@inkeep/open-knowledge 0.88.6-beta.3 → 0.88.6-beta.5
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/alias-JE7RI5QX-D_KITrCa.mjs +1 -0
- package/dist/assets/skills/project/references/ingest-and-sources.md +1 -1
- package/dist/awk2-BBAGSFUB-CehlsFZ5.mjs +1 -0
- package/dist/bash-IJWYRKFO-D1gJZuWH.mjs +1 -0
- package/dist/chokidar-D0G-K3zc.mjs +3 -0
- package/dist/{chunk-3BS5SKQH-C9C8uLJE.mjs → chunk-3BS5SKQH-CKmQMz_L.mjs} +15 -15
- package/dist/{chunk-62RKD26F-Bv6peUyf.mjs → chunk-62RKD26F-B6OssxCM.mjs} +3 -3
- package/dist/{chunk-6Z5SFZXK-CiQN8zZ8.mjs → chunk-6Z5SFZXK-D2_6X1Dn.mjs} +35 -35
- package/dist/chunk-A4JSPFCI-DQxLkrTb.mjs +6 -0
- package/dist/chunk-D6CWQ5DW-BybImdUI.mjs +5 -0
- package/dist/chunk-GOV5EKKI-D42P07Xu.mjs +9 -0
- package/dist/{chunk-HKLCLINH-BHo2f5d2.mjs → chunk-HKLCLINH-C2rvDMlW.mjs} +20 -20
- package/dist/{chunk-HL6NGDO2-BFPiiJBP.mjs → chunk-HL6NGDO2-CvsVMff5.mjs} +9 -9
- package/dist/{chunk-I57KEIP3-C90kULU7.mjs → chunk-I57KEIP3-BrnLL4Gl.mjs} +4 -4
- package/dist/{chunk-K6LIBGJA-D-bMYdgr.mjs → chunk-K6LIBGJA-CN_13h4C.mjs} +7 -7
- package/dist/{chunk-KRBPSX3W-DXuvylLd.mjs → chunk-KRBPSX3W-CY8FCKFm.mjs} +2 -2
- package/dist/chunk-MDDMCKUK-ByCsPSNd.mjs +6 -0
- package/dist/chunk-MIZPJHVH-DrIwZ3F_.mjs +7 -0
- package/dist/chunk-NAERJDUW-nfjIZ3Pb.mjs +8 -0
- package/dist/chunk-NUYSJFDK-M0xrw_uS.mjs +7 -0
- package/dist/chunk-OCLXQMOG-DHLmxiVS.mjs +6 -0
- package/dist/{chunk-OCS6LSEM-BBT5tk28.mjs → chunk-OCS6LSEM-CUgQNrT_.mjs} +7 -7
- package/dist/{chunk-PBXLG62G-G7lHqZ9p.mjs → chunk-PBXLG62G-CuixUdAo.mjs} +3 -3
- package/dist/{chunk-T56QNPHK-BuLSSwpV.mjs → chunk-T56QNPHK-BhobE-0w.mjs} +3 -3
- package/dist/chunk-TLSUDHID-BpXt2GFu.mjs +6 -0
- package/dist/{chunk-TOMNU26N-CPb3jib2.mjs → chunk-TOMNU26N-Bhlbw7_h.mjs} +3 -3
- package/dist/{chunk-TP4BZANS-BKDDD1i2.mjs → chunk-TP4BZANS-Dv2qAxWh.mjs} +12 -12
- package/dist/{chunk-XKWWSDBF-CiyukTrj.mjs → chunk-XKWWSDBF-COm-Bab0.mjs} +10 -10
- package/dist/{chunk-YMMW5UAP-B7swMNER.mjs → chunk-YMMW5UAP-CTA9rr10.mjs} +7 -7
- package/dist/chunk-YTNYSM6T-gRMum0pq.mjs +11 -0
- package/dist/{chunk-YULBWSET-BjwIKz2I.mjs → chunk-YULBWSET-BZbeBpnM.mjs} +6 -6
- package/dist/{chunk-Z6LRHWXI-B5pNb54L.mjs → chunk-Z6LRHWXI-BE3EMa92.mjs} +5 -5
- package/dist/{chunk-ZZO3UDB3-Dr2Q2MNF.mjs → chunk-ZZO3UDB3-C92Poglu.mjs} +32 -32
- package/dist/cli-DtqA8k1H.mjs +110 -0
- package/dist/cli.mjs +1 -110
- package/dist/constants-D-73L_8T.mjs +1 -0
- package/dist/constants-ok-dir-DZ25OS9-.mjs +115 -0
- package/dist/{cp-XOYR4ABJ-BWvobbqd.mjs → cp-XOYR4ABJ-KRhRq3W9.mjs} +1 -1
- package/dist/{curl-47BFPSFW-CjxwhFSt.mjs → curl-47BFPSFW-D1cYHIfa.mjs} +8 -8
- package/dist/{diff-HJF2MPDN-B5Vu5bd_.mjs → diff-HJF2MPDN-CLb1d3Pm.mjs} +1 -1
- package/dist/dist-D4ipyg1q.mjs +1 -0
- package/dist/{dist-Br5t34YL.mjs → dist-DPe6aLSk.mjs} +518 -522
- package/dist/env-5EPCWSXR-B6cYhau7.mjs +1 -0
- package/dist/expansion-VBDYWVZR-vhATs2YP.mjs +1 -0
- package/dist/expr-YYCVMXE3-BG-gQLPe.mjs +1 -0
- package/dist/{file-IGDTDPLG-CRy1Omyh.mjs → file-IGDTDPLG-CqcQiax7.mjs} +1 -1
- package/dist/find-DH2ALKQS-DUCbwSBg.mjs +1 -0
- package/dist/flag-coverage-6JEX67RU-BgXRRqNM.mjs +1 -0
- package/dist/fs-find-project-root-BYV07wjn.mjs +5 -0
- package/dist/git-credential-get-BOA4DNNp.mjs +2 -0
- package/dist/git-credential-helper-DY8W25nc.mjs +1 -0
- package/dist/git-credential-operation-9lLcCrJB.mjs +1 -0
- package/dist/grep-2HUTXO5U-CbvcQZdY.mjs +1 -0
- package/dist/index.mjs +302 -302
- package/dist/{init-CFqa1MvX.mjs → init-C08CTCp9.mjs} +28 -28
- package/dist/init-CSYVvJYZ.mjs +1 -0
- package/dist/jq-LYZFFBZB-DP4gih1P.mjs +1 -0
- package/dist/{js-exec-VXN6TZ7U-Z8_USGOo.mjs → js-exec-VXN6TZ7U-B4rL1N_3.mjs} +4 -4
- package/dist/{js-exec-VXN6TZ7U-D--44jnh.mjs → js-exec-VXN6TZ7U-CByMmXZz.mjs} +8 -8
- package/dist/launch-json-removal-B39BoBBe.mjs +1 -0
- package/dist/{lib-CxwDRGVJ.mjs → lib-CGyiYSWt.mjs} +15 -15
- package/dist/{ln-4TRFBYAT-xkfE7-89.mjs → ln-4TRFBYAT-RK1Uvly1.mjs} +1 -1
- package/dist/loader-D4dq2xfA.mjs +1 -0
- package/dist/loader-DeOCcx0c.mjs +1 -0
- package/dist/{lzma-CEMDJHEs.mjs → lzma-B6QS2aZK.mjs} +2 -2
- package/dist/{lzma-PPHiE419.mjs → lzma-VPfz3anC.mjs} +1 -1
- package/dist/md-manager-BGnqyqi1-DmEmjhMs.mjs +400 -0
- package/dist/{mkdir-TDEMSB6C-DKSMdaAE.mjs → mkdir-TDEMSB6C-Ds9y3YxN.mjs} +1 -1
- package/dist/{mv-Z6MORUFL-C-C4Dr_j.mjs → mv-Z6MORUFL-C9ixK1Sz.mjs} +1 -1
- package/dist/{open-browser-BgcinSRG.mjs → open-browser-d8GjenQK.mjs} +1 -1
- package/dist/parse-worker.mjs +1 -1
- package/dist/preview-BD9T555q.mjs +1 -0
- package/dist/preview-BOmvdi0o.mjs +2 -0
- package/dist/printf-CX64KX2P-DlBDp9me.mjs +1 -0
- package/dist/public/assets/{AccountSection-LJRd8sB4.js → AccountSection-UK4fSEAo.js} +1 -1
- package/dist/public/assets/{ActivityModeContent-CQSexLMh.js → ActivityModeContent-CD3FGIx9.js} +1 -1
- package/dist/public/assets/{AddPropertiesButton-CFKmvgxU.js → AddPropertiesButton-B6p_gdr8.js} +1 -1
- package/dist/public/assets/{AgentDiffPane-_ihWGbD_.js → AgentDiffPane-DkoQ7ai2.js} +1 -1
- package/dist/public/assets/{AttachmentsSection-DBsgV2Bw.js → AttachmentsSection-B4oQIzeZ.js} +1 -1
- package/dist/public/assets/{CodeMirrorPropInput-CijXVQab.js → CodeMirrorPropInput-B9s5B9Bw.js} +2 -2
- package/dist/public/assets/{ContentRulesSection-C6MePblA.js → ContentRulesSection-aWJrYA4j.js} +1 -1
- package/dist/public/assets/{DocumentContext-Ckv8SUWG.js → DocumentContext-DXpWi5ky.js} +2 -2
- package/dist/public/assets/{EditorModeToggle-N2hyqb1I.js → EditorModeToggle-Diya7MyF.js} +1 -1
- package/dist/public/assets/{ExcalidrawDocEditor-CP2HLZRg.js → ExcalidrawDocEditor-PRwr0WYf.js} +1 -1
- package/dist/public/assets/FeedbackForm-Cvqd9EXq.js +1 -0
- package/dist/public/assets/{ImportSkillDialog-B6FRcFBN.js → ImportSkillDialog-CMk2xlCO.js} +1 -1
- package/dist/public/assets/{LinkPreviewsSection-C4BQkoW1.js → LinkPreviewsSection-KX_4h53c.js} +1 -1
- package/dist/public/assets/{LintConfigEditor-BZ5RnGQH.js → LintConfigEditor-7ZtCVw7Y.js} +1 -1
- package/dist/public/assets/{LintingSection-gYcf6zSw.js → LintingSection-ClAY_FjD.js} +1 -1
- package/dist/public/assets/ManagedArtifactProperties-C6A9h_XM.js +1 -0
- package/dist/public/assets/{ManagedArtifactProperties-7BpPCdWC.js → ManagedArtifactProperties-lEwwds9N.js} +1 -1
- package/dist/public/assets/{MermaidDocEditor-D8S17k_t.js → MermaidDocEditor-DHUtun4r.js} +1 -1
- package/dist/public/assets/{NetworkAccessSection-CfSEDmXg.js → NetworkAccessSection-CkW30CIT.js} +1 -1
- package/dist/public/assets/{PropertyDisplayRow-BoNQImBU.js → PropertyDisplayRow-D6c0dfSa.js} +1 -1
- package/dist/public/assets/{PublishToGitHubDialog-Bc5NpD70.js → PublishToGitHubDialog-CwF7zH2X.js} +1 -1
- package/dist/public/assets/{SchemaConfigEditor-DXzybru5.js → SchemaConfigEditor-BEJxtFtu.js} +1 -1
- package/dist/public/assets/{SearchSection-C19oEXnN.js → SearchSection-CDyx2C9f.js} +1 -1
- package/dist/public/assets/{SessionsHost-Dq18GV-Q.js → SessionsHost-H5NLeN9a.js} +2 -2
- package/dist/public/assets/{SettingsDialogBody-CKMzthec.js → SettingsDialogBody-C_YjecBu.js} +2 -2
- package/dist/public/assets/{ShareReceiveMissDialog-CjeRKStG.js → ShareReceiveMissDialog-D_FkOpht.js} +1 -1
- package/dist/public/assets/{SkillToolbarControls-Bw0kbj8T.js → SkillToolbarControls-CtxNLAp-.js} +1 -1
- package/dist/public/assets/{SourceEditor-Cdd0XUzF.js → SourceEditor-B5LnWxyf.js} +1 -1
- package/dist/public/assets/{SpellingSettings-D39D0V93.js → SpellingSettings-05EGR87o.js} +1 -1
- package/dist/public/assets/{SyncSection-uN1z_93L.js → SyncSection-D3PTVWIM.js} +1 -1
- package/dist/public/assets/{SyncStatusBadge-DKqP2nFA.js → SyncStatusBadge-BaJrZaL1.js} +1 -1
- package/dist/public/assets/{TerminalSection-OQKUYevA.js → TerminalSection-CsRkbMx2.js} +1 -1
- package/dist/public/assets/{TerminalWindowApp-CYJ1Jbl1.js → TerminalWindowApp-CA9GKqNE.js} +1 -1
- package/dist/public/assets/{TextDocEditor-O7zcpBhs.js → TextDocEditor-Ch27GvYs.js} +1 -1
- package/dist/public/assets/{ThemePluginSection-DvDmnFk0.js → ThemePluginSection-_vipA-fZ.js} +1 -1
- package/dist/public/assets/{ThreadView-DXAtEUVo.js → ThreadView-Dj6jQfOU.js} +1 -1
- package/dist/public/assets/{TimelineDiffPane-DfckigW2.js → TimelineDiffPane-4gPranZj.js} +1 -1
- package/dist/public/assets/{client-version-BJc8f8RK.js → client-version-B_xA5Zs6.js} +1 -1
- package/dist/public/assets/{comment-chips-D5QcVI38.js → comment-chips-nSpyi8g5.js} +1 -1
- package/dist/public/assets/{config-provider-B2uReVA0.js → config-provider-CNRgcd7O.js} +1 -1
- package/dist/public/assets/config-schema-BiXW8bgJ.js +1 -0
- package/dist/public/assets/{doc-undo-manager-eVCrXF_j.js → doc-undo-manager-mWX4_oGV.js} +1 -1
- package/dist/public/assets/{field-controls-BUVPC8fp.js → field-controls-7BMlpso-.js} +1 -1
- package/dist/public/assets/field-controls-Bx5mePuq.js +1 -0
- package/dist/public/assets/{index-DixZkzDK.js → index-DvFhVjVJ.js} +7 -7
- package/dist/public/assets/{lint-config-client-IECAMEY0.js → lint-config-client-CE9biPJr.js} +1 -1
- package/dist/public/assets/{lint-plugins-BkTeSxCo.js → lint-plugins-DAx86XSh.js} +1 -1
- package/dist/public/assets/{markdown-lint-Gr2dt_mE.js → markdown-lint-BU1ReVdL.js} +1 -1
- package/dist/public/assets/{markdownlint-rule-browser-BPUY-_hO.js → markdownlint-rule-browser-CX5Nb4yK.js} +1 -1
- package/dist/public/assets/messages-3TywIfo0.js +1 -0
- package/dist/public/assets/messages-60dgDSH4.js +1 -0
- package/dist/public/assets/messages-9vrrNpJf.js +1 -0
- package/dist/public/assets/messages-B-A9_jul.js +1 -0
- package/dist/public/assets/messages-B4Eyfdod.js +1 -0
- package/dist/public/assets/messages-BsQXyfTQ.js +1 -0
- package/dist/public/assets/messages-CIj-vRyV.js +1 -0
- package/dist/public/assets/messages-CZbBFMhU.js +1 -0
- package/dist/public/assets/messages-D5Q2aWu3.js +1 -0
- package/dist/public/assets/messages-D6ypArrS.js +1 -0
- package/dist/public/assets/messages-Zpi3sLU2.js +1 -0
- package/dist/public/assets/messages-lMmvlKg7.js +1 -0
- package/dist/public/assets/messages-yXb-shTo.js +1 -0
- package/dist/public/assets/{pending-receive-nav-store-Iv87HrBp.js → pending-receive-nav-store-hbWxGWbG.js} +1 -1
- package/dist/public/assets/{preferred-session-events-xfa2uZrO.js → preferred-session-events-CD3TX4uI.js} +1 -1
- package/dist/public/assets/{progress-BrArAZHf.js → progress-Bp-8Nd7B.js} +1 -1
- package/dist/public/assets/{saved-themes-client-CERsocAi.js → saved-themes-client-Cefq8Snw.js} +1 -1
- package/dist/public/assets/{schema-section-DxwzENze.js → schema-section-BTjV9wCm.js} +1 -1
- package/dist/public/assets/{selection-context-Dbqj5HIF.js → selection-context-C7DBYtd4.js} +1 -1
- package/dist/public/assets/{src-CY4cyl93.js → src-Bd4ITI6l.js} +1 -1
- package/dist/public/assets/{telemetry-impl-CzmRwkV2.js → telemetry-impl-D34TS_t5.js} +1 -1
- package/dist/public/assets/{telemetry-startup-6UOhK4H3.js → telemetry-startup-S6YVb_-D.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-43TkkCGr.js → typing-burst-detector-BPhBcJhO.js} +1 -1
- package/dist/public/assets/{uninstall-Drxc7ooZ.js → uninstall-CBADj29y.js} +1 -1
- package/dist/public/assets/{use-activity-panel-Bqo7iLoL.js → use-activity-panel-DAiQAul-.js} +1 -1
- package/dist/public/assets/{use-apply-config-language-DWhramML.js → use-apply-config-language-BVhx79Sp.js} +2 -2
- package/dist/public/assets/{use-open-skill-DiaFh1sV.js → use-open-skill-BiGTEBAG.js} +1 -1
- package/dist/public/assets/{use-terminal-enabled-D67U-_lT.js → use-terminal-enabled-BPFt3ZjV.js} +1 -1
- package/dist/public/assets/{use-timeline-entry-diff-KpbAdkg7.js → use-timeline-entry-diff-DI6wb0mp.js} +1 -1
- package/dist/public/index.html +24 -24
- package/dist/public/uninstall.html +3 -3
- package/dist/python3-DNGS4G3E-BgcDJ4cm.mjs +11 -0
- package/dist/{python3-DNGS4G3E-CixyRGKv.mjs → python3-DNGS4G3E-Cm5Hwa-u.mjs} +3 -3
- package/dist/registry-probes-CQ5QHLWA.mjs +16 -0
- package/dist/{removal-file-path-BB7PGKh9.mjs → removal-file-path-DhnfL9uo.mjs} +1 -1
- package/dist/{repair-launch-json-BGnKoX_8.mjs → repair-launch-json-D4tGRImu.mjs} +1 -1
- package/dist/{repair-mcp-configs-CnuXQsDL.mjs → repair-mcp-configs-CkXUYNJq.mjs} +1 -1
- package/dist/rg-XNF3R3II-BCapXTDd.mjs +1 -0
- package/dist/{rm-RTZG23RL-CVxZCS0d.mjs → rm-RTZG23RL-pdC15ghA.mjs} +1 -1
- package/dist/{rmdir-XTQXT7RK-DnFOfz6J.mjs → rmdir-XTQXT7RK-DcllfdyA.mjs} +1 -1
- package/dist/sed-JAPPVBEU-BogTEm4c.mjs +1 -0
- package/dist/{sleep-VZFPZFWA-C-QGmlTD.mjs → sleep-VZFPZFWA-Z-cEwS7i.mjs} +1 -1
- package/dist/sqlite3-TE5AIOTF-DqoN8a9C.mjs +1 -0
- package/dist/{sqlite3-TE5AIOTF-DVwda1Ow.mjs → sqlite3-TE5AIOTF-DxxxT49W.mjs} +3 -3
- package/dist/src-DxORHPwx.mjs +1 -0
- package/dist/src-uYPRavFi.mjs +16 -0
- package/dist/start-BVplvpm0.mjs +5 -0
- package/dist/start-Dp7OVBDP.mjs +1 -0
- package/dist/tar-MZQD7NO4-DEw7Py1-.mjs +1 -0
- package/dist/{tar-MZQD7NO4-BRGDcHqv.mjs → tar-MZQD7NO4-ljX84Spn.mjs} +2 -2
- package/dist/time-DEUO3QV2-BdkhaszE.mjs +1 -0
- package/dist/{timeout-VRKMCG72-Bn-zPLw8.mjs → timeout-VRKMCG72-BJshiKR9.mjs} +1 -1
- package/dist/token-store-Bmb3_0hU.mjs +2 -0
- package/dist/touch-DX2IJOQ4-DQk2E3PA.mjs +1 -0
- package/dist/{tr-2HXZRDSW-D6nqhlWa.mjs → tr-2HXZRDSW-B9XzLO_W.mjs} +1 -1
- package/dist/xan-UD7JYIL2-B0nl-bKu.mjs +1 -0
- package/dist/xargs-I6EZUCYF-DyMYQH4H.mjs +1 -0
- package/dist/yq-OAKYHSXH-BuWuWli6.mjs +1 -0
- package/package.json +4 -4
- package/dist/alias-JE7RI5QX-DJCUhA0w.mjs +0 -1
- package/dist/awk2-BBAGSFUB-e61UM1Y8.mjs +0 -1
- package/dist/bash-IJWYRKFO-L9NsSg-G.mjs +0 -1
- package/dist/chokidar-BXdru135.mjs +0 -3
- package/dist/chunk-A4JSPFCI-Ywh1N_m_.mjs +0 -6
- package/dist/chunk-D6CWQ5DW-CWPsf9FV.mjs +0 -5
- package/dist/chunk-GOV5EKKI-DH8052og.mjs +0 -9
- package/dist/chunk-MDDMCKUK-B8V-vwhF.mjs +0 -6
- package/dist/chunk-MIZPJHVH-D45kCv1L.mjs +0 -7
- package/dist/chunk-NAERJDUW-g_zD_t_X.mjs +0 -8
- package/dist/chunk-NUYSJFDK-C3CfS8pU.mjs +0 -7
- package/dist/chunk-OCLXQMOG-BgcVHeKY.mjs +0 -6
- package/dist/chunk-TLSUDHID-BY7gVdyC.mjs +0 -6
- package/dist/chunk-YTNYSM6T-3WjLDS_v.mjs +0 -11
- package/dist/constants-qWODYpdZ.mjs +0 -1
- package/dist/dist-DFlcDcjF.mjs +0 -1
- package/dist/env-5EPCWSXR-hkmWHgd5.mjs +0 -1
- package/dist/expansion-VBDYWVZR-CPnYsIZl.mjs +0 -1
- package/dist/expr-YYCVMXE3-DtiMaNQl.mjs +0 -1
- package/dist/find-DH2ALKQS-44-asZtW.mjs +0 -1
- package/dist/flag-coverage-6JEX67RU-CvfAS1f3.mjs +0 -1
- package/dist/grep-2HUTXO5U-CoGVhBxG.mjs +0 -1
- package/dist/init-D5UpQ70d.mjs +0 -1
- package/dist/jq-LYZFFBZB-CXMPfDWj.mjs +0 -1
- package/dist/launch-json-removal-BiiU2YFK.mjs +0 -1
- package/dist/loader-B2fGi6oQ.mjs +0 -1
- package/dist/loader-CpSE6Pb3.mjs +0 -1
- package/dist/md-manager-BGnqyqi1-COpgRhOl.mjs +0 -514
- package/dist/preview-DSJofhni.mjs +0 -1
- package/dist/preview-W1qLrOTN.mjs +0 -2
- package/dist/printf-CX64KX2P-zCdxSgaG.mjs +0 -1
- package/dist/public/assets/FeedbackForm-DvbVD7xY.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-C21i-wVX.js +0 -1
- package/dist/public/assets/config-schema-JSuM1ay_.js +0 -1
- package/dist/public/assets/field-controls-DceP36U9.js +0 -1
- package/dist/public/assets/messages--JE1r0oK.js +0 -1
- package/dist/public/assets/messages-BPDRauYd.js +0 -1
- package/dist/public/assets/messages-Bw510bJG.js +0 -1
- package/dist/public/assets/messages-By-SAk_o.js +0 -1
- package/dist/public/assets/messages-C9dO0WcF.js +0 -1
- package/dist/public/assets/messages-CE48fdcx.js +0 -1
- package/dist/public/assets/messages-CQaF3pLd.js +0 -1
- package/dist/public/assets/messages-D-qO9G0a.js +0 -1
- package/dist/public/assets/messages-D4HWBQCW.js +0 -1
- package/dist/public/assets/messages-DE6pzo9b.js +0 -1
- package/dist/public/assets/messages-Dy13fRcA.js +0 -1
- package/dist/public/assets/messages-JfpWPtsW.js +0 -1
- package/dist/public/assets/messages-q-WCQc2m.js +0 -1
- package/dist/python3-DNGS4G3E-CRyO5yp1.mjs +0 -11
- package/dist/registry-probes-DwE2ywLj.mjs +0 -17
- package/dist/rg-XNF3R3II-ClllMprJ.mjs +0 -1
- package/dist/sed-JAPPVBEU-D49-i6JC.mjs +0 -1
- package/dist/sqlite3-TE5AIOTF-BK092fD6.mjs +0 -1
- package/dist/src-CMSKsmsA.mjs +0 -1
- package/dist/src-CbDiPIIp.mjs +0 -16
- package/dist/start-Bs7pMN0A.mjs +0 -5
- package/dist/start-Dx5wqmPM.mjs +0 -1
- package/dist/tar-MZQD7NO4-D__44nPJ.mjs +0 -1
- package/dist/time-DEUO3QV2-BAt2bzlP.mjs +0 -1
- package/dist/touch-DX2IJOQ4-BJTz2DiT.mjs +0 -1
- package/dist/xan-UD7JYIL2-IybnHHpT.mjs +0 -1
- package/dist/xargs-I6EZUCYF-CpVYZvg1.mjs +0 -1
- package/dist/yq-OAKYHSXH-kqRGBS-8.mjs +0 -1
|
@@ -0,0 +1,400 @@
|
|
|
1
|
+
import{i as e,o as t,r as n,t as r}from"./rolldown-runtime-tZXQYakl.mjs";import{C as i,O as a,d as o,k as s,m as c,p as l,t as u,u as d,v as f,x as p}from"./constants-ok-dir-DZ25OS9-.mjs";import{i as m,n as h,p as g}from"./esm-B3YyV3nD.mjs";import{n as _,t as v}from"./markdownit-Ce3k05MZ.mjs";import{fileURLToPath as y}from"node:url";import b from"node:path";import x from"node:process";import{access as S,accessSync as C,readFile as w,readFileSync as T}from"node:fs";import{EOL as ee,homedir as te}from"node:os";const ne=[`claude`,`claude-desktop`,`cursor`,`codex`,`copilot`,`opencode`,`openclaw`,`pi`,`antigravity`,`lm-studio`,`hermes`],re={claude:`Claude`,"claude-desktop":`Claude Desktop`,cursor:`Cursor`,codex:`Codex`,copilot:`GitHub Copilot`,opencode:`OpenCode`,openclaw:`OpenClaw`,pi:`Pi`,antigravity:`Antigravity`,"lm-studio":`LM Studio`,hermes:`Hermes`},ie={claude:`.claude/skills`,"claude-desktop":null,cursor:`.cursor/skills`,codex:`.codex/skills`,copilot:`.github/skills`,opencode:`.opencode/skills`,openclaw:null,pi:`.pi/skills`,antigravity:null,"lm-studio":null,hermes:null},ae={claude:`.claude/skills`,"claude-desktop":null,cursor:`.cursor/skills`,codex:`.codex/skills`,copilot:`.copilot/skills`,opencode:`.opencode/skills`,openclaw:null,pi:`.pi/agent/skills`,antigravity:`.gemini/skills`,"lm-studio":`.lmstudio/skills`,hermes:null},oe=[{editorId:`lm-studio`,dotDir:`.lmstudio`,scope:`project`},{editorId:`openclaw`,dotDir:`.openclaw`,scope:`global`}],se=new Set([`.github`]);function ce(e){let t=e.split(`/`)[0]??e;return se.has(t)?e:t}const le=ne.filter(e=>ie[e]!==null),ue=ne.filter(e=>ae[e]!==null),E=`open-knowledge`,de=ne.flatMap(e=>{let t=ie[e];return t===null?[]:[`${t}/${E}/`]}),fe=le.filter(e=>e!==`pi`&&e!==`copilot`).map(e=>({hostDir:(ie[e]??``).split(`/`)[0],editorId:e})),pe=ne.flatMap(e=>{let t=ae[e];if(t===null)return[];let n=t.split(`/`)[0];return n===void 0?[]:[{hostDir:n,skillsRoot:t,editorId:e}]}),D={claude:`claude-code`,"claude-desktop":`claude-code`,cursor:`cursor`,codex:`codex`,copilot:`github-copilot-cli`,opencode:`opencode`,openclaw:`openclaw`,pi:`pi`,antigravity:`antigravity`,"lm-studio":`lm-studio`,hermes:`hermes`};function O(e){return`.pi/extensions/${e.mcpServerName}.ts`}function me(e){return`ok${e.mcpChainTag}`}const he={claude:`.mcp.json`,"claude-desktop":null,cursor:`.cursor/mcp.json`,codex:`.codex/config.toml`,copilot:null,opencode:`opencode.json`,openclaw:null,pi:O(i.stable),antigravity:null,"lm-studio":null,hermes:null};function ge(e,t){return e===`pi`?O(t):he[e]}const _e=[`copilot`];function ve(e){return`'${e.replace(/'/g,`'\\''`)}'`}const ye=/^[A-Za-z_][A-Za-z0-9_]*$/;function be(e){return ye.test(e)&&!e.toUpperCase().startsWith(`OK_TERMINAL_LAUNCH_ENV_`)}const xe=[`delete`,`move`,`share_link`,`install`,`import`],Se=[`claude`,`codex`,`opencode`,`cursor`,`copilot`,`pi`,`antigravity`,`openclaw`,`hermes`];var Ce;const we=Object.freeze({status:`aborted`});function k(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}var Te=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Ee=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(Ce=globalThis).__zod_globalConfig??(Ce.__zod_globalConfig={});const De=globalThis.__zod_globalConfig;function Oe(e){return e&&Object.assign(De,e),De}function ke(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function Ae(e,t){return typeof t==`bigint`?t.toString():t}function je(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Me(e){return e==null}function Ne(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function Pe(e,t){let n=e/t,r=Math.round(n),i=2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}const Fe=Symbol(`evaluating`);function Ie(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Fe)return r===void 0&&(r=Fe,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Le(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Re(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function ze(e){return JSON.stringify(e)}function Be(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}const Ve=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function He(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const Ue=je(()=>{if(De.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function We(e){if(He(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return He(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function Ge(e){return We(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const Ke=new Set([`string`,`number`,`symbol`]);function qe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Je(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function A(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function Ye(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}const Xe={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Ze(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return Je(e,Re(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return Le(this,`shape`,e),e},checks:[]}))}function Qe(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return Je(e,Re(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return Le(this,`shape`,r),r},checks:[]}))}function $e(e,t){if(!We(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Je(e,Re(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Le(this,`shape`,n),n}}))}function et(e,t){if(!We(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return Je(e,Re(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Le(this,`shape`,n),n}}))}function tt(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return Je(e,Re(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return Le(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function nt(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return Je(t,Re(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return Le(this,`shape`,i),i},checks:[]}))}function rt(e,t,n){return Je(t,Re(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return Le(this,`shape`,i),i}}))}function it(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function at(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function ot(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function st(e){return typeof e==`string`?e:e?.message}function ct(e,t,n){let r=e.message?e.message:st(e.inst?._zod.def?.error?.(e))??st(t?.error?.(e))??st(n.customError?.(e))??st(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??=[],s.message=r,t?.reportInput&&(s.input=o),s}function lt(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function ut(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}const dt=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Ae,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},ft=k(`$ZodError`,dt),pt=k(`$ZodError`,dt,{Parent:Error});function mt(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function ht(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i];i===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(a))):r[n]=r[n]||{_errors:[]},r=r[n],i++}}}};return r(e),n}function eee(e){let t=[],n=e.map(e=>typeof e==`object`?e.key:e);for(let e of n)typeof e==`number`?t.push(`[${e}]`):typeof e==`symbol`?t.push(`[${JSON.stringify(String(e))}]`):/[^\w$]/.test(e)?t.push(`[${JSON.stringify(e)}]`):(t.length&&t.push(`.`),t.push(e));return t.join(``)}function gt(e){let t=[],n=[...e.issues].sort((e,t)=>(e.path??[]).length-(t.path??[]).length);for(let e of n)t.push(`✖ ${e.message}`),e.path?.length&&t.push(` → at ${eee(e.path)}`);return t.join(`
|
|
2
|
+
`)}const _t=e=>(t,n,r,i)=>{let a=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new Te;if(o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>ct(e,a,Oe())));throw Ve(t,i?.callee),t}return o.value},vt=_t(pt),yt=e=>async(t,n,r,i)=>{let a=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>ct(e,a,Oe())));throw Ve(t,i?.callee),t}return o.value},bt=yt(pt),xt=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new Te;return a.issues.length?{success:!1,error:new(e??ft)(a.issues.map(e=>ct(e,i,Oe())))}:{success:!0,data:a.value}},St=xt(pt),Ct=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>ct(e,i,Oe())))}:{success:!0,data:a.value}},wt=Ct(pt),tee=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return _t(e)(t,n,i)},nee=e=>(t,n,r)=>_t(e)(t,n,r),Tt=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return yt(e)(t,n,i)},Et=e=>async(t,n,r)=>yt(e)(t,n,r),ree=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return xt(e)(t,n,i)},Dt=e=>(t,n,r)=>xt(e)(t,n,r),Ot=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Ct(e)(t,n,i)},kt=e=>async(t,n,r)=>Ct(e)(t,n,r),At=/^[cC][0-9a-z]{6,}$/,jt=/^[0-9a-z]+$/,Mt=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Nt=/^[0-9a-vA-V]{20}$/,Pt=/^[A-Za-z0-9]{27}$/,Ft=/^[a-zA-Z0-9_-]{21}$/,It=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Lt=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Rt=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,zt=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;function Bt(){return RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`)}const Vt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Ht=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,iee=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,aee=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,oee=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ut=/^[A-Za-z0-9_-]*$/,Wt=/^https?$/,Gt=/^\+[1-9]\d{6,14}$/,Kt=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,qt=RegExp(`^${Kt}$`);function Jt(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Yt(e){return RegExp(`^${Jt(e)}$`)}function Xt(e){let t=Jt({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${Kt}T(?:${r})$`)}const Zt=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},Qt=/^-?\d+$/,$t=/^-?\d+(?:\.\d+)?$/,en=/^(?:true|false)$/i,tn=/^null$/i,nn=/^[^A-Z]*$/,rn=/^[^a-z]*$/,an=k(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),on={number:`number`,bigint:`bigint`,object:`date`},sn=k(`$ZodCheckLessThan`,(e,t)=>{an.init(e,t);let n=on[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),cn=k(`$ZodCheckGreaterThan`,(e,t)=>{an.init(e,t);let n=on[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ln=k(`$ZodCheckMultipleOf`,(e,t)=>{an.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):Pe(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),un=k(`$ZodCheckNumberFormat`,(e,t)=>{an.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=Xe[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=Qt)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),dn=k(`$ZodCheckMaxLength`,(e,t)=>{var n;an.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Me(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=lt(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),fn=k(`$ZodCheckMinLength`,(e,t)=>{var n;an.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Me(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=lt(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),pn=k(`$ZodCheckLengthEquals`,(e,t)=>{var n;an.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Me(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=lt(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),mn=k(`$ZodCheckStringFormat`,(e,t)=>{var n,r;an.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),hn=k(`$ZodCheckRegex`,(e,t)=>{mn.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),gn=k(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=nn,mn.init(e,t)}),_n=k(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=rn,mn.init(e,t)}),vn=k(`$ZodCheckIncludes`,(e,t)=>{an.init(e,t);let n=qe(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),yn=k(`$ZodCheckStartsWith`,(e,t)=>{an.init(e,t);let n=RegExp(`^${qe(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),bn=k(`$ZodCheckEndsWith`,(e,t)=>{an.init(e,t);let n=RegExp(`.*${qe(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),xn=k(`$ZodCheckOverwrite`,(e,t)=>{an.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});var Sn=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
3
|
+
`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
|
|
4
|
+
`))}};const Cn={major:4,minor:4,patch:3},wn=k(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Cn;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=it(e),i;for(let a of t){if(a._zod.def.when){if(at(e)||!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new Te;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=it(e,t))});else{if(e.issues.length===t)continue;r||=it(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(it(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new Te;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new Te;return o.then(e=>t(e,r,a))}return t(o,r,a)}}Ie(e,`~standard`,()=>({validate:t=>{try{let n=St(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return wt(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),Tn=k(`$ZodString`,(e,t)=>{wn.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Zt(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),En=k(`$ZodStringFormat`,(e,t)=>{mn.init(e,t),Tn.init(e,t)}),Dn=k(`$ZodGUID`,(e,t)=>{t.pattern??=Lt,En.init(e,t)}),On=k(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=Rt(e)}else t.pattern??=Rt();En.init(e,t)}),kn=k(`$ZodEmail`,(e,t)=>{t.pattern??=zt,En.init(e,t)}),An=k(`$ZodURL`,(e,t)=>{En.init(e,t),e._zod.check=n=>{try{let r=n.value.trim();if(!t.normalize&&t.protocol?.source===Wt.source&&!/^https?:\/\//i.test(r)){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}let i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),n.value=t.normalize?i.href:r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),jn=k(`$ZodEmoji`,(e,t)=>{t.pattern??=Bt(),En.init(e,t)}),Mn=k(`$ZodNanoID`,(e,t)=>{t.pattern??=Ft,En.init(e,t)}),Nn=k(`$ZodCUID`,(e,t)=>{t.pattern??=At,En.init(e,t)}),Pn=k(`$ZodCUID2`,(e,t)=>{t.pattern??=jt,En.init(e,t)}),Fn=k(`$ZodULID`,(e,t)=>{t.pattern??=Mt,En.init(e,t)}),In=k(`$ZodXID`,(e,t)=>{t.pattern??=Nt,En.init(e,t)}),Ln=k(`$ZodKSUID`,(e,t)=>{t.pattern??=Pt,En.init(e,t)}),Rn=k(`$ZodISODateTime`,(e,t)=>{t.pattern??=Xt(t),En.init(e,t)}),zn=k(`$ZodISODate`,(e,t)=>{t.pattern??=qt,En.init(e,t)}),Bn=k(`$ZodISOTime`,(e,t)=>{t.pattern??=Yt(t),En.init(e,t)}),Vn=k(`$ZodISODuration`,(e,t)=>{t.pattern??=It,En.init(e,t)}),Hn=k(`$ZodIPv4`,(e,t)=>{t.pattern??=Vt,En.init(e,t),e._zod.bag.format=`ipv4`}),Un=k(`$ZodIPv6`,(e,t)=>{t.pattern??=Ht,En.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),Wn=k(`$ZodCIDRv4`,(e,t)=>{t.pattern??=iee,En.init(e,t)}),Gn=k(`$ZodCIDRv6`,(e,t)=>{t.pattern??=aee,En.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function Kn(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const qn=k(`$ZodBase64`,(e,t)=>{t.pattern??=oee,En.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{Kn(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function Jn(e){if(!Ut.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Kn(t.padEnd(Math.ceil(t.length/4)*4,`=`))}const Yn=k(`$ZodBase64URL`,(e,t)=>{t.pattern??=Ut,En.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{Jn(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Xn=k(`$ZodE164`,(e,t)=>{t.pattern??=Gt,En.init(e,t)});function Zn(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}const Qn=k(`$ZodJWT`,(e,t)=>{En.init(e,t),e._zod.check=n=>{Zn(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),$n=k(`$ZodNumber`,(e,t)=>{wn.init(e,t),e._zod.pattern=e._zod.bag.pattern??$t,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),er=k(`$ZodNumberFormat`,(e,t)=>{un.init(e,t),$n.init(e,t)}),tr=k(`$ZodBoolean`,(e,t)=>{wn.init(e,t),e._zod.pattern=en,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),nr=k(`$ZodNull`,(e,t)=>{wn.init(e,t),e._zod.pattern=tn,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),rr=k(`$ZodAny`,(e,t)=>{wn.init(e,t),e._zod.parse=e=>e}),ir=k(`$ZodUnknown`,(e,t)=>{wn.init(e,t),e._zod.parse=e=>e}),ar=k(`$ZodNever`,(e,t)=>{wn.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function or(e,t,n){e.issues.length&&t.issues.push(...ot(n,e.issues)),t.value[n]=e.value}const sr=k(`$ZodArray`,(e,t)=>{wn.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>or(t,n,e))):or(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function cr(e,t,n,r,i,a){let o=n in r;if(e.issues.length){if(i&&a&&!o)return;t.issues.push(...ot(n,e.issues))}if(!o&&!i){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}function lr(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=Ye(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function ur(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin===`optional`,d=c.optout===`optional`;for(let i in t){if(i===`__proto__`||s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>cr(e,n,i,t,u,d))):cr(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}const dr=k(`$ZodObject`,(e,t)=>{if(wn.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}let n=je(()=>lr(t));Ie(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=He,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optin===`optional`,i=n._zod.optout===`optional`,a=n._zod.run({value:s[e],issues:[]},o);a instanceof Promise?c.push(a.then(n=>cr(n,t,e,s,r,i))):cr(a,t,e,s,r,i)}return i?ur(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),fr=k(`$ZodObjectJIT`,(e,t)=>{dr.init(e,t);let n=e._zod.parse,r=je(()=>lr(t)),i=e=>{let t=new Sn([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=ze(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=ze(r),s=e[r],c=s?._zod?.optin===`optional`,l=s?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),c&&l?t.write(`
|
|
5
|
+
if (${n}.issues.length) {
|
|
6
|
+
if (${o} in input) {
|
|
7
|
+
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
8
|
+
...iss,
|
|
9
|
+
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
10
|
+
})));
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
if (${n}.value === undefined) {
|
|
15
|
+
if (${o} in input) {
|
|
16
|
+
newResult[${o}] = undefined;
|
|
17
|
+
}
|
|
18
|
+
} else {
|
|
19
|
+
newResult[${o}] = ${n}.value;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
`):c?t.write(`
|
|
23
|
+
if (${n}.issues.length) {
|
|
24
|
+
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
25
|
+
...iss,
|
|
26
|
+
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
27
|
+
})));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (${n}.value === undefined) {
|
|
31
|
+
if (${o} in input) {
|
|
32
|
+
newResult[${o}] = undefined;
|
|
33
|
+
}
|
|
34
|
+
} else {
|
|
35
|
+
newResult[${o}] = ${n}.value;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
`):t.write(`
|
|
39
|
+
const ${n}_present = ${o} in input;
|
|
40
|
+
if (${n}.issues.length) {
|
|
41
|
+
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
42
|
+
...iss,
|
|
43
|
+
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
44
|
+
})));
|
|
45
|
+
}
|
|
46
|
+
if (!${n}_present && !${n}.issues.length) {
|
|
47
|
+
payload.issues.push({
|
|
48
|
+
code: "invalid_type",
|
|
49
|
+
expected: "nonoptional",
|
|
50
|
+
input: undefined,
|
|
51
|
+
path: [${o}]
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (${n}_present) {
|
|
56
|
+
if (${n}.value === undefined) {
|
|
57
|
+
newResult[${o}] = undefined;
|
|
58
|
+
} else {
|
|
59
|
+
newResult[${o}] = ${n}.value;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=He,s=!De.jitless,c=s&&Ue.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?ur([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function pr(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!it(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>ct(e,r,Oe())))}),t)}const mr=k(`$ZodUnion`,(e,t)=>{wn.init(e,t),Ie(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),Ie(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),Ie(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),Ie(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>Ne(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>pr(t,r,e,i)):pr(o,r,e,i)}}),hr=k(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,mr.init(e,t);let n=e._zod.parse;Ie(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=je(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!He(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()),input:o,path:[t.discriminator],inst:e}),i)}}),gr=k(`$ZodIntersection`,(e,t)=>{wn.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>vr(e,t,n)):vr(e,i,a)}});function _r(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(We(e)&&We(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=_r(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=_r(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function vr(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),it(e))return e;let o=_r(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}const yr=k(`$ZodTuple`,(e,t)=>{wn.init(e,t);let n=t.items;e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({input:a,inst:e,expected:`tuple`,code:`invalid_type`}),r;r.value=[];let o=[],s=br(n,`optin`),c=br(n,`optout`);if(!t.rest){if(a.length<s)return r.issues.push({code:`too_small`,minimum:s,inclusive:!0,input:a,inst:e,origin:`array`}),r;a.length>n.length&&r.issues.push({code:`too_big`,maximum:n.length,inclusive:!0,input:a,inst:e,origin:`array`})}let l=Array(n.length);for(let e=0;e<n.length;e++){let t=n[e]._zod.run({value:a[e],issues:[]},i);t instanceof Promise?o.push(t.then(t=>{l[e]=t})):l[e]=t}if(t.rest){let e=n.length-1,s=a.slice(n.length);for(let n of s){e++;let a=t.rest._zod.run({value:n,issues:[]},i);a instanceof Promise?o.push(a.then(t=>xr(t,r,e))):xr(a,r,e)}}return o.length?Promise.all(o).then(()=>Sr(l,r,n,a,c)):Sr(l,r,n,a,c)}});function br(e,t){for(let n=e.length-1;n>=0;n--)if(e[n]._zod[t]!==`optional`)return n+1;return 0}function xr(e,t,n){e.issues.length&&t.issues.push(...ot(n,e.issues)),t.value[n]=e.value}function Sr(e,t,n,r,i){for(let a=0;a<n.length;a++){let n=e[a],o=a<r.length;if(n.issues.length){if(!o&&a>=i){t.value.length=a;break}t.issues.push(...ot(a,n.issues))}t.value[a]=n.value}for(let e=t.value.length-1;e>=r.length&&n[e]._zod.optout===`optional`&&t.value[e]===void 0;e--)t.value.length=e;return t}const Cr=k(`$ZodRecord`,(e,t)=>{wn.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!We(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],o=t.keyType._zod.values;if(o){n.value={};let s=new Set;for(let c of o)if(typeof c==`string`||typeof c==`number`||typeof c==`symbol`){s.add(typeof c==`number`?c.toString():c);let o=t.keyType._zod.run({value:c,issues:[]},r);if(o instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(o.issues.length){n.issues.push({code:`invalid_key`,origin:`record`,issues:o.issues.map(e=>ct(e,r,Oe())),input:c,path:[c],inst:e});continue}let l=o.value,u=t.valueType._zod.run({value:i[c],issues:[]},r);u instanceof Promise?a.push(u.then(e=>{e.issues.length&&n.issues.push(...ot(c,e.issues)),n.value[l]=e.value})):(u.issues.length&&n.issues.push(...ot(c,u.issues)),n.value[l]=u.value)}let c;for(let e in i)s.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:c})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`||!Object.prototype.propertyIsEnumerable.call(i,o))continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof o==`string`&&$t.test(o)&&s.issues.length){let e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(s=e)}if(s.issues.length){t.mode===`loose`?n.value[o]=i[o]:n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>ct(e,r,Oe())),input:o,path:[o],inst:e});continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...ot(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...ot(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),wr=k(`$ZodEnum`,(e,t)=>{wn.init(e,t);let n=ke(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>Ke.has(typeof e)).map(e=>typeof e==`string`?qe(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),Tr=k(`$ZodLiteral`,(e,t)=>{if(wn.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?qe(e):e?qe(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),Er=k(`$ZodTransform`,(e,t)=>{wn.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Ee(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n.fallback=!0,n));if(i instanceof Promise)throw new Te;return n.value=i,n.fallback=!0,n}});function Dr(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const Or=k(`$ZodOptional`,(e,t)=>{wn.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,Ie(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Ie(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Ne(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=e.value,i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>Dr(e,r)):Dr(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),kr=k(`$ZodExactOptional`,(e,t)=>{Or.init(e,t),Ie(e._zod,`values`,()=>t.innerType._zod.values),Ie(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Ar=k(`$ZodNullable`,(e,t)=>{wn.init(e,t),Ie(e._zod,`optin`,()=>t.innerType._zod.optin),Ie(e._zod,`optout`,()=>t.innerType._zod.optout),Ie(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Ne(e.source)}|null)$`):void 0}),Ie(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),jr=k(`$ZodDefault`,(e,t)=>{wn.init(e,t),e._zod.optin=`optional`,Ie(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Mr(e,t)):Mr(r,t)}});function Mr(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Nr=k(`$ZodPrefault`,(e,t)=>{wn.init(e,t),e._zod.optin=`optional`,Ie(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Pr=k(`$ZodNonOptional`,(e,t)=>{wn.init(e,t),Ie(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Fr(t,e)):Fr(i,e)}});function Fr(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}const see=k(`$ZodCatch`,(e,t)=>{wn.init(e,t),e._zod.optin=`optional`,Ie(e._zod,`optout`,()=>t.innerType._zod.optout),Ie(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>ct(e,n,Oe()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>ct(e,n,Oe()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),Ir=k(`$ZodPipe`,(e,t)=>{wn.init(e,t),Ie(e._zod,`values`,()=>t.in._zod.values),Ie(e._zod,`optin`,()=>t.in._zod.optin),Ie(e._zod,`optout`,()=>t.out._zod.optout),Ie(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Lr(e,t.in,n)):Lr(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Lr(e,t.out,n)):Lr(r,t.out,n)}});function Lr(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}const cee=k(`$ZodPreprocess`,(e,t)=>{Ir.init(e,t)}),lee=k(`$ZodReadonly`,(e,t)=>{wn.init(e,t),Ie(e._zod,`propValues`,()=>t.innerType._zod.propValues),Ie(e._zod,`values`,()=>t.innerType._zod.values),Ie(e._zod,`optin`,()=>t.innerType?._zod?.optin),Ie(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Rr):Rr(r)}});function Rr(e){return e.value=Object.freeze(e.value),e}const uee=k(`$ZodLazy`,(e,t)=>{wn.init(e,t),Ie(e._zod,`innerType`,()=>{let e=t;return e._cachedInner||=t.getter(),e._cachedInner}),Ie(e._zod,`pattern`,()=>e._zod.innerType?._zod?.pattern),Ie(e._zod,`propValues`,()=>e._zod.innerType?._zod?.propValues),Ie(e._zod,`optin`,()=>e._zod.innerType?._zod?.optin??void 0),Ie(e._zod,`optout`,()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),dee=k(`$ZodCustom`,(e,t)=>{an.init(e,t),wn.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>zr(t,n,r,e));zr(i,n,r,e)}});function zr(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(ut(e))}}var Br,fee=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Vr(){return new fee}(Br=globalThis).__zod_globalRegistry??(Br.__zod_globalRegistry=Vr());const Hr=globalThis.__zod_globalRegistry;function pee(e,t){return new e({type:`string`,...A(t)})}function mee(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...A(t)})}function Ur(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...A(t)})}function Wr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...A(t)})}function hee(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...A(t)})}function gee(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...A(t)})}function _ee(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...A(t)})}function Gr(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...A(t)})}function vee(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...A(t)})}function yee(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...A(t)})}function bee(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...A(t)})}function xee(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...A(t)})}function See(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...A(t)})}function Cee(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...A(t)})}function wee(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...A(t)})}function Tee(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...A(t)})}function Eee(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...A(t)})}function Dee(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...A(t)})}function Oee(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...A(t)})}function Kr(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...A(t)})}function qr(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...A(t)})}function Jr(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...A(t)})}function Yr(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...A(t)})}function Xr(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...A(t)})}function Zr(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...A(t)})}function Qr(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...A(t)})}function $r(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...A(t)})}function ei(e,t){return new e({type:`number`,checks:[],...A(t)})}function ti(e,t){return new e({type:`number`,coerce:!0,checks:[],...A(t)})}function ni(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...A(t)})}function ri(e,t){return new e({type:`boolean`,...A(t)})}function ii(e,t){return new e({type:`null`,...A(t)})}function ai(e){return new e({type:`any`})}function oi(e){return new e({type:`unknown`})}function kee(e,t){return new e({type:`never`,...A(t)})}function si(e,t){return new sn({check:`less_than`,...A(t),value:e,inclusive:!1})}function ci(e,t){return new sn({check:`less_than`,...A(t),value:e,inclusive:!0})}function li(e,t){return new cn({check:`greater_than`,...A(t),value:e,inclusive:!1})}function ui(e,t){return new cn({check:`greater_than`,...A(t),value:e,inclusive:!0})}function di(e,t){return new ln({check:`multiple_of`,...A(t),value:e})}function fi(e,t){return new dn({check:`max_length`,...A(t),maximum:e})}function pi(e,t){return new fn({check:`min_length`,...A(t),minimum:e})}function mi(e,t){return new pn({check:`length_equals`,...A(t),length:e})}function hi(e,t){return new hn({check:`string_format`,format:`regex`,...A(t),pattern:e})}function gi(e){return new gn({check:`string_format`,format:`lowercase`,...A(e)})}function _i(e){return new _n({check:`string_format`,format:`uppercase`,...A(e)})}function Aee(e,t){return new vn({check:`string_format`,format:`includes`,...A(t),includes:e})}function jee(e,t){return new yn({check:`string_format`,format:`starts_with`,...A(t),prefix:e})}function Mee(e,t){return new bn({check:`string_format`,format:`ends_with`,...A(t),suffix:e})}function vi(e){return new xn({check:`overwrite`,tx:e})}function Nee(e){return vi(t=>t.normalize(e))}function yi(){return vi(e=>e.trim())}function bi(){return vi(e=>e.toLowerCase())}function xi(){return vi(e=>e.toUpperCase())}function Si(){return vi(e=>Be(e))}function Ci(e,t,n){return new e({type:`array`,element:t,...A(n)})}function wi(e,t,n){let r=A(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function Ti(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...A(n)})}function Ei(e,t){let n=Di(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(ut(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=t.value,r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(ut(r))}},e(t.value,t)),t);return n}function Di(e,t){let n=new an({check:`custom`,...A(t)});return n._zod.check=e,n}function Oi(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??Hr,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function ki(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,ki(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&Mi(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function Ai(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
64
|
+
|
|
65
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function ji(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:Pi(t,`input`,e.processors),output:Pi(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function Mi(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return Mi(r.element,n);if(r.type===`set`)return Mi(r.valueType,n);if(r.type===`lazy`)return Mi(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`)return Mi(r.innerType,n);if(r.type===`intersection`)return Mi(r.left,n)||Mi(r.right,n);if(r.type===`record`||r.type===`map`)return Mi(r.keyType,n)||Mi(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:Mi(r.in,n)||Mi(r.out,n);if(r.type===`object`){for(let e in r.shape)if(Mi(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(Mi(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(Mi(e,n))return!0;return!!(r.rest&&Mi(r.rest,n))}return!1}const Ni=(e,t={})=>n=>{let r=Oi({...n,processors:t});return ki(e,r),Ai(r,e),ji(r,e)},Pi=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Oi({...i??{},target:a,io:t,processors:n});return ki(e,o),Ai(o,e),ji(o,e)},Fi={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Ii=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Fi[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},Li=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;i.type=typeof s==`string`&&s.includes(`int`)?`integer`:`number`;let d=typeof u==`number`&&u>=(a??-1/0),f=typeof l==`number`&&l<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(i.multipleOf=c)},Ri=(e,t,n,r)=>{n.type=`boolean`},zi=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`BigInt cannot be represented in JSON Schema`)},Bi=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Symbols cannot be represented in JSON Schema`)},Vi=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},Hi=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Undefined cannot be represented in JSON Schema`)},Ui=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Void cannot be represented in JSON Schema`)},Wi=(e,t,n,r)=>{n.not={}},Gi=(e,t,n,r)=>{},Ki=(e,t,n,r)=>{},qi=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Date cannot be represented in JSON Schema`)},Ji=(e,t,n,r)=>{let i=e._zod.def,a=ke(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},Yi=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},Xi=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`NaN cannot be represented in JSON Schema`)},Zi=(e,t,n,r)=>{let i=n,a=e._zod.pattern;if(!a)throw Error(`Pattern not found in template literal`);i.type=`string`,i.pattern=a.source},Qi=(e,t,n,r)=>{let i=n,a={type:`string`,format:`binary`,contentEncoding:`binary`},{minimum:o,maximum:s,mime:c}=e._zod.bag;o!==void 0&&(a.minLength=o),s!==void 0&&(a.maxLength=s),c?c.length===1?(a.contentMediaType=c[0],Object.assign(i,a)):(Object.assign(i,a),i.anyOf=c.map(e=>({contentMediaType:e}))):Object.assign(i,a)},$i=(e,t,n,r)=>{n.type=`boolean`},ea=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},ta=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Function types cannot be represented in JSON Schema`)},na=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},ra=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Map cannot be represented in JSON Schema`)},ia=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Set cannot be represented in JSON Schema`)},aa=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=ki(a.element,t,{...r,path:[...r.path,`items`]})},oa=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=ki(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=ki(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},sa=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>ki(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},ca=(e,t,n,r)=>{let i=e._zod.def,a=ki(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=ki(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},la=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>ki(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?ki(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null;t.target===`draft-2020-12`?(i.prefixItems=c,l&&(i.items=l)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),i.minItems=c.length,l||(i.maxItems=c.length)):(i.items=c,l&&(i.additionalItems=l));let{minimum:u,maximum:d}=e._zod.bag;typeof u==`number`&&(i.minItems=u),typeof d==`number`&&(i.maxItems=d)},ua=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=ki(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else(t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=ki(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=ki(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},da=(e,t,n,r)=>{let i=e._zod.def,a=ki(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},fa=(e,t,n,r)=>{let i=e._zod.def;ki(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},pa=(e,t,n,r)=>{let i=e._zod.def;ki(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},ma=(e,t,n,r)=>{let i=e._zod.def;ki(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},ha=(e,t,n,r)=>{let i=e._zod.def;ki(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},ga=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;ki(o,t,r);let s=t.seen.get(e);s.ref=o},_a=(e,t,n,r)=>{let i=e._zod.def;ki(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},va=(e,t,n,r)=>{let i=e._zod.def;ki(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},ya=(e,t,n,r)=>{let i=e._zod.def;ki(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},ba=(e,t,n,r)=>{let i=e._zod.innerType;ki(i,t,r);let a=t.seen.get(e);a.ref=i},xa={string:Ii,number:Li,boolean:Ri,bigint:zi,symbol:Bi,null:Vi,undefined:Hi,void:Ui,never:Wi,any:Gi,unknown:Ki,date:qi,enum:Ji,literal:Yi,nan:Xi,template_literal:Zi,file:Qi,success:$i,custom:ea,function:ta,transform:na,map:ra,set:ia,array:aa,object:oa,union:sa,intersection:ca,tuple:la,record:ua,nullable:da,nonoptional:fa,default:pa,prefault:ma,catch:ha,pipe:ga,readonly:_a,promise:va,optional:ya,lazy:ba};function Sa(e,t){if(`_idmap`in e){let n=e,r=Oi({...t,processors:xa}),i={};for(let e of n._idmap.entries()){let[t,n]=e;ki(n,r)}let a={};r.external={registry:n,uri:t?.uri,defs:i};for(let e of n._idmap.entries()){let[t,n]=e;Ai(r,n),a[t]=ji(r,n)}return Object.keys(i).length>0&&(a.__shared={[r.target===`draft-2020-12`?`$defs`:`definitions`]:i}),{schemas:a}}let n=Oi({...t,processors:xa});return ki(e,n),Ai(n,e),ji(n,e)}const Ca=k(`ZodISODateTime`,(e,t)=>{Rn.init(e,t),Za.init(e,t)});function wa(e){return Xr(Ca,e)}const Ta=k(`ZodISODate`,(e,t)=>{zn.init(e,t),Za.init(e,t)});function Ea(e){return Zr(Ta,e)}const Da=k(`ZodISOTime`,(e,t)=>{Bn.init(e,t),Za.init(e,t)});function Oa(e){return Qr(Da,e)}const ka=k(`ZodISODuration`,(e,t)=>{Vn.init(e,t),Za.init(e,t)});function Aa(e){return $r(ka,e)}const ja=(e,t)=>{ft.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>ht(e,t)},flatten:{value:t=>mt(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Ae,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Ae,2)}},isEmpty:{get(){return e.issues.length===0}}})},Ma=k(`ZodError`,ja),Na=k(`ZodError`,ja,{Parent:Error}),Pa=_t(Na),Fa=yt(Na),Ia=xt(Na),La=Ct(Na),Ra=tee(Na),za=nee(Na),Ba=Tt(Na),Va=Et(Na),Ha=ree(Na),Ua=Dt(Na),Wa=Ot(Na),Ga=kt(Na),Ka=new WeakMap;function qa(e,t,n){let r=Object.getPrototypeOf(e),i=Ka.get(r);if(i||(i=new Set,Ka.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}const Ja=k(`ZodType`,(e,t)=>(wn.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:Pi(e,`input`),output:Pi(e,`output`)}}),e.toJSONSchema=Ni(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>Pa(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Ia(e,t,n),e.parseAsync=async(t,n)=>Fa(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>La(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Ra(e,t,n),e.decode=(t,n)=>za(e,t,n),e.encodeAsync=async(t,n)=>Ba(e,t,n),e.decodeAsync=async(t,n)=>Va(e,t,n),e.safeEncode=(t,n)=>Ha(e,t,n),e.safeDecode=(t,n)=>Ua(e,t,n),e.safeEncodeAsync=async(t,n)=>Wa(e,t,n),e.safeDecodeAsync=async(t,n)=>Ga(e,t,n),qa(e,`ZodType`,{check(...e){let t=this.def;return this.clone(Re(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return Je(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(is(e,t))},superRefine(e,t){return this.check(as(e,t))},overwrite(e){return this.check(vi(e))},optional(){return Io(this)},exactOptional(){return Ro(this)},nullable(){return Bo(this)},nullish(){return Io(Bo(this))},nonoptional(e){return Ko(this,e)},array(){return P(this)},or(e){return xo([this,e])},and(e){return To(this,e)},transform(e){return Xo(this,Po(e))},default(e){return Ho(this,e)},prefault(e){return Wo(this,e)},catch(e){return Jo(this,e)},pipe(e){return Xo(this,e)},readonly(){return $o(this)},describe(e){let t=this.clone();return Hr.add(t,{description:e}),t},meta(...e){if(e.length===0)return Hr.get(this);let t=this.clone();return Hr.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get(){return Hr.get(e)?.description},configurable:!0}),e)),Ya=k(`_ZodString`,(e,t)=>{Tn.init(e,t),Ja.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ii(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,qa(e,`_ZodString`,{regex(...e){return this.check(hi(...e))},includes(...e){return this.check(Aee(...e))},startsWith(...e){return this.check(jee(...e))},endsWith(...e){return this.check(Mee(...e))},min(...e){return this.check(pi(...e))},max(...e){return this.check(fi(...e))},length(...e){return this.check(mi(...e))},nonempty(...e){return this.check(pi(1,...e))},lowercase(e){return this.check(gi(e))},uppercase(e){return this.check(_i(e))},trim(){return this.check(yi())},normalize(...e){return this.check(Nee(...e))},toLowerCase(){return this.check(bi())},toUpperCase(){return this.check(xi())},slugify(){return this.check(Si())}})}),Xa=k(`ZodString`,(e,t)=>{Tn.init(e,t),Ya.init(e,t),e.email=t=>e.check(mee(Qa,t)),e.url=t=>e.check(Gr(no,t)),e.jwt=t=>e.check(Yr(Kee,t)),e.emoji=t=>e.check(vee(io,t)),e.guid=t=>e.check(Ur($a,t)),e.uuid=t=>e.check(Wr(eo,t)),e.uuidv4=t=>e.check(hee(eo,t)),e.uuidv6=t=>e.check(gee(eo,t)),e.uuidv7=t=>e.check(_ee(eo,t)),e.nanoid=t=>e.check(yee(ao,t)),e.guid=t=>e.check(Ur($a,t)),e.cuid=t=>e.check(bee(Pee,t)),e.cuid2=t=>e.check(xee(Fee,t)),e.ulid=t=>e.check(See(Iee,t)),e.base64=t=>e.check(Kr(Uee,t)),e.base64url=t=>e.check(qr(Wee,t)),e.xid=t=>e.check(Cee(Lee,t)),e.ksuid=t=>e.check(wee(Ree,t)),e.ipv4=t=>e.check(Tee(zee,t)),e.ipv6=t=>e.check(Eee(Bee,t)),e.cidrv4=t=>e.check(Dee(Vee,t)),e.cidrv6=t=>e.check(Oee(Hee,t)),e.e164=t=>e.check(Jr(Gee,t)),e.datetime=t=>e.check(wa(t)),e.date=t=>e.check(Ea(t)),e.time=t=>e.check(Oa(t)),e.duration=t=>e.check(Aa(t))});function j(e){return pee(Xa,e)}const Za=k(`ZodStringFormat`,(e,t)=>{En.init(e,t),Ya.init(e,t)}),Qa=k(`ZodEmail`,(e,t)=>{kn.init(e,t),Za.init(e,t)}),$a=k(`ZodGUID`,(e,t)=>{Dn.init(e,t),Za.init(e,t)}),eo=k(`ZodUUID`,(e,t)=>{On.init(e,t),Za.init(e,t)});function to(e){return Wr(eo,e)}const no=k(`ZodURL`,(e,t)=>{An.init(e,t),Za.init(e,t)});function ro(e){return Gr(no,e)}const io=k(`ZodEmoji`,(e,t)=>{jn.init(e,t),Za.init(e,t)}),ao=k(`ZodNanoID`,(e,t)=>{Mn.init(e,t),Za.init(e,t)}),Pee=k(`ZodCUID`,(e,t)=>{Nn.init(e,t),Za.init(e,t)}),Fee=k(`ZodCUID2`,(e,t)=>{Pn.init(e,t),Za.init(e,t)}),Iee=k(`ZodULID`,(e,t)=>{Fn.init(e,t),Za.init(e,t)}),Lee=k(`ZodXID`,(e,t)=>{In.init(e,t),Za.init(e,t)}),Ree=k(`ZodKSUID`,(e,t)=>{Ln.init(e,t),Za.init(e,t)}),zee=k(`ZodIPv4`,(e,t)=>{Hn.init(e,t),Za.init(e,t)}),Bee=k(`ZodIPv6`,(e,t)=>{Un.init(e,t),Za.init(e,t)}),Vee=k(`ZodCIDRv4`,(e,t)=>{Wn.init(e,t),Za.init(e,t)}),Hee=k(`ZodCIDRv6`,(e,t)=>{Gn.init(e,t),Za.init(e,t)}),Uee=k(`ZodBase64`,(e,t)=>{qn.init(e,t),Za.init(e,t)}),Wee=k(`ZodBase64URL`,(e,t)=>{Yn.init(e,t),Za.init(e,t)}),Gee=k(`ZodE164`,(e,t)=>{Xn.init(e,t),Za.init(e,t)}),Kee=k(`ZodJWT`,(e,t)=>{Qn.init(e,t),Za.init(e,t)}),oo=k(`ZodNumber`,(e,t)=>{$n.init(e,t),Ja.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Li(e,t,n,r),qa(e,`ZodNumber`,{gt(e,t){return this.check(li(e,t))},gte(e,t){return this.check(ui(e,t))},min(e,t){return this.check(ui(e,t))},lt(e,t){return this.check(si(e,t))},lte(e,t){return this.check(ci(e,t))},max(e,t){return this.check(ci(e,t))},int(e){return this.check(so(e))},safe(e){return this.check(so(e))},positive(e){return this.check(li(0,e))},nonnegative(e){return this.check(ui(0,e))},negative(e){return this.check(si(0,e))},nonpositive(e){return this.check(ci(0,e))},multipleOf(e,t){return this.check(di(e,t))},step(e,t){return this.check(di(e,t))},finite(){return this}});let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function M(e){return ei(oo,e)}const qee=k(`ZodNumberFormat`,(e,t)=>{er.init(e,t),oo.init(e,t)});function so(e){return ni(qee,e)}const Jee=k(`ZodBoolean`,(e,t)=>{tr.init(e,t),Ja.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ri(e,t,n,r)});function N(e){return ri(Jee,e)}const Yee=k(`ZodNull`,(e,t)=>{nr.init(e,t),Ja.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vi(e,t,n,r)});function co(e){return ii(Yee,e)}const lo=k(`ZodAny`,(e,t)=>{rr.init(e,t),Ja.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function uo(){return ai(lo)}const fo=k(`ZodUnknown`,(e,t)=>{ir.init(e,t),Ja.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function po(){return oi(fo)}const mo=k(`ZodNever`,(e,t)=>{ar.init(e,t),Ja.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wi(e,t,n,r)});function ho(e){return kee(mo,e)}const go=k(`ZodArray`,(e,t)=>{sr.init(e,t),Ja.init(e,t),e._zod.processJSONSchema=(t,n,r)=>aa(e,t,n,r),e.element=t.element,qa(e,`ZodArray`,{min(e,t){return this.check(pi(e,t))},nonempty(e){return this.check(pi(1,e))},max(e,t){return this.check(fi(e,t))},length(e,t){return this.check(mi(e,t))},unwrap(){return this.element}})});function P(e,t){return Ci(go,e,t)}const _o=k(`ZodObject`,(e,t)=>{fr.init(e,t),Ja.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oa(e,t,n,r),Ie(e,`shape`,()=>t.shape),qa(e,`ZodObject`,{keyof(){return I(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:po()})},loose(){return this.clone({...this._zod.def,catchall:po()})},strict(){return this.clone({...this._zod.def,catchall:ho()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return $e(this,e)},safeExtend(e){return et(this,e)},merge(e){return tt(this,e)},pick(e){return Ze(this,e)},omit(e){return Qe(this,e)},partial(...e){return nt(Fo,this,e[0])},required(...e){return rt(Go,this,e[0])}})});function F(e,t){let n={type:`object`,shape:e??{},...A(t)};return new _o(n)}function vo(e,t){return new _o({type:`object`,shape:e,catchall:ho(),...A(t)})}function yo(e,t){return new _o({type:`object`,shape:e,catchall:po(),...A(t)})}const bo=k(`ZodUnion`,(e,t)=>{mr.init(e,t),Ja.init(e,t),e._zod.processJSONSchema=(t,n,r)=>sa(e,t,n,r),e.options=t.options});function xo(e,t){return new bo({type:`union`,options:e,...A(t)})}const So=k(`ZodDiscriminatedUnion`,(e,t)=>{bo.init(e,t),hr.init(e,t)});function Co(e,t,n){return new So({type:`union`,options:t,discriminator:e,...A(n)})}const wo=k(`ZodIntersection`,(e,t)=>{gr.init(e,t),Ja.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ca(e,t,n,r)});function To(e,t){return new wo({type:`intersection`,left:e,right:t})}const Eo=k(`ZodTuple`,(e,t)=>{yr.init(e,t),Ja.init(e,t),e._zod.processJSONSchema=(t,n,r)=>la(e,t,n,r),e.rest=t=>e.clone({...e._zod.def,rest:t})});function Do(e,t,n){let r=t instanceof wn;return new Eo({type:`tuple`,items:e,rest:r?t:null,...A(r?n:t)})}const Oo=k(`ZodRecord`,(e,t)=>{Cr.init(e,t),Ja.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ua(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function ko(e,t,n){return!t||!t._zod?new Oo({type:`record`,keyType:j(),valueType:e,...A(t)}):new Oo({type:`record`,keyType:e,valueType:t,...A(n)})}function Ao(e,t,n){let r=Je(e);return r._zod.values=void 0,new Oo({type:`record`,keyType:r,valueType:t,...A(n)})}const jo=k(`ZodEnum`,(e,t)=>{wr.init(e,t),Ja.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ji(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new jo({...t,checks:[],...A(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new jo({...t,checks:[],...A(r),entries:i})}});function I(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new jo({type:`enum`,entries:n,...A(t)})}const Mo=k(`ZodLiteral`,(e,t)=>{Tr.init(e,t),Ja.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Yi(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function L(e,t){return new Mo({type:`literal`,values:Array.isArray(e)?e:[e],...A(t)})}const No=k(`ZodTransform`,(e,t)=>{Er.init(e,t),Ja.init(e,t),e._zod.processJSONSchema=(t,n,r)=>na(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Ee(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(ut(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(ut(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function Po(e){return new No({type:`transform`,transform:e})}const Fo=k(`ZodOptional`,(e,t)=>{Or.init(e,t),Ja.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ya(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Io(e){return new Fo({type:`optional`,innerType:e})}const Lo=k(`ZodExactOptional`,(e,t)=>{kr.init(e,t),Ja.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ya(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ro(e){return new Lo({type:`optional`,innerType:e})}const zo=k(`ZodNullable`,(e,t)=>{Ar.init(e,t),Ja.init(e,t),e._zod.processJSONSchema=(t,n,r)=>da(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Bo(e){return new zo({type:`nullable`,innerType:e})}const Vo=k(`ZodDefault`,(e,t)=>{jr.init(e,t),Ja.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pa(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Ho(e,t){return new Vo({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Ge(t)}})}const Uo=k(`ZodPrefault`,(e,t)=>{Nr.init(e,t),Ja.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ma(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Wo(e,t){return new Uo({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Ge(t)}})}const Go=k(`ZodNonOptional`,(e,t)=>{Pr.init(e,t),Ja.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fa(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ko(e,t){return new Go({type:`nonoptional`,innerType:e,...A(t)})}const qo=k(`ZodCatch`,(e,t)=>{see.init(e,t),Ja.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ha(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Jo(e,t){return new qo({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}const Yo=k(`ZodPipe`,(e,t)=>{Ir.init(e,t),Ja.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ga(e,t,n,r),e.in=t.in,e.out=t.out});function Xo(e,t){return new Yo({type:`pipe`,in:e,out:t})}const Zo=k(`ZodPreprocess`,(e,t)=>{Yo.init(e,t),cee.init(e,t)}),Qo=k(`ZodReadonly`,(e,t)=>{lee.init(e,t),Ja.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_a(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function $o(e){return new Qo({type:`readonly`,innerType:e})}const es=k(`ZodLazy`,(e,t)=>{uee.init(e,t),Ja.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ba(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function ts(e){return new es({type:`lazy`,getter:e})}const ns=k(`ZodCustom`,(e,t)=>{dee.init(e,t),Ja.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ea(e,t,n,r)});function rs(e,t){return wi(ns,e??(()=>!0),t)}function is(e,t={}){return Ti(ns,e,t)}function as(e,t){return Ei(e,t)}function ss(e,t){return new Zo({type:`pipe`,in:Po(e),out:t})}const cs=[`config-entry`,`managed-file`,`skill-bundle-copy`,`central-store-copy`,`session-injection`],ls=I(cs),us=cs.filter(e=>e!==`session-injection`),ds=[`satisfied`,`present-consent-unknown`,`absent`,`foreign`,`foreign-replaceable`,`drifted`,`excluded`,`structural-na`,`undetected`,`unprobeable`,`unprobed`];xo([I(ds),j()]);function fs(e){return ds.includes(e)}const ps=[`reclaim-permissive`,`pre-approval-exact`,`injection-functional`],ms=I(ps),hs=I([`none`,`approve-once`,`enable-manually`,`trust-gated`]),gs=[`enable-manually`],_s=[`written`,`overwritten`,`skipped-unsupported`,`skipped-prerequisite`,`declined`,`failed`,`removed`,`excluded`,`unchanged`,`handed-off`,`skipped-foreign`,`skipped-missing`,`no-op`];I(_s),I([`info`,`warning`,`error`]);const vs=I([`required`,`recommended`]),ys=[...ne,`gemini`],bs=I(ys);function xs(e){return ys.includes(e)}const Ss=I([`acp`,`terminal`,`external`]),Cs=I([...Se,`gemini`]),ws=I([`claude-cowork`,`claude-code`,`codex`,`cursor`,`copilot`,`opencode`,`pi`,`antigravity`,`openclaw`,`hermes`]),Ts=I([`mcp`,`skill`]),Es=[`project`,`user`,`session`],Ds=I(Es),Os=j().regex(/^[a-z0-9-]+\/[a-z0-9-]+\/[a-z0-9-]+\/[a-z0-9-]+$/).transform(e=>e),ks=j().min(1).transform(e=>e),As=j().min(1).transform(e=>e);function js(e){return`${e.agent}/${e.piece}/${e.scope}/${e.kind}`}function Ms(e){return e}function Ns(e){return e}const Ps=[`editor-user-config`,`editor-project-config`,`editor-project-skill-root`,`editor-user-skill-root`],Fs=Ms(`central-skill-store`);function Is(e,t){return Ms(`${e}:${t}`)}function Ls(e){if(e===Fs)return{kind:`central-skill-store`};let t=e.indexOf(`:`);if(t===-1)return null;let n=e.slice(0,t),r=e.slice(t+1);return!Ps.includes(n)||!ne.includes(r)?null:{kind:n,editor:r}}const Rs=I(ne),zs=F({kind:I([`source-read`,`measured`,`vendor-doc`,`upstream-issue`,`observation`]),ref:j().min(1),note:j().optional()}),Bs=F({version:j().min(1).optional(),observedAt:j().min(1)}),Vs=Co(`confidence`,[F({confidence:L(`verified`),evidence:P(zs).min(1),verifiedAgainst:Bs.optional()}),F({confidence:L(`assumed`),evidence:P(zs).min(1),verifiedAgainst:Bs.optional()}),F({confidence:L(`contested`),evidence:P(zs).min(1),verifiedAgainst:Bs})]),Hs=F({id:As,params:ko(j(),xo([j(),M(),N()])).optional()}),Us=Co(`mode`,[F({mode:L(`probeable`),strictness:P(ms).min(1)}),F({mode:L(`unprobeable`),reason:I([`no-readable-state`,`different-machine`,`no-programmatic-path`,`session-scoped`]),note:j().optional()})]),Ws=I([`this-project`,`this-user`,`this-machine`]),Gs=I([`installable`,`user-completes`,`not-installable`]),Ks=F({id:Os,agent:bs,piece:Ts,scope:Ds,kind:ls,pathId:ks.optional(),sharedWith:P(bs).default([]),prerequisites:P(Os).default([]),consentClass:hs.default(`none`),probe:Us,attestation:Vs,audience:Ws,installability:Gs.default(`installable`),notInstallableReason:I([`no-non-interactive-verb`,`session-scoped`,`no-surface`]).optional(),preferred:N().default(!1),guidance:Hs.optional(),followup:Hs.optional(),troubleshooting:P(Hs).default([])}),qs=F({piece:Ts,level:vs,satisfiedByAny:P(Os)}),Js=F({acpAgentId:j().min(1),featuredOrder:M().int().nonnegative().nullable(),harnessCli:Cs.nullable(),harnessReadsEditorConfig:Rs.nullable(),harnessReadsEditorConfigAttestation:Vs,verifiedPosture:I([`asks`,`self-managed`,`autonomous`]).nullable()}),Ys=F({cliId:j().min(1)}),Xs=[`darwin`,`win32`,`linux`],Zs=I(Xs),Qs=F({targetId:ws,knownOrder:M().int().nonnegative(),visible:N(),displayName:j().min(1),appBrandName:j().min(1).optional(),schemes:P(j().min(1)),installUrl:j().min(1),platforms:P(Zs).min(1),tagline:j().min(1).optional()}),$s=F({requirements:P(qs),caveats:P(Hs).default([])});F({id:bs,setupDocSlug:j().min(1).nullable(),offerOnlyWhenDetected:N().default(!1),offersConnectionRow:N().default(!1),detectionSources:P(j().min(1)).default([]),satisfiers:P(Ks),modes:Ao(Ss,$s),acp:Js.optional(),terminal:Ys.optional(),external:Qs.optional()}),F({id:j().min(1),requiredStrictness:ms,scope:Ds.optional(),piece:Ts,revokedByForeignEntry:N().default(!1),guidance:Hs.optional()});const ec=e=>e===void 0?[]:Array.isArray(e)?[...e]:[e];function tc(e){let{sharedWith:t,prerequisites:n,consentClass:r,installability:i,preferred:a,troubleshooting:o,...s}=e;return{...s,troubleshooting:ec(o),id:js({agent:e.agent,piece:e.piece,scope:e.scope,kind:e.kind}),sharedWith:t??[],prerequisites:n??[],consentClass:r??`none`,installability:i??`installable`,preferred:a??!1}}function nc(e){let{offerOnlyWhenDetected:t,offersConnectionRow:n,detectionSources:r,modes:i,...a}=e,o={};for(let[e,t]of Object.entries(i))o[e]={requirements:t.requirements,caveats:t.caveats??[]};return{...a,offerOnlyWhenDetected:t??!1,offersConnectionRow:n??!1,detectionSources:r??[],modes:o}}const R=(e,t,n,r)=>js({agent:e,piece:t,scope:n,kind:r}),rc=e=>({piece:`mcp`,level:`required`,satisfiedByAny:e}),ic=e=>({piece:`skill`,level:`recommended`,satisfiedByAny:e}),ac=(...e)=>({mode:`probeable`,strictness:e}),oc=(e,t)=>({mode:`unprobeable`,reason:e,...t===void 0?{}:{note:t}}),sc=(e,t)=>({id:Ns(e),...t===void 0?{}:{params:t}}),cc=(e,t)=>{let n=gs.find(t=>t===e);return n===void 0?void 0:sc(`followup.${n}`,{agent:t})},lc=(e,t)=>({kind:`source-read`,ref:e,...t===void 0?{}:{note:t}}),uc=(e,t)=>t===void 0?{confidence:`verified`,evidence:e}:{confidence:`verified`,evidence:e,verifiedAgainst:t},dc=(e,t)=>({confidence:`contested`,evidence:e,verifiedAgainst:t});function fc(e){return{acpAgentId:e.acpAgentId,featuredOrder:e.featuredOrder,harnessCli:e.harnessCli,harnessReadsEditorConfig:e.readsEditorConfig,harnessReadsEditorConfigAttestation:e.readsEditorConfigAttestation,verifiedPosture:e.verifiedPosture}}function pc(e){let{appBrandName:t,tagline:n,platforms:r=Xs,...i}=e;return{...i,platforms:[...r],...t===void 0?{}:{appBrandName:t},...n===void 0?{}:{tagline:n}}}const mc=(e,t)=>({kind:`observation`,ref:e,note:t}),hc={observedAt:`2026-07-02`},gc={cliEditors:`packages/cli/src/commands/editors.ts`,coreEditors:`packages/core/src/constants/editors.ts`,acpRegistry:`packages/server/src/acp/registry.ts`,threadManager:`packages/server/src/acp/thread-manager.ts`,writeProjectSkill:`packages/cli/src/integrations/write-project-skill.ts`,repairSkills:`packages/cli/src/commands/repair-skills.ts`,skillInstall:`packages/server/src/skill-install.ts`,presenceProbes:`packages/desktop/src/main/integrations-settings.ts`};function _c(e){return tc({agent:e.agent,piece:`mcp`,scope:`user`,kind:`config-entry`,pathId:Is(`editor-user-config`,e.agent),probe:ac(...e.strictness),attestation:e.attestation,audience:`this-user`,installability:e.installability,notInstallableReason:e.notInstallableReason,guidance:sc(`guidance.mcp.user-config`,{agent:e.agent}),troubleshooting:e.troubleshooting})}function vc(e){return tc({agent:e.agent,piece:`mcp`,scope:`project`,kind:`config-entry`,pathId:Is(`editor-project-config`,e.fileOwner??e.agent),sharedWith:e.sharedWith,consentClass:e.consentClass,probe:ac(...e.strictness),attestation:e.attestation,audience:`this-project`,guidance:sc(`guidance.mcp.project-config`,{agent:e.agent}),followup:cc(e.consentClass,e.agent),troubleshooting:e.troubleshooting})}function yc(e){return tc({agent:e.agent,piece:`skill`,scope:`project`,kind:`skill-bundle-copy`,pathId:Is(`editor-project-skill-root`,e.agent),prerequisites:e.prerequisites,probe:ac(`reclaim-permissive`),attestation:e.attestation,audience:`this-project`,guidance:sc(`guidance.skill.project`,{agent:e.agent}),troubleshooting:e.troubleshooting})}function bc(e){return tc({agent:e.agent,piece:`skill`,scope:`user`,kind:`skill-bundle-copy`,pathId:Is(`editor-user-skill-root`,e.agent),probe:ac(`reclaim-permissive`),attestation:e.attestation,audience:`this-user`,guidance:sc(`guidance.skill.user`,{agent:e.agent})})}function xc(e){return tc({agent:e,piece:`mcp`,scope:`session`,kind:`session-injection`,probe:oc(`session-scoped`),attestation:uc([lc(gc.threadManager,`the session MCP config the thread manager builds per thread`)]),audience:`this-project`,installability:`not-installable`,notInstallableReason:`session-scoped`,guidance:sc(`guidance.mcp.session-injection`,{agent:e})})}const Sc={claude:nc({id:`claude`,setupDocSlug:D.claude,offersConnectionRow:!0,detectionSources:[`cli-on-path:claude`,`scheme-handler:claude-code`],satisfiers:[_c({agent:`claude`,strictness:[`reclaim-permissive`,`pre-approval-exact`,`injection-functional`],attestation:uc([lc(gc.cliEditors,`user-global MCP config target`)])}),vc({agent:`claude`,sharedWith:[`copilot`],consentClass:`approve-once`,strictness:[`reclaim-permissive`,`pre-approval-exact`,`injection-functional`],attestation:uc([lc(gc.cliEditors),lc(gc.coreEditors)]),troubleshooting:sc(`troubleshooting.claude.project-entry-not-approved`,{agent:`claude`})}),yc({agent:`claude`,prerequisites:[R(`claude`,`mcp`,`project`,`config-entry`)],attestation:uc([lc(gc.coreEditors),lc(gc.repairSkills)])}),bc({agent:`claude`,attestation:uc([lc(gc.coreEditors),lc(gc.skillInstall)])}),xc(`claude`)],modes:{external:{requirements:[rc([R(`claude`,`mcp`,`user`,`config-entry`),R(`claude`,`mcp`,`project`,`config-entry`)]),ic([R(`claude`,`skill`,`project`,`skill-bundle-copy`),R(`claude`,`skill`,`user`,`skill-bundle-copy`)])]},terminal:{requirements:[rc([R(`claude`,`mcp`,`user`,`config-entry`),R(`claude`,`mcp`,`project`,`config-entry`)]),ic([R(`claude`,`skill`,`project`,`skill-bundle-copy`),R(`claude`,`skill`,`user`,`skill-bundle-copy`)])]},acp:{requirements:[rc([R(`claude`,`mcp`,`session`,`session-injection`),R(`claude`,`mcp`,`user`,`config-entry`),R(`claude`,`mcp`,`project`,`config-entry`)]),ic([R(`claude`,`skill`,`project`,`skill-bundle-copy`),R(`claude`,`skill`,`user`,`skill-bundle-copy`)])]}},acp:fc({acpAgentId:`claude-acp`,featuredOrder:0,harnessCli:`claude`,readsEditorConfig:`claude`,readsEditorConfigAttestation:uc([lc(gc.threadManager,`the injection-skip probe reads the managed entry for this editor`),mc(`claude-acp adapter`,`The adapter runs Claude Code, which loads the MCP entry OK writes for the Claude editor on its own, so injecting a same-name duplicate would be redundant.`)],hc),verifiedPosture:`asks`}),external:pc({targetId:`claude-code`,knownOrder:1,visible:!0,displayName:`Claude`,appBrandName:`Claude Desktop`,schemes:[`claude:`],installUrl:`https://claude.com/download`,tagline:`Agentic coding in Claude Desktop's Code tab.`})}),"claude-desktop":nc({id:`claude-desktop`,setupDocSlug:D[`claude-desktop`],offersConnectionRow:!1,detectionSources:[`scheme-handler:claude-code`],satisfiers:[_c({agent:`claude-desktop`,strictness:[`reclaim-permissive`],attestation:uc([lc(gc.cliEditors,`user-global config target; its path resolution throws on Linux`)]),troubleshooting:sc(`troubleshooting.claude-desktop.per-tool-approval`,{agent:`claude-desktop`})})],modes:{external:{requirements:[rc([R(`claude-desktop`,`mcp`,`user`,`config-entry`)]),ic([])]}},external:pc({targetId:`claude-cowork`,knownOrder:0,visible:!1,displayName:`Claude Cowork`,appBrandName:`Claude Desktop`,schemes:[`claude:`],installUrl:`https://claude.com/download`,tagline:`Conversational pairing in Claude Desktop's Cowork tab.`})}),cursor:nc({id:`cursor`,setupDocSlug:D.cursor,offersConnectionRow:!0,detectionSources:[`cli-on-path:cursor`,`scheme-handler:cursor`],satisfiers:[_c({agent:`cursor`,strictness:[`reclaim-permissive`],attestation:uc([lc(gc.cliEditors)])}),vc({agent:`cursor`,consentClass:`enable-manually`,strictness:[`reclaim-permissive`],attestation:uc([lc(gc.cliEditors),lc(gc.coreEditors),{kind:`observation`,ref:`cursor-3.19.19-project-server-default-off`,note:`project .cursor/mcp.json server listed Disabled under Customize → MCPs with no prompt; enabled via the per-source toggle in its Configure dialog; with a same-named user-level entry present, the user entry connected and the disabled project entry did not shadow it`}],{version:`3.19.19`,observedAt:`2026-09-09`}),troubleshooting:sc(`troubleshooting.cursor.project-entry-not-loaded`,{agent:`cursor`})}),yc({agent:`cursor`,prerequisites:[R(`cursor`,`mcp`,`project`,`config-entry`)],attestation:uc([lc(gc.coreEditors),lc(gc.repairSkills)])}),bc({agent:`cursor`,attestation:uc([lc(gc.coreEditors),lc(gc.skillInstall)])}),xc(`cursor`)],modes:{external:{requirements:[rc([R(`cursor`,`mcp`,`user`,`config-entry`),R(`cursor`,`mcp`,`project`,`config-entry`)]),ic([R(`cursor`,`skill`,`project`,`skill-bundle-copy`),R(`cursor`,`skill`,`user`,`skill-bundle-copy`)])]},terminal:{requirements:[rc([R(`cursor`,`mcp`,`user`,`config-entry`),R(`cursor`,`mcp`,`project`,`config-entry`)]),ic([R(`cursor`,`skill`,`project`,`skill-bundle-copy`),R(`cursor`,`skill`,`user`,`skill-bundle-copy`)])]},acp:{requirements:[rc([R(`cursor`,`mcp`,`session`,`session-injection`)]),ic([R(`cursor`,`skill`,`project`,`skill-bundle-copy`),R(`cursor`,`skill`,`user`,`skill-bundle-copy`)])]}},acp:fc({acpAgentId:`cursor`,featuredOrder:3,harnessCli:`cursor`,readsEditorConfig:null,readsEditorConfigAttestation:uc([mc(`cursor-agent mcp list`,`Reports a config-declared entry that has not been approved as "not loaded (needs approval)", so a present entry says nothing about whether the agent will have the tools.`),lc(gc.threadManager,`the one agent the skip probe never stands down for`)],{observedAt:`2026-08-20`}),verifiedPosture:`self-managed`}),external:pc({targetId:`cursor`,knownOrder:3,visible:!0,displayName:`Cursor`,schemes:[`cursor:`],installUrl:`https://cursor.com/`,tagline:`AI-first VS Code fork with multi-file edits.`})}),codex:nc({id:`codex`,setupDocSlug:D.codex,offersConnectionRow:!0,detectionSources:[`cli-on-path:codex`,`scheme-handler:codex`],satisfiers:[_c({agent:`codex`,strictness:[`reclaim-permissive`,`injection-functional`],attestation:uc([lc(gc.cliEditors,`TOML user-global config target`)])}),vc({agent:`codex`,consentClass:`trust-gated`,strictness:[`reclaim-permissive`,`injection-functional`],attestation:dc([lc(gc.cliEditors,`project config path added by analogy with the other editors`),{kind:`upstream-issue`,ref:`openai/codex#13025`,note:`open, reproduced on builds newer than the one OK checked`},{kind:`upstream-issue`,ref:`openai/codex#36960`,note:`requires an explicit trust decision in rust-v0.147.0, reverting #36935's automatic trust from the same release; builds from 0.113 asked but did not reliably persist the answer (#14547); codex exec never asks`},{kind:`vendor-doc`,ref:`OpenAI Codex: Advanced configuration`,note:`project-scoped config loads only for a trusted project`},{kind:`observation`,ref:`codex-desktop-project-config-load`,note:`single non-repro on 26.623.81905; the CLI honors it only for a trusted project`}],{version:`26.707.72221`,observedAt:`2026-07-15`}),troubleshooting:[sc(`troubleshooting.codex.desktop-project-config`,{agent:`codex`,honoredByDesktop:!1}),sc(`troubleshooting.codex.folder-trust`,{agent:`codex`})]}),yc({agent:`codex`,prerequisites:[R(`codex`,`mcp`,`project`,`config-entry`)],attestation:uc([lc(gc.coreEditors),lc(gc.repairSkills)]),troubleshooting:sc(`troubleshooting.codex.folder-trust`,{agent:`codex`})}),bc({agent:`codex`,attestation:uc([lc(gc.coreEditors),lc(gc.skillInstall)])}),xc(`codex`)],modes:{external:{requirements:[rc([R(`codex`,`mcp`,`user`,`config-entry`),R(`codex`,`mcp`,`project`,`config-entry`)]),ic([R(`codex`,`skill`,`project`,`skill-bundle-copy`),R(`codex`,`skill`,`user`,`skill-bundle-copy`)])]},terminal:{requirements:[rc([R(`codex`,`mcp`,`user`,`config-entry`),R(`codex`,`mcp`,`project`,`config-entry`)]),ic([R(`codex`,`skill`,`project`,`skill-bundle-copy`),R(`codex`,`skill`,`user`,`skill-bundle-copy`)])]},acp:{requirements:[rc([R(`codex`,`mcp`,`session`,`session-injection`),R(`codex`,`mcp`,`user`,`config-entry`),R(`codex`,`mcp`,`project`,`config-entry`)]),ic([R(`codex`,`skill`,`project`,`skill-bundle-copy`),R(`codex`,`skill`,`user`,`skill-bundle-copy`)])]}},acp:fc({acpAgentId:`codex-acp`,featuredOrder:1,harnessCli:`codex`,readsEditorConfig:`codex`,readsEditorConfigAttestation:uc([lc(gc.cliEditors,`the managed MCP entry OK writes into the Codex TOML config`),mc(`codex-acp adapter`,`The adapter runs the Codex CLI, which loads the MCP servers declared in its own config, so the managed entry is already in the session.`)],hc),verifiedPosture:`self-managed`}),external:pc({targetId:`codex`,knownOrder:2,visible:!0,displayName:`ChatGPT`,appBrandName:`ChatGPT Desktop`,schemes:[`codex:`],installUrl:`https://developers.openai.com/codex/app`,tagline:`OpenAI's ChatGPT desktop app, home of the Codex agent.`})}),copilot:nc({id:`copilot`,setupDocSlug:D.copilot,offersConnectionRow:!0,detectionSources:[`cli-on-path:copilot`],satisfiers:[_c({agent:`copilot`,strictness:[`reclaim-permissive`],attestation:uc([lc(gc.cliEditors)])}),vc({agent:`copilot`,fileOwner:`claude`,sharedWith:[`claude`],consentClass:`trust-gated`,strictness:[`reclaim-permissive`],attestation:uc([{kind:`vendor-doc`,ref:`GitHub Copilot CLI — MCP configuration`,note:"reads workspace `.mcp.json` or `.github/mcp.json`"},{kind:`vendor-doc`,ref:`GitHub Docs: Adding MCP servers for Copilot CLI`,note:`project-level servers load only after folder-trust confirmation; skipped silently in untrusted folders; under copilot -p they load only in an already-trusted folder unless GITHUB_COPILOT_PROMPT_MODE_WORKSPACE_MCP=true`},lc(gc.coreEditors,`OK deliberately writes no second copy for copilot`)],{version:`copilot CLI 1.0.80`,observedAt:`2026-08-20`}),troubleshooting:sc(`troubleshooting.copilot.shared-workspace-config`,{agent:`copilot`,sourceAgent:`claude`})}),yc({agent:`copilot`,prerequisites:[R(`copilot`,`mcp`,`project`,`config-entry`),R(`copilot`,`mcp`,`user`,`config-entry`)],attestation:uc([lc(gc.coreEditors),lc(gc.writeProjectSkill)])}),bc({agent:`copilot`,attestation:uc([lc(gc.coreEditors),lc(gc.skillInstall)])}),xc(`copilot`)],modes:{external:{requirements:[rc([R(`copilot`,`mcp`,`user`,`config-entry`),R(`copilot`,`mcp`,`project`,`config-entry`)]),ic([R(`copilot`,`skill`,`project`,`skill-bundle-copy`),R(`copilot`,`skill`,`user`,`skill-bundle-copy`)])]},terminal:{requirements:[rc([R(`copilot`,`mcp`,`user`,`config-entry`),R(`copilot`,`mcp`,`project`,`config-entry`)]),ic([R(`copilot`,`skill`,`project`,`skill-bundle-copy`),R(`copilot`,`skill`,`user`,`skill-bundle-copy`)])]},acp:{requirements:[rc([R(`copilot`,`mcp`,`session`,`session-injection`)]),ic([R(`copilot`,`skill`,`project`,`skill-bundle-copy`),R(`copilot`,`skill`,`user`,`skill-bundle-copy`)])]}},acp:fc({acpAgentId:`github-copilot-cli`,featuredOrder:4,harnessCli:null,readsEditorConfig:null,readsEditorConfigAttestation:{confidence:`assumed`,evidence:[mc(`copilot CLI 1.0.80`,"The CLI does read a workspace `.mcp.json`, but nobody has observed the ACP adapter loading the managed entry inside a session. Claiming it would stand our injection down on an unverified read and risk a thread with no OK tools, so the claim stays unmade and OK keeps injecting.")],verifiedAgainst:{version:`1.0.80`,observedAt:`2026-08-20`}},verifiedPosture:null}),external:pc({targetId:`copilot`,knownOrder:4,visible:!1,displayName:`GitHub Copilot`,schemes:[],installUrl:`https://docs.github.com/en/copilot/how-tos/copilot-cli/cli-getting-started`,tagline:`GitHub's terminal-native coding agent.`})}),opencode:nc({id:`opencode`,setupDocSlug:D.opencode,offersConnectionRow:!0,detectionSources:[`cli-on-path:opencode`],satisfiers:[_c({agent:`opencode`,strictness:[`reclaim-permissive`,`injection-functional`],attestation:uc([lc(gc.cliEditors,`XDG config dir; the win32 location is by analogy and unverified`)])}),vc({agent:`opencode`,consentClass:`none`,strictness:[`reclaim-permissive`,`injection-functional`],attestation:uc([lc(gc.cliEditors,`the one project config that is not under a dotdir`)])}),yc({agent:`opencode`,prerequisites:[R(`opencode`,`mcp`,`project`,`config-entry`)],attestation:uc([lc(gc.coreEditors),lc(gc.repairSkills)])}),bc({agent:`opencode`,attestation:uc([lc(gc.coreEditors),lc(gc.skillInstall)])}),xc(`opencode`)],modes:{external:{requirements:[rc([R(`opencode`,`mcp`,`user`,`config-entry`),R(`opencode`,`mcp`,`project`,`config-entry`)]),ic([R(`opencode`,`skill`,`project`,`skill-bundle-copy`),R(`opencode`,`skill`,`user`,`skill-bundle-copy`)])]},terminal:{requirements:[rc([R(`opencode`,`mcp`,`user`,`config-entry`),R(`opencode`,`mcp`,`project`,`config-entry`)]),ic([R(`opencode`,`skill`,`project`,`skill-bundle-copy`),R(`opencode`,`skill`,`user`,`skill-bundle-copy`)])]},acp:{requirements:[rc([R(`opencode`,`mcp`,`session`,`session-injection`),R(`opencode`,`mcp`,`user`,`config-entry`),R(`opencode`,`mcp`,`project`,`config-entry`)]),ic([R(`opencode`,`skill`,`project`,`skill-bundle-copy`),R(`opencode`,`skill`,`user`,`skill-bundle-copy`)])]}},acp:fc({acpAgentId:`opencode`,featuredOrder:5,harnessCli:`opencode`,readsEditorConfig:`opencode`,readsEditorConfigAttestation:uc([lc(gc.cliEditors,`the managed MCP entry OK writes into the opencode config`),mc(`opencode-acp adapter`,`The adapter runs opencode, which loads its own configured MCP servers, so the managed entry is already in the session.`)],hc),verifiedPosture:null}),external:pc({targetId:`opencode`,knownOrder:5,visible:!1,displayName:`OpenCode`,schemes:[],installUrl:`https://opencode.ai`,tagline:`Open-source terminal coding agent; bring any local model.`})}),openclaw:nc({id:`openclaw`,setupDocSlug:D.openclaw,offersConnectionRow:!0,offerOnlyWhenDetected:!0,detectionSources:[`cli-on-path:openclaw`],satisfiers:[_c({agent:`openclaw`,strictness:[`reclaim-permissive`],attestation:uc([lc(gc.cliEditors,"the one two-level server map, nested under `mcp.servers`")])}),tc({agent:`openclaw`,piece:`skill`,scope:`user`,kind:`central-store-copy`,pathId:Fs,probe:ac(`reclaim-permissive`),attestation:uc([lc(gc.coreEditors),lc(gc.skillInstall,`the hub is written only when it already exists`)]),audience:`this-user`,guidance:sc(`guidance.skill.central-store`,{agent:`openclaw`}),troubleshooting:sc(`troubleshooting.openclaw.central-store-missing`,{agent:`openclaw`})})],modes:{external:{requirements:[rc([R(`openclaw`,`mcp`,`user`,`config-entry`)]),ic([R(`openclaw`,`skill`,`user`,`central-store-copy`)])]},terminal:{requirements:[rc([R(`openclaw`,`mcp`,`user`,`config-entry`)]),ic([R(`openclaw`,`skill`,`user`,`central-store-copy`)])]}},external:pc({targetId:`openclaw`,knownOrder:8,visible:!1,displayName:`OpenClaw`,schemes:[],installUrl:`https://openclaw.ai`,tagline:`Open-source agent gateway; runs agents against your MCP servers.`})}),pi:nc({id:`pi`,setupDocSlug:D.pi,offersConnectionRow:!0,detectionSources:[`cli-on-path:pi`],satisfiers:[tc({agent:`pi`,piece:`mcp`,scope:`project`,kind:`managed-file`,pathId:Is(`editor-project-config`,`pi`),probe:ac(`reclaim-permissive`,`injection-functional`),attestation:uc([lc(gc.cliEditors,`OK owns the whole file; currency is a first-line sentinel`),lc(gc.acpRegistry,`the thread provisions this file instead of injecting`)]),audience:`this-project`,guidance:sc(`guidance.mcp.managed-file`,{agent:`pi`}),troubleshooting:sc(`troubleshooting.pi.folder-trust`,{agent:`pi`})}),yc({agent:`pi`,prerequisites:[R(`pi`,`mcp`,`project`,`managed-file`)],attestation:uc([lc(gc.coreEditors),lc(gc.writeProjectSkill)]),troubleshooting:sc(`troubleshooting.pi.folder-trust`,{agent:`pi`})}),bc({agent:`pi`,attestation:uc([lc(gc.coreEditors,`the agent home nests one level below the dotdir`),lc(gc.skillInstall)])})],modes:{external:{requirements:[rc([R(`pi`,`mcp`,`project`,`managed-file`)]),ic([R(`pi`,`skill`,`project`,`skill-bundle-copy`),R(`pi`,`skill`,`user`,`skill-bundle-copy`)])]},terminal:{requirements:[rc([R(`pi`,`mcp`,`project`,`managed-file`)]),ic([R(`pi`,`skill`,`project`,`skill-bundle-copy`),R(`pi`,`skill`,`user`,`skill-bundle-copy`)])]},acp:{requirements:[rc([R(`pi`,`mcp`,`project`,`managed-file`)]),ic([R(`pi`,`skill`,`project`,`skill-bundle-copy`),R(`pi`,`skill`,`user`,`skill-bundle-copy`)])]}},acp:fc({acpAgentId:`pi-acp`,featuredOrder:null,harnessCli:`pi`,readsEditorConfig:`pi`,readsEditorConfigAttestation:uc([mc(`pi-acp@0.0.33`,"Pi has no MCP client at all: it accepts `mcpServers` at session/new, stores them write-only and never connects. Its wiring is a managed extension FILE in the project, which OK provisions instead of injecting — the same mapping, a different shape."),lc(gc.threadManager,`the bridge route that provisions the extension instead of injecting`)],{version:`0.0.33`,observedAt:`2026-08-20`}),verifiedPosture:`autonomous`}),external:pc({targetId:`pi`,knownOrder:6,visible:!1,displayName:`Pi`,schemes:[],installUrl:`https://pi.dev`,tagline:`Minimal open-source terminal coding agent, extensible in TypeScript.`})}),antigravity:nc({id:`antigravity`,setupDocSlug:D.antigravity,offersConnectionRow:!0,offerOnlyWhenDetected:!0,detectionSources:[`cli-on-path:antigravity`],satisfiers:[_c({agent:`antigravity`,strictness:[`reclaim-permissive`],attestation:uc([lc(gc.cliEditors,`one user-global file shared by the IDE, the app and the CLI; per project you can only filter it`)])}),bc({agent:`antigravity`,attestation:uc([lc(gc.coreEditors),lc(gc.skillInstall)])})],modes:{external:{requirements:[rc([R(`antigravity`,`mcp`,`user`,`config-entry`)]),ic([R(`antigravity`,`skill`,`user`,`skill-bundle-copy`)])]},terminal:{requirements:[rc([R(`antigravity`,`mcp`,`user`,`config-entry`)]),ic([R(`antigravity`,`skill`,`user`,`skill-bundle-copy`)])]}},external:pc({targetId:`antigravity`,knownOrder:7,visible:!1,displayName:`Antigravity`,schemes:[],installUrl:`https://antigravity.google`,tagline:"Google's agentic IDE + `agy` terminal agent."})}),"lm-studio":nc({id:`lm-studio`,setupDocSlug:D[`lm-studio`],offersConnectionRow:!0,offerOnlyWhenDetected:!0,detectionSources:[],satisfiers:[_c({agent:`lm-studio`,strictness:[`reclaim-permissive`],installability:`not-installable`,notInstallableReason:`no-non-interactive-verb`,attestation:uc([lc(gc.cliEditors,`two candidate locations, resolved against what already exists`),{kind:`upstream-issue`,ref:`lmstudio-ai/lmstudio-bug-tracker#1371`,note:`documented config path differs from the one the app reads on macOS`},lc(gc.presenceProbes,`deliberately absent from the presence probes`)]),troubleshooting:sc(`troubleshooting.lm-studio.config-path-mismatch`,{agent:`lm-studio`})})],modes:{external:{requirements:[rc([R(`lm-studio`,`mcp`,`user`,`config-entry`)]),ic([])]}}}),hermes:nc({id:`hermes`,setupDocSlug:D.hermes,offersConnectionRow:!0,offerOnlyWhenDetected:!0,detectionSources:[`cli-on-path:hermes`],satisfiers:[_c({agent:`hermes`,strictness:[`reclaim-permissive`],attestation:uc([lc(gc.cliEditors,`the one YAML target; the whole config is a single user-global file`)])})],modes:{external:{requirements:[rc([R(`hermes`,`mcp`,`user`,`config-entry`)]),ic([])]},terminal:{requirements:[rc([R(`hermes`,`mcp`,`user`,`config-entry`)]),ic([])]}},external:pc({targetId:`hermes`,knownOrder:9,visible:!1,displayName:`Hermes`,schemes:[],installUrl:`https://hermes-agent.nousresearch.com`,tagline:`Nous Research's terminal coding agent.`})}),gemini:nc({id:`gemini`,setupDocSlug:null,detectionSources:[`harness-bin:gemini`],satisfiers:[xc(`gemini`)],modes:{acp:{requirements:[rc([R(`gemini`,`mcp`,`session`,`session-injection`)]),ic([])]}},acp:fc({acpAgentId:`gemini`,featuredOrder:2,harnessCli:`gemini`,readsEditorConfig:null,readsEditorConfigAttestation:uc([lc(gc.coreEditors,`gemini reaches OK as an ACP agent only; it has no editor config target`)],hc),verifiedPosture:null})})};function Cc(e){return Sc[e]}const wc=Object.values(Sc).flatMap(e=>e.satisfiers),Tc=new Map(wc.map(e=>[e.id,e]));function Ec(e){return Tc.get(e)}const Dc=Object.values(Sc).flatMap(e=>e.acp===void 0?[]:[{record:e,acp:e.acp}]).sort((e,t)=>e.acp.acpAgentId.localeCompare(t.acp.acpAgentId)),Oc=Dc.filter(({acp:e})=>e.featuredOrder!==null).sort((e,t)=>(e.acp.featuredOrder??0)-(t.acp.featuredOrder??0)).map(({acp:e})=>e.acpAgentId),kc=Object.fromEntries(Dc.flatMap(({acp:e})=>e.harnessCli===null?[]:[[e.acpAgentId,e.harnessCli]])),Ac=Object.fromEntries(Dc.flatMap(({acp:e})=>e.harnessReadsEditorConfig===null?[]:[[e.acpAgentId,e.harnessReadsEditorConfig]]));function jc(e){return Dc.find(({acp:t})=>t.acpAgentId===e)?.record.id}Object.fromEntries(Dc.flatMap(({acp:e})=>e.verifiedPosture===null?[]:[[e.acpAgentId,e.verifiedPosture]]));const Mc=Object.values(Sc).flatMap(e=>e.external===void 0?[]:[e.external]).sort((e,t)=>e.knownOrder-t.knownOrder),Nc=Mc.map(({targetId:e,displayName:t,appBrandName:n,schemes:r,installUrl:i,platforms:a,tagline:o})=>({id:e,displayName:t,...n===void 0?{}:{appBrandName:n},schemes:r,installUrl:i,platforms:a,...o===void 0?{}:{tagline:o}})),Pc=new Set(Mc.filter(e=>e.visible).map(e=>e.targetId));Nc.filter(e=>Pc.has(e.id)),ne.filter(e=>Sc[e].offersConnectionRow);const Fc=new Map(Object.values(Sc).flatMap(e=>e.external===void 0?[]:[[e.external.targetId,e.id]]));function Ic(e){return Fc.get(e)}new Map(Object.values(Sc).flatMap(e=>e.modes.terminal===void 0?[]:[[e.id,e.id]])),Object.fromEntries(Object.values(Sc).flatMap(e=>{let t=e.satisfiers.find(e=>e.piece===`mcp`&&e.scope===`project`&&e.consentClass!==`none`)?.consentClass;return t===void 0?[]:[[e.id,t]]}));const Lc=[`not-installable`,`no-writer`,`surface-missing`,`foreign-artifact`,`write-declined`,`write-failed`,`executor-threw`,`unrecognized-outcome`,`dependency-failed`],Rc=[`written`,`overwritten`,`removed`,`unchanged`,`no-op`],zc=new Set(_s);function Bc(e){return typeof e==`object`&&!!e}function Vc(e){if(!Bc(e))return null;let{action:t,errorId:n}=e;if(typeof t!=`string`||!zc.has(t))return null;let r=typeof n==`string`&&Lc.includes(n)?n:void 0;return r===void 0?{action:t}:{action:t,errorId:r}}function Hc(e,t){return{satisfierId:e.satisfierId,agentId:e.agentId,piece:e.piece,scope:e.scope,kind:e.kind,...e.pathId===void 0?{}:{pathId:e.pathId},desired:e.desired,action:t.action,...t.errorId===void 0?{}:{errorId:t.errorId}}}async function Uc(e,t){if(t.alreadyInDesiredState)return{action:`unchanged`};if(t.installability===`not-installable`)return{action:`skipped-unsupported`,errorId:`not-installable`};if(t.installability===`user-completes`)return{action:`handed-off`};let n;try{n=await e(t)}catch{return{action:`failed`,errorId:`executor-threw`}}return Vc(n)??{action:`failed`,errorId:`unrecognized-outcome`}}async function Wc(e,t){let n=Bc(e)&&Array.isArray(e.steps)?e.steps:[],r=Bc(e)&&Array.isArray(e.conflicts)?e.conflicts:[],i=Bc(e)&&Array.isArray(e.withheld)?e.withheld:[],a=[],o=new Set;for(let e of n){if(!Bc(e)||typeof e.satisfierId!=`string`)continue;let n=e;if(n.dependsOn.some(e=>o.has(e))){o.add(n.satisfierId),a.push(Hc(n,{action:`skipped-prerequisite`,errorId:`dependency-failed`}));continue}let r=await Uc(t,n);Rc.includes(r.action)||o.add(n.satisfierId),a.push(Hc(n,r))}return{actions:a,conflicts:r,withheld:i}}const Gc=[{id:`mcp-preapproval`,piece:`mcp`,scope:`project`,requiredStrictness:`pre-approval-exact`,revokedByForeignEntry:!1},{id:`tool-autoapprove`,piece:`mcp`,requiredStrictness:`pre-approval-exact`,revokedByForeignEntry:!0}];Gc.map(e=>e.id);const Kc={satisfied:{counts:!0,exception:null},"present-consent-unknown":{counts:!0,exception:`info`},absent:{counts:!1,exception:null},foreign:{counts:!1,exception:`warning`},"foreign-replaceable":{counts:!1,exception:`warning`},drifted:{counts:!1,exception:`warning`},excluded:{counts:!1,exception:`info`},"structural-na":{counts:!1,exception:`info`},undetected:{counts:!1,exception:null},unprobeable:{counts:!0,exception:`info`},unprobed:{counts:!1,exception:`info`}};I([`count-unverified`,`not-count`]);const qc={acp:{unprobed:`count-unverified`},terminal:{unprobed:`count-unverified`},external:{unprobed:`not-count`}};I([`acp-catalog-supported`,`harness-cli-on-path`,`os-scheme-handler`]);const Jc={acp:{signal:`acp-catalog-supported`,unresolved:`show`,negativeOutranksOverride:!0},terminal:{signal:`harness-cli-on-path`,unresolved:`show`,negativeOutranksOverride:!1},external:{signal:`os-scheme-handler`,unresolved:`hide`,negativeOutranksOverride:!1}};function Yc(e){return{env:e,satisfiers:{}}}const Xc={detected:[],probed:!1};function Zc(e){return typeof e==`object`&&!!e}function Qc(e,t){if(!Zc(e))return;let{satisfiers:n}=e;if(!Zc(n))return;let r=n[t];if(!Zc(r))return;let{state:i,strictness:a,sharedWith:o}=r;if(typeof i!=`string`||i.length===0)return;let s=Array.isArray(a)?a.filter(e=>typeof e==`string`):void 0,c=Array.isArray(o)?o.filter(e=>typeof e==`string`&&xs(e)):void 0;return{state:i,...s===void 0?{}:{strictness:s},...c===void 0||c.length===0?{}:{sharedWith:c}}}function $c(e,t){if(!Zc(e))return!1;let{detected:n}=e;return Array.isArray(n)&&n.includes(t)}function el(e,t){return e.probe.mode===`unprobeable`?`unprobeable`:Qc(t,e.id)?.state??`unprobed`}function tl(e){return fs(e)?Kc[e]:Kc.unprobed}function nl(e,t){let n=e.filter(e=>{let n=Ec(e);return n===void 0||!tl(el(n,t)).counts});return n.length===e.length?n:[]}function rl(e){return tl(e).exception===`warning`}function il(e){return e.state===`foreign`?`foreign`:e.state===`structural-na`?`structural-na`:e.installability===`not-installable`?`not-installable`:e.agentFolded?`agent-undetected`:null}function al(e,t){let n=t?.probed===!0?$c(t,e.id):null;return{detected:n,folded:e.offerOnlyWhenDetected&&n===!1}}function ol(e,t){return(Qc(t,e.id)?.sharedWith??[]).filter(t=>t!==e.agent)}const sl=Es.filter(e=>e!==`session`);function cl(e){return us.includes(e)}function ll(e,t,n){let r=[];for(let i of e.satisfiers){if(!cl(i.kind))continue;let a=el(i,t),o=t?.satisfiers?.[i.id]?.path,s=tl(a),c=nl(i.prerequisites,t),l=il({state:a,installability:i.installability,agentFolded:n});r.push({satisfierId:i.id,agentId:e.id,piece:i.piece,scope:i.scope,kind:i.kind,...i.pathId===void 0?{}:{pathId:i.pathId},...o===void 0?{}:{resolvedPath:o},audience:i.audience,state:a,checked:s.counts,exception:s.exception,folded:a===`undetected`,enabled:l===null,disabledReason:l,sharedWith:i.sharedWith,sharedFolderWith:ol(i,t),prerequisites:i.prerequisites,unmetPrerequisites:c,consentClass:i.consentClass,installability:i.installability,...i.guidance===void 0?{}:{guidance:i.guidance},...i.followup===void 0?{}:{followup:i.followup},troubleshooting:i.troubleshooting})}return r}function ul(e){let t=[];for(let n of sl){let r=e.filter(e=>e.scope===n);r.length!==0&&t.push({scope:n,cells:r})}return t}function dl(e,t,n){let{detected:r,folded:i}=al(e,n),a=ll(e,t,i);return{agentId:e.id,detected:r,folded:i,setupDocSlug:e.setupDocSlug,scopes:ul(a)}}function fl(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`&&xs(e)):ys}function pl(e={}){let{agentIds:t,probes:n,detection:r}=e;return{rows:fl(t).map(e=>Sc[e]).filter(e=>e!==void 0).map(e=>dl(e,n,r))}}function ml(e,t){let n=e.requirements.find(e=>e.piece===t);return n===void 0?{status:`not-assessed`,confidence:null}:{status:n.status,confidence:n.confidence}}function hl(e,t){let n=xs(t.agentId)&&t.verdict!==`not-registered`?t.agentId:null,r=ml(t,`mcp`),i=ml(t,`skill`);return{site:e,mode:t.mode,verdict:t.verdict,agent:n,registered:n!==null,mcp:r.status,skill:i.status,mcpConfidence:r.confidence,skillConfidence:i.confidence}}const gl={agent:bs},_l={"followup.enable-manually":{params:vo(gl)},"guidance.mcp.user-config":{params:vo(gl)},"guidance.mcp.project-config":{params:vo(gl)},"guidance.mcp.session-injection":{params:vo(gl)},"guidance.mcp.managed-file":{params:vo(gl)},"guidance.skill.project":{params:vo(gl)},"guidance.skill.user":{params:vo(gl)},"guidance.skill.central-store":{params:vo(gl)},"troubleshooting.claude.project-entry-not-approved":{params:vo(gl)},"troubleshooting.claude-desktop.per-tool-approval":{params:vo(gl)},"troubleshooting.cursor.project-entry-not-loaded":{params:vo({...gl,server:j().optional()})},"troubleshooting.codex.desktop-project-config":{params:vo({...gl,honoredByDesktop:N()})},"troubleshooting.codex.folder-trust":{params:vo(gl)},"troubleshooting.copilot.shared-workspace-config":{params:vo({...gl,sourceAgent:bs})},"troubleshooting.openclaw.central-store-missing":{params:vo(gl)},"troubleshooting.pi.folder-trust":{params:vo(gl)},"troubleshooting.lm-studio.config-path-mismatch":{params:vo(gl)}};Object.keys(_l).sort();const vl=[`present`,`absent`],yl={steps:[],conflicts:[],withheld:[]};function bl(e){return typeof e==`object`&&!!e}function xl(e){return typeof e==`string`&&vl.includes(e)}function Sl(e){let t=new Map;if(!bl(e)||!Array.isArray(e.rows))return t;for(let n of e.rows)if(!(!bl(n)||!Array.isArray(n.scopes))){for(let e of n.scopes)if(!(!bl(e)||!Array.isArray(e.cells)))for(let n of e.cells)bl(n)&&typeof n.satisfierId==`string`&&t.set(n.satisfierId,n)}return t}function Cl(e,t){return[...e].filter(e=>e.pathId===t)}var wl=class{cells;drafts=new Map;conflicts=[];seq=0;constructor(e){this.cells=Sl(e)}conflict(e){let t=[];for(let n of e.satisfierIds){let e=this.cells.get(n)?.agentId;e!==void 0&&!t.includes(e)&&t.push(e)}for(let n of e.agentIds??[])t.includes(n)||t.push(n);this.conflicts.push({kind:e.kind,satisfierIds:e.satisfierIds,agentIds:t,...e.pathId===void 0?{}:{pathId:e.pathId},...e.blockedReason===void 0?{}:{blockedReason:e.blockedReason}})}admit(e){if(Array.isArray(e))for(let t of e){if(!bl(t)||typeof t.satisfierId!=`string`||!xl(t.desired)){this.conflict({kind:`malformed-intent`,satisfierIds:[]});continue}let e=t.satisfierId,n=this.cells.get(e);if(n===void 0){this.conflict({kind:`unknown-satisfier`,satisfierIds:[e]});continue}let r=n.disabledReason;if(r!==null&&r!==`not-installable`&&(t.desired===`present`||r===`foreign`)){this.conflict({kind:`blocked-satisfier`,satisfierIds:[e],blockedReason:r});continue}let i=this.drafts.get(e);if(i===void 0){this.drafts.set(e,{cell:n,desired:t.desired,origin:`requested`,seq:this.seq++});continue}i.desired!==t.desired&&this.conflict({kind:`contradictory-intents`,satisfierIds:[e]})}}expandPrerequisites(){let e=[...this.drafts.values()].filter(e=>e.desired===`present`),t=new Set;for(;e.length>0;){let n=e.shift();if(n===void 0||t.has(n.cell.satisfierId))continue;t.add(n.cell.satisfierId);let r=n.cell.satisfierId,i=n.cell.unmetPrerequisites;if(i.length>0&&!i.some(e=>this.drafts.has(e))){let t=[],n=[];for(let e of i){let i=this.cells.get(e);if(i===void 0){this.conflict({kind:`unknown-satisfier`,satisfierIds:[e,r]});continue}if(i.disabledReason!==null){t.push({id:e,reason:i.disabledReason});continue}if(rl(i.state)){t.push({id:e,reason:`foreign-replaceable`});continue}n.push(i)}let a=El(n),o=a!==void 0;if(a!==void 0){let t={cell:a,desired:`present`,origin:`prerequisite`,seq:this.seq++};this.drafts.set(a.satisfierId,t),e.push(t)}if(!o)for(let{id:e,reason:n}of t)this.conflict({kind:`prerequisite-unavailable`,satisfierIds:[e,r],blockedReason:n})}}}checkSharedCopies(){let e=[...this.drafts.values()],t=new Map;for(let n of e){let e=n.cell.pathId;if(e===void 0)continue;let r=t.get(e);r===void 0?t.set(e,[n]):r.push(n)}for(let[e,n]of t)n.length<2||n.every(e=>e.desired===n[0]?.desired)||this.conflict({kind:`contradictory-intents`,satisfierIds:n.map(e=>e.cell.satisfierId),pathId:e});for(let t of e){if(t.desired!==`absent`)continue;let{cell:e}=t,n=e.pathId;if(n!==void 0&&e.sharedWith.length>0){let t=Cl(this.cells.values(),n).filter(t=>t.satisfierId!==e.satisfierId);this.reportStrandedPeers(e,t,e.sharedWith,n)}e.sharedFolderWith.length>0&&this.reportStrandedPeers(e,this.folderPeersOf(e),e.sharedFolderWith)}}folderPeersOf(e){return[...this.cells.values()].filter(t=>t.satisfierId!==e.satisfierId&&t.piece===e.piece&&t.scope===e.scope&&e.sharedFolderWith.includes(t.agentId))}reportStrandedPeers(e,t,n,r){let i=t.filter(e=>e.checked).filter(e=>this.drafts.get(e.satisfierId)?.desired!==`absent`).map(e=>e.satisfierId),a=n.filter(e=>!t.some(t=>t.agentId===e));(i.length!==0||a.length!==0)&&this.conflict({kind:`unresolved-shared-copy`,satisfierIds:[e.satisfierId,...i],agentIds:a,...r===void 0?{}:{pathId:r}})}anotherPrerequisiteHolds(e,t){return e.cell.prerequisites.some(e=>{if(e===t)return!1;let n=this.drafts.get(e);return n===void 0?this.cells.get(e)?.checked===!0:n.desired===`present`})}order(){let e=new Map;for(let t of this.drafts.keys())e.set(t,[]);let t=(t,n)=>{let r=e.get(n);r!==void 0&&!r.includes(t)&&r.push(t)};for(let e of this.drafts.values()){let n=e.cell.satisfierId;for(let r of e.cell.prerequisites){let i=this.drafts.get(r);i!==void 0&&(e.desired===`present`&&i.desired===`present`?t(r,n):e.desired===`absent`&&i.desired===`absent`?t(n,r):e.desired===`present`&&i.desired===`absent`&&!this.anotherPrerequisiteHolds(e,r)&&this.conflict({kind:`prerequisite-removed`,satisfierIds:[r,n]}))}}let n=[],r=new Set,i=[...this.drafts.values()].sort((e,t)=>e.seq-t.seq),a=!0;for(;a;){a=!1;for(let t of i){let i=t.cell.satisfierId;r.has(i)||(e.get(i)??[]).every(e=>r.has(e))&&(n.push(t),r.add(i),a=!0)}}let o=i.filter(e=>!r.has(e.cell.satisfierId));return o.length>0&&this.conflict({kind:`prerequisite-cycle`,satisfierIds:o.map(e=>e.cell.satisfierId)}),{steps:n.map(t=>this.toStep(t,e)),blocked:new Set(o.map(e=>e.cell.satisfierId))}}toStep(e,t){let{cell:n}=e;return{satisfierId:n.satisfierId,agentId:n.agentId,piece:n.piece,scope:n.scope,kind:n.kind,...n.pathId===void 0?{}:{pathId:n.pathId},desired:e.desired,origin:e.origin,dependsOn:t.get(n.satisfierId)??[],state:n.state,installability:n.installability,alreadyInDesiredState:n.checked===(e.desired===`present`)}}finish(e){let t=new Set(e.blocked);for(let e of this.conflicts)for(let n of e.satisfierIds)this.drafts.has(n)&&t.add(n);if(this.conflicts.length>0)for(let e of this.drafts.keys())t.add(e);for(let n of e.steps)n.dependsOn.some(e=>t.has(e))&&t.add(n.satisfierId);return{steps:e.steps.filter(e=>!t.has(e.satisfierId)),conflicts:this.conflicts,withheld:[...t]}}};function Tl(e){return(e.sharedWith.length>0?2:0)+(e.consentClass===`none`?0:1)}function El(e){let t;for(let n of e)(t===void 0||Tl(n)<Tl(t))&&(t=n);return t}function Dl(e,t){if(!Array.isArray(e)||e.length===0)return yl;let n=new wl(t);return n.admit(e),n.expandPrerequisites(),n.checkSharedCopies(),n.finish(n.order())}const Ol=wc.flatMap(e=>e.probe.mode===`probeable`?[{satisfierId:e.id,agent:e.agent,piece:e.piece,scope:e.scope,kind:e.kind,pathId:e.pathId??null,strictness:e.probe.strictness}]:[]);Ol.map(e=>e.satisfierId);function kl(e){if(e===void 0)return Ol;let t=new Set(e);return Ol.filter(e=>t.has(e.agent))}async function Al(e,t){try{return await e(t)}catch{return null}}function jl(e,t){if(t===void 0)return;let n=t.filter(t=>e.strictness.includes(t));return n.length===0?void 0:n}function Ml(e,t){if(t===null||typeof t.state!=`string`||t.state.length===0)return{state:`unprobed`};let n=jl(e,t.strictness),r=t.sharedWith?.filter(t=>t!==e.agent),i=typeof t.path==`string`&&t.path.length>0?t.path:void 0;return{state:t.state,...n===void 0?{}:{strictness:n},...r===void 0||r.length===0?{}:{sharedWith:r},...i===void 0?{}:{path:i}}}async function Nl(e){let t={};for(let n of kl(e.agentIds))t[n.satisfierId]=Ml(n,await Al(e.resolve,n));return{env:e.env,satisfiers:t}}const Pl={verified:3,unverifiable:2,unverified:1};function Fl(e,t){let n=Jc[e],r=typeof t==`boolean`?t:null;return{signal:n.signal,resolved:r,show:r??n.unresolved===`show`}}function Il(e,t,n){let r=Ec(e);if(r===void 0)return{id:e,state:`absent`,counts:!1,confidence:`unverified`,exception:Kc.absent.exception,consentClass:`none`,troubleshooting:[]};let i=el(r,n),a=!fs(i)||i===`unprobed`,o=qc[t].unprobed===`count-unverified`;return{id:e,state:i,counts:a?o:tl(i).counts,confidence:a?`unverified`:i===`unprobeable`?`unverifiable`:`verified`,exception:tl(i).exception,consentClass:r.consentClass,...r.guidance===void 0?{}:{guidance:r.guidance},...r.followup===void 0?{}:{followup:r.followup},troubleshooting:r.troubleshooting}}function Ll(e,t,n){let r=e.satisfiedByAny.map(e=>Il(e,t,n));if(r.length===0)return{piece:e.piece,level:e.level,status:`nothing-required`,confidence:null,satisfiedBy:null,options:r};let i=null;for(let e of r)e.counts&&(i===null||Pl[e.confidence]>Pl[i.confidence])&&(i=e);return{piece:e.piece,level:e.level,status:i===null?`unmet`:`met`,confidence:i?.confidence??null,satisfiedBy:i?.id??null,options:r}}const Rl=[`absent`,`structural-na`];function zl(e,t){let n=[];for(let r of Gc){let i=e.satisfiers.filter(e=>e.piece===r.piece&&e.kind!==`session-injection`&&(r.scope===void 0||e.scope===r.scope));r.revokedByForeignEntry&&i.some(e=>!Rl.includes(el(e,t))&&!Bl(Qc(t,e.id),r.requiredStrictness))||i.some(e=>e.probe.mode!==`probeable`||!e.probe.strictness.includes(r.requiredStrictness)||!tl(el(e,t)).counts?!1:Bl(Qc(t,e.id),r.requiredStrictness))&&n.push(r.id)}return n}function Bl(e,t){return e?.strictness?.includes(t)===!0}function Vl(e){let{agentId:t,mode:n,probes:r,modeSignal:i}=e,a=xs(t)?Cc(t):void 0;if(a===void 0)return{agentId:t,mode:n,verdict:`not-registered`,visibility:{...Fl(n,i),show:!0},requirements:[],grantedCapabilities:[],modeCaveats:[]};let o=Fl(n,i),s=a.modes[n];if(s===void 0)return{agentId:t,mode:n,verdict:`mode-not-available`,visibility:o,requirements:[],grantedCapabilities:[],modeCaveats:[]};let c=s.requirements.map(e=>Ll(e,n,r)),l=c.some(e=>e.level===`required`&&e.status===`unmet`),u=c.some(e=>e.status===`unmet`);return{agentId:t,mode:n,verdict:l?`blocked`:u?`ready-with-nudges`:`ready`,visibility:o,requirements:c,grantedCapabilities:zl(a,r),modeCaveats:s.caveats}}const Hl=F({path:P(xo([j(),M()])),message:j(),issueCode:j()});Co(`code`,[F({code:L(`SCHEMA_INVALID`),issues:P(Hl)}),F({code:L(`WRITE_ERROR`),detail:j()})]);const Ul=[`text`,`number`,`boolean`,`date`,`list`,`object`];I(Ul);const Wl=xo([j(),M(),N()]);function Gl(e){if(Array.isArray(e)){for(let[t,n]of e.entries()){let e=Gl(n);if(e!==null)return[t,...e]}return null}if(typeof e==`object`&&e){if(Object.hasOwn(e,`__proto__`))return[`__proto__`];for(let[t,n]of Object.entries(e)){let e=Gl(n);if(e!==null)return[t,...e]}}return null}function Kl(e){return typeof e==`object`&&e&&Object.hasOwn(e,`__proto__`)?[`__proto__`]:null}function ql(e,t){return ss((e,n)=>{let r=t(e);return r!==null&&n.addIssue({code:`custom`,path:r,message:`Unsupported frontmatter key: __proto__`}),e},ko(j(),e)).nonoptional()}function Jl(e){return ql(e,Gl)}function Yl(e){return ql(e,Kl)}const Xl=ts(()=>xo([Wl.transform(e=>String(e)),Yl(Zl),P(Xl)])),Zl=ts(()=>xo([j(),M(),N(),P(Xl),Yl(Zl)]));function Ql(e){if(Array.isArray(e)){let t=[];for(let n of e)n!==null&&t.push(Ql(n));return t}if(typeof e==`object`&&e){let t={};for(let[n,r]of Object.entries(e))t[n]=r===null?``:Ql(r);return t}return e}const $l=ss(Ql,ko(j(),Zl)),eu=Jl(xo([Zl,co()]));function tu(e){return!!(e===null||typeof e==`string`&&e===``||Array.isArray(e)&&e.length===0)}function nu(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!nu(e[n],t[n]))return!1;return!0}if(e!==null&&t!==null&&typeof e==`object`&&typeof t==`object`&&!Array.isArray(e)&&!Array.isArray(t)){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.hasOwn(t,r)||!nu(e[r],t[r]))return!1;return!0}return!1}const ru=/^---[ \t]*\r?\n([\s\S]*?\r?\n)?---[ \t]*(\r?\n|$)/;function iu(e){let t=e.match(ru);return t?{frontmatter:t[0],body:e.slice(t[0].length)}:{frontmatter:``,body:e}}function au(e,t){return e?t===``||/\r?\n$/.test(e)?e+t:e+(e.includes(`\r
|
|
66
|
+
`)?`\r
|
|
67
|
+
`:`
|
|
68
|
+
`)+t:t}function ou(e){if(e===``)return``;let t=e.match(ru);return t?(t[1]??``).replace(/\r?\n$/,``):e}var su=p();const cu={defaultKeyType:`PLAIN`,defaultStringType:`PLAIN`,lineWidth:0};function lu(e){if(e.trim()===``)return{doc:new su.Document({}),map:{}};let t;try{t=(0,su.parseDocument)(e)}catch(e){let t=e instanceof Error?e.message:String(e);return{doc:new su.Document({}),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=$l.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 uu(e){return Object.keys(e).length===0?``:new su.Document(e).toString(cu)}function du(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function fu(e,t,n){if(Array.isArray(n)){let r=e.createNode(n),i=(0,su.isSeq)(t)?t.flow:void 0;return i!==void 0&&(r.flow=i),r}if(du(n)){let r=e.createNode(n),i=(0,su.isMap)(t)?t.flow:void 0;return i!==void 0&&(r.flow=i),r}return n}function pu(e){return e===``?``:`---\n${e.endsWith(`
|
|
69
|
+
`)?e.slice(0,-1):e}\n---\n`}function mu(e){let t=e.contents;return typeof t!=`object`||!t||!(`items`in t)?[]:t.items.map(e=>{let t=e.key;return typeof t==`string`?t:t&&typeof t==`object`&&`value`in t&&typeof t.value==`string`?t.value:null}).filter(e=>e!==null)}function hu(e){let t=e.match(ru);return t?{fenced:t[0],body:e.slice(t[0].length)}:{fenced:``,body:e}}function gu(e){if(e.trim()===``)return{doc:new su.Document({}),map:{}};let t;try{t=(0,su.parseDocument)(e,{uniqueKeys:!1})}catch(e){let t=e instanceof Error?e.message:String(e);return{doc:new su.Document({}),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=$l.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 _u(e){return e===``?{doc:new su.Document({}),map:{}}:gu(ou(e))}function vu(e){let{fenced:t}=hu(e),{map:n}=_u(t);return n??{}}function yu(e){if(e.contents==null||!(`items`in e.contents)){let t=e.createNode({});return e.contents=t,t}return e.contents}function bu(e){let t=e.contents;return!t||!(`items`in t)||(t.items?.length??0)===0?``:pu(e.toString(cu))}function xu(e){let t=new TextEncoder().encode(e).byteLength;return t>65536?{kind:`region_too_large`,bytes:t,limit:65536}:null}function Su(e){let t=bu(e),n=xu(t);return n?{ok:!1,error:n}:{ok:!0,nextFenced:t}}function Cu(e,t){if(Object.hasOwn(t,`frontmatter`))return{ok:!1,error:{kind:`reserved_key`,key:`frontmatter`}};let{doc:n,map:r}=_u(e);if(r===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};let i=eu.safeParse(t);if(!i.success)return{ok:!1,error:{kind:`invalid_value`,key:String(i.error.issues[0]?.path[0]??``),reason:i.error.issues[0]?.message??`invalid value`}};try{yu(n);for(let[e,t]of Object.entries(i.data)){if(t===null){n.delete(e);continue}n.set(e,fu(n,n.get(e,!0),t))}return Su(n)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function wu(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(16).padStart(8,`0`)}const Tu=[`https`,`http`,`mailto`,`tel`,`ftp`,`sms`],Eu=Tu.map(e=>`${e}:`).join(`|`);RegExp(`^(?:${Eu}|\\/|#|\\?|\\.\\/|\\.\\.\\/)`,`i`);function Du(e){let t=e.trim();if(t===``)return!0;let n=t.indexOf(`:`);if(n===-1)return!0;let r=t.indexOf(`/`),i=t.indexOf(`?`),a=t.indexOf(`#`);return n>Math.min(r===-1?1/0:r,i===-1?1/0:i,a===-1?1/0:a)}function Ou(){return typeof process>`u`||!process.env?!1:process.env.NODE_ENV===`development`||process.env.NODE_ENV===`test`}function ku(e){let t=e.lastIndexOf(`/`);return t===-1?``:t===0?`/`:e.slice(0,t)}function Au(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 ju(e,t){return t??e}function Mu(e,t){if(typeof e!=`string`||e===``||!t||e.startsWith(`/`)||!Du(e))return e;let n=Au(ku(t),e);return n===``||n===`..`||n.startsWith(`../`)?(Ou()&&console.warn(`[resolve-image-url] doc-relative path escapes contentDir; emitting raw URL: ${e} (from sourcePath ${t})`),e):`/${n}`}function Nu(e,t){return e>=(t===`leading`?2:1)?e:0}function Pu(e){let t=e.charCodeAt(0)===65279?e.slice(1):e,n=t.replace(/^\n+/,``);return n.replace(/\n+$/,``).length===0?{leading:0,trailing:0}:{leading:Nu(t.length-n.length,`leading`),trailing:Nu(n.length-n.replace(/\n+$/,``).length-1,`trailing`)}}function Fu(e,t){let n={line:e,column:1,offset:t};return{type:`paragraph`,children:[],position:{start:n,end:{...n}}}}function Iu(e,t){let n=e.children,r=n.length===0||t.leading===void 0?0:Nu(t.leading.length,`leading`),i=n.length===0||t.trailing===void 0?0:Nu(t.trailing.length-1,`trailing`);if(r===0&&i===0)return t;let a=n[n.length-1]?.position?.end,o=[],s=[];if(r>0)for(let e=0;e<r;e++)o.push(Fu(1+e,e));if(i>0&&typeof a?.offset==`number`&&typeof a.line==`number`)for(let e=0;e<i;e++)s.push(Fu(a.line+1+e,a.offset+1+e));if(o.length===0&&s.length===0||(e.children=[...o,...n,...s],o.length>0&&delete t.leading,s.length>0&&delete t.trailing,t.bom!==void 0||t.leading!==void 0||t.trailing!==void 0))return t;e.data!==void 0&&delete e.data.sourceDocBoundary}function Lu(e,t){let n=0;for(let r=0;r<t.length&&n<e.length;r++)e[n]===t[r]&&n++;return n===e.length}const Ru=new Set([`sourceRaw`,`sourceDirty`,`position`]),zu=new Set([`jsxComponent`,`table`,`tableRow`,`tableCell`,`tableHeader`,`list`,`listItem`,`blockquote`,`codeBlock`,`heading`]),Bu={type:`__br__`},Vu=/^<br\s*\/?>$/i;function Hu(e){let t=qu(e,Hu);return(t.type===`tableCell`||t.type===`tableHeader`)&&t.content?{...t,content:Uu(t.content)}:t}function Uu(e){let t=[];for(let n of e){let e=Wu(n);e.length!==0&&(t.length>0&&t.push(Bu),t.push(...e))}return t}function Wu(e){return e.text!==void 0||e.type===`hardBreak`||e.type===`jsxInline`?[e]:!e.content||e.content.length===0?[]:e.content.some(e=>e.text===void 0&&e.type!==`hardBreak`&&e.type!==`jsxInline`&&!!e.content)?Uu(e.content):e.content}function Gu(e){return e.type===`hardBreak`||e.type===Bu.type||e.text!==void 0&&Vu.test(e.text.trim())?Bu:qu(e,Gu)}const Ku=[{label:`table-cell-block-flatten`,severity:`pm-model-caused`,rationale:`GFM table cells have no block spelling; a block placed in a cell is flattened to inline on serialize, so a cell-with-blocks and a cell-with-inline describe the same persisted document.`,proofPointer:`markdown/table-cell-flatten.ts flattenCellBlocks (table-cell-flatten-dropped-block event)`,canonicalize:Hu},{label:`void-hardbreak-br`,severity:`serializer-caused`,rationale:`A void hardBreak inside a table cell or heading serializes to a literal <br /> that a fresh parse keeps as text; the node form and the literal form are the same break.`,proofPointer:`markdown/void-br-promoter.ts + markdown/to-markdown-handlers.ts break handler`,canonicalize:Gu}];function qu(e,t){return e.content?{...e,content:e.content.map(t)}:e}function Ju(e,t){let n={};e.type!==void 0&&(n.type=e.type),e.text!==void 0&&(n.text=e.text);let r=Yu(e.attrs,t);return r&&(n.attrs=r),e.marks&&e.marks.length>0&&(n.marks=[...e.marks].map(e=>({type:e.type,attrs:Yu(e.attrs,t)})).sort((e,t)=>Zu(e).localeCompare(Zu(t)))),e.content&&e.content.length>0&&(n.content=e.content.map(e=>Ju(e,t))),n}function Yu(e,t){if(!e)return null;let n={};for(let r of Object.keys(e).sort()){if(Ru.has(r)||t?.(r))continue;let i=e[r];i!=null&&(n[r]=t?Xu(i,t):i)}return Object.keys(n).length>0?n:null}function Xu(e,t){if(Array.isArray(e))return e.map(e=>Xu(e,t));if(e&&typeof e==`object`){let n={};for(let[r,i]of Object.entries(e))t(r)||(n[r]=Xu(i,t));return n}return e}function Zu(e){return JSON.stringify(e,(e,t)=>{if(t&&typeof t==`object`&&!Array.isArray(t)){let e={};for(let n of Object.keys(t).sort())e[n]=t[n];return e}return t})}function Qu(e,t=!1){let n=``,r=e=>{if(!(t&&e.type===`rawMdxFallback`)&&(e.text!==void 0&&(n+=e.text),e.content))for(let t of e.content)r(t)};return r(e),n.replace(/\s+/g,``)}function $u(e){let t=[],n=e=>{if(e.type&&zu.has(e.type)){let n=e.type===`jsxComponent`?String(e.attrs?.componentName??``):``;t.push(n?`${e.type}:${n}`:e.type)}if(e.content)for(let t of e.content)n(t)};return n(e),t.sort()}function ed(e){let t=e,n=[];for(let e of Ku){let r=Zu(t),i=e.canonicalize(t);Zu(i)!==r&&n.push(e.label),t=i}return{normalized:t,fired:n}}function td(e,t,n={}){let r=ed(e),i=ed(t),a=[...new Set([...r.fired,...i.fired])],o=Lu(Qu(r.normalized),Qu(i.normalized)),s=!o&&n.rawSourceSide===`expected`&&Lu(Qu(r.normalized,!0),Qu(i.normalized,!0));if(!o&&!s)return{equivalent:!1,level:`L1`,reason:`content-loss`,appliedDegrades:a,detail:`authored text did not survive the round-trip`};let c=$u(r.normalized),l=$u(i.normalized);if(Zu(c)!==Zu(l))return{equivalent:!1,level:`L1`,reason:`structural-shatter`,appliedDegrades:a,detail:`container multiset diverged: [${c.join(`, `)}] vs [${l.join(`, `)}]`};let u=Ju(r.normalized,n.ignoreAttrs),d=Ju(i.normalized,n.ignoreAttrs);return Zu(u)===Zu(d)?{equivalent:!0,level:a.length>0?`L2`:`L1`,appliedDegrades:a}:{equivalent:!1,level:`L2`,reason:`structural-divergence`,appliedDegrades:a,detail:nd(u,d)}}function nd(e,t,n=`doc`){let r=e,i=t;if(!r||!i)return`${n}: node presence differs`;if(r.type!==i.type)return`${n}: type ${String(r.type)} vs ${String(i.type)}`;let a=r.content??[],o=i.content??[];if(a.length!==o.length)return`${n}(${String(r.type)}): child count ${a.length} vs ${o.length}`;for(let e=0;e<a.length;e++)if(Zu(a[e])!==Zu(o[e]))return nd(a[e],o[e],`${n}>${String(r.type)}[${e}]`);return`${n}(${String(r.type)}): attrs or marks differ`}function rd(e,t,n){return!td(e,t,{ignoreAttrs:n}).equivalent}const id=new Set([`src`,`href`,`size`]),ad=new Set([`WikiEmbedImage`,`WikiEmbedVideo`,`WikiEmbedAudio`,`WikiEmbedFile`]);function od(e){if(Array.isArray(e))return e.map(e=>od(e));if(e&&typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))id.has(n)||(t[n]=od(r));return t}return e}function sd(e){let{sourceUrl:t,...n}=e;return{...n,src:ju(e.src,t)}}function cd(e){let t=e.type===`jsxComponent`?e.attrs?.componentName:void 0;if(typeof t==`string`&&ad.has(t))return od(e);if(e.type===`image`&&e.attrs)return{...e,attrs:sd(e.attrs)};let n=e.attrs?.props;return t===`CommonMarkImage`&&n&&typeof n==`object`?{...e,attrs:{...e.attrs,props:sd(n)}}:e.content?{...e,content:e.content.map(cd)}:e}function ld(e){if(Array.isArray(e))return e.map(e=>ld(e));if(e&&typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))n!==`position`&&(t[n]=ld(r));return t}return e}function ud(e){if(e.type===`jsxComponent`)return e;if(e.content)for(let t of e.content){let e=ud(t);if(e)return e}}function dd(e){let t=e.cacheLimit??2048,n=new Map,r=r=>{let i=n.get(r);if(i!==void 0)return i;let a=ud(e.parse(r)),o=a?cd(ld(a)):null;if(n.size>=t){let e=n.keys().next().value;e!==void 0&&n.delete(e)}return n.set(r,o),o};return{isDiverged(e){if(e.type!==`jsxComponent`||!e.attrs||e.attrs.kind===`expression`)return!1;let t=e.attrs.sourceRaw;if(typeof t!=`string`||t.length===0)return!1;let n=r(t);return n?rd(n,cd(ld(e))):!1}}}var fd=t(r(((e,t)=>{var n=function(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32},r=-1,i=1,a=0;n.Diff=function(e,t){return[e,t]},n.prototype.diff_main=function(e,t,r,i){i===void 0&&(i=this.Diff_Timeout<=0?Number.MAX_VALUE:new Date().getTime()+this.Diff_Timeout*1e3);var o=i;if(e==null||t==null)throw Error(`Null input. (diff_main)`);if(e==t)return e?[new n.Diff(a,e)]:[];r===void 0&&(r=!0);var s=r,c=this.diff_commonPrefix(e,t),l=e.substring(0,c);e=e.substring(c),t=t.substring(c),c=this.diff_commonSuffix(e,t);var u=e.substring(e.length-c);e=e.substring(0,e.length-c),t=t.substring(0,t.length-c);var d=this.diff_compute_(e,t,s,o);return l&&d.unshift(new n.Diff(a,l)),u&&d.push(new n.Diff(a,u)),this.diff_cleanupMerge(d),d},n.prototype.diff_compute_=function(e,t,o,s){var c;if(!e)return[new n.Diff(i,t)];if(!t)return[new n.Diff(r,e)];var l=e.length>t.length?e:t,u=e.length>t.length?t:e,d=l.indexOf(u);if(d!=-1)return c=[new n.Diff(i,l.substring(0,d)),new n.Diff(a,u),new n.Diff(i,l.substring(d+u.length))],e.length>t.length&&(c[0][0]=c[2][0]=r),c;if(u.length==1)return[new n.Diff(r,e),new n.Diff(i,t)];var f=this.diff_halfMatch_(e,t);if(f){var p=f[0],m=f[1],h=f[2],g=f[3],_=f[4],v=this.diff_main(p,h,o,s),y=this.diff_main(m,g,o,s);return v.concat([new n.Diff(a,_)],y)}return o&&e.length>100&&t.length>100?this.diff_lineMode_(e,t,s):this.diff_bisect_(e,t,s)},n.prototype.diff_lineMode_=function(e,t,o){var s=this.diff_linesToChars_(e,t);e=s.chars1,t=s.chars2;var c=s.lineArray,l=this.diff_main(e,t,!1,o);this.diff_charsToLines_(l,c),this.diff_cleanupSemantic(l),l.push(new n.Diff(a,``));for(var u=0,d=0,f=0,p=``,m=``;u<l.length;){switch(l[u][0]){case i:f++,m+=l[u][1];break;case r:d++,p+=l[u][1];break;case a:if(d>=1&&f>=1){l.splice(u-d-f,d+f),u=u-d-f;for(var h=this.diff_main(p,m,!1,o),g=h.length-1;g>=0;g--)l.splice(u,0,h[g]);u+=h.length}f=0,d=0,p=``,m=``}u++}return l.pop(),l},n.prototype.diff_bisect_=function(e,t,a){for(var o=e.length,s=t.length,c=Math.ceil((o+s)/2),l=c,u=2*c,d=Array(u),f=Array(u),p=0;p<u;p++)d[p]=-1,f[p]=-1;d[l+1]=0,f[l+1]=0;for(var m=o-s,h=m%2!=0,g=0,_=0,v=0,y=0,b=0;b<c&&!(new Date().getTime()>a);b++){for(var x=-b+g;x<=b-_;x+=2){for(var S=l+x,C=x==-b||x!=b&&d[S-1]<d[S+1]?d[S+1]:d[S-1]+1,w=C-x;C<o&&w<s&&e.charAt(C)==t.charAt(w);)C++,w++;if(d[S]=C,C>o)_+=2;else if(w>s)g+=2;else if(h){var T=l+m-x;if(T>=0&&T<u&&f[T]!=-1){var ee=o-f[T];if(C>=ee)return this.diff_bisectSplit_(e,t,C,w,a)}}}for(var te=-b+v;te<=b-y;te+=2){for(var T=l+te,ee=te==-b||te!=b&&f[T-1]<f[T+1]?f[T+1]:f[T-1]+1,ne=ee-te;ee<o&&ne<s&&e.charAt(o-ee-1)==t.charAt(s-ne-1);)ee++,ne++;if(f[T]=ee,ee>o)y+=2;else if(ne>s)v+=2;else if(!h){var S=l+m-te;if(S>=0&&S<u&&d[S]!=-1){var C=d[S],w=l+C-S;if(ee=o-ee,C>=ee)return this.diff_bisectSplit_(e,t,C,w,a)}}}}return[new n.Diff(r,e),new n.Diff(i,t)]},n.prototype.diff_bisectSplit_=function(e,t,n,r,i){var a=e.substring(0,n),o=t.substring(0,r),s=e.substring(n),c=t.substring(r),l=this.diff_main(a,o,!1,i),u=this.diff_main(s,c,!1,i);return l.concat(u)},n.prototype.diff_linesToChars_=function(e,t){var n=[],r={};n[0]=``;function i(e){for(var t=``,i=0,o=-1,s=n.length;o<e.length-1;){o=e.indexOf(`
|
|
70
|
+
`,i),o==-1&&(o=e.length-1);var c=e.substring(i,o+1);(r.hasOwnProperty?r.hasOwnProperty(c):r[c]!==void 0)?t+=String.fromCharCode(r[c]):(s==a&&(c=e.substring(i),o=e.length),t+=String.fromCharCode(s),r[c]=s,n[s++]=c),i=o+1}return t}var a=4e4,o=i(e);return a=65535,{chars1:o,chars2:i(t),lineArray:n}},n.prototype.diff_charsToLines_=function(e,t){for(var n=0;n<e.length;n++){for(var r=e[n][1],i=[],a=0;a<r.length;a++)i[a]=t[r.charCodeAt(a)];e[n][1]=i.join(``)}},n.prototype.diff_commonPrefix=function(e,t){if(!e||!t||e.charAt(0)!=t.charAt(0))return 0;for(var n=0,r=Math.min(e.length,t.length),i=r,a=0;n<i;)e.substring(a,i)==t.substring(a,i)?(n=i,a=n):r=i,i=Math.floor((r-n)/2+n);return i},n.prototype.diff_commonSuffix=function(e,t){if(!e||!t||e.charAt(e.length-1)!=t.charAt(t.length-1))return 0;for(var n=0,r=Math.min(e.length,t.length),i=r,a=0;n<i;)e.substring(e.length-i,e.length-a)==t.substring(t.length-i,t.length-a)?(n=i,a=n):r=i,i=Math.floor((r-n)/2+n);return i},n.prototype.diff_commonOverlap_=function(e,t){var n=e.length,r=t.length;if(n==0||r==0)return 0;n>r?e=e.substring(n-r):n<r&&(t=t.substring(0,n));var i=Math.min(n,r);if(e==t)return i;for(var a=0,o=1;;){var s=e.substring(i-o),c=t.indexOf(s);if(c==-1)return a;o+=c,(c==0||e.substring(i-o)==t.substring(0,o))&&(a=o,o++)}},n.prototype.diff_halfMatch_=function(e,t){if(this.Diff_Timeout<=0)return null;var n=e.length>t.length?e:t,r=e.length>t.length?t:e;if(n.length<4||r.length*2<n.length)return null;var i=this;function a(e,t,n){for(var r=e.substring(n,n+Math.floor(e.length/4)),a=-1,o=``,s,c,l,u;(a=t.indexOf(r,a+1))!=-1;){var d=i.diff_commonPrefix(e.substring(n),t.substring(a)),f=i.diff_commonSuffix(e.substring(0,n),t.substring(0,a));o.length<f+d&&(o=t.substring(a-f,a)+t.substring(a,a+d),s=e.substring(0,n-f),c=e.substring(n+d),l=t.substring(0,a-f),u=t.substring(a+d))}return o.length*2>=e.length?[s,c,l,u,o]:null}var o=a(n,r,Math.ceil(n.length/4)),s=a(n,r,Math.ceil(n.length/2)),c;if(!o&&!s)return null;c=s?o&&o[4].length>s[4].length?o:s:o;var l,u,d,f;e.length>t.length?(l=c[0],u=c[1],d=c[2],f=c[3]):(d=c[0],f=c[1],l=c[2],u=c[3]);var p=c[4];return[l,u,d,f,p]},n.prototype.diff_cleanupSemantic=function(e){for(var t=!1,o=[],s=0,c=null,l=0,u=0,d=0,f=0,p=0;l<e.length;)e[l][0]==a?(o[s++]=l,u=f,d=p,f=0,p=0,c=e[l][1]):(e[l][0]==i?f+=e[l][1].length:p+=e[l][1].length,c&&c.length<=Math.max(u,d)&&c.length<=Math.max(f,p)&&(e.splice(o[s-1],0,new n.Diff(r,c)),e[o[s-1]+1][0]=i,s--,s--,l=s>0?o[s-1]:-1,u=0,d=0,f=0,p=0,c=null,t=!0)),l++;for(t&&this.diff_cleanupMerge(e),this.diff_cleanupSemanticLossless(e),l=1;l<e.length;){if(e[l-1][0]==r&&e[l][0]==i){var m=e[l-1][1],h=e[l][1],g=this.diff_commonOverlap_(m,h),_=this.diff_commonOverlap_(h,m);g>=_?(g>=m.length/2||g>=h.length/2)&&(e.splice(l,0,new n.Diff(a,h.substring(0,g))),e[l-1][1]=m.substring(0,m.length-g),e[l+1][1]=h.substring(g),l++):(_>=m.length/2||_>=h.length/2)&&(e.splice(l,0,new n.Diff(a,m.substring(0,_))),e[l-1][0]=i,e[l-1][1]=h.substring(0,h.length-_),e[l+1][0]=r,e[l+1][1]=m.substring(_),l++),l++}l++}},n.prototype.diff_cleanupSemanticLossless=function(e){function t(e,t){if(!e||!t)return 6;var r=e.charAt(e.length-1),i=t.charAt(0),a=r.match(n.nonAlphaNumericRegex_),o=i.match(n.nonAlphaNumericRegex_),s=a&&r.match(n.whitespaceRegex_),c=o&&i.match(n.whitespaceRegex_),l=s&&r.match(n.linebreakRegex_),u=c&&i.match(n.linebreakRegex_),d=l&&e.match(n.blanklineEndRegex_),f=u&&t.match(n.blanklineStartRegex_);return d||f?5:l||u?4:a&&!s&&c?3:s||c?2:a||o?1:0}for(var r=1;r<e.length-1;){if(e[r-1][0]==a&&e[r+1][0]==a){var i=e[r-1][1],o=e[r][1],s=e[r+1][1],c=this.diff_commonSuffix(i,o);if(c){var l=o.substring(o.length-c);i=i.substring(0,i.length-c),o=l+o.substring(0,o.length-c),s=l+s}for(var u=i,d=o,f=s,p=t(i,o)+t(o,s);o.charAt(0)===s.charAt(0);){i+=o.charAt(0),o=o.substring(1)+s.charAt(0),s=s.substring(1);var m=t(i,o)+t(o,s);m>=p&&(p=m,u=i,d=o,f=s)}e[r-1][1]!=u&&(u?e[r-1][1]=u:(e.splice(r-1,1),r--),e[r][1]=d,f?e[r+1][1]=f:(e.splice(r+1,1),r--))}r++}},n.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,n.whitespaceRegex_=/\s/,n.linebreakRegex_=/[\r\n]/,n.blanklineEndRegex_=/\n\r?\n$/,n.blanklineStartRegex_=/^\r?\n\r?\n/,n.prototype.diff_cleanupEfficiency=function(e){for(var t=!1,o=[],s=0,c=null,l=0,u=!1,d=!1,f=!1,p=!1;l<e.length;)e[l][0]==a?(e[l][1].length<this.Diff_EditCost&&(f||p)?(o[s++]=l,u=f,d=p,c=e[l][1]):(s=0,c=null),f=p=!1):(e[l][0]==r?p=!0:f=!0,c&&(u&&d&&f&&p||c.length<this.Diff_EditCost/2&&u+d+f+p==3)&&(e.splice(o[s-1],0,new n.Diff(r,c)),e[o[s-1]+1][0]=i,s--,c=null,u&&d?(f=p=!0,s=0):(s--,l=s>0?o[s-1]:-1,f=p=!1),t=!0)),l++;t&&this.diff_cleanupMerge(e)},n.prototype.diff_cleanupMerge=function(e){e.push(new n.Diff(a,``));for(var t=0,o=0,s=0,c=``,l=``,u;t<e.length;)switch(e[t][0]){case i:s++,l+=e[t][1],t++;break;case r:o++,c+=e[t][1],t++;break;case a:o+s>1?(o!==0&&s!==0&&(u=this.diff_commonPrefix(l,c),u!==0&&(t-o-s>0&&e[t-o-s-1][0]==a?e[t-o-s-1][1]+=l.substring(0,u):(e.splice(0,0,new n.Diff(a,l.substring(0,u))),t++),l=l.substring(u),c=c.substring(u)),u=this.diff_commonSuffix(l,c),u!==0&&(e[t][1]=l.substring(l.length-u)+e[t][1],l=l.substring(0,l.length-u),c=c.substring(0,c.length-u))),t-=o+s,e.splice(t,o+s),c.length&&(e.splice(t,0,new n.Diff(r,c)),t++),l.length&&(e.splice(t,0,new n.Diff(i,l)),t++),t++):t!==0&&e[t-1][0]==a?(e[t-1][1]+=e[t][1],e.splice(t,1)):t++,s=0,o=0,c=``,l=``}e[e.length-1][1]===``&&e.pop();var d=!1;for(t=1;t<e.length-1;)e[t-1][0]==a&&e[t+1][0]==a&&(e[t][1].substring(e[t][1].length-e[t-1][1].length)==e[t-1][1]?(e[t][1]=e[t-1][1]+e[t][1].substring(0,e[t][1].length-e[t-1][1].length),e[t+1][1]=e[t-1][1]+e[t+1][1],e.splice(t-1,1),d=!0):e[t][1].substring(0,e[t+1][1].length)==e[t+1][1]&&(e[t-1][1]+=e[t+1][1],e[t][1]=e[t][1].substring(e[t+1][1].length)+e[t+1][1],e.splice(t+1,1),d=!0)),t++;d&&this.diff_cleanupMerge(e)},n.prototype.diff_xIndex=function(e,t){var n=0,a=0,o=0,s=0,c;for(c=0;c<e.length&&(e[c][0]!==i&&(n+=e[c][1].length),e[c][0]!==r&&(a+=e[c][1].length),!(n>t));c++)o=n,s=a;return e.length!=c&&e[c][0]===r?s:s+(t-o)},n.prototype.diff_prettyHtml=function(e){for(var t=[],n=/&/g,o=/</g,s=/>/g,c=/\n/g,l=0;l<e.length;l++){var u=e[l][0],d=e[l][1].replace(n,`&`).replace(o,`<`).replace(s,`>`).replace(c,`¶<br>`);switch(u){case i:t[l]=`<ins style="background:#e6ffe6;">`+d+`</ins>`;break;case r:t[l]=`<del style="background:#ffe6e6;">`+d+`</del>`;break;case a:t[l]=`<span>`+d+`</span>`}}return t.join(``)},n.prototype.diff_text1=function(e){for(var t=[],n=0;n<e.length;n++)e[n][0]!==i&&(t[n]=e[n][1]);return t.join(``)},n.prototype.diff_text2=function(e){for(var t=[],n=0;n<e.length;n++)e[n][0]!==r&&(t[n]=e[n][1]);return t.join(``)},n.prototype.diff_levenshtein=function(e){for(var t=0,n=0,o=0,s=0;s<e.length;s++){var c=e[s][0],l=e[s][1];switch(c){case i:n+=l.length;break;case r:o+=l.length;break;case a:t+=Math.max(n,o),n=0,o=0}}return t+=Math.max(n,o),t},n.prototype.diff_toDelta=function(e){for(var t=[],n=0;n<e.length;n++)switch(e[n][0]){case i:t[n]=`+`+encodeURI(e[n][1]);break;case r:t[n]=`-`+e[n][1].length;break;case a:t[n]=`=`+e[n][1].length}return t.join(` `).replace(/%20/g,` `)},n.prototype.diff_fromDelta=function(e,t){for(var o=[],s=0,c=0,l=t.split(/\t/g),u=0;u<l.length;u++){var d=l[u].substring(1);switch(l[u].charAt(0)){case`+`:try{o[s++]=new n.Diff(i,decodeURI(d))}catch{throw Error(`Illegal escape in diff_fromDelta: `+d)}break;case`-`:case`=`:var f=parseInt(d,10);if(isNaN(f)||f<0)throw Error(`Invalid number in diff_fromDelta: `+d);var p=e.substring(c,c+=f);l[u].charAt(0)==`=`?o[s++]=new n.Diff(a,p):o[s++]=new n.Diff(r,p);break;default:if(l[u])throw Error(`Invalid diff operation in diff_fromDelta: `+l[u])}}if(c!=e.length)throw Error(`Delta length (`+c+`) does not equal source text length (`+e.length+`).`);return o},n.prototype.match_main=function(e,t,n){if(e==null||t==null||n==null)throw Error(`Null input. (match_main)`);return n=Math.max(0,Math.min(n,e.length)),e==t?0:e.length?e.substring(n,n+t.length)==t?n:this.match_bitap_(e,t,n):-1},n.prototype.match_bitap_=function(e,t,n){if(t.length>this.Match_MaxBits)throw Error(`Pattern too long for this browser.`);var r=this.match_alphabet_(t),i=this;function a(e,r){var a=e/t.length,o=Math.abs(n-r);return i.Match_Distance?a+o/i.Match_Distance:o?1:a}var o=this.Match_Threshold,s=e.indexOf(t,n);s!=-1&&(o=Math.min(a(0,s),o),s=e.lastIndexOf(t,n+t.length),s!=-1&&(o=Math.min(a(0,s),o)));var c=1<<t.length-1;s=-1;for(var l,u,d=t.length+e.length,f,p=0;p<t.length;p++){for(l=0,u=d;l<u;)a(p,n+u)<=o?l=u:d=u,u=Math.floor((d-l)/2+l);d=u;var m=Math.max(1,n-u+1),h=Math.min(n+u,e.length)+t.length,g=Array(h+2);g[h+1]=(1<<p)-1;for(var _=h;_>=m;_--){var v=r[e.charAt(_-1)];if(p===0?g[_]=(g[_+1]<<1|1)&v:g[_]=(g[_+1]<<1|1)&v|(f[_+1]|f[_])<<1|1|f[_+1],g[_]&c){var y=a(p,_-1);if(y<=o){if(o=y,s=_-1,s>n)m=Math.max(1,2*n-s);else break}}}if(a(p+1,n)>o)break;f=g}return s},n.prototype.match_alphabet_=function(e){for(var t={},n=0;n<e.length;n++)t[e.charAt(n)]=0;for(var n=0;n<e.length;n++)t[e.charAt(n)]|=1<<e.length-n-1;return t},n.prototype.patch_addContext_=function(e,t){if(t.length!=0){if(e.start2===null)throw Error(`patch not initialized`);for(var r=t.substring(e.start2,e.start2+e.length1),i=0;t.indexOf(r)!=t.lastIndexOf(r)&&r.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)i+=this.Patch_Margin,r=t.substring(e.start2-i,e.start2+e.length1+i);i+=this.Patch_Margin;var o=t.substring(e.start2-i,e.start2);o&&e.diffs.unshift(new n.Diff(a,o));var s=t.substring(e.start2+e.length1,e.start2+e.length1+i);s&&e.diffs.push(new n.Diff(a,s)),e.start1-=o.length,e.start2-=o.length,e.length1+=o.length+s.length,e.length2+=o.length+s.length}},n.prototype.patch_make=function(e,t,o){var s,c;if(typeof e==`string`&&typeof t==`string`&&o===void 0)s=e,c=this.diff_main(s,t,!0),c.length>2&&(this.diff_cleanupSemantic(c),this.diff_cleanupEfficiency(c));else if(e&&typeof e==`object`&&t===void 0&&o===void 0)c=e,s=this.diff_text1(c);else if(typeof e==`string`&&t&&typeof t==`object`&&o===void 0)s=e,c=t;else if(typeof e==`string`&&typeof t==`string`&&o&&typeof o==`object`)s=e,c=o;else throw Error(`Unknown call format to patch_make.`);if(c.length===0)return[];for(var l=[],u=new n.patch_obj,d=0,f=0,p=0,m=s,h=s,g=0;g<c.length;g++){var _=c[g][0],v=c[g][1];switch(!d&&_!==a&&(u.start1=f,u.start2=p),_){case i:u.diffs[d++]=c[g],u.length2+=v.length,h=h.substring(0,p)+v+h.substring(p);break;case r:u.length1+=v.length,u.diffs[d++]=c[g],h=h.substring(0,p)+h.substring(p+v.length);break;case a:v.length<=2*this.Patch_Margin&&d&&c.length!=g+1?(u.diffs[d++]=c[g],u.length1+=v.length,u.length2+=v.length):v.length>=2*this.Patch_Margin&&d&&(this.patch_addContext_(u,m),l.push(u),u=new n.patch_obj,d=0,m=h,f=p)}_!==i&&(f+=v.length),_!==r&&(p+=v.length)}return d&&(this.patch_addContext_(u,m),l.push(u)),l},n.prototype.patch_deepCopy=function(e){for(var t=[],r=0;r<e.length;r++){var i=e[r],a=new n.patch_obj;a.diffs=[];for(var o=0;o<i.diffs.length;o++)a.diffs[o]=new n.Diff(i.diffs[o][0],i.diffs[o][1]);a.start1=i.start1,a.start2=i.start2,a.length1=i.length1,a.length2=i.length2,t[r]=a}return t},n.prototype.patch_apply=function(e,t){if(e.length==0)return[t,[]];e=this.patch_deepCopy(e);var n=this.patch_addPadding(e);t=n+t+n,this.patch_splitMax(e);for(var o=0,s=[],c=0;c<e.length;c++){var l=e[c].start2+o,u=this.diff_text1(e[c].diffs),d,f=-1;if(u.length>this.Match_MaxBits?(d=this.match_main(t,u.substring(0,this.Match_MaxBits),l),d!=-1&&(f=this.match_main(t,u.substring(u.length-this.Match_MaxBits),l+u.length-this.Match_MaxBits),(f==-1||d>=f)&&(d=-1))):d=this.match_main(t,u,l),d==-1)s[c]=!1,o-=e[c].length2-e[c].length1;else{s[c]=!0,o=d-l;var p=f==-1?t.substring(d,d+u.length):t.substring(d,f+this.Match_MaxBits);if(u==p)t=t.substring(0,d)+this.diff_text2(e[c].diffs)+t.substring(d+u.length);else{var m=this.diff_main(u,p,!1);if(u.length>this.Match_MaxBits&&this.diff_levenshtein(m)/u.length>this.Patch_DeleteThreshold)s[c]=!1;else{this.diff_cleanupSemanticLossless(m);for(var h=0,g,_=0;_<e[c].diffs.length;_++){var v=e[c].diffs[_];v[0]!==a&&(g=this.diff_xIndex(m,h)),v[0]===i?t=t.substring(0,d+g)+v[1]+t.substring(d+g):v[0]===r&&(t=t.substring(0,d+g)+t.substring(d+this.diff_xIndex(m,h+v[1].length))),v[0]!==r&&(h+=v[1].length)}}}}}return t=t.substring(n.length,t.length-n.length),[t,s]},n.prototype.patch_addPadding=function(e){for(var t=this.Patch_Margin,r=``,i=1;i<=t;i++)r+=String.fromCharCode(i);for(var i=0;i<e.length;i++)e[i].start1+=t,e[i].start2+=t;var o=e[0],s=o.diffs;if(s.length==0||s[0][0]!=a)s.unshift(new n.Diff(a,r)),o.start1-=t,o.start2-=t,o.length1+=t,o.length2+=t;else if(t>s[0][1].length){var c=t-s[0][1].length;s[0][1]=r.substring(s[0][1].length)+s[0][1],o.start1-=c,o.start2-=c,o.length1+=c,o.length2+=c}if(o=e[e.length-1],s=o.diffs,s.length==0||s[s.length-1][0]!=a)s.push(new n.Diff(a,r)),o.length1+=t,o.length2+=t;else if(t>s[s.length-1][1].length){var c=t-s[s.length-1][1].length;s[s.length-1][1]+=r.substring(0,c),o.length1+=c,o.length2+=c}return r},n.prototype.patch_splitMax=function(e){for(var t=this.Match_MaxBits,o=0;o<e.length;o++)if(!(e[o].length1<=t)){var s=e[o];e.splice(o--,1);for(var c=s.start1,l=s.start2,u=``;s.diffs.length!==0;){var d=new n.patch_obj,f=!0;for(d.start1=c-u.length,d.start2=l-u.length,u!==``&&(d.length1=d.length2=u.length,d.diffs.push(new n.Diff(a,u)));s.diffs.length!==0&&d.length1<t-this.Patch_Margin;){var p=s.diffs[0][0],m=s.diffs[0][1];p===i?(d.length2+=m.length,l+=m.length,d.diffs.push(s.diffs.shift()),f=!1):p===r&&d.diffs.length==1&&d.diffs[0][0]==a&&m.length>2*t?(d.length1+=m.length,c+=m.length,f=!1,d.diffs.push(new n.Diff(p,m)),s.diffs.shift()):(m=m.substring(0,t-d.length1-this.Patch_Margin),d.length1+=m.length,c+=m.length,p===a?(d.length2+=m.length,l+=m.length):f=!1,d.diffs.push(new n.Diff(p,m)),m==s.diffs[0][1]?s.diffs.shift():s.diffs[0][1]=s.diffs[0][1].substring(m.length))}u=this.diff_text2(d.diffs),u=u.substring(u.length-this.Patch_Margin);var h=this.diff_text1(s.diffs).substring(0,this.Patch_Margin);h!==``&&(d.length1+=h.length,d.length2+=h.length,d.diffs.length!==0&&d.diffs[d.diffs.length-1][0]===a?d.diffs[d.diffs.length-1][1]+=h:d.diffs.push(new n.Diff(a,h))),f||e.splice(++o,0,d)}}},n.prototype.patch_toText=function(e){for(var t=[],n=0;n<e.length;n++)t[n]=e[n];return t.join(``)},n.prototype.patch_fromText=function(e){var t=[];if(!e)return t;for(var o=e.split(`
|
|
71
|
+
`),s=0,c=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;s<o.length;){var l=o[s].match(c);if(!l)throw Error(`Invalid patch string: `+o[s]);var u=new n.patch_obj;for(t.push(u),u.start1=parseInt(l[1],10),l[2]===``?(u.start1--,u.length1=1):l[2]==`0`?u.length1=0:(u.start1--,u.length1=parseInt(l[2],10)),u.start2=parseInt(l[3],10),l[4]===``?(u.start2--,u.length2=1):l[4]==`0`?u.length2=0:(u.start2--,u.length2=parseInt(l[4],10)),s++;s<o.length;){var d=o[s].charAt(0);try{var f=decodeURI(o[s].substring(1))}catch{throw Error(`Illegal escape in patch_fromText: `+f)}if(d==`-`)u.diffs.push(new n.Diff(r,f));else if(d==`+`)u.diffs.push(new n.Diff(i,f));else if(d==` `)u.diffs.push(new n.Diff(a,f));else if(d==`@`)break;else if(d!==``)throw Error(`Invalid patch mode "`+d+`" in: `+f);s++}}return t},n.patch_obj=function(){this.diffs=[],this.start1=null,this.start2=null,this.length1=0,this.length2=0},n.patch_obj.prototype.toString=function(){for(var e=this.length1===0?this.start1+`,0`:this.length1==1?this.start1+1:this.start1+1+`,`+this.length1,t=this.length2===0?this.start2+`,0`:this.length2==1?this.start2+1:this.start2+1+`,`+this.length2,n=[`@@ -`+e+` +`+t+` @@
|
|
72
|
+
`],o,s=0;s<this.diffs.length;s++){switch(this.diffs[s][0]){case i:o=`+`;break;case r:o=`-`;break;case a:o=` `}n[s+1]=o+encodeURI(this.diffs[s][1])+`
|
|
73
|
+
`}return n.join(``).replace(/%20/g,` `)},t.exports=n,t.exports.diff_match_patch=n,t.exports.DIFF_DELETE=r,t.exports.DIFF_INSERT=i,t.exports.DIFF_EQUAL=a}))(),1);function pd(e,t){let n=Object.create(null);for(let e=0;e<t.length;e++){let r=t[e];n[r]?n[r].push(e):n[r]=[e]}let r=[{buffer1index:-1,buffer2index:-1,chain:null}];for(let t=0;t<e.length;t++){let i=n[e[t]]||[],a=0,o=r[0];for(let e of i){let n;for(n=a;n<r.length&&!(r[n].buffer2index<e&&(n===r.length-1||r[n+1].buffer2index>e));n++);if(n<r.length){let i={buffer1index:t,buffer2index:e,chain:r[n]};if(a===r.length?r.push(o):r[a]=o,a=n+1,o=i,a===r.length)break}}r[a]=o}return r[r.length-1]}function md(e,t){let n=pd(e,t),r=[],i=e.length,a=t.length;for(let o=n;o!==null;o=o.chain){let n=i-o.buffer1index-1,s=a-o.buffer2index-1;i=o.buffer1index,a=o.buffer2index,(n||s)&&r.push({buffer1:[i+1,n],buffer1Content:e.slice(i+1,i+1+n),buffer2:[a+1,s],buffer2Content:t.slice(a+1,a+1+s)})}return r.reverse(),r}function hd(e,t,n){let r=[];function i(e,t){r.push({ab:t,oStart:e.buffer1[0],oLength:e.buffer1[1],abStart:e.buffer2[0],abLength:e.buffer2[1]})}md(t,e).forEach(e=>i(e,`a`)),md(t,n).forEach(e=>i(e,`b`)),r.sort((e,t)=>e.oStart-t.oStart);let a=[],o=0;function s(e){e>o&&(a.push({stable:!0,buffer:`o`,bufferStart:o,bufferLength:e-o,bufferContent:t.slice(o,e)}),o=e)}for(;r.length;){let i=r.shift(),c=i.oStart,l=i.oStart+i.oLength,u=[i];for(s(c);r.length;){let e=r[0],t=e.oStart;if(t>l)break;l=Math.max(l,t+e.oLength),u.push(r.shift())}if(u.length===1){if(i.abLength>0){let t=i.ab===`a`?e:n;a.push({stable:!0,buffer:i.ab,bufferStart:i.abStart,bufferLength:i.abLength,bufferContent:t.slice(i.abStart,i.abStart+i.abLength)})}}else{let r={a:[e.length,-1,t.length,-1],b:[n.length,-1,t.length,-1]};for(;u.length;){i=u.shift();let e=i.oStart,t=e+i.oLength,n=i.abStart,a=n+i.abLength,o=r[i.ab];o[0]=Math.min(n,o[0]),o[1]=Math.max(a,o[1]),o[2]=Math.min(e,o[2]),o[3]=Math.max(t,o[3])}let o=r.a[0]+(c-r.a[2]),s=r.a[1]+(l-r.a[3]),d=r.b[0]+(c-r.b[2]),f=r.b[1]+(l-r.b[3]),p={stable:!1,aStart:o,aLength:s-o,aContent:e.slice(o,s),oStart:c,oLength:l-c,oContent:t.slice(c,l),bStart:d,bLength:f-d,bContent:n.slice(d,f)};a.push(p)}o=l}return s(t.length),a}function gd(e,t,n,r){r=Object.assign({excludeFalseConflicts:!0,stringSeparator:/\s+/},r),typeof e==`string`&&(e=e.split(r.stringSeparator)),typeof t==`string`&&(t=t.split(r.stringSeparator)),typeof n==`string`&&(n=n.split(r.stringSeparator));let i=[],a=hd(e,t,n),o=[];function s(){o.length&&i.push({ok:o}),o=[]}function c(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return a.forEach(e=>{e.stable?o.push(...e.bufferContent):r.excludeFalseConflicts&&c(e.aContent,e.bContent)?o.push(...e.aContent):(s(),i.push({conflict:{a:e.aContent,aIndex:e.aStart,o:e.oContent,oIndex:e.oStart,b:e.bContent,bIndex:e.bStart}}))}),s(),i}const _d=new fd.default;function vd(e,t){if(e===t)return[{value:e}];let{chars1:n,chars2:r,lineArray:i}=_d.diff_linesToChars_(e,t),a=_d.diff_main(n,r,!1);_d.diff_charsToLines_(a,i);let o=[];for(let[e,t]of a){if(t.length===0)continue;let n=o[o.length-1],r=e===fd.default.DIFF_DELETE,i=e===fd.default.DIFF_INSERT;if(n&&!!n.removed===r&&!!n.added===i){n.value+=t;continue}r?o.push({value:t,removed:!0}):i?o.push({value:t,added:!0}):o.push({value:t})}return o}const yd=262144;function bd(e,t,n){if(t===n)return;let r=vd(t,n),i=0;for(let n=0;n<r.length;n++){let a=r[n],o=r[n+1];if(a.removed&&o?.added){if(t.substring(i,i+o.value.length)===o.value){i+=o.value.length,n++;continue}e.delete(i,a.value.length),e.insert(i,o.value),i+=o.value.length,n++}else a.removed?e.delete(i,a.value.length):(a.added&&e.insert(i,a.value),i+=a.value.length)}}function xd(e,t,n){if(t===n)return;if(t.length>yd||n.length>yd){Sd(e,t,n);return}let r=vd(t,n),i=0;for(let t of r)t.removed?e.delete(i,t.value.length):(t.added&&e.insert(i,t.value),i+=t.value.length)}function Sd(e,t,n){let r=0,i=Math.min(t.length,n.length);for(;r<i&&t.charCodeAt(r)===n.charCodeAt(r);)r++;r>0&&(r=t.lastIndexOf(`
|
|
74
|
+
`,r-1)+1);let a=0;for(;a<i-r&&t.charCodeAt(t.length-1-a)===n.charCodeAt(n.length-1-a);)a++;if(a>0){let e=t.length-a,r=n.length-a,i=e===0||t.charCodeAt(e-1)===10,o=r===0||n.charCodeAt(r-1)===10;if(!(i&&o)){let n=t.indexOf(`
|
|
75
|
+
`,e);a=n===-1?0:t.length-(n+1)}}let o=t.length-r-a,s=n.slice(r,n.length-a);o>0&&e.delete(r,o),s.length>0&&e.insert(r,s)}const Cd=/^---[ \t]*\r?\n---[ \t]*(\r?\n|$)/,wd=/^---([ \t]*)(?=\r?\n|$)/,Td=e=>e.includes(`\r
|
|
76
|
+
`)?`\r
|
|
77
|
+
`:`
|
|
78
|
+
`,Ed=e=>e.replace(wd,`***$1`),Dd=e=>`---${e}${e}---${e}`;function Od(e,t){let n=au(e,t);return{md:n,frontmatter:n.slice(0,n.length-t.length)}}function kd(e,t){let{md:n,frontmatter:r}=Od(e,t),i=iu(n);return i.frontmatter===r&&i.body===t}function Ad(e,t,n,r){let{md:i,frontmatter:a}=Od(t,n);return{md:i,frontmatter:a,body:n,adjusted:r===`none`&&a!==e?`frontmatter`:r}}function jd(e,t){if(kd(e,t))return Ad(e,e,t,`none`);let n=Ed(t);if(n!==t&&kd(e,n))return Ad(e,e,n,`body`);if(Cd.test(e)){let n=Dd(Td(e));if(kd(n,t))return Ad(e,n,t,`frontmatter`)}return Ad(e,e,t,`unresolved`)}function Md(e,t){if(kd(e,t))return Ad(e,e,t,`none`);let n=Dd(Td(e||t));return(e===``||Cd.test(e))&&kd(n,t)?Ad(e,n,t,`frontmatter`):Ad(e,e,t,`unresolved`)}Object.freeze({source:`local`,skipStoreHooks:!1,context:Object.freeze({origin:`form-write`})});function Nd(e,t){let n=t?.verbose===!0,r=t?.nowMs===void 0?new Date().toISOString():new Date(t.nowMs).toISOString(),i={event:`bridge-invariant-violation`,site:e.site,"doc.name":e.docName??null,"tolerance-class-attempted":`untracked`,"normalize-equal-modulo-tolerance":!1,ytextLen:e.ytextSnapshot.length,fragmentLen:e.fragmentMdSnapshot.length,ytextHash:wu(e.ytextSnapshot),fragmentHash:wu(e.fragmentMdSnapshot),redacted:!n,timestamp:r};return n?{...i,diff:e.unifiedDiff}:i}var Pd=class extends Error{violation;constructor(e){let t=typeof e.origin==`string`?e.origin:e.origin?.context?.origin??`unknown-object`,n=e.docName?` doc='${e.docName}'`:``;super(`Bridge invariant violated [site='${e.site}'${n}, origin='${t}'].\n Y.Text (${e.ytextSnapshot.length} chars): ${e.ytextSnapshot.slice(0,200)}...\n Fragment (${e.fragmentMdSnapshot.length} chars): ${e.fragmentMdSnapshot.slice(0,200)}...\n Diff:\n${e.unifiedDiff}`),this.name=`BridgeInvariantViolationError`,this.violation=e}};const Fd={"emphasis-around-code":`pm-model-caused`,bom:`parser-caused`,crlf:`parser-caused`,"commonmark-escape":`parser-caused`,"leading-newline":`parser-caused`,"paragraph-continuation-indent":`parser-caused`,"doc-start-thematic":`parser-caused`,"block-separator-collapse":`serializer-caused`,"table-align-row-spacing":`serializer-caused`,"row-no-trailing-pipe":`serializer-caused`,"ordered-list-marker-number":`serializer-caused`,"list-indent-canonical":`serializer-caused`,"jsx-container-boundary-blank":`serializer-caused`,"trailing-whitespace":`serializer-caused`,"blank-line-collapse":`serializer-caused`,"trailing-newline":`serializer-caused`,"parse-equivalence":`parser-caused`};function Id(e){return Fd[e]}function Ld(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++)if(e.charCodeAt(r)!==t.charCodeAt(r))return r;return e.length===t.length?-1:n}let Rd=null;function zd(e){Rd=e}function Bd(e,t,n,r){if(!Rd||e.length===0)return;let i=Ld(t,n),a=new Date().toISOString();for(let t of e)Rd({timestamp:a,className:t,documentName:r,codeUnitPosition:i,severity:Id(t)})}function Vd(e,t){let n=Ld(e,t);return n===-1?Math.min(e.length,t.length):n}function Hd(e,t=!1){if(e.trim()===``)return`blank`;let n=e.trimStart();return t&&/^-{3,}\s*$/.test(n)?`frontmatter-fence`:/^#{1,6}(\s|$)/.test(n)?`heading`:/^(?:`{3,}|~{3,})/.test(n)?`fence`:n.startsWith(`>`)?`blockquote`:/^(?:-{3,}|\*{3,}|_{3,})\s*$/.test(n)?`thematic-break`:/^[-+*](\s|$)/.test(n)?`bullet-list-item`:/^\d+[.)](\s|$)/.test(n)?`ordered-list-item`:n.startsWith(`|`)?`table-row`:/^<\/?[A-Z]/.test(n)?`jsx-tag`:/^<[a-z!/]/i.test(n)?`html-block`:`paragraph`}function Ud(e,t){let n=Vd(e,t),r=1,i=-1;for(let t=0;t<n;t++)e[t]===`
|
|
79
|
+
`&&(r++,i=t);return{index:n,normalizedLine:r,normalizedColumn:n-i,ytextLineKind:Gd(e,n,r),fragmentLineKind:Gd(t,n,r),precedingLineKind:Kd(e,n,r)}}function Wd(e,t){if(t>e.length||t===e.length&&e.length>0&&t>0)return null;let n=e.lastIndexOf(`
|
|
80
|
+
`,Math.max(0,t-1))+1,r=e.indexOf(`
|
|
81
|
+
`,t);return e.slice(n,r===-1?e.length:r)}function Gd(e,t,n){let r=Wd(e,t);return r===null?`absent`:Hd(r,n===1)}function Kd(e,t,n){if(n<=1||t>e.length)return`absent`;let r=e.lastIndexOf(`
|
|
82
|
+
`,Math.max(0,t-1)),i=n;for(;r>0;){let t=e.lastIndexOf(`
|
|
83
|
+
`,r-1)+1,n=e.slice(t,r);if(i--,n.trim()!==``)return Hd(n,i===1);r=t-1}return`absent`}const qd=/^(?:\r?\n)+/;function Jd(e){return Pu(e).leading>0}function Yd(e){let t=Jd(e);return{project:e=>ef(Xd(e),t),unproject:(e,n)=>Zd(tf(e,Xd(n),t),n)}}function Xd(e){return e.replaceAll(`\r
|
|
84
|
+
`,`
|
|
85
|
+
`)}function Zd(e,t){let n=t.split(`\r
|
|
86
|
+
`).length-1;return n>t.split(`
|
|
87
|
+
`).length-1-n?e.replaceAll(`
|
|
88
|
+
`,`\r
|
|
89
|
+
`):e}function Qd(e,t){if(t)return{boundary:``,text:e};let{frontmatter:n,body:r}=iu(e),i=r.match(qd);if(!i)return{boundary:``,text:e};let a=r.slice(i[0].length);return n===``&&ru.test(a)?{boundary:``,text:e}:{boundary:i[0],text:n+a}}function $d(e,t){if(t===``)return e;let{frontmatter:n,body:r}=iu(e);return n+t+r}function ef(e,t){if(t)return e;let n=Qd(e,t).text;return iu(n).frontmatter===``?n:$d(n,`
|
|
90
|
+
`)}function tf(e,t,n){return n?e:$d(Qd(e,n).text,Qd(t,n).boundary)}function nf(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 rf(e){let{frontmatter:t,body:n}=iu(e);if(t===``)return Pu(e);let r=nf(t,n).body;return/^\n*$/.test(r)?Pu(e):Pu(r)}function af(e,t){let n=rf(e),r=rf(t);return n.leading!==r.leading||n.trailing!==r.trailing}function of(e,t=16){let n=e.trim();return n.length<t?!1:!(n.startsWith(`<`)||n.startsWith("```")||n.startsWith(`|`))}function sf(e,t=16){let n=new Map;for(let r of e.split(`
|
|
91
|
+
`)){if(!of(r,t))continue;let e=r.trim();n.set(e,(n.get(e)??0)+1)}return n}function cf(e,t,n=16){let r=sf(t,n),i=[];for(let[t,a]of sf(e,n))a>=2&&a>(r.get(t)??0)&&i.push(t);return i}function lf(e){let t=new Map;for(let n of e.split(`
|
|
92
|
+
`))n.trim()!==``&&t.set(n,(t.get(n)??0)+1);return t}function uf(e,t,n){let r=lf(e),i=lf(t),a=lf(n);for(let[e,t]of r)if(t>(i.get(e)??0)&&t>(a.get(e)??0))return!0;return!1}function df(e,t,n){let r=lf(e),i=lf(t),a=lf(n),o=[];for(let[e,t]of r)t>(i.get(e)??0)&&t>(a.get(e)??0)&&o.push(e);return o}function ff(e){let t=[],n=0;for(let r=e.indexOf(`
|
|
93
|
+
`);r!==-1;r=e.indexOf(`
|
|
94
|
+
`,r+1))r>0&&e.charCodeAt(r-1)===13?t.push(r-1-t.length):n++;return{positions:t,bareLfCount:n}}function pf(e,t){let n=0,r=e.length;for(;n<r;){let i=n+r>>>1;(e[i]??0)<t?n=i+1:r=i}return n}function mf(e,t=`
|
|
95
|
+
`){let{positions:n,bareLfCount:r}=ff(e);return n.length===0&&r===0?t:n.length>r?`\r
|
|
96
|
+
`:`
|
|
97
|
+
`}function hf(e){let{frontmatter:t,body:n}=iu(e);return mf(n,mf(t))}function gf(e,t){return t===`\r
|
|
98
|
+
`?e.replace(/\r?\n/g,`\r
|
|
99
|
+
`):e.replaceAll(`\r
|
|
100
|
+
`,`
|
|
101
|
+
`)}function _f(e){let{positions:t,bareLfCount:n}=ff(e);return t.length===0?{text:e,lineEnding:`
|
|
102
|
+
`,toRawOffset:e=>e}:{text:e.replaceAll(`\r
|
|
103
|
+
`,`
|
|
104
|
+
`),lineEnding:t.length>n?`\r
|
|
105
|
+
`:`
|
|
106
|
+
`,toRawOffset:e=>e+pf(t,e)}}const vf=new fd.default;vf.Match_Threshold=.5;function yf(e,t,n){let r=bf(e,t,n);return Ef(e,t,n,r),r}function bf(e,t,n){if(e===t)return n;if(e===n||t===n)return t;let r=gd(t.split(`
|
|
107
|
+
`),e.split(`
|
|
108
|
+
`),n.split(`
|
|
109
|
+
`)),i=[];for(let e=0;e<r.length;e++){let t=r[e];if(`ok`in t&&t.ok)i.push(t.ok.join(`
|
|
110
|
+
`));else if(`conflict`in t&&t.conflict){let e=t.conflict.o.join(`
|
|
111
|
+
`),n=t.conflict.a.join(`
|
|
112
|
+
`),r=t.conflict.b.join(`
|
|
113
|
+
`);i.push(Af(e,n,r))}}return i.join(`
|
|
114
|
+
`)}function xf(e,t,n){if(e===t)return{clean:!0,merged:n};if(e===n||t===n)return{clean:!0,merged:t};let r=gd(t.split(`
|
|
115
|
+
`),e.split(`
|
|
116
|
+
`),n.split(`
|
|
117
|
+
`)),i=[];for(let e of r)if(`ok`in e&&e.ok)i.push(e.ok.join(`
|
|
118
|
+
`));else return{clean:!1};let a=i.join(`
|
|
119
|
+
`);try{Ef(e,t,n,a)}catch{return{clean:!1}}return{clean:!0,merged:a}}function Sf(e){return e.map(e=>({len:e.length,digest:wu(e)}))}var Cf=class extends Error{info;constructor(e){let t=e.lostSubstrings.map(e=>JSON.stringify(e.length>80?`${e.slice(0,77)}...`:e)).join(`, `);super(`Bridge merge content loss (which=${e.which}, side=${e.side}): ${t}`),this.name=`BridgeMergeContentLossError`,this.info=e}toLog(e){let t=e?.verbose===!0;return{event:`bridge-merge-content-loss`,which:this.info.which,side:this.info.side,baselineLen:this.info.baseline.length,userTextLen:this.info.userText.length,agentTextLen:this.info.agentText.length,resultLen:this.info.result.length,lostSubstrings:t?this.info.lostSubstrings:Sf(this.info.lostSubstrings),redacted:!t}}};function wf(e,t){if(e===t)return[];let n=vf.diff_main(e,t);vf.diff_cleanupSemantic(n);let r=[];for(let[e,t]of n)if(e===1)for(let e of t.split(`
|
|
120
|
+
`)){let t=e.trim();t.length!==0&&r.push(t)}return r}function Tf(e,t){let n=0;for(let r of t){let t=e.indexOf(r,n);if(t<0){if(e.indexOf(r)<0)continue;return r}n=t+r.length}return null}function Ef(e,t,n,r){let i=wf(e,t),a=wf(e,n),o=i.filter(e=>!r.includes(e));if(o.length>0)throw new Cf({baseline:e,userText:t,agentText:n,result:r,lostSubstrings:o,which:`substring`,side:`user`});let s=a.filter(e=>!r.includes(e));if(s.length>0)throw new Cf({baseline:e,userText:t,agentText:n,result:r,lostSubstrings:s,which:`substring`,side:`agent`});let c=Tf(r,i);if(c!==null)throw new Cf({baseline:e,userText:t,agentText:n,result:r,lostSubstrings:[c],which:`order`,side:`user`});let l=Tf(r,a);if(l!==null)throw new Cf({baseline:e,userText:t,agentText:n,result:r,lostSubstrings:[l],which:`order`,side:`agent`});let u=sf(e),d=sf(t),f=sf(n);for(let[i,a]of sf(r))if(!(a<2)&&a>Math.max(u.get(i)??0,d.get(i)??0,f.get(i)??0))throw new Cf({baseline:e,userText:t,agentText:n,result:r,lostSubstrings:[i],which:`growth`,side:`user`})}function Df(e,t,n){let r=wf(t,e);return r.length===0?[]:r.filter(e=>!n.includes(e))}function Of(e){let t=``,n=[];for(let r=0;r<e.length;r++)/\s/.test(e[r])||(t+=e[r],n.push(r));return{chars:t,offsets:n}}function kf(e,t,n,r){let i=Of(t),a=vf.diff_main(Of(e).chars,i.chars);vf.diff_cleanupSemantic(a);let o=Of(r).chars,s=[],c=0;for(let[e,t]of a)if(e!==-1){if(e===1){let e=``;for(let r=0;r<t.length;r++){let a=i.offsets[c+r];a>=n.start&&a<n.end?e+=t[r]:e!==``&&(s.push(e),e=``)}e!==``&&s.push(e)}c+=t.length}return s.filter(e=>!o.includes(e))}function Af(e,t,n){if(t===``)return n;if(n===``)return t;let r=vf.patch_make(e,t),[i,a]=vf.patch_apply(r,n);return a.some(e=>!e)&&console.warn(JSON.stringify({event:`bridge-merge-patch-drop`,applied:a.filter(Boolean).length,total:a.length,regionSize:n.length})),i}const jf=/\\([!"#$%&'()*+,\-./:;<=>?@[\]^_`{|}~])/g,Mf=/(?<![^\n])((?:[ \t]*(?:>|(?:[-+*]|\d{1,9}[.)])[ \t]))*)[ \t]*(\d{1,9}\\[.)]|\\[-+*#>_=])/g,Nf=/^(?:[-+*](?:[ \t]|$)|\d{1,9}[.)](?:[ \t]|$)|#{1,6}(?:[ \t]|$)|>|(?:\*[ \t]*){3,}$|(?:-[ \t]*){3,}$|(?:_[ \t]*){3,}$)/,Pf=/^(?:[-+*][ \t]+\S|1[.)][ \t]+\S|#{1,6}(?:[ \t]|$)|>|(?:\*[ \t]*){3,}$|(?:_[ \t]*){3,}$|(?:-[ \t]*){3,}$|-+[ \t]*$|=+[ \t]*$)/,Ff=/^(?:$|#{1,6}(?:[ \t]|$)|`{3,}|~{3,}|(?:\*[ \t]*){3,}$|(?:-[ \t]*){3,}$|(?:_[ \t]*){3,}$)/,If=/^<\/?[A-Z][A-Za-z0-9.]*(?:\s[^>]*)?>$/;function Lf(e,t){return e.slice(e.lastIndexOf(`
|
|
121
|
+
`,t-2)+1,t-1)}function Rf(e){let t=e.replace(/^[ \t>]*/,``);return Ff.test(t)||If.test(t.replace(/[ \t]+$/,``))}function zf(e){let t=new Set;if(!e.includes(`\\`))return t;for(let n of e.matchAll(Mf)){let r=n[1]??``,i=n[2]??``,a=n.index,o=a+n[0].length-i.length,s=e.indexOf(`
|
|
122
|
+
`,o),c=e.slice(o,s===-1?e.length:s).replace(jf,`$1`),l=/[^ \t>]/.test(r),u=a===0||Rf(Lf(e,a));(l||u?Nf:Pf).test(c)&&t.add(o+i.indexOf(`\\`))}return t}function Bf(e){let t=zf(e);return t.size===0?e.replace(jf,`$1`):e.replace(jf,(e,n,r)=>t.has(r)?e:n)}const Vf=/^\s*\|?\s*:?-+:?\s*(\|\s*:?-+:?\s*)+\|?\s*$/,Hf=/^[ \t]+([-+*]|\d+[.)]|[a-zA-Z][.)])\s/,Uf=/^\d+([.)])(?=\s)/,Xee=/\*\*\s*(`[^`]+`)\s*\*\*/g,Zee=/^(`{3,}|~{3,})/;function Qee(e){let t=new Set,n=null;for(let r=0;r<e.length;r++){let i=e[r].trimEnd(),a=Zee.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||!Vf.test(i))continue;let o=e[r-1].trimEnd();if(!(!o.startsWith(`|`)||Vf.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 Wf(e){return e.slice(0,-1).trimEnd()}const Gf=/^(?:#{1,6}[ \t]|>|(?:[-+*]|\d{1,9}[.)])[ \t]|`{3,}|~{3,}|=+[ \t]*$|-+[ \t]*$|(?:\*[ \t]*){3,}$|(?:_[ \t]*){3,}$)/;function Kf(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}const $ee=/^<[A-Z][A-Za-z0-9.]*(?:\s[^>]*)?>$/,ete=/^<\/[A-Z][A-Za-z0-9.]*\s*>$/,tte=/<\/?[A-Z]/;function nte(e){let t=!1;for(let n=0;n<e.length;n++)if(tte.test(e[n]??``)){t=!0;break}if(!t)return e;let n=Kf(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&&If.test(s));let l=c&&ete.test(s),u=c&&!l&&$ee.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 rte(e){let t=nte(Bf(e.replace(/^/,``).replace(/\r/g,``)).replace(Xee,`$1`).replace(/^\n+/,``).replace(/^[*-]{3,}(?=\n|$)/,`---`).replace(/(\n)([#>+-]|\d+[.)]|`{3,}|~{3,})/g,`
|
|
123
|
+
|
|
124
|
+
$2`).replace(/^([#>+-].*|\d+[.)].*|`{3,}.*|~{3,}.*|<\/[A-Z][A-Za-z0-9]*>[ \t]*)\n([^\n])/gm,`$1
|
|
125
|
+
|
|
126
|
+
$2`).split(`
|
|
127
|
+
`)),n=Qee(t),r=Kf(t);return t.map((e,i)=>{let a=e.trimEnd();if(i>0&&!r.has(i)&&/^[ \t]+\S/.test(a)&&(t[i-1]??``).trim()!==``&&!Hf.test(a)&&!Gf.test(a.trimStart())){let e=(t[i-1]??``).trimStart();if(!Gf.test(e)&&!e.startsWith(`|`))return a.replace(/^[ \t]+/,``)}if(Vf.test(a)){let e=a.replace(/\s+/g,``);return n.has(i)&&e.length>1&&e.startsWith(`|`)&&e.endsWith(`|`)?Wf(e):e}let o=Hf.test(a)?a.replace(/^[ \t]+/,``):a;return n.has(i)&&o.length>1&&o.startsWith(`|`)&&o.endsWith(`|`)&&(o=Wf(o)),o.replace(Uf,`1$1`)}).join(`
|
|
128
|
+
`).replace(/\n{3,}/g,`
|
|
129
|
+
|
|
130
|
+
`).replace(/\n+$/,``)}function qf(e){return[...e.replace(/^\n+/,``).replace(/\n+$/,``).matchAll(/\n{2,}/g)].map(e=>e[0].length)}function ite(e,t){let n=rf(e),r=rf(t);if(r.leading>n.leading||r.trailing>n.trailing)return!0;let i=qf(iu(e).body),a=qf(iu(t).body);return i.length===a.length&&a.some((e,t)=>e>(i[t]??0))}function ate(e,t){let n=[];(e.charCodeAt(0)===65279||t.charCodeAt(0)===65279)&&n.push(`bom`),(e.includes(`\r`)||t.includes(`\r`))&&n.push(`crlf`),(/\\[!"#$%&'()*+,\-./:;<=>?@[\]^_`{|}~\\]/.test(e)||/\\[!"#$%&'()*+,\-./:;<=>?@[\]^_`{|}~\\]/.test(t))&&n.push(`commonmark-escape`),(/\*\*\s*`[^`]+`\s*\*\*/.test(e)||/\*\*\s*`[^`]+`\s*\*\*/.test(t))&&n.push(`emphasis-around-code`);let r=e.replace(/^/,``),i=t.replace(/^/,``);r.startsWith(`
|
|
131
|
+
`)!==i.startsWith(`
|
|
132
|
+
`)&&n.push(`leading-newline`);let a=r.replace(/^\n+/,``),o=i.replace(/^\n+/,``),s=/^\*{3,}(?=\n|$)/.test(a),c=/^-{3,}(?=\n|$)/.test(a),l=/^\*{3,}(?=\n|$)/.test(o),u=/^-{3,}(?=\n|$)/.test(o);(s&&u||c&&l)&&n.push(`doc-start-thematic`);let d=/\n\n([#>+-]|\d+[.)]|`{3,}|~{3,})/,f=/^([#>+-].*|\d+[.)].*|`{3,}.*|~{3,}.*|<\/[A-Z][A-Za-z0-9]*>[ \t]*)\n\n[^\n]/m,p=d.test(r),m=d.test(i),h=f.test(r),g=f.test(i);(p!==m||h!==g)&&n.push(`block-separator-collapse`);let _=r.replace(/\r/g,``),v=i.replace(/\r/g,``),y=/^\s*\|?\s*:?-+:?\s*(\|\s*:?-+:?\s*)+\|?\s*$/m;(y.test(_)||y.test(v))&&n.push(`table-align-row-spacing`);let b=e=>y.test(e)&&/^\|[^\n]*[^|\s][ \t]*$/m.test(e);b(_)!==b(v)&&n.push(`row-no-trailing-pipe`);let x=/^[ \t]+([-+*]|\d+[.)]|[a-zA-Z][.)])\s/m;(x.test(_)||x.test(v))&&n.push(`list-indent-canonical`);let S=/[^\n]\n[ \t]+(?![-+*>#]|\d+[.)])\S/;(S.test(_)||S.test(v))&&n.push(`paragraph-continuation-indent`);let C=_.split(`
|
|
133
|
+
`),w=v.split(`
|
|
134
|
+
`),T=e=>{for(let t=0;t<e.length-1;t++){let n=(e[t]??``).trim(),r=(e[t+1]??``).trim(),i=n!==``&&r===``&&If.test(n),a=n===``&&r!==``&&If.test(r);if(i||a)return!0}return!1};(T(C)||T(w))&&n.push(`jsx-container-boundary-blank`);let ee=e=>e.replace(/^[ \t]+/,``).replace(Uf,`1$1`),te=Math.min(C.length,w.length);for(let e=0;e<te;e++){let t=C[e]??``,r=w[e]??``;if(t!==r&&ee(t)===ee(r)&&/^[ \t]*\d+[.)]\s/.test(t)){n.push(`ordered-list-marker-number`);break}}return(/[ \t]\n/.test(_)||/[ \t]\n/.test(v))&&n.push(`trailing-whitespace`),(/[ \t]$/.test(_)||/[ \t]$/.test(v))&&(n.includes(`trailing-whitespace`)||n.push(`trailing-whitespace`)),(/\n{3,}/.test(_)||/\n{3,}/.test(v))&&n.push(`blank-line-collapse`),_.endsWith(`
|
|
135
|
+
`)!==v.endsWith(`
|
|
136
|
+
`)&&n.push(`trailing-newline`),n}const ote=`parse-equivalence`;function Jf(e){return ste(cte(gf(e,`
|
|
137
|
+
`)))}function ste(e){return e.replace(/^\n+/,``).replace(/\n+$/,``)}function cte(e){return e.replace(/[ \t]+$/gm,``)}const lte=/^([ \t]*)\d+([.)])(?=[ \t])/;function Yf(e){return e.split(`
|
|
138
|
+
`).map(e=>e.replace(lte,(e,t,n)=>`${t}1${n}`)).join(``).replace(/\s+/g,``)}const Xf=new Set;function ute(e,t,n){let r=iu(e),i=iu(t);if(r.frontmatter!==i.frontmatter)return!1;if(r.body===i.body)return!0;let a;try{a=n(r.body)}catch(e){let t=e instanceof Error?e.message:String(e);return Xf.size<8&&!Xf.has(t)&&(Xf.add(t),console.warn(`[parse-equivalence] canonicalizeBody threw; treating as not equivalent:`,t)),!1}return Jf(a)===Jf(i.body)&&Lu(Yf(r.body),Yf(a))}const dte={setTimeout:(e,t)=>globalThis.setTimeout(e,t),clearTimeout:e=>globalThis.clearTimeout(e),now:()=>Date.now()},Zf=`ok-checkpoint-v1: `,fte=[`check-failed`,`too-large`,`conflict-markers`,`no-base`],pte=[`mermaid`,`excalidraw`,`text`,`config`];function Qf(e){return e===`ours`||e===`theirs`}function mte(e){return fte.includes(e)}function hte(e){return pte.includes(e)}function gte(e){if(!e)return null;for(let t of e.split(`
|
|
139
|
+
`)){let e=t.trim();if(!e.startsWith(Zf))continue;let n;try{n=JSON.parse(e.slice(18))}catch{return null}if(typeof n!=`object`||!n)return null;let r=n,i=r.kind,a=r.metadata;if(typeof a!=`object`||!a)return null;let o=typeof r.docName==`string`?r.docName:null,s=typeof r.size==`number`&&Number.isFinite(r.size)?r.size:null;if(i===`bridge-merge-loss`){let e=a;return Array.isArray(e.lostSubstrings)&&e.lostSubstrings.every(e=>typeof e==`string`)?{kind:`bridge-merge-loss`,docName:o,size:s,metadata:{lostSubstrings:e.lostSubstrings}}:null}if(i===`producer-guard-loss`){let e=a;return typeof e.construct==`string`?{kind:`producer-guard-loss`,docName:o,size:s,metadata:{construct:e.construct}}:null}if(i===`observer-a-duplication`){let e=a;return typeof e.duplicatedLineCount==`number`&&Number.isFinite(e.duplicatedLineCount)?{kind:`observer-a-duplication`,docName:o,size:s,metadata:{duplicatedLineCount:e.duplicatedLineCount}}:null}if(i===`external-change-rescue`){let e=a;return typeof e.incomingDiskSha==`string`?{kind:`external-change-rescue`,docName:o,size:s,metadata:{incomingDiskSha:e.incomingDiskSha}}:null}if(i===`external-change-rescue-disk-update`){let e=a;return typeof e.incomingDiskSha==`string`?{kind:`external-change-rescue-disk-update`,docName:o,size:s,metadata:{incomingDiskSha:e.incomingDiskSha}}:null}if(i===`defer-exhaustion-loss`){let e=a;return typeof e.deferCount==`number`&&Number.isFinite(e.deferCount)?{kind:`defer-exhaustion-loss`,docName:o,size:s,metadata:{deferCount:e.deferCount}}:null}if(i===`observer-a-apply-loss`){let e=a;return Array.isArray(e.lostSubstrings)&&e.lostSubstrings.every(e=>typeof e==`string`)?{kind:`observer-a-apply-loss`,docName:o,size:s,metadata:{lostSubstrings:e.lostSubstrings}}:null}if(i===`bridge-derive-loss`){let e=a;return Array.isArray(e.lostSubstrings)&&e.lostSubstrings.every(e=>typeof e==`string`)?{kind:`bridge-derive-loss`,docName:o,size:s,metadata:{lostSubstrings:e.lostSubstrings}}:null}if(i===`bridge-backstop-trip`){let e=a;return typeof e.rounds==`number`&&Number.isFinite(e.rounds)?{kind:`bridge-backstop-trip`,docName:o,size:s,metadata:{rounds:e.rounds}}:null}if(i===`persistence-reconcile-loss`){let e=a;return typeof e.atRiskLines==`number`&&Number.isFinite(e.atRiskLines)&&typeof e.witnessAvailable==`boolean`?{kind:`persistence-reconcile-loss`,docName:o,size:s,metadata:{atRiskLines:e.atRiskLines,witnessAvailable:e.witnessAvailable}}:null}if(i===`persistence-duplication-reset`){let e=a;return typeof e.copies==`number`&&Number.isFinite(e.copies)&&typeof e.fragmentChildren==`number`&&Number.isFinite(e.fragmentChildren)?{kind:`persistence-duplication-reset`,docName:o,size:s,metadata:{copies:e.copies,fragmentChildren:e.fragmentChildren}}:null}if(i===`persistence-divergence-realign`||i===`managed-artifact-reconcile`){let e=a;return typeof e.diskBytes==`number`&&Number.isFinite(e.diskBytes)&&typeof e.discardedBytes==`number`&&Number.isFinite(e.discardedBytes)?{kind:i,docName:o,size:s,metadata:{diskBytes:e.diskBytes,discardedBytes:e.discardedBytes}}:null}if(i===`external-change-both-kept`){let e=a;return Qf(e.side)&&typeof e.keptBlocks==`number`&&Number.isFinite(e.keptBlocks)?{kind:`external-change-both-kept`,docName:o,size:s,metadata:{side:e.side,keptBlocks:e.keptBlocks}}:null}if(i===`external-change-kept-live`){let e=a;return Qf(e.side)&&mte(e.reason)?{kind:`external-change-kept-live`,docName:o,size:s,metadata:{side:e.side,reason:e.reason}}:null}if(i===`external-change-no-engine`){let e=a;return Qf(e.side)&&hte(e.fileType)?{kind:`external-change-no-engine`,docName:o,size:s,metadata:{side:e.side,fileType:e.fileType}}:null}if(i===`auto-consolidation`){let e=a;return typeof e.foldedRefs==`number`&&Number.isFinite(e.foldedRefs)&&typeof e.trigger==`string`?{kind:`auto-consolidation`,docName:o,size:s,metadata:{foldedRefs:e.foldedRefs,trigger:e.trigger}}:null}return null}return null}function _te(e){let t={kind:e.kind,metadata:e.metadata};return e.docName!==null&&(t.docName=e.docName),e.size!==null&&(t.size=e.size),`${Zf}${JSON.stringify(t)}`}const $f={"bridge-merge-loss":{visibility:`surfaced`,gcBucket:`bridge-merge-loss`,bundleExposure:`subject-only`,chainAnchor:!1},"producer-guard-loss":{visibility:`surfaced`,gcBucket:`producer-guard-loss`,bundleExposure:`metadata`,chainAnchor:!1},"observer-a-duplication":{visibility:`surfaced`,gcBucket:`observer-a-duplication`,bundleExposure:`metadata`,chainAnchor:!1},"external-change-rescue":{visibility:`surfaced`,gcBucket:`external-change-rescue`,bundleExposure:`metadata`,chainAnchor:!1},"external-change-rescue-disk-update":{visibility:`surfaced`,gcBucket:`external-change-rescue-disk-update`,bundleExposure:`metadata`,chainAnchor:!1},"defer-exhaustion-loss":{visibility:`surfaced`,gcBucket:`defer-exhaustion-loss`,bundleExposure:`metadata`,chainAnchor:!1},"observer-a-apply-loss":{visibility:`surfaced`,gcBucket:`observer-a-apply-loss`,bundleExposure:`subject-only`,chainAnchor:!1},"bridge-derive-loss":{visibility:`surfaced`,gcBucket:`bridge-derive-loss`,bundleExposure:`subject-only`,chainAnchor:!1},"bridge-backstop-trip":{visibility:`surfaced`,gcBucket:`bridge-backstop-trip`,bundleExposure:`metadata`,chainAnchor:!1},"persistence-reconcile-loss":{visibility:`surfaced`,gcBucket:`persistence-reconcile-loss`,bundleExposure:`metadata`,chainAnchor:!1},"persistence-duplication-reset":{visibility:`surfaced`,gcBucket:`persistence-duplication-reset`,bundleExposure:`metadata`,chainAnchor:!1},"persistence-divergence-realign":{visibility:`surfaced`,gcBucket:`persistence-divergence-realign`,bundleExposure:`metadata`,chainAnchor:!1},"managed-artifact-reconcile":{visibility:`surfaced`,gcBucket:`managed-artifact-reconcile`,bundleExposure:`metadata`,chainAnchor:!1},"external-change-both-kept":{visibility:`surfaced`,gcBucket:`external-change-both-kept`,bundleExposure:`metadata`,chainAnchor:!1},"external-change-kept-live":{visibility:`surfaced`,gcBucket:`external-change-kept-live`,bundleExposure:`metadata`,chainAnchor:!1},"external-change-no-engine":{visibility:`surfaced`,gcBucket:`external-change-no-engine`,bundleExposure:`metadata`,chainAnchor:!1},"auto-consolidation":{visibility:`hidden`,gcBucket:`auto-consolidation`,bundleExposure:`none`,chainAnchor:!0}},vte=Object.keys($f);function yte(e){return e==null||$f[e].visibility===`surfaced`}function bte(e){return e==null||$f[e].chainAnchor}const ep={editor:{left:`editorMoveToLeftEdge`,right:`editorMoveToRightEdge`,top:`editorMoveToTopEdge`,bottom:`editorMoveToBottomEdge`},agents:{left:`agentsMoveToLeftEdge`,right:`agentsMoveToRightEdge`,top:`agentsMoveToTopEdge`,bottom:`agentsMoveToBottomEdge`},terminal:{left:`terminalMoveToLeftEdge`,right:`terminalMoveToRightEdge`,top:`terminalMoveToTopEdge`,bottom:`terminalMoveToBottomEdge`}},xte={editor:[`document`],agents:[`chat`,`ai`],terminal:[`shell`,`console`]},Ste=[`left`,`right`,`top`,`bottom`],Cte=Object.keys(ep).flatMap(e=>Ste.map(t=>({id:`move-${e}-${t}`,pane:e,side:t,labelKey:ep[e][t]})));function wte(e){let t=e.pane===`terminal`;return{id:e.id,labelKey:e.labelKey,keywords:[`move`,`dock`,`pane`,`layout`,`edge`,e.pane,...xte[e.pane],e.side],availability:t?{host:`desktop`,requiresTerminalCapability:!0}:{},palette:{group:t?`terminal`:`view`,visibility:`search-only`}}}[...Cte.map(wte)];const tp=new Map([[32,` `],[9,` `],[160,`\xA0`]]);function np(e){let t=/^&#(x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);$/.exec(e);if(!t)return null;let n=t[1],r=n[0]===`x`||n[0]===`X`,i=Number.parseInt(r?n.slice(1):n,r?16:10);return Number.isNaN(i)?null:i}function rp(e){let t=np(e);return t!==null&&tp.has(t)}function ip(e){let t=np(e);return t===null?null:tp.get(t)??null}const ap=/&#(?:x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);/g;function op(e){ap.lastIndex=0;let t=e.match(ap);if(t===null||t.join(``)!==e)return null;let n=``;for(let e of t){let t=ip(e);if(t===null)return null;n+=t}return n}const sp=[`off`,`follow`,`full`],cp=`pull`,lp=[`off`,`follow`,`full`,cp],Tte=[`follow`,`full`,cp];function up(e){return e===cp?`follow`:Ete(e)?e:null}function Ete(e){return typeof e==`string`&&sp.includes(e)}function Dte(e){return e===!0?`full`:e===!1?`off`:null}function Ote(e){return e===!0?`full`:e===!1?`off`:up(e)}function kte(e){let t=up(e?.mode);return t===null?Dte(e?.enabled):t}const dp=3600;function fp(e,t){return typeof e!=`number`||!Number.isFinite(e)?t:Math.min(dp,Math.max(30,Math.round(e)))}function Ate(e){return{pullIntervalSeconds:fp(e?.pullIntervalSeconds,30),pushIntervalSeconds:fp(e?.pushIntervalSeconds,60)}}const pp=Symbol.for(`@inkeep/open-knowledge/field-registry`),mp=globalThis;mp[pp]===void 0&&(mp[pp]=Vr());const z=mp[pp];function jte(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=Mte(t)?z.get(t):void 0;if(e!==void 0)return e;let n=t._zod?.def?.innerType;if(n===void 0)return;t=n}}function Mte(e){return typeof e==`object`&&!!e&&`_zod`in e&&`parse`in e}const hp=[`.mdx`,`.md`],gp=new Set(Object.keys({sh:`bash`,zsh:`bash`,bash:`bash`,c:`c`,cc:`cpp`,cpp:`cpp`,cxx:`cpp`,"c++":`cpp`,h:`c`,hh:`cpp`,hpp:`cpp`,cs:`csharp`,css:`css`,less:`less`,scss:`scss`,sass:`scss`,diff:`diff`,patch:`diff`,feature:`gherkin`,go:`go`,gql:`graphql`,graphql:`graphql`,ini:`ini`,cfg:`ini`,conf:`ini`,properties:`ini`,java:`java`,js:`javascript`,jsx:`javascript`,mjs:`javascript`,cjs:`javascript`,json:`json`,jsonc:`json`,kt:`kotlin`,kts:`kotlin`,lua:`lua`,makefile:`makefile`,md:`markdown`,mdx:`markdown`,m:`objectivec`,mm:`objectivec`,pl:`perl`,pm:`perl`,php:`php`,phtml:`php`,py:`python`,pyi:`python`,pyx:`python`,r:`r`,rb:`ruby`,rs:`rust`,sql:`sql`,swift:`swift`,ts:`typescript`,tsx:`typescript`,xml:`xml`,yaml:`yaml`,yml:`yaml`})),Nte=new Set([`md`,`mdx`,`mmd`,`mermaid`]),Pte=new Set([...gp,`txt`,`text`,`csv`,`tsv`,`log`,`toml`,`html`,`htm`,`svg`,`vue`,`svelte`,`astro`,`lock`].filter(e=>!Nte.has(e)));function Fte(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);return n<=0?!1:Pte.has(t.slice(n+1).toLowerCase())}const _p=[`image/jpeg`,`image/png`,`image/gif`,`image/webp`,`image/svg+xml`],Ite=[`video/mp4`,`video/webm`,`video/ogg`],Lte=[`audio/mpeg`,`audio/wav`,`audio/ogg`],Rte=[`application/pdf`],vp=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`avif`,`svg`]),yp=new Set([`mp4`,`webm`,`mov`,`m4v`,`mkv`]),zte=new Set([`pdf`]),bp=new Set([`mp3`,`wav`,`ogg`,`m4a`,`flac`,`aac`,`opus`]),xp=new Set(`pdf.docx.xlsx.pptx.doc.xls.ppt.zip.7z.tar.gz.rar.csv.tsv.rtf.json.yaml.yml.xml.txt.pages.numbers.key.odt.ods.odp.epub.mobi`.split(`.`)),Bte=new Set(`exe.bat.cmd.ps1.com.msi.vbs.vbe.py.pyw.pyc.pyz.pyzw.js.jse.wsf.wsh.hta.sh.command.tool.csh.ksh.bash.zsh.fish.desktop.action.workflow.html.htm.svg.xml.mhtml.svgz.dmg.pkg.mpkg.scpt.applescript.terminal.prefpane.webloc.inetloc.fileloc.jar.appimage.deb.rpm.msix.appx.ipa.apk.pif.scr.lnk.url.cpl.msc.chm.application.appref-ms.settingcontent-ms.reg.inf.scf.sct.wsc.msp.mst.shb.shs`.split(`.`)),Sp=new Set(`png.jpg.jpeg.gif.webp.avif.svg.apng.heic.heif.tiff.bmp.ico.pdf.mp4.webm.mov.m4v.mkv.avi.flv.wmv.mpeg.mpg.mp3.wav.ogg.m4a.flac.aac.opus.zip.7z.tar.gz.rar.woff.woff2.ttf.otf.eot.docx.xlsx.pptx.doc.xls.ppt.odt.ods.odp.pages.numbers.key.epub.mobi.csv.tsv.txt.rtf.json.yaml.yml.xml.toml.lock.gpx.html.htm`.split(`.`)),Vte=new Set([`html`,`htm`]),Hte=`sandbox allow-scripts; connect-src 'none'`,Cp=new Set(`png.jpg.jpeg.gif.webp.avif.apng.heic.heif.tiff.bmp.ico.svg.pdf.mp4.webm.mov.m4v.mkv.mp3.wav.ogg.m4a.flac.aac.opus.json.toml.lock`.split(`.`)),wp=`./{{filename}}.assets`,Ute=`same-dir`,Tp=new Set(`png.jpg.jpeg.gif.webp.avif.svg.pdf.mp4.webm.mov.m4v.mkv.mp3.wav.ogg.m4a.flac.aac.opus.docx.xlsx.pptx.doc.xls.ppt.zip.7z.tar.gz.rar.csv.tsv.rtf.json.yaml.yml.xml.txt.pages.numbers.key.odt.ods.odp.epub.mobi`.split(`.`)),Ep=[`png`,`jpg`,`jpeg`,`gif`,`webp`,`avif`],Dp=[`mp4`,`webm`,`mov`,`m4v`],Op=[`mp3`,`wav`,`ogg`,`m4a`,`flac`,`aac`,`opus`],kp=[`pdf`],Ap=[`json`,`toml`,`lock`];function jp(e,t,n){for(let r of t)if(!n.has(r))throw Error(`${e}: ${r} is not present in canonical upload constants`)}jp(`SIDEBAR_IMAGE_ASSET_EXTENSIONS`,Ep,vp),jp(`SIDEBAR_VIDEO_ASSET_EXTENSIONS`,Dp,yp),jp(`SIDEBAR_AUDIO_ASSET_EXTENSIONS`,Op,bp),jp(`SIDEBAR_PDF_ASSET_EXTENSIONS`,kp,zte),jp(`FILE_ATTACHMENT_EXTENSIONS`,[...xp],Tp),jp(`WIKI_EMBED_EXTENSIONS`,[...Tp],Sp);const Wte=new Set(Ep),Gte=new Set(Dp),Kte=new Set(Op),qte=new Set(kp),Jte=new Set(Ap);jp(`SIDEBAR_RENDERABLE_ASSET_EXTENSIONS`,[...new Set([...Ep,...Dp,...Op,...kp,...Ap])],Cp);const Mp=new Set([`base`,`canvas`]),Np=new Set([`mmd`,`mermaid`]);function Yte(e){let t=e.lastIndexOf(`.`);return t<0?!1:Np.has(e.slice(t+1).toLowerCase())}const Pp=new Set([`excalidraw`]);function Xte(e){let t=e.lastIndexOf(`.`);return t<0?!1:Pp.has(e.slice(t+1).toLowerCase())}const Zte=new Set([...Sp,...Mp,...Np,...Pp]);function Qte(e){let t=e.toLowerCase().replace(/^\./,``);return Wte.has(t)?`image`:Gte.has(t)?`video`:Kte.has(t)?`audio`:qte.has(t)?`pdf`:Jte.has(t)||Mp.has(t)?`text`:Np.has(t)?`mermaid`:Pp.has(t)?`excalidraw`:gp.has(t)?`text`:null}const Fp=[`en`,`zh-Hans`,`zh-Hant`,`hi`,`es`,`ar`,`fr`,`bn`,`pt-BR`,`id`,`ur`,`ko`,`pl`],$te=new Set([`ar`,`ur`]),ene=Fp.filter(e=>!$te.has(e)),tne=[`markdownlint`,`frontmatter`,`okf`],nne=[`missing`,`invalid`];[...tne];const rne=[`off`,`warning`,`error`],Ip=`warning`,ine=[`error`,`warning`],Lp=[`base00`,`base01`,`base02`,`base03`,`base04`,`base05`,`base06`,`base07`,`base08`,`base09`,`base0A`,`base0B`,`base0C`,`base0D`,`base0E`,`base0F`],ane={base00:`default background`,base01:`alt background — cards, popovers, sidebar`,base02:`selection background, borders`,base03:`comments, invisibles`,base04:`secondary text`,base05:`default foreground`,base06:`light foreground`,base07:`lightest foreground`,base08:`red — variables, tags, diff deleted`,base09:`orange — numbers, constants`,base0A:`yellow — classes, search highlight`,base0B:`green — strings, diff inserted`,base0C:`cyan — support, escapes, quotes`,base0D:`blue — functions, headings, accent`,base0E:`magenta — keywords, storage`,base0F:`deprecated markers, embedded tags`},Rp=/^#[0-9a-fA-F]{6}$/,one=/\P{White_Space}/u,zp={graphical:3,text:4.5};function Bp(e){return one.test(e)}function Vp(e){return typeof e==`string`&&Rp.test(e)}function Hp(e,t){let n=Yp(e),r=Yp(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function Up(e,t){return t.reduce((t,n)=>Hp(e,n)>Hp(e,t)?n:t)}function Wp(e,t){let n=Up(e,t);return Hp(e,n)>=zp.text?n:Up(e,[`#000000`,`#ffffff`])}function Gp(e,t,n,r=0){let i=Up(e[0]??`#ffffff`,[`#000000`,`#ffffff`]),a=e=>{for(let n=0;n<=255;n+=1){let r=n===0?t:Jp(t,i,n/255);if(e(r))return r}return null},o=t=>e.every(e=>Hp(e,t)>=n),s=t=>e.every(e=>Hp(Jp(e,t,r),t)>=n),c=a(e=>o(e)&&s(e))??a(o);return c===null?(console.warn(`[base16] No foreground reaches a ${n}:1 contrast ratio against ${e.join(`, `)}; using the highest-contrast endpoint`),i):c}function sne(e){let t=e.palette,n=Jp(t.base02,e.variant===`dark`?`#ffffff`:`#000000`,.04),r=e=>Gp([t.base00,t.base01],e,zp.text,.25);return{background:t.base00,foreground:t.base05,card:t.base01,"card-foreground":t.base05,popover:t.base01,"popover-foreground":t.base05,primary:t.base0D,"primary-foreground":t.base00,secondary:t.base01,"secondary-foreground":t.base05,muted:t.base01,"muted-foreground":t.base04,accent:t.base02,"accent-foreground":t.base05,destructive:r(t.base08),success:r(t.base0B),warning:r(t.base0A),info:r(t.base0D),border:t.base02,input:t.base02,ring:t.base0D,"selection-soft":t.base02,"chart-1":t.base0D,"chart-2":t.base0B,"chart-3":t.base0A,"chart-4":t.base0E,"chart-5":t.base08,"identity-1":t.base0E,"identity-2":t.base0C,"identity-3":t.base09,"identity-4":t.base0F,sidebar:t.base01,"sidebar-foreground":t.base05,"sidebar-primary":t.base0D,"sidebar-primary-foreground":t.base00,"sidebar-accent":t.base02,"sidebar-accent-foreground":t.base0D,"sidebar-hover":t.base02,"sidebar-hover-foreground":Wp(t.base02,[t.base00,t.base05,t.base07]),"sidebar-hover-muted-foreground":Gp([t.base02],t.base04,zp.text),"sidebar-hover-destructive-foreground":Gp([t.base02],t.base08,zp.graphical),"sidebar-selected":n,"sidebar-selected-foreground":Wp(n,[t.base00,t.base05,t.base07]),"sidebar-selected-muted-foreground":Gp([n],t.base04,zp.text),"sidebar-selected-destructive-foreground":Gp([n],t.base08,zp.graphical),"sidebar-border":t.base02,"sidebar-ring":t.base0D,"syntax-keyword":t.base0E,"syntax-tag":t.base08,"syntax-attr":t.base0D,"syntax-string":t.base0B,"syntax-number":t.base09,"syntax-atom":t.base0C,"syntax-comment":t.base03,"syntax-func":t.base0D,"syntax-var":t.base08,"syntax-type":t.base0A,"syntax-operator":t.base05,"syntax-meta":t.base0F,"syntax-bg":t.base01,"link-color":t.base0D,"broken-link-color":t.base08,"lint-warning-color":t.base0A,"lint-error-color":t.base08,"diff-added":t.base0B,"diff-removed":t.base08,"diff-modified":t.base0D,"callout-note-color":t.base0D,"callout-info-color":t.base0D,"callout-todo-color":t.base0D,"callout-abstract-color":t.base0C,"callout-tip-color":t.base0B,"callout-success-color":t.base0B,"callout-important-color":t.base0E,"callout-example-color":t.base0E,"callout-question-color":t.base0E,"callout-warning-color":t.base0A,"callout-caution-color":t.base09,"callout-danger-color":t.base09,"callout-failure-color":t.base08,"callout-bug-color":t.base08,"callout-quote-color":t.base03,...lne(t)}}const Kp={black:`base00`,red:`base08`,green:`base0B`,yellow:`base0A`,blue:`base0D`,magenta:`base0E`,cyan:`base0C`,white:`base05`,brightBlack:`base03`,brightRed:`base08`,brightGreen:`base0B`,brightYellow:`base0A`,brightBlue:`base0D`,brightMagenta:`base0E`,brightCyan:`base0C`,brightWhite:`base07`},cne=Object.keys(Kp);function lne(e){let t={};for(let n of cne)t[`ansi-${une(n)}`]=e[Kp[n]];return t}function une(e){return e.replace(/([a-z])([A-Z])/g,`$1-$2`).toLowerCase()}function qp(e){return JSON.stringify(e).replace(/[\u007f-\u009f\u2028\u2029\ufffe\uffff]/g,e=>`\\u${e.charCodeAt(0).toString(16).padStart(4,`0`)}`)}function dne(e){return`${[`system: "base16"`,`name: ${qp(e.name)}`,...e.author?[`author: ${qp(e.author)}`]:[],`variant: ${qp(e.variant)}`,`palette:`,...Lp.map(t=>` ${t}: ${qp(e.palette[t])}`)].join(`
|
|
140
|
+
`)}\n`}function fne(e){let t;try{t=(0,su.parse)(e,{schema:`failsafe`})}catch(e){let t=e?.linePos;return{ok:!1,error:{kind:`unparseable`,line:typeof t?.[0]?.line==`number`?t[0].line:void 0}}}if(!t||typeof t!=`object`||Array.isArray(t))return{ok:!1,error:{kind:`not-a-scheme`}};let n=t,r=n.palette,i=r&&typeof r==`object`&&!Array.isArray(r)?r:n,a={},o=[],s=[];for(let e of Lp){let t=i[e]??i[e.toLowerCase()];if(t==null){o.push(e);continue}let n=pne(t);if(!n){s.push(e);continue}a[e]=n}return o.length?{ok:!1,error:{kind:`missing-slots`,slots:o}}:s.length?{ok:!1,error:{kind:`bad-hex`,slots:s}}:typeof n.name==`string`&&!Bp(n.name)||typeof n.author==`string`&&!Bp(n.author)?{ok:!1,error:{kind:`not-a-scheme`}}:{ok:!0,scheme:{name:typeof n.name==`string`?n.name:`Imported`,author:typeof n.author==`string`?n.author:void 0,variant:n.variant===`light`||n.variant===`dark`?n.variant:Xp(a),palette:a}}}function pne(e){if(typeof e!=`string`)return null;let t=e.trim();return t.startsWith(`#`)||(t=`#${t}`),/^#[0-9a-fA-F]{3}$/.test(t)&&(t=`#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}`),Rp.test(t)?t.toLowerCase():null}function Jp(e,t,n){let r=Vp(e)?e:`#000000`,i=Vp(t)?t:`#000000`,a=Math.min(1,Math.max(0,n)),o=`#`;for(let e=0;e<3;e++){let t=Number.parseInt(r.slice(1+e*2,3+e*2),16),n=Number.parseInt(i.slice(1+e*2,3+e*2),16);o+=Math.round(t+(n-t)*a).toString(16).padStart(2,`0`)}return o}function Yp(e){let t=Vp(e)?e:`#000000`,n=e=>{let n=Number.parseInt(t.slice(1+e*2,3+e*2),16)/255;return n<=.03928?n/12.92:((n+.055)/1.055)**2.4};return .2126*n(0)+.7152*n(1)+.0722*n(2)}function Xp(e){return Yp(e.base00)<Yp(e.base05)?`dark`:`light`}const Zp={name:`Dracula`,author:`clach04 (https://github.com/clach04)`,variant:`dark`,palette:{base00:`#282a36`,base01:`#21222c`,base02:`#44475a`,base03:`#6272a4`,base04:`#9ea8c7`,base05:`#f8f8f2`,base06:`#f8f8f2`,base07:`#ffffff`,base08:`#ff5555`,base09:`#ffb86c`,base0A:`#f1fa8c`,base0B:`#50fa7b`,base0C:`#8be9fd`,base0D:`#bd93f9`,base0E:`#ff79c6`,base0F:`#993333`}},Qp={name:`Catppuccin Frappé`,author:`https://github.com/catppuccin/catppuccin`,variant:`dark`,palette:{base00:`#303446`,base01:`#292c3c`,base02:`#414559`,base03:`#51576d`,base04:`#626880`,base05:`#c6d0f5`,base06:`#f2d5cf`,base07:`#babbf1`,base08:`#e78284`,base09:`#ef9f76`,base0A:`#e5c890`,base0B:`#a6d189`,base0C:`#81c8be`,base0D:`#8caaee`,base0E:`#ca9ee6`,base0F:`#eebebe`}},$p={name:`Catppuccin Latte`,author:`https://github.com/catppuccin/catppuccin`,variant:`light`,palette:{base00:`#eff1f5`,base01:`#e6e9ef`,base02:`#ccd0da`,base03:`#bcc0cc`,base04:`#acb0be`,base05:`#4c4f69`,base06:`#dc8a78`,base07:`#7287fd`,base08:`#d20f39`,base09:`#fe640b`,base0A:`#df8e1d`,base0B:`#40a02b`,base0C:`#179299`,base0D:`#1d62ec`,base0E:`#8839ef`,base0F:`#dd7878`}},mne={name:`Monokai`,author:`Wimer Hazenberg (http://www.monokai.nl)`,variant:`dark`,palette:{base00:`#272822`,base01:`#383830`,base02:`#49483e`,base03:`#75715e`,base04:`#a59f85`,base05:`#f8f8f2`,base06:`#f5f4f1`,base07:`#f9f8f5`,base08:`#f92672`,base09:`#fd971f`,base0A:`#f4bf75`,base0B:`#a6e22e`,base0C:`#a1efe4`,base0D:`#66d9ef`,base0E:`#ae81ff`,base0F:`#cc6633`}},em={name:`Gruvbox dark, medium`,author:`Dawid Kurek, morhetz (https://github.com/morhetz/gruvbox)`,variant:`dark`,palette:{base00:`#282828`,base01:`#3c3836`,base02:`#504945`,base03:`#665c54`,base04:`#bdae93`,base05:`#d5c4a1`,base06:`#ebdbb2`,base07:`#fbf1c7`,base08:`#fb4934`,base09:`#fe8019`,base0A:`#fabd2f`,base0B:`#b8bb26`,base0C:`#8ec07c`,base0D:`#83a598`,base0E:`#d3869b`,base0F:`#d65d0e`}},tm={name:`Solarized Dark`,author:`Ethan Schoonover (modified by aramisgithub)`,variant:`dark`,palette:{base00:`#002b36`,base01:`#073642`,base02:`#586e75`,base03:`#657b83`,base04:`#839496`,base05:`#93a1a1`,base06:`#eee8d5`,base07:`#fdf6e3`,base08:`#dc322f`,base09:`#cb4b16`,base0A:`#b58900`,base0B:`#859900`,base0C:`#2aa198`,base0D:`#2995e1`,base0E:`#6c71c4`,base0F:`#d33682`}};function nm(e,t,n){return{id:e,label:t,kind:n.variant,scheme:n,toTokens:()=>sne(n)}}function rm(e,t){return{id:e,label:t,kind:`system`}}const im=[rm(`default`,`Default`),nm(`dracula`,`Dracula`,Zp),nm(`catppuccin-frappe`,`Catppuccin Frappé`,Qp),nm(`catppuccin-latte`,`Catppuccin Latte`,$p),nm(`monokai`,`Monokai`,mne),nm(`gruvbox`,`Gruvbox`,em),nm(`solarized`,`Solarized`,tm),rm(`custom`,`Custom`)],am=im.map(e=>e.id),om=/^[a-z0-9-]{1,32}$/,sm=/\p{M}+/gu,cm=/['\u2019\u02bc]+/gu,lm=/[^a-z0-9]+/g;function um(e){let t=2166136261;for(let n of e)t^=n.codePointAt(0)??0,t=Math.imul(t,16777619);return(t>>>0).toString(16).padStart(8,`0`)}function hne(e){let t=e.trim();if(t.length===0)return{ok:!1,code:`empty`};let n=t.normalize(`NFKD`).replace(sm,``).toLowerCase().replace(cm,``).replace(lm,`-`).replace(/^-+|-+$/g,``),r=um(t),i=n.length===0?`theme-${r}`:n.length<=26?n:`${n.slice(0,26-r.length-1).replace(/-+$/g,``)}-${r}`,a=dm(i);if(!a.ok)throw Error(`Saved theme name derivation produced an invalid id`);return{ok:!0,name:t,stem:i,id:a.id}}function dm(e){if(e.length===0)return{ok:!1,code:`empty`};let t=`saved-`+e;return om.test(t)?{ok:!0,id:t}:{ok:!1,code:/^[a-z0-9-]+$/.test(t)?`too-long`:`invalid-chars`}}function gne(e){if(!om.test(e)||!e.startsWith(`saved-`))return{ok:!1};let t=e.slice(6);return t.length===0?{ok:!1}:{ok:!0,stem:t}}new Map(im.map(e=>[e.id,e]));function fm(e,t){for(let n=1;n<t.length;n++){let r=t.slice(0,n);if(!e.hasIn(r))continue;let i=e.getIn(r,!0);(0,su.isCollection)(i)||e.deleteIn(r)}}function pm(e,t){let n=[];function r(t,i){if(t!==void 0){if(t===null){e.deleteIn(i),n.push(i.join(`.`));return}if(Array.isArray(t)){fm(e,i),e.setIn(i,t),n.push(i.join(`.`));return}if(typeof t==`object`){for(let[e,n]of Object.entries(t))r(n,[...i,e]);return}fm(e,i),e.setIn(i,t),n.push(i.join(`.`))}}for(let[e,n]of Object.entries(t))r(n,[e]);return n}function mm(e){return{path:e.path.map(e=>typeof e==`symbol`?String(e):e),message:e.message,issueCode:e.code}}const hm={provider:I(l).register(z,{scope:`user`,agentSettable:!1,reload:`boot`,defaultScope:`user`,description:"Declares that this git host is a GitHub Enterprise Server instance, so OpenKnowledge treats its remotes the way it treats github.com (OpenKnowledge credential handling, the push-permission check, share links, and the default host for `ok auth`). 'github' is the only accepted value today. A host that is not declared here and is not github.com is treated as a generic git remote, so OpenKnowledge leaves the machine's own git credentials alone and does not check push permission. Per-machine (user scope, global.yml in the OpenKnowledge home folder); a value in a project's `.ok/config.yml` is ignored. The declaration takes effect when OpenKnowledge next starts."})},gm=Object.fromEntries(Object.entries(hm).map(([e,t])=>[e,t.optional().catch(void 0)])),_m=Object.fromEntries(Object.entries(hm).map(([e,t])=>[e,t.nullish()])),vm=yo(gm).catch({}),ym=ko(j(),yo(hm).partial()),bm=yo({git:yo({hosts:ko(j(),yo(_m).nullish()).nullish()}).nullish()});function xm(e){let t=bm.safeParse(e);return t.success?null:{code:`SCHEMA_INVALID`,issues:t.error.issues.map(mm)}}const Sm=F({prefix:j().regex(/^[A-Za-z][A-Za-z0-9_-]*$/,{message:`prefix must start with a letter and use only letters, digits, _ and -`}),url:j().regex(/^https?:\/\/[^\s<>]*<num>[^\s<>]*$/,{message:`url must be an http or https URL containing <num>`})}),Cm=P(Sm),wm=Sm.nullable().catch(null);function Tm(){return Object.fromEntries(Lp.map(e=>[e,j().register(z,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Custom theme: base16 ${e} — ${ane[e]}, as a #rrggbb hex string.`}).optional()]))}function Em(){return am.filter(e=>e!=="default"&&e!==`custom`).map(e=>`'${e}'`).join(`, `)}const Dm=Object.freeze([`authorization`,`auth.token`,`auth.bearer`,`cookie`,`set-cookie`,`x-api-key`,`password`,`secret`]),Om=52428800,km=26214400,Am=12582912,jm=`https://api.openai.com/v1`,Mm=`text-embedding-3-small`,Nm=96e3,Pm=3e4,Fm=2048,Im=16384e3,Lm=6e5,Rm=Object.freeze([`127.0.0.1`]),zm=/^[1-9]\d*(s|m|h)$/,Bm=/^https?:\/\//;function Vm(e){let t;try{t=new URL(e)}catch{return!1}let n=t.hostname.toLowerCase();return n===`localhost`||n===`127.0.0.1`||n===`[::1]`}function Hm(e){let t;try{t=new URL(e)}catch{return`invalid-url`}return t.protocol===`https:`||t.protocol===`http:`&&Vm(e)?null:`insecure-scheme`}function Um(e){let t=e.trim();return t===``?wp:t}const Wm=[`filename`],Gm=/\{\{([^{}\n]+?)\}\}/g;function Km(e){return Wm.includes(e)}function qm(e){let t=[],n=0;for(let r of e.matchAll(Gm)){let i=r.index;i>n&&t.push({kind:`text`,text:e.slice(n,i),start:n});let a=(r[1]??``).trim();t.push(Km(a)?{kind:`variable`,text:r[0],start:i,name:a}:{kind:`unknown-variable`,text:r[0],start:i,name:a}),n=i+r[0].length}return n<e.length&&t.push({kind:`text`,text:e.slice(n),start:n}),t}function Jm(e){return e.filter(e=>e.kind===`variable`).length}function Ym(e){let t=qm(e),n=t.flatMap(e=>e.kind===`unknown-variable`?[e.text]:[]);return n.length>0?{kind:`unknown-variable`,variables:n}:t.some(e=>e.kind===`text`&&(e.text.includes(`{{`)||e.text.includes(`}}`)))?{kind:`unclosed-braces`}:e.split(`/`).some(e=>Jm(qm(e))>1)?{kind:`repeated-variable`}:null}function Xm(e){let t=Wm.map(e=>`{{${e}}}`).join(`, `);switch(e.kind){case`unknown-variable`:return`content.attachmentFolderPath uses the unknown variable ${e.variables.join(`, `)}. Supported variables: ${t}.`;case`unclosed-braces`:return`content.attachmentFolderPath has a "{{" or "}}" without its pair.`;case`repeated-variable`:return`content.attachmentFolderPath uses a variable more than once in one folder name.`}}function Zm(e,t){return qm(e).map(e=>e.kind===`variable`?t[e.name]:e.text).join(``)}function _ne(e){let t=e.toLowerCase(),n=hp.find(e=>t.endsWith(e));return n?e.slice(0,-n.length):``}function vne(e,t){let n=t.lastIndexOf(`/`),r=n===-1?``:t.slice(0,n),i=_ne(t.slice(n+1)),a=Um(e),o=Zm(i===``&&Jm(qm(a))>0?`./`:a,{filename:i}),s=o.startsWith(`./`),c=s?o.slice(2):o;return[...s?[r]:[],...c.split(`/`)].filter(e=>e!==``&&e!==`.`).join(`/`)}function yne(e){let t=qm(e);if(Jm(t)!==1)return t=>t===e;let n=t.findIndex(e=>e.kind===`variable`),r=e=>e.map(e=>e.text).join(``),i=r(t.slice(0,n)),a=r(t.slice(n+1));return e=>e.length>i.length+a.length&&e.startsWith(i)&&e.endsWith(a)}function Qm(e){let t=Um(e);if(t.includes(`\0`)||t.includes(`\\`))return!1;let n=t.split(`/`),r=n.find(e=>e!==``&&e!==`.`);return!(r!==void 0&&/^[A-Za-z]:/.test(r)||n.some(e=>e===`..`))}const bne=/[<>:"\\|?*]/;function $m(e){return{params:e}}function xne(e){return qm(e).some(e=>e.kind===`text`&&/[{}]/.test(e.text))}j().refine(e=>e.trim()!==``,$m({kind:`empty`})).refine(e=>!bne.test(e),$m({kind:`reserved-character`})).refine(Qm,$m({kind:`outside-project`})).refine(e=>e===e.trim(),$m({kind:`surrounding-space`})).refine(e=>e.startsWith(`./`)||e.startsWith(`/`),$m({kind:`missing-prefix`})).refine(e=>!e.includes(`//`),$m({kind:`empty-folder-name`})).refine(e=>e===`./`||e===`/`||!e.endsWith(`/`),$m({kind:`trailing-slash`})).superRefine((e,t)=>{let n=Ym(e);n&&t.addIssue({code:`custom`,params:n})}).refine(e=>!xne(e),$m({kind:`single-brace`}));const eh=yo({content:yo({dir:j().register(z,{scope:`project`,agentSettable:!1,reload:`boot`,defaultScope:`project`,description:`Folder OpenKnowledge reads and writes documents under, relative to the project root (the folder that contains .ok/). Defaults to the project root. Exclude paths with .okignore. Read at server start; changing it requires a restart.`}).default(`.`),attachmentFolderPath:j().register(z,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Where pasted and dropped assets, and MCP write assets given a bare file name, are stored. The path must start with './' (relative to the current document) or '/' (relative to the content root): './' colocates beside the current document; './subdir' targets a subfolder next to it; '/' targets the content root; '/folder' targets a fixed folder under the content root. '{{filename}}' expands to the current document's name without its extension, so the default './{{filename}}.assets' keeps each document's files in its own folder. An upload whose parent is not a Markdown document, such as an MCP write asset given a bare file name, ignores {{filename}} and is placed as with './', which for a bare file name is the content root. A bare name such as 'attachments', saved by older versions, is read as '/attachments'. A path with an unknown variable refuses uploads until it is fixed. Whitespace-only values are treated as the default.`}).refine(Qm,{message:`Invalid attachment folder path: must not contain '..' segments, NUL bytes, backslashes, or drive letters.`}).default(wp)}).default({dir:`.`,attachmentFolderPath:wp}),appearance:yo({theme:I([`light`,`dark`,`system`]).register(z,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Editor color theme: 'light', 'dark', or 'system' (follow the OS). A personal preference (user scope) — not shared with the project.`}).optional(),language:I([`system`,...Fp]).register(z,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Interface language. 'system' follows the operating system. A personal preference (user scope) — not shared with the project, and never applied to document content.`}).optional(),colorThemeLight:j().register(z,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`IDE color palette applied in light mode: 'default' (no palette), 'custom' (your own colors from appearance.customTheme), one of ${Em()}, or the id of a saved theme. A short id of lowercase letters, digits, and hyphens (max 32 characters); an id no palette matches falls back to 'default' for this mode only, leaving the rest of your config untouched. A personal preference (user scope) — not shared with the project.`}).regex(om,{message:`Theme id must be lowercase letters, digits, and hyphens, 1–32 characters (e.g. 'dracula', 'custom', or a saved theme id).`}).optional(),colorThemeDark:j().register(z,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`IDE color palette applied in dark mode: 'default' (no palette), 'custom' (your own colors from appearance.customTheme), one of ${Em()}, or the id of a saved theme. A short id of lowercase letters, digits, and hyphens (max 32 characters); an id no palette matches falls back to 'default' for this mode only, leaving the rest of your config untouched. A personal preference (user scope) — not shared with the project.`}).regex(om,{message:`Theme id must be lowercase letters, digits, and hyphens, 1–32 characters (e.g. 'dracula', 'custom', or a saved theme id).`}).optional(),colorTheme:j().register(z,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Superseded by appearance.colorThemeLight / appearance.colorThemeDark. Read as the palette for both modes while neither of those is set. A short theme id (lowercase letters, digits, and hyphens; max 32 characters); an id no palette matches falls back to 'default'. A personal preference (user scope) — not shared with the project.`}).regex(om,{message:`Theme id must be lowercase letters, digits, and hyphens, 1–32 characters (e.g. 'dracula', 'custom', or a saved theme id).`}).optional(),colorThemeEnabled:N().register(z,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Whether the Themes plugin appears in Settings → Plugins. A personal preference (user scope). Default on.`}).optional(),customTheme:yo({name:j().register(z,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Custom theme: the scheme's display name.`}).optional(),author:j().register(z,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Custom theme: the scheme's author credit, carried through from an imported base16 scheme.`}).optional(),variant:I([`dark`,`light`]).register(z,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Custom theme: whether the scheme is 'dark' or 'light'. Auto-detected from the palette when omitted.`}).optional(),...Tm()}).optional(),preview:yo({autoOpen:N().register(z,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`When on, the agent opens or refreshes the live preview after each edit. Turn off if you manage your own preview window. A personal preference (user scope).`}).default(!0)}).default({autoOpen:!0}),sidebar:yo({showHiddenFiles:N().register(z,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Show dot-prefixed entries (e.g. .ok/, .okignore) in the file tree. Per-machine (project-local) — not shared with collaborators.`}).default(!1),showOnlyMarkdownFiles:N().register(z,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Show only markdown documents (.md/.mdx) and folders in the file tree, hiding other file types from view. View-only: hidden files stay on disk and remain reachable via links and search. Per-machine (project-local) — not shared with collaborators.`}).default(!1),showSkillsSection:N().register(z,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Show the Skills section in the sidebar. Skill documents remain reachable via links and search while the section is hidden. Per-machine (project-local) — not shared with collaborators.`}).default(!0),showOkFolders:N().register(z,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Show .ok folders (skills, templates, and other OpenKnowledge-managed state) in the file tree as read-only entries. .ok/worktrees and .ok/local never appear. Per-machine (project-local) — not shared with collaborators.`}).default(!1),showSkillGroups:N().register(z,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Group skills in the sidebar by where they came from — the publisher they were imported from, or the plugin that ships them. Skills you authored stay ungrouped at the top of their scope. Per-machine (project-local) — not shared with collaborators.`}).default(!0),pinnedProjectSkills:P(j()).register(z,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Project-scope skills pinned to the top of the Skills sidebar, by name. A pinned skill also keeps its normal row, so a provenance group still lists everything from its source. Per-machine (project-local) — not shared with collaborators.`}).default([]),pinnedGlobalSkills:P(j()).register(z,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Global-scope skills pinned to the top of the Skills sidebar, by name. Stored per USER rather than per project, so a pinned global skill follows you into every project.`}).default([])}).optional()}).default({preview:{autoOpen:!0}}),editor:yo({wordWrap:N().register(z,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Soft-wrap long lines in the source (CodeMirror) editor. A personal preference (user scope).`}).default(!0),previewTabs:N().register(z,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Reuse one tab when clicking through the Files and Skills sidebars, the way an editor preview tab works. Turn off to open every click in its own tab. Pinned tabs keep their own tab either way. A personal preference (user scope).`}).default(!0)}).default({wordWrap:!0,previewTabs:!0}),agents:yo({autoApproveOkTools:N().register(z,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:"Auto-approve OpenKnowledge's own tools for agents launched from the built-in terminal (plus `ok open` on Claude) and for in-app Agents-panel chats with any ACP agent. Destructive tools (delete/move/share/install/import) still prompt. Per-machine personal preference (user scope)."}).default(!0),browserTools:N().register(z,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Give in-app Claude Code and Codex chats a browser they can drive (Playwright MCP, started through npx from OpenKnowledge's own folder with a fresh in-memory profile), so an agent can open pages, click, and take screenshots. Every browser action asks for approval, with no option to always allow it, unless the agent's own mode or permission settings skip approvals. Needs Google Chrome and Node.js. Off by default; takes effect for chats started after the change. Per-machine personal preference (user scope).`}).default(!1)}).default({autoApproveOkTools:!0,browserTools:!1}),autoSync:yo({mode:I(lp).register(z,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`What this machine syncs on a schedule for this project: 'off' (Manual — nothing scheduled; the manual pull/push actions still work), 'follow' (Auto, pull only — scheduled pulls, never a scheduled push; 'pull' is accepted as a legacy alias), or 'full' (Auto, pull and push — bidirectional). Explicit user-triggered pushes work in every mode. null = not chosen yet (onboarding asks). Per-machine (project-local) — not shared. Supersedes the legacy autoSync.enabled boolean.`}).nullable().default(null),enabled:N().register(z,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Legacy per-machine sync toggle, superseded by autoSync.mode. Read only when mode is absent (true = full, false = off). null = not chosen yet. Per-machine (project-local) — not shared.`}).nullable().default(null),resumeMode:I(Tte).register(z,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`When sync is paused (autoSync.mode 'off') after having been enabled, the active mode to resume into ('follow' | 'full'). Per-machine UI memory; ignored while a mode is active. Not shared.`}).optional(),pullIntervalSeconds:M().int().min(30).max(dp).register(z,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Seconds between scheduled pulls while autoSync.mode is follow or full (default 30). Per-machine (project-local) — not shared.`}).optional().catch(void 0),pushIntervalSeconds:M().int().min(30).max(dp).register(z,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Seconds between scheduled pushes while autoSync.mode is full (default 60). Ignored in every other mode, which never pushes on a schedule. Each cycle with pending edits authors a commit, so a shorter interval means more, smaller commits in the repo's shared history. Per-machine (project-local) — not shared.`}).optional().catch(void 0),default:xo([N(),I(lp)]).register(z,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Committed project default for a machine's sync mode on first open: 'off' | 'follow' | 'full', or the legacy boolean (true = full, false = off). null = ask (show the onboarding prompt). Shared via git. A per-machine autoSync.mode choice overrides it.`}).nullable().default(null)}).default({mode:null,enabled:null,default:null}),git:yo({hosts:ko(j(),vm).register(z,{scope:`user`,agentSettable:!1,reload:`boot`,defaultScope:`user`,description:"Per-git-host declarations, keyed by hostname (for example ghes.example.com). Each entry says how OpenKnowledge should treat remotes on that host; today the only key an entry carries is `provider`. Hosts absent from this map are treated as generic git remotes. Per-machine (user scope, global.yml in the OpenKnowledge home folder); a value in a project's `.ok/config.yml` is ignored. Declarations take effect when OpenKnowledge next starts."}).default({}).catch({})}).default({hosts:{}}),terminal:yo({enabled:N().register(z,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Opt-out for the in-app terminal (a real OS shell at full user privilege). The terminal is on by default; set false to disable it for this project on this machine. Per-machine (project-local) — never shared via git, clone, or sync.`}).nullable().default(null),shell:j().register(z,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Absolute Windows shell executable override for the in-app terminal. PowerShell, cmd.exe, and Git Bash support OpenKnowledge-managed launches (agent chat tabs and fixed commands such as Resolve in terminal or Install Slidev) and dropped-file path insertion. A different existing executable remains usable for plain terminal tabs and shows a capability notice; requested agent and command launches open only the plain shell without running the agent or command, and dropped-file paths are refused. Empty values use automatic shell discovery. Per-machine (project-local), human-managed, and never shared via git, clone, or sync.`}).optional()}).default({enabled:null}),slides:yo({enabled:N().register(z,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:"Whether the Slides plugin appears in Settings → Plugins. When on, a document whose frontmatter has `slides: true` offers an action that opens the deck in a dedicated window (desktop only, requires a resolvable slidev). A personal preference (user scope). Default off."}).default(!1)}).default({enabled:!1}),telemetry:yo({localSink:yo({enabled:N().register(z,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:"Write per-project diagnostic spans + logs under the user-level OpenKnowledge logs directory for `ok diagnose bundle`. Files stay local unless shared, including in a support bundle. Set false for sensitive workspaces. Shared across collaborators."}).default(!0),spans:yo({maxBytes:M().register(z,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Maximum size, in bytes, of the local diagnostic spans file before it rotates (default ~50 MB).`}).default(Om)}).default({maxBytes:Om}),logs:yo({maxBytes:M().register(z,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Maximum size, in bytes, of the local diagnostic logs file before it rotates (default ~25 MB).`}).default(km)}).default({maxBytes:km}),attributeDenylist:P(j()).register(z,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Telemetry attribute keys whose values are redacted before any local span/log is written (credential / secret guard). Extends the built-in denylist.`}).default([...Dm])}).default({enabled:!0,spans:{maxBytes:Om},logs:{maxBytes:km},attributeDenylist:[...Dm]}),skillInstallReports:yo({enabled:N().register(z,{scope:`user`,agentSettable:!1,reload:`live`,defaultScope:`user`,description:`Report skill installs to skills.sh so a published skill shows an accurate install count. Sends the skill name, its source repo, and which agent tools it was installed for — never file contents, and never for a private or local source. One report per skill per machine. Default off; when it is on, the DO_NOT_TRACK and DISABLE_TELEMETRY environment variables still turn it off.`}).default(!1)}).default({enabled:!1})}).default({localSink:{enabled:!0,spans:{maxBytes:Om},logs:{maxBytes:km},attributeDenylist:[...Dm]},skillInstallReports:{enabled:!1}}),lossCapture:yo({enabled:N().register(z,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:"Record bridge loss-class events (content-free) under .ok/local/loss-capture/ for `ok diagnose bundle`. Local-only — never leaves the machine until you run bundle. Set false for sensitive workspaces. Shared across collaborators."}).default(!0),maxBytes:M().register(z,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Maximum size, in bytes, of the local loss-capture file before it rotates (default ~12 MB).`}).default(Am)}).default({enabled:!0,maxBytes:Am}),bridge:yo({backgroundThrottle:yo({enabled:N().register(z,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Keep the desktop window's timers running at full rate while it holds unsynced work, so backgrounding the app never starves sync or recovery; when the window is idle the OS-default background throttling is restored (battery). Honored by the desktop app. Default ON — disable only to isolate a suspected regression.`}).default(!0)}).default({enabled:!0}),deferGuard:yo({enabled:N().register(z,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Defer a drain-shaped Observer B re-derive when the WYSIWYG fragment holds an un-propagated keystroke Y.Text lacks, so the keystroke survives instead of being stomped. Default ON — disable only to isolate a suspected regression.`}).default(!0)}).default({enabled:!0}),lossDetector:yo({enabled:N().register(z,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Detect content the bridge silently dropped at its reconciliation boundary (an Observer-A apply arm or a paired agent-undo derive) and write a recovery checkpoint plus a content-free loss event. Detection only — never blocks a write. Default ON — disable only to isolate a suspected regression.`}).default(!0)}).default({enabled:!0}),fixedPoint:yo({enabled:N().register(z,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Bound the Y.Text→WYSIWYG re-derive loop with a drain-count backstop: a run of re-derive drains that never reaches a raw-byte fixed point freezes the re-derive loop and writes a recovery checkpoint plus a content-free loss event, instead of churning unbounded. Default ON — disable only to isolate a suspected regression.`}).default(!0)}).default({enabled:!0}),preDrain:yo({enabled:N().register(z,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Before an agent write or undo rebuilds the WYSIWYG fragment, flush an un-propagated keystroke that provably does not overlap the operation into Y.Text so the keystroke survives instead of needing recovery; overlapping or unmodellable cases fall back to the checkpoint floor. Scope: appending writes and single-frame undos — a write that replaces the whole body (replace / edit) overwrites the keystroke either way, so those always take the checkpoint floor. Default ON — disable only to isolate a suspected regression.`}).default(!0)}).default({enabled:!0}),flushOnHide:yo({enabled:N().register(z,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`On tab hide/unload, force-send each doc's unsynced work to the server and commit its local cache, and re-sync on return to foreground, so a backgrounded tab never strands edits that IndexedDB alone would lose on recycle. Honored client-side. Default ON — disable only to isolate a suspected regression.`}).default(!0)}).default({enabled:!0})}).default({backgroundThrottle:{enabled:!0},deferGuard:{enabled:!0},lossDetector:{enabled:!0},fixedPoint:{enabled:!0},preDrain:{enabled:!0},flushOnHide:{enabled:!0}}),search:yo({semantic:yo({enabled:N().register(z,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:"Add semantic (embeddings) ranking to the MCP search tool, fused with the lexical engine so conceptually-related pages surface even with no shared keywords. When ON and an API key is set (`ok embeddings set-key`), the search query and matching document content are sent to the configured embeddings provider — content egress. Default OFF. Per-machine (project-local) — not shared with collaborators."}).default(!1),baseUrl:j().register(z,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:"Base URL of the OpenAI-compatible embeddings API (default https://api.openai.com/v1). Override to point at a self-hosted server (Ollama / vLLM / LM Studio) or another provider. The API key is NOT stored here — set it with `ok embeddings set-key` (stored in secrets.yml in the OpenKnowledge home folder); it is sent to whichever endpoint this names."}).default(jm),model:j().register(z,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Embeddings model id (default text-embedding-3-small). Must be served by the provider at baseUrl. Changing it re-embeds the corpus (the cache is keyed by provider + model + dimensions).`}).default(Mm),dimensions:M().int().positive().register(z,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Optional output vector dimensions. Omit (recommended) to detect the model's native size from its first response — that is what lets a non-OpenAI model work without knowing its size up front. Set a smaller value (text-embedding-3 supports e.g. 512 / 1024) to shrink the on-disk cache, trading a little retrieval quality; a server that ignores the request param then fails loudly instead of silently. Changing it re-embeds the corpus.`}).optional(),similarityFloor:M().min(0).max(1).register(z,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Optional hard cutoff: drop any "by meaning" match whose cosine similarity is below this value. Off by default (0) because retrieval is rank-based (the closest pages are returned regardless of absolute score) and the right cutoff is model-specific. Set it only to suppress weak matches for a specific provider/model whose cosine scale you know. Most setups should leave it unset and rely on the result-count cap.`}).optional(),maxBatchSize:M().int().min(1).max(Fm).register(z,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Maximum number of text chunks sent in one indexing request (1–2048, default 96). The ceiling follows OpenAI's input-array limit; other providers may impose different limits. Larger requests may still be split by the character budget. Changing it preserves cached vectors and document chunking; it applies to the next indexing pass. Invalid values use the default and are reported by ok config validate and server logs.`}).default(96).catch(96),maxBatchChars:M().int().min(1).max(Im).register(z,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Approximate cumulative character budget per indexing request (1–16384000, default 96000). A single chunk can exceed this budget. OpenAI separately caps total input at 300000 tokens per request; this character budget does not enforce that limit, and high values can produce rejected requests. Other providers have their own limits. Changing it preserves cached vectors and document chunking; it applies to the next indexing pass. Invalid values use the default and are reported by ok config validate and server logs.`}).default(Nm).catch(Nm),docTimeoutMs:M().int().min(1).max(Lm).register(z,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Timeout in milliseconds for each indexing request attempt (1–600000, default 30000). A request can retry four times, and a failed grouped request can trigger individual-document requests. There is no total indexing-pass deadline: large timeouts can delay newly queued work for hours. The query timeout remains 8 seconds per attempt. Changing it preserves cached vectors and applies to the next indexing pass; an in-progress pass keeps its current timeout. Invalid values use the default and are reported by ok config validate and server logs.`}).default(Pm).catch(Pm)}).default({enabled:!1,baseUrl:jm,model:Mm,maxBatchSize:96,maxBatchChars:Nm,docTimeoutMs:Pm})}).default({semantic:{enabled:!1,baseUrl:jm,model:Mm,maxBatchSize:96,maxBatchChars:Nm,docTimeoutMs:Pm}}),contentRules:yo({markdownlint:F({enabled:N().register(z,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Whether the markdownlint plugin (body rules) contributes diagnostics.`}).default(!1)}).default({enabled:!1}),frontmatter:F({enabled:N().register(z,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Whether the frontmatter plugin (JSON-Schema validation of document frontmatter) contributes diagnostics.`}).default(!1),schemas:P(F({appliesTo:xo([j(),P(j())]).optional(),file:j(),enabled:N().optional()})).register(z,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Frontmatter schema mappings: which docs (appliesTo globs) validate against which JSON Schema file (project-root-relative path).`}).default([])}).default({enabled:!1,schemas:[]}),okf:F({enabled:N().register(z,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Whether the OKF plugin (Open Knowledge Format portability + conformance rules) contributes diagnostics. Advisory warnings; never blocks a write.`}).default(!1),rules:ko(j(),N()).register(z,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Per-rule opt-outs for the OKF plugin, keyed by rule id (e.g. no-wiki-links). Omit a rule to leave it enabled; set false to silence it while keeping the plugin on.`}).optional(),generate:F({index:N().register(z,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Whether OK generates and maintains a navigation index.md in every folder that contains Markdown, each listing the documents in that folder grouped by frontmatter type and linking to its subfolders. OK owns these files: edits to them are replaced on the next rebuild.`}).default(!1)}).default({index:!1})}).default({enabled:!1,generate:{index:!1}})}).default({markdownlint:{enabled:!1},frontmatter:{enabled:!1,schemas:[]},okf:{enabled:!1,generate:{index:!1}}}),validation:yo({links:I(rne).register(z,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`How broken internal links are reported on the validation plane: 'off' hides them, 'warning' (default) or 'error' sets their severity.`}).default(Ip),fileTreeIndicators:N().register(z,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Whether the file tree tints and badges files that have validation problems.`}).default(!0),suppressLogLinkAdvisories:N().register(z,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:`Whether unresolved links in the reserved change-history documents (lowercase-stemmed log.md / log.mdx at any depth, where the extension's case does not matter and the stem's does) are omitted from broken-link advisories: the Problems panel, file-tree indicators, source diagnostics, audits, and agent write/edit results. Default true. Raw link views still show them, and LOG.md, Log.md, and every other stem spelling are ordinary documents.`}).default(!0)}).default({links:Ip,fileTreeIndicators:!0,suppressLogLinkAdvisories:!0}),autolinks:P(wm).register(z,{scope:`project`,agentSettable:!1,reload:`live`,defaultScope:`project`,description:"Turn ticket references into links; today they apply to Agents-panel chat messages. Each entry pairs a `prefix` (for example `PRD-`) with a `url` template containing `<num>` (for example `https://linear.app/inkeep/issue/PRD-<num>`); the prefix followed by digits links to that URL with the digits in place of `<num>`. Matching is case-sensitive. An invalid entry is skipped with a warning and the others still apply. Shared with collaborators (project scope, `.ok/config.yml`)."}).default([]).catch([]),linkPreviews:yo({enabled:N().register(z,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Show a rich preview card (site name, page title, description, favicon) when you hover an external link in the editor, and a status card when you hover a GitHub pull request or issue link in an agent chat. When ON, hovering an external link sends that link's URL to the destination site to fetch its preview metadata, and hovering a GitHub reference asks the GitHub host's API for it, signed in as you when a GitHub sign-in is available — outbound egress, one request per previewed link. Default ON; set to false to turn external previews off. Per-machine (project-local) — not shared with collaborators. Previews of links to other documents in this project are read from the local index with no network request and are always on.`}).default(!0)}).default({enabled:!0}),server:yo({port:M().int().min(1).max(65535).register(z,{scope:`project`,agentSettable:!1,reload:`boot`,defaultScope:`project`,description:`TCP port the server listens on. Unset by default: a local start picks a free port dynamically, and deployment platforms inject the PORT environment variable instead. Read at server start; changing it requires a restart.`}).optional(),bind:P(j().min(1)).min(1).register(z,{scope:`project-local`,agentSettable:!1,reload:`boot`,defaultScope:`project-local`,description:`Addresses the server binds, e.g. [127.0.0.1] or [0.0.0.0]. Default loopback-only ([127.0.0.1]): nothing off this machine can connect. A non-loopback bind additionally requires the server.allowExternal consent interlock. Per-machine (project-local): a value committed to .ok/config.yml is ignored, so one machine exposing the server can never break local clones for the rest of the team — the exposing host sets it via OK_BIND, --bind, or .ok/local/config.yml. Lists replace, never merge. Read at server start; changing it requires a restart.`}).default([...Rm]),externalUrl:ro({protocol:/^https?$/}).regex(Bm).register(z,{scope:`project`,agentSettable:!1,reload:`boot`,defaultScope:`project`,description:`Canonical external origin the server is reached at, e.g. https://kb.example.com — its host joins the Host/Origin allowlists (external-Host + CORS admission). Unset by default: the server admits only loopback Hosts. Setting it declares external exposure, which additionally requires the server.allowExternal consent interlock. Read at server start; changing it requires a restart.`}).optional(),allowExternal:N().register(z,{scope:`project-local`,agentSettable:!1,reload:`boot`,defaultScope:`project-local`,description:`Exposure consent interlock. A non-loopback server.bind without allowExternal: true is refused at boot with a one-line fix; a server.externalUrl without it boots (a committed externalUrl never arms exposure on clones — but it is project-scoped, so its host still joins the Host/Origin allowlists there), but requests carrying forwarding headers (X-Forwarded-For etc.) are refused until consent is given — proxy tolerance requires both keys. Default off. The server has no authentication of its own, so only consent behind an authenticating edge. Per-machine (project-local) — consent never travels via git, clone, or share; containers consent via the environment instead.`}).default(!1),openBrowser:N().register(z,{scope:`project-local`,agentSettable:!1,reload:`boot`,defaultScope:`project-local`,description:`Open the UI in a browser when the server starts. Default derived: true when every bind address is loopback (a laptop start pops the UI), false otherwise (a container or exposed bind is headless and must never try). Acts once at start. Per-machine (project-local) — not shared.`}).optional(),idleShutdown:xo([L(`off`),j().regex(zm)]).register(z,{scope:`project-local`,agentSettable:!1,reload:`live`,defaultScope:`project-local`,description:`Shut the server down after this long with no activity: a duration like '30m' (positive integer with unit s, m, or h), or 'off'. Default derived: '30m' for a loopback-only, unexposed server; 'off' otherwise — a non-loopback bind, or a loopback bind declared externally reachable (server.allowExternal + server.externalUrl), stays up, because a remote agent keeps it busy over /mcp, which the idle timer does not count. Residual case the derivation cannot see: a loopback server reached by remote agents with no server.externalUrl (e.g. behind a same-box reverse proxy) still idles at 30m — set 'off' by hand. Reloadable — a valid change applies without a restart. Per-machine (project-local) — not shared.`}).optional()}).default({bind:[...Rm],allowExternal:!1})});function Sne(e){let t=e;for(let e=0;e<16;e++){if(t==null||t?._zod?.def?.shape!==void 0)return t;let e=t?._zod?.def?.innerType;if(e===void 0)return t;t=e}return t}function th(e,t){let n=e;for(let e of t){n=Sne(n);let t=n?._zod?.def?.shape;if(!t){let e=n?._zod?.def;if(e?.type!==`record`)return;n=e.valueType;continue}if(n=t[String(e)],n===void 0)return}return n}function nh(e,t){let n=th(e,t);if(n!==void 0)return jte(n)}h();const rh=`open-knowledge-config`;async function ih(e,t,n){let r=m.getTracer(rh),i=t?{attributes:t}:{};return r.startActiveSpan(e,i,async e=>{try{return await n(e)}catch(t){throw e.recordException(t),e.setStatus({code:g.ERROR,message:t instanceof Error?t.message:String(t)}),t}finally{e.end()}})}function ah(e,t,n){let r=m.getTracer(rh),i=t?{attributes:t}:{};return r.startActiveSpan(e,i,e=>{try{return n(e)}catch(t){throw e.recordException(t),e.setStatus({code:g.ERROR,message:t instanceof Error?t.message:String(t)}),t}finally{e.end()}})}function oh(e,t){let n=m.getActiveSpan();n&&n.addEvent(e,t)}function sh(e,t){return e===`either`||e===t}function ch(e,t){let n=null;function r(e,i){if(n!==null||e===void 0)return;let a=nh(eh,i);if(a?.scope!==void 0&&!sh(a.scope,t)){n={code:`SCOPE_VIOLATION`,path:i,expectedScope:a.scope,actualScope:t};return}if(typeof e==`object`&&e&&!Array.isArray(e)){for(let[t,a]of Object.entries(e))if(r(a,[...i,t]),n!==null)return;return}}for(let[t,i]of Object.entries(e))if(r(i,[t]),n!==null)break;return n}function lh(e,t){if(t.length===0)return e.contents??null;let n=e.getIn(t,!0);if((0,su.isNode)(n))return n;for(let n=t.length-1;n>=0;n--){let r=e.getIn(t.slice(0,n),!0);if((0,su.isNode)(r))return r}return e.contents??null}function uh(e,t){let n=1,r=1,i=Math.min(t,e.length);for(let t=0;t<i;t++)e.charCodeAt(t)===10?(n++,r=1):r++;return{line:n,column:r}}function dh(e,t,n,r,i){let a=e.split(`
|
|
141
|
+
`),o=r-1;if(o<0||o>=a.length)return``;let s=a[o]??``,c=t-(i-1)+s.length,l=Math.max(1,Math.min(n,c)-t),u=[],d=String(o+2).length;for(let e=Math.max(0,o-1);e<=Math.min(a.length-1,o+1);e++){let t=e===o,n=t?`>`:` `,r=String(e+1).padStart(d,` `);if(u.push(`${n} ${r} | ${a[e]??``}`),t){let e=` `.repeat(2+d+3+i-1);u.push(`${e}${`^`.repeat(l)}`)}}return u.join(`
|
|
142
|
+
`)}function fh(e){let t=lh(e.doc,e.path);if(!t)return;let n=t.range;if(!n)return;let[r,,i=r]=n,{line:a,column:o}=uh(e.source,r),s=(0,su.isCollection)(t)?dh(e.source,r,r+1,a,o):dh(e.source,r,i,a,o);return{file:e.file,line:a,column:o,snippet:s.length>0?s:void 0}}const ph=()=>`Run \`${a()} config migrate\` to strip the obsolete key automatically, or remove it by hand.`,mh=[{path:[`content`,`include`],get redirect(){return[`content.include has been removed.`,`For subdirectory scoping, set content.dir in .ok/config.yml instead.`,`For pattern-based filtering, use .okignore (gitignore syntax — exclude-only; do not copy include patterns directly).`,ph()].join(` `)}},{path:[`content`,`exclude`],get redirect(){return[`Move these patterns to .okignore at the project root (gitignore syntax, 1:1 migration).`,ph()].join(` `)}},{path:[`folders`],get redirect(){return[`folders is no longer a top-level config field.`,"A folder's own frontmatter (open-shape, like a doc's) lives in nested `<folder>/.ok/frontmatter.yml`; new-doc starting properties come from templates in `<folder>/.ok/templates/`.","Edit via the folder overview in the editor sidebar, or `edit({ folder: { path, frontmatter } })` via the MCP.",ph()].join(` `)}},{path:[`appearance`,`editorModeDefault`],get redirect(){return[`appearance.editorModeDefault was removed and is never read — new docs always open in WYSIWYG; toggle mode via the editor mode button.`,ph()].join(` `)}},{path:[`upload`,`maxBytes`],get redirect(){return[`streaming uploads have no user-facing cap; the value is hardcoded in @inkeep/open-knowledge-core.`,ph()].join(` `)}},{path:[`github`,`oauthAppClientId`],get redirect(){return[`Use the OPEN_KNOWLEDGE_GITHUB_CLIENT_ID environment variable instead.`,ph()].join(` `)}},{path:[`server`,`host`],get redirect(){return[`Use server.bind in .ok/config.yml instead — a list of bind addresses, e.g. [127.0.0.1]; a non-loopback bind additionally requires server.allowExternal.`,`The --bind CLI flag and HOST environment variable also remain available.`,ph()].join(` `)}},{path:[`remote`,`url`],get redirect(){return[`remote.url has been removed. Use server.externalUrl in .ok/config.yml instead (the public origin your tunnel serves).`,ph()].join(` `)}},{path:[`remote`,`port`],get redirect(){return[`remote.port has been removed. Use server.port in .ok/config.yml instead.`,ph()].join(` `)}},{path:[`server`,`publicUrl`],get redirect(){return[`server.publicUrl has been removed. Use server.externalUrl in .ok/config.yml instead (the same key under its current name).`,ph()].join(` `)}},{path:[`server`,`openOnAgentEdit`],get redirect(){return[`This behavior was removed; the value is hardcoded.`,ph()].join(` `)}},{path:[`mcp`,`autoStart`],get redirect(){return[`To disable MCP auto-start, set OK_MCP_AUTOSTART=0.`,ph()].join(` `)}},{path:[`mcp`,`tools`,`read_document`,`historyDepth`],get redirect(){return[`This value is hardcoded in @inkeep/open-knowledge-core.`,ph()].join(` `)}},{path:[`mcp`,`tools`,`grep`,`maxResults`],get redirect(){return[`This value is hardcoded in @inkeep/open-knowledge-core.`,ph()].join(` `)}},{path:[`mcp`,`tools`,`search`,`maxResults`],get redirect(){return[`The search result cap is hardcoded in @inkeep/open-knowledge-core; this config key was removed.`,ph()].join(` `)}},{path:[`preview`,`baseUrl`],get redirect(){return[`preview URLs now resolve only to the running server — start one with \`${a()} start\`.`,ph()].join(` `)}},{path:[`preview`,`scriptSrc`],get redirect(){return[`preview.scriptSrc has been removed.`,`The code-block preview iframe now runs a fixed open network policy (it is no longer configurable).`,ph()].join(` `)}},{path:[`appearance`,`sidebar`,`showAllFiles`],get redirect(){return[`appearance.sidebar.showAllFiles has been removed.`,`The sidebar lists every file on disk by default; dot-prefixed entries are gated by appearance.sidebar.showHiddenFiles, and appearance.sidebar.showOnlyMarkdownFiles scopes the tree down to markdown documents as a per-machine view preference.`,ph()].join(` `)}}];function hh(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function gh(e,t){let n=e;for(let e=0;e<t.length-1;e++){if(!hh(n))return!1;n=n[t[e]]}return hh(n)?t[t.length-1]in n:!1}function _h(e){let{value:t,file:n,source:r,doc:i}=e;if(!hh(t))return[];let a=[];for(let e of mh){if(!gh(t,e.path))continue;let o;i!=null&&r!=null&&n!=null&&(o=fh({file:n,source:r,doc:i,path:e.path})),a.push({code:`REMOVED_KEY`,path:e.path,redirect:e.redirect,...o===void 0?{}:{source:o}})}return a}function vh(e,t){let[n,...r]=t;if(n===void 0)return e;let i={...e};if(r.length===0)return delete i[n],i;let a=i[n];return hh(a)&&(i[n]=vh(a,r)),i}function yh(e){if(!hh(e))return e;let t=e;for(let e of mh)gh(t,e.path)&&(t=vh(t,e.path));return t}const bh=`v0`,xh=1e4,Sh=`last-spawn-error.log`,Ch={logsCurrent:`server-current.jsonl`,logsPrevious:`server-prev.jsonl`,spansCurrent:`spans-current.jsonl`,spansPrevious:`spans-prev.jsonl`,spawnError:Sh},wh=`=== spawn attempt `,Th=`acp-launch-failures.log`;function Eh(e){return e===void 0?`a`:e>=262144?`w`:`a`}function Dh(e,t){return`\n${wh}${e.toISOString()} pid=${t} ===\n`}function Oh(e){let t=e.lastIndexOf(wh);if(t===-1)return e;let n=e.indexOf(`
|
|
143
|
+
`,t);return n===-1?``:e.slice(n+1)}const kh=`last-server-exit.json`,Ah=`last-server-crash.json`;function jh(e){return new Promise(t=>{setTimeout(t,e)})}const Mh=F({file:j(),line:M().int().min(1),column:M().int().min(1),snippet:j().optional()}),Nh=F({path:P(xo([j(),M()])),message:j(),issueCode:j(),params:ko(j(),po()).optional(),source:Mh.optional()}),Ph=I([`user`,`project`,`project-local`,`either`]),Fh=I([`user`,`project`,`project-local`]),Ih=F({code:L(`YAML_PARSE`),detail:j()}),Lh=F({code:L(`UNREADABLE`),detail:j()}),Rh=F({code:L(`SCHEMA_INVALID`),issues:P(Nh)}),zh=F({code:L(`REMOVED_KEY`),path:P(j()),redirect:j(),source:Mh.optional()}),Bh=F({path:P(j()),message:j(),source:Mh.omit({snippet:!0}).optional()}),Vh=F({code:L(`VALUE_FALLBACK`),issues:P(Bh)}),Hh=Co(`code`,[Ih,Rh,Lh,F({code:L(`SCOPE_VIOLATION`),path:P(j()),expectedScope:Ph,actualScope:Fh}),F({code:L(`NOT_AGENT_SETTABLE`),path:P(j())}),F({code:L(`MIXED_SCOPE`),paths:P(F({path:P(j()),scope:Fh}))}),zh,F({code:L(`NOT_SYNCED`),detail:j()}),F({code:L(`WRITE_ERROR`),detail:j()}),F({code:L(`OKIGNORE_INVALID`),detail:j(),lineNumber:M().int().min(1).optional()}),F({code:L(`SAVE_HELD`),cause:I([`no-history-or-backup`,`keeps-changing`,`not-utf8`,`unreadable`]),file:j()}),F({code:L(`UNKNOWN`),message:j().optional()})]);Co(`code`,[zh,Vh,Ih,Rh,Lh]);const Uh=F({diagnostics:P(Co(`code`,[F({code:L(`VALUE_FALLBACK`),scope:Fh,file:j(),issues:P(Bh.omit({source:!0}).extend({line:Mh.shape.line.optional(),column:Mh.shape.column.optional()}))}),F({code:L(`REMOVED_KEY`),scope:Fh,file:j(),path:P(j()),redirect:j()}),F({code:L(`YAML_PARSE`),scope:Fh,file:j()}),F({code:L(`SCHEMA_INVALID`),scope:Fh,file:j()}),F({code:L(`UNREADABLE`),scope:Fh,file:j()})]))}),Wh=new Set(Hh.options.map(e=>e.shape.code.value)),Gh=xo([Hh,yo({code:j(),message:j().optional()})]);function Kh(e){return Wh.has(e.code)}function qh(e){switch(e){case`user`:return o(`global.yml`);case`project`:return`.ok/config.yml`;case`project-local`:return`.ok/local/config.yml`;case`either`:return`.ok/config.yml or ${o(`global.yml`)}`}}function Jh(e){switch(e){case`user`:return`personal to you, across all projects`;case`project`:return`shared with your team via git`;case`project-local`:return`this machine only, not shared`;case`either`:return`user or project`}}function Yh(e){if(e.code===`VALUE_FALLBACK`){let t=Vh.safeParse(e);if(t.success){if(t.data.issues.length===0)return`Configuration loaded with defaults for invalid settings.`;let e=[`Configuration loaded with defaults for invalid settings:`];for(let n of t.data.issues)n.source&&e.push(` ${n.source.file}:${n.source.line}:${n.source.column}`),e.push(` ${n.path.join(`.`)}: ${n.message}`);return e.join(`
|
|
144
|
+
`)}}if(!Kh(e))return e.message??`Unknown error (${e.code}).`;switch(e.code){case`YAML_PARSE`:return`Failed to parse YAML: ${e.detail}`;case`UNREADABLE`:return`Could not read the file: ${e.detail}`;case`SCHEMA_INVALID`:{if(e.issues.length===0)return`Invalid configuration.`;let t=new Map;for(let n of e.issues){let e=n.source?.file??`<no source>`,r=t.get(e)??[];r.push(n),t.set(e,r)}let n=[];for(let[e,r]of t){e===`<no source>`?n.push(`Invalid configuration:`):n.push(`Invalid configuration at ${e}:`);for(let t of r){let r=t.path.length===0?`<root>`:t.path.join(`.`);if(t.source){if(n.push(` ${e}:${t.source.line}:${t.source.column}`),n.push(` ${r}: ${t.message}`),t.source.snippet&&t.source.snippet.length>0)for(let e of t.source.snippet.split(`
|
|
145
|
+
`))n.push(` ${e}`)}else n.push(` ${r}: ${t.message}`)}}return n.join(`
|
|
146
|
+
`)}case`SCOPE_VIOLATION`:return[`Setting ${e.path.join(`.`)} belongs in your ${e.expectedScope} config`,`(${qh(e.expectedScope)} — ${Jh(e.expectedScope)}),`,`but it was set in the ${e.actualScope} config (${qh(e.actualScope)}).`,`Move it to ${qh(e.expectedScope)}.`].join(` `);case`NOT_AGENT_SETTABLE`:return[`Setting ${e.path.join(`.`)} is human-only and can't be changed by an agent.`,`Change it in the Settings pane, or edit the config.yml by hand.`].join(` `);case`MIXED_SCOPE`:return[`This change touches settings that live in different config files. Apply them one file at a time:`,e.paths.map(({path:e,scope:t})=>` ${e.join(`.`)} → ${qh(t)} (${t})`).join(`
|
|
147
|
+
`)].join(`
|
|
148
|
+
`);case`REMOVED_KEY`:{let t=e.path.join(`.`),n=[`${e.source?`Removed key at ${e.source.file}:${e.source.line}:${e.source.column}`:`Removed key in configuration`}: ${t}`,e.redirect];if(e.source?.snippet&&e.source.snippet.length>0)for(let t of e.source.snippet.split(`
|
|
149
|
+
`))n.push(` ${t}`);return n.join(`
|
|
150
|
+
`)}case`NOT_SYNCED`:return`Settings are still loading. Try again in a moment.`;case`WRITE_ERROR`:return`Failed to write config file: ${e.detail}`;case`OKIGNORE_INVALID`:return e.lineNumber===void 0?`.okignore: ${e.detail}`:`.okignore line ${e.lineNumber}: ${e.detail}`;case`SAVE_HELD`:return`${e.file} was not saved (${e.cause}); saving is tried again.`;case`UNKNOWN`:return e.message??`Unknown error.`}}function Xh(e,t,n){return Zh([e,t,n],[])}function Zh(e,t){if(t.length>0){let n=nh(eh,t);if(n?.scope===`user`)return e[0];if(n?.scope===`project`)return e[1]??e[0];if(n?.scope===`project-local`)return e[2]??e[0]}let n=Qh(e);if(n===void 0)return;if(n===null)return null;if(Array.isArray(n)||typeof n!=`object`)return n;let r=e.map(e=>$h(e)?e:void 0),i=new Set;for(let e of r)if(e!==void 0)for(let t of Object.keys(e))i.add(t);let a={};for(let e of i)a[e]=Zh(r.map(t=>t===void 0?void 0:t[e]),[...t,e]);return a}function Qh(e){for(let t=e.length-1;t>=0;t--)if(e[t]!==void 0)return e[t]}function $h(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const eg=`__system__`,tg=1,ng=`__config__/project`,rg=`__user__/config.yml`,ig=`__local__/project`,ag=`__config__/okignore`,og=Object.freeze([ng,ig,rg,ag]),sg=`__skill__/`,cg=`__template__/`,lg=`__extskill__/`,ug=[`project`,`global`];function dg(e){return e.startsWith(`__skill__/`)||e.startsWith(`__template__/`)||e.startsWith(`__extskill__/`)}function fg(e){return`${lg}${e}`}function pg(e){if(!e.startsWith(`__extskill__/`))return null;let t=e.slice(13),n=t.indexOf(`/`),r=n<0?t:t.slice(0,n),i=n<0?null:t.slice(n+1);return/^[a-z0-9-]+$/.test(r)?{name:r,rel:i&&i.length>0?i:null}:null}function mg(e){return e.replace(/\.mdx?$/i,``)}const hg=`.ok/skills`;function gg(e){return`${hg}/${e}/SKILL`}const _g=[`references`,`scripts`];function vg(e,t){let n=e.trim();if(!n.startsWith(`/`))return null;let r=n.slice(1);if(r===``||r.includes(`/`))return null;let i=/^(\.[A-Za-z0-9_-]+\/skills)\/[^/]+\/(?:SKILL|references\/.+)$/.exec(t);return i?`${i[1]}/${r}/SKILL`:/^__skill__\/(global)\/[^/]+(?:\/references\/.+)?$/.exec(t)?wg(`global`,r):null}function yg(e,t){let n=/^(\.[A-Za-z0-9_-]+\/skills\/[^/]+)\/(?:SKILL|references\/.+)$/.exec(t)??/^(__skill__\/global\/[^/]+)(?:\/references\/.+)?$/.exec(t)??/^(__extskill__\/[^/]+)(?:\/.+)?$/.exec(t);if(!n)return null;let r=n[1],i=mg(e.trim()).split(`/`).filter(e=>e!==``&&e!==`.`),[a]=i;return!a||!_g.includes(a)||i.includes(`..`)||i.length<2?null:`${r}/${i.join(`/`)}`}const bg=/^\.[A-Za-z0-9_-]+\/skills\/([^/]+)\/(SKILL|references\/.+)$/;function xg(e){let t=bg.exec(e);if(!t)return null;let n=t[1],r=t[2];return r===`SKILL`?{name:n,kind:`skill`,rel:null}:{name:n,kind:`reference`,rel:r.slice(11)}}const Sg=/^__skill__\/global\/([^/]+)(?:\/(references\/.+))?$/;function Cg(e){let t=Sg.exec(e);if(!t)return null;let{name:n,host:r}=Tg(t[1]),i=t[2];return i===void 0?{name:n,kind:`skill`,rel:null,host:r}:{name:n,kind:`reference`,rel:i.slice(11),host:r}}function wg(e,t,n){return e===`project`?gg(t):`${sg}${e}/${t}${n?`@${n}`:``}`}function Tg(e){let t=e.indexOf(`@`);if(t<0)return{name:e,host:null};let n=e.slice(t+1);return{name:e.slice(0,t),host:n===``?null:n}}function Eg(e){if(e===``)return``;try{return e.split(`/`).map(e=>decodeURIComponent(e)).join(`/`)}catch{return e}}function Dg(e){if(e.startsWith(`__skill__/`)){let t=e.slice(10),n=t.indexOf(`/`);if(n<0)return null;let r=t.slice(0,n);if(r!==`global`&&r!==`project`)return null;let i=t.slice(n+1);if(!i)return null;let a=Eg(i),o=a.indexOf(`/`),s=o<0?a:a.slice(0,o);if(!s)return null;let c=o<0?null:a.slice(o+1),{name:l,host:u}=Tg(s);return l?{kind:`skill`,scope:r,name:l,host:u,rel:c}:null}return null}function Og(e,t){let n=e.replace(/^\/+|\/+$/g,``);return n?`${n}/.ok/templates/${t}`:`.ok/templates/${t}`}const kg=i.stable.mcpServerName,Ag=`Server unreachable:`,jg=`Server timed out:`,Mg=[`exec`,`search`,`history`,`links`,`skills`,`config`,`palette`,`preview_url`,`share_link`,`lint`,`audit`,`write`,`edit`,`delete`,`move`,`install`,`import`,`checkpoint`,`restore_version`],Ng=`OK_HOSTED_AGENT`;function Pg(e){return e.OK_DESKTOP_TERMINAL===`1`||e.OK_HOSTED_AGENT===`1`}function Fg(e){if(e.length===0)return{ok:!1,reason:`docName must not be empty`};if(e.trim().length===0)return{ok:!1,reason:`docName must not be blank (whitespace only)`};if(e!==e.trim())return{ok:!1,reason:`docName must not have leading or trailing whitespace`};for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n<32||n===127)return{ok:!1,reason:`docName must not contain control characters`}}if(e.includes(`..`)||e.startsWith(`/`)||e.includes(`\\`))return{ok:!1,reason:`docName must not contain "..", a leading "/", or a backslash`};for(let t of e.split(`/`)){if(t.length===0)return{ok:!1,reason:`docName must not contain empty path segments (no leading, trailing, or doubled "/")`};if(t.startsWith(`.`))return{ok:!1,reason:`docName path segments must not start with "." (hidden files are not addressable)`}}return{ok:!0}}const Ig=new Set([`opencode.json`]),Lg=/^\.[A-Za-z0-9_-]+\/skills\/[^/]+\/.+$/;function Rg(e){return Lg.test(e)}function zg(e){return Rg(e)?!1:e.split(`/`).some(e=>e.startsWith(`.`))?!0:Ig.has(e.slice(e.lastIndexOf(`/`)+1))}const Bg=P(j().min(1)).max(50),Vg=I([`dormant`,`idle`,`fetching`,`pulling`,`pushing`,`conflict`,`offline`,`auth-error`,`disabled`]),Hg=F({label:j().min(1),webUrl:ro().nullable(),transport:I([`https`,`http`,`ssh`,`git`]).optional()}).loose(),Ug=Co(`checkStatus`,[F({checkStatus:L(`allowed`)}).loose(),F({checkStatus:L(`denied`),deniedReason:I([`no-collaborator`,`private-no-access`,`repo-not-found`,`not-authenticated`]),resolvedLogin:j().optional(),declaredLogin:j().optional(),declaredSource:j().optional()}).loose(),F({checkStatus:L(`unknown`),unknownError:I([`network`,`timeout`,`rate-limit`,`token-invalid`,`malformed-response`,`ssh-unverified`]).optional()}).loose()]),Wg=I([`auth-403`,`auth-401`,`auth-scope-mismatch`,`auth-no-credential`,`auth-not-found-as-identity`,`semantic-protected-branch`]),Gg=I(sp),Kg=I([`succeeded`,`up-to-date`,`conflict`,`refused`,`error`]),qg=F({state:Vg,lastSyncUtc:j().nullable(),lastRunUtc:j().nullable().optional(),lastPullOkUtc:j().nullable().optional(),lastPushOkUtc:j().nullable().optional(),lastFetchUtc:j().nullable(),lastPushedSha:j().nullable(),ahead:M().int().min(0),behind:M().int().min(0),consecutiveFailures:M().int().min(0),consecutivePushFailures:M().int().min(0).optional(),conflictCount:M().int().min(0),hasRemote:N(),syncEnabled:N(),identityUnresolved:N(),remote:Hg.nullable().optional(),pushError:j().optional(),pushErrorCode:Wg.optional(),pullError:j().optional(),pullErrorCode:Wg.optional(),pausedReason:j().optional(),blockingPaths:P(j().min(1)).optional(),refusedSymlinkPaths:Bg.optional(),pushPermission:Ug.optional(),syncMode:Gg.optional(),lastPullUtc:j().nullable().optional(),lastPullOutcome:Kg.nullable().optional()}).loose(),Jg=F({action:I([`commit`]),paths:P(j().min(1)),commitSha:j().optional()}).loose(),Yg=F({action:I([`commit`])}).loose(),Xg=F({op:I([`sync`,`push`,`pull`,`fetch`]).optional()}).loose(),Zg=F({op:I([`sync`,`push`,`pull`,`fetch`])}).loose(),Qg=[`merge-native`,`working-tree`,`reconcile`],$g=I(Qg),e_=[`merged-with-markers`,`refused-conflict-markers`,`refused-no-base`,`refused-too-large`,`disk-markers`,`stale-external-write`],t_=I(e_),n_=I([`mine`,`theirs`,`content`,`delete`]),r_=F({conflicts:P(F({file:j().min(1),detectedAt:j().min(1),conflict:$g,reason:t_.optional().catch(void 0),conflictKind:I([`git`,`stale-external-write`]).optional(),docName:j().nullable(),theirsSha:j().optional(),baseSha:j().optional()}).loose())}).loose(),i_=F({file:j().min(1),strategy:I([`mine`,`theirs`,`content`,`delete`]),content:j().optional()}).loose().refine(e=>e.strategy!==`content`||e.content!==void 0,{message:`content must be provided when strategy is 'content' (an empty string keeps an empty file)`,path:[`content`]}),a_=F({}).loose(),o_=F({file:j().min(1),base:j(),ours:j(),theirs:j(),kind:I([`both-modified`,`delete-modify`,`modify-delete`]),conflict:$g,reason:t_.optional().catch(void 0),conflictKind:I([`git`,`stale-external-write`]).optional(),resolutionOptions:P(n_)}).loose(),s_=F({plan:rs(e=>e!==void 0,{message:`plan is required`})}).loose(),c_=F({plan:rs(e=>e!==void 0,{message:`plan is required`})}).loose(),l_=F({result:rs(e=>e!==void 0,{message:`result is required`})}).loose(),u_=F({packId:j().min(1)}).strict(),d_=F({installedHosts:P(j()),skills:P(F({name:j().min(1),created:N()}).strict())}).strict(),f_=F({path:j().min(1),summary:j().min(1)}).loose(),p_=F({files:M().int().nonnegative(),folders:M().int().nonnegative()}).loose(),m_=F({packs:P(F({id:j().min(1),name:j().min(1),description:j().min(1),defaultSubfolder:j().optional(),folders:P(f_),entryCounts:p_}).loose())}).loose(),h_=F({noOpen:N().optional(),out:j().min(1).optional()}).loose(),g_=F({reason:I([`unsupported-platform`,`spawn-error`]),message:j()}).loose(),__=Co(`status`,[F({status:L(`installed`),outputPath:j(),size:M().int().nonnegative(),sha256:j(),skillVersion:j()}).loose(),F({status:L(`built`),outputPath:j(),size:M().int().nonnegative(),sha256:j(),skillVersion:j(),handoffError:g_.optional()}).loose(),F({status:L(`failed`),buildError:j()}).loose(),F({status:L(`skip-current`),skillVersion:j(),recordedAt:j().optional()}).loose()]),v_=Co(`kind`,[F({kind:L(`doc`),docPath:j().min(1)}).loose(),F({kind:L(`folder`),folderPath:j()}).loose()]),y_=I([`no-remote`,`detached-head`,`branch-not-on-origin`,`non-github-remote`,`invalid-path`,`unsupported-share-url`]),b_=I([`current`,`stale`,`absent`,`empty`]),Cne=Co(`ok`,[F({ok:L(!0),shareUrl:j().min(1),sharedUrl:j().min(1),branch:j().min(1),freshness:b_.optional().catch(void 0)}).loose(),F({ok:L(!1),error:y_,branch:j().min(1).optional()}).loose()]),wne=I([`user`,`org`]),Tne=F({login:j().min(1),kind:wne,avatarUrl:j().optional()}).loose(),x_=I([`auth-required`,`network`]),Ene=Co(`ok`,[F({ok:L(!0),owners:P(Tne)}).loose(),F({ok:L(!1),error:x_}).loose()]),Dne=Co(`ok`,[F({ok:L(!0),available:N()}).loose(),F({ok:L(!1),error:x_}).loose()]),One=I([`public`,`private`]),kne=F({owner:j().min(1),name:j().min(1),visibility:One,description:j().optional()}).loose(),Ane=I([`name-conflict`,`saml-sso`,`auth-required`,`push-failed`,`init-failed`,`network`,`no-project`]),jne=Co(`ok`,[F({ok:L(!0),ownerLogin:j().min(1),repoName:j().min(1),cloneUrl:j().min(1),defaultBranch:j().min(1)}).loose(),F({ok:L(!1),error:Ane}).loose()]);function S_(e){return!(typeof e!=`string`||e.length===0||e.startsWith(`-`)||/[\x00-\x1F\x7F]/.test(e)||/\s/.test(e)||e.includes(`:`)||e.split(`/`).includes(`..`))}const C_=e=>e.refine(S_,`invalid branch name`);function Mne(e){if(e==null)return!1;let t=e instanceof Error?e.message:String(e);return/couldn'?t find remote ref|Remote branch .+ not found/i.test(t)}const Nne=[/could not read (username|password)/i,/terminal prompts disabled/i,/user interactivity has been disabled/i,/unable to get password from user/i],Pne=[/insufficient scopes/i,/missing.*scope/i,/required scope/i],Fne=[/permission denied.*\(publickey\)/i,/host key verification failed/i],w_=/fatal:.*repository.*not found/i,Ine=[/\b(401|403)\b/,/authentication failed/i,/authorization failed/i,/invalid credentials/i,/credential helper/i,/bad credentials/i,/token.*expired/i,/expired.*token/i,w_];function Lne(e){if(typeof e!=`object`||!e)return``;let t=e.git;return t==null?``:String(t)}function Rne(e){if(e==null)return{kind:`non-auth`};let t=`${e instanceof Error?e.message:String(e)}\n${Lne(e)}`;return Nne.some(e=>e.test(t))?{kind:`auth`,subclass:`no-credential`}:Pne.some(e=>e.test(t))?{kind:`auth`,subclass:`scope-mismatch`}:Fne.some(e=>e.test(t))?{kind:`auth`,subclass:`ssh-auth`}:Ine.some(e=>e.test(t))?/\b401\b/.test(t)||/token.*expired/i.test(t)?{kind:`auth`,subclass:`401`}:/\b403\b/.test(t)?{kind:`auth`,subclass:`403`}:w_.test(t)?{kind:`auth`,subclass:`not-found-as-identity`}:{kind:`auth`,subclass:`unknown-auth`}:{kind:`non-auth`}}function zne(e){return e.kind===`auth`?e.subclass===`no-credential`||e.subclass===`401`||e.subclass===`unknown-auth`:!1}const T_={shareTargetExists:N(),dirtyConflicts:F({conflicts:N(),files:P(j().min(1))}).loose(),branchIsLocal:N(),shareTargetOnOriginBranch:N().optional()},Bne=Co(`detached`,[F({detached:L(!1),currentBranch:j().min(1).nullable(),currentHeadSha:co(),...T_}).loose(),F({detached:L(!0),currentBranch:co(),currentHeadSha:j().min(1),...T_}).loose()]),Vne=F({branch:C_(j().min(1)),principalId:j().optional(),fastForward:N().optional()}).loose(),Hne=I([`dirty-conflict`,`branch-not-found`,`fetch-failed`,`checkout-failed`,`branch-in-other-worktree`,`ff-diverged`,`unsafe-symlinks`,`symlink-check-failed`]),Une=Co(`ok`,[F({ok:L(!0)}).loose(),F({ok:L(!1),reason:Hne,files:P(j().min(1)).optional(),otherWorktreePath:j().min(1).optional(),refusedSymlinkPaths:Bg.optional()}).loose()]);I([`on-origin`,`renamed`,`deleted`,`never-on-branch`,`changed-locally`,`unknown`]);const Wne=F({branch:C_(j().min(1)),path:j(),kind:I([`doc`,`folder`]),contentRootDepth:M().int().min(1).max(65535).optional()}).loose(),Gne=Co(`verdict`,[F({verdict:L(`on-origin`)}).loose(),F({verdict:L(`renamed`),renamedTo:j().min(1)}).loose(),F({verdict:L(`deleted`)}).loose(),F({verdict:L(`never-on-branch`)}).loose(),F({verdict:L(`changed-locally`)}).loose(),F({verdict:L(`unknown`)}).loose()]).catch({verdict:`unknown`});function Kne(e){return e>=0&&e<=31&&e!==9&&e!==10&&e!==13}function E_(e,t,n=[]){for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);if(Kne(i)){t.addIssue({code:`custom`,path:n,params:{contentControlAdmission:!0},message:`Disallowed content control U+${i.toString(16).toUpperCase().padStart(4,`0`)} at zero-based UTF-16 offset ${r}. C0 controls allow only TAB, LF and CR. Remove the character or replace it with a printable escape such as \\u0000.`});return}}}const D_=j().superRefine(E_);function O_(e,t){let n=Fg(e);n.ok||t.addIssue({code:`custom`,message:n.reason})}const k_=j().superRefine(O_).optional(),qne=j().superRefine(O_),A_={agentId:j().optional(),agentName:j().optional(),colorSeed:j().optional(),clientName:j().optional(),clientVersion:j().optional(),label:j().optional()},j_=j().optional(),Jne=/^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,Yne=F({startedAt:j().min(1),httpListenMs:M().nonnegative().optional(),seedWalkMs:M().nonnegative().optional(),indexesMs:M().nonnegative().optional(),readyMs:M().nonnegative().optional(),fileCount:M().nonnegative().optional()}),Xne=F({serverInstanceId:j().min(1),currentBranch:j().min(1).optional(),currentDiskAckSVs:ko(j().min(1),j().min(1)).optional(),boot:Yne.optional(),collabClients:M().int().nonnegative().optional(),runtimeVersion:j().min(1).optional(),protocolVersion:M().int().positive().optional()}).loose(),Zne=F({id:j().min(1),display_name:j().min(1),display_email:j(),source:I([`git-config`,`synthesized`]),created_at:j().min(1)}).loose(),Qne=F({collabUrl:j().nullable(),previewUrl:j().nullable(),port:M(),singleFile:N().default(!1)}).loose(),M_=I(`urn:ok:error:malformed-upload.urn:ok:error:collision-exhaustion.urn:ok:error:storage-full.urn:ok:error:storage-readonly.urn:ok:error:storage-error.urn:ok:error:no-file-received.urn:ok:error:path-escape.urn:ok:error:symlink-refused.urn:ok:error:links-not-permitted.urn:ok:error:method-not-allowed.urn:ok:error:invalid-request.urn:ok:error:unsupported-media-type.urn:ok:error:payload-too-large.urn:ok:error:request-timeout.urn:ok:error:internal-server-error.urn:ok:error:derived-index-unavailable.urn:ok:error:loopback-required.urn:ok:error:invalid-origin.urn:ok:error:url-not-allowed.urn:ok:error:dir-outside-home.urn:ok:error:concurrent-operation.urn:ok:error:clone-failed.urn:ok:error:clone-timeout.urn:ok:error:server-start-failed.urn:ok:error:reserved-doc-name.urn:ok:error:target-not-found.urn:ok:error:stale-target.urn:ok:error:frontmatter-edit-not-supported.urn:ok:error:invalid-frontmatter-patch.urn:ok:error:frontmatter-malformed.urn:ok:error:no-active-session.urn:ok:error:too-many-agent-sessions.urn:ok:error:disk-divergence.urn:ok:error:stale-external-write.urn:ok:error:store-refused.urn:ok:error:save-held.urn:ok:error:doc-removed.urn:ok:error:branch-switched.urn:ok:error:doc-moved.urn:ok:error:server-stopped.urn:ok:error:both-kept.urn:ok:error:write-replaced.urn:ok:error:write-dropped.urn:ok:error:doc-not-found.urn:ok:error:doc-already-exists.urn:ok:error:doc-not-open.urn:ok:error:rollback-not-configured.urn:ok:error:doc-not-available.urn:ok:error:backlink-index-not-configured.urn:ok:error:file-rescan-not-configured.urn:ok:error:shadow-not-configured.urn:ok:error:host-not-allowed.urn:ok:error:principal-not-available.urn:ok:error:not-found.urn:ok:error:auth-failed.urn:ok:error:no-project-dir.urn:ok:error:non-github-origin.urn:ok:error:server-open-failed.urn:ok:error:doc-in-conflict.urn:ok:error:concurrent-overwrite-refused.urn:ok:error:unresolved-conflict-markers.urn:ok:error:no-conflict-tracked.urn:ok:error:no-blocking-changes.urn:ok:error:sync-not-active.urn:ok:error:project-repo-not-configured.urn:ok:error:seed-prerequisite-missing.urn:ok:error:seed-invalid-root.urn:ok:error:tag-index-not-configured.urn:ok:error:template-not-found.urn:ok:error:unsupported-asset-type.urn:ok:error:asset-not-found.urn:ok:error:single-file-mode.urn:ok:error:collab-server-not-running.urn:ok:error:gateway-timeout.urn:ok:error:cursor-not-installed.urn:ok:error:cursor-spawn-timeout.urn:ok:error:cursor-spawn-failed.urn:ok:error:handoff-target-not-installed.urn:ok:error:handoff-spawn-timeout.urn:ok:error:handoff-spawn-failed.urn:ok:error:registry-unreachable.urn:ok:error:config-not-writable.urn:ok:error:audit-superseded.urn:ok:error:theme-name-taken.urn:ok:error:theme-name-invalid`.split(`.`));function $ne(e){throw Error(`Unexpected ProblemType variant: ${JSON.stringify(e)}`)}const N_=F({type:M_,title:j().min(1),status:M().int().min(400).max(599),instance:j().regex(Jne,`instance must be urn:uuid:<uuid>`).optional(),detail:j().optional()}).loose(),ere=F({parentDocName:j().min(1),placement:I([`configured-attachments`,`parent-dir`]).default(`configured-attachments`),agentId:j().min(1).optional(),agentName:j().min(1).optional()}).loose(),tre=F({src:j().min(1),path:j().min(1).optional(),deduped:N().optional()}).loose();Co(`kind`,[F({kind:L(`unknown-variable`),variables:P(j())}),F({kind:L(`unclosed-braces`)}),F({kind:L(`repeated-variable`)}),F({kind:L(`invalid-config`)})]);const nre=F({url:j().min(1),dir:j().min(1),branch:j().min(1).refine(S_,`invalid branch name`).optional()}).loose(),rre=F({type:L(`error`),problem:N_}).loose(),P_=[`applied`,`merged-first`,`both-kept`,`refused`,`projection-held`],F_=[`retry`,`re-read`,`none`],I_={applied:`the write landed and is saved to the file; carry on, or re-read first when nextStep says re-read (the stored text differs from what was sent)`,"merged-first":`an outside change to the file was handled before the write was saved (merged in, or saved to the document history when it could not be merged); the write landed; re-read before the next edit`,"both-kept":`the write landed and is saved, and for a block changed both here and outside both versions are in the document, this side first; never retry it; re-read and tidy the duplicate with an ordinary edit if the task calls for it`,refused:`not saved; OpenKnowledge saves it only after someone acts: the agent, as nextStep says, or the user; follow nextStep`,"projection-held":`the write is in the document but not yet in its file, and OpenKnowledge saves it on its own (on either runtime: a held local save or a held cloud projection); never retry it; re-read before the next edit`},L_={retry:`the write did not land; send it again, corrected the way the detail says or after the wait it names`,"re-read":`re-read the document before doing anything further with it`,none:`nothing more to do on this document: with applied, carry on; with refused, nothing the agent sends changes it, so tell the user what the detail says`};function R_(e){return P_.includes(e)}function z_(e){return F_.includes(e)}const B_={outcome:j().optional(),saved:N().optional(),nextStep:j().optional()};function V_(e){return e===void 0?{}:z_(e)?{nextStep:e}:{nextStep:`re-read`,unknownNextStep:String(e)}}function H_(e){if(e.outcome===void 0)return;let t=typeof e.saved==`boolean`?{saved:e.saved}:{};return R_(e.outcome)?{outcome:e.outcome,...t,...V_(e.nextStep)}:{outcome:e.saved===!0?`merged-first`:`refused`,...t,...V_(e.nextStep),nextStep:`re-read`,unknownOutcome:String(e.outcome)}}const U_=F({docName:k_,summary:j_,content:D_.optional(),...A_}).loose(),W_=F({docName:k_,summary:j_,markdown:D_,position:I([`append`,`prepend`,`replace`]).optional(),extension:I(hp).optional(),...A_}).loose(),G_=F({docName:k_,summary:j_,find:j().min(1),replace:D_,offset:M().int().nonnegative().optional(),...A_}).loose(),K_=F({docName:k_,connectionId:j().min(1),scope:I([`last`,`session`,`file`,`count`]).optional(),count:M().int().positive().optional(),...A_}).loose().refine(e=>e.scope!==`count`||e.count!==void 0,{message:`count is required when scope is 'count'`,path:[`count`]}),q_=F({value:j(),truncatedFrom:M().int().nonnegative().optional(),hint:j().optional()}).loose(),J_=Co(`kind`,[F({kind:L(`inline`),content:j()}),F({kind:L(`truncated`),byteLength:M().int().nonnegative(),hint:j()})]),Y_=F({kind:L(`content-divergence`),intendedBytes:M().int().nonnegative(),actualBytes:M().int().nonnegative(),byteDelta:M().int(),divergenceType:j().optional(),currentState:J_.optional(),hint:j().optional()}).loose(),X_=F({type:L(`orphan`),parentCandidates:P(j()),message:j()}).loose(),Z_=[`clean`,`merged`,`both-kept`,`kept-live`];function Q_(e){return Z_.includes(e)}const $_=F({kind:L(`disk-edit-reconciled`),intendedBytes:M().int().nonnegative(),actualBytes:M().int().nonnegative(),byteDelta:M().int(),mergeOutcome:j().optional(),duplicatedBlocks:M().int().nonnegative().optional(),restoredDeletedHere:M().int().nonnegative().optional(),restoredDeletedOutside:M().int().nonnegative().optional(),nextStep:j().optional().meta({deprecated:!0}),hint:j().optional()}).loose();Co(`kind`,[Y_,$_]);const ev=Object.keys({"content-divergence":!0,"disk-edit-reconciled":!0});function tv(e){return ev.includes(e)}function nv(e){throw Error(`Unexpected WriteWarning variant: ${JSON.stringify(e)}`)}const rv=F({kind:L(`mermaid-parse-error`),fenceIndex:M().int().positive(),fenceFirstLine:j(),message:j(),line:M().int().positive().optional()}).loose(),iv=F({href:j(),targetKind:j(),role:j(),sourceForm:j(),resolvedTarget:j().nullable(),reason:j(),resolutionMethod:j(),fallbackTarget:j().nullable().optional(),definition:F({line:M().int().nonnegative(),label:j()}).loose().optional()}).loose(),av=Co(`kind`,[Y_,$_,rv,F({kind:L(`lint-violation`),source:j(),code:j(),message:j(),severity:I([`error`,`warning`,`info`,`hint`]),line:M().int().positive(),column:M().int().positive(),linkTarget:j().optional(),localTarget:iv.optional()}).loose(),F({kind:L(`link-check-deferred`),message:j()}).loose()]),ov=P(av).min(1),sv=F({href:j(),resolvedTo:j().nullable(),reason:I([`no-such-doc`,`no-such-file`,`unresolvable`,`excluded`]),localTarget:iv.optional()}).loose(),cv=P(sv),lv=[`reserved-log-policy`],uv=F({reason:j().min(1),count:M().int().positive()}).loose(),dv=F({...B_,timestamp:j().min(1),summary:q_.optional(),warnings:ov.optional()}).loose(),fv=F({...B_,timestamp:j().min(1),subscriberCount:M().int().nonnegative(),systemSubscriberCount:M().int().nonnegative(),hints:P(X_).optional(),summary:q_.optional(),warnings:ov.optional(),brokenLinks:cv,brokenLinkSuppression:uv.optional()}).loose(),pv=F({...B_,timestamp:j().min(1),subscriberCount:M().int().nonnegative(),systemSubscriberCount:M().int().nonnegative(),summary:q_.optional(),warnings:ov.optional(),brokenLinks:cv,brokenLinkSuppression:uv.optional()}).loose(),mv=F({...B_,docName:j().min(1),scope:I([`last`,`session`,`count`]),undone:N()}).loose(),hv=F({docs:P(F({docName:qne,markdown:D_,position:I([`append`,`prepend`,`replace`]).optional(),extension:I(hp).optional(),summary:j_}).loose()).min(1).max(100),...A_}).loose(),gv=F({type:M_,title:j(),detail:j().optional()}).loose(),_v=Co(`status`,[F({status:L(`written`),docName:j().min(1),...B_,summary:q_.optional(),warnings:ov.optional(),brokenLinks:cv,brokenLinkSuppression:uv.optional()}).loose(),F({status:L(`error`),docName:j().min(1),...B_,error:gv}).loose()]),vv=F({timestamp:j().min(1),results:P(_v),written:M().int().nonnegative(),failed:M().int().nonnegative()}).loose(),yv=F({docName:k_,patch:eu,types:ko(j(),I(Ul)).optional(),summary:j_,...A_}).loose(),bv=F({...B_,timestamp:j().min(1),subscriberCount:M().int().nonnegative(),systemSubscriberCount:M().int().nonnegative(),appliedKeys:P(j()),summary:q_.optional(),warnings:ov.optional(),brokenLinks:cv,brokenLinkSuppression:uv.optional()}).loose();function xv(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}const Sv=Nv(/[A-Za-z]/),Cv=Nv(/[\dA-Za-z]/),wv=Nv(/[#-'*+\--9=?A-Z^-~]/);function Tv(e){return e!==null&&(e<32||e===127)}const Ev=Nv(/\d/),Dv=Nv(/[\dA-Fa-f]/),Ov=Nv(/[!-/:-@[-`{-~]/);function B(e){return e!==null&&e<-2}function kv(e){return e!==null&&(e<0||e===32)}function Av(e){return e===-2||e===-1||e===32}const jv=Nv(/\p{P}|\p{S}/u),Mv=Nv(/\s/);function Nv(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Pv(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}const Fv=(function(e,t,n,r,i){let a=Iv(t);if(n!=null&&(typeof n!=`number`||n<0||n===1/0))throw Error(`Expected positive finite index`);if(r!=null&&(!Fv(r)||!r.children))throw Error(`Expected parent node`);if(r==null!=(n==null))throw Error(`Expected both parent and index`);return Hv(e)?a.call(i,e,n,r):!1}),Iv=(function(e){if(e==null)return Vv;if(typeof e==`function`)return Bv(e);if(typeof e==`object`)return Array.isArray(e)?Lv(e):Rv(e);if(typeof e==`string`)return zv(e);throw Error(`Expected function, string, or object as test`)});function Lv(e){let t=[],n=-1;for(;++n<e.length;)t[n]=Iv(e[n]);return Bv(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function Rv(e){let t=e;return Bv(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function zv(e){return Bv(t);function t(t){return t&&t.type===e}}function Bv(e){return t;function t(t,n,r){return!!(Hv(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function Vv(){return!0}function Hv(e){return typeof e==`object`&&!!e&&`type`in e}function Uv(e){return`\x1B[33m`+e+`\x1B[39m`}const Wv=[],Gv=`skip`;function Kv(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=Iv(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+Uv(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=Wv,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=qv(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function qv(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?Wv:[e]}function Jv(e,t,n){let r=Iv((n||{}).ignore||[]),i=Yv(t),a=-1;for(;++a<i.length;)Kv(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function Yv(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([Xv(e[0]),Zv(e[1])])}return t}function Xv(e){return typeof e==`string`?new RegExp(Pv(e),`g`):e}function Zv(e){return typeof e==`function`?e:function(){return e}}const Qv=`phrasing`,$v=[`autolink`,`link`,`image`,`label`];function ey(){return{transforms:[cy],enter:{literalAutolink:ny,literalAutolinkEmail:ry,literalAutolinkHttp:ry,literalAutolinkWww:ry},exit:{literalAutolink:sy,literalAutolinkEmail:oy,literalAutolinkHttp:iy,literalAutolinkWww:ay}}}function ty(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:Qv,notInConstruct:$v},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:Qv,notInConstruct:$v},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:Qv,notInConstruct:$v}]}}function ny(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function ry(e){this.config.enter.autolinkProtocol.call(this,e)}function iy(e){this.config.exit.autolinkProtocol.call(this,e)}function ay(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function oy(e){this.config.exit.autolinkEmail.call(this,e)}function sy(e){this.exit(e)}function cy(e){Jv(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,ly],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,uy]],{ignore:[`link`,`linkReference`]})}function ly(e,t,n,r,i){let a=``;if(!py(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!dy(n)))return!1;let o=fy(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function uy(e,t,n,r){return!py(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function dy(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function fy(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=xv(e,`(`),a=xv(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function py(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||Mv(n)||jv(n))&&(!t||n!==47)}function my(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}wy.peek=Cy;function hy(){this.buffer()}function gy(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function _y(){this.buffer()}function vy(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function yy(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=my(this.sliceSerialize(e)).toLowerCase(),n.label=t}function by(e){this.exit(e)}function xy(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=my(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Sy(e){this.exit(e)}function Cy(){return`[`}function wy(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function Ty(){return{enter:{gfmFootnoteCallString:hy,gfmFootnoteCall:gy,gfmFootnoteDefinitionLabelString:_y,gfmFootnoteDefinition:vy},exit:{gfmFootnoteCallString:yy,gfmFootnoteCall:by,gfmFootnoteDefinitionLabelString:xy,gfmFootnoteDefinition:Sy}}}function Ey(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:wy},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
|
|
151
|
+
`:` `)+r.indentLines(r.containerFlow(e,a.current()),t?Oy:Dy))),s(),o}}function Dy(e,t,n){return t===0?e:Oy(e,t,n)}function Oy(e,t,n){return(n?``:` `)+e}const ky=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];Py.peek=Fy;function Ay(){return{canContainEols:[`delete`],enter:{strikethrough:My},exit:{strikethrough:Ny}}}function jy(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:ky}],handlers:{delete:Py}}}function My(e){this.enter({type:`delete`,children:[]},e)}function Ny(e){this.exit(e)}function Py(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function Fy(){return`~`}function Iy(e){return e.length}function Ly(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||Iy,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=Ry(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=zy(r[d]);else{let e=zy(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&(n.alignDelimiters!==!1||i!==``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
|
|
152
|
+
`)}function Ry(e){return e==null?``:String(e)}function zy(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}const By={}.hasOwnProperty;function Vy(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&By.call(t,e)){let n=String(t[e]);i=By.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const Hy={}.hasOwnProperty;function Uy(e,t){let n=-1,r;if(t.extensions)for(;++n<t.extensions.length;)Uy(e,t.extensions[n]);for(r in t)if(Hy.call(t,r))switch(r){case`extensions`:break;case`unsafe`:Wy(e[r],t[r]);break;case`join`:Wy(e[r],t[r]);break;case`handlers`:Gy(e[r],t[r]);break;default:e.options[r]=t[r]}return e}function Wy(e,t){t&&e.push(...t)}function Gy(e,t){t&&Object.assign(e,t)}function Ky(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),qy);return i(),o}function qy(e,t,n){return`>`+(n?``:` `)+e}function Jy(e,t){return Yy(e,t.inConstruct,!0)&&!Yy(e,t.notInConstruct,!1)}function Yy(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Xy(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
153
|
+
`&&Jy(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
|
|
154
|
+
`}function Zy(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function Qy(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function $y(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function eb(e,t,n,r){let i=$y(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(Qy(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,tb);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(Zy(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
|
|
155
|
+
`,encode:["`"],...s.current()})),t()}return u+=s.move(`
|
|
156
|
+
`),a&&(u+=s.move(a+`
|
|
157
|
+
`)),u+=s.move(c),l(),u}function tb(e,t,n){return(n?``:` `)+e}function nb(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function rb(e,t,n,r){let i=nb(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
|
|
158
|
+
`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function ib(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function ab(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function ob(e){if(e===null||kv(e)||Mv(e))return 1;if(jv(e))return 2}function sb(e,t,n){let r=ob(e),i=ob(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}cb.peek=lb;function cb(e,t,n,r){let i=ib(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=sb(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=ab(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=sb(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+ab(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function lb(e,t,n){return n.options.emphasis||`*`}function ub(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),Kv(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}const db={};function fb(e,t){let n=t||db;return pb(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function pb(e,t,n){if(hb(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return mb(e.children,t,n)}return Array.isArray(e)?mb(e,t,n):``}function mb(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=pb(e[i],t,n);return r.join(``)}function hb(e){return!!(e&&typeof e==`object`)}function gb(e,t){let n=!1;return ub(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&fb(e)&&(t.options.setext||n))}function _b(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(gb(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
|
|
159
|
+
`,after:`
|
|
160
|
+
`});return r(),t(),o+`
|
|
161
|
+
`+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
|
|
162
|
+
`))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
|
|
163
|
+
`,...a.current()});return/^[\t ]/.test(l)&&(l=ab(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}vb.peek=yb;function vb(e){return e.value||``}function yb(){return`<`}bb.peek=xb;function bb(e,t,n,r){let i=nb(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function xb(){return`!`}Sb.peek=Cb;function Sb(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function Cb(){return`!`}wb.peek=Tb;function wb(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function Tb(){return"`"}function Eb(e,t){let n=fb(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type===`text`&&(n===e.url||`mailto:`+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Db.peek=Ob;function Db(e,t,n,r){let i=nb(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(Eb(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function Ob(e,t,n){return Eb(e,n)?`<`:`[`}kb.peek=Ab;function kb(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function Ab(){return`[`}function jb(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Mb(e){let t=jb(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function Nb(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Pb(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function Fb(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?Nb(n):jb(n),s=e.ordered?o===`.`?`)`:`.`:Mb(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),Pb(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function Ib(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function Lb(e,t,n,r){let i=Ib(n),a=n.bulletCurrent||jb(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function Rb(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}const zb=Iv([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function Bb(e,t,n,r){return(e.children.some(function(e){return zb(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function Vb(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Hb.peek=Ub;function Hb(e,t,n,r){let i=Vb(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=sb(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=ab(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=sb(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+ab(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Ub(e,t,n){return n.options.strong||`*`}function Wb(e,t,n,r){return n.safe(e.value,r)}function Gb(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function Kb(e,t,n){let r=(Pb(n)+(n.options.ruleSpaces?` `:``)).repeat(Gb(n));return n.options.ruleSpaces?r.slice(0,-1):r}const qb={blockquote:Ky,break:Xy,code:eb,definition:rb,emphasis:cb,hardBreak:Xy,heading:_b,html:vb,image:bb,imageReference:Sb,inlineCode:wb,link:Db,linkReference:kb,list:Fb,listItem:Lb,paragraph:Rb,root:Bb,strong:Hb,text:Wb,thematicBreak:Kb},Jb=[Yb];function Yb(e,t,n,r){if(t.type===`code`&&Qy(t,r)&&(e.type===`list`||e.type===t.type&&Qy(e,r)))return!1;if(`spread`in n&&typeof n.spread==`boolean`)return e.type===`paragraph`&&(e.type===t.type||t.type===`definition`||t.type===`heading`&&gb(t,r))?void 0:+!!n.spread}const Xb=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`],Zb=[{character:` `,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,before:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`]},{character:`\r`,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`,`codeFencedMetaGraveAccent`,`codeFencedMetaTilde`,`destinationLiteral`,`headingAtx`]},{character:`
|
|
164
|
+
`,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`,`codeFencedMetaGraveAccent`,`codeFencedMetaTilde`,`destinationLiteral`,`headingAtx`]},{character:` `,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,before:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`]},{character:`!`,after:`\\[`,inConstruct:`phrasing`,notInConstruct:Xb},{character:`"`,inConstruct:`titleQuote`},{atBreak:!0,character:`#`},{character:`#`,inConstruct:`headingAtx`,after:`(?:[\r
|
|
165
|
+
]|$)`},{character:`&`,after:`[#A-Za-z]`,inConstruct:`phrasing`},{character:`'`,inConstruct:`titleApostrophe`},{character:`(`,inConstruct:`destinationRaw`},{before:`\\]`,character:`(`,inConstruct:`phrasing`,notInConstruct:Xb},{atBreak:!0,before:`\\d+`,character:`)`},{character:`)`,inConstruct:`destinationRaw`},{atBreak:!0,character:`*`,after:`(?:[ \r
|
|
166
|
+
*])`},{character:`*`,inConstruct:`phrasing`,notInConstruct:Xb},{atBreak:!0,character:`+`,after:`(?:[ \r
|
|
167
|
+
])`},{atBreak:!0,character:`-`,after:`(?:[ \r
|
|
168
|
+
-])`},{atBreak:!0,before:`\\d+`,character:`.`,after:`(?:[ \r
|
|
169
|
+
]|$)`},{atBreak:!0,character:`<`,after:`[!/?A-Za-z]`},{character:`<`,after:`[!/?A-Za-z]`,inConstruct:`phrasing`,notInConstruct:Xb},{character:`<`,inConstruct:`destinationLiteral`},{atBreak:!0,character:`=`},{atBreak:!0,character:`>`},{character:`>`,inConstruct:`destinationLiteral`},{atBreak:!0,character:`[`},{character:`[`,inConstruct:`phrasing`,notInConstruct:Xb},{character:`[`,inConstruct:[`label`,`reference`]},{character:`\\`,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:`]`,inConstruct:[`label`,`reference`]},{atBreak:!0,character:`_`},{character:`_`,inConstruct:`phrasing`,notInConstruct:Xb},{atBreak:!0,character:"`"},{character:"`",inConstruct:[`codeFencedLangGraveAccent`,`codeFencedMetaGraveAccent`]},{character:"`",inConstruct:`phrasing`,notInConstruct:Xb},{atBreak:!0,character:`~`}],Qb={AElig:`Æ`,AMP:`&`,Aacute:`Á`,Abreve:`Ă`,Acirc:`Â`,Acy:`А`,Afr:`𝔄`,Agrave:`À`,Alpha:`Α`,Amacr:`Ā`,And:`⩓`,Aogon:`Ą`,Aopf:`𝔸`,ApplyFunction:``,Aring:`Å`,Ascr:`𝒜`,Assign:`≔`,Atilde:`Ã`,Auml:`Ä`,Backslash:`∖`,Barv:`⫧`,Barwed:`⌆`,Bcy:`Б`,Because:`∵`,Bernoullis:`ℬ`,Beta:`Β`,Bfr:`𝔅`,Bopf:`𝔹`,Breve:`˘`,Bscr:`ℬ`,Bumpeq:`≎`,CHcy:`Ч`,COPY:`©`,Cacute:`Ć`,Cap:`⋒`,CapitalDifferentialD:`ⅅ`,Cayleys:`ℭ`,Ccaron:`Č`,Ccedil:`Ç`,Ccirc:`Ĉ`,Cconint:`∰`,Cdot:`Ċ`,Cedilla:`¸`,CenterDot:`·`,Cfr:`ℭ`,Chi:`Χ`,CircleDot:`⊙`,CircleMinus:`⊖`,CirclePlus:`⊕`,CircleTimes:`⊗`,ClockwiseContourIntegral:`∲`,CloseCurlyDoubleQuote:`”`,CloseCurlyQuote:`’`,Colon:`∷`,Colone:`⩴`,Congruent:`≡`,Conint:`∯`,ContourIntegral:`∮`,Copf:`ℂ`,Coproduct:`∐`,CounterClockwiseContourIntegral:`∳`,Cross:`⨯`,Cscr:`𝒞`,Cup:`⋓`,CupCap:`≍`,DD:`ⅅ`,DDotrahd:`⤑`,DJcy:`Ђ`,DScy:`Ѕ`,DZcy:`Џ`,Dagger:`‡`,Darr:`↡`,Dashv:`⫤`,Dcaron:`Ď`,Dcy:`Д`,Del:`∇`,Delta:`Δ`,Dfr:`𝔇`,DiacriticalAcute:`´`,DiacriticalDot:`˙`,DiacriticalDoubleAcute:`˝`,DiacriticalGrave:"`",DiacriticalTilde:`˜`,Diamond:`⋄`,DifferentialD:`ⅆ`,Dopf:`𝔻`,Dot:`¨`,DotDot:`⃜`,DotEqual:`≐`,DoubleContourIntegral:`∯`,DoubleDot:`¨`,DoubleDownArrow:`⇓`,DoubleLeftArrow:`⇐`,DoubleLeftRightArrow:`⇔`,DoubleLeftTee:`⫤`,DoubleLongLeftArrow:`⟸`,DoubleLongLeftRightArrow:`⟺`,DoubleLongRightArrow:`⟹`,DoubleRightArrow:`⇒`,DoubleRightTee:`⊨`,DoubleUpArrow:`⇑`,DoubleUpDownArrow:`⇕`,DoubleVerticalBar:`∥`,DownArrow:`↓`,DownArrowBar:`⤓`,DownArrowUpArrow:`⇵`,DownBreve:`̑`,DownLeftRightVector:`⥐`,DownLeftTeeVector:`⥞`,DownLeftVector:`↽`,DownLeftVectorBar:`⥖`,DownRightTeeVector:`⥟`,DownRightVector:`⇁`,DownRightVectorBar:`⥗`,DownTee:`⊤`,DownTeeArrow:`↧`,Downarrow:`⇓`,Dscr:`𝒟`,Dstrok:`Đ`,ENG:`Ŋ`,ETH:`Ð`,Eacute:`É`,Ecaron:`Ě`,Ecirc:`Ê`,Ecy:`Э`,Edot:`Ė`,Efr:`𝔈`,Egrave:`È`,Element:`∈`,Emacr:`Ē`,EmptySmallSquare:`◻`,EmptyVerySmallSquare:`▫`,Eogon:`Ę`,Eopf:`𝔼`,Epsilon:`Ε`,Equal:`⩵`,EqualTilde:`≂`,Equilibrium:`⇌`,Escr:`ℰ`,Esim:`⩳`,Eta:`Η`,Euml:`Ë`,Exists:`∃`,ExponentialE:`ⅇ`,Fcy:`Ф`,Ffr:`𝔉`,FilledSmallSquare:`◼`,FilledVerySmallSquare:`▪`,Fopf:`𝔽`,ForAll:`∀`,Fouriertrf:`ℱ`,Fscr:`ℱ`,GJcy:`Ѓ`,GT:`>`,Gamma:`Γ`,Gammad:`Ϝ`,Gbreve:`Ğ`,Gcedil:`Ģ`,Gcirc:`Ĝ`,Gcy:`Г`,Gdot:`Ġ`,Gfr:`𝔊`,Gg:`⋙`,Gopf:`𝔾`,GreaterEqual:`≥`,GreaterEqualLess:`⋛`,GreaterFullEqual:`≧`,GreaterGreater:`⪢`,GreaterLess:`≷`,GreaterSlantEqual:`⩾`,GreaterTilde:`≳`,Gscr:`𝒢`,Gt:`≫`,HARDcy:`Ъ`,Hacek:`ˇ`,Hat:`^`,Hcirc:`Ĥ`,Hfr:`ℌ`,HilbertSpace:`ℋ`,Hopf:`ℍ`,HorizontalLine:`─`,Hscr:`ℋ`,Hstrok:`Ħ`,HumpDownHump:`≎`,HumpEqual:`≏`,IEcy:`Е`,IJlig:`IJ`,IOcy:`Ё`,Iacute:`Í`,Icirc:`Î`,Icy:`И`,Idot:`İ`,Ifr:`ℑ`,Igrave:`Ì`,Im:`ℑ`,Imacr:`Ī`,ImaginaryI:`ⅈ`,Implies:`⇒`,Int:`∬`,Integral:`∫`,Intersection:`⋂`,InvisibleComma:``,InvisibleTimes:``,Iogon:`Į`,Iopf:`𝕀`,Iota:`Ι`,Iscr:`ℐ`,Itilde:`Ĩ`,Iukcy:`І`,Iuml:`Ï`,Jcirc:`Ĵ`,Jcy:`Й`,Jfr:`𝔍`,Jopf:`𝕁`,Jscr:`𝒥`,Jsercy:`Ј`,Jukcy:`Є`,KHcy:`Х`,KJcy:`Ќ`,Kappa:`Κ`,Kcedil:`Ķ`,Kcy:`К`,Kfr:`𝔎`,Kopf:`𝕂`,Kscr:`𝒦`,LJcy:`Љ`,LT:`<`,Lacute:`Ĺ`,Lambda:`Λ`,Lang:`⟪`,Laplacetrf:`ℒ`,Larr:`↞`,Lcaron:`Ľ`,Lcedil:`Ļ`,Lcy:`Л`,LeftAngleBracket:`⟨`,LeftArrow:`←`,LeftArrowBar:`⇤`,LeftArrowRightArrow:`⇆`,LeftCeiling:`⌈`,LeftDoubleBracket:`⟦`,LeftDownTeeVector:`⥡`,LeftDownVector:`⇃`,LeftDownVectorBar:`⥙`,LeftFloor:`⌊`,LeftRightArrow:`↔`,LeftRightVector:`⥎`,LeftTee:`⊣`,LeftTeeArrow:`↤`,LeftTeeVector:`⥚`,LeftTriangle:`⊲`,LeftTriangleBar:`⧏`,LeftTriangleEqual:`⊴`,LeftUpDownVector:`⥑`,LeftUpTeeVector:`⥠`,LeftUpVector:`↿`,LeftUpVectorBar:`⥘`,LeftVector:`↼`,LeftVectorBar:`⥒`,Leftarrow:`⇐`,Leftrightarrow:`⇔`,LessEqualGreater:`⋚`,LessFullEqual:`≦`,LessGreater:`≶`,LessLess:`⪡`,LessSlantEqual:`⩽`,LessTilde:`≲`,Lfr:`𝔏`,Ll:`⋘`,Lleftarrow:`⇚`,Lmidot:`Ŀ`,LongLeftArrow:`⟵`,LongLeftRightArrow:`⟷`,LongRightArrow:`⟶`,Longleftarrow:`⟸`,Longleftrightarrow:`⟺`,Longrightarrow:`⟹`,Lopf:`𝕃`,LowerLeftArrow:`↙`,LowerRightArrow:`↘`,Lscr:`ℒ`,Lsh:`↰`,Lstrok:`Ł`,Lt:`≪`,Map:`⤅`,Mcy:`М`,MediumSpace:` `,Mellintrf:`ℳ`,Mfr:`𝔐`,MinusPlus:`∓`,Mopf:`𝕄`,Mscr:`ℳ`,Mu:`Μ`,NJcy:`Њ`,Nacute:`Ń`,Ncaron:`Ň`,Ncedil:`Ņ`,Ncy:`Н`,NegativeMediumSpace:``,NegativeThickSpace:``,NegativeThinSpace:``,NegativeVeryThinSpace:``,NestedGreaterGreater:`≫`,NestedLessLess:`≪`,NewLine:`
|
|
170
|
+
`,Nfr:`𝔑`,NoBreak:``,NonBreakingSpace:`\xA0`,Nopf:`ℕ`,Not:`⫬`,NotCongruent:`≢`,NotCupCap:`≭`,NotDoubleVerticalBar:`∦`,NotElement:`∉`,NotEqual:`≠`,NotEqualTilde:`≂̸`,NotExists:`∄`,NotGreater:`≯`,NotGreaterEqual:`≱`,NotGreaterFullEqual:`≧̸`,NotGreaterGreater:`≫̸`,NotGreaterLess:`≹`,NotGreaterSlantEqual:`⩾̸`,NotGreaterTilde:`≵`,NotHumpDownHump:`≎̸`,NotHumpEqual:`≏̸`,NotLeftTriangle:`⋪`,NotLeftTriangleBar:`⧏̸`,NotLeftTriangleEqual:`⋬`,NotLess:`≮`,NotLessEqual:`≰`,NotLessGreater:`≸`,NotLessLess:`≪̸`,NotLessSlantEqual:`⩽̸`,NotLessTilde:`≴`,NotNestedGreaterGreater:`⪢̸`,NotNestedLessLess:`⪡̸`,NotPrecedes:`⊀`,NotPrecedesEqual:`⪯̸`,NotPrecedesSlantEqual:`⋠`,NotReverseElement:`∌`,NotRightTriangle:`⋫`,NotRightTriangleBar:`⧐̸`,NotRightTriangleEqual:`⋭`,NotSquareSubset:`⊏̸`,NotSquareSubsetEqual:`⋢`,NotSquareSuperset:`⊐̸`,NotSquareSupersetEqual:`⋣`,NotSubset:`⊂⃒`,NotSubsetEqual:`⊈`,NotSucceeds:`⊁`,NotSucceedsEqual:`⪰̸`,NotSucceedsSlantEqual:`⋡`,NotSucceedsTilde:`≿̸`,NotSuperset:`⊃⃒`,NotSupersetEqual:`⊉`,NotTilde:`≁`,NotTildeEqual:`≄`,NotTildeFullEqual:`≇`,NotTildeTilde:`≉`,NotVerticalBar:`∤`,Nscr:`𝒩`,Ntilde:`Ñ`,Nu:`Ν`,OElig:`Œ`,Oacute:`Ó`,Ocirc:`Ô`,Ocy:`О`,Odblac:`Ő`,Ofr:`𝔒`,Ograve:`Ò`,Omacr:`Ō`,Omega:`Ω`,Omicron:`Ο`,Oopf:`𝕆`,OpenCurlyDoubleQuote:`“`,OpenCurlyQuote:`‘`,Or:`⩔`,Oscr:`𝒪`,Oslash:`Ø`,Otilde:`Õ`,Otimes:`⨷`,Ouml:`Ö`,OverBar:`‾`,OverBrace:`⏞`,OverBracket:`⎴`,OverParenthesis:`⏜`,PartialD:`∂`,Pcy:`П`,Pfr:`𝔓`,Phi:`Φ`,Pi:`Π`,PlusMinus:`±`,Poincareplane:`ℌ`,Popf:`ℙ`,Pr:`⪻`,Precedes:`≺`,PrecedesEqual:`⪯`,PrecedesSlantEqual:`≼`,PrecedesTilde:`≾`,Prime:`″`,Product:`∏`,Proportion:`∷`,Proportional:`∝`,Pscr:`𝒫`,Psi:`Ψ`,QUOT:`"`,Qfr:`𝔔`,Qopf:`ℚ`,Qscr:`𝒬`,RBarr:`⤐`,REG:`®`,Racute:`Ŕ`,Rang:`⟫`,Rarr:`↠`,Rarrtl:`⤖`,Rcaron:`Ř`,Rcedil:`Ŗ`,Rcy:`Р`,Re:`ℜ`,ReverseElement:`∋`,ReverseEquilibrium:`⇋`,ReverseUpEquilibrium:`⥯`,Rfr:`ℜ`,Rho:`Ρ`,RightAngleBracket:`⟩`,RightArrow:`→`,RightArrowBar:`⇥`,RightArrowLeftArrow:`⇄`,RightCeiling:`⌉`,RightDoubleBracket:`⟧`,RightDownTeeVector:`⥝`,RightDownVector:`⇂`,RightDownVectorBar:`⥕`,RightFloor:`⌋`,RightTee:`⊢`,RightTeeArrow:`↦`,RightTeeVector:`⥛`,RightTriangle:`⊳`,RightTriangleBar:`⧐`,RightTriangleEqual:`⊵`,RightUpDownVector:`⥏`,RightUpTeeVector:`⥜`,RightUpVector:`↾`,RightUpVectorBar:`⥔`,RightVector:`⇀`,RightVectorBar:`⥓`,Rightarrow:`⇒`,Ropf:`ℝ`,RoundImplies:`⥰`,Rrightarrow:`⇛`,Rscr:`ℛ`,Rsh:`↱`,RuleDelayed:`⧴`,SHCHcy:`Щ`,SHcy:`Ш`,SOFTcy:`Ь`,Sacute:`Ś`,Sc:`⪼`,Scaron:`Š`,Scedil:`Ş`,Scirc:`Ŝ`,Scy:`С`,Sfr:`𝔖`,ShortDownArrow:`↓`,ShortLeftArrow:`←`,ShortRightArrow:`→`,ShortUpArrow:`↑`,Sigma:`Σ`,SmallCircle:`∘`,Sopf:`𝕊`,Sqrt:`√`,Square:`□`,SquareIntersection:`⊓`,SquareSubset:`⊏`,SquareSubsetEqual:`⊑`,SquareSuperset:`⊐`,SquareSupersetEqual:`⊒`,SquareUnion:`⊔`,Sscr:`𝒮`,Star:`⋆`,Sub:`⋐`,Subset:`⋐`,SubsetEqual:`⊆`,Succeeds:`≻`,SucceedsEqual:`⪰`,SucceedsSlantEqual:`≽`,SucceedsTilde:`≿`,SuchThat:`∋`,Sum:`∑`,Sup:`⋑`,Superset:`⊃`,SupersetEqual:`⊇`,Supset:`⋑`,THORN:`Þ`,TRADE:`™`,TSHcy:`Ћ`,TScy:`Ц`,Tab:` `,Tau:`Τ`,Tcaron:`Ť`,Tcedil:`Ţ`,Tcy:`Т`,Tfr:`𝔗`,Therefore:`∴`,Theta:`Θ`,ThickSpace:` `,ThinSpace:` `,Tilde:`∼`,TildeEqual:`≃`,TildeFullEqual:`≅`,TildeTilde:`≈`,Topf:`𝕋`,TripleDot:`⃛`,Tscr:`𝒯`,Tstrok:`Ŧ`,Uacute:`Ú`,Uarr:`↟`,Uarrocir:`⥉`,Ubrcy:`Ў`,Ubreve:`Ŭ`,Ucirc:`Û`,Ucy:`У`,Udblac:`Ű`,Ufr:`𝔘`,Ugrave:`Ù`,Umacr:`Ū`,UnderBar:`_`,UnderBrace:`⏟`,UnderBracket:`⎵`,UnderParenthesis:`⏝`,Union:`⋃`,UnionPlus:`⊎`,Uogon:`Ų`,Uopf:`𝕌`,UpArrow:`↑`,UpArrowBar:`⤒`,UpArrowDownArrow:`⇅`,UpDownArrow:`↕`,UpEquilibrium:`⥮`,UpTee:`⊥`,UpTeeArrow:`↥`,Uparrow:`⇑`,Updownarrow:`⇕`,UpperLeftArrow:`↖`,UpperRightArrow:`↗`,Upsi:`ϒ`,Upsilon:`Υ`,Uring:`Ů`,Uscr:`𝒰`,Utilde:`Ũ`,Uuml:`Ü`,VDash:`⊫`,Vbar:`⫫`,Vcy:`В`,Vdash:`⊩`,Vdashl:`⫦`,Vee:`⋁`,Verbar:`‖`,Vert:`‖`,VerticalBar:`∣`,VerticalLine:`|`,VerticalSeparator:`❘`,VerticalTilde:`≀`,VeryThinSpace:` `,Vfr:`𝔙`,Vopf:`𝕍`,Vscr:`𝒱`,Vvdash:`⊪`,Wcirc:`Ŵ`,Wedge:`⋀`,Wfr:`𝔚`,Wopf:`𝕎`,Wscr:`𝒲`,Xfr:`𝔛`,Xi:`Ξ`,Xopf:`𝕏`,Xscr:`𝒳`,YAcy:`Я`,YIcy:`Ї`,YUcy:`Ю`,Yacute:`Ý`,Ycirc:`Ŷ`,Ycy:`Ы`,Yfr:`𝔜`,Yopf:`𝕐`,Yscr:`𝒴`,Yuml:`Ÿ`,ZHcy:`Ж`,Zacute:`Ź`,Zcaron:`Ž`,Zcy:`З`,Zdot:`Ż`,ZeroWidthSpace:``,Zeta:`Ζ`,Zfr:`ℨ`,Zopf:`ℤ`,Zscr:`𝒵`,aacute:`á`,abreve:`ă`,ac:`∾`,acE:`∾̳`,acd:`∿`,acirc:`â`,acute:`´`,acy:`а`,aelig:`æ`,af:``,afr:`𝔞`,agrave:`à`,alefsym:`ℵ`,aleph:`ℵ`,alpha:`α`,amacr:`ā`,amalg:`⨿`,amp:`&`,and:`∧`,andand:`⩕`,andd:`⩜`,andslope:`⩘`,andv:`⩚`,ang:`∠`,ange:`⦤`,angle:`∠`,angmsd:`∡`,angmsdaa:`⦨`,angmsdab:`⦩`,angmsdac:`⦪`,angmsdad:`⦫`,angmsdae:`⦬`,angmsdaf:`⦭`,angmsdag:`⦮`,angmsdah:`⦯`,angrt:`∟`,angrtvb:`⊾`,angrtvbd:`⦝`,angsph:`∢`,angst:`Å`,angzarr:`⍼`,aogon:`ą`,aopf:`𝕒`,ap:`≈`,apE:`⩰`,apacir:`⩯`,ape:`≊`,apid:`≋`,apos:`'`,approx:`≈`,approxeq:`≊`,aring:`å`,ascr:`𝒶`,ast:`*`,asymp:`≈`,asympeq:`≍`,atilde:`ã`,auml:`ä`,awconint:`∳`,awint:`⨑`,bNot:`⫭`,backcong:`≌`,backepsilon:`϶`,backprime:`‵`,backsim:`∽`,backsimeq:`⋍`,barvee:`⊽`,barwed:`⌅`,barwedge:`⌅`,bbrk:`⎵`,bbrktbrk:`⎶`,bcong:`≌`,bcy:`б`,bdquo:`„`,becaus:`∵`,because:`∵`,bemptyv:`⦰`,bepsi:`϶`,bernou:`ℬ`,beta:`β`,beth:`ℶ`,between:`≬`,bfr:`𝔟`,bigcap:`⋂`,bigcirc:`◯`,bigcup:`⋃`,bigodot:`⨀`,bigoplus:`⨁`,bigotimes:`⨂`,bigsqcup:`⨆`,bigstar:`★`,bigtriangledown:`▽`,bigtriangleup:`△`,biguplus:`⨄`,bigvee:`⋁`,bigwedge:`⋀`,bkarow:`⤍`,blacklozenge:`⧫`,blacksquare:`▪`,blacktriangle:`▴`,blacktriangledown:`▾`,blacktriangleleft:`◂`,blacktriangleright:`▸`,blank:`␣`,blk12:`▒`,blk14:`░`,blk34:`▓`,block:`█`,bne:`=⃥`,bnequiv:`≡⃥`,bnot:`⌐`,bopf:`𝕓`,bot:`⊥`,bottom:`⊥`,bowtie:`⋈`,boxDL:`╗`,boxDR:`╔`,boxDl:`╖`,boxDr:`╓`,boxH:`═`,boxHD:`╦`,boxHU:`╩`,boxHd:`╤`,boxHu:`╧`,boxUL:`╝`,boxUR:`╚`,boxUl:`╜`,boxUr:`╙`,boxV:`║`,boxVH:`╬`,boxVL:`╣`,boxVR:`╠`,boxVh:`╫`,boxVl:`╢`,boxVr:`╟`,boxbox:`⧉`,boxdL:`╕`,boxdR:`╒`,boxdl:`┐`,boxdr:`┌`,boxh:`─`,boxhD:`╥`,boxhU:`╨`,boxhd:`┬`,boxhu:`┴`,boxminus:`⊟`,boxplus:`⊞`,boxtimes:`⊠`,boxuL:`╛`,boxuR:`╘`,boxul:`┘`,boxur:`└`,boxv:`│`,boxvH:`╪`,boxvL:`╡`,boxvR:`╞`,boxvh:`┼`,boxvl:`┤`,boxvr:`├`,bprime:`‵`,breve:`˘`,brvbar:`¦`,bscr:`𝒷`,bsemi:`⁏`,bsim:`∽`,bsime:`⋍`,bsol:`\\`,bsolb:`⧅`,bsolhsub:`⟈`,bull:`•`,bullet:`•`,bump:`≎`,bumpE:`⪮`,bumpe:`≏`,bumpeq:`≏`,cacute:`ć`,cap:`∩`,capand:`⩄`,capbrcup:`⩉`,capcap:`⩋`,capcup:`⩇`,capdot:`⩀`,caps:`∩︀`,caret:`⁁`,caron:`ˇ`,ccaps:`⩍`,ccaron:`č`,ccedil:`ç`,ccirc:`ĉ`,ccups:`⩌`,ccupssm:`⩐`,cdot:`ċ`,cedil:`¸`,cemptyv:`⦲`,cent:`¢`,centerdot:`·`,cfr:`𝔠`,chcy:`ч`,check:`✓`,checkmark:`✓`,chi:`χ`,cir:`○`,cirE:`⧃`,circ:`ˆ`,circeq:`≗`,circlearrowleft:`↺`,circlearrowright:`↻`,circledR:`®`,circledS:`Ⓢ`,circledast:`⊛`,circledcirc:`⊚`,circleddash:`⊝`,cire:`≗`,cirfnint:`⨐`,cirmid:`⫯`,cirscir:`⧂`,clubs:`♣`,clubsuit:`♣`,colon:`:`,colone:`≔`,coloneq:`≔`,comma:`,`,commat:`@`,comp:`∁`,compfn:`∘`,complement:`∁`,complexes:`ℂ`,cong:`≅`,congdot:`⩭`,conint:`∮`,copf:`𝕔`,coprod:`∐`,copy:`©`,copysr:`℗`,crarr:`↵`,cross:`✗`,cscr:`𝒸`,csub:`⫏`,csube:`⫑`,csup:`⫐`,csupe:`⫒`,ctdot:`⋯`,cudarrl:`⤸`,cudarrr:`⤵`,cuepr:`⋞`,cuesc:`⋟`,cularr:`↶`,cularrp:`⤽`,cup:`∪`,cupbrcap:`⩈`,cupcap:`⩆`,cupcup:`⩊`,cupdot:`⊍`,cupor:`⩅`,cups:`∪︀`,curarr:`↷`,curarrm:`⤼`,curlyeqprec:`⋞`,curlyeqsucc:`⋟`,curlyvee:`⋎`,curlywedge:`⋏`,curren:`¤`,curvearrowleft:`↶`,curvearrowright:`↷`,cuvee:`⋎`,cuwed:`⋏`,cwconint:`∲`,cwint:`∱`,cylcty:`⌭`,dArr:`⇓`,dHar:`⥥`,dagger:`†`,daleth:`ℸ`,darr:`↓`,dash:`‐`,dashv:`⊣`,dbkarow:`⤏`,dblac:`˝`,dcaron:`ď`,dcy:`д`,dd:`ⅆ`,ddagger:`‡`,ddarr:`⇊`,ddotseq:`⩷`,deg:`°`,delta:`δ`,demptyv:`⦱`,dfisht:`⥿`,dfr:`𝔡`,dharl:`⇃`,dharr:`⇂`,diam:`⋄`,diamond:`⋄`,diamondsuit:`♦`,diams:`♦`,die:`¨`,digamma:`ϝ`,disin:`⋲`,div:`÷`,divide:`÷`,divideontimes:`⋇`,divonx:`⋇`,djcy:`ђ`,dlcorn:`⌞`,dlcrop:`⌍`,dollar:`$`,dopf:`𝕕`,dot:`˙`,doteq:`≐`,doteqdot:`≑`,dotminus:`∸`,dotplus:`∔`,dotsquare:`⊡`,doublebarwedge:`⌆`,downarrow:`↓`,downdownarrows:`⇊`,downharpoonleft:`⇃`,downharpoonright:`⇂`,drbkarow:`⤐`,drcorn:`⌟`,drcrop:`⌌`,dscr:`𝒹`,dscy:`ѕ`,dsol:`⧶`,dstrok:`đ`,dtdot:`⋱`,dtri:`▿`,dtrif:`▾`,duarr:`⇵`,duhar:`⥯`,dwangle:`⦦`,dzcy:`џ`,dzigrarr:`⟿`,eDDot:`⩷`,eDot:`≑`,eacute:`é`,easter:`⩮`,ecaron:`ě`,ecir:`≖`,ecirc:`ê`,ecolon:`≕`,ecy:`э`,edot:`ė`,ee:`ⅇ`,efDot:`≒`,efr:`𝔢`,eg:`⪚`,egrave:`è`,egs:`⪖`,egsdot:`⪘`,el:`⪙`,elinters:`⏧`,ell:`ℓ`,els:`⪕`,elsdot:`⪗`,emacr:`ē`,empty:`∅`,emptyset:`∅`,emptyv:`∅`,emsp13:` `,emsp14:` `,emsp:` `,eng:`ŋ`,ensp:` `,eogon:`ę`,eopf:`𝕖`,epar:`⋕`,eparsl:`⧣`,eplus:`⩱`,epsi:`ε`,epsilon:`ε`,epsiv:`ϵ`,eqcirc:`≖`,eqcolon:`≕`,eqsim:`≂`,eqslantgtr:`⪖`,eqslantless:`⪕`,equals:`=`,equest:`≟`,equiv:`≡`,equivDD:`⩸`,eqvparsl:`⧥`,erDot:`≓`,erarr:`⥱`,escr:`ℯ`,esdot:`≐`,esim:`≂`,eta:`η`,eth:`ð`,euml:`ë`,euro:`€`,excl:`!`,exist:`∃`,expectation:`ℰ`,exponentiale:`ⅇ`,fallingdotseq:`≒`,fcy:`ф`,female:`♀`,ffilig:`ffi`,fflig:`ff`,ffllig:`ffl`,ffr:`𝔣`,filig:`fi`,fjlig:`fj`,flat:`♭`,fllig:`fl`,fltns:`▱`,fnof:`ƒ`,fopf:`𝕗`,forall:`∀`,fork:`⋔`,forkv:`⫙`,fpartint:`⨍`,frac12:`½`,frac13:`⅓`,frac14:`¼`,frac15:`⅕`,frac16:`⅙`,frac18:`⅛`,frac23:`⅔`,frac25:`⅖`,frac34:`¾`,frac35:`⅗`,frac38:`⅜`,frac45:`⅘`,frac56:`⅚`,frac58:`⅝`,frac78:`⅞`,frasl:`⁄`,frown:`⌢`,fscr:`𝒻`,gE:`≧`,gEl:`⪌`,gacute:`ǵ`,gamma:`γ`,gammad:`ϝ`,gap:`⪆`,gbreve:`ğ`,gcirc:`ĝ`,gcy:`г`,gdot:`ġ`,ge:`≥`,gel:`⋛`,geq:`≥`,geqq:`≧`,geqslant:`⩾`,ges:`⩾`,gescc:`⪩`,gesdot:`⪀`,gesdoto:`⪂`,gesdotol:`⪄`,gesl:`⋛︀`,gesles:`⪔`,gfr:`𝔤`,gg:`≫`,ggg:`⋙`,gimel:`ℷ`,gjcy:`ѓ`,gl:`≷`,glE:`⪒`,gla:`⪥`,glj:`⪤`,gnE:`≩`,gnap:`⪊`,gnapprox:`⪊`,gne:`⪈`,gneq:`⪈`,gneqq:`≩`,gnsim:`⋧`,gopf:`𝕘`,grave:"`",gscr:`ℊ`,gsim:`≳`,gsime:`⪎`,gsiml:`⪐`,gt:`>`,gtcc:`⪧`,gtcir:`⩺`,gtdot:`⋗`,gtlPar:`⦕`,gtquest:`⩼`,gtrapprox:`⪆`,gtrarr:`⥸`,gtrdot:`⋗`,gtreqless:`⋛`,gtreqqless:`⪌`,gtrless:`≷`,gtrsim:`≳`,gvertneqq:`≩︀`,gvnE:`≩︀`,hArr:`⇔`,hairsp:` `,half:`½`,hamilt:`ℋ`,hardcy:`ъ`,harr:`↔`,harrcir:`⥈`,harrw:`↭`,hbar:`ℏ`,hcirc:`ĥ`,hearts:`♥`,heartsuit:`♥`,hellip:`…`,hercon:`⊹`,hfr:`𝔥`,hksearow:`⤥`,hkswarow:`⤦`,hoarr:`⇿`,homtht:`∻`,hookleftarrow:`↩`,hookrightarrow:`↪`,hopf:`𝕙`,horbar:`―`,hscr:`𝒽`,hslash:`ℏ`,hstrok:`ħ`,hybull:`⁃`,hyphen:`‐`,iacute:`í`,ic:``,icirc:`î`,icy:`и`,iecy:`е`,iexcl:`¡`,iff:`⇔`,ifr:`𝔦`,igrave:`ì`,ii:`ⅈ`,iiiint:`⨌`,iiint:`∭`,iinfin:`⧜`,iiota:`℩`,ijlig:`ij`,imacr:`ī`,image:`ℑ`,imagline:`ℐ`,imagpart:`ℑ`,imath:`ı`,imof:`⊷`,imped:`Ƶ`,in:`∈`,incare:`℅`,infin:`∞`,infintie:`⧝`,inodot:`ı`,int:`∫`,intcal:`⊺`,integers:`ℤ`,intercal:`⊺`,intlarhk:`⨗`,intprod:`⨼`,iocy:`ё`,iogon:`į`,iopf:`𝕚`,iota:`ι`,iprod:`⨼`,iquest:`¿`,iscr:`𝒾`,isin:`∈`,isinE:`⋹`,isindot:`⋵`,isins:`⋴`,isinsv:`⋳`,isinv:`∈`,it:``,itilde:`ĩ`,iukcy:`і`,iuml:`ï`,jcirc:`ĵ`,jcy:`й`,jfr:`𝔧`,jmath:`ȷ`,jopf:`𝕛`,jscr:`𝒿`,jsercy:`ј`,jukcy:`є`,kappa:`κ`,kappav:`ϰ`,kcedil:`ķ`,kcy:`к`,kfr:`𝔨`,kgreen:`ĸ`,khcy:`х`,kjcy:`ќ`,kopf:`𝕜`,kscr:`𝓀`,lAarr:`⇚`,lArr:`⇐`,lAtail:`⤛`,lBarr:`⤎`,lE:`≦`,lEg:`⪋`,lHar:`⥢`,lacute:`ĺ`,laemptyv:`⦴`,lagran:`ℒ`,lambda:`λ`,lang:`⟨`,langd:`⦑`,langle:`⟨`,lap:`⪅`,laquo:`«`,larr:`←`,larrb:`⇤`,larrbfs:`⤟`,larrfs:`⤝`,larrhk:`↩`,larrlp:`↫`,larrpl:`⤹`,larrsim:`⥳`,larrtl:`↢`,lat:`⪫`,latail:`⤙`,late:`⪭`,lates:`⪭︀`,lbarr:`⤌`,lbbrk:`❲`,lbrace:`{`,lbrack:`[`,lbrke:`⦋`,lbrksld:`⦏`,lbrkslu:`⦍`,lcaron:`ľ`,lcedil:`ļ`,lceil:`⌈`,lcub:`{`,lcy:`л`,ldca:`⤶`,ldquo:`“`,ldquor:`„`,ldrdhar:`⥧`,ldrushar:`⥋`,ldsh:`↲`,le:`≤`,leftarrow:`←`,leftarrowtail:`↢`,leftharpoondown:`↽`,leftharpoonup:`↼`,leftleftarrows:`⇇`,leftrightarrow:`↔`,leftrightarrows:`⇆`,leftrightharpoons:`⇋`,leftrightsquigarrow:`↭`,leftthreetimes:`⋋`,leg:`⋚`,leq:`≤`,leqq:`≦`,leqslant:`⩽`,les:`⩽`,lescc:`⪨`,lesdot:`⩿`,lesdoto:`⪁`,lesdotor:`⪃`,lesg:`⋚︀`,lesges:`⪓`,lessapprox:`⪅`,lessdot:`⋖`,lesseqgtr:`⋚`,lesseqqgtr:`⪋`,lessgtr:`≶`,lesssim:`≲`,lfisht:`⥼`,lfloor:`⌊`,lfr:`𝔩`,lg:`≶`,lgE:`⪑`,lhard:`↽`,lharu:`↼`,lharul:`⥪`,lhblk:`▄`,ljcy:`љ`,ll:`≪`,llarr:`⇇`,llcorner:`⌞`,llhard:`⥫`,lltri:`◺`,lmidot:`ŀ`,lmoust:`⎰`,lmoustache:`⎰`,lnE:`≨`,lnap:`⪉`,lnapprox:`⪉`,lne:`⪇`,lneq:`⪇`,lneqq:`≨`,lnsim:`⋦`,loang:`⟬`,loarr:`⇽`,lobrk:`⟦`,longleftarrow:`⟵`,longleftrightarrow:`⟷`,longmapsto:`⟼`,longrightarrow:`⟶`,looparrowleft:`↫`,looparrowright:`↬`,lopar:`⦅`,lopf:`𝕝`,loplus:`⨭`,lotimes:`⨴`,lowast:`∗`,lowbar:`_`,loz:`◊`,lozenge:`◊`,lozf:`⧫`,lpar:`(`,lparlt:`⦓`,lrarr:`⇆`,lrcorner:`⌟`,lrhar:`⇋`,lrhard:`⥭`,lrm:``,lrtri:`⊿`,lsaquo:`‹`,lscr:`𝓁`,lsh:`↰`,lsim:`≲`,lsime:`⪍`,lsimg:`⪏`,lsqb:`[`,lsquo:`‘`,lsquor:`‚`,lstrok:`ł`,lt:`<`,ltcc:`⪦`,ltcir:`⩹`,ltdot:`⋖`,lthree:`⋋`,ltimes:`⋉`,ltlarr:`⥶`,ltquest:`⩻`,ltrPar:`⦖`,ltri:`◃`,ltrie:`⊴`,ltrif:`◂`,lurdshar:`⥊`,luruhar:`⥦`,lvertneqq:`≨︀`,lvnE:`≨︀`,mDDot:`∺`,macr:`¯`,male:`♂`,malt:`✠`,maltese:`✠`,map:`↦`,mapsto:`↦`,mapstodown:`↧`,mapstoleft:`↤`,mapstoup:`↥`,marker:`▮`,mcomma:`⨩`,mcy:`м`,mdash:`—`,measuredangle:`∡`,mfr:`𝔪`,mho:`℧`,micro:`µ`,mid:`∣`,midast:`*`,midcir:`⫰`,middot:`·`,minus:`−`,minusb:`⊟`,minusd:`∸`,minusdu:`⨪`,mlcp:`⫛`,mldr:`…`,mnplus:`∓`,models:`⊧`,mopf:`𝕞`,mp:`∓`,mscr:`𝓂`,mstpos:`∾`,mu:`μ`,multimap:`⊸`,mumap:`⊸`,nGg:`⋙̸`,nGt:`≫⃒`,nGtv:`≫̸`,nLeftarrow:`⇍`,nLeftrightarrow:`⇎`,nLl:`⋘̸`,nLt:`≪⃒`,nLtv:`≪̸`,nRightarrow:`⇏`,nVDash:`⊯`,nVdash:`⊮`,nabla:`∇`,nacute:`ń`,nang:`∠⃒`,nap:`≉`,napE:`⩰̸`,napid:`≋̸`,napos:`ʼn`,napprox:`≉`,natur:`♮`,natural:`♮`,naturals:`ℕ`,nbsp:`\xA0`,nbump:`≎̸`,nbumpe:`≏̸`,ncap:`⩃`,ncaron:`ň`,ncedil:`ņ`,ncong:`≇`,ncongdot:`⩭̸`,ncup:`⩂`,ncy:`н`,ndash:`–`,ne:`≠`,neArr:`⇗`,nearhk:`⤤`,nearr:`↗`,nearrow:`↗`,nedot:`≐̸`,nequiv:`≢`,nesear:`⤨`,nesim:`≂̸`,nexist:`∄`,nexists:`∄`,nfr:`𝔫`,ngE:`≧̸`,nge:`≱`,ngeq:`≱`,ngeqq:`≧̸`,ngeqslant:`⩾̸`,nges:`⩾̸`,ngsim:`≵`,ngt:`≯`,ngtr:`≯`,nhArr:`⇎`,nharr:`↮`,nhpar:`⫲`,ni:`∋`,nis:`⋼`,nisd:`⋺`,niv:`∋`,njcy:`њ`,nlArr:`⇍`,nlE:`≦̸`,nlarr:`↚`,nldr:`‥`,nle:`≰`,nleftarrow:`↚`,nleftrightarrow:`↮`,nleq:`≰`,nleqq:`≦̸`,nleqslant:`⩽̸`,nles:`⩽̸`,nless:`≮`,nlsim:`≴`,nlt:`≮`,nltri:`⋪`,nltrie:`⋬`,nmid:`∤`,nopf:`𝕟`,not:`¬`,notin:`∉`,notinE:`⋹̸`,notindot:`⋵̸`,notinva:`∉`,notinvb:`⋷`,notinvc:`⋶`,notni:`∌`,notniva:`∌`,notnivb:`⋾`,notnivc:`⋽`,npar:`∦`,nparallel:`∦`,nparsl:`⫽⃥`,npart:`∂̸`,npolint:`⨔`,npr:`⊀`,nprcue:`⋠`,npre:`⪯̸`,nprec:`⊀`,npreceq:`⪯̸`,nrArr:`⇏`,nrarr:`↛`,nrarrc:`⤳̸`,nrarrw:`↝̸`,nrightarrow:`↛`,nrtri:`⋫`,nrtrie:`⋭`,nsc:`⊁`,nsccue:`⋡`,nsce:`⪰̸`,nscr:`𝓃`,nshortmid:`∤`,nshortparallel:`∦`,nsim:`≁`,nsime:`≄`,nsimeq:`≄`,nsmid:`∤`,nspar:`∦`,nsqsube:`⋢`,nsqsupe:`⋣`,nsub:`⊄`,nsubE:`⫅̸`,nsube:`⊈`,nsubset:`⊂⃒`,nsubseteq:`⊈`,nsubseteqq:`⫅̸`,nsucc:`⊁`,nsucceq:`⪰̸`,nsup:`⊅`,nsupE:`⫆̸`,nsupe:`⊉`,nsupset:`⊃⃒`,nsupseteq:`⊉`,nsupseteqq:`⫆̸`,ntgl:`≹`,ntilde:`ñ`,ntlg:`≸`,ntriangleleft:`⋪`,ntrianglelefteq:`⋬`,ntriangleright:`⋫`,ntrianglerighteq:`⋭`,nu:`ν`,num:`#`,numero:`№`,numsp:` `,nvDash:`⊭`,nvHarr:`⤄`,nvap:`≍⃒`,nvdash:`⊬`,nvge:`≥⃒`,nvgt:`>⃒`,nvinfin:`⧞`,nvlArr:`⤂`,nvle:`≤⃒`,nvlt:`<⃒`,nvltrie:`⊴⃒`,nvrArr:`⤃`,nvrtrie:`⊵⃒`,nvsim:`∼⃒`,nwArr:`⇖`,nwarhk:`⤣`,nwarr:`↖`,nwarrow:`↖`,nwnear:`⤧`,oS:`Ⓢ`,oacute:`ó`,oast:`⊛`,ocir:`⊚`,ocirc:`ô`,ocy:`о`,odash:`⊝`,odblac:`ő`,odiv:`⨸`,odot:`⊙`,odsold:`⦼`,oelig:`œ`,ofcir:`⦿`,ofr:`𝔬`,ogon:`˛`,ograve:`ò`,ogt:`⧁`,ohbar:`⦵`,ohm:`Ω`,oint:`∮`,olarr:`↺`,olcir:`⦾`,olcross:`⦻`,oline:`‾`,olt:`⧀`,omacr:`ō`,omega:`ω`,omicron:`ο`,omid:`⦶`,ominus:`⊖`,oopf:`𝕠`,opar:`⦷`,operp:`⦹`,oplus:`⊕`,or:`∨`,orarr:`↻`,ord:`⩝`,order:`ℴ`,orderof:`ℴ`,ordf:`ª`,ordm:`º`,origof:`⊶`,oror:`⩖`,orslope:`⩗`,orv:`⩛`,oscr:`ℴ`,oslash:`ø`,osol:`⊘`,otilde:`õ`,otimes:`⊗`,otimesas:`⨶`,ouml:`ö`,ovbar:`⌽`,par:`∥`,para:`¶`,parallel:`∥`,parsim:`⫳`,parsl:`⫽`,part:`∂`,pcy:`п`,percnt:`%`,period:`.`,permil:`‰`,perp:`⊥`,pertenk:`‱`,pfr:`𝔭`,phi:`φ`,phiv:`ϕ`,phmmat:`ℳ`,phone:`☎`,pi:`π`,pitchfork:`⋔`,piv:`ϖ`,planck:`ℏ`,planckh:`ℎ`,plankv:`ℏ`,plus:`+`,plusacir:`⨣`,plusb:`⊞`,pluscir:`⨢`,plusdo:`∔`,plusdu:`⨥`,pluse:`⩲`,plusmn:`±`,plussim:`⨦`,plustwo:`⨧`,pm:`±`,pointint:`⨕`,popf:`𝕡`,pound:`£`,pr:`≺`,prE:`⪳`,prap:`⪷`,prcue:`≼`,pre:`⪯`,prec:`≺`,precapprox:`⪷`,preccurlyeq:`≼`,preceq:`⪯`,precnapprox:`⪹`,precneqq:`⪵`,precnsim:`⋨`,precsim:`≾`,prime:`′`,primes:`ℙ`,prnE:`⪵`,prnap:`⪹`,prnsim:`⋨`,prod:`∏`,profalar:`⌮`,profline:`⌒`,profsurf:`⌓`,prop:`∝`,propto:`∝`,prsim:`≾`,prurel:`⊰`,pscr:`𝓅`,psi:`ψ`,puncsp:` `,qfr:`𝔮`,qint:`⨌`,qopf:`𝕢`,qprime:`⁗`,qscr:`𝓆`,quaternions:`ℍ`,quatint:`⨖`,quest:`?`,questeq:`≟`,quot:`"`,rAarr:`⇛`,rArr:`⇒`,rAtail:`⤜`,rBarr:`⤏`,rHar:`⥤`,race:`∽̱`,racute:`ŕ`,radic:`√`,raemptyv:`⦳`,rang:`⟩`,rangd:`⦒`,range:`⦥`,rangle:`⟩`,raquo:`»`,rarr:`→`,rarrap:`⥵`,rarrb:`⇥`,rarrbfs:`⤠`,rarrc:`⤳`,rarrfs:`⤞`,rarrhk:`↪`,rarrlp:`↬`,rarrpl:`⥅`,rarrsim:`⥴`,rarrtl:`↣`,rarrw:`↝`,ratail:`⤚`,ratio:`∶`,rationals:`ℚ`,rbarr:`⤍`,rbbrk:`❳`,rbrace:`}`,rbrack:`]`,rbrke:`⦌`,rbrksld:`⦎`,rbrkslu:`⦐`,rcaron:`ř`,rcedil:`ŗ`,rceil:`⌉`,rcub:`}`,rcy:`р`,rdca:`⤷`,rdldhar:`⥩`,rdquo:`”`,rdquor:`”`,rdsh:`↳`,real:`ℜ`,realine:`ℛ`,realpart:`ℜ`,reals:`ℝ`,rect:`▭`,reg:`®`,rfisht:`⥽`,rfloor:`⌋`,rfr:`𝔯`,rhard:`⇁`,rharu:`⇀`,rharul:`⥬`,rho:`ρ`,rhov:`ϱ`,rightarrow:`→`,rightarrowtail:`↣`,rightharpoondown:`⇁`,rightharpoonup:`⇀`,rightleftarrows:`⇄`,rightleftharpoons:`⇌`,rightrightarrows:`⇉`,rightsquigarrow:`↝`,rightthreetimes:`⋌`,ring:`˚`,risingdotseq:`≓`,rlarr:`⇄`,rlhar:`⇌`,rlm:``,rmoust:`⎱`,rmoustache:`⎱`,rnmid:`⫮`,roang:`⟭`,roarr:`⇾`,robrk:`⟧`,ropar:`⦆`,ropf:`𝕣`,roplus:`⨮`,rotimes:`⨵`,rpar:`)`,rpargt:`⦔`,rppolint:`⨒`,rrarr:`⇉`,rsaquo:`›`,rscr:`𝓇`,rsh:`↱`,rsqb:`]`,rsquo:`’`,rsquor:`’`,rthree:`⋌`,rtimes:`⋊`,rtri:`▹`,rtrie:`⊵`,rtrif:`▸`,rtriltri:`⧎`,ruluhar:`⥨`,rx:`℞`,sacute:`ś`,sbquo:`‚`,sc:`≻`,scE:`⪴`,scap:`⪸`,scaron:`š`,sccue:`≽`,sce:`⪰`,scedil:`ş`,scirc:`ŝ`,scnE:`⪶`,scnap:`⪺`,scnsim:`⋩`,scpolint:`⨓`,scsim:`≿`,scy:`с`,sdot:`⋅`,sdotb:`⊡`,sdote:`⩦`,seArr:`⇘`,searhk:`⤥`,searr:`↘`,searrow:`↘`,sect:`§`,semi:`;`,seswar:`⤩`,setminus:`∖`,setmn:`∖`,sext:`✶`,sfr:`𝔰`,sfrown:`⌢`,sharp:`♯`,shchcy:`щ`,shcy:`ш`,shortmid:`∣`,shortparallel:`∥`,shy:``,sigma:`σ`,sigmaf:`ς`,sigmav:`ς`,sim:`∼`,simdot:`⩪`,sime:`≃`,simeq:`≃`,simg:`⪞`,simgE:`⪠`,siml:`⪝`,simlE:`⪟`,simne:`≆`,simplus:`⨤`,simrarr:`⥲`,slarr:`←`,smallsetminus:`∖`,smashp:`⨳`,smeparsl:`⧤`,smid:`∣`,smile:`⌣`,smt:`⪪`,smte:`⪬`,smtes:`⪬︀`,softcy:`ь`,sol:`/`,solb:`⧄`,solbar:`⌿`,sopf:`𝕤`,spades:`♠`,spadesuit:`♠`,spar:`∥`,sqcap:`⊓`,sqcaps:`⊓︀`,sqcup:`⊔`,sqcups:`⊔︀`,sqsub:`⊏`,sqsube:`⊑`,sqsubset:`⊏`,sqsubseteq:`⊑`,sqsup:`⊐`,sqsupe:`⊒`,sqsupset:`⊐`,sqsupseteq:`⊒`,squ:`□`,square:`□`,squarf:`▪`,squf:`▪`,srarr:`→`,sscr:`𝓈`,ssetmn:`∖`,ssmile:`⌣`,sstarf:`⋆`,star:`☆`,starf:`★`,straightepsilon:`ϵ`,straightphi:`ϕ`,strns:`¯`,sub:`⊂`,subE:`⫅`,subdot:`⪽`,sube:`⊆`,subedot:`⫃`,submult:`⫁`,subnE:`⫋`,subne:`⊊`,subplus:`⪿`,subrarr:`⥹`,subset:`⊂`,subseteq:`⊆`,subseteqq:`⫅`,subsetneq:`⊊`,subsetneqq:`⫋`,subsim:`⫇`,subsub:`⫕`,subsup:`⫓`,succ:`≻`,succapprox:`⪸`,succcurlyeq:`≽`,succeq:`⪰`,succnapprox:`⪺`,succneqq:`⪶`,succnsim:`⋩`,succsim:`≿`,sum:`∑`,sung:`♪`,sup1:`¹`,sup2:`²`,sup3:`³`,sup:`⊃`,supE:`⫆`,supdot:`⪾`,supdsub:`⫘`,supe:`⊇`,supedot:`⫄`,suphsol:`⟉`,suphsub:`⫗`,suplarr:`⥻`,supmult:`⫂`,supnE:`⫌`,supne:`⊋`,supplus:`⫀`,supset:`⊃`,supseteq:`⊇`,supseteqq:`⫆`,supsetneq:`⊋`,supsetneqq:`⫌`,supsim:`⫈`,supsub:`⫔`,supsup:`⫖`,swArr:`⇙`,swarhk:`⤦`,swarr:`↙`,swarrow:`↙`,swnwar:`⤪`,szlig:`ß`,target:`⌖`,tau:`τ`,tbrk:`⎴`,tcaron:`ť`,tcedil:`ţ`,tcy:`т`,tdot:`⃛`,telrec:`⌕`,tfr:`𝔱`,there4:`∴`,therefore:`∴`,theta:`θ`,thetasym:`ϑ`,thetav:`ϑ`,thickapprox:`≈`,thicksim:`∼`,thinsp:` `,thkap:`≈`,thksim:`∼`,thorn:`þ`,tilde:`˜`,times:`×`,timesb:`⊠`,timesbar:`⨱`,timesd:`⨰`,tint:`∭`,toea:`⤨`,top:`⊤`,topbot:`⌶`,topcir:`⫱`,topf:`𝕥`,topfork:`⫚`,tosa:`⤩`,tprime:`‴`,trade:`™`,triangle:`▵`,triangledown:`▿`,triangleleft:`◃`,trianglelefteq:`⊴`,triangleq:`≜`,triangleright:`▹`,trianglerighteq:`⊵`,tridot:`◬`,trie:`≜`,triminus:`⨺`,triplus:`⨹`,trisb:`⧍`,tritime:`⨻`,trpezium:`⏢`,tscr:`𝓉`,tscy:`ц`,tshcy:`ћ`,tstrok:`ŧ`,twixt:`≬`,twoheadleftarrow:`↞`,twoheadrightarrow:`↠`,uArr:`⇑`,uHar:`⥣`,uacute:`ú`,uarr:`↑`,ubrcy:`ў`,ubreve:`ŭ`,ucirc:`û`,ucy:`у`,udarr:`⇅`,udblac:`ű`,udhar:`⥮`,ufisht:`⥾`,ufr:`𝔲`,ugrave:`ù`,uharl:`↿`,uharr:`↾`,uhblk:`▀`,ulcorn:`⌜`,ulcorner:`⌜`,ulcrop:`⌏`,ultri:`◸`,umacr:`ū`,uml:`¨`,uogon:`ų`,uopf:`𝕦`,uparrow:`↑`,updownarrow:`↕`,upharpoonleft:`↿`,upharpoonright:`↾`,uplus:`⊎`,upsi:`υ`,upsih:`ϒ`,upsilon:`υ`,upuparrows:`⇈`,urcorn:`⌝`,urcorner:`⌝`,urcrop:`⌎`,uring:`ů`,urtri:`◹`,uscr:`𝓊`,utdot:`⋰`,utilde:`ũ`,utri:`▵`,utrif:`▴`,uuarr:`⇈`,uuml:`ü`,uwangle:`⦧`,vArr:`⇕`,vBar:`⫨`,vBarv:`⫩`,vDash:`⊨`,vangrt:`⦜`,varepsilon:`ϵ`,varkappa:`ϰ`,varnothing:`∅`,varphi:`ϕ`,varpi:`ϖ`,varpropto:`∝`,varr:`↕`,varrho:`ϱ`,varsigma:`ς`,varsubsetneq:`⊊︀`,varsubsetneqq:`⫋︀`,varsupsetneq:`⊋︀`,varsupsetneqq:`⫌︀`,vartheta:`ϑ`,vartriangleleft:`⊲`,vartriangleright:`⊳`,vcy:`в`,vdash:`⊢`,vee:`∨`,veebar:`⊻`,veeeq:`≚`,vellip:`⋮`,verbar:`|`,vert:`|`,vfr:`𝔳`,vltri:`⊲`,vnsub:`⊂⃒`,vnsup:`⊃⃒`,vopf:`𝕧`,vprop:`∝`,vrtri:`⊳`,vscr:`𝓋`,vsubnE:`⫋︀`,vsubne:`⊊︀`,vsupnE:`⫌︀`,vsupne:`⊋︀`,vzigzag:`⦚`,wcirc:`ŵ`,wedbar:`⩟`,wedge:`∧`,wedgeq:`≙`,weierp:`℘`,wfr:`𝔴`,wopf:`𝕨`,wp:`℘`,wr:`≀`,wreath:`≀`,wscr:`𝓌`,xcap:`⋂`,xcirc:`◯`,xcup:`⋃`,xdtri:`▽`,xfr:`𝔵`,xhArr:`⟺`,xharr:`⟷`,xi:`ξ`,xlArr:`⟸`,xlarr:`⟵`,xmap:`⟼`,xnis:`⋻`,xodot:`⨀`,xopf:`𝕩`,xoplus:`⨁`,xotime:`⨂`,xrArr:`⟹`,xrarr:`⟶`,xscr:`𝓍`,xsqcup:`⨆`,xuplus:`⨄`,xutri:`△`,xvee:`⋁`,xwedge:`⋀`,yacute:`ý`,yacy:`я`,ycirc:`ŷ`,ycy:`ы`,yen:`¥`,yfr:`𝔶`,yicy:`ї`,yopf:`𝕪`,yscr:`𝓎`,yucy:`ю`,yuml:`ÿ`,zacute:`ź`,zcaron:`ž`,zcy:`з`,zdot:`ż`,zeetrf:`ℨ`,zeta:`ζ`,zfr:`𝔷`,zhcy:`ж`,zigrarr:`⇝`,zopf:`𝕫`,zscr:`𝓏`,zwj:``,zwnj:``},$b={}.hasOwnProperty;function ex(e){return $b.call(Qb,e)?Qb[e]:!1}function tx(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}const nx=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function rx(e){return e.replace(nx,ix)}function ix(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return tx(n.slice(t?2:1),t?16:10)}return ex(n)||e}function ax(e){return e.label||!e.identifier?e.label||``:rx(e.identifier)}function ox(e){if(!e._compiled){let t=(e.atBreak?`[\\r\\n][\\t ]*`:``)+(e.before?`(?:`+e.before+`)`:``);e._compiled=RegExp((t?`(`+t+`)`:``)+(/[|\\{}()[\]^$+*?.-]/.test(e.character)?`\\`:``)+e.character+(e.after?`(?:`+e.after+`)`:``),`g`)}return e._compiled}function sx(e,t,n){let r=t.indexStack,i=e.children||[],a=[],o=-1,s=n.before,c;r.push(-1);let l=t.createTracker(n);for(;++o<i.length;){let u=i[o],d;if(r[r.length-1]=o,o+1<i.length){let n=t.handle.handlers[i[o+1].type];n&&n.peek&&(n=n.peek),d=n?n(i[o+1],e,t,{before:``,after:``,...l.current()}).charAt(0):``}else d=n.after;a.length>0&&(s===`\r`||s===`
|
|
171
|
+
`)&&u.type===`html`&&(a[a.length-1]=a[a.length-1].replace(/(\r?\n|\r)$/,` `),s=` `,l=t.createTracker(n),l.move(a.join(``)));let f=t.handle(u,e,t,{...l.current(),after:d,before:s});c&&c===f.slice(0,1)&&(f=ab(c.charCodeAt(0))+f.slice(1));let p=t.attentionEncodeSurroundingInfo;t.attentionEncodeSurroundingInfo=void 0,c=void 0,p&&(a.length>0&&p.before&&s===a[a.length-1].slice(-1)&&(a[a.length-1]=a[a.length-1].slice(0,-1)+ab(s.charCodeAt(0))),p.after&&(c=d)),l.move(f),a.push(f),s=f.slice(-1)}return r.pop(),a.join(``)}function cx(e,t,n){let r=t.indexStack,i=e.children||[],a=t.createTracker(n),o=[],s=-1;for(r.push(-1);++s<i.length;){let n=i[s];r[r.length-1]=s,o.push(a.move(t.handle(n,e,t,{before:`
|
|
172
|
+
`,after:`
|
|
173
|
+
`,...a.current()}))),n.type!==`list`&&(t.bulletLastUsed=void 0),s<i.length-1&&o.push(a.move(lx(n,i[s+1],e,t)))}return r.pop(),o.join(``)}function lx(e,t,n,r){let i=r.join.length;for(;i--;){let a=r.join[i](e,t,n,r);if(a===!0||a===1)break;if(typeof a==`number`)return`
|
|
174
|
+
`.repeat(1+a);if(a===!1)return`
|
|
175
|
+
|
|
176
|
+
<!---->
|
|
177
|
+
|
|
178
|
+
`}return`
|
|
179
|
+
|
|
180
|
+
`}const ux=/\r?\n|\r/g;function dx(e,t){let n=[],r=0,i=0,a;for(;a=ux.exec(e);)o(e.slice(r,a.index)),n.push(a[0]),r=a.index+a[0].length,i++;return o(e.slice(r)),n.join(``);function o(e){n.push(t(e,i,!e))}}function fx(e,t,n){let r=(n.before||``)+(t||``)+(n.after||``),i=[],a=[],o={},s=-1;for(;++s<e.unsafe.length;){let t=e.unsafe[s];if(!Jy(e.stack,t))continue;let n=e.compilePattern(t),a;for(;a=n.exec(r);){let e=`before`in t||!!t.atBreak,n=`after`in t,r=a.index+(e?a[1].length:0);i.includes(r)?(o[r].before&&!e&&(o[r].before=!1),o[r].after&&!n&&(o[r].after=!1)):(i.push(r),o[r]={before:e,after:n})}}i.sort(px);let c=n.before?n.before.length:0,l=r.length-(n.after?n.after.length:0);for(s=-1;++s<i.length;){let e=i[s];e<c||e>=l||e+1<l&&i[s+1]===e+1&&o[e].after&&!o[e+1].before&&!o[e+1].after||i[s-1]===e-1&&o[e].before&&!o[e-1].before&&!o[e-1].after||(c!==e&&a.push(mx(r.slice(c,e),`\\`)),c=e,/[!-/:-@[-`{-~]/.test(r.charAt(e))&&(!n.encode||!n.encode.includes(r.charAt(e)))?a.push(`\\`):(a.push(ab(r.charCodeAt(e))),c++))}return a.push(mx(r.slice(c,l),n.after)),a.join(``)}function px(e,t){return e-t}function mx(e,t){let n=/\\(?=[!-/:-@[-`{-~])/g,r=[],i=[],a=e+t,o=-1,s=0,c;for(;c=n.exec(a);)r.push(c.index);for(;++o<r.length;)s!==r[o]&&i.push(e.slice(s,r[o])),i.push(`\\`),s=r[o];return i.push(e.slice(s)),i.join(``)}function hx(e){let t=e||{},n=t.now||{},r=t.lineShift||0,i=n.line||1,a=n.column||1;return{move:c,current:o,shift:s};function o(){return{now:{line:i,column:a},lineShift:r}}function s(e){r+=e}function c(e){let t=e||``,n=t.split(/\r?\n|\r/g),o=n[n.length-1];return i+=n.length-1,a=n.length===1?a+o.length:1+o.length+r,t}}function gx(e,t){let n=t||{},r={associationId:ax,containerPhrasing:bx,containerFlow:xx,createTracker:hx,compilePattern:ox,enter:a,handlers:{...qb},handle:void 0,indentLines:dx,indexStack:[],join:[...Jb],options:{},safe:Sx,stack:[],unsafe:[...Zb]};Uy(r,n),r.options.tightDefinitions&&r.join.push(yx),r.handle=Vy(`type`,{invalid:_x,unknown:vx,handlers:r.handlers});let i=r.handle(e,void 0,r,{before:`
|
|
181
|
+
`,after:`
|
|
182
|
+
`,now:{line:1,column:1},lineShift:0});return i&&i.charCodeAt(i.length-1)!==10&&i.charCodeAt(i.length-1)!==13&&(i+=`
|
|
183
|
+
`),i;function a(e){return r.stack.push(e),t;function t(){r.stack.pop()}}}function _x(e){throw Error("Cannot handle value `"+e+"`, expected node")}function vx(e){throw Error("Cannot handle unknown node `"+e.type+"`")}function yx(e,t){if(e.type===`definition`&&e.type===t.type)return 0}function bx(e,t){return sx(e,this,t)}function xx(e,t){return cx(e,this,t)}function Sx(e,t){return fx(this,e,t)}function Cx(){return{enter:{table:wx,tableData:Ox,tableHeader:Ox,tableRow:Ex},exit:{codeText:kx,table:Tx,tableData:Dx,tableHeader:Dx,tableRow:Dx}}}function wx(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function Tx(e){this.exit(e),this.data.inTable=void 0}function Ex(e){this.enter({type:`tableRow`,children:[]},e)}function Dx(e){this.exit(e)}function Ox(e){this.enter({type:`tableCell`,children:[]},e)}function kx(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Ax));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Ax(e,t){return t===`|`?t:e}function jx(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
|
|
184
|
+
`,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
|
|
185
|
+
`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return Ly(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=qb.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function Mx(){return{exit:{taskListCheckValueChecked:Px,taskListCheckValueUnchecked:Px,paragraph:Fx}}}function Nx(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:Ix}}}function Px(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function Fx(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function Ix(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=qb.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function Lx(){return[ey(),Ty(),Ay(),Cx(),Mx()]}function Rx(e){return{extensions:[ty(),Ey(e),jy(),jx(e),Nx()]}}function zx(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function Bx(e,t){return e.length>0?(zx(e,e.length,0,t),e):t}const Vx={}.hasOwnProperty;function Hx(e){let t={},n=-1;for(;++n<e.length;)Ux(t,e[n]);return t}function Ux(e,t){let n;for(n in t){let r=(Vx.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){Vx.call(r,a)||(r[a]=[]);let e=i[a];Wx(r[a],Array.isArray(e)?e:e?[e]:[])}}}function Wx(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);zx(e,0,0,r)}const Gx={tokenize:aS,partial:!0},Kx={tokenize:oS,partial:!0},qx={tokenize:sS,partial:!0},Jx={tokenize:cS,partial:!0},Yx={tokenize:lS,partial:!0},Xx={name:`wwwAutolink`,tokenize:rS,previous:uS},Zx={name:`protocolAutolink`,tokenize:iS,previous:dS},Qx={name:`emailAutolink`,tokenize:nS,previous:fS},$x={};function eS(){return{text:$x}}let tS=48;for(;tS<123;)$x[tS]=Qx,tS++,tS===58?tS=65:tS===91&&(tS=97);$x[43]=Qx,$x[45]=Qx,$x[46]=Qx,$x[95]=Qx,$x[72]=[Qx,Zx],$x[104]=[Qx,Zx],$x[87]=[Qx,Xx],$x[119]=[Qx,Xx];function nS(e,t,n){let r=this,i,a;return o;function o(t){return!pS(t)||!fS.call(r,r.previous)||mS(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return pS(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(Yx,u,l)(t):t===45||t===95||Cv(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&Sv(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function rS(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!uS.call(r,r.previous)||mS(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(Gx,e.attempt(Kx,e.attempt(qx,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function iS(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&dS.call(r,r.previous)&&!mS(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(Sv(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||Tv(t)||kv(t)||Mv(t)||jv(t)?n(t):e.attempt(Kx,e.attempt(qx,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function aS(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function oS(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(Jx,c,s)(t):t===null||kv(t)||Mv(t)||t!==45&&jv(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function sS(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(Jx,t,a)(o):o===null||kv(o)||Mv(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function cS(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||kv(o)||Mv(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||kv(e)||Mv(e)?t(e):r(e)}function a(e){return Sv(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):Sv(t)?(e.consume(t),o):n(t)}}function lS(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return Cv(e)?n(e):t(e)}}function uS(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||kv(e)}function dS(e){return!Sv(e)}function fS(e){return!(e===47||pS(e))}function pS(e){return e===43||e===45||e===46||e===95||Cv(e)}function mS(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}function hS(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&Cv(e.charCodeAt(n+1))&&Cv(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function gS(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const _S={name:`attention`,resolveAll:vS,tokenize:yS};function vS(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};bS(d,-c),bS(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=Bx(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=Bx(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=Bx(l,gS(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=Bx(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=Bx(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,zx(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function yS(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=ob(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=ob(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function bS(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const xS={name:`autolink`,tokenize:SS};function SS(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return Sv(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||Cv(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||Cv(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||Tv(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):wv(t)?(e.consume(t),l):n(t)}function u(e){return Cv(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||Cv(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}function CS(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return Av(r)?(e.enter(n),s(r)):t(r)}function s(r){return Av(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}const wS={partial:!0,tokenize:TS};function TS(e,t,n){return r;function r(t){return Av(t)?CS(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||B(e)?t(e):n(e)}}const ES={continuation:{tokenize:OS},exit:kS,name:`blockQuote`,tokenize:DS};function DS(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return Av(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function OS(e,t,n){let r=this;return i;function i(t){return Av(t)?CS(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(ES,t,n)(r)}}function kS(e){e.exit(`blockQuote`)}const AS={name:`characterEscape`,tokenize:jS};function jS(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return Ov(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}const MS={name:`characterReference`,tokenize:NS};function NS(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=Cv,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=Dv,u):(e.enter(`characterReferenceValue`),a=7,o=Ev,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===Cv&&!ex(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}const PS={partial:!0,tokenize:LS},FS={concrete:!0,name:`codeFenced`,tokenize:IS};function IS(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),Av(t)?CS(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||B(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(PS,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||B(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):Av(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),CS(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||B(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||B(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&Av(t)?CS(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||B(t)?e.check(PS,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||B(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),Av(t)?CS(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),Av(t)?CS(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||B(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function LS(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}const RS={name:`codeIndented`,tokenize:BS},zS={partial:!0,tokenize:VS};function BS(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),CS(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):B(t)?e.attempt(zS,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||B(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function VS(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):B(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):CS(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):B(e)?i(e):n(e)}}const HS={name:`codeText`,previous:WS,resolve:US,tokenize:GS};function US(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function WS(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function GS(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):B(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||B(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var KS=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&qS(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),qS(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),qS(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);qS(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);qS(this.left,t.reverse())}}}};function qS(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function JS(e){let t={},n=-1,r,i,a,o,s,c,l,u=new KS(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,YS(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return zx(e,0,1/0,u.slice(0)),!l}function YS(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}const XS={resolve:QS,tokenize:$S},ZS={partial:!0,tokenize:eC};function QS(e){return JS(e),e}function $S(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):B(t)?e.check(ZS,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function eC(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),CS(e,a,`linePrefix`)}function a(i){if(i===null||B(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function tC(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||Tv(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||B(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||kv(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||Tv(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function nC(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):B(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||B(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!Av(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function rC(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):B(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),CS(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||B(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function iC(e,t){let n;return r;function r(i){return B(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):Av(i)?CS(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}const aC={name:`definition`,tokenize:sC},oC={partial:!0,tokenize:cC};function sC(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return nC.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=my(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return kv(t)?iC(e,l)(t):l(t)}function l(t){return tC(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(oC,d,d)(t)}function d(t){return Av(t)?CS(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||B(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function cC(e,t,n){return r;function r(t){return kv(t)?iC(e,i)(t):n(t)}function i(t){return rC(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return Av(t)?CS(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||B(e)?t(e):n(e)}}const lC={name:`hardBreakEscape`,tokenize:uC};function uC(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return B(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}const dC={name:`headingAtx`,resolve:fC,tokenize:pC};function fC(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},zx(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function pC(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||kv(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||B(n)?(e.exit(`atxHeading`),t(n)):Av(n)?CS(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||kv(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}const mC=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),hC=[`pre`,`script`,`style`,`textarea`],gC={concrete:!0,name:`htmlFlow`,resolveTo:yC,tokenize:bC},_C={partial:!0,tokenize:SC},vC={partial:!0,tokenize:xC};function yC(e){let t=e.length;for(;t--&&(e[t][0]!==`enter`||e[t][1].type!==`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function bC(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:ue):Sv(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):Sv(a)?(e.consume(a),i=4,r.interrupt?t:ue):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:ue):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:ne:m):n(i)}function h(t){return Sv(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||kv(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&hC.includes(l)?(i=1,r.interrupt?t(s):ne(s)):mC.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):ne(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||Cv(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:ne):n(i)}function v(t){return Av(t)?(e.consume(t),v):ee(t)}function y(t){return t===47?(e.consume(t),ee):t===58||t===95||Sv(t)?(e.consume(t),b):Av(t)?(e.consume(t),y):ee(t)}function b(t){return t===45||t===46||t===58||t===95||Cv(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):Av(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):Av(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||B(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||kv(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||Av(e)?y(e):n(e)}function ee(t){return t===62?(e.consume(t),te):n(t)}function te(t){return t===null||B(t)?ne(t):Av(t)?(e.consume(t),te):n(t)}function ne(t){return t===45&&i===2?(e.consume(t),oe):t===60&&i===1?(e.consume(t),se):t===62&&i===4?(e.consume(t),E):t===63&&i===3?(e.consume(t),ue):t===93&&i===5?(e.consume(t),le):B(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(_C,de,re)(t)):t===null||B(t)?(e.exit(`htmlFlowData`),re(t)):(e.consume(t),ne)}function re(t){return e.check(vC,ie,de)(t)}function ie(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ae}function ae(t){return t===null||B(t)?re(t):(e.enter(`htmlFlowData`),ne(t))}function oe(t){return t===45?(e.consume(t),ue):ne(t)}function se(t){return t===47?(e.consume(t),o=``,ce):ne(t)}function ce(t){if(t===62){let n=o.toLowerCase();return hC.includes(n)?(e.consume(t),E):ne(t)}return Sv(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),ce):ne(t)}function le(t){return t===93?(e.consume(t),ue):ne(t)}function ue(t){return t===62?(e.consume(t),E):t===45&&i===2?(e.consume(t),ue):ne(t)}function E(t){return t===null||B(t)?(e.exit(`htmlFlowData`),de(t)):(e.consume(t),E)}function de(n){return e.exit(`htmlFlow`),t(n)}}function xC(e,t,n){let r=this;return i;function i(t){return B(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function SC(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(wS,t,n)}}const CC={name:`htmlText`,tokenize:wC};function wC(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):Sv(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):Sv(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):B(t)?(o=d,se(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?oe(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):B(t)?(o=h,se(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?oe(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?oe(t):B(t)?(o=v,se(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):B(t)?(o=y,se(t)):(e.consume(t),y)}function b(e){return e===62?oe(e):y(e)}function x(t){return Sv(t)?(e.consume(t),S):n(t)}function S(t){return t===45||Cv(t)?(e.consume(t),S):C(t)}function C(t){return B(t)?(o=C,se(t)):Av(t)?(e.consume(t),C):oe(t)}function w(t){return t===45||Cv(t)?(e.consume(t),w):t===47||t===62||kv(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),oe):t===58||t===95||Sv(t)?(e.consume(t),ee):B(t)?(o=T,se(t)):Av(t)?(e.consume(t),T):oe(t)}function ee(t){return t===45||t===46||t===58||t===95||Cv(t)?(e.consume(t),ee):te(t)}function te(t){return t===61?(e.consume(t),ne):B(t)?(o=te,se(t)):Av(t)?(e.consume(t),te):T(t)}function ne(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,re):B(t)?(o=ne,se(t)):Av(t)?(e.consume(t),ne):(e.consume(t),ie)}function re(t){return t===i?(e.consume(t),i=void 0,ae):t===null?n(t):B(t)?(o=re,se(t)):(e.consume(t),re)}function ie(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||kv(t)?T(t):(e.consume(t),ie)}function ae(e){return e===47||e===62||kv(e)?T(e):n(e)}function oe(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function se(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ce}function ce(t){return Av(t)?CS(e,le,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):le(t)}function le(t){return e.enter(`htmlTextData`),o(t)}}const TC={name:`labelEnd`,resolveAll:kC,resolveTo:AC,tokenize:jC},EC={tokenize:MC},DC={tokenize:NC},OC={tokenize:PC};function kC(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&zx(e,0,e.length,n),e}function AC(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=Bx(s,e.slice(a+1,a+r+3)),s=Bx(s,[[`enter`,u,t]]),s=Bx(s,gS(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=Bx(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=Bx(s,e.slice(o+1)),s=Bx(s,[[`exit`,c,t]]),zx(e,a,e.length,s),e}function jC(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(my(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(EC,u,o?u:d)(t):t===91?e.attempt(DC,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(OC,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function MC(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return kv(t)?iC(e,a)(t):a(t)}function a(t){return t===41?u(t):tC(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return kv(t)?iC(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?rC(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return kv(t)?iC(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function NC(e,t,n){let r=this;return i;function i(t){return nC.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(my(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function PC(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}const FC={name:`labelStartImage`,resolveAll:TC.resolveAll,tokenize:IC};function IC(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}const LC={name:`labelStartLink`,resolveAll:TC.resolveAll,tokenize:RC};function RC(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}const zC={name:`lineEnding`,tokenize:BC};function BC(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),CS(e,t,`linePrefix`)}}const VC={name:`thematicBreak`,tokenize:HC};function HC(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||B(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),Av(t)?CS(e,s,`whitespace`)(t):s(t))}}const UC={continuation:{tokenize:qC},exit:YC,name:`list`,tokenize:KC},WC={partial:!0,tokenize:XC},GC={partial:!0,tokenize:JC};function KC(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:Ev(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(VC,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return Ev(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(wS,r.interrupt?n:u,e.attempt(WC,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return Av(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function qC(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(wS,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,CS(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!Av(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(GC,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,CS(e,e.attempt(UC,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function JC(e,t,n){let r=this;return CS(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function YC(e){e.exit(this.containerState.type)}function XC(e,t,n){let r=this;return CS(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!Av(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}const ZC={name:`setextUnderline`,resolveTo:QC,tokenize:$C};function QC(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function $C(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),Av(t)?CS(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||B(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}const ew={tokenize:cw,partial:!0};function tw(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:aw,continuation:{tokenize:ow},exit:sw}},text:{91:{name:`gfmFootnoteCall`,tokenize:iw},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:nw,resolveTo:rw}}}}function nw(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=my(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function rw(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function iw(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||kv(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(my(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return kv(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function aw(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||kv(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=my(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return kv(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),CS(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function ow(e,t,n){return e.check(wS,t,e.attempt(ew,t,n))}function sw(e){e.exit(`gfmFootnoteDefinition`)}function cw(e,t,n){let r=this;return CS(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function lw(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&zx(o,o.length,0,gS(s,e.slice(r+1,n),t)),zx(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),zx(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=ob(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=ob(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var uw=class{constructor(){this.map=[]}add(e,t,n){dw(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function dw(e,t,n,r){let i=0;if(n!==0||r.length!==0){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function fw(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function pw(){return{flow:{null:{name:`table`,tokenize:mw,resolveAll:hw}}}}function mw(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):B(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):Av(t)?CS(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||kv(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,Av(t)?CS(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return Av(t)?CS(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||B(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return Av(t)?CS(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||B(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||B(n)?(e.exit(`tableRow`),t(n)):Av(n)?CS(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||kv(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function hw(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new uw;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(_w(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=gw(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=gw(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=gw(f,t,o,i,n,d)):(o[0]=o[1],d=gw(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&_w(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=fw(t.events,n))}return e}function gw(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},vw(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=vw(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=vw(t.events,n[2]),a=vw(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},vw(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function _w(e,t,n,r,i){let a=[],o=vw(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function vw(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}const yw={name:`tasklistCheck`,tokenize:xw};function bw(){return{text:{91:yw}}}function xw(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return kv(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return B(r)?t(r):Av(r)?e.check({tokenize:Sw},t,n)(r):n(r)}}function Sw(e,t,n){return CS(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function Cw(e){return Hx([eS(),tw(),lw(e),pw(),bw()])}const ww={};function Tw(e){let t=this,n=e||ww,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(Cw(n)),a.push(Lx()),o.push(Rx(n))}function Ew(e){if(e)throw e}var Dw=t(r(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}))(),1);function Ow(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function kw(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?Aw(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function Aw(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}function jw(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?Nw(e.position):`start`in e||`end`in e?Nw(e):`line`in e||`column`in e?Mw(e):``}function Mw(e){return Pw(e&&e.line)+`:`+Pw(e&&e.column)}function Nw(e){return Mw(e&&e.start)+`-`+Mw(e&&e.end)}function Pw(e){return e&&typeof e==`number`?e:1}var Fw=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=jw(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};Fw.prototype.file=``,Fw.prototype.name=``,Fw.prototype.reason=``,Fw.prototype.message=``,Fw.prototype.stack=``,Fw.prototype.column=void 0,Fw.prototype.line=void 0,Fw.prototype.ancestors=void 0,Fw.prototype.cause=void 0,Fw.prototype.fatal=void 0,Fw.prototype.place=void 0,Fw.prototype.ruleId=void 0,Fw.prototype.source=void 0;function Iw(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}const Lw=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`];var Rw=class{constructor(e){let t;t=e?Iw(e)?{path:e}:typeof e==`string`||Hw(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:x.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<Lw.length;){let e=Lw[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)Lw.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?b.basename(this.path):void 0}set basename(e){Bw(e,`basename`),zw(e,`basename`),this.path=b.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?b.dirname(this.path):void 0}set dirname(e){Vw(this.basename,`dirname`),this.path=b.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?b.extname(this.path):void 0}set extname(e){if(zw(e,`extname`),Vw(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=b.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){Iw(e)&&(e=y(e)),Bw(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?b.basename(this.path,this.extname):void 0}set stem(e){Bw(e,`stem`),zw(e,`stem`),this.path=b.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new Fw(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function zw(e,t){if(e&&e.includes(b.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+b.sep+"`")}function Bw(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function Vw(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function Hw(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}const Uw=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),Ww={}.hasOwnProperty,Gw=new class e extends Uw{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=kw()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,Dw.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(Jw(`data`,this.frozen),this.namespace[e]=t,this):Ww.call(this.namespace,e)&&this.namespace[e]||void 0:e?(Jw(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=Zw(e),n=this.parser||this.Parser;return Kw(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),Kw(`process`,this.parser||this.Parser),qw(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=Zw(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);$w(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),Kw(`processSync`,this.parser||this.Parser),qw(`processSync`,this.compiler||this.Compiler),this.process(e,r),Xw(`processSync`,`process`,t),n;function r(e,r){t=!0,Ew(e),n=r}}run(e,t,n){Yw(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=Zw(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),Xw(`runSync`,`run`,n),r;function i(e,t){Ew(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=Zw(t),r=this.compiler||this.Compiler;return qw(`stringify`,r),Yw(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(Jw(`use`,this.frozen),e!=null){if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`")}return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`){if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e)}else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,Dw.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null){if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];Ow(o)&&Ow(r)&&(r=(0,Dw.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function Kw(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function qw(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function Jw(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Yw(e){if(!Ow(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function Xw(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function Zw(e){return Qw(e)?e:new Rw(e)}function Qw(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function $w(e){return typeof e==`string`||eT(e)}function eT(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var tT=t(r(((e,t)=>{(function(){var e=t===void 0?function(){return this||(0,eval)(`this`)}():t.exports=i;e.format=i,e.vsprintf=r,typeof console<`u`&&typeof console.log==`function`&&(e.printf=n);function n(){console.log(i.apply(null,arguments))}function r(e,t){return i.apply(null,[e].concat(t))}function i(e){for(var t=1,n=[].slice.call(arguments),r=0,i=e.length,a=``,o,s=!1,c,l,u=!1,d,f=function(){return n[t++]},p=function(){for(var t=``;/\d/.test(e[r]);)t+=e[r++],o=e[r];return t.length>0?parseInt(t):null};r<i;++r)if(o=e[r],s)switch(s=!1,o==`.`?(u=!1,o=e[++r]):o==`0`&&e[r+1]==`.`?(u=!0,r+=2,o=e[r]):u=!0,d=p(),o){case`b`:a+=parseInt(f(),10).toString(2);break;case`c`:c=f(),typeof c==`string`||c instanceof String?a+=c:a+=String.fromCharCode(parseInt(c,10));break;case`d`:a+=parseInt(f(),10);break;case`f`:l=String(parseFloat(f()).toFixed(d||6)),a+=u?l:l.replace(/^0/,``);break;case`j`:a+=JSON.stringify(f());break;case`o`:a+=`0`+parseInt(f(),10).toString(8);break;case`s`:a+=f();break;case`x`:a+=`0x`+parseInt(f(),10).toString(16);break;case`X`:a+=`0x`+parseInt(f(),10).toString(16).toUpperCase();break;default:a+=o}else o===`%`?s=!0:a+=o;return a}})()}))(),1);const nT=Object.assign(rT(Error),{eval:rT(EvalError),range:rT(RangeError),reference:rT(ReferenceError),syntax:rT(SyntaxError),type:rT(TypeError),uri:rT(URIError)});function rT(e){return t.displayName=e.displayName||e.name,t;function t(t,...n){return new e(t&&(0,tT.default)(t,...n))}}const iT={}.hasOwnProperty,aT={yaml:`-`,toml:`+`};function oT(e){let t=[],n=-1,r=Array.isArray(e)?e:e?[e]:[`yaml`];for(;++n<r.length;)t[n]=sT(r[n]);return t}function sT(e){let t=e;if(typeof t==`string`){if(!iT.call(aT,t))throw nT("Missing matter definition for `%s`",t);t={type:t,marker:aT[t]}}else if(typeof t!=`object`)throw nT("Expected matter to be an object, not `%j`",t);if(!iT.call(t,`type`))throw nT("Missing `type` in matter `%j`",t);if(!iT.call(t,`fence`)&&!iT.call(t,`marker`))throw nT("Missing `marker` or `fence` in matter `%j`",t);return t}function cT(e){let t=oT(e),n={},r=-1;for(;++r<t.length;){let e=t[r],i=uT(e,`open`).charCodeAt(0),a=lT(e),o=n[i];Array.isArray(o)?o.push(a):n[i]=[a]}return{flow:n}}function lT(e){let t=e.anywhere,n=e.type,r=n+`Fence`,i=r+`Sequence`,a=n+`Value`,o={tokenize:u,partial:!0},s,c=0;return{tokenize:l,concrete:!0};function l(l,u,d){let f=this;return p;function p(a){let o=f.now();return o.column===1&&(o.line===1||t)&&(s=uT(e,`open`),c=0,a===s.charCodeAt(c))?(l.enter(n),l.enter(r),l.enter(i),m(a)):d(a)}function m(e){return c===s.length?(l.exit(i),Av(e)?(l.enter(`whitespace`),h(e)):g(e)):e===s.charCodeAt(c++)?(l.consume(e),m):d(e)}function h(e){return Av(e)?(l.consume(e),h):(l.exit(`whitespace`),g(e))}function g(t){return B(t)?(l.exit(r),l.enter(`lineEnding`),l.consume(t),l.exit(`lineEnding`),s=uT(e,`close`),c=0,l.attempt(o,b,_)):d(t)}function _(e){return e===null||B(e)?y(e):(l.enter(a),v(e))}function v(e){return e===null||B(e)?(l.exit(a),y(e)):(l.consume(e),v)}function y(e){return e===null?d(e):(l.enter(`lineEnding`),l.consume(e),l.exit(`lineEnding`),l.attempt(o,b,_))}function b(e){return l.exit(n),u(e)}}function u(e,t,n){let a=0;return o;function o(t){return t===s.charCodeAt(a)?(e.enter(r),e.enter(i),c(t)):n(t)}function c(t){return a===s.length?(e.exit(i),Av(t)?(e.enter(`whitespace`),l(t)):u(t)):t===s.charCodeAt(a++)?(e.consume(t),c):n(t)}function l(t){return Av(t)?(e.consume(t),l):(e.exit(`whitespace`),u(t))}function u(i){return i===null||B(i)?(e.exit(r),t(i)):n(i)}}}function uT(e,t){return e.marker?dT(e.marker,t).repeat(3):dT(e.fence,t)}function dT(e,t){return typeof e==`string`?e:e[t]}function fT(e){let t=oT(e),n={},r={},i=-1;for(;++i<t.length;){let e=t[i];n[e.type]=pT(e),r[e.type]=mT,r[e.type+`Value`]=hT}return{enter:n,exit:r}}function pT(e){return t;function t(t){this.enter({type:e.type,value:``},t),this.buffer()}}function mT(e){let t=this.resume(),n=this.stack[this.stack.length-1];`value`in n,this.exit(e),n.value=t.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``)}function hT(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function gT(e){let t=[],n={},r=oT(e),i=-1;for(;++i<r.length;){let e=r[i];n[e.type]=_T(e);let a=vT(e,`open`);t.push({atBreak:!0,character:a.charAt(0),after:Pv(a.charAt(1))})}return{unsafe:t,handlers:n}}function _T(e){let t=vT(e,`open`),n=vT(e,`close`);return r;function r(e){return t+(e.value?`
|
|
186
|
+
`+e.value:``)+`
|
|
187
|
+
`+n}}function vT(e,t){return e.marker?yT(e.marker,t).repeat(3):yT(e.fence,t)}function yT(e,t){return typeof e==`string`?e:e[t]}function bT(e){let t=this,n=e||`yaml`,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(cT(n)),a.push(fT(n)),o.push(gT(n))}const xT={tokenize:ST};function ST(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),CS(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return B(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}const CT={tokenize:TT},wT={tokenize:ET};function TT(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return zx(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(wT,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(wT,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return B(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;zx(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function ET(e,t,n){return CS(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}const DT={tokenize:OT};function OT(e){let t=this,n=e.attempt(wS,r,e.attempt(this.parser.constructs.flowInitial,i,CS(e,e.attempt(this.parser.constructs.flow,i,e.attempt(XS,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}const kT={resolveAll:NT()},AT=MT(`string`),jT=MT(`text`);function MT(e){return{resolveAll:NT(e===`text`?PT:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function NT(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function PT(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var FT=n({attentionMarkers:()=>UT,contentInitial:()=>LT,disable:()=>WT,document:()=>IT,flow:()=>zT,flowInitial:()=>RT,insideSpan:()=>HT,string:()=>BT,text:()=>VT});const IT={42:UC,43:UC,45:UC,48:UC,49:UC,50:UC,51:UC,52:UC,53:UC,54:UC,55:UC,56:UC,57:UC,62:ES},LT={91:aC},RT={[-2]:RS,[-1]:RS,32:RS},zT={35:dC,42:VC,45:[ZC,VC],60:gC,61:ZC,95:VC,96:FS,126:FS},BT={38:MS,92:AS},VT={[-5]:zC,[-4]:zC,[-3]:zC,33:FC,38:MS,42:_S,60:[xS,CC],91:LC,92:[lC,AS],93:TC,95:_S,96:HS},HT={null:[_S,kT]},UT={null:[42,95]},WT={null:[]};function GT(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=Bx(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=gS(a,l.events,l),l.events):[]}function f(e,t){return qT(p(e),t)}function p(e){return KT(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,ee()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){B(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,ee()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&zx(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,ee()}}function ee(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function KT(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function qT(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
|
|
188
|
+
`;break;case-3:o=`\r
|
|
189
|
+
`;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function JT(e){let t={constructs:Hx([FT,...(e||{}).extensions||[]]),content:n(xT),defined:[],document:n(CT),flow:n(DT),lazy:{},string:n(AT),text:n(jT)};return t;function n(e){return n;function n(n){return GT(t,e,n)}}}function YT(e){for(;!JS(e););return e}const XT=/[\0\t\n\r]/g;function ZT(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(XT.lastIndex=u,c=XT.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}const QT={}.hasOwnProperty;function $T(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),eE(n)(YT(JT(n).document().write(ZT()(e,t,!0))))}function eE(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(Te),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(Se),blockQuote:a(_e),characterEscape:T,characterReference:T,codeFenced:a(ve),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(ve,o),codeText:a(ye,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(be),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(xe),hardBreakEscape:a(Ce),hardBreakTrailing:a(Ce),htmlFlow:a(we,o),htmlFlowData:T,htmlText:a(we,o),htmlTextData:T,image:a(k),label:o,link:a(Te),listItem:a(De),listItemValue:f,listOrdered:a(Ee,d),listUnordered:a(Ee),paragraph:a(Oe),reference:fe,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(Se),strong:a(ke),thematicBreak:a(je)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:ge,autolinkProtocol:he,blockQuote:c(),characterEscapeValue:ee,characterReferenceMarkerHexadecimal:D,characterReferenceMarkerNumeric:D,characterReferenceValue:O,characterReference:me,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:ee,codeIndented:c(_),codeText:c(ae),codeTextData:ee,data:ee,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(ne),hardBreakTrailing:c(ne),htmlFlow:c(re),htmlFlowData:ee,htmlText:c(ie),htmlTextData:ee,image:c(se),label:le,labelText:ce,lineEnding:te,link:c(oe),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:pe,resourceDestinationString:ue,resourceTitleString:E,resource:de,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};nE(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];QT.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||iE).call(a,void 0,e[0])}for(r.position={start:tE(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:tE(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:tE(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||iE).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+jw({start:e.start,end:e.end})+`): it’s not open`);n.position.end=tE(e.end)}function u(){return fb(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=my(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=Ae(),n.position={start:tE(e.start),end:void 0},t.push(n)),this.stack.push(n)}function ee(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=tE(e.end)}function te(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=tE(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),ee.call(this,e))}function ne(){this.data.atHardBreak=!0}function re(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ie(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ae(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function oe(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function se(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function ce(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=rx(t),n.identifier=my(t).toLowerCase()}function le(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function ue(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function E(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function de(){this.data.inReference=void 0}function fe(){this.data.referenceType=`collapsed`}function pe(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=my(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function D(e){this.data.characterReferenceType=e.type}function O(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=tx(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=ex(t);let i=this.stack[this.stack.length-1];i.value+=r}function me(e){let t=this.stack.pop();t.position.end=tE(e.end)}function he(e){ee.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function ge(e){ee.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function _e(){return{type:`blockquote`,children:[]}}function ve(){return{type:`code`,lang:null,meta:null,value:``}}function ye(){return{type:`inlineCode`,value:``}}function be(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function xe(){return{type:`emphasis`,children:[]}}function Se(){return{type:`heading`,depth:0,children:[]}}function Ce(){return{type:`break`}}function we(){return{type:`html`,value:``}}function k(){return{type:`image`,title:null,url:``,alt:null}}function Te(){return{type:`link`,title:null,url:``,children:[]}}function Ee(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function De(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function Oe(){return{type:`paragraph`,children:[]}}function ke(){return{type:`strong`,children:[]}}function Ae(){return{type:`text`,value:``}}function je(){return{type:`thematicBreak`}}}function tE(e){return{line:e.line,column:e.column,offset:e.offset}}function nE(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?nE(e,r):rE(e,r)}}function rE(e,t){let n;for(n in t)if(QT.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function iE(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+jw({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+jw({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+jw({start:t.start,end:t.end})+`) is still open`)}function aE(e){let t=this;t.parser=n;function n(n){return $T(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}var oE=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;var t=class{};e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var n=class extends t{constructor(t){if(super(),!e.IDENTIFIER.test(t))throw Error(`CodeGen: name must be a valid identifier`);this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};e.Name=n;var r=class extends t{constructor(e){super(),this._items=typeof e==`string`?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===``||e===`""`}get str(){return this._str??=this._items.reduce((e,t)=>`${e}${t}`,``)}get names(){return this._names??=this._items.reduce((e,t)=>(t instanceof n&&(e[t.str]=(e[t.str]||0)+1),e),{})}};e._Code=r,e.nil=new r(``);function i(e,...t){let n=[e[0]],i=0;for(;i<t.length;)s(n,t[i]),n.push(e[++i]);return new r(n)}e._=i;let a=new r(`+`);function o(e,...t){let n=[p(e[0])],i=0;for(;i<t.length;)n.push(a),s(n,t[i]),n.push(a,p(e[++i]));return c(n),new r(n)}e.str=o;function s(e,t){t instanceof r?e.push(...t._items):t instanceof n?e.push(t):e.push(d(t))}e.addCodeArg=s;function c(e){let t=1;for(;t<e.length-1;){if(e[t]===a){let n=l(e[t-1],e[t+1]);if(n!==void 0){e.splice(t-1,3,n);continue}e[t++]=`+`}t++}}function l(e,t){if(t===`""`)return e;if(e===`""`)return t;if(typeof e==`string`)return t instanceof n||e[e.length-1]!==`"`?void 0:typeof t==`string`?t[0]===`"`?e.slice(0,-1)+t.slice(1):void 0:`${e.slice(0,-1)}${t}"`;if(typeof t==`string`&&t[0]===`"`&&!(e instanceof n))return`"${e}${t.slice(1)}`}function u(e,t){return t.emptyStr()?e:e.emptyStr()?t:o`${e}${t}`}e.strConcat=u;function d(e){return typeof e==`number`||typeof e==`boolean`||e===null?e:p(Array.isArray(e)?e.join(`,`):e)}function f(e){return new r(p(e))}e.stringify=f;function p(e){return JSON.stringify(e).replace(/\u2028/g,`\\u2028`).replace(/\u2029/g,`\\u2029`)}e.safeStringify=p;function m(t){return typeof t==`string`&&e.IDENTIFIER.test(t)?new r(`.${t}`):i`[${t}]`}e.getProperty=m;function h(t){if(typeof t==`string`&&e.IDENTIFIER.test(t))return new r(`${t}`);throw Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}e.getEsmExportName=h;function g(e){return new r(e.toString())}e.regexpCode=g})),sE=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;let t=oE();var n=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},r;(function(e){e[e.Started=0]=`Started`,e[e.Completed=1]=`Completed`})(r||(e.UsedValueState=r={})),e.varKinds={const:new t.Name(`const`),let:new t.Name(`let`),var:new t.Name(`var`)};var i=class{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof t.Name?e:this.name(e)}name(e){return new t.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){if((this._parent?._prefixes)?.has(e)||this._prefixes&&!this._prefixes.has(e))throw Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};e.Scope=i;var a=class extends t.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:n,itemIndex:r}){this.value=e,this.scopePath=(0,t._)`.${new t.Name(n)}[${r}]`}};e.ValueScopeName=a;let o=(0,t._)`\n`;e.ValueScope=class extends i{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?o:t.nil}}get(){return this._scope}name(e){return new a(e,this._newName(e))}value(e,t){if(t.ref===void 0)throw Error(`CodeGen: ref must be passed in value`);let n=this.toName(e),{prefix:r}=n,i=t.key??t.ref,a=this._values[r];if(a){let e=a.get(i);if(e)return e}else a=this._values[r]=new Map;a.set(i,n);let o=this._scope[r]||(this._scope[r]=[]),s=o.length;return o[s]=t.ref,n.setValue(t,{property:r,itemIndex:s}),n}getValue(e,t){let n=this._values[e];if(n)return n.get(t)}scopeRefs(e,n=this._values){return this._reduceValues(n,n=>{if(n.scopePath===void 0)throw Error(`CodeGen: name "${n}" has no value`);return(0,t._)`${e}${n.scopePath}`})}scopeCode(e=this._values,t,n){return this._reduceValues(e,e=>{if(e.value===void 0)throw Error(`CodeGen: name "${e}" has no value`);return e.value.code},t,n)}_reduceValues(i,a,o={},s){let c=t.nil;for(let l in i){let u=i[l];if(!u)continue;let d=o[l]=o[l]||new Map;u.forEach(i=>{if(d.has(i))return;d.set(i,r.Started);let o=a(i);if(o){let n=this.opts.es5?e.varKinds.var:e.varKinds.const;c=(0,t._)`${c}${n} ${i} = ${o};${this.opts._n}`}else if(o=s?.(i))c=(0,t._)`${c}${o}${this.opts._n}`;else throw new n(i);d.set(i,r.Completed)})}return c}}})),cE=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;let t=oE(),n=sE();var r=oE();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return r.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return r.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return r.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}});var i=sE();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return i.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return i.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return i.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return i.varKinds}}),e.operators={GT:new t._Code(`>`),GTE:new t._Code(`>=`),LT:new t._Code(`<`),LTE:new t._Code(`<=`),EQ:new t._Code(`===`),NEQ:new t._Code(`!==`),NOT:new t._Code(`!`),OR:new t._Code(`||`),AND:new t._Code(`&&`),ADD:new t._Code(`+`)};var a=class{optimizeNodes(){return this}optimizeNames(e,t){return this}},o=class extends a{constructor(e,t,n){super(),this.varKind=e,this.name=t,this.rhs=n}render({es5:e,_n:t}){let r=e?n.varKinds.var:this.varKind,i=this.rhs===void 0?``:` = ${this.rhs}`;return`${r} ${this.name}${i};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&=re(this.rhs,e,t),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}},s=class extends a{constructor(e,t,n){super(),this.lhs=e,this.rhs=t,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,n){if(!(this.lhs instanceof t.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=re(this.rhs,e,n),this}get names(){return ne(this.lhs instanceof t.Name?{}:{...this.lhs.names},this.rhs)}},c=class extends s{constructor(e,t,n,r){super(e,n,r),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},l=class extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},u=class extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:``};`+e}},d=class extends a{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},f=class extends a{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=re(this.code,e,t),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}},p=class extends a{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((t,n)=>t+n.render(e),``)}optimizeNodes(){let{nodes:e}=this,t=e.length;for(;t--;){let n=e[t].optimizeNodes();Array.isArray(n)?e.splice(t,1,...n):n?e[t]=n:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:n}=this,r=n.length;for(;r--;){let i=n[r];i.optimizeNames(e,t)||(ie(e,i.names),n.splice(r,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>te(e,t.names),{})}},m=class extends p{render(e){return`{`+e._n+super.render(e)+`}`+e._n}},h=class extends p{},g=class extends m{};g.kind=`else`;var _=class e extends m{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+=`else `+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let n=this.else;if(n){let e=n.optimizeNodes();n=this.else=Array.isArray(e)?new g(e):e}if(n)return t===!1?n instanceof e?n:n.nodes:this.nodes.length?this:new e(ae(t),n instanceof e?[n]:n.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(e,t){if(this.else=this.else?.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=re(this.condition,e,t),this}get names(){let e=super.names;return ne(e,this.condition),this.else&&te(e,this.else.names),e}};_.kind=`if`;var v=class extends m{};v.kind=`for`;var y=class extends v{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=re(this.iteration,e,t),this}get names(){return te(super.names,this.iteration.names)}},b=class extends v{constructor(e,t,n,r){super(),this.varKind=e,this.name=t,this.from=n,this.to=r}render(e){let t=e.es5?n.varKinds.var:this.varKind,{name:r,from:i,to:a}=this;return`for(${t} ${r}=${i}; ${r}<${a}; ${r}++)`+super.render(e)}get names(){return ne(ne(super.names,this.from),this.to)}},x=class extends v{constructor(e,t,n,r){super(),this.loop=e,this.varKind=t,this.name=n,this.iterable=r}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=re(this.iterable,e,t),this}get names(){return te(super.names,this.iterable.names)}},S=class extends m{constructor(e,t,n){super(),this.name=e,this.args=t,this.async=n}render(e){return`${this.async?`async `:``}function ${this.name}(${this.args})`+super.render(e)}};S.kind=`func`;var C=class extends p{render(e){return`return `+super.render(e)}};C.kind=`return`;var w=class extends m{render(e){let t=`try`+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),(e=this.catch)==null||e.optimizeNodes(),(t=this.finally)==null||t.optimizeNodes(),this}optimizeNames(e,t){var n,r;return super.optimizeNames(e,t),(n=this.catch)==null||n.optimizeNames(e,t),(r=this.finally)==null||r.optimizeNames(e,t),this}get names(){let e=super.names;return this.catch&&te(e,this.catch.names),this.finally&&te(e,this.finally.names),e}},T=class extends m{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};T.kind=`catch`;var ee=class extends m{render(e){return`finally`+super.render(e)}};ee.kind=`finally`,e.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
|
|
190
|
+
`:``},this._extScope=e,this._scope=new n.Scope({parent:e}),this._nodes=[new h]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let n=this._extScope.value(e,t);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,n,r){let i=this._scope.toName(t);return n!==void 0&&r&&(this._constants[i.str]=n),this._leafNode(new o(e,i,n)),i}const(e,t,r){return this._def(n.varKinds.const,e,t,r)}let(e,t,r){return this._def(n.varKinds.let,e,t,r)}var(e,t,r){return this._def(n.varKinds.var,e,t,r)}assign(e,t,n){return this._leafNode(new s(e,t,n))}add(t,n){return this._leafNode(new c(t,e.operators.ADD,n))}code(e){return typeof e==`function`?e():e!==t.nil&&this._leafNode(new f(e)),this}object(...e){let n=[`{`];for(let[r,i]of e)n.length>1&&n.push(`,`),n.push(r),(r!==i||this.opts.es5)&&(n.push(`:`),(0,t.addCodeArg)(n,i));return n.push(`}`),new t._Code(n)}if(e,t,n){if(this._blockNode(new _(e)),t&&n)this.code(t).else().code(n).endIf();else if(t)this.code(t).endIf();else if(n)throw Error(`CodeGen: "else" body without "then" body`);return this}elseIf(e){return this._elseNode(new _(e))}else(){return this._elseNode(new g)}endIf(){return this._endBlockNode(_,g)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new y(e),t)}forRange(e,t,r,i,a=this.opts.es5?n.varKinds.var:n.varKinds.let){let o=this._scope.toName(e);return this._for(new b(a,o,t,r),()=>i(o))}forOf(e,r,i,a=n.varKinds.const){let o=this._scope.toName(e);if(this.opts.es5){let e=r instanceof t.Name?r:this.var(`_arr`,r);return this.forRange(`_i`,0,(0,t._)`${e}.length`,n=>{this.var(o,(0,t._)`${e}[${n}]`),i(o)})}return this._for(new x(`of`,a,o,r),()=>i(o))}forIn(e,r,i,a=this.opts.es5?n.varKinds.var:n.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,t._)`Object.keys(${r})`,i);let o=this._scope.toName(e);return this._for(new x(`in`,a,o,r),()=>i(o))}endFor(){return this._endBlockNode(v)}label(e){return this._leafNode(new l(e))}break(e){return this._leafNode(new u(e))}return(e){let t=new C;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw Error(`CodeGen: "return" should have one node`);return this._endBlockNode(C)}try(e,t,n){if(!t&&!n)throw Error(`CodeGen: "try" without "catch" and "finally"`);let r=new w;if(this._blockNode(r),this.code(e),t){let e=this.name(`e`);this._currNode=r.catch=new T(e),t(e)}return n&&(this._currNode=r.finally=new ee,this.code(n)),this._endBlockNode(T,ee)}throw(e){return this._leafNode(new d(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){let t=this._blockStarts.pop();if(t===void 0)throw Error(`CodeGen: not in self-balancing block`);let n=this._nodes.length-t;if(n<0||e!==void 0&&n!==e)throw Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=t,this}func(e,n=t.nil,r,i){return this._blockNode(new S(e,n,r)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(S)}optimize(e=1){for(;e-->0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){let n=this._currNode;if(n instanceof e||t&&n instanceof t)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){let t=this._currNode;if(!(t instanceof _))throw Error(`CodeGen: "else" without "if"`);return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let t=this._nodes;t[t.length-1]=e}};function te(e,t){for(let n in t)e[n]=(e[n]||0)+(t[n]||0);return e}function ne(e,n){return n instanceof t._CodeOrName?te(e,n.names):e}function re(e,n,r){if(e instanceof t.Name)return i(e);if(!a(e))return e;return new t._Code(e._items.reduce((e,n)=>(n instanceof t.Name&&(n=i(n)),n instanceof t._Code?e.push(...n._items):e.push(n),e),[]));function i(e){let t=r[e.str];return t===void 0||n[e.str]!==1?e:(delete n[e.str],t)}function a(e){return e instanceof t._Code&&e._items.some(e=>e instanceof t.Name&&n[e.str]===1&&r[e.str]!==void 0)}}function ie(e,t){for(let n in t)e[n]=(e[n]||0)-(t[n]||0)}function ae(e){return typeof e==`boolean`||typeof e==`number`||e===null?!e:(0,t._)`!${E(e)}`}e.not=ae;let oe=ue(e.operators.AND);function se(...e){return e.reduce(oe)}e.and=se;let ce=ue(e.operators.OR);function le(...e){return e.reduce(ce)}e.or=le;function ue(e){return(n,r)=>n===t.nil?r:r===t.nil?n:(0,t._)`${E(n)} ${e} ${E(r)}`}function E(e){return e instanceof t.Name?e:(0,t._)`(${e})`}})),lE=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.checkStrictMode=e.getErrorPath=e.Type=e.useFunc=e.setEvaluated=e.evaluatedPropsToName=e.mergeEvaluated=e.eachItem=e.unescapeJsonPointer=e.escapeJsonPointer=e.escapeFragment=e.unescapeFragment=e.schemaRefOrVal=e.schemaHasRulesButRef=e.schemaHasRules=e.checkUnknownRules=e.alwaysValidSchema=e.toHash=void 0;let t=cE(),n=oE();function r(e){let t={};for(let n of e)t[n]=!0;return t}e.toHash=r;function i(e,t){return typeof t==`boolean`?t:Object.keys(t).length===0||(a(e,t),!o(t,e.self.RULES.all))}e.alwaysValidSchema=i;function a(e,t=e.schema){let{opts:n,self:r}=e;if(!n.strictSchema||typeof t==`boolean`)return;let i=r.RULES.keywords;for(let n in t)i[n]||x(e,`unknown keyword: "${n}"`)}e.checkUnknownRules=a;function o(e,t){if(typeof e==`boolean`)return!e;for(let n in e)if(t[n])return!0;return!1}e.schemaHasRules=o;function s(e,t){if(typeof e==`boolean`)return!e;for(let n in e)if(n!==`$ref`&&t.all[n])return!0;return!1}e.schemaHasRulesButRef=s;function c({topSchemaRef:e,schemaPath:n},r,i,a){if(!a){if(typeof r==`number`||typeof r==`boolean`)return r;if(typeof r==`string`)return(0,t._)`${r}`}return(0,t._)`${e}${n}${(0,t.getProperty)(i)}`}e.schemaRefOrVal=c;function l(e){return f(decodeURIComponent(e))}e.unescapeFragment=l;function u(e){return encodeURIComponent(d(e))}e.escapeFragment=u;function d(e){return typeof e==`number`?`${e}`:e.replace(/~/g,`~0`).replace(/\//g,`~1`)}e.escapeJsonPointer=d;function f(e){return e.replace(/~1/g,`/`).replace(/~0/g,`~`)}e.unescapeJsonPointer=f;function p(e,t){if(Array.isArray(e))for(let n of e)t(n);else t(e)}e.eachItem=p;function m({mergeNames:e,mergeToName:n,mergeValues:r,resultToName:i}){return(a,o,s,c)=>{let l=s===void 0?o:s instanceof t.Name?(o instanceof t.Name?e(a,o,s):n(a,o,s),s):o instanceof t.Name?(n(a,s,o),o):r(o,s);return c===t.Name&&!(l instanceof t.Name)?i(a,l):l}}e.mergeEvaluated={props:m({mergeNames:(e,n,r)=>e.if((0,t._)`${r} !== true && ${n} !== undefined`,()=>{e.if((0,t._)`${n} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,t._)`${r} || {}`).code((0,t._)`Object.assign(${r}, ${n})`))}),mergeToName:(e,n,r)=>e.if((0,t._)`${r} !== true`,()=>{n===!0?e.assign(r,!0):(e.assign(r,(0,t._)`${r} || {}`),g(e,r,n))}),mergeValues:(e,t)=>e===!0||{...e,...t},resultToName:h}),items:m({mergeNames:(e,n,r)=>e.if((0,t._)`${r} !== true && ${n} !== undefined`,()=>e.assign(r,(0,t._)`${n} === true ? true : ${r} > ${n} ? ${r} : ${n}`)),mergeToName:(e,n,r)=>e.if((0,t._)`${r} !== true`,()=>e.assign(r,n===!0||(0,t._)`${r} > ${n} ? ${r} : ${n}`)),mergeValues:(e,t)=>e===!0||Math.max(e,t),resultToName:(e,t)=>e.var(`items`,t)})};function h(e,n){if(n===!0)return e.var(`props`,!0);let r=e.var(`props`,(0,t._)`{}`);return n!==void 0&&g(e,r,n),r}e.evaluatedPropsToName=h;function g(e,n,r){Object.keys(r).forEach(r=>e.assign((0,t._)`${n}${(0,t.getProperty)(r)}`,!0))}e.setEvaluated=g;let _={};function v(e,t){return e.scopeValue(`func`,{ref:t,code:_[t.code]||(_[t.code]=new n._Code(t.code))})}e.useFunc=v;var y;(function(e){e[e.Num=0]=`Num`,e[e.Str=1]=`Str`})(y||(e.Type=y={}));function b(e,n,r){if(e instanceof t.Name){let i=n===y.Num;return r?i?(0,t._)`"[" + ${e} + "]"`:(0,t._)`"['" + ${e} + "']"`:i?(0,t._)`"/" + ${e}`:(0,t._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,t.getProperty)(e).toString():`/`+d(e)}e.getErrorPath=b;function x(e,t,n=e.opts.strictSchema){if(n){if(t=`strict mode: ${t}`,n===!0)throw Error(t);e.self.logger.warn(t)}}e.checkStrictMode=x})),uE=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cE();e.default={data:new t.Name(`data`),valCxt:new t.Name(`valCxt`),instancePath:new t.Name(`instancePath`),parentData:new t.Name(`parentData`),parentDataProperty:new t.Name(`parentDataProperty`),rootData:new t.Name(`rootData`),dynamicAnchors:new t.Name(`dynamicAnchors`),vErrors:new t.Name(`vErrors`),errors:new t.Name(`errors`),this:new t.Name(`this`),self:new t.Name(`self`),scope:new t.Name(`scope`),json:new t.Name(`json`),jsonPos:new t.Name(`jsonPos`),jsonLen:new t.Name(`jsonLen`),jsonPart:new t.Name(`jsonPart`)}})),dE=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;let t=cE(),n=lE(),r=uE();e.keywordError={message:({keyword:e})=>(0,t.str)`must pass "${e}" keyword validation`},e.keyword$DataError={message:({keyword:e,schemaType:n})=>n?(0,t.str)`"${e}" keyword must be ${n} ($data)`:(0,t.str)`"${e}" keyword is invalid ($data)`};function i(n,r=e.keywordError,i,a){let{it:o}=n,{gen:s,compositeRule:u,allErrors:f}=o,p=d(n,r,i);a??(u||f)?c(s,p):l(o,(0,t._)`[${p}]`)}e.reportError=i;function a(t,n=e.keywordError,i){let{it:a}=t,{gen:o,compositeRule:s,allErrors:u}=a;c(o,d(t,n,i)),s||u||l(a,r.default.vErrors)}e.reportExtraError=a;function o(e,n){e.assign(r.default.errors,n),e.if((0,t._)`${r.default.vErrors} !== null`,()=>e.if(n,()=>e.assign((0,t._)`${r.default.vErrors}.length`,n),()=>e.assign(r.default.vErrors,null)))}e.resetErrorsCount=o;function s({gen:e,keyword:n,schemaValue:i,data:a,errsCount:o,it:s}){if(o===void 0)throw Error(`ajv implementation error`);let c=e.name(`err`);e.forRange(`i`,o,r.default.errors,o=>{e.const(c,(0,t._)`${r.default.vErrors}[${o}]`),e.if((0,t._)`${c}.instancePath === undefined`,()=>e.assign((0,t._)`${c}.instancePath`,(0,t.strConcat)(r.default.instancePath,s.errorPath))),e.assign((0,t._)`${c}.schemaPath`,(0,t.str)`${s.errSchemaPath}/${n}`),s.opts.verbose&&(e.assign((0,t._)`${c}.schema`,i),e.assign((0,t._)`${c}.data`,a))})}e.extendErrors=s;function c(e,n){let i=e.const(`err`,n);e.if((0,t._)`${r.default.vErrors} === null`,()=>e.assign(r.default.vErrors,(0,t._)`[${i}]`),(0,t._)`${r.default.vErrors}.push(${i})`),e.code((0,t._)`${r.default.errors}++`)}function l(e,n){let{gen:r,validateName:i,schemaEnv:a}=e;a.$async?r.throw((0,t._)`new ${e.ValidationError}(${n})`):(r.assign((0,t._)`${i}.errors`,n),r.return(!1))}let u={keyword:new t.Name(`keyword`),schemaPath:new t.Name(`schemaPath`),params:new t.Name(`params`),propertyName:new t.Name(`propertyName`),message:new t.Name(`message`),schema:new t.Name(`schema`),parentSchema:new t.Name(`parentSchema`)};function d(e,n,r){let{createErrors:i}=e.it;return i===!1?(0,t._)`{}`:f(e,n,r)}function f(e,t,n={}){let{gen:r,it:i}=e,a=[p(i,n),m(e,n)];return h(e,t,a),r.object(...a)}function p({errorPath:e},{instancePath:i}){let a=i?(0,t.str)`${e}${(0,n.getErrorPath)(i,n.Type.Str)}`:e;return[r.default.instancePath,(0,t.strConcat)(r.default.instancePath,a)]}function m({keyword:e,it:{errSchemaPath:r}},{schemaPath:i,parentSchema:a}){let o=a?r:(0,t.str)`${r}/${e}`;return i&&(o=(0,t.str)`${o}${(0,n.getErrorPath)(i,n.Type.Str)}`),[u.schemaPath,o]}function h(e,{params:n,message:i},a){let{keyword:o,data:s,schemaValue:c,it:l}=e,{opts:d,propertyName:f,topSchemaRef:p,schemaPath:m}=l;a.push([u.keyword,o],[u.params,typeof n==`function`?n(e):n||(0,t._)`{}`]),d.messages&&a.push([u.message,typeof i==`function`?i(e):i]),d.verbose&&a.push([u.schema,c],[u.parentSchema,(0,t._)`${p}${m}`],[r.default.data,s]),f&&a.push([u.propertyName,f])}})),fE=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.boolOrEmptySchema=e.topBoolOrEmptySchema=void 0;let t=dE(),n=cE(),r=uE(),i={message:`boolean schema is false`};function a(e){let{gen:t,schema:i,validateName:a}=e;i===!1?s(e,!1):typeof i==`object`&&i.$async===!0?t.return(r.default.data):(t.assign((0,n._)`${a}.errors`,null),t.return(!0))}e.topBoolOrEmptySchema=a;function o(e,t){let{gen:n,schema:r}=e;r===!1?(n.var(t,!1),s(e)):n.var(t,!0)}e.boolOrEmptySchema=o;function s(e,n){let{gen:r,data:a}=e,o={gen:r,keyword:`false schema`,data:a,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,t.reportError)(o,i,void 0,n)}})),pE=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getRules=e.isJSONType=void 0;let t=new Set([`string`,`number`,`integer`,`boolean`,`null`,`object`,`array`]);function n(e){return typeof e==`string`&&t.has(e)}e.isJSONType=n;function r(){let e={number:{type:`number`,rules:[]},string:{type:`string`,rules:[]},array:{type:`array`,rules:[]},object:{type:`object`,rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}e.getRules=r})),mE=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.shouldUseRule=e.shouldUseGroup=e.schemaHasRulesForType=void 0;function t({schema:e,self:t},r){let i=t.RULES.types[r];return i&&i!==!0&&n(e,i)}e.schemaHasRulesForType=t;function n(e,t){return t.rules.some(t=>r(e,t))}e.shouldUseGroup=n;function r(e,t){return e[t.keyword]!==void 0||t.definition.implements?.some(t=>e[t]!==void 0)}e.shouldUseRule=r})),hE=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.reportTypeError=e.checkDataTypes=e.checkDataType=e.coerceAndCheckDataType=e.getJSONTypes=e.getSchemaTypes=e.DataType=void 0;let t=pE(),n=mE(),r=dE(),i=cE(),a=lE();var o;(function(e){e[e.Correct=0]=`Correct`,e[e.Wrong=1]=`Wrong`})(o||(e.DataType=o={}));function s(e){let t=c(e.type);if(t.includes(`null`)){if(e.nullable===!1)throw Error(`type: null contradicts nullable: false`)}else{if(!t.length&&e.nullable!==void 0)throw Error(`"nullable" cannot be used without "type"`);e.nullable===!0&&t.push(`null`)}return t}e.getSchemaTypes=s;function c(e){let n=Array.isArray(e)?e:e?[e]:[];if(n.every(t.isJSONType))return n;throw Error(`type must be JSONType or JSONType[]: `+n.join(`,`))}e.getJSONTypes=c;function l(e,t){let{gen:r,data:i,opts:a}=e,s=d(t,a.coerceTypes),c=t.length>0&&!(s.length===0&&t.length===1&&(0,n.schemaHasRulesForType)(e,t[0]));if(c){let n=h(t,i,a.strictNumbers,o.Wrong);r.if(n,()=>{s.length?f(e,t,s):_(e)})}return c}e.coerceAndCheckDataType=l;let u=new Set([`string`,`number`,`integer`,`boolean`,`null`]);function d(e,t){return t?e.filter(e=>u.has(e)||t===`array`&&e===`array`):[]}function f(e,t,n){let{gen:r,data:a,opts:o}=e,s=r.let(`dataType`,(0,i._)`typeof ${a}`),c=r.let(`coerced`,(0,i._)`undefined`);o.coerceTypes===`array`&&r.if((0,i._)`${s} == 'object' && Array.isArray(${a}) && ${a}.length == 1`,()=>r.assign(a,(0,i._)`${a}[0]`).assign(s,(0,i._)`typeof ${a}`).if(h(t,a,o.strictNumbers),()=>r.assign(c,a))),r.if((0,i._)`${c} !== undefined`);for(let e of n)(u.has(e)||e===`array`&&o.coerceTypes===`array`)&&l(e);r.else(),_(e),r.endIf(),r.if((0,i._)`${c} !== undefined`,()=>{r.assign(a,c),p(e,c)});function l(e){switch(e){case`string`:r.elseIf((0,i._)`${s} == "number" || ${s} == "boolean"`).assign(c,(0,i._)`"" + ${a}`).elseIf((0,i._)`${a} === null`).assign(c,(0,i._)`""`);return;case`number`:r.elseIf((0,i._)`${s} == "boolean" || ${a} === null
|
|
191
|
+
|| (${s} == "string" && ${a} && ${a} == +${a})`).assign(c,(0,i._)`+${a}`);return;case`integer`:r.elseIf((0,i._)`${s} === "boolean" || ${a} === null
|
|
192
|
+
|| (${s} === "string" && ${a} && ${a} == +${a} && !(${a} % 1))`).assign(c,(0,i._)`+${a}`);return;case`boolean`:r.elseIf((0,i._)`${a} === "false" || ${a} === 0 || ${a} === null`).assign(c,!1).elseIf((0,i._)`${a} === "true" || ${a} === 1`).assign(c,!0);return;case`null`:r.elseIf((0,i._)`${a} === "" || ${a} === 0 || ${a} === false`),r.assign(c,null);return;case`array`:r.elseIf((0,i._)`${s} === "string" || ${s} === "number"
|
|
193
|
+
|| ${s} === "boolean" || ${a} === null`).assign(c,(0,i._)`[${a}]`)}}}function p({gen:e,parentData:t,parentDataProperty:n},r){e.if((0,i._)`${t} !== undefined`,()=>e.assign((0,i._)`${t}[${n}]`,r))}function m(e,t,n,r=o.Correct){let a=r===o.Correct?i.operators.EQ:i.operators.NEQ,s;switch(e){case`null`:return(0,i._)`${t} ${a} null`;case`array`:s=(0,i._)`Array.isArray(${t})`;break;case`object`:s=(0,i._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case`integer`:s=c((0,i._)`!(${t} % 1) && !isNaN(${t})`);break;case`number`:s=c();break;default:return(0,i._)`typeof ${t} ${a} ${e}`}return r===o.Correct?s:(0,i.not)(s);function c(e=i.nil){return(0,i.and)((0,i._)`typeof ${t} == "number"`,e,n?(0,i._)`isFinite(${t})`:i.nil)}}e.checkDataType=m;function h(e,t,n,r){if(e.length===1)return m(e[0],t,n,r);let o,s=(0,a.toHash)(e);if(s.array&&s.object){let e=(0,i._)`typeof ${t} != "object"`;o=s.null?e:(0,i._)`!${t} || ${e}`,delete s.null,delete s.array,delete s.object}else o=i.nil;s.number&&delete s.integer;for(let e in s)o=(0,i.and)(o,m(e,t,n,r));return o}e.checkDataTypes=h;let g={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e==`string`?(0,i._)`{type: ${e}}`:(0,i._)`{type: ${t}}`};function _(e){let t=v(e);(0,r.reportError)(t,g)}e.reportTypeError=_;function v(e){let{gen:t,data:n,schema:r}=e,i=(0,a.schemaRefOrVal)(e,r,`type`);return{gen:t,keyword:`type`,data:n,schema:r.type,schemaCode:i,schemaValue:i,parentSchema:r,params:{},it:e}}})),gE=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.assignDefaults=void 0;let t=cE(),n=lE();function r(e,t){let{properties:n,items:r}=e.schema;if(t===`object`&&n)for(let t in n)i(e,t,n[t].default);else t===`array`&&Array.isArray(r)&&r.forEach((t,n)=>i(e,n,t.default))}e.assignDefaults=r;function i(e,r,i){let{gen:a,compositeRule:o,data:s,opts:c}=e;if(i===void 0)return;let l=(0,t._)`${s}${(0,t.getProperty)(r)}`;if(o){(0,n.checkStrictMode)(e,`default is ignored for: ${l}`);return}let u=(0,t._)`${l} === undefined`;c.useDefaults===`empty`&&(u=(0,t._)`${u} || ${l} === null || ${l} === ""`),a.if(u,(0,t._)`${l} = ${(0,t.stringify)(i)}`)}})),_E=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateUnion=e.validateArray=e.usePattern=e.callValidateCode=e.schemaProperties=e.allSchemaProperties=e.noPropertyInData=e.propertyInData=e.isOwnProperty=e.hasPropFunc=e.reportMissingProp=e.checkMissingProp=e.checkReportMissingProp=void 0;let t=cE(),n=lE(),r=uE(),i=lE();function a(e,n){let{gen:r,data:i,it:a}=e;r.if(d(r,i,n,a.opts.ownProperties),()=>{e.setParams({missingProperty:(0,t._)`${n}`},!0),e.error()})}e.checkReportMissingProp=a;function o({gen:e,data:n,it:{opts:r}},i,a){return(0,t.or)(...i.map(i=>(0,t.and)(d(e,n,i,r.ownProperties),(0,t._)`${a} = ${i}`)))}e.checkMissingProp=o;function s(e,t){e.setParams({missingProperty:t},!0),e.error()}e.reportMissingProp=s;function c(e){return e.scopeValue(`func`,{ref:Object.prototype.hasOwnProperty,code:(0,t._)`Object.prototype.hasOwnProperty`})}e.hasPropFunc=c;function l(e,n,r){return(0,t._)`${c(e)}.call(${n}, ${r})`}e.isOwnProperty=l;function u(e,n,r,i){let a=(0,t._)`${n}${(0,t.getProperty)(r)} !== undefined`;return i?(0,t._)`${a} && ${l(e,n,r)}`:a}e.propertyInData=u;function d(e,n,r,i){let a=(0,t._)`${n}${(0,t.getProperty)(r)} === undefined`;return i?(0,t.or)(a,(0,t.not)(l(e,n,r))):a}e.noPropertyInData=d;function f(e){return e?Object.keys(e).filter(e=>e!==`__proto__`):[]}e.allSchemaProperties=f;function p(e,t){return f(t).filter(r=>!(0,n.alwaysValidSchema)(e,t[r]))}e.schemaProperties=p;function m({schemaCode:e,data:n,it:{gen:i,topSchemaRef:a,schemaPath:o,errorPath:s},it:c},l,u,d){let f=d?(0,t._)`${e}, ${n}, ${a}${o}`:n,p=[[r.default.instancePath,(0,t.strConcat)(r.default.instancePath,s)],[r.default.parentData,c.parentData],[r.default.parentDataProperty,c.parentDataProperty],[r.default.rootData,r.default.rootData]];c.opts.dynamicRef&&p.push([r.default.dynamicAnchors,r.default.dynamicAnchors]);let m=(0,t._)`${f}, ${i.object(...p)}`;return u===t.nil?(0,t._)`${l}(${m})`:(0,t._)`${l}.call(${u}, ${m})`}e.callValidateCode=m;let h=(0,t._)`new RegExp`;function g({gen:e,it:{opts:n}},r){let a=n.unicodeRegExp?`u`:``,{regExp:o}=n.code,s=o(r,a);return e.scopeValue(`pattern`,{key:s.toString(),ref:s,code:(0,t._)`${o.code===`new RegExp`?h:(0,i.useFunc)(e,o)}(${r}, ${a})`})}e.usePattern=g;function _(e){let{gen:r,data:i,keyword:a,it:o}=e,s=r.name(`valid`);if(o.allErrors){let e=r.let(`valid`,!0);return c(()=>r.assign(e,!1)),e}return r.var(s,!0),c(()=>r.break()),s;function c(o){let c=r.const(`len`,(0,t._)`${i}.length`);r.forRange(`i`,0,c,i=>{e.subschema({keyword:a,dataProp:i,dataPropType:n.Type.Num},s),r.if((0,t.not)(s),o)})}}e.validateArray=_;function v(e){let{gen:r,schema:i,keyword:a,it:o}=e;if(!Array.isArray(i))throw Error(`ajv implementation error`);if(i.some(e=>(0,n.alwaysValidSchema)(o,e))&&!o.opts.unevaluated)return;let s=r.let(`valid`,!1),c=r.name(`_valid`);r.block(()=>i.forEach((n,i)=>{let o=e.subschema({keyword:a,schemaProp:i,compositeRule:!0},c);r.assign(s,(0,t._)`${s} || ${c}`),e.mergeValidEvaluated(o,c)||r.if((0,t.not)(s))})),e.result(s,()=>e.reset(),()=>e.error(!0))}e.validateUnion=v})),vE=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateKeywordUsage=e.validSchemaType=e.funcKeywordCode=e.macroKeywordCode=void 0;let t=cE(),n=uE(),r=_E(),i=dE();function a(e,n){let{gen:r,keyword:i,schema:a,parentSchema:o,it:s}=e,c=n.macro.call(s.self,a,o,s),l=u(r,i,c);s.opts.validateSchema!==!1&&s.self.validateSchema(c,!0);let d=r.name(`valid`);e.subschema({schema:c,schemaPath:t.nil,errSchemaPath:`${s.errSchemaPath}/${i}`,topSchemaRef:l,compositeRule:!0},d),e.pass(d,()=>e.error(!0))}e.macroKeywordCode=a;function o(e,i){let{gen:a,keyword:o,schema:d,parentSchema:f,$data:p,it:m}=e;l(m,i);let h=u(a,o,!p&&i.compile?i.compile.call(m.self,d,f,m):i.validate),g=a.let(`valid`);e.block$data(g,_),e.ok(i.valid??g);function _(){if(i.errors===!1)b(),i.modifying&&s(e),x(()=>e.error());else{let t=i.async?v():y();i.modifying&&s(e),x(()=>c(e,t))}}function v(){let e=a.let(`ruleErrs`,null);return a.try(()=>b((0,t._)`await `),n=>a.assign(g,!1).if((0,t._)`${n} instanceof ${m.ValidationError}`,()=>a.assign(e,(0,t._)`${n}.errors`),()=>a.throw(n))),e}function y(){let e=(0,t._)`${h}.errors`;return a.assign(e,null),b(t.nil),e}function b(o=i.async?(0,t._)`await `:t.nil){let s=m.opts.passContext?n.default.this:n.default.self,c=!(`compile`in i&&!p||i.schema===!1);a.assign(g,(0,t._)`${o}${(0,r.callValidateCode)(e,h,s,c)}`,i.modifying)}function x(e){a.if((0,t.not)(i.valid??g),e)}}e.funcKeywordCode=o;function s(e){let{gen:n,data:r,it:i}=e;n.if(i.parentData,()=>n.assign(r,(0,t._)`${i.parentData}[${i.parentDataProperty}]`))}function c(e,r){let{gen:a}=e;a.if((0,t._)`Array.isArray(${r})`,()=>{a.assign(n.default.vErrors,(0,t._)`${n.default.vErrors} === null ? ${r} : ${n.default.vErrors}.concat(${r})`).assign(n.default.errors,(0,t._)`${n.default.vErrors}.length`),(0,i.extendErrors)(e)},()=>e.error())}function l({schemaEnv:e},t){if(t.async&&!e.$async)throw Error(`async keyword in sync schema`)}function u(e,n,r){if(r===void 0)throw Error(`keyword "${n}" failed to compile`);return e.scopeValue(`keyword`,typeof r==`function`?{ref:r}:{ref:r,code:(0,t.stringify)(r)})}function d(e,t,n=!1){return!t.length||t.some(t=>t===`array`?Array.isArray(e):t===`object`?e&&typeof e==`object`&&!Array.isArray(e):typeof e==t||n&&e===void 0)}e.validSchemaType=d;function f({schema:e,opts:t,self:n,errSchemaPath:r},i,a){if(Array.isArray(i.keyword)?!i.keyword.includes(a):i.keyword!==a)throw Error(`ajv implementation error`);let o=i.dependencies;if(o?.some(t=>!Object.prototype.hasOwnProperty.call(e,t)))throw Error(`parent schema must have dependencies of ${a}: ${o.join(`,`)}`);if(i.validateSchema&&!i.validateSchema(e[a])){let e=`keyword "${a}" value is invalid at path "${r}": `+n.errorsText(i.validateSchema.errors);if(t.validateSchema===`log`)n.logger.error(e);else throw Error(e)}}e.validateKeywordUsage=f})),yE=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extendSubschemaMode=e.extendSubschemaData=e.getSubschema=void 0;let t=cE(),n=lE();function r(e,{keyword:r,schemaProp:i,schema:a,schemaPath:o,errSchemaPath:s,topSchemaRef:c}){if(r!==void 0&&a!==void 0)throw Error(`both "keyword" and "schema" passed, only one allowed`);if(r!==void 0){let a=e.schema[r];return i===void 0?{schema:a,schemaPath:(0,t._)`${e.schemaPath}${(0,t.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${r}`}:{schema:a[i],schemaPath:(0,t._)`${e.schemaPath}${(0,t.getProperty)(r)}${(0,t.getProperty)(i)}`,errSchemaPath:`${e.errSchemaPath}/${r}/${(0,n.escapeFragment)(i)}`}}if(a!==void 0){if(o===void 0||s===void 0||c===void 0)throw Error(`"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"`);return{schema:a,schemaPath:o,topSchemaRef:c,errSchemaPath:s}}throw Error(`either "keyword" or "schema" must be passed`)}e.getSubschema=r;function i(e,r,{dataProp:i,dataPropType:a,data:o,dataTypes:s,propertyName:c}){if(o!==void 0&&i!==void 0)throw Error(`both "data" and "dataProp" passed, only one allowed`);let{gen:l}=r;if(i!==void 0){let{errorPath:o,dataPathArr:s,opts:c}=r;u(l.let(`data`,(0,t._)`${r.data}${(0,t.getProperty)(i)}`,!0)),e.errorPath=(0,t.str)`${o}${(0,n.getErrorPath)(i,a,c.jsPropertySyntax)}`,e.parentDataProperty=(0,t._)`${i}`,e.dataPathArr=[...s,e.parentDataProperty]}o!==void 0&&(u(o instanceof t.Name?o:l.let(`data`,o,!0)),c!==void 0&&(e.propertyName=c)),s&&(e.dataTypes=s);function u(t){e.data=t,e.dataLevel=r.dataLevel+1,e.dataTypes=[],r.definedProperties=new Set,e.parentData=r.data,e.dataNames=[...r.dataNames,t]}}e.extendSubschemaData=i;function a(e,{jtdDiscriminator:t,jtdMetadata:n,compositeRule:r,createErrors:i,allErrors:a}){r!==void 0&&(e.compositeRule=r),i!==void 0&&(e.createErrors=i),a!==void 0&&(e.allErrors=a),e.jtdDiscriminator=t,e.jtdMetadata=n}e.extendSubschemaMode=a})),bE=r(((e,t)=>{t.exports=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t==`object`&&typeof n==`object`){if(t.constructor!==n.constructor)return!1;var r,i,a;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(a=Object.keys(t),r=a.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;i--!==0;){var o=a[i];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n}})),xE=r(((e,t)=>{var n=t.exports=function(e,t,n){typeof t==`function`&&(n=t,t={}),n=t.cb||n;var i=typeof n==`function`?n:n.pre||function(){},a=n.post||function(){};r(t,i,a,e,``,e)};n.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},n.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},n.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},n.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function r(e,t,a,o,s,c,l,u,d,f){if(o&&typeof o==`object`&&!Array.isArray(o)){for(var p in t(o,s,c,l,u,d,f),o){var m=o[p];if(Array.isArray(m)){if(p in n.arrayKeywords)for(var h=0;h<m.length;h++)r(e,t,a,m[h],s+`/`+p+`/`+h,c,s,p,o,h)}else if(p in n.propsKeywords){if(m&&typeof m==`object`)for(var g in m)r(e,t,a,m[g],s+`/`+p+`/`+i(g),c,s,p,o,g)}else(p in n.keywords||e.allKeys&&!(p in n.skipKeywords))&&r(e,t,a,m,s+`/`+p,c,s,p,o)}a(o,s,c,l,u,d,f)}}function i(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}})),SE=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getSchemaRefs=e.resolveUrl=e.normalizeId=e._getFullPath=e.getFullPath=e.inlineRef=void 0;let t=lE(),n=bE(),r=xE(),i=new Set([`type`,`format`,`pattern`,`maxLength`,`minLength`,`maxProperties`,`minProperties`,`maxItems`,`minItems`,`maximum`,`minimum`,`uniqueItems`,`multipleOf`,`required`,`enum`,`const`]);function a(e,t=!0){return typeof e==`boolean`?!0:t===!0?!s(e):t?c(e)<=t:!1}e.inlineRef=a;let o=new Set([`$ref`,`$recursiveRef`,`$recursiveAnchor`,`$dynamicRef`,`$dynamicAnchor`]);function s(e){for(let t in e){if(o.has(t))return!0;let n=e[t];if(Array.isArray(n)&&n.some(s)||typeof n==`object`&&s(n))return!0}return!1}function c(e){let n=0;for(let r in e)if(r===`$ref`||(n++,!i.has(r)&&(typeof e[r]==`object`&&(0,t.eachItem)(e[r],e=>n+=c(e)),n===1/0)))return 1/0;return n}function l(e,t=``,n){return n!==!1&&(t=f(t)),u(e,e.parse(t))}e.getFullPath=l;function u(e,t){return e.serialize(t).split(`#`)[0]+`#`}e._getFullPath=u;let d=/#\/?$/;function f(e){return e?e.replace(d,``):``}e.normalizeId=f;function p(e,t,n){return n=f(n),e.resolve(t,n)}e.resolveUrl=p;let m=/^[a-z_][-a-z0-9._]*$/i;function h(e,t){if(typeof e==`boolean`)return{};let{schemaId:i,uriResolver:a}=this.opts,o=f(e[i]||t),s={"":o},c=l(a,o,!1),u={},d=new Set;return r(e,{allKeys:!0},(e,t,n,r)=>{if(r===void 0)return;let a=c+t,o=s[r];typeof e[i]==`string`&&(o=l.call(this,e[i])),g.call(this,e.$anchor),g.call(this,e.$dynamicAnchor),s[t]=o;function l(t){let n=this.opts.uriResolver.resolve;if(t=f(o?n(o,t):t),d.has(t))throw h(t);d.add(t);let r=this.refs[t];return typeof r==`string`&&(r=this.refs[r]),typeof r==`object`?p(e,r.schema,t):t!==f(a)&&(t[0]===`#`?(p(e,u[t],t),u[t]=e):this.refs[t]=a),t}function g(e){if(typeof e==`string`){if(!m.test(e))throw Error(`invalid anchor "${e}"`);l.call(this,`#${e}`)}}}),u;function p(e,t,r){if(t!==void 0&&!n(e,t))throw h(r)}function h(e){return Error(`reference "${e}" resolves to more than one schema`)}}e.getSchemaRefs=h})),CE=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getData=e.KeywordCxt=e.validateFunctionCode=void 0;let t=fE(),n=hE(),r=mE(),i=hE(),a=gE(),o=vE(),s=yE(),c=cE(),l=uE(),u=SE(),d=lE(),f=dE();function p(e){if(S(e)&&(w(e),x(e))){_(e);return}m(e,()=>(0,t.topBoolOrEmptySchema)(e))}e.validateFunctionCode=p;function m({gen:e,validateName:t,schema:n,schemaEnv:r,opts:i},a){i.code.es5?e.func(t,(0,c._)`${l.default.data}, ${l.default.valCxt}`,r.$async,()=>{e.code((0,c._)`"use strict"; ${y(n,i)}`),g(e,i),e.code(a)}):e.func(t,(0,c._)`${l.default.data}, ${h(i)}`,r.$async,()=>e.code(y(n,i)).code(a))}function h(e){return(0,c._)`{${l.default.instancePath}="", ${l.default.parentData}, ${l.default.parentDataProperty}, ${l.default.rootData}=${l.default.data}${e.dynamicRef?(0,c._)`, ${l.default.dynamicAnchors}={}`:c.nil}}={}`}function g(e,t){e.if(l.default.valCxt,()=>{e.var(l.default.instancePath,(0,c._)`${l.default.valCxt}.${l.default.instancePath}`),e.var(l.default.parentData,(0,c._)`${l.default.valCxt}.${l.default.parentData}`),e.var(l.default.parentDataProperty,(0,c._)`${l.default.valCxt}.${l.default.parentDataProperty}`),e.var(l.default.rootData,(0,c._)`${l.default.valCxt}.${l.default.rootData}`),t.dynamicRef&&e.var(l.default.dynamicAnchors,(0,c._)`${l.default.valCxt}.${l.default.dynamicAnchors}`)},()=>{e.var(l.default.instancePath,(0,c._)`""`),e.var(l.default.parentData,(0,c._)`undefined`),e.var(l.default.parentDataProperty,(0,c._)`undefined`),e.var(l.default.rootData,l.default.data),t.dynamicRef&&e.var(l.default.dynamicAnchors,(0,c._)`{}`)})}function _(e){let{schema:t,opts:n,gen:r}=e;m(e,()=>{n.$comment&&t.$comment&&ie(e),te(e),r.let(l.default.vErrors,null),r.let(l.default.errors,0),n.unevaluated&&v(e),T(e),ae(e)})}function v(e){let{gen:t,validateName:n}=e;e.evaluated=t.const(`evaluated`,(0,c._)`${n}.evaluated`),t.if((0,c._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,c._)`${e.evaluated}.props`,(0,c._)`undefined`)),t.if((0,c._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,c._)`${e.evaluated}.items`,(0,c._)`undefined`))}function y(e,t){let n=typeof e==`object`&&e[t.schemaId];return n&&(t.code.source||t.code.process)?(0,c._)`/*# sourceURL=${n} */`:c.nil}function b(e,n){if(S(e)&&(w(e),x(e))){C(e,n);return}(0,t.boolOrEmptySchema)(e,n)}function x({schema:e,self:t}){if(typeof e==`boolean`)return!e;for(let n in e)if(t.RULES.all[n])return!0;return!1}function S(e){return typeof e.schema!=`boolean`}function C(e,t){let{schema:n,gen:r,opts:i}=e;i.$comment&&n.$comment&&ie(e),ne(e),re(e);let a=r.const(`_errs`,l.default.errors);T(e,a),r.var(t,(0,c._)`${a} === ${l.default.errors}`)}function w(e){(0,d.checkUnknownRules)(e),ee(e)}function T(e,t){if(e.opts.jtd)return se(e,[],!1,t);let r=(0,n.getSchemaTypes)(e.schema);se(e,r,!(0,n.coerceAndCheckDataType)(e,r),t)}function ee(e){let{schema:t,errSchemaPath:n,opts:r,self:i}=e;t.$ref&&r.ignoreKeywordsWithRef&&(0,d.schemaHasRulesButRef)(t,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${n}"`)}function te(e){let{schema:t,opts:n}=e;t.default!==void 0&&n.useDefaults&&n.strictSchema&&(0,d.checkStrictMode)(e,`default is ignored in the schema root`)}function ne(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,u.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function re(e){if(e.schema.$async&&!e.schemaEnv.$async)throw Error(`async schema in sync schema`)}function ie({gen:e,schemaEnv:t,schema:n,errSchemaPath:r,opts:i}){let a=n.$comment;if(i.$comment===!0)e.code((0,c._)`${l.default.self}.logger.log(${a})`);else if(typeof i.$comment==`function`){let n=(0,c.str)`${r}/$comment`,i=e.scopeValue(`root`,{ref:t.root});e.code((0,c._)`${l.default.self}.opts.$comment(${a}, ${n}, ${i}.schema)`)}}function ae(e){let{gen:t,schemaEnv:n,validateName:r,ValidationError:i,opts:a}=e;n.$async?t.if((0,c._)`${l.default.errors} === 0`,()=>t.return(l.default.data),()=>t.throw((0,c._)`new ${i}(${l.default.vErrors})`)):(t.assign((0,c._)`${r}.errors`,l.default.vErrors),a.unevaluated&&oe(e),t.return((0,c._)`${l.default.errors} === 0`))}function oe({gen:e,evaluated:t,props:n,items:r}){n instanceof c.Name&&e.assign((0,c._)`${t}.props`,n),r instanceof c.Name&&e.assign((0,c._)`${t}.items`,r)}function se(e,t,n,a){let{gen:o,schema:s,data:u,allErrors:f,opts:p,self:m}=e,{RULES:h}=m;if(s.$ref&&(p.ignoreKeywordsWithRef||!(0,d.schemaHasRulesButRef)(s,h))){o.block(()=>he(e,`$ref`,h.all.$ref.definition));return}p.jtd||le(e,t),o.block(()=>{for(let e of h.rules)g(e);g(h.post)});function g(d){(0,r.shouldUseGroup)(s,d)&&(d.type?(o.if((0,i.checkDataType)(d.type,u,p.strictNumbers)),ce(e,d),t.length===1&&t[0]===d.type&&n&&(o.else(),(0,i.reportTypeError)(e)),o.endIf()):ce(e,d),f||o.if((0,c._)`${l.default.errors} === ${a||0}`))}}function ce(e,t){let{gen:n,schema:i,opts:{useDefaults:o}}=e;o&&(0,a.assignDefaults)(e,t.type),n.block(()=>{for(let n of t.rules)(0,r.shouldUseRule)(i,n)&&he(e,n.keyword,n.definition,t.type)})}function le(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(ue(e,t),e.opts.allowUnionTypes||E(e,t),de(e,e.dataTypes))}function ue(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(t=>{pe(e.dataTypes,t)||O(e,`type "${t}" not allowed by context "${e.dataTypes.join(`,`)}"`)}),D(e,t)}}function E(e,t){t.length>1&&!(t.length===2&&t.includes(`null`))&&O(e,`use allowUnionTypes to allow union type keyword`)}function de(e,t){let n=e.self.RULES.all;for(let i in n){let a=n[i];if(typeof a==`object`&&(0,r.shouldUseRule)(e.schema,a)){let{type:n}=a.definition;n.length&&!n.some(e=>fe(t,e))&&O(e,`missing type "${n.join(`,`)}" for keyword "${i}"`)}}}function fe(e,t){return e.includes(t)||t===`number`&&e.includes(`integer`)}function pe(e,t){return e.includes(t)||t===`integer`&&e.includes(`number`)}function D(e,t){let n=[];for(let r of e.dataTypes)pe(t,r)?n.push(r):t.includes(`integer`)&&r===`number`&&n.push(`integer`);e.dataTypes=n}function O(e,t){let n=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${n}" (strictTypes)`,(0,d.checkStrictMode)(e,t,e.opts.strictTypes)}var me=class{constructor(e,t,n){if((0,o.validateKeywordUsage)(e,t,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,d.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const(`vSchema`,ve(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,o.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw Error(`${n} value must be ${JSON.stringify(t.schemaType)}`);(`code`in t?t.trackErrors:t.errors!==!1)&&(this.errsCount=e.gen.const(`_errs`,l.default.errors))}result(e,t,n){this.failResult((0,c.not)(e),t,n)}failResult(e,t,n){this.gen.if(e),n?n():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,c.not)(e),void 0,t)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:t}=this;this.fail((0,c._)`${t} !== undefined && (${(0,c.or)(this.invalid$data(),e)})`)}error(e,t,n){if(t){this.setParams(t),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,t){(e?f.reportExtraError:f.reportError)(this,this.def.error,t)}$dataError(){(0,f.reportError)(this,this.def.$dataError||f.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error(`add "trackErrors" to keyword definition`);(0,f.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,n=c.nil){this.gen.block(()=>{this.check$data(e,n),t()})}check$data(e=c.nil,t=c.nil){if(!this.$data)return;let{gen:n,schemaCode:r,schemaType:i,def:a}=this;n.if((0,c.or)((0,c._)`${r} === undefined`,t)),e!==c.nil&&n.assign(e,!0),(i.length||a.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==c.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:t,schemaType:n,def:r,it:a}=this;return(0,c.or)(o(),s());function o(){if(n.length){if(!(t instanceof c.Name))throw Error(`ajv implementation error`);let e=Array.isArray(n)?n:[n];return(0,c._)`${(0,i.checkDataTypes)(e,t,a.opts.strictNumbers,i.DataType.Wrong)}`}return c.nil}function s(){if(r.validateSchema){let n=e.scopeValue(`validate$data`,{ref:r.validateSchema});return(0,c._)`!${n}(${t})`}return c.nil}}subschema(e,t){let n=(0,s.getSubschema)(this.it,e);(0,s.extendSubschemaData)(n,this.it,e),(0,s.extendSubschemaMode)(n,e);let r={...this.it,...n,items:void 0,props:void 0};return b(r,t),r}mergeEvaluated(e,t){let{it:n,gen:r}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=d.mergeEvaluated.props(r,e.props,n.props,t)),n.items!==!0&&e.items!==void 0&&(n.items=d.mergeEvaluated.items(r,e.items,n.items,t)))}mergeValidEvaluated(e,t){let{it:n,gen:r}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return r.if(t,()=>this.mergeEvaluated(e,c.Name)),!0}};e.KeywordCxt=me;function he(e,t,n,r){let i=new me(e,n,t);`code`in n?n.code(i,r):i.$data&&n.validate?(0,o.funcKeywordCode)(i,n):`macro`in n?(0,o.macroKeywordCode)(i,n):(n.compile||n.validate)&&(0,o.funcKeywordCode)(i,n)}let ge=/^\/(?:[^~]|~0|~1)*$/,_e=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function ve(e,{dataLevel:t,dataNames:n,dataPathArr:r}){let i,a;if(e===``)return l.default.rootData;if(e[0]===`/`){if(!ge.test(e))throw Error(`Invalid JSON-pointer: ${e}`);i=e,a=l.default.rootData}else{let o=_e.exec(e);if(!o)throw Error(`Invalid JSON-pointer: ${e}`);let s=+o[1];if(i=o[2],i===`#`){if(s>=t)throw Error(u(`property/index`,s));return r[t-s]}if(s>t)throw Error(u(`data`,s));if(a=n[t-s],!i)return a}let o=a,s=i.split(`/`);for(let e of s)e&&(a=(0,c._)`${a}${(0,c.getProperty)((0,d.unescapeJsonPointer)(e))}`,o=(0,c._)`${o} && ${a}`);return o;function u(e,n){return`Cannot access ${e} ${n} levels up, current level is ${t}`}}e.getData=ve})),wE=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=class extends Error{constructor(e){super(`validation failed`),this.errors=e,this.ajv=this.validation=!0}}})),TE=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=SE();e.default=class extends Error{constructor(e,n,r,i){super(i||`can't resolve reference ${r} from id ${n}`),this.missingRef=(0,t.resolveUrl)(e,n,r),this.missingSchema=(0,t.normalizeId)((0,t.getFullPath)(e,this.missingRef))}}})),EE=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.resolveSchema=e.getCompilingSchema=e.resolveRef=e.compileSchema=e.SchemaEnv=void 0;let t=cE(),n=wE(),r=uE(),i=SE(),a=lE(),o=CE();var s=class{constructor(e){this.refs={},this.dynamicAnchors={};let t;typeof e.schema==`object`&&(t=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=e.baseId??(0,i.normalizeId)(t?.[e.schemaId||`$id`]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=t?.$async,this.refs={}}};e.SchemaEnv=s;function c(e){let a=d.call(this,e);if(a)return a;let s=(0,i.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:c,lines:l}=this.opts.code,{ownProperties:u}=this.opts,f=new t.CodeGen(this.scope,{es5:c,lines:l,ownProperties:u}),p;e.$async&&(p=f.scopeValue(`Error`,{ref:n.default,code:(0,t._)`require("ajv/dist/runtime/validation_error").default`}));let m=f.scopeName(`validate`);e.validateName=m;let h={gen:f,allErrors:this.opts.allErrors,data:r.default.data,parentData:r.default.parentData,parentDataProperty:r.default.parentDataProperty,dataNames:[r.default.data],dataPathArr:[t.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:f.scopeValue(`schema`,this.opts.code.source===!0?{ref:e.schema,code:(0,t.stringify)(e.schema)}:{ref:e.schema}),validateName:m,ValidationError:p,schema:e.schema,schemaEnv:e,rootId:s,baseId:e.baseId||s,schemaPath:t.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?``:`#`),errorPath:(0,t._)`""`,opts:this.opts,self:this},g;try{this._compilations.add(e),(0,o.validateFunctionCode)(h),f.optimize(this.opts.code.optimize);let n=f.toString();g=`${f.scopeRefs(r.default.scope)}return ${n}`,this.opts.code.process&&(g=this.opts.code.process(g,e));let i=Function(`${r.default.self}`,`${r.default.scope}`,g)(this,this.scope.get());if(this.scope.value(m,{ref:i}),i.errors=null,i.schema=e.schema,i.schemaEnv=e,e.$async&&(i.$async=!0),this.opts.code.source===!0&&(i.source={validateName:m,validateCode:n,scopeValues:f._values}),this.opts.unevaluated){let{props:e,items:n}=h;i.evaluated={props:e instanceof t.Name?void 0:e,items:n instanceof t.Name?void 0:n,dynamicProps:e instanceof t.Name,dynamicItems:n instanceof t.Name},i.source&&(i.source.evaluated=(0,t.stringify)(i.evaluated))}return e.validate=i,e}catch(t){throw delete e.validate,delete e.validateName,g&&this.logger.error(`Error compiling schema, function code:`,g),t}finally{this._compilations.delete(e)}}e.compileSchema=c;function l(e,t,n){n=(0,i.resolveUrl)(this.opts.uriResolver,t,n);let r=e.refs[n];if(r)return r;let a=p.call(this,e,n);if(a===void 0){let r=e.localRefs?.[n],{schemaId:i}=this.opts;r&&(a=new s({schema:r,schemaId:i,root:e,baseId:t}))}if(a!==void 0)return e.refs[n]=u.call(this,a)}e.resolveRef=l;function u(e){return(0,i.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:c.call(this,e)}function d(e){for(let t of this._compilations)if(f(t,e))return t}e.getCompilingSchema=d;function f(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function p(e,t){let n;for(;typeof(n=this.refs[t])==`string`;)t=n;return n||this.schemas[t]||m.call(this,e,t)}function m(e,t){let n=this.opts.uriResolver.parse(t),r=(0,i._getFullPath)(this.opts.uriResolver,n),a=(0,i.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&r===a)return g.call(this,n,e);let o=(0,i.normalizeId)(r),l=this.refs[o]||this.schemas[o];if(typeof l==`string`){let t=m.call(this,e,l);return typeof t?.schema==`object`?g.call(this,n,t):void 0}if(typeof l?.schema==`object`){if(l.validate||c.call(this,l),o===(0,i.normalizeId)(t)){let{schema:t}=l,{schemaId:n}=this.opts,r=t[n];return r&&(a=(0,i.resolveUrl)(this.opts.uriResolver,a,r)),new s({schema:t,schemaId:n,root:e,baseId:a})}return g.call(this,n,l)}}e.resolveSchema=m;let h=new Set([`properties`,`patternProperties`,`enum`,`dependencies`,`definitions`]);function g(e,{baseId:t,schema:n,root:r}){if(e.fragment?.[0]!==`/`)return;for(let r of e.fragment.slice(1).split(`/`)){if(typeof n==`boolean`)return;let e=n[(0,a.unescapeFragment)(r)];if(e===void 0)return;n=e;let o=typeof n==`object`&&n[this.opts.schemaId];!h.has(r)&&o&&(t=(0,i.resolveUrl)(this.opts.uriResolver,t,o))}let o;if(typeof n!=`boolean`&&n.$ref&&!(0,a.schemaHasRulesButRef)(n,this.RULES)){let e=(0,i.resolveUrl)(this.opts.uriResolver,t,n.$ref);o=m.call(this,r,e)}let{schemaId:c}=this.opts;if(o||=new s({schema:n,schemaId:c,root:r,baseId:t}),o.schema!==o.root.schema)return o}})),DE=r(((e,t)=>{t.exports={$id:`https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#`,description:`Meta-schema for $data reference (JSON AnySchema extension proposal)`,type:`object`,required:[`$data`],properties:{$data:{type:`string`,anyOf:[{format:`relative-json-pointer`},{format:`json-pointer`}]}},additionalProperties:!1}})),OE=r(((e,t)=>{let n=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),r=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),i=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),a=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),o=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function s(e){let t=``,n=0,r=0;for(r=0;r<e.length;r++)if(n=e[r].charCodeAt(0),n!==48){if(!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return``;t+=e[r];break}for(r+=1;r<e.length;r++){if(n=e[r].charCodeAt(0),!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return``;t+=e[r]}return t}let c=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function l(e){return e.length=0,!0}function u(e,t,n){if(e.length){let r=s(e);if(r!==``)t.push(r);else return n.error=!0,!1;e.length=0}return!0}function d(e){let t=0,n={error:!1,address:``,zone:``},r=[],i=[],a=!1,o=!1,c=u;for(let s=0;s<e.length;s++){let u=e[s];if(u!==`[`&&u!==`]`){if(u===`:`){if(a===!0&&(o=!0),!c(i,r,n))break;if(++t>7){n.error=!0;break}s>0&&e[s-1]===`:`&&(a=!0),r.push(`:`);continue}if(u===`%`){if(!c(i,r,n))break;c=l}else{i.push(u);continue}}}return i.length&&(c===l?n.zone=i.join(``):o?r.push(i.join(``)):r.push(s(i))),n.address=r.join(``),n}function f(e){if(p(e,`:`)<2)return{host:e,isIPV6:!1};let t=d(e);if(t.error)return{host:e,isIPV6:!1};{let e=t.address,n=t.address;return t.zone&&(e+=`%`+t.zone,n+=`%25`+t.zone),{host:e,isIPV6:!0,escapedHost:n}}}function p(e,t){let n=0;for(let r=0;r<e.length;r++)e[r]===t&&n++;return n}function m(e){let t=e,n=[],r=-1,i=0;for(;i=t.length;){if(i===1){if(t===`.`)break;if(t===`/`){n.push(`/`);break}n.push(t);break}if(i===2){if(t[0]===`.`){if(t[1]===`.`)break;if(t[1]===`/`){t=t.slice(2);continue}}else if(t[0]===`/`&&(t[1]===`.`||t[1]===`/`)){n.push(`/`);break}}else if(i===3&&t===`/..`){n.length!==0&&n.pop(),n.push(`/`);break}if(t[0]===`.`){if(t[1]===`.`){if(t[2]===`/`){t=t.slice(3);continue}}else if(t[1]===`/`){t=t.slice(2);continue}}else if(t[0]===`/`&&t[1]===`.`){if(t[2]===`/`){t=t.slice(2);continue}if(t[2]===`.`&&t[3]===`/`){t=t.slice(3),n.length!==0&&n.pop();continue}}if((r=t.indexOf(`/`,1))===-1){n.push(t);break}n.push(t.slice(0,r)),t=t.slice(r)}return n.join(``)}let h={"@":`%40`,"/":`%2F`,"?":`%3F`,"#":`%23`,":":`%3A`},g=/[@/?#:]/g,_=/[@/?#]/g;function v(e,t){let n=t?_:g;return n.lastIndex=0,e.replace(n,e=>h[e])}function y(e,t=!1){if(e.indexOf(`%`)===-1)return e;let n=``;for(let r=0;r<e.length;r++){if(e[r]===`%`&&r+2<e.length){let o=e.slice(r+1,r+3);if(i(o)){let e=o.toUpperCase(),i=String.fromCharCode(parseInt(e,16));t&&a(i)?n+=i:n+=`%`+e,r+=2;continue}}n+=e[r]}return n}function b(e){let t=``;for(let n=0;n<e.length;n++){if(e[n]===`%`&&n+2<e.length){let r=e.slice(n+1,n+3);if(i(r)){let e=r.toUpperCase(),i=String.fromCharCode(parseInt(e,16));i!==`.`&&a(i)?t+=i:t+=`%`+e,n+=2;continue}}o(e[n])?t+=e[n]:t+=escape(e[n])}return t}function x(e){let t=``;for(let n=0;n<e.length;n++){if(e[n]===`%`&&n+2<e.length){let r=e.slice(n+1,n+3);if(i(r)){t+=`%`+r.toUpperCase(),n+=2;continue}}t+=escape(e[n])}return t}function S(e){let t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push(`@`)),e.host!==void 0){let n=unescape(e.host);if(!r(n)){let e=f(n);n=e.isIPV6===!0?`[${e.escapedHost}]`:v(n,!1)}t.push(n)}return(typeof e.port==`number`||typeof e.port==`string`)&&(t.push(`:`),t.push(String(e.port))),t.length?t.join(``):void 0}t.exports={nonSimpleDomain:c,recomposeAuthority:S,reescapeHostDelimiters:v,normalizePercentEncoding:y,normalizePathEncoding:b,escapePreservingEscapes:x,removeDotSegments:m,isIPv4:r,isUUID:n,normalizeIPv6:f,stringArrayToHexStripped:s}})),kE=r(((e,t)=>{let{isUUID:n}=OE(),r=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,i=[`http`,`https`,`ws`,`wss`,`urn`,`urn:uuid`];function a(e){return i.indexOf(e)!==-1}function o(e){return e.secure===!0?!0:e.secure===!1?!1:e.scheme?e.scheme.length===3&&(e.scheme[0]===`w`||e.scheme[0]===`W`)&&(e.scheme[1]===`s`||e.scheme[1]===`S`)&&(e.scheme[2]===`s`||e.scheme[2]===`S`):!1}function s(e){return e.host||(e.error=e.error||`HTTP URIs must have a host.`),e}function c(e){let t=String(e.scheme).toLowerCase()===`https`;return(e.port===(t?443:80)||e.port===``)&&(e.port=void 0),e.path||=`/`,e}function l(e){return e.secure=o(e),e.resourceName=(e.path||`/`)+(e.query?`?`+e.query:``),e.path=void 0,e.query=void 0,e}function u(e){if((e.port===(o(e)?443:80)||e.port===``)&&(e.port=void 0),typeof e.secure==`boolean`&&(e.scheme=e.secure?`wss`:`ws`,e.secure=void 0),e.resourceName){let[t,n]=e.resourceName.split(`?`);e.path=t&&t!==`/`?t:void 0,e.query=n,e.resourceName=void 0}return e.fragment=void 0,e}function d(e,t){if(!e.path)return e.error=`URN can not be parsed`,e;let n=e.path.match(r);if(n){let r=t.scheme||e.scheme||`urn`;e.nid=n[1].toLowerCase(),e.nss=n[2];let i=y(`${r}:${t.nid||e.nid}`);e.path=void 0,i&&(e=i.parse(e,t))}else e.error=e.error||`URN can not be parsed.`;return e}function f(e,t){if(e.nid===void 0)throw Error(`URN without nid cannot be serialized`);let n=t.scheme||e.scheme||`urn`,r=e.nid.toLowerCase(),i=y(`${n}:${t.nid||r}`);i&&(e=i.serialize(e,t));let a=e,o=e.nss;return a.path=`${r||t.nid}:${o}`,t.skipEscape=!0,a}function p(e,t){let r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!n(r.uuid))&&(r.error=r.error||`UUID is not valid.`),r}function m(e){let t=e;return t.nss=(e.uuid||``).toLowerCase(),t}let h={scheme:`http`,domainHost:!0,parse:s,serialize:c},g={scheme:`https`,domainHost:h.domainHost,parse:s,serialize:c},_={scheme:`ws`,domainHost:!0,parse:l,serialize:u},v={http:h,https:g,ws:_,wss:{scheme:`wss`,domainHost:_.domainHost,parse:_.parse,serialize:_.serialize},urn:{scheme:`urn`,parse:d,serialize:f,skipNormalize:!0},"urn:uuid":{scheme:`urn:uuid`,parse:p,serialize:m,skipNormalize:!0}};Object.setPrototypeOf(v,null);function y(e){return e&&(v[e]||v[e.toLowerCase()])||void 0}t.exports={wsIsSecure:o,SCHEMES:v,isValidSchemeName:a,getSchemeHandler:y}})),AE=r(((e,t)=>{let{normalizeIPv6:n,removeDotSegments:r,recomposeAuthority:i,normalizePercentEncoding:a,normalizePathEncoding:o,escapePreservingEscapes:s,reescapeHostDelimiters:c,isIPv4:l,nonSimpleDomain:u}=OE(),{SCHEMES:d,getSchemeHandler:f}=kE();function p(e,t){return typeof e==`string`?e=w(e,t):typeof e==`object`&&(e=C(_(e,t),t)),e}function m(e,t,n){let r=n?Object.assign({scheme:`null`},n):{scheme:`null`},{parsed:i,malformedAuthorityOrPort:a}=S(e,r),{parsed:o,malformedAuthorityOrPort:s}=S(t,r);if(a||s)throw Error(i.error||o.error||`URI is malformed.`);let c=h(i,o,r,!0);return r.skipEscape=!0,_(c,r)}function h(e,t,n,i){let a={};return i||(e=C(_(e,n),n),t=C(_(t,n),n)),n||={},!n.tolerant&&t.scheme?(a.scheme=t.scheme,a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=r(t.path||``),a.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=r(t.path||``),a.query=t.query):(t.path?(t.path[0]===`/`?a.path=r(t.path):(a.path=(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?`/`+t.path:e.path?e.path.slice(0,e.path.lastIndexOf(`/`)+1)+t.path:t.path,a.path=r(a.path)),a.query=t.query):(a.path=e.path,a.query=t.query===void 0?e.query:t.query),a.userinfo=e.userinfo,a.host=e.host,a.port=e.port),a.scheme=e.scheme),a.fragment=t.fragment,a}function g(e,t,n){let r=ee(e,n),i=ee(t,n);return r!==void 0&&i!==void 0&&r.toLowerCase()===i.toLowerCase()}function _(e,t){let n={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:``},o=Object.assign({},t),c=[],l=f(o.scheme||n.scheme);l&&l.serialize&&l.serialize(n,o),n.path!==void 0&&(o.skipEscape?n.path=a(n.path):(n.path=s(n.path),n.scheme!==void 0&&(n.path=n.path.split(`%3A`).join(`:`)))),o.reference!==`suffix`&&n.scheme&&c.push(n.scheme,`:`);let u=i(n);if(u!==void 0&&(o.reference!==`suffix`&&c.push(`//`),c.push(u),n.path&&n.path[0]!==`/`&&c.push(`/`)),n.path!==void 0){let e=n.path;!o.absolutePath&&(!l||!l.absolutePath)&&(e=r(e)),u===void 0&&e[0]===`/`&&e[1]===`/`&&(e=`/%2F`+e.slice(2)),c.push(e)}return n.query!==void 0&&c.push(`?`,n.query),n.fragment!==void 0&&c.push(`#`,n.fragment),c.join(``)}let v=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,y=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,b=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function x(e,t){if(t[2]!==void 0&&e.path&&e.path[0]!==`/`)return`URI path must start with "/" when authority is present.`;if(typeof e.port==`number`&&(e.port<0||e.port>65535))return`URI port is malformed.`}function S(e,t){let r=Object.assign({},t),i={scheme:void 0,userinfo:void 0,host:``,port:void 0,path:``,query:void 0,fragment:void 0},a=!1,s=!1;r.reference===`suffix`&&(e=r.scheme?r.scheme+`:`+e:`//`+e);let d=e.match(y);d!==null&&d[1].indexOf(`\\`)!==-1&&(i.error=`URI authority must not contain a literal backslash.`,a=!0);let p=e.match(b);if(p!==null){let e=p[1],t=e.replace(/[\t\n\r]/g,``);t.length>=2&&(t.slice(0,2)===`//`?e.length!==t.length&&(i.error=i.error||`URI authority introducer must not contain whitespace.`,a=!0):(i.error=i.error||`URI authority must not contain a literal backslash.`,a=!0))}let m=e.match(v);if(m){i.scheme=m[1],i.userinfo=m[3],i.host=m[4],i.port=parseInt(m[5],10),i.path=m[6]||``,i.query=m[7],i.fragment=m[8],isNaN(i.port)&&(i.port=m[5]);let t=x(i,m);if(t!==void 0&&(i.error=i.error||t,a=!0),i.host){if(l(i.host)===!1){let e=n(i.host);i.host=e.host.toLowerCase(),s=e.isIPV6}else s=!0}i.reference=i.scheme===void 0&&i.userinfo===void 0&&i.host===void 0&&i.port===void 0&&i.query===void 0&&!i.path?`same-document`:i.scheme===void 0?`relative`:i.fragment===void 0?`absolute`:`uri`,r.reference&&r.reference!==`suffix`&&r.reference!==i.reference&&(i.error=i.error||`URI is not a `+r.reference+` reference.`);let d=f(r.scheme||i.scheme);if(!r.unicodeSupport&&(!d||!d.unicodeSupport)&&i.host&&(r.domainHost||d&&d.domainHost)&&s===!1&&u(i.host))try{i.host=new URL(`http://`+i.host).hostname}catch(e){i.error=i.error||`Host's domain name can not be converted to ASCII: `+e}if((!d||d&&!d.skipNormalize)&&(e.indexOf(`%`)!==-1&&(i.scheme!==void 0&&(i.scheme=unescape(i.scheme)),i.host!==void 0&&(i.host=c(unescape(i.host),s))),i.path&&=o(i.path),i.fragment))try{i.fragment=encodeURI(decodeURIComponent(i.fragment))}catch{i.error=i.error||`URI malformed`}d&&d.parse&&d.parse(i,r)}else i.error=i.error||`URI can not be parsed.`;return{parsed:i,malformedAuthorityOrPort:a}}function C(e,t){return S(e,t).parsed}function w(e,t){return T(e,t).normalized}function T(e,t){let{parsed:n,malformedAuthorityOrPort:r}=S(e,t);return{normalized:r?e:_(n,t),malformedAuthorityOrPort:r}}function ee(e,t){if(typeof e==`string`){let{normalized:n,malformedAuthorityOrPort:r}=T(e,t);return r?void 0:n}if(typeof e==`object`)return _(e,t)}let te={SCHEMES:d,normalize:p,resolve:m,resolveComponent:h,equal:g,serialize:_,parse:C};t.exports=te,t.exports.default=te,t.exports.fastUri=te})),jE=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=AE();t.code=`require("ajv/dist/runtime/uri").default`,e.default=t})),ME=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=CE();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var n=cE();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return n.CodeGen}});let r=wE(),i=TE(),a=pE(),o=EE(),s=cE(),c=SE(),l=hE(),u=lE(),d=DE(),f=jE(),p=(e,t)=>new RegExp(e,t);p.code=`new RegExp`;let m=[`removeAdditional`,`useDefaults`,`coerceTypes`],h=new Set([`validate`,`serialize`,`parse`,`wrapper`,`root`,`schema`,`keyword`,`pattern`,`formats`,`validate$data`,`func`,`obj`,`Error`]),g={errorDataPath:``,format:"`validateFormats: false` can be used instead.",nullable:`"nullable" keyword is supported by default.`,jsonPointers:`Deprecated jsPropertySyntax can be used instead.`,extendRefs:`Deprecated ignoreKeywordsWithRef can be used instead.`,missingRefs:`Pass empty schema with $id that should be ignored to ajv.addSchema.`,processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:`"uniqueItems" keyword is always validated.`,unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:`Map is used as cache, schema object as key.`,serialize:`Map is used as cache, schema object as key.`,ajvErrors:`It is default now.`},_={ignoreKeywordsWithRef:``,jsPropertySyntax:``,unicode:`"minLength"/"maxLength" account for unicode characters by default.`};function v(e){let t=e.strict,n=e.code?.optimize,r=n===!0||n===void 0?1:n||0,i=e.code?.regExp??p,a=e.uriResolver??f.default;return{strictSchema:e.strictSchema??t??!0,strictNumbers:e.strictNumbers??t??!0,strictTypes:e.strictTypes??t??`log`,strictTuples:e.strictTuples??t??`log`,strictRequired:e.strictRequired??t??!1,code:e.code?{...e.code,optimize:r,regExp:i}:{optimize:r,regExp:i},loopRequired:e.loopRequired??200,loopEnum:e.loopEnum??200,meta:e.meta??!0,messages:e.messages??!0,inlineRefs:e.inlineRefs??!0,schemaId:e.schemaId??`$id`,addUsedSchema:e.addUsedSchema??!0,validateSchema:e.validateSchema??!0,validateFormats:e.validateFormats??!0,unicodeRegExp:e.unicodeRegExp??!0,int32range:e.int32range??!0,uriResolver:a}}var y=class{constructor(e={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...v(e)};let{es5:t,lines:n}=this.opts.code;this.scope=new s.ValueScope({scope:{},prefixes:h,es5:t,lines:n}),this.logger=te(e.logger);let r=e.validateFormats;e.validateFormats=!1,this.RULES=(0,a.getRules)(),b.call(this,g,e,`NOT SUPPORTED`),b.call(this,_,e,`DEPRECATED`,`warn`),this._metaOpts=T.call(this),e.formats&&C.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&w.call(this,e.keywords),typeof e.meta==`object`&&this.addMetaSchema(e.meta),S.call(this),e.validateFormats=r}_addVocabularies(){this.addKeyword(`$async`)}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:n}=this.opts,r=d;n===`id`&&(r={...d},r.id=r.$id,delete r.$id),t&&e&&this.addMetaSchema(r,r[n],!1)}defaultMeta(){let{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta=typeof e==`object`?e[t]||e:void 0}validate(e,t){let n;if(typeof e==`string`){if(n=this.getSchema(e),!n)throw Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let r=n(t);return`$async`in n||(this.errors=n.errors),r}compile(e,t){let n=this._addSchema(e,t);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,t){if(typeof this.opts.loadSchema!=`function`)throw Error(`options.loadSchema should be a function`);let{loadSchema:n}=this.opts;return r.call(this,e,t);async function r(e,t){await a.call(this,e.$schema);let n=this._addSchema(e,t);return n.validate||o.call(this,n)}async function a(e){e&&!this.getSchema(e)&&await r.call(this,{$ref:e},!0)}async function o(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof i.default))throw t;return s.call(this,t),await c.call(this,t.missingSchema),o.call(this,e)}}function s({missingSchema:e,missingRef:t}){if(this.refs[e])throw Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function c(e){let n=await l.call(this,e);this.refs[e]||await a.call(this,n.$schema),this.refs[e]||this.addSchema(n,e,t)}async function l(e){let t=this._loading[e];if(t)return t;try{return await(this._loading[e]=n(e))}finally{delete this._loading[e]}}}addSchema(e,t,n,r=this.opts.validateSchema){if(Array.isArray(e)){for(let t of e)this.addSchema(t,void 0,n,r);return this}let i;if(typeof e==`object`){let{schemaId:t}=this.opts;if(i=e[t],i!==void 0&&typeof i!=`string`)throw Error(`schema ${t} must be string`)}return t=(0,c.normalizeId)(t||i),this._checkUnique(t),this.schemas[t]=this._addSchema(e,n,t,r,!0),this}addMetaSchema(e,t,n=this.opts.validateSchema){return this.addSchema(e,t,!0,n),this}validateSchema(e,t){if(typeof e==`boolean`)return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!=`string`)throw Error(`$schema must be a string`);if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn(`meta-schema not available`),this.errors=null,!0;let r=this.validate(n,e);if(!r&&t){let e=`schema is invalid: `+this.errorsText();if(this.opts.validateSchema===`log`)this.logger.error(e);else throw Error(e)}return r}getSchema(e){let t;for(;typeof(t=x.call(this,e))==`string`;)e=t;if(t===void 0){let{schemaId:n}=this.opts,r=new o.SchemaEnv({schema:{},schemaId:n});if(t=o.resolveSchema.call(this,r,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case`undefined`:return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case`string`:{let t=x.call(this,e);return typeof t==`object`&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case`object`:{let t=e;this._cache.delete(t);let n=e[this.opts.schemaId];return n&&(n=(0,c.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw Error(`ajv.removeSchema: invalid parameter`)}}addVocabulary(e){for(let t of e)this.addKeyword(t);return this}addKeyword(e,t){let n;if(typeof e==`string`)n=e,typeof t==`object`&&(this.logger.warn(`these parameters are deprecated, see docs for addKeyword`),t.keyword=n);else if(typeof e==`object`&&t===void 0){if(t=e,n=t.keyword,Array.isArray(n)&&!n.length)throw Error(`addKeywords: keyword must be string or non-empty array`)}else throw Error(`invalid addKeywords parameters`);if(re.call(this,n,t),!t)return(0,u.eachItem)(n,e=>ie.call(this,e)),this;oe.call(this,t);let r={...t,type:(0,l.getJSONTypes)(t.type),schemaType:(0,l.getJSONTypes)(t.schemaType)};return(0,u.eachItem)(n,r.type.length===0?e=>ie.call(this,e,r):e=>r.type.forEach(t=>ie.call(this,e,r,t))),this}getKeyword(e){let t=this.RULES.all[e];return typeof t==`object`?t.definition:!!t}removeKeyword(e){let{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(let n of t.rules){let t=n.rules.findIndex(t=>t.keyword===e);t>=0&&n.rules.splice(t,1)}return this}addFormat(e,t){return typeof t==`string`&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=`, `,dataVar:n=`data`}={}){return!e||e.length===0?`No errors`:e.map(e=>`${n}${e.instancePath} ${e.message}`).reduce((e,n)=>e+t+n)}$dataMetaSchema(e,t){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let r of t){let t=r.split(`/`).slice(1),i=e;for(let e of t)i=i[e];for(let e in n){let t=n[e];if(typeof t!=`object`)continue;let{$data:r}=t.definition,a=i[e];r&&a&&(i[e]=ce(a))}}return e}_removeAllSchemas(e,t){for(let n in e){let r=e[n];(!t||t.test(n))&&(typeof r==`string`?delete e[n]:r&&!r.meta&&(this._cache.delete(r.schema),delete e[n]))}}_addSchema(e,t,n,r=this.opts.validateSchema,i=this.opts.addUsedSchema){let a,{schemaId:s}=this.opts;if(typeof e==`object`)a=e[s];else if(this.opts.jtd)throw Error(`schema must be object`);else if(typeof e!=`boolean`)throw Error(`schema must be object or boolean`);let l=this._cache.get(e);if(l!==void 0)return l;n=(0,c.normalizeId)(a||n);let u=c.getSchemaRefs.call(this,e,n);return l=new o.SchemaEnv({schema:e,schemaId:s,meta:t,baseId:n,localRefs:u}),this._cache.set(l.schema,l),i&&!n.startsWith(`#`)&&(n&&this._checkUnique(n),this.refs[n]=l),r&&this.validateSchema(e,!0),l}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):o.compileSchema.call(this,e),!e.validate)throw Error(`ajv implementation error`);return e.validate}_compileMetaSchema(e){let t=this.opts;this.opts=this._metaOpts;try{o.compileSchema.call(this,e)}finally{this.opts=t}}};y.ValidationError=r.default,y.MissingRefError=i.default,e.default=y;function b(e,t,n,r=`error`){for(let i in e){let a=i;a in t&&this.logger[r](`${n}: option ${i}. ${e[a]}`)}}function x(e){return e=(0,c.normalizeId)(e),this.schemas[e]||this.refs[e]}function S(){let e=this.opts.schemas;if(e){if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}}function C(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}function w(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn(`keywords option as map is deprecated, pass array`);for(let t in e){let n=e[t];n.keyword||=t,this.addKeyword(n)}}function T(){let e={...this.opts};for(let t of m)delete e[t];return e}let ee={log(){},warn(){},error(){}};function te(e){if(e===!1)return ee;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw Error(`logger must implement log, warn and error methods`)}let ne=/^[a-z_$][a-z0-9_$:-]*$/i;function re(e,t){let{RULES:n}=this;if((0,u.eachItem)(e,e=>{if(n.keywords[e])throw Error(`Keyword ${e} is already defined`);if(!ne.test(e))throw Error(`Keyword ${e} has invalid name`)}),t&&t.$data&&!(`code`in t||`validate`in t))throw Error(`$data keyword must have "code" or "validate" function`)}function ie(e,t,n){var r;let i=t?.post;if(n&&i)throw Error(`keyword with "post" flag cannot have "type"`);let{RULES:a}=this,o=i?a.post:a.rules.find(({type:e})=>e===n);if(o||(o={type:n,rules:[]},a.rules.push(o)),a.keywords[e]=!0,!t)return;let s={keyword:e,definition:{...t,type:(0,l.getJSONTypes)(t.type),schemaType:(0,l.getJSONTypes)(t.schemaType)}};t.before?ae.call(this,o,s,t.before):o.rules.push(s),a.all[e]=s,(r=t.implements)==null||r.forEach(e=>this.addKeyword(e))}function ae(e,t,n){let r=e.rules.findIndex(e=>e.keyword===n);r>=0?e.rules.splice(r,0,t):(e.rules.push(t),this.logger.warn(`rule ${n} is not defined`))}function oe(e){let{metaSchema:t}=e;t!==void 0&&(e.$data&&this.opts.$data&&(t=ce(t)),e.validateSchema=this.compile(t,!0))}let se={$ref:`https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#`};function ce(e){return{anyOf:[e,se]}}})),NE=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={keyword:`id`,code(){throw Error(`NOT SUPPORTED: keyword "id", use "$id" for schema ID`)}}})),PE=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.callRef=e.getValidate=void 0;let t=TE(),n=_E(),r=cE(),i=uE(),a=EE(),o=lE(),s={keyword:`$ref`,schemaType:`string`,code(e){let{gen:n,schema:i,it:o}=e,{baseId:s,schemaEnv:u,validateName:d,opts:f,self:p}=o,{root:m}=u;if((i===`#`||i===`#/`)&&s===m.baseId)return g();let h=a.resolveRef.call(p,m,s,i);if(h===void 0)throw new t.default(o.opts.uriResolver,s,i);if(h instanceof a.SchemaEnv)return _(h);return v(h);function g(){if(u===m)return l(e,d,u,u.$async);let t=n.scopeValue(`root`,{ref:m});return l(e,(0,r._)`${t}.validate`,m,m.$async)}function _(t){l(e,c(e,t),t,t.$async)}function v(t){let a=n.scopeValue(`schema`,f.code.source===!0?{ref:t,code:(0,r.stringify)(t)}:{ref:t}),o=n.name(`valid`),s=e.subschema({schema:t,dataTypes:[],schemaPath:r.nil,topSchemaRef:a,errSchemaPath:i},o);e.mergeEvaluated(s),e.ok(o)}}};function c(e,t){let{gen:n}=e;return t.validate?n.scopeValue(`validate`,{ref:t.validate}):(0,r._)`${n.scopeValue(`wrapper`,{ref:t})}.validate`}e.getValidate=c;function l(e,t,a,s){let{gen:c,it:l}=e,{allErrors:u,schemaEnv:d,opts:f}=l,p=f.passContext?i.default.this:r.nil;s?m():h();function m(){if(!d.$async)throw Error(`async schema referenced by sync schema`);let i=c.let(`valid`);c.try(()=>{c.code((0,r._)`await ${(0,n.callValidateCode)(e,t,p)}`),_(t),u||c.assign(i,!0)},e=>{c.if((0,r._)`!(${e} instanceof ${l.ValidationError})`,()=>c.throw(e)),g(e),u||c.assign(i,!1)}),e.ok(i)}function h(){e.result((0,n.callValidateCode)(e,t,p),()=>_(t),()=>g(t))}function g(e){let t=(0,r._)`${e}.errors`;c.assign(i.default.vErrors,(0,r._)`${i.default.vErrors} === null ? ${t} : ${i.default.vErrors}.concat(${t})`),c.assign(i.default.errors,(0,r._)`${i.default.vErrors}.length`)}function _(e){if(!l.opts.unevaluated)return;let t=a?.validate?.evaluated;if(l.props!==!0){if(t&&!t.dynamicProps)t.props!==void 0&&(l.props=o.mergeEvaluated.props(c,t.props,l.props));else{let t=c.var(`props`,(0,r._)`${e}.evaluated.props`);l.props=o.mergeEvaluated.props(c,t,l.props,r.Name)}}if(l.items!==!0){if(t&&!t.dynamicItems)t.items!==void 0&&(l.items=o.mergeEvaluated.items(c,t.items,l.items));else{let t=c.var(`items`,(0,r._)`${e}.evaluated.items`);l.items=o.mergeEvaluated.items(c,t,l.items,r.Name)}}}}e.callRef=l,e.default=s})),FE=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=NE(),n=PE();e.default=[`$schema`,`$id`,`$defs`,`$vocabulary`,{keyword:`$comment`},`definitions`,t.default,n.default]})),IE=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cE(),n=t.operators,r={maximum:{okStr:`<=`,ok:n.LTE,fail:n.GT},minimum:{okStr:`>=`,ok:n.GTE,fail:n.LT},exclusiveMaximum:{okStr:`<`,ok:n.LT,fail:n.GTE},exclusiveMinimum:{okStr:`>`,ok:n.GT,fail:n.LTE}};e.default={keyword:Object.keys(r),type:`number`,schemaType:`number`,$data:!0,error:{message:({keyword:e,schemaCode:n})=>(0,t.str)`must be ${r[e].okStr} ${n}`,params:({keyword:e,schemaCode:n})=>(0,t._)`{comparison: ${r[e].okStr}, limit: ${n}}`},code(e){let{keyword:n,data:i,schemaCode:a}=e;e.fail$data((0,t._)`${i} ${r[n].fail} ${a} || isNaN(${i})`)}}})),LE=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cE();e.default={keyword:`multipleOf`,type:`number`,schemaType:`number`,$data:!0,error:{message:({schemaCode:e})=>(0,t.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,t._)`{multipleOf: ${e}}`},code(e){let{gen:n,data:r,schemaCode:i,it:a}=e,o=a.opts.multipleOfPrecision,s=n.let(`res`),c=o?(0,t._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${o}`:(0,t._)`${s} !== parseInt(${s})`;e.fail$data((0,t._)`(${i} === 0 || (${s} = ${r}/${i}, ${c}))`)}}})),RE=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});function t(e){let t=e.length,n=0,r=0,i;for(;r<t;)n++,i=e.charCodeAt(r++),i>=55296&&i<=56319&&r<t&&(i=e.charCodeAt(r),(i&64512)==56320&&r++);return n}e.default=t,t.code=`require("ajv/dist/runtime/ucs2length").default`})),zE=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cE(),n=lE(),r=RE();e.default={keyword:[`maxLength`,`minLength`],type:`string`,schemaType:`number`,$data:!0,error:{message({keyword:e,schemaCode:n}){let r=e===`maxLength`?`more`:`fewer`;return(0,t.str)`must NOT have ${r} than ${n} characters`},params:({schemaCode:e})=>(0,t._)`{limit: ${e}}`},code(e){let{keyword:i,data:a,schemaCode:o,it:s}=e,c=i===`maxLength`?t.operators.GT:t.operators.LT,l=s.opts.unicode===!1?(0,t._)`${a}.length`:(0,t._)`${(0,n.useFunc)(e.gen,r.default)}(${a})`;e.fail$data((0,t._)`${l} ${c} ${o}`)}}})),BE=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=_E(),n=lE(),r=cE();e.default={keyword:`pattern`,type:`string`,schemaType:`string`,$data:!0,error:{message:({schemaCode:e})=>(0,r.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,r._)`{pattern: ${e}}`},code(e){let{gen:i,data:a,$data:o,schema:s,schemaCode:c,it:l}=e,u=l.opts.unicodeRegExp?`u`:``;if(o){let{regExp:t}=l.opts.code,o=t.code===`new RegExp`?(0,r._)`new RegExp`:(0,n.useFunc)(i,t),s=i.let(`valid`);i.try(()=>i.assign(s,(0,r._)`${o}(${c}, ${u}).test(${a})`),()=>i.assign(s,!1)),e.fail$data((0,r._)`!${s}`)}else{let n=(0,t.usePattern)(e,s);e.fail$data((0,r._)`!${n}.test(${a})`)}}}})),ire=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cE();e.default={keyword:[`maxProperties`,`minProperties`],type:`object`,schemaType:`number`,$data:!0,error:{message({keyword:e,schemaCode:n}){let r=e===`maxProperties`?`more`:`fewer`;return(0,t.str)`must NOT have ${r} than ${n} properties`},params:({schemaCode:e})=>(0,t._)`{limit: ${e}}`},code(e){let{keyword:n,data:r,schemaCode:i}=e,a=n===`maxProperties`?t.operators.GT:t.operators.LT;e.fail$data((0,t._)`Object.keys(${r}).length ${a} ${i}`)}}})),are=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=_E(),n=cE(),r=lE();e.default={keyword:`required`,type:`object`,schemaType:`array`,$data:!0,error:{message:({params:{missingProperty:e}})=>(0,n.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,n._)`{missingProperty: ${e}}`},code(e){let{gen:i,schema:a,schemaCode:o,data:s,$data:c,it:l}=e,{opts:u}=l;if(!c&&a.length===0)return;let d=a.length>=u.loopRequired;if(l.allErrors?f():p(),u.strictRequired){let t=e.parentSchema.properties,{definedProperties:n}=e.it;for(let e of a)if(t?.[e]===void 0&&!n.has(e)){let t=`required property "${e}" is not defined at "${l.schemaEnv.baseId+l.errSchemaPath}" (strictRequired)`;(0,r.checkStrictMode)(l,t,l.opts.strictRequired)}}function f(){if(d||c)e.block$data(n.nil,m);else for(let n of a)(0,t.checkReportMissingProp)(e,n)}function p(){let n=i.let(`missing`);if(d||c){let t=i.let(`valid`,!0);e.block$data(t,()=>h(n,t)),e.ok(t)}else i.if((0,t.checkMissingProp)(e,a,n)),(0,t.reportMissingProp)(e,n),i.else()}function m(){i.forOf(`prop`,o,n=>{e.setParams({missingProperty:n}),i.if((0,t.noPropertyInData)(i,s,n,u.ownProperties),()=>e.error())})}function h(r,a){e.setParams({missingProperty:r}),i.forOf(r,o,()=>{i.assign(a,(0,t.propertyInData)(i,s,r,u.ownProperties)),i.if((0,n.not)(a),()=>{e.error(),i.break()})},n.nil)}}}})),ore=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cE();e.default={keyword:[`maxItems`,`minItems`],type:`array`,schemaType:`number`,$data:!0,error:{message({keyword:e,schemaCode:n}){let r=e===`maxItems`?`more`:`fewer`;return(0,t.str)`must NOT have ${r} than ${n} items`},params:({schemaCode:e})=>(0,t._)`{limit: ${e}}`},code(e){let{keyword:n,data:r,schemaCode:i}=e,a=n===`maxItems`?t.operators.GT:t.operators.LT;e.fail$data((0,t._)`${r}.length ${a} ${i}`)}}})),VE=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=bE();t.code=`require("ajv/dist/runtime/equal").default`,e.default=t})),sre=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=hE(),n=cE(),r=lE(),i=VE();e.default={keyword:`uniqueItems`,type:`array`,schemaType:`boolean`,$data:!0,error:{message:({params:{i:e,j:t}})=>(0,n.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,n._)`{i: ${e}, j: ${t}}`},code(e){let{gen:a,data:o,$data:s,schema:c,parentSchema:l,schemaCode:u,it:d}=e;if(!s&&!c)return;let f=a.let(`valid`),p=l.items?(0,t.getSchemaTypes)(l.items):[];e.block$data(f,m,(0,n._)`${u} === false`),e.ok(f);function m(){let t=a.let(`i`,(0,n._)`${o}.length`),r=a.let(`j`);e.setParams({i:t,j:r}),a.assign(f,!0),a.if((0,n._)`${t} > 1`,()=>(h()?g:_)(t,r))}function h(){return p.length>0&&!p.some(e=>e===`object`||e===`array`)}function g(r,i){let s=a.name(`item`),c=(0,t.checkDataTypes)(p,s,d.opts.strictNumbers,t.DataType.Wrong),l=a.const(`indices`,(0,n._)`{}`);a.for((0,n._)`;${r}--;`,()=>{a.let(s,(0,n._)`${o}[${r}]`),a.if(c,(0,n._)`continue`),p.length>1&&a.if((0,n._)`typeof ${s} == "string"`,(0,n._)`${s} += "_"`),a.if((0,n._)`typeof ${l}[${s}] == "number"`,()=>{a.assign(i,(0,n._)`${l}[${s}]`),e.error(),a.assign(f,!1).break()}).code((0,n._)`${l}[${s}] = ${r}`)})}function _(t,s){let c=(0,r.useFunc)(a,i.default),l=a.name(`outer`);a.label(l).for((0,n._)`;${t}--;`,()=>a.for((0,n._)`${s} = ${t}; ${s}--;`,()=>a.if((0,n._)`${c}(${o}[${t}], ${o}[${s}])`,()=>{e.error(),a.assign(f,!1).break(l)})))}}}})),cre=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cE(),n=lE(),r=VE();e.default={keyword:`const`,$data:!0,error:{message:`must be equal to constant`,params:({schemaCode:e})=>(0,t._)`{allowedValue: ${e}}`},code(e){let{gen:i,data:a,$data:o,schemaCode:s,schema:c}=e;o||c&&typeof c==`object`?e.fail$data((0,t._)`!${(0,n.useFunc)(i,r.default)}(${a}, ${s})`):e.fail((0,t._)`${c} !== ${a}`)}}})),lre=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cE(),n=lE(),r=VE();e.default={keyword:`enum`,schemaType:`array`,$data:!0,error:{message:`must be equal to one of the allowed values`,params:({schemaCode:e})=>(0,t._)`{allowedValues: ${e}}`},code(e){let{gen:i,data:a,$data:o,schema:s,schemaCode:c,it:l}=e;if(!o&&s.length===0)throw Error(`enum must have non-empty array`);let u=s.length>=l.opts.loopEnum,d,f=()=>d??=(0,n.useFunc)(i,r.default),p;if(u||o)p=i.let(`valid`),e.block$data(p,m);else{if(!Array.isArray(s))throw Error(`ajv implementation error`);let e=i.const(`vSchema`,c);p=(0,t.or)(...s.map((t,n)=>h(e,n)))}e.pass(p);function m(){i.assign(p,!1),i.forOf(`v`,c,e=>i.if((0,t._)`${f()}(${a}, ${e})`,()=>i.assign(p,!0).break()))}function h(e,n){let r=s[n];return typeof r==`object`&&r?(0,t._)`${f()}(${a}, ${e}[${n}])`:(0,t._)`${a} === ${r}`}}}})),HE=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=IE(),n=LE(),r=zE(),i=BE(),a=ire(),o=are(),s=ore(),c=sre(),l=cre(),u=lre();e.default=[t.default,n.default,r.default,i.default,a.default,o.default,s.default,c.default,{keyword:`type`,schemaType:[`string`,`array`]},{keyword:`nullable`,schemaType:`boolean`},l.default,u.default]})),UE=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateAdditionalItems=void 0;let t=cE(),n=lE(),r={keyword:`additionalItems`,type:`array`,schemaType:[`boolean`,`object`],before:`uniqueItems`,error:{message:({params:{len:e}})=>(0,t.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,t._)`{limit: ${e}}`},code(e){let{parentSchema:t,it:r}=e,{items:a}=t;if(!Array.isArray(a)){(0,n.checkStrictMode)(r,`"additionalItems" is ignored when "items" is not an array of schemas`);return}i(e,a)}};function i(e,r){let{gen:i,schema:a,data:o,keyword:s,it:c}=e;c.items=!0;let l=i.const(`len`,(0,t._)`${o}.length`);if(a===!1)e.setParams({len:r.length}),e.pass((0,t._)`${l} <= ${r.length}`);else if(typeof a==`object`&&!(0,n.alwaysValidSchema)(c,a)){let n=i.var(`valid`,(0,t._)`${l} <= ${r.length}`);i.if((0,t.not)(n),()=>u(n)),e.ok(n)}function u(a){i.forRange(`i`,r.length,l,r=>{e.subschema({keyword:s,dataProp:r,dataPropType:n.Type.Num},a),c.allErrors||i.if((0,t.not)(a),()=>i.break())})}}e.validateAdditionalItems=i,e.default=r})),WE=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateTuple=void 0;let t=cE(),n=lE(),r=_E(),i={keyword:`items`,type:`array`,schemaType:[`object`,`array`,`boolean`],before:`uniqueItems`,code(e){let{schema:t,it:i}=e;if(Array.isArray(t))return a(e,`additionalItems`,t);i.items=!0,!(0,n.alwaysValidSchema)(i,t)&&e.ok((0,r.validateArray)(e))}};function a(e,r,i=e.schema){let{gen:a,parentSchema:o,data:s,keyword:c,it:l}=e;f(o),l.opts.unevaluated&&i.length&&l.items!==!0&&(l.items=n.mergeEvaluated.items(a,i.length,l.items));let u=a.name(`valid`),d=a.const(`len`,(0,t._)`${s}.length`);i.forEach((r,i)=>{(0,n.alwaysValidSchema)(l,r)||(a.if((0,t._)`${d} > ${i}`,()=>e.subschema({keyword:c,schemaProp:i,dataProp:i},u)),e.ok(u))});function f(e){let{opts:t,errSchemaPath:a}=l,o=i.length,s=o===e.minItems&&(o===e.maxItems||e[r]===!1);if(t.strictTuples&&!s){let e=`"${c}" is ${o}-tuple, but minItems or maxItems/${r} are not specified or different at path "${a}"`;(0,n.checkStrictMode)(l,e,t.strictTuples)}}}e.validateTuple=a,e.default=i})),ure=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=WE();e.default={keyword:`prefixItems`,type:`array`,schemaType:[`array`],before:`uniqueItems`,code:e=>(0,t.validateTuple)(e,`items`)}})),dre=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cE(),n=lE(),r=_E(),i=UE();e.default={keyword:`items`,type:`array`,schemaType:[`object`,`boolean`],before:`uniqueItems`,error:{message:({params:{len:e}})=>(0,t.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,t._)`{limit: ${e}}`},code(e){let{schema:t,parentSchema:a,it:o}=e,{prefixItems:s}=a;o.items=!0,!(0,n.alwaysValidSchema)(o,t)&&(s?(0,i.validateAdditionalItems)(e,s):e.ok((0,r.validateArray)(e)))}}})),fre=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cE(),n=lE();e.default={keyword:`contains`,type:`array`,schemaType:[`object`,`boolean`],before:`uniqueItems`,trackErrors:!0,error:{message:({params:{min:e,max:n}})=>n===void 0?(0,t.str)`must contain at least ${e} valid item(s)`:(0,t.str)`must contain at least ${e} and no more than ${n} valid item(s)`,params:({params:{min:e,max:n}})=>n===void 0?(0,t._)`{minContains: ${e}}`:(0,t._)`{minContains: ${e}, maxContains: ${n}}`},code(e){let{gen:r,schema:i,parentSchema:a,data:o,it:s}=e,c,l,{minContains:u,maxContains:d}=a;s.opts.next?(c=u===void 0?1:u,l=d):c=1;let f=r.const(`len`,(0,t._)`${o}.length`);if(e.setParams({min:c,max:l}),l===void 0&&c===0){(0,n.checkStrictMode)(s,`"minContains" == 0 without "maxContains": "contains" keyword ignored`);return}if(l!==void 0&&c>l){(0,n.checkStrictMode)(s,`"minContains" > "maxContains" is always invalid`),e.fail();return}if((0,n.alwaysValidSchema)(s,i)){let n=(0,t._)`${f} >= ${c}`;l!==void 0&&(n=(0,t._)`${n} && ${f} <= ${l}`),e.pass(n);return}s.items=!0;let p=r.name(`valid`);l===void 0&&c===1?h(p,()=>r.if(p,()=>r.break())):c===0?(r.let(p,!0),l!==void 0&&r.if((0,t._)`${o}.length > 0`,m)):(r.let(p,!1),m()),e.result(p,()=>e.reset());function m(){let e=r.name(`_valid`),t=r.let(`count`,0);h(e,()=>r.if(e,()=>g(t)))}function h(t,i){r.forRange(`i`,0,f,r=>{e.subschema({keyword:`contains`,dataProp:r,dataPropType:n.Type.Num,compositeRule:!0},t),i()})}function g(e){r.code((0,t._)`${e}++`),l===void 0?r.if((0,t._)`${e} >= ${c}`,()=>r.assign(p,!0).break()):(r.if((0,t._)`${e} > ${l}`,()=>r.assign(p,!1).break()),c===1?r.assign(p,!0):r.if((0,t._)`${e} >= ${c}`,()=>r.assign(p,!0)))}}}})),GE=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;let t=cE(),n=lE(),r=_E();e.error={message:({params:{property:e,depsCount:n,deps:r}})=>{let i=n===1?`property`:`properties`;return(0,t.str)`must have ${i} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:n,deps:r,missingProperty:i}})=>(0,t._)`{property: ${e},
|
|
194
|
+
missingProperty: ${i},
|
|
195
|
+
depsCount: ${n},
|
|
196
|
+
deps: ${r}}`};let i={keyword:`dependencies`,type:`object`,schemaType:`object`,error:e.error,code(e){let[t,n]=a(e);o(e,t),s(e,n)}};function a({schema:e}){let t={},n={};for(let r in e){if(r===`__proto__`)continue;let i=Array.isArray(e[r])?t:n;i[r]=e[r]}return[t,n]}function o(e,n=e.schema){let{gen:i,data:a,it:o}=e;if(Object.keys(n).length===0)return;let s=i.let(`missing`);for(let c in n){let l=n[c];if(l.length===0)continue;let u=(0,r.propertyInData)(i,a,c,o.opts.ownProperties);e.setParams({property:c,depsCount:l.length,deps:l.join(`, `)}),o.allErrors?i.if(u,()=>{for(let t of l)(0,r.checkReportMissingProp)(e,t)}):(i.if((0,t._)`${u} && (${(0,r.checkMissingProp)(e,l,s)})`),(0,r.reportMissingProp)(e,s),i.else())}}e.validatePropertyDeps=o;function s(e,t=e.schema){let{gen:i,data:a,keyword:o,it:s}=e,c=i.name(`valid`);for(let l in t)(0,n.alwaysValidSchema)(s,t[l])||(i.if((0,r.propertyInData)(i,a,l,s.opts.ownProperties),()=>{let t=e.subschema({keyword:o,schemaProp:l},c);e.mergeValidEvaluated(t,c)},()=>i.var(c,!0)),e.ok(c))}e.validateSchemaDeps=s,e.default=i})),pre=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cE(),n=lE();e.default={keyword:`propertyNames`,type:`object`,schemaType:[`object`,`boolean`],error:{message:`property name must be valid`,params:({params:e})=>(0,t._)`{propertyName: ${e.propertyName}}`},code(e){let{gen:r,schema:i,data:a,it:o}=e;if((0,n.alwaysValidSchema)(o,i))return;let s=r.name(`valid`);r.forIn(`key`,a,n=>{e.setParams({propertyName:n}),e.subschema({keyword:`propertyNames`,data:n,dataTypes:[`string`],propertyName:n,compositeRule:!0},s),r.if((0,t.not)(s),()=>{e.error(!0),o.allErrors||r.break()})}),e.ok(s)}}})),KE=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=_E(),n=cE(),r=uE(),i=lE();e.default={keyword:`additionalProperties`,type:[`object`],schemaType:[`boolean`,`object`],allowUndefined:!0,trackErrors:!0,error:{message:`must NOT have additional properties`,params:({params:e})=>(0,n._)`{additionalProperty: ${e.additionalProperty}}`},code(e){let{gen:a,schema:o,parentSchema:s,data:c,errsCount:l,it:u}=e;if(!l)throw Error(`ajv implementation error`);let{allErrors:d,opts:f}=u;if(u.props=!0,f.removeAdditional!==`all`&&(0,i.alwaysValidSchema)(u,o))return;let p=(0,t.allSchemaProperties)(s.properties),m=(0,t.allSchemaProperties)(s.patternProperties);h(),e.ok((0,n._)`${l} === ${r.default.errors}`);function h(){a.forIn(`key`,c,e=>{!p.length&&!m.length?v(e):a.if(g(e),()=>v(e))})}function g(r){let o;if(p.length>8){let e=(0,i.schemaRefOrVal)(u,s.properties,`properties`);o=(0,t.isOwnProperty)(a,e,r)}else o=p.length?(0,n.or)(...p.map(e=>(0,n._)`${r} === ${e}`)):n.nil;return m.length&&(o=(0,n.or)(o,...m.map(i=>(0,n._)`${(0,t.usePattern)(e,i)}.test(${r})`))),(0,n.not)(o)}function _(e){a.code((0,n._)`delete ${c}[${e}]`)}function v(t){if(f.removeAdditional===`all`||f.removeAdditional&&o===!1){_(t);return}if(o===!1){e.setParams({additionalProperty:t}),e.error(),d||a.break();return}if(typeof o==`object`&&!(0,i.alwaysValidSchema)(u,o)){let r=a.name(`valid`);f.removeAdditional===`failing`?(y(t,r,!1),a.if((0,n.not)(r),()=>{e.reset(),_(t)})):(y(t,r),d||a.if((0,n.not)(r),()=>a.break()))}}function y(t,n,r){let a={keyword:`additionalProperties`,dataProp:t,dataPropType:i.Type.Str};r===!1&&Object.assign(a,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(a,n)}}}})),mre=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=CE(),n=_E(),r=lE(),i=KE();e.default={keyword:`properties`,type:`object`,schemaType:`object`,code(e){let{gen:a,schema:o,parentSchema:s,data:c,it:l}=e;l.opts.removeAdditional===`all`&&s.additionalProperties===void 0&&i.default.code(new t.KeywordCxt(l,i.default,`additionalProperties`));let u=(0,n.allSchemaProperties)(o);for(let e of u)l.definedProperties.add(e);l.opts.unevaluated&&u.length&&l.props!==!0&&(l.props=r.mergeEvaluated.props(a,(0,r.toHash)(u),l.props));let d=u.filter(e=>!(0,r.alwaysValidSchema)(l,o[e]));if(d.length===0)return;let f=a.name(`valid`);for(let t of d)p(t)?m(t):(a.if((0,n.propertyInData)(a,c,t,l.opts.ownProperties)),m(t),l.allErrors||a.else().var(f,!0),a.endIf()),e.it.definedProperties.add(t),e.ok(f);function p(e){return l.opts.useDefaults&&!l.compositeRule&&o[e].default!==void 0}function m(t){e.subschema({keyword:`properties`,schemaProp:t,dataProp:t},f)}}}})),hre=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=_E(),n=cE(),r=lE(),i=lE();e.default={keyword:`patternProperties`,type:`object`,schemaType:`object`,code(e){let{gen:a,schema:o,data:s,parentSchema:c,it:l}=e,{opts:u}=l,d=(0,t.allSchemaProperties)(o),f=d.filter(e=>(0,r.alwaysValidSchema)(l,o[e]));if(d.length===0||f.length===d.length&&(!l.opts.unevaluated||l.props===!0))return;let p=u.strictSchema&&!u.allowMatchingProperties&&c.properties,m=a.name(`valid`);l.props!==!0&&!(l.props instanceof n.Name)&&(l.props=(0,i.evaluatedPropsToName)(a,l.props));let{props:h}=l;g();function g(){for(let e of d)p&&_(e),l.allErrors?v(e):(a.var(m,!0),v(e),a.if(m))}function _(e){for(let t in p)new RegExp(e).test(t)&&(0,r.checkStrictMode)(l,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}function v(r){a.forIn(`key`,s,o=>{a.if((0,n._)`${(0,t.usePattern)(e,r)}.test(${o})`,()=>{let t=f.includes(r);t||e.subschema({keyword:`patternProperties`,schemaProp:r,dataProp:o,dataPropType:i.Type.Str},m),l.opts.unevaluated&&h!==!0?a.assign((0,n._)`${h}[${o}]`,!0):!t&&!l.allErrors&&a.if((0,n.not)(m),()=>a.break())})})}}}})),gre=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=lE();e.default={keyword:`not`,schemaType:[`object`,`boolean`],trackErrors:!0,code(e){let{gen:n,schema:r,it:i}=e;if((0,t.alwaysValidSchema)(i,r)){e.fail();return}let a=n.name(`valid`);e.subschema({keyword:`not`,compositeRule:!0,createErrors:!1,allErrors:!1},a),e.failResult(a,()=>e.reset(),()=>e.error())},error:{message:`must NOT be valid`}}})),_re=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={keyword:`anyOf`,schemaType:`array`,trackErrors:!0,code:_E().validateUnion,error:{message:`must match a schema in anyOf`}}})),vre=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cE(),n=lE();e.default={keyword:`oneOf`,schemaType:`array`,trackErrors:!0,error:{message:`must match exactly one schema in oneOf`,params:({params:e})=>(0,t._)`{passingSchemas: ${e.passing}}`},code(e){let{gen:r,schema:i,parentSchema:a,it:o}=e;if(!Array.isArray(i))throw Error(`ajv implementation error`);if(o.opts.discriminator&&a.discriminator)return;let s=i,c=r.let(`valid`,!1),l=r.let(`passing`,null),u=r.name(`_valid`);e.setParams({passing:l}),r.block(d),e.result(c,()=>e.reset(),()=>e.error(!0));function d(){s.forEach((i,a)=>{let s;(0,n.alwaysValidSchema)(o,i)?r.var(u,!0):s=e.subschema({keyword:`oneOf`,schemaProp:a,compositeRule:!0},u),a>0&&r.if((0,t._)`${u} && ${c}`).assign(c,!1).assign(l,(0,t._)`[${l}, ${a}]`).else(),r.if(u,()=>{r.assign(c,!0),r.assign(l,a),s&&e.mergeEvaluated(s,t.Name)})})}}}})),yre=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=lE();e.default={keyword:`allOf`,schemaType:`array`,code(e){let{gen:n,schema:r,it:i}=e;if(!Array.isArray(r))throw Error(`ajv implementation error`);let a=n.name(`valid`);r.forEach((n,r)=>{if((0,t.alwaysValidSchema)(i,n))return;let o=e.subschema({keyword:`allOf`,schemaProp:r},a);e.ok(a),e.mergeEvaluated(o)})}}})),bre=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cE(),n=lE(),r={keyword:`if`,schemaType:[`object`,`boolean`],trackErrors:!0,error:{message:({params:e})=>(0,t.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,t._)`{failingKeyword: ${e.ifClause}}`},code(e){let{gen:r,parentSchema:a,it:o}=e;a.then===void 0&&a.else===void 0&&(0,n.checkStrictMode)(o,`"if" without "then" and "else" is ignored`);let s=i(o,`then`),c=i(o,`else`);if(!s&&!c)return;let l=r.let(`valid`,!0),u=r.name(`_valid`);if(d(),e.reset(),s&&c){let t=r.let(`ifClause`);e.setParams({ifClause:t}),r.if(u,f(`then`,t),f(`else`,t))}else s?r.if(u,f(`then`)):r.if((0,t.not)(u),f(`else`));e.pass(l,()=>e.error(!0));function d(){let t=e.subschema({keyword:`if`,compositeRule:!0,createErrors:!1,allErrors:!1},u);e.mergeEvaluated(t)}function f(n,i){return()=>{let a=e.subschema({keyword:n},u);r.assign(l,u),e.mergeValidEvaluated(a,l),i?r.assign(i,(0,t._)`${n}`):e.setParams({ifClause:n})}}}};function i(e,t){let r=e.schema[t];return r!==void 0&&!(0,n.alwaysValidSchema)(e,r)}e.default=r})),xre=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=lE();e.default={keyword:[`then`,`else`],schemaType:[`object`,`boolean`],code({keyword:e,parentSchema:n,it:r}){n.if===void 0&&(0,t.checkStrictMode)(r,`"${e}" without "if" is ignored`)}}})),qE=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=UE(),n=ure(),r=WE(),i=dre(),a=fre(),o=GE(),s=pre(),c=KE(),l=mre(),u=hre(),d=gre(),f=_re(),p=vre(),m=yre(),h=bre(),g=xre();function _(e=!1){let _=[d.default,f.default,p.default,m.default,h.default,g.default,s.default,c.default,o.default,l.default,u.default];return e?_.push(n.default,i.default):_.push(t.default,r.default),_.push(a.default),_}e.default=_})),Sre=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cE();e.default={keyword:`format`,type:[`number`,`string`],schemaType:`string`,$data:!0,error:{message:({schemaCode:e})=>(0,t.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,t._)`{format: ${e}}`},code(e,n){let{gen:r,data:i,$data:a,schema:o,schemaCode:s,it:c}=e,{opts:l,errSchemaPath:u,schemaEnv:d,self:f}=c;if(!l.validateFormats)return;a?p():m();function p(){let a=r.scopeValue(`formats`,{ref:f.formats,code:l.code.formats}),o=r.const(`fDef`,(0,t._)`${a}[${s}]`),c=r.let(`fType`),u=r.let(`format`);r.if((0,t._)`typeof ${o} == "object" && !(${o} instanceof RegExp)`,()=>r.assign(c,(0,t._)`${o}.type || "string"`).assign(u,(0,t._)`${o}.validate`),()=>r.assign(c,(0,t._)`"string"`).assign(u,o)),e.fail$data((0,t.or)(p(),m()));function p(){return l.strictSchema===!1?t.nil:(0,t._)`${s} && !${u}`}function m(){let e=d.$async?(0,t._)`(${o}.async ? await ${u}(${i}) : ${u}(${i}))`:(0,t._)`${u}(${i})`,r=(0,t._)`(typeof ${u} == "function" ? ${e} : ${u}.test(${i}))`;return(0,t._)`${u} && ${u} !== true && ${c} === ${n} && !${r}`}}function m(){let a=f.formats[o];if(!a){m();return}if(a===!0)return;let[s,c,p]=h(a);s===n&&e.pass(g());function m(){if(l.strictSchema===!1){f.logger.warn(e());return}throw Error(e());function e(){return`unknown format "${o}" ignored in schema at path "${u}"`}}function h(e){let n=e instanceof RegExp?(0,t.regexpCode)(e):l.code.formats?(0,t._)`${l.code.formats}${(0,t.getProperty)(o)}`:void 0,i=r.scopeValue(`formats`,{key:o,ref:e,code:n});return typeof e==`object`&&!(e instanceof RegExp)?[e.type||`string`,e.validate,(0,t._)`${i}.validate`]:[`string`,e,i]}function g(){if(typeof a==`object`&&!(a instanceof RegExp)&&a.async){if(!d.$async)throw Error(`async format in sync schema`);return(0,t._)`await ${p}(${i})`}return typeof c==`function`?(0,t._)`${p}(${i})`:(0,t._)`${p}.test(${i})`}}}}})),JE=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=[Sre().default]})),YE=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.contentVocabulary=e.metadataVocabulary=void 0,e.metadataVocabulary=[`title`,`description`,`default`,`deprecated`,`readOnly`,`writeOnly`,`examples`],e.contentVocabulary=[`contentMediaType`,`contentEncoding`,`contentSchema`]})),XE=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=FE(),n=HE(),r=qE(),i=JE(),a=YE();e.default=[t.default,n.default,(0,r.default)(),i.default,a.metadataVocabulary,a.contentVocabulary]})),Cre=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DiscrError=void 0;var t;(function(e){e.Tag=`tag`,e.Mapping=`mapping`})(t||(e.DiscrError=t={}))})),ZE=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cE(),n=Cre(),r=EE(),i=TE(),a=lE();e.default={keyword:`discriminator`,type:`object`,schemaType:`object`,error:{message:({params:{discrError:e,tagName:t}})=>e===n.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:n,tagName:r}})=>(0,t._)`{error: ${e}, tag: ${r}, tagValue: ${n}}`},code(e){let{gen:o,data:s,schema:c,parentSchema:l,it:u}=e,{oneOf:d}=l;if(!u.opts.discriminator)throw Error(`discriminator: requires discriminator option`);let f=c.propertyName;if(typeof f!=`string`)throw Error(`discriminator: requires propertyName`);if(c.mapping)throw Error(`discriminator: mapping is not supported`);if(!d)throw Error(`discriminator: requires oneOf keyword`);let p=o.let(`valid`,!1),m=o.const(`tag`,(0,t._)`${s}${(0,t.getProperty)(f)}`);o.if((0,t._)`typeof ${m} == "string"`,()=>h(),()=>e.error(!1,{discrError:n.DiscrError.Tag,tag:m,tagName:f})),e.ok(p);function h(){let r=_();o.if(!1);for(let e in r)o.elseIf((0,t._)`${m} === ${e}`),o.assign(p,g(r[e]));o.else(),e.error(!1,{discrError:n.DiscrError.Mapping,tag:m,tagName:f}),o.endIf()}function g(n){let r=o.name(`valid`),i=e.subschema({keyword:`oneOf`,schemaProp:n},r);return e.mergeEvaluated(i,t.Name),r}function _(){let e={},t=o(l),n=!0;for(let e=0;e<d.length;e++){let c=d[e];if(c?.$ref&&!(0,a.schemaHasRulesButRef)(c,u.self.RULES)){let e=c.$ref;if(c=r.resolveRef.call(u.self,u.schemaEnv.root,u.baseId,e),c instanceof r.SchemaEnv&&(c=c.schema),c===void 0)throw new i.default(u.opts.uriResolver,u.baseId,e)}let l=c?.properties?.[f];if(typeof l!=`object`)throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${f}"`);n&&=t||o(c),s(l,e)}if(!n)throw Error(`discriminator: "${f}" must be required`);return e;function o({required:e}){return Array.isArray(e)&&e.includes(f)}function s(e,t){if(e.const)c(e.const,t);else if(e.enum)for(let n of e.enum)c(n,t);else throw Error(`discriminator: "properties/${f}" must have "const" or "enum"`)}function c(t,n){if(typeof t!=`string`||t in e)throw Error(`discriminator: "${f}" values must be unique strings`);e[t]=n}}}}})),wre=r(((e,t)=>{t.exports={$schema:`http://json-schema.org/draft-07/schema#`,$id:`http://json-schema.org/draft-07/schema#`,title:`Core schema meta-schema`,definitions:{schemaArray:{type:`array`,minItems:1,items:{$ref:`#`}},nonNegativeInteger:{type:`integer`,minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:`#/definitions/nonNegativeInteger`},{default:0}]},simpleTypes:{enum:[`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`]},stringArray:{type:`array`,items:{type:`string`},uniqueItems:!0,default:[]}},type:[`object`,`boolean`],properties:{$id:{type:`string`,format:`uri-reference`},$schema:{type:`string`,format:`uri`},$ref:{type:`string`,format:`uri-reference`},$comment:{type:`string`},title:{type:`string`},description:{type:`string`},default:!0,readOnly:{type:`boolean`,default:!1},examples:{type:`array`,items:!0},multipleOf:{type:`number`,exclusiveMinimum:0},maximum:{type:`number`},exclusiveMaximum:{type:`number`},minimum:{type:`number`},exclusiveMinimum:{type:`number`},maxLength:{$ref:`#/definitions/nonNegativeInteger`},minLength:{$ref:`#/definitions/nonNegativeIntegerDefault0`},pattern:{type:`string`,format:`regex`},additionalItems:{$ref:`#`},items:{anyOf:[{$ref:`#`},{$ref:`#/definitions/schemaArray`}],default:!0},maxItems:{$ref:`#/definitions/nonNegativeInteger`},minItems:{$ref:`#/definitions/nonNegativeIntegerDefault0`},uniqueItems:{type:`boolean`,default:!1},contains:{$ref:`#`},maxProperties:{$ref:`#/definitions/nonNegativeInteger`},minProperties:{$ref:`#/definitions/nonNegativeIntegerDefault0`},required:{$ref:`#/definitions/stringArray`},additionalProperties:{$ref:`#`},definitions:{type:`object`,additionalProperties:{$ref:`#`},default:{}},properties:{type:`object`,additionalProperties:{$ref:`#`},default:{}},patternProperties:{type:`object`,additionalProperties:{$ref:`#`},propertyNames:{format:`regex`},default:{}},dependencies:{type:`object`,additionalProperties:{anyOf:[{$ref:`#`},{$ref:`#/definitions/stringArray`}]}},propertyNames:{$ref:`#`},const:!0,enum:{type:`array`,items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:`#/definitions/simpleTypes`},{type:`array`,items:{$ref:`#/definitions/simpleTypes`},minItems:1,uniqueItems:!0}]},format:{type:`string`},contentMediaType:{type:`string`},contentEncoding:{type:`string`},if:{$ref:`#`},then:{$ref:`#`},else:{$ref:`#`},allOf:{$ref:`#/definitions/schemaArray`},anyOf:{$ref:`#/definitions/schemaArray`},oneOf:{$ref:`#/definitions/schemaArray`},not:{$ref:`#`}},default:!0}})),QE=r(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv=void 0;let n=ME(),r=XE(),i=ZE(),a=wre(),o=[`/properties`],s=`http://json-schema.org/draft-07/schema`;var c=class extends n.default{_addVocabularies(){super._addVocabularies(),r.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(a,o):a;this.addMetaSchema(e,s,!1),this.refs[`http://json-schema.org/schema`]=s}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(s)?s:void 0)}};e.Ajv=c,t.exports=e=c,t.exports.Ajv=c,Object.defineProperty(e,"__esModule",{value:!0}),e.default=c;var l=CE();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return l.KeywordCxt}});var u=cE();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return u._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return u.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return u.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return u.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return u.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return u.CodeGen}});var d=wE();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return d.default}});var f=TE();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return f.default}})})),$E=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicAnchor=void 0;let t=cE(),n=uE(),r=EE(),i=PE(),a={keyword:`$dynamicAnchor`,schemaType:`string`,code:e=>o(e,e.schema)};function o(e,r){let{gen:i,it:a}=e;a.schemaEnv.root.dynamicAnchors[r]=!0;let o=(0,t._)`${n.default.dynamicAnchors}${(0,t.getProperty)(r)}`,c=a.errSchemaPath===`#`?a.validateName:s(e);i.if((0,t._)`!${o}`,()=>i.assign(o,c))}e.dynamicAnchor=o;function s(e){let{schemaEnv:t,schema:n,self:a}=e.it,{root:o,baseId:s,localRefs:c,meta:l}=t.root,{schemaId:u}=a.opts,d=new r.SchemaEnv({schema:n,schemaId:u,root:o,baseId:s,localRefs:c,meta:l});return r.compileSchema.call(a,d),(0,i.getValidate)(e,d)}e.default=a})),eD=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicRef=void 0;let t=cE(),n=uE(),r=PE(),i={keyword:`$dynamicRef`,schemaType:`string`,code:e=>a(e,e.schema)};function a(e,i){let{gen:a,keyword:o,it:s}=e;if(i[0]!==`#`)throw Error(`"${o}" only supports hash fragment reference`);let c=i.slice(1);if(s.allErrors)l();else{let t=a.let(`valid`,!1);l(t),e.ok(t)}function l(e){if(s.schemaEnv.root.dynamicAnchors[c]){let r=a.let(`_v`,(0,t._)`${n.default.dynamicAnchors}${(0,t.getProperty)(c)}`);a.if(r,u(r,e),u(s.validateName,e))}else u(s.validateName,e)()}function u(t,n){return n?()=>a.block(()=>{(0,r.callRef)(e,t),a.let(n,!0)}):()=>(0,r.callRef)(e,t)}}e.dynamicRef=a,e.default=i})),Tre=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=$E(),n=lE();e.default={keyword:`$recursiveAnchor`,schemaType:`boolean`,code(e){e.schema?(0,t.dynamicAnchor)(e,``):(0,n.checkStrictMode)(e.it,`$recursiveAnchor: false is ignored`)}}})),Ere=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=eD();e.default={keyword:`$recursiveRef`,schemaType:`string`,code:e=>(0,t.dynamicRef)(e,e.schema)}})),tD=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=$E(),n=eD(),r=Tre(),i=Ere();e.default=[t.default,n.default,r.default,i.default]})),Dre=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=GE();e.default={keyword:`dependentRequired`,type:`object`,schemaType:`object`,error:t.error,code:e=>(0,t.validatePropertyDeps)(e)}})),Ore=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=GE();e.default={keyword:`dependentSchemas`,type:`object`,schemaType:`object`,code:e=>(0,t.validateSchemaDeps)(e)}})),kre=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=lE();e.default={keyword:[`maxContains`,`minContains`],type:`array`,schemaType:`number`,code({keyword:e,parentSchema:n,it:r}){n.contains===void 0&&(0,t.checkStrictMode)(r,`"${e}" without "contains" is ignored`)}}})),nD=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Dre(),n=Ore(),r=kre();e.default=[t.default,n.default,r.default]})),Are=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cE(),n=lE(),r=uE();e.default={keyword:`unevaluatedProperties`,type:`object`,schemaType:[`boolean`,`object`],trackErrors:!0,error:{message:`must NOT have unevaluated properties`,params:({params:e})=>(0,t._)`{unevaluatedProperty: ${e.unevaluatedProperty}}`},code(e){let{gen:i,schema:a,data:o,errsCount:s,it:c}=e;if(!s)throw Error(`ajv implementation error`);let{allErrors:l,props:u}=c;u instanceof t.Name?i.if((0,t._)`${u} !== true`,()=>i.forIn(`key`,o,e=>i.if(f(u,e),()=>d(e)))):u!==!0&&i.forIn(`key`,o,e=>u===void 0?d(e):i.if(p(u,e),()=>d(e))),c.props=!0,e.ok((0,t._)`${s} === ${r.default.errors}`);function d(r){if(a===!1){e.setParams({unevaluatedProperty:r}),e.error(),l||i.break();return}if(!(0,n.alwaysValidSchema)(c,a)){let a=i.name(`valid`);e.subschema({keyword:`unevaluatedProperties`,dataProp:r,dataPropType:n.Type.Str},a),l||i.if((0,t.not)(a),()=>i.break())}}function f(e,n){return(0,t._)`!${e} || !${e}[${n}]`}function p(e,n){let r=[];for(let i in e)e[i]===!0&&r.push((0,t._)`${n} !== ${i}`);return(0,t.and)(...r)}}}})),jre=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cE(),n=lE();e.default={keyword:`unevaluatedItems`,type:`array`,schemaType:[`boolean`,`object`],error:{message:({params:{len:e}})=>(0,t.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,t._)`{limit: ${e}}`},code(e){let{gen:r,schema:i,data:a,it:o}=e,s=o.items||0;if(s===!0)return;let c=r.const(`len`,(0,t._)`${a}.length`);if(i===!1)e.setParams({len:s}),e.fail((0,t._)`${c} > ${s}`);else if(typeof i==`object`&&!(0,n.alwaysValidSchema)(o,i)){let n=r.var(`valid`,(0,t._)`${c} <= ${s}`);r.if((0,t.not)(n),()=>l(n,s)),e.ok(n)}o.items=!0;function l(i,a){r.forRange(`i`,a,c,a=>{e.subschema({keyword:`unevaluatedItems`,dataProp:a,dataPropType:n.Type.Num},i),o.allErrors||r.if((0,t.not)(i),()=>r.break())})}}}})),rD=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Are(),n=jre();e.default=[t.default,n.default]})),Mre=r(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2019-09/schema`,$id:`https://json-schema.org/draft/2019-09/schema`,$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0,"https://json-schema.org/draft/2019-09/vocab/applicator":!0,"https://json-schema.org/draft/2019-09/vocab/validation":!0,"https://json-schema.org/draft/2019-09/vocab/meta-data":!0,"https://json-schema.org/draft/2019-09/vocab/format":!1,"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:`Core and Validation specifications meta-schema`,allOf:[{$ref:`meta/core`},{$ref:`meta/applicator`},{$ref:`meta/validation`},{$ref:`meta/meta-data`},{$ref:`meta/format`},{$ref:`meta/content`}],type:[`object`,`boolean`],properties:{definitions:{$comment:`While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.`,type:`object`,additionalProperties:{$recursiveRef:`#`},default:{}},dependencies:{$comment:`"dependencies" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to "dependentSchemas" and "dependentRequired"`,type:`object`,additionalProperties:{anyOf:[{$recursiveRef:`#`},{$ref:`meta/validation#/$defs/stringArray`}]}}}}})),Nre=r(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2019-09/schema`,$id:`https://json-schema.org/draft/2019-09/meta/applicator`,$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/applicator":!0},$recursiveAnchor:!0,title:`Applicator vocabulary meta-schema`,type:[`object`,`boolean`],properties:{additionalItems:{$recursiveRef:`#`},unevaluatedItems:{$recursiveRef:`#`},items:{anyOf:[{$recursiveRef:`#`},{$ref:`#/$defs/schemaArray`}]},contains:{$recursiveRef:`#`},additionalProperties:{$recursiveRef:`#`},unevaluatedProperties:{$recursiveRef:`#`},properties:{type:`object`,additionalProperties:{$recursiveRef:`#`},default:{}},patternProperties:{type:`object`,additionalProperties:{$recursiveRef:`#`},propertyNames:{format:`regex`},default:{}},dependentSchemas:{type:`object`,additionalProperties:{$recursiveRef:`#`}},propertyNames:{$recursiveRef:`#`},if:{$recursiveRef:`#`},then:{$recursiveRef:`#`},else:{$recursiveRef:`#`},allOf:{$ref:`#/$defs/schemaArray`},anyOf:{$ref:`#/$defs/schemaArray`},oneOf:{$ref:`#/$defs/schemaArray`},not:{$recursiveRef:`#`}},$defs:{schemaArray:{type:`array`,minItems:1,items:{$recursiveRef:`#`}}}}})),Pre=r(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2019-09/schema`,$id:`https://json-schema.org/draft/2019-09/meta/content`,$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:`Content vocabulary meta-schema`,type:[`object`,`boolean`],properties:{contentMediaType:{type:`string`},contentEncoding:{type:`string`},contentSchema:{$recursiveRef:`#`}}}})),Fre=r(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2019-09/schema`,$id:`https://json-schema.org/draft/2019-09/meta/core`,$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0},$recursiveAnchor:!0,title:`Core vocabulary meta-schema`,type:[`object`,`boolean`],properties:{$id:{type:`string`,format:`uri-reference`,$comment:`Non-empty fragments not allowed.`,pattern:`^[^#]*#?$`},$schema:{type:`string`,format:`uri`},$anchor:{type:`string`,pattern:`^[A-Za-z][-A-Za-z0-9.:_]*$`},$ref:{type:`string`,format:`uri-reference`},$recursiveRef:{type:`string`,format:`uri-reference`},$recursiveAnchor:{type:`boolean`,default:!1},$vocabulary:{type:`object`,propertyNames:{type:`string`,format:`uri`},additionalProperties:{type:`boolean`}},$comment:{type:`string`},$defs:{type:`object`,additionalProperties:{$recursiveRef:`#`},default:{}}}}})),Ire=r(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2019-09/schema`,$id:`https://json-schema.org/draft/2019-09/meta/format`,$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/format":!0},$recursiveAnchor:!0,title:`Format vocabulary meta-schema`,type:[`object`,`boolean`],properties:{format:{type:`string`}}}})),Lre=r(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2019-09/schema`,$id:`https://json-schema.org/draft/2019-09/meta/meta-data`,$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/meta-data":!0},$recursiveAnchor:!0,title:`Meta-data vocabulary meta-schema`,type:[`object`,`boolean`],properties:{title:{type:`string`},description:{type:`string`},default:!0,deprecated:{type:`boolean`,default:!1},readOnly:{type:`boolean`,default:!1},writeOnly:{type:`boolean`,default:!1},examples:{type:`array`,items:!0}}}})),Rre=r(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2019-09/schema`,$id:`https://json-schema.org/draft/2019-09/meta/validation`,$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/validation":!0},$recursiveAnchor:!0,title:`Validation vocabulary meta-schema`,type:[`object`,`boolean`],properties:{multipleOf:{type:`number`,exclusiveMinimum:0},maximum:{type:`number`},exclusiveMaximum:{type:`number`},minimum:{type:`number`},exclusiveMinimum:{type:`number`},maxLength:{$ref:`#/$defs/nonNegativeInteger`},minLength:{$ref:`#/$defs/nonNegativeIntegerDefault0`},pattern:{type:`string`,format:`regex`},maxItems:{$ref:`#/$defs/nonNegativeInteger`},minItems:{$ref:`#/$defs/nonNegativeIntegerDefault0`},uniqueItems:{type:`boolean`,default:!1},maxContains:{$ref:`#/$defs/nonNegativeInteger`},minContains:{$ref:`#/$defs/nonNegativeInteger`,default:1},maxProperties:{$ref:`#/$defs/nonNegativeInteger`},minProperties:{$ref:`#/$defs/nonNegativeIntegerDefault0`},required:{$ref:`#/$defs/stringArray`},dependentRequired:{type:`object`,additionalProperties:{$ref:`#/$defs/stringArray`}},const:!0,enum:{type:`array`,items:!0},type:{anyOf:[{$ref:`#/$defs/simpleTypes`},{type:`array`,items:{$ref:`#/$defs/simpleTypes`},minItems:1,uniqueItems:!0}]}},$defs:{nonNegativeInteger:{type:`integer`,minimum:0},nonNegativeIntegerDefault0:{$ref:`#/$defs/nonNegativeInteger`,default:0},simpleTypes:{enum:[`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`]},stringArray:{type:`array`,items:{type:`string`},uniqueItems:!0,default:[]}}}})),zre=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Mre(),n=Nre(),r=Pre(),i=Fre(),a=Ire(),o=Lre(),s=Rre(),c=[`/properties`];function l(e){return[t,n,r,i,l(this,a),o,l(this,s)].forEach(e=>this.addMetaSchema(e,void 0,!1)),this;function l(t,n){return e?t.$dataMetaSchema(n,c):n}}e.default=l})),Bre=r(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv2019=void 0;let n=ME(),r=XE(),i=tD(),a=nD(),o=rD(),s=ZE(),c=zre(),l=`https://json-schema.org/draft/2019-09/schema`;var u=class extends n.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),this.addVocabulary(i.default),r.default.forEach(e=>this.addVocabulary(e)),this.addVocabulary(a.default),this.addVocabulary(o.default),this.opts.discriminator&&this.addKeyword(s.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:t}=this.opts;t&&(c.default.call(this,e),this.refs[`http://json-schema.org/schema`]=l)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(l)?l:void 0)}};e.Ajv2019=u,t.exports=e=u,t.exports.Ajv2019=u,Object.defineProperty(e,"__esModule",{value:!0}),e.default=u;var d=CE();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return d.KeywordCxt}});var f=cE();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return f._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return f.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return f.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return f.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return f.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return f.CodeGen}});var p=wE();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return p.default}});var m=TE();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return m.default}})})),Vre=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=FE(),n=HE(),r=qE(),i=tD(),a=nD(),o=rD(),s=JE(),c=YE();e.default=[i.default,t.default,n.default,(0,r.default)(!0),s.default,c.metadataVocabulary,c.contentVocabulary,a.default,o.default]})),Hre=r(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/schema`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:`meta`,title:`Core and Validation specifications meta-schema`,allOf:[{$ref:`meta/core`},{$ref:`meta/applicator`},{$ref:`meta/unevaluated`},{$ref:`meta/validation`},{$ref:`meta/meta-data`},{$ref:`meta/format-annotation`},{$ref:`meta/content`}],type:[`object`,`boolean`],$comment:`This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.`,properties:{definitions:{$comment:`"definitions" has been replaced by "$defs".`,type:`object`,additionalProperties:{$dynamicRef:`#meta`},deprecated:!0,default:{}},dependencies:{$comment:`"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.`,type:`object`,additionalProperties:{anyOf:[{$dynamicRef:`#meta`},{$ref:`meta/validation#/$defs/stringArray`}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:`"$recursiveAnchor" has been replaced by "$dynamicAnchor".`,$ref:`meta/core#/$defs/anchorString`,deprecated:!0},$recursiveRef:{$comment:`"$recursiveRef" has been replaced by "$dynamicRef".`,$ref:`meta/core#/$defs/uriReferenceString`,deprecated:!0}}}})),Ure=r(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/applicator`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:`meta`,title:`Applicator vocabulary meta-schema`,type:[`object`,`boolean`],properties:{prefixItems:{$ref:`#/$defs/schemaArray`},items:{$dynamicRef:`#meta`},contains:{$dynamicRef:`#meta`},additionalProperties:{$dynamicRef:`#meta`},properties:{type:`object`,additionalProperties:{$dynamicRef:`#meta`},default:{}},patternProperties:{type:`object`,additionalProperties:{$dynamicRef:`#meta`},propertyNames:{format:`regex`},default:{}},dependentSchemas:{type:`object`,additionalProperties:{$dynamicRef:`#meta`},default:{}},propertyNames:{$dynamicRef:`#meta`},if:{$dynamicRef:`#meta`},then:{$dynamicRef:`#meta`},else:{$dynamicRef:`#meta`},allOf:{$ref:`#/$defs/schemaArray`},anyOf:{$ref:`#/$defs/schemaArray`},oneOf:{$ref:`#/$defs/schemaArray`},not:{$dynamicRef:`#meta`}},$defs:{schemaArray:{type:`array`,minItems:1,items:{$dynamicRef:`#meta`}}}}})),Wre=r(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/unevaluated`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:`meta`,title:`Unevaluated applicator vocabulary meta-schema`,type:[`object`,`boolean`],properties:{unevaluatedItems:{$dynamicRef:`#meta`},unevaluatedProperties:{$dynamicRef:`#meta`}}}})),Gre=r(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/content`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:`meta`,title:`Content vocabulary meta-schema`,type:[`object`,`boolean`],properties:{contentEncoding:{type:`string`},contentMediaType:{type:`string`},contentSchema:{$dynamicRef:`#meta`}}}})),Kre=r(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/core`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:`meta`,title:`Core vocabulary meta-schema`,type:[`object`,`boolean`],properties:{$id:{$ref:`#/$defs/uriReferenceString`,$comment:`Non-empty fragments not allowed.`,pattern:`^[^#]*#?$`},$schema:{$ref:`#/$defs/uriString`},$ref:{$ref:`#/$defs/uriReferenceString`},$anchor:{$ref:`#/$defs/anchorString`},$dynamicRef:{$ref:`#/$defs/uriReferenceString`},$dynamicAnchor:{$ref:`#/$defs/anchorString`},$vocabulary:{type:`object`,propertyNames:{$ref:`#/$defs/uriString`},additionalProperties:{type:`boolean`}},$comment:{type:`string`},$defs:{type:`object`,additionalProperties:{$dynamicRef:`#meta`}}},$defs:{anchorString:{type:`string`,pattern:`^[A-Za-z_][-A-Za-z0-9._]*$`},uriString:{type:`string`,format:`uri`},uriReferenceString:{type:`string`,format:`uri-reference`}}}})),qre=r(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/format-annotation`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:`meta`,title:`Format vocabulary meta-schema for annotation results`,type:[`object`,`boolean`],properties:{format:{type:`string`}}}})),Jre=r(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/meta-data`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:`meta`,title:`Meta-data vocabulary meta-schema`,type:[`object`,`boolean`],properties:{title:{type:`string`},description:{type:`string`},default:!0,deprecated:{type:`boolean`,default:!1},readOnly:{type:`boolean`,default:!1},writeOnly:{type:`boolean`,default:!1},examples:{type:`array`,items:!0}}}})),Yre=r(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/validation`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:`meta`,title:`Validation vocabulary meta-schema`,type:[`object`,`boolean`],properties:{type:{anyOf:[{$ref:`#/$defs/simpleTypes`},{type:`array`,items:{$ref:`#/$defs/simpleTypes`},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:`array`,items:!0},multipleOf:{type:`number`,exclusiveMinimum:0},maximum:{type:`number`},exclusiveMaximum:{type:`number`},minimum:{type:`number`},exclusiveMinimum:{type:`number`},maxLength:{$ref:`#/$defs/nonNegativeInteger`},minLength:{$ref:`#/$defs/nonNegativeIntegerDefault0`},pattern:{type:`string`,format:`regex`},maxItems:{$ref:`#/$defs/nonNegativeInteger`},minItems:{$ref:`#/$defs/nonNegativeIntegerDefault0`},uniqueItems:{type:`boolean`,default:!1},maxContains:{$ref:`#/$defs/nonNegativeInteger`},minContains:{$ref:`#/$defs/nonNegativeInteger`,default:1},maxProperties:{$ref:`#/$defs/nonNegativeInteger`},minProperties:{$ref:`#/$defs/nonNegativeIntegerDefault0`},required:{$ref:`#/$defs/stringArray`},dependentRequired:{type:`object`,additionalProperties:{$ref:`#/$defs/stringArray`}}},$defs:{nonNegativeInteger:{type:`integer`,minimum:0},nonNegativeIntegerDefault0:{$ref:`#/$defs/nonNegativeInteger`,default:0},simpleTypes:{enum:[`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`]},stringArray:{type:`array`,items:{type:`string`},uniqueItems:!0,default:[]}}}})),Xre=r((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Hre(),n=Ure(),r=Wre(),i=Gre(),a=Kre(),o=qre(),s=Jre(),c=Yre(),l=[`/properties`];function u(e){return[t,n,r,i,a,u(this,o),s,u(this,c)].forEach(e=>this.addMetaSchema(e,void 0,!1)),this;function u(t,n){return e?t.$dataMetaSchema(n,l):n}}e.default=u})),Zre=r(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv2020=void 0;let n=ME(),r=Vre(),i=ZE(),a=Xre(),o=`https://json-schema.org/draft/2020-12/schema`;var s=class extends n.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),r.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:t}=this.opts;t&&(a.default.call(this,e),this.refs[`http://json-schema.org/schema`]=o)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(o)?o:void 0)}};e.Ajv2020=s,t.exports=e=s,t.exports.Ajv2020=s,Object.defineProperty(e,"__esModule",{value:!0}),e.default=s;var c=CE();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var l=cE();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return l._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return l.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return l.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return l.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return l.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return l.CodeGen}});var u=wE();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return u.default}});var d=TE();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return d.default}})})),Qre=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(e,t){return{validate:e,compare:t}}e.fullFormats={date:t(a,o),time:t(c(!0),l),"date-time":t(f(!0),p),"iso-time":t(c(),u),"iso-date-time":t(f(),m),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:_,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:ee,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:y,int32:{type:`number`,validate:S},int64:{type:`number`,validate:C},float:{type:`number`,validate:w},double:{type:`number`,validate:w},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,o),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,l),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,p),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,u),"iso-date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,m),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function n(e){return e%4==0&&(e%100!=0||e%400==0)}let r=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,i=[0,31,28,31,30,31,30,31,31,30,31,30,31];function a(e){let t=r.exec(e);if(!t)return!1;let a=+t[1],o=+t[2],s=+t[3];return o>=1&&o<=12&&s>=1&&s<=(o===2&&n(a)?29:i[o])}function o(e,t){if(e&&t)return e>t?1:e<t?-1:0}let s=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function c(e){return function(t){let n=s.exec(t);if(!n)return!1;let r=+n[1],i=+n[2],a=+n[3],o=n[4],c=n[5]===`-`?-1:1,l=+(n[6]||0),u=+(n[7]||0);if(l>23||u>59||e&&!o)return!1;if(r<=23&&i<=59&&a<60)return!0;let d=i-u*c,f=r-l*c-+(d<0);return(f===23||f===-1)&&(d===59||d===-1)&&a<61}}function l(e,t){if(!(e&&t))return;let n=new Date(`2020-01-01T`+e).valueOf(),r=new Date(`2020-01-01T`+t).valueOf();if(n&&r)return n-r}function u(e,t){if(!(e&&t))return;let n=s.exec(e),r=s.exec(t);if(n&&r)return e=n[1]+n[2]+n[3],t=r[1]+r[2]+r[3],e>t?1:e<t?-1:0}let d=/t|\s/i;function f(e){let t=c(e);return function(e){let n=e.split(d);return n.length===2&&a(n[0])&&t(n[1])}}function p(e,t){if(!(e&&t))return;let n=new Date(e).valueOf(),r=new Date(t).valueOf();if(n&&r)return n-r}function m(e,t){if(!(e&&t))return;let[n,r]=e.split(d),[i,a]=t.split(d),s=o(n,i);if(s!==void 0)return s||l(r,a)}let h=/\/|:/,g=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function _(e){return h.test(e)&&g.test(e)}let v=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function y(e){return v.lastIndex=0,v.test(e)}let b=-(2**31),x=2**31-1;function S(e){return Number.isInteger(e)&&e<=x&&e>=b}function C(e){return Number.isInteger(e)}function w(){return!0}let T=/[^\\]\\Z/;function ee(e){if(T.test(e))return!1;try{return new RegExp(e),!0}catch{return!1}}})),$re=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;let t=QE(),n=cE(),r=n.operators,i={formatMaximum:{okStr:`<=`,ok:r.LTE,fail:r.GT},formatMinimum:{okStr:`>=`,ok:r.GTE,fail:r.LT},formatExclusiveMaximum:{okStr:`<`,ok:r.LT,fail:r.GTE},formatExclusiveMinimum:{okStr:`>`,ok:r.GT,fail:r.LTE}};e.formatLimitDefinition={keyword:Object.keys(i),type:`string`,schemaType:`string`,$data:!0,error:{message:({keyword:e,schemaCode:t})=>(0,n.str)`should be ${i[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,n._)`{comparison: ${i[e].okStr}, limit: ${t}}`},code(e){let{gen:r,data:a,schemaCode:o,keyword:s,it:c}=e,{opts:l,self:u}=c;if(!l.validateFormats)return;let d=new t.KeywordCxt(c,u.RULES.all.format.definition,`format`);d.$data?f():p();function f(){let t=r.scopeValue(`formats`,{ref:u.formats,code:l.code.formats}),i=r.const(`fmt`,(0,n._)`${t}[${d.schemaCode}]`);e.fail$data((0,n.or)((0,n._)`typeof ${i} != "object"`,(0,n._)`${i} instanceof RegExp`,(0,n._)`typeof ${i}.compare != "function"`,m(i)))}function p(){let t=d.schema,i=u.formats[t];if(!i||i===!0)return;if(typeof i!=`object`||i instanceof RegExp||typeof i.compare!=`function`)throw Error(`"${s}": format "${t}" does not define "compare" function`);let a=r.scopeValue(`formats`,{key:t,ref:i,code:l.code.formats?(0,n._)`${l.code.formats}${(0,n.getProperty)(t)}`:void 0});e.fail$data(m(a))}function m(e){return(0,n._)`${e}.compare(${a}, ${o}) ${i[s].fail} 0`}},dependencies:[`format`]},e.default=t=>(t.addKeyword(e.formatLimitDefinition),t)})),iD=r(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});let n=Qre(),r=$re(),i=cE(),a=new i.Name(`fullFormats`),o=new i.Name(`fastFormats`),s=(e,t={keywords:!0})=>{if(Array.isArray(t))return c(e,t,n.fullFormats,a),e;let[i,s]=t.mode===`fast`?[n.fastFormats,o]:[n.fullFormats,a];return c(e,t.formats||n.formatNames,i,s),t.keywords&&(0,r.default)(e),e};s.get=(e,t=`full`)=>{let r=(t===`fast`?n.fastFormats:n.fullFormats)[e];if(!r)throw Error(`Unknown format "${e}"`);return r};function c(e,t,n,r){var a;(a=e.opts.code).formats??(a.formats=(0,i._)`require("ajv-formats/dist/formats").${r}`);for(let r of t)e.addFormat(r,n[r])}t.exports=e=s,Object.defineProperty(e,"__esModule",{value:!0}),e.default=s})),aD=r(((e,t)=>{let n=`[^\\\\/]`,r=`[^/]`,i=`(?:\\/|$)`,a=`(?:^|\\/)`,o=`\\.{1,2}${i}`,s={DOT_LITERAL:`\\.`,PLUS_LITERAL:`\\+`,QMARK_LITERAL:`\\?`,SLASH_LITERAL:`\\/`,ONE_CHAR:`(?=.)`,QMARK:r,END_ANCHOR:i,DOTS_SLASH:o,NO_DOT:`(?!\\.)`,NO_DOTS:`(?!${a}${o})`,NO_DOT_SLASH:`(?!\\.{0,1}${i})`,NO_DOTS_SLASH:`(?!${o})`,QMARK_NO_DOT:`[^.\\/]`,STAR:`${r}*?`,START_ANCHOR:a,SEP:`/`},c={...s,SLASH_LITERAL:`[\\\\/]`,QMARK:n,STAR:`${n}*?`,DOTS_SLASH:`\\.{1,2}(?:[\\\\/]|$)`,NO_DOT:`(?!\\.)`,NO_DOTS:`(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))`,NO_DOT_SLASH:`(?!\\.{0,1}(?:[\\\\/]|$))`,NO_DOTS_SLASH:`(?!\\.{1,2}(?:[\\\\/]|$))`,QMARK_NO_DOT:`[^.\\\\/]`,START_ANCHOR:`(?:^|[\\\\/])`,END_ANCHOR:`(?:[\\\\/]|$)`,SEP:`\\`};t.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{__proto__:null,alnum:`a-zA-Z0-9`,alpha:`a-zA-Z`,ascii:`\\x00-\\x7F`,blank:` \\t`,cntrl:`\\x00-\\x1F\\x7F`,digit:`0-9`,graph:`\\x21-\\x7E`,lower:`a-z`,print:`\\x20-\\x7E `,punct:`\\-!"#$%&'()\\*+,./:;<=>?@[\\]^_\`{|}~`,space:` \\t\\r\\n\\v\\f`,upper:`A-Z`,word:`A-Za-z0-9_`,xdigit:`A-Fa-f0-9`},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":`*`,"**/**":`**`,"**/**/**":`**`},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(e){return{"!":{type:`negate`,open:`(?:(?!(?:`,close:`))${e.STAR})`},"?":{type:`qmark`,open:`(?:`,close:`)?`},"+":{type:`plus`,open:`(?:`,close:`)+`},"*":{type:`star`,open:`(?:`,close:`)*`},"@":{type:`at`,open:`(?:`,close:`)`}}},globChars(e){return e===!0?c:s}}})),oD=r((e=>{let{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:r,REGEX_SPECIAL_CHARS_GLOBAL:i}=aD();e.isObject=e=>typeof e==`object`&&!!e&&!Array.isArray(e),e.hasRegexChars=e=>r.test(e),e.isRegexChar=t=>t.length===1&&e.hasRegexChars(t),e.escapeRegex=e=>e.replace(i,`\\$1`),e.toPosixSlashes=e=>e.replace(t,`/`),e.isWindows=()=>{if(typeof navigator<`u`&&navigator.platform){let e=navigator.platform.toLowerCase();return e===`win32`||e===`windows`}return typeof process<`u`&&process.platform?process.platform===`win32`:!1},e.removeBackslashes=e=>e.replace(n,e=>e===`\\`?``:e),e.escapeLast=(t,n,r)=>{let i=t.lastIndexOf(n,r);return i===-1?t:t[i-1]===`\\`?e.escapeLast(t,n,i-1):`${t.slice(0,i)}\\${t.slice(i)}`},e.removePrefix=(e,t={})=>{let n=e;return n.startsWith(`./`)&&(n=n.slice(2),t.prefix=`./`),n},e.wrapOutput=(e,t={},n={})=>{let r=`${n.contains?``:`^`}(?:${e})${n.contains?``:`$`}`;return t.negated===!0&&(r=`(?:^(?!${r}).*$)`),r},e.basename=(e,{windows:t}={})=>{let n=e.split(t?/[\\/]/:`/`),r=n[n.length-1];return r===``?n[n.length-2]:r}})),eie=r(((e,t)=>{let n=oD(),{CHAR_ASTERISK:r,CHAR_AT:i,CHAR_BACKWARD_SLASH:a,CHAR_COMMA:o,CHAR_DOT:s,CHAR_EXCLAMATION_MARK:c,CHAR_FORWARD_SLASH:l,CHAR_LEFT_CURLY_BRACE:u,CHAR_LEFT_PARENTHESES:d,CHAR_LEFT_SQUARE_BRACKET:f,CHAR_PLUS:p,CHAR_QUESTION_MARK:m,CHAR_RIGHT_CURLY_BRACE:h,CHAR_RIGHT_PARENTHESES:g,CHAR_RIGHT_SQUARE_BRACKET:_}=aD(),v=e=>e===l||e===a,y=e=>{e.isPrefix!==!0&&(e.depth=e.isGlobstar?1/0:1)};t.exports=(e,t)=>{let b=t||{},x=e.length-1,S=b.parts===!0||b.tokens===!0||b.scanToEnd===!0,C=[],w=[],T=[],ee=e,te=-1,ne=0,re=0,ie=!1,ae=!1,oe=!1,se=!1,ce=!1,le=!1,ue=!1,E=!1,de=!1,fe=!1,pe=0,D,O,me={value:``,depth:0,isGlob:!1},he=()=>te>=x,ge=()=>ee.charCodeAt(te+1),_e=()=>(D=O,ee.charCodeAt(++te));for(;te<x;){O=_e();let e;if(O===a){ue=me.backslashes=!0,O=_e(),O===u&&(le=!0);continue}if(le===!0||O===u){for(pe++;he()!==!0&&(O=_e());){if(O===a){ue=me.backslashes=!0,_e();continue}if(O===u){pe++;continue}if(le!==!0&&O===s&&(O=_e())===s){if(ie=me.isBrace=!0,oe=me.isGlob=!0,fe=!0,S===!0)continue;break}if(le!==!0&&O===o){if(ie=me.isBrace=!0,oe=me.isGlob=!0,fe=!0,S===!0)continue;break}if(O===h&&(pe--,pe===0)){le=!1,ie=me.isBrace=!0,fe=!0;break}}if(S===!0)continue;break}if(O===l){if(C.push(te),w.push(me),me={value:``,depth:0,isGlob:!1},fe===!0)continue;if(D===s&&te===ne+1){ne+=2;continue}re=te+1;continue}if(b.noext!==!0&&(O===p||O===i||O===r||O===m||O===c)&&ge()===d){if(oe=me.isGlob=!0,se=me.isExtglob=!0,fe=!0,O===c&&te===ne&&(de=!0),S===!0){let e=0;for(;he()!==!0&&(O=_e());){if(O===a){ue=me.backslashes=!0,_e();continue}if(O===d){e++;continue}if(O===g&&--e===0){fe=!0;break}}continue}break}if(O===r){if(D===r&&(ce=me.isGlobstar=!0),oe=me.isGlob=!0,fe=!0,S===!0)continue;break}if(O===m){if(oe=me.isGlob=!0,fe=!0,S===!0)continue;break}if(O===f){for(;he()!==!0&&(e=_e());){if(e===a){ue=me.backslashes=!0,_e();continue}if(e===_){ae=me.isBracket=!0,oe=me.isGlob=!0,fe=!0;break}}if(S===!0)continue;break}if(b.nonegate!==!0&&O===c&&te===ne){E=me.negated=!0,ne++;continue}if(b.noparen!==!0&&O===d){if(oe=me.isGlob=!0,S===!0){let e=1;for(;he()!==!0&&(O=_e());){if(O===a){ue=me.backslashes=!0,_e();continue}if(O===d){e++;continue}if(O===g&&--e===0){fe=!0;break}}continue}break}if(oe===!0){if(fe=!0,S===!0)continue;break}}b.noext===!0&&(se=!1,oe=!1);let ve=ee,ye=``,be=``;ne>0&&(ye=ee.slice(0,ne),ee=ee.slice(ne),re-=ne),ve&&oe===!0&&re>0?(ve=ee.slice(0,re),be=ee.slice(re)):oe===!0?(ve=``,be=ee):ve=ee,ve&&ve!==``&&ve!==`/`&&ve!==ee&&v(ve.charCodeAt(ve.length-1))&&(ve=ve.slice(0,-1)),b.unescape===!0&&(be&&=n.removeBackslashes(be),ve&&ue===!0&&(ve=n.removeBackslashes(ve)));let xe={prefix:ye,input:e,start:ne,base:ve,glob:be,isBrace:ie,isBracket:ae,isGlob:oe,isExtglob:se,isGlobstar:ce,negated:E,negatedExtglob:de};if(b.tokens===!0&&(xe.maxDepth=0,v(O)||w.push(me),xe.tokens=w),b.parts===!0||b.tokens===!0){let t;for(let n=0;n<C.length;n++){let r=t===void 0?ne:t+1,i=C[n],a=e.slice(r,i);b.tokens&&(n===0&&ne!==0?(w[n].isPrefix=!0,w[n].value=ye):w[n].value=a,y(w[n]),xe.maxDepth+=w[n].depth),i>=ne&&(T.push(a),t=i)}let n=t===void 0?ne:t+1,r=e.slice(n);T.push(r),b.tokens&&t&&t+1<e.length&&(w[w.length-1].value=r,y(w[w.length-1]),xe.maxDepth+=w[w.length-1].depth),xe.slashes=C,xe.parts=T}return xe}})),tie=r(((e,t)=>{let n=aD(),r=oD(),{MAX_LENGTH:i,POSIX_REGEX_SOURCE:a,REGEX_NON_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_BACKREF:s,REPLACEMENTS:c}=n,l=(e,t)=>{if(typeof t.expandRange==`function`)return t.expandRange(...e,t);e.sort();let n=`[${e.join(`-`)}]`;try{new RegExp(n)}catch{return e.map(e=>r.escapeRegex(e)).join(`..`)}return n},u=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,d=e=>{let t=[],n=0,r=0,i=0,a=``,o=!1;for(let s of e){if(o===!0){a+=s,o=!1;continue}if(s===`\\`){a+=s,o=!0;continue}if(s===`"`){i=i===1?0:1,a+=s;continue}if(i===0){if(s===`[`)n++;else if(s===`]`&&n>0)n--;else if(n===0){if(s===`(`)r++;else if(s===`)`&&r>0)r--;else if(s===`|`&&r===0){t.push(a),a=``;continue}}}a+=s}return t.push(a),t},f=e=>{let t=!1;for(let n of e){if(t===!0){t=!1;continue}if(n===`\\`){t=!0;continue}if(/[?*+@!()[\]{}]/.test(n))return!1}return!0},p=e=>{let t=e.trim(),n=!0;for(;n===!0;)n=!1,/^@\([^\\()[\]{}|]+\)$/.test(t)&&(t=t.slice(2,-1),n=!0);if(f(t))return t.replace(/\\(.)/g,`$1`)},m=e=>{let t=e.map(p).filter(Boolean);for(let e=0;e<t.length;e++)for(let n=e+1;n<t.length;n++){let r=t[e],i=t[n],a=r[0];if(!(!a||r!==a.repeat(r.length)||i!==a.repeat(i.length))&&(r===i||r.startsWith(i)||i.startsWith(r)))return!0}return!1},h=(e,t=!0)=>{if(e[0]!==`+`&&e[0]!==`*`||e[1]!==`(`)return;let n=0,r=0,i=0,a=!1;for(let o=1;o<e.length;o++){let s=e[o];if(a===!0){a=!1;continue}if(s===`\\`){a=!0;continue}if(s===`"`){i=i===1?0:1;continue}if(i!==1){if(s===`[`){n++;continue}if(s===`]`&&n>0){n--;continue}if(!(n>0)){if(s===`(`){r++;continue}if(s===`)`&&(r--,r===0))return t===!0&&o!==e.length-1?void 0:{type:e[0],body:e.slice(2,o),end:o}}}}},g=e=>`${e.length===1?r.escapeRegex(e[0]):`[${e.map(e=>r.escapeRegex(e)).join(``)}]`}*`,_=e=>{let t=0,n=[];for(;t<e.length;){let r=h(e.slice(t),!1);if(!r||r.type!==`*`)return;let i=d(r.body).map(e=>e.trim());if(i.length!==1)return;let a=p(i[0]);if(!a||a.length!==1)return;n.push(a),t+=r.end+1}if(!(n.length<1))return n},v=e=>{let t=0,n=e.trim(),r=h(n);for(;r;)t++,n=r.body.trim(),r=h(n);return t},y=(e,t)=>{if(t.maxExtglobRecursion===!1)return{risky:!1};let r=typeof t.maxExtglobRecursion==`number`?t.maxExtglobRecursion:n.DEFAULT_MAX_EXTGLOB_RECURSION,i=d(e).map(e=>e.trim());if(i.length>1&&(i.some(e=>e===``)||i.some(e=>/^[*?]+$/.test(e))||m(i)))return{risky:!0};let a=[],o=!1,s=!0;for(let e of i){let t=_(e);if(t){o=!0,a.push(...t);continue}let n=p(e);if(n&&n.length===1){a.push(n);continue}if(s=!1,v(e)>r)return{risky:!0}}return o?s?{risky:!0,safeOutput:g([...new Set(a)])}:{risky:!0}:{risky:!1}},b=(e,t)=>{if(typeof e!=`string`)throw TypeError(`Expected a string`);e=c[e]||e;let d={...t},f=typeof d.maxLength==`number`?Math.min(i,d.maxLength):i,p=e.length;if(p>f)throw SyntaxError(`Input length: ${p}, exceeds maximum allowed length: ${f}`);let m={type:`bos`,value:``,output:d.prepend||``},h=[m],g=d.capture?``:`?:`,_=n.globChars(d.windows),v=n.extglobChars(_),{DOT_LITERAL:x,PLUS_LITERAL:S,SLASH_LITERAL:C,ONE_CHAR:w,DOTS_SLASH:T,NO_DOT:ee,NO_DOT_SLASH:te,NO_DOTS_SLASH:ne,QMARK:re,QMARK_NO_DOT:ie,STAR:ae,START_ANCHOR:oe}=_,se=e=>`(${g}(?:(?!${oe}${e.dot?T:x}).)*?)`,ce=d.dot?``:ee,le=d.dot?re:ie,ue=d.bash===!0?se(d):ae;d.capture&&(ue=`(${ue})`),typeof d.noext==`boolean`&&(d.noextglob=d.noext);let E={input:e,index:-1,start:0,dot:d.dot===!0,consumed:``,output:``,prefix:``,backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:h};e=r.removePrefix(e,E),p=e.length;let de=[],fe=[],pe=[],D=m,O,me=()=>E.index===p-1,he=E.peek=(t=1)=>e[E.index+t],ge=E.advance=()=>e[++E.index]||``,_e=()=>e.slice(E.index+1),ve=(e=``,t=0)=>{E.consumed+=e,E.index+=t},ye=e=>{E.output+=e.output==null?e.value:e.output,ve(e.value)},be=()=>{let e=1;for(;he()===`!`&&(he(2)!==`(`||he(3)===`?`);)ge(),E.start++,e++;return e%2!=0&&(E.negated=!0,E.start++,!0)},xe=e=>{E[e]++,pe.push(e)},Se=e=>{E[e]--,pe.pop()},Ce=e=>{if(D.type===`globstar`){let t=E.braces>0&&(e.type===`comma`||e.type===`brace`),n=e.extglob===!0||de.length&&(e.type===`pipe`||e.type===`paren`);e.type!==`slash`&&e.type!==`paren`&&!t&&!n&&(E.output=E.output.slice(0,-D.output.length),D.type=`star`,D.value=`*`,D.output=ue,E.output+=D.output)}if(de.length&&e.type!==`paren`&&(de[de.length-1].inner+=e.value),(e.value||e.output)&&ye(e),D&&D.type===`text`&&e.type===`text`){D.output=(D.output||D.value)+e.value,D.value+=e.value;return}e.prev=D,h.push(e),D=e},we=(e,t)=>{let n={...v[t],conditions:1,inner:``};n.prev=D,n.parens=E.parens,n.output=E.output,n.startIndex=E.index,n.tokensIndex=h.length;let r=(d.capture?`(`:``)+n.open;xe(`parens`),Ce({type:e,value:t,output:E.output?``:w}),Ce({type:`paren`,extglob:!0,value:ge(),output:r}),de.push(n)},k=n=>{let i=e.slice(n.startIndex,E.index+1),a=e.slice(n.startIndex+2,E.index),o=y(a,d);if((n.type===`plus`||n.type===`star`)&&o.risky){let e=o.safeOutput?(n.output?``:w)+(d.capture?`(${o.safeOutput})`:o.safeOutput):void 0,t=h[n.tokensIndex];t.type=`text`,t.value=i,t.output=e||r.escapeRegex(i);for(let e=n.tokensIndex+1;e<h.length;e++)h[e].value=``,h[e].output=``,delete h[e].suffix;E.output=n.output+t.output,E.backtrack=!0,Ce({type:`paren`,extglob:!0,value:O,output:``}),Se(`parens`);return}let s=n.close+(d.capture?`)`:``),c;if(n.type===`negate`){let e=ue;n.inner&&n.inner.length>1&&n.inner.includes(`/`)&&(e=se(d)),(e!==ue||me()||/^\)+$/.test(_e()))&&(s=n.close=`)$))${e}`),n.inner.includes(`*`)&&(c=_e())&&/^\.[^\\/.]+$/.test(c)&&(s=n.close=`)${b(c,{...t,fastpaths:!1}).output})${e})`),n.prev.type===`bos`&&(E.negatedExtglob=!0)}Ce({type:`paren`,extglob:!0,value:O,output:s}),Se(`parens`)};if(d.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let n=!1,i=e.replace(s,(e,t,r,i,a,o)=>i===`\\`?(n=!0,e):i===`?`?t?t+i+(a?re.repeat(a.length):``):o===0?le+(a?re.repeat(a.length):``):re.repeat(r.length):i===`.`?x.repeat(r.length):i===`*`?t?t+i+(a?ue:``):ue:t?e:`\\${e}`);return n===!0&&(i=d.unescape===!0?i.replace(/\\/g,``):i.replace(/\\+/g,e=>e.length%2==0?`\\\\`:e?`\\`:``)),i===e&&d.contains===!0?(E.output=e,E):(E.output=r.wrapOutput(i,E,t),E)}for(;!me();){if(O=ge(),O===`\0`)continue;if(O===`\\`){let e=he();if(e===`/`&&d.bash!==!0||e===`.`||e===`;`)continue;if(!e){O+=`\\`,Ce({type:`text`,value:O});continue}let t=/^\\+/.exec(_e()),n=0;if(t&&t[0].length>2&&(n=t[0].length,E.index+=n,n%2!=0&&(O+=`\\`)),d.unescape===!0?O=ge():O+=ge(),E.brackets===0){Ce({type:`text`,value:O});continue}}if(E.brackets>0&&(O!==`]`||D.value===`[`||D.value===`[^`)){if(d.posix!==!1&&O===`:`){let e=D.value.slice(1);if(e.includes(`[`)&&(D.posix=!0,e.includes(`:`))){let e=D.value.lastIndexOf(`[`),t=D.value.slice(0,e),n=D.value.slice(e+2),r=a[n];if(r){D.value=t+r,E.backtrack=!0,ge(),!m.output&&h.indexOf(D)===1&&(m.output=w);continue}}}(O===`[`&&he()!==`:`||O===`-`&&he()===`]`)&&(O=`\\${O}`),O===`]`&&(D.value===`[`||D.value===`[^`)&&(O=`\\${O}`),d.posix===!0&&O===`!`&&D.value===`[`&&(O=`^`),D.value+=O,ye({value:O});continue}if(E.quotes===1&&O!==`"`){O=r.escapeRegex(O),D.value+=O,ye({value:O});continue}if(O===`"`){E.quotes=E.quotes===1?0:1,d.keepQuotes===!0&&Ce({type:`text`,value:O});continue}if(O===`(`){xe(`parens`),Ce({type:`paren`,value:O});continue}if(O===`)`){if(E.parens===0&&d.strictBrackets===!0)throw SyntaxError(u(`opening`,`(`));let e=de[de.length-1];if(e&&E.parens===e.parens+1){k(de.pop());continue}Ce({type:`paren`,value:O,output:E.parens?`)`:`\\)`}),Se(`parens`);continue}if(O===`[`){if(d.nobracket===!0||!_e().includes(`]`)){if(d.nobracket!==!0&&d.strictBrackets===!0)throw SyntaxError(u(`closing`,`]`));O=`\\${O}`}else xe(`brackets`);Ce({type:`bracket`,value:O});continue}if(O===`]`){if(d.nobracket===!0||D&&D.type===`bracket`&&D.value.length===1){Ce({type:`text`,value:O,output:`\\${O}`});continue}if(E.brackets===0){if(d.strictBrackets===!0)throw SyntaxError(u(`opening`,`[`));Ce({type:`text`,value:O,output:`\\${O}`});continue}Se(`brackets`);let e=D.value.slice(1);if(D.posix!==!0&&e[0]===`^`&&!e.includes(`/`)&&(O=`/${O}`),D.value+=O,ye({value:O}),d.literalBrackets===!1||r.hasRegexChars(e))continue;let t=r.escapeRegex(D.value);if(E.output=E.output.slice(0,-D.value.length),d.literalBrackets===!0){E.output+=t,D.value=t;continue}D.value=`(${g}${t}|${D.value})`,E.output+=D.value;continue}if(O===`{`&&d.nobrace!==!0){xe(`braces`);let e={type:`brace`,value:O,output:`(`,outputIndex:E.output.length,tokensIndex:E.tokens.length};fe.push(e),Ce(e);continue}if(O===`}`){let e=fe[fe.length-1];if(d.nobrace===!0||!e){Ce({type:`text`,value:O,output:O});continue}let t=`)`;if(e.dots===!0){let e=h.slice(),n=[];for(let t=e.length-1;t>=0&&(h.pop(),e[t].type!==`brace`);t--)e[t].type!==`dots`&&n.unshift(e[t].value);t=l(n,d),E.backtrack=!0}if(e.comma!==!0&&e.dots!==!0){let n=E.output.slice(0,e.outputIndex),r=E.tokens.slice(e.tokensIndex);e.value=e.output=`\\{`,O=t=`\\}`,E.output=n;for(let e of r)E.output+=e.output||e.value}Ce({type:`brace`,value:O,output:t}),Se(`braces`),fe.pop();continue}if(O===`|`){de.length>0&&de[de.length-1].conditions++,Ce({type:`text`,value:O});continue}if(O===`,`){let e=O,t=fe[fe.length-1];t&&pe[pe.length-1]===`braces`&&(t.comma=!0,e=`|`),Ce({type:`comma`,value:O,output:e});continue}if(O===`/`){if(D.type===`dot`&&E.index===E.start+1){E.start=E.index+1,E.consumed=``,E.output=``,h.pop(),D=m;continue}Ce({type:`slash`,value:O,output:C});continue}if(O===`.`){if(E.braces>0&&D.type===`dot`){D.value===`.`&&(D.output=x);let e=fe[fe.length-1];D.type=`dots`,D.output+=O,D.value+=O,e.dots=!0;continue}if(E.braces+E.parens===0&&D.type!==`bos`&&D.type!==`slash`){Ce({type:`text`,value:O,output:x});continue}Ce({type:`dot`,value:O,output:x});continue}if(O===`?`){if(!(D&&D.value===`(`)&&d.noextglob!==!0&&he()===`(`&&he(2)!==`?`){we(`qmark`,O);continue}if(D&&D.type===`paren`){let e=he(),t=O;(D.value===`(`&&!/[!=<:]/.test(e)||e===`<`&&!/<([!=]|\w+>)/.test(_e()))&&(t=`\\${O}`),Ce({type:`text`,value:O,output:t});continue}if(d.dot!==!0&&(D.type===`slash`||D.type===`bos`)){Ce({type:`qmark`,value:O,output:ie});continue}Ce({type:`qmark`,value:O,output:re});continue}if(O===`!`){if(d.noextglob!==!0&&he()===`(`&&(he(2)!==`?`||!/[!=<:]/.test(he(3)))){we(`negate`,O);continue}if(d.nonegate!==!0&&E.index===0){be();continue}}if(O===`+`){if(d.noextglob!==!0&&he()===`(`&&he(2)!==`?`){we(`plus`,O);continue}if(D&&D.value===`(`||d.regex===!1){Ce({type:`plus`,value:O,output:S});continue}if(D&&(D.type===`bracket`||D.type===`paren`||D.type===`brace`)||E.parens>0){Ce({type:`plus`,value:O});continue}Ce({type:`plus`,value:S});continue}if(O===`@`){if(d.noextglob!==!0&&he()===`(`&&he(2)!==`?`){Ce({type:`at`,extglob:!0,value:O,output:``});continue}Ce({type:`text`,value:O});continue}if(O!==`*`){(O===`$`||O===`^`)&&(O=`\\${O}`);let e=o.exec(_e());e&&(O+=e[0],E.index+=e[0].length),Ce({type:`text`,value:O});continue}if(D&&(D.type===`globstar`||D.star===!0)){D.type=`star`,D.star=!0,D.value+=O,D.output=ue,E.backtrack=!0,E.globstar=!0,ve(O);continue}let t=_e();if(d.noextglob!==!0&&/^\([^?]/.test(t)){we(`star`,O);continue}if(D.type===`star`){if(d.noglobstar===!0){ve(O);continue}let n=D.prev,r=n.prev,i=n.type===`slash`||n.type===`bos`,a=r&&(r.type===`star`||r.type===`globstar`);if(d.bash===!0&&(!i||t[0]&&t[0]!==`/`)){Ce({type:`star`,value:O,output:``});continue}let o=E.braces>0&&(n.type===`comma`||n.type===`brace`),s=de.length&&(n.type===`pipe`||n.type===`paren`);if(!i&&n.type!==`paren`&&!o&&!s){Ce({type:`star`,value:O,output:``});continue}for(;t.slice(0,3)===`/**`;){let n=e[E.index+4];if(n&&n!==`/`)break;t=t.slice(3),ve(`/**`,3)}let c=me()||E.parens>0&&t===`)`.repeat(E.parens)&&!de.some(e=>e.type===`negate`);if(n.type===`bos`&&me()){D.type=`globstar`,D.value+=O,D.output=se(d),E.output=D.output,E.globstar=!0,ve(O);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&!a&&c){E.output=E.output.slice(0,-(n.output+D.output).length),n.output=`(?:${n.output}`,D.type=`globstar`,D.output=se(d)+(d.strictSlashes?`)`:`|$)`),D.value+=O,E.globstar=!0,E.output+=n.output+D.output,ve(O);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&t[0]===`/`){let e=t[1]===void 0?``:`|$`;E.output=E.output.slice(0,-(n.output+D.output).length),n.output=`(?:${n.output}`,D.type=`globstar`,D.output=`${se(d)}${C}|${C}${e})`,D.value+=O,E.output+=n.output+D.output,E.globstar=!0,ve(O+ge()),Ce({type:`slash`,value:`/`,output:``});continue}if(n.type===`bos`&&t[0]===`/`){D.type=`globstar`,D.value+=O,D.output=`(?:^|${C}|${se(d)}${C})`,E.output=D.output,E.globstar=!0,ve(O+ge()),Ce({type:`slash`,value:`/`,output:``});continue}E.output=E.output.slice(0,-D.output.length),D.type=`globstar`,D.output=se(d),D.value+=O,E.output+=D.output,E.globstar=!0,ve(O);continue}let n={type:`star`,value:O,output:ue};if(d.bash===!0){n.output=`.*?`,(D.type===`bos`||D.type===`slash`)&&(n.output=ce+n.output),Ce(n);continue}if(D&&(D.type===`bracket`||D.type===`paren`)&&d.regex===!0){n.output=O,Ce(n);continue}(E.index===E.start||D.type===`slash`||D.type===`dot`)&&(D.type===`dot`?(E.output+=te,D.output+=te):d.dot===!0?(E.output+=ne,D.output+=ne):(E.output+=ce,D.output+=ce),he()!==`*`&&(E.output+=w,D.output+=w)),Ce(n)}for(;E.brackets>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`]`));E.output=r.escapeLast(E.output,`[`),Se(`brackets`)}for(;E.parens>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`)`));E.output=r.escapeLast(E.output,`(`),Se(`parens`)}for(;E.braces>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`}`));E.output=r.escapeLast(E.output,`{`),Se(`braces`)}if(d.strictSlashes!==!0&&(D.type===`star`||D.type===`bracket`)&&Ce({type:`maybe_slash`,value:``,output:`${C}?`}),E.backtrack===!0){E.output=``;for(let e of E.tokens)E.output+=e.output==null?e.value:e.output,e.suffix&&(E.output+=e.suffix)}return E};b.fastpaths=(e,t)=>{let a={...t},o=typeof a.maxLength==`number`?Math.min(i,a.maxLength):i,s=e.length;if(s>o)throw SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${o}`);e=c[e]||e;let{DOT_LITERAL:l,SLASH_LITERAL:u,ONE_CHAR:d,DOTS_SLASH:f,NO_DOT:p,NO_DOTS:m,NO_DOTS_SLASH:h,STAR:g,START_ANCHOR:_}=n.globChars(a.windows),v=a.dot?m:p,y=a.dot?h:p,b=a.capture?``:`?:`,x={negated:!1,prefix:``},S=a.bash===!0?`.*?`:g;a.capture&&(S=`(${S})`);let C=e=>e.noglobstar===!0?S:`(${b}(?:(?!${_}${e.dot?f:l}).)*?)`,w=e=>{switch(e){case`*`:return`${v}${d}${S}`;case`.*`:return`${l}${d}${S}`;case`*.*`:return`${v}${S}${l}${d}${S}`;case`*/*`:return`${v}${S}${u}${d}${y}${S}`;case`**`:return v+C(a);case`**/*`:return`(?:${v}${C(a)}${u})?${y}${d}${S}`;case`**/*.*`:return`(?:${v}${C(a)}${u})?${y}${S}${l}${d}${S}`;case`**/.*`:return`(?:${v}${C(a)}${u})?${l}${d}${S}`;default:{let t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;let n=w(t[1]);return n?n+l+t[2]:void 0}}},T=w(r.removePrefix(e,x));return T&&a.strictSlashes!==!0&&(T+=`${u}?`),T},t.exports=b})),nie=r(((e,t)=>{let n=eie(),r=tie(),i=oD(),a=aD(),o=e=>e&&typeof e==`object`&&!Array.isArray(e),s=(e,t,n=!1)=>{if(Array.isArray(e)){let r=e.map(e=>s(e,t,n));return e=>{for(let t of r){let n=t(e);if(n)return n}return!1}}let r=o(e)&&e.tokens&&e.input;if(e===``||typeof e!=`string`&&!r)throw TypeError(`Expected pattern to be a non-empty string`);let i=t||{},a=i.windows,c=r?s.compileRe(e,t):s.makeRe(e,t,!1,!0),l=c.state;delete c.state;let u=()=>!1;if(i.ignore){let e={...t,ignore:null,onMatch:null,onResult:null};u=s(i.ignore,e,n)}let d=(n,r=!1)=>{let{isMatch:o,match:d,output:f}=s.test(n,c,t,{glob:e,posix:a}),p={glob:e,state:l,regex:c,posix:a,input:n,output:f,match:d,isMatch:o};return typeof i.onResult==`function`&&i.onResult(p),o===!1?(p.isMatch=!1,r?p:!1):u(n)?(typeof i.onIgnore==`function`&&i.onIgnore(p),p.isMatch=!1,r?p:!1):(typeof i.onMatch==`function`&&i.onMatch(p),!r||p)};return n&&(d.state=l),d};s.test=(e,t,n,{glob:r,posix:a}={})=>{if(typeof e!=`string`)throw TypeError(`Expected input to be a string`);if(e===``)return{isMatch:!1,output:``};let o=n||{},c=o.format||(a?i.toPosixSlashes:null),l=e===r,u=l&&c?c(e):e;return l===!1&&(u=c?c(e):e,l=u===r),(l===!1||o.capture===!0)&&(l=o.matchBase===!0||o.basename===!0?s.matchBase(e,t,n,a):t.exec(u)),{isMatch:!!l,match:l,output:u}},s.matchBase=(e,t,n,r=n&&n.windows)=>(t instanceof RegExp?t:s.makeRe(t,n)).test(i.basename(e,{windows:r})),s.isMatch=(e,t,n)=>s(t,n)(e),s.parse=(e,t)=>Array.isArray(e)?e.map(e=>s.parse(e,t)):r(e,{...t,fastpaths:!1}),s.scan=(e,t)=>n(e,t),s.compileRe=(e,t,n=!1,r=!1)=>{if(n===!0)return e.output;let i=t||{},a=i.contains?``:`^`,o=i.contains?``:`$`,c=`${a}(?:${e.output})${o}`;e&&e.negated===!0&&(c=`^(?!${c}).*$`);let l=s.toRegex(c,t);return r===!0&&(l.state=e),l},s.makeRe=(e,t={},n=!1,i=!1)=>{if(!e||typeof e!=`string`)throw TypeError(`Expected a non-empty string`);let a={negated:!1,fastpaths:!0};return t.fastpaths!==!1&&(e[0]===`.`||e[0]===`*`)&&(a.output=r.fastpaths(e,t)),a.output||(a=r(e,t)),s.compileRe(a,t,n,i)},s.toRegex=(e,t)=>{try{let n=t||{};return new RegExp(e,n.flags||(n.nocase?`i`:``))}catch(e){if(t&&t.debug===!0)throw e;return/$^/}},s.constants=a,t.exports=s})),rie=r(((e,t)=>{let n=nie(),r=oD();function i(e,t,i=!1){return t&&(t.windows===null||t.windows===void 0)&&(t={...t,windows:r.isWindows()}),n(e,t,i)}Object.assign(i,n),t.exports=i})),iie=t(QE(),1),aie=t(Bre(),1),oie=t(Zre(),1),sie=t(iD(),1),sD=t(rie(),1);const cie={access:S,accessSync:C,readFile:w,readFileSync:T},lie={EOL:ee,homedir:te};var cD=r(((e,t)=>{let{flatTokensSymbol:n,htmlFlowSymbol:r,newlineRe:i}=_();function a(e){return Object.hasOwn(e,r)}function o(e){let{text:t,type:n}=e;if(n===`htmlFlow`&&t.startsWith(`<!--`)&&t.endsWith(`-->`)){let e=t.slice(4,-3);return!e.startsWith(`>`)&&!e.startsWith(`->`)&&!e.endsWith(`-`)}return!1}function s(e,t,n){for(let r=t;r<=n;r++)e.add(r)}function c(e,t,n){let r=[],i=[{array:e,index:0}];for(;i.length>0;){let e=i[i.length-1],{array:a,index:o}=e;if(o<a.length){let o=a[e.index++];t(o)&&r.push(o);let{children:s}=o;if(s.length>0){let e=n?n(o):s;i.push({array:e,index:0})}}else i.pop()}return r}function l(e,t,r){let i=e=>t.includes(e.type)&&(r||!a(e)),o=e[n];return o?o.filter(i):c(e,i)}function u(e,t,n=1){return l(e,[`blockQuotePrefix`,`linePrefix`]).filter(e=>e.startLine===t).map(e=>e.text).join(``).trimEnd().concat(`
|
|
197
|
+
`).repeat(n)}function d(e,t){let n=Array.isArray(e)?e:[e];for(let e of t){let t=t=>Array.isArray(e)?e.includes(t.type):e===t.type;n=n.flatMap(e=>e.children.filter(t))}return n}function f(e){let t=1,{text:n}=e.children.find(e=>[`atxHeadingSequence`,`setextHeadingLine`].includes(e.type));return n[0]===`#`?t=Math.min(n.length,6):n[0]===`-`&&(t=2),t}function p(e){return e.type===`setextHeading`?`setext`:e.children.filter(e=>e.type===`atxHeadingSequence`).length===1?`atx`:`atx_closed`}function m(e){return d(e,[[`atxHeadingText`,`setextHeadingText`]]).flatMap(e=>e.children.filter(e=>e.type!==`htmlText`)).map(e=>e.text).join(``).replace(i,` `)}function h(e){let t=/^<([^!>][^/\s>]*)/;if(e.type===`htmlText`){let n=t.exec(e.text);if(n){let e=n[1],t=e.startsWith(`/`);return{close:t,name:t?e.slice(1):e}}}return null}function g(e,t){let n=e;for(;(n=n.parent)&&!t.includes(n.type););return n}let v=/^#tab\//;function y(e){if(e?.type===`atxHeading`){let t=d(e,[`atxHeadingText`]);if(t.length===1&&t[0].children.length===1&&t[0].children[0].type===`link`){let e=l(t[0].children[0].children,[`resourceDestinationString`]);return e.length===1&&v.test(e[0].text)}}return!1}t.exports={addRangeToSet:s,filterByPredicate:c,filterByTypes:l,getBlockQuotePrefixText:u,getDescendantsByType:d,getHeadingLevel:f,getHeadingStyle:p,getHeadingText:m,getHtmlTagInfo:h,getParentOfType:g,inHtmlFlow:a,isDocfxTab:y,isHtmlFlowComment:o,nonContentTokens:new Set([`blockQuoteMarker`,`blockQuotePrefix`,`blockQuotePrefixWhitespace`,`gfmFootnoteDefinitionIndent`,`lineEnding`,`lineEndingBlank`,`linePrefix`,`listItemIndent`,`undefinedReference`,`undefinedReferenceCollapsed`,`undefinedReferenceFull`,`undefinedReferenceShortcut`])}})),V=t(r(((e,t)=>{let n=cD(),{newlineRe:r,nextLinesRe:i}=_();t.exports.newLineRe=r,t.exports.nextLinesRe=i,t.exports.frontMatterRe=/((^---[^\S\r\n\u2028\u2029]*$[\s\S]+?^---\s*)|(^\+\+\+[^\S\r\n\u2028\u2029]*$[\s\S]+?^(\+\+\+|\.\.\.)\s*)|(^\{[^\S\r\n\u2028\u2029]*$[\s\S]+?^\}\s*))(\r\n|\r|\n|$)/m;let a=/(<!--\s*markdownlint-(disable|enable|capture|restore|disable-file|enable-file|disable-line|disable-next-line|configure-file))(?:\s|-->)/gi;t.exports.inlineCommentStartRe=a,t.exports.endOfLineHtmlEntityRe=/&(?:#\d+|#[xX][\da-fA-F]+|[a-zA-Z]{2,31}|blk\d{2}|emsp1[34]|frac\d{2}|sup\d|there4);$/,t.exports.endOfLineGemojiCodeRe=/:(?:[abmovx]|[-+]1|100|1234|(?:1st|2nd|3rd)_place_medal|8ball|clock\d{1,4}|e-mail|non-potable_water|o2|t-rex|u5272|u5408|u55b6|u6307|u6708|u6709|u6e80|u7121|u7533|u7981|u7a7a|[a-z]{2,15}2?|[a-z]{1,14}(?:_[a-z\d]{1,16})+):$/;let o=`.,;:!?。,;:!?`;t.exports.allPunctuation=o,t.exports.allPunctuationNoQuestion=o.replace(/[??]/gu,``);function s(e){return typeof e==`number`}t.exports.isNumber=s;function c(e){return typeof e==`string`}t.exports.isString=c;function l(e){return e.length===0}t.exports.isEmptyString=l;function u(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}t.exports.isObject=u;function d(e){return!!e&&Object.getPrototypeOf(e)===URL.prototype}t.exports.isUrl=d;function f(e){return Array.isArray(e)?[...e]:e}t.exports.cloneIfArray=f;function p(e){return d(e)?new URL(e):e}t.exports.cloneIfUrl=p,t.exports.getHtmlAttributeRe=function(e){return RegExp(`\\s${e}\\s*=\\s*['"]?([^'"\\s>]*)`,`iu`)};function m(e){return!e||!e.trim()||!(e=>{for(;;){let t=e.indexOf(`<!--`),n=e.indexOf(`-->`);if(n!==-1&&(t===-1||n<t))e=e.slice(n+3);else if(t!==-1&&n!==-1)e=e.slice(0,t)+e.slice(n+3);else if(t!==-1&&n===-1)e=e.slice(0,t);else return e}})(e).replace(/>/g,``).trim()}t.exports.isBlankLine=m;let h=/^ *\|/,g=/[^\r\n]/g,v=/[^ \r\n]/g,y=/ +[\r\n]/g,b=e=>e.replace(g,`.`);t.exports.clearHtmlCommentText=function(e){let t=0;for(;(t=e.indexOf(`<!--`,t))!==-1;){let n=e.indexOf(`-->`,t+2);if(n===-1)break;if(n>t+4){let r=e.slice(t+4,n),i=e.lastIndexOf(`
|
|
198
|
+
`,t)+1,a=e.slice(i,t),o=a.trim().length===0,s=h.test(a)&&r.includes(`
|
|
199
|
+
`);if(o||!(s||r.startsWith(`>`)||r.startsWith(`->`)||r.endsWith(`-`)||r.includes(`--`))){let i=r.replace(v,`.`).replace(y,b);e=e.slice(0,t+4)+i+e.slice(n)}}t=n+3}return e},t.exports.escapeForRegExp=function(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,`\\$&`)};function x(e,t,n){return e.length<=30||(e=t&&n?e.slice(0,15)+`...`+e.slice(-15):n?`...`+e.slice(-30):e.slice(0,30)+`...`),e}t.exports.ellipsify=x;function S(e,t,n,r,i,a){e({lineNumber:t,detail:n,context:r,range:i,fixInfo:a})}t.exports.addError=S;function C(e,t,n,r,i,a,o,s){n!==r&&S(e,t,`Expected: `+n+`; Actual: `+r+(i?`; `+i:``),a,o,s)}t.exports.addErrorDetailIf=C;function w(e,t,n,i,a,o,s){n=x(n.replace(r,`
|
|
200
|
+
`),i,a),S(e,t,void 0,n,o,s)}t.exports.addErrorContext=w;let T=(e,t,n,r)=>e<n||e===n&&t<=r;t.exports.hasOverlap=function(e,t){let n=T(e.startLine,e.startColumn,t.startLine,t.startColumn),r=n?e:t,i=n?t:e;return T(i.startLine,i.startColumn,r.endLine,r.endColumn)},t.exports.frontMatterHasTitle=function(e,t){let n=t!==void 0&&!t,r=new RegExp(String(t||`^\\s*"?title"?\\s*[:=]`),`i`);return!n&&e.some(e=>r.test(e))};function ee(e){let t=e=>e.toLowerCase().trim().replace(/\s+/g,` `),r=e=>e?.children.filter(e=>e.type!==`blockQuotePrefix`).map(e=>e.text).join(``),i=new Map,a=new Map,o=(e,n,r)=>{let o=[e.startLine-1,e.startColumn-1,e.text.length],s=t(n),c=r?a:i,l=c.get(s)||[];l.push(o),c.set(s,l)},s=new Map,c=[],l=[],u=n.filterByTypes(e,[`definition`,`gfmFootnoteDefinition`,`definitionLabelString`,`gfmFootnoteDefinitionLabelString`,`gfmFootnoteCall`,`image`,`link`,`undefinedReferenceCollapsed`,`undefinedReferenceFull`,`undefinedReferenceShortcut`]);for(let e of u){let i=``;switch(e.type){case`definition`:case`gfmFootnoteDefinition`:for(let t=e.startLine;t<=e.endLine;t++)c.push(t-1);break;case`gfmFootnoteDefinitionLabelString`:i=`^`;case`definitionLabelString`:{let r=t(`${i}${e.text}`);if(s.has(r))l.push([r,e.startLine-1]);else{let t=n.getParentOfType(e,[`definition`]),i=t&&n.getDescendantsByType(t,[`definitionDestination`,`definitionDestinationRaw`,`definitionDestinationString`])[0]?.text;s.set(r,[e.startLine-1,i||``])}break}case`gfmFootnoteCall`:case`image`:case`link`:{let t=e.children.length===1,i=e.children.length===2&&!e.children.some(e=>e.type===`resource`),[a]=n.getDescendantsByType(e,[`label`,`labelText`]),[s]=n.getDescendantsByType(e,[`reference`,`referenceString`]),c=r(a);if(!t&&!i){let[n,r]=e.children.filter(e=>[`gfmFootnoteCallMarker`,`gfmFootnoteCallString`].includes(e.type));n&&r&&(c=`${n.text}${r.text}`,t=!0)}(t||i)&&o(e,r(s)||c,t);break}case`undefinedReferenceCollapsed`:case`undefinedReferenceFull`:case`undefinedReferenceShortcut`:o(e,n.getDescendantsByType(e,[`undefinedReference`])[0].children.map(e=>e.text).join(``),e.type===`undefinedReferenceShortcut`)}}return{references:i,shortcuts:a,definitions:s,duplicateDefinitions:l,definitionLineIndices:c}}t.exports.getReferenceLinkImageData=ee;function te(e,t){let n=0,i=0,a=0,o=e.match(r)||[];for(let e of o)switch(e){case`\r`:n++;break;case`
|
|
201
|
+
`:i++;break;case`\r
|
|
202
|
+
`:a++}let s=null;return s=!n&&!i&&!a?t&&t.EOL||`
|
|
203
|
+
`:i>=a&&i>=n?`
|
|
204
|
+
`:a>=n?`\r
|
|
205
|
+
`:`\r`,s}t.exports.getPreferredLineEnding=te;function ne(e,t){let n=t&&t.homedir&&t.homedir();return n?e.replace(/^~($|\/|\\)/,`${n}$1`):e}t.exports.expandTildePath=ne;function re(e){let t={ruleNames:[],lineNumber:-1};return e.filter((e,n,r)=>{delete e.fixInfo,delete e.severity;let i=r[n-1]||t;return e.ruleNames[0]!==i.ruleNames[0]||e.lineNumber!==i.lineNumber})}function ie(e){for(let t of e)t.ruleName=t.ruleNames[0],t.ruleAlias=t.ruleNames[1]||t.ruleName,delete t.ruleNames;return e}function ae(e){let t={};for(let n of e){let e=n.ruleNames[0],r=t[e]||[];r.push(n.lineNumber),t[e]=r}return t}function oe(e,t){let n={};for(let[r,i]of Object.entries(e))n[r]=t(i.map(e=>({...e})));return n}t.exports.convertToResultVersion0=function(e){return oe(e,e=>ae(re(e)))},t.exports.convertToResultVersion1=function(e){return oe(e,e=>ie(re(e)))},t.exports.convertToResultVersion2=function(e){return oe(e,re)},t.exports.formatLintResults=function(e){let t=[],n=Object.entries(e||{});n.sort((e,t)=>e[0].localeCompare(t[0]));for(let[e,r]of n)for(let n of r){let{lineNumber:r,ruleNames:i,ruleDescription:a,errorDetail:o,errorContext:s,errorRange:c,severity:l}=n,u=i.join(`/`),d=`:${r}`,f=c&&c[0]||0,p=f?`:${f}`:``,m=a,h=o?` [${o}]`:``,g=s?` [Context: "${s}"]`:``;t.push(`${e}${d}${p} ${l} ${u} ${m}${h}${g}`)}return t}}))(),1),H=cD();const lD=new Map;let uD;function dD(e){lD.clear(),uD=e}function fD(){return uD?.parsers.micromark.tokens||[]}function pD(e,t){if(lD.has(e))return lD.get(e);let n=t();return lD.set(e,n),n}function mD(e,t){return pD(JSON.stringify(arguments),()=>(0,H.filterByTypes)(fD(),e,t))}function hD(){return pD(hD.name,()=>(0,V.getReferenceLinkImageData)(fD()))}const gD=`0.41.1`;var uie=r(((e,t)=>{function n(){return v()}t.exports={requireMarkdownItCjs:n}})),die=r(((t,n)=>{let r=typeof __non_webpack_require__>`u`?e:__non_webpack_require__,i=(e,t,n=[])=>{let r=e.paths?.(``)||[];return e(t,{paths:[...n,...r]})};n.exports={resolveModule:(e,t)=>i(r.resolve,e,t),resolveModuleCustomResolve:i}})),fie=uie();die();var pie={names:[`MD001`,`heading-increment`],description:`Heading levels should only increment by one level at a time`,tags:[`headings`],parser:`micromark`,function:function(e,t){let n=(0,V.frontMatterHasTitle)(e.frontMatterLines,e.config.front_matter_title)?1:2**53-1;for(let e of mD([`atxHeading`,`setextHeading`])){let r=(0,H.getHeadingLevel)(e);r>n&&(0,V.addErrorDetailIf)(t,e.startLine,`h${n+1}`,`h${r}`),n=r}}},mie={names:[`MD003`,`heading-style`],description:`Heading style`,tags:[`headings`],parser:`micromark`,function:function(e,t){let n=String(e.config.style||`consistent`);for(let e of mD([`atxHeading`,`setextHeading`])){let r=(0,H.getHeadingStyle)(e);if(n===`consistent`&&(n=r),r!==n){let i=(0,H.getHeadingLevel)(e)<=2;if(!(n===`setext_with_atx`&&(i&&r===`setext`||!i&&r===`atx`))&&!(n===`setext_with_atx_closed`&&(i&&r===`setext`||!i&&r===`atx_closed`))){let a=n;n===`setext_with_atx`?a=i?`setext`:`atx`:n===`setext_with_atx_closed`&&(a=i?`setext`:`atx_closed`),(0,V.addErrorDetailIf)(t,e.startLine,a,r)}}}}};const hie=e=>e===`-`?`dash`:e===`+`?`plus`:`asterisk`,gie=e=>e===`dash`?`-`:e===`plus`?`+`:`*`,_ie=e=>e===`dash`?`plus`:e===`plus`?`asterisk`:`dash`,vie=new Set([`asterisk`,`consistent`,`dash`,`plus`,`sublist`]);var yie={names:[`MD004`,`ul-style`],description:`Unordered list style`,tags:[`bullet`,`ul`],parser:`micromark`,function:function(e,t){let n=String(e.config.style||`consistent`),r=vie.has(n)?n:`dash`,i=[];for(let e of mD([`listUnordered`])){let a=0;if(n===`sublist`){let t=e;for(;t=(0,H.getParentOfType)(t,[`listOrdered`,`listUnordered`]);)a++}let o=(0,H.getDescendantsByType)(e,[`listItemPrefix`,`listItemMarker`]);for(let e of o){let o=hie(e.text);n===`sublist`?(i[a]||(i[a]=o===i[a-1]?_ie(o):o),r=i[a]):r===`consistent`&&(r=o);let s=e.startColumn,c=e.endColumn-e.startColumn;(0,V.addErrorDetailIf)(t,e.startLine,r,o,void 0,void 0,[s,c],{editColumn:s,deleteCount:c,insertText:gie(r)})}}}},bie={names:[`MD005`,`list-indent`],description:`Inconsistent indentation for list items at the same level`,tags:[`bullet`,`ul`,`indentation`],parser:`micromark`,function:function(e,t){for(let e of mD([`listOrdered`,`listUnordered`])){let n=e.startColumn-1,r=0,i=!1,a=e.children.filter(e=>e.type===`listItemPrefix`);for(let o of a){let a=o.startLine,s=o.startColumn-1,c=[1,o.endColumn-1];if(e.type===`listUnordered`)(0,V.addErrorDetailIf)(t,a,n,s,void 0,void 0,c);else{let e=o.text.trim().length,l=o.startColumn+e-1;if(r||=l,n!==s||i){if(r===l)i=!0;else{let o=i?`Expected: (${r}); Actual: (${l})`:`Expected: ${n}; Actual: ${s}`,u=i?r-e:n,d=i?l-e:s;(0,V.addError)(t,a,o,void 0,c,{editColumn:Math.min(d,u)+1,deleteCount:Math.max(d-u,0),insertText:``.padEnd(Math.max(u-d,0))})}}}}}}};const xie=[`blockQuotePrefix`,`listItemPrefix`,`listUnordered`],Sie=[`blockQuote`,`listOrdered`,`listUnordered`];var Cie={names:[`MD007`,`ul-indent`],description:`Unordered list indentation`,tags:[`bullet`,`ul`,`indentation`],parser:`micromark`,function:function(e,t){let n=Number(e.config.indent||2),r=!!e.config.start_indented,i=Number(e.config.start_indent||n),a=new Map,o=null,s=mD(xie);for(let e of s){let{endColumn:s,parent:c,startColumn:l,startLine:u,type:d}=e;if(d===`blockQuotePrefix`)o=e;else if(d===`listUnordered`){let t=0,n=e;for(;n=(0,H.getParentOfType)(n,Sie);){if(n.type===`listUnordered`){t++;continue}n.type===`listOrdered`&&(t=-1);break}t>=0&&a.set(e,t)}else{let d=a.get(c);if(d!==void 0){let a=((0,H.getParentOfType)(e,[`gfmFootnoteDefinition`])?4:0)+(r?i:0)+d*n,c=o?.endLine===u?o.endColumn-1:0,f=l-1-c,p=[1,s-1],m={editColumn:l-f,deleteCount:Math.max(f-a,0),insertText:``.padEnd(Math.max(a-f,0))};(0,V.addErrorDetailIf)(t,u,a,f,void 0,void 0,p,m)}}}}},wie={names:[`MD009`,`no-trailing-spaces`],description:`Trailing spaces`,tags:[`whitespace`],parser:`micromark`,function:function(e,t){let n=e.config.br_spaces;n=Number(n===void 0?2:n);let r=e.config.code_blocks,i=r!==void 0&&!!r,a=!!e.config.list_item_empty_lines,o=!!e.config.strict,s=new Set;if(!i){for(let e of mD([`codeFenced`]))(0,H.addRangeToSet)(s,e.startLine+1,e.endLine-1);for(let e of mD([`codeIndented`]))(0,H.addRangeToSet)(s,e.startLine,e.endLine)}let c=new Set;if(a)for(let e of mD([`listOrdered`,`listUnordered`])){(0,H.addRangeToSet)(c,e.startLine,e.endLine);let t=!0;for(let n=e.children.length-1;n>=0;n--){let r=e.children[n];switch(r.type){case`content`:t=!1;break;case`listItemIndent`:t&&c.delete(r.startLine);break;case`listItemPrefix`:t=!0}}}let l=new Set,u=new Set;if(o){for(let e of mD([`paragraph`]))(0,H.addRangeToSet)(l,e.startLine,e.endLine-1);for(let e of mD([`codeText`]))(0,H.addRangeToSet)(u,e.startLine,e.endLine-1)}let d=n<2?0:n;for(let n=0;n<e.lines.length;n++){let r=e.lines[n],i=n+1,a=r.length-r.trimEnd().length;if(a&&!s.has(i)&&!c.has(i)&&(d!==a||o&&(!l.has(i)||u.has(i)))){let e=r.length-a+1;(0,V.addError)(t,i,`Expected: `+(d===0?``:`0 or `)+d+`; Actual: `+a,void 0,[e,a],{editColumn:e,deleteCount:a})}}}};const Tie=/\t+/g;var Eie={names:[`MD010`,`no-hard-tabs`],description:`Hard tabs`,tags:[`whitespace`,`hard_tab`],parser:`micromark`,function:function(e,t){let n=e.config.code_blocks,r=n===void 0||!!n,i=new Set((e.config.ignore_code_languages||[]).map(e=>String(e).toLowerCase())),a=e.config.spaces_per_tab,o=a===void 0?1:Math.max(0,Number(a)),s=[];r?i.size>0&&s.push(`codeFenced`):s.push(`codeFenced`,`codeIndented`,`codeText`);let c=mD(s).filter(e=>e.type===`codeFenced`&&i.size>0?(0,H.getDescendantsByType)(e,[`codeFencedFence`,`codeFencedFenceInfo`]).every(e=>i.has(e.text.toLowerCase())):!0).map(e=>{let{type:t,startLine:n,startColumn:r,endLine:i,endColumn:a}=e,o=t===`codeFenced`;return{startLine:n+ +!!o,startColumn:o?0:r,endLine:i-+!!o,endColumn:o?2**53-1:a}});for(let n=0;n<e.lines.length;n++){let r=e.lines[n],i=null;for(;(i=Tie.exec(r))!==null;){let e=n+1,r=i.index+1,a=i[0].length,s={startLine:e,startColumn:r,endLine:e,endColumn:r+a-1};c.some(e=>(0,V.hasOverlap)(e,s))||(0,V.addError)(t,e,`Column: `+r,void 0,[r,a],{editColumn:r,deleteCount:a,insertText:``.padEnd(a*o)})}}}};const Die=/(^|[^\\])\(([^()]+)\)\[([^\]^][^\]]*)\](?!\()/g;var Oie={names:[`MD011`,`no-reversed-links`],description:`Reversed link syntax`,tags:[`links`],parser:`micromark`,function:function(e,t){let n=new Set;for(let e of mD([`codeFenced`,`codeIndented`,`mathFlow`]))(0,H.addRangeToSet)(n,e.startLine,e.endLine);let r=mD([`codeText`,`mathText`]);for(let[i,a]of e.lines.entries()){let e=i+1;if(!n.has(e)){let n=null;for(;(n=Die.exec(a))!==null;){let[i,a,o,s]=n;if(!o.endsWith(`\\`)&&!s.endsWith(`\\`)){let c=n.index+a.length+1,l=n[0].length-a.length,u={startLine:e,startColumn:c,endLine:e,endColumn:c+l-1};r.some(e=>(0,V.hasOverlap)(e,u))||(0,V.addError)(t,e,i.slice(a.length),void 0,[c,l],{editColumn:c,deleteCount:l,insertText:`[${o}](${s})`})}}}}}},kie={names:[`MD012`,`no-multiple-blanks`],description:`Multiple consecutive blank lines`,tags:[`whitespace`,`blank_lines`],parser:`micromark`,function:function(e,t){let n=Number(e.config.maximum||1),{lines:r}=e,i=new Set;for(let e of mD([`codeFenced`,`codeIndented`]))(0,H.addRangeToSet)(i,e.startLine,e.endLine);let a=0;for(let[e,o]of r.entries())a=i.has(e+1)||o.trim().length>0?0:a+1,n<a&&(0,V.addErrorDetailIf)(t,e+1,n,a,void 0,void 0,void 0,{deleteCount:-1})}};const Aie=/^(?:[#>\s]*\s)?\S*$/;var jie={names:[`MD013`,`line-length`],description:`Line length`,tags:[`line_length`],parser:`micromark`,function:function(e,t){let n=Number(e.config.line_length||80),r=Number(e.config.heading_line_length||n),i=Number(e.config.code_block_line_length||n),a=!!e.config.strict,o=!!e.config.stern,s=e.config.code_blocks,c=s===void 0||!!s,l=e.config.tables,u=l===void 0||!!l,d=e.config.headings,f=d===void 0||!!d,p=new Set;for(let e of mD([`atxHeading`,`setextHeading`]))(0,H.addRangeToSet)(p,e.startLine,e.endLine);let m=new Set;for(let e of mD([`codeFenced`,`codeIndented`]))(0,H.addRangeToSet)(m,e.startLine,e.endLine);let h=new Set;for(let e of mD([`table`]))(0,H.addRangeToSet)(h,e.startLine,e.endLine);let g=new Set;for(let e of mD([`autolink`,`image`,`link`,`literalAutolink`]))(0,H.addRangeToSet)(g,e.startLine,e.endLine);let _=new Set;for(let e of mD([`paragraph`]))for(let t of(0,H.getDescendantsByType)(e,[`data`]))(0,H.addRangeToSet)(_,t.startLine,t.endLine);let v=new Set;for(let e of g)_.has(e)||v.add(e);let y=new Set(hD().definitionLineIndices);for(let s=0;s<e.lines.length;s++){let l=e.lines[s],d=s+1,g=p.has(d),_=m.has(d),b=h.has(d),x=_?i:g?r:n,S=a||o?l:l.replace(/\S*$/u,`#`);x>0&&(c||!_)&&(u||!b)&&(f||!g)&&!y.has(s)&&(a||!(o&&Aie.test(l))&&!v.has(d))&&S.length>x&&(0,V.addErrorDetailIf)(t,d,x,l.length,void 0,void 0,[x+1,l.length-x])}}};const Mie=/^(\s*)(\$\s+)/;var Nie={names:[`MD014`,`commands-show-output`],description:`Dollar signs used before commands without showing output`,tags:[`code`],parser:`micromark`,function:function(e,t){for(let e of mD([`codeFenced`,`codeIndented`])){let n=e.children.filter(e=>e.type===`codeFlowValue`),r=n.map(e=>({result:e.text.match(Mie),startColumn:e.startColumn,startLine:e.startLine,text:e.text})).filter(e=>e.result);if(r.length===n.length)for(let e of r){let n=e.startColumn+e.result[1].length,r=e.result[2].length;(0,V.addErrorContext)(t,e.startLine,e.text,void 0,void 0,[n,r],{editColumn:n,deleteCount:r})}}}},Pie={names:[`MD018`,`no-missing-space-atx`],description:`No space after hash on atx style heading`,tags:[`headings`,`atx`,`spaces`],parser:`micromark`,function:function(e,t){let{lines:n}=e,r=new Set;for(let e of mD([`codeFenced`,`codeIndented`,`htmlFlow`]))(0,H.addRangeToSet)(r,e.startLine,e.endLine);for(let[e,i]of n.entries())if(!r.has(e+1)&&/^#+[^# \t]/.test(i)&&!/#\s*$/.test(i)&&!i.startsWith(`#️⃣`)){let n=/^#+/.exec(i)[0].length;(0,V.addErrorContext)(t,e+1,i.trim(),void 0,void 0,[1,n+1],{editColumn:n+1,insertText:` `})}}};function _D(e,t,n){let{children:r,startLine:i,text:a}=t,o=n>0?0:r.length-1;for(;r[o]&&r[o].type!==`atxHeadingSequence`;)o+=n;let s=r[o],c=r[o+n];if(s?.type===`atxHeadingSequence`&&c?.type===`whitespace`&&c.text.length>1){let t=c.startColumn+1,r=c.endColumn-t;(0,V.addErrorContext)(e,i,a.trim(),n>0,n<0,[t,r],{editColumn:t,deleteCount:r})}}var Fie=[{names:[`MD019`,`no-multiple-space-atx`],description:`Multiple spaces after hash on atx style heading`,tags:[`headings`,`atx`,`spaces`],parser:`micromark`,function:function(e,t){let n=mD([`atxHeading`]).filter(e=>(0,H.getHeadingStyle)(e)===`atx`);for(let e of n)_D(t,e,1)}},{names:[`MD021`,`no-multiple-space-closed-atx`],description:`Multiple spaces inside hashes on closed atx style heading`,tags:[`headings`,`atx_closed`,`spaces`],parser:`micromark`,function:function(e,t){let n=mD([`atxHeading`]).filter(e=>(0,H.getHeadingStyle)(e)===`atx_closed`);for(let e of n)_D(t,e,1),_D(t,e,-1)}}],Iie={names:[`MD020`,`no-missing-space-closed-atx`],description:`No space inside hashes on closed atx style heading`,tags:[`headings`,`atx_closed`,`spaces`],parser:`micromark`,function:function(e,t){let{lines:n}=e,r=new Set;for(let e of mD([`codeFenced`,`codeIndented`,`htmlFlow`]))(0,H.addRangeToSet)(r,e.startLine,e.endLine);for(let[e,i]of n.entries())if(!r.has(e+1)){let n=/^(#+)([ \t]*)([^# \t\\]|[^# \t][^#]*?[^# \t\\])([ \t]*)((?:\\#)?)(#+)(\s*)$/.exec(i);if(n){let[,r,{length:a},o,{length:s},c,l,{length:u}]=n,d=r.length,f=l.length,p=!a,m=!s||!!c,h=c?`${c} `:``;if(p||m){let n=p?[1,d+1]:[i.length-u-f,f+1];(0,V.addErrorContext)(t,e+1,i.trim(),p,m,n,{editColumn:1,deleteCount:i.length,insertText:`${r} ${o} ${h}${l}`})}}}}};const vD=e=>{if(Array.isArray(e)){let t=[,,,,,,].fill(1);for(let[n,r]of[...e.entries()].slice(0,6))t[n]=r;return e=>t[(0,H.getHeadingLevel)(e)-1]}let t=e===void 0?1:Number(e);return()=>t},yD=(e,t,n,r)=>t>=0&&t<e.length?e[t]:r&&n.length>0&&t<0&&t>=-n.length?n[n.length+t]:``;var Lie={names:[`MD022`,`blanks-around-headings`],description:`Headings should be surrounded by blank lines`,tags:[`headings`,`blank_lines`],parser:`micromark`,function:function(e,t){let n=vD(e.config.lines_above),r=vD(e.config.lines_below),i=!!e.config.include_front_matter,{lines:a,frontMatterLines:o}=e,s=mD([`blockQuotePrefix`,`linePrefix`]);for(let e of mD([`atxHeading`,`setextHeading`])){let{startLine:c,endLine:l}=e,u=a[c-1].trim(),d=n(e);if(d>=0){let e=0;for(let t=0;t<d&&(0,V.isBlankLine)(yD(a,c-2-t,o,i));t++)e++;(0,V.addErrorDetailIf)(t,c,d,e,`Above`,u,void 0,{insertText:(0,H.getBlockQuotePrefixText)(s,c-1,d-e)})}let f=r(e);if(f>=0){let e=0;for(let t=0;t<f&&(0,V.isBlankLine)(yD(a,l+t,o,!1));t++)e++;(0,V.addErrorDetailIf)(t,c,f,e,`Below`,u,void 0,{lineNumber:l+1,insertText:(0,H.getBlockQuotePrefixText)(s,l+1,f-e)})}}}},Rie={names:[`MD023`,`heading-start-left`],description:`Headings must start at the beginning of the line`,tags:[`headings`,`spaces`],parser:`micromark`,function:function(e,t){let n=mD([`atxHeading`,`linePrefix`,`setextHeading`]);for(let r=0;r<n.length-1;r++)if(n[r].type===`linePrefix`&&n[r+1].type!==`linePrefix`&&n[r].startLine===n[r+1].startLine){let{endColumn:i,startColumn:a,startLine:o}=n[r],s=i-a;(0,V.addErrorContext)(t,o,e.lines[o-1],!0,!1,[a,s],{editColumn:a,deleteCount:s})}}},zie={names:[`MD024`,`no-duplicate-heading`],description:`Multiple headings with the same content`,tags:[`headings`],parser:`micromark`,function:function(e,t){let n=!!e.config.siblings_only,r=[null,[]],i=1,a=r[i];for(let e of mD([`atxHeading`,`setextHeading`])){let o=(0,H.getHeadingText)(e);if(n){let t=(0,H.getHeadingLevel)(e);for(;i<t;)i++,r[i]=[];for(;i>t;)r[i]=[],i--;a=r[t]}a.includes(o)?(0,V.addErrorContext)(t,e.startLine,o.trim()):a.push(o)}}},Bie={names:[`MD025`,`single-title`,`single-h1`],description:`Multiple top-level headings in the same document`,tags:[`headings`],parser:`micromark`,function:function(e,t){let n=Number(e.config.level||1),{tokens:r}=e.parsers.micromark,i=mD([`atxHeading`,`setextHeading`]).filter(e=>n===(0,H.getHeadingLevel)(e)&&!(0,H.isDocfxTab)(e));if(i.length>0){let n=(0,V.frontMatterHasTitle)(e.frontMatterLines,e.config.front_matter_title),a=n;if(a||=r.slice(0,r.indexOf(i[0])).every(e=>H.nonContentTokens.has(e.type)||(0,H.isHtmlFlowComment)(e)),a)for(let e of i.slice(+!n))(0,V.addErrorContext)(t,e.startLine,(0,H.getHeadingText)(e))}}},Vie={names:[`MD026`,`no-trailing-punctuation`],description:`Trailing punctuation in heading`,tags:[`headings`],parser:`micromark`,function:function(e,t){let n=e.config.punctuation;n=String(n===void 0?V.allPunctuationNoQuestion:n);let r=RegExp(`\\s*[`+(0,V.escapeForRegExp)(n)+`]+$`),i=mD([`atxHeadingText`,`setextHeadingText`]);for(let e of i){let{endColumn:n,endLine:i,text:a}=e,o=r.exec(a);if(o&&!V.endOfLineHtmlEntityRe.test(a)&&!V.endOfLineGemojiCodeRe.test(a)){let e=o[0],r=e.length,a=n-r;(0,V.addError)(t,i,`Punctuation: '${e}'`,void 0,[a,r],{editColumn:a,deleteCount:r})}}}};const bD=[`listOrdered`,`listUnordered`];var Hie={names:[`MD027`,`no-multiple-space-blockquote`],description:`Multiple spaces after blockquote symbol`,tags:[`blockquote`,`whitespace`,`indentation`],parser:`micromark`,function:function(e,t){let n=e.config.list_items,r=n===void 0||!!n,{tokens:i}=e.parsers.micromark;for(let n of mD([`linePrefix`])){let a=n.parent,o=a?.type===`codeIndented`,s=a?.children||i;if(!o&&s[s.indexOf(n)-1]?.type===`blockQuotePrefix`&&(r||!bD.includes(s[s.indexOf(n)+1]?.type)&&!(0,H.getParentOfType)(n,bD))){let{startColumn:r,startLine:i,text:a}=n,{length:o}=a,s=e.lines[i-1];(0,V.addErrorContext)(t,i,s,void 0,void 0,[r,o],{editColumn:r,deleteCount:o})}}}};const Uie=new Set([`lineEnding`,`listItemIndent`,`linePrefix`]);var Wie={names:[`MD028`,`no-blanks-blockquote`],description:`Blank line inside blockquote`,tags:[`blockquote`,`whitespace`],parser:`micromark`,function:function(e,t){for(let n of mD([`blockQuote`])){let r=[],i=n.parent?.children||e.parsers.micromark.tokens;for(let e=i.indexOf(n)+1;e<i.length;e++){let{startLine:n,type:a}=i[e];if(a===`lineEndingBlank`)r.push(n);else if(!Uie.has(a)){if(a===`blockQuote`){for(let e of r)(0,V.addError)(t,e);break}break}}}}};const xD={one:`1/1/1`,ordered:`1/2/3`,zero:`0/0/0`},Gie=Object.keys(xD);function SD(e){let{startColumn:t,endColumn:n,text:r}=(0,H.getDescendantsByType)(e,[`listItemValue`])[0];return{startColumn:t,endColumn:n,text:r,number:Number(r)}}var Kie={names:[`MD029`,`ol-prefix`],description:`Ordered list item prefix`,tags:[`ol`],parser:`micromark`,function:function(e,t){let n=String(e.config.style);for(let e of mD([`listOrdered`])){let r=(0,H.getDescendantsByType)(e,[`listItemPrefix`]),i=1,a=!1,o=!1,s=!1;if(r.length>0){let e=r[0].endColumn;if(o=r.every(t=>t.endColumn===e),r.length>1){let e=SD(r[0]);(SD(r[1]).number!==1||e.number===0)&&(a=!0,e.number===0&&(i=0)),s=e.text.startsWith(`0`)}}let c=Gie.includes(n)?n:a?`ordered`:`one`;c===`zero`?i=0:c===`one`&&(i=1);for(let e of r){let n=i.toString(),{endColumn:r,startColumn:a,number:l}=SD(e),u=r-a,d={editColumn:a,deleteCount:u,insertText:o?n.padStart(u,s?`0`:` `):n};(0,V.addErrorDetailIf)(t,e.startLine,i,l,`Style: `+xD[c],void 0,[e.startColumn,e.endColumn-e.startColumn],d),c===`ordered`&&i++}}}},qie={names:[`MD030`,`list-marker-space`],description:`Spaces after list markers`,tags:[`ol`,`ul`,`whitespace`],parser:`micromark`,function:function(e,t){let n=Number(e.config.ul_single||1),r=Number(e.config.ol_single||1),i=Number(e.config.ul_multi||1),a=Number(e.config.ol_multi||1);for(let e of mD([`listOrdered`,`listUnordered`])){let o=e.type===`listOrdered`,s=e.children.filter(e=>e.type===`listItemPrefix`),c=e.endLine-e.startLine+1===s.length,l=o?c?r:a:c?n:i;for(let e of s){let n=[e.startColumn,e.endColumn-e.startColumn],r=e.children.filter(e=>e.type===`listItemPrefixWhitespace`);for(let e of r){let{endColumn:r,startColumn:i,startLine:a}=e,o=r-i,s={editColumn:i,deleteCount:o,insertText:``.padEnd(l)};(0,V.addErrorDetailIf)(t,a,l,o,void 0,void 0,n,s)}}}}};const Jie=/^(.*?)[`~]/;function CD(e,t,n,r){let i=t[n-1],[,a]=i.match(Jie)||[],o=a===void 0?void 0:{lineNumber:n+ +!r,insertText:`${a.replace(/[^>]/g,` `).trim()}\n`};(0,V.addErrorContext)(e,n,i.trim(),void 0,void 0,void 0,o)}var Yie={names:[`MD031`,`blanks-around-fences`],description:`Fenced code blocks should be surrounded by blank lines`,tags:[`code`,`blank_lines`],parser:`micromark`,function:function(e,t){let n=e.config.list_items,r=n===void 0||!!n,{lines:i}=e;for(let e of mD([`codeFenced`]))(r||!(0,H.getParentOfType)(e,[`listOrdered`,`listUnordered`]))&&((0,V.isBlankLine)(i[e.startLine-2])||CD(t,i,e.startLine,!0),!(0,V.isBlankLine)(i[e.endLine])&&!(0,V.isBlankLine)(i[e.endLine-1])&&CD(t,i,e.endLine,!1))}};const wD=e=>e.type===`listOrdered`||e.type===`listUnordered`;var Xie={names:[`MD032`,`blanks-around-lists`],description:`Lists should be surrounded by blank lines`,tags:[`bullet`,`ul`,`ol`,`blank_lines`],parser:`micromark`,function:function(e,t){let{lines:n,parsers:r}=e,i=mD([`blockQuotePrefix`,`linePrefix`]),a=(0,H.filterByPredicate)(r.micromark.tokens,wD,e=>wD(e)||e.type===`htmlFlow`?[]:e.children);for(let e of a){let r=e.startLine;(0,V.isBlankLine)(n[r-2])||(0,V.addErrorContext)(t,r,n[r-1].trim(),void 0,void 0,void 0,{insertText:(0,H.getBlockQuotePrefixText)(i,r)});let a=(0,H.filterByPredicate)(e.children,e=>!H.nonContentTokens.has(e.type),e=>H.nonContentTokens.has(e.type)?[]:e.children),o=(a.length>0?a[a.length-1]:e).endLine;(0,V.isBlankLine)(n[o])||(0,V.addErrorContext)(t,o,n[o-1].trim(),void 0,void 0,void 0,{lineNumber:o+1,insertText:(0,H.getBlockQuotePrefixText)(i,o)})}}};const TD=e=>Array.isArray(e)?e.map(e=>String(e).toLowerCase()):[];var Zie={names:[`MD033`,`no-inline-html`],description:`Inline HTML`,tags:[`html`],parser:`micromark`,function:function(e,t){let n=TD(e.config.allowed_elements),r=TD(e.config.table_allowed_elements||e.config.allowed_elements);for(let e of mD([`htmlText`],!0)){let i=(0,H.getHtmlTagInfo)(e);if(i&&!i.close){let a=i?.name.toLowerCase(),o=!!(0,H.getParentOfType)(e,[`table`]);if((o||!n.includes(a))&&(!o||!r.includes(a))){let n=[e.startColumn,e.text.replace(V.nextLinesRe,``).length];(0,V.addError)(t,e.startLine,`Element: `+i.name,void 0,n)}}}}},Qie={names:[`MD034`,`no-bare-urls`],description:`Bare URL used`,tags:[`links`,`url`],parser:`micromark`,function:function(e,t){let n=e=>(0,H.filterByPredicate)(e,e=>{if(e.type===`literalAutolink`&&!(0,H.inHtmlFlow)(e)){let t=e.parent?.children,n=t?.indexOf(e),r=t?.at(n-1),i=t?.at(n+1);return!(r&&i&&r.type===`data`&&i.type===`data`&&r.text.endsWith(`<`)&&i.text.startsWith(`>`))}return!1},e=>{let{children:t}=e,n=[];for(let e=0;e<t.length;e++){let r=t[e],i=(0,H.getHtmlTagInfo)(r);if(i&&!i.close){let n=1;for(let r=e+1;r<t.length;r++){let a=t[r],o=(0,H.getHtmlTagInfo)(a);if(o&&i.name===o.name){if(o.close){if(n--,n===0){e=r;break}}else n++}}}else n.push(r)}return n});for(let r of n(e.parsers.micromark.tokens)){let e=[r.startColumn,r.endColumn-r.startColumn],n={editColumn:e[0],deleteCount:e[1],insertText:`<${r.text}>`};(0,V.addErrorContext)(t,r.startLine,r.text,void 0,void 0,e,n)}}},$ie={names:[`MD035`,`hr-style`],description:`Horizontal rule style`,tags:[`hr`],parser:`micromark`,function:function(e,t){let n=String(e.config.style||`consistent`).trim(),r=mD([`thematicBreak`]);for(let e of r){let{startLine:r,text:i}=e;n===`consistent`&&(n=i),(0,V.addErrorDetailIf)(t,r,n,i)}}};const eae=[[`emphasis`,`emphasisText`],[`strong`,`strongText`]],tae=e=>!(e.type===`htmlText`||e.type===`data`&&e.text.trim().length===0);var nae={names:[`MD036`,`no-emphasis-as-heading`],description:`Emphasis used instead of a heading`,tags:[`headings`,`emphasis`],parser:`micromark`,function:function(e,t){let n=e.config.punctuation;n=String(n===void 0?V.allPunctuation:n);let r=RegExp(`[`+n+`]$`),i=mD([`paragraph`],!0).filter(e=>e.parent?.type===`content`&&(!e.parent?.parent||e.parent?.parent?.type===`htmlFlow`&&!e.parent?.parent?.parent)&&e.children.filter(tae).length===1);for(let e of eae){let n=(0,H.getDescendantsByType)(i,e);for(let e of n)e.children.length===1&&e.children[0].type===`data`&&!r.test(e.text)&&(0,V.addErrorContext)(t,e.startLine,e.text)}}},rae={names:[`MD037`,`no-space-in-emphasis`],description:`Spaces inside emphasis markers`,tags:[`whitespace`,`emphasis`],parser:`micromark`,function:function(e,t){let{lines:n,parsers:r}=e,i=new Map;for(let e of[`_`,`__`,`___`,`*`,`**`,`***`])i.set(e,[]);let a=(0,H.filterByPredicate)(r.micromark.tokens,e=>e.children.some(e=>e.type===`data`));for(let e of a){for(let e of i.values())e.length=0;for(let t of e.children){let{text:e,type:n}=t;if(n===`data`&&e.length<=3){let n=i.get(e);n&&!(0,H.inHtmlFlow)(t)&&n.push(t)}}for(let[e,r]of i)for(let i=0;i+1<r.length;i+=2){let a=r[i],o=n[a.startLine-1].slice(a.endColumn-1).match(/^\s+\S/);if(o){let[n]=o,r=`${e}${n}`,i=a.endColumn,s=n.length-1;(0,V.addError)(t,a.startLine,void 0,r,[i,s],{editColumn:i,deleteCount:s})}let s=r[i+1],c=n[s.startLine-1].slice(0,s.startColumn-1).match(/\S\s+$/);if(c){let[n]=c,r=`${n}${e}`,i=s.startColumn-(n.length-1),a=n.length-1;(0,V.addError)(t,s.startLine,void 0,r,[i,a],{editColumn:i,deleteCount:a})}}}}},iae={names:[`MD038`,`no-space-in-code`],description:`Spaces inside code span elements`,tags:[`whitespace`,`code`],parser:`micromark`,function:function(e,t){let n=mD([`codeText`]);for(let e of n){let n=(0,H.getDescendantsByType)(e,[`codeTextData`]);if(n.length>0){let r=(0,H.getDescendantsByType)(e,[`codeTextPadding`]),i=r[0],a=n[0],o=/^(\s+)(\S)/.exec(a.text)||[null,``,``],s=o[2]==="`",c=o[1].length-(s&&!i?1:0),l=c>0,u=r[r.length-1],d=n[n.length-1],f=/(\S)(\s+)$/.exec(d.text)||[null,``,``],p=f[1]==="`",m=f[2].length-(p&&!u?1:0),h=m>0,g=l&&h&&i&&u&&!s&&!p,_=e.text;if(l){let e=(g?i:a).startColumn,n=c+(g?i.text.length:0);(0,V.addErrorContext)(t,a.startLine,_,!0,!1,[e,n],{editColumn:e,deleteCount:n})}if(h){let e=(g?u:d).endColumn,n=m+(g?u.text.length:0);(0,V.addErrorContext)(t,d.endLine,_,!1,!0,[e-n,n],{editColumn:e-n,deleteCount:n})}}}}};function ED(e,t,n,r){let i=n.text.match(r?/^[^\S\r\n]+/:/[^\S\r\n]+$/),a=i?[r?n.startColumn:n.endColumn-i[0].length,i[0].length]:void 0;(0,V.addErrorContext)(e,r?n.startLine+ +!i:n.endLine-+!i,t.text.replace(/\s+/g,` `),r,!r,a,a?{editColumn:a[0],deleteCount:a[1]}:void 0)}var aae={names:[`MD039`,`no-space-in-links`],description:`Spaces inside link text`,tags:[`whitespace`,`links`],parser:`micromark`,function:function(e,t){let n=mD([`label`]).filter(e=>e.parent?.type===`link`);for(let e of n){let n=e.children.filter(e=>e.type===`labelText`);for(let r of n)r.text.trimStart().length!==r.text.length&&ED(t,e,r,!0),r.text.trimEnd().length!==r.text.length&&ED(t,e,r,!1)}}},oae={names:[`MD040`,`fenced-code-language`],description:`Fenced code blocks should have a language specified`,tags:[`code`,`language`],parser:`micromark`,function:function(e,t){let n=e.config.allowed_languages;n=Array.isArray(n)?n:[];let r=!!e.config.language_only,i=mD([`codeFenced`]);for(let e of i){let i=(0,H.getDescendantsByType)(e,[`codeFencedFence`])[0],{startLine:a,text:o}=i,s=(0,H.getDescendantsByType)(i,[`codeFencedFenceInfo`])[0]?.text;s?n.length>0&&!n.includes(s)&&(0,V.addError)(t,a,`"${s}" is not allowed`):(0,V.addErrorContext)(t,a,o),r&&(0,H.getDescendantsByType)(i,[`codeFencedFenceMeta`]).length>0&&(0,V.addError)(t,a,`Info string contains more than language: "${o}"`)}}};const sae=/^h[1-6]$/;function cae(e){let{children:t,type:n}=e;if(n===`htmlFlow`){let e=(0,H.filterByTypes)(t,[`htmlText`],!0),n=e.length>0&&(0,H.getHtmlTagInfo)(e[0]);if(n)return n.name.toLowerCase()}return null}var lae={names:[`MD041`,`first-line-heading`,`first-line-h1`],description:`First line in a file should be a top-level heading`,tags:[`headings`],parser:`micromark`,function:function(e,t){let n=!!e.config.allow_preamble,r=Number(e.config.level||1),{tokens:i}=e.parsers.micromark;if(!(0,V.frontMatterHasTitle)(e.frontMatterLines,e.config.front_matter_title)){let a=0;for(let e of i){let{startLine:t,type:i}=e;if(!H.nonContentTokens.has(i)&&!(0,H.isHtmlFlowComment)(e)){let o=null;if(i===`atxHeading`||i===`setextHeading`){(0,H.getHeadingLevel)(e)!==r&&(a=t);break}if((o=cae(e))&&sae.test(o)){o!==`h${r}`&&(a=t);break}if(!n){a=t;break}}}a>0&&(0,V.addErrorContext)(t,a,e.lines[a-1])}}},uae={names:[`MD042`,`no-empty-links`],description:`No empty links`,tags:[`links`],parser:`micromark`,function:function(e,t){let{definitions:n}=hD(),r=e=>{let t=n.get(e.text.trim());return!!(t&&t[1]===`#`)},i=mD([`link`]);for(let e of i){let n=(0,H.getDescendantsByType)(e,[`label`,`labelText`]),i=(0,H.getDescendantsByType)(e,[`reference`]),a=(0,H.getDescendantsByType)(e,[`resource`]),o=(0,H.getDescendantsByType)(i,[`referenceString`]),s=(0,H.getDescendantsByType)(a,[`resourceDestination`,[`resourceDestinationLiteral`,`resourceDestinationRaw`],`resourceDestinationString`]),c=n.length>0,l=i.length>0,u=a.length>0,d=o.length>0,f=s.length>0,p=!1;c&&(!l&&!u||l&&!d)?p=r(n[0]):d&&!f?p=r(o[0]):!d&&f?p=s[0].text.trim()===`#`:!d&&!f&&(p=!0),p&&(0,V.addErrorContext)(t,e.startLine,e.text,void 0,void 0,[e.startColumn,e.endColumn-e.startColumn])}}},dae={names:[`MD043`,`required-headings`],description:`Required heading structure`,tags:[`headings`],parser:`micromark`,function:function(e,t){let n=e.config.headings;if(!Array.isArray(n))return;let r=e.config.match_case||!1,i=0,a=!1,o=!1,s=!1,c=()=>String(n[i++]||`[None]`),l=e=>r?e:e.toLowerCase();for(let e of mD([`atxHeading`,`setextHeading`]))if(!o){let n=(0,H.getHeadingText)(e),r=(0,H.getHeadingLevel)(e);s=!0;let u=`${``.padEnd(r,`#`)} ${n}`,d=c();d===`*`?l(c())!==l(u)&&(a=!0,i--):d===`+`?a=!0:d===`?`||(l(d)===l(u)?a=!1:a?i--:((0,V.addErrorDetailIf)(t,e.startLine,d,u),o=!0))}let u=n.length-i;!o&&(u>1||u===1&&n[i]!==`*`)&&(s||!n.every(e=>e===`*`))&&(0,V.addErrorContext)(t,e.lines.length,n[i])}};function DD(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m){let h,g;return _;function _(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),v}function v(t){return t===35?(h=o,y(t)):t===46?(h=s,y(t)):m&&Av(t)?CS(e,v,`whitespace`)(t):!m&&kv(t)?iC(e,v)(t):t===null||B(t)||Mv(t)||jv(t)&&t!==45&&t!==95?ie(t):(e.enter(a),e.enter(c),e.consume(t),S)}function y(t){let n=h+`Marker`;return e.enter(a),e.enter(h),e.enter(n),e.consume(t),e.exit(n),b}function b(t){if(t===null||t===34||t===35||t===39||t===46||t===60||t===61||t===62||t===96||t===125||kv(t))return n(t);let r=h+`Value`;return e.enter(r),e.consume(t),x}function x(t){if(t===null||t===34||t===39||t===60||t===61||t===62||t===96)return n(t);if(t===35||t===46||t===125||kv(t)){let n=h+`Value`;return e.exit(n),e.exit(h),e.exit(a),v(t)}return e.consume(t),x}function S(t){return t===null||B(t)||Mv(t)||jv(t)&&t!==45&&t!==46&&t!==58&&t!==95?(e.exit(c),m&&Av(t)?CS(e,C,`whitespace`)(t):!m&&kv(t)?iC(e,C)(t):C(t)):(e.consume(t),S)}function C(t){return t===61?(e.enter(l),e.consume(t),e.exit(l),w):(e.exit(a),v(t))}function w(t){return t===null||t===60||t===61||t===62||t===96||t===125||m&&B(t)?n(t):t===34||t===39?(e.enter(u),e.enter(f),e.consume(t),e.exit(f),g=t,ee):m&&Av(t)?CS(e,w,`whitespace`)(t):!m&&kv(t)?iC(e,w)(t):(e.enter(d),e.enter(p),e.consume(t),g=void 0,T)}function T(t){return t===null||t===34||t===39||t===60||t===61||t===62||t===96?n(t):t===125||kv(t)?(e.exit(p),e.exit(d),e.exit(a),v(t)):(e.consume(t),T)}function ee(t){return t===g?(e.enter(f),e.consume(t),e.exit(f),e.exit(u),e.exit(a),re):(e.enter(d),te(t))}function te(t){return t===g?(e.exit(d),ee(t)):t===null?n(t):B(t)?m?n(t):iC(e,te)(t):(e.enter(p),e.consume(t),ne)}function ne(t){return t===g||t===null||B(t)?(e.exit(p),te(t)):(e.consume(t),ne)}function re(e){return e===125||kv(e)?v(e):ie(e)}function ie(a){return a===125?(e.enter(i),e.consume(a),e.exit(i),e.exit(r),t):n(a)}}function OD(e,t,n,r,i,a,o){let s=0,c=0,l;return u;function u(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),d}function d(n){return n===93?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),f(n))}function f(t){if(t===93&&!c)return h(t);let n=e.enter(`chunkText`,{_contentTypeTextTrailing:!0,contentType:`text`,previous:l});return l&&(l.next=n),l=n,p(t)}function p(t){return t===null||s>999||t===91&&++c>32?n(t):t===93&&!c--?(e.exit(`chunkText`),h(t)):B(t)?o?n(t):(e.consume(t),e.exit(`chunkText`),f):(e.consume(t),t===92?m:p)}function m(t){return t===91||t===92||t===93?(e.consume(t),s++,p):p(t)}function h(n){return e.exit(a),e.enter(i),e.consume(n),e.exit(i),e.exit(r),t}}function kD(e,t,n,r){let i=this;return a;function a(t){return t===null||B(t)||jv(t)||Mv(t)?n(t):(e.enter(r),e.consume(t),o)}function o(a){return a===null||B(a)||Mv(a)||jv(a)&&a!==45&&a!==95?(e.exit(r),i.previous===45||i.previous===95?n(a):t(a)):(e.consume(a),o)}}const fae={tokenize:hae,concrete:!0},pae={tokenize:gae,partial:!0},mae={tokenize:_ae,partial:!0},AD={tokenize:vae,partial:!0};function hae(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0,s;return c;function c(t){return e.enter(`directiveContainer`),e.enter(`directiveContainerFence`),e.enter(`directiveContainerSequence`),l(t)}function l(t){return t===58?(e.consume(t),o++,l):o<3?n(t):(e.exit(`directiveContainerSequence`),kD.call(r,e,u,n,`directiveContainerName`)(t))}function u(t){return t===91?e.attempt(pae,d,d)(t):d(t)}function d(t){return t===123?e.attempt(mae,f,f)(t):f(t)}function f(t){return CS(e,p,`whitespace`)(t)}function p(i){return e.exit(`directiveContainerFence`),i===null?C(i):B(i)?r.interrupt?t(i):e.attempt(AD,m,C)(i):n(i)}function m(t){return t===null?C(t):B(t)?e.check(AD,y,C)(t):(e.enter(`directiveContainerContent`),h(t))}function h(t){return e.attempt({tokenize:w,partial:!0},S,a?CS(e,g,`linePrefix`,a+1):g)(t)}function g(t){return t===null?S(t):B(t)?e.check(AD,v,S)(t):v(t)}function _(t){if(t===null){let n=e.exit(`chunkDocument`);return r.parser.lazy[n.start.line]=!1,S(t)}return B(t)?e.check(AD,b,x)(t):(e.consume(t),_)}function v(t){let n=e.enter(`chunkDocument`,{contentType:`document`,previous:s});return s&&(s.next=n),s=n,_(t)}function y(t){return e.enter(`directiveContainerContent`),h(t)}function b(t){e.consume(t);let n=e.exit(`chunkDocument`);return r.parser.lazy[n.start.line]=!1,h}function x(t){let n=e.exit(`chunkDocument`);return r.parser.lazy[n.start.line]=!1,S(t)}function S(t){return e.exit(`directiveContainerContent`),C(t)}function C(n){return e.exit(`directiveContainer`),t(n)}function w(e,t,n){let i=0;return CS(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4);function a(t){return e.enter(`directiveContainerFence`),e.enter(`directiveContainerSequence`),s(t)}function s(t){return t===58?(e.consume(t),i++,s):i<o?n(t):(e.exit(`directiveContainerSequence`),CS(e,c,`whitespace`)(t))}function c(r){return r===null||B(r)?(e.exit(`directiveContainerFence`),t(r)):n(r)}}}function gae(e,t,n){return OD(e,t,n,`directiveContainerLabel`,`directiveContainerLabelMarker`,`directiveContainerLabelString`,!0)}function _ae(e,t,n){return DD(e,t,n,`directiveContainerAttributes`,`directiveContainerAttributesMarker`,`directiveContainerAttribute`,`directiveContainerAttributeId`,`directiveContainerAttributeClass`,`directiveContainerAttributeName`,`directiveContainerAttributeInitializerMarker`,`directiveContainerAttributeValueLiteral`,`directiveContainerAttributeValue`,`directiveContainerAttributeValueMarker`,`directiveContainerAttributeValueData`,!0)}function vae(e,t,n){let r=this;return i;function i(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}const yae={tokenize:Sae},bae={tokenize:Cae,partial:!0},xae={tokenize:wae,partial:!0};function Sae(e,t,n){let r=this;return i;function i(t){return e.enter(`directiveLeaf`),e.enter(`directiveLeafSequence`),e.consume(t),a}function a(t){return t===58?(e.consume(t),e.exit(`directiveLeafSequence`),kD.call(r,e,o,n,`directiveLeafName`)):n(t)}function o(t){return t===91?e.attempt(bae,s,s)(t):s(t)}function s(t){return t===123?e.attempt(xae,c,c)(t):c(t)}function c(t){return CS(e,l,`whitespace`)(t)}function l(r){return r===null||B(r)?(e.exit(`directiveLeaf`),t(r)):n(r)}}function Cae(e,t,n){return OD(e,t,n,`directiveLeafLabel`,`directiveLeafLabelMarker`,`directiveLeafLabelString`,!0)}function wae(e,t,n){return DD(e,t,n,`directiveLeafAttributes`,`directiveLeafAttributesMarker`,`directiveLeafAttribute`,`directiveLeafAttributeId`,`directiveLeafAttributeClass`,`directiveLeafAttributeName`,`directiveLeafAttributeInitializerMarker`,`directiveLeafAttributeValueLiteral`,`directiveLeafAttributeValue`,`directiveLeafAttributeValueMarker`,`directiveLeafAttributeValueData`,!0)}const Tae={tokenize:kae,previous:Oae},Eae={tokenize:Aae,partial:!0},Dae={tokenize:jae,partial:!0};function Oae(e){return e!==58||this.events[this.events.length-1][1].type===`characterEscape`}function kae(e,t,n){let r=this;return i;function i(t){return e.enter(`directiveText`),e.enter(`directiveTextMarker`),e.consume(t),e.exit(`directiveTextMarker`),kD.call(r,e,a,n,`directiveTextName`)}function a(t){return t===58?n(t):t===91?e.attempt(Eae,o,o)(t):o(t)}function o(t){return t===123?e.attempt(Dae,s,s)(t):s(t)}function s(n){return e.exit(`directiveText`),t(n)}}function Aae(e,t,n){return OD(e,t,n,`directiveTextLabel`,`directiveTextLabelMarker`,`directiveTextLabelString`)}function jae(e,t,n){return DD(e,t,n,`directiveTextAttributes`,`directiveTextAttributesMarker`,`directiveTextAttribute`,`directiveTextAttributeId`,`directiveTextAttributeClass`,`directiveTextAttributeName`,`directiveTextAttributeInitializerMarker`,`directiveTextAttributeValueLiteral`,`directiveTextAttributeValue`,`directiveTextAttributeValueMarker`,`directiveTextAttributeValueData`)}function Mae(){return{text:{58:Tae},flow:{58:[fae,yae]}}}const Nae=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),jD={0:`�`,128:`€`,130:`‚`,131:`ƒ`,132:`„`,133:`…`,134:`†`,135:`‡`,136:`ˆ`,137:`‰`,138:`Š`,139:`‹`,140:`Œ`,142:`Ž`,145:`‘`,146:`’`,147:`“`,148:`”`,149:`•`,150:`–`,151:`—`,152:`˜`,153:`™`,154:`š`,155:`›`,156:`œ`,158:`ž`,159:`Ÿ`};function MD(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=48&&t<=57}function Pae(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function Fae(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}function ND(e){return Fae(e)||MD(e)}const Iae=[``,`Named character references must be terminated by a semicolon`,`Numeric character references must be terminated by a semicolon`,`Named character references cannot be empty`,`Numeric character references cannot be empty`,`Named character references must be known`,`Numeric character references cannot be disallowed`,`Numeric character references cannot be outside the permissible Unicode range`];function Lae(e,t){let n=t||{},r=typeof n.additional==`string`?n.additional.charCodeAt(0):n.additional,i=[],a=0,o=-1,s=``,c,l;n.position&&(`start`in n.position||`indent`in n.position?(l=n.position.indent,c=n.position.start):c=n.position);let u=(c?c.line:0)||1,d=(c?c.column:0)||1,f=m(),p;for(a--;++a<=e.length;)if(p===10&&(d=(l?l[o]:0)||1),p=e.charCodeAt(a),p===38){let t=e.charCodeAt(a+1);if(t===9||t===10||t===12||t===32||t===38||t===60||Number.isNaN(t)||r&&t===r){s+=String.fromCharCode(p),d++;continue}let o=a+1,c=o,l=o,u;if(t===35){l=++c;let t=e.charCodeAt(l);t===88||t===120?(u=`hexadecimal`,l=++c):u=`decimal`}else u=`named`;let _=``,v=``,y=``,b=u===`named`?ND:u===`decimal`?MD:Pae;for(l--;++l<=e.length;){let t=e.charCodeAt(l);if(!b(t))break;y+=String.fromCharCode(t),u===`named`&&Nae.includes(y)&&(_=y,v=ex(y))}let x=e.charCodeAt(l)===59;if(x){l++;let e=u===`named`&&ex(y);e&&(_=y,v=e)}let S=1+l-o,C=``;if(!(!x&&n.nonTerminated===!1)){if(!y)u!==`named`&&h(4,S);else if(u===`named`){if(x&&!v)h(5,1);else if(_!==y&&(l=c+_.length,S=1+l-c,x=!1),!x){let t=_?1:3;if(n.attribute){let n=e.charCodeAt(l);n===61?(h(t,S),v=``):ND(n)?v=``:h(t,S)}else h(t,S)}C=v}else{x||h(2,S);let e=Number.parseInt(y,u===`hexadecimal`?16:10);if(Rae(e))h(7,S),C=`�`;else if(e in jD)h(6,S),C=jD[e];else{let t=``;zae(e)&&h(6,S),e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10|55296),e=56320|e&1023),C=t+String.fromCharCode(e)}}}if(C){g(),f=m(),a=l-1,d+=l-o+1,i.push(C);let t=m();t.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,C,{start:f,end:t},e.slice(o-1,l)),f=t}else y=e.slice(o-1,l),s+=y,d+=y.length,a=l-1}else p===10&&(u++,o++,d=0),Number.isNaN(p)?g():(s+=String.fromCharCode(p),d++);return i.join(``);function m(){return{line:u,column:d,offset:a+((c?c.offset:0)||0)}}function h(e,t){let r;n.warning&&(r=m(),r.column+=t,r.offset+=t,n.warning.call(n.warningContext||void 0,Iae[e],r,e))}function g(){s&&=(i.push(s),n.text&&n.text.call(n.textContext||void 0,s,{start:f,end:m()}),``)}}function Rae(e){return e>=55296&&e<=57343||e>1114111}function zae(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)==65535||(e&65535)==65534}const Bae={tokenize:Vae,concrete:!0,name:`mathFlow`},PD={tokenize:Hae,partial:!0};function Vae(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){return e.enter(`mathFlow`),e.enter(`mathFlowFence`),e.enter(`mathFlowFenceSequence`),c(t)}function c(t){return t===36?(e.consume(t),o++,c):o<2?n(t):(e.exit(`mathFlowFenceSequence`),CS(e,l,`whitespace`)(t))}function l(t){return t===null||B(t)?d(t):(e.enter(`mathFlowFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===null||B(t)?(e.exit(`chunkString`),e.exit(`mathFlowFenceMeta`),d(t)):t===36?n(t):(e.consume(t),u)}function d(n){return e.exit(`mathFlowFence`),r.interrupt?t(n):e.attempt(PD,f,g)(n)}function f(t){return e.attempt({tokenize:_,partial:!0},g,p)(t)}function p(t){return(a?CS(e,m,`linePrefix`,a+1):m)(t)}function m(t){return t===null?g(t):B(t)?e.attempt(PD,f,g)(t):(e.enter(`mathFlowValue`),h(t))}function h(t){return t===null||B(t)?(e.exit(`mathFlowValue`),m(t)):(e.consume(t),h)}function g(n){return e.exit(`mathFlow`),t(n)}function _(e,t,n){let i=0;return CS(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4);function a(t){return e.enter(`mathFlowFence`),e.enter(`mathFlowFenceSequence`),s(t)}function s(t){return t===36?(i++,e.consume(t),s):i<o?n(t):(e.exit(`mathFlowFenceSequence`),CS(e,c,`whitespace`)(t))}function c(r){return r===null||B(r)?(e.exit(`mathFlowFence`),t(r)):n(r)}}}function Hae(e,t,n){let r=this;return i;function i(n){return n===null?t(n):(e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function Uae(e){let t=(e||{}).singleDollarTextMath;return t??=!0,{tokenize:n,resolve:Wae,previous:Gae,name:`mathText`};function n(e,n,r){let i=0,a,o;return s;function s(t){return e.enter(`mathText`),e.enter(`mathTextSequence`),c(t)}function c(n){return n===36?(e.consume(n),i++,c):i<2&&!t?r(n):(e.exit(`mathTextSequence`),l(n))}function l(t){return t===null?r(t):t===36?(o=e.enter(`mathTextSequence`),a=0,d(t)):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),l):B(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),l):(e.enter(`mathTextData`),u(t))}function u(t){return t===null||t===32||t===36||B(t)?(e.exit(`mathTextData`),l(t)):(e.consume(t),u)}function d(t){return t===36?(e.consume(t),a++,d):a===i?(e.exit(`mathTextSequence`),e.exit(`mathText`),n(t)):(o.type=`mathTextData`,u(t))}}}function Wae(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`mathTextData`){e[t][1].type=`mathTextPadding`,e[n][1].type=`mathTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`mathTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Gae(e){return e!==36||this.events[this.events.length-1][1].type===`characterEscape`}function FD(e){return{flow:{36:Bae},text:{36:Uae(e)}}}var ID=_();function Kae(){let e={...Mae()};return delete e.text,e}function LD(e,t){return e.slice(t.start.offset,t.end.offset)}function qae(e,t={}){let n=[Kae(),eS(),tw(),pw(),FD(),...t.extensions||[]],r=[],i=TC.tokenize;function a(t,n,a){let o=this,s=o.events;return i.call(o,t,n,t=>{let n=s.length;for(;--n>=0;){let[e,t]=s[n];if(e===`enter`){let{type:e}=t;if(e===`labelImage`||e===`labelLink`)break}}if(n>=0){let[,t]=s[n],[,i]=s[s.length-1],a={type:`undefinedReferenceShortcut`,start:t.start,end:i.end},c={type:`undefinedReference`,start:t.start,end:i.end},l=s.slice(n).filter(e=>{let[,t]=e,{type:n}=t;return n===`data`||n===`lineEnding`}),u=r.length>0&&r[r.length-1][0],d=u&&u[1];d&&d.end.line===a.start.line&&d.end.column===a.start.column&&(l.length===0?(d.type=`undefinedReferenceCollapsed`,d.end=i.end):(a.type=`undefinedReferenceFull`,a.start=d.start,r.pop()));let f=l.filter(e=>e[0]===`enter`).map(t=>LD(e,t[1])).join(``).trim();if(f.length>0&&!f.includes(`]`)){let e=[[`enter`,a,o],[`enter`,c,o]];for(let t of l){let[n,r]=t;e.push([n,{...r},o])}e.push([`exit`,c,o],[`exit`,a,o]),r.push(e)}}return a(t)})}try{TC.tokenize=a;let i=JT({...t,extensions:n}),o=ZT()(e,void 0,!0);return YT(i.document().write(o)).concat(...r)}finally{TC.tokenize=i}}function RD(e,t={},n={},r=0,i=void 0){let a=!!t.freezeTokens,o=qae(e,n),s=[],c=[],l={type:`data`,startLine:-1,startColumn:-1,endLine:-1,endColumn:-1,text:`ROOT`,children:s,parent:null},u=[l],d=l,f=null,p=null,m=!1;for(let s of o){let[o,h]=s,{type:g,start:_,end:v}=h,{column:y,line:b}=_,{column:x,line:S}=v,C=LD(e,h);if(o===`enter`&&!m){let a=d;if(u.push(a),d={type:g,startLine:b+r,startColumn:y,endLine:S+r,endColumn:x,text:C,children:[],parent:a===l?i||null:a},i&&Object.defineProperty(d,ID.htmlFlowSymbol,{value:!0}),a.children.push(d),c.push(d),d.type===`htmlFlow`&&!(0,H.isHtmlFlowComment)(d)){m=!0,(!f||!p)&&(f={...n,extensions:[{disable:{null:[`codeIndented`,`htmlFlow`]}}]},p=e.split(ID.newlineRe));let r=RD(p.slice(d.startLine-1,d.endLine).join(`
|
|
206
|
+
`),t,f,d.startLine-1,d);d.children=r,c=c.concat(r[ID.flatTokensSymbol])}}else o===`exit`&&(g===`htmlFlow`&&(m=!1),m||(a&&(Object.freeze(d.children),Object.freeze(d)),d=u.pop()))}return Object.defineProperty(s,ID.flatTokensSymbol,{value:c}),a&&Object.freeze(s),s}function zD(e,t){return RD(e,t)}const Jae=new Set([`codeFencedFence`,`definition`,`reference`,`resource`]);var Yae={names:[`MD044`,`proper-names`],description:`Proper names should have the correct capitalization`,tags:[`spelling`],parser:`micromark`,function:function(e,t){let n=e.config.names;if(n=Array.isArray(n)?n:[],n.sort((e,t)=>t.length-e.length||e.localeCompare(t)),n.length===0)return;let r=e.config.code_blocks,i=r===void 0||!!r,a=e.config.html_elements,o=a===void 0||!!a,s=new Set([`data`]);i&&(s.add(`codeFlowValue`),s.add(`codeTextData`)),o&&(s.add(`htmlFlowData`),s.add(`htmlTextData`));let c=(0,H.filterByPredicate)(e.parsers.micromark.tokens,e=>s.has(e.type),e=>e.children.filter(e=>!Jae.has(e.type))),l=[],u=new Set;for(let e of n){let r=(0,V.escapeForRegExp)(e),i=`(${/^\W/.test(e)?``:`\\b_*`})(${r})${/\W$/.test(e)?``:`_*\\b`}`,a=new RegExp(i,`gi`);for(let r of c){let i=null;for(;(i=a.exec(r.text))!==null;){let[,a,o]=i,s=r.startColumn+i.index+a.length,c=o.length,d=r.startLine,f={startLine:d,startColumn:s,endLine:d,endColumn:s+c-1};if(!n.includes(o)&&!l.some(e=>(0,V.hasOverlap)(e,f))){let n=[];u.has(r)||(n=(0,H.filterByTypes)(zD(r.text),[`literalAutolink`]).map(e=>({startLine:d,startColumn:r.startColumn+e.startColumn-1,endLine:d,endColumn:r.endColumn+e.endColumn-1})),l.push(...n),u.add(r)),n.some(e=>(0,V.hasOverlap)(e,f))||(0,V.addErrorDetailIf)(t,r.startLine,e,o,void 0,void 0,[s,c],{editColumn:s,deleteCount:c,insertText:e})}l.push(f)}}}}};const Xae=(0,V.getHtmlAttributeRe)(`alt`),Zae=(0,V.getHtmlAttributeRe)(`aria-hidden`);var Qae={names:[`MD045`,`no-alt-text`],description:`Images should have alternate text (alt text)`,tags:[`accessibility`,`images`],parser:`micromark`,function:function(e,t){let n=mD([`image`]);for(let e of n)if((0,H.getDescendantsByType)(e,[`label`,`labelText`]).some(e=>e.text.length===0)){let n=e.startLine===e.endLine?[e.startColumn,e.endColumn-e.startColumn]:void 0;(0,V.addError)(t,e.startLine,void 0,void 0,n)}let r=mD([`htmlText`],!0);for(let e of r){let{startColumn:n,startLine:r,text:i}=e,a=(0,H.getHtmlTagInfo)(e);if(a&&!a.close&&a.name.toLowerCase()===`img`&&!Xae.test(i)&&Zae.exec(i)?.[1].toLowerCase()!==`true`){let e=[n,i.replace(V.nextLinesRe,``).length];(0,V.addError)(t,r,void 0,void 0,e)}}}};const BD=e=>e===`codeFenced`?`fenced`:`indented`;var $ae={names:[`MD046`,`code-block-style`],description:`Code block style`,tags:[`code`],parser:`micromark`,function:function(e,t){let n=String(e.config.style||`consistent`);for(let e of mD([`codeFenced`,`codeIndented`])){let{startLine:r,type:i}=e;n===`consistent`&&(n=BD(i)),(0,V.addErrorDetailIf)(t,r,n,BD(i))}}},eoe={names:[`MD047`,`single-trailing-newline`],description:`Files should end with a single newline character`,tags:[`blank_lines`],parser:`none`,function:function(e,t){let n=e.lines.length,r=e.lines[n-1];(0,V.isBlankLine)(r)||(0,V.addError)(t,n,void 0,void 0,[r.length,1],{insertText:`
|
|
207
|
+
`,editColumn:r.length+1})}};function VD(e){switch(e[0]){case`~`:return`tilde`;default:return`backtick`}}var toe={names:[`MD048`,`code-fence-style`],description:`Code fence style`,tags:[`code`],parser:`micromark`,function:function(e,t){let n=String(e.config.style||`consistent`),r=mD([`codeFenced`]);for(let e of r){let{startLine:r,text:i}=(0,H.getDescendantsByType)(e,[`codeFencedFence`,`codeFencedFenceSequence`])[0];n===`consistent`&&(n=VD(i)),(0,V.addErrorDetailIf)(t,r,n,VD(i))}}};const HD=/^\w$/;function noe(e){switch(e[0]){case`*`:return`asterisk`;default:return`underscore`}}const UD=(e,t,n,r,i,a,o=`consistent`)=>{let{lines:s,parsers:c}=e,l=(0,H.filterByPredicate)(c.micromark.tokens,e=>e.type===n,e=>e.type===`htmlFlow`?[]:e.children);for(let e of l){let n=(0,H.getDescendantsByType)(e,[r]),c=n[0],l=n[n.length-1];if(c&&l){let e=noe(c.text);if(o===`consistent`&&(o=e),o!==e&&!(o===`underscore`&&(HD.test(s[c.startLine-1][c.startColumn-2])||HD.test(s[l.endLine-1][l.endColumn-1]))))for(let n of[c,l])(0,V.addError)(t,n.startLine,`Expected: ${o}; Actual: ${e}`,void 0,[n.startColumn,n.text.length],{editColumn:n.startColumn,deleteCount:n.text.length,insertText:o===`asterisk`?i:a})}}};var roe=[{names:[`MD049`,`emphasis-style`],description:`Emphasis style`,tags:[`emphasis`],parser:`micromark`,function:function(e,t){return UD(e,t,`emphasis`,`emphasisSequence`,`*`,`_`,e.config.style||void 0)}},{names:[`MD050`,`strong-style`],description:`Strong style`,tags:[`emphasis`],parser:`micromark`,function:function(e,t){return UD(e,t,`strong`,`strongSequence`,`**`,`__`,e.config.style||void 0)}}];const ioe=(0,V.getHtmlAttributeRe)(`id`),aoe=(0,V.getHtmlAttributeRe)(`name`),ooe=/\{(#[a-z\d]+(?:[-_][a-z\d]+)*)\}/gu,soe=/^#(?:L\d+(?:C\d+)?-L\d+(?:C\d+)?|L\d+)$/,coe=new Set([`image`,`reference`,`resource`]),loe=new Set([`characterEscapeValue`,`codeTextData`,`data`,`mathTextData`]);function uoe(e){let t=(0,H.filterByPredicate)(e.children,e=>loe.has(e.type),e=>coe.has(e.type)?[]:e.children).map(e=>e.text).join(``);return`#`+encodeURIComponent(t.toLowerCase().replace(/[^\p{Letter}\p{Mark}\p{Number}\p{Connector_Punctuation}\- ]/gu,``).replace(/ /gu,`-`).toWellFormed())}function doe(e){return(0,H.filterByTypes)(e.children,[`characterEscapeValue`,`data`]).map(e=>e.text).join(``)}var foe={names:[`MD051`,`link-fragments`],description:`Link fragments should be valid`,tags:[`links`],parser:`micromark`,function:function(e,t){let n=e.config.ignore_case||!1,r=e.config.ignored_pattern||``,i=new RegExp(r||`^$`),a=new Map([[`#top`,0]]),o=mD([`atxHeadingText`,`setextHeadingText`]);for(let e of o){let t=uoe(e);if(t!==`#`){let n=a.get(t)||0;n&&a.set(`${t}-${n}`,0),a.set(t,n+1);let r=null;for(;(r=ooe.exec(e.text))!==null;){let[,e]=r;a.has(e)||a.set(e,1)}}}for(let e of mD([`htmlText`],!0)){let t=(0,H.getHtmlTagInfo)(e);if(t&&!t.close){let n=ioe.exec(e.text)||t.name.toLowerCase()===`a`&&aoe.exec(e.text);n&&n.length>0&&a.set(`#${n[1]}`,0)}}for(let[e,r]of[[`link`,`resourceDestinationString`],[`definition`,`definitionDestinationString`]]){let o=mD([e]).filter(e=>!(e.parent?.type===`atxHeadingText`&&(0,H.isDocfxTab)(e.parent.parent)));for(let e of o){let o=(0,H.filterByTypes)(e.children,[r]);for(let r of o){let{endColumn:o,startColumn:s}=r,c=doe(r),l=c.slice(1),u=`#${encodeURIComponent(l.toWellFormed())}`;if(c.length>1&&c.startsWith(`#`)&&!a.has(u)&&!soe.test(u)&&!i.test(l)){let r,i,l;e.startLine===e.endLine&&(r=e.text,i=[e.startColumn,e.endColumn-e.startColumn],l={editColumn:s,deleteCount:o-s});let u=c.toLowerCase(),d=[...a.keys()].find(e=>u===e.toLowerCase());d?((l||{}).insertText=d,!n&&d!==c&&(0,V.addError)(t,e.startLine,`Expected: ${d}; Actual: ${c}`,r,i,l)):(0,V.addError)(t,e.startLine,void 0,r,i)}}}}}},poe={names:[`MD052`,`reference-links-images`],description:`Reference links and images should use a label that is defined`,tags:[`images`,`links`],parser:`none`,function:function(e,t){let{config:n,lines:r}=e,i=n.shortcut_syntax||!1,a=new Set(n.ignored_labels||[`x`]),{definitions:o,references:s,shortcuts:c}=hD(),l=i?[...s.entries(),...c.entries()]:s.entries();for(let e of l){let[n,i]=e;if(!o.has(n)&&!a.has(n))for(let e of i){let[i,a,o]=e,s=r[i].slice(a,a+o);(0,V.addError)(t,i+1,`Missing link or image reference definition: "${n}"`,s,[a+1,s.length])}}}};const moe=/^ {0,3}\[([^\]]*[^\\])\]:/;var hoe={names:[`MD053`,`link-image-reference-definitions`],description:`Link and image reference definitions should be needed`,tags:[`images`,`links`],parser:`none`,function:function(e,t){let n=new Set(e.config.ignored_definitions||[`//`]),r=e.lines,{references:i,shortcuts:a,definitions:o,duplicateDefinitions:s}=hD(),c=e=>e.replace(moe,``).trim().length>0,l={deleteCount:-1};for(let e of o.entries()){let[o,[s]]=e;if(!n.has(o)&&!i.has(o)&&!a.has(o)){let e=r[s];(0,V.addError)(t,s+1,`Unused link or image reference definition: "${o}"`,(0,V.ellipsify)(e),[1,e.length],c(e)?l:void 0)}}for(let e of s){let[i,a]=e;if(!n.has(i)){let e=r[a];(0,V.addError)(t,a+1,`Duplicate link or image reference definition: "${i}"`,(0,V.ellipsify)(e),[1,e.length],c(e)?l:void 0)}}}};const goe=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,_oe=e=>e.replace(goe,`$1`),voe=/[ <>]/,WD=e=>{try{new URL(e)}catch{return!1}return!voe.test(e)};var yoe={names:[`MD054`,`link-image-style`],description:`Link and image style`,tags:[`images`,`links`],parser:`micromark`,function:(e,t)=>{let n=e.config,r=n.autolink===void 0||!!n.autolink,i=n.inline===void 0||!!n.inline,a=n.full===void 0||!!n.full,o=n.collapsed===void 0||!!n.collapsed,s=n.shortcut===void 0||!!n.shortcut,c=n.url_inline===void 0||!!n.url_inline;if(r&&i&&a&&o&&s&&c)return;let{definitions:l}=hD(),u=mD([`autolink`,`image`,`link`]);for(let e of u){let n=null,u=null,{endColumn:d,endLine:f,startColumn:p,startLine:m,text:h,type:g}=e,_=g===`image`,v=!1;if(g===`autolink`)u=(0,H.getDescendantsByType)(e,[[`autolinkEmail`,`autolinkProtocol`]])[0]?.text,n=u,v=!r&&!!u;else if(n=(0,H.getDescendantsByType)(e,[`label`,`labelText`])[0].text,u=(0,H.getDescendantsByType)(e,[`resource`,`resourceDestination`,[`resourceDestinationLiteral`,`resourceDestinationRaw`],`resourceDestinationString`])[0]?.text,u){let t=(0,H.getDescendantsByType)(e,[`resource`,`resourceTitle`,`resourceTitleString`])[0]?.text;v=!i||!c&&r&&!_&&!t&&n===u&&WD(u)}else{let t=(0,H.getDescendantsByType)(e,[`reference`]).length===0,r=(0,H.getDescendantsByType)(e,[`reference`,`referenceString`])[0]?.text,i=r===void 0,c=l.get(r||n);u=c&&c[1]||``,v=!!(u&&(t?!s:i?!o:!a))}if(v){let e,a;if(m===f){e=[p,d-p];let t=null,o=i&&n,s=r&&!_&&WD(u);o&&(c||!s)?t=`${_?`!`:``}[${n.replace(/[[\]]/g,`\\$&`)}](${u.replace(/[()]/g,`\\$&`)})`:s&&(t=`<${_oe(u)}>`),t&&(a={editColumn:e[0],insertText:t,deleteCount:e[1]})}(0,V.addErrorContext)(t,m,h.replace(V.nextLinesRe,``),void 0,void 0,e,a)}}}};const boe=new Set([`linePrefix`,`whitespace`]),GD=e=>e.filter(e=>!boe.has(e.type)),KD=e=>e[0],qD=e=>e[e.length-1],JD=(e,t)=>[e,t-e+1];var xoe={names:[`MD055`,`table-pipe-style`],description:`Table pipe style`,tags:[`table`],parser:`micromark`,function:function(e,t){let n=String(e.config.style||`consistent`),r=n!==`no_leading_or_trailing`&&n!==`trailing_only`,i=n!==`no_leading_or_trailing`&&n!==`leading_only`,a=mD([`tableDelimiterRow`,`tableRow`]);for(let e of a){let a=KD(e.children),o=KD(GD(a.children)).type===`tableCellDivider`,s=qD(e.children),c=qD(GD(s.children)).type===`tableCellDivider`,l=o?c?`leading_and_trailing`:`leading_only`:c?`trailing_only`:`no_leading_or_trailing`;n===`consistent`&&(n=l,r=o,i=c),o!==r&&(0,V.addErrorDetailIf)(t,a.startLine,n,l,`${r?`Missing`:`Unexpected`} leading pipe`,void 0,JD(e.startColumn,a.startColumn)),c!==i&&(0,V.addErrorDetailIf)(t,s.endLine,n,l,`${i?`Missing`:`Unexpected`} trailing pipe`,void 0,JD(s.endColumn-1,e.endColumn-1))}}};const Soe=(e,t)=>[e,t-e+1];var Coe={names:[`MD056`,`table-column-count`],description:`Table column count`,tags:[`table`],parser:`micromark`,function:function(e,t){let n=mD([`tableDelimiterRow`,`tableRow`]),r=0,i=null;for(let e of n){let n=(0,H.getParentOfType)(e,[`table`]);i!==n&&(r=0,i=n);let a=e.children.filter(e=>[`tableData`,`tableDelimiter`,`tableHeader`].includes(e.type)),o=a.length;r||=o;let s,c;o<r?(s=`Too few cells, row will be missing data`,c=[e.endColumn-1,1]):r<o&&(s=`Too many cells, extra data will be missing`,c=Soe(a[r].startColumn,e.endColumn-1)),(0,V.addErrorDetailIf)(t,e.endLine,r,o,s,void 0,c)}}},woe={names:[`MD058`,`blanks-around-tables`],description:`Tables should be surrounded by blank lines`,tags:[`table`],parser:`micromark`,function:function(e,t){let{lines:n}=e,r=mD([`blockQuotePrefix`,`linePrefix`]),i=mD([`table`]);for(let e of i){let i=e.startLine;(0,V.isBlankLine)(n[i-2])||(0,V.addErrorContext)(t,i,n[i-1].trim(),void 0,void 0,void 0,{insertText:(0,H.getBlockQuotePrefixText)(r,i)});let a=e.endLine;(0,V.isBlankLine)(n[a])||(0,V.addErrorContext)(t,a,n[a-1].trim(),void 0,void 0,void 0,{lineNumber:a+1,insertText:(0,H.getBlockQuotePrefixText)(r,a)})}}};const Toe=new Set([`codeText`,`htmlText`]),Eoe=[`click here`,`here`,`link`,`more`];function YD(e){return e.replace(/[\W_]+/g,` `).replace(/\s+/g,` `).toLowerCase().trim()}var Doe={names:[`MD059`,`descriptive-link-text`],description:`Link text should be descriptive`,tags:[`accessibility`,`links`],parser:`micromark`,function:function(e,t){let n=new Set((e.config.prohibited_texts||Eoe).map(YD));if(n.size>0){let e=mD([`link`]);for(let r of e){let e=(0,H.getDescendantsByType)(r,[`label`,`labelText`]);for(let r of e){let{children:e,endColumn:i,endLine:a,parent:o,startColumn:s,startLine:c,text:l}=r;if(!e.some(e=>Toe.has(e.type))&&n.has(YD(l))){let e=c===a?[s,i-s]:void 0;(0,V.addErrorContext)(t,c,o.text,void 0,void 0,e)}}}}}};function Ooe({onlyFirst:e=!1}={}){return RegExp(`(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]`,e?void 0:`g`)}const koe=Ooe();function Aoe(e){if(typeof e!=`string`)throw TypeError(`Expected a \`string\`, got \`${typeof e}\``);return!e.includes(`\x1B`)&&!e.includes(``)?e:e.replace(koe,``)}const joe=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],Moe=[12288,12288,65281,65376,65504,65510],XD=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141],ZD=(e,t)=>{let n=0,r=Math.floor(e.length/2)-1;for(;n<=r;){let i=Math.floor((n+r)/2),a=i*2;if(t<e[a])r=i-1;else if(t>e[a+1])n=i+1;else return!0}return!1},QD=19968,[Noe,Poe]=Foe(XD);function Foe(e){let t=e[0],n=e[1];for(let r=0;r<e.length;r+=2){let i=e[r],a=e[r+1];if(QD>=i&&QD<=a)return[i,a];a-i>n-t&&(t=i,n=a)}return[t,n]}const Ioe=e=>e<161||e>1114109?!1:ZD(joe,e),Loe=e=>e<12288||e>65510?!1:ZD(Moe,e),Roe=e=>e>=Noe&&e<=Poe?!0:e<4352||e>262141?!1:ZD(XD,e);function zoe(e){if(!Number.isSafeInteger(e))throw TypeError(`Expected a code point, got \`${typeof e}\`.`)}function $D(e,{ambiguousAsWide:t=!1}={}){return zoe(e),Loe(e)||Roe(e)||t&&Ioe(e)?2:1}const Boe=new Intl.Segmenter,eO=/^(?:\p{Default_Ignorable_Code_Point}|\p{Control}|\p{Format}|\p{Mark}|\p{Surrogate})+$/v,Voe=/^[\p{Default_Ignorable_Code_Point}\p{Control}\p{Format}\p{Mark}\p{Surrogate}]+/v,Hoe=/^\p{RGI_Emoji}$/v,Uoe=/^[\d#*]\u20E3$/,Woe=/\p{Extended_Pictographic}/gu;function Goe(e){if(e.length>50)return!1;if(Uoe.test(e))return!0;if(e.includes(``)){let t=e.match(Woe);return t!==null&&t.length>=2}return!1}function Koe(e){return e.replace(Voe,``)}function tO(e){return eO.test(e)}function nO(e){return e>=4352&&e<=4447||e>=43360&&e<=43388}function rO(e){return e>=4448&&e<=4519||e>=55216&&e<=55238}function iO(e){return e>=4520&&e<=4607||e>=55243&&e<=55291}function aO(e){return nO(e)||rO(e)||iO(e)}function oO(e,t){let n=[];for(let t of e)eO.test(t)||n.push(t.codePointAt(0));if(n.length===0)return;let r=0;for(let e=0;e<n.length;e++){let i=n[e];if(!aO(i)){if(r===0)return;for(let i=e;i<n.length;i++)r+=$D(n[i],t);return r}if(nO(i)&&rO(n[e+1])){r+=2,e+=iO(n[e+2])?2:1;continue}r+=$D(i,t)}return r}function sO(e,t){let n=0,r=!0;for(let i of e){if(r){r=!1;continue}i>=``&&i<=``&&(n+=$D(i.codePointAt(0),t))}return n}function cO(e,t={}){if(typeof e!=`string`||e.length===0)return 0;let{ambiguousIsNarrow:n=!0,countAnsiEscapeCodes:r=!1}=t,i=e;if(!r&&(i.includes(`\x1B`)||i.includes(``))&&(i=Aoe(i)),i.length===0)return 0;if(/^[\u0020-\u007E]*$/.test(i))return i.length;let a=0,o={ambiguousAsWide:!n};for(let{segment:e}of Boe.segment(i)){if(tO(e))continue;if(Hoe.test(e)||Goe(e)){a+=2;continue}let t=Koe(e),n=oO(t,o);if(n!==void 0){a+=n;continue}let r=t.codePointAt(0);a+=$D(r,o),a+=sO(t,o)}return a}function lO(e,t,n,r,i){e.push({lineNumber:t,detail:r,range:[n,1],fixInfo:i})}function uO(e,t){return(0,H.filterByTypes)(t.children,[`tableCellDivider`]).map(n=>({actual:n.startColumn,effective:cO(e[t.startLine-1].slice(0,n.startColumn-1))}))}function dO(e,t,n){let r=[],i=t[0],a=uO(e,i);for(let i of t.slice(1)){let t=new Set(a.map(e=>e.effective)),o=uO(e,i);for(let e of o)t.size>0&&!t.delete(e.effective)&&lO(r,i.startLine,e.actual,n)}return r}var fO={names:[`MD060`,`table-column-style`],description:`Table column style`,tags:[`table`],parser:`micromark`,function:function(e,t){let n=String(e.config.style||`any`),r=n===`any`||n===`aligned`,i=n===`any`||n===`compact`,a=n===`any`||n===`tight`,o=!!e.config.aligned_delimiter,s=e.lines,c=mD([`table`]);for(let e of c){let n=(0,H.filterByTypes)(e.children,[`tableDelimiterRow`,`tableRow`]),c=[];r&&c.push(...dO(s,n,`Table pipe does not align with header for style "aligned"`));let l=[],u=[];if((i||a)&&!(r&&c.length===0)){if(o){let e=dO(s,n.slice(0,2),`Table pipe does not align with header for option "aligned_delimiter"`);l.push(...e),u.push(...e)}for(let e of n){let t=(0,H.filterByTypes)(e.children,[`tableCellDivider`,`tableContent`,`whitespace`]);for(let n=0;n<t.length;n++){let{startColumn:r,startLine:i,type:a}=t[n];if(a===`tableCellDivider`){let a=t[n-1];a&&(a.type===`whitespace`?(a.text.length!==1&&lO(l,i,r,`Table pipe has extra space to the left for style "compact"`,{editColumn:a.startColumn,deleteCount:a.text.length-1}),lO(u,i,r,`Table pipe has space to the left for style "tight"`,{editColumn:a.startColumn,deleteCount:a.text.length})):lO(l,i,r,`Table pipe is missing space to the left for style "compact"`,{editColumn:a.endColumn,insertText:` `}));let o=t[n+1];o&&(o.type===`whitespace`?o.endColumn!==e.endColumn&&(o.text.length!==1&&lO(l,i,r,`Table pipe has extra space to the right for style "compact"`,{editColumn:o.startColumn,deleteCount:o.text.length-1}),lO(u,i,r,`Table pipe has space to the right for style "tight"`,{editColumn:o.startColumn,deleteCount:o.text.length})):lO(l,i,r,`Table pipe is missing space to the right for style "compact"`,{editColumn:o.startColumn,insertText:` `}))}}}}let d=c;i&&(l.length<d.length||!r)&&(d=l),a&&(u.length<d.length||!r&&!i)&&(d=u);for(let e of d)t(e)}}};const[pO,mO]=Fie,[hO,gO]=roe,_O=[pie,mie,yie,bie,Cie,wie,Eie,Oie,kie,jie,Nie,Pie,pO,Iie,mO,Lie,Rie,zie,Bie,Vie,Hie,Wie,Kie,qie,Yie,Xie,Zie,Qie,$ie,nae,rae,iae,aae,oae,lae,uae,dae,Yae,Qae,$ae,eoe,toe,hO,gO,foe,poe,hoe,yoe,xoe,Coe,woe,Doe,fO];for(let e of _O){let t=e.names[0].toLowerCase();e.information=new URL(`https://github.com/DavidAnson/markdownlint/blob/v${gD}/doc/${t}.md`)}function vO(e,t,n){let r=null,i=null,a=[],o=0;return(n||[JSON.parse]).every(e=>{try{let n=e(t);return r=n&&typeof n==`object`&&!Array.isArray(n)?n:{},!1}catch(e){a.push(`Parser ${o++}: ${e?.message}`)}return!0})&&(a.unshift(`Unable to parse '${e}'`),i=a.join(`; `)),{config:r,message:i}}function yO(e,t){let n=null;if(e.length===_O.length)return n;let r={};for(let[i,a]of e.entries()){let e=i-_O.length;function o(t,n){return Error(`Property '${t}' of custom rule at index ${e} is incorrect: '${n}'.`)}for(let e of[`names`,`tags`]){let t=a[e];!n&&(!t||!Array.isArray(t)||t.length===0||!t.every(V.isString)||t.some(V.isEmptyString))&&(n=o(e,t))}for(let e of[[`description`,`string`],[`function`,`function`]]){let t=e[0],r=a[t];!n&&(!r||typeof r!==e[1])&&(n=o(t,r))}if(!n&&a.parser!==void 0&&a.parser!==`markdownit`&&a.parser!==`micromark`&&a.parser!==`none`&&(n=o(`parser`,a.parser)),!n&&a.information&&!V.isUrl(a.information)&&(n=o(`information`,a.information)),!n&&a.asynchronous!==void 0&&typeof a.asynchronous!=`boolean`&&(n=o(`asynchronous`,a.asynchronous)),!n&&a.asynchronous&&t&&(n=Error(`Custom rule `+a.names.join(`/`)+` at index `+e+` is asynchronous and can not be used in a synchronous context.`)),!n){for(let t of a.names){let i=t.toUpperCase();!n&&r[i]!==void 0&&(n=Error(`Name '`+t+`' of custom rule at index `+e+` is already used as a name or tag.`)),r[i]=!0}for(let t of a.tags){let i=t.toUpperCase();!n&&r[i]&&(n=Error(`Tag '`+t+`' of custom rule at index `+e+` is already used as a name.`)),r[i]=!1}}}return n}function bO(e,t){let n=[];if(t){let r=e.match(t);if(r&&!r.index){let t=r[0];e=e.slice(t.length),n=t.split(V.newLineRe),n.length>0&&n[n.length-1]===``&&n.length--}}return{content:e,frontMatterLines:n}}function xO(e){let t={};for(let n of e){let e=n.names[0].toUpperCase();for(let r of n.names){let n=r.toUpperCase();t[n]=[e]}for(let r of n.tags){let n=r.toUpperCase(),i=t[n]||[];i.push(e),t[n]=i}}return t}function SO(e,t,n){let r=!0,i=`error`;Object.entries(t).every(([e,t])=>e.toUpperCase()!==`DEFAULT`||(r=!!t,t===`warning`&&(i=`warning`),!1));let a={},o=new Map,s=new Map,c=Object.freeze({});for(let t of e.map(e=>e.names[0].toUpperCase()))a[t]=c,o.set(t,r),s.set(t,i);for(let[e,r]of Object.entries(t)){let t=e.toUpperCase(),i=!1,c=`error`,l={};if(r){if(r instanceof Object){let e=r;i=e.enabled===void 0||!!e.enabled,c=e.severity===`warning`?`warning`:`error`,l=Object.fromEntries(Object.entries(r).filter(([e])=>e!==`enabled`&&e!==`severity`))}else i=!0,c=r===`warning`?`warning`:`error`}for(let e of n[t]||[])Object.freeze(l),a[e]=l,o.set(e,i),s.set(e,c)}return{effectiveConfig:a,rulesEnabled:o,rulesSeverity:s}}function CO(e,t,n,r,i,a,o){let s=new Map,c=s,l=Array(1+n.length);function u(e,t,n=void 0){for(let[i,a]of e.entries()){if(!r){let e=null;for(;e=V.inlineCommentStartRe.exec(a);){let n=e[2].toUpperCase(),r=e.index+e[1].length,o=a.indexOf(`-->`,r);if(o===-1)break;t(n,a.slice(r,o),i+1)}}n&&n()}}function d(e,t){if(e===`CONFIGURE-FILE`){let{config:e}=vO(`CONFIGURE-FILE`,t,a);e&&(i={...i,...e})}}function f(e,t,n){n=new Map(n);let r=e.startsWith(`ENABLE`),i=t&&t.trim(),a=i?i.toUpperCase().split(/\s+/):b;for(let e of a)for(let t of o[e]||[])n.set(t,r);return n}function p(e,t){(e===`ENABLE-FILE`||e===`DISABLE-FILE`)&&(s=f(e,t,s))}function m(e,t){e===`CAPTURE`?c=s:e===`RESTORE`?s=c:(e===`ENABLE`||e===`DISABLE`)&&(s=f(e,t,s))}function h(){l.push(s)}function g(e,t,r){let i=e===`DISABLE-LINE`,a=e===`DISABLE-NEXT-LINE`;if(i||a){let i=n.length+r+ +!!a;l[i]=f(e,t,l[i])}}u([t.join(`
|
|
208
|
+
`)],d);let{effectiveConfig:_,rulesEnabled:v,rulesSeverity:y}=SO(e,i,o),b=[...v.keys()];return s=new Map(v),c=s,u(t,p),u(t,m,h),u(t,g),{effectiveConfig:_,enabledRulesPerLineNumber:l,enabledRuleList:e.filter(e=>{let t=e.names[0].toUpperCase();return l.some(e=>e.get(t))}),rulesSeverity:y}}function wO(e,n,r,i,a,o,s,c,l,u,d,f){let p=e=>f(e instanceof Error?e:Error(e));i=i.replace(/^\uFEFF/,``);let m=bO(i,c),{frontMatterLines:h}=m;i=m.content;let{effectiveConfig:g,enabledRulesPerLineNumber:_,enabledRuleList:v,rulesSeverity:y}=CO(e,i.split(V.newLineRe),h,u,o,s,n),b=v.some(e=>e.parser===`markdownit`||e.parser===void 0),x=v.some(e=>e.parser===`micromark`),S=e.length!==_O.length,C=x?zD(i,{freezeTokens:S}):[],w=i;i=V.clearHtmlCommentText(i);let T=i.split(V.newLineRe),ee=e=>{let t=Object.freeze({markdownit:Object.freeze({tokens:e})}),n=Object.freeze({micromark:Object.freeze({tokens:C})}),i=Object.freeze({}),a={name:r,version:gD,lines:Object.freeze(T),frontMatterLines:Object.freeze(h)};dD({...a,parsers:n,config:{}});let o=[],s=s=>{let c=s.names[0].toUpperCase(),u={},d=i;s.parser===void 0?(u.tokens=e,d=t):s.parser===`markdownit`?d=t:s.parser===`micromark`&&(d=n);let f=Object.freeze({...a,...u,parsers:d,config:g[c]});function p(e){throw Error(`Value of '${e}' passed to onError by '${c}' is incorrect for '${r}'.`)}function m(e){(!e||!V.isNumber(e.lineNumber)||e.lineNumber<1||e.lineNumber>T.length)&&p(`lineNumber`);let t=e.lineNumber+h.length;if(!_[t].get(c))return;e.detail&&!V.isString(e.detail)&&p(`detail`),e.context&&!V.isString(e.context)&&p(`context`),e.information&&!V.isUrl(e.information)&&p(`information`),e.range&&(!Array.isArray(e.range)||e.range.length!==2||!V.isNumber(e.range[0])||e.range[0]<1||!V.isNumber(e.range[1])||e.range[1]<1||e.range[0]+e.range[1]-1>T[e.lineNumber-1].length)&&p(`range`);let n=e.fixInfo,r={};if(n){V.isObject(n)||p(`fixInfo`),n.lineNumber!==void 0&&((!V.isNumber(n.lineNumber)||n.lineNumber<1||n.lineNumber>T.length)&&p(`fixInfo.lineNumber`),r.lineNumber=n.lineNumber+h.length);let t=n.lineNumber||e.lineNumber;n.editColumn!==void 0&&((!V.isNumber(n.editColumn)||n.editColumn<1||n.editColumn>T[t-1].length+1)&&p(`fixInfo.editColumn`),r.editColumn=n.editColumn),n.deleteCount!==void 0&&((!V.isNumber(n.deleteCount)||n.deleteCount<-1||n.deleteCount>T[t-1].length)&&p(`fixInfo.deleteCount`),r.deleteCount=n.deleteCount),n.insertText!==void 0&&(V.isString(n.insertText)||p(`fixInfo.insertText`),r.insertText=n.insertText)}let i=e.information||s.information;o.push({lineNumber:t,ruleNames:s.names,ruleDescription:s.description,ruleInformation:i?i.href:null,errorDetail:e.detail?.replace(V.newLineRe,` `)||null,errorContext:e.context?.replace(V.newLineRe,` `)||null,errorRange:e.range?[...e.range]:null,fixInfo:n?r:null,severity:y.get(c)})}let v=e=>m({lineNumber:1,detail:`This rule threw an exception: ${e.message||e}`}),b=()=>s.function(f,m);if(s.asynchronous){let e=Promise.resolve().then(b);return l?e.catch(v):e}try{b()}catch(e){if(l)v(e);else throw e}return null},c=()=>(o.sort((e,t)=>e.ruleNames[0].localeCompare(t.ruleNames[0])||e.lineNumber-t.lineNumber),o),u=v.filter(e=>e.asynchronous),d=v.filter(e=>!e.asynchronous),m=[...u,...d],b=()=>f(null,c());try{let e=m.map(s);u.length>0?Promise.all(e.slice(0,u.length)).then(b).catch(p):b()}catch(e){p(e)}finally{dD()}};!b||d?ee(b?(0,fie.requireMarkdownItCjs)().getMarkdownItTokens(a(),w,T):[]):Promise.all([import(`./markdownit-KdPRBB1X.mjs`).then(e=>t(e.default,1)),new Promise(e=>e(a()))]).then(([e,t])=>{let n=e.getMarkdownItTokens(t,w,T);ee(n)}).catch(p)}function TO(e,t,n,r,i,a,o,s,c,l,u,d){function f(l,f){return l?d(l):wO(e,t,n,f,r,i,a,o,s,c,u,d)}u?f(null,l.readFileSync(n,`utf8`)):l.readFile(n,`utf8`,f)}function EO(e,t,n){e||={},n||=()=>{};let r=[e.customRules||[]].flat().map(e=>({names:V.cloneIfArray(e.names),description:e.description,information:V.cloneIfUrl(e.information),tags:V.cloneIfArray(e.tags),parser:e.parser,asynchronous:e.asynchronous,function:e.function})),i=_O.concat(r),a=yO(i,t);if(a){n(a);return}let o=[];Array.isArray(e.files)?o=[...e.files]:e.files&&(o=[String(e.files)]);let s=e.strings||{},c=Object.keys(s),l=e.config||{default:!0},u=e.configParsers||void 0,d=e.frontMatter===void 0?V.frontMatterRe:e.frontMatter,f=!!e.handleRuleFailures,p=!!e.noInlineConfig,m=e.markdownItFactory||(()=>{throw Error(`The option 'markdownItFactory' was required (due to the option 'customRules' including a rule requiring the 'markdown-it' parser), but 'markdownItFactory' was not set.`)}),h=e.fs||cie,g=xO(i),_={},v=!1,y=0;function b(){let e;function r(r,i){return y--,r?(v=!0,n(r)):(_[e]=i,t||b(),null)}if(!v){if(e=o.shift())y++,TO(i,g,e,m,l,u,d,f,p,h,t,r);else if(e=c.shift())y++,wO(i,g,e,s[e]||``,m,l,u,d,f,p,t,r);else if(y===0){v=!0;let e=Object.entries(_);e.sort(([e],[t])=>e.localeCompare(t));let t=Object.fromEntries(e);return n(null,t)}}return null}if(t)for(;!v;)b();else b(),b(),b(),b(),b(),b(),b(),b()}function DO(e){let t=null;return EO(e,!0,function(e,n){if(e)throw e;t=n}),t}function OO(e,t=0){return{lineNumber:e.lineNumber||t,editColumn:e.editColumn||1,deleteCount:e.deleteCount||0,insertText:e.insertText||``}}function kO(e,t,n=`
|
|
209
|
+
`){let{editColumn:r,deleteCount:i,insertText:a}=OO(t),o=r-1;return i===-1?null:e.slice(0,o)+a.replace(/\n/g,n)+e.slice(o+i)}function AO(e,t){let n=V.getPreferredLineEnding(e,lie),r=e.split(V.newLineRe),i=t.filter(e=>e.fixInfo).map(e=>OO(e.fixInfo,e.lineNumber));i.sort((e,t)=>{let n=e.deleteCount===-1,r=t.deleteCount===-1;return t.lineNumber-e.lineNumber||(n?1:r?-1:0)||t.editColumn-e.editColumn||t.insertText.length-e.insertText.length});let a={};i=i.filter(e=>{let t=e.lineNumber!==a.lineNumber||e.editColumn!==a.editColumn||e.deleteCount!==a.deleteCount||e.insertText!==a.insertText;return a=e,t}),a={lineNumber:-1};for(let e of i)e.lineNumber===a.lineNumber&&e.editColumn===a.editColumn&&!e.insertText&&e.deleteCount>0&&a.insertText&&!a.deleteCount&&(e.insertText=a.insertText,a.lineNumber=0),a=e;i=i.filter(e=>e.lineNumber);let o=-1,s=-1;for(let e of i){let{lineNumber:t,editColumn:i,deleteCount:a}=e,c=t-1,l=i-1;(c!==o||a===-1||l+a<=s-(a>0?0:1))&&(r[c]=kO(r[c],e,n)),o=c,s=l}return r.filter(e=>e!==null).join(n)}function jO(e,t){let n=typeof e==`string`?e:e.origin,r=typeof e==`string`?void 0:e.url,i=n.split(`:`),a=i[1]?i[0]:void 0,o=i[1];return Object.defineProperty(s,"name",{value:n}),s;function s(e){let[n,i]=MO(o,e),s=n===2;if(n)return function(e,n,c){let l=n.messages.length-1;Aw(t,function(e){let t=n.messages;if(e&&!t.includes(e))try{n.fail(e)}catch{}for(;++l<t.length;)Object.assign(t[l],{fatal:s,ruleId:o,source:a,url:r});c()})(e,n,i)}}}function MO(e,t){if(Array.isArray(t)){let[n,r]=t;switch(n){case!1:case 0:case`off`:return[0,r];case!0:case 1:case`on`:case`warn`:return[1,r];case 2:case`error`:return[2,r];default:if(typeof n==`number`)throw Error("Incorrect severity `"+n+"` for `"+e+"`, expected 0, 1, or 2");return[1,t]}}return[1,t]}function NO(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);if(n<=0)return t;let r=t.slice(n).toLowerCase();return hp.includes(r)?t.slice(0,n):t}function PO(e){return NO(e)===`log`}const FO={default:!0,MD013:!1};function IO(e){return e??FO}function LO(e){let t=e.replace(/\\/g,`/`);for(;t.startsWith(`./`);)t=t.slice(2);let n=t.toLowerCase();for(let e of hp)if(n.endsWith(e))return t.slice(0,-e.length);return t}function RO(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,sD.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();hp.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=LO(e);return t===``||!(s||i.some(e=>e(t)))?!1:!a.some(e=>e(t))}}}function zO(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(LO).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,sD.default)(t,{dot:!0,strictBrackets:!0})}catch{continue}r.some(e=>n(e))||i.push(e)}return i}function BO(e,t){let n=new Set,r=[];for(let i of e){if(i.enabled===!1||!i.schema||!RO(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}const VO={"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`},HO=Object.keys(VO),UO=`draft-07`,WO=new Map(HO.map(e=>[GO(VO[e]),e]));function GO(e){return e.replace(/^https?:\/\//,``).replace(/#$/,``)}function KO(e){let t=e.$schema;return t===void 0?UO:typeof t==`string`?WO.get(GO(t))??null:null}function qO(e){return KO(e)!==null}const JO=new Map;function YO(e){throw Error(`Unhandled FrontmatterSchemaDialect: ${JSON.stringify(e)}`)}function XO(e){let t=JO.get(e);if(t)return t;let n={allErrors:!0,strict:!1},r;switch(e){case`2020-12`:r=new oie.default(n);break;case`2019-09`:r=new aie.default(n);break;case`draft-06`:case`draft-07`:r=new iie.default(n);break;default:return YO(e)}return(0,sie.default)(r),JO.set(e,r),r}function ZO(e){let{$schema:t,...n}=e;return n}function QO(e,t){let n=XO(e),r=t.$id;return typeof r==`string`&&r!==``&&n.removeSchema(r),n.compile(ZO(t))}const $O=new Map;function ek(e){let t=JSON.stringify(e),n=$O.get(t);if(n!==void 0)return n;let r=null,i=KO(e);if(i!==null)try{r=QO(i,e)}catch{r=null}return $O.size>=256&&$O.clear(),$O.set(t,r),r}function tk(e){if(ek(e))return null;let t=KO(e);if(t===null)return`unsupported dialect ${JSON.stringify(e.$schema)}`;try{return QO(t,e),`schema was refused`}catch(e){return e instanceof Error?e.message:String(e)}}function nk(e){let t=new Map;if(!ru.test(e))return{data:{},keyLines:t};let{frontmatter:n}=iu(e),r=ou(n);if(r.trim()===``)return{data:{},keyLines:t};let i=(0,su.parseDocument)(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((0,su.isMap)(i.contents))for(let e of i.contents.items){let n=e.key;if(!(0,su.isScalar)(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}}const rk={"date-time":`an ISO 8601 datetime with an explicit UTC offset, for example "2026-09-23T00:00:00Z"`};function ik(e){let t=e.format;return typeof t==`string`?rk[t]:void 0}function ak(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 ok(e){if(!e.startsWith(`/`))return null;let t=e.slice(1).split(`/`)[0]??``;return t===``?null:t.replace(/~1/g,`/`).replace(/~0/g,`~`)}function sk(e){return e.split(`/`).slice(1).map(e=>e.replace(/~1/g,`/`).replace(/~0/g,`~`)).join(`.`)}function ck(e,t,n){if(t.length===0)return[];let r=n?.source??`frontmatter`,{data:i,keyLines:a}=nk(e),o=e.split(`
|
|
210
|
+
`),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=ek(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=ok(e.instancePath);n!==null&&(o=a.get(n)??0);let r=sk(e.instancePath),s=n!==null&&r===n?i[n]:void 0;if(t===`enum`)l=`Frontmatter property "${r}" must be one of: ${(e.params.allowedValues??[]).map(String).join(`, `)}${ak(s)}`;else if(t===`format`&&ik(e.params)!==void 0){let t=e.params.format;l=`Frontmatter property "${r}" must be ${ik(e.params)} (format "${String(t)}")${ak(s)}`}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}function lk(e,t){return AO(e,DO({strings:{doc:e},config:t}).doc??[])}function uk(e,t){let n=DO({strings:{doc:e},config:t}).doc??[],r=e.split(`
|
|
211
|
+
`),i=dk(t);return n.map(e=>pk(e,r,fk(e,i)))}function dk(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 fk(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 pk(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?[mk(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 mk(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??``}}const hk=[`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 gk(e,t){return e?.[t]!==!1}const _k=`.ok/okf`;function vk(e){return`${e.replace(/^frontmatter-/,``)}.schema.json`}function yk(e){return`${_k}/${vk(e)}`}const bk={$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/open-knowledge-format/blob/ad30107c31c06aec8a7d5636e0d1058118604e6f/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."}}},xk={$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/open-knowledge-format/blob/ad30107c31c06aec8a7d5636e0d1058118604e6f/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."}}},Sk={$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/open-knowledge-format/blob/ad30107c31c06aec8a7d5636e0d1058118604e6f/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-time`,description:"Optional credibility signal — a recency signal: when the source itself last changed, as an ISO 8601 datetime with an explicit UTC offset (`2026-06-15T00:00:00Z`). Distinct from `generated.at`, which records when the concept was written. OKF v0.2 §5, §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-time`,description:"Start of the window framing this entry's `usage_count`, as an ISO 8601 datetime with an explicit UTC offset (`2026-06-01T00:00:00Z`). OKF v0.2 §5, §5.1."},to:{type:`string`,format:`date-time`,description:"End of the window framing this entry's `usage_count`, as an ISO 8601 datetime with an explicit UTC offset (`2026-06-30T00:00:00Z`). OKF v0.2 §5, §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 }` range. A single entry may carry its own `usage_window` to override it. OKF v0.2 §5, §5.1.",properties:{from:{type:`string`,format:`date-time`,description:"Start of the shared usage window, as an ISO 8601 datetime with an explicit UTC offset (`2026-06-01T00:00:00Z`). OKF v0.2 §5, §5.1."},to:{type:`string`,format:`date-time`,description:"End of the shared usage window, as an ISO 8601 datetime with an explicit UTC offset (`2026-06-30T00:00:00Z`). OKF v0.2 §5, §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 with an explicit UTC offset (`2026-06-30T14:00:00Z`) 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, §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:"An ISO 8601 datetime with an explicit UTC offset (`2026-07-01T09:00:00Z`) recording when the verification event happened. OKF v0.2 §5, §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:"An ISO 8601 datetime with an explicit UTC offset (`2026-07-01T09:00:00Z`) recording when the verification event happened. OKF v0.2 §5, §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-time`,description:"An absolute instant, an ISO 8601 datetime with an explicit UTC offset (`2026-12-31T00:00:00Z`): the concept is stale when `now >= stale_after`. Absolute rather than a relative TTL so staleness stays a plain comparison with no reference to when the concept was read. An instant in the past is a freshness signal for consumers, not a violation. OKF v0.2 §5, §5.5, §10.5."}}},Ck={$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/open-knowledge-format/blob/ad30107c31c06aec8a7d5636e0d1058118604e6f/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."}}}}},wk={$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/open-knowledge-format/blob/ad30107c31c06aec8a7d5636e0d1058118604e6f/SPEC.md#8-index-files",type:`object`,maxProperties:0},Tk={$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/open-knowledge-format/blob/ad30107c31c06aec8a7d5636e0d1058118604e6f/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.'}}},Ek=[`**`,`!**/{index,log}`],Dk=[{id:`frontmatter-required`,appliesTo:Ek,schema:bk},{id:`frontmatter-recommended`,appliesTo:Ek,schema:xk},{id:`frontmatter-provenance`,appliesTo:Ek,schema:Sk},{id:`frontmatter-computation`,appliesTo:Ek,schema:Ck},{id:`frontmatter-reserved-index`,appliesTo:[`**/index`,`!index`],schema:wk},{id:`frontmatter-root-index`,appliesTo:[`index`],schema:Tk}],Ok=Object.fromEntries(hk.filter(e=>!Dk.some(t=>t.id===e)).map(e=>[e,!1]));function kk(e,t){return t===void 0?[]:Dk.filter(n=>gk(e,n.id)&&RO([...n.appliesTo]).matches(t))}function Ak(e){return Dk.filter(t=>gk(e,t.id)).map(e=>({appliesTo:[...e.appliesTo],file:yk(e.id)}))}function jk(e,t,n){let r=kk(t,n);return r.length===0?[]:ck(e,r.map(e=>({file:yk(e.id),schema:e.schema,ruleId:e.id})),{source:`okf`})}function Mk(e,t){return jO(`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 Nk(e,t,n){let r=RO(t);return Mk(e,(e,t)=>{r.matches(t.data.okfDocName)&&n(e,t)})}const Pk=e=>({line:e.line-1,character:e.column-1});function Fk(e,t){if(e&&`start`in e)return{start:Pk(e.start),end:Pk(e.end)};if(e){let n=Pk(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 Ik(e,t){return{range:Fk(e.place,t),severity:`warning`,source:`okf`,code:e.ruleId??`okf`,message:e.reason}}function Lk(e,t,n){if(t.length===0)return[];let r=Gw().use(aE).use(Tw).use(bT,[`yaml`]);for(let e of t)r.use(e);let i=new Rw({value:e});n!==void 0&&(i.data.okfDocName=n);let a=r.parse(i);r.runSync(a,i);let o=e.split(`
|
|
212
|
+
`);return i.messages.map(e=>Ik(e,o))}function Rk(e){let t=!1;return ub(e,[`link`,`linkReference`],()=>(t=!0,!1)),t}const zk=Nk(`index-shape`,`**/index`,(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)}ub(e,`listItem`,e=>{e.children.some(e=>e.type===`list`)||Rk(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)})}),Bk=/^\s*(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])(?!\d)/;function Vk(e,t,n){let r=new Date(Date.UTC(e,t-1,n));return r.getUTCFullYear()===e&&r.getUTCMonth()===t-1&&r.getUTCDate()===n}const Hk=/^\s*\d{4}[-/.]\d{1,2}[-/.]\d{1,2}/;function Uk(e){let t=e.trim();return t.length>60?`${t.slice(0,59)}…`:t}const Wk=Nk(`log-shape`,`**/log`,(e,t)=>{let n;ub(e,`heading`,e=>{if(e.depth!==2)return;let r=fb(e),i=Bk.exec(r);if(!i){t.message(Hk.test(r)?`Log date heading "${Uk(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 "${Uk(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(!Vk(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})}),Gk=/\[\[[^[\]\n]+\]\]/g;function Kk(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}const qk=Mk(`no-wiki-links`,(e,t)=>{let n=typeof t.value==`string`?t.value:String(t.value);ub(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]===`
|
|
213
|
+
`?(c+=1,l=1):l+=1;return{line:c,column:l}};for(let e of o.matchAll(Gk)){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(Kk(e[0]),s)}})}),Jk=[`index`,`log`],Yk=Mk(`reserved-casing`,(e,t)=>{let n=t.data.okfDocName;if(n===void 0)return;let r=NO(n),i=r.toLowerCase();Jk.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.`)}),Xk=[{id:`no-wiki-links`,rule:qk},{id:`log-shape`,rule:Wk},{id:`index-shape`,rule:zk},{id:`reserved-casing`,rule:Yk}],Zk=Xk.map(e=>e.rule);function Qk(e){return e===void 0?Zk:Xk.filter(t=>gk(e,t.id)).map(e=>e.rule)}const $k=xo([N(),I(ine),ko(j(),po())]),eA={id:`markdownlint`,sliceSchema:F({enabled:N(),rules:ko(j(),$k)}),defaultSlice:{enabled:!1,rules:FO},async lint(e,t){return uk(e,IO(t.rules))},fix(e,t){return lk(e,IO(t.rules))}},tA=F({appliesTo:xo([j(),P(j())]).optional(),file:j(),enabled:N().optional(),key:j().optional(),schema:ko(j(),po()).optional()}),nA=[eA,{id:`frontmatter`,sliceSchema:F({enabled:N(),schemas:P(tA)}),defaultSlice:{enabled:!1,schemas:[]},async lint(e,t,n){return ck(e,BO(t.schemas,n.docName))},frontmatter:{schemasForDoc:(e,t)=>BO(e.schemas,t),narrowSliceToFrontmatter:e=>e,advertisedMappings:e=>e.schemas}},{id:`okf`,sliceSchema:F({enabled:N(),rules:ko(j(),N()).optional(),generate:F({index:N().optional()}).optional()}),defaultSlice:{enabled:!1},async lint(e,t,n){return[...Lk(e,Qk(t.rules),n.docName),...jk(e,t.rules,n.docName)]},frontmatter:{schemasForDoc:(e,t)=>kk(e.rules,t),narrowSliceToFrontmatter:e=>({...e,rules:{...e.rules,...Ok}}),advertisedMappings:e=>Ak(e.rules)}}],rA={enabled:!0,plugins:Object.fromEntries(nA.map(e=>[e.id,e.defaultSlice]))};function iA(e,t){return e.enabled&&e.plugins[t]?.enabled===!0}function aA(e){if(!e?.enabled)return[];let t=[];for(let n of nA){if(n.frontmatter===void 0)continue;let r=e.plugins[n.id];r?.enabled===!0&&t.push(...n.frontmatter.advertisedMappings(r))}return t}function oA(e){return{enabled:e.enabled??!0,plugins:{markdownlint:{...e.markdownlint,rules:e.markdownlint.rules??FO},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}}}}}const sA=Object.fromEntries(nA.map(e=>[e.id,e.sliceSchema])),cA=F({effective:F({enabled:N(),plugins:F(sA)}),configFile:j().nullable().optional(),configProblems:P(j()).optional()}),lA=xo([N(),ko(j(),po())]),uA=new Set([`__proto__`]),dA=j().min(1).max(256).refine(e=>!uA.has(e),{message:`schema property name cannot be __proto__`}),fA=F({ruleId:j().min(1).max(64).regex(/^[A-Za-z][A-Za-z0-9_-]*$/),value:xo([lA,co()])}),pA=F({file:j().min(1).max(512),delete:L(!0).optional(),field:dA.optional(),parentPath:P(xo([dA,F({items:L(!0)}).strict()])).max(8).optional(),removeField:L(!0).optional(),renameTo:dA.optional(),constraint:F({type:I([`string`,`number`,`boolean`,`array`,`object`]).nullable().optional(),enum:P(xo([j(),M(),N()])).nullable().optional(),itemsEnum:P(xo([j(),M(),N()])).nullable().optional(),itemsType:I([`string`,`number`,`boolean`,`object`]).nullable().optional(),pattern:j().nullable().optional(),format:j().nullable().optional(),description:j().max(2048).nullable().optional(),required:N().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`}),mA=F({schemas:P(j()),truncated:N()}).strict(),hA=F({line:M(),character:M()}),gA=F({start:hA,end:hA}),_A=F({range:gA,severity:I([`error`,`warning`,`info`,`hint`]),source:j(),code:j(),message:j(),fixes:P(F({range:gA,newText:j()})).optional(),frontmatterScope:I(nne).optional(),frontmatterProperty:j().optional()}),vA=P(j()).optional(),yA=F({file:j(),diagnostics:P(_A),ran:vA,warnings:P(j()).optional()}),bA=F({files:P(yA),fileCount:M(),errorCount:M(),warningCount:M(),warnings:P(j()),ran:vA}),xA=_A.extend({linkTarget:j().optional(),localTarget:iv.optional()}),SA=F({files:P(F({file:j(),diagnostics:P(xA)})),fileCount:M(),errorCount:M(),warningCount:M(),warnings:P(j()),ran:vA,brokenLinkSuppression:uv.optional()}),CA=F({errorCount:M().int().nonnegative(),warningCount:M().int().nonnegative()}),wA=F({files:P(F({file:j(),lint:CA,links:CA})),fileCount:M().int().nonnegative(),errorCount:M().int().nonnegative(),warningCount:M().int().nonnegative(),warnings:P(j()),brokenLinkSuppression:uv.optional()}),TA=F({docName:k_,summary:j_,...A_}).loose(),EA=`Re-lint after fix failed: `;function DA(e){return e.startsWith(EA)}const OA=[`re-lint-threw`,`source-went-blind`];function kA(e){return typeof e==`string`&&OA.includes(e)}const AA=F({reason:I(OA),message:j().min(1)}),jA=F({...B_,file:j(),fixedCount:M(),diagnostics:P(_A),errorCount:M(),warningCount:M(),ran:vA,warnings:P(j()).optional(),diagnosticsArePreFix:N().optional(),reLintFailure:AA.optional()});function MA(){let e=VO[UO];return`${JSON.stringify({$schema:e,type:`object`},null,2)}\n`}function NA(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 PA(e){let t=e.trim().toLowerCase().split(`/`).pop()??``;return t.endsWith(`.schema.json`)&&t.length>12?!0:NA(e)&&t.endsWith(`.json`)}var FA=class extends Error{};function IA(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function LA(e,t,n){let r=e;for(let e of t){if(typeof e!=`string`){let e=r.items;if(e===void 0){if(!n)throw new FA(`field path items does not exist`);let e={type:`object`};r.items=e,r=e;continue}if(!IA(e))throw new FA(`field path items is not an object sub-schema`);r=e;continue}let t=BA(r),i=Object.hasOwn(t,e)?t[e]:void 0;if(i===void 0){if(!n)throw new FA(`field path ${JSON.stringify(e)} does not exist`);let i={type:`object`};r.properties={...t,[e]:i},r=i;continue}if(!IA(i))throw new FA(`field path ${JSON.stringify(e)} is not an object property`);r=i}return r}function RA(e,t,n,r=[]){let i;i=e.trim()===``?JSON.parse(MA()):zA(e);let a=LA(i,r,!0),o=BA(a),s=Object.hasOwn(o,t)?o[t]:void 0,c={...IA(s)?s:{}};for(let e of[`type`,`enum`,`pattern`,`format`,`description`]){if(!(e in n))continue;let t=n[e];t==null?delete c[e]:c[e]=t}if(`itemsEnum`in n||`itemsType`in n){if(c.items!==void 0&&!IA(c.items))throw new FA(`field path items is not an object sub-schema`);let e=IA(c.items)?{...c.items}:{};`itemsEnum`in n&&(n.itemsEnum===null||n.itemsEnum===void 0?delete e.enum:e.enum=n.itemsEnum),`itemsType`in n&&(n.itemsType===null||n.itemsType===void 0?delete e.type:e.type=n.itemsType),Object.keys(e).length>0?c.items=e:delete c.items}if(Object.keys(c).length>0)a.properties={...o,[t]:c};else if(Object.hasOwn(o,t)){let{[t]:e,...n}=o;Object.keys(n).length>0?a.properties=n:delete a.properties}if(n.required!==void 0){let e=VA(a),r=e.includes(t);n.required&&!r?a.required=[...e,t]:!n.required&&r&&HA(a,e.filter(e=>e!==t))}return`${JSON.stringify(i,null,2)}\n`}function zA(e){let t;try{t=JSON.parse(e)}catch(e){throw new FA(`schema is not valid JSON (${e instanceof Error?e.message:String(e)})`)}if(!IA(t))throw new FA(`schema is not a JSON object`);return t}function BA(e){return IA(e.properties)?e.properties:{}}function VA(e){return Array.isArray(e.required)?e.required.filter(e=>typeof e==`string`):[]}function HA(e,t){t.length>0?e.required=t:delete e.required}function UA(e,t,n=[]){let r=zA(e),i=LA(r,n,!1),a=BA(i);if(Object.hasOwn(a,t)){let{[t]:e,...n}=a;Object.keys(n).length>0?i.properties=n:delete i.properties}return HA(i,VA(i).filter(e=>e!==t)),`${JSON.stringify(r,null,2)}\n`}function WA(e,t,n,r=[]){let i=zA(e),a=LA(i,r,!1),o=BA(a);if(!Object.hasOwn(o,t))throw new FA(`field ${JSON.stringify(t)} does not exist`);if(Object.hasOwn(o,n))throw new FA(`field ${JSON.stringify(n)} already exists`);return a.properties=Object.fromEntries(Object.entries(o).map(([e,r])=>[e===t?n:e,r])),HA(a,VA(a).map(e=>e===t?n:e)),`${JSON.stringify(i,null,2)}\n`}function GA(){return Dk.map(e=>({path:`${_k}/${vk(e.id)}`,ruleId:e.id,contents:`${JSON.stringify({$comment:"Generated by the OpenKnowledge `okf` lint plugin — do not edit. The plugin validates from its own compiled copy and never reads this file, so changes here have no effect and are overwritten when the server restarts. This describes an external format (Google’s Open Knowledge Format); to change what is enforced, change the rule toggles under Settings → this project → Plugins → OKF.",...e.schema},null,2)}\n`}))}function KA(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);return n<=0?{stem:t,ext:``}:{stem:t.slice(0,n),ext:t.slice(n)}}function qA(e){let t=new Set(e.filter(e=>KA(e).ext.toLowerCase()===`.md`).map(e=>e.slice(0,e.lastIndexOf(`.`)))),n=[];for(let r of e){if(KA(r).ext.toLowerCase()!==`.mdx`)continue;let e=r.slice(0,r.lastIndexOf(`.`)),i=`"${r}" won't be picked up by an Open Knowledge Format consumer — the format is .md-only, and nothing scanning for .md files will open an .mdx.`;n.push({file:r,code:`project-no-mdx`,message:t.has(e)?`${i} It is also shadowed by "${e}.md", so a consumer reads that file instead and gets different content than this project shows you.`:i})}return n}const JA=[{id:`project-no-mdx`,run:qA}];function YA(e,t){let n=e.filter(e=>hp.some(t=>e.toLowerCase().endsWith(t)));return n.length===0?[]:JA.filter(e=>gk(t,e.id)).flatMap(e=>e.run(n))}function XA(e){return`source "${e.source}" ${e.phase} failed`}function ZA(e){let t=e.docName===void 0?``:` on "${e.docName}"`;return`${XA(e)}${t}: ${e.message}`}function QA(e){let t=new Map;for(let n of e){let e=[n.source,n.phase,n.message].join(`\0`),r=t.get(e)??{first:n,docNames:new Set};n.docName!==void 0&&r.docNames.add(n.docName),t.set(e,r)}return[...t.values()].map(({first:e,docNames:t})=>t.size<=1?ZA(e):`${XA(e)} on ${t.size} documents (first: "${e.docName}"): ${e.message}`)}const $A=[{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}]}],ej=(()=>{let e=new Map;for(let t of $A){e.set(t.id.toUpperCase(),t.id);for(let n of t.aliases)e.set(n.toUpperCase(),t.id)}return e})();function tj(e){return ej.get(e.toUpperCase())??null}function nj(e,t){let n=tj(t);if(n===null)return;let r;for(let[t,i]of Object.entries(e))tj(t)===n&&(r={key:t,value:i});return r}function rj(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}function ij(e,t){let n=nA.filter(t=>iA(e,t.id)).map(e=>e.id);return t.mode===`audit`&&t.linksValidation!==`off`&&n.push(`links`),n}const aj=`No documents were checked: this scope contains no admitted documents.`;function oj(e){return e===aj}function sj(e,t){return t===0?e!==void 0&&e.length>0?[`Checks selected: ${e.join(`, `)}; no document checks ran.`]:[`No document checks ran.`]:e===void 0?[]:e.length===0?[`No checks ran.`]:[`Checks run: ${e.join(`, `)}.`]}async function cj(e,t,n,r){if(!t.enabled)return[];let i=[];for(let a of nA){if(!iA(t,a.id))continue;let o=t.plugins[a.id];try{i.push(...await a.lint(e,o,{docName:n}))}catch(e){console.warn(`[lint] plugin "${a.id}" failed${n?` on "${n}"`:``}`,e),r?.({source:a.id,phase:`lint`,...n===void 0?{}:{docName:n},message:uj(e)})}}return i}function lj(e,t,n,r){if(!t.enabled)return e;let i=e;for(let e of nA){if(!iA(t,e.id)||!e.fix)continue;let a=t.plugins[e.id];try{i=e.fix(i,a)}catch(t){console.warn(`[lint] plugin "${e.id}" fix failed${n?` on "${n}"`:``}`,t),r?.({source:e.id,phase:`fix`,...n===void 0?{}:{docName:n},message:uj(t)})}}return i}function uj(e){let t=dj(e);return t.length>500?`${t.slice(0,500)}… (truncated)`:t}function dj(e,t=0){if(e instanceof Error)return e.cause===void 0||t>=3?e.message:`${e.message} (cause: ${dj(e.cause,t+1)})`;if(typeof e==`object`&&e)try{let t=JSON.stringify(e);if(t!==void 0)return t}catch{}return String(e)}const fj=`.agents/skills`;function pj(e){let t=e.trim();if(t===`inkeep/open-knowledge-skills`)return!0;if(!t.includes(`://`)&&!t.includes(`@`))return!1;if(t.includes(`://`))try{let e=new URL(t);return mj.has(e.hostname.toLowerCase())&&hj(e.pathname)}catch{return!1}let n=/^(?:[\w.-]+@)?([\w.-]+):(.+)$/.exec(t);return n?mj.has(n[1].toLowerCase())&&hj(n[2]):!1}const mj=new Set([`skills.sh`,`www.skills.sh`,`github.com`,`www.github.com`,`raw.githubusercontent.com`]);function hj(e){let t=e.replace(/^\/+/,``).replace(/\.git$/,``);return t===`inkeep/open-knowledge-skills`||t.startsWith(`inkeep/open-knowledge-skills/`)}const gj={"open-knowledge-pack-plain-notes":`note-taking`,"open-knowledge-pack-worldbuilding":`worldbuilding`,"open-knowledge-pack-writing-pipeline":`writing-workflow`,"open-knowledge-pack-codebase-wiki":`codebase-wiki`,"open-knowledge-pack-knowledge-base":`knowledge-base`,"open-knowledge-pack-software-lifecycle":`software-lifecycle`,"open-knowledge-pack-entity-vault":`personal-crm`,"open-knowledge-pack-okf":`okf-knowledge-base`,"open-knowledge-pack-software-lifecycle-frame-a-proposal":`frame-a-proposal`,"open-knowledge-pack-software-lifecycle-record-a-decision":`record-a-decision`,"open-knowledge-pack-software-lifecycle-write-a-spec":`write-a-spec`,"open-knowledge-pack-software-lifecycle-review-a-design":`review-a-design`,"open-knowledge-pack-software-lifecycle-write-a-postmortem":`write-a-postmortem`,"open-knowledge-pack-knowledge-base-research":`research-with-sources`,"open-knowledge-pack-knowledge-base-consolidate":`consolidate-notes`},_j=`inkeep/open-knowledge-skills`;function vj(e,t){return e.startsWith(`open-knowledge-pack-`)&&pj(t)}const yj=/(^|[\s([])\/([a-z0-9][a-z0-9-]{1,63})(?=$|[\s.,;:!?)\]])/g,bj=new Set([`tmp`,`usr`,`etc`,`var`,`dev`,`opt`,`bin`,`api`,`home`,`root`]);function xj(e){return!bj.has(e)}const Sj=/`\/([a-z0-9][a-z0-9-]{1,63})`/g;function Cj(e){let t=new Set;yj.lastIndex=0;for(let n=yj.exec(e);n!==null;n=yj.exec(e)){let e=n[2];xj(e)&&t.add(e)}Sj.lastIndex=0;for(let n=Sj.exec(e);n!==null;n=Sj.exec(e)){let e=n[1];xj(e)&&t.add(e)}return[...t]}function wj(e,t,n){if(t===n||!xj(t)||!e.includes(`/${t}`))return e;yj.lastIndex=0;let r=e.replace(yj,(e,r,i)=>i===t?`${r}/${n}`:e);return Sj.lastIndex=0,r.replace(Sj,(e,r)=>r===t?`\`/${n}\``:e)}const Tj=`skills-lock.json`,Ej=[`.ok`,Tj],Dj=yo({source:j(),pluginProvider:j().optional(),skill:j().optional(),subpath:j().optional(),ref:j().optional(),contentHash:j(),files:P(j()).optional(),localHash:j().optional(),baselineRef:j().optional(),publisher:j().optional(),importedAt:wa(),autoUpdate:N().optional()}),Oj=yo({schema:L(1),skills:ko(j(),Dj).default({})});function kj(){return{schema:1,skills:{}}}function Aj(e){let t;try{t=JSON.parse(e)}catch{return null}let n=Oj.safeParse(t);return n.success?n.data:null}function jj(e,t,n){return{...e,skills:{...e.skills,[t]:n}}}const Mj=new Set(Object.values(gj));function Nj(e){if(typeof e!=`object`||!e)return;let t=e.metadata;if(typeof t!=`object`||!t)return;let n=t.pack;return typeof n==`string`&&n.trim().length>0?n.trim():void 0}function Pj(e,t,n,r){return e.startsWith(`open-knowledge-pack-`)?Fj(e,t,n):!Mj.has(e)||r?.selfIdentifiesAsPack!==!0?null:Fj(e,t,n)}function Fj(e,t,n){return{source:_j,skill:e,contentHash:t,importedAt:n}}function Ij(e,t){for(let[n,r]of Object.entries(e.skills))if(r.contentHash===t)return n;return null}const Lj=16777216,Rj=67108864;function zj(e,t){let n=new Map;for(let r of e){let e=r.provenance.plugin,i=r.provenance.marketplace;if(!e||!i||n.has(r.name))continue;let a=t(r.home);a&&n.set(r.name,{source:`${e}@${i}`,plugin:e,marketplace:i,provider:r.sourceHarness,contentHash:a,...r.provenance.version===void 0?{}:{version:r.provenance.version},...r.provenance.repositoryUrl===void 0?{}:{repositoryUrl:r.provenance.repositoryUrl},home:r.home})}return n}const Bj=Object.freeze([{value:`workflow-fit`,label:`It didn't fit into my workflow`},{value:`missing-feature`,label:`It was missing a feature I needed`},{value:`hard-to-start`,label:`It was too hard to set up or get started`},{value:`unreliable`,label:`Bugs, crashes, or it felt unreliable`},{value:`switched-tool`,label:`I'm switching to another tool`},{value:`one-off`,label:`It was a trial or one-off project`},{value:`other`,label:`Something else`}]);new Set(Bj.map(e=>e.value));function Vj(e){this.content=e}Vj.prototype={constructor:Vj,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),a=r.content.slice();return i==-1?a.push(n||e,t):(a[i+1]=t,n&&(a[i]=n)),new Vj(a)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new Vj(n)},addToStart:function(e,t){return new Vj([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new Vj(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),a=r.find(e);return i.splice(a==-1?i.length:a,0,t,n),new Vj(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=Vj.from(e),e.size?new Vj(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=Vj.from(e),e.size?new Vj(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=Vj.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},Vj.from=function(e){if(e instanceof Vj)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new Vj(t)};function Hj(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a){n+=i.nodeSize;continue}if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){for(let e=0;i.text[e]==a.text[e];e++)n++;return n}if(i.content.size||a.content.size){let e=Hj(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}function Uj(e,t,n,r){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let o=e.child(--i),s=t.child(--a),c=o.nodeSize;if(o==s){n-=c,r-=c;continue}if(!o.sameMarkup(s))return{a:n,b:r};if(o.isText&&o.text!=s.text){let e=0,t=Math.min(o.text.length,s.text.length);for(;e<t&&o.text[o.text.length-e-1]==s.text[s.text.length-e-1];)e++,n--,r--;return{a:n,b:r}}if(o.content.size||s.content.size){let e=Uj(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}var U=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let a=0,o=0;o<t;a++){let s=this.content[a],c=o+s.nodeSize;if(c>e&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new e(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let e=0,a=0;a<n;e++){let o=this.content[e],s=a+o.nodeSize;s>t&&((a<t||s>n)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw RangeError(`Index `+e+` out of range for `+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return Hj(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return Uj(this,e,t,n)}findIndex(e){if(e==0)return Gj(0,e);if(e==this.size)return Gj(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=this.child(t),i=n+r.nodeSize;if(i>=e)return i==e?Gj(t+1,i):Gj(t,n);n=i}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return new e(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;e<t.length;e++){let i=t[e];r+=i.nodeSize,e&&i.isText&&t[e-1].sameMarkup(i)?(n||=t.slice(0,e),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw RangeError(`Can not convert `+t+` to a Fragment`+(t.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}};U.empty=new U([],0);const Wj={index:0,offset:0};function Gj(e,t){return Wj.index=e,Wj.offset=t,Wj}function Kj(e,t){if(e===t)return!0;if(!(e&&typeof e==`object`)||!(t&&typeof t==`object`))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!Kj(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!Kj(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var qj=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||=e.slice(0,r);else if(i.type.excludes(this.type))return e;else!n&&i.type.rank>this.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Kj(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Mark.fromJSON`);let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}};qj.none=[];var Jj=class extends Error{},W=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=Xj(this.content,t+this.openStart,n);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(Yj(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+`(`+this.openStart+`,`+this.openEnd+`)`}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(U.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}};W.empty=new W(U.empty,0,0);function Yj(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(Yj(a.content,t-i-1,n-i-1)))}function Xj(e,t,n,r){let{index:i,offset:a}=e.findIndex(t),o=e.maybeChild(i);if(a==t||o.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let s=Xj(o.content,t-a-1,n,o);return s&&e.replaceChild(i,o.copy(s))}function Zj(e,t,n){if(n.openStart>e.depth)throw new Jj(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new Jj(`Inconsistent open depths`);return Qj(e,t,n,0)}function Qj(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=Qj(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}if(!n.content.size)return rM(a,aM(e,t,r));if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return rM(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}{let{start:i,end:o}=oM(n,e);return rM(a,iM(e,i,o,t,r))}}function $j(e,t){if(!t.type.compatibleContent(e.type))throw new Jj(`Cannot join `+t.type.name+` onto `+e.type.name)}function eM(e,t,n){let r=e.node(n);return $j(r,t.node(n)),r}function tM(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function nM(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(tM(e.nodeAfter,r),a++));for(let e=a;e<o;e++)tM(i.child(e),r);t&&t.depth==n&&t.textOffset&&tM(t.nodeBefore,r)}function rM(e,t){return e.type.checkContent(t),e.copy(t)}function iM(e,t,n,r,i){let a=e.depth>i&&eM(e,t,i+1),o=r.depth>i&&eM(n,r,i+1),s=[];return nM(null,e,i,s),a&&o&&t.index(i)==n.index(i)?($j(a,o),tM(rM(a,iM(e,t,n,r,i+1)),s)):(a&&tM(rM(a,aM(e,t,i+1)),s),nM(t,n,i,s),o&&tM(rM(o,aM(n,r,i+1)),s)),nM(r,null,i,s),new U(s)}function aM(e,t,n){let r=[];return nM(null,e,n,r),e.depth>n&&tM(rM(eM(e,t,n+1),aM(e,t,n+1)),r),nM(t,null,n,r),new U(r)}function oM(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(U.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}var sM=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position before the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position after the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return qj.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive===!1&&(!r||!i[a].isInSet(r.marks))&&(i=i[a--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive===!1&&(!r||!n[i].isInSet(r.marks))&&(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new dM(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e=``;for(let t=1;t<=this.depth;t++)e+=(e?`/`:``)+this.node(t).type.name+`_`+this.index(t-1);return e+`:`+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=uM.get(t);if(r)for(let e=0;e<r.elts.length;e++){let t=r.elts[e];if(t.pos==n)return t}else uM.set(t,r=new cM);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%lM,i}},cM=class{constructor(){this.elts=[],this.i=0}};const lM=12,uM=new WeakMap;var dM=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}};const fM=Object.create(null);var pM=class e{constructor(e,t,n,r=qj.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||U.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,``)}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&Kj(this.attrs,t||e.defaultAttrs||fM)&&qj.sameSet(this.marks,n||qj.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return W.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new W(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return Zj(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return sM.resolveCached(this,e)}resolveNoCache(e){return sM.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+=`(`+this.content.toStringInner()+`)`),hM(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=U.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),a=i&&i.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=qj.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!qj.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=U.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,r,n);return i.type.checkAttrs(i.attrs),i}};pM.prototype.text=void 0;var mM=class e extends pM{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError(`Empty text nodes are not allowed`);this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):hM(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function hM(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}var gM=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new _M(t,n);if(r.next==null)return e.empty;let i=vM(r);r.next&&r.err(`Unexpected trailing text`);let a=OM(TM(i));return kM(a,r),a}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];function i(a,o){let s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return U.from(o.map(e=>e.createAndFill()));for(let e=0;e<a.next.length;e++){let{type:t,next:n}=a.next[e];if(!(t.isText||t.hasRequiredAttrs())&&r.indexOf(n)==-1){r.push(n);let e=i(n,o.concat(t));if(e)return e}}return null}return i(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:a,next:o}=i.next[e];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!r.type||o.validEnd)&&(n.push({match:a.contentMatch,type:a,via:r}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&t(n.next[r].next)}return t(this),e.map((t,n)=>{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n<t.next.length;n++)r+=(n?`, `:``)+t.next[n].type.name+`->`+e.indexOf(t.next[n].next);return r}).join(`
|
|
214
|
+
`)}};gM.empty=new gM(!0);var _M=class{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==``&&this.tokens.pop(),this.tokens[0]==``&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw SyntaxError(e+` (in content expression '`+this.string+`')`)}};function vM(e){let t=[];do t.push(yM(e));while(e.eat(`|`));return t.length==1?t[0]:{type:`choice`,exprs:t}}function yM(e){let t=[];do t.push(bM(e));while(e.next&&e.next!=`)`&&e.next!=`|`);return t.length==1?t[0]:{type:`seq`,exprs:t}}function bM(e){let t=wM(e);for(;;)if(e.eat(`+`))t={type:`plus`,expr:t};else if(e.eat(`*`))t={type:`star`,expr:t};else if(e.eat(`?`))t={type:`opt`,expr:t};else if(e.eat(`{`))t=SM(e,t);else break;return t}function xM(e){/\D/.test(e.next)&&e.err(`Expected number, got '`+e.next+`'`);let t=Number(e.next);return e.pos++,t}function SM(e,t){let n=xM(e),r=n;return e.eat(`,`)&&(r=e.next==`}`?-1:xM(e)),e.eat(`}`)||e.err(`Unclosed braced range`),{type:`range`,min:n,max:r,expr:t}}function CM(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.isInGroup(t)&&i.push(r)}return i.length==0&&e.err(`No node type or group '`+t+`' found`),i}function wM(e){if(e.eat(`(`)){let t=vM(e);return e.eat(`)`)||e.err(`Missing closing paren`),t}if(/\W/.test(e.next))e.err(`Unexpected token '`+e.next+`'`);else{let t=CM(e,e.next).map(t=>(e.inline==null?e.inline=t.isInline:e.inline!=t.isInline&&e.err(`Mixing inline and block content`),{type:`name`,value:t}));return e.pos++,t.length==1?t[0]:{type:`choice`,exprs:t}}}function TM(e){let t=[[]];return i(a(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach(e=>e.to=t)}function a(e,t){if(e.type==`choice`)return e.exprs.reduce((e,n)=>e.concat(a(n,t)),[]);if(e.type==`seq`)for(let r=0;;r++){let o=a(e.exprs[r],t);if(r==e.exprs.length-1)return o;i(o,t=n())}else if(e.type==`star`){let o=n();return r(t,o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`plus`){let o=n();return i(a(e.expr,t),o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`opt`)return[r(t)].concat(a(e.expr,t));else if(e.type==`range`){let o=t;for(let t=0;t<e.min;t++){let t=n();i(a(e.expr,o),t),o=t}if(e.max==-1)i(a(e.expr,o),o);else for(let t=e.min;t<e.max;t++){let t=n();r(o,t),i(a(e.expr,o),t),o=t}return[r(o)]}else if(e.type==`name`)return[r(t,void 0,e.value)];else throw Error(`Unknown expr type`)}}function EM(e,t){return t-e}function DM(e,t){let n=[];return r(t),n.sort(EM);function r(t){let i=e[t];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(t);for(let e=0;e<i.length;e++){let{term:t,to:a}=i[e];!t&&n.indexOf(a)==-1&&r(a)}}}function OM(e){let t=Object.create(null);return n(DM(e,0));function n(r){let i=[];r.forEach(t=>{e[t].forEach(({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);DM(e,n).forEach(e=>{r||i.push([t,r=[]]),r.indexOf(e)==-1&&r.push(e)})})});let a=t[r.join(`,`)]=new gM(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(EM);a.next.push({type:i[e][0],next:t[r.join(`,`)]||n(r)})}return a}}function kM(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,a=[];for(let t=0;t<e.next.length;t++){let{type:n,next:o}=e.next[t];a.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),r.indexOf(o)==-1&&r.push(o)}i&&t.err(`Only non-generatable nodes (`+a.join(`, `)+`) in a required position (see https://prosemirror.net/docs/guide/#generatable)`)}}function AM(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function jM(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(i===void 0){let t=e[r];if(t.hasDefault)i=t.default;else throw RangeError(`No value supplied for attribute `+r)}n[r]=i}return n}function MM(e,t,n,r){for(let r in t)if(!(r in e))throw RangeError(`Unsupported attribute ${r} for ${n} of type ${r}`);for(let n in e){let r=e[n];r.validate&&r.validate(t[n])}}function NM(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new IM(e,r,t[r]);return n}var PM=class e{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(` `):[],this.attrs=NM(e,n.attrs),this.defaultAttrs=AM(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e==`text`),this.isText=e==`text`}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==gM.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?`pre`:`normal`)}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:jM(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error(`NodeType.create can't construct text nodes`);return new pM(this,this.computeAttrs(e),U.from(t),qj.setFrom(n))}createChecked(e=null,t,n){return t=U.from(t),this.checkContent(t),new pM(this,this.computeAttrs(e),t,qj.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),t=U.from(t),t.size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(U.empty,!0);return i?new pM(this,e,t.append(i),qj.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){MM(this.attrs,e,`node`,this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||=e.slice(0,n);return t?t.length?t:qj.none:e}static compile(t,n){let r=Object.create(null);t.forEach((t,i)=>r[t]=new e(t,n,i));let i=n.spec.topNode||`doc`;if(!r[i])throw RangeError(`Schema is missing its top node type ('`+i+`')`);if(!r.text)throw RangeError(`Every schema needs a 'text' type`);for(let e in r.text.attrs)throw RangeError(`The text node type should not have attributes`);return r}};function FM(e,t,n){let r=n.split(`|`);return n=>{let i=n===null?`null`:typeof n;if(r.indexOf(i)<0)throw RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`)}}var IM=class{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,`default`),this.default=n.default,this.validate=typeof n.validate==`string`?FM(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}},LM=class e{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=NM(e,r.attrs),this.excluded=null;let i=AM(this.attrs);this.instance=i?new qj(this,i):null}create(e=null){return!e&&this.instance?this.instance:new qj(this,jM(this.attrs,e))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((t,a)=>r[t]=new e(t,i++,n,a)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){MM(this.attrs,e,`mark`,this.name)}excludes(e){return this.excluded.indexOf(e)>-1}},RM=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=Vj.from(e.nodes),t.marks=Vj.from(e.marks||{}),this.nodes=PM.compile(this.spec.nodes,this),this.marks=LM.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw RangeError(e+` can not be both a node and a mark`);let t=this.nodes[e],r=t.spec.content||``,i=t.spec.marks;if(t.contentMatch=n[r]||(n[r]=gM.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError(`Multiple linebreak nodes defined`);if(!t.isInline||!t.isLeaf)throw RangeError(`Linebreak replacement nodes must be inline leaf nodes`);this.linebreakReplacement=t}t.markSet=i==`_`?null:i?zM(this,i.split(` `)):i==``||!t.inlineContent?[]:null}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=n==null?[t]:n==``?[]:zM(this,n.split(` `))}this.nodeFromJSON=e=>pM.fromJSON(this,e),this.markFromJSON=e=>qj.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||`doc`],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if(typeof e==`string`)e=this.nodeType(e);else if(!(e instanceof PM))throw RangeError(`Invalid node type: `+e);else if(e.schema!=this)throw RangeError(`Node type from different schema used (`+e.name+`)`);return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new mM(n,n.defaultAttrs,e,qj.setFrom(t))}mark(e,t){return typeof e==`string`&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw RangeError(`Unknown node type: `+e);return t}};function zM(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],a=e.marks[i],o=a;if(a)n.push(a);else for(let t in e.marks){let r=e.marks[t];(i==`_`||r.spec.group&&r.spec.group.split(` `).indexOf(i)>-1)&&n.push(o=r)}if(!o)throw SyntaxError(`Unknown mark type: '`+t[r]+`'`)}return n}function BM(e){return e.tag!=null}function VM(e){return e.style!=null}var HM=class e{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(BM(e))this.tags.push(e);else if(VM(e)){let t=/[^=]*/.exec(e.style)[0];n.indexOf(t)<0&&n.push(t),this.styles.push(e)}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)})}parse(e,t={}){let n=new JM(this,t,!1);return n.addAll(e,qj.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new JM(this,t,!0);return n.addAll(e,qj.none,t.from,t.to),W.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(XM(e,n.tag)&&(n.namespace===void 0||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(t===!1)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],a=r.style;if(!(a.indexOf(e)!=0||r.context&&!n.matchesContext(r.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(e===!1)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=e.priority==null?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((e.priority==null?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach(e=>{n(e=ZM(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)})}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach(e=>{n(e=ZM(e)),e.node||e.ignore||e.mark||(e.node=t)})}return t}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new e(t,e.schemaRules(t)))}};const UM={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},WM={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},GM={ol:!0,ul:!0};function KM(e,t,n){return t==null?e&&e.whitespace==`pre`?3:n&-5:!!t|(t===`full`?2:0)}var qM=class{constructor(e,t,n,r,i,a){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=a,this.content=[],this.activeMarks=qj.none,this.match=i||(a&4?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(U.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let t=this.type.contentMatch,n;return(n=t.findWrapping(e.type))?(this.match=t,n):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&1)){let e=this.content[this.content.length-1],t;if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let t=U.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(U.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!UM.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},JM=class{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=t.topNode,i,a=KM(null,t.preserveWhitespace,0)|(n?4:0);i=r?new qM(r.type,r.attrs,qj.none,!0,t.topMatch||r.type.contentMatch,a):n?new qM(null,null,qj.none,!0,null,a):new qM(e.schema.topNodeType,null,qj.none,!0,null,a),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top,i=r.options&2?`full`:this.localPreserveWS||(r.options&1)>0,{schema:a}=this.parser;if(i===`full`||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(!i){if(n=n.replace(/[ \t\r\n\u000c]+/g,` `),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],i=e.previousSibling;(!t||i&&i.nodeName==`BR`||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}}else if(i===`full`)n=n.replace(/\r\n?/g,`
|
|
215
|
+
`);else if(a.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(a.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n<e.length;n++)n&&this.insertNode(a.linebreakReplacement.create(),t,!0),e[n]&&this.insertNode(a.text(e[n]),t,!/\S/.test(e[n]));n=``}else n=n.replace(/\r?\n|\r/g,` `);n&&this.insertNode(a.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r=this.localPreserveWS,i=this.top;(e.tagName==`PRE`||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a=e.nodeName.toLowerCase(),o;GM.hasOwnProperty(a)&&this.parser.normalizeLists&&YM(e);let s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,n));out:if(s?s.ignore:WM.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e,t);else if(!s||s.skip||s.closeParent){s&&s.closeParent?this.open=Math.max(0,this.open-1):s&&s.skip.nodeType&&(e=s.skip);let n,r=this.needsBlock;if(UM.hasOwnProperty(a))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),n=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break out}let o=s&&s.skip?t:this.readStyles(e,t);o&&this.addAll(e,o),n&&this.sync(i),this.needsBlock=r}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,s,n,s.consuming===!1?o:void 0)}this.localPreserveWS=r}leafFallback(e,t){e.nodeName==`BR`&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
216
|
+
`),t)}ignoreFallback(e,t){e.nodeName==`BR`&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text(`-`),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let e=0;e<this.parser.matchedStyles.length;e++){let r=this.parser.matchedStyles[e],i=n.getPropertyValue(r);if(i)for(let e;;){let n=this.parser.matchStyle(r,i,this,e);if(!n)break;if(n.ignore)return null;if(t=n.clearMark?t.filter(e=>!n.clearMark(e)):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),n.consuming===!1)e=n;else break}}return t}addElementByRule(e,t,n,r){let i,a;if(t.node){if(a=this.parser.schema.nodes[t.node],a.isLeaf)this.insertNode(a.create(t.attrs),n,e.nodeName==`BR`)||this.leafFallback(e,n);else{let e=this.enter(a,t.attrs||null,n,t.preserveWhitespace);e&&(i=!0,n=e)}}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let o=this.top;if(a&&a.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n,!1));else{let r=e;typeof t.contentElement==`string`?r=e.querySelector(t.contentElement):typeof t.contentElement==`function`?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}i&&this.sync(o)&&this.open--}addAll(e,t,n,r){let i=n||0;for(let a=n?e.childNodes[n]:e.firstChild,o=r==null?null:e.childNodes[r];a!=o;a=a.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(a,t);this.findAtPoint(e,i)}findPlace(e,t,n){let r,i;for(let t=this.open,a=0;t>=0;t--){let o=this.nodes[t],s=o.findWrapping(e);if(s&&(!r||r.length>s.length+a)&&(r=s,i=o,!s.length))break;if(o.solid){if(n)break;a+=2}}if(!r)return null;this.sync(i);for(let e=0;e<r.length;e++)t=this.enterInner(r[e],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let r=this.findPlace(e,t,n);if(r){this.closeExtra();let t=this.top;t.match&&=t.match.matchType(e.type);let n=qj.none;for(let i of r.concat(e.marks))(t.type?t.type.allowsMarkType(i.type):QM(i.type,e.type))&&(n=i.addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n,r){let i=this.findPlace(e.create(t),n,!1);return i&&=this.enterInner(e,t,n,!0,r),i}enterInner(e,t,n,r=!1,i){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(e);let o=KM(e,i,a.options);a.options&4&&a.content.length==0&&(o|=4);let s=qj.none;return n=n.filter(t=>!(a.type?a.type.allowsMarkType(t.type):QM(t.type,e))||(s=t.addToSet(s),!1)),this.nodes.push(new qM(e,t,s,r,null,o)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;else this.localPreserveWS&&(this.nodes[t].options|=1);return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&e.nodeType==1&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf(`|`)>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split(`/`),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+ +!r,a=(e,o)=>{for(;e>=0;e--){let s=t[e];if(s==``){if(e==t.length-1||e==0)continue;for(;o>=i;o--)if(a(e-1,o))return!0;return!1}{let e=o>0||o==0&&r?this.nodes[o].type:n&&o>=i?n.node(o-i).type:null;if(!e||e.name!=s&&!e.isInGroup(s))return!1;o--}}return!0};return a(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}};function YM(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=t.nodeType==1?t.nodeName.toLowerCase():null;e&&GM.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):e==`li`?n=t:e&&(n=null)}}function XM(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function ZM(e){let t={};for(let n in e)t[n]=e[n];return t}function QM(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let a=[],o=e=>{a.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t||a.indexOf(i)<0&&o(i))return!0}};if(o(i.contentMatch))return!0}}var $M=class e{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||=tN(t).createDocumentFragment();let r=n,i=[];return e.forEach(e=>{if(i.length||e.marks.length){let n=0,a=0;for(;n<i.length&&a<e.marks.length;){let t=e.marks[a];if(!this.marks[t.type.name]){a++;continue}if(!t.eq(i[n][0])||t.type.spec.spanning===!1)break;n++,a++}for(;n<i.length;)r=i.pop()[1];for(;a<e.marks.length;){let n=e.marks[a++],o=this.serializeMark(n,e.isInline,t);o&&(i.push([n,r]),r.appendChild(o.dom),r=o.contentDOM||o.dom)}}r.appendChild(this.serializeNodeInner(e,t))}),n}serializeNodeInner(e,t){let{dom:n,contentDOM:r}=aN(tN(t),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw RangeError(`Content hole not allowed in a leaf node spec`);this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&aN(tN(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return aN(e,t,n,r)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new e(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(e){let t=eN(e.nodes);return t.text||=e=>e.text,t}static marksFromSchema(e){return eN(e.marks)}};function eN(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function tN(e){return e.document||window.document}const nN=new WeakMap;function rN(e){let t=nN.get(e);return t===void 0&&nN.set(e,t=iN(e)),t}function iN(e){let t=null;function n(e){if(e&&typeof e==`object`){if(Array.isArray(e)){if(typeof e[0]==`string`)t||=[],t.push(e);else for(let t=0;t<e.length;t++)n(e[t])}else for(let t in e)n(e[t])}}return n(e),t}function aN(e,t,n,r){if(typeof t==`string`)return{dom:e.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let i=t[0],a;if(typeof i!=`string`)throw RangeError(`Invalid array passed to renderSpec`);if(r&&(a=rN(r))&&a.indexOf(t)>-1)throw RangeError(`Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.`);let o=i.indexOf(` `);o>0&&(n=i.slice(0,o),i=i.slice(o+1));let s,c=n?e.createElementNS(n,i):e.createElement(i),l=t[1],u=1;if(l&&typeof l==`object`&&l.nodeType==null&&!Array.isArray(l)){u=2;for(let e in l)if(l[e]!=null){let t=e.indexOf(` `);t>0?c.setAttributeNS(e.slice(0,t),e.slice(t+1),l[e]):e==`style`&&c.style?c.style.cssText=l[e]:c.setAttribute(e,l[e])}}for(let i=u;i<t.length;i++){let a=t[i];if(a===0){if(i<t.length-1||i>u)throw RangeError(`Content hole must be the only child of its parent node`);return{dom:c,contentDOM:c}}{let{dom:t,contentDOM:i}=aN(e,a,n,r);if(c.appendChild(t),i){if(s)throw RangeError(`Multiple content holes`);s=i}}}return{dom:c,contentDOM:s}}const oN=65535,sN=2**16;function cN(e,t){return e+t*sN}function lN(e){return e&oN}function uN(e){return(e-(e&oN))/sN}var dN=class{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&8)>0}get deletedBefore(){return(this.delInfo&5)>0}get deletedAfter(){return(this.delInfo&6)>0}get deletedAcross(){return(this.delInfo&4)>0}},fN=class e{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}recover(e){let t=0,n=lN(e);if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[e*3+2]-this.ranges[e*3+1];return this.ranges[n*3]+t+uN(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,a=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let s=this.ranges[o]-(this.inverted?r:0);if(s>e)break;let c=this.ranges[o+i],l=this.ranges[o+a],u=s+c;if(e<=u){let i=c?e==s?-1:e==u?1:t:t,a=s+r+(i<0?0:l);if(n)return a;let d=e==(t<0?s:u)?null:cN(o/3,e-s),f=e==s?2:e==u?1:4;return(t<0?e!=s:e!=u)&&(f|=8),new dN(a,f,d)}r+=l-c}return n?e+r:new dN(e+r,0,null)}touches(e,t){let n=0,r=lN(t),i=this.inverted?2:1,a=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let o=this.ranges[t]-(this.inverted?n:0);if(o>e)break;let s=this.ranges[t+i];if(e<=o+s&&t==r*3)return!0;n+=this.ranges[t+a]-s}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let a=this.ranges[r],o=a-(this.inverted?i:0),s=a+(this.inverted?0:i),c=this.ranges[r+t],l=this.ranges[r+n];e(o,o+c,s,s+l),i+=l-c}}invert(){return new e(this.ranges,!this.inverted)}toString(){return(this.inverted?`-`:``)+JSON.stringify(this.ranges)}static offset(t){return t==0?e.empty:new e(t<0?[0,-t,0]:[0,0,t])}};fN.empty=new fN([]);var pN=class e{constructor(e,t,n=0,r=e?e.length:0){this.mirror=t,this.from=n,this.to=r,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(t=0,n=this.maps.length){return new e(this._maps,this.mirror,t,n)}appendMap(e,t){this.ownData||=(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let r=e.getMirror(t);this.appendMap(e._maps[t],r!=null&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||=[],this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e._maps[t].invert(),r!=null&&r>t?n-r-1:void 0)}}invert(){let t=new e;return t.appendMappingInverted(this),t}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let n=this.from;n<this.to;n++){let i=this._maps[n].mapResult(e,t);if(i.recover!=null){let t=this.getMirror(n);if(t!=null&&t>n&&t<this.to){n=t,e=this._maps[t].recover(i.recover);continue}}r|=i.delInfo,e=i.pos}return n?e:new dN(e,r,null)}};const mN=Object.create(null);var hN=class{getMap(){return fN.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError(`Invalid input for Step.fromJSON`);let n=mN[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in mN)throw RangeError(`Duplicate use of step JSON ID `+e);return mN[e]=t,t.prototype.jsonID=e,t}},gN=class e{constructor(e,t){this.doc=e,this.failed=t}static ok(t){return new e(t,null)}static fail(t){return new e(null,t)}static fromReplace(t,n,r,i){try{return e.ok(t.replace(n,r,i))}catch(t){if(t instanceof Jj)return e.fail(t.message);throw t}}};function _N(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let a=e.child(i);a.content.size&&(a=a.copy(_N(a.content,t,a))),a.isInline&&(a=t(a,n,i)),r.push(a)}return U.fromArray(r)}var vN=class e extends hN{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new W(_N(t.content,(e,t)=>!e.isAtom||!t.type.allowsMarkType(this.mark.type)?e:e.mark(this.mark.addToSet(e.marks)),r),t.openStart,t.openEnd);return gN.fromReplace(e,this.from,this.to,i)}invert(){return new yN(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`addMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for AddMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};hN.jsonID(`addMark`,vN);var yN=class e extends hN{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new W(_N(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return gN.fromReplace(e,this.from,this.to,n)}invert(){return new vN(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`removeMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for RemoveMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};hN.jsonID(`removeMark`,yN);var bN=class e extends hN{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return gN.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return gN.fromReplace(e,this.pos,this.pos+1,new W(U.from(n),0,+!t.isLeaf))}invert(t){let n=t.nodeAt(this.pos);if(n){let t=this.mark.addToSet(n.marks);if(t.length==n.marks.length){for(let r=0;r<n.marks.length;r++)if(!n.marks[r].isInSet(t))return new e(this.pos,n.marks[r]);return new e(this.pos,this.mark)}}return new xN(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`addNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for AddNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};hN.jsonID(`addNodeMark`,bN);var xN=class e extends hN{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return gN.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return gN.fromReplace(e,this.pos,this.pos+1,new W(U.from(n),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new bN(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`removeNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for RemoveNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};hN.jsonID(`removeNodeMark`,xN);var SN=class e extends hN{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&wN(e,this.from,this.to)?gN.fail(`Structure replace would overwrite content`):gN.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new fN([this.from,this.to-this.from,this.slice.size])}invert(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.to,-1),r=this.from==this.to&&e.MAP_BIAS<0?n:t.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new e(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(t){if(!(t instanceof e)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?W.empty:new W(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(this.from,this.to+(t.to-t.from),n,this.structure)}if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?W.empty:new W(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,this.structure)}return null}toJSON(){let e={stepType:`replace`,from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for ReplaceStep.fromJSON`);return new e(n.from,n.to,W.fromJSON(t,n.slice),!!n.structure)}};SN.MAP_BIAS=1,hN.jsonID(`replace`,SN);var CN=class e extends hN{constructor(e,t,n,r,i,a,o=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=a,this.structure=o}apply(e){if(this.structure&&(wN(e,this.from,this.gapFrom)||wN(e,this.gapTo,this.to)))return gN.fail(`Structure gap-replace would overwrite content`);let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return gN.fail(`Gap is not a flat range`);let n=this.slice.insertAt(this.insert,t.content);return n?gN.fromReplace(e,this.from,this.to,n):gN.fail(`Content does not fit in gap`)}getMap(){return new fN([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),a=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||a>r.pos?null:new e(n.pos,r.pos,i,a,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:`replaceAround`,from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`||typeof n.gapFrom!=`number`||typeof n.gapTo!=`number`||typeof n.insert!=`number`)throw RangeError(`Invalid input for ReplaceAroundStep.fromJSON`);return new e(n.from,n.to,n.gapFrom,n.gapTo,W.fromJSON(t,n.slice),n.insert,!!n.structure)}};hN.jsonID(`replaceAround`,CN);function wN(e,t,n){let r=e.resolve(t),i=n-t,a=r.depth;for(;i>0&&a>0&&r.indexAfter(a)==r.node(a).childCount;)a--,i--;if(i>0){let e=r.node(a).maybeChild(r.indexAfter(a));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function TN(e,t,n,r){let i=[],a=[],o,s;e.doc.nodesBetween(t,n,(e,c,l)=>{if(!e.isInline)return;let u=e.marks;if(!r.isInSet(u)&&l.type.allowsMarkType(r.type)){let l=Math.max(c,t),d=Math.min(c+e.nodeSize,n),f=r.addToSet(u);for(let e=0;e<u.length;e++)u[e].isInSet(f)||(o&&o.to==l&&o.mark.eq(u[e])?o.to=d:i.push(o=new yN(l,d,u[e])));s&&s.to==l?s.to=d:a.push(s=new vN(l,d,r))}}),i.forEach(t=>e.step(t)),a.forEach(t=>e.step(t))}function EN(e,t,n,r){let i=[],a=0;e.doc.nodesBetween(t,n,(e,o)=>{if(!e.isInline)return;a++;let s=null;if(r instanceof LM){let t=e.marks,n;for(;n=r.isInSet(t);)(s||=[]).push(n),t=n.removeFromSet(t)}else r?r.isInSet(e.marks)&&(s=[r]):s=e.marks;if(s&&s.length){let r=Math.min(o+e.nodeSize,n);for(let e=0;e<s.length;e++){let n=s[e],c;for(let e=0;e<i.length;e++){let t=i[e];t.step==a-1&&n.eq(i[e].style)&&(c=t)}c?(c.to=r,c.step=a):i.push({style:n,from:Math.max(o,t),to:r,step:a})}}}),i.forEach(t=>e.step(new yN(t.from,t.to,t.style)))}function DN(e,t,n,r=n.contentMatch,i=!0){let a=e.doc.nodeAt(t),o=[],s=t+1;for(let t=0;t<a.childCount;t++){let c=a.child(t),l=s+c.nodeSize,u=r.matchType(c.type);if(!u)o.push(new SN(s,l,W.empty));else{r=u;for(let t=0;t<c.marks.length;t++)n.allowsMarkType(c.marks[t].type)||e.step(new yN(s,l,c.marks[t]));if(i&&c.isText&&n.whitespace!=`pre`){let e,t=/\r?\n|\r/g,r;for(;e=t.exec(c.text);)r||=new W(U.from(n.schema.text(` `,n.allowedMarks(c.marks))),0,0),o.push(new SN(s+e.index,s+e.index+e[0].length,r))}}s=l}if(!r.validEnd){let t=r.fillBefore(U.empty,!0);e.replace(s,s,new W(t,0,0))}for(let t=o.length-1;t>=0;t--)e.step(o[t])}function ON(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function kN(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,r=0,i=0;;--n){let a=e.$from.node(n),o=e.$from.index(n)+r,s=e.$to.indexAfter(n)-i;if(n<e.depth&&a.canReplace(o,s,t))return n;if(n==0||a.type.spec.isolating||!ON(a,o,s))break;o&&(r=1),s<a.childCount&&(i=1)}return null}function AN(e,t,n){let{$from:r,$to:i,depth:a}=t,o=r.before(a+1),s=i.after(a+1),c=o,l=s,u=U.empty,d=0;for(let e=a,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,u=U.from(r.node(e).copy(u)),d++):c--;let f=U.empty,p=0;for(let e=a,t=!1;e>n;e--)t||i.after(e+1)<i.end(e)?(t=!0,f=U.from(i.node(e).copy(f)),p++):l++;e.step(new CN(c,l,o,s,new W(u.append(f),d,p),u.size-d,!0))}function jN(e,t,n=null,r=e){let i=NN(e,t),a=i&&PN(r,t);return a?i.map(MN).concat({type:t,attrs:n}).concat(a.map(MN)):null}function MN(e){return{type:e,attrs:null}}function NN(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.contentMatchAt(r).findWrapping(t);if(!a)return null;let o=a.length?a[0]:t;return n.canReplaceWith(r,i,o)?a:null}function PN(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.child(r),o=t.contentMatch.findWrapping(a.type);if(!o)return null;let s=(o.length?o[o.length-1]:t).contentMatch;for(let e=r;s&&e<i;e++)s=s.matchType(n.child(e).type);return!s||!s.validEnd?null:o}function FN(e,t,n){let r=U.empty;for(let e=n.length-1;e>=0;e--){if(r.size){let t=n[e].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw RangeError(`Wrapper type given to Transform.wrap does not form valid content of its parent wrapper`)}r=U.from(n[e].type.create(n[e].attrs,r))}let i=t.start,a=t.end;e.step(new CN(i,a,i,a,new W(r,0,0),n.length,!0))}function IN(e,t,n,r,i){if(!r.isTextblock)throw RangeError(`Type given to setBlockType should be a textblock`);let a=e.steps.length;e.doc.nodesBetween(t,n,(t,n)=>{let o=typeof i==`function`?i(t):i;if(t.isTextblock&&!t.hasMarkup(r,o)&&zN(e.doc,e.mapping.slice(a).map(n),r)){let i=null;if(r.schema.linebreakReplacement){let e=r.whitespace==`pre`,t=!!r.contentMatch.matchType(r.schema.linebreakReplacement);e&&!t?i=!1:!e&&t&&(i=!0)}i===!1&&RN(e,t,n,a),DN(e,e.mapping.slice(a).map(n,1),r,void 0,i===null);let s=e.mapping.slice(a),c=s.map(n,1),l=s.map(n+t.nodeSize,1);return e.step(new CN(c,l,c+1,l-1,new W(U.from(r.create(o,null,t.marks)),0,0),1,!0)),i===!0&&LN(e,t,n,a),!1}})}function LN(e,t,n,r){t.forEach((i,a)=>{if(i.isText){let o,s=/\r?\n|\r/g;for(;o=s.exec(i.text);){let i=e.mapping.slice(r).map(n+1+a+o.index);e.replaceWith(i,i+1,t.type.schema.linebreakReplacement.create())}}})}function RN(e,t,n,r){t.forEach((i,a)=>{if(i.type==i.type.schema.linebreakReplacement){let i=e.mapping.slice(r).map(n+1+a);e.replaceWith(i,i+1,t.type.schema.text(`
|
|
217
|
+
`))}})}function zN(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function BN(e,t,n,r,i){let a=e.doc.nodeAt(t);if(!a)throw RangeError(`No node at given position`);n||=a.type;let o=n.create(r,null,i||a.marks);if(a.isLeaf)return e.replaceWith(t,t+a.nodeSize,o);if(!n.validContent(a.content))throw RangeError(`Invalid content for node type `+n.name);e.step(new CN(t,t+a.nodeSize,t+1,t+a.nodeSize-1,new W(U.from(o),0,0),1,!0))}function VN(e,t,n=1,r){let i=e.resolve(t),a=i.depth-n,o=r&&r[r.length-1]||i.parent;if(a<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let e=i.depth-1,t=n-2;e>a;e--,t--){let n=i.node(e),a=i.index(e);if(n.type.spec.isolating)return!1;let o=n.content.cutByIndex(a,n.childCount),s=r&&r[t+1];s&&(o=o.replaceChild(0,s.type.create(s.attrs)));let c=r&&r[t]||n;if(!n.canReplace(a+1,n.childCount)||!c.type.validContent(o))return!1}let s=i.indexAfter(a),c=r&&r[0];return i.node(a).canReplaceWith(s,s,c?c.type:i.node(a+1).type)}function HN(e,t,n=1,r){let i=e.doc.resolve(t),a=U.empty,o=U.empty;for(let e=i.depth,t=i.depth-n,s=n-1;e>t;e--,s--){a=U.from(i.node(e).copy(a));let t=r&&r[s];o=U.from(t?t.type.create(t.attrs,o):i.node(e).copy(o))}e.step(new SN(t,t,new W(a.append(o),n,n),!0))}function UN(e,t){let n=e.resolve(t),r=n.index();return GN(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function WN(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let i=0;i<t.childCount;i++){let a=t.child(i),o=a.type==r?e.type.schema.nodes.text:a.type;if(n=n.matchType(o),!n||!e.type.allowsMarks(a.marks))return!1}return n.validEnd}function GN(e,t){return!!(e&&t&&!e.isLeaf&&WN(e,t))}function KN(e,t,n=-1){let r=e.resolve(t);for(let e=r.depth;;e--){let i,a,o=r.index(e);if(e==r.depth?(i=r.nodeBefore,a=r.nodeAfter):n>0?(i=r.node(e+1),o++,a=r.node(e).maybeChild(o)):(i=r.node(e).maybeChild(o-1),a=r.node(e+1)),i&&!i.isTextblock&&GN(i,a)&&r.node(e).canReplace(o,o+1))return t;if(e==0)break;t=n<0?r.before(e):r.after(e)}}function qN(e,t,n){let r=null,{linebreakReplacement:i}=e.doc.type.schema,a=e.doc.resolve(t-n),o=a.node().type;if(i&&o.inlineContent){let e=o.whitespace==`pre`,t=!!o.contentMatch.matchType(i);e&&!t?r=!1:!e&&t&&(r=!0)}let s=e.steps.length;if(r===!1){let r=e.doc.resolve(t+n);RN(e,r.node(),r.before(),s)}o.inlineContent&&DN(e,t+n-1,o,a.node().contentMatchAt(a.index()),r==null);let c=e.mapping.slice(s),l=c.map(t-n);if(e.step(new SN(l,c.map(t+n,-1),W.empty,!0)),r===!0){let t=e.doc.resolve(l);LN(e,t.node(),t.before(),e.steps.length)}return e}function JN(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(r.parentOffset==0)for(let e=r.depth-1;e>=0;e--){let t=r.index(e);if(r.node(e).canReplaceWith(t,t,n))return r.before(e+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let e=r.depth-1;e>=0;e--){let t=r.indexAfter(e);if(r.node(e).canReplaceWith(t,t,n))return r.after(e+1);if(t<r.node(e).childCount)return null}return null}function YN(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let e=0;e<n.openStart;e++)i=i.firstChild.content;for(let e=1;e<=(n.openStart==0&&n.size?2:1);e++)for(let t=r.depth;t>=0;t--){let n=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,a=r.index(t)+ +(n>0),o=r.node(t),s=!1;if(e==1)s=o.canReplace(a,a,i);else{let e=o.contentMatchAt(a).findWrapping(i.firstChild.type);s=e&&o.canReplaceWith(a,a,e[0])}if(s)return n==0?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}function XN(e,t,n=t,r=W.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),a=e.resolve(n);return ZN(i,a,r)?new SN(t,n,r):new QN(i,a,r).fit()}function ZN(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}var QN=class{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=U.empty;for(let t=0;t<=e.depth;t++){let n=e.node(t);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(t))})}for(let t=e.depth;t>0;t--)this.placed=U.from(e.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let i=this.placed,a=n.depth,o=r.depth;for(;a&&o&&i.childCount==1;)i=i.firstChild.content,a--,o--;let s=new W(i,a,o);return e>-1?new CN(n.pos,e,this.$to.pos,this.$to.end(),s,t):s.size||n.pos!=this.$to.pos?new SN(n.pos,r.pos,s):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<e;n++){let i=t.firstChild;if(t.childCount>1&&(r=0),i.type.spec.isolating&&r<=n){e=n;break}t=i.content}for(let t=1;t<=2;t++)for(let n=t==1?e:this.unplaced.openStart;n>=0;n--){let e,r=null;n?(r=tP(this.unplaced.content,n-1).firstChild,e=r.content):e=this.unplaced.content;let i=e.firstChild;for(let e=this.depth;e>=0;e--){let{type:a,match:o}=this.frontier[e],s,c=null;if(t==1&&(i?o.matchType(i.type)||(c=o.fillBefore(U.from(i),!1)):r&&a.compatibleContent(r.type)))return{sliceDepth:n,frontierDepth:e,parent:r,inject:c};if(t==2&&i&&(s=o.findWrapping(i.type)))return{sliceDepth:n,frontierDepth:e,parent:r,wrap:s};if(r&&o.matchType(r.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=tP(e,t);return!r.childCount||r.firstChild.isLeaf?!1:(this.unplaced=new W(e,t+1,Math.max(n,r.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=tP(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new W($N(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new W($N(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let e=0;e<i.length;e++)this.openFrontierNode(i[e]);let a=this.unplaced,o=n?n.content:a.content,s=a.openStart-e,c=0,l=[],{match:u,type:d}=this.frontier[t];if(r){for(let e=0;e<r.childCount;e++)l.push(r.child(e));u=u.matchFragment(r)}let f=o.size+e-(a.content.size-a.openEnd);for(;c<o.childCount;){let e=o.child(c),t=u.matchType(e.type);if(!t)break;c++,(c>1||s==0||e.content.size)&&(u=t,l.push(nP(e.mark(d.allowedMarks(e.marks)),c==1?s:0,c==o.childCount?f:-1)))}let p=c==o.childCount;p||(f=-1),this.placed=eP(this.placed,t,U.from(l)),this.frontier[t].match=u,p&&f<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=o;e<f;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content}this.unplaced=p?e==0?W.empty:new W($N(a.content,e-1,1),e-1,f<0?a.openEnd:e-1):new W($N(a.content,e,c),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!rP(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){scan:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),a=rP(e,t,r,n,i);if(a){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=rP(e,n,r,t,!0);if(!i||i.childCount)continue scan}return{depth:t,fit:a,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=eP(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=eP(this.placed,this.depth,U.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(U.empty,!0);e.childCount&&(this.placed=eP(this.placed,this.frontier.length,e))}};function $N(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy($N(e.firstChild.content,t-1,n)))}function eP(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(eP(e.lastChild.content,t-1,n)))}function tP(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function nP(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,nP(r.firstChild,t-1,r.childCount==1?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(U.empty,!0)))),e.copy(r)}function rP(e,t,n,r,i){let a=e.node(t),o=i?e.indexAfter(t):e.index(t);if(o==a.childCount&&!n.compatibleContent(a.type))return null;let s=r.fillBefore(a.content,!0,o);return s&&!iP(n,a.content,o)?s:null}function iP(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function aP(e){return e.spec.defining||e.spec.definingForContent}function oP(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),a=e.doc.resolve(n);if(ZN(i,a,r))return e.step(new SN(t,n,r));let o=uP(i,a);o[o.length-1]==0&&o.pop();let s=-(i.depth+1);o.unshift(s);for(let e=i.depth,t=i.pos-1;e>0;e--,t--){let n=i.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;o.indexOf(e)>-1?s=e:i.before(e)==t&&o.splice(1,0,-e)}let c=o.indexOf(s),l=[],u=r.openStart;for(let e=r.content,t=0;;t++){let n=e.firstChild;if(l.push(n),t==r.openStart)break;e=n.content}for(let e=u-1;e>=0;e--){let t=l[e],n=aP(t.type);if(n&&!t.sameMarkup(i.node(Math.abs(s)-1)))u=e;else if(n||!t.type.isTextblock)break}for(let t=r.openStart;t>=0;t--){let s=(t+u+1)%(r.openStart+1),d=l[s];if(d)for(let t=0;t<o.length;t++){let l=o[(t+c)%o.length],u=!0;l<0&&(u=!1,l=-l);let f=i.node(l-1),p=i.index(l-1);if(f.canReplaceWith(p,p,d.type,d.marks))return e.replace(i.before(l),u?a.after(l):n,new W(sP(r.content,0,r.openStart,s),s,r.openEnd))}}let d=e.steps.length;for(let s=o.length-1;s>=0&&(e.replace(t,n,r),!(e.steps.length>d));s--){let e=o[s];e<0||(t=i.before(e),n=a.after(e))}}function sP(e,t,n,r,i){if(t<n){let i=e.firstChild;e=e.replaceChild(0,i.copy(sP(i.content,t+1,n,r,i)))}if(t>r){let t=i.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(U.empty,!0))}return e}function cP(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=JN(e.doc,t,r.type);i!=null&&(t=n=i)}e.replaceRange(t,n,new W(U.from(r),0,0))}function lP(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n);if(r.parent.isTextblock&&i.parent.isTextblock&&r.start()!=i.start()&&r.parentOffset==0&&i.parentOffset==0){let a=r.sharedDepth(n),o=!1;for(let e=r.depth;e>a;e--)r.node(e).type.spec.isolating&&(o=!0);for(let e=i.depth;e>a;e--)i.node(e).type.spec.isolating&&(o=!0);if(!o){for(let e=r.depth;e>0&&t==r.start(e);e--)t=r.before(e);for(let e=i.depth;e>0&&n==i.start(e);e--)n=i.before(e);r=e.doc.resolve(t),i=e.doc.resolve(n)}}let a=uP(r,i);for(let t=0;t<a.length;t++){let n=a[t],o=t==a.length-1;if(o&&n==0||r.node(n).type.contentMatch.validEnd)return e.delete(r.start(n),i.end(n));if(n>0&&(o||r.node(n-1).canReplace(r.index(n-1),i.indexAfter(n-1))))return e.delete(r.before(n),i.after(n))}for(let a=1;a<=r.depth&&a<=i.depth;a++)if(t-r.start(a)==r.depth-a&&n>r.end(a)&&i.end(a)-n!=i.depth-a&&r.start(a-1)==i.start(a-1)&&r.node(a-1).canReplace(r.index(a-1),i.index(a-1)))return e.delete(r.before(a),n);e.delete(t,n)}function uP(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let i=r;i>=0;i--){let r=e.start(i);if(r<e.pos-(e.depth-i)||t.end(i)>t.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(r==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==r-1)&&n.push(i)}return n}var dP=class e extends hN{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return gN.fail(`No node at attribute step's position`);let n=Object.create(null);for(let e in t.attrs)n[e]=t.attrs[e];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return gN.fromReplace(e,this.pos,this.pos+1,new W(U.from(r),0,+!t.isLeaf))}getMap(){return fN.empty}invert(t){return new e(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.attr,this.value)}toJSON(){return{stepType:`attr`,pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!=`number`||typeof n.attr!=`string`)throw RangeError(`Invalid input for AttrStep.fromJSON`);return new e(n.pos,n.attr,n.value)}};hN.jsonID(`attr`,dP);var fP=class e extends hN{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let n in e.attrs)t[n]=e.attrs[n];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return gN.ok(n)}getMap(){return fN.empty}invert(t){return new e(this.attr,t.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:`docAttr`,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!=`string`)throw RangeError(`Invalid input for DocAttrStep.fromJSON`);return new e(n.attr,n.value)}};hN.jsonID(`docAttr`,fP);let pP=class extends Error{};pP=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},pP.prototype=Object.create(Error.prototype),pP.prototype.constructor=pP,pP.prototype.name=`TransformError`;var mP=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new pN}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new pP(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,t=-1e9;for(let n=0;n<this.mapping.maps.length;n++){let r=this.mapping.maps[n];n&&(e=r.map(e,1),t=r.map(t,-1)),r.forEach((n,r,i,a)=>{e=Math.min(e,i),t=Math.max(t,a)})}return e==1e9?null:{from:e,to:t}}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=W.empty){let r=XN(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new W(U.from(n),0,0))}delete(e,t){return this.replace(e,t,W.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return oP(this,e,t,n),this}replaceRangeWith(e,t,n){return cP(this,e,t,n),this}deleteRange(e,t){return lP(this,e,t),this}lift(e,t){return AN(this,e,t),this}join(e,t=1){return qN(this,e,t),this}wrap(e,t){return FN(this,e,t),this}setBlockType(e,t=e,n,r=null){return IN(this,e,t,n,r),this}setNodeMarkup(e,t,n=null,r){return BN(this,e,t,n,r),this}setNodeAttribute(e,t,n){return this.step(new dP(e,t,n)),this}setDocAttribute(e,t){return this.step(new fP(e,t)),this}addNodeMark(e,t){return this.step(new bN(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw RangeError(`No node at position `+e);if(t instanceof qj)t.isInSet(n.marks)&&this.step(new xN(e,t));else{let r=n.marks,i,a=[];for(;i=t.isInSet(r);)a.push(new xN(e,i)),r=i.removeFromSet(r);for(let e=a.length-1;e>=0;e--)this.step(a[e])}return this}split(e,t=1,n){return HN(this,e,t,n),this}addMark(e,t,n){return TN(this,e,t,n),this}removeMark(e,t,n){return EN(this,e,t,n),this}clearIncompatible(e,t,n){return DN(this,e,t,n),this}};const hP=Object.create(null);var gP=class{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new _P(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=W.empty){let n=t.content.lastChild,r=null;for(let e=0;e<t.openEnd;e++)r=n,n=n.lastChild;let i=e.steps.length,a=this.ranges;for(let o=0;o<a.length;o++){let{$from:s,$to:c}=a[o],l=e.mapping.slice(i);e.replaceRange(l.map(s.pos),l.map(c.pos),o?W.empty:t),o==0&&DP(e,i,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:a,$to:o}=r[i],s=e.mapping.slice(n),c=s.map(a.pos),l=s.map(o.pos);i?e.deleteRange(c,l):(e.replaceRangeWith(c,l,t),DP(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new bP(e):EP(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let r=e.depth-1;r>=0;r--){let i=t<0?EP(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):EP(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(i)return i}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new wP(e.node(0))}static atStart(e){return EP(e,e,0,0,1)||new wP(e)}static atEnd(e){return EP(e,e,e.content.size,e.childCount,-1)||new wP(e)}static fromJSON(e,t){if(!t||!t.type)throw RangeError(`Invalid input for Selection.fromJSON`);let n=hP[t.type];if(!n)throw RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in hP)throw RangeError(`Duplicate use of selection JSON ID `+e);return hP[e]=t,t.prototype.jsonID=e,t}getBookmark(){return bP.between(this.$anchor,this.$head).getBookmark()}};gP.prototype.visible=!0;var _P=class{constructor(e,t){this.$from=e,this.$to=t}};let vP=!1;function yP(e){!vP&&!e.parent.inlineContent&&(vP=!0,console.warn(`TextSelection endpoint not pointing into a node with inline content (`+e.parent.type.name+`)`))}var bP=class e extends gP{constructor(e,t=e){yP(e),yP(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let r=t.resolve(n.map(this.head));if(!r.parent.inlineContent)return gP.near(r);let i=t.resolve(n.map(this.anchor));return new e(i.parent.inlineContent?i:r,r)}replace(e,t=W.empty){if(super.replace(e,t),t==W.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(t){return t instanceof e&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new xP(this.anchor,this.head)}toJSON(){return{type:`text`,anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!=`number`||typeof n.head!=`number`)throw RangeError(`Invalid input for TextSelection.fromJSON`);return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(t,n,r){let i=t.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let e=gP.findFrom(n,r,!0)||gP.findFrom(n,-r,!0);if(e)n=e.$head;else return gP.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(gP.findFrom(t,-r,!0)||gP.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new e(t,n)}};gP.jsonID(`text`,bP);var xP=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){return bP.between(e.resolve(this.anchor),e.resolve(this.head))}},SP=class e extends gP{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(t,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),a=t.resolve(i);return r?gP.near(a):new e(a)}content(){return new W(U.from(this.node),0,0)}eq(t){return t instanceof e&&t.anchor==this.anchor}toJSON(){return{type:`node`,anchor:this.anchor}}getBookmark(){return new CP(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!=`number`)throw RangeError(`Invalid input for NodeSelection.fromJSON`);return new e(t.resolve(n.anchor))}static create(t,n){return new e(t.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}};SP.prototype.visible=!1,gP.jsonID(`node`,SP);var CP=class e{constructor(e){this.anchor=e}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new xP(r,r):new e(r)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&SP.isSelectable(n)?new SP(t):gP.near(t)}},wP=class e extends gP{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=W.empty){if(t==W.empty){e.delete(0,e.doc.content.size);let t=gP.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:`all`}}static fromJSON(t){return new e(t)}map(t){return new e(t)}eq(t){return t instanceof e}getBookmark(){return TP}};gP.jsonID(`all`,wP);const TP={map(){return this},resolve(e){return new wP(e)}};function EP(e,t,n,r,i,a=!1){if(t.inlineContent)return bP.create(e,n);for(let o=r-(i>0?0:1);i>0?o<t.childCount:o>=0;o+=i){let r=t.child(o);if(!r.isAtom){let t=EP(e,r,n+i,i<0?r.childCount:0,i,a);if(t)return t}else if(!a&&SP.isSelectable(r))return SP.create(e,n-(i<0?r.nodeSize:0));n+=r.nodeSize*i}return null}function DP(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof SN||i instanceof CN))return;let a=e.mapping.maps[r],o;a.forEach((e,t,n,r)=>{o??=r}),e.setSelection(gP.near(e.doc.resolve(o),n))}function OP(e,t){return!t||!e?e:e.bind(t)}var kP=class{constructor(e,t,n){this.name=e,this.init=OP(t.init,n),this.apply=OP(t.apply,n)}};new kP(`doc`,{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new kP(`selection`,{init(e,t){return e.selection||gP.atStart(t.doc)},apply(e){return e.selection}}),new kP(`storedMarks`,{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new kP(`scrollToSelection`,{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}});function AP(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r==`handleDOMEvents`&&(i=AP(i,t,{})),n[r]=i}return n}var jP=class{constructor(e){this.spec=e,this.props={},e.props&&AP(e.props,this,this.props),this.key=e.key?e.key.key:NP(`plugin`)}getState(e){return e[this.key]}};const MP=Object.create(null);function NP(e){return e in MP?e+`$`+ ++MP[e]:(MP[e]=0,e+`$`)}var PP=class{constructor(e=`key`){this.key=NP(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}};const FP=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function IP(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`backward`,e):n.parentOffset>0)?null:n}const LP=(e,t,n)=>{let r=IP(e,n);if(!r)return!1;let i=UP(r);if(!i){let n=r.blockRange(),i=n&&kN(n);return i!=null&&(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let a=i.nodeBefore;if(sF(e,i,t,-1))return!0;if(r.parent.content.size==0&&(VP(a,`end`)||SP.isSelectable(a)))for(let n=r.depth;;n--){let o=XN(e.doc,r.before(n),r.after(n),W.empty);if(o&&o.slice.size<o.to-o.from){if(t){let n=e.tr.step(o);n.setSelection(VP(a,`end`)?gP.findFrom(n.doc.resolve(n.mapping.map(i.pos,-1)),-1):SP.create(n.doc,i.pos-a.nodeSize)),t(n.scrollIntoView())}return!0}if(n==1||r.node(n-1).childCount>1)break}return a.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos-a.nodeSize,i.pos).scrollIntoView()),!0):!1},RP=(e,t,n)=>{let r=IP(e,n);if(!r)return!1;let i=UP(r);return i?BP(e,i,t):!1},zP=(e,t,n)=>{let r=WP(e,n);if(!r)return!1;let i=qP(r);return i?BP(e,i,t):!1};function BP(e,t,n){let r=t.nodeBefore,i=t.pos-1;for(;!r.isTextblock;i--){if(r.type.spec.isolating)return!1;let e=r.lastChild;if(!e)return!1;r=e}let a=t.nodeAfter,o=t.pos+1;for(;!a.isTextblock;o++){if(a.type.spec.isolating)return!1;let e=a.firstChild;if(!e)return!1;a=e}let s=XN(e.doc,i,o,W.empty);if(!s||s.from!=i||s instanceof SN&&s.slice.size>=o-i)return!1;if(n){let t=e.tr.step(s);t.setSelection(bP.create(t.doc,i)),n(t.scrollIntoView())}return!0}function VP(e,t,n=!1){for(let r=e;r;r=t==`start`?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const HP=(e,t,n)=>{let{$head:r,empty:i}=e.selection,a=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock(`backward`,e):r.parentOffset>0)return!1;a=UP(r)}let o=a&&a.nodeBefore;return!o||!SP.isSelectable(o)?!1:(t&&t(e.tr.setSelection(SP.create(e.doc,a.pos-o.nodeSize)).scrollIntoView()),!0)};function UP(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function WP(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`forward`,e):n.parentOffset<n.parent.content.size)?null:n}const GP=(e,t,n)=>{let r=WP(e,n);if(!r)return!1;let i=qP(r);if(!i)return!1;let a=i.nodeAfter;if(sF(e,i,t,1))return!0;if(r.parent.content.size==0&&(VP(a,`start`)||SP.isSelectable(a))){let n=XN(e.doc,r.before(),r.after(),W.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(VP(a,`start`)?gP.findFrom(r.doc.resolve(r.mapping.map(i.pos)),1):SP.create(r.doc,r.mapping.map(i.pos))),t(r.scrollIntoView())}return!0}}return a.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos,i.pos+a.nodeSize).scrollIntoView()),!0):!1},KP=(e,t,n)=>{let{$head:r,empty:i}=e.selection,a=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock(`forward`,e):r.parentOffset<r.parent.content.size)return!1;a=qP(r)}let o=a&&a.nodeAfter;return!o||!SP.isSelectable(o)?!1:(t&&t(e.tr.setSelection(SP.create(e.doc,a.pos)).scrollIntoView()),!0)};function qP(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}const JP=(e,t)=>{let n=e.selection,r=n instanceof SP,i;if(r){if(n.node.isTextblock||!UN(e.doc,n.from))return!1;i=n.from}else if(i=KN(e.doc,n.from,-1),i==null)return!1;if(t){let n=e.tr.join(i);r&&n.setSelection(SP.create(n.doc,i-e.doc.resolve(i).nodeBefore.nodeSize)),t(n.scrollIntoView())}return!0},YP=(e,t)=>{let n=e.selection,r;if(n instanceof SP){if(n.node.isTextblock||!UN(e.doc,n.to))return!1;r=n.to}else if(r=KN(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},XP=(e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),a=i&&kN(i);return a!=null&&(t&&t(e.tr.lift(i,a).scrollIntoView()),!0)},ZP=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`
|
|
218
|
+
`).scrollIntoView()),!0)};function QP(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const $P=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),a=n.indexAfter(-1),o=QP(i.contentMatchAt(a));if(!o||!i.canReplaceWith(a,a,o))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,o.createAndFill());i.setSelection(gP.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0},eF=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof wP||r.parent.inlineContent||i.parent.inlineContent)return!1;let a=QP(i.parent.contentMatchAt(i.indexAfter()));if(!a||!a.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,o=e.tr.insert(n,a.createAndFill());o.setSelection(bP.create(o.doc,n+1)),t(o.scrollIntoView())}return!0},tF=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(VN(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&kN(r);return i!=null&&(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)};function nF(e){return(t,n)=>{let{$from:r,$to:i}=t.selection;if(t.selection instanceof SP&&t.selection.node.isBlock)return!r.parentOffset||!VN(t.doc,r.pos)?!1:(n&&n(t.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let a=[],o,s,c=!1,l=!1;for(let t=r.depth;;t--)if(r.node(t).isBlock){c=r.end(t)==r.pos+(r.depth-t),l=r.start(t)==r.pos-(r.depth-t),s=QP(r.node(t-1).contentMatchAt(r.indexAfter(t-1)));let n=e&&e(i.parent,c,r);a.unshift(n||(c&&s?{type:s}:null)),o=t;break}else{if(t==1)return!1;a.unshift(null)}let u=t.tr;(t.selection instanceof bP||t.selection instanceof wP)&&u.deleteSelection();let d=u.mapping.map(r.pos),f=VN(u.doc,d,a.length,a);if(f||=(a[0]=s?{type:s}:null,VN(u.doc,d,a.length,a)),!f)return!1;if(u.split(d,a.length,a),!c&&l&&r.node(o).type!=s){let e=u.mapping.map(r.before(o)),t=u.doc.resolve(e);s&&r.node(o-1).canReplaceWith(t.index(),t.index()+1,s)&&u.setNodeMarkup(u.mapping.map(r.before(o)),s)}return n&&n(u.scrollIntoView()),!0}}const rF=nF(),iF=(e,t)=>{let{$from:n,to:r}=e.selection,i,a=n.sharedDepth(r);return a!=0&&(i=n.before(a),t&&t(e.tr.setSelection(SP.create(e.doc,i))),!0)},aF=(e,t)=>(t&&t(e.tr.setSelection(new wP(e.doc))),!0);function oF(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,a=t.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&t.parent.canReplace(a-1,a)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(a,a+1)||!(i.isTextblock||UN(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function sF(e,t,n,r){let i=t.nodeBefore,a=t.nodeAfter,o,s,c=i.type.spec.isolating||a.type.spec.isolating;if(!c&&oF(e,t,n))return!0;let l=!c&&t.parent.canReplace(t.index(),t.index()+1);if(l&&(o=(s=i.contentMatchAt(i.childCount)).findWrapping(a.type))&&s.matchType(o[0]||a.type).validEnd){if(n){let r=t.pos+a.nodeSize,s=U.empty;for(let e=o.length-1;e>=0;e--)s=U.from(o[e].create(null,s));s=U.from(i.copy(s));let c=e.tr.step(new CN(t.pos-1,r,t.pos,r,new W(s,1,0),o.length,!0)),l=c.doc.resolve(r+2*o.length);l.nodeAfter&&l.nodeAfter.type==i.type&&UN(c.doc,l.pos)&&c.join(l.pos),n(c.scrollIntoView())}return!0}let u=a.type.spec.isolating||r>0&&c?null:gP.findFrom(t,1),d=u&&u.$from.blockRange(u.$to),f=d&&kN(d);if(f!=null&&f>=t.depth)return n&&n(e.tr.lift(d,f).scrollIntoView()),!0;if(l&&VP(a,`start`,!0)&&VP(i,`end`)){let r=i,o=[];for(;o.push(r),!r.isTextblock;)r=r.lastChild;let s=a,c=1;for(;!s.isTextblock;s=s.firstChild)c++;if(r.canReplace(r.childCount,r.childCount,s.content)){if(n){let r=U.empty;for(let e=o.length-1;e>=0;e--)r=U.from(o[e].copy(r));n(e.tr.step(new CN(t.pos-o.length,t.pos+a.nodeSize,t.pos+c,t.pos+a.nodeSize-c,new W(r,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function cF(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,a=i.depth;for(;i.node(a).isInline;){if(!a)return!1;a--}return i.node(a).isTextblock?(n&&n(t.tr.setSelection(bP.create(t.doc,e<0?i.start(a):i.end(a)))),!0):!1}}const lF=cF(-1),uF=cF(1);function dF(e,t=null){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a),s=o&&jN(o,e,t);return s?(r&&r(n.tr.wrap(o,s).scrollIntoView()),!0):!1}}function fF(e,t=null){return function(n,r){let i=!1;for(let r=0;r<n.selection.ranges.length&&!i;r++){let{$from:{pos:a},$to:{pos:o}}=n.selection.ranges[r];n.doc.nodesBetween(a,o,(r,a)=>{if(i)return!1;if(!(!r.isTextblock||r.hasMarkup(e,t))){if(r.type==e)i=!0;else{let t=n.doc.resolve(a),r=t.index();i=t.parent.canReplaceWith(r,r+1,e)}}})}if(!i)return!1;if(r){let i=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:a},$to:{pos:o}}=n.selection.ranges[r];i.setBlockType(a,o,e,t)}r(i.scrollIntoView())}return!0}}function pF(...e){return function(t,n,r){for(let i=0;i<e.length;i++)if(e[i](t,n,r))return!0;return!1}}let mF=pF(FP,LP,HP),hF=pF(FP,GP,KP);const gF={Enter:pF(ZP,eF,tF,rF),"Mod-Enter":$P,Backspace:mF,"Mod-Backspace":mF,"Shift-Backspace":mF,Delete:hF,"Mod-Delete":hF,"Mod-a":aF},_F={"Ctrl-h":gF.Backspace,"Alt-Backspace":gF[`Mod-Backspace`],"Ctrl-d":gF.Delete,"Ctrl-Alt-Backspace":gF[`Mod-Delete`],"Alt-Delete":gF[`Mod-Delete`],"Alt-d":gF[`Mod-Delete`],"Ctrl-a":lF,"Ctrl-e":uF};for(let e in gF)_F[e]=gF[e];typeof navigator<`u`?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<`u`&&os.platform&&os.platform();function vF(e,t=null){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a);if(!o)return!1;let s=r?n.tr:null;return yF(s,o,e,t)?(r&&r(s.scrollIntoView()),!0):!1}}function yF(e,t,n,r=null){let i=!1,a=t,o=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&t.startIndex==0){if(t.$from.index(t.depth-1)==0)return!1;let e=o.resolve(t.start-2);a=new dM(e,e,t.depth),t.endIndex<t.parent.childCount&&(t=new dM(t.$from,o.resolve(t.$to.end(t.depth)),t.depth)),i=!0}let s=jN(a,n,r,t);return s?(e&&bF(e,t,s,i,n),!0):!1}function bF(e,t,n,r,i){let a=U.empty;for(let e=n.length-1;e>=0;e--)a=U.from(n[e].type.create(n[e].attrs,a));e.step(new CN(t.start-(r?2:0),t.end,t.start,t.end,new W(a,0,0),n.length,!0));let o=0;for(let e=0;e<n.length;e++)n[e].type==i&&(o=e+1);let s=n.length-o,c=t.start+n.length-(r?2:0),l=t.parent;for(let n=t.startIndex,r=t.endIndex,i=!0;n<r;n++,i=!1)!i&&VN(e.doc,c,s)&&(e.split(c,s),c+=2*s),c+=l.child(n).nodeSize;return e}function xF(e){return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);return a?n?r.node(a.depth-1).type==e?SF(t,n,e,a):CF(t,n,a):!0:!1}}function SF(e,t,n,r){let i=e.tr,a=r.end,o=r.$to.end(r.depth);a<o&&(i.step(new CN(a-1,o,a,o,new W(U.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new dM(i.doc.resolve(r.$from.pos),i.doc.resolve(o),r.depth));let s=kN(r);if(s==null)return!1;i.lift(r,s);let c=i.doc.resolve(i.mapping.map(a,-1)-1);return UN(i.doc,c.pos)&&c.nodeBefore.type==c.nodeAfter.type&&i.join(c.pos),t(i.scrollIntoView()),!0}function CF(e,t,n){let r=e.tr,i=n.parent;for(let e=n.end,t=n.endIndex-1,a=n.startIndex;t>a;t--)e-=i.child(t).nodeSize,r.delete(e-1,e+1);let a=r.doc.resolve(n.start),o=a.nodeAfter;if(r.mapping.map(n.end)!=n.start+a.nodeAfter.nodeSize)return!1;let s=n.startIndex==0,c=n.endIndex==i.childCount,l=a.node(-1),u=a.index(-1);if(!l.canReplace(u+ +!s,u+1,o.content.append(c?U.empty:U.from(i))))return!1;let d=a.pos,f=d+o.nodeSize;return r.step(new CN(d-+!!s,f+ +!!c,d+1,f-1,new W((s?U.empty:U.from(i.copy(U.empty))).append(c?U.empty:U.from(i.copy(U.empty))),+!s,+!c),+!s)),t(r.scrollIntoView()),!0}function wF(e){return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);if(!a)return!1;let o=a.startIndex;if(o==0)return!1;let s=a.parent,c=s.child(o-1);if(c.type!=e)return!1;if(n){let r=c.lastChild&&c.lastChild.type==s.type,i=U.from(r?e.create():null),o=new W(U.from(e.create(null,U.from(s.type.create(null,i)))),r?3:1,0),l=a.start,u=a.end;n(t.tr.step(new CN(l-(r?3:1),u,l,u,o,1,!0)).scrollIntoView())}return!0}}const TF=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},EF=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t};let DF=null;const OF=function(e,t,n){let r=DF||=document.createRange();return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},kF=function(){DF=null},AF=function(e,t,n,r){return n&&(MF(e,t,n,r,-1)||MF(e,t,n,r,1))},jF=/^(img|br|input|textarea|hr)$/i;function MF(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:NF(e))){let n=e.parentNode;if(!n||n.nodeType!=1||LF(e)||jF.test(e.nodeName)||e.contentEditable==`false`)return!1;t=TF(e)+(i<0?0:1),e=n}else if(e.nodeType==1){let n=e.childNodes[t+(i<0?-1:0)];if(n.nodeType==1&&n.contentEditable==`false`){if(n.pmViewDesc?.ignoreForSelection)t+=i;else return!1}else e=n,t=i<0?NF(e):0}else return!1}}function NF(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function PF(e,t){for(;;){if(e.nodeType==3&&t)return e;if(e.nodeType==1&&t>0){if(e.contentEditable==`false`)return null;e=e.childNodes[t-1],t=NF(e)}else if(e.parentNode&&!LF(e))t=TF(e),e=e.parentNode;else return null}}function FF(e,t){for(;;){if(e.nodeType==3&&t<e.nodeValue.length)return e;if(e.nodeType==1&&t<e.childNodes.length){if(e.contentEditable==`false`)return null;e=e.childNodes[t],t=0}else if(e.parentNode&&!LF(e))t=TF(e)+1,e=e.parentNode;else return null}}function IF(e,t,n){for(let r=t==0,i=t==NF(e);r||i;){if(e==n)return!0;let t=TF(e);if(e=e.parentNode,!e)return!1;r&&=t==0,i&&=t==NF(e)}}function LF(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const RF=function(e){return e.focusNode&&AF(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function zF(e,t){let n=document.createEvent(`Event`);return n.initEvent(`keydown`,!0,!0),n.keyCode=e,n.key=n.code=t,n}function BF(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function VF(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(NF(r.offsetNode),r.offset)}}catch{}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(NF(r.startContainer),r.startOffset)}}}const HF=typeof navigator<`u`?navigator:null,UF=typeof document<`u`?document:null,WF=HF&&HF.userAgent||``,GF=/Edge\/(\d+)/.exec(WF),KF=/MSIE \d/.exec(WF),qF=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(WF),JF=!!(KF||qF||GF),YF=KF?document.documentMode:qF?+qF[1]:GF?+GF[1]:0,XF=!JF&&/gecko\/(\d+)/i.test(WF);XF&&+(/Firefox\/(\d+)/.exec(WF)||[0,0])[1];const ZF=!JF&&/Chrome\/(\d+)/.exec(WF),QF=!!ZF,$F=ZF?+ZF[1]:0,eI=!JF&&!!HF&&/Apple Computer/.test(HF.vendor),tI=eI&&(/Mobile\/\w+/.test(WF)||!!HF&&HF.maxTouchPoints>2),nI=tI||(HF?/Mac/.test(HF.platform):!1),rI=HF?/Win/.test(HF.platform):!1,iI=/Android \d/.test(WF),aI=!!UF&&`webkitFontSmoothing`in UF.documentElement.style,oI=aI?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function sI(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function cI(e,t){return typeof e==`number`?e:e[t]}function lI(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function uI(e,t,n){let r=e.someProp(`scrollThreshold`)||0,i=e.someProp(`scrollMargin`)||5,a=e.dom.ownerDocument;for(let o=n||e.dom;o;){if(o.nodeType!=1){o=EF(o);continue}let e=o,n=e==a.body,s=n?sI(a):lI(e),c=0,l=0;if(t.top<s.top+cI(r,`top`)?l=-(s.top-t.top+cI(i,`top`)):t.bottom>s.bottom-cI(r,`bottom`)&&(l=t.bottom-t.top>s.bottom-s.top?t.top+cI(i,`top`)-s.top:t.bottom-s.bottom+cI(i,`bottom`)),t.left<s.left+cI(r,`left`)?c=-(s.left-t.left+cI(i,`left`)):t.right>s.right-cI(r,`right`)&&(c=t.right-s.right+cI(i,`right`)),c||l){if(n)a.defaultView.scrollBy(c,l);else{let n=e.scrollLeft,r=e.scrollTop;l&&(e.scrollTop+=l),c&&(e.scrollLeft+=c);let i=e.scrollLeft-n,a=e.scrollTop-r;t={left:t.left-i,top:t.top-a,right:t.right-i,bottom:t.bottom-a}}}let u=n?`fixed`:getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(u))break;o=u==`absolute`?o.offsetParent:EF(o)}}function dI(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),r,i;for(let a=(t.left+t.right)/2,o=n+1;o<Math.min(innerHeight,t.bottom);o+=5){let t=e.root.elementFromPoint(a,o);if(!t||t==e.dom||!e.dom.contains(t))continue;let s=t.getBoundingClientRect();if(s.top>=n-20){r=t,i=s.top;break}}return{refDOM:r,refTop:i,stack:fI(e.dom)}}function fI(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=EF(r));return t}function pI({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;mI(n,r==0?0:r-t)}function mI(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:a}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=a&&(r.scrollLeft=a)}}let hI=null;function gI(e){if(e.setActive)return e.setActive();if(hI)return e.focus(hI);let t=fI(e);e.focus(hI==null?{get preventScroll(){return hI={preventScroll:!0},!0}}:void 0),hI||(hI=!1,mI(t,0))}function _I(e,t){let n,r=2e8,i,a=0,o=t.top,s=t.top,c,l;for(let u=e.firstChild,d=0;u;u=u.nextSibling,d++){let e;if(u.nodeType==1)e=u.getClientRects();else if(u.nodeType==3)e=OF(u).getClientRects();else continue;for(let f=0;f<e.length;f++){let p=e[f];if(p.top<=o&&p.bottom>=s){o=Math.max(p.bottom,o),s=Math.min(p.top,s);let e=p.left>t.left?p.left-t.left:p.right<t.left?t.left-p.right:0;if(e<r){n=u,r=e,i=e&&n.nodeType==3?{left:p.right<t.left?p.right:p.left,top:t.top}:t,u.nodeType==1&&e&&(a=d+ +(t.left>=(p.left+p.right)/2));continue}}else p.top>t.top&&!c&&p.left<=t.left&&p.right>=t.left&&(c=u,l={left:Math.max(p.left,Math.min(p.right,t.left)),top:p.top});!n&&(t.left>=p.right&&t.top>=p.top||t.left>=p.left&&t.top>=p.bottom)&&(a=d+1)}}return!n&&c&&(n=c,i=l,r=0),n&&n.nodeType==3?vI(n,i):!n||r&&n.nodeType==1?{node:e,offset:a}:_I(n,i)}function vI(e,t){let n=e.nodeValue.length,r=document.createRange(),i;for(let a=0;a<n;a++){r.setEnd(e,a+1),r.setStart(e,a);let n=EI(r,1);if(n.top!=n.bottom&&yI(t,n)){i={node:e,offset:a+ +(t.left>=(n.left+n.right)/2)};break}}return r.detach(),i||{node:e,offset:0}}function yI(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function bI(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function xI(e,t,n){let{node:r,offset:i}=_I(t,n),a=-1;if(r.nodeType==1&&!r.firstChild){let e=r.getBoundingClientRect();a=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,i,a)}function SI(e,t,n,r){let i=-1;for(let n=t,a=!1;n!=e.dom;){let t=e.docView.nearestDesc(n,!0),o;if(!t)return null;if(t.dom.nodeType==1&&(t.node.isBlock&&t.parent||!t.contentDOM)&&((o=t.dom.getBoundingClientRect()).width||o.height)&&(t.node.isBlock&&t.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(t.dom.nodeName)&&(!a&&o.left>r.left||o.top>r.top?i=t.posBefore:(!a&&o.right<r.left||o.bottom<r.top)&&(i=t.posAfter),a=!0),!t.contentDOM&&i<0&&!t.node.isText))return(t.node.isBlock?r.top<(o.top+o.bottom)/2:r.left<(o.left+o.right)/2)?t.posBefore:t.posAfter;n=t.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,-1)}function CI(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),a=i;;){let n=e.childNodes[a];if(n.nodeType==1){let e=n.getClientRects();for(let r=0;r<e.length;r++){let i=e[r];if(yI(t,i))return CI(n,t,i)}}if((a=(a+1)%r)==i)break}return e}function wI(e,t){let n=e.dom.ownerDocument,r,i=0,a=VF(n,t.left,t.top);a&&({node:r,offset:i}=a);let o=(e.root.elementFromPoint?e.root:n).elementFromPoint(t.left,t.top),s;if(!o||!e.dom.contains(o.nodeType==1?o:o.parentNode)){let n=e.dom.getBoundingClientRect();if(!yI(t,n)||(o=CI(e.dom,t,n),!o))return null}if(eI)for(let e=o;r&&e;e=EF(e))e.draggable&&(r=void 0);if(o=bI(o,t),r){if(XF&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let e=r.childNodes[i],n;e.nodeName==`IMG`&&(n=e.getBoundingClientRect()).right<=t.left&&n.bottom>t.top&&i++}let n;aI&&i&&r.nodeType==1&&(n=r.childNodes[i-1]).nodeType==1&&n.contentEditable==`false`&&n.getBoundingClientRect().top>=t.top&&i--,r==e.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&t.top>r.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!=`BR`)&&(s=SI(e,r,i,t))}s??=xI(e,o,t);let c=e.docView.nearestDesc(o,!0);return{pos:s,inside:c?c.posAtStart-c.border:-1}}function TI(e){return e.top<e.bottom||e.left<e.right}function EI(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(TI(e))return e}return Array.prototype.find.call(n,TI)||e.getBoundingClientRect()}const DI=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function OI(e,t,n){let{node:r,offset:i,atom:a}=e.docView.domFromPos(t,n<0?-1:1),o=aI||XF;if(r.nodeType==3){if(o&&(DI.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let e=EI(OF(r,i,i),n);if(XF&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let t=EI(OF(r,i-1,i-1),-1);if(t.top==e.top){let n=EI(OF(r,i,i+1),-1);if(n.top!=e.top)return kI(n,n.left<t.left)}}return e}{let e=i,t=i,a=n<0?1:-1;return n<0&&!i?(t++,a=-1):n>=0&&i==r.nodeValue.length?(e--,a=1):n<0?e--:t++,kI(EI(OF(r,e,t),a),a<0)}}if(!e.state.doc.resolve(t-(a||0)).parent.inlineContent){if(a==null&&i&&(n<0||i==NF(r))){let e=r.childNodes[i-1];if(e.nodeType==1)return AI(e.getBoundingClientRect(),!1)}if(a==null&&i<NF(r)){let e=r.childNodes[i];if(e.nodeType==1)return AI(e.getBoundingClientRect(),!0)}return AI(r.getBoundingClientRect(),n>=0)}if(a==null&&i&&(n<0||i==NF(r))){let e=r.childNodes[i-1],t=e.nodeType==3?OF(e,NF(e)-+!o):e.nodeType==1&&(e.nodeName!=`BR`||!e.nextSibling)?e:null;if(t)return kI(EI(t,1),!1)}if(a==null&&i<NF(r)){let e=r.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?e.nodeType==3?OF(e,0,+!o):e.nodeType==1?e:null:null;if(t)return kI(EI(t,-1),!0)}return kI(EI(r.nodeType==3?OF(r):r,-n),n>=0)}function kI(e,t){if(e.width==0)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function AI(e,t){if(e.height==0)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function jI(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}function MI(e,t,n){let r=t.selection,i=n==`up`?r.$from:r.$to;return jI(e,t,()=>{let{node:t}=e.docView.domFromPos(i.pos,n==`up`?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.contentDOM||n.dom;break}t=n.dom.parentNode}let r=OI(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(e.nodeType==1)t=e.getClientRects();else if(e.nodeType==3)t=OF(e,0,e.nodeValue.length).getClientRects();else continue;for(let e=0;e<t.length;e++){let i=t[e];if(i.bottom>i.top+1&&(n==`up`?r.top-i.top>(i.bottom-r.top)*2:i.bottom-r.bottom>(r.bottom-i.top)*2))return!1}}return!0})}const NI=/[\u0590-\u08ac]/;function PI(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,a=!i,o=i==r.parent.content.size,s=e.domSelection();return s?!NI.test(r.parent.textContent)||!s.modify?n==`left`||n==`backward`?a:o:jI(e,t,()=>{let{focusNode:t,focusOffset:i,anchorNode:a,anchorOffset:o}=e.domSelectionRange(),c=s.caretBidiLevel;s.modify(`move`,n,`character`);let l=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:u,focusOffset:d}=e.domSelectionRange(),f=u&&!l.contains(u.nodeType==1?u:u.parentNode)||t==u&&i==d;try{s.collapse(a,o),t&&(t!=a||i!=o)&&s.extend&&s.extend(t,i)}catch{}return c!=null&&(s.caretBidiLevel=c),f}):r.pos==r.start()||r.pos==r.end()}let FI=null,II=null,LI=!1;function RI(e,t,n){return FI==t&&II==n?LI:(FI=t,II=n,LI=n==`up`||n==`down`?MI(e,t,n):PI(e,t,n))}var zI=class{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=0,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let r=this.children[t];if(r==e)return n;n+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode)){if(n<0){let n,r;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}{let n,r;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}}let r;if(e==this.dom&&this.contentDOM)r=t>TF(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(t==0)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(r==null&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return r??n>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let i=this.getDesc(r),a;if(i&&(!t||i.node)){if(n&&(a=i.nodeDOM)&&!(a.nodeType==1?a.contains(e.nodeType==1?e:e.parentNode):a==e))n=!1;else return i}}}getDesc(e){let t=e.pmViewDesc;for(let e=t;e;e=e.parent)if(e==this)return t}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],i=n+r.size;if(n==e&&i!=n){for(;!r.border&&r.children.length;)for(let e=0;e<r.children.length;e++){let t=r.children[e];if(t.size){r=t;break}}return r}if(e<i)return r.descAt(e-n-r.border);n=i}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,r=0;for(let t=0;n<this.children.length;n++){let i=this.children[n],a=t+i.size;if(a>e||i instanceof KI){r=e-t;break}t=a}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(let e;n&&!(e=this.children[n-1]).size&&e instanceof BI&&e.side>=0;n--);if(t<=0){let e,r=!0;for(;e=n?this.children[n-1]:null,!(!e||e.dom.parentNode==this.contentDOM);n--,r=!1);return e&&t&&r&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?TF(e.dom)+1:0}}{let e,r=!0;for(;e=n<this.children.length?this.children[n]:null,!(!e||e.dom.parentNode==this.contentDOM);n++,r=!1);return e&&r&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?TF(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,i=-1;for(let a=n,o=0;;o++){let n=this.children[o],s=a+n.size;if(r==-1&&e<=s){let i=a+n.border;if(e>=i&&t<=s-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,i);e=a;for(let t=o;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=TF(n.dom)+1;break}e-=n.size}r==-1&&(r=0)}if(r>-1&&(s>t||o==this.children.length-1)){t=s;for(let e=o+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){i=TF(n.dom);break}t+=n.size}i==-1&&(i=this.contentDOM.childNodes.length);break}a=s}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return t.size==0||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(t.nodeType!=1||n==t.childNodes.length)throw RangeError(`No node after pos `+e);return t.childNodes[n]}setSelection(e,t,n,r=!1){let i=Math.min(e,t),a=Math.max(e,t);for(let o=0,s=0;o<this.children.length;o++){let c=this.children[o],l=s+c.size;if(i>s&&a<l)return c.setSelection(e-s-c.border,t-s-c.border,n,r);s=l}let o=this.domFromPos(e,e?-1:1),s=t==e?o:this.domFromPos(t,t?-1:1),c=n.root.getSelection(),l=n.domSelectionRange(),u=!1;if((XF||eI)&&e==t){let{node:e,offset:t}=o;if(e.nodeType==3){if(u=!!(t&&e.nodeValue[t-1]==`
|
|
219
|
+
`),u&&t==e.nodeValue.length)for(let t=e,n;t;t=t.parentNode){if(n=t.nextSibling){n.nodeName==`BR`&&(o=s={node:n.parentNode,offset:TF(n)+1});break}let e=t.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];u=n&&(n.nodeName==`BR`||n.contentEditable==`false`)}}if(XF&&l.focusNode&&l.focusNode!=s.node&&l.focusNode.nodeType==1){let e=l.focusNode.childNodes[l.focusOffset];e&&e.contentEditable==`false`&&(r=!0)}if(!(r||u&&eI)&&AF(o.node,o.offset,l.anchorNode,l.anchorOffset)&&AF(s.node,s.offset,l.focusNode,l.focusOffset))return;let d=!1;if((c.extend||e==t)&&!(u&&XF)){c.collapse(o.node,o.offset);try{e!=t&&c.extend(s.node,s.offset),d=!0}catch{}}if(!d){if(e>t){let e=o;o=s,s=e}let n=document.createRange();n.setEnd(s.node,s.offset),n.setStart(o.node,o.offset),c.removeAllRanges(),c.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&e.type!=`selection`}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,r=0;r<this.children.length;r++){let i=this.children[r],a=n+i.size;if(n==a?e<=a&&t>=n:e<a&&t>n){let r=n+i.border,o=a-i.border;if(e>=r&&t<=o){this.dirty=e==n||t==a?2:1,e==r&&t==o&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=3:i.markDirty(e-r,t-r);return}i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?2:3}n=a}this.dirty=2}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=e==1?2:1;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}},BI=class extends zI{constructor(e,t,n,r){let i,a=t.type.toDOM;if(typeof a==`function`&&(a=a(n,()=>{if(!i)return r;if(i.parent)return i.parent.posBeforeChild(i)})),!t.type.spec.raw){if(a.nodeType!=1){let e=document.createElement(`span`);e.appendChild(a),a=e}a.contentEditable=`false`,a.classList.add(`ProseMirror-widget`)}super(e,[],a,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return this.dirty==0&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(e):!1}ignoreMutation(e){return e.type!=`selection`||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}},VI=class extends zI{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(e,t){return e==this.textDOM?this.posAtStart+t:this.posAtStart+(t?this.size:0)}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type===`characterData`&&e.target.nodeValue==e.oldValue}},HI=class e extends zI{constructor(e,t,n,r,i){super(e,[],n,r),this.mark=t,this.spec=i}static create(t,n,r,i){let a=i.nodeViews[n.type.name],o=a&&a(n,i,r);return(!o||!o.dom)&&(o=$M.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new e(t,n,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&3||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=3&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=0){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=0}}slice(t,n,r){let i=e.create(this.parent,this.mark,!0,r),a=this.children,o=this.size;n<o&&(a=lL(a,n,o,r)),t>0&&(a=lL(a,0,t,r));for(let e=0;e<a.length;e++)a[e].parent=i;return i.children=a,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}},UI=class e extends zI{constructor(e,t,n,r,i,a,o,s,c){super(e,[],i,a),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=o}static create(t,n,r,i,a,o){let s=a.nodeViews[n.type.name],c,l=s&&s(n,a,()=>{if(!c)return o;if(c.parent)return c.parent.posBeforeChild(c)},r,i),u=l&&l.dom,d=l&&l.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw RangeError(`Text must be rendered as a DOM text node`)}else if(!u){let e=$M.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs);({dom:u,contentDOM:d}=e)}!d&&!n.isText&&u.nodeName!=`BR`&&(u.hasAttribute(`contenteditable`)||(u.contentEditable=`false`),n.type.spec.draggable&&(u.draggable=!0));let f=u;return u=eL(u,r,n),l?c=new qI(t,n,r,i,u,d||null,f,l,a,o+1):n.isText?new GI(t,n,r,i,u,f,a):new e(t,n,r,i,u,d||null,f,a,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace==`pre`&&(e.preserveWhitespace=`full`),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>U.empty)}return e}matchesNode(e,t,n){return this.dirty==0&&e.eq(this.node)&&tL(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return+!this.node.isLeaf}updateChildren(e,t){let n=this.node.inlineContent,r=t,i=e.composing?this.localCompositionInfo(e,t):null,a=i&&i.pos>-1?i:null,o=i&&i.pos<0,s=new rL(this,a&&a.node,e);oL(this.node,this.innerDeco,(t,i,a)=>{t.spec.marks?s.syncToMarks(t.spec.marks,n,e,i):t.type.side>=0&&!a&&s.syncToMarks(i==this.node.childCount?qj.none:this.node.child(i).marks,n,e,i),s.placeWidget(t,e,r)},(t,a,c,l)=>{s.syncToMarks(t.marks,n,e,l);let u;s.findNodeMatch(t,a,c,l)||o&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(u=s.findIndexWithChild(i.node))>-1&&s.updateNodeAt(t,a,c,u,e)||s.updateNextNode(t,a,c,e,l,r)||s.addNode(t,a,c,e,r),r+=t.nodeSize}),s.syncToMarks([],n,e,0),this.node.isTextblock&&s.addTextblockHacks(),s.destroyRest(),(s.changed||this.dirty==2)&&(a&&this.protectLocalComposition(e,a),JI(this.contentDOM,this.children,e),tI&&sL(this.dom))}localCompositionInfo(e,t){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof bP)||n<t||r>t+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let e=i.nodeValue,a=cL(this.node.content,e,n-t,r-t);return a<0?null:{node:i,pos:a,text:e}}return{node:i,pos:-1,text:``}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let i=t;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let a=new VI(this,i,t,r);e.input.compositionNodes.push(a),this.children=lL(this.children,n,n+r.length,e,a)}update(e,t,n,r){return this.dirty==3||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,n,r),!0)}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0}updateOuterDeco(e){if(tL(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,n=this.dom;this.dom=QI(this.dom,this.nodeDOM,ZI(this.outerDeco,this.node,t),ZI(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add(`ProseMirror-selectednode`),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove(`ProseMirror-selectednode`),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute(`draggable`))}get domAtom(){return this.node.isAtom}};function WI(e,t,n,r,i){eL(r,t,e);let a=new UI(void 0,e,t,n,r,r,r,i,0);return a.contentDOM&&a.updateChildren(i,0),a}var GI=class e extends UI{constructor(e,t,n,r,i,a,o){super(e,t,n,r,i,null,a,o,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,r){return this.dirty==3||this.dirty!=0&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=0||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=0,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return e.type!=`characterData`&&e.type!=`selection`}slice(t,n,r){let i=this.node.cut(t,n),a=document.createTextNode(i.text);return new e(this.parent,i,this.outerDeco,this.innerDeco,a,a,r)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=3)}get domAtom(){return!1}isText(e){return this.node.text==e}},KI=class extends zI{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==0&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName==`IMG`}},qI=class extends UI{constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r,i,a,o,c,l),this.spec=s}update(e,t,n,r){if(this.dirty==3)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,t,n);return i&&this.updateInner(e,t,n,r),i}return!this.contentDOM&&!e.isLeaf?!1:super.update(e,t,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n.root):super.setSelection(e,t,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}};function JI(e,t,n){let r=e.firstChild,i=!1;for(let a=0;a<t.length;a++){let o=t[a],s=o.dom;if(s.parentNode==e){for(;s!=r;)r=nL(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(s,r);if(o instanceof HI){let t=r?r.previousSibling:e.lastChild;JI(o.contentDOM,o.children,n),r=t?t.nextSibling:e.firstChild}}for(;r;)r=nL(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}const YI=function(e){e&&(this.nodeName=e)};YI.prototype=Object.create(null);const XI=[new YI];function ZI(e,t,n){if(e.length==0)return XI;let r=n?XI[0]:new YI,i=[r];for(let a=0;a<e.length;a++){let o=e[a].type.attrs;if(o){o.nodeName&&i.push(r=new YI(o.nodeName));for(let e in o){let a=o[e];a!=null&&(n&&i.length==1&&i.push(r=new YI(t.isInline?`span`:`div`)),e==`class`?r.class=(r.class?r.class+` `:``)+a:e==`style`?r.style=(r.style?r.style+`;`:``)+a:e!=`nodeName`&&(r[e]=a))}}}return i}function QI(e,t,n,r){if(n==XI&&r==XI)return t;let i=t;for(let t=0;t<r.length;t++){let a=r[t],o=n[t];if(t){let t;o&&o.nodeName==a.nodeName&&i!=e&&(t=i.parentNode)&&t.nodeName.toLowerCase()==a.nodeName?i=t:(t=document.createElement(a.nodeName),t.pmIsDeco=!0,t.appendChild(i),o=XI[0],i=t)}$I(i,o||XI[0],a)}return i}function $I(e,t,n){for(let r in t)r!=`class`&&r!=`style`&&r!=`nodeName`&&!(r in n)&&e.removeAttribute(r);for(let r in n)r!=`class`&&r!=`style`&&r!=`nodeName`&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(` `).filter(Boolean):[],i=n.class?n.class.split(` `).filter(Boolean):[];for(let t=0;t<r.length;t++)i.indexOf(r[t])==-1&&e.classList.remove(r[t]);for(let t=0;t<i.length;t++)r.indexOf(i[t])==-1&&e.classList.add(i[t]);e.classList.length==0&&e.removeAttribute(`class`)}if(t.style!=n.style){if(t.style){let n=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,r;for(;r=n.exec(t.style);)e.style.removeProperty(r[1])}n.style&&(e.style.cssText+=n.style)}}function eL(e,t,n){return QI(e,e,XI,ZI(t,n,e.nodeType!=1))}function tL(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function nL(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}var rL=class{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=iL(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n,r){let i=0,a=this.stack.length>>1,o=Math.min(a,e.length);for(;i<o&&(i==a-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<a;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),a--;for(;a<e.length;){this.stack.push(this.top,this.index+1);let i=-1,o=this.top.children.length;r<this.preMatch.index&&(o=Math.min(this.index+3,o));for(let t=this.index;t<o;t++){let n=this.top.children[t];if(n.matchesMark(e[a])&&!this.isLocked(n.dom)){i=t;break}}if(i>-1)i>this.index&&(this.changed=!0,this.destroyBetween(this.index,i)),this.top=this.top.children[this.index];else{let r=HI.create(this.top,e[a],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,a++}}findNodeMatch(e,t,n,r){let i=-1,a;if(r>=this.preMatch.index&&(a=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&a.matchesNode(e,t,n))i=this.top.children.indexOf(a,this.index);else for(let r=this.index,a=Math.min(this.top.children.length,r+5);r<a;r++){let a=this.top.children[r];if(a.matchesNode(e,t,n)&&!this.preMatch.matched.has(a)){i=r;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,t,n,r,i){let a=this.top.children[r];return a.dirty==3&&a.dom==a.contentDOM&&(a.dirty=2),a.update(e,t,n,i)?(this.destroyBetween(this.index,r),this.index++,!0):!1}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t){for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e}return-1}e=t}}updateNextNode(e,t,n,r,i,a){for(let o=this.index;o<this.top.children.length;o++){let s=this.top.children[o];if(s instanceof UI){let c=this.preMatch.matched.get(s);if(c!=null&&c!=i)return!1;let l=s.dom,u,d=this.isLocked(l)&&!(e.isText&&s.node&&s.node.isText&&s.nodeDOM.nodeValue==e.text&&s.dirty!=3&&tL(t,s.outerDeco));if(!d&&s.update(e,t,n,r))return this.destroyBetween(this.index,o),s.dom!=l&&(this.changed=!0),this.index++,!0;if(!d&&(u=this.recreateWrapper(s,e,t,n,r,a)))return this.destroyBetween(this.index,o),this.top.children[this.index]=u,u.contentDOM&&(u.dirty=2,u.updateChildren(r,a+1),u.dirty=0),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,r,i,a){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!tL(n,e.outerDeco)||!r.eq(e.innerDeco))return null;let o=UI.create(this.top,t,n,r,i,a);if(o.contentDOM){o.children=e.children,e.children=[];for(let e of o.children)e.parent=o}return e.destroy(),o}addNode(e,t,n,r,i){let a=UI.create(this.top,e,t,n,r,i);a.contentDOM&&a.updateChildren(r,i+1),this.top.children.splice(this.index++,0,a),this.changed=!0}placeWidget(e,t,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(r&&r.matchesWidget(e)&&(e==r.widget||!r.widget.type.toDOM.parentNode))this.index++;else{let r=new BI(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof HI;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof GI)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((eI||QF)&&e&&e.dom.contentEditable==`false`&&this.addHackNode(`IMG`,t),this.addHackNode(`BR`,this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);e==`IMG`&&(n.className=`ProseMirror-separator`,n.alt=``),e==`BR`&&(n.className=`ProseMirror-trailingBreak`);let r=new KI(this.top,[],n,null);t==this.top?t.children.splice(this.index++,0,r):t.children.push(r),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}};function iL(e,t){let n=t,r=n.children.length,i=e.childCount,a=new Map,o=[];outer:for(;i>0;){let s;for(;;)if(r){let e=n.children[r-1];if(e instanceof HI)n=e,r=e.children.length;else{s=e,r--;break}}else if(n==t)break outer;else r=n.parent.children.indexOf(n),n=n.parent;let c=s.node;if(c){if(c!=e.child(i-1))break;--i,a.set(s,i),o.push(s)}}return{index:i,matched:a,matches:o.reverse()}}function aL(e,t){return e.type.side-t.type.side}function oL(e,t,n,r){let i=t.locals(e),a=0;if(i.length==0){for(let n=0;n<e.childCount;n++){let o=e.child(n);r(o,i,t.forChild(a,o),n),a+=o.nodeSize}return}let o=0,s=[],c=null;for(let l=0;;){let u,d;for(;o<i.length&&i[o].to==a;){let e=i[o++];e.widget&&(u?(d||=[u]).push(e):u=e)}if(u){if(d){d.sort(aL);for(let e=0;e<d.length;e++)n(d[e],l,!!c)}else n(u,l,!!c)}let f,p;if(c)p=-1,f=c,c=null;else if(l<e.childCount)p=l,f=e.child(l++);else break;for(let e=0;e<s.length;e++)s[e].to<=a&&s.splice(e--,1);for(;o<i.length&&i[o].from<=a&&i[o].to>a;)s.push(i[o++]);let m=a+f.nodeSize;if(f.isText){let e=m;o<i.length&&i[o].from<e&&(e=i[o].from);for(let t=0;t<s.length;t++)s[t].to<e&&(e=s[t].to);e<m&&(c=f.cut(e-a),f=f.cut(0,e-a),m=e,p=-1)}else for(;o<i.length&&i[o].to<m;)o++;let h=f.isInline&&!f.isLeaf?s.filter(e=>!e.inline):s.slice();r(f,h,t.forChild(a,f),p),a=m}}function sL(e){if(e.nodeName==`UL`||e.nodeName==`OL`){let t=e.style.cssText;e.style.cssText=t+`; list-style: square !important`,window.getComputedStyle(e).listStyle,e.style.cssText=t}}function cL(e,t,n,r){for(let i=0,a=0;i<e.childCount&&a<=r;){let o=e.child(i++),s=a;if(a+=o.nodeSize,!o.isText)continue;let c=o.text;for(;i<e.childCount;){let t=e.child(i++);if(a+=t.nodeSize,!t.isText)break;c+=t.text}if(a>=n){if(a>=r&&c.slice(r-t.length-s,r-s)==t)return r-t.length;let e=s<r?c.lastIndexOf(t,r-s-1):-1;if(e>=0&&e+t.length+s>=n)return s+e;if(n==r&&c.length>=r+t.length-s&&c.slice(r-s,r-s+t.length)==t)return r}}return-1}function lL(e,t,n,r,i){let a=[];for(let o=0,s=0;o<e.length;o++){let c=e[o],l=s,u=s+=c.size;l>=n||u<=t?a.push(c):(l<t&&a.push(c.slice(0,t-l,r)),i&&=(a.push(i),void 0),u>n&&a.push(c.slice(n-l,c.size,r)))}return a}function uL(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),a=i&&i.size==0,o=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(o<0)return null;let s=r.resolve(o),c,l;if(RF(n)){for(c=o;i&&!i.node;)i=i.parent;let e=i.node;if(i&&e.isAtom&&SP.isSelectable(e)&&i.parent&&!(e.isInline&&IF(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;l=new SP(o==e?s:r.resolve(e))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let t=o,i=o;for(let r=0;r<n.rangeCount;r++){let a=n.getRangeAt(r);t=Math.min(t,e.docView.posFromDOM(a.startContainer,a.startOffset,1)),i=Math.max(i,e.docView.posFromDOM(a.endContainer,a.endOffset,-1))}if(t<0)return null;[c,o]=i==e.state.selection.anchor?[i,t]:[t,i],s=r.resolve(o)}else c=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(c<0)return null}let u=r.resolve(c);if(!l){let n=t==`pointer`||e.state.selection.head<s.pos&&!a?1:-1;l=xL(e,u,s,n)}return l}function dL(e){return e.editable?e.hasFocus():CL(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function fL(e,t=!1){let n=e.state.selection;if(yL(e,n),dL(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&QF){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&AF(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)vL(e);else{let{anchor:r,head:i}=n,a,o;pL&&!(n instanceof bP)&&(n.$from.parent.inlineContent||(a=mL(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(o=mL(e,n.to))),e.docView.setSelection(r,i,e,t),pL&&(a&&gL(a),o&&gL(o)),n.visible?e.dom.classList.remove(`ProseMirror-hideselection`):(e.dom.classList.add(`ProseMirror-hideselection`),`onselectionchange`in document&&_L(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const pL=eI||QF&&$F<63;function mL(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,a=r?n.childNodes[r-1]:null;if(eI&&i&&i.contentEditable==`false`)return hL(i);if((!i||i.contentEditable==`false`)&&(!a||a.contentEditable==`false`)){if(i)return hL(i);if(a)return hL(a)}}function hL(e){return e.contentEditable=`true`,eI&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function gL(e){e.contentEditable=`false`,e.wasDraggable&&=(e.draggable=!0,null)}function _L(e){let t=e.dom.ownerDocument;t.removeEventListener(`selectionchange`,e.input.hideSelectionGuard);let n=e.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;t.addEventListener(`selectionchange`,e.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(t.removeEventListener(`selectionchange`,e.input.hideSelectionGuard),setTimeout(()=>{(!dL(e)||e.state.selection.visible)&&e.dom.classList.remove(`ProseMirror-hideselection`)},20))})}function vL(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r=n.nodeName==`IMG`;r?t.collapse(n.parentNode,TF(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&JF&&YF<=11&&(n.disabled=!0,n.disabled=!1)}function yL(e,t){if(t instanceof SP){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(bL(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else bL(e)}function bL(e){e.lastSelectedViewDesc&&=(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),void 0)}function xL(e,t,n,r){return e.someProp(`createSelectionBetween`,r=>r(e,t,n))||bP.between(t,n,r)}function SL(e){return e.editable&&!e.hasFocus()?!1:CL(e)}function CL(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function wL(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return AF(t.node,t.offset,n.anchorNode,n.anchorOffset)}function TL(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),a=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return a&&gP.findFrom(a,t)}function EL(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function DL(e,t,n){let r=e.state.selection;if(r instanceof bP){if(n.indexOf(`s`)>-1){let{$head:n}=r,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let a=e.state.doc.resolve(n.pos+i.nodeSize*(t<0?-1:1));return EL(e,new bP(r.$anchor,a))}if(!r.empty)return!1;if(e.endOfTextblock(t>0?`forward`:`backward`)){let n=TL(e.state,t);return n&&n instanceof SP?EL(e,n):!1}if(!(nI&&n.indexOf(`m`)>-1)){let n=r.$head,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter,a;if(!i||i.isText)return!1;let o=t<0?n.pos-i.nodeSize:n.pos;return i.isAtom||(a=e.docView.descAt(o))&&!a.contentDOM?SP.isSelectable(i)?EL(e,new SP(t<0?e.state.doc.resolve(n.pos-i.nodeSize):n)):aI?EL(e,new bP(e.state.doc.resolve(t<0?o:o+i.nodeSize))):!1:!1}}else if(r instanceof SP&&r.node.isInline)return EL(e,new bP(t>0?r.$to:r.$from));else{let n=TL(e.state,t);return n?EL(e,n):!1}}function OL(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function kL(e,t){let n=e.pmViewDesc;return n&&n.size==0&&(t<0||e.nextSibling||e.nodeName!=`BR`)}function AL(e,t){return t<0?jL(e):ML(e)}function jL(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,a,o=!1;for(XF&&n.nodeType==1&&r<OL(n)&&kL(n.childNodes[r],-1)&&(o=!0);;)if(r>0){if(n.nodeType!=1)break;{let e=n.childNodes[r-1];if(kL(e,-1))i=n,a=--r;else if(e.nodeType==3)n=e,r=n.nodeValue.length;else break}}else if(NL(n))break;else{let t=n.previousSibling;for(;t&&kL(t,-1);)i=n.parentNode,a=TF(t),t=t.previousSibling;if(t)n=t,r=OL(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}o?IL(e,n,r):i&&IL(e,i,a)}function ML(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=OL(n),a,o;for(;;)if(r<i){if(n.nodeType!=1)break;let e=n.childNodes[r];if(kL(e,1))a=n,o=++r;else break}else if(NL(n))break;else{let t=n.nextSibling;for(;t&&kL(t,1);)a=t.parentNode,o=TF(t)+1,t=t.nextSibling;if(t)n=t,r=0,i=OL(n);else{if(n=n.parentNode,n==e.dom)break;r=i=0}}a&&IL(e,a,o)}function NL(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function PL(e,t){for(;e&&t==e.childNodes.length&&!LF(e);)t=TF(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable==`false`)break;e=n,t=0}}function FL(e,t){for(;e&&!t&&!LF(e);)t=TF(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable==`false`)break;e=n,t=e.childNodes.length}}function IL(e,t,n){if(t.nodeType!=3){let e,r;(r=PL(t,n))?(t=r,n=0):(e=FL(t,n))&&(t=e,n=e.nodeValue.length)}let r=e.domSelection();if(!r)return;if(RF(r)){let e=document.createRange();e.setEnd(t,n),e.setStart(t,n),r.removeAllRanges(),r.addRange(e)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&fL(e)},50)}function LL(e,t){let n=e.state.doc.resolve(t);if(!(QF||rI)&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left<r.left?`ltr`:`rtl`}if(t<n.end()){let n=e.coordsAtPos(t+1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left>r.left?`ltr`:`rtl`}}return getComputedStyle(e.dom).direction==`rtl`?`rtl`:`ltr`}function RL(e,t,n){let r=e.state.selection;if(r instanceof bP&&!r.empty||n.indexOf(`s`)>-1||nI&&n.indexOf(`m`)>-1)return!1;let{$from:i,$to:a}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?`up`:`down`)){let n=TL(e.state,t);if(n&&n instanceof SP)return EL(e,n)}if(!i.parent.inlineContent){let n=t<0?i:a,o=r instanceof wP?gP.near(n,t):gP.findFrom(n,t);return o?EL(e,o):!1}return!1}function zL(e,t){if(!(e.state.selection instanceof bP))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?`forward`:`backward`))return!0;let a=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(a&&!a.isText){let r=e.state.tr;return t<0?r.delete(n.pos-a.nodeSize,n.pos):r.delete(n.pos,n.pos+a.nodeSize),e.dispatch(r),!0}return!1}function BL(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function VL(e){if(!eI||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&t.nodeType==1&&n==0&&t.firstChild&&t.firstChild.contentEditable==`false`){let n=t.firstChild;BL(e,n,`true`),setTimeout(()=>BL(e,n,`false`),20)}return!1}function HL(e){let t=``;return e.ctrlKey&&(t+=`c`),e.metaKey&&(t+=`m`),e.altKey&&(t+=`a`),e.shiftKey&&(t+=`s`),t}function UL(e,t){let n=t.keyCode,r=HL(t);if(n==8||nI&&n==72&&r==`c`)return zL(e,-1)||AL(e,-1);if(n==46&&!t.shiftKey||nI&&n==68&&r==`c`)return zL(e,1)||AL(e,1);if(n==13||n==27)return!0;if(n==37||nI&&n==66&&r==`c`){let t=n==37?LL(e,e.state.selection.from)==`ltr`?-1:1:-1;return DL(e,t,r)||AL(e,t)}if(n==39||nI&&n==70&&r==`c`){let t=n==39?LL(e,e.state.selection.from)==`ltr`?1:-1:1;return DL(e,t,r)||AL(e,t)}return n==38||nI&&n==80&&r==`c`?RL(e,-1,r)||AL(e,-1):n==40||nI&&n==78&&r==`c`?VL(e)||RL(e,1,r)||AL(e,1):!(r!=(nI?`m`:`c`)||n!=66&&n!=73&&n!=89&&n!=90)}function WL(e,t){e.someProp(`transformCopied`,n=>{t=n(t,e)});let n=[],{content:r,openStart:i,openEnd:a}=t;for(;i>1&&a>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,a--;let e=r.firstChild;n.push(e.type.name,e.attrs==e.type.defaultAttrs?null:e.attrs),r=e.content}let o=e.someProp(`clipboardSerializer`)||$M.fromSchema(e.state.schema),s=tR(),c=s.createElement(`div`);c.appendChild(o.serializeFragment(r,{document:s}));let l=c.firstChild,u,d=0;for(;l&&l.nodeType==1&&(u=$L[l.nodeName.toLowerCase()]);){for(let e=u.length-1;e>=0;e--){let t=s.createElement(u[e]);for(;c.firstChild;)t.appendChild(c.firstChild);c.appendChild(t),d++}l=c.firstChild}return l&&l.nodeType==1&&l.setAttribute(`data-pm-slice`,`${i} ${a}${d?` -${d}`:``} ${JSON.stringify(n)}`),{dom:c,text:e.someProp(`clipboardTextSerializer`,n=>n(t,e))||t.content.textBetween(0,t.content.size,`
|
|
220
|
+
|
|
221
|
+
`),slice:t}}function GL(e,t,n,r,i){let a=i.parent.type.spec.code,o,s;if(!n&&!t)return null;let c=!!t&&(r||a||!n);if(c){if(e.someProp(`transformPastedText`,n=>{t=n(t,a||r,e)}),a)return s=new W(U.from(e.state.schema.text(t.replace(/\r\n?/g,`
|
|
222
|
+
`))),0,0),e.someProp(`transformPasted`,t=>{s=t(s,e,!0)}),s;let n=e.someProp(`clipboardTextParser`,n=>n(t,i,r,e));if(n)s=n;else{let n=i.marks(),{schema:r}=e.state,a=$M.fromSchema(r);o=document.createElement(`div`),t.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=o.appendChild(document.createElement(`p`));e&&t.appendChild(a.serializeNode(r.text(e,n)))})}}else e.someProp(`transformPastedHTML`,t=>{n=t(n,e)}),o=iR(n),aI&&aR(o);let l=o&&o.querySelector(`[data-pm-slice]`),u=l&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(l.getAttribute(`data-pm-slice`)||``);if(u&&u[3])for(let e=+u[3];e>0;e--){let e=o.firstChild;for(;e&&e.nodeType!=1;)e=e.nextSibling;if(!e)break;o=e}if(s||=(e.someProp(`clipboardParser`)||e.someProp(`domParser`)||HM.fromSchema(e.state.schema)).parseSlice(o,{preserveWhitespace:!!(c||u),context:i,ruleFromNode(e){return e.nodeName==`BR`&&!e.nextSibling&&e.parentNode&&!KL.test(e.parentNode.nodeName)?{ignore:!0}:null}}),u)s=oR(QL(s,+u[1],+u[2]),u[4]);else if(s=W.maxOpen(qL(s.content,i),!0),s.openStart||s.openEnd){let e=0,t=0;for(let t=s.content.firstChild;e<s.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=s.content.lastChild;t<s.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);s=QL(s,e,t)}return e.someProp(`transformPasted`,t=>{s=t(s,e,c)}),s}const KL=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function qL(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.index(n)),i,a=[];if(e.forEach(e=>{if(!a)return;let t=r.findWrapping(e.type),n;if(!t)return a=null;if(n=a.length&&i.length&&YL(t,i,e,a[a.length-1],0))a[a.length-1]=n;else{a.length&&(a[a.length-1]=XL(a[a.length-1],i.length));let n=JL(e,t);a.push(n),r=r.matchType(n.type),i=t}}),a)return U.from(a)}return e}function JL(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,U.from(e));return e}function YL(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let a=YL(e,t,n,r.lastChild,i+1);if(a)return r.copy(r.content.replaceChild(r.childCount-1,a));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(U.from(JL(n,e,i+1))))}}function XL(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,XL(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(U.empty,!0);return e.copy(n.append(r))}function ZL(e,t,n,r,i,a){let o=t<0?e.firstChild:e.lastChild,s=o.content;return e.childCount>1&&(a=0),i<r-1&&(s=ZL(s,t,n,r,i+1,a)),i>=n&&(s=t<0?o.contentMatchAt(0).fillBefore(s,a<=i).append(s):s.append(o.contentMatchAt(o.childCount).fillBefore(U.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,o.copy(s))}function QL(e,t,n){return t<e.openStart&&(e=new W(ZL(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new W(ZL(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const $L={thead:[`table`],tbody:[`table`],tfoot:[`table`],caption:[`table`],colgroup:[`table`],col:[`table`,`colgroup`],tr:[`table`,`tbody`],td:[`table`,`tbody`,`tr`],th:[`table`,`tbody`,`tr`]};let eR=null;function tR(){return eR||=document.implementation.createHTMLDocument(`title`)}let nR=null;function rR(e){let t=window.trustedTypes;return t?(nR||=t.defaultPolicy||t.createPolicy(`ProseMirrorClipboard`,{createHTML:e=>e}),nR.createHTML(e)):e}function iR(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=tR().createElement(`div`),r=/<([a-z][^>\s]+)/i.exec(e),i;if((i=r&&$L[r[1].toLowerCase()])&&(e=i.map(e=>`<`+e+`>`).join(``)+e+i.map(e=>`</`+e+`>`).reverse().join(``)),n.innerHTML=rR(e),i)for(let e=0;e<i.length;e++)n=n.querySelector(i[e])||n;return n}function aR(e){let t=e.querySelectorAll(QF?`span:not([class]):not([style])`:`span.Apple-converted-space`);for(let n=0;n<t.length;n++){let r=t[n];r.childNodes.length==1&&r.textContent==`\xA0`&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(` `),r)}}function oR(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch{return e}let{content:i,openStart:a,openEnd:o}=e;for(let e=r.length-2;e>=0;e-=2){let t=n.nodes[r[e]];if(!t||t.hasRequiredAttrs())break;i=U.from(t.create(r[e+1],i)),a++,o++}return new W(i,a,o)}const sR={},cR={},lR={touchstart:!0,touchmove:!0};var uR=class{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:``,button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}};function dR(e){for(let t in sR){let n=sR[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{gR(e,t)&&!hR(e,t)&&(e.editable||!(t.type in cR))&&n(e,t)},lR[t]?{passive:!0}:void 0)}eI&&e.dom.addEventListener(`input`,()=>null),mR(e)}function fR(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function pR(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function mR(e){e.someProp(`handleDOMEvents`,t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>hR(e,t))})}function hR(e,t){return e.someProp(`handleDOMEvents`,n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function gR(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function _R(e,t){!hR(e,t)&&sR[t.type]&&(e.editable||!(t.type in cR))&&sR[t.type](e,t)}cR.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!jR(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(iI&&QF&&n.keyCode==13))){if(n.keyCode!=229&&e.domObserver.forceFlush(),tI&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==t&&(e.someProp(`handleKeyDown`,t=>t(e,zF(13,`Enter`))),e.input.lastIOSEnter=0)},200)}else e.someProp(`handleKeyDown`,t=>t(e,n))||UL(e,n)?n.preventDefault():fR(e,`key`)}},cR.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)},cR.keypress=(e,t)=>{let n=t;if(jR(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||nI&&n.metaKey)return;if(e.someProp(`handleKeyPress`,t=>t(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof bP)||!r.$from.sameParent(r.$to)){let t=String.fromCharCode(n.charCode),i=()=>e.state.tr.insertText(t).scrollIntoView();!/[\r\n]/.test(t)&&!e.someProp(`handleTextInput`,n=>n(e,r.$from.pos,r.$to.pos,t,i))&&e.dispatch(i()),n.preventDefault()}};function vR(e){return{left:e.clientX,top:e.clientY}}function yR(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function bR(e,t,n,r,i){if(r==-1)return!1;let a=e.state.doc.resolve(r);for(let r=a.depth+1;r>0;r--)if(e.someProp(t,t=>r>a.depth?t(e,n,a.nodeAfter,a.before(r),i,!0):t(e,n,a.node(r),a.before(r),i,!1)))return!0;return!1}function xR(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);n==`pointer`&&r.setMeta(`pointer`,!0),e.dispatch(r)}function SR(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&SP.isSelectable(r)?(xR(e,new SP(n),`pointer`),!0):!1}function CR(e,t){if(t==-1)return!1;let n=e.state.selection,r,i;n instanceof SP&&(r=n.node);let a=e.state.doc.resolve(t);for(let e=a.depth+1;e>0;e--){let t=e>a.depth?a.nodeAfter:a.node(e);if(SP.isSelectable(t)){i=r&&n.$from.depth>0&&e>=n.$from.depth&&a.before(n.$from.depth+1)==n.$from.pos?a.before(n.$from.depth):a.before(e);break}}return i!=null&&(xR(e,SP.create(e.state.doc,i),`pointer`),!0)}function wR(e,t,n,r,i){return bR(e,`handleClickOn`,t,n,r)||e.someProp(`handleClick`,n=>n(e,t,r))||(i?CR(e,n):SR(e,n))}function TR(e,t,n,r){return bR(e,`handleDoubleClickOn`,t,n,r)||e.someProp(`handleDoubleClick`,n=>n(e,t,r))}function ER(e,t,n,r){return bR(e,`handleTripleClickOn`,t,n,r)||e.someProp(`handleTripleClick`,n=>n(e,t,r))||DR(e,n,r)}function DR(e,t,n){if(n.button!=0)return!1;let r=e.state.doc;if(t==-1)return r.inlineContent?(xR(e,bP.create(r,0,r.content.size),`pointer`),!0):!1;let i=r.resolve(t);for(let t=i.depth+1;t>0;t--){let n=t>i.depth?i.nodeAfter:i.node(t),a=i.before(t);if(n.inlineContent)xR(e,bP.create(r,a+1,a+1+n.content.size),`pointer`);else if(SP.isSelectable(n))xR(e,SP.create(r,a),`pointer`);else continue;return!0}}function OR(e){return RR(e)}const kR=nI?`metaKey`:`ctrlKey`;sR.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=OR(e),i=Date.now(),a=`singleClick`;i-e.input.lastClick.time<500&&yR(n,e.input.lastClick)&&!n[kR]&&e.input.lastClick.button==n.button&&(e.input.lastClick.type==`singleClick`?a=`doubleClick`:e.input.lastClick.type==`doubleClick`&&(a=`tripleClick`)),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:a,button:n.button};let o=e.posAtCoords(vR(n));o&&(a==`singleClick`?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new AR(e,o,n,!!r)):(a==`doubleClick`?TR:ER)(e,o.pos,o.inside,n)?n.preventDefault():fR(e,`pointer`))};var AR=class{constructor(e,t,n,r){this.view=e,this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[kR],this.allowDefault=n.shiftKey;let i,a;if(t.inside>-1)i=e.state.doc.nodeAt(t.inside),a=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,a=n.depth?n.before():0}let o=r?null:n.target,s=o?e.docView.nearestDesc(o,!0):null;this.target=s&&s.nodeDOM.nodeType==1?s.nodeDOM:null;let{selection:c}=e.state;n.button==0&&(i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof SP&&c.from<=a&&c.to>a)&&(this.mightDrag={node:i,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&XF&&!this.target.hasAttribute(`contentEditable`))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute(`contentEditable`,`false`)},20),this.view.domObserver.start()),e.root.addEventListener(`mouseup`,this.up=this.up.bind(this)),e.root.addEventListener(`mousemove`,this.move=this.move.bind(this)),fR(e,`pointer`)}done(){this.view.root.removeEventListener(`mouseup`,this.up),this.view.root.removeEventListener(`mousemove`,this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute(`draggable`),this.mightDrag.setUneditable&&this.target.removeAttribute(`contentEditable`),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>fL(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(vR(e))),this.updateAllowDefault(e),this.allowDefault||!t?fR(this.view,`pointer`):wR(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||eI&&this.mightDrag&&!this.mightDrag.node.isAtom||QF&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(xR(this.view,gP.near(this.view.state.doc.resolve(t.pos)),`pointer`),e.preventDefault()):fR(this.view,`pointer`)}move(e){this.updateAllowDefault(e),fR(this.view,`pointer`),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}};sR.touchstart=e=>{e.input.lastTouch=Date.now(),OR(e),fR(e,`pointer`)},sR.touchmove=e=>{e.input.lastTouch=Date.now(),fR(e,`pointer`)},sR.contextmenu=e=>OR(e);function jR(e,t){return e.composing?!0:eI&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}const MR=iI?5e3:-1;cR.compositionstart=cR.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof bP&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>e.type.spec.inclusive===!1)||QF&&rI&&NR(e)))e.markCursor=e.state.storedMarks||n.marks(),RR(e,!0),e.markCursor=null;else if(RR(e,!t.selection.empty),XF&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&n.nodeType==1&&r!=0;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(t.nodeType==3){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}n=t,r=-1}}e.input.composing=!0}PR(e,MR)};function NR(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||t.nodeType!=1||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return r.nodeType==1&&r.contentEditable==`false`}cR.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,PR(e,20))};function PR(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>RR(e),t))}function FR(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=LR());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function IR(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=PF(t.focusNode,t.focusOffset),r=FF(t.focusNode,t.focusOffset);if(n&&r&&n!=r){let t=r.pmViewDesc,i=e.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!t||!t.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let e=n.pmViewDesc;if(!(!e||!e.isText(n.nodeValue)))return r}}return n||r}function LR(){let e=document.createEvent(`Event`);return e.initEvent(`event`,!0,!0),e.timeStamp}function RR(e,t=!1){if(!(iI&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),FR(e),t||e.docView&&e.docView.dirty){let n=uL(e),r=e.state.selection;return n&&!n.eq(r)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}function zR(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement(`div`));n.appendChild(t),n.style.cssText=`position: fixed; left: -10000px; top: 10px`;let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}const BR=JF&&YF<15||tI&&oI<604;sR.copy=cR.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type==`cut`;if(r.empty)return;let a=BR?null:n.clipboardData,{dom:o,text:s}=WL(e,r.content());a?(n.preventDefault(),a.clearData(),a.setData(`text/html`,o.innerHTML),a.setData(`text/plain`,s)):zR(e,o),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta(`uiEvent`,`cut`))};function VR(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function HR(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?`textarea`:`div`));n||(r.contentEditable=`true`),r.style.cssText=`position: fixed; left: -10000px; top: 10px`,r.focus();let i=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?UR(e,r.value,null,i,t):UR(e,r.textContent,r.innerHTML,i,t)},50)}function UR(e,t,n,r,i){let a=GL(e,t,n,r,e.state.selection.$from);if(e.someProp(`handlePaste`,t=>t(e,i,a||W.empty)))return!0;if(!a)return!1;let o=VR(a),s=o?e.state.tr.replaceSelectionWith(o,r):e.state.tr.replaceSelection(a);return e.dispatch(s.scrollIntoView().setMeta(`paste`,!0).setMeta(`uiEvent`,`paste`)),!0}function WR(e){let t=e.getData(`text/plain`)||e.getData(`Text`);if(t)return t;let n=e.getData(`text/uri-list`);return n?n.replace(/\r?\n/g,` `):``}cR.paste=(e,t)=>{let n=t;if(e.composing&&!iI)return;let r=BR?null:n.clipboardData,i=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&UR(e,WR(r),r.getData(`text/html`),i,n)?n.preventDefault():HR(e,n)};var GR=class{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}};const KR=nI?`altKey`:`ctrlKey`;function qR(e,t){let n;return e.someProp(`dragCopies`,e=>{n||=e(t)}),n==null?!t[KR]:!n}sR.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,a=i.empty?null:e.posAtCoords(vR(n)),o;if(!(a&&a.pos>=i.from&&a.pos<=(i instanceof SP?i.to-1:i.to))){if(r&&r.mightDrag)o=SP.create(e.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&(o=SP.create(e.state.doc,t.posBefore))}}let{dom:s,text:c,slice:l}=WL(e,(o||e.state.selection).content());(!n.dataTransfer.files.length||!QF||$F>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(BR?`Text`:`text/html`,s.innerHTML),n.dataTransfer.effectAllowed=`copyMove`,BR||n.dataTransfer.setData(`text/plain`,c),e.dragging=new GR(l,qR(e,n),o)},sR.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},cR.dragover=cR.dragenter=(e,t)=>t.preventDefault(),cR.drop=(e,t)=>{try{JR(e,t,e.dragging)}finally{e.dragging=null}};function JR(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(vR(t));if(!r)return;let i=e.state.doc.resolve(r.pos),a=n&&n.slice;a?e.someProp(`transformPasted`,t=>{a=t(a,e,!1)}):a=GL(e,WR(t.dataTransfer),BR?null:t.dataTransfer.getData(`text/html`),!1,i);let o=!!(n&&qR(e,t));if(e.someProp(`handleDrop`,n=>n(e,t,a||W.empty,o))){t.preventDefault();return}if(!a)return;t.preventDefault();let s=a?YN(e.state.doc,i.pos,a):i.pos;s??=i.pos;let c=e.state.tr;if(o){let{node:e}=n;e?e.replace(c):c.deleteSelection()}let l=c.mapping.map(s),u=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,d=c.doc;if(u?c.replaceRangeWith(l,l,a.content.firstChild):c.replaceRange(l,l,a),c.doc.eq(d))return;let f=c.doc.resolve(l);if(u&&SP.isSelectable(a.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new SP(f));else{let t=c.mapping.map(s);c.mapping.maps[c.mapping.maps.length-1].forEach((e,n,r,i)=>t=i),c.setSelection(xL(e,f,c.doc.resolve(t)))}e.focus(),e.dispatch(c.setMeta(`uiEvent`,`drop`))}sR.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add(`ProseMirror-focused`),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&fL(e)},20))},sR.blur=(e,t)=>{let n=t;e.focused&&=(e.domObserver.stop(),e.dom.classList.remove(`ProseMirror-focused`),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),!1)},sR.beforeinput=(e,t)=>{if(QF&&iI&&t.inputType==`deleteContentBackward`){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=t||(e.dom.blur(),e.focus(),e.someProp(`handleKeyDown`,t=>t(e,zF(8,`Backspace`)))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())},50)}};for(let e in cR)sR[e]=cR[e];function YR(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}var XR=class e{constructor(e,t){this.toDOM=e,this.spec=t||tz,this.side=this.spec.side||0}map(e,t,n,r){let{pos:i,deleted:a}=e.mapResult(t.from+r,this.side<0?-1:1);return a?null:new $R(i-n,i-n,this)}valid(){return!0}eq(t){return this==t||t instanceof e&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&YR(this.spec,t.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}},ZR=class e{constructor(e,t){this.attrs=e,this.spec=t||tz}map(e,t,n,r){let i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,a=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=a?null:new $R(i,a,this)}valid(e,t){return t.from<t.to}eq(t){return this==t||t instanceof e&&YR(this.attrs,t.attrs)&&YR(this.spec,t.spec)}static is(t){return t.type instanceof e}destroy(){}},QR=class e{constructor(e,t){this.attrs=e,this.spec=t||tz}map(e,t,n,r){let i=e.mapResult(t.from+r,1);if(i.deleted)return null;let a=e.mapResult(t.to+r,-1);return a.deleted||a.pos<=i.pos?null:new $R(i.pos-n,a.pos-n,this)}valid(e,t){let{index:n,offset:r}=e.content.findIndex(t.from),i;return r==t.from&&!(i=e.child(n)).isText&&r+i.nodeSize==t.to}eq(t){return this==t||t instanceof e&&YR(this.attrs,t.attrs)&&YR(this.spec,t.spec)}destroy(){}},$R=class e{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(t,n){return new e(t,n,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(t,n,r){return new e(t,t,new XR(n,r))}static inline(t,n,r,i){return new e(t,n,new ZR(r,i))}static node(t,n,r,i){return new e(t,n,new QR(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof ZR}get widget(){return this.type instanceof XR}};const ez=[],tz={};var nz=class e{constructor(e,t){this.local=e.length?e:ez,this.children=t.length?t:ez}static create(e,t){return t.length?uz(t,e,0,tz):rz}find(e,t,n){let r=[];return this.findInner(e??0,t??1e9,r,0,n),r}findInner(e,t,n,r,i){for(let a=0;a<this.local.length;a++){let o=this.local[a];o.from<=t&&o.to>=e&&(!i||i(o.spec))&&n.push(o.copy(o.from+r,o.to+r))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<t&&this.children[a+1]>e){let o=this.children[a]+1;this.children[a+2].findInner(e-o,t-o,n,r+o,i)}}map(e,t,n){return this==rz||e.maps.length==0?this:this.mapInner(e,t,0,0,n||tz)}mapInner(t,n,r,i,a){let o;for(let e=0;e<this.local.length;e++){let s=this.local[e].map(t,r,i);s&&s.type.valid(n,s)?(o||=[]).push(s):a.onRemove&&a.onRemove(this.local[e].spec)}return this.children.length?az(this.children,o||[],t,n,r,i,a):o?new e(o.sort(dz),ez):rz}add(t,n){return n.length?this==rz?e.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let i,a=0;t.forEach((e,t)=>{let o=t+r,s;if(s=cz(n,e,o)){for(i||=this.children.slice();a<i.length&&i[a]<t;)a+=3;i[a]==t?i[a+2]=i[a+2].addInner(e,s,o+1):i.splice(a,0,t,t+e.nodeSize,uz(s,e,o+1,tz)),a+=3}});let o=oz(a?lz(n):n,-r);for(let e=0;e<o.length;e++)o[e].type.valid(t,o[e])||o.splice(e--,1);return new e(o.length?this.local.concat(o).sort(dz):this.local,i||this.children)}remove(e){return e.length==0||this==rz?this:this.removeInner(e,0)}removeInner(t,n){let r=this.children,i=this.local;for(let e=0;e<r.length;e+=3){let i,a=r[e]+n,o=r[e+1]+n;for(let e=0,n;e<t.length;e++)(n=t[e])&&n.from>a&&n.to<o&&(t[e]=null,(i||=[]).push(n));if(!i)continue;r==this.children&&(r=this.children.slice());let s=r[e+2].removeInner(i,a+1);s==rz?(r.splice(e,3),e-=3):r[e+2]=s}if(i.length){for(let e=0,r;e<t.length;e++)if(r=t[e])for(let e=0;e<i.length;e++)i[e].eq(r,n)&&(i==this.local&&(i=this.local.slice()),i.splice(e--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new e(i,r):rz}forChild(t,n){if(this==rz)return this;if(n.isLeaf)return e.empty;let r,i;for(let e=0;e<this.children.length;e+=3)if(this.children[e]>=t){this.children[e]==t&&(r=this.children[e+2]);break}let a=t+1,o=a+n.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<o&&t.to>a&&t.type instanceof ZR){let e=Math.max(a,t.from)-a,n=Math.min(o,t.to)-a;e<n&&(i||=[]).push(t.copy(e,n))}}if(i){let t=new e(i.sort(dz),ez);return r?new iz([t,r]):t}return r||rz}eq(t){if(this==t)return!0;if(!(t instanceof e)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let e=0;e<this.local.length;e++)if(!this.local[e].eq(t.local[e]))return!1;for(let e=0;e<this.children.length;e+=3)if(this.children[e]!=t.children[e]||this.children[e+1]!=t.children[e+1]||!this.children[e+2].eq(t.children[e+2]))return!1;return!0}locals(e){return fz(this.localsInner(e))}localsInner(e){if(this==rz)return ez;if(e.inlineContent||!this.local.some(ZR.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof ZR||t.push(this.local[e]);return t}forEachSet(e){e(this)}};nz.empty=new nz([],[]),nz.removeOverlap=fz;const rz=nz.empty;var iz=class e{constructor(e){this.members=e}map(t,n){let r=this.members.map(e=>e.map(t,n,tz));return e.from(r)}forChild(t,n){if(n.isLeaf)return nz.empty;let r=[];for(let i=0;i<this.members.length;i++){let a=this.members[i].forChild(t,n);a!=rz&&(a instanceof e?r=r.concat(a.members):r.push(a))}return e.from(r)}eq(t){if(!(t instanceof e)||t.members.length!=this.members.length)return!1;for(let e=0;e<this.members.length;e++)if(!this.members[e].eq(t.members[e]))return!1;return!0}locals(e){let t,n=!0;for(let r=0;r<this.members.length;r++){let i=this.members[r].localsInner(e);if(i.length){if(!t)t=i;else{n&&=(t=t.slice(),!1);for(let e=0;e<i.length;e++)t.push(i[e])}}}return t?fz(n?t:t.sort(dz)):ez}static from(t){switch(t.length){case 0:return rz;case 1:return t[0];default:return new e(t.every(e=>e instanceof nz)?t:t.reduce((e,t)=>e.concat(t instanceof nz?t:t.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}};function az(e,t,n,r,i,a,o){let s=e.slice();for(let e=0,t=a;e<n.maps.length;e++){let r=0;n.maps[e].forEach((e,n,i,a)=>{let o=a-i-(n-e);for(let i=0;i<s.length;i+=3){let a=s[i+1];if(a<0||e>a+t-r)continue;let c=s[i]+t-r;n>=c?s[i+1]=e<=c?-2:-1:e>=t&&o&&(s[i]+=o,s[i+1]+=o)}r+=o}),t=n.maps[e].map(t,-1)}let c=!1;for(let t=0;t<s.length;t+=3)if(s[t+1]<0){if(s[t+1]==-2){c=!0,s[t+1]=-1;continue}let l=n.map(e[t]+a),u=l-i;if(u<0||u>=r.content.size){c=!0;continue}let d=n.map(e[t+1]+a,-1)-i,{index:f,offset:p}=r.content.findIndex(u),m=r.maybeChild(f);if(m&&p==u&&p+m.nodeSize==d){let r=s[t+2].mapInner(n,m,l+1,e[t]+a+1,o);r==rz?(s[t+1]=-2,c=!0):(s[t]=u,s[t+1]=d,s[t+2]=r)}else c=!0}if(c){let c=uz(sz(s,e,t,n,i,a,o),r,0,o);t=c.local;for(let e=0;e<s.length;e+=3)s[e+1]<0&&(s.splice(e,3),e-=3);for(let e=0,t=0;e<c.children.length;e+=3){let n=c.children[e];for(;t<s.length&&s[t]<n;)t+=3;s.splice(t,0,c.children[e],c.children[e+1],c.children[e+2])}}return new nz(t.sort(dz),s)}function oz(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new $R(i.from+t,i.to+t,i.type))}return n}function sz(e,t,n,r,i,a,o){function s(e,t){for(let a=0;a<e.local.length;a++){let s=e.local[a].map(r,i,t);s?n.push(s):o.onRemove&&o.onRemove(e.local[a].spec)}for(let n=0;n<e.children.length;n+=3)s(e.children[n+2],e.children[n]+t+1)}for(let n=0;n<e.length;n+=3)e[n+1]==-1&&s(e[n+2],t[n]+a+1);return n}function cz(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let t=0,a;t<e.length;t++)(a=e[t])&&a.from>n&&a.to<r&&((i||=[]).push(a),e[t]=null);return i}function lz(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function uz(e,t,n,r){let i=[],a=!1;t.forEach((t,o)=>{let s=cz(e,t,o+n);if(s){a=!0;let e=uz(s,t,n+o+1,r);e!=rz&&i.push(o,o+t.nodeSize,e)}});let o=oz(a?lz(e):e,-n).sort(dz);for(let e=0;e<o.length;e++)o[e].type.valid(t,o[e])||(r.onRemove&&r.onRemove(o[e].spec),o.splice(e--,1));return o.length||i.length?new nz(o,i):rz}function dz(e,t){return e.from-t.from||e.to-t.to}function fz(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let a=t[i];if(a.from==r.from){a.to!=r.to&&(t==e&&(t=e.slice()),t[i]=a.copy(a.from,r.to),pz(t,i+1,a.copy(r.to,a.to)));continue}a.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,a.from),pz(t,i,r.copy(a.from,r.to)));break}}return t}function pz(e,t,n){for(;t<e.length&&dz(n,e[t])>0;)t++;e.splice(t,0,n)}function mz(e){let t=[];return e.someProp(`decorations`,n=>{let r=n(e.state);r&&r!=rz&&t.push(r)}),e.cursorWrapper&&t.push(nz.create(e.state.doc,[e.cursorWrapper.deco])),iz.from(t)}const hz={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},gz=JF&&YF<=11;var _z=class{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}},vz=class{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new _z,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(t=>{for(let e=0;e<t.length;e++)this.queue.push(t[e]);JF&&YF<=11&&t.some(e=>e.type==`childList`&&e.removedNodes.length||e.type==`characterData`&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():eI&&e.composing&&t.some(e=>e.type==`childList`&&e.target.nodeName==`TR`)?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),gz&&(this.onCharData=e=>{this.queue.push({target:e.target,type:`characterData`,oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,hz)),this.onCharData&&this.view.dom.addEventListener(`DOMCharacterDataModified`,this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener(`DOMCharacterDataModified`,this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener(`selectionchange`,this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener(`selectionchange`,this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(SL(this.view)){if(this.suppressingSelectionUpdates)return fL(this.view);if(JF&&YF<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&AF(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,n;for(let n=e.focusNode;n;n=EF(n))t.add(n);for(let r=e.anchorNode;r;r=EF(r))if(t.has(r)){n=r;break}let r=n&&this.view.docView.nearestDesc(n);if(r&&r.ignoreMutation({type:`selection`,target:n.nodeType==3?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let n=e.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&SL(e)&&!this.ignoreSelectionChange(n),i=-1,a=-1,o=!1,s=[];if(e.editable)for(let e=0;e<t.length;e++){let n=this.registerMutation(t[e],s);n&&(i=i<0?n.from:Math.min(n.from,i),a=a<0?n.to:Math.max(n.to,a),n.typeOver&&(o=!0))}if(s.some(e=>e.nodeName==`BR`)&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46)){for(let e of s)if(e.nodeName==`BR`&&e.parentNode){let t=e.nextSibling;for(;t&&t.nodeType==1;){if(t.contentEditable==`false`){e.parentNode.removeChild(e);break}t=t.firstChild}}}else if(XF&&s.length){let t=s.filter(e=>e.nodeName==`BR`);if(t.length==2){let[e,n]=t;e.parentNode&&e.parentNode.parentNode==n.parentNode?n.remove():e.remove()}else{let{focusNode:n}=this.currentSelection;for(let r of t){let t=r.parentNode;t&&t.nodeName==`LI`&&(!n||wz(e,n)!=t)&&r.remove()}}}let c=null;i<0&&r&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&RF(n)&&(c=uL(e))&&c.eq(gP.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,fL(e),this.currentSelection.set(n),e.scrollToSelection()):(i>-1||r)&&(i>-1&&(e.docView.markDirty(i,a),xz(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,Tz(e,s)),this.handleDOMChange(i,a,o,s),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||fL(e),this.currentSelection.set(n))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if(e.type==`attributes`&&(n==this.view.docView||e.attributeName==`contenteditable`||e.attributeName==`style`&&!e.oldValue&&!e.target.getAttribute(`style`))||!n||n.ignoreMutation(e))return null;if(e.type==`childList`){for(let n=0;n<e.addedNodes.length;n++){let r=e.addedNodes[n];t.push(r),r.nodeType==3&&(this.lastChangedTextNode=r)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,i=e.nextSibling;if(JF&&YF<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:a}=e.addedNodes[t];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(r=n),(!a||Array.prototype.indexOf.call(e.addedNodes,a)<0)&&(i=a)}let a=r&&r.parentNode==e.target?TF(r)+1:0,o=n.localPosFromDOM(e.target,a,-1),s=i&&i.parentNode==e.target?TF(i):e.target.childNodes.length;return{from:o,to:n.localPosFromDOM(e.target,s,1)}}return e.type==`attributes`?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:(this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}};let yz=new WeakMap,bz=!1;function xz(e){if(!yz.has(e)&&(yz.set(e,null),[`normal`,`nowrap`,`pre-line`].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=XF,bz)return;console.warn(`ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package.`),bz=!0}}function Sz(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,a=t.endOffset,o=e.domAtPos(e.state.selection.anchor);return AF(o.node,o.offset,i,a)&&([n,r,i,a]=[i,a,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}}function Cz(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return Sz(e,n)}let n;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.dom.addEventListener(`beforeinput`,r,!0),document.execCommand(`indent`),e.dom.removeEventListener(`beforeinput`,r,!0),n?Sz(e,n):null}function wz(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let t=e.docView.nearestDesc(n,!0);if(t&&t.node.isBlock)return n}return null}function Tz(e,t){let{focusNode:n,focusOffset:r}=e.domSelectionRange();for(let i of t)if(i.parentNode?.nodeName==`TR`){let t=i.nextSibling;for(;t&&t.nodeName!=`TD`&&t.nodeName!=`TH`;)t=t.nextSibling;if(t){let a=t;for(;;){let e=a.firstChild;if(!e||e.nodeType!=1||e.contentEditable==`false`||/^(BR|IMG)$/.test(e.nodeName))break;a=e}a.insertBefore(i,a.firstChild),n==i&&e.domSelection().collapse(i,r)}else i.parentNode.removeChild(i)}}function Ez(e,t,n){let{node:r,fromOffset:i,toOffset:a,from:o,to:s}=e.docView.parseRange(t,n),c=e.domSelectionRange(),l,u=c.anchorNode;if(u&&e.dom.contains(u.nodeType==1?u:u.parentNode)&&(l=[{node:u,offset:c.anchorOffset}],RF(c)||l.push({node:c.focusNode,offset:c.focusOffset})),QF&&e.input.lastKeyCode===8)for(let e=a;e>i;e--){let t=r.childNodes[e-1],n=t.pmViewDesc;if(t.nodeName==`BR`&&!n){a=e;break}if(!n||n.size)break}let d=e.state.doc,f=e.someProp(`domParser`)||HM.fromSchema(e.state.schema),p=d.resolve(o),m=null,h=f.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:a,preserveWhitespace:p.parent.type.whitespace!=`pre`||`full`,findPositions:l,ruleFromNode:Dz,context:p});if(l&&l[0].pos!=null){let e=l[0].pos,t=l[1]&&l[1].pos;t??=e,m={anchor:e+o,head:t+o}}return{doc:h,sel:m,from:o,to:s}}function Dz(e){let t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName==`BR`&&e.parentNode){if(eI&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement(`div`);return e.appendChild(document.createElement(`li`)),{skip:e}}if(e.parentNode.lastChild==e||eI&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName==`IMG`&&e.getAttribute(`mark-placeholder`))return{ignore:!0};return null}const Oz=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function kz(e,t,n,r,i){let a=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=uL(e,t);if(n&&!e.state.selection.eq(n)){if(QF&&iI&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp(`handleKeyDown`,t=>t(e,zF(13,`Enter`))))return;let r=e.state.tr.setSelection(n);t==`pointer`?r.setMeta(`pointer`,!0):t==`key`&&r.scrollIntoView(),a&&r.setMeta(`composition`,a),e.dispatch(r)}return}let o=e.state.doc.resolve(t),s=o.sharedDepth(n);t=o.before(s+1),n=e.state.doc.resolve(n).after(s+1);let c=e.state.selection,l=Ez(e,t,n),u=e.state.doc,d=u.slice(l.from,l.to),f,p;e.input.lastKeyCode===8&&Date.now()-100<e.input.lastKeyCodeTime?(f=e.state.selection.to,p=`end`):(f=e.state.selection.from,p=`start`),e.input.lastKeyCode=null;let m=Pz(d.content,l.doc.content,l.from,f,p);if(m&&e.input.domChangeCount++,(tI&&e.input.lastIOSEnter>Date.now()-225||iI)&&i.some(e=>e.nodeType==1&&!Oz.test(e.nodeName))&&(!m||m.endA>=m.endB)&&e.someProp(`handleKeyDown`,t=>t(e,zF(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(!m){if(r&&c instanceof bP&&!c.empty&&c.$head.sameParent(c.$anchor)&&!e.composing&&!(l.sel&&l.sel.anchor!=l.sel.head))m={start:c.from,endA:c.to,endB:c.to};else{if(l.sel){let t=Az(e,e.state.doc,l.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);a&&n.setMeta(`composition`,a),e.dispatch(n)}}return}}e.state.selection.from<e.state.selection.to&&m.start==m.endB&&e.state.selection instanceof bP&&(m.start>e.state.selection.from&&m.start<=e.state.selection.from+2&&e.state.selection.from>=l.from?m.start=e.state.selection.from:m.endA<e.state.selection.to&&m.endA>=e.state.selection.to-2&&e.state.selection.to<=l.to&&(m.endB+=e.state.selection.to-m.endA,m.endA=e.state.selection.to)),JF&&YF<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>l.from&&l.doc.textBetween(m.start-l.from-1,m.start-l.from+1)==` \xA0`&&(m.start--,m.endA--,m.endB--);let h=l.doc.resolveNoCache(m.start-l.from),g=l.doc.resolveNoCache(m.endB-l.from),_=u.resolve(m.start),v=h.sameParent(g)&&h.parent.inlineContent&&_.end()>=m.endA;if((tI&&e.input.lastIOSEnter>Date.now()-225&&(!v||i.some(e=>e.nodeName==`DIV`||e.nodeName==`P`))||!v&&h.pos<l.doc.content.size&&(!h.sameParent(g)||!h.parent.inlineContent)&&h.pos<g.pos&&!/\S/.test(l.doc.textBetween(h.pos,g.pos,``,``)))&&e.someProp(`handleKeyDown`,t=>t(e,zF(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>m.start&&Mz(u,m.start,m.endA,h,g)&&e.someProp(`handleKeyDown`,t=>t(e,zF(8,`Backspace`)))){iI&&QF&&e.domObserver.suppressSelectionUpdates();return}QF&&m.endB==m.start&&(e.input.lastChromeDelete=Date.now()),iI&&!v&&h.start()!=g.start()&&g.parentOffset==0&&h.depth==g.depth&&l.sel&&l.sel.anchor==l.sel.head&&l.sel.head==m.endA&&(m.endB-=2,g=l.doc.resolveNoCache(m.endB-l.from),setTimeout(()=>{e.someProp(`handleKeyDown`,function(t){return t(e,zF(13,`Enter`))})},20));let y=m.start,b=m.endA,x=t=>{let n=t||e.state.tr.replace(y,b,l.doc.slice(m.start-l.from,m.endB-l.from));if(l.sel){let t=Az(e,n.doc,l.sel);t&&!(QF&&e.composing&&t.empty&&(m.start!=m.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==y||t.head==n.mapping.map(b)-1)||JF&&t.empty&&t.head==y)&&n.setSelection(t)}return a&&n.setMeta(`composition`,a),n.scrollIntoView()},S;if(v){if(h.pos==g.pos){JF&&YF<=11&&h.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>fL(e),20));let t=x(e.state.tr.delete(y,b)),n=u.resolve(m.start).marksAcross(u.resolve(m.endA));n&&t.ensureMarks(n),e.dispatch(t)}else if(m.endA==m.endB&&(S=jz(h.parent.content.cut(h.parentOffset,g.parentOffset),_.parent.content.cut(_.parentOffset,m.endA-_.start())))){let t=x(e.state.tr);S.type==`add`?t.addMark(y,b,S.mark):t.removeMark(y,b,S.mark),e.dispatch(t)}else if(h.parent.child(h.index()).isText&&h.index()==g.index()-+!g.textOffset){let t=h.parent.textBetween(h.parentOffset,g.parentOffset),n=()=>x(e.state.tr.insertText(t,y,b));e.someProp(`handleTextInput`,r=>r(e,y,b,t,n))||e.dispatch(n())}else e.dispatch(x())}else e.dispatch(x())}function Az(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:xL(e,t.resolve(n.anchor),t.resolve(n.head))}function jz(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,i=n,a=r,o,s,c;for(let e=0;e<r.length;e++)i=r[e].removeFromSet(i);for(let e=0;e<n.length;e++)a=n[e].removeFromSet(a);if(i.length==1&&a.length==0)s=i[0],o=`add`,c=e=>e.mark(s.addToSet(e.marks));else if(i.length==0&&a.length==1)s=a[0],o=`remove`,c=e=>e.mark(s.removeFromSet(e.marks));else return null;let l=[];for(let e=0;e<t.childCount;e++)l.push(c(t.child(e)));if(U.from(l).eq(e))return{mark:s,type:o}}function Mz(e,t,n,r,i){if(n-t<=i.pos-r.pos||Nz(r,!0,!1)<i.pos)return!1;let a=e.resolve(t);if(!r.parent.isTextblock){let e=a.nodeAfter;return e!=null&&n==t+e.nodeSize}if(a.parentOffset<a.parent.content.size||!a.parent.isTextblock)return!1;let o=e.resolve(Nz(a,!0,!0));return!o.parent.isTextblock||o.pos>n||Nz(o,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(o.parent.content)}function Nz(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,i++}return i}function Pz(e,t,n,r,i){let a=e.findDiffStart(t,n);if(a==null)return null;let{a:o,b:s}=e.findDiffEnd(t,n+e.size,n+t.size);if(i==`end`){let e=Math.max(0,a-Math.min(o,s));r-=o+e-a}if(o<a&&e.size<t.size){let e=r<=a&&r>=o?a-r:0;a-=e,a&&a<t.size&&Fz(t.textBetween(a-1,a+1))&&(a+=e?1:-1),s=a+(s-o),o=a}else if(s<a){let t=r<=a&&r>=s?a-r:0;a-=t,a&&a<e.size&&Fz(e.textBetween(a-1,a+1))&&(a+=t?1:-1),o=a+(o-s),s=a}return{start:a,endA:o,endB:s}}function Fz(e){if(e.length!=2)return!1;let t=e.charCodeAt(0),n=e.charCodeAt(1);return t>=56320&&t<=57343&&n>=55296&&n<=56319}var Iz=class{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new uR,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(Uz),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement(`div`),e&&(e.appendChild?e.appendChild(this.dom):typeof e==`function`?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=zz(this),Rz(this),this.nodeViews=Vz(this),this.docView=WI(this.state.doc,Lz(this),mz(this),this.dom,this),this.domObserver=new vz(this,(e,t,n,r)=>kz(this,e,t,n,r)),this.domObserver.start(),dR(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&mR(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Uz),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){let n=this.state,r=!1,i=!1;e.storedMarks&&this.composing&&(FR(this),i=!0),this.state=e;let a=n.plugins!=e.plugins||this._props.plugins!=t.plugins;if(a||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=Vz(this);Hz(e,this.nodeViews)&&(this.nodeViews=e,r=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&mR(this),this.editable=zz(this),Rz(this);let o=mz(this),s=Lz(this),c=n.plugins!=e.plugins&&!n.doc.eq(e.doc)?`reset`:e.scrollToSelection>n.scrollToSelection?`to selection`:`preserve`,l=r||!this.docView.matchesNode(e.doc,s,o);(l||!e.selection.eq(n.selection))&&(i=!0);let u=c==`preserve`&&i&&this.dom.style.overflowAnchor==null&&dI(this);if(i){this.domObserver.stop();let t=l&&(JF||QF)&&!this.composing&&!n.selection.empty&&!e.selection.empty&&Bz(n.selection,e.selection);if(l){let n=QF?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=IR(this)),(r||!this.docView.update(e.doc,s,o,this))&&(this.docView.updateOuterDeco(s),this.docView.destroy(),this.docView=WI(e.doc,s,o,this.dom,this)),n&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(t=!0)}t||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&wL(this))?fL(this,t):(yL(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(n),this.dragging?.node&&!n.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,n),c==`reset`?this.dom.scrollTop=0:c==`to selection`?this.scrollToSelection():u&&pI(u)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))&&!this.someProp(`handleScrollToSelection`,e=>e(this))){if(this.state.selection instanceof SP){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&uI(this,t.getBoundingClientRect(),e)}else uI(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}else for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}}updateDraggedNode(e,t){let n=e.node,r=-1;if(n.from<this.state.doc.content.size&&this.state.doc.nodeAt(n.from)==n.node)r=n.from;else{let e=n.from+(this.state.doc.content.size-t.doc.content.size);(e>0&&e<this.state.doc.content.size&&this.state.doc.nodeAt(e))==n.node&&(r=e)}this.dragging=new GR(e.slice,e.move,r<0?void 0:SP.create(this.state.doc,r))}someProp(e,t){let n=this._props&&this._props[e],r;if(n!=null&&(r=t?t(n):n))return r;for(let n=0;n<this.directPlugins.length;n++){let i=this.directPlugins[n].props[e];if(i!=null&&(r=t?t(i):i))return r}let i=this.state.plugins;if(i)for(let n=0;n<i.length;n++){let a=i[n].props[e];if(a!=null&&(r=t?t(a):a))return r}}hasFocus(){if(JF){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable==`false`)return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&gI(this.dom),fL(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let e=this.dom.parentNode;e;e=e.parentNode)if(e.nodeType==9||e.nodeType==11&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e}return e||document}updateRoot(){this._root=null}posAtCoords(e){return wI(this,e)}coordsAtPos(e,t=1){return OI(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let r=this.docView.posFromDOM(e,t,n);if(r==null)throw RangeError(`DOM position not inside the editor`);return r}endOfTextblock(e,t){return RI(this,t||this.state,e)}pasteHTML(e,t){return UR(this,``,e,!1,t||new ClipboardEvent(`paste`))}pasteText(e,t){return UR(this,e,null,!0,t||new ClipboardEvent(`paste`))}serializeForClipboard(e){return WL(this,e)}destroy(){this.docView&&(pR(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],mz(this),this),this.dom.textContent=``):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,kF())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return _R(this,e)}domSelectionRange(){let e=this.domSelection();return e?eI&&this.root.nodeType===11&&BF(this.dom.ownerDocument)==this.dom&&Cz(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}};Iz.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};function Lz(e){let t=Object.create(null);return t.class=`ProseMirror`,t.contenteditable=String(e.editable),e.someProp(`attributes`,n=>{if(typeof n==`function`&&(n=n(e.state)),n)for(let e in n)e==`class`?t.class+=` `+n[e]:e==`style`?t.style=(t.style?t.style+`;`:``)+n[e]:!t[e]&&e!=`contenteditable`&&e!=`nodeName`&&(t[e]=String(n[e]))}),t.translate||=`no`,[$R.node(0,e.state.doc.content.size,t)]}function Rz(e){if(e.markCursor){let t=document.createElement(`img`);t.className=`ProseMirror-separator`,t.setAttribute(`mark-placeholder`,`true`),t.setAttribute(`alt`,``),e.cursorWrapper={dom:t,deco:$R.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function zz(e){return!e.someProp(`editable`,t=>t(e.state)===!1)}function Bz(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}function Vz(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp(`nodeViews`,n),e.someProp(`markViews`,n),t}function Hz(e,t){let n=0,r=0;for(let r in e){if(e[r]!=t[r])return!0;n++}for(let e in t)r++;return n!=r}function Uz(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw RangeError(`Plugins passed directly to the view must not have a state component`)}for(var Wz={8:`Backspace`,9:`Tab`,10:`Enter`,12:`NumLock`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,44:`PrintScreen`,45:`Insert`,46:`Delete`,59:`;`,61:`=`,91:`Meta`,92:`Meta`,106:`*`,107:`+`,108:`,`,109:`-`,110:`.`,111:`/`,144:`NumLock`,145:`ScrollLock`,160:`Shift`,161:`Shift`,162:`Control`,163:`Control`,164:`Alt`,165:`Alt`,173:`-`,186:`;`,187:`=`,188:`,`,189:`-`,190:`.`,191:`/`,192:"`",219:`[`,220:`\\`,221:`]`,222:`'`},Gz={48:`)`,49:`!`,50:`@`,51:`#`,52:`$`,53:`%`,54:`^`,55:`&`,56:`*`,57:`(`,59:`:`,61:`+`,173:`_`,186:`:`,187:`+`,188:`<`,189:`_`,190:`>`,191:`?`,192:`~`,219:`{`,220:`|`,221:`}`,222:`"`},Kz=typeof navigator<`u`&&/Mac/.test(navigator.platform),qz=typeof navigator<`u`&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Jz=0;Jz<10;Jz++)Wz[48+Jz]=Wz[96+Jz]=String(Jz);for(var Jz=1;Jz<=24;Jz++)Wz[Jz+111]=`F`+Jz;for(var Jz=65;Jz<=90;Jz++)Wz[Jz]=String.fromCharCode(Jz+32),Gz[Jz]=String.fromCharCode(Jz);for(var Yz in Wz)Gz.hasOwnProperty(Yz)||(Gz[Yz]=Wz[Yz]);function Xz(e){var t=!(Kz&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||qz&&e.shiftKey&&e.key&&e.key.length==1||e.key==`Unidentified`)&&e.key||(e.shiftKey?Gz:Wz)[e.keyCode]||e.key||`Unidentified`;return t==`Esc`&&(t=`Escape`),t==`Del`&&(t=`Delete`),t==`Left`&&(t=`ArrowLeft`),t==`Up`&&(t=`ArrowUp`),t==`Right`&&(t=`ArrowRight`),t==`Down`&&(t=`ArrowDown`),t}const Zz=typeof navigator<`u`&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),Qz=typeof navigator<`u`&&/Win/.test(navigator.platform);function $z(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n==`Space`&&(n=` `);let r,i,a,o;for(let e=0;e<t.length-1;e++){let n=t[e];if(/^(cmd|meta|m)$/i.test(n))o=!0;else if(/^a(lt)?$/i.test(n))r=!0;else if(/^(c|ctrl|control)$/i.test(n))i=!0;else if(/^s(hift)?$/i.test(n))a=!0;else if(/^mod$/i.test(n))Zz?o=!0:i=!0;else throw Error(`Unrecognized modifier name: `+n)}return r&&(n=`Alt-`+n),i&&(n=`Ctrl-`+n),o&&(n=`Meta-`+n),a&&(n=`Shift-`+n),n}function eB(e){let t=Object.create(null);for(let n in e)t[$z(n)]=e[n];return t}function tB(e,t,n=!0){return t.altKey&&(e=`Alt-`+e),t.ctrlKey&&(e=`Ctrl-`+e),t.metaKey&&(e=`Meta-`+e),n&&t.shiftKey&&(e=`Shift-`+e),e}function nB(e){let t=eB(e);return function(e,n){let r=Xz(n),i,a=t[tB(r,n)];if(a&&a(e.state,e.dispatch,e))return!0;if(r.length==1&&r!=` `){if(n.shiftKey){let i=t[tB(r,n,!1)];if(i&&i(e.state,e.dispatch,e))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(Qz&&n.ctrlKey&&n.altKey)&&(i=Wz[n.keyCode])&&i!=r){let r=t[tB(i,n)];if(r&&r(e.state,e.dispatch,e))return!0}}return!1}}var rB=Object.defineProperty,iB=(e,t)=>{for(var n in t)rB(e,n,{get:t[n],enumerable:!0})};function aB(e){let{state:t,transaction:n}=e,{selection:r}=n,{doc:i}=n,{storedMarks:a}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return a},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,a=n.storedMarks,n}}}var oB=class{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){let{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:i}=n,a=this.buildProps(i);return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,(...e)=>{let n=t(...e)(a);return!i.getMeta(`preventDispatch`)&&!this.hasCustomState&&r.dispatch(i),n}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:a}=r,o=[],s=!!e,c=e||i.tr,l=()=>(!s&&t&&!c.getMeta(`preventDispatch`)&&!this.hasCustomState&&a.dispatch(c),o.every(e=>e===!0)),u={...Object.fromEntries(Object.entries(n).map(([e,n])=>[e,(...e)=>{let r=this.buildProps(c,t),i=n(...e)(r);return o.push(i),u}])),run:l};return u}createCan(e){let{rawCommands:t,state:n}=this,r=e||n.tr,i=this.buildProps(r,!1);return{...Object.fromEntries(Object.entries(t).map(([e,t])=>[e,(...e)=>t(...e)({...i,dispatch:void 0})])),chain:()=>this.createChain(r,!1)}}buildProps(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:a}=r,o={tr:e,editor:r,view:a,state:aB({state:i,transaction:e}),dispatch:t?()=>void 0:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([e,t])=>[e,(...e)=>t(...e)(o)]))}};return o}},sB={};iB(sB,{blur:()=>cB,clearContent:()=>lB,clearNodes:()=>uB,command:()=>dB,createParagraphNear:()=>fB,cut:()=>pB,deleteCurrentNode:()=>mB,deleteNode:()=>gB,deleteRange:()=>_B,deleteSelection:()=>vB,enter:()=>yB,exitCode:()=>bB,extendMarkRange:()=>DB,first:()=>OB,focus:()=>FB,forEach:()=>IB,insertContent:()=>LB,insertContentAt:()=>UB,joinBackward:()=>KB,joinDown:()=>GB,joinForward:()=>qB,joinItemBackward:()=>JB,joinItemForward:()=>YB,joinTextblockBackward:()=>XB,joinTextblockForward:()=>ZB,joinUp:()=>WB,keyboardShortcut:()=>eV,lift:()=>nV,liftEmptyBlock:()=>rV,liftListItem:()=>iV,newlineInCode:()=>aV,resetAttributes:()=>cV,scrollIntoView:()=>lV,selectAll:()=>uV,selectNodeBackward:()=>dV,selectNodeForward:()=>fV,selectParentNode:()=>pV,selectTextblockEnd:()=>mV,selectTextblockStart:()=>hV,setContent:()=>_V,setMark:()=>sH,setMeta:()=>cH,setNode:()=>lH,setNodeSelection:()=>uH,setTextDirection:()=>dH,setTextSelection:()=>fH,sinkListItem:()=>pH,splitBlock:()=>hH,splitListItem:()=>gH,toggleList:()=>bH,toggleMark:()=>xH,toggleNode:()=>SH,toggleWrap:()=>CH,undoInputRule:()=>wH,unsetAllMarks:()=>TH,unsetMark:()=>EH,unsetTextDirection:()=>DH,updateAttributes:()=>OH,wrapIn:()=>kH,wrapInList:()=>AH});var cB=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),(n=window==null?void 0:window.getSelection())==null||n.removeAllRanges())}),!0),lB=(e=!0)=>({commands:t})=>t.setContent(``,{emitUpdate:e}),uB=()=>({state:e,tr:t,dispatch:n})=>{let{selection:r}=t,{ranges:i}=r;return n&&i.forEach(({$from:n,$to:r})=>{e.doc.nodesBetween(n.pos,r.pos,(e,n)=>{if(e.type.isText)return;let{doc:r,mapping:i}=t,a=r.resolve(i.map(n)),o=r.resolve(i.map(n+e.nodeSize)),s=a.blockRange(o);if(!s)return;let c=kN(s);if(e.type.isTextblock){let{defaultType:e}=a.parent.contentMatchAt(a.index());t.setNodeMarkup(s.start,e)}(c||c===0)&&t.lift(s,c)})}),!0},dB=e=>t=>e(t),fB=()=>({state:e,dispatch:t})=>eF(e,t),pB=(e,t)=>({editor:n,tr:r})=>{let{state:i}=n,a=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);let o=r.mapping.map(t);return r.insert(o,a.content),r.setSelection(new bP(r.doc.resolve(Math.max(o-1,0)))),!0},mB=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;let i=e.selection.$anchor;for(let n=i.depth;n>0;--n)if(i.node(n).type===r.type){if(t){let t=i.before(n),r=i.after(n);e.delete(t,r).scrollIntoView()}return!0}return!1};function hB(e,t){if(typeof e==`string`){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}var gB=e=>({tr:t,state:n,dispatch:r})=>{let i=hB(e,n.schema),a=t.selection.$anchor;for(let e=a.depth;e>0;--e)if(a.node(e).type===i){if(r){let n=a.before(e),r=a.after(e);t.delete(n,r).scrollIntoView()}return!0}return!1},_B=e=>({tr:t,dispatch:n})=>{let{from:r,to:i}=e;return n&&t.delete(r,i),!0},vB=()=>({state:e,dispatch:t})=>FP(e,t),yB=()=>({commands:e})=>e.keyboardShortcut(`Enter`),bB=()=>({state:e,dispatch:t})=>$P(e,t);function xB(e){return Object.prototype.toString.call(e)===`[object RegExp]`}function SB(e,t,n={strict:!0}){let r=Object.keys(t);return!r.length||r.every(r=>n.strict?t[r]===e[r]:xB(t[r])?t[r].test(e[r]):t[r]===e[r])}function CB(e,t,n={}){return e.find(e=>e.type===t&&SB(Object.fromEntries(Object.keys(n).map(t=>[t,e.attrs[t]])),n))}function wB(e,t,n={}){return!!CB(e,t,n)}function TB(e,t,n){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if((!r.node||!r.node.marks.some(e=>e.type===t))&&(r=e.parent.childBefore(e.parentOffset)),!r.node||!r.node.marks.some(e=>e.type===t))return;if(!n){let e=r.node.marks.find(e=>e.type===t);e&&(n=e.attrs)}if(!CB([...r.node.marks],t,n))return;let i=r.index,a=e.start()+r.offset,o=i+1,s=a+r.node.nodeSize;for(;i>0&&wB([...e.parent.child(i-1).marks],t,n);)--i,a-=e.parent.child(i).nodeSize;for(;o<e.parent.childCount&&wB([...e.parent.child(o).marks],t,n);)s+=e.parent.child(o).nodeSize,o+=1;return{from:a,to:s}}function EB(e,t){if(typeof e==`string`){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}var DB=(e,t)=>({tr:n,state:r,dispatch:i})=>{let a=EB(e,r.schema),{doc:o,selection:s}=n,{$from:c,from:l,to:u}=s;if(i){let e=TB(c,a,t);if(e&&e.from<=l&&e.to>=u){let t=bP.create(o,e.from,e.to);n.setSelection(t)}}return!0},OB=e=>t=>{let n=typeof e==`function`?e(t):e;for(let e=0;e<n.length;e+=1)if(n[e](t))return!0;return!1};function kB(e){return e instanceof bP}function AB(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function jB(e,t=null){if(!t)return null;let n=gP.atStart(e),r=gP.atEnd(e);if(t===`start`||t===!0)return n;if(t===`end`)return r;let i=n.from,a=r.to;return t===`all`?bP.create(e,AB(0,i,a),AB(e.content.size,i,a)):bP.create(e,AB(t,i,a),AB(t,i,a))}function MB(){return navigator.platform===`Android`||/android/i.test(navigator.userAgent)}function NB(){return[`iPad Simulator`,`iPhone Simulator`,`iPod Simulator`,`iPad`,`iPhone`,`iPod`].includes(navigator.platform)||navigator.userAgent.includes(`Mac`)&&`ontouchend`in document}function PB(){return typeof navigator<`u`&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}var FB=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:a})=>{t={scrollIntoView:!0,...t};let o=()=>{(NB()||MB())&&r.dom.focus(),PB()&&!NB()&&!MB()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),t?.scrollIntoView&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&e===null||e===!1)return!0}catch{return!1}if(a&&e===null&&!kB(n.state.selection))return o(),!0;let s=jB(i.doc,e)||n.state.selection,c=n.state.selection.eq(s);return a&&(c||i.setSelection(s),c&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},IB=(e,t)=>n=>e.every((e,r)=>t(e,{...n,index:r})),LB=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),RB=e=>{let t=e.childNodes;for(let n=t.length-1;n>=0;--n){let r=t[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):r.nodeType===1&&RB(r)}return e};function zB(e){if(typeof window>`u`)throw Error(`[tiptap error]: there is no window object available, so this function cannot be used`);let t=`<body>${e}</body>`,n=new window.DOMParser().parseFromString(t,`text/html`).body;return RB(n)}function BB(e,t,n){if(e instanceof pM||e instanceof U)return e;n={slice:!0,parseOptions:{},...n};let r=typeof e==`object`&&!!e,i=typeof e==`string`;if(r)try{if(Array.isArray(e)&&e.length>0)return U.fromArray(e.map(e=>t.nodeFromJSON(e)));let r=t.nodeFromJSON(e);return n.errorOnInvalidContent&&r.check(),r}catch(r){if(n.errorOnInvalidContent)throw Error(`[tiptap error]: Invalid JSON content`,{cause:r});return console.warn(`[tiptap warn]: Invalid content.`,`Passed value:`,e,`Error:`,r),BB(``,t,n)}if(i){if(n.errorOnInvalidContent){let r=!1,i=``,a=new RM({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:`inline*`,group:`block`,parseDOM:[{tag:`*`,getAttrs:e=>(r=!0,i=typeof e==`string`?e:e.outerHTML,null)}]}})});if(n.slice?HM.fromSchema(a).parseSlice(zB(e),n.parseOptions):HM.fromSchema(a).parse(zB(e),n.parseOptions),n.errorOnInvalidContent&&r)throw Error(`[tiptap error]: Invalid HTML content`,{cause:Error(`Invalid element found: ${i}`)})}let r=HM.fromSchema(t);return n.slice?r.parseSlice(zB(e),n.parseOptions).content:r.parse(zB(e),n.parseOptions)}return BB(``,t,n)}function VB(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof SN||i instanceof CN))return;let a=e.mapping.maps[r],o=0;a.forEach((e,t,n,r)=>{o===0&&(o=r)}),e.setSelection(gP.near(e.doc.resolve(o),n))}var HB=e=>!(`type`in e),UB=(e,t,n)=>({tr:r,dispatch:i,editor:a})=>{if(i){n={parseOptions:a.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let i,o=e=>{a.emit(`contentError`,{editor:a,error:e,disableCollaboration:()=>{`collaboration`in a.storage&&typeof a.storage.collaboration==`object`&&a.storage.collaboration&&(a.storage.collaboration.isDisabled=!0)}})},s={preserveWhitespace:`full`,...n.parseOptions};if(!n.errorOnInvalidContent&&!a.options.enableContentCheck&&a.options.emitContentError)try{BB(t,a.schema,{parseOptions:s,errorOnInvalidContent:!0})}catch(e){o(e)}try{i=BB(t,a.schema,{parseOptions:s,errorOnInvalidContent:n.errorOnInvalidContent??a.options.enableContentCheck})}catch(e){return o(e),!1}let{from:c,to:l}=typeof e==`number`?{from:e,to:e}:{from:e.from,to:e.to},u=!0,d=!0;if((HB(i)?i:[i]).forEach(e=>{e.check(),u=u?e.isText&&e.marks.length===0:!1,d=d?e.isBlock:!1}),c===l&&d){let{parent:e}=r.doc.resolve(c);e.isTextblock&&!e.type.spec.code&&!e.childCount&&(--c,l+=1)}let f;if(u){if(Array.isArray(t))f=t.map(e=>e.text||``).join(``);else if(t instanceof U){let e=``;t.forEach(t=>{t.text&&(e+=t.text)}),f=e}else f=typeof t==`object`&&t&&t.text?t.text:t;r.insertText(f,c,l)}else{f=i;let e=r.doc.resolve(c),t=e.node(),n=e.parentOffset===0,a=t.isText||t.isTextblock,o=t.content.size>0;n&&a&&o&&d&&(c=Math.max(0,c-1)),r.replaceWith(c,l,f)}n.updateSelection&&VB(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta(`applyInputRules`,{from:c,text:f}),n.applyPasteRules&&r.setMeta(`applyPasteRules`,{from:c,text:f})}return!0},WB=()=>({state:e,dispatch:t})=>JP(e,t),GB=()=>({state:e,dispatch:t})=>YP(e,t),KB=()=>({state:e,dispatch:t})=>LP(e,t),qB=()=>({state:e,dispatch:t})=>GP(e,t),JB=()=>({state:e,dispatch:t,tr:n})=>{try{let r=KN(e.doc,e.selection.$from.pos,-1);return r!=null&&(n.join(r,2),t&&t(n),!0)}catch{return!1}},YB=()=>({state:e,dispatch:t,tr:n})=>{try{let r=KN(e.doc,e.selection.$from.pos,1);return r!=null&&(n.join(r,2),t&&t(n),!0)}catch{return!1}},XB=()=>({state:e,dispatch:t})=>RP(e,t),ZB=()=>({state:e,dispatch:t})=>zP(e,t);function QB(){return typeof navigator<`u`&&/Mac/.test(navigator.platform)}function $B(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n===`Space`&&(n=` `);let r,i,a,o;for(let e=0;e<t.length-1;e+=1){let n=t[e];if(/^(cmd|meta|m)$/i.test(n))o=!0;else if(/^a(lt)?$/i.test(n))r=!0;else if(/^(c|ctrl|control)$/i.test(n))i=!0;else if(/^s(hift)?$/i.test(n))a=!0;else if(/^mod$/i.test(n))NB()||QB()?o=!0:i=!0;else throw Error(`Unrecognized modifier name: ${n}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),o&&(n=`Meta-${n}`),a&&(n=`Shift-${n}`),n}var eV=e=>({editor:t,view:n,tr:r,dispatch:i})=>{let a=$B(e).split(/-(?!$)/),o=a.find(e=>![`Alt`,`Ctrl`,`Meta`,`Shift`].includes(e)),s=new KeyboardEvent(`keydown`,{key:o===`Space`?` `:o,altKey:a.includes(`Alt`),ctrlKey:a.includes(`Ctrl`),metaKey:a.includes(`Meta`),shiftKey:a.includes(`Shift`),bubbles:!0,cancelable:!0});return t.captureTransaction(()=>{n.someProp(`handleKeyDown`,e=>e(n,s))})?.steps.forEach(e=>{let t=e.map(r.mapping);t&&i&&r.maybeStep(t)}),!0};function tV(e,t,n={}){let{from:r,to:i,empty:a}=e.selection,o=t?hB(t,e.schema):null,s=[];e.doc.nodesBetween(r,i,(e,t)=>{if(e.isText)return;let n=Math.max(r,t),a=Math.min(i,t+e.nodeSize);s.push({node:e,from:n,to:a})});let c=i-r,l=s.filter(e=>!o||o.name===e.node.type.name).filter(e=>SB(e.node.attrs,n,{strict:!1}));return a?!!l.length:l.reduce((e,t)=>e+t.to-t.from,0)>=c}var nV=(e,t={})=>({state:n,dispatch:r})=>tV(n,hB(e,n.schema),t)?XP(n,r):!1,rV=()=>({state:e,dispatch:t})=>tF(e,t),iV=e=>({state:t,dispatch:n})=>xF(hB(e,t.schema))(t,n),aV=()=>({state:e,dispatch:t})=>ZP(e,t);function oV(e,t){return t.nodes[e]?`node`:t.marks[e]?`mark`:null}function sV(e,t){let n=typeof t==`string`?[t]:t;return Object.keys(e).reduce((t,r)=>(n.includes(r)||(t[r]=e[r]),t),{})}var cV=(e,t)=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=oV(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=hB(e,r.schema)),s===`mark`&&(o=EB(e,r.schema));let c=!1;return n.selection.ranges.forEach(e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,(e,r)=>{a&&a===e.type&&(c=!0,i&&n.setNodeMarkup(r,void 0,sV(e.attrs,t))),o&&e.marks.length&&e.marks.forEach(a=>{o===a.type&&(c=!0,i&&n.addMark(r,r+e.nodeSize,o.create(sV(a.attrs,t))))})})}),c},lV=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),uV=()=>({tr:e,dispatch:t})=>{if(t){let t=new wP(e.doc);e.setSelection(t)}return!0},dV=()=>({state:e,dispatch:t})=>HP(e,t),fV=()=>({state:e,dispatch:t})=>KP(e,t),pV=()=>({state:e,dispatch:t})=>iF(e,t),mV=()=>({state:e,dispatch:t})=>uF(e,t),hV=()=>({state:e,dispatch:t})=>lF(e,t);function gV(e,t,n={},r={}){return BB(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var _V=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:a,dispatch:o,commands:s})=>{let{doc:c}=a;if(r.preserveWhitespace!==`full`){let s=gV(e,i.schema,r,{errorOnInvalidContent:t??i.options.enableContentCheck});return o&&a.replaceWith(0,c.content.size,s).setMeta(`preventUpdate`,!n),!0}return o&&a.setMeta(`preventUpdate`,!n),s.insertContentAt({from:0,to:c.content.size},e,{parseOptions:r,errorOnInvalidContent:t??i.options.enableContentCheck})};function vV(e,t){let n=EB(t,e.schema),{from:r,to:i,empty:a}=e.selection,o=[];a?(e.storedMarks&&o.push(...e.storedMarks),o.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,e=>{o.push(...e.marks)});let s=o.find(e=>e.type.name===n.name);return s?{...s.attrs}:{}}function yV(e,t){let n=new mP(e);return t.forEach(e=>{e.steps.forEach(e=>{n.step(e)})}),n}function bV(e){for(let t=0;t<e.edgeCount;t+=1){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function xV(e,t,n){let r=[];return e.nodesBetween(t.from,t.to,(e,t)=>{n(e)&&r.push({node:e,pos:t})}),r}function SV(e,t){for(let n=e.depth;n>0;--n){let r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function CV(e){return t=>SV(t.$from,e)}function wV(e,t,n){return e.config[t]===void 0&&e.parent?wV(e.parent,t,n):typeof e.config[t]==`function`?e.config[t].bind({...n,parent:e.parent?wV(e.parent,t,n):null}):e.config[t]}function TV(e){return e.map(e=>{let t=wV(e,`addExtensions`,{name:e.name,options:e.options,storage:e.storage});return t?[e,...TV(t())]:e}).flat(10)}function EV(e){return typeof e==`function`}function DV(e,t=void 0,...n){return EV(e)?t?e.bind(t)(...n):e(...n):e}function OV(e={}){return Object.keys(e).length===0&&e.constructor===Object}function kV(e){return{baseExtensions:e.filter(e=>e.type===`extension`),nodeExtensions:e.filter(e=>e.type===`node`),markExtensions:e.filter(e=>e.type===`mark`)}}function AV(e){let t=[],{nodeExtensions:n,markExtensions:r}=kV(e),i=[...n,...r],a={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},o=n.filter(e=>e.name!==`text`).map(e=>e.name),s=r.map(e=>e.name),c=[...o,...s];return e.forEach(e=>{let n=wV(e,`addGlobalAttributes`,{name:e.name,options:e.options,storage:e.storage,extensions:i});n&&n().forEach(e=>{let n;n=Array.isArray(e.types)?e.types:e.types===`*`?c:e.types===`nodes`?o:e.types===`marks`?s:[],n.forEach(n=>{Object.entries(e.attributes).forEach(([e,r])=>{t.push({type:n,name:e,attribute:{...a,...r}})})})})}),i.forEach(e=>{let n=wV(e,`addAttributes`,{name:e.name,options:e.options,storage:e.storage});if(!n)return;let r=n();Object.entries(r).forEach(([n,r])=>{let i={...a,...r};typeof i?.default==`function`&&(i.default=i.default()),i?.isRequired&&i?.default===void 0&&delete i.default,t.push({type:e.name,name:n,attribute:i})})}),t}function jV(e){let t=[],n=``,r=!1,i=!1,a=0,o=e.length;for(let s=0;s<o;s+=1){let o=e[s];if(o===`'`&&!i){r=!r,n+=o;continue}if(o===`"`&&!r){i=!i,n+=o;continue}if(!r&&!i){if(o===`(`){a+=1,n+=o;continue}if(o===`)`&&a>0){--a,n+=o;continue}if(o===`;`&&a===0){t.push(n),n=``;continue}}n+=o}return n&&t.push(n),t}function MV(e){let t=[],n=jV(e||``),r=n.length;for(let e=0;e<r;e+=1){let r=n[e],i=r.indexOf(`:`);if(i===-1)continue;let a=r.slice(0,i).trim(),o=r.slice(i+1).trim();a&&o&&t.push([a,o])}return t}function NV(...e){return e.filter(e=>!!e).reduce((e,t)=>{let n={...e};return Object.entries(t).forEach(([e,t])=>{if(!n[e]){n[e]=t;return}if(e===`class`){let r=t?String(t).split(` `):[],i=n[e]?n[e].split(` `):[],a=r.filter(e=>!i.includes(e));n[e]=[...i,...a].join(` `)}else if(e===`style`){let r=new Map([...MV(n[e]),...MV(t)]);n[e]=Array.from(r.entries()).map(([e,t])=>`${e}: ${t}`).join(`; `)}else n[e]=t}),n},{})}function PV(e,t){return t.filter(t=>t.type===e.type.name).filter(e=>e.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(e.attrs)||{}:{[t.name]:e.attrs[t.name]}).reduce((e,t)=>NV(e,t),{})}function FV(e){return typeof e==`string`?e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e===`true`||e!==`false`&&e:e}function IV(e,t){return`style`in e?e:{...e,getAttrs:n=>{let r=e.getAttrs?e.getAttrs(n):e.attrs;if(r===!1)return!1;let i=t.reduce((e,t)=>{let r=t.attribute.parseHTML?t.attribute.parseHTML(n):FV(n.getAttribute(t.name));return r==null?e:{...e,[t.name]:r}},{});return{...r,...i}}}}function LV(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>e===`attrs`&&OV(t)?!1:t!=null))}function RV(e){let t={};return!e?.attribute?.isRequired&&`default`in(e?.attribute||{})&&(t.default=e.attribute.default),e?.attribute?.validate!==void 0&&(t.validate=e.attribute.validate),[e.name,t]}function zV(e,t){let n=AV(e),{nodeExtensions:r,markExtensions:i}=kV(e),a=r.find(e=>wV(e,`topNode`))?.name;return new RM({topNode:a,nodes:Object.fromEntries(r.map(r=>{let i=n.filter(e=>e.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:t},o=LV({...e.reduce((e,t)=>{let n=wV(t,`extendNodeSchema`,a);return{...e,...n?n(r):{}}},{}),content:DV(wV(r,`content`,a)),marks:DV(wV(r,`marks`,a)),group:DV(wV(r,`group`,a)),inline:DV(wV(r,`inline`,a)),atom:DV(wV(r,`atom`,a)),selectable:DV(wV(r,`selectable`,a)),draggable:DV(wV(r,`draggable`,a)),code:DV(wV(r,`code`,a)),whitespace:DV(wV(r,`whitespace`,a)),linebreakReplacement:DV(wV(r,`linebreakReplacement`,a)),defining:DV(wV(r,`defining`,a)),isolating:DV(wV(r,`isolating`,a)),attrs:Object.fromEntries(i.map(RV))}),s=DV(wV(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>IV(e,i)));let c=wV(r,`renderHTML`,a);c&&(o.toDOM=e=>c({node:e,HTMLAttributes:PV(e,i)}));let l=wV(r,`renderText`,a);return l&&(o.toText=l),[r.name,o]})),marks:Object.fromEntries(i.map(r=>{let i=n.filter(e=>e.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:t},o=LV({...e.reduce((e,t)=>{let n=wV(t,`extendMarkSchema`,a);return{...e,...n?n(r):{}}},{}),inclusive:DV(wV(r,`inclusive`,a)),excludes:DV(wV(r,`excludes`,a)),group:DV(wV(r,`group`,a)),spanning:DV(wV(r,`spanning`,a)),code:DV(wV(r,`code`,a)),attrs:Object.fromEntries(i.map(RV))}),s=DV(wV(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>IV(e,i)));let c=wV(r,`renderHTML`,a);return c&&(o.toDOM=e=>c({mark:e,HTMLAttributes:PV(e,i)})),[r.name,o]}))})}function BV(e){let t=e.filter((t,n)=>e.indexOf(t)!==n);return Array.from(new Set(t))}function VV(e){return e.sort((e,t)=>{let n=wV(e,`priority`)||100,r=wV(t,`priority`)||100;return n>r?-1:+(n<r)})}function HV(e){let t=VV(TV(e)),n=BV(t.map(e=>e.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(e=>`'${e}'`).join(`, `)}]. This can lead to issues.`),t}function UV(e,t){return zV(HV(e),t)}function WV(e,t,n){let{from:r,to:i}=t,{blockSeparator:a=`
|
|
223
|
+
|
|
224
|
+
`,textSerializers:o={}}=n||{},s=``;return e.nodesBetween(r,i,(e,n,c,l)=>{e.isBlock&&n>r&&(s+=a);let u=o?.[e.type.name];if(u)return c&&(s+=u({node:e,pos:n,parent:c,index:l,range:t})),!1;e.isText&&(s+=(e?.text)?.slice(Math.max(r,n)-n,i-n))}),s}function GV(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function KV(e,t){let n=hB(t,e.schema),{from:r,to:i}=e.selection,a=[];e.doc.nodesBetween(r,i,e=>{a.push(e)});let o=a.reverse().find(e=>e.type.name===n.name);return o?{...o.attrs}:{}}function qV(e,t){let n=oV(typeof t==`string`?t:t.name,e.schema);return n===`node`?KV(e,t):n===`mark`?vV(e,t):{}}function JV(e,t=JSON.stringify){let n={};return e.filter(e=>{let r=t(e);return Object.prototype.hasOwnProperty.call(n,r)?!1:n[r]=!0})}function YV(e){let t=JV(e);return t.length===1?t:t.filter((e,n)=>!t.filter((e,t)=>t!==n).some(t=>e.oldRange.from>=t.oldRange.from&&e.oldRange.to<=t.oldRange.to&&e.newRange.from>=t.newRange.from&&e.newRange.to<=t.newRange.to))}function XV(e){let{mapping:t,steps:n}=e,r=[];return t.maps.forEach((e,i)=>{let a=[];if(e.ranges.length)e.forEach((e,t)=>{a.push({from:e,to:t})});else{let{from:e,to:t}=n[i];if(e===void 0||t===void 0)return;a.push({from:e,to:t})}a.forEach(({from:e,to:n})=>{let a=t.slice(i).map(e,-1),o=t.slice(i).map(n),s=t.invert().map(a,-1),c=t.invert().map(o);r.push({oldRange:{from:s,to:c},newRange:{from:a,to:o}})})}),YV(r)}function ZV(e,t,n){let r=[];return e===t?n.resolve(e).marks().forEach(t=>{let i=TB(n.resolve(e),t.type);i&&r.push({mark:t,...i})}):n.nodesBetween(e,t,(e,t)=>{!e||e?.nodeSize===void 0||r.push(...e.marks.map(n=>({from:t,to:t+e.nodeSize,mark:n})))}),r}var QV=(e,t,n,r=20)=>{let i=e.doc.resolve(n),a=r,o=null;for(;a>0&&o===null;){let e=i.node(a);e?.type.name===t?o=e:--a}return[o,a]};function $V(e,t,n){return Object.fromEntries(Object.entries(n).filter(([n])=>{let r=e.find(e=>e.type===t&&e.name===n);return r?r.attribute.keepOnSplit:!1}))}function eH(e,t,n={}){let{empty:r,ranges:i}=e.selection,a=t?EB(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(e=>!a||a.name===e.type.name).find(e=>SB(e.attrs,n,{strict:!1}));let o=0,s=[];if(i.forEach(({$from:t,$to:n})=>{let r=t.pos,i=n.pos;e.doc.nodesBetween(r,i,(e,t)=>{if(a&&e.inlineContent&&!e.type.allowsMarkType(a))return!1;if(!e.isText&&!e.marks.length)return;let n=Math.max(r,t),c=Math.min(i,t+e.nodeSize),l=c-n;o+=l,s.push(...e.marks.map(e=>({mark:e,from:n,to:c})))})}),o===0)return!1;let c=s.filter(e=>!a||a.name===e.mark.type.name).filter(e=>SB(e.mark.attrs,n,{strict:!1})).reduce((e,t)=>e+t.to-t.from,0),l=s.filter(e=>!a||e.mark.type!==a&&e.mark.type.excludes(a)).reduce((e,t)=>e+t.to-t.from,0);return(c>0?c+l:c)>=o}var tH=(e,t)=>{let{$from:n,$to:r,$anchor:i}=e.selection;if(t){let n=CV(e=>e.type.name===t)(e.selection);if(!n)return!1;let r=e.doc.resolve(n.pos+1);return i.pos+1===r.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},nH=e=>{let{$from:t,$to:n}=e.selection;return!(t.parentOffset>0||t.pos!==n.pos)};function rH(e,t){let{nodeExtensions:n}=kV(t),r=n.find(t=>t.name===e);if(!r)return!1;let i=DV(wV(r,`group`,{name:r.name,options:r.options,storage:r.storage}));return typeof i==`string`&&i.split(` `).includes(`list`)}function iH(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){if(n){if(e.type.name===`hardBreak`)return!0;if(e.isText)return!/\S/.test(e.text??``)}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(e.content.childCount===0)return!0;if(t){let r=!0;return e.content.forEach(e=>{r!==!1&&(iH(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))}),r}return!1}function aH(e){return e instanceof SP}function oH(e,t,n){let{selection:r}=t,i=null;if(kB(r)&&(i=r.$cursor),i){let t=e.storedMarks??i.marks();return i.parent.type.allowsMarkType(n)&&(!!n.isInSet(t)||!t.some(e=>e.type.excludes(n)))}let{ranges:a}=r;return a.some(({$from:t,$to:r})=>{let i=t.depth===0&&e.doc.inlineContent&&e.doc.type.allowsMarkType(n);return e.doc.nodesBetween(t.pos,r.pos,(e,t,r)=>{if(i)return!1;if(e.isInline){let t=!r||r.type.allowsMarkType(n),a=!!n.isInSet(e.marks)||!e.marks.some(e=>e.type.excludes(n));i=t&&a}return!i}),i})}var sH=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{selection:a}=n,{empty:o,ranges:s}=a,c=EB(e,r.schema);if(i){if(o){let e=vV(r,c);n.addStoredMark(c.create({...e,...t}))}else s.forEach(e=>{let i=e.$from.pos,a=e.$to.pos;r.doc.nodesBetween(i,a,(e,r)=>{let o=Math.max(r,i),s=Math.min(r+e.nodeSize,a);e.marks.find(e=>e.type===c)?e.marks.forEach(e=>{c===e.type&&n.addMark(o,s,c.create({...e.attrs,...t}))}):n.addMark(o,s,c.create(t))})})}return oH(r,n,c)},cH=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),lH=(e,t={})=>({state:n,dispatch:r,chain:i})=>{let a=hB(e,n.schema),o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),a.isTextblock?i().command(({commands:e})=>fF(a,{...o,...t})(n)?!0:e.clearNodes()).command(({state:e})=>fF(a,{...o,...t})(e,r)).run():(console.warn(`[tiptap warn]: Currently "setNode()" only supports text block nodes.`),!1)},uH=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,r=AB(e,0,n.content.size),i=SP.create(n,r);t.setSelection(i)}return!0},dH=(e,t)=>({tr:n,state:r,dispatch:i})=>{let{selection:a}=r,o,s;return typeof t==`number`?(o=t,s=t):t&&`from`in t&&`to`in t?(o=t.from,s=t.to):(o=a.from,s=a.to),i&&n.doc.nodesBetween(o,s,(t,r)=>{t.isText||n.setNodeMarkup(r,void 0,{...t.attrs,dir:e})}),!0},fH=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,{from:r,to:i}=typeof e==`number`?{from:e,to:e}:e,a=bP.atStart(n).from,o=bP.atEnd(n).to,s=AB(r,a,o),c=AB(i,a,o),l=bP.create(n,s,c);t.setSelection(l)}return!0},pH=e=>({state:t,dispatch:n})=>wF(hB(e,t.schema))(t,n);function mH(e,t){let n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){let r=n.filter(e=>t?.includes(e.type.name));e.tr.ensureMarks(r)}}var hH=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{let{selection:a,doc:o}=t,{$from:s,$to:c}=a,l=i.extensionManager.attributes,u=$V(l,s.node().type.name,s.node().attrs);if(a instanceof SP&&a.node.isBlock)return!s.parentOffset||!VN(o,s.pos)?!1:(r&&(e&&mH(n,i.extensionManager.splittableMarks),t.split(s.pos).scrollIntoView()),!0);if(!s.parent.isBlock)return!1;let d=c.parentOffset===c.parent.content.size,f=s.depth===0?void 0:bV(s.node(-1).contentMatchAt(s.indexAfter(-1))),p=d&&f?[{type:f,attrs:u}]:void 0,m=VN(t.doc,t.mapping.map(s.pos),1,p);if(!p&&!m&&VN(t.doc,t.mapping.map(s.pos),1,f?[{type:f}]:void 0)&&(m=!0,p=f?[{type:f,attrs:u}]:void 0),r){if(m&&(a instanceof bP&&t.deleteSelection(),t.split(t.mapping.map(s.pos),1,p),f&&!d&&!s.parentOffset&&s.parent.type!==f)){let e=t.mapping.map(s.before()),n=t.doc.resolve(e);s.node(-1).canReplaceWith(n.index(),n.index()+1,f)&&t.setNodeMarkup(t.mapping.map(s.before()),f)}e&&mH(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return m},gH=(e,t={})=>({tr:n,state:r,dispatch:i,editor:a})=>{let o=hB(e,r.schema),{$from:s,$to:c}=r.selection,l=r.selection.node;if(l&&l.isBlock||s.depth<2||!s.sameParent(c))return!1;let u=s.node(-1);if(u.type!==o)return!1;let d=a.extensionManager.attributes;if(s.parent.content.size===0&&s.node(-1).childCount===s.indexAfter(-1)){if(s.depth===2||s.node(-3).type!==o||s.index(-2)!==s.node(-2).childCount-1)return!1;if(i){let e=U.empty,r=s.index(-1)?1:s.index(-2)?2:3;for(let t=s.depth-r;t>=s.depth-3;--t)e=U.from(s.node(t).copy(e));let i=s.indexAfter(-1)<s.node(-2).childCount?1:s.indexAfter(-2)<s.node(-3).childCount?2:3,a={...$V(d,s.node().type.name,s.node().attrs),...t},c=o.contentMatch.defaultType?.createAndFill(a)||void 0;e=e.append(U.from(o.createAndFill(null,c)||void 0));let l=s.before(s.depth-(r-1));n.replace(l,s.after(-i),new W(e,4-r,0));let u=-1;n.doc.nodesBetween(l,n.doc.content.size,(e,t)=>{if(u>-1)return!1;e.isTextblock&&e.content.size===0&&(u=t+1)}),u>-1&&n.setSelection(bP.near(n.doc.resolve(u))),n.scrollIntoView()}return!0}let f=c.pos===s.end()?u.contentMatchAt(0).defaultType:null,p={...$V(d,u.type.name,u.attrs),...t},m={...$V(d,s.node().type.name,s.node().attrs),...t};n.delete(s.pos,c.pos);let h=f?[{type:o,attrs:p},{type:f,attrs:m}]:[{type:o,attrs:p}];if(!VN(n.doc,s.pos,2))return!1;if(i){let{selection:e,storedMarks:t}=r,{splittableMarks:o}=a.extensionManager,c=t||e.$to.parentOffset&&e.$from.marks();if(n.split(s.pos,2,h).scrollIntoView(),!c||!i)return!0;let l=c.filter(e=>o.includes(e.type.name));n.ensureMarks(l)}return!0},_H=(e,t)=>{let n=CV(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;let i=e.doc.nodeAt(r);return n.node.type===i?.type&&UN(e.doc,n.pos)&&e.join(n.pos),!0},vH=(e,t)=>{let n=CV(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;let i=e.doc.nodeAt(r);return n.node.type===i?.type&&UN(e.doc,r)&&e.join(r),!0};function yH(e){let t=e.doc,n=t.firstChild;if(!n)return null;let r=n.nodeSize-1;return bP.create(t,1,r)}var bH=(e,t,n,r={})=>({editor:i,tr:a,state:o,dispatch:s,chain:c,commands:l,can:u})=>{let{extensions:d,splittableMarks:f}=i.extensionManager,p=hB(e,o.schema),m=hB(t,o.schema),{selection:h,storedMarks:g}=o,{$from:_,$to:v}=h,y=_.blockRange(v),b=g||h.$to.parentOffset&&h.$from.marks();if(!y)return!1;let x=CV(e=>rH(e.type.name,d))(h),S=h.from===0&&h.to===o.doc.content.size,C=o.doc.content.content,w=C.length===1?C[0]:null,T=S&&w&&rH(w.type.name,d)?{node:w,pos:0,depth:0}:null,ee=x??T,te=!!x&&y.depth>=1&&y.depth-x.depth<=1,ne=!!T;if((te||ne)&&ee){if(ee.node.type===p)return S&&ne?c().command(({tr:e,dispatch:t})=>{let n=yH(e);return n?(e.setSelection(n),t&&t(e),!0):!1}).liftListItem(m).run():l.liftListItem(m);if(rH(ee.node.type.name,d)&&p.validContent(ee.node.content))return c().command(()=>(a.setNodeMarkup(ee.pos,p),!0)).command(()=>_H(a,p)).command(()=>vH(a,p)).run()}return!n||!b||!s?c().command(()=>u().wrapInList(p,r)?!0:l.clearNodes()).wrapInList(p,r).command(()=>_H(a,p)).command(()=>vH(a,p)).run():c().command(()=>{let e=u().wrapInList(p,r),t=b.filter(e=>f.includes(e.type.name));return a.ensureMarks(t),e?!0:l.clearNodes()}).wrapInList(p,r).command(()=>_H(a,p)).command(()=>vH(a,p)).run()},xH=(e,t={},n={})=>({state:r,commands:i})=>{let{extendEmptyMarkRange:a=!1}=n,o=EB(e,r.schema);return eH(r,o,t)?i.unsetMark(o,{extendEmptyMarkRange:a}):i.setMark(o,t)},SH=(e,t,n={})=>({state:r,commands:i})=>{let a=hB(e,r.schema),o=hB(t,r.schema),s=tV(r,a,n),c;return r.selection.$anchor.sameParent(r.selection.$head)&&(c=r.selection.$anchor.parent.attrs),s?i.setNode(o,c):i.setNode(a,{...c,...n})},CH=(e,t={})=>({state:n,commands:r})=>{let i=hB(e,n.schema);return tV(n,i,t)?r.lift(i):r.wrapIn(i,t)},wH=()=>({state:e,dispatch:t})=>{let n=e.plugins;for(let r=0;r<n.length;r+=1){let i=n[r],a;if(i.spec.isInputRules&&(a=i.getState(e))){if(t){let t=e.tr,n=a.transform;for(let e=n.steps.length-1;e>=0;--e)t.step(n.steps[e].invert(n.docs[e]));if(a.text){let n=t.doc.resolve(a.from).marks();t.replaceWith(a.from,a.to,e.schema.text(a.text,n))}else t.delete(a.from,a.to)}return!0}}return!1},TH=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,{empty:r,ranges:i}=n;return r||t&&i.forEach(t=>{e.removeMark(t.$from.pos,t.$to.pos)}),!0},EH=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{extendEmptyMarkRange:a=!1}=t,{selection:o}=n,s=EB(e,r.schema),{$from:c,empty:l,ranges:u}=o;if(!i)return!0;if(l&&a){let{from:e,to:t}=o,r=TB(c,s,c.marks().find(e=>e.type===s)?.attrs);r&&(e=r.from,t=r.to),n.removeMark(e,t,s)}else u.forEach(e=>{n.removeMark(e.$from.pos,e.$to.pos,s)});return n.removeStoredMark(s),!0},DH=e=>({tr:t,state:n,dispatch:r})=>{let{selection:i}=n,a,o;return typeof e==`number`?(a=e,o=e):e&&`from`in e&&`to`in e?(a=e.from,o=e.to):(a=i.from,o=i.to),r&&t.doc.nodesBetween(a,o,(e,n)=>{if(e.isText)return;let r={...e.attrs};delete r.dir,t.setNodeMarkup(n,void 0,r)}),!0},OH=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=oV(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=hB(e,r.schema)),s===`mark`&&(o=EB(e,r.schema));let c=!1;return n.selection.ranges.forEach(e=>{let s=e.$from.pos,l=e.$to.pos,u,d,f,p;n.selection.empty?r.doc.nodesBetween(s,l,(e,t)=>{a&&a===e.type&&(c=!0,f=Math.max(t,s),p=Math.min(t+e.nodeSize,l),u=t,d=e)}):r.doc.nodesBetween(s,l,(e,r)=>{r<s&&a&&a===e.type&&(c=!0,f=Math.max(r,s),p=Math.min(r+e.nodeSize,l),u=r,d=e),r>=s&&r<=l&&(a&&a===e.type&&(c=!0,i&&n.setNodeMarkup(r,void 0,{...e.attrs,...t})),o&&e.marks.length&&e.marks.forEach(a=>{if(o===a.type&&(c=!0,i)){let i=Math.max(r,s),c=Math.min(r+e.nodeSize,l);n.addMark(i,c,o.create({...a.attrs,...t}))}}))}),d&&(u!==void 0&&i&&n.setNodeMarkup(u,void 0,{...d.attrs,...t}),o&&d.marks.length&&d.marks.forEach(e=>{o===e.type&&i&&n.addMark(f,p,o.create({...e.attrs,...t}))}))}),c},kH=(e,t={})=>({state:n,dispatch:r})=>dF(hB(e,n.schema),t)(n,r),AH=(e,t={})=>({state:n,dispatch:r})=>vF(hB(e,n.schema),t)(n,r),jH=class{constructor(e){this.find=e.find,this.handler=e.handler,this.undoable=e.undoable??!0}};function MH(e){return Object.prototype.toString.call(e).slice(8,-1)}function NH(e){return MH(e)===`Object`&&e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function PH(e,t){let n={...e};return NH(e)&&NH(t)&&Object.keys(t).forEach(r=>{NH(t[r])&&NH(e[r])?n[r]=PH(e[r],t[r]):n[r]=t[r]}),n}var FH=class{constructor(e={}){this.type=`extendable`,this.parent=null,this.child=null,this.name=``,this.config={name:this.name},this.config={...this.config,...e},this.name=this.config.name}get options(){return{...DV(wV(this,`addOptions`,{name:this.name}))||{}}}get storage(){return{...DV(wV(this,`addStorage`,{name:this.name,options:this.options}))||{}}}configure(e={}){let t=this.extend({...this.config,addOptions:()=>PH(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){let t=new this.constructor({...this.config,...e});return t.parent=this,this.child=t,t.name=`name`in e?e.name:t.parent.name,t}},IH=class e extends FH{constructor(){super(...arguments),this.type=`mark`}static create(t={}){let n=typeof t==`function`?t():t;return new e(n)}static handleExit({editor:e,mark:t}){let{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){let i=r.marks();if(!i.find(e=>e?.type.name===t.name))return!1;let a=i.find(e=>e?.type.name===t.name);return a&&n.removeStoredMark(a),n.insertText(` `,r.pos),e.view.dispatch(n),!0}return!1}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}},LH=class{constructor(e){this.find=e.find,this.handler=e.handler}};iB({},{ClipboardTextSerializer:()=>zH,Commands:()=>BH,Delete:()=>VH,Drop:()=>HH,Editable:()=>UH,FocusEvents:()=>GH,Keymap:()=>KH,Paste:()=>qH,Tabindex:()=>JH,TextDirection:()=>YH,focusEventsPluginKey:()=>WH});var RH=class e extends FH{constructor(){super(...arguments),this.type=`extension`}static create(t={}){let n=typeof t==`function`?t():t;return new e(n)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}},zH=RH.create({name:`clipboardTextSerializer`,addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new jP({key:new PP(`clipboardTextSerializer`),props:{clipboardTextSerializer:()=>{let{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,{ranges:a}=i,o=Math.min(...a.map(e=>e.$from.pos)),s=Math.max(...a.map(e=>e.$to.pos)),c=GV(n);return WV(r,{from:o,to:s},{...this.options.blockSeparator===void 0?{}:{blockSeparator:this.options.blockSeparator},textSerializers:c})}}})]}}),BH=RH.create({name:`commands`,addCommands(){return{...sB}}}),VH=RH.create({name:`delete`,onUpdate({transaction:e,appendedTransactions:t}){let n=()=>{var n;if(((n=this.editor.options.coreExtensionOptions?.delete)?.filterTransaction)?.call(n,e)??e.getMeta(`y-sync$`))return;let r=yV(e.before,[e,...t]);XV(r).forEach(t=>{r.mapping.mapResult(t.oldRange.from).deletedAfter&&r.mapping.mapResult(t.oldRange.to).deletedBefore&&r.before.nodesBetween(t.oldRange.from,t.oldRange.to,(n,i)=>{let a=i+n.nodeSize-2,o=t.oldRange.from<=i&&a<=t.oldRange.to;this.editor.emit(`delete`,{type:`node`,node:n,from:i,to:a,newFrom:r.mapping.map(i),newTo:r.mapping.map(a),deletedRange:t.oldRange,newRange:t.newRange,partial:!o,editor:this.editor,transaction:e,combinedTransform:r})})});let i=r.mapping;r.steps.forEach((t,n)=>{if(t instanceof yN){let a=i.slice(n).map(t.from,-1),o=i.slice(n).map(t.to),s=i.invert().map(a,-1),c=i.invert().map(o),l=a>0&&r.doc.nodeAt(a-1)?.marks.some(e=>e.eq(t.mark)),u=r.doc.nodeAt(o)?.marks.some(e=>e.eq(t.mark));this.editor.emit(`delete`,{type:`mark`,mark:t.mark,from:t.from,to:t.to,deletedRange:{from:s,to:c},newRange:{from:a,to:o},partial:!!(u||l),editor:this.editor,transaction:e,combinedTransform:r})}})};this.editor.options.coreExtensionOptions?.delete?.async??!0?setTimeout(n,0):n()}}),HH=RH.create({name:`drop`,addProseMirrorPlugins(){return[new jP({key:new PP(`tiptapDrop`),props:{handleDrop:(e,t,n,r)=>{this.editor.emit(`drop`,{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),UH=RH.create({name:`editable`,addProseMirrorPlugins(){return[new jP({key:new PP(`editable`),props:{editable:()=>this.editor.options.editable}})]}}),WH=new PP(`focusEvents`),GH=RH.create({name:`focusEvents`,addProseMirrorPlugins(){let{editor:e}=this;return[new jP({key:WH,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;let r=e.state.tr.setMeta(`focus`,{event:n}).setMeta(`addToHistory`,!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;let r=e.state.tr.setMeta(`blur`,{event:n}).setMeta(`addToHistory`,!1);return t.dispatch(r),!1}}}})]}}),KH=RH.create({name:`keymap`,addKeyboardShortcuts(){let e=()=>this.editor.commands.first(({commands:e})=>[()=>e.undoInputRule(),()=>e.command(({tr:t})=>{let{selection:n,doc:r}=t,{empty:i,$anchor:a}=n,{pos:o,parent:s}=a,c=a.parent.isTextblock&&o>0?t.doc.resolve(o-1):a,l=c.parent.type.spec.isolating,u=a.pos-a.parentOffset,d=l&&c.parent.childCount===1?u===a.pos:gP.atStart(r).from===o;return!i||!s.type.isTextblock||s.textContent.length||!d||d&&a.parent.type.name===`paragraph`?!1:e.clearNodes()}),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:e})=>[()=>e.deleteSelection(),()=>e.deleteCurrentNode(),()=>e.joinForward(),()=>e.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},i={...n,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return NB()||QB()?i:r},addProseMirrorPlugins(){return[new jP({key:new PP(`clearDocument`),appendTransaction:(e,t,n)=>{if(e.some(e=>e.getMeta(`composition`)))return;let r=e.some(e=>e.docChanged)&&!t.doc.eq(n.doc),i=e.some(e=>e.getMeta(`preventClearDocument`));if(!r||i)return;let{empty:a,from:o,to:s}=t.selection,c=gP.atStart(t.doc).from,l=gP.atEnd(t.doc).to;if(a||o!==c||s!==l||!iH(n.doc))return;let u=n.tr,d=aB({state:n,transaction:u}),{commands:f}=new oB({editor:this.editor,state:d});if(f.clearNodes(),u.steps.length)return u}})]}}),qH=RH.create({name:`paste`,addProseMirrorPlugins(){return[new jP({key:new PP(`tiptapPaste`),props:{handlePaste:(e,t,n)=>{this.editor.emit(`paste`,{editor:this.editor,event:t,slice:n})}}})]}}),JH=RH.create({name:`tabindex`,addProseMirrorPlugins(){return[new jP({key:new PP(`tabindex`),props:{attributes:()=>this.editor.isEditable?{tabindex:`0`}:{}}})]}}),YH=RH.create({name:`textDirection`,addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];let{nodeExtensions:e}=kV(this.extensions);return[{types:e.filter(e=>e.name!==`text`).map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{let t=e.getAttribute(`dir`);return t&&(t===`ltr`||t===`rtl`||t===`auto`)?t:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new jP({key:new PP(`textDirection`),props:{attributes:()=>{let e=this.options.direction;return e?{dir:e}:{}}}})]}});function XH(e){return new jH({find:e.find,handler:({state:t,range:n,match:r})=>{let i=DV(e.getAttributes,void 0,r);if(i===!1||i===null)return null;let{tr:a}=t,o=r[r.length-1],s=r[0];if(o){let r=s.search(/\S/),c=n.from+s.indexOf(o),l=c+o.length;if(ZV(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>c).length)return null;l<n.to&&a.delete(l,n.to),c>n.from&&a.delete(n.from+r,c);let u=n.from+r+o.length;a.addMark(n.from+r,u,e.type.create(i||{})),a.removeStoredMark(e.type)}},undoable:e.undoable})}function ZH(e){return new jH({find:e.find,handler:({state:t,range:n,match:r})=>{let i=DV(e.getAttributes,void 0,r)||{},{tr:a}=t,o=n.from,s=n.to,c=e.type.create(i);if(r[1]){let e=o+r[0].lastIndexOf(r[1]);e>s?e=s:s=e+r[1].length;let t=r[0][r[0].length-1];a.insertText(t,o+r[0].length-1),a.replaceWith(e,s,c)}else if(r[0]){let t=e.type.isInline?o:o-1;a.insert(t,e.type.create(i)).delete(a.mapping.map(o),a.mapping.map(s))}a.scrollIntoView()},undoable:e.undoable})}function QH(e){return new jH({find:e.find,handler:({state:t,range:n,match:r})=>{let i=t.doc.resolve(n.from),a=DV(e.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,a)},undoable:e.undoable})}function $H(e){return new jH({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{let a=DV(e.getAttributes,void 0,r)||{},o=t.tr.delete(n.from,n.to),s=o.doc.resolve(n.from).blockRange(),c=s&&jN(s,e.type,a);if(!c)return null;if(o.wrap(s,c),e.keepMarks&&e.editor){let{selection:n,storedMarks:r}=t,{splittableMarks:i}=e.editor.extensionManager,a=r||n.$to.parentOffset&&n.$from.marks();if(a){let e=a.filter(e=>i.includes(e.type.name));o.ensureMarks(e)}}if(e.keepAttributes){let t=e.type.name===`bulletList`||e.type.name===`orderedList`?`listItem`:`taskList`;i().updateAttributes(t,a).run()}let l=o.doc.resolve(n.from-1).nodeBefore;l&&l.type===e.type&&UN(o.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,l))&&o.join(n.from-1)},undoable:e.undoable})}var eU=e=>`touches`in e,tU=class{constructor(e){this.directions=[`bottom-left`,`bottom-right`,`top-left`,`top-right`],this.minSize={height:8,width:8},this.preserveAspectRatio=!1,this.classNames={container:``,wrapper:``,handle:``,resizing:``},this.initialWidth=0,this.initialHeight=0,this.aspectRatio=1,this.isResizing=!1,this.activeHandle=null,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.isShiftKeyPressed=!1,this.lastEditableState=void 0,this.handleMap=new Map,this.handleMouseMove=e=>{if(!this.isResizing||!this.activeHandle)return;let t=e.clientX-this.startX,n=e.clientY-this.startY;this.handleResize(t,n)},this.handleTouchMove=e=>{if(!this.isResizing||!this.activeHandle)return;let t=e.touches[0];if(!t)return;let n=t.clientX-this.startX,r=t.clientY-this.startY;this.handleResize(n,r)},this.handleMouseUp=()=>{if(!this.isResizing)return;let e=this.element.offsetWidth,t=this.element.offsetHeight;this.onCommit(e,t),this.isResizing=!1,this.activeHandle=null,this.container.dataset.resizeState=`false`,this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener(`mousemove`,this.handleMouseMove),document.removeEventListener(`mouseup`,this.handleMouseUp),document.removeEventListener(`keydown`,this.handleKeyDown),document.removeEventListener(`keyup`,this.handleKeyUp)},this.handleKeyDown=e=>{e.key===`Shift`&&(this.isShiftKeyPressed=!0)},this.handleKeyUp=e=>{e.key===`Shift`&&(this.isShiftKeyPressed=!1)},this.node=e.node,this.editor=e.editor,this.element=e.element,this.contentElement=e.contentElement,this.getPos=e.getPos,this.onResize=e.onResize,this.onCommit=e.onCommit,this.onUpdate=e.onUpdate,e.options?.min&&(this.minSize={...this.minSize,...e.options.min}),e.options?.max&&(this.maxSize=e.options.max),e?.options?.directions&&(this.directions=e.options.directions),e.options?.preserveAspectRatio&&(this.preserveAspectRatio=e.options.preserveAspectRatio),e.options?.className&&(this.classNames={container:e.options.className.container||``,wrapper:e.options.className.wrapper||``,handle:e.options.className.handle||``,resizing:e.options.className.resizing||``}),e.options?.createCustomHandle&&(this.createCustomHandle=e.options.createCustomHandle),this.wrapper=this.createWrapper(),this.container=this.createContainer(),this.applyInitialSize(),this.attachHandles(),this.editor.on(`update`,this.handleEditorUpdate.bind(this))}get dom(){return this.container}get contentDOM(){return this.contentElement??null}handleEditorUpdate(){let e=this.editor.isEditable;e!==this.lastEditableState&&(this.lastEditableState=e,e?e&&this.handleMap.size===0&&this.attachHandles():this.removeHandles())}update(e,t,n){return e.type===this.node.type&&(this.node=e,!this.onUpdate||this.onUpdate(e,t,n))}destroy(){this.isResizing&&(this.container.dataset.resizeState=`false`,this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener(`mousemove`,this.handleMouseMove),document.removeEventListener(`mouseup`,this.handleMouseUp),document.removeEventListener(`keydown`,this.handleKeyDown),document.removeEventListener(`keyup`,this.handleKeyUp),this.isResizing=!1,this.activeHandle=null),this.editor.off(`update`,this.handleEditorUpdate.bind(this)),this.container.remove()}createContainer(){let e=document.createElement(`div`);return e.dataset.resizeContainer=``,e.dataset.node=this.node.type.name,e.style.display=this.node.type.isInline?`inline-flex`:`flex`,this.classNames.container&&(e.className=this.classNames.container),e.appendChild(this.wrapper),e}createWrapper(){let e=document.createElement(`div`);return e.style.position=`relative`,e.style.display=`block`,e.dataset.resizeWrapper=``,this.classNames.wrapper&&(e.className=this.classNames.wrapper),e.appendChild(this.element),e}createHandle(e){let t=document.createElement(`div`);return t.dataset.resizeHandle=e,t.style.position=`absolute`,this.classNames.handle&&(t.className=this.classNames.handle),t}positionHandle(e,t){let n=t.includes(`top`),r=t.includes(`bottom`),i=t.includes(`left`),a=t.includes(`right`);n&&(e.style.top=`0`),r&&(e.style.bottom=`0`),i&&(e.style.left=`0`),a&&(e.style.right=`0`),(t===`top`||t===`bottom`)&&(e.style.left=`0`,e.style.right=`0`),(t===`left`||t===`right`)&&(e.style.top=`0`,e.style.bottom=`0`)}attachHandles(){this.directions.forEach(e=>{let t;t=this.createCustomHandle?this.createCustomHandle(e):this.createHandle(e),t instanceof HTMLElement||(console.warn(`[ResizableNodeView] createCustomHandle("${e}") did not return an HTMLElement. Falling back to default handle.`),t=this.createHandle(e)),this.createCustomHandle||this.positionHandle(t,e),t.addEventListener(`mousedown`,t=>this.handleResizeStart(t,e)),t.addEventListener(`touchstart`,t=>this.handleResizeStart(t,e)),this.handleMap.set(e,t),this.wrapper.appendChild(t)})}removeHandles(){this.handleMap.forEach(e=>e.remove()),this.handleMap.clear()}applyInitialSize(){let e=this.node.attrs.width,t=this.node.attrs.height;e?(this.element.style.width=`${e}px`,this.initialWidth=e):this.initialWidth=this.element.offsetWidth,t?(this.element.style.height=`${t}px`,this.initialHeight=t):this.initialHeight=this.element.offsetHeight,this.initialWidth>0&&this.initialHeight>0&&(this.aspectRatio=this.initialWidth/this.initialHeight)}handleResizeStart(e,t){e.preventDefault(),e.stopPropagation(),this.isResizing=!0,this.activeHandle=t,eU(e)?(this.startX=e.touches[0].clientX,this.startY=e.touches[0].clientY):(this.startX=e.clientX,this.startY=e.clientY),this.startWidth=this.element.offsetWidth,this.startHeight=this.element.offsetHeight,this.startWidth>0&&this.startHeight>0&&(this.aspectRatio=this.startWidth/this.startHeight),this.getPos(),this.container.dataset.resizeState=`true`,this.classNames.resizing&&this.container.classList.add(this.classNames.resizing),document.addEventListener(`mousemove`,this.handleMouseMove),document.addEventListener(`touchmove`,this.handleTouchMove),document.addEventListener(`mouseup`,this.handleMouseUp),document.addEventListener(`keydown`,this.handleKeyDown),document.addEventListener(`keyup`,this.handleKeyUp)}handleResize(e,t){if(!this.activeHandle)return;let n=this.preserveAspectRatio||this.isShiftKeyPressed,{width:r,height:i}=this.calculateNewDimensions(this.activeHandle,e,t),a=this.applyConstraints(r,i,n);this.element.style.width=`${a.width}px`,this.element.style.height=`${a.height}px`,this.onResize&&this.onResize(a.width,a.height)}calculateNewDimensions(e,t,n){let r=this.startWidth,i=this.startHeight,a=e.includes(`right`),o=e.includes(`left`),s=e.includes(`bottom`),c=e.includes(`top`);return a?r=this.startWidth+t:o&&(r=this.startWidth-t),s?i=this.startHeight+n:c&&(i=this.startHeight-n),(e===`right`||e===`left`)&&(r=this.startWidth+(a?t:-t)),(e===`top`||e===`bottom`)&&(i=this.startHeight+(s?n:-n)),this.preserveAspectRatio||this.isShiftKeyPressed?this.applyAspectRatio(r,i,e):{width:r,height:i}}applyConstraints(e,t,n){if(!n){let n=Math.max(this.minSize.width,e),r=Math.max(this.minSize.height,t);return this.maxSize?.width&&(n=Math.min(this.maxSize.width,n)),this.maxSize?.height&&(r=Math.min(this.maxSize.height,r)),{width:n,height:r}}let r=e,i=t;return r<this.minSize.width&&(r=this.minSize.width,i=r/this.aspectRatio),i<this.minSize.height&&(i=this.minSize.height,r=i*this.aspectRatio),this.maxSize?.width&&r>this.maxSize.width&&(r=this.maxSize.width,i=r/this.aspectRatio),this.maxSize?.height&&i>this.maxSize.height&&(i=this.maxSize.height,r=i*this.aspectRatio),{width:r,height:i}}applyAspectRatio(e,t,n){return n===`left`||n===`right`?{width:e,height:e/this.aspectRatio}:n===`top`||n===`bottom`?{width:t*this.aspectRatio,height:t}:{width:e,height:e/this.aspectRatio}}};function nU(e,t){let{selection:n}=e,{$from:r}=n;if(n instanceof SP){let e=r.index();return r.parent.canReplaceWith(e,e+1,t)}let i=r.depth;for(;i>=0;){let e=r.index(i);if(r.node(i).contentMatchAt(e).matchType(t))return!0;--i}return!1}iB({},{createAtomBlockMarkdownSpec:()=>aU,createBlockMarkdownSpec:()=>oU,createInlineMarkdownSpec:()=>lU,parseAttributes:()=>rU,parseIndentedBlocks:()=>uU,renderNestedMarkdownContent:()=>dU,serializeAttributes:()=>iU});function rU(e){if(!e?.trim())return{};let t={},n=[],r=e.replace(/["']([^"']*)["']/g,e=>(n.push(e),`__QUOTED_${n.length-1}__`)),i=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);i&&(t.class=i.map(e=>e.trim().slice(1)).join(` `));let a=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);a&&(t.id=a[1]),Array.from(r.matchAll(/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g)).forEach(([,e,r])=>{let i=parseInt(r.match(/__QUOTED_(\d+)__/)?.[1]||`0`,10),a=n[i];a&&(t[e]=a.slice(1,-1))});let o=r.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,``).replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,``).replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,``).trim();return o&&o.split(/\s+/).filter(Boolean).forEach(e=>{e.match(/^[a-zA-Z][\w-]*$/)&&(t[e]=!0)}),t}function iU(e){if(!e||Object.keys(e).length===0)return``;let t=[];return e.class&&String(e.class).split(/\s+/).filter(Boolean).forEach(e=>t.push(`.${e}`)),e.id&&t.push(`#${e.id}`),Object.entries(e).forEach(([e,n])=>{e!==`class`&&e!==`id`&&(n===!0?t.push(e):n!==!1&&n!=null&&t.push(`${e}="${String(n)}"`))}),t.join(` `)}function aU(e){let{nodeName:t,name:n,parseAttributes:r=rU,serializeAttributes:i=iU,defaultAttributes:a={},requiredAttributes:o=[],allowedAttributes:s}=e,c=n||t,l=e=>{if(!s)return e;let t={};return s.forEach(n=>{n in e&&(t[n]=e[n])}),t};return{parseMarkdown:(e,n)=>{let r={...a,...e.attributes};return n.createNode(t,r,[])},markdownTokenizer:{name:t,level:`block`,start(e){let t=RegExp(`^:::${c}(?:\\s|$)`,`m`),n=e.match(t)?.index;return n===void 0?-1:n},tokenize(e,n,i){let a=RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),s=e.match(a);if(!s)return;let l=s[1]||``,u=r(l);if(!o.find(e=>!(e in u)))return{type:t,raw:s[0],attributes:u}}},renderMarkdown:e=>{let t=l(e.attrs||{}),n=i(t),r=n?` {${n}}`:``;return`:::${c}${r} :::`}}}function oU(e){let{nodeName:t,name:n,getContent:r,parseAttributes:i=rU,serializeAttributes:a=iU,defaultAttributes:o={},content:s=`block`,allowedAttributes:c}=e,l=n||t,u=e=>{if(!c)return e;let t={};return c.forEach(n=>{n in e&&(t[n]=e[n])}),t};return{parseMarkdown:(e,n)=>{let i;if(r){let t=r(e);i=typeof t==`string`?[{type:`text`,text:t}]:t}else i=s===`block`?n.parseChildren(e.tokens||[]):n.parseInline(e.tokens||[]);let a={...o,...e.attributes};return n.createNode(t,a,i)},markdownTokenizer:{name:t,level:`block`,start(e){let t=RegExp(`^:::${l}`,`m`),n=e.match(t)?.index;return n===void 0?-1:n},tokenize(e,n,r){let a=RegExp(`^:::${l}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),o=e.match(a);if(!o)return;let[c,u=``]=o,d=i(u),f=1,p=c.length,m=``,h=/^:::([\w-]*)(\s.*)?/gm,g=e.slice(p);for(h.lastIndex=0;;){let n=h.exec(g);if(n===null)break;let i=n.index,a=n[1];if(!n[2]?.endsWith(`:::`)){if(a)f+=1;else if(--f,f===0){let a=g.slice(0,i);m=a.trim();let o=e.slice(0,p+i+n[0].length),c=[];if(m){if(s===`block`)for(c=r.blockTokens(a),c.forEach(e=>{e.text&&(!e.tokens||e.tokens.length===0)&&(e.tokens=r.inlineTokens(e.text))});c.length>0;){let e=c[c.length-1];if(e.type===`paragraph`&&(!e.text||e.text.trim()===``))c.pop();else break}else c=r.inlineTokens(m)}return{type:t,raw:o,attributes:d,content:m,tokens:c}}}}}},renderMarkdown:(e,t)=>{let n=u(e.attrs||{}),r=a(n),i=r?` {${r}}`:``,o=t.renderChildren(e.content||[],`
|
|
225
|
+
|
|
226
|
+
`);return`:::${l}${i}
|
|
227
|
+
|
|
228
|
+
${o}
|
|
229
|
+
|
|
230
|
+
:::`}}}function sU(e){if(!e.trim())return{};let t={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g,r=n.exec(e);for(;r!==null;){let[,i,a,o]=r;t[i]=a||o,r=n.exec(e)}return t}function cU(e){return Object.entries(e).filter(([,e])=>e!=null).map(([e,t])=>`${e}="${t}"`).join(` `)}function lU(e){let{nodeName:t,name:n,getContent:r,parseAttributes:i=sU,serializeAttributes:a=cU,defaultAttributes:o={},selfClosing:s=!1,allowedAttributes:c}=e,l=n||t,u=e=>{if(!c)return e;let t={};return c.forEach(n=>{let r=typeof n==`string`?n:n.name,i=typeof n==`string`?void 0:n.skipIfDefault;if(r in e){let n=e[r];if(i!==void 0&&n===i)return;t[r]=n}}),t},d=l.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);return{parseMarkdown:(e,n)=>{let i={...o,...e.attributes};if(s)return n.createNode(t,i);let a=r?r(e):e.content||``;return a?n.createNode(t,i,[n.createTextNode(a)]):n.createNode(t,i,[])},markdownTokenizer:{name:t,level:`inline`,start(e){let t=RegExp(s?`\\[${d}\\s*[^\\]]*\\]`:`\\[${d}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${d}\\]`),n=e.match(t)?.index;return n===void 0?-1:n},tokenize(e,n,r){let a=RegExp(s?`^\\[${d}\\s*([^\\]]*)\\]`:`^\\[${d}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${d}\\]`),o=e.match(a);if(!o)return;let c=``,l=``;if(s){let[,e]=o;l=e}else{let[,e,t]=o;l=e,c=t||``}let u=i(l.trim());return{type:t,raw:o[0],content:c.trim(),attributes:u}}},renderMarkdown:e=>{let t=``;r?t=r(e):e.content&&e.content.length>0&&(t=e.content.filter(e=>e.type===`text`).map(e=>e.text).join(``));let n=u(e.attrs||{}),i=a(n),o=i?` ${i}`:``;return s?`[${l}${o}]`:`[${l}${o}]${t}[/${l}]`}}}function uU(e,t,n){let r=e.split(`
|
|
231
|
+
`),i=[],a=``,o=0,s=t.baseIndentSize||2;for(;o<r.length;){let e=r[o],c=e.match(t.itemPattern);if(!c){if(i.length>0)break;if(e.trim()===``){o+=1,a=`${a}${e}
|
|
232
|
+
`;continue}return}let l=t.extractItemData(c),{indentLevel:u,mainContent:d}=l;a=`${a}${e}
|
|
233
|
+
`;let f=[d];for(o+=1;o<r.length;){let e=r[o];if(e.trim()===``){let t=r.slice(o+1).findIndex(e=>e.trim()!==``);if(t===-1)break;if((r[o+1+t].match(/^(\s*)/)?.[1]?.length||0)>u){f.push(e),a=`${a}${e}
|
|
234
|
+
`,o+=1;continue}break}if((e.match(/^(\s*)/)?.[1]?.length||0)>u)f.push(e),a=`${a}${e}
|
|
235
|
+
`,o+=1;else break}let p,m=f.slice(1);if(m.length>0){let e=m.map(e=>e.slice(u+s)).join(`
|
|
236
|
+
`);e.trim()&&(p=t.customNestedParser?t.customNestedParser(e):n.blockTokens(e))}let h=t.createToken(l,p);i.push(h)}if(i.length!==0)return{items:i,raw:a}}function dU(e,t,n,r){if(!e||!Array.isArray(e.content))return``;let i=typeof n==`function`?n(r):n,[a,...o]=e.content,s=`${i}${t.renderChildren([a])}`;return o&&o.length>0&&o.forEach((e,n)=>{let r=t.renderChild?.call(t,e,n+1)??t.renderChildren([e]);if(r!=null){let n=r.split(`
|
|
237
|
+
`).map(e=>e?t.indent(e):t.indent(``)).join(`
|
|
238
|
+
`);s+=e.type===`paragraph`?`
|
|
239
|
+
|
|
240
|
+
${n}`:`
|
|
241
|
+
${n}`}}),s}var fU=class e extends FH{constructor(){super(...arguments),this.type=`node`}static create(t={}){let n=typeof t==`function`?t():t;return new e(n)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}};function pU(e){return new LH({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{let a=DV(e.getAttributes,void 0,r,i);if(a===!1||a===null)return null;let{tr:o}=t,s=r[r.length-1],c=r[0],l=n.to;if(s){let i=c.search(/\S/),u=n.from+c.indexOf(s),d=u+s.length;if(ZV(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>u).length)return null;d<n.to&&o.delete(d,n.to),u>n.from&&o.delete(n.from+i,u),l=n.from+i+s.length,o.addMark(n.from+i,l,e.type.create(a||{})),r.index!==void 0&&r.input!==void 0&&r.index+r[0].length>=r.input.length||o.removeStoredMark(e.type)}}})}var mU=4,hU=/^```([a-z]+)?[\s\n]$/,gU=/^~~~([a-z]+)?[\s\n]$/,_U=fU.create({name:`codeBlock`,addOptions(){return{languageClassPrefix:`language-`,exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:mU,HTMLAttributes:{}}},content:`text*`,marks:``,group:`block`,code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{let{languageClassPrefix:t}=this.options;return t&&[...e.firstElementChild?.classList||[]].filter(e=>e.startsWith(t)).map(e=>e.replace(t,``))[0]||null},rendered:!1}}},parseHTML(){return[{tag:`pre`,preserveWhitespace:`full`}]},renderHTML({node:e,HTMLAttributes:t}){return[`pre`,NV(this.options.HTMLAttributes,t),[`code`,{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},markdownTokenName:`code`,parseMarkdown:(e,t)=>e.raw?.startsWith("```")===!1&&e.raw?.startsWith(`~~~`)===!1&&e.codeBlockStyle!==`indented`?[]:t.createNode(`codeBlock`,{language:e.lang||null},e.text?[t.createTextNode(e.text)]:[]),renderMarkdown:(e,t)=>{let n=``,r=e.attrs?.language||``;return n=e.content?[`\`\`\`${r}`,t.renderChildren(e.content),"```"].join(`
|
|
242
|
+
`):`\`\`\`${r}
|
|
243
|
+
|
|
244
|
+
\`\`\``,n},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,`paragraph`,e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:e,$anchor:t}=this.editor.state.selection,n=t.pos===1;return!e||t.parent.type.name!==this.name?!1:n||!t.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:e})=>{if(!this.options.enableTabIndentation)return!1;let t=this.options.tabSize??mU,{state:n}=e,{selection:r}=n,{$from:i,empty:a}=r;if(i.parent.type!==this.type)return!1;let o=` `.repeat(t);return a?e.commands.insertContent(o):e.commands.command(({tr:e})=>{let{from:t,to:i}=r,a=n.doc.textBetween(t,i,`
|
|
245
|
+
`,`
|
|
246
|
+
`).split(`
|
|
247
|
+
`).map(e=>o+e).join(`
|
|
248
|
+
`);return e.replaceWith(t,i,n.schema.text(a)),!0})},"Shift-Tab":({editor:e})=>{if(!this.options.enableTabIndentation)return!1;let t=this.options.tabSize??mU,{state:n}=e,{selection:r}=n,{$from:i,empty:a}=r;return i.parent.type===this.type?a?e.commands.command(({tr:e})=>{let{pos:r}=i,a=i.start(),o=i.end(),s=n.doc.textBetween(a,o,`
|
|
249
|
+
`,`
|
|
250
|
+
`).split(`
|
|
251
|
+
`),c=0,l=0,u=r-a;for(let e=0;e<s.length;e+=1){if(l+s[e].length>=u){c=e;break}l+=s[e].length+1}let d=s[c].match(/^ */)?.[0]||``,f=Math.min(d.length,t);if(f===0)return!0;let p=a;for(let e=0;e<c;e+=1)p+=s[e].length+1;return e.delete(p,p+f),r-p<=f&&e.setSelection(bP.create(e.doc,p)),!0}):e.commands.command(({tr:e})=>{let{from:i,to:a}=r,o=n.doc.textBetween(i,a,`
|
|
252
|
+
`,`
|
|
253
|
+
`).split(`
|
|
254
|
+
`).map(e=>{let n=e.match(/^ */)?.[0]||``,r=Math.min(n.length,t);return e.slice(r)}).join(`
|
|
255
|
+
`);return e.replaceWith(i,a,n.schema.text(o)),!0}):!1},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;let{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;let a=r.parentOffset===r.parent.nodeSize-2,o=r.parent.textContent.endsWith(`
|
|
256
|
+
|
|
257
|
+
`);return!a||!o?!1:e.chain().command(({tr:e})=>(e.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;let{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:a}=n;if(!a||i.parent.type!==this.type||i.parentOffset!==i.parent.nodeSize-2)return!1;let o=i.after();return o===void 0?!1:r.nodeAt(o)?e.commands.command(({tr:e})=>(e.setSelection(gP.near(r.resolve(o))),!0)):e.commands.exitCode()}}},addInputRules(){return[QH({find:hU,type:this.type,getAttributes:e=>({language:e[1]})}),QH({find:gU,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new jP({key:new PP(`codeBlockVSCodeHandler`),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;let n=t.clipboardData.getData(`text/plain`),r=t.clipboardData.getData(`vscode-editor-data`),i=(r?JSON.parse(r):void 0)?.mode;if(!n||!i)return!1;let{tr:a,schema:o}=e.state,s=o.text(n.replace(/\r\n?/g,`
|
|
258
|
+
`));return a.replaceSelectionWith(this.type.create({language:i},s)),a.selection.$from.parent.type!==this.type&&a.setSelection(bP.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.setMeta(`paste`,!0),e.dispatch(a),!0}}})]}});const vU=_U.extend({priority:60,addAttributes(){return{...this.parent?.(),fenceDelimiter:{default:"`"},fenceLength:{default:3},meta:{default:null},sourceStyle:{default:`fenced`},sourceClosingFenceLength:{default:null,rendered:!1},sourceUnclosedFence:{default:!1,rendered:!1},sourceFenceIndent:{default:null,rendered:!1},sourceInfoPadding:{default:null,rendered:!1},sourceIndents:{default:null,rendered:!1}}}});function yU({node:e}){return``.repeat(e.nodeSize-e.content.size)}const bU=fU.create({name:`footnoteReference`,marks:`_`,group:`inline`,inline:!0,atom:!0,selectable:!0,draggable:!1,priority:60,renderText:yU,addAttributes(){return{identifier:{default:``},label:{default:null}}},parseHTML(){return[{tag:`sup[data-footnote-ref]`,getAttrs:e=>{if(typeof e==`string`)return!1;let t=e.getAttribute(`data-footnote-id`)||``;return{identifier:t,label:t||null}}}]},renderHTML({node:e}){let t=String(e.attrs.identifier??``);return[`sup`,{id:`fnref-${t}`,"data-footnote-ref":``,"data-footnote-id":t,class:`footnote-ref`},[`a`,{href:`#fn-${t}`,class:`footnote-ref-link`},`[${t}]`]]},addCommands(){return{insertFootnoteReference:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{identifier:e,label:e}})}}}),xU=fU.create({name:`imageReference`,marks:`_`,group:`inline`,inline:!0,atom:!0,priority:60,renderText:yU,addAttributes(){return{alt:{default:``},label:{default:``},identifier:{default:``},referenceType:{default:`shortcut`}}},parseHTML(){return[{tag:`img[data-image-reference]`}]},renderHTML({node:e}){let{alt:t,label:n,referenceType:r}=e.attrs;return[`img`,{"data-image-reference":``,"data-reference-type":r,"data-label":n,alt:t||n}]}});function SU(e){if(typeof e!=`string`||!e.startsWith(`/`))return e;let t=globalThis.window?.okDesktop?.config?.apiOrigin;return typeof t==`string`&&t?t+e:e}var CU=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/;const wU=fU.create({name:`image`,addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?`inline`:`block`},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?`img[src]`:`img[src]:not([src^="data:"])`}]},renderHTML({HTMLAttributes:e}){return[`img`,NV(this.options.HTMLAttributes,e)]},parseMarkdown:(e,t)=>t.createNode(`image`,{src:e.href,title:e.title,alt:e.text}),renderMarkdown:e=>{let t=e.attrs?.src??``,n=e.attrs?.alt??``,r=e.attrs?.title??``;return r?``:``},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>`u`)return null;let{directions:e,minWidth:t,minHeight:n,alwaysPreserveAspectRatio:r}=this.options.resize;return({node:i,getPos:a,HTMLAttributes:o,editor:s})=>{let c=document.createElement(`img`);Object.entries(o).forEach(([e,t])=>{if(t!=null)switch(e){case`width`:case`height`:break;default:c.setAttribute(e,t)}}),c.src=o.src;let l=new tU({element:c,editor:s,node:i,getPos:a,onResize:(e,t)=>{c.style.width=`${e}px`,c.style.height=`${t}px`},onCommit:(e,t)=>{let n=a();n!==void 0&&this.editor.chain().setNodeSelection(n).updateAttributes(this.name,{width:e,height:t}).run()},onUpdate:(e,t,n)=>e.type===i.type,options:{directions:e,min:{width:t,height:n},preserveAspectRatio:r===!0}}),u=l.dom;return u.style.visibility=`hidden`,u.style.pointerEvents=`none`,c.onload=()=>{u.style.visibility=``,u.style.pointerEvents=``},l}},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[ZH({find:CU,type:this.type,getAttributes:e=>{let[,,t,n,r]=e;return{src:n,alt:t,title:r}}})]}}).extend({marks:`_`,priority:60,renderText:yU,addAttributes(){return{...this.parent?.(),sourceUrl:{default:null,rendered:!1},sourceUrlForm:{default:null,rendered:!1}}},renderHTML({HTMLAttributes:e}){let t=NV(this.options.HTMLAttributes,e);return typeof t.src==`string`&&(t.src=SU(t.src)),[`img`,t]}}),TU=fU.create({name:`jsxComponent`,group:`block`,atom:!1,content:`block*`,isolating:!0,selectable:!0,defining:!0,priority:60,addAttributes(){return{componentName:{default:``},kind:{default:`element`},attributes:{default:[]},sourceRaw:{default:``},sourceDirty:{default:!1},props:{default:{}}}},parseHTML(){return[{tag:`div[data-jsx-component]`,getAttrs:e=>typeof e!=`string`&&{componentName:e.getAttribute(`data-component-name`)||``,sourceRaw:e.getAttribute(`data-source-raw`)||``}}]},renderHTML({HTMLAttributes:e}){return[`div`,{"data-jsx-component":``,"data-component-name":e.componentName,"data-source-raw":e.sourceRaw},0]},addCommands(){return{insertJsxComponent:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{sourceRaw:e}})}}}),EU=fU.create({name:`jsxInline`,group:`inline`,inline:!0,atom:!1,content:`text*`,isolating:!1,selectable:!0,priority:60,renderText:yU,addAttributes(){return{componentName:{default:``},kind:{default:`element`},attributes:{default:[]},sourceRaw:{default:``},sourceDirty:{default:!1},props:{default:{}}}},parseHTML(){return[{tag:`span[data-jsx-inline]`,getAttrs:e=>typeof e!=`string`&&{componentName:e.getAttribute(`data-component-name`)||``,sourceRaw:e.getAttribute(`data-source-raw`)||``}}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-jsx-inline":``,"data-component-name":e.componentName,"data-source-raw":e.sourceRaw},0]}});var DU=r((e=>{let t=`numeric`,n=`ascii`,r=`alpha`,i=`asciinumeric`,a=`alphanumeric`,o=`domain`,s=`emoji`,c=`whitespace`;function l(e,t){return e in t||(t[e]=[]),t[e]}function u(e,c,u){c[t]&&(c[i]=!0,c[a]=!0),c[n]&&(c[i]=!0,c[r]=!0),c[i]&&(c[a]=!0),c[r]&&(c[a]=!0),c[a]&&(c[o]=!0),c[s]&&(c[o]=!0);for(let t in c){let n=l(t,u);n.indexOf(e)<0&&n.push(e)}}function d(e,t){let n={};for(let r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}function f(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}f.groups={},f.prototype={accepts(){return!!this.t},go(e){let t=this,n=t.j[e];if(n)return n;for(let n=0;n<t.jr.length;n++){let r=t.jr[n][0],i=t.jr[n][1];if(i&&r.test(e))return i}return t.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,r){for(let i=0;i<e.length;i++)this.tt(e[i],t,n,r)},tr(e,t,n,r){r||=f.groups;let i;return t&&t.j?i=t:(i=new f(t),n&&r&&u(t,n,r)),this.jr.push([e,i]),i},ts(e,t,n,r){let i=this,a=e.length;if(!a)return i;for(let t=0;t<a-1;t++)i=i.tt(e[t]);return i.tt(e[a-1],t,n,r)},tt(e,t,n,r){r||=f.groups;let i=this;if(t&&t.j)return i.j[e]=t,t;let a=t,o,s=i.go(e);return s?(o=new f,Object.assign(o.j,s.j),o.jr.push.apply(o.jr,s.jr),o.jd=s.jd,o.t=s.t):o=new f,a&&(r&&(o.t&&typeof o.t==`string`?u(a,Object.assign(d(o.t,r),n),r):n&&u(a,n,r)),o.t=a),i.j[e]=o,o}};let p=(e,t,n,r,i)=>e.ta(t,n,r,i),m=(e,t,n,r,i)=>e.tr(t,n,r,i),h=(e,t,n,r,i)=>e.ts(t,n,r,i),g=(e,t,n,r,i)=>e.tt(t,n,r,i),_=`WORD`,v=`UWORD`,y=`ASCIINUMERICAL`,b=`ALPHANUMERICAL`,x=`LOCALHOST`,S=`UTLD`,C=`SCHEME`,w=`SLASH_SCHEME`,T=`OPENBRACE`,ee=`CLOSEBRACE`,te=`OPENBRACKET`,ne=`CLOSEBRACKET`,re=`OPENPAREN`,ie=`CLOSEPAREN`,ae=`OPENANGLEBRACKET`,oe=`CLOSEANGLEBRACKET`,se=`FULLWIDTHLEFTPAREN`,ce=`FULLWIDTHRIGHTPAREN`,le=`LEFTCORNERBRACKET`,ue=`RIGHTCORNERBRACKET`,E=`LEFTWHITECORNERBRACKET`,de=`RIGHTWHITECORNERBRACKET`,fe=`FULLWIDTHLESSTHAN`,pe=`FULLWIDTHGREATERTHAN`,D=`AMPERSAND`,O=`APOSTROPHE`,me=`ASTERISK`,he=`BACKSLASH`,ge=`BACKTICK`,_e=`CARET`,ve=`COLON`,ye=`COMMA`,be=`DOLLAR`,xe=`EQUALS`,Se=`EXCLAMATION`,Ce=`HYPHEN`,we=`PERCENT`,k=`PIPE`,Te=`PLUS`,Ee=`POUND`,De=`QUERY`,Oe=`QUOTE`,ke=`FULLWIDTHMIDDLEDOT`,Ae=`SEMI`,je=`SLASH`,Me=`TILDE`,Ne=`UNDERSCORE`,Pe=`EMOJI`;var Fe=Object.freeze({__proto__:null,ALPHANUMERICAL:b,AMPERSAND:D,APOSTROPHE:O,ASCIINUMERICAL:y,ASTERISK:me,AT:`AT`,BACKSLASH:he,BACKTICK:ge,CARET:_e,CLOSEANGLEBRACKET:oe,CLOSEBRACE:ee,CLOSEBRACKET:ne,CLOSEPAREN:ie,COLON:ve,COMMA:ye,DOLLAR:be,DOT:`DOT`,EMOJI:Pe,EQUALS:xe,EXCLAMATION:Se,FULLWIDTHGREATERTHAN:pe,FULLWIDTHLEFTPAREN:se,FULLWIDTHLESSTHAN:fe,FULLWIDTHMIDDLEDOT:ke,FULLWIDTHRIGHTPAREN:ce,HYPHEN:Ce,LEFTCORNERBRACKET:le,LEFTWHITECORNERBRACKET:E,LOCALHOST:x,NL:`NL`,NUM:`NUM`,OPENANGLEBRACKET:ae,OPENBRACE:T,OPENBRACKET:te,OPENPAREN:re,PERCENT:we,PIPE:k,PLUS:Te,POUND:Ee,QUERY:De,QUOTE:Oe,RIGHTCORNERBRACKET:ue,RIGHTWHITECORNERBRACKET:de,SCHEME:C,SEMI:Ae,SLASH:je,SLASH_SCHEME:w,SYM:`SYM`,TILDE:Me,TLD:`TLD`,UNDERSCORE:Ne,UTLD:S,UWORD:v,WORD:_,WS:`WS`});let Ie=/[a-z]/,Le=/\p{L}/u,Re=/\p{Emoji}/u,ze=/\d/,Be=/\s/,Ve=null,He=null;function Ue(e=[]){let l={};f.groups=l;let d=new f;Ve??=qe(`aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2`),He??=qe(`ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2`),g(d,`'`,O),g(d,`{`,T),g(d,`}`,ee),g(d,`[`,te),g(d,`]`,ne),g(d,`(`,re),g(d,`)`,ie),g(d,`<`,ae),g(d,`>`,oe),g(d,`(`,se),g(d,`)`,ce),g(d,`「`,le),g(d,`」`,ue),g(d,`『`,E),g(d,`』`,de),g(d,`<`,fe),g(d,`>`,pe),g(d,`&`,D),g(d,`*`,me),g(d,`@`,`AT`),g(d,"`",ge),g(d,`^`,_e),g(d,`:`,ve),g(d,`,`,ye),g(d,`$`,be),g(d,`.`,`DOT`),g(d,`=`,xe),g(d,`!`,Se),g(d,`-`,Ce),g(d,`%`,we),g(d,`|`,k),g(d,`+`,Te),g(d,`#`,Ee),g(d,`?`,De),g(d,`"`,Oe),g(d,`/`,je),g(d,`;`,Ae),g(d,`~`,Me),g(d,`_`,Ne),g(d,`\\`,he),g(d,`・`,ke);let p=m(d,ze,`NUM`,{[t]:!0});m(p,ze,p);let Ue=m(p,Ie,y,{[i]:!0}),We=m(p,Le,b,{[a]:!0}),Ge=m(d,Ie,_,{[n]:!0});m(Ge,ze,Ue),m(Ge,Ie,Ge),m(Ue,ze,Ue),m(Ue,Ie,Ue);let Je=m(d,Le,v,{[r]:!0});m(Je,Ie),m(Je,ze,We),m(Je,Le,Je),m(We,ze,We),m(We,Ie),m(We,Le,We);let A=g(d,`
|
|
259
|
+
`,`NL`,{[c]:!0}),Ye=g(d,`\r`,`WS`,{[c]:!0}),Xe=m(d,Be,`WS`,{[c]:!0});g(d,``,Xe),g(Ye,`
|
|
260
|
+
`,A),g(Ye,``,Xe),m(Ye,Be,Xe),g(Xe,`\r`),g(Xe,`
|
|
261
|
+
`),m(Xe,Be,Xe),g(Xe,``,Xe);let Ze=m(d,Re,Pe,{[s]:!0});g(Ze,`#`),m(Ze,Re,Ze),g(Ze,`️`,Ze);let Qe=g(Ze,``);g(Qe,`#`),m(Qe,Re,Ze);let $e=[[Ie,Ge],[ze,Ue]],et=[[Ie,null],[Le,Je],[ze,We]];for(let e=0;e<Ve.length;e++)Ke(d,Ve[e],`TLD`,_,$e);for(let e=0;e<He.length;e++)Ke(d,He[e],S,v,et);u(`TLD`,{tld:!0,ascii:!0},l),u(S,{utld:!0,alpha:!0},l),Ke(d,`file`,C,_,$e),Ke(d,`mailto`,C,_,$e),Ke(d,`http`,w,_,$e),Ke(d,`https`,w,_,$e),Ke(d,`ftp`,w,_,$e),Ke(d,`ftps`,w,_,$e),u(C,{scheme:!0,ascii:!0},l),u(w,{slashscheme:!0,ascii:!0},l),e=e.sort((e,t)=>e[0]>t[0]?1:-1);for(let r=0;r<e.length;r++){let a=e[r][0],s=e[r][1]?{scheme:!0}:{slashscheme:!0};a.indexOf(`-`)>=0?s[o]=!0:Ie.test(a)?ze.test(a)?s[i]=!0:s[n]=!0:s[t]=!0,h(d,a,a,s)}return h(d,`localhost`,x,{ascii:!0}),d.jd=new f(`SYM`),{start:d,tokens:Object.assign({groups:l},Fe)}}function We(e,t){let n=Ge(t.replace(/[A-Z]/g,e=>e.toLowerCase())),r=n.length,i=[],a=0,o=0;for(;o<r;){let s=e,c=null,l=0,u=null,d=-1,f=-1;for(;o<r&&(c=s.go(n[o]));)s=c,s.accepts()?(d=0,f=0,u=s):d>=0&&(d+=n[o].length,f++),l+=n[o].length,a+=n[o].length,o++;a-=d,o-=f,l-=d,i.push({t:u.t,v:t.slice(a-l,a),s:a-l,e:a})}return i}function Ge(e){let t=[],n=e.length,r=0;for(;r<n;){let i=e.charCodeAt(r),a,o=i<55296||i>56319||r+1===n||(a=e.charCodeAt(r+1))<56320||a>57343?e[r]:e.slice(r,r+2);t.push(o),r+=o.length}return t}function Ke(e,t,n,r,i){let a,o=t.length;for(let n=0;n<o-1;n++){let o=t[n];e.j[o]?a=e.j[o]:(a=new f(r),a.jr=i.slice(),e.j[o]=a),e=a}return a=new f(n),a.jr=i.slice(),e.j[t[o-1]]=a,a}function qe(e){let t=[],n=[],r=0;for(;r<e.length;){let i=0;for(;`0123456789`.indexOf(e[r+i])>=0;)i++;if(i>0){t.push(n.join(``));for(let t=parseInt(e.substring(r,r+i),10);t>0;t--)n.pop();r+=i}else n.push(e[r]),r++}return t}let Je={defaultProtocol:`http`,events:null,format:Ye,formatHref:Ye,nl2br:!1,tagName:`a`,target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function A(e,t=null){let n=Object.assign({},Je);e&&(n=Object.assign(n,e instanceof A?e.o:e));let r=n.ignoreTags,i=[];for(let e=0;e<r.length;e++)i.push(r[e].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=i}A.prototype={o:Je,ignoreTags:[],defaultRender(e){return e},check(e){return this.get(`validate`,e.toString(),e)},get(e,t,n){let r=t!=null,i=this.o[e];return i&&(typeof i==`object`?(i=n.t in i?i[n.t]:Je[e],typeof i==`function`&&r&&(i=i(t,n))):typeof i==`function`&&r&&(i=i(t,n.t,n)),i)},getObj(e,t,n){let r=this.o[e];return typeof r==`function`&&t!=null&&(r=r(t,n.t,n)),r},render(e){let t=e.render(this);return(this.get(`render`,null,e)||this.defaultRender)(t,e.t,e)}};function Ye(e){return e}function Xe(e,t){this.t=`token`,this.v=e,this.tk=t}Xe.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){let t=this.toString(),n=e.get(`truncate`,t,this),r=e.get(`format`,t,this);return n&&r.length>n?r.substring(0,n)+`…`:r},toFormattedHref(e){return e.get(`formatHref`,this.toHref(e.get(`defaultProtocol`)),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=Je.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get(`validate`,this.toString(),this)},render(e){let t=this,n=this.toHref(e.get(`defaultProtocol`)),r=e.get(`formatHref`,n,this),i=e.get(`tagName`,n,t),a=this.toFormattedString(e),o={},s=e.get(`className`,n,t),c=e.get(`target`,n,t),l=e.get(`rel`,n,t),u=e.getObj(`attributes`,n,t),d=e.getObj(`events`,n,t);return o.href=r,s&&(o.class=s),c&&(o.target=c),l&&(o.rel=l),u&&Object.assign(o,u),{tagName:i,attributes:o,content:a,eventListeners:d}}};function Ze(e,t){class n extends Xe{constructor(t,n){super(t,n),this.t=e}}for(let e in t)n.prototype[e]=t[e];return n.t=e,n}let Qe=Ze(`email`,{isLink:!0,toHref(){return`mailto:`+this.toString()}}),$e=Ze(`text`),et=Ze(`nl`),tt=Ze(`url`,{isLink:!0,toHref(e=Je.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){let e=this.tk;return e.length>=2&&e[0].t!==x&&e[1].t===ve}}),nt=e=>new f(e);function rt({groups:e}){let t=e.domain.concat([D,me,`AT`,he,ge,_e,be,xe,Ce,`NUM`,we,k,Te,Ee,je,`SYM`,Me,Ne]),n=[O,ve,ye,`DOT`,Se,we,De,Oe,Ae,ae,oe,T,ee,ne,te,re,ie,se,ce,le,ue,E,de,fe,pe],r=[D,O,me,he,ge,_e,be,xe,Ce,T,ee,we,k,Te,Ee,De,je,`SYM`,Me,Ne],i=nt(),a=g(i,Me);p(a,r,a),p(a,e.domain,a);let o=nt(),s=nt(),c=nt();p(i,e.domain,o),p(i,e.scheme,s),p(i,e.slashscheme,c),p(o,r,a),p(o,e.domain,o);let l=g(o,`AT`);g(a,`AT`,l),g(s,`AT`,l),g(c,`AT`,l);let u=g(a,`DOT`);p(u,r,a),p(u,e.domain,a);let d=nt();p(l,e.domain,d),p(d,e.domain,d);let f=g(d,`DOT`);p(f,e.domain,d);let m=nt(Qe);p(f,e.tld,m),p(f,e.utld,m),g(l,x,m);let h=g(d,Ce);g(h,Ce,h),p(h,e.domain,d),p(m,e.domain,d),g(m,`DOT`,f),g(m,Ce,h);let _=g(o,Ce),v=g(o,`DOT`);g(_,Ce,_),p(_,e.domain,o),p(v,r,a),p(v,e.domain,o);let y=nt(tt);p(v,e.tld,y),p(v,e.utld,y),p(y,e.domain,o),p(y,r,a),g(y,`DOT`,v),g(y,Ce,_),g(y,`AT`,l);let b=g(y,ve),S=nt(tt);p(b,e.numeric,S);let C=nt(tt),w=nt();p(C,t,C),p(C,n,w),p(w,t,C),p(w,n,w),g(y,je,C),g(S,je,C);let ke=g(s,ve),Pe=g(c,ve),Ie=g(Pe,je),Le=g(Ie,je);p(s,e.domain,o),g(s,`DOT`,v),g(s,Ce,_),p(c,e.domain,o),g(c,`DOT`,v),g(c,Ce,_),p(ke,e.domain,C),g(ke,je,C),g(ke,De,C),p(Le,e.domain,C),p(Le,t,C),g(Le,je,C);let Re=[[T,ee],[te,ne],[re,ie],[ae,oe],[se,ce],[le,ue],[E,de],[fe,pe]];for(let e=0;e<Re.length;e++){let[r,i]=Re[e],a=g(C,r);g(w,r,a);let o=nt(tt);p(a,t,o);let s=nt();p(a,n,s),g(a,i,C),p(o,t,o),p(o,n,s),p(s,t,o),p(s,n,s),g(o,i,C),g(s,i,C)}return g(i,x,y),g(i,`NL`,et),{start:i,tokens:Fe}}function it(e,t,n){let r=n.length,i=0,a=[],o=[];for(;i<r;){let s=e,c=null,l=null,u=0,d=null,f=-1;for(;i<r&&!(c=s.go(n[i].t));)o.push(n[i++]);for(;i<r&&(l=c||s.go(n[i].t));)c=null,s=l,s.accepts()?(f=0,d=s):f>=0&&f++,i++,u++;if(f<0)i-=u,i<r&&(o.push(n[i]),i++);else{o.length>0&&(a.push(at($e,t,o)),o=[]),i-=f,u-=f;let e=d.t,r=n.slice(i-u,i);a.push(at(e,t,r))}}return o.length>0&&a.push(at($e,t,o)),a}function at(e,t,n){let r=n[0].s,i=n[n.length-1].e;return new e(t.slice(r,i),n)}let ot=typeof console<`u`&&console&&console.warn||(()=>{}),st={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function ct(){return f.groups={},st.scanner=null,st.parser=null,st.tokenQueue=[],st.pluginQueue=[],st.customSchemes=[],st.initialized=!1,st}function lt(e,t=!1){if(st.initialized&&ot(`linkifyjs: already initialized - will not register custom scheme "${e}" until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw Error(`linkifyjs: incorrect scheme format.
|
|
262
|
+
1. Must only contain digits, lowercase ASCII letters or "-"
|
|
263
|
+
2. Cannot start or end with "-"
|
|
264
|
+
3. "-" cannot repeat`);st.customSchemes.push([e,t])}function ut(){st.scanner=Ue(st.customSchemes);for(let e=0;e<st.tokenQueue.length;e++)st.tokenQueue[e][1]({scanner:st.scanner});st.parser=rt(st.scanner.tokens);for(let e=0;e<st.pluginQueue.length;e++)st.pluginQueue[e][1]({scanner:st.scanner,parser:st.parser});return st.initialized=!0,st}function dt(e){return st.initialized||ut(),it(st.parser.start,e,We(st.scanner.start,e))}dt.scan=We;function ft(e,t=null,n=null){if(t&&typeof t==`object`){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}let r=new A(n),i=dt(e),a=[];for(let e=0;e<i.length;e++){let n=i[e];n.isLink&&(!t||n.t===t)&&r.check(n)&&a.push(n.toFormattedObject(r))}return a}e.find=ft,e.registerCustomProtocol=lt,e.reset=ct,e.tokenize=dt}))(),OU=`[\0- \xA0 -\u2029 ]`,kU=new RegExp(OU),AU=RegExp(`${OU}$`),jU=new RegExp(OU,`g`);function MU(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?[`()`,`[]`].includes(e[0].value+e[2].value):!1}function NU(e){return new jP({key:new PP(`autolink`),appendTransaction:(t,n,r)=>{let i=t.some(e=>e.docChanged)&&!n.doc.eq(r.doc),a=t.some(e=>e.getMeta(`preventAutolink`));if(!i||a)return;let{tr:o}=r;if(XV(yV(n.doc,[...t])).forEach(({newRange:t})=>{let n=xV(r.doc,t,e=>e.isTextblock),i,a;if(n.length>1)i=n[0],a=r.doc.textBetween(i.pos,i.pos+i.node.nodeSize,void 0,` `);else if(n.length){let e=r.doc.textBetween(t.from,t.to,` `,` `);if(!AU.test(e))return;i=n[0],a=r.doc.textBetween(i.pos,t.to,void 0,` `)}if(i&&a){let t=a.split(kU).filter(Boolean);if(t.length<=0)return!1;let n=t[t.length-1],s=i.pos+a.lastIndexOf(n);if(!n)return!1;let c=(0,DU.tokenize)(n).map(t=>t.toObject(e.defaultProtocol));if(!MU(c))return!1;c.filter(e=>e.isLink).map(e=>({...e,from:s+e.start+1,to:s+e.end+1})).filter(e=>!r.schema.marks.code||!r.doc.rangeHasMark(e.from,e.to,r.schema.marks.code)).filter(t=>e.validate(t.value)).filter(t=>e.shouldAutoLink(t.value)).forEach(t=>{ZV(t.from,t.to,r.doc).some(t=>t.mark.type===e.type)||o.addMark(t.from,t.to,e.type.create({href:t.href}))})}}),o.steps.length)return o}})}function PU(e){return new jP({key:new PP(`handleClickLink`),props:{handleClick:(t,n,r)=>{if(r.button!==0||!t.editable)return!1;let i=null;if(r.target instanceof HTMLAnchorElement)i=r.target;else{let t=r.target;if(!t)return!1;let n=e.editor.view.dom;i=t.closest(`a`),i&&!n.contains(i)&&(i=null)}if(!i)return!1;let a=!1;if(e.enableClickSelection&&(a=e.editor.commands.extendMarkRange(e.type.name)),e.openOnClick){let n=qV(t.state,e.type.name),r=i.href??n.href,o=i.target??n.target;r&&(window.open(r,o),a=!0)}return a}}})}function FU(e){return new jP({key:new PP(`handlePasteLink`),props:{handlePaste:(t,n,r)=>{let{shouldAutoLink:i}=e,{state:a}=t,{selection:o}=a,{empty:s}=o;if(s)return!1;let c=``;r.content.forEach(e=>{c+=e.textContent});let l=(0,DU.find)(c,{defaultProtocol:e.defaultProtocol}).find(e=>e.isLink&&e.value===c);return!c||!l||i!==void 0&&!i(l.value)?!1:e.editor.commands.setMark(e.type,{href:l.href})}}})}function IU(e,t){let n=[`http`,`https`,`ftp`,`ftps`,`mailto`,`tel`,`callto`,`sms`,`cid`,`xmpp`];return t&&t.forEach(e=>{let t=typeof e==`string`?e:e.scheme;t&&n.push(t)}),!e||e.replace(jU,``).match(RegExp(`^(?:(?:${n.join(`|`)}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,`i`))}var LU=IH.create({name:`link`,priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(e=>{if(typeof e==`string`){(0,DU.registerCustomProtocol)(e);return}(0,DU.registerCustomProtocol)(e.scheme,e.optionalSlashes)})},onDestroy(){(0,DU.reset)()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:`http`,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer nofollow`,class:null},isAllowedUri:(e,t)=>!!IU(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>{let t=/^[a-z][a-z0-9+.-]*:\/\//i.test(e),n=/^[a-z][a-z0-9+.-]*:/i.test(e);if(t||n&&!e.includes(`@`))return!0;let r=(e.includes(`@`)?e.split(`@`).pop():e).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(r)||!/\./.test(r))}}},addAttributes(){return{href:{default:null,parseHTML(e){return e.getAttribute(`href`)}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class},title:{default:null}}},parseHTML(){return[{tag:`a[href]`,getAttrs:e=>{let t=e.getAttribute(`href`);return!t||!this.options.isAllowedUri(t,{defaultValidate:e=>!!IU(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:e=>!!IU(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?[`a`,NV(this.options.HTMLAttributes,e),0]:[`a`,NV(this.options.HTMLAttributes,{...e,href:``}),0]},markdownTokenName:`link`,parseMarkdown:(e,t)=>t.applyMark(`link`,t.parseInline(e.tokens||[]),{href:e.href,title:e.title||null}),renderMarkdown:(e,t)=>{let n=e.attrs?.href??``,r=e.attrs?.title??``,i=t.renderChildren(e);return r?`[${i}](${n} "${r}")`:`[${i}](${n})`},addCommands(){return{setLink:e=>({chain:t})=>{let{href:n}=e;return this.options.isAllowedUri(n,{defaultValidate:e=>!!IU(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().setMark(this.name,e).setMeta(`preventAutolink`,!0).run():!1},toggleLink:e=>({chain:t})=>{let{href:n}=e||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:e=>!!IU(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta(`preventAutolink`,!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta(`preventAutolink`,!0).run()}},addPasteRules(){return[pU({find:e=>{let t=[];if(e){let{protocols:n,defaultProtocol:r}=this.options,i=(0,DU.find)(e).filter(e=>e.isLink&&this.options.isAllowedUri(e.value,{defaultValidate:e=>!!IU(e,n),protocols:n,defaultProtocol:r}));i.length&&i.forEach(e=>{this.options.shouldAutoLink(e.value)&&t.push({text:e.value,data:{href:e.href},index:e.start})})}return t},type:this.type,getAttributes:e=>({href:e.data?.href})})]},addProseMirrorPlugins(){let e=[],{protocols:t,defaultProtocol:n}=this.options;return this.options.autolink&&e.push(NU({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!IU(e,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),e.push(PU({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick===`whenNotEditable`||this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&e.push(FU({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),e}}),RU=LU;const zU=new Set(Tu.map(e=>`${e}:`));function BU(e){try{let t=new URL(e,`https://placeholder.invalid`);return zU.has(t.protocol.toLowerCase())}catch{return!1}}const VU=`LinkFidelity must be derived from the Link extension`,HU=RU.extend({priority:60,addOptions(){let e=this.parent?.();if(e===void 0)throw Error(VU);return{...e,openOnClick:!1,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:`http`,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer`},isAllowedUri:BU,shouldAutoLink:()=>!0}},addAttributes(){let e=this.parent?.();if(e===void 0)throw Error(VU);return{...e,linkStyle:{default:`inline`,rendered:!1},refLabel:{default:null,rendered:!1},sourceForm:{default:null,rendered:!1},target:{default:null,rendered:!1},anchor:{default:null,rendered:!1},alias:{default:null,rendered:!1},sourceUrlForm:{default:null,rendered:!1},sourceTitleMarker:{default:null,rendered:!1},sourceTarget:{default:null,rendered:!1},sourceAnchor:{default:null,rendered:!1},sourceAlias:{default:null,rendered:!1}}}}),UU=fU.create({name:`mathInline`,marks:`_`,group:`inline`,inline:!0,atom:!0,selectable:!0,priority:60,renderText:yU,addAttributes(){return{formula:{default:``},id:{default:null},language:{default:`latex`},sourceDelimiter:{default:null,rendered:!1}}},parseHTML(){return[{tag:`span[data-math-inline]`,getAttrs:e=>typeof e!=`string`&&{formula:e.getAttribute(`data-formula`)||``,id:e.getAttribute(`id`)||null,language:e.getAttribute(`data-language`)||`latex`}}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-math-inline":``,"data-formula":e.formula,"data-language":e.language,...e.id?{id:e.id}:{}}]},addCommands(){return{insertMathInline:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{formula:e}})}}}),WU=fU.create({name:`rawMdxFallback`,group:`block`,atom:!1,content:`text*`,isolating:!0,selectable:!0,defining:!0,priority:60,addAttributes(){return{reason:{default:``},originalSpan:{default:{start:0,end:0}}}},parseHTML(){let e=e=>typeof e!=`string`&&{reason:e.getAttribute(`data-reason`)||``};return[{tag:`div[data-raw-mdx-fallback]`,getAttrs:e},{tag:`pre[data-raw-mdx-fallback]`,getAttrs:e}]},renderHTML({HTMLAttributes:e}){return[`div`,{"data-raw-mdx-fallback":``,"data-raw-badge":`raw`,"data-reason":e.reason,contenteditable:`false`,class:`raw-mdx-fallback`},0]},addNodeView(){return({HTMLAttributes:e})=>{let t=document.createElement(`div`);t.setAttribute(`data-raw-mdx-fallback`,``),t.setAttribute(`data-raw-badge`,`raw`),t.setAttribute(`contenteditable`,`false`),t.classList.add(`raw-mdx-fallback`),e.reason&&t.setAttribute(`data-reason`,e.reason);let n=document.createElement(`pre`);return n.classList.add(`raw-mdx-fallback-content`),n.setAttribute(`contenteditable`,`false`),t.appendChild(n),{dom:t,contentDOM:n,ignoreMutation:()=>!0}}}}),GU=IH.create({name:`sourceLiteral`,priority:10,excludes:``,inclusive:!1,addAttributes(){return{sourceRaw:{default:``}}},parseHTML(){return[{tag:`span[data-source-literal]`}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-source-literal":``,...e},0]}});function KU(e,t){if(typeof e!=`string`||typeof t!=`string`||/[\x00-\x1F\x7F]/.test(e))return!1;let n=e.replaceAll(`\xA0`,` `),r=t.replaceAll(`\xA0`,` `);return n===r||qU(n)===r||op(e)===t}function qU(e){return e.replace(/\\([!-/:-@[-`{-~])/g,`$1`)}const JU=fU.create({name:`tag`,marks:`_`,group:`inline`,inline:!0,atom:!0,selectable:!0,priority:60,renderText:yU,addAttributes(){return{value:{default:``}}},parseHTML(){return[{tag:`a[data-tag]`,getAttrs:e=>typeof e!=`string`&&{value:e.getAttribute(`data-tag`)||``}}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.value??``);return[`a`,{...t,"data-tag":n,href:`#tag/${n}`,class:`tag`},`#${n}`]},addCommands(){return{insertTag:e=>({chain:t})=>t().insertContent({type:`tag`,attrs:{value:e}}).run()}}});function YU(e,t){let{target:n,anchor:r,alias:i}=e;if(!t.separatorCrossed)return e;if(r!==null){let e=$U(r);return{target:n,anchor:e.length>0?e:null,alias:i===null?null:eW(i)}}return{target:$U(n),anchor:null,alias:i===null?null:eW(i)}}function XU(e,t,n){let r=e.trim();return r===t?!0:n===`alias`?eW(r)===t:$U(r)===t}function ZU(e,t,n){return typeof e==`string`&&XU(e,t,n)?e:t}function QU(e){return $U(e.trim())===``}function $U(e){return e.endsWith(`\\`)?e.slice(0,-1):e}function eW(e){return e.replace(/\\\|/g,`|`)}function tW(e){let t=``,n=0;for(let r of e)r===`\\`?n++:(r===`|`&&n%2==0&&(t+=`\\`),n=0),t+=r;return t}function nW(e){return e.replace(/\|/g,`\\|`)}function rW(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function iW(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}const aW=fU.create({name:`wikiLink`,marks:`_`,group:`inline`,inline:!0,atom:!0,priority:60,renderText:yU,addAttributes(){return{target:{default:``},alias:{default:null},anchor:{default:null},resolved:{default:!1},sourceTarget:{default:null,rendered:!1},sourceAnchor:{default:null,rendered:!1},sourceAlias:{default:null,rendered:!1}}},parseHTML(){return[{tag:`span[data-wiki-link]`,getAttrs:e=>typeof e!=`string`&&{target:e.getAttribute(`data-target`)||``,alias:rW(e.getAttribute(`data-alias`)),anchor:rW(e.getAttribute(`data-anchor`)),resolved:e.getAttribute(`data-resolved`)===`true`}},{tag:`a.wiki-link[data-target]`,priority:100,getAttrs:e=>{if(typeof e==`string`)return!1;let t=e.getAttribute(`data-target`)??``;return t?{target:t,alias:rW(e.getAttribute(`data-alias`)),anchor:rW(e.getAttribute(`data-anchor`)),resolved:!1}:!1}}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.target??``),r=rW(e.attrs.alias),i=rW(e.attrs.anchor),a=e.attrs.resolved===!0;return[`span`,{...t,"data-wiki-link":``,"data-target":n,"data-alias":r??``,"data-anchor":i??``,"data-resolved":a?`true`:`false`},iW({target:n,alias:r,anchor:i})]}});function oW(e){let t=e.split(`/`).pop()??e,n=t.lastIndexOf(`.`);return n<=0||n===t.length-1?``:t.slice(n+1).toLowerCase()}function sW(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}const cW=fU.create({name:`wikiLinkEmbed`,group:`inline`,inline:!0,atom:!0,priority:60,renderText:yU,addAttributes(){return{target:{default:``},alias:{default:null},anchor:{default:null},resolvedSrc:{default:null,rendered:!1,parseHTML:()=>null}}},parseHTML(){let e=e=>typeof e==`string`||!e.hasAttribute(`data-wiki-embed`)?!1:{target:e.getAttribute(`data-target`)||``,alias:rW(e.getAttribute(`data-alias`)),anchor:rW(e.getAttribute(`data-anchor`))};return[{tag:`img[data-wiki-embed]`,getAttrs:e,priority:100},{tag:`a[data-wiki-embed]`,getAttrs:e,priority:100}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.target??``),r=rW(e.attrs.alias),i=rW(e.attrs.anchor),a=rW(e.attrs.resolvedSrc),o=oW(n);if(vp.has(o))return[`img`,{...t,"data-wiki-embed":``,"data-target":n,"data-alias":r??``,"data-anchor":i??``,src:a??n,alt:r??n}];let s=a??n;return[`a`,{...t,"data-wiki-embed":``,"data-target":n,"data-alias":r??``,"data-anchor":i??``,href:i?`${s}#${i}`:s,target:`_blank`,rel:`noopener noreferrer`},sW({target:n,alias:r,anchor:i})]}});var lW=(e,t)=>{if(e===`slot`)return 0;if(e instanceof Function)return e(t);let{children:n,...r}=t??{};if(e===`svg`)throw Error(`SVG elements are not supported in the JSX syntax, use the array syntax instead`);return[e,r,n]},uW=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,dW=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,fW=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,pW=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,mW=IH.create({name:`bold`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`strong`},{tag:`b`,getAttrs:e=>e.style.fontWeight!==`normal`&&null},{style:`font-weight=400`,clearMark:e=>e.type.name===this.name},{style:`font-weight`,getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return lW(`strong`,{...NV(this.options.HTMLAttributes,e),children:lW(`slot`,{})})},markdownTokenName:`strong`,parseMarkdown:(e,t)=>t.applyMark(`bold`,t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:`<strong>`,close:`</strong>`}},renderMarkdown:(e,t)=>`**${t.renderChildren(e)}**`,addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[XH({find:uW,type:this.type}),XH({find:fW,type:this.type})]},addPasteRules(){return[pU({find:dW,type:this.type}),pU({find:pW,type:this.type})]}}),hW=mW,gW=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,_W=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,vW=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,yW=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,bW=IH.create({name:`italic`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`em`},{tag:`i`,getAttrs:e=>e.style.fontStyle!==`normal`&&null},{style:`font-style=normal`,clearMark:e=>e.type.name===this.name},{style:`font-style=italic`}]},renderHTML({HTMLAttributes:e}){return[`em`,NV(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},markdownTokenName:`em`,parseMarkdown:(e,t)=>t.applyMark(`italic`,t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:`<em>`,close:`</em>`}},renderMarkdown:(e,t)=>`*${t.renderChildren(e)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[XH({find:gW,type:this.type}),XH({find:vW,type:this.type})]},addPasteRules(){return[pU({find:_W,type:this.type}),pU({find:yW,type:this.type})]}}),xW=bW,SW=fU.create({name:`hardBreak`,markdownTokenName:`br`,addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:`inline`,selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:`br`}]},renderHTML({HTMLAttributes:e}){return[`br`,NV(this.options.HTMLAttributes,e)]},renderText(){return`
|
|
265
|
+
`},renderMarkdown:()=>`
|
|
266
|
+
`,parseMarkdown:()=>({type:`hardBreak`}),addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{let{selection:e,storedMarks:i}=n;if(e.$from.parent.type.spec.isolating)return!1;let{keepMarks:a}=this.options,{splittableMarks:o}=r.extensionManager,s=i||e.$to.parentOffset&&e.$from.marks();return t().insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{if(t&&s&&a){let t=s.filter(e=>o.includes(e.type.name));e.ensureMarks(t)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),CW=SW,wW=fU.create({name:`heading`,addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:`inline*`,group:`block`,defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,NV(this.options.HTMLAttributes,t),0]},parseMarkdown:(e,t)=>t.createNode(`heading`,{level:e.depth||1},t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>{let n=e.attrs?.level?parseInt(e.attrs.level,10):1,r=`#`.repeat(n);return e.content?`${r} ${t.renderChildren(e.content)}`:``},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,`paragraph`,e):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>QH({find:RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),TW=wW,EW=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,DW=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,OW=IH.create({name:`highlight`,addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:e=>e.getAttribute(`data-color`)||e.style.backgroundColor,renderHTML:e=>e.color?{"data-color":e.color,style:`background-color: ${e.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:`mark`}]},renderHTML({HTMLAttributes:e}){return[`mark`,NV(this.options.HTMLAttributes,e),0]},renderMarkdown:(e,t)=>`==${t.renderChildren(e)}==`,parseMarkdown:(e,t)=>t.applyMark(`highlight`,t.parseInline(e.tokens||[])),markdownTokenizer:{name:`highlight`,level:`inline`,start:e=>e.indexOf(`==`),tokenize(e,t,n){let r=/^(==)([^=]+)(==)/.exec(e);if(r){let e=r[2].trim(),t=n.inlineTokens(e);return{type:`highlight`,raw:r[0],text:e,tokens:t}}}},addCommands(){return{setHighlight:e=>({commands:t})=>t.setMark(this.name,e),toggleHighlight:e=>({commands:t})=>t.toggleMark(this.name,e),unsetHighlight:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[XH({find:EW,type:this.type})]},addPasteRules(){return[pU({find:DW,type:this.type})]}});let kW,AW;if(typeof WeakMap<`u`){let e=new WeakMap;kW=t=>e.get(t),AW=(t,n)=>(e.set(t,n),n)}else{let e=[],t=0;kW=t=>{for(let n=0;n<e.length;n+=2)if(e[n]==t)return e[n+1]},AW=(n,r)=>(t==10&&(t=0),e[t++]=n,e[t++]=r)}var jW=class{constructor(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r}findCell(e){for(let t=0;t<this.map.length;t++){let n=this.map[t];if(n!=e)continue;let r=t%this.width,i=t/this.width|0,a=r+1,o=i+1;for(let e=1;a<this.width&&this.map[t+e]==n;e++)a++;for(let e=1;o<this.height&&this.map[t+this.width*e]==n;e++)o++;return{left:r,top:i,right:a,bottom:o}}throw RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){let{left:r,right:i,top:a,bottom:o}=this.findCell(e);return t==`horiz`?(n<0?r==0:i==this.width)?null:this.map[a*this.width+(n<0?r-1:i)]:(n<0?a==0:o==this.height)?null:this.map[r+this.width*(n<0?a-1:o)]}rectBetween(e,t){let{left:n,right:r,top:i,bottom:a}=this.findCell(e),{left:o,right:s,top:c,bottom:l}=this.findCell(t);return{left:Math.min(n,o),top:Math.min(i,c),right:Math.max(r,s),bottom:Math.max(a,l)}}cellsInRect(e){let t=[],n={};for(let r=e.top;r<e.bottom;r++)for(let i=e.left;i<e.right;i++){let a=r*this.width+i,o=this.map[a];n[o]||(n[o]=!0,!(i==e.left&&i&&this.map[a-1]==o||r==e.top&&r&&this.map[a-this.width]==o)&&t.push(o))}return t}positionAt(e,t,n){for(let r=0,i=0;;r++){let a=i+n.child(r).nodeSize;if(r==e){let n=t+e*this.width,r=(e+1)*this.width;for(;n<r&&this.map[n]<i;)n++;return n==r?a-1:this.map[n]}i=a}}static get(e){return kW(e)||AW(e,MW(e))}};function MW(e){if(e.type.spec.tableRole!=`table`)throw RangeError(`Not a table node: `+e.type.name);let t=NW(e),n=e.childCount,r=[],i=0,a=null,o=[];for(let e=0,i=t*n;e<i;e++)r[e]=0;for(let s=0,c=0;s<n;s++){let l=e.child(s);c++;for(let e=0;;e++){for(;i<r.length&&r[i]!=0;)i++;if(e==l.childCount)break;let u=l.child(e),{colspan:d,rowspan:f,colwidth:p}=u.attrs;for(let e=0;e<f;e++){if(e+s>=n){(a||=[]).push({type:`overlong_rowspan`,pos:c,n:f-e});break}let l=i+e*t;for(let e=0;e<d;e++){r[l+e]==0?r[l+e]=c:(a||=[]).push({type:`collision`,row:s,pos:c,n:d-e});let n=p&&p[e];if(n){let r=(l+e)%t*2,i=o[r];i==null||i!=n&&o[r+1]==1?(o[r]=n,o[r+1]=1):i==n&&o[r+1]++}}}i+=d,c+=u.nodeSize}let u=(s+1)*t,d=0;for(;i<u;)r[i++]==0&&d++;d&&(a||=[]).push({type:`missing`,row:s,n:d}),c++}(t===0||n===0)&&(a||=[]).push({type:`zero_sized`});let s=new jW(t,n,r,a),c=!1;for(let e=0;!c&&e<o.length;e+=2)o[e]!=null&&o[e+1]<n&&(c=!0);return c&&PW(s,o,e),s}function NW(e){let t=-1,n=!1;for(let r=0;r<e.childCount;r++){let i=e.child(r),a=0;if(n)for(let t=0;t<r;t++){let n=e.child(t);for(let e=0;e<n.childCount;e++){let i=n.child(e);t+i.attrs.rowspan>r&&(a+=i.attrs.colspan)}}for(let e=0;e<i.childCount;e++){let t=i.child(e);a+=t.attrs.colspan,t.attrs.rowspan>1&&(n=!0)}t==-1?t=a:t!=a&&(t=Math.max(t,a))}return t}function PW(e,t,n){e.problems||=[];let r={};for(let i=0;i<e.map.length;i++){let a=e.map[i];if(r[a])continue;r[a]=!0;let o=n.nodeAt(a);if(!o)throw RangeError(`No cell with offset ${a} found`);let s=null,c=o.attrs;for(let n=0;n<c.colspan;n++){let r=t[(i+n)%e.width*2];r!=null&&(!c.colwidth||c.colwidth[n]!=r)&&((s||=FW(c))[n]=r)}s&&e.problems.unshift({type:`colwidth mismatch`,pos:a,colwidth:s})}}function FW(e){if(e.colwidth)return e.colwidth.slice();let t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function IW(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(let n in e.nodes){let r=e.nodes[n],i=r.spec.tableRole;i&&(t[i]=r)}}return t}const LW=new PP(`selectingCells`);function RW(e){for(let t=e.depth-1;t>0;t--)if(e.node(t).type.spec.tableRole==`row`)return e.node(0).resolve(e.before(t+1));return null}function zW(e){for(let t=e.depth;t>0;t--){let n=e.node(t).type.spec.tableRole;if(n===`cell`||n===`header_cell`)return e.node(t)}return null}function BW(e){let t=e.selection.$head;for(let e=t.depth;e>0;e--)if(t.node(e).type.spec.tableRole==`row`)return!0;return!1}function VW(e){let t=e.selection;if(`$anchorCell`in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if(`node`in t&&t.node&&t.node.type.spec.tableRole==`cell`)return t.$anchor;let n=RW(t.$head)||HW(t.$head);if(n)return n;throw RangeError(`No cell found around position ${t.head}`)}function HW(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){let r=t.type.spec.tableRole;if(r==`cell`||r==`header_cell`)return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){let r=t.type.spec.tableRole;if(r==`cell`||r==`header_cell`)return e.doc.resolve(n-t.nodeSize)}}function UW(e){return e.parent.type.spec.tableRole==`row`&&!!e.nodeAfter}function WW(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function GW(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function KW(e,t,n){let r=e.node(-1),i=jW.get(r),a=e.start(-1),o=i.nextCell(e.pos-a,t,n);return o==null?null:e.node(0).resolve(a+o)}function qW(e,t,n=1){let r={...e,colspan:e.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some(e=>e>0)||(r.colwidth=null)),r}function JW(e,t,n=1){let r={...e,colspan:e.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let e=0;e<n;e++)r.colwidth.splice(t,0,0)}return r}function YW(e,t,n){let r=IW(t.type.schema).header_cell;for(let i=0;i<e.height;i++)if(t.nodeAt(e.map[n+i*e.width]).type!=r)return!1;return!0}var XW=class e extends gP{constructor(e,t=e){let n=e.node(-1),r=jW.get(n),i=e.start(-1),a=r.rectBetween(e.pos-i,t.pos-i),o=e.node(0),s=r.cellsInRect(a).filter(e=>e!=t.pos-i);s.unshift(t.pos-i);let c=s.map(e=>{let t=n.nodeAt(e);if(!t)throw RangeError(`No cell with offset ${e} found`);let r=i+e+1;return new _P(o.resolve(r),o.resolve(r+t.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=t}map(t,n){let r=t.resolve(n.map(this.$anchorCell.pos)),i=t.resolve(n.map(this.$headCell.pos));if(UW(r)&&UW(i)&&GW(r,i)){let t=this.$anchorCell.node(-1)!=r.node(-1);return t&&this.isRowSelection()?e.rowSelection(r,i):t&&this.isColSelection()?e.colSelection(r,i):new e(r,i)}return bP.between(r,i)}content(){let e=this.$anchorCell.node(-1),t=jW.get(e),n=this.$anchorCell.start(-1),r=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),i={},a=[];for(let n=r.top;n<r.bottom;n++){let o=[];for(let a=n*t.width+r.left,s=r.left;s<r.right;s++,a++){let n=t.map[a];if(i[n])continue;i[n]=!0;let s=t.findCell(n),c=e.nodeAt(n);if(!c)throw RangeError(`No cell with offset ${n} found`);let l=r.left-s.left,u=s.right-r.right;if(l>0||u>0){let e=c.attrs;if(l>0&&(e=qW(e,0,l)),u>0&&(e=qW(e,e.colspan-u,u)),s.left<r.left){if(c=c.type.createAndFill(e),!c)throw RangeError(`Could not create cell with attrs ${JSON.stringify(e)}`)}else c=c.type.create(e,c.content)}if(s.top<r.top||s.bottom>r.bottom){let e={...c.attrs,rowspan:Math.min(s.bottom,r.bottom)-Math.max(s.top,r.top)};c=s.top<r.top?c.type.createAndFill(e):c.type.create(e,c.content)}o.push(c)}a.push(e.child(n).copy(U.from(o)))}let o=this.isColSelection()&&this.isRowSelection()?e:a;return new W(U.from(o),1,1)}replace(e,t=W.empty){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:a,$to:o}=r[i],s=e.mapping.slice(n);e.replace(s.map(a.pos),s.map(o.pos),i?W.empty:t)}let i=gP.findFrom(e.doc.resolve(e.mapping.slice(n).map(this.to)),-1);i&&e.setSelection(i)}replaceWith(e,t){this.replace(e,new W(U.from(t),0,0))}forEachCell(e){let t=this.$anchorCell.node(-1),n=jW.get(t),r=this.$anchorCell.start(-1),i=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r));for(let n=0;n<i.length;n++)e(t.nodeAt(i[n]),r+i[n])}isColSelection(){let e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)return!1;let n=e+this.$anchorCell.nodeAfter.attrs.rowspan,r=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){let r=t.node(-1),i=jW.get(r),a=t.start(-1),o=i.findCell(t.pos-a),s=i.findCell(n.pos-a),c=t.node(0);return o.top<=s.top?(o.top>0&&(t=c.resolve(a+i.map[o.left])),s.bottom<i.height&&(n=c.resolve(a+i.map[i.width*(i.height-1)+s.right-1]))):(s.top>0&&(n=c.resolve(a+i.map[s.left])),o.bottom<i.height&&(t=c.resolve(a+i.map[i.width*(i.height-1)+o.right-1]))),new e(t,n)}isRowSelection(){let e=this.$anchorCell.node(-1),t=jW.get(e),n=this.$anchorCell.start(-1),r=t.colCount(this.$anchorCell.pos-n),i=t.colCount(this.$headCell.pos-n);if(Math.min(r,i)>0)return!1;let a=r+this.$anchorCell.nodeAfter.attrs.colspan,o=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(a,o)==t.width}eq(t){return t instanceof e&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){let r=t.node(-1),i=jW.get(r),a=t.start(-1),o=i.findCell(t.pos-a),s=i.findCell(n.pos-a),c=t.node(0);return o.left<=s.left?(o.left>0&&(t=c.resolve(a+i.map[o.top*i.width])),s.right<i.width&&(n=c.resolve(a+i.map[i.width*(s.top+1)-1]))):(s.left>0&&(n=c.resolve(a+i.map[s.top*i.width])),o.right<i.width&&(t=c.resolve(a+i.map[i.width*(o.top+1)-1]))),new e(t,n)}toJSON(){return{type:`cell`,anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){return new e(t.resolve(n),t.resolve(r))}getBookmark(){return new ZW(this.$anchorCell.pos,this.$headCell.pos)}};XW.prototype.visible=!1,gP.jsonID(`cell`,XW);var ZW=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){let t=e.resolve(this.anchor),n=e.resolve(this.head);return t.parent.type.spec.tableRole==`row`&&n.parent.type.spec.tableRole==`row`&&t.index()<t.parent.childCount&&n.index()<n.parent.childCount&&GW(t,n)?new XW(t,n):gP.near(n,1)}};function QW(e){if(!(e.selection instanceof XW))return null;let t=[];return e.selection.forEachCell((e,n)=>{t.push($R.node(n,n+e.nodeSize,{class:`selectedCell`}))}),nz.create(e.doc,t)}function $W({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,r=t.pos,i=e.depth;for(;i>=0&&!(e.after(i+1)<e.end(i));i--,n++);for(let e=t.depth;e>=0&&!(t.before(e+1)>t.start(e));e--,r--);return n==r&&/row|table/.test(e.node(i).type.spec.tableRole)}function eG({$from:e,$to:t}){let n,r;for(let t=e.depth;t>0;t--){let r=e.node(t);if(r.type.spec.tableRole===`cell`||r.type.spec.tableRole===`header_cell`){n=r;break}}for(let e=t.depth;e>0;e--){let n=t.node(e);if(n.type.spec.tableRole===`cell`||n.type.spec.tableRole===`header_cell`){r=n;break}}return n!==r&&t.parentOffset===0}function tG(e,t,n){let r=(t||e).selection,i=(t||e).doc,a,o;if(r instanceof SP&&(o=r.node.type.spec.tableRole)){if(o==`cell`||o==`header_cell`)a=XW.create(i,r.from);else if(o==`row`){let e=i.resolve(r.from+1);a=XW.rowSelection(e,e)}else if(!n){let e=jW.get(r.node),t=r.from+1,n=t+e.map[e.width*e.height-1];a=XW.create(i,t+1,n)}}else r instanceof bP&&$W(r)?a=bP.create(i,r.from):r instanceof bP&&eG(r)&&(a=bP.create(i,r.$from.start(),r.$from.end()));return a&&(t||=e.tr).setSelection(a),t}const nG=new PP(`fix-tables`);function rG(e,t,n,r){let i=e.childCount,a=t.childCount;outer:for(let o=0,s=0;o<a;o++){let a=t.child(o);for(let t=s,r=Math.min(i,o+3);t<r;t++)if(e.child(t)==a){s=t+1,n+=a.nodeSize;continue outer}r(a,n),s<i&&e.child(s).sameMarkup(a)?rG(e.child(s),a,n+1,r):a.nodesBetween(0,a.content.size,r,n+1),n+=a.nodeSize}}function iG(e,t){let n,r=(t,r)=>{t.type.spec.tableRole==`table`&&(n=aG(e,t,r,n))};return t?t.doc!=e.doc&&rG(t.doc,e.doc,0,r):e.doc.descendants(r),n}function aG(e,t,n,r){let i=jW.get(t);if(!i.problems)return r;r||=e.tr;let a=[];for(let e=0;e<i.height;e++)a.push(0);for(let e=0;e<i.problems.length;e++){let o=i.problems[e];if(o.type==`collision`){let e=t.nodeAt(o.pos);if(!e)continue;let i=e.attrs;for(let e=0;e<i.rowspan;e++)a[o.row+e]+=o.n;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,qW(i,i.colspan-o.n,o.n))}else if(o.type==`missing`)a[o.row]+=o.n;else if(o.type==`overlong_rowspan`){let e=t.nodeAt(o.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,{...e.attrs,rowspan:e.attrs.rowspan-o.n})}else if(o.type==`colwidth mismatch`){let e=t.nodeAt(o.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,{...e.attrs,colwidth:o.colwidth})}else if(o.type==`zero_sized`){let e=r.mapping.map(n);r.delete(e,e+t.nodeSize)}}let o,s;for(let e=0;e<a.length;e++)a[e]&&(o??=e,s=e);for(let c=0,l=n+1;c<i.height;c++){let n=t.child(c),i=l+n.nodeSize,u=a[c];if(u>0){let t=`cell`;n.firstChild&&(t=n.firstChild.type.spec.tableRole);let a=[];for(let n=0;n<u;n++){let n=IW(e.schema)[t].createAndFill();n&&a.push(n)}let d=(c==0||o==c-1)&&s==c?l+1:i-1;r.insert(r.mapping.map(d),a)}l=i}return r.setMeta(nG,{fixTables:!0})}function oG(e){let t=e.selection,n=VW(e),r=n.node(-1),i=n.start(-1),a=jW.get(r);return{...t instanceof XW?a.rectBetween(t.$anchorCell.pos-i,t.$headCell.pos-i):a.findCell(n.pos-i),tableStart:i,map:a,table:r}}function sG(e,{map:t,tableStart:n,table:r},i){let a=i>0?-1:0;YW(t,r,i+a)&&(a=i==0||i==t.width?null:0);for(let o=0;o<t.height;o++){let s=o*t.width+i;if(i>0&&i<t.width&&t.map[s-1]==t.map[s]){let a=t.map[s],c=r.nodeAt(a);e.setNodeMarkup(e.mapping.map(n+a),null,JW(c.attrs,i-t.colCount(a))),o+=c.attrs.rowspan-1}else{let c=a==null?IW(r.type.schema).cell:r.nodeAt(t.map[s+a]).type,l=t.positionAt(o,i,r);e.insert(e.mapping.map(n+l),c.createAndFill())}}return e}function cG(e,t){if(!BW(e))return!1;if(t){let n=oG(e);t(sG(e.tr,n,n.left))}return!0}function lG(e,t){if(!BW(e))return!1;if(t){let n=oG(e);t(sG(e.tr,n,n.right))}return!0}function uG(e,{map:t,table:n,tableStart:r},i){let a=e.mapping.maps.length;for(let o=0;o<t.height;){let s=o*t.width+i,c=t.map[s],l=n.nodeAt(c),u=l.attrs;if(i>0&&t.map[s-1]==c||i<t.width-1&&t.map[s+1]==c)e.setNodeMarkup(e.mapping.slice(a).map(r+c),null,qW(u,i-t.colCount(c)));else{let t=e.mapping.slice(a).map(r+c);e.delete(t,t+l.nodeSize)}o+=u.rowspan}}function dG(e,t){if(!BW(e))return!1;if(t){let n=oG(e),r=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let e=n.right-1;uG(r,n,e),e!=n.left;e--){let e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError(`No table found`);n.table=e,n.map=jW.get(e)}t(r)}return!0}function fG(e,t,n){let r=IW(t.type.schema).header_cell;for(let i=0;i<e.width;i++)if(t.nodeAt(e.map[i+n*e.width])?.type!=r)return!1;return!0}function pG(e,{map:t,tableStart:n,table:r},i){let a=n;for(let e=0;e<i;e++)a+=r.child(e).nodeSize;let o=[],s=i>0?-1:0;fG(t,r,i+s)&&(s=i==0||i==t.height?null:0);for(let a=0,c=t.width*i;a<t.width;a++,c++)if(i>0&&i<t.height&&t.map[c]==t.map[c-t.width]){let i=t.map[c],o=r.nodeAt(i).attrs;e.setNodeMarkup(n+i,null,{...o,rowspan:o.rowspan+1}),a+=o.colspan-1}else{let e=(s==null?IW(r.type.schema).cell:r.nodeAt(t.map[c+s*t.width])?.type)?.createAndFill();e&&o.push(e)}return e.insert(a,IW(r.type.schema).row.create(null,o)),e}function mG(e,t){if(!BW(e))return!1;if(t){let n=oG(e);t(pG(e.tr,n,n.top))}return!0}function hG(e,t){if(!BW(e))return!1;if(t){let n=oG(e);t(pG(e.tr,n,n.bottom))}return!0}function gG(e,{map:t,table:n,tableStart:r},i){let a=0;for(let e=0;e<i;e++)a+=n.child(e).nodeSize;let o=a+n.child(i).nodeSize,s=e.mapping.maps.length;e.delete(a+r,o+r);let c=new Set;for(let a=0,o=i*t.width;a<t.width;a++,o++){let l=t.map[o];if(!c.has(l)){if(c.add(l),i>0&&l==t.map[o-t.width]){let t=n.nodeAt(l).attrs;e.setNodeMarkup(e.mapping.slice(s).map(l+r),null,{...t,rowspan:t.rowspan-1}),a+=t.colspan-1}else if(i<t.height&&l==t.map[o+t.width]){let o=n.nodeAt(l),c=o.attrs,u=o.type.create({...c,rowspan:o.attrs.rowspan-1},o.content),d=t.positionAt(i+1,a,n);e.insert(e.mapping.slice(s).map(r+d),u),a+=c.colspan-1}}}}function _G(e,t){if(!BW(e))return!1;if(t){let n=oG(e),r=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let e=n.bottom-1;gG(r,n,e),e!=n.top;e--){let e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError(`No table found`);n.table=e,n.map=jW.get(n.table)}t(r)}return!0}function vG(e){let t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function yG({width:e,height:t,map:n},r){let i=r.top*e+r.left,a=i,o=(r.bottom-1)*e+r.left,s=i+(r.right-r.left-1);for(let t=r.top;t<r.bottom;t++){if(r.left>0&&n[a]==n[a-1]||r.right<e&&n[s]==n[s+1])return!0;a+=e,s+=e}for(let a=r.left;a<r.right;a++){if(r.top>0&&n[i]==n[i-e]||r.bottom<t&&n[o]==n[o+e])return!0;i++,o++}return!1}function bG(e,t){let n=e.selection;if(!(n instanceof XW)||n.$anchorCell.pos==n.$headCell.pos)return!1;let r=oG(e),{map:i}=r;if(yG(i,r))return!1;if(t){let n=e.tr,a={},o=U.empty,s,c;for(let e=r.top;e<r.bottom;e++)for(let t=r.left;t<r.right;t++){let l=i.map[e*i.width+t],u=r.table.nodeAt(l);if(!(a[l]||!u)){if(a[l]=!0,s==null)s=l,c=u;else{vG(u)||(o=o.append(u.content));let e=n.mapping.map(l+r.tableStart);n.delete(e,e+u.nodeSize)}}}if(s==null||c==null)return!0;if(n.setNodeMarkup(s+r.tableStart,null,{...JW(c.attrs,c.attrs.colspan,r.right-r.left-c.attrs.colspan),rowspan:r.bottom-r.top}),o.size>0){let e=s+1+c.content.size,t=vG(c)?s+1:e;n.replaceWith(t+r.tableStart,e+r.tableStart,o)}n.setSelection(new XW(n.doc.resolve(s+r.tableStart))),t(n)}return!0}function xG(e,t){let n=IW(e.schema);return SG(({node:e})=>n[e.type.spec.tableRole])(e,t)}function SG(e){return(t,n)=>{let r=t.selection,i,a;if(r instanceof XW){if(r.$anchorCell.pos!=r.$headCell.pos)return!1;i=r.$anchorCell.nodeAfter,a=r.$anchorCell.pos}else{if(i=zW(r.$from),!i)return!1;a=RW(r.$from)?.pos}if(i==null||a==null||i.attrs.colspan==1&&i.attrs.rowspan==1)return!1;if(n){let o=i.attrs,s=[],c=o.colwidth;o.rowspan>1&&(o={...o,rowspan:1}),o.colspan>1&&(o={...o,colspan:1});let l=oG(t),u=t.tr;for(let e=0;e<l.right-l.left;e++)s.push(c?{...o,colwidth:c&&c[e]?[c[e]]:null}:o);let d;for(let t=l.top;t<l.bottom;t++){let n=l.map.positionAt(t,l.left,l.table);t==l.top&&(n+=i.nodeSize);for(let r=l.left,a=0;r<l.right;r++,a++)(r!=l.left||t!=l.top)&&u.insert(d=u.mapping.map(n+l.tableStart,1),e({node:i,row:t,col:r}).createAndFill(s[a]))}u.setNodeMarkup(a,e({node:i,row:l.top,col:l.left}),s[0]),r instanceof XW&&u.setSelection(new XW(u.doc.resolve(r.$anchorCell.pos),d?u.doc.resolve(d):void 0)),n(u)}return!0}}function CG(e,t){return function(n,r){if(!BW(n))return!1;let i=VW(n);if(i.nodeAfter.attrs[e]===t)return!1;if(r){let a=n.tr;n.selection instanceof XW?n.selection.forEachCell((n,r)=>{n.attrs[e]!==t&&a.setNodeMarkup(r,null,{...n.attrs,[e]:t})}):a.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[e]:t}),r(a)}return!0}}function wG(e){return function(t,n){if(!BW(t))return!1;if(n){let r=IW(t.schema),i=oG(t),a=t.tr,o=i.map.cellsInRect(e==`column`?{left:i.left,top:0,right:i.right,bottom:i.map.height}:e==`row`?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),s=o.map(e=>i.table.nodeAt(e));for(let e=0;e<o.length;e++)s[e].type==r.header_cell&&a.setNodeMarkup(i.tableStart+o[e],r.cell,s[e].attrs);if(a.steps.length===0)for(let e=0;e<o.length;e++)a.setNodeMarkup(i.tableStart+o[e],r.header_cell,s[e].attrs);n(a)}return!0}}function TG(e,t,n){let r=t.map.cellsInRect({left:0,top:0,right:e==`row`?t.map.width:1,bottom:e==`column`?t.map.height:1});for(let e=0;e<r.length;e++){let i=t.table.nodeAt(r[e]);if(i&&i.type!==n.header_cell)return!1}return!0}function EG(e,t){return t||={useDeprecatedLogic:!1},t.useDeprecatedLogic?wG(e):function(t,n){if(!BW(t))return!1;if(n){let r=IW(t.schema),i=oG(t),a=t.tr,o=TG(`row`,i,r),s=TG(`column`,i,r),c=(e===`column`?o:e===`row`&&s)?1:0,l=e==`column`?{left:0,top:c,right:1,bottom:i.map.height}:e==`row`?{left:c,top:0,right:i.map.width,bottom:1}:i,u=e==`column`?s?r.cell:r.header_cell:e==`row`?o?r.cell:r.header_cell:r.cell;i.map.cellsInRect(l).forEach(e=>{let t=e+i.tableStart,n=a.doc.nodeAt(t);n&&a.setNodeMarkup(t,u,n.attrs)}),n(a)}return!0}}EG(`row`,{useDeprecatedLogic:!0}),EG(`column`,{useDeprecatedLogic:!0});const DG=EG(`cell`,{useDeprecatedLogic:!0});function OG(e,t){if(t<0){let t=e.nodeBefore;if(t)return e.pos-t.nodeSize;for(let t=e.index(-1)-1,n=e.before();t>=0;t--){let r=e.node(-1).child(t),i=r.lastChild;if(i)return n-1-i.nodeSize;n-=r.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;let t=e.node(-1);for(let n=e.indexAfter(-1),r=e.after();n<t.childCount;n++){let e=t.child(n);if(e.childCount)return r+1;r+=e.nodeSize}}return null}function kG(e){return function(t,n){if(!BW(t))return!1;let r=OG(VW(t),e);if(r==null)return!1;if(n){let e=t.doc.resolve(r);n(t.tr.setSelection(bP.between(e,WW(e))).scrollIntoView())}return!0}}function AG(e,t){let n=e.selection.$anchor;for(let r=n.depth;r>0;r--)if(n.node(r).type.spec.tableRole==`table`)return t&&t(e.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function jG(e,t){let n=e.selection;if(!(n instanceof XW))return!1;if(t){let r=e.tr,i=IW(e.schema).cell.createAndFill().content;n.forEachCell((e,t)=>{e.content.eq(i)||r.replace(r.mapping.map(t+1),r.mapping.map(t+e.nodeSize-1),new W(i,0,0))}),r.docChanged&&t(r)}return!0}function MG(e){if(e.size===0)return null;let{content:t,openStart:n,openEnd:r}=e;for(;t.childCount==1&&(n>0&&r>0||t.child(0).type.spec.tableRole==`table`);)n--,r--,t=t.child(0).content;let i=t.child(0),a=i.type.spec.tableRole,o=i.type.schema,s=[];if(a==`row`)for(let e=0;e<t.childCount;e++){let i=t.child(e).content,a=e?0:Math.max(0,n-1),c=e<t.childCount-1?0:Math.max(0,r-1);(a||c)&&(i=PG(IW(o).row,new W(i,a,c)).content),s.push(i)}else if(a==`cell`||a==`header_cell`)s.push(n||r?PG(IW(o).row,new W(t,n,r)).content:t);else return null;return NG(o,s)}function NG(e,t){let n=[];for(let e=0;e<t.length;e++){let r=t[e];for(let t=r.childCount-1;t>=0;t--){let{rowspan:i,colspan:a}=r.child(t).attrs;for(let t=e;t<e+i;t++)n[t]=(n[t]||0)+a}}let r=0;for(let e=0;e<n.length;e++)r=Math.max(r,n[e]);for(let i=0;i<n.length;i++)if(i>=t.length&&t.push(U.empty),n[i]<r){let a=IW(e).cell.createAndFill(),o=[];for(let e=n[i];e<r;e++)o.push(a);t[i]=t[i].append(U.from(o))}return{height:t.length,width:r,rows:t}}function PG(e,t){let n=e.createAndFill();return new mP(n).replace(0,n.content.size,t).doc}function FG({width:e,height:t,rows:n},r,i){if(e!=r){let t=[],i=[];for(let e=0;e<n.length;e++){let a=n[e],o=[];for(let n=t[e]||0,i=0;n<r;i++){let s=a.child(i%a.childCount);n+s.attrs.colspan>r&&(s=s.type.createChecked(qW(s.attrs,s.attrs.colspan,n+s.attrs.colspan-r),s.content)),o.push(s),n+=s.attrs.colspan;for(let n=1;n<s.attrs.rowspan;n++)t[e+n]=(t[e+n]||0)+s.attrs.colspan}i.push(U.from(o))}n=i,e=r}if(t!=i){let e=[];for(let r=0,a=0;r<i;r++,a++){let o=[],s=n[a%t];for(let e=0;e<s.childCount;e++){let t=s.child(e);r+t.attrs.rowspan>i&&(t=t.type.create({...t.attrs,rowspan:Math.max(1,i-t.attrs.rowspan)},t.content)),o.push(t)}e.push(U.from(o))}n=e,t=i}return{width:e,height:t,rows:n}}function IG(e,t,n,r,i,a,o){let s=e.doc.type.schema,c=IW(s),l,u;if(i>t.width)for(let a=0,s=0;a<t.height;a++){let d=n.child(a);s+=d.nodeSize;let f=[],p;p=d.lastChild==null||d.lastChild.type==c.cell?l||=c.cell.createAndFill():u||=c.header_cell.createAndFill();for(let e=t.width;e<i;e++)f.push(p);e.insert(e.mapping.slice(o).map(s-1+r),f)}if(a>t.height){let s=[];for(let e=0,r=(t.height-1)*t.width;e<Math.max(t.width,i);e++){let i=e>=t.width?!1:n.nodeAt(t.map[r+e]).type==c.header_cell;s.push(i?u||=c.header_cell.createAndFill():l||=c.cell.createAndFill())}let d=c.row.create(null,U.from(s)),f=[];for(let e=t.height;e<a;e++)f.push(d);e.insert(e.mapping.slice(o).map(r+n.nodeSize-2),f)}return!!(l||u)}function LG(e,t,n,r,i,a,o,s){if(o==0||o==t.height)return!1;let c=!1;for(let l=i;l<a;l++){let i=o*t.width+l,a=t.map[i];if(t.map[i-t.width]==a){c=!0;let i=n.nodeAt(a),{top:u,left:d}=t.findCell(a);e.setNodeMarkup(e.mapping.slice(s).map(a+r),null,{...i.attrs,rowspan:o-u}),e.insert(e.mapping.slice(s).map(t.positionAt(o,d,n)),i.type.createAndFill({...i.attrs,rowspan:u+i.attrs.rowspan-o})),l+=i.attrs.colspan-1}}return c}function RG(e,t,n,r,i,a,o,s){if(o==0||o==t.width)return!1;let c=!1;for(let l=i;l<a;l++){let i=l*t.width+o,a=t.map[i];if(t.map[i-1]==a){c=!0;let i=n.nodeAt(a),u=t.colCount(a),d=e.mapping.slice(s).map(a+r);e.setNodeMarkup(d,null,qW(i.attrs,o-u,i.attrs.colspan-(o-u))),e.insert(d+i.nodeSize,i.type.createAndFill(qW(i.attrs,0,o-u))),l+=i.attrs.rowspan-1}}return c}function zG(e,t,n,r,i){let a=n?e.doc.nodeAt(n-1):e.doc;if(!a)throw Error(`No table found`);let o=jW.get(a),{top:s,left:c}=r,l=c+i.width,u=s+i.height,d=e.tr,f=0;function p(){if(a=n?d.doc.nodeAt(n-1):d.doc,!a)throw Error(`No table found`);o=jW.get(a),f=d.mapping.maps.length}IG(d,o,a,n,l,u,f)&&p(),LG(d,o,a,n,c,l,s,f)&&p(),LG(d,o,a,n,c,l,u,f)&&p(),RG(d,o,a,n,s,u,c,f)&&p(),RG(d,o,a,n,s,u,l,f)&&p();for(let e=s;e<u;e++){let t=o.positionAt(e,c,a),r=o.positionAt(e,l,a);d.replace(d.mapping.slice(f).map(t+n),d.mapping.slice(f).map(r+n),new W(i.rows[e-s],0,0))}p(),d.setSelection(new XW(d.doc.resolve(n+o.positionAt(s,c,a)),d.doc.resolve(n+o.positionAt(u-1,l-1,a)))),t(d)}const BG=nB({ArrowLeft:HG(`horiz`,-1),ArrowRight:HG(`horiz`,1),ArrowUp:HG(`vert`,-1),ArrowDown:HG(`vert`,1),"Shift-ArrowLeft":UG(`horiz`,-1),"Shift-ArrowRight":UG(`horiz`,1),"Shift-ArrowUp":UG(`vert`,-1),"Shift-ArrowDown":UG(`vert`,1),Backspace:jG,"Mod-Backspace":jG,Delete:jG,"Mod-Delete":jG});function VG(e,t,n){return!n.eq(e.selection)&&(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function HG(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection;if(a instanceof XW)return VG(n,r,gP.near(a.$headCell,t));if(e!=`horiz`&&!a.empty)return!1;let o=qG(i,e,t);if(o==null)return!1;if(e==`horiz`)return VG(n,r,gP.near(n.doc.resolve(a.head+t),t));{let i=n.doc.resolve(o),a=KW(i,e,t),s;return s=a?gP.near(a,1):t<0?gP.near(n.doc.resolve(i.before(-1)),-1):gP.near(n.doc.resolve(i.after(-1)),1),VG(n,r,s)}}}function UG(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection,o;if(a instanceof XW)o=a;else{let r=qG(i,e,t);if(r==null)return!1;o=new XW(n.doc.resolve(r))}let s=KW(o.$headCell,e,t);return s?VG(n,r,new XW(o.$anchorCell,s)):!1}}function WG(e,t){let n=e.state.doc,r=RW(n.resolve(t));return r?(e.dispatch(e.state.tr.setSelection(new XW(r))),!0):!1}function GG(e,t,n){if(!BW(e.state))return!1;let r=MG(n),i=e.state.selection;if(i instanceof XW){r||={width:1,height:1,rows:[U.from(PG(IW(e.state.schema).cell,n))]};let t=i.$anchorCell.node(-1),a=i.$anchorCell.start(-1),o=jW.get(t).rectBetween(i.$anchorCell.pos-a,i.$headCell.pos-a);return r=FG(r,o.right-o.left,o.bottom-o.top),zG(e.state,e.dispatch,a,o,r),!0}if(r){let t=VW(e.state),n=t.start(-1);return zG(e.state,e.dispatch,n,jW.get(t.node(-1)).findCell(t.pos-n),r),!0}return!1}function KG(e,t){if(t.button!=0||t.ctrlKey||t.metaKey)return;let n=JG(e,t.target),r;if(t.shiftKey&&e.state.selection instanceof XW)i(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&n&&(r=RW(e.state.selection.$anchor))!=null&&YG(e,t)?.pos!=r.pos)i(r,t),t.preventDefault();else if(!n)return;function i(t,n){let r=YG(e,n),i=LW.getState(e.state)==null;if(!r||!GW(t,r)){if(i)r=t;else return}let a=new XW(t,r);if(i||!e.state.selection.eq(a)){let n=e.state.tr.setSelection(a);i&&n.setMeta(LW,t.pos),e.dispatch(n)}}function a(){e.root.removeEventListener(`mouseup`,a),e.root.removeEventListener(`dragstart`,a),e.root.removeEventListener(`mousemove`,o),LW.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(LW,-1))}function o(r){let o=r,s=LW.getState(e.state),c;if(s!=null)c=e.state.doc.resolve(s);else if(JG(e,o.target)!=n&&(c=YG(e,t),!c))return a();c&&i(c,o)}e.root.addEventListener(`mouseup`,a),e.root.addEventListener(`dragstart`,a),e.root.addEventListener(`mousemove`,o)}function qG(e,t,n){if(!(e.state.selection instanceof bP))return null;let{$head:r}=e.state.selection;for(let i=r.depth-1;i>=0;i--){let a=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:a.childCount))return null;if(a.type.spec.tableRole==`cell`||a.type.spec.tableRole==`header_cell`){let a=r.before(i),o=t==`vert`?n>0?`down`:`up`:n>0?`right`:`left`;return e.endOfTextblock(o)?a:null}}return null}function JG(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName==`TD`||t.nodeName==`TH`)return t;return null}function YG(e,t){let n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:r,pos:i}=n;return r>=0&&RW(e.state.doc.resolve(r))||RW(e.state.doc.resolve(i))}var XG=class{constructor(e,t){this.node=e,this.defaultCellMinWidth=t,this.dom=document.createElement(`div`),this.dom.className=`tableWrapper`,this.table=this.dom.appendChild(document.createElement(`table`)),this.table.style.setProperty(`--default-cell-min-width`,`${t}px`),this.colgroup=this.table.appendChild(document.createElement(`colgroup`)),ZG(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement(`tbody`))}update(e){return e.type==this.node.type&&(this.node=e,ZG(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type==`attributes`&&(e.target==this.table||this.colgroup.contains(e.target))}};function ZG(e,t,n,r,i,a){let o=0,s=!0,c=t.firstChild,l=e.firstChild;if(l){for(let e=0,n=0;e<l.childCount;e++){let{colspan:u,colwidth:d}=l.child(e).attrs;for(let e=0;e<u;e++,n++){let l=i==n?a:d&&d[e],u=l?l+`px`:``;if(o+=l||r,l||(s=!1),c)c.style.width!=u&&(c.style.width=u),c=c.nextSibling;else{let e=document.createElement(`col`);e.style.width=u,t.appendChild(e)}}}for(;c;){var u;let e=c.nextSibling;(u=c.parentNode)==null||u.removeChild(c),c=e}s?(n.style.width=o+`px`,n.style.minWidth=``):(n.style.width=``,n.style.minWidth=o+`px`)}}const QG=new PP(`tableColumnResizing`);function $G({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:r=XG,lastColumnResizable:i=!0}={}){let a=new jP({key:QG,state:{init(e,t){var i;let o=(i=a.spec)==null||(i=i.props)==null?void 0:i.nodeViews,s=IW(t.schema).table.name;return r&&o&&(o[s]=(e,t)=>new r(e,n,t)),new eK(-1,!1)},apply(e,t){return t.apply(e)}},props:{attributes:e=>{let t=QG.getState(e);return t&&t.activeHandle>-1?{class:`resize-cursor`}:{}},handleDOMEvents:{mousemove:(t,n)=>{tK(t,n,e,i)},mouseleave:e=>{nK(e)},mousedown:(e,r)=>{rK(e,r,t,n)}},decorations:e=>{let t=QG.getState(e);if(t&&t.activeHandle>-1)return fK(e,t.activeHandle)},nodeViews:{}}});return a}var eK=class e{constructor(e,t){this.activeHandle=e,this.dragging=t}apply(t){let n=this,r=t.getMeta(QG);if(r&&r.setHandle!=null)return new e(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new e(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&t.docChanged){let r=t.mapping.map(n.activeHandle,-1);return UW(t.doc.resolve(r))||(r=-1),new e(r,n.dragging)}return n}};function tK(e,t,n,r){if(!e.editable)return;let i=QG.getState(e.state);if(i&&!i.dragging){let a=aK(t.target),o=-1;if(a){let{left:r,right:i}=a.getBoundingClientRect();t.clientX-r<=n?o=oK(e,t,`left`,n):i-t.clientX<=n&&(o=oK(e,t,`right`,n))}if(o!=i.activeHandle){if(!r&&o!==-1){let t=e.state.doc.resolve(o),n=t.node(-1),r=jW.get(n),i=t.start(-1);if(r.colCount(t.pos-i)+t.nodeAfter.attrs.colspan-1==r.width-1)return}cK(e,o)}}}function nK(e){if(!e.editable)return;let t=QG.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&cK(e,-1)}function rK(e,t,n,r){if(!e.editable)return!1;let i=e.dom.ownerDocument.defaultView??window,a=QG.getState(e.state);if(!a||a.activeHandle==-1||a.dragging)return!1;let o=e.state.doc.nodeAt(a.activeHandle),s=iK(e,a.activeHandle,o.attrs);e.dispatch(e.state.tr.setMeta(QG,{setDragging:{startX:t.clientX,startWidth:s}}));function c(t){i.removeEventListener(`mouseup`,c),i.removeEventListener(`mousemove`,l);let r=QG.getState(e.state);r?.dragging&&(lK(e,r.activeHandle,sK(r.dragging,t,n)),e.dispatch(e.state.tr.setMeta(QG,{setDragging:null})))}function l(t){if(!t.which)return c(t);let i=QG.getState(e.state);if(i&&i.dragging){let a=sK(i.dragging,t,n);uK(e,i.activeHandle,a,r)}}return uK(e,a.activeHandle,s,r),i.addEventListener(`mouseup`,c),i.addEventListener(`mousemove`,l),t.preventDefault(),!0}function iK(e,t,{colspan:n,colwidth:r}){let i=r&&r[r.length-1];if(i)return i;let a=e.domAtPos(t),o=a.node.childNodes[a.offset].offsetWidth,s=n;if(r)for(let e=0;e<n;e++)r[e]&&(o-=r[e],s--);return o/s}function aK(e){for(;e&&e.nodeName!=`TD`&&e.nodeName!=`TH`;)e=e.classList&&e.classList.contains(`ProseMirror`)?null:e.parentNode;return e}function oK(e,t,n,r){let i=n==`right`?-r:r,a=e.posAtCoords({left:t.clientX+i,top:t.clientY});if(!a)return-1;let{pos:o}=a,s=RW(e.state.doc.resolve(o));if(!s)return-1;if(n==`right`)return s.pos;let c=jW.get(s.node(-1)),l=s.start(-1),u=c.map.indexOf(s.pos-l);return u%c.width==0?-1:l+c.map[u-1]}function sK(e,t,n){let r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function cK(e,t){e.dispatch(e.state.tr.setMeta(QG,{setHandle:t}))}function lK(e,t,n){let r=e.state.doc.resolve(t),i=r.node(-1),a=jW.get(i),o=r.start(-1),s=a.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1,c=e.state.tr;for(let e=0;e<a.height;e++){let t=e*a.width+s;if(e&&a.map[t]==a.map[t-a.width])continue;let r=a.map[t],l=i.nodeAt(r).attrs,u=l.colspan==1?0:s-a.colCount(r);if(l.colwidth&&l.colwidth[u]==n)continue;let d=l.colwidth?l.colwidth.slice():dK(l.colspan);d[u]=n,c.setNodeMarkup(o+r,null,{...l,colwidth:d})}c.docChanged&&e.dispatch(c)}function uK(e,t,n,r){let i=e.state.doc.resolve(t),a=i.node(-1),o=i.start(-1),s=jW.get(a).colCount(i.pos-o)+i.nodeAfter.attrs.colspan-1,c=e.domAtPos(i.start(-1)).node;for(;c&&c.nodeName!=`TABLE`;)c=c.parentNode;c&&ZG(a,c.firstChild,c,r,s,n)}function dK(e){return Array(e).fill(0)}function fK(e,t){let n=[],r=e.doc.resolve(t),i=r.node(-1);if(!i)return nz.empty;let a=jW.get(i),o=r.start(-1),s=a.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1;for(let t=0;t<a.height;t++){let r=s+t*a.width;if((s==a.width-1||a.map[r]!=a.map[r+1])&&(t==0||a.map[r]!=a.map[r-a.width])){let t=a.map[r],s=o+t+i.nodeAt(t).nodeSize-1,c=document.createElement(`div`);c.className=`column-resize-handle`,QG.getState(e)?.dragging&&n.push($R.node(o+t,o+t+i.nodeAt(t).nodeSize,{class:`column-resize-dragging`})),n.push($R.widget(s,c))}}return nz.create(e.doc,n)}function pK({allowTableNodeSelection:e=!1}={}){return new jP({key:LW,state:{init(){return null},apply(e,t){let n=e.getMeta(LW);if(n!=null)return n==-1?null:n;if(t==null||!e.docChanged)return t;let{deleted:r,pos:i}=e.mapping.mapResult(t);return r?null:i}},props:{decorations:QW,handleDOMEvents:{mousedown:KG},createSelectionBetween(e){return LW.getState(e.state)==null?null:e.state.selection},handleTripleClick:WG,handleKeyDown:BG,handlePaste:GG},appendTransaction(t,n,r){return tG(r,iG(r,n),e)}})}function mK(e){return e===`left`||e===`right`||e===`center`?e:null}function hK(e){let t=(e.style.textAlign||``).trim().toLowerCase(),n=(e.getAttribute(`align`)||``).trim().toLowerCase();return mK(t||n)}function gK(e){return mK(e?.align)}function _K(){return{default:null,parseHTML:e=>hK(e),renderHTML:e=>e.align?{style:`text-align: ${e.align}`}:{}}}var vK=fU.create({name:`tableCell`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{let t=e.getAttribute(`colwidth`),n=t?t.split(`,`).map(e=>parseInt(e,10)):null;if(!n){let t=e.closest(`table`)?.querySelectorAll(`colgroup > col`),n=Array.from(e.parentElement?.children||[]).indexOf(e);if(n&&n>-1&&t&&t[n]){let e=t[n].getAttribute(`width`);return e?[parseInt(e,10)]:null}}return n}},align:_K()}},tableRole:`cell`,isolating:!0,parseHTML(){return[{tag:`td`}]},renderHTML({HTMLAttributes:e}){return[`td`,NV(this.options.HTMLAttributes,e),0]}}),yK=fU.create({name:`tableHeader`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{let t=e.getAttribute(`colwidth`);return t?t.split(`,`).map(e=>parseInt(e,10)):null}},align:_K()}},tableRole:`header_cell`,isolating:!0,parseHTML(){return[{tag:`th`}]},renderHTML({HTMLAttributes:e}){return[`th`,NV(this.options.HTMLAttributes,e),0]}}),bK=fU.create({name:`tableRow`,addOptions(){return{HTMLAttributes:{}}},content:`(tableCell | tableHeader)*`,tableRole:`row`,parseHTML(){return[{tag:`tr`}]},renderHTML({HTMLAttributes:e}){return[`tr`,NV(this.options.HTMLAttributes,e),0]}});function xK(e,t){return t?[`width`,`${Math.max(t,e)}px`]:[`min-width`,`${e}px`]}function SK(e,t,n,r,i,a){var o;let s=0,c=!0,l=t.firstChild,u=e.firstChild;if(u!==null)for(let e=0,n=0;e<u.childCount;e+=1){let{colspan:o,colwidth:d}=u.child(e).attrs;for(let e=0;e<o;e+=1,n+=1){let o=i===n?a:d&&d[e],u=o?`${o}px`:``;if(s+=o||r,o||(c=!1),l){if(l.style.width!==u){let[e,t]=xK(r,o);l.style.setProperty(e,t)}l=l.nextSibling}else{let e=document.createElement(`col`),[n,i]=xK(r,o);e.style.setProperty(n,i),t.appendChild(e)}}}for(;l;){let e=l.nextSibling;(o=l.parentNode)==null||o.removeChild(l),l=e}let d=e.attrs.style&&typeof e.attrs.style==`string`&&/\bwidth\s*:/i.test(e.attrs.style);c&&!d?(n.style.width=`${s}px`,n.style.minWidth=``):(n.style.width=``,n.style.minWidth=`${s}px`)}var CK=class{constructor(e,t){this.node=e,this.cellMinWidth=t,this.dom=document.createElement(`div`),this.dom.className=`tableWrapper`,this.table=this.dom.appendChild(document.createElement(`table`)),e.attrs.style&&(this.table.style.cssText=e.attrs.style),this.colgroup=this.table.appendChild(document.createElement(`colgroup`)),SK(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement(`tbody`))}update(e){return e.type===this.node.type&&(this.node=e,SK(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){let t=e.target,n=this.dom.contains(t),r=this.contentDOM.contains(t);return!!(n&&!r&&(e.type===`attributes`||e.type===`childList`||e.type===`characterData`))}};function wK(e,t,n,r){let i=0,a=!0,o=[],s=e.firstChild;if(!s)return{};for(let e=0,c=0;e<s.childCount;e+=1){let{colspan:l,colwidth:u}=s.child(e).attrs;for(let e=0;e<l;e+=1,c+=1){let s=n===c?r:u&&u[e];i+=s||t,s||(a=!1);let[l,d]=xK(t,s);o.push([`col`,{style:`${l}: ${d}`}])}}let c=a?`${i}px`:``,l=a?``:`${i}px`;return{colgroup:[`colgroup`,{},...o],tableWidth:c,tableMinWidth:l}}function TK(e,t){return t?e.createChecked(null,t):e.createAndFill()}function EK(e){if(e.cached.tableNodeTypes)return e.cached.tableNodeTypes;let t={};return Object.keys(e.nodes).forEach(n=>{let r=e.nodes[n];r.spec.tableRole&&(t[r.spec.tableRole]=r)}),e.cached.tableNodeTypes=t,t}function DK(e,t,n,r,i){let a=EK(e),o=[],s=[];for(let e=0;e<n;e+=1){let e=TK(a.cell,i);if(e&&s.push(e),r){let e=TK(a.header_cell,i);e&&o.push(e)}}let c=[];for(let e=0;e<t;e+=1)c.push(a.row.createChecked(null,r&&e===0?o:s));return a.table.createChecked(null,c)}function OK(e){return e instanceof XW}var kK=({editor:e})=>{let{selection:t}=e.state;if(!OK(t))return!1;let n=0;return SV(t.ranges[0].$from,e=>e.type.name===`table`)?.node.descendants(e=>{if(e.type.name===`table`)return!1;[`tableCell`,`tableHeader`].includes(e.type.name)&&(n+=1)}),n===t.ranges.length&&(e.commands.deleteTable(),!0)};function AK(e){return(e||``).replace(/\s+/g,` `).trim()}function jK(e,t,n={}){let r=n.cellLineSeparator??``;if(!e||!e.content||e.content.length===0)return``;let i=[];e.content.forEach(e=>{let n=[];e.content&&e.content.forEach(e=>{let i=``;i=e.content&&Array.isArray(e.content)&&e.content.length>1?e.content.map(e=>t.renderChildren(e)).join(r):e.content?t.renderChildren(e.content):``;let a=AK(i),o=e.type===`tableHeader`,s=gK(e.attrs);n.push({text:a,isHeader:o,align:s})}),i.push(n)});let a=i.reduce((e,t)=>Math.max(e,t.length),0);if(a===0)return``;let o=Array(a).fill(0);i.forEach(e=>{for(let t=0;t<a;t+=1){let n=(e[t]?.text||``).length;n>o[t]&&(o[t]=n),o[t]<3&&(o[t]=3)}});let s=(e,t)=>e+` `.repeat(Math.max(0,t-e.length)),c=i[0],l=c.some(e=>e.isHeader),u=Array(a).fill(null);i.forEach(e=>{for(let t=0;t<a;t+=1)!u[t]&&e[t]?.align&&(u[t]=e[t].align)});let d=`
|
|
267
|
+
`,f=Array(a).fill(0).map((e,t)=>l&&c[t]&&c[t].text||``);return d+=`| ${f.map((e,t)=>s(e,o[t])).join(` | `)} |
|
|
268
|
+
`,d+=`| ${o.map((e,t)=>{let n=Math.max(3,e),r=u[t];return r===`left`?`:${`-`.repeat(n)}`:r===`right`?`${`-`.repeat(n)}:`:r===`center`?`:${`-`.repeat(n)}:`:`-`.repeat(n)}).join(` | `)} |
|
|
269
|
+
`,(l?i.slice(1):i).forEach(e=>{d+=`| ${Array(a).fill(0).map((t,n)=>s(e[n]&&e[n].text||``,o[n])).join(` | `)} |
|
|
270
|
+
`}),d}var MK=jK,NK=fU.create({name:`table`,addOptions(){return{HTMLAttributes:{},resizable:!1,renderWrapper:!1,handleWidth:5,cellMinWidth:25,View:CK,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:`tableRow+`,tableRole:`table`,isolating:!0,group:`block`,parseHTML(){return[{tag:`table`}]},renderHTML({node:e,HTMLAttributes:t}){let{colgroup:n,tableWidth:r,tableMinWidth:i}=wK(e,this.options.cellMinWidth),a=t.style;function o(){return a||(r?`width: ${r}`:`min-width: ${i}`)}let s=[`table`,NV(this.options.HTMLAttributes,t,{style:o()}),n,[`tbody`,0]];return this.options.renderWrapper?[`div`,{class:`tableWrapper`},s]:s},parseMarkdown:(e,t)=>{let n=[],r=Array.isArray(e.align)?e.align:[];if(e.header){let i=[];e.header.forEach((e,n)=>{let a=mK(r[n]??e.align),o=a?{align:a}:{};i.push(t.createNode(`tableHeader`,o,[{type:`paragraph`,content:t.parseInline(e.tokens)}]))}),n.push(t.createNode(`tableRow`,{},i))}return e.rows&&e.rows.forEach(e=>{let i=[];e.forEach((e,n)=>{let a=mK(r[n]??e.align),o=a?{align:a}:{};i.push(t.createNode(`tableCell`,o,[{type:`paragraph`,content:t.parseInline(e.tokens)}]))}),n.push(t.createNode(`tableRow`,{},i))}),t.createNode(`table`,void 0,n)},renderMarkdown:(e,t)=>MK(e,t),addCommands(){return{insertTable:({rows:e=3,cols:t=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:i,editor:a})=>{let o=DK(a.schema,e,t,n);if(i){let e=r.selection.from+1;r.replaceSelectionWith(o).scrollIntoView().setSelection(bP.near(r.doc.resolve(e)))}return!0},addColumnBefore:()=>({state:e,dispatch:t})=>cG(e,t),addColumnAfter:()=>({state:e,dispatch:t})=>lG(e,t),deleteColumn:()=>({state:e,dispatch:t})=>dG(e,t),addRowBefore:()=>({state:e,dispatch:t})=>mG(e,t),addRowAfter:()=>({state:e,dispatch:t})=>hG(e,t),deleteRow:()=>({state:e,dispatch:t})=>_G(e,t),deleteTable:()=>({state:e,dispatch:t})=>AG(e,t),mergeCells:()=>({state:e,dispatch:t})=>bG(e,t),splitCell:()=>({state:e,dispatch:t})=>xG(e,t),toggleHeaderColumn:()=>({state:e,dispatch:t})=>EG(`column`)(e,t),toggleHeaderRow:()=>({state:e,dispatch:t})=>EG(`row`)(e,t),toggleHeaderCell:()=>({state:e,dispatch:t})=>DG(e,t),mergeOrSplit:()=>({state:e,dispatch:t})=>bG(e,t)?!0:xG(e,t),setCellAttribute:(e,t)=>({state:n,dispatch:r})=>CG(e,t)(n,r),goToNextCell:()=>({state:e,dispatch:t})=>kG(1)(e,t),goToPreviousCell:()=>({state:e,dispatch:t})=>kG(-1)(e,t),fixTables:()=>({state:e,dispatch:t})=>(t&&iG(e),!0),setCellSelection:e=>({tr:t,dispatch:n})=>{if(n){let n=XW.create(t.doc,e.anchorCell,e.headCell);t.setSelection(n)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:kK,"Mod-Backspace":kK,Delete:kK,"Mod-Delete":kK}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[$G({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],pK({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(e){return{tableRole:DV(wV(e,`tableRole`,{name:e.name,options:e.options,storage:e.storage}))}}});RH.create({name:`tableKit`,addExtensions(){let e=[];return this.options.table!==!1&&e.push(NK.configure(this.options.table)),this.options.tableCell!==!1&&e.push(vK.configure(this.options.tableCell)),this.options.tableHeader!==!1&&e.push(yK.configure(this.options.tableHeader)),this.options.tableRow!==!1&&e.push(bK.configure(this.options.tableRow)),e}});var PK=/^\s*>\s$/,FK=fU.create({name:`blockquote`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,group:`block`,defining:!0,parseHTML(){return[{tag:`blockquote`}]},renderHTML({HTMLAttributes:e}){return lW(`blockquote`,{...NV(this.options.HTMLAttributes,e),children:lW(`slot`,{})})},parseMarkdown:(e,t)=>{let n=t.parseBlockChildren??t.parseChildren;return t.createNode(`blockquote`,void 0,n(e.tokens||[]))},renderMarkdown:(e,t)=>{if(!e.content)return``;let n=[];return e.content.forEach((e,r)=>{let i=(t.renderChild?.call(t,e,r)??t.renderChildren([e])).split(`
|
|
271
|
+
`).map(e=>e.trim()===``?`>`:`> ${e}`);n.push(i.join(`
|
|
272
|
+
`))}),n.join(`
|
|
273
|
+
>
|
|
274
|
+
`)},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[$H({find:PK,type:this.type})]}}),IK=FK,LK=/(^|[^`])`([^`]+)`(?!`)$/,RK=/(^|[^`])`([^`]+)`(?!`)/g,zK=IH.create({name:`code`,addOptions(){return{HTMLAttributes:{}}},excludes:`_`,code:!0,exitable:!0,parseHTML(){return[{tag:`code`}]},renderHTML({HTMLAttributes:e}){return[`code`,NV(this.options.HTMLAttributes,e),0]},markdownTokenName:`codespan`,parseMarkdown:(e,t)=>t.applyMark(`code`,[{type:`text`,text:e.text||``}]),renderMarkdown:(e,t)=>e.content?`\`${t.renderChildren(e.content)}\``:``,addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[XH({find:LK,type:this.type})]},addPasteRules(){return[pU({find:RK,type:this.type})]}}),BK=zK,VK=fU.create({name:`doc`,topNode:!0,content:`block+`,renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
|
|
275
|
+
|
|
276
|
+
`):``}),HK=fU.create({name:`horizontalRule`,addOptions(){return{HTMLAttributes:{},nextNodeType:`paragraph`}},group:`block`,parseHTML(){return[{tag:`hr`}]},renderHTML({HTMLAttributes:e}){return[`hr`,NV(this.options.HTMLAttributes,e)]},markdownTokenName:`hr`,parseMarkdown:(e,t)=>t.createNode(`horizontalRule`),renderMarkdown:()=>`---`,addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!nU(t,t.schema.nodes[this.name]))return!1;let{selection:n}=t,{$to:r}=n,i=e();return aH(n)?i.insertContentAt(r.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:e,tr:t,dispatch:n})=>{if(n){let{$to:n}=t.selection,r=n.end();if(n.nodeAfter)n.nodeAfter.isTextblock?t.setSelection(bP.create(t.doc,n.pos+1)):n.nodeAfter.isBlock?t.setSelection(SP.create(t.doc,n.pos)):t.setSelection(bP.create(t.doc,n.pos));else{let i=(e.schema.nodes[this.options.nextNodeType]||n.parent.type.contentMatch.defaultType)?.create();i&&(t.insert(r,i),t.setSelection(bP.create(t.doc,r+1)))}t.scrollIntoView()}return!0}).run()}}},addInputRules(){return[ZH({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),UK=HK,WK=Object.defineProperty,GK=(e,t)=>{for(var n in t)WK(e,n,{get:t[n],enumerable:!0})},KK=`listItem`,qK=`textStyle`,JK=/^\s*([-+*])\s$/,YK=fU.create({name:`bulletList`,addOptions(){return{itemTypeName:`listItem`,HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:`block list`,content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul`}]},renderHTML({HTMLAttributes:e}){return[`ul`,NV(this.options.HTMLAttributes,e),0]},markdownTokenName:`list`,parseMarkdown:(e,t)=>e.type!==`list`||e.ordered?[]:{type:`bulletList`,content:e.items?t.parseChildren(e.items):[]},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
|
|
277
|
+
`):``,markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(KK,this.editor.getAttributes(qK)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=$H({find:JK,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=$H({find:JK,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(qK),editor:this.editor})),[e]}}),XK=fU.create({name:`listItem`,addOptions(){return{HTMLAttributes:{},bulletListTypeName:`bulletList`,orderedListTypeName:`orderedList`}},content:`paragraph block*`,defining:!0,parseHTML(){return[{tag:`li`}]},renderHTML({HTMLAttributes:e}){return[`li`,NV(this.options.HTMLAttributes,e),0]},markdownTokenName:`list_item`,parseMarkdown:(e,t)=>{if(e.type!==`list_item`)return[];let n=t.parseBlockChildren??t.parseChildren,r=[];if(e.tokens&&e.tokens.length>0){if(e.tokens.some(e=>e.type===`paragraph`))r=n(e.tokens);else{let i=e.tokens[0];if(i&&i.type===`text`&&i.tokens&&i.tokens.length>0){if(r=[{type:`paragraph`,content:t.parseInline(i.tokens)}],e.tokens.length>1){let t=n(e.tokens.slice(1));r.push(...t)}}else r=n(e.tokens)}}return r.length===0&&(r=[{type:`paragraph`,content:[]}]),{type:`listItem`,content:r}},renderMarkdown:(e,t,n)=>dU(e,t,e=>e.parentType===`bulletList`?`- `:e.parentType===`orderedList`?`${(e.meta?.parentAttrs?.start||1)+e.index}. `:`- `,n),addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}});GK({},{findListItemPos:()=>ZK,getNextListDepth:()=>QK,handleBackspace:()=>nq,handleDelete:()=>aq,hasListBefore:()=>$K,hasListItemAfter:()=>oq,hasListItemBefore:()=>eq,listItemHasSubList:()=>tq,nextListIsDeeper:()=>rq,nextListIsHigher:()=>iq});var ZK=(e,t)=>{let{$from:n}=t.selection,r=hB(e,t.schema),i=null,a=n.depth,o=n.pos,s=null;for(;a>0&&s===null;)i=n.node(a),i.type===r?s=a:(--a,--o);return s===null?null:{$pos:t.doc.resolve(o),depth:s}},QK=(e,t)=>{let n=ZK(e,t);if(!n)return!1;let[,r]=QV(t,e,n.$pos.pos+4);return r},$K=(e,t,n)=>{let{$anchor:r}=e.selection,i=Math.max(0,r.pos-2),a=e.doc.resolve(i).node();return!(!a||!n.includes(a.type.name))},eq=(e,t)=>{let{$anchor:n}=t.selection,r=t.doc.resolve(n.pos-2);return r.index()!==0&&r.nodeBefore?.type.name===e},tq=(e,t,n)=>{if(!n)return!1;let r=hB(e,t.schema),i=!1;return n.descendants(e=>{e.type===r&&(i=!0)}),i},nq=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!tV(e.state,t)&&$K(e.state,t,n)){let{$anchor:n}=e.state.selection,r=e.state.doc.resolve(n.before()-1),i=[];r.node().descendants((e,n)=>{e.type.name===t&&i.push({node:e,pos:n})});let a=i.at(-1);if(!a)return!1;let o=e.state.doc.resolve(r.start()+a.pos+1);return e.chain().cut({from:n.start()-1,to:n.end()+1},o.end()).joinForward().run()}if(!tV(e.state,t)||!nH(e.state))return!1;let r=ZK(t,e.state);if(!r)return!1;let i=e.state.doc.resolve(r.$pos.pos-2).node(r.depth),a=tq(t,e.state,i);return eq(t,e.state)&&!a?e.commands.joinItemBackward():e.chain().liftListItem(t).run()},rq=(e,t)=>{let n=QK(e,t),r=ZK(e,t);return!r||!n?!1:n>r.depth},iq=(e,t)=>{let n=QK(e,t),r=ZK(e,t);return!r||!n?!1:n<r.depth},aq=(e,t)=>{if(!tV(e.state,t)||!tH(e.state,t))return!1;let{selection:n}=e.state,{$from:r,$to:i}=n;return!n.empty&&r.sameParent(i)?!1:rq(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():iq(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward()},oq=(e,t)=>{let{$anchor:n}=t.selection,r=t.doc.resolve(n.pos-n.parentOffset-2);return r.index()!==r.parent.childCount-1&&r.nodeAfter?.type.name===e},sq=RH.create({name:`listKeymap`,addOptions(){return{listTypes:[{itemName:`listItem`,wrapperNames:[`bulletList`,`orderedList`]},{itemName:`taskItem`,wrapperNames:[`taskList`]}]}},addKeyboardShortcuts(){return{Delete:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&aq(e,n)&&(t=!0)}),t},"Mod-Delete":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&aq(e,n)&&(t=!0)}),t},Backspace:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&nq(e,n,r)&&(t=!0)}),t},"Mod-Backspace":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&nq(e,n,r)&&(t=!0)}),t}}}}),cq=/^(\s*)(\d+)\.\s+(.*)$/,lq=/^\s/;function uq(e){let t=[],n=0,r=0;for(;n<e.length;){let i=e[n],a=i.match(cq);if(!a)break;let[,o,s,c]=a,l=o.length,u=c,d=n+1,f=[i];for(;d<e.length;){let t=e[d];if(t.match(cq))break;if(t.trim()===``)f.push(t),u+=`
|
|
278
|
+
`,d+=1;else if(t.match(lq))f.push(t),u+=`
|
|
279
|
+
${t.slice(l+2)}`,d+=1;else break}t.push({indent:l,number:parseInt(s,10),content:u.trim(),raw:f.join(`
|
|
280
|
+
`)}),r=d,n=d}return[t,r]}function dq(e,t,n){let r=[],i=0;for(;i<e.length;){let a=e[i];if(a.indent===t){let o=a.content.split(`
|
|
281
|
+
`),s=o[0]?.trim()||``,c=[];s&&c.push({type:`paragraph`,raw:s,tokens:n.inlineTokens(s)});let l=o.slice(1).join(`
|
|
282
|
+
`).trim();if(l){let e=n.blockTokens(l);c.push(...e)}let u=i+1,d=[];for(;u<e.length&&e[u].indent>t;)d.push(e[u]),u+=1;if(d.length>0){let e=dq(d,Math.min(...d.map(e=>e.indent)),n);c.push({type:`list`,ordered:!0,start:d[0].number,items:e,raw:d.map(e=>e.raw).join(`
|
|
283
|
+
`)})}r.push({type:`list_item`,raw:a.raw,tokens:c}),i=u}else i+=1}return r}function fq(e,t){return e.map(e=>{if(e.type!==`list_item`)return t.parseChildren([e])[0];let n=[];return e.tokens&&e.tokens.length>0&&e.tokens.forEach(e=>{if(e.type===`paragraph`||e.type===`list`||e.type===`blockquote`||e.type===`code`)n.push(...t.parseChildren([e]));else if(e.type===`text`&&e.tokens){let r=t.parseChildren([e]);n.push({type:`paragraph`,content:r})}else{let r=t.parseChildren([e]);r.length>0&&n.push(...r)}}),{type:`listItem`,content:n}})}var pq=`listItem`,mq=`textStyle`,hq=/^(\d+)\.\s$/,gq=fU.create({name:`orderedList`,addOptions(){return{itemTypeName:`listItem`,HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:`block list`,content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute(`start`)?parseInt(e.getAttribute(`start`)||``,10):1},type:{default:null,parseHTML:e=>e.getAttribute(`type`)}}},parseHTML(){return[{tag:`ol`}]},renderHTML({HTMLAttributes:e}){let{start:t,...n}=e;return t===1?[`ol`,NV(this.options.HTMLAttributes,n),0]:[`ol`,NV(this.options.HTMLAttributes,e),0]},markdownTokenName:`list`,parseMarkdown:(e,t)=>{if(e.type!==`list`||!e.ordered)return[];let n=e.start||1,r=e.items?fq(e.items,t):[];return n===1?{type:`orderedList`,content:r}:{type:`orderedList`,attrs:{start:n},content:r}},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
|
|
284
|
+
`):``,markdownTokenizer:{name:`orderedList`,level:`block`,start:e=>{let t=e.match(/^(\s*)(\d+)\.\s+/)?.index;return t===void 0?-1:t},tokenize:(e,t,n)=>{let r=e.split(`
|
|
285
|
+
`),[i,a]=uq(r);if(i.length===0)return;let o=dq(i,0,n);if(o.length!==0)return{type:`list`,ordered:!0,start:i[0]?.number||1,items:o,raw:r.slice(0,a).join(`
|
|
286
|
+
`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(pq,this.editor.getAttributes(mq)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=$H({find:hq,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=$H({find:hq,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(mq)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[e]}}),_q=/^\s*(\[([( |x])?\])\s$/,vq=fU.create({name:`taskItem`,addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:`taskList`,a11y:void 0}},content(){return this.options.nested?`paragraph block*`:`paragraph+`},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:e=>{let t=e.getAttribute(`data-checked`);return t===``||t===`true`},renderHTML:e=>({"data-checked":e.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:e,HTMLAttributes:t}){return[`li`,NV(this.options.HTMLAttributes,t,{"data-type":this.name}),[`label`,[`input`,{type:`checkbox`,checked:e.attrs.checked?`checked`:null}],[`span`]],[`div`,0]]},parseMarkdown:(e,t)=>{let n=[];if(e.tokens&&e.tokens.length>0?n.push(t.createNode(`paragraph`,{},t.parseInline(e.tokens))):e.text?n.push(t.createNode(`paragraph`,{},[t.createNode(`text`,{text:e.text})])):n.push(t.createNode(`paragraph`,{},[])),e.nestedTokens&&e.nestedTokens.length>0){let r=t.parseChildren(e.nestedTokens);n.push(...r)}return t.createNode(`taskItem`,{checked:e.checked||!1},n)},renderMarkdown:(e,t)=>dU(e,t,`- [${e.attrs?.checked?`x`:` `}] `),addKeyboardShortcuts(){let e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return({node:e,HTMLAttributes:t,getPos:n,editor:r})=>{let i=document.createElement(`li`),a=document.createElement(`label`),o=document.createElement(`span`),s=document.createElement(`input`),c=document.createElement(`div`),l=e=>{var t;s.ariaLabel=((t=this.options.a11y)?.checkboxLabel)?.call(t,e,s.checked)||`Task item checkbox for ${e.textContent||`empty task item`}`};l(e),a.contentEditable=`false`,s.type=`checkbox`,s.addEventListener(`mousedown`,e=>e.preventDefault()),s.addEventListener(`change`,t=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){s.checked=!s.checked;return}let{checked:i}=t.target;r.isEditable&&typeof n==`function`&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:e})=>{let t=n();if(typeof t!=`number`)return!1;let r=e.doc.nodeAt(t);return e.setNodeMarkup(t,void 0,{...r?.attrs,checked:i}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(e,i)||(s.checked=!s.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([e,t])=>{i.setAttribute(e,t)}),i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,a.append(s,o),i.append(a,c),Object.entries(t).forEach(([e,t])=>{i.setAttribute(e,t)});let u=new Set(Object.keys(t));return{dom:i,contentDOM:c,update:e=>{if(e.type!==this.type)return!1;i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,l(e);let t=r.extensionManager.attributes,n=PV(e,t),a=new Set(Object.keys(n)),o=this.options.HTMLAttributes;return u.forEach(e=>{a.has(e)||(e in o?i.setAttribute(e,o[e]):i.removeAttribute(e))}),Object.entries(n).forEach(([e,t])=>{t==null?e in o?i.setAttribute(e,o[e]):i.removeAttribute(e):i.setAttribute(e,t)}),u=a,!0}}}},addInputRules(){return[$H({find:_q,type:this.type,getAttributes:e=>({checked:e[e.length-1]===`x`})})]}}),yq=fU.create({name:`taskList`,addOptions(){return{itemTypeName:`taskItem`,HTMLAttributes:{}}},group:`block list`,content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:e}){return[`ul`,NV(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},parseMarkdown:(e,t)=>t.createNode(`taskList`,{},t.parseChildren(e.items||[])),renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
|
|
287
|
+
`):``,markdownTokenizer:{name:`taskList`,level:`block`,start(e){let t=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/)?.index;return t===void 0?-1:t},tokenize(e,t,n){let r=e=>{let t=uU(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:e[3].toLowerCase()===`x`}),createToken:(e,t)=>({type:`taskItem`,raw:``,mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);return t?[{type:`taskList`,raw:t.raw,items:t.items}]:n.blockTokens(e)},i=uU(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:e[3].toLowerCase()===`x`}),createToken:(e,t)=>({type:`taskItem`,raw:``,mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);if(i)return{type:`taskList`,raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});RH.create({name:`listKit`,addExtensions(){let e=[];return this.options.bulletList!==!1&&e.push(YK.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push(XK.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(sq.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(gq.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push(vq.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(yq.configure(this.options.taskList)),e}});var bq=` `,xq=`\xA0`,Sq=fU.create({name:`paragraph`,priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:`block`,content:`inline*`,parseHTML(){return[{tag:`p`}]},renderHTML({HTMLAttributes:e}){return[`p`,NV(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{let n=e.tokens||[];if(n.length===1&&n[0].type===`image`)return t.parseChildren([n[0]]);let r=t.parseInline(n);return n.length===1&&n[0].type===`text`&&(n[0].raw===bq||n[0].text===bq||n[0].raw===xq||n[0].text===xq)&&r.length===1&&r[0].type===`text`&&(r[0].text===bq||r[0].text===xq)?t.createNode(`paragraph`,void 0,[]):t.createNode(`paragraph`,void 0,r)},renderMarkdown:(e,t,n)=>{if(!e)return``;let r=Array.isArray(e.content)?e.content:[];if(r.length===0){let e=Array.isArray(n?.previousNode?.content)?n.previousNode.content:[];return n?.previousNode?.type===`paragraph`&&e.length===0?bq:``}return t.renderChildren(r)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Cq=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,wq=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,Tq=IH.create({name:`strike`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`s`},{tag:`del`},{tag:`strike`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`line-through`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`s`,NV(this.options.HTMLAttributes,e),0]},markdownTokenName:`del`,parseMarkdown:(e,t)=>t.applyMark(`strike`,t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`~~${t.renderChildren(e)}~~`,addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[XH({find:Cq,type:this.type})]},addPasteRules(){return[pU({find:wq,type:this.type})]}}),Eq=Tq,Dq=fU.create({name:`text`,group:`inline`,parseMarkdown:e=>({type:`text`,text:e.text||``}),renderMarkdown:e=>e.text||``}),Oq=IH.create({name:`underline`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`u`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`underline`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`u`,NV(this.options.HTMLAttributes,e),0]},parseMarkdown(e,t){return t.applyMark(this.name||`underline`,t.parseInline(e.tokens||[]))},renderMarkdown(e,t){return`++${t.renderChildren(e)}++`},markdownTokenizer:{name:`underline`,level:`inline`,start(e){return e.indexOf(`++`)},tokenize(e,t,n){let r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!r)return;let i=r[2].trim();return{type:`underline`,raw:r[0],text:i,tokens:n.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),kq=Oq;function Aq(e={}){return new jP({view(t){return new jq(t,e)}})}var jq=class{constructor(e,t){this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.lastDragEvent=null,this.width=t.width??1,this.color=t.color===!1?void 0:t.color||`black`,this.class=t.class,this.handlers=[`dragover`,`dragend`,`drop`,`dragleave`].map(t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){if(this.cursorPos!=null&&t.doc!=e.state.doc){if(this.lastDragEvent){let e=this.computeTarget(this.lastDragEvent);e==this.cursorPos?this.updateOverlay():this.setCursor(e)}else this.updateOverlay()}}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,n,r=this.editorView.dom,i=r.getBoundingClientRect(),a=i.width/r.offsetWidth,o=i.height/r.offsetHeight;if(t){let t=e.nodeBefore,r=e.nodeAfter;if(t||r){let e=this.editorView.nodeDOM(this.cursorPos-(t?t.nodeSize:0));if(e){let i=e.getBoundingClientRect(),a=t?i.bottom:i.top;t&&r&&(a=(a+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let s=this.width/2*o;n={left:i.left,right:i.right,top:a-s,bottom:a+s}}}}if(!n){let e=this.editorView.coordsAtPos(this.cursorPos),t=this.width/2*a;n={left:e.left-t,right:e.left+t,top:e.top,bottom:e.bottom}}let s=this.editorView.dom.offsetParent;this.element||(this.element=s.appendChild(document.createElement(`div`)),this.class&&(this.element.className=this.class),this.element.style.cssText=`position: absolute; z-index: 50; pointer-events: none;`,this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle(`prosemirror-dropcursor-block`,t),this.element.classList.toggle(`prosemirror-dropcursor-inline`,!t);let c,l;if(!s||s==document.body&&getComputedStyle(s).position==`static`)c=-pageXOffset,l=-pageYOffset;else{let e=s.getBoundingClientRect(),t=e.width/s.offsetWidth,n=e.height/s.offsetHeight;c=e.left-s.scrollLeft*t,l=e.top-s.scrollTop*n}this.element.style.left=(n.left-c)/a+`px`,this.element.style.top=(n.top-l)/o+`px`,this.element.style.width=(n.right-n.left)/a+`px`,this.element.style.height=(n.bottom-n.top)/o+`px`}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}computeTarget(e){let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,i=typeof r==`function`?r(this.editorView,t,e):r;if(!t||i)return null;let a=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let e=YN(this.editorView.state.doc,a,this.editorView.dragging.slice);e!=null&&(a=e)}return a}dragover(e){if(!this.editorView.editable)return;this.lastDragEvent=e;let t=this.computeTarget(e);t!=null&&(this.setCursor(t),this.scheduleRemoval(5e3))}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}},Mq=class e extends gP{constructor(e){super(e,e)}map(t,n){let r=t.resolve(n.map(this.head));return e.valid(r)?new e(r):gP.near(r)}content(){return W.empty}eq(t){return t instanceof e&&t.head==this.head}toJSON(){return{type:`gapcursor`,pos:this.head}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for GapCursor.fromJSON`);return new e(t.resolve(n.pos))}getBookmark(){return new Nq(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!Fq(e)||!Iq(e))return!1;let n=t.type.spec.allowGapCursor;if(n!=null)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(t,n,r=!1){search:for(;;){if(!r&&e.valid(t))return t;let i=t.pos,a=null;for(let r=t.depth;;r--){let o=t.node(r);if(n>0?t.indexAfter(r)<o.childCount:t.index(r)>0){a=o.child(n>0?t.indexAfter(r):t.index(r)-1);break}if(r==0)return null;i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}for(;;){let o=n>0?a.firstChild:a.lastChild;if(!o){if(a.isAtom&&!a.isText&&!SP.isSelectable(a)){t=t.doc.resolve(i+a.nodeSize*n),r=!1;continue search}break}a=o,i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}return null}}};Mq.prototype.visible=!1,Mq.findFrom=Mq.findGapCursorFrom,gP.jsonID(`gapcursor`,Mq);var Nq=class e{constructor(e){this.pos=e}map(t){return new e(t.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return Mq.valid(t)?new Mq(t):gP.near(t)}};function Pq(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function Fq(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n-1);;e=e.lastChild){if(e.childCount==0&&!e.inlineContent||Pq(e.type))return!0;if(e.inlineContent)return!1}}return!0}function Iq(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n);;e=e.firstChild){if(e.childCount==0&&!e.inlineContent||Pq(e.type))return!0;if(e.inlineContent)return!1}}return!0}function Lq(){return new jP({props:{decorations:Hq,createSelectionBetween(e,t,n){return t.pos==n.pos&&Mq.valid(n)?new Mq(n):null},handleClick:Bq,handleKeyDown:Rq,handleDOMEvents:{beforeinput:Vq}}})}const Rq=nB({ArrowLeft:zq(`horiz`,-1),ArrowRight:zq(`horiz`,1),ArrowUp:zq(`vert`,-1),ArrowDown:zq(`vert`,1)});function zq(e,t){let n=e==`vert`?t>0?`down`:`up`:t>0?`right`:`left`;return function(e,r,i){let a=e.selection,o=t>0?a.$to:a.$from,s=a.empty;if(a instanceof bP){if(!i.endOfTextblock(n)||o.depth==0)return!1;s=!1,o=e.doc.resolve(t>0?o.after():o.before())}let c=Mq.findGapCursorFrom(o,t,s);return c?(r&&r(e.tr.setSelection(new Mq(c))),!0):!1}}function Bq(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!Mq.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&SP.isSelectable(e.state.doc.nodeAt(i.inside))?!1:(e.dispatch(e.state.tr.setSelection(new Mq(r))),!0)}function Vq(e,t){if(t.inputType!=`insertCompositionText`||!(e.state.selection instanceof Mq))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let i=U.empty;for(let e=r.length-1;e>=0;e--)i=U.from(r[e].createAndFill(null,i));let a=e.state.tr.replace(n.pos,n.pos,new W(i,0,0));return a.setSelection(bP.near(a.doc.resolve(n.pos+1))),e.dispatch(a),!1}function Hq(e){if(!(e.selection instanceof Mq))return null;let t=document.createElement(`div`);return t.className=`ProseMirror-gapcursor`,nz.create(e.doc,[$R.widget(e.selection.head,t,{key:`gapcursor`})])}var Uq=200,Wq=function(){};Wq.prototype.append=function(e){return e.length?(e=Wq.from(e),!this.length&&e||e.length<Uq&&this.leafAppend(e)||this.length<Uq&&e.leafPrepend(this)||this.appendInner(e)):this},Wq.prototype.prepend=function(e){return e.length?Wq.from(e).append(this):this},Wq.prototype.appendInner=function(e){return new Kq(this,e)},Wq.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?Wq.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},Wq.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Wq.prototype.forEach=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},Wq.prototype.map=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length);var r=[];return this.forEach(function(t,n){return r.push(e(t,n))},t,n),r},Wq.from=function(e){return e instanceof Wq?e:e&&e.length?new Gq(e):Wq.empty};var Gq=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return e==0&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i<n;i++)if(e(this.values[i],r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(e(this.values[i],r+i)===!1)return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=Uq)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=Uq)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(Wq);Wq.empty=new Gq([]);var Kq=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var i=this.left.length;if(t<i&&this.left.forEachInner(e,t,Math.min(n,i),r)===!1||n>i&&this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;if(t>i&&this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i)===!1||n<i&&this.left.forEachInvertedInner(e,Math.min(t,i),n,r)===!1)return!1},t.prototype.sliceInner=function(e,t){if(e==0&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(Wq),qq=class e{constructor(e,t){this.items=e,this.eventCount=t}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,a;n&&(i=this.remapping(r,this.items.length),a=i.maps.length);let o=t.tr,s,c,l=[],u=[];return this.items.forEach((t,n)=>{if(!t.step){i||(i=this.remapping(r,n+1),a=i.maps.length),a--,u.push(t);return}if(i){u.push(new Yq(t.map));let e=t.step.map(i.slice(a)),n;e&&o.maybeStep(e).doc&&(n=o.mapping.maps[o.mapping.maps.length-1],l.push(new Yq(n,void 0,void 0,l.length+u.length))),a--,n&&i.appendMap(n,a)}else o.maybeStep(t.step);if(t.selection)return s=i?t.selection.map(i.slice(a)):t.selection,c=new e(this.items.slice(0,r).append(u.reverse().concat(l)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:o,selection:s}}addTransform(t,n,r,i){let a=[],o=this.eventCount,s=this.items,c=!i&&s.length?s.get(s.length-1):null;for(let e=0;e<t.steps.length;e++){let r=t.steps[e].invert(t.docs[e]),l=new Yq(t.mapping.maps[e],r,n),u;(u=c&&c.merge(l))&&(l=u,e?a.pop():s=s.slice(0,s.length-1)),a.push(l),n&&=(o++,void 0),i||(c=l)}let l=o-r.depth;return l>Zq&&(s=Jq(s,l),o-=l),new e(s.append(a),o)}remapping(e,t){let n=new pN;return this.items.forEach((t,r)=>{let i=t.mirrorOffset!=null&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)},e,t),n}addMaps(t){return this.eventCount==0?this:new e(this.items.append(t.map(e=>new Yq(e))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),a=t.mapping,o=t.steps.length,s=this.eventCount;this.items.forEach(e=>{e.selection&&s--},i);let c=n;this.items.forEach(e=>{let n=a.getMirror(--c);if(n==null)return;o=Math.min(o,n);let i=a.maps[n];if(e.step){let o=t.steps[n].invert(t.docs[n]),l=e.selection&&e.selection.map(a.slice(c+1,n));l&&s++,r.push(new Yq(i,o,l))}else r.push(new Yq(i))},i);let l=[];for(let e=n;e<o;e++)l.push(new Yq(a.maps[e]));let u=this.items.slice(0,i).append(l).append(r),d=new e(u,s);return d.emptyItemCount()>500&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],a=0;return this.items.forEach((e,o)=>{if(o>=t)i.push(e),e.selection&&a++;else if(e.step){let t=e.step.map(n.slice(r)),o=t&&t.getMap();if(r--,o&&n.appendMap(o,r),t){let s=e.selection&&e.selection.map(n.slice(r));s&&a++;let c=new Yq(o.invert(),t,s),l,u=i.length-1;(l=i.length&&i[u].merge(c))?i[u]=l:i.push(c)}}else e.map&&r--},this.items.length,0),new e(Wq.from(i.reverse()),a)}};qq.empty=new qq(Wq.empty,0);function Jq(e,t){let n;return e.forEach((e,r)=>{if(e.selection&&t--==0)return n=r,!1}),e.slice(n)}var Yq=class e{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new e(n.getMap().invert(),n,this.selection)}}},Xq=class{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}};const Zq=20;function Qq(e,t,n,r){let i=n.getMeta(oJ),a;if(i)return i.historyState;n.getMeta(sJ)&&(e=new Xq(e.done,e.undone,null,0,-1));let o=n.getMeta(`appendedTransaction`);if(n.steps.length==0)return e;if(o&&o.getMeta(oJ))return o.getMeta(oJ).redo?new Xq(e.done.addTransform(n,void 0,r,aJ(t)),e.undone,eJ(n.mapping.maps),e.prevTime,e.prevComposition):new Xq(e.done,e.undone.addTransform(n,void 0,r,aJ(t)),null,e.prevTime,e.prevComposition);if(n.getMeta(`addToHistory`)!==!1&&!(o&&o.getMeta(`addToHistory`)===!1)){let i=n.getMeta(`composition`),a=e.prevTime==0||!o&&e.prevComposition!=i&&(e.prevTime<(n.time||0)-r.newGroupDelay||!$q(n,e.prevRanges)),s=o?tJ(e.prevRanges,n.mapping):eJ(n.mapping.maps);return new Xq(e.done.addTransform(n,a?t.selection.getBookmark():void 0,r,aJ(t)),qq.empty,s,n.time,i??e.prevComposition)}return(a=n.getMeta(`rebased`))?new Xq(e.done.rebased(n,a),e.undone.rebased(n,a),tJ(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new Xq(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),tJ(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function $q(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((e,r)=>{for(let i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)}),n}function eJ(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((e,n,r,i)=>t.push(r,i));return t}function tJ(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),a=t.map(e[r+1],-1);i<=a&&n.push(i,a)}return n}function nJ(e,t,n){let r=aJ(t),i=oJ.get(t).spec.config,a=(n?e.undone:e.done).popEvent(t,r);if(!a)return null;let o=a.selection.resolve(a.transform.doc),s=(n?e.done:e.undone).addTransform(a.transform,t.selection.getBookmark(),i,r),c=new Xq(n?s:a.remaining,n?a.remaining:s,null,0,-1);return a.transform.setSelection(o).setMeta(oJ,{redo:n,historyState:c})}let rJ=!1,iJ=null;function aJ(e){let t=e.plugins;if(iJ!=t){rJ=!1,iJ=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){rJ=!0;break}}return rJ}const oJ=new PP(`history`),sJ=new PP(`closeHistory`);function cJ(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new jP({key:oJ,state:{init(){return new Xq(qq.empty,qq.empty,null,0,-1)},apply(t,n,r){return Qq(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r=n==`historyUndo`?uJ:n==`historyRedo`?dJ:null;return!r||!e.editable?!1:(t.preventDefault(),r(e.state,e.dispatch))}}}})}function lJ(e,t){return(n,r)=>{let i=oJ.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let a=nJ(i,n,e);a&&r(t?a.scrollIntoView():a)}return!0}}const uJ=lJ(!1,!0),dJ=lJ(!0,!0);RH.create({name:`characterCount`,addOptions(){return{limit:null,mode:`textSize`,textCounter:e=>e.length,wordCounter:e=>e.split(` `).filter(e=>e!==``).length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=e=>{let t=e?.node||this.editor.state.doc;if((e?.mode||this.options.mode)===`textSize`){let e=t.textBetween(0,t.content.size,void 0,` `);return this.options.textCounter(e)}return t.nodeSize},this.storage.words=e=>{let t=e?.node||this.editor.state.doc,n=t.textBetween(0,t.content.size,` `,` `);return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new jP({key:new PP(`characterCount`),appendTransaction:(t,n,r)=>{if(e)return;let i=this.options.limit;if(i==null||i===0){e=!0;return}let a=this.storage.characters({node:r.doc});if(a>i){let t=a-i;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);let n=r.tr.deleteRange(0,t);return e=!0,n}e=!0},filterTransaction:(e,t)=>{let n=this.options.limit;if(!e.docChanged||n===0||n==null)return!0;let r=this.storage.characters({node:t.doc}),i=this.storage.characters({node:e.doc});if(i<=n||r>n&&i>n&&i<=r)return!0;if(r>n&&i>n&&i>r||!e.getMeta(`paste`))return!1;let a=e.selection.$head.pos,o=a-(i-n),s=a;return e.deleteRange(o,s),!(this.storage.characters({node:e.doc})>n)}})]}});var fJ=RH.create({name:`dropCursor`,addOptions(){return{color:`currentColor`,width:1,class:void 0}},addProseMirrorPlugins(){return[Aq(this.options)]}});RH.create({name:`focus`,addOptions(){return{className:`has-focus`,mode:`all`}},addProseMirrorPlugins(){return[new jP({key:new PP(`focus`),props:{decorations:({doc:e,selection:t})=>{let{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,a=[];if(!n||!r)return nz.create(e,[]);let o=0;this.options.mode===`deepest`&&e.descendants((e,t)=>{if(!e.isText){if(!(i>=t&&i<=t+e.nodeSize-1))return!1;o+=1}});let s=0;return e.descendants((e,t)=>{if(e.isText||!(i>=t&&i<=t+e.nodeSize-1))return!1;if(s+=1,this.options.mode===`deepest`&&o-s>0||this.options.mode===`shallowest`&&s>1)return this.options.mode===`deepest`;a.push($R.node(t,t+e.nodeSize,{class:this.options.className}))}),nz.create(e,a)}}})]}});var pJ=RH.create({name:`gapCursor`,addProseMirrorPlugins(){return[Lq()]},extendNodeSchema(e){return{allowGapCursor:DV(wV(e,`allowGapCursor`,{name:e.name,options:e.options,storage:e.storage}))??null}}}),mJ=`placeholder`;function hJ(e){return e.replace(/\s+/g,`-`).replace(/[^a-zA-Z0-9-]/g,``).replace(/^[0-9-]+/,``).replace(/^-+/,``).toLowerCase()}RH.create({name:`placeholder`,addOptions(){return{emptyEditorClass:`is-editor-empty`,emptyNodeClass:`is-empty`,dataAttribute:mJ,placeholder:`Write something …`,showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){let e=this.options.dataAttribute?`data-${hJ(this.options.dataAttribute)}`:`data-${mJ}`;return[new jP({key:new PP(`placeholder`),props:{decorations:({doc:t,selection:n})=>{let r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:i}=n,a=[];if(!r)return null;let o=this.editor.isEmpty;return t.descendants((t,n)=>{let r=i>=n&&i<=n+t.nodeSize,s=!t.isLeaf&&iH(t);if(!t.type.isTextblock)return this.options.includeChildren;if((r||!this.options.showOnlyCurrent)&&s){let i=[this.options.emptyNodeClass];o&&i.push(this.options.emptyEditorClass);let s=$R.node(n,n+t.nodeSize,{class:i.join(` `),[e]:typeof this.options.placeholder==`function`?this.options.placeholder({editor:this.editor,node:t,pos:n,hasAnchor:r}):this.options.placeholder});a.push(s)}return this.options.includeChildren}),nz.create(t,a)}}})]}}),RH.create({name:`selection`,addOptions(){return{className:`selection`}},addProseMirrorPlugins(){let{editor:e,options:t}=this;return[new jP({key:new PP(`selection`),props:{decorations(n){return n.selection.empty||e.isFocused||!e.isEditable||aH(n.selection)||e.view.dragging?null:nz.create(n.doc,[$R.inline(n.selection.from,n.selection.to,{class:t.className})])}}})]}});function gJ({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||t?.type===e}var _J=RH.create({name:`trailingNode`,addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){let e=new PP(this.name),t=this.options.node||this.editor.schema.topNodeType.contentMatch.defaultType?.name||`paragraph`,n=Object.entries(this.editor.schema.nodes).map(([,e])=>e).filter(e=>(this.options.notAfter||[]).concat(t).includes(e.name));return[new jP({key:e,appendTransaction:(n,r,i)=>{let{doc:a,tr:o,schema:s}=i,c=e.getState(i),l=a.content.size,u=s.nodes[t];if(!n.some(e=>e.getMeta(`skipTrailingNode`))&&c)return o.insert(l,u.create())},state:{init:(e,t)=>{let r=t.tr.doc.lastChild;return!gJ({node:r,types:n})},apply:(e,t)=>{if(!e.docChanged||e.getMeta(`__uniqueIDTransaction`))return t;let r=e.doc.lastChild;return!gJ({node:r,types:n})}}})]}}),vJ=RH.create({name:`undoRedo`,addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>uJ(e,t),redo:()=>({state:e,dispatch:t})=>dJ(e,t)}},addProseMirrorPlugins(){return[cJ(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),yJ=RH.create({name:`starterKit`,addExtensions(){let e=[];return this.options.bold!==!1&&e.push(mW.configure(this.options.bold)),this.options.blockquote!==!1&&e.push(FK.configure(this.options.blockquote)),this.options.bulletList!==!1&&e.push(YK.configure(this.options.bulletList)),this.options.code!==!1&&e.push(zK.configure(this.options.code)),this.options.codeBlock!==!1&&e.push(_U.configure(this.options.codeBlock)),this.options.document!==!1&&e.push(VK.configure(this.options.document)),this.options.dropcursor!==!1&&e.push(fJ.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&e.push(pJ.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&e.push(SW.configure(this.options.hardBreak)),this.options.heading!==!1&&e.push(wW.configure(this.options.heading)),this.options.undoRedo!==!1&&e.push(vJ.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&e.push(HK.configure(this.options.horizontalRule)),this.options.italic!==!1&&e.push(bW.configure(this.options.italic)),this.options.listItem!==!1&&e.push(XK.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(sq.configure(this.options?.listKeymap)),this.options.link!==!1&&e.push(LU.configure(this.options?.link)),this.options.orderedList!==!1&&e.push(gq.configure(this.options.orderedList)),this.options.paragraph!==!1&&e.push(Sq.configure(this.options.paragraph)),this.options.strike!==!1&&e.push(Tq.configure(this.options.strike)),this.options.text!==!1&&e.push(Dq.configure(this.options.text)),this.options.underline!==!1&&e.push(Oq.configure(this.options?.underline)),this.options.trailingNode!==!1&&e.push(_J.configure(this.options?.trailingNode)),e}});const bJ=xW.extend({name:`emphasis`,priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`*`}}},addInputRules(){return[XH({find:gW,type:this.type,getAttributes:{sourceDelimiter:`*`}}),XH({find:vW,type:this.type,getAttributes:{sourceDelimiter:`_`}})]}}),xJ=hW.extend({name:`strong`,priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`**`}}},addInputRules(){return[XH({find:uW,type:this.type,getAttributes:{sourceDelimiter:`**`}}),XH({find:fW,type:this.type,getAttributes:{sourceDelimiter:`__`}})]}}),SJ=IH.create({name:`escapeMark`,priority:10,excludes:``,inclusive:!1,parseHTML(){return[{tag:`span[data-escape-mark]`}]},renderHTML(){return[`span`,{"data-escape-mark":``},0]}}),CJ=fU.create({name:`footnoteDefinition`,group:`block`,content:`block+`,defining:!0,priority:60,addAttributes(){return{identifier:{default:``},label:{default:null}}},parseHTML(){let e=e=>{if(typeof e==`string`)return!1;let t=e.getAttribute(`data-footnote-id`)||``;return{identifier:t,label:t||null}};return[{tag:`aside[data-footnote-def]`,getAttrs:e},{tag:`aside.footnote-def`,getAttrs:e}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.identifier??``);return[`aside`,{...t,"data-footnote-def":``,"data-footnote-id":n,id:`fn-${n}`,class:`footnote-def`},[`div`,{class:`footnote-body`},0],[`a`,{href:`#fnref-${n}`,class:`footnote-backref`,contentEditable:`false`,"aria-label":`Back to reference`},`↩`]]},addCommands(){return{insertFootnoteDefinition:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{identifier:e,label:e},content:[{type:`paragraph`}]})}}}),wJ=CW.extend({marks:`_`,priority:60,addAttributes(){return{...this.parent?.(),hardBreakStyle:{default:`backslash`},sourceRaw:{default:null}}}}),TJ=TW.extend({priority:60,addAttributes(){return{...this.parent?.(),headingStyle:{default:`atx`},sourceTrailingHashes:{default:null},sourceUnderlineLength:{default:null},sourceContiguousNext:{default:!1},sourceLeadingIndent:{default:null,rendered:!1},sourceInteriorSpacing:{default:null,rendered:!1}}}}),EJ=fU.create({name:`htmlBlock`,group:`block`,atom:!0,priority:60,addAttributes(){return{content:{default:``}}},parseHTML(){return[{tag:`div[data-html-block]`}]},renderHTML({node:e}){return[`div`,{"data-html-block":``,class:`html-block`},e.attrs.content]}}),DJ=fU.create({name:`linkRefDef`,group:`block`,atom:!0,priority:60,addAttributes(){return{label:{default:``},href:{default:``},title:{default:null},sourceLayout:{default:null},sourceTitleMarker:{default:null},sourceUrlForm:{default:null}}},parseHTML(){return[{tag:`div[data-link-ref-def]`}]},renderHTML({node:e}){let{label:t,href:n,title:r}=e.attrs;return[`div`,{"data-link-ref-def":``,class:`link-ref-def`},r?`[${t}]: ${n} "${r}"`:`[${t}]: ${n}`]}});function OJ(e){return e.type.name===`list`&&!e.attrs.ordered}function kJ(e){return e.type.name===`list`&&!!e.attrs.ordered}function AJ(e){let t=!1;return e.forEach(e=>{e.type.name===`listItem`&&e.attrs.checked!==null&&(t=!0)}),t}function jJ(e,t,n,r,i,a,o){let s=CV(e=>e.type.name===`list`)(e.selection);if(s&&i(s.node)){let{$from:n,$to:i}=e.selection;return n.blockRange(i)?xF(r)(e,t):!1}if(s){if(!t)return!0;let{tr:n}=e;return n.setNodeMarkup(s.pos,void 0,{...s.node.attrs,...a}),o!==void 0&&s.node.forEach((e,t)=>{if(e.type.name===`listItem`){let r=s.pos+1+t;n.setNodeMarkup(r,void 0,{...e.attrs,...o})}}),t(n),!0}return vF(n,a)(e,void 0)?!t||vF(n,a)(e,n=>{if(o){let t=n.mapping.map(e.selection.$from.pos),r=n.doc.resolve(t);for(let e=r.depth;e>0;e--){let t=r.node(e);if(t.type.name===`listItem`){n.setNodeMarkup(r.before(e),void 0,{...t.attrs,...o});break}}}t(n)}):!1}function MJ(e){return e===`x`||e===`X`}function NJ(e){return e===`X`?`X`:null}function PJ(e,t,n,r){let i=e.schema.nodes.list;if(!i)return!1;let a=e.doc.resolve(t.from),o=a.depth-1;if(o>0&&a.node(o).type.name===`listItem`&&a.index(o)===0){let i=a.node(o);return e.tr.delete(t.from,t.to).setNodeMarkup(a.before(o),void 0,{...i.attrs,checked:n,sourceCheckboxChar:r}),!0}let s=a.blockRange();if(!s)return!1;let c=jN(s,i,{ordered:!1});if(!c)return!1;let l=e.tr;l.wrap(s,c),l.delete(l.mapping.map(t.from),l.mapping.map(t.to));let u=l.doc.resolve(l.mapping.map(t.from));for(let e=u.depth;e>0;e--){let t=u.node(e);if(t.type.name===`listItem`){l.setNodeMarkup(u.before(e),void 0,{...t.attrs,checked:n,sourceCheckboxChar:r});break}}return!0}const FJ=/^\s*([-+*])\s$/,IJ=/^\s*(\d+)([.)])\s$/,LJ=/^\s*[-*+]\s\[([ xX]?)\]\s$/,RJ=/^\s*\[([ xX]?)\]\s$/,zJ=fU.create({name:`list`,group:`block list`,content:`listItem+`,priority:60,addAttributes(){return{ordered:{default:!1},start:{default:1},spread:{default:!1},bulletMarker:{default:null},listMarkerDelimiter:{default:null}}},parseHTML(){return[{tag:`ul`,getAttrs:()=>({ordered:!1})},{tag:`ol`,getAttrs:e=>({ordered:!0,start:e.getAttribute(`start`)?Number(e.getAttribute(`start`)):1})}]},renderHTML({node:e,HTMLAttributes:t}){let n=e.attrs.ordered?`ol`:`ul`,r={};return e.attrs.ordered&&e.attrs.start!==1&&(r.start=e.attrs.start),[n,NV(t,r),0]},addCommands(){return{toggleBulletList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:jJ(e,t,n,r,e=>OJ(e)&&!AJ(e),{ordered:!1},{checked:null})},toggleOrderedList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:jJ(e,t,n,r,e=>kJ(e),{ordered:!0},{checked:null})},toggleTaskList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:jJ(e,t,n,r,e=>OJ(e)&&AJ(e),{ordered:!1},{checked:!1})}}},addInputRules(){return[$H({find:FJ,type:this.type,getAttributes:e=>({ordered:!1,bulletMarker:e[1]}),joinPredicate:(e,t)=>t.attrs.ordered===!1}),$H({find:IJ,type:this.type,getAttributes:e=>({ordered:!0,start:Number(e[1]),listMarkerDelimiter:e[2]}),joinPredicate:(e,t)=>t.attrs.ordered===!0}),new jH({find:LJ,handler:({state:e,range:t,match:n})=>PJ(e,t,MJ(n[1]),NJ(n[1]))?void 0:null}),new jH({find:RJ,handler:({state:e,range:t,match:n})=>PJ(e,t,MJ(n[1]),NJ(n[1]))?void 0:null})]},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList(),"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList(),"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),BJ=fU.create({name:`listItem`,content:`paragraph block*`,defining:!0,addAttributes(){return{checked:{default:null},spread:{default:!1},sourceMarkerSpacing:{default:null,rendered:!1},sourceOrdinal:{default:null,rendered:!1},sourceCheckboxChar:{default:null,rendered:!1},sourceContinuationIndent:{default:null,rendered:!1}}},parseHTML(){return[{tag:`li`,getAttrs:e=>{let t=e.querySelector(`input[type="checkbox"]`);return{checked:t?t.checked:null}}}]},renderHTML({node:e,HTMLAttributes:t}){return e.attrs.checked===null?[`li`,NV(t),0]:[`li`,NV(t,{"data-type":`taskItem`,"data-checked":e.attrs.checked?`true`:`false`}),[`label`,{contenteditable:`false`},[`input`,{type:`checkbox`,...e.attrs.checked?{checked:`checked`}:{}}]],[`div`,0]]},addNodeView(){return({node:e,getPos:t,editor:n,HTMLAttributes:r})=>{let i=document.createElement(`li`);Object.entries(NV(r,e.attrs.checked===null?{}:{"data-type":`taskItem`,"data-checked":String(!!e.attrs.checked)})).forEach(([e,t])=>{t!=null&&i.setAttribute(e,String(t))});let a=null,o=null,s=document.createElement(`div`),c=()=>{o&&(o.disabled=!n.isEditable)};return e.attrs.checked!==null&&(a=document.createElement(`label`),a.contentEditable=`false`,o=document.createElement(`input`),o.type=`checkbox`,o.checked=!!e.attrs.checked,c(),n.on(`update`,c),o.addEventListener(`change`,()=>{let r=t();r!==void 0&&typeof r==`number`&&n.view.dispatch(n.view.state.tr.setNodeMarkup(r,void 0,{...e.attrs,checked:o?.checked??!1}))}),a.appendChild(o),i.appendChild(a)),i.appendChild(s),{dom:i,contentDOM:s,update(t){return t.type!==e.type||t.attrs.checked!==null!=(e.attrs.checked!==null)?!1:(o&&t.attrs.checked!==null&&(o.checked=!!t.attrs.checked,o.disabled=!n.isEditable,i.setAttribute(`data-checked`,String(!!t.attrs.checked))),e=t,!0)},destroy(){n.off(`update`,c)}}}},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>{let{$from:e}=this.editor.state.selection;for(let t=e.depth;t>0;t--)if(e.node(t).type.name===`listItem`)return this.editor.commands.sinkListItem(this.name);return!1},"Shift-Tab":()=>{let{$from:e}=this.editor.state.selection;for(let t=e.depth;t>0;t--)if(e.node(t).type.name===`listItem`)return this.editor.commands.liftListItem(this.name);return!1}}}}),VJ=zJ,HJ=BJ,UJ=IK.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceMarkerSpacings:{default:null}}}}),WJ=BK.extend({excludes:``,addAttributes(){return{...this.parent?.(),sourceFenceChar:{default:"`"},sourceFenceLength:{default:1},sourcePadded:{default:!1,rendered:!1}}}}),GJ=fU.create({name:`commentBlock`,group:`block`,content:`block+`,defining:!0,priority:60,addAttributes(){return{sourceForm:{default:`percent`,parseHTML:e=>e.getAttribute(`data-source-form`)===`html`?`html`:`percent`,renderHTML:e=>e.sourceForm===`html`?{"data-source-form":`html`}:{}},sourceLayout:{default:`block`,parseHTML:e=>e.getAttribute(`data-source-layout`)===`inline`?`inline`:`block`,renderHTML:e=>e.sourceLayout===`inline`?{"data-source-layout":`inline`}:{}}}},parseHTML(){return[{tag:`aside[data-comment-block]`},{tag:`aside.comment-block`}]},renderHTML({HTMLAttributes:e}){return[`aside`,{"data-comment-block":``,"data-clipboard-omit":`true`,class:`comment-block`,...e},0]},addCommands(){return{setCommentBlock:()=>({commands:e})=>e.wrapIn(this.name),toggleCommentBlock:()=>({commands:e})=>e.toggleWrap(this.name),unsetCommentBlock:()=>({commands:e})=>e.lift(this.name)}}}),KJ=IH.create({name:`comment`,priority:10,excludes:``,inclusive:!1,addAttributes(){return{sourceForm:{default:`percent`,parseHTML:e=>e.getAttribute(`data-source-form`)===`html`?`html`:`percent`,renderHTML:e=>e.sourceForm===`html`?{"data-source-form":`html`}:{}}}},parseHTML(){return[{tag:`span[data-comment-mark]`}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-comment-mark":``,"data-clipboard-omit":`true`,class:`comment-mark`,...e},0]},addCommands(){return{setComment:()=>({commands:e})=>e.setMark(this.name),toggleComment:()=>({commands:e})=>e.toggleMark(this.name),unsetComment:()=>({commands:e})=>e.unsetMark(this.name)}}}),qJ=RH.create({name:`docFidelity`,addGlobalAttributes(){return[{types:[`doc`],attributes:{sourceDocBoundary:{default:null,rendered:!1}}}]}});function JJ(e){for(let t=e.depth;t>0;t--)if(e.node(t).type.name===`listItem`)return t;return null}function YJ(e){let t=!1;return e.descendants(e=>!t&&(e.type.name===`list`&&(t=!0),!t)),t}function XJ(e){let{selection:t}=e;return t instanceof bP?t.$cursor:null}function ZJ(e){let t=XJ(e);if(t?.parentOffset!==0)return!1;let n=JJ(t);if(n===null||t.depth!==n+1||t.index(n)!==0)return!1;let r=t.index(n-1);return r!==0&&YJ(t.node(n-1).child(r-1))}function QJ(e,t){for(let n=t-1;n>=0;n--){let t=e.node(n),r=e.index(n);if(r<t.childCount-1){let e=t.child(r+1),i=n+1;for(;e.type.name===`list`&&e.firstChild;)e=e.firstChild,i+=1;return e.type.name===`listItem`?i:null}}return null}function $J(e){let t=XJ(e);if(!t||t.parentOffset!==t.parent.content.size)return!1;let n=JJ(t);if(n===null)return!1;for(let e=t.depth;e>n;e--)if(t.index(e-1)!==t.node(e-1).childCount-1)return!1;let r=QJ(t,n);return r!==null&&r<n}const eY=RH.create({name:`listBoundaryMerge`,addKeyboardShortcuts(){let e=()=>{let{editor:e}=this;if(!ZJ(e.state))return!1;if(e.commands.undoInputRule())return!0;let{state:t,view:n}=e;return RP(t,n.dispatch,n)},t=()=>{let{editor:e}=this;if(!$J(e.state))return!1;let{state:t,view:n}=e;return zP(t,n.dispatch,n)};return{Backspace:e,"Mod-Backspace":e,Delete:t,"Mod-Delete":t}}}),tY=RH.create({name:`plainTextClipboard`,priority:1e3,addProseMirrorPlugins(){return[new jP({key:new PP(`okPlainTextClipboard`),props:{clipboardTextSerializer:e=>e.content.textBetween(0,e.content.size,`
|
|
288
|
+
|
|
289
|
+
`)}})]}}),nY=Eq.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`~~`,rendered:!1}}}}),rY=NK.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceDashCounts:{default:null},sourceOuterPipes:{default:null,rendered:!1},sourceAlignmentPadding:{default:null,rendered:!1}}}}),iY=vK.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),aY=yK.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),oY=/^(?:---|—-|___\s|\*\*\*\s)$/;function sY(e){let t=String(e[0]??``).replace(/\s+$/,``);return t===`—-`?`---`:t}const cY=UK.extend({name:`thematicBreak`,priority:60,addAttributes(){return{...this.parent?.(),sourceRaw:{default:`---`}}},addInputRules(){return[ZH({find:oY,type:this.type,getAttributes:e=>({sourceRaw:sY(e)})})]}}),lY=[TU,WU,EU,UU,aW,cW,JU,VJ,HJ,bJ,xJ,nY,kq.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceForm:{default:`u`,rendered:!1}}}}),WJ,vU,UJ,TJ,cY,HU,EJ,DJ,wJ,SJ,qJ,GU,tY,yJ.configure({trailingNode:!1,undoRedo:!1,bulletList:!1,orderedList:!1,listItem:!1,listKeymap:{listTypes:[{itemName:`listItem`,wrapperNames:[`list`]}]},italic:!1,bold:!1,strike:!1,underline:!1,code:!1,codeBlock:!1,heading:!1,horizontalRule:!1,hardBreak:!1,link:!1,blockquote:!1,dropcursor:{color:`color-mix(in oklch, var(--primary) 50%, transparent)`,width:2}}),eY,rY.configure({resizable:!0}),bK,aY,iY,wU.configure({inline:!0}),xU,OW,KJ,GJ,bU,CJ];function uY(e){if(typeof e!=`object`||!e||!Object.hasOwn(e,`escapedChars`))return{kind:`absent`};let t=e.escapedChars;return Array.isArray(t)&&t.every(e=>{if(typeof e!=`object`||!e)return!1;let t=e.offset;return typeof t==`number`&&Number.isInteger(t)&&t>=0&&typeof e.char==`string`})?{kind:`valid`,data:{escapedChars:t}}:{kind:`malformed`}}function dY(e){return uY(e).kind===`valid`}function fY(e,t,n){return e[t]===`\\`&&t+1<e.length&&e[t+1]===n}function pY(e,t,n,r){let i=t,a=0;for(;a<r&&i<e.length;){let t=a>0&&n[a-1]===`
|
|
290
|
+
`?hY(e,i,n[a]):null;t!==null&&(i=t),i+=fY(e,i,n[a])?2:1,a+=1}return i}function mY(e,t,n){return e[t]===n||fY(e,t,n)}function hY(e,t,n){let r=t,i=!1;for(;;){let t=r;for(;r<e.length&&(e[r]===` `||e[r]===` `);)r+=1;if(e[r]===`>`){r+=1,(e[r]===` `||e[r]===` `)&&(r+=1),i=!0;continue}r>t&&(i=!0);break}return i&&mY(e,r,n)?r:null}function gY(e){return dY(e.data)?new Set(e.data.escapedChars.map(e=>e.offset)):null}function _Y(e,t,n){return e.filter(e=>e.offset>=t&&e.offset<n).map(e=>({...e,offset:e.offset-t}))}function vY(e,t,n){return e.filter(e=>e.offset>=t&&e.offset+e.length<=n).map(e=>({...e,offset:e.offset-t}))}function yY(e,t,n,r){let i={type:`text`,value:t.value.slice(n,r)},a=CY(e,t,n,r);a&&(i.position=a);let o;if(dY(t.data)&&(o={escapedChars:_Y(t.data.escapedChars,n,r)}),t.data?.entityRefSpans?.length){let e=vY(t.data.entityRefSpans,n,r);e.length>0&&(o={...o,entityRefSpans:e})}return o&&(i.data=o),i}function bY(e,t,n){if(e===null||e.size===0)return!1;for(let r=0;r<n;r++)if(e.has(t+r))return!0;return!1}function xY(e,t){let n=1,r=1;for(let i=0;i<t&&i<e.length;i++)e[i]===`
|
|
291
|
+
`?(n+=1,r=1):r+=1;return{line:n,column:r,offset:t}}function SY(e,t,n){return{start:xY(e,t),end:xY(e,n)}}function CY(e,t,n,r){if(!e||!t.position||typeof t.position.start?.offset!=`number`)return;let i=t.position.start.offset;return SY(e,pY(e,i,t.value,n),pY(e,i,t.value,r))}const wY=`[\\p{L}\\p{M}\\p{N}_/-]`,TY=`(?:(?!\\p{DI})${wY})`,EY=`(?!\\p{DI})\\p{L}${TY}*`,DY=`(^|\\s)#(${EY})(?!\\p{DI}*${wY})`;function OY(){return new RegExp(DY,`gu`)}const kY=OY();RegExp(`^${EY}$`,`u`);function AY(e,t=``){let n=[],r=!1;for(let i of e.children){if(i.type!==`text`){n.push(i);continue}let e=i.value,a=gY(i);kY.lastIndex=0;let o=[],s=0;for(;;){let n=kY.exec(e);if(n===null)break;let c=n[1]??``,l=n[2]??``,u=n.index+c.length;if(bY(a,u,1))continue;u>s&&o.push(yY(t,i,s,u));let d={type:`tag`,value:l},f=CY(t,i,u,u+1+l.length);f&&(d.position=f),o.push(d),s=u+1+l.length,r=!0}o.length===0?n.push(i):(s<e.length&&o.push(yY(t,i,s,e.length)),n.push(...o))}r&&(e.children=n)}const jY=RegExp(`^(?!\\p{DI})[\\p{L}\\p{N}]${TY}*$`,`u`);function MY(e){return e.startsWith(`#`)?e.slice(1):e}function NY(e){return typeof e==`string`?[e]:Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function PY(e){if(!e||e.trim()===``)return[];let{map:t}=lu(e);if(!t)return[];let n=NY(t.tags),r=[];for(let e of n){let t=MY(e);jY.test(t)&&r.push(t)}return r}const FY=F({changes:P(Co(`kind`,[F({key:j(),kind:L(`added`),after:Zl}).loose(),F({key:j(),kind:L(`removed`),before:Zl}).loose(),F({key:j(),kind:L(`changed`),before:Zl,after:Zl}).loose()])),unparseable:F({before:j(),after:j()}).loose().nullable()}).loose();function IY(e){let{fenced:t}=hu(e),n=_u(t);if(n.map===null)return{fenced:t,map:{},keys:[],parseError:n.parseError};let r=mu(n.doc);return{fenced:t,map:n.map,keys:r.length>0?r:Object.keys(n.map),parseError:void 0}}function LY(e,t){let n=IY(e),r=IY(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}nu(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}}3072-RY("This is an OpenKnowledge project: load the `open-knowledge` skill and use the OpenKnowledge MCP tools for all markdown — don't probe for `.ok/` or use native file tools on `.md` / `.mdx`. ",`cursor`),new TextEncoder;function RY(e,t){let n=encodeURIComponent(e);return t===`cursor`?encodeURIComponent(n).length:n.length}function zY(e){return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||e===45||e===95}function BY(e){if(!e.includes(`eyJ`))return null;let t=[],n=[];for(let r=0;r<e.length;r+=1)if(zY(e.charCodeAt(r))){for(t.push(r);r<e.length&&zY(e.charCodeAt(r));)r+=1;n.push(r)}let r=[];for(let t=e.indexOf(`eyJ`);t!==-1;t=e.indexOf(`eyJ`,t+1))r.push(t);let i=r=>r+1<t.length&&e[n[r]??-1]===`.`&&t[r+1]===(n[r]??-1)+1,a=[],o=0,s=0;for(let c=0;c+2<t.length;c+=1){let l=t[c]??0,u=n[c]??0;for(;s<r.length&&(r[s]??0)<l;)s+=1;if(!i(c)||!i(c+1))continue;let d=t[c+1]??0,f=n[c+1]??0,p=(n[c+2]??0)-(t[c+2]??0);if(!e.startsWith(`eyJ`,d)||f-d<11||p<8)continue;let m=r[s];m===void 0||m>=u||u-m<11||(a.push(e.slice(o,m),`[REDACTED-JWT]`),o=n[c+2]??e.length,c+=2)}return a.length===0?null:(a.push(e.slice(o)),a.join(``))}function VY(e){return RegExp(`(?:\\b|(?<=(?:\\[|\\u009b)[0-?]*[ -/]*[@-~]))${e.source}`,`g`)}const HY=[{name:`github-pat`,regex:/(ghp_|gho_|ghu_|ghs_|ghr_)[A-Za-z0-9]{36,}\b/g,replacement:`[REDACTED-GH-PAT]`},{name:`aws-access-key`,regex:VY(/(AKIA|ASIA|ABIA)[A-Z2-7]{16}\b/),replacement:`[REDACTED-AWS-KEY]`},{name:`anthropic-key`,regex:/sk-ant-api03-[A-Za-z0-9_-]{20,}\b/g,replacement:`[REDACTED-ANTHROPIC]`},{name:`openai-key`,regex:VY(/sk-[A-Za-z0-9]{20,}\b/),replacement:`[REDACTED-OPENAI]`},{name:`bearer-token`,regex:/([Aa]uthorization:\s*[Bb]earer\s+)(?:\\"[^\s"\\]+\\"|"[A-Za-z0-9\-._~+/=]+"|[^\s"\\]+)/g,replacement:`$1[REDACTED]`},{name:`jwt`,redact:BY},{name:`url-credentials`,regex:/:\/\/[^/\s:@"]+:[^/\s:@"]+@/g,replacement:`://[REDACTED]@`},{name:`github-pat-fine-grained`,regex:/github_pat_[0-9A-Za-z_]{20,}/g,replacement:`[REDACTED-GH-PAT]`},{name:`openai-key-modern`,regex:VY(/sk-(?:proj|svcacct|admin|None)-[A-Za-z0-9_-]{20,}/),replacement:`[REDACTED-OPENAI]`},{name:`slack-token`,regex:/xox[a-z]-[A-Za-z0-9-]{10,}/g,replacement:`[REDACTED-SLACK]`},{name:`google-api-key`,regex:/AIza[0-9A-Za-z_-]{35}/g,replacement:`[REDACTED-GOOGLE]`},{name:`stripe-secret-key`,regex:VY(/(?:sk|rk)_live_[0-9A-Za-z]{16,}\b/),replacement:`[REDACTED-STRIPE]`},{name:`gitlab-pat`,regex:/glpat-[0-9A-Za-z_-]{20,}/g,replacement:`[REDACTED-GITLAB]`},{name:`atlassian-api-token`,regex:/\b(?:ATATT|ATCTT|ATBB)[0-9A-Za-z_=-]{20,}/g,replacement:`[REDACTED-ATLASSIAN]`},{name:`bearer-token-json`,regex:/("[Aa]uthorization"\s*:\s*"[Bb]earer\s+)(?:\\"[^"\\]+\\"|[^"\\]+)/g,replacement:`$1[REDACTED]`},{name:`macos-home-path`,regex:/\/Users\/[^/"\r]*[^/"\r\\]/g,replacement:`~`},{name:`linux-home-path`,regex:/\/home\/[^/"\r]*[^/"\r\\]/g,replacement:`~`},{name:`windows-home-path`,regex:/[A-Za-z]:\\{1,2}Users\\{1,2}(?:(?![A-Za-z]:\\)[^\\"\r])+/gi,replacement:`~`}],UY=HY.map(e=>e.name);function WY(e){let t=new Set,n=0;return{redacted:e.split(`
|
|
292
|
+
`).map(e=>{let r=e,i=!1;for(let e of HY){if(`redact`in e){let n=e.redact(r);if(n===null)continue;t.add(e.name),i=!0,r=n;continue}let{name:n,regex:a,replacement:o}=e;a.lastIndex=0,a.test(r)&&(t.add(n),i=!0,a.lastIndex=0,r=r.replace(a,o))}return i&&n++,r}).join(`
|
|
293
|
+
`),patterns:[...t],lineCount:n}}function GY(e){return WY(e).redacted}function KY(e,t,n=3){let r=RegExp(`^ {0,3}(\\${e}+)[ \\t]*$`),i=Math.max(3,n);for(let e of t.split(`
|
|
294
|
+
`)){let t=r.exec(e);t&&t[1].length>=i&&(i=t[1].length+1)}return i}function qY(e){let t=[],n=0,r=()=>{t.length>0&&(n+=1)},i=e=>{for(;n>0;)t.push({type:`break`}),--n;t.push(e)},a=e=>{e.split(`
|
|
295
|
+
`).forEach((e,t)=>{t>0&&r(),e.length>0&&i({type:`text`,value:e})})},o=e=>{let t=e.ordered===!0,n=typeof e.start==`number`?e.start:1,a=e.data,o=typeof a?.bulletMarker==`string`?a.bulletMarker:`-`,c=typeof a?.listMarkerDelimiter==`string`?a.listMarkerDelimiter:`.`;e.children.forEach((e,a)=>{a>0&&r();let l=t?`${n+a}${c} `:`${o} `;i({type:`text`,value:l}),e.children.forEach((e,t)=>{t>0&&r(),s(e)})})},s=e=>{switch(e.type){case`paragraph`:case`heading`:e.children.forEach(i);return;case`list`:o(e);return;case`code`:case`html`:a(e.value);return;case`thematicBreak`:i({type:`text`,value:e.data?.sourceRaw??`---`});return;default:{let t=e;if(Array.isArray(t.children)&&t.children.length>0){t.children.forEach((e,t)=>{t>0&&r(),s(e)});return}let n=e;if(typeof n.value==`string`){a(n.value);return}console.warn(JSON.stringify({event:`table-cell-flatten-dropped-block`,nodeType:e.type}))}}};return e.forEach((e,t)=>{t>0&&r(),s(e)}),t}var JY=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};JY.prototype.normal={},JY.prototype.property={},JY.prototype.space=void 0;function YY(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new JY(n,r,t)}function XY(e){return e.toLowerCase()}var ZY=class{constructor(e,t){this.attribute=t,this.property=e}};ZY.prototype.attribute=``,ZY.prototype.booleanish=!1,ZY.prototype.boolean=!1,ZY.prototype.commaOrSpaceSeparated=!1,ZY.prototype.commaSeparated=!1,ZY.prototype.defined=!1,ZY.prototype.mustUseProperty=!1,ZY.prototype.number=!1,ZY.prototype.overloadedBoolean=!1,ZY.prototype.property=``,ZY.prototype.spaceSeparated=!1,ZY.prototype.space=void 0;var QY=n({boolean:()=>eX,booleanish:()=>tX,commaOrSpaceSeparated:()=>aX,commaSeparated:()=>iX,number:()=>G,overloadedBoolean:()=>nX,spaceSeparated:()=>rX});let $Y=0;const eX=oX(),tX=oX(),nX=oX(),G=oX(),rX=oX(),iX=oX(),aX=oX();function oX(){return 2**++$Y}const sX=Object.keys(QY);var cX=class extends ZY{constructor(e,t,n,r){let i=-1;if(super(e,t),lX(this,`space`,r),typeof n==`number`)for(;++i<sX.length;){let e=sX[i];lX(this,sX[i],(n&QY[e])===QY[e])}}};cX.prototype.defined=!0;function lX(e,t,n){n&&(e[t]=n)}function uX(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new cX(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[XY(r)]=r,n[XY(a.attribute)]=r}return new JY(t,n,e.space)}const dX=uX({properties:{ariaActiveDescendant:null,ariaAtomic:tX,ariaAutoComplete:null,ariaBusy:tX,ariaChecked:tX,ariaColCount:G,ariaColIndex:G,ariaColSpan:G,ariaControls:rX,ariaCurrent:null,ariaDescribedBy:rX,ariaDetails:null,ariaDisabled:tX,ariaDropEffect:rX,ariaErrorMessage:null,ariaExpanded:tX,ariaFlowTo:rX,ariaGrabbed:tX,ariaHasPopup:null,ariaHidden:tX,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:rX,ariaLevel:G,ariaLive:null,ariaModal:tX,ariaMultiLine:tX,ariaMultiSelectable:tX,ariaOrientation:null,ariaOwns:rX,ariaPlaceholder:null,ariaPosInSet:G,ariaPressed:tX,ariaReadOnly:tX,ariaRelevant:null,ariaRequired:tX,ariaRoleDescription:rX,ariaRowCount:G,ariaRowIndex:G,ariaRowSpan:G,ariaSelected:tX,ariaSetSize:G,ariaSort:null,ariaValueMax:G,ariaValueMin:G,ariaValueNow:G,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function fX(e,t){return t in e?e[t]:t}function pX(e,t){return fX(e,t.toLowerCase())}const mX=uX({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:iX,acceptCharset:rX,accessKey:rX,action:null,allow:null,allowFullScreen:eX,allowPaymentRequest:eX,allowUserMedia:eX,alpha:eX,alt:null,as:null,async:eX,autoCapitalize:null,autoComplete:rX,autoFocus:eX,autoPlay:eX,blocking:rX,capture:null,charSet:null,checked:eX,cite:null,className:rX,closedBy:null,colorSpace:null,cols:G,colSpan:G,command:null,commandFor:null,content:null,contentEditable:tX,controls:eX,controlsList:rX,coords:G|iX,crossOrigin:null,data:null,dateTime:null,decoding:null,default:eX,defer:eX,dir:null,dirName:null,disabled:eX,download:nX,draggable:tX,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:eX,formTarget:null,headers:rX,height:G,hidden:nX,high:G,href:null,hrefLang:null,htmlFor:rX,httpEquiv:rX,id:null,imageSizes:null,imageSrcSet:null,inert:eX,inputMode:null,integrity:null,is:null,isMap:eX,itemId:null,itemProp:rX,itemRef:rX,itemScope:eX,itemType:rX,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:eX,low:G,manifest:null,max:null,maxLength:G,media:null,method:null,min:null,minLength:G,multiple:eX,muted:eX,name:null,nonce:null,noModule:eX,noValidate:eX,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:eX,optimum:G,pattern:null,ping:rX,placeholder:null,playsInline:eX,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:eX,referrerPolicy:null,rel:rX,required:eX,reversed:eX,rows:G,rowSpan:G,sandbox:rX,scope:null,scoped:eX,seamless:eX,selected:eX,shadowRootClonable:eX,shadowRootCustomElementRegistry:eX,shadowRootDelegatesFocus:eX,shadowRootMode:null,shadowRootSerializable:eX,shape:null,size:G,sizes:null,slot:null,span:G,spellCheck:tX,src:null,srcDoc:null,srcLang:null,srcSet:null,start:G,step:null,style:null,tabIndex:G,target:null,title:null,translate:null,type:null,typeMustMatch:eX,useMap:null,value:tX,width:G,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:rX,axis:null,background:null,bgColor:null,border:G,borderColor:null,bottomMargin:G,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:eX,declare:eX,event:null,face:null,frame:null,frameBorder:null,hSpace:G,leftMargin:G,link:null,longDesc:null,lowSrc:null,marginHeight:G,marginWidth:G,noResize:eX,noHref:eX,noShade:eX,noWrap:eX,object:null,profile:null,prompt:null,rev:null,rightMargin:G,rules:null,scheme:null,scrolling:tX,standby:null,summary:null,text:null,topMargin:G,valueType:null,version:null,vAlign:null,vLink:null,vSpace:G,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:eX,disablePictureInPicture:eX,disableRemotePlayback:eX,exportParts:iX,part:rX,prefix:null,property:null,results:G,security:null,unselectable:null},space:`html`,transform:pX}),hX=uX({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:aX,accentHeight:G,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:G,amplitude:G,arabicForm:null,ascent:G,attributeName:null,attributeType:null,azimuth:G,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:G,by:null,calcMode:null,capHeight:G,className:rX,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:G,diffuseConstant:G,direction:null,display:null,dur:null,divisor:G,dominantBaseline:null,download:eX,dx:null,dy:null,edgeMode:null,editable:null,elevation:G,enableBackground:null,end:null,event:null,exponent:G,externalResourcesRequired:null,fill:null,fillOpacity:G,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:iX,g2:iX,glyphName:iX,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:G,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:G,horizOriginX:G,horizOriginY:G,id:null,ideographic:G,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:G,k:G,k1:G,k2:G,k3:G,k4:G,kernelMatrix:aX,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:G,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:G,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:G,overlineThickness:G,paintOrder:null,panose1:null,path:null,pathLength:G,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:rX,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:G,pointsAtY:G,pointsAtZ:G,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:aX,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:aX,rev:aX,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:aX,requiredFeatures:aX,requiredFonts:aX,requiredFormats:aX,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:G,specularExponent:G,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:G,strikethroughThickness:G,string:null,stroke:null,strokeDashArray:aX,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:G,strokeOpacity:G,strokeWidth:null,style:null,surfaceScale:G,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:aX,tabIndex:G,tableValues:null,target:null,targetX:G,targetY:G,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:aX,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:G,underlineThickness:G,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:G,values:null,vAlphabetic:G,vMathematical:G,vectorEffect:null,vHanging:G,vIdeographic:G,version:null,vertAdvY:G,vertOriginX:G,vertOriginY:G,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:G,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:fX}),gX=uX({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),_X=uX({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:pX}),vX=uX({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),yX=/[A-Z]/g,bX=/-[a-z]/g,xX=/^data[-\w.:]+$/i;function SX(e,t){let n=XY(t),r=t,i=ZY;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&xX.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(bX,wX);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!bX.test(e)){let n=e.replace(yX,CX);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=cX}return new i(r,t)}function CX(e){return`-`+e.toLowerCase()}function wX(e){return e.charAt(1).toUpperCase()}const TX=YY([dX,mX,gX,_X,vX],`html`),EX=YY([dX,hX,gX,_X,vX],`svg`);function DX(e){let t=[],n=String(e||``),r=n.indexOf(`,`),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);let e=n.slice(i,r).trim();(e||!a)&&t.push(e),i=r+1,r=n.indexOf(`,`,i)}return t}const OX=/[#.]/g;function kX(e,t){let n=e||``,r={},i=0,a,o;for(;i<n.length;){OX.lastIndex=i;let e=OX.exec(n),t=n.slice(i,e?e.index:n.length);t&&(a?a===`#`?r.id=t:Array.isArray(r.className)?r.className.push(t):r.className=[t]:o=t,i+=t.length),e&&(a=e[0],i++)}return{type:`element`,tagName:o||t||`div`,properties:r,children:[]}}function AX(e){let t=String(e||``).trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function jX(e,t,n){let r=n?LX(n):void 0;function i(n,i,...a){let o;if(n==null){o={type:`root`,children:[]};let e=i;a.unshift(e)}else{o=kX(n,t);let s=o.tagName.toLowerCase(),c=r?r.get(s):void 0;if(o.tagName=c||s,MX(i))a.unshift(i);else for(let[t,n]of Object.entries(i))NX(e,o.properties,t,n)}for(let e of a)PX(o.children,e);return o.type===`element`&&o.tagName===`template`&&(o.content={type:`root`,children:o.children},o.children=[]),o}return i}function MX(e){if(typeof e!=`object`||!e||Array.isArray(e))return!0;if(typeof e.type!=`string`)return!1;let t=e,n=Object.keys(e);for(let e of n){let n=t[e];if(n&&typeof n==`object`){if(!Array.isArray(n))return!0;let e=n;for(let t of e)if(typeof t!=`number`&&typeof t!=`string`)return!0}}return!!(`children`in e&&Array.isArray(e.children))}function NX(e,t,n,r){let i=SX(e,n),a;if(r!=null){if(typeof r==`number`){if(Number.isNaN(r))return;a=r}else a=typeof r==`boolean`?r:typeof r==`string`?i.spaceSeparated?AX(r):i.commaSeparated?DX(r):i.commaOrSpaceSeparated?AX(DX(r).join(` `)):FX(i,i.property,r):Array.isArray(r)?[...r]:i.property===`style`?IX(r):String(r);if(Array.isArray(a)){let e=[];for(let t of a)e.push(FX(i,i.property,t));a=e}i.property===`className`&&Array.isArray(t.className)&&(a=t.className.concat(a)),t[i.property]=a}}function PX(e,t){if(t!=null){if(typeof t==`number`||typeof t==`string`)e.push({type:`text`,value:String(t)});else if(Array.isArray(t))for(let n of t)PX(e,n);else if(typeof t==`object`&&`type`in t)t.type===`root`?PX(e,t.children):e.push(t);else throw Error("Expected node, nodes, or string, got `"+t+"`")}}function FX(e,t,n){if(typeof n==`string`){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===``||XY(n)===XY(t)))return!0}return n}function IX(e){let t=[];for(let[n,r]of Object.entries(e))t.push([n,r].join(`: `));return t.join(`; `)}function LX(e){let t=new Map;for(let n of e)t.set(n.toLowerCase(),n);return t}const RX=`altGlyph.altGlyphDef.altGlyphItem.animateColor.animateMotion.animateTransform.clipPath.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feDropShadow.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.foreignObject.glyphRef.linearGradient.radialGradient.solidColor.textArea.textPath`.split(`.`),zX=jX(TX,`div`),BX=jX(EX,`g`,RX);function VX(e){let t=String(e),n=[];return{toOffset:i,toPoint:r};function r(e){if(typeof e==`number`&&e>-1&&e<=t.length){let r=0;for(;;){let i=n[r];if(i===void 0){let e=HX(t,n[r-1]);i=e===-1?t.length+1:e+1,n[r]=i}if(i>e)return{line:r+1,column:e-(r>0?n[r-1]:0)+1,offset:e};r++}}}function i(e){if(e&&typeof e.line==`number`&&typeof e.column==`number`&&!Number.isNaN(e.line)&&!Number.isNaN(e.column)){for(;n.length<e.line;){let e=n[n.length-1],r=HX(t,e),i=r===-1?t.length+1:r+1;if(e===i)break;n.push(i)}let r=(e.line>1?n[e.line-2]:0)+e.column-1;if(r<n[e.line-1])return r}}}function HX(e,t){let n=e.indexOf(`\r`,t),r=e.indexOf(`
|
|
296
|
+
`,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}const UX={html:`http://www.w3.org/1999/xhtml`,mathml:`http://www.w3.org/1998/Math/MathML`,svg:`http://www.w3.org/2000/svg`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`},WX={}.hasOwnProperty,GX=Object.prototype;function KX(e,t){let n=t||{};return qX({file:n.file||void 0,location:!1,schema:n.space===`svg`?EX:TX,verbose:n.verbose||!1},e)}function qX(e,t){let n;switch(t.nodeName){case`#comment`:{let r=t;return n={type:`comment`,value:r.data},XX(e,r,n),n}case`#document`:case`#document-fragment`:{let r=t,i=`mode`in r?r.mode===`quirks`||r.mode===`limited-quirks`:!1;if(n={type:`root`,children:JX(e,t.childNodes),data:{quirksMode:i}},e.file&&e.location){let t=String(e.file),r=VX(t),i=r.toPoint(0),a=r.toPoint(t.length);n.position={start:i,end:a}}return n}case`#documentType`:{let r=t;return n={type:`doctype`},XX(e,r,n),n}case`#text`:{let r=t;return n={type:`text`,value:r.value},XX(e,r,n),n}default:return n=YX(e,t),n}}function JX(e,t){let n=-1,r=[];for(;++n<t.length;){let i=qX(e,t[n]);r.push(i)}return r}function YX(e,t){let n=e.schema;e.schema=t.namespaceURI===UX.svg?EX:TX;let r=-1,i={};for(;++r<t.attrs.length;){let e=t.attrs[r],n=(e.prefix?e.prefix+`:`:``)+e.name;WX.call(GX,n)||(i[n]=e.value)}let a=(e.schema.space===`svg`?BX:zX)(t.tagName,i,JX(e,t.childNodes));if(XX(e,t,a),a.tagName===`template`){let n=t,r=n.sourceCodeLocation,i=r&&r.startTag&&QX(r.startTag),o=r&&r.endTag&&QX(r.endTag),s=qX(e,n.content);i&&o&&e.file&&(s.position={start:i.end,end:o.start}),a.content=s}return e.schema=n,a}function XX(e,t,n){if(`sourceCodeLocation`in t&&t.sourceCodeLocation&&e.file){let r=ZX(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function ZX(e,t,n){let r=QX(n);if(t.type===`element`){let i=t.children[t.children.length-1];if(r&&!n.endTag&&i&&i.position&&i.position.end&&(r.end=Object.assign({},i.position.end)),e.verbose){let r={},i;if(n.attrs)for(i in n.attrs)WX.call(n.attrs,i)&&(r[SX(e.schema,i).property]=QX(n.attrs[i]));n.startTag;let a=QX(n.startTag),o=n.endTag?QX(n.endTag):void 0,s={opening:a};o&&(s.closing=o),s.properties=r,t.data={position:s}}}return r}function QX(e){let t=$X({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=$X({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function $X(e){return e.line&&e.column?e:void 0}const eZ=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]);var K;(function(e){e[e.EOF=-1]=`EOF`,e[e.NULL=0]=`NULL`,e[e.TABULATION=9]=`TABULATION`,e[e.CARRIAGE_RETURN=13]=`CARRIAGE_RETURN`,e[e.LINE_FEED=10]=`LINE_FEED`,e[e.FORM_FEED=12]=`FORM_FEED`,e[e.SPACE=32]=`SPACE`,e[e.EXCLAMATION_MARK=33]=`EXCLAMATION_MARK`,e[e.QUOTATION_MARK=34]=`QUOTATION_MARK`,e[e.AMPERSAND=38]=`AMPERSAND`,e[e.APOSTROPHE=39]=`APOSTROPHE`,e[e.HYPHEN_MINUS=45]=`HYPHEN_MINUS`,e[e.SOLIDUS=47]=`SOLIDUS`,e[e.DIGIT_0=48]=`DIGIT_0`,e[e.DIGIT_9=57]=`DIGIT_9`,e[e.SEMICOLON=59]=`SEMICOLON`,e[e.LESS_THAN_SIGN=60]=`LESS_THAN_SIGN`,e[e.EQUALS_SIGN=61]=`EQUALS_SIGN`,e[e.GREATER_THAN_SIGN=62]=`GREATER_THAN_SIGN`,e[e.QUESTION_MARK=63]=`QUESTION_MARK`,e[e.LATIN_CAPITAL_A=65]=`LATIN_CAPITAL_A`,e[e.LATIN_CAPITAL_Z=90]=`LATIN_CAPITAL_Z`,e[e.RIGHT_SQUARE_BRACKET=93]=`RIGHT_SQUARE_BRACKET`,e[e.GRAVE_ACCENT=96]=`GRAVE_ACCENT`,e[e.LATIN_SMALL_A=97]=`LATIN_SMALL_A`,e[e.LATIN_SMALL_Z=122]=`LATIN_SMALL_Z`})(K||={});const tZ={DASH_DASH:`--`,CDATA_START:`[CDATA[`,DOCTYPE:`doctype`,SCRIPT:`script`,PUBLIC:`public`,SYSTEM:`system`};function nZ(e){return e>=55296&&e<=57343}function rZ(e){return e>=56320&&e<=57343}function iZ(e,t){return(e-55296)*1024+9216+t}function aZ(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function oZ(e){return e>=64976&&e<=65007||eZ.has(e)}var q;(function(e){e.controlCharacterInInputStream=`control-character-in-input-stream`,e.noncharacterInInputStream=`noncharacter-in-input-stream`,e.surrogateInInputStream=`surrogate-in-input-stream`,e.nonVoidHtmlElementStartTagWithTrailingSolidus=`non-void-html-element-start-tag-with-trailing-solidus`,e.endTagWithAttributes=`end-tag-with-attributes`,e.endTagWithTrailingSolidus=`end-tag-with-trailing-solidus`,e.unexpectedSolidusInTag=`unexpected-solidus-in-tag`,e.unexpectedNullCharacter=`unexpected-null-character`,e.unexpectedQuestionMarkInsteadOfTagName=`unexpected-question-mark-instead-of-tag-name`,e.invalidFirstCharacterOfTagName=`invalid-first-character-of-tag-name`,e.unexpectedEqualsSignBeforeAttributeName=`unexpected-equals-sign-before-attribute-name`,e.missingEndTagName=`missing-end-tag-name`,e.unexpectedCharacterInAttributeName=`unexpected-character-in-attribute-name`,e.unknownNamedCharacterReference=`unknown-named-character-reference`,e.missingSemicolonAfterCharacterReference=`missing-semicolon-after-character-reference`,e.unexpectedCharacterAfterDoctypeSystemIdentifier=`unexpected-character-after-doctype-system-identifier`,e.unexpectedCharacterInUnquotedAttributeValue=`unexpected-character-in-unquoted-attribute-value`,e.eofBeforeTagName=`eof-before-tag-name`,e.eofInTag=`eof-in-tag`,e.missingAttributeValue=`missing-attribute-value`,e.missingWhitespaceBetweenAttributes=`missing-whitespace-between-attributes`,e.missingWhitespaceAfterDoctypePublicKeyword=`missing-whitespace-after-doctype-public-keyword`,e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers=`missing-whitespace-between-doctype-public-and-system-identifiers`,e.missingWhitespaceAfterDoctypeSystemKeyword=`missing-whitespace-after-doctype-system-keyword`,e.missingQuoteBeforeDoctypePublicIdentifier=`missing-quote-before-doctype-public-identifier`,e.missingQuoteBeforeDoctypeSystemIdentifier=`missing-quote-before-doctype-system-identifier`,e.missingDoctypePublicIdentifier=`missing-doctype-public-identifier`,e.missingDoctypeSystemIdentifier=`missing-doctype-system-identifier`,e.abruptDoctypePublicIdentifier=`abrupt-doctype-public-identifier`,e.abruptDoctypeSystemIdentifier=`abrupt-doctype-system-identifier`,e.cdataInHtmlContent=`cdata-in-html-content`,e.incorrectlyOpenedComment=`incorrectly-opened-comment`,e.eofInScriptHtmlCommentLikeText=`eof-in-script-html-comment-like-text`,e.eofInDoctype=`eof-in-doctype`,e.nestedComment=`nested-comment`,e.abruptClosingOfEmptyComment=`abrupt-closing-of-empty-comment`,e.eofInComment=`eof-in-comment`,e.incorrectlyClosedComment=`incorrectly-closed-comment`,e.eofInCdata=`eof-in-cdata`,e.absenceOfDigitsInNumericCharacterReference=`absence-of-digits-in-numeric-character-reference`,e.nullCharacterReference=`null-character-reference`,e.surrogateCharacterReference=`surrogate-character-reference`,e.characterReferenceOutsideUnicodeRange=`character-reference-outside-unicode-range`,e.controlCharacterReference=`control-character-reference`,e.noncharacterCharacterReference=`noncharacter-character-reference`,e.missingWhitespaceBeforeDoctypeName=`missing-whitespace-before-doctype-name`,e.missingDoctypeName=`missing-doctype-name`,e.invalidCharacterSequenceAfterDoctypeName=`invalid-character-sequence-after-doctype-name`,e.duplicateAttribute=`duplicate-attribute`,e.nonConformingDoctype=`non-conforming-doctype`,e.missingDoctype=`missing-doctype`,e.misplacedDoctype=`misplaced-doctype`,e.endTagWithoutMatchingOpenElement=`end-tag-without-matching-open-element`,e.closingOfElementWithOpenChildElements=`closing-of-element-with-open-child-elements`,e.disallowedContentInNoscriptInHead=`disallowed-content-in-noscript-in-head`,e.openElementsLeftAfterEof=`open-elements-left-after-eof`,e.abandonedHeadElementChild=`abandoned-head-element-child`,e.misplacedStartTagForHeadElement=`misplaced-start-tag-for-head-element`,e.nestedNoscriptInHead=`nested-noscript-in-head`,e.eofInElementThatCanContainOnlyText=`eof-in-element-that-can-contain-only-text`})(q||={});var sZ=class{constructor(e){this.handler=e,this.html=``,this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=65536,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+Number(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(e,t){let{line:n,col:r,offset:i}=this,a=r+t,o=i+t;return{code:e,startLine:n,endLine:n,startCol:a,endCol:a,startOffset:o,endOffset:o}}_err(e){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(e,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(e){if(this.pos!==this.html.length-1){let t=this.html.charCodeAt(this.pos+1);if(rZ(t))return this.pos++,this._addGap(),iZ(e,t)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,K.EOF;return this._err(q.surrogateInInputStream),e}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(e,t){this.html.length>0?this.html+=e:this.html=e,this.endOfChunkHit=!1,this.lastChunkWritten=t}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(e,t){if(this.pos+e.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(t)return this.html.startsWith(e,this.pos);for(let t=0;t<e.length;t++)if((this.html.charCodeAt(this.pos+t)|32)!==e.charCodeAt(t))return!1;return!0}peek(e){let t=this.pos+e;if(t>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,K.EOF;let n=this.html.charCodeAt(t);return n===K.CARRIAGE_RETURN?K.LINE_FEED:n}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,K.EOF;let e=this.html.charCodeAt(this.pos);return e===K.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,K.LINE_FEED):e===K.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,nZ(e)&&(e=this._processSurrogate(e)),this.handler.onParseError===null||e>31&&e<127||e===K.LINE_FEED||e===K.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){aZ(e)?this._err(q.controlCharacterInInputStream):oZ(e)&&this._err(q.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}},cZ;(function(e){e[e.CHARACTER=0]=`CHARACTER`,e[e.NULL_CHARACTER=1]=`NULL_CHARACTER`,e[e.WHITESPACE_CHARACTER=2]=`WHITESPACE_CHARACTER`,e[e.START_TAG=3]=`START_TAG`,e[e.END_TAG=4]=`END_TAG`,e[e.COMMENT=5]=`COMMENT`,e[e.DOCTYPE=6]=`DOCTYPE`,e[e.EOF=7]=`EOF`,e[e.HIBERNATION=8]=`HIBERNATION`})(cZ||={});function lZ(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}const uZ=new Uint16Array(`ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻\xA0ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌`.split(``).map(e=>e.charCodeAt(0))),dZ=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);String.fromCodePoint;function fZ(e){return e>=55296&&e<=57343||e>1114111?65533:dZ.get(e)??e}var pZ;(function(e){e[e.NUM=35]=`NUM`,e[e.SEMI=59]=`SEMI`,e[e.EQUALS=61]=`EQUALS`,e[e.ZERO=48]=`ZERO`,e[e.NINE=57]=`NINE`,e[e.LOWER_A=97]=`LOWER_A`,e[e.LOWER_F=102]=`LOWER_F`,e[e.LOWER_X=120]=`LOWER_X`,e[e.LOWER_Z=122]=`LOWER_Z`,e[e.UPPER_A=65]=`UPPER_A`,e[e.UPPER_F=70]=`UPPER_F`,e[e.UPPER_Z=90]=`UPPER_Z`})(pZ||={});var mZ;(function(e){e[e.VALUE_LENGTH=49152]=`VALUE_LENGTH`,e[e.BRANCH_LENGTH=16256]=`BRANCH_LENGTH`,e[e.JUMP_TABLE=127]=`JUMP_TABLE`})(mZ||={});function hZ(e){return e>=pZ.ZERO&&e<=pZ.NINE}function gZ(e){return e>=pZ.UPPER_A&&e<=pZ.UPPER_F||e>=pZ.LOWER_A&&e<=pZ.LOWER_F}function _Z(e){return e>=pZ.UPPER_A&&e<=pZ.UPPER_Z||e>=pZ.LOWER_A&&e<=pZ.LOWER_Z||hZ(e)}function vZ(e){return e===pZ.EQUALS||_Z(e)}var yZ;(function(e){e[e.EntityStart=0]=`EntityStart`,e[e.NumericStart=1]=`NumericStart`,e[e.NumericDecimal=2]=`NumericDecimal`,e[e.NumericHex=3]=`NumericHex`,e[e.NamedEntity=4]=`NamedEntity`})(yZ||={});var bZ;(function(e){e[e.Legacy=0]=`Legacy`,e[e.Strict=1]=`Strict`,e[e.Attribute=2]=`Attribute`})(bZ||={});var xZ=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=yZ.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=bZ.Strict}startEntity(e){this.decodeMode=e,this.state=yZ.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case yZ.EntityStart:return e.charCodeAt(t)===pZ.NUM?(this.state=yZ.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=yZ.NamedEntity,this.stateNamedEntity(e,t));case yZ.NumericStart:return this.stateNumericStart(e,t);case yZ.NumericDecimal:return this.stateNumericDecimal(e,t);case yZ.NumericHex:return this.stateNumericHex(e,t);case yZ.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|32)===pZ.LOWER_X?(this.state=yZ.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=yZ.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,r){if(t!==n){let i=n-t;this.result=this.result*r**+i+Number.parseInt(e.substr(t,i),r),this.consumed+=i}}stateNumericHex(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(hZ(r)||gZ(r))t+=1;else return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(r,3)}return this.addToNumericResult(e,n,t,16),-1}stateNumericDecimal(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(hZ(r))t+=1;else return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(r,2)}return this.addToNumericResult(e,n,t,10),-1}emitNumericEntity(e,t){var n;if(this.consumed<=t)return(n=this.errors)==null||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===pZ.SEMI)this.consumed+=1;else if(this.decodeMode===bZ.Strict)return 0;return this.emitCodePoint(fZ(this.result),this.consumed),this.errors&&(e!==pZ.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){let{decodeTree:n}=this,r=n[this.treeIndex],i=(r&mZ.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){let a=e.charCodeAt(t);if(this.treeIndex=SZ(n,r,this.treeIndex+Math.max(1,i),a),this.treeIndex<0)return this.result===0||this.decodeMode===bZ.Attribute&&(i===0||vZ(a))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],i=(r&mZ.VALUE_LENGTH)>>14,i!==0){if(a===pZ.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==bZ.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;let{result:t,decodeTree:n}=this,r=(n[t]&mZ.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,r,this.consumed),(e=this.errors)==null||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){let{decodeTree:r}=this;return this.emitCodePoint(t===1?r[e]&~mZ.VALUE_LENGTH:r[e+1],n),t===3&&this.emitCodePoint(r[e+2],n),n}end(){var e;switch(this.state){case yZ.NamedEntity:return this.result!==0&&(this.decodeMode!==bZ.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case yZ.NumericDecimal:return this.emitNumericEntity(0,2);case yZ.NumericHex:return this.emitNumericEntity(0,3);case yZ.NumericStart:return(e=this.errors)==null||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case yZ.EntityStart:return 0}}};function SZ(e,t,n,r){let i=(t&mZ.BRANCH_LENGTH)>>7,a=t&mZ.JUMP_TABLE;if(i===0)return a!==0&&r===a?n:-1;if(a){let t=r-a;return t<0||t>=i?-1:e[n+t]-1}let o=n,s=o+i-1;for(;o<=s;){let t=o+s>>>1,n=e[t];if(n<r)o=t+1;else if(n>r)s=t-1;else return e[t+i]}return-1}var J;(function(e){e.HTML=`http://www.w3.org/1999/xhtml`,e.MATHML=`http://www.w3.org/1998/Math/MathML`,e.SVG=`http://www.w3.org/2000/svg`,e.XLINK=`http://www.w3.org/1999/xlink`,e.XML=`http://www.w3.org/XML/1998/namespace`,e.XMLNS=`http://www.w3.org/2000/xmlns/`})(J||={});var CZ;(function(e){e.TYPE=`type`,e.ACTION=`action`,e.ENCODING=`encoding`,e.PROMPT=`prompt`,e.NAME=`name`,e.COLOR=`color`,e.FACE=`face`,e.SIZE=`size`})(CZ||={});var wZ;(function(e){e.NO_QUIRKS=`no-quirks`,e.QUIRKS=`quirks`,e.LIMITED_QUIRKS=`limited-quirks`})(wZ||={});var Y;(function(e){e.A=`a`,e.ADDRESS=`address`,e.ANNOTATION_XML=`annotation-xml`,e.APPLET=`applet`,e.AREA=`area`,e.ARTICLE=`article`,e.ASIDE=`aside`,e.B=`b`,e.BASE=`base`,e.BASEFONT=`basefont`,e.BGSOUND=`bgsound`,e.BIG=`big`,e.BLOCKQUOTE=`blockquote`,e.BODY=`body`,e.BR=`br`,e.BUTTON=`button`,e.CAPTION=`caption`,e.CENTER=`center`,e.CODE=`code`,e.COL=`col`,e.COLGROUP=`colgroup`,e.DD=`dd`,e.DESC=`desc`,e.DETAILS=`details`,e.DIALOG=`dialog`,e.DIR=`dir`,e.DIV=`div`,e.DL=`dl`,e.DT=`dt`,e.EM=`em`,e.EMBED=`embed`,e.FIELDSET=`fieldset`,e.FIGCAPTION=`figcaption`,e.FIGURE=`figure`,e.FONT=`font`,e.FOOTER=`footer`,e.FOREIGN_OBJECT=`foreignObject`,e.FORM=`form`,e.FRAME=`frame`,e.FRAMESET=`frameset`,e.H1=`h1`,e.H2=`h2`,e.H3=`h3`,e.H4=`h4`,e.H5=`h5`,e.H6=`h6`,e.HEAD=`head`,e.HEADER=`header`,e.HGROUP=`hgroup`,e.HR=`hr`,e.HTML=`html`,e.I=`i`,e.IMG=`img`,e.IMAGE=`image`,e.INPUT=`input`,e.IFRAME=`iframe`,e.KEYGEN=`keygen`,e.LABEL=`label`,e.LI=`li`,e.LINK=`link`,e.LISTING=`listing`,e.MAIN=`main`,e.MALIGNMARK=`malignmark`,e.MARQUEE=`marquee`,e.MATH=`math`,e.MENU=`menu`,e.META=`meta`,e.MGLYPH=`mglyph`,e.MI=`mi`,e.MO=`mo`,e.MN=`mn`,e.MS=`ms`,e.MTEXT=`mtext`,e.NAV=`nav`,e.NOBR=`nobr`,e.NOFRAMES=`noframes`,e.NOEMBED=`noembed`,e.NOSCRIPT=`noscript`,e.OBJECT=`object`,e.OL=`ol`,e.OPTGROUP=`optgroup`,e.OPTION=`option`,e.P=`p`,e.PARAM=`param`,e.PLAINTEXT=`plaintext`,e.PRE=`pre`,e.RB=`rb`,e.RP=`rp`,e.RT=`rt`,e.RTC=`rtc`,e.RUBY=`ruby`,e.S=`s`,e.SCRIPT=`script`,e.SEARCH=`search`,e.SECTION=`section`,e.SELECT=`select`,e.SOURCE=`source`,e.SMALL=`small`,e.SPAN=`span`,e.STRIKE=`strike`,e.STRONG=`strong`,e.STYLE=`style`,e.SUB=`sub`,e.SUMMARY=`summary`,e.SUP=`sup`,e.TABLE=`table`,e.TBODY=`tbody`,e.TEMPLATE=`template`,e.TEXTAREA=`textarea`,e.TFOOT=`tfoot`,e.TD=`td`,e.TH=`th`,e.THEAD=`thead`,e.TITLE=`title`,e.TR=`tr`,e.TRACK=`track`,e.TT=`tt`,e.U=`u`,e.UL=`ul`,e.SVG=`svg`,e.VAR=`var`,e.WBR=`wbr`,e.XMP=`xmp`})(Y||={});var X;(function(e){e[e.UNKNOWN=0]=`UNKNOWN`,e[e.A=1]=`A`,e[e.ADDRESS=2]=`ADDRESS`,e[e.ANNOTATION_XML=3]=`ANNOTATION_XML`,e[e.APPLET=4]=`APPLET`,e[e.AREA=5]=`AREA`,e[e.ARTICLE=6]=`ARTICLE`,e[e.ASIDE=7]=`ASIDE`,e[e.B=8]=`B`,e[e.BASE=9]=`BASE`,e[e.BASEFONT=10]=`BASEFONT`,e[e.BGSOUND=11]=`BGSOUND`,e[e.BIG=12]=`BIG`,e[e.BLOCKQUOTE=13]=`BLOCKQUOTE`,e[e.BODY=14]=`BODY`,e[e.BR=15]=`BR`,e[e.BUTTON=16]=`BUTTON`,e[e.CAPTION=17]=`CAPTION`,e[e.CENTER=18]=`CENTER`,e[e.CODE=19]=`CODE`,e[e.COL=20]=`COL`,e[e.COLGROUP=21]=`COLGROUP`,e[e.DD=22]=`DD`,e[e.DESC=23]=`DESC`,e[e.DETAILS=24]=`DETAILS`,e[e.DIALOG=25]=`DIALOG`,e[e.DIR=26]=`DIR`,e[e.DIV=27]=`DIV`,e[e.DL=28]=`DL`,e[e.DT=29]=`DT`,e[e.EM=30]=`EM`,e[e.EMBED=31]=`EMBED`,e[e.FIELDSET=32]=`FIELDSET`,e[e.FIGCAPTION=33]=`FIGCAPTION`,e[e.FIGURE=34]=`FIGURE`,e[e.FONT=35]=`FONT`,e[e.FOOTER=36]=`FOOTER`,e[e.FOREIGN_OBJECT=37]=`FOREIGN_OBJECT`,e[e.FORM=38]=`FORM`,e[e.FRAME=39]=`FRAME`,e[e.FRAMESET=40]=`FRAMESET`,e[e.H1=41]=`H1`,e[e.H2=42]=`H2`,e[e.H3=43]=`H3`,e[e.H4=44]=`H4`,e[e.H5=45]=`H5`,e[e.H6=46]=`H6`,e[e.HEAD=47]=`HEAD`,e[e.HEADER=48]=`HEADER`,e[e.HGROUP=49]=`HGROUP`,e[e.HR=50]=`HR`,e[e.HTML=51]=`HTML`,e[e.I=52]=`I`,e[e.IMG=53]=`IMG`,e[e.IMAGE=54]=`IMAGE`,e[e.INPUT=55]=`INPUT`,e[e.IFRAME=56]=`IFRAME`,e[e.KEYGEN=57]=`KEYGEN`,e[e.LABEL=58]=`LABEL`,e[e.LI=59]=`LI`,e[e.LINK=60]=`LINK`,e[e.LISTING=61]=`LISTING`,e[e.MAIN=62]=`MAIN`,e[e.MALIGNMARK=63]=`MALIGNMARK`,e[e.MARQUEE=64]=`MARQUEE`,e[e.MATH=65]=`MATH`,e[e.MENU=66]=`MENU`,e[e.META=67]=`META`,e[e.MGLYPH=68]=`MGLYPH`,e[e.MI=69]=`MI`,e[e.MO=70]=`MO`,e[e.MN=71]=`MN`,e[e.MS=72]=`MS`,e[e.MTEXT=73]=`MTEXT`,e[e.NAV=74]=`NAV`,e[e.NOBR=75]=`NOBR`,e[e.NOFRAMES=76]=`NOFRAMES`,e[e.NOEMBED=77]=`NOEMBED`,e[e.NOSCRIPT=78]=`NOSCRIPT`,e[e.OBJECT=79]=`OBJECT`,e[e.OL=80]=`OL`,e[e.OPTGROUP=81]=`OPTGROUP`,e[e.OPTION=82]=`OPTION`,e[e.P=83]=`P`,e[e.PARAM=84]=`PARAM`,e[e.PLAINTEXT=85]=`PLAINTEXT`,e[e.PRE=86]=`PRE`,e[e.RB=87]=`RB`,e[e.RP=88]=`RP`,e[e.RT=89]=`RT`,e[e.RTC=90]=`RTC`,e[e.RUBY=91]=`RUBY`,e[e.S=92]=`S`,e[e.SCRIPT=93]=`SCRIPT`,e[e.SEARCH=94]=`SEARCH`,e[e.SECTION=95]=`SECTION`,e[e.SELECT=96]=`SELECT`,e[e.SOURCE=97]=`SOURCE`,e[e.SMALL=98]=`SMALL`,e[e.SPAN=99]=`SPAN`,e[e.STRIKE=100]=`STRIKE`,e[e.STRONG=101]=`STRONG`,e[e.STYLE=102]=`STYLE`,e[e.SUB=103]=`SUB`,e[e.SUMMARY=104]=`SUMMARY`,e[e.SUP=105]=`SUP`,e[e.TABLE=106]=`TABLE`,e[e.TBODY=107]=`TBODY`,e[e.TEMPLATE=108]=`TEMPLATE`,e[e.TEXTAREA=109]=`TEXTAREA`,e[e.TFOOT=110]=`TFOOT`,e[e.TD=111]=`TD`,e[e.TH=112]=`TH`,e[e.THEAD=113]=`THEAD`,e[e.TITLE=114]=`TITLE`,e[e.TR=115]=`TR`,e[e.TRACK=116]=`TRACK`,e[e.TT=117]=`TT`,e[e.U=118]=`U`,e[e.UL=119]=`UL`,e[e.SVG=120]=`SVG`,e[e.VAR=121]=`VAR`,e[e.WBR=122]=`WBR`,e[e.XMP=123]=`XMP`})(X||={});const TZ=new Map([[Y.A,X.A],[Y.ADDRESS,X.ADDRESS],[Y.ANNOTATION_XML,X.ANNOTATION_XML],[Y.APPLET,X.APPLET],[Y.AREA,X.AREA],[Y.ARTICLE,X.ARTICLE],[Y.ASIDE,X.ASIDE],[Y.B,X.B],[Y.BASE,X.BASE],[Y.BASEFONT,X.BASEFONT],[Y.BGSOUND,X.BGSOUND],[Y.BIG,X.BIG],[Y.BLOCKQUOTE,X.BLOCKQUOTE],[Y.BODY,X.BODY],[Y.BR,X.BR],[Y.BUTTON,X.BUTTON],[Y.CAPTION,X.CAPTION],[Y.CENTER,X.CENTER],[Y.CODE,X.CODE],[Y.COL,X.COL],[Y.COLGROUP,X.COLGROUP],[Y.DD,X.DD],[Y.DESC,X.DESC],[Y.DETAILS,X.DETAILS],[Y.DIALOG,X.DIALOG],[Y.DIR,X.DIR],[Y.DIV,X.DIV],[Y.DL,X.DL],[Y.DT,X.DT],[Y.EM,X.EM],[Y.EMBED,X.EMBED],[Y.FIELDSET,X.FIELDSET],[Y.FIGCAPTION,X.FIGCAPTION],[Y.FIGURE,X.FIGURE],[Y.FONT,X.FONT],[Y.FOOTER,X.FOOTER],[Y.FOREIGN_OBJECT,X.FOREIGN_OBJECT],[Y.FORM,X.FORM],[Y.FRAME,X.FRAME],[Y.FRAMESET,X.FRAMESET],[Y.H1,X.H1],[Y.H2,X.H2],[Y.H3,X.H3],[Y.H4,X.H4],[Y.H5,X.H5],[Y.H6,X.H6],[Y.HEAD,X.HEAD],[Y.HEADER,X.HEADER],[Y.HGROUP,X.HGROUP],[Y.HR,X.HR],[Y.HTML,X.HTML],[Y.I,X.I],[Y.IMG,X.IMG],[Y.IMAGE,X.IMAGE],[Y.INPUT,X.INPUT],[Y.IFRAME,X.IFRAME],[Y.KEYGEN,X.KEYGEN],[Y.LABEL,X.LABEL],[Y.LI,X.LI],[Y.LINK,X.LINK],[Y.LISTING,X.LISTING],[Y.MAIN,X.MAIN],[Y.MALIGNMARK,X.MALIGNMARK],[Y.MARQUEE,X.MARQUEE],[Y.MATH,X.MATH],[Y.MENU,X.MENU],[Y.META,X.META],[Y.MGLYPH,X.MGLYPH],[Y.MI,X.MI],[Y.MO,X.MO],[Y.MN,X.MN],[Y.MS,X.MS],[Y.MTEXT,X.MTEXT],[Y.NAV,X.NAV],[Y.NOBR,X.NOBR],[Y.NOFRAMES,X.NOFRAMES],[Y.NOEMBED,X.NOEMBED],[Y.NOSCRIPT,X.NOSCRIPT],[Y.OBJECT,X.OBJECT],[Y.OL,X.OL],[Y.OPTGROUP,X.OPTGROUP],[Y.OPTION,X.OPTION],[Y.P,X.P],[Y.PARAM,X.PARAM],[Y.PLAINTEXT,X.PLAINTEXT],[Y.PRE,X.PRE],[Y.RB,X.RB],[Y.RP,X.RP],[Y.RT,X.RT],[Y.RTC,X.RTC],[Y.RUBY,X.RUBY],[Y.S,X.S],[Y.SCRIPT,X.SCRIPT],[Y.SEARCH,X.SEARCH],[Y.SECTION,X.SECTION],[Y.SELECT,X.SELECT],[Y.SOURCE,X.SOURCE],[Y.SMALL,X.SMALL],[Y.SPAN,X.SPAN],[Y.STRIKE,X.STRIKE],[Y.STRONG,X.STRONG],[Y.STYLE,X.STYLE],[Y.SUB,X.SUB],[Y.SUMMARY,X.SUMMARY],[Y.SUP,X.SUP],[Y.TABLE,X.TABLE],[Y.TBODY,X.TBODY],[Y.TEMPLATE,X.TEMPLATE],[Y.TEXTAREA,X.TEXTAREA],[Y.TFOOT,X.TFOOT],[Y.TD,X.TD],[Y.TH,X.TH],[Y.THEAD,X.THEAD],[Y.TITLE,X.TITLE],[Y.TR,X.TR],[Y.TRACK,X.TRACK],[Y.TT,X.TT],[Y.U,X.U],[Y.UL,X.UL],[Y.SVG,X.SVG],[Y.VAR,X.VAR],[Y.WBR,X.WBR],[Y.XMP,X.XMP]]);function EZ(e){return TZ.get(e)??X.UNKNOWN}const Z=X,DZ={[J.HTML]:new Set([Z.ADDRESS,Z.APPLET,Z.AREA,Z.ARTICLE,Z.ASIDE,Z.BASE,Z.BASEFONT,Z.BGSOUND,Z.BLOCKQUOTE,Z.BODY,Z.BR,Z.BUTTON,Z.CAPTION,Z.CENTER,Z.COL,Z.COLGROUP,Z.DD,Z.DETAILS,Z.DIR,Z.DIV,Z.DL,Z.DT,Z.EMBED,Z.FIELDSET,Z.FIGCAPTION,Z.FIGURE,Z.FOOTER,Z.FORM,Z.FRAME,Z.FRAMESET,Z.H1,Z.H2,Z.H3,Z.H4,Z.H5,Z.H6,Z.HEAD,Z.HEADER,Z.HGROUP,Z.HR,Z.HTML,Z.IFRAME,Z.IMG,Z.INPUT,Z.LI,Z.LINK,Z.LISTING,Z.MAIN,Z.MARQUEE,Z.MENU,Z.META,Z.NAV,Z.NOEMBED,Z.NOFRAMES,Z.NOSCRIPT,Z.OBJECT,Z.OL,Z.P,Z.PARAM,Z.PLAINTEXT,Z.PRE,Z.SCRIPT,Z.SECTION,Z.SELECT,Z.SOURCE,Z.STYLE,Z.SUMMARY,Z.TABLE,Z.TBODY,Z.TD,Z.TEMPLATE,Z.TEXTAREA,Z.TFOOT,Z.TH,Z.THEAD,Z.TITLE,Z.TR,Z.TRACK,Z.UL,Z.WBR,Z.XMP]),[J.MATHML]:new Set([Z.MI,Z.MO,Z.MN,Z.MS,Z.MTEXT,Z.ANNOTATION_XML]),[J.SVG]:new Set([Z.TITLE,Z.FOREIGN_OBJECT,Z.DESC]),[J.XLINK]:new Set,[J.XML]:new Set,[J.XMLNS]:new Set},OZ=new Set([Z.H1,Z.H2,Z.H3,Z.H4,Z.H5,Z.H6]);Y.STYLE,Y.SCRIPT,Y.XMP,Y.IFRAME,Y.NOEMBED,Y.NOFRAMES,Y.PLAINTEXT;var Q;(function(e){e[e.DATA=0]=`DATA`,e[e.RCDATA=1]=`RCDATA`,e[e.RAWTEXT=2]=`RAWTEXT`,e[e.SCRIPT_DATA=3]=`SCRIPT_DATA`,e[e.PLAINTEXT=4]=`PLAINTEXT`,e[e.TAG_OPEN=5]=`TAG_OPEN`,e[e.END_TAG_OPEN=6]=`END_TAG_OPEN`,e[e.TAG_NAME=7]=`TAG_NAME`,e[e.RCDATA_LESS_THAN_SIGN=8]=`RCDATA_LESS_THAN_SIGN`,e[e.RCDATA_END_TAG_OPEN=9]=`RCDATA_END_TAG_OPEN`,e[e.RCDATA_END_TAG_NAME=10]=`RCDATA_END_TAG_NAME`,e[e.RAWTEXT_LESS_THAN_SIGN=11]=`RAWTEXT_LESS_THAN_SIGN`,e[e.RAWTEXT_END_TAG_OPEN=12]=`RAWTEXT_END_TAG_OPEN`,e[e.RAWTEXT_END_TAG_NAME=13]=`RAWTEXT_END_TAG_NAME`,e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]=`SCRIPT_DATA_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_END_TAG_OPEN=15]=`SCRIPT_DATA_END_TAG_OPEN`,e[e.SCRIPT_DATA_END_TAG_NAME=16]=`SCRIPT_DATA_END_TAG_NAME`,e[e.SCRIPT_DATA_ESCAPE_START=17]=`SCRIPT_DATA_ESCAPE_START`,e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]=`SCRIPT_DATA_ESCAPE_START_DASH`,e[e.SCRIPT_DATA_ESCAPED=19]=`SCRIPT_DATA_ESCAPED`,e[e.SCRIPT_DATA_ESCAPED_DASH=20]=`SCRIPT_DATA_ESCAPED_DASH`,e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]=`SCRIPT_DATA_ESCAPED_DASH_DASH`,e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]=`SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]=`SCRIPT_DATA_ESCAPED_END_TAG_OPEN`,e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]=`SCRIPT_DATA_ESCAPED_END_TAG_NAME`,e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]=`SCRIPT_DATA_DOUBLE_ESCAPE_START`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]=`SCRIPT_DATA_DOUBLE_ESCAPED`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]=`SCRIPT_DATA_DOUBLE_ESCAPED_DASH`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]=`SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]=`SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]=`SCRIPT_DATA_DOUBLE_ESCAPE_END`,e[e.BEFORE_ATTRIBUTE_NAME=31]=`BEFORE_ATTRIBUTE_NAME`,e[e.ATTRIBUTE_NAME=32]=`ATTRIBUTE_NAME`,e[e.AFTER_ATTRIBUTE_NAME=33]=`AFTER_ATTRIBUTE_NAME`,e[e.BEFORE_ATTRIBUTE_VALUE=34]=`BEFORE_ATTRIBUTE_VALUE`,e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]=`ATTRIBUTE_VALUE_DOUBLE_QUOTED`,e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]=`ATTRIBUTE_VALUE_SINGLE_QUOTED`,e[e.ATTRIBUTE_VALUE_UNQUOTED=37]=`ATTRIBUTE_VALUE_UNQUOTED`,e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]=`AFTER_ATTRIBUTE_VALUE_QUOTED`,e[e.SELF_CLOSING_START_TAG=39]=`SELF_CLOSING_START_TAG`,e[e.BOGUS_COMMENT=40]=`BOGUS_COMMENT`,e[e.MARKUP_DECLARATION_OPEN=41]=`MARKUP_DECLARATION_OPEN`,e[e.COMMENT_START=42]=`COMMENT_START`,e[e.COMMENT_START_DASH=43]=`COMMENT_START_DASH`,e[e.COMMENT=44]=`COMMENT`,e[e.COMMENT_LESS_THAN_SIGN=45]=`COMMENT_LESS_THAN_SIGN`,e[e.COMMENT_LESS_THAN_SIGN_BANG=46]=`COMMENT_LESS_THAN_SIGN_BANG`,e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]=`COMMENT_LESS_THAN_SIGN_BANG_DASH`,e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]=`COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH`,e[e.COMMENT_END_DASH=49]=`COMMENT_END_DASH`,e[e.COMMENT_END=50]=`COMMENT_END`,e[e.COMMENT_END_BANG=51]=`COMMENT_END_BANG`,e[e.DOCTYPE=52]=`DOCTYPE`,e[e.BEFORE_DOCTYPE_NAME=53]=`BEFORE_DOCTYPE_NAME`,e[e.DOCTYPE_NAME=54]=`DOCTYPE_NAME`,e[e.AFTER_DOCTYPE_NAME=55]=`AFTER_DOCTYPE_NAME`,e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]=`AFTER_DOCTYPE_PUBLIC_KEYWORD`,e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]=`BEFORE_DOCTYPE_PUBLIC_IDENTIFIER`,e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]=`DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED`,e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]=`DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED`,e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]=`AFTER_DOCTYPE_PUBLIC_IDENTIFIER`,e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]=`BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS`,e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]=`AFTER_DOCTYPE_SYSTEM_KEYWORD`,e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]=`BEFORE_DOCTYPE_SYSTEM_IDENTIFIER`,e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]=`DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED`,e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]=`DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED`,e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]=`AFTER_DOCTYPE_SYSTEM_IDENTIFIER`,e[e.BOGUS_DOCTYPE=67]=`BOGUS_DOCTYPE`,e[e.CDATA_SECTION=68]=`CDATA_SECTION`,e[e.CDATA_SECTION_BRACKET=69]=`CDATA_SECTION_BRACKET`,e[e.CDATA_SECTION_END=70]=`CDATA_SECTION_END`,e[e.CHARACTER_REFERENCE=71]=`CHARACTER_REFERENCE`,e[e.AMBIGUOUS_AMPERSAND=72]=`AMBIGUOUS_AMPERSAND`})(Q||={});const kZ={DATA:Q.DATA,RCDATA:Q.RCDATA,RAWTEXT:Q.RAWTEXT,SCRIPT_DATA:Q.SCRIPT_DATA,PLAINTEXT:Q.PLAINTEXT,CDATA_SECTION:Q.CDATA_SECTION};function AZ(e){return e>=K.DIGIT_0&&e<=K.DIGIT_9}function jZ(e){return e>=K.LATIN_CAPITAL_A&&e<=K.LATIN_CAPITAL_Z}function MZ(e){return e>=K.LATIN_SMALL_A&&e<=K.LATIN_SMALL_Z}function NZ(e){return MZ(e)||jZ(e)}function PZ(e){return NZ(e)||AZ(e)}function FZ(e){return e+32}function IZ(e){return e===K.SPACE||e===K.LINE_FEED||e===K.TABULATION||e===K.FORM_FEED}function LZ(e){return IZ(e)||e===K.SOLIDUS||e===K.GREATER_THAN_SIGN}function RZ(e){return e===K.NULL?q.nullCharacterReference:e>1114111?q.characterReferenceOutsideUnicodeRange:nZ(e)?q.surrogateCharacterReference:oZ(e)?q.noncharacterCharacterReference:aZ(e)||e===K.CARRIAGE_RETURN?q.controlCharacterReference:null}var zZ=class{constructor(e,t){this.options=e,this.handler=t,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName=``,this.active=!1,this.state=Q.DATA,this.returnState=Q.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:``,value:``},this.preprocessor=new sZ(t),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new xZ(uZ,(e,t)=>{this.preprocessor.pos=this.entityStartPos+t-1,this._flushCodePointConsumedAsCharacterReference(e)},t.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(q.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:e=>{this._err(q.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+e)},validateNumericCharacterReference:e=>{let t=RZ(e);t&&this._err(t,1)}}:void 0)}_err(e,t=0){var n,r;(r=(n=this.handler).onParseError)==null||r.call(n,this.preprocessor.getError(e,t))}getCurrentLocation(e){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-e,startOffset:this.preprocessor.offset-e,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;let e=this._consume();this._ensureHibernation()||this._callState(e)}this.inLoop=!1}}pause(){this.paused=!0}resume(e){if(!this.paused)throw Error(`Parser was already resumed`);this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||e?.())}write(e,t,n){this.active=!0,this.preprocessor.write(e,t),this._runParsingLoop(),this.paused||n?.()}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(e){this.consumedAfterSnapshot+=e;for(let t=0;t<e;t++)this.preprocessor.advance()}_consumeSequenceIfMatch(e,t){return this.preprocessor.startsWith(e,t)?(this._advanceBy(e.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:cZ.START_TAG,tagName:``,tagID:X.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:cZ.END_TAG,tagName:``,tagID:X.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(e){this.currentToken={type:cZ.COMMENT,data:``,location:this.getCurrentLocation(e)}}_createDoctypeToken(e){this.currentToken={type:cZ.DOCTYPE,name:e,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(e,t){this.currentCharacterToken={type:e,chars:t,location:this.currentLocation}}_createAttr(e){this.currentAttr={name:e,value:``},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var e;let t=this.currentToken;if(lZ(t,this.currentAttr.name)===null){if(t.attrs.push(this.currentAttr),t.location&&this.currentLocation){let n=(e=t.location).attrs??(e.attrs=Object.create(null));n[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(q.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(e){this._emitCurrentCharacterToken(e.location),this.currentToken=null,e.location&&(e.location.endLine=this.preprocessor.line,e.location.endCol=this.preprocessor.col+1,e.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){let e=this.currentToken;this.prepareToken(e),e.tagID=EZ(e.tagName),e.type===cZ.START_TAG?(this.lastStartTagName=e.tagName,this.handler.onStartTag(e)):(e.attrs.length>0&&this._err(q.endTagWithAttributes),e.selfClosing&&this._err(q.endTagWithTrailingSolidus),this.handler.onEndTag(e)),this.preprocessor.dropParsedChunk()}emitCurrentComment(e){this.prepareToken(e),this.handler.onComment(e),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(e){this.prepareToken(e),this.handler.onDoctype(e),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(e){if(this.currentCharacterToken){switch(e&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=e.startLine,this.currentCharacterToken.location.endCol=e.startCol,this.currentCharacterToken.location.endOffset=e.startOffset),this.currentCharacterToken.type){case cZ.CHARACTER:this.handler.onCharacter(this.currentCharacterToken);break;case cZ.NULL_CHARACTER:this.handler.onNullCharacter(this.currentCharacterToken);break;case cZ.WHITESPACE_CHARACTER:this.handler.onWhitespaceCharacter(this.currentCharacterToken)}this.currentCharacterToken=null}}_emitEOFToken(){let e=this.getCurrentLocation(0);e&&(e.endLine=e.startLine,e.endCol=e.startCol,e.endOffset=e.startOffset),this._emitCurrentCharacterToken(e),this.handler.onEof({type:cZ.EOF,location:e}),this.active=!1}_appendCharToCurrentCharacterToken(e,t){if(this.currentCharacterToken){if(this.currentCharacterToken.type===e){this.currentCharacterToken.chars+=t;return}this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk()}this._createCharacterToken(e,t)}_emitCodePoint(e){let t=IZ(e)?cZ.WHITESPACE_CHARACTER:e===K.NULL?cZ.NULL_CHARACTER:cZ.CHARACTER;this._appendCharToCurrentCharacterToken(t,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(cZ.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=Q.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?bZ.Attribute:bZ.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===Q.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===Q.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===Q.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case Q.DATA:this._stateData(e);break;case Q.RCDATA:this._stateRcdata(e);break;case Q.RAWTEXT:this._stateRawtext(e);break;case Q.SCRIPT_DATA:this._stateScriptData(e);break;case Q.PLAINTEXT:this._statePlaintext(e);break;case Q.TAG_OPEN:this._stateTagOpen(e);break;case Q.END_TAG_OPEN:this._stateEndTagOpen(e);break;case Q.TAG_NAME:this._stateTagName(e);break;case Q.RCDATA_LESS_THAN_SIGN:this._stateRcdataLessThanSign(e);break;case Q.RCDATA_END_TAG_OPEN:this._stateRcdataEndTagOpen(e);break;case Q.RCDATA_END_TAG_NAME:this._stateRcdataEndTagName(e);break;case Q.RAWTEXT_LESS_THAN_SIGN:this._stateRawtextLessThanSign(e);break;case Q.RAWTEXT_END_TAG_OPEN:this._stateRawtextEndTagOpen(e);break;case Q.RAWTEXT_END_TAG_NAME:this._stateRawtextEndTagName(e);break;case Q.SCRIPT_DATA_LESS_THAN_SIGN:this._stateScriptDataLessThanSign(e);break;case Q.SCRIPT_DATA_END_TAG_OPEN:this._stateScriptDataEndTagOpen(e);break;case Q.SCRIPT_DATA_END_TAG_NAME:this._stateScriptDataEndTagName(e);break;case Q.SCRIPT_DATA_ESCAPE_START:this._stateScriptDataEscapeStart(e);break;case Q.SCRIPT_DATA_ESCAPE_START_DASH:this._stateScriptDataEscapeStartDash(e);break;case Q.SCRIPT_DATA_ESCAPED:this._stateScriptDataEscaped(e);break;case Q.SCRIPT_DATA_ESCAPED_DASH:this._stateScriptDataEscapedDash(e);break;case Q.SCRIPT_DATA_ESCAPED_DASH_DASH:this._stateScriptDataEscapedDashDash(e);break;case Q.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataEscapedLessThanSign(e);break;case Q.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:this._stateScriptDataEscapedEndTagOpen(e);break;case Q.SCRIPT_DATA_ESCAPED_END_TAG_NAME:this._stateScriptDataEscapedEndTagName(e);break;case Q.SCRIPT_DATA_DOUBLE_ESCAPE_START:this._stateScriptDataDoubleEscapeStart(e);break;case Q.SCRIPT_DATA_DOUBLE_ESCAPED:this._stateScriptDataDoubleEscaped(e);break;case Q.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:this._stateScriptDataDoubleEscapedDash(e);break;case Q.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:this._stateScriptDataDoubleEscapedDashDash(e);break;case Q.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataDoubleEscapedLessThanSign(e);break;case Q.SCRIPT_DATA_DOUBLE_ESCAPE_END:this._stateScriptDataDoubleEscapeEnd(e);break;case Q.BEFORE_ATTRIBUTE_NAME:this._stateBeforeAttributeName(e);break;case Q.ATTRIBUTE_NAME:this._stateAttributeName(e);break;case Q.AFTER_ATTRIBUTE_NAME:this._stateAfterAttributeName(e);break;case Q.BEFORE_ATTRIBUTE_VALUE:this._stateBeforeAttributeValue(e);break;case Q.ATTRIBUTE_VALUE_DOUBLE_QUOTED:this._stateAttributeValueDoubleQuoted(e);break;case Q.ATTRIBUTE_VALUE_SINGLE_QUOTED:this._stateAttributeValueSingleQuoted(e);break;case Q.ATTRIBUTE_VALUE_UNQUOTED:this._stateAttributeValueUnquoted(e);break;case Q.AFTER_ATTRIBUTE_VALUE_QUOTED:this._stateAfterAttributeValueQuoted(e);break;case Q.SELF_CLOSING_START_TAG:this._stateSelfClosingStartTag(e);break;case Q.BOGUS_COMMENT:this._stateBogusComment(e);break;case Q.MARKUP_DECLARATION_OPEN:this._stateMarkupDeclarationOpen(e);break;case Q.COMMENT_START:this._stateCommentStart(e);break;case Q.COMMENT_START_DASH:this._stateCommentStartDash(e);break;case Q.COMMENT:this._stateComment(e);break;case Q.COMMENT_LESS_THAN_SIGN:this._stateCommentLessThanSign(e);break;case Q.COMMENT_LESS_THAN_SIGN_BANG:this._stateCommentLessThanSignBang(e);break;case Q.COMMENT_LESS_THAN_SIGN_BANG_DASH:this._stateCommentLessThanSignBangDash(e);break;case Q.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:this._stateCommentLessThanSignBangDashDash(e);break;case Q.COMMENT_END_DASH:this._stateCommentEndDash(e);break;case Q.COMMENT_END:this._stateCommentEnd(e);break;case Q.COMMENT_END_BANG:this._stateCommentEndBang(e);break;case Q.DOCTYPE:this._stateDoctype(e);break;case Q.BEFORE_DOCTYPE_NAME:this._stateBeforeDoctypeName(e);break;case Q.DOCTYPE_NAME:this._stateDoctypeName(e);break;case Q.AFTER_DOCTYPE_NAME:this._stateAfterDoctypeName(e);break;case Q.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._stateAfterDoctypePublicKeyword(e);break;case Q.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:this._stateBeforeDoctypePublicIdentifier(e);break;case Q.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypePublicIdentifierDoubleQuoted(e);break;case Q.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypePublicIdentifierSingleQuoted(e);break;case Q.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:this._stateAfterDoctypePublicIdentifier(e);break;case Q.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break;case Q.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._stateAfterDoctypeSystemKeyword(e);break;case Q.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:this._stateBeforeDoctypeSystemIdentifier(e);break;case Q.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypeSystemIdentifierDoubleQuoted(e);break;case Q.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypeSystemIdentifierSingleQuoted(e);break;case Q.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:this._stateAfterDoctypeSystemIdentifier(e);break;case Q.BOGUS_DOCTYPE:this._stateBogusDoctype(e);break;case Q.CDATA_SECTION:this._stateCdataSection(e);break;case Q.CDATA_SECTION_BRACKET:this._stateCdataSectionBracket(e);break;case Q.CDATA_SECTION_END:this._stateCdataSectionEnd(e);break;case Q.CHARACTER_REFERENCE:this._stateCharacterReference();break;case Q.AMBIGUOUS_AMPERSAND:this._stateAmbiguousAmpersand(e);break;default:throw Error(`Unknown state`)}}_stateData(e){switch(e){case K.LESS_THAN_SIGN:this.state=Q.TAG_OPEN;break;case K.AMPERSAND:this._startCharacterReference();break;case K.NULL:this._err(q.unexpectedNullCharacter),this._emitCodePoint(e);break;case K.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case K.AMPERSAND:this._startCharacterReference();break;case K.LESS_THAN_SIGN:this.state=Q.RCDATA_LESS_THAN_SIGN;break;case K.NULL:this._err(q.unexpectedNullCharacter),this._emitChars(`�`);break;case K.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case K.LESS_THAN_SIGN:this.state=Q.RAWTEXT_LESS_THAN_SIGN;break;case K.NULL:this._err(q.unexpectedNullCharacter),this._emitChars(`�`);break;case K.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case K.LESS_THAN_SIGN:this.state=Q.SCRIPT_DATA_LESS_THAN_SIGN;break;case K.NULL:this._err(q.unexpectedNullCharacter),this._emitChars(`�`);break;case K.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case K.NULL:this._err(q.unexpectedNullCharacter),this._emitChars(`�`);break;case K.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateTagOpen(e){if(NZ(e))this._createStartTagToken(),this.state=Q.TAG_NAME,this._stateTagName(e);else switch(e){case K.EXCLAMATION_MARK:this.state=Q.MARKUP_DECLARATION_OPEN;break;case K.SOLIDUS:this.state=Q.END_TAG_OPEN;break;case K.QUESTION_MARK:this._err(q.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=Q.BOGUS_COMMENT,this._stateBogusComment(e);break;case K.EOF:this._err(q.eofBeforeTagName),this._emitChars(`<`),this._emitEOFToken();break;default:this._err(q.invalidFirstCharacterOfTagName),this._emitChars(`<`),this.state=Q.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(NZ(e))this._createEndTagToken(),this.state=Q.TAG_NAME,this._stateTagName(e);else switch(e){case K.GREATER_THAN_SIGN:this._err(q.missingEndTagName),this.state=Q.DATA;break;case K.EOF:this._err(q.eofBeforeTagName),this._emitChars(`</`),this._emitEOFToken();break;default:this._err(q.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=Q.BOGUS_COMMENT,this._stateBogusComment(e)}}_stateTagName(e){let t=this.currentToken;switch(e){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:this.state=Q.BEFORE_ATTRIBUTE_NAME;break;case K.SOLIDUS:this.state=Q.SELF_CLOSING_START_TAG;break;case K.GREATER_THAN_SIGN:this.state=Q.DATA,this.emitCurrentTagToken();break;case K.NULL:this._err(q.unexpectedNullCharacter),t.tagName+=`�`;break;case K.EOF:this._err(q.eofInTag),this._emitEOFToken();break;default:t.tagName+=String.fromCodePoint(jZ(e)?FZ(e):e)}}_stateRcdataLessThanSign(e){e===K.SOLIDUS?this.state=Q.RCDATA_END_TAG_OPEN:(this._emitChars(`<`),this.state=Q.RCDATA,this._stateRcdata(e))}_stateRcdataEndTagOpen(e){NZ(e)?(this.state=Q.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(e)):(this._emitChars(`</`),this.state=Q.RCDATA,this._stateRcdata(e))}handleSpecialEndTag(e){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();let t=this.currentToken;switch(t.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=Q.BEFORE_ATTRIBUTE_NAME,!1;case K.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=Q.SELF_CLOSING_START_TAG,!1;case K.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=Q.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=Q.RCDATA,this._stateRcdata(e))}_stateRawtextLessThanSign(e){e===K.SOLIDUS?this.state=Q.RAWTEXT_END_TAG_OPEN:(this._emitChars(`<`),this.state=Q.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagOpen(e){NZ(e)?(this.state=Q.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(e)):(this._emitChars(`</`),this.state=Q.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=Q.RAWTEXT,this._stateRawtext(e))}_stateScriptDataLessThanSign(e){switch(e){case K.SOLIDUS:this.state=Q.SCRIPT_DATA_END_TAG_OPEN;break;case K.EXCLAMATION_MARK:this.state=Q.SCRIPT_DATA_ESCAPE_START,this._emitChars(`<!`);break;default:this._emitChars(`<`),this.state=Q.SCRIPT_DATA,this._stateScriptData(e)}}_stateScriptDataEndTagOpen(e){NZ(e)?(this.state=Q.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(e)):(this._emitChars(`</`),this.state=Q.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=Q.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStart(e){e===K.HYPHEN_MINUS?(this.state=Q.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars(`-`)):(this.state=Q.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStartDash(e){e===K.HYPHEN_MINUS?(this.state=Q.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars(`-`)):(this.state=Q.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscaped(e){switch(e){case K.HYPHEN_MINUS:this.state=Q.SCRIPT_DATA_ESCAPED_DASH,this._emitChars(`-`);break;case K.LESS_THAN_SIGN:this.state=Q.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case K.NULL:this._err(q.unexpectedNullCharacter),this._emitChars(`�`);break;case K.EOF:this._err(q.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptDataEscapedDash(e){switch(e){case K.HYPHEN_MINUS:this.state=Q.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars(`-`);break;case K.LESS_THAN_SIGN:this.state=Q.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case K.NULL:this._err(q.unexpectedNullCharacter),this.state=Q.SCRIPT_DATA_ESCAPED,this._emitChars(`�`);break;case K.EOF:this._err(q.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=Q.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedDashDash(e){switch(e){case K.HYPHEN_MINUS:this._emitChars(`-`);break;case K.LESS_THAN_SIGN:this.state=Q.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case K.GREATER_THAN_SIGN:this.state=Q.SCRIPT_DATA,this._emitChars(`>`);break;case K.NULL:this._err(q.unexpectedNullCharacter),this.state=Q.SCRIPT_DATA_ESCAPED,this._emitChars(`�`);break;case K.EOF:this._err(q.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=Q.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===K.SOLIDUS?this.state=Q.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:NZ(e)?(this._emitChars(`<`),this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars(`<`),this.state=Q.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){NZ(e)?(this.state=Q.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars(`</`),this.state=Q.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=Q.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscapeStart(e){if(this.preprocessor.startsWith(tZ.SCRIPT,!1)&&LZ(this.preprocessor.peek(tZ.SCRIPT.length))){this._emitCodePoint(e);for(let e=0;e<tZ.SCRIPT.length;e++)this._emitCodePoint(this._consume());this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=Q.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscaped(e){switch(e){case K.HYPHEN_MINUS:this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars(`-`);break;case K.LESS_THAN_SIGN:this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case K.NULL:this._err(q.unexpectedNullCharacter),this._emitChars(`�`);break;case K.EOF:this._err(q.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDash(e){switch(e){case K.HYPHEN_MINUS:this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars(`-`);break;case K.LESS_THAN_SIGN:this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case K.NULL:this._err(q.unexpectedNullCharacter),this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(`�`);break;case K.EOF:this._err(q.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDashDash(e){switch(e){case K.HYPHEN_MINUS:this._emitChars(`-`);break;case K.LESS_THAN_SIGN:this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case K.GREATER_THAN_SIGN:this.state=Q.SCRIPT_DATA,this._emitChars(`>`);break;case K.NULL:this._err(q.unexpectedNullCharacter),this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(`�`);break;case K.EOF:this._err(q.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===K.SOLIDUS?(this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars(`/`)):(this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(tZ.SCRIPT,!1)&&LZ(this.preprocessor.peek(tZ.SCRIPT.length))){this._emitCodePoint(e);for(let e=0;e<tZ.SCRIPT.length;e++)this._emitCodePoint(this._consume());this.state=Q.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateBeforeAttributeName(e){switch(e){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:break;case K.SOLIDUS:case K.GREATER_THAN_SIGN:case K.EOF:this.state=Q.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break;case K.EQUALS_SIGN:this._err(q.unexpectedEqualsSignBeforeAttributeName),this._createAttr(`=`),this.state=Q.ATTRIBUTE_NAME;break;default:this._createAttr(``),this.state=Q.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateAttributeName(e){switch(e){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:case K.SOLIDUS:case K.GREATER_THAN_SIGN:case K.EOF:this._leaveAttrName(),this.state=Q.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break;case K.EQUALS_SIGN:this._leaveAttrName(),this.state=Q.BEFORE_ATTRIBUTE_VALUE;break;case K.QUOTATION_MARK:case K.APOSTROPHE:case K.LESS_THAN_SIGN:this._err(q.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(e);break;case K.NULL:this._err(q.unexpectedNullCharacter),this.currentAttr.name+=`�`;break;default:this.currentAttr.name+=String.fromCodePoint(jZ(e)?FZ(e):e)}}_stateAfterAttributeName(e){switch(e){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:break;case K.SOLIDUS:this.state=Q.SELF_CLOSING_START_TAG;break;case K.EQUALS_SIGN:this.state=Q.BEFORE_ATTRIBUTE_VALUE;break;case K.GREATER_THAN_SIGN:this.state=Q.DATA,this.emitCurrentTagToken();break;case K.EOF:this._err(q.eofInTag),this._emitEOFToken();break;default:this._createAttr(``),this.state=Q.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateBeforeAttributeValue(e){switch(e){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:break;case K.QUOTATION_MARK:this.state=Q.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break;case K.APOSTROPHE:this.state=Q.ATTRIBUTE_VALUE_SINGLE_QUOTED;break;case K.GREATER_THAN_SIGN:this._err(q.missingAttributeValue),this.state=Q.DATA,this.emitCurrentTagToken();break;default:this.state=Q.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(e)}}_stateAttributeValueDoubleQuoted(e){switch(e){case K.QUOTATION_MARK:this.state=Q.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case K.AMPERSAND:this._startCharacterReference();break;case K.NULL:this._err(q.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case K.EOF:this._err(q.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueSingleQuoted(e){switch(e){case K.APOSTROPHE:this.state=Q.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case K.AMPERSAND:this._startCharacterReference();break;case K.NULL:this._err(q.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case K.EOF:this._err(q.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueUnquoted(e){switch(e){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:this._leaveAttrValue(),this.state=Q.BEFORE_ATTRIBUTE_NAME;break;case K.AMPERSAND:this._startCharacterReference();break;case K.GREATER_THAN_SIGN:this._leaveAttrValue(),this.state=Q.DATA,this.emitCurrentTagToken();break;case K.NULL:this._err(q.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case K.QUOTATION_MARK:case K.APOSTROPHE:case K.LESS_THAN_SIGN:case K.EQUALS_SIGN:case K.GRAVE_ACCENT:this._err(q.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(e);break;case K.EOF:this._err(q.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAfterAttributeValueQuoted(e){switch(e){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:this._leaveAttrValue(),this.state=Q.BEFORE_ATTRIBUTE_NAME;break;case K.SOLIDUS:this._leaveAttrValue(),this.state=Q.SELF_CLOSING_START_TAG;break;case K.GREATER_THAN_SIGN:this._leaveAttrValue(),this.state=Q.DATA,this.emitCurrentTagToken();break;case K.EOF:this._err(q.eofInTag),this._emitEOFToken();break;default:this._err(q.missingWhitespaceBetweenAttributes),this.state=Q.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateSelfClosingStartTag(e){switch(e){case K.GREATER_THAN_SIGN:{let e=this.currentToken;e.selfClosing=!0,this.state=Q.DATA,this.emitCurrentTagToken();break}case K.EOF:this._err(q.eofInTag),this._emitEOFToken();break;default:this._err(q.unexpectedSolidusInTag),this.state=Q.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateBogusComment(e){let t=this.currentToken;switch(e){case K.GREATER_THAN_SIGN:this.state=Q.DATA,this.emitCurrentComment(t);break;case K.EOF:this.emitCurrentComment(t),this._emitEOFToken();break;case K.NULL:this._err(q.unexpectedNullCharacter),t.data+=`�`;break;default:t.data+=String.fromCodePoint(e)}}_stateMarkupDeclarationOpen(e){this._consumeSequenceIfMatch(tZ.DASH_DASH,!0)?(this._createCommentToken(tZ.DASH_DASH.length+1),this.state=Q.COMMENT_START):this._consumeSequenceIfMatch(tZ.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(tZ.DOCTYPE.length+1),this.state=Q.DOCTYPE):this._consumeSequenceIfMatch(tZ.CDATA_START,!0)?this.inForeignNode?this.state=Q.CDATA_SECTION:(this._err(q.cdataInHtmlContent),this._createCommentToken(tZ.CDATA_START.length+1),this.currentToken.data=`[CDATA[`,this.state=Q.BOGUS_COMMENT):this._ensureHibernation()||(this._err(q.incorrectlyOpenedComment),this._createCommentToken(2),this.state=Q.BOGUS_COMMENT,this._stateBogusComment(e))}_stateCommentStart(e){switch(e){case K.HYPHEN_MINUS:this.state=Q.COMMENT_START_DASH;break;case K.GREATER_THAN_SIGN:{this._err(q.abruptClosingOfEmptyComment),this.state=Q.DATA;let e=this.currentToken;this.emitCurrentComment(e);break}default:this.state=Q.COMMENT,this._stateComment(e)}}_stateCommentStartDash(e){let t=this.currentToken;switch(e){case K.HYPHEN_MINUS:this.state=Q.COMMENT_END;break;case K.GREATER_THAN_SIGN:this._err(q.abruptClosingOfEmptyComment),this.state=Q.DATA,this.emitCurrentComment(t);break;case K.EOF:this._err(q.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`-`,this.state=Q.COMMENT,this._stateComment(e)}}_stateComment(e){let t=this.currentToken;switch(e){case K.HYPHEN_MINUS:this.state=Q.COMMENT_END_DASH;break;case K.LESS_THAN_SIGN:t.data+=`<`,this.state=Q.COMMENT_LESS_THAN_SIGN;break;case K.NULL:this._err(q.unexpectedNullCharacter),t.data+=`�`;break;case K.EOF:this._err(q.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=String.fromCodePoint(e)}}_stateCommentLessThanSign(e){let t=this.currentToken;switch(e){case K.EXCLAMATION_MARK:t.data+=`!`,this.state=Q.COMMENT_LESS_THAN_SIGN_BANG;break;case K.LESS_THAN_SIGN:t.data+=`<`;break;default:this.state=Q.COMMENT,this._stateComment(e)}}_stateCommentLessThanSignBang(e){e===K.HYPHEN_MINUS?this.state=Q.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=Q.COMMENT,this._stateComment(e))}_stateCommentLessThanSignBangDash(e){e===K.HYPHEN_MINUS?this.state=Q.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=Q.COMMENT_END_DASH,this._stateCommentEndDash(e))}_stateCommentLessThanSignBangDashDash(e){e!==K.GREATER_THAN_SIGN&&e!==K.EOF&&this._err(q.nestedComment),this.state=Q.COMMENT_END,this._stateCommentEnd(e)}_stateCommentEndDash(e){let t=this.currentToken;switch(e){case K.HYPHEN_MINUS:this.state=Q.COMMENT_END;break;case K.EOF:this._err(q.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`-`,this.state=Q.COMMENT,this._stateComment(e)}}_stateCommentEnd(e){let t=this.currentToken;switch(e){case K.GREATER_THAN_SIGN:this.state=Q.DATA,this.emitCurrentComment(t);break;case K.EXCLAMATION_MARK:this.state=Q.COMMENT_END_BANG;break;case K.HYPHEN_MINUS:t.data+=`-`;break;case K.EOF:this._err(q.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`--`,this.state=Q.COMMENT,this._stateComment(e)}}_stateCommentEndBang(e){let t=this.currentToken;switch(e){case K.HYPHEN_MINUS:t.data+=`--!`,this.state=Q.COMMENT_END_DASH;break;case K.GREATER_THAN_SIGN:this._err(q.incorrectlyClosedComment),this.state=Q.DATA,this.emitCurrentComment(t);break;case K.EOF:this._err(q.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`--!`,this.state=Q.COMMENT,this._stateComment(e)}}_stateDoctype(e){switch(e){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:this.state=Q.BEFORE_DOCTYPE_NAME;break;case K.GREATER_THAN_SIGN:this.state=Q.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e);break;case K.EOF:{this._err(q.eofInDoctype),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this._emitEOFToken();break}default:this._err(q.missingWhitespaceBeforeDoctypeName),this.state=Q.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e)}}_stateBeforeDoctypeName(e){if(jZ(e))this._createDoctypeToken(String.fromCharCode(FZ(e))),this.state=Q.DOCTYPE_NAME;else switch(e){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:break;case K.NULL:this._err(q.unexpectedNullCharacter),this._createDoctypeToken(`�`),this.state=Q.DOCTYPE_NAME;break;case K.GREATER_THAN_SIGN:{this._err(q.missingDoctypeName),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this.state=Q.DATA;break}case K.EOF:{this._err(q.eofInDoctype),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(e)),this.state=Q.DOCTYPE_NAME}}_stateDoctypeName(e){let t=this.currentToken;switch(e){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:this.state=Q.AFTER_DOCTYPE_NAME;break;case K.GREATER_THAN_SIGN:this.state=Q.DATA,this.emitCurrentDoctype(t);break;case K.NULL:this._err(q.unexpectedNullCharacter),t.name+=`�`;break;case K.EOF:this._err(q.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.name+=String.fromCodePoint(jZ(e)?FZ(e):e)}}_stateAfterDoctypeName(e){let t=this.currentToken;switch(e){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:break;case K.GREATER_THAN_SIGN:this.state=Q.DATA,this.emitCurrentDoctype(t);break;case K.EOF:this._err(q.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._consumeSequenceIfMatch(tZ.PUBLIC,!1)?this.state=Q.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(tZ.SYSTEM,!1)?this.state=Q.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(q.invalidCharacterSequenceAfterDoctypeName),t.forceQuirks=!0,this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(e))}}_stateAfterDoctypePublicKeyword(e){let t=this.currentToken;switch(e){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:this.state=Q.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break;case K.QUOTATION_MARK:this._err(q.missingWhitespaceAfterDoctypePublicKeyword),t.publicId=``,this.state=Q.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case K.APOSTROPHE:this._err(q.missingWhitespaceAfterDoctypePublicKeyword),t.publicId=``,this.state=Q.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case K.GREATER_THAN_SIGN:this._err(q.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=Q.DATA,this.emitCurrentDoctype(t);break;case K.EOF:this._err(q.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(q.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypePublicIdentifier(e){let t=this.currentToken;switch(e){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:break;case K.QUOTATION_MARK:t.publicId=``,this.state=Q.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case K.APOSTROPHE:t.publicId=``,this.state=Q.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case K.GREATER_THAN_SIGN:this._err(q.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=Q.DATA,this.emitCurrentDoctype(t);break;case K.EOF:this._err(q.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(q.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypePublicIdentifierDoubleQuoted(e){let t=this.currentToken;switch(e){case K.QUOTATION_MARK:this.state=Q.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case K.NULL:this._err(q.unexpectedNullCharacter),t.publicId+=`�`;break;case K.GREATER_THAN_SIGN:this._err(q.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=Q.DATA;break;case K.EOF:this._err(q.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.publicId+=String.fromCodePoint(e)}}_stateDoctypePublicIdentifierSingleQuoted(e){let t=this.currentToken;switch(e){case K.APOSTROPHE:this.state=Q.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case K.NULL:this._err(q.unexpectedNullCharacter),t.publicId+=`�`;break;case K.GREATER_THAN_SIGN:this._err(q.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=Q.DATA;break;case K.EOF:this._err(q.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.publicId+=String.fromCodePoint(e)}}_stateAfterDoctypePublicIdentifier(e){let t=this.currentToken;switch(e){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:this.state=Q.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break;case K.GREATER_THAN_SIGN:this.state=Q.DATA,this.emitCurrentDoctype(t);break;case K.QUOTATION_MARK:this._err(q.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId=``,this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case K.APOSTROPHE:this._err(q.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId=``,this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case K.EOF:this._err(q.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(q.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBetweenDoctypePublicAndSystemIdentifiers(e){let t=this.currentToken;switch(e){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:break;case K.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=Q.DATA;break;case K.QUOTATION_MARK:t.systemId=``,this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case K.APOSTROPHE:t.systemId=``,this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case K.EOF:this._err(q.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(q.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateAfterDoctypeSystemKeyword(e){let t=this.currentToken;switch(e){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:this.state=Q.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break;case K.QUOTATION_MARK:this._err(q.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId=``,this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case K.APOSTROPHE:this._err(q.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId=``,this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case K.GREATER_THAN_SIGN:this._err(q.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=Q.DATA,this.emitCurrentDoctype(t);break;case K.EOF:this._err(q.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(q.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypeSystemIdentifier(e){let t=this.currentToken;switch(e){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:break;case K.QUOTATION_MARK:t.systemId=``,this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case K.APOSTROPHE:t.systemId=``,this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case K.GREATER_THAN_SIGN:this._err(q.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=Q.DATA,this.emitCurrentDoctype(t);break;case K.EOF:this._err(q.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(q.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypeSystemIdentifierDoubleQuoted(e){let t=this.currentToken;switch(e){case K.QUOTATION_MARK:this.state=Q.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case K.NULL:this._err(q.unexpectedNullCharacter),t.systemId+=`�`;break;case K.GREATER_THAN_SIGN:this._err(q.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=Q.DATA;break;case K.EOF:this._err(q.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.systemId+=String.fromCodePoint(e)}}_stateDoctypeSystemIdentifierSingleQuoted(e){let t=this.currentToken;switch(e){case K.APOSTROPHE:this.state=Q.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case K.NULL:this._err(q.unexpectedNullCharacter),t.systemId+=`�`;break;case K.GREATER_THAN_SIGN:this._err(q.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=Q.DATA;break;case K.EOF:this._err(q.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.systemId+=String.fromCodePoint(e)}}_stateAfterDoctypeSystemIdentifier(e){let t=this.currentToken;switch(e){case K.SPACE:case K.LINE_FEED:case K.TABULATION:case K.FORM_FEED:break;case K.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=Q.DATA;break;case K.EOF:this._err(q.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(q.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBogusDoctype(e){let t=this.currentToken;switch(e){case K.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=Q.DATA;break;case K.NULL:this._err(q.unexpectedNullCharacter);break;case K.EOF:this.emitCurrentDoctype(t),this._emitEOFToken()}}_stateCdataSection(e){switch(e){case K.RIGHT_SQUARE_BRACKET:this.state=Q.CDATA_SECTION_BRACKET;break;case K.EOF:this._err(q.eofInCdata),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateCdataSectionBracket(e){e===K.RIGHT_SQUARE_BRACKET?this.state=Q.CDATA_SECTION_END:(this._emitChars(`]`),this.state=Q.CDATA_SECTION,this._stateCdataSection(e))}_stateCdataSectionEnd(e){switch(e){case K.GREATER_THAN_SIGN:this.state=Q.DATA;break;case K.RIGHT_SQUARE_BRACKET:this._emitChars(`]`);break;default:this._emitChars(`]]`),this.state=Q.CDATA_SECTION,this._stateCdataSection(e)}}_stateCharacterReference(){let e=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(e<0){if(this.preprocessor.lastChunkWritten)e=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}}e===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(K.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&PZ(this.preprocessor.peek(1))?Q.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(e){PZ(e)?this._flushCodePointConsumedAsCharacterReference(e):(e===K.SEMICOLON&&this._err(q.unknownNamedCharacterReference),this.state=this.returnState,this._callState(e))}};const BZ=new Set([X.DD,X.DT,X.LI,X.OPTGROUP,X.OPTION,X.P,X.RB,X.RP,X.RT,X.RTC]),VZ=new Set([...BZ,X.CAPTION,X.COLGROUP,X.TBODY,X.TD,X.TFOOT,X.TH,X.THEAD,X.TR]),HZ=new Set([X.APPLET,X.CAPTION,X.HTML,X.MARQUEE,X.OBJECT,X.TABLE,X.TD,X.TEMPLATE,X.TH]),UZ=new Set([...HZ,X.OL,X.UL]),WZ=new Set([...HZ,X.BUTTON]),GZ=new Set([X.ANNOTATION_XML,X.MI,X.MN,X.MO,X.MS,X.MTEXT]),KZ=new Set([X.DESC,X.FOREIGN_OBJECT,X.TITLE]),qZ=new Set([X.TR,X.TEMPLATE,X.HTML]),JZ=new Set([X.TBODY,X.TFOOT,X.THEAD,X.TEMPLATE,X.HTML]),YZ=new Set([X.TABLE,X.TEMPLATE,X.HTML]),XZ=new Set([X.TD,X.TH]);var ZZ=class{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(e,t,n){this.treeAdapter=t,this.handler=n,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=X.UNKNOWN,this.current=e}_indexOf(e){return this.items.lastIndexOf(e,this.stackTop)}_isInTemplate(){return this.currentTagId===X.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===J.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(e,t){this.stackTop++,this.items[this.stackTop]=e,this.current=e,this.tagIDs[this.stackTop]=t,this.currentTagId=t,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(e,t,!0)}pop(){let e=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!0)}replace(e,t){let n=this._indexOf(e);this.items[n]=t,n===this.stackTop&&(this.current=t)}insertAfter(e,t,n){let r=this._indexOf(e)+1;this.items.splice(r,0,t),this.tagIDs.splice(r,0,n),this.stackTop++,r===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,r===this.stackTop)}popUntilTagNamePopped(e){let t=this.stackTop+1;do t=this.tagIDs.lastIndexOf(e,t-1);while(t>0&&this.treeAdapter.getNamespaceURI(this.items[t])!==J.HTML);this.shortenToLength(Math.max(t,0))}shortenToLength(e){for(;this.stackTop>=e;){let t=this.current;this.tmplCount>0&&this._isInTemplate()&&--this.tmplCount,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,this.stackTop<e)}}popUntilElementPopped(e){let t=this._indexOf(e);this.shortenToLength(Math.max(t,0))}popUntilPopped(e,t){let n=this._indexOfTagNames(e,t);this.shortenToLength(Math.max(n,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(OZ,J.HTML)}popUntilTableCellPopped(){this.popUntilPopped(XZ,J.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(e,t){for(let n=this.stackTop;n>=0;n--)if(e.has(this.tagIDs[n])&&this.treeAdapter.getNamespaceURI(this.items[n])===t)return n;return-1}clearBackTo(e,t){let n=this._indexOfTagNames(e,t);this.shortenToLength(n+1)}clearBackToTableContext(){this.clearBackTo(YZ,J.HTML)}clearBackToTableBodyContext(){this.clearBackTo(JZ,J.HTML)}clearBackToTableRowContext(){this.clearBackTo(qZ,J.HTML)}remove(e){let t=this._indexOf(e);t>=0&&(t===this.stackTop?this.pop():(this.items.splice(t,1),this.tagIDs.splice(t,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===X.BODY?this.items[1]:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){let t=this._indexOf(e)-1;return t>=0?this.items[t]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===X.HTML}hasInDynamicScope(e,t){for(let n=this.stackTop;n>=0;n--){let r=this.tagIDs[n];switch(this.treeAdapter.getNamespaceURI(this.items[n])){case J.HTML:if(r===e)return!0;if(t.has(r))return!1;break;case J.SVG:if(KZ.has(r))return!1;break;case J.MATHML:if(GZ.has(r))return!1}}return!0}hasInScope(e){return this.hasInDynamicScope(e,HZ)}hasInListItemScope(e){return this.hasInDynamicScope(e,UZ)}hasInButtonScope(e){return this.hasInDynamicScope(e,WZ)}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){let t=this.tagIDs[e];switch(this.treeAdapter.getNamespaceURI(this.items[e])){case J.HTML:if(OZ.has(t))return!0;if(HZ.has(t))return!1;break;case J.SVG:if(KZ.has(t))return!1;break;case J.MATHML:if(GZ.has(t))return!1}}return!0}hasInTableScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===J.HTML)switch(this.tagIDs[t]){case e:return!0;case X.TABLE:case X.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===J.HTML)switch(this.tagIDs[e]){case X.TBODY:case X.THEAD:case X.TFOOT:return!0;case X.TABLE:case X.HTML:return!1}return!0}hasInSelectScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===J.HTML)switch(this.tagIDs[t]){case e:return!0;case X.OPTION:case X.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&BZ.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&VZ.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==void 0&&this.currentTagId!==e&&VZ.has(this.currentTagId);)this.pop()}},QZ;(function(e){e[e.Marker=0]=`Marker`,e[e.Element=1]=`Element`})(QZ||={});const $Z={type:QZ.Marker};var eQ=class{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,t){let n=[],r=t.length,i=this.treeAdapter.getTagName(e),a=this.treeAdapter.getNamespaceURI(e);for(let e=0;e<this.entries.length;e++){let t=this.entries[e];if(t.type===QZ.Marker)break;let{element:o}=t;if(this.treeAdapter.getTagName(o)===i&&this.treeAdapter.getNamespaceURI(o)===a){let t=this.treeAdapter.getAttrList(o);t.length===r&&n.push({idx:e,attrs:t})}}return n}_ensureNoahArkCondition(e){if(this.entries.length<3)return;let t=this.treeAdapter.getAttrList(e),n=this._getNoahArkConditionCandidates(e,t);if(n.length<3)return;let r=new Map(t.map(e=>[e.name,e.value])),i=0;for(let e=0;e<n.length;e++){let t=n[e];t.attrs.every(e=>r.get(e.name)===e.value)&&(i+=1,i>=3&&this.entries.splice(t.idx,1))}}insertMarker(){this.entries.unshift($Z)}pushElement(e,t){this._ensureNoahArkCondition(e),this.entries.unshift({type:QZ.Element,element:e,token:t})}insertElementAfterBookmark(e,t){let n=this.entries.indexOf(this.bookmark);this.entries.splice(n,0,{type:QZ.Element,element:e,token:t})}removeEntry(e){let t=this.entries.indexOf(e);t!==-1&&this.entries.splice(t,1)}clearToLastMarker(){let e=this.entries.indexOf($Z);e===-1?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){let t=this.entries.find(t=>t.type===QZ.Marker||this.treeAdapter.getTagName(t.element)===e);return t&&t.type===QZ.Element?t:null}getElementEntry(e){return this.entries.find(t=>t.type===QZ.Element&&t.element===e)}};const tQ={createDocument(){return{nodeName:`#document`,mode:wZ.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:`#document-fragment`,childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:`#comment`,data:e,parentNode:null}},createTextNode(e){return{nodeName:`#text`,value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){let r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){let i=e.childNodes.find(e=>e.nodeName===`#documentType`);if(i)i.name=t,i.publicId=n,i.systemId=r;else{let i={nodeName:`#documentType`,name:t,publicId:n,systemId:r,parentNode:null};tQ.appendChild(e,i)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){let t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){let n=e.childNodes[e.childNodes.length-1];if(tQ.isTextNode(n)){n.value+=t;return}}tQ.appendChild(e,tQ.createTextNode(t))},insertTextBefore(e,t,n){let r=e.childNodes[e.childNodes.indexOf(n)-1];r&&tQ.isTextNode(r)?r.value+=t:tQ.insertBefore(e,tQ.createTextNode(t),n)},adoptAttributes(e,t){let n=new Set(e.attrs.map(e=>e.name));for(let r=0;r<t.length;r++)n.has(t[r].name)||e.attrs.push(t[r])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName===`#text`},isCommentNode(e){return e.nodeName===`#comment`},isDocumentTypeNode(e){return e.nodeName===`#documentType`},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,`tagName`)},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}},nQ=`html`,rQ=`+//silmaril//dtd html pro v0r11 19970101//,-//as//dtd html 3.0 aswedit + extensions//,-//advasoft ltd//dtd html 3.0 aswedit + extensions//,-//ietf//dtd html 2.0 level 1//,-//ietf//dtd html 2.0 level 2//,-//ietf//dtd html 2.0 strict level 1//,-//ietf//dtd html 2.0 strict level 2//,-//ietf//dtd html 2.0 strict//,-//ietf//dtd html 2.0//,-//ietf//dtd html 2.1e//,-//ietf//dtd html 3.0//,-//ietf//dtd html 3.2 final//,-//ietf//dtd html 3.2//,-//ietf//dtd html 3//,-//ietf//dtd html level 0//,-//ietf//dtd html level 1//,-//ietf//dtd html level 2//,-//ietf//dtd html level 3//,-//ietf//dtd html strict level 0//,-//ietf//dtd html strict level 1//,-//ietf//dtd html strict level 2//,-//ietf//dtd html strict level 3//,-//ietf//dtd html strict//,-//ietf//dtd html//,-//metrius//dtd metrius presentational//,-//microsoft//dtd internet explorer 2.0 html strict//,-//microsoft//dtd internet explorer 2.0 html//,-//microsoft//dtd internet explorer 2.0 tables//,-//microsoft//dtd internet explorer 3.0 html strict//,-//microsoft//dtd internet explorer 3.0 html//,-//microsoft//dtd internet explorer 3.0 tables//,-//netscape comm. corp.//dtd html//,-//netscape comm. corp.//dtd strict html//,-//o'reilly and associates//dtd html 2.0//,-//o'reilly and associates//dtd html extended 1.0//,-//o'reilly and associates//dtd html extended relaxed 1.0//,-//sq//dtd html 2.0 hotmetal + extensions//,-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//,-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//,-//spyglass//dtd html 2.0 extended//,-//sun microsystems corp.//dtd hotjava html//,-//sun microsystems corp.//dtd hotjava strict html//,-//w3c//dtd html 3 1995-03-24//,-//w3c//dtd html 3.2 draft//,-//w3c//dtd html 3.2 final//,-//w3c//dtd html 3.2//,-//w3c//dtd html 3.2s draft//,-//w3c//dtd html 4.0 frameset//,-//w3c//dtd html 4.0 transitional//,-//w3c//dtd html experimental 19960712//,-//w3c//dtd html experimental 970421//,-//w3c//dtd w3 html//,-//w3o//dtd w3 html 3.0//,-//webtechs//dtd mozilla html 2.0//,-//webtechs//dtd mozilla html//`.split(`,`),iQ=[...rQ,`-//w3c//dtd html 4.01 frameset//`,`-//w3c//dtd html 4.01 transitional//`],aQ=new Set([`-//w3o//dtd w3 html strict 3.0//en//`,`-/w3c/dtd html 4.0 transitional/en`,`html`]),oQ=[`-//w3c//dtd xhtml 1.0 frameset//`,`-//w3c//dtd xhtml 1.0 transitional//`],sQ=[...oQ,`-//w3c//dtd html 4.01 frameset//`,`-//w3c//dtd html 4.01 transitional//`];function cQ(e,t){return t.some(t=>e.startsWith(t))}function lQ(e){return e.name===nQ&&e.publicId===null&&(e.systemId===null||e.systemId===`about:legacy-compat`)}function uQ(e){if(e.name!==nQ)return wZ.QUIRKS;let{systemId:t}=e;if(t&&t.toLowerCase()===`http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd`)return wZ.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),aQ.has(n))return wZ.QUIRKS;let e=t===null?iQ:rQ;if(cQ(n,e))return wZ.QUIRKS;if(e=t===null?oQ:sQ,cQ(n,e))return wZ.LIMITED_QUIRKS}return wZ.NO_QUIRKS}const dQ={TEXT_HTML:`text/html`,APPLICATION_XML:`application/xhtml+xml`},fQ=new Map(`attributeName.attributeType.baseFrequency.baseProfile.calcMode.clipPathUnits.diffuseConstant.edgeMode.filterUnits.glyphRef.gradientTransform.gradientUnits.kernelMatrix.kernelUnitLength.keyPoints.keySplines.keyTimes.lengthAdjust.limitingConeAngle.markerHeight.markerUnits.markerWidth.maskContentUnits.maskUnits.numOctaves.pathLength.patternContentUnits.patternTransform.patternUnits.pointsAtX.pointsAtY.pointsAtZ.preserveAlpha.preserveAspectRatio.primitiveUnits.refX.refY.repeatCount.repeatDur.requiredExtensions.requiredFeatures.specularConstant.specularExponent.spreadMethod.startOffset.stdDeviation.stitchTiles.surfaceScale.systemLanguage.tableValues.targetX.targetY.textLength.viewBox.viewTarget.xChannelSelector.yChannelSelector.zoomAndPan`.split(`.`).map(e=>[e.toLowerCase(),e])),pQ=new Map([[`xlink:actuate`,{prefix:`xlink`,name:`actuate`,namespace:J.XLINK}],[`xlink:arcrole`,{prefix:`xlink`,name:`arcrole`,namespace:J.XLINK}],[`xlink:href`,{prefix:`xlink`,name:`href`,namespace:J.XLINK}],[`xlink:role`,{prefix:`xlink`,name:`role`,namespace:J.XLINK}],[`xlink:show`,{prefix:`xlink`,name:`show`,namespace:J.XLINK}],[`xlink:title`,{prefix:`xlink`,name:`title`,namespace:J.XLINK}],[`xlink:type`,{prefix:`xlink`,name:`type`,namespace:J.XLINK}],[`xml:lang`,{prefix:`xml`,name:`lang`,namespace:J.XML}],[`xml:space`,{prefix:`xml`,name:`space`,namespace:J.XML}],[`xmlns`,{prefix:``,name:`xmlns`,namespace:J.XMLNS}],[`xmlns:xlink`,{prefix:`xmlns`,name:`xlink`,namespace:J.XMLNS}]]),mQ=new Map(`altGlyph.altGlyphDef.altGlyphItem.animateColor.animateMotion.animateTransform.clipPath.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.foreignObject.glyphRef.linearGradient.radialGradient.textPath`.split(`.`).map(e=>[e.toLowerCase(),e])),hQ=new Set([X.B,X.BIG,X.BLOCKQUOTE,X.BODY,X.BR,X.CENTER,X.CODE,X.DD,X.DIV,X.DL,X.DT,X.EM,X.EMBED,X.H1,X.H2,X.H3,X.H4,X.H5,X.H6,X.HEAD,X.HR,X.I,X.IMG,X.LI,X.LISTING,X.MENU,X.META,X.NOBR,X.OL,X.P,X.PRE,X.RUBY,X.S,X.SMALL,X.SPAN,X.STRONG,X.STRIKE,X.SUB,X.SUP,X.TABLE,X.TT,X.U,X.UL,X.VAR]);function gQ(e){let t=e.tagID;return t===X.FONT&&e.attrs.some(({name:e})=>e===CZ.COLOR||e===CZ.SIZE||e===CZ.FACE)||hQ.has(t)}function _Q(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===`definitionurl`){e.attrs[t].name=`definitionURL`;break}}function vQ(e){for(let t=0;t<e.attrs.length;t++){let n=fQ.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function yQ(e){for(let t=0;t<e.attrs.length;t++){let n=pQ.get(e.attrs[t].name);n&&(e.attrs[t].prefix=n.prefix,e.attrs[t].name=n.name,e.attrs[t].namespace=n.namespace)}}function bQ(e){let t=mQ.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=EZ(e.tagName))}function xQ(e,t){return t===J.MATHML&&(e===X.MI||e===X.MO||e===X.MN||e===X.MS||e===X.MTEXT)}function SQ(e,t,n){if(t===J.MATHML&&e===X.ANNOTATION_XML){for(let e=0;e<n.length;e++)if(n[e].name===CZ.ENCODING){let t=n[e].value.toLowerCase();return t===dQ.TEXT_HTML||t===dQ.APPLICATION_XML}}return t===J.SVG&&(e===X.FOREIGN_OBJECT||e===X.DESC||e===X.TITLE)}function CQ(e,t,n,r){return(!r||r===J.HTML)&&SQ(e,t,n)||(!r||r===J.MATHML)&&xQ(e,t)}var $;(function(e){e[e.INITIAL=0]=`INITIAL`,e[e.BEFORE_HTML=1]=`BEFORE_HTML`,e[e.BEFORE_HEAD=2]=`BEFORE_HEAD`,e[e.IN_HEAD=3]=`IN_HEAD`,e[e.IN_HEAD_NO_SCRIPT=4]=`IN_HEAD_NO_SCRIPT`,e[e.AFTER_HEAD=5]=`AFTER_HEAD`,e[e.IN_BODY=6]=`IN_BODY`,e[e.TEXT=7]=`TEXT`,e[e.IN_TABLE=8]=`IN_TABLE`,e[e.IN_TABLE_TEXT=9]=`IN_TABLE_TEXT`,e[e.IN_CAPTION=10]=`IN_CAPTION`,e[e.IN_COLUMN_GROUP=11]=`IN_COLUMN_GROUP`,e[e.IN_TABLE_BODY=12]=`IN_TABLE_BODY`,e[e.IN_ROW=13]=`IN_ROW`,e[e.IN_CELL=14]=`IN_CELL`,e[e.IN_SELECT=15]=`IN_SELECT`,e[e.IN_SELECT_IN_TABLE=16]=`IN_SELECT_IN_TABLE`,e[e.IN_TEMPLATE=17]=`IN_TEMPLATE`,e[e.AFTER_BODY=18]=`AFTER_BODY`,e[e.IN_FRAMESET=19]=`IN_FRAMESET`,e[e.AFTER_FRAMESET=20]=`AFTER_FRAMESET`,e[e.AFTER_AFTER_BODY=21]=`AFTER_AFTER_BODY`,e[e.AFTER_AFTER_FRAMESET=22]=`AFTER_AFTER_FRAMESET`})($||={});const wQ={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},TQ=new Set([X.TABLE,X.TBODY,X.TFOOT,X.THEAD,X.TR]),EQ={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:tQ,onParseError:null};var DQ=class{constructor(e,t,n=null,r=null){this.fragmentContext=n,this.scriptHandler=r,this.currentToken=null,this.stopped=!1,this.insertionMode=$.INITIAL,this.originalInsertionMode=$.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...EQ,...e},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=t??this.treeAdapter.createDocument(),this.tokenizer=new zZ(this.options,this),this.activeFormattingElements=new eQ(this.treeAdapter),this.fragmentContextID=n?EZ(this.treeAdapter.getTagName(n)):X.UNKNOWN,this._setContextModes(n??this.document,this.fragmentContextID),this.openElements=new ZZ(this.document,this.treeAdapter,this)}static parse(e,t){let n=new this(t);return n.tokenizer.write(e,!0),n.document}static getFragmentParser(e,t){let n={...EQ,...t};e??=n.treeAdapter.createElement(Y.TEMPLATE,J.HTML,[]);let r=n.treeAdapter.createElement(`documentmock`,J.HTML,[]),i=new this(n,r,e);return i.fragmentContextID===X.TEMPLATE&&i.tmplInsertionModeStack.unshift($.IN_TEMPLATE),i._initTokenizerForFragmentParsing(),i._insertFakeRootElement(),i._resetInsertionMode(),i._findFormInFragmentContext(),i}getFragment(){let e=this.treeAdapter.getFirstChild(this.document),t=this.treeAdapter.createDocumentFragment();return this._adoptNodes(e,t),t}_err(e,t,n){if(!this.onParseError)return;let r=e.location??wQ,i={code:t,startLine:r.startLine,startCol:r.startCol,startOffset:r.startOffset,endLine:n?r.startLine:r.endLine,endCol:n?r.startCol:r.endCol,endOffset:n?r.startOffset:r.endOffset};this.onParseError(i)}onItemPush(e,t,n){var r,i;(i=(r=this.treeAdapter).onItemPush)==null||i.call(r,e),n&&this.openElements.stackTop>0&&this._setContextModes(e,t)}onItemPop(e,t){var n,r;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(e,this.currentToken),(r=(n=this.treeAdapter).onItemPop)==null||r.call(n,e,this.openElements.current),t){let e,t;this.openElements.stackTop===0&&this.fragmentContext?(e=this.fragmentContext,t=this.fragmentContextID):{current:e,currentTagId:t}=this.openElements,this._setContextModes(e,t)}}_setContextModes(e,t){let n=e===this.document||e&&this.treeAdapter.getNamespaceURI(e)===J.HTML;this.currentNotInHTML=!n,this.tokenizer.inForeignNode=!n&&e!==void 0&&t!==void 0&&!this._isIntegrationPoint(t,e)}_switchToTextParsing(e,t){this._insertElement(e,J.HTML),this.tokenizer.state=t,this.originalInsertionMode=this.insertionMode,this.insertionMode=$.TEXT}switchToPlaintextParsing(){this.insertionMode=$.TEXT,this.originalInsertionMode=$.IN_BODY,this.tokenizer.state=kZ.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let e=this.fragmentContext;for(;e;){if(this.treeAdapter.getTagName(e)===Y.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==J.HTML))switch(this.fragmentContextID){case X.TITLE:case X.TEXTAREA:this.tokenizer.state=kZ.RCDATA;break;case X.STYLE:case X.XMP:case X.IFRAME:case X.NOEMBED:case X.NOFRAMES:case X.NOSCRIPT:this.tokenizer.state=kZ.RAWTEXT;break;case X.SCRIPT:this.tokenizer.state=kZ.SCRIPT_DATA;break;case X.PLAINTEXT:this.tokenizer.state=kZ.PLAINTEXT}}_setDocumentType(e){let t=e.name||``,n=e.publicId||``,r=e.systemId||``;if(this.treeAdapter.setDocumentType(this.document,t,n,r),e.location){let t=this.treeAdapter.getChildNodes(this.document).find(e=>this.treeAdapter.isDocumentTypeNode(e));t&&this.treeAdapter.setNodeSourceCodeLocation(t,e.location)}}_attachElementToTree(e,t){if(this.options.sourceCodeLocationInfo){let n=t&&{...t,startTag:t};this.treeAdapter.setNodeSourceCodeLocation(e,n)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{let t=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(t??this.document,e)}}_appendElement(e,t){let n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location)}_insertElement(e,t){let n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location),this.openElements.push(n,e.tagID)}_insertFakeElement(e,t){let n=this.treeAdapter.createElement(e,J.HTML,[]);this._attachElementToTree(n,null),this.openElements.push(n,t)}_insertTemplate(e){let t=this.treeAdapter.createElement(e.tagName,J.HTML,e.attrs),n=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(t,n),this._attachElementToTree(t,e.location),this.openElements.push(t,e.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,null)}_insertFakeRootElement(){let e=this.treeAdapter.createElement(Y.HTML,J.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,X.HTML)}_appendCommentNode(e,t){let n=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(t,n),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,e.location)}_insertCharacters(e){let t,n;if(this._shouldFosterParentOnInsertion()?({parent:t,beforeElement:n}=this._findFosterParentingLocation(),n?this.treeAdapter.insertTextBefore(t,e.chars,n):this.treeAdapter.insertText(t,e.chars)):(t=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(t,e.chars)),!e.location)return;let r=this.treeAdapter.getChildNodes(t),i=r[(n?r.lastIndexOf(n):r.length)-1];if(this.treeAdapter.getNodeSourceCodeLocation(i)){let{endLine:t,endCol:n,endOffset:r}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(i,{endLine:t,endCol:n,endOffset:r})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,e.location)}_adoptNodes(e,t){for(let n=this.treeAdapter.getFirstChild(e);n;n=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(n),this.treeAdapter.appendChild(t,n)}_setEndLocation(e,t){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&t.location){let n=t.location,r=this.treeAdapter.getTagName(e),i=t.type===cZ.END_TAG&&r===t.tagName?{endTag:{...n},endLine:n.endLine,endCol:n.endCol,endOffset:n.endOffset}:{endLine:n.startLine,endCol:n.startCol,endOffset:n.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(e,i)}}shouldProcessStartTagTokenInForeignContent(e){if(!this.currentNotInHTML)return!1;let t,n;return this.openElements.stackTop===0&&this.fragmentContext?(t=this.fragmentContext,n=this.fragmentContextID):{current:t,currentTagId:n}=this.openElements,e.tagID===X.SVG&&this.treeAdapter.getTagName(t)===Y.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(t)===J.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===X.MGLYPH||e.tagID===X.MALIGNMARK)&&n!==void 0&&!this._isIntegrationPoint(n,t,J.HTML)}_processToken(e){switch(e.type){case cZ.CHARACTER:this.onCharacter(e);break;case cZ.NULL_CHARACTER:this.onNullCharacter(e);break;case cZ.COMMENT:this.onComment(e);break;case cZ.DOCTYPE:this.onDoctype(e);break;case cZ.START_TAG:this._processStartTag(e);break;case cZ.END_TAG:this.onEndTag(e);break;case cZ.EOF:this.onEof(e);break;case cZ.WHITESPACE_CHARACTER:this.onWhitespaceCharacter(e)}}_isIntegrationPoint(e,t,n){return CQ(e,this.treeAdapter.getNamespaceURI(t),this.treeAdapter.getAttrList(t),n)}_reconstructActiveFormattingElements(){let e=this.activeFormattingElements.entries.length;if(e){let t=this.activeFormattingElements.entries.findIndex(e=>e.type===QZ.Marker||this.openElements.contains(e.element)),n=t===-1?e-1:t-1;for(let e=n;e>=0;e--){let t=this.activeFormattingElements.entries[e];this._insertElement(t.token,this.treeAdapter.getNamespaceURI(t.element)),t.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=$.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(X.P),this.openElements.popUntilTagNamePopped(X.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(e===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case X.TR:this.insertionMode=$.IN_ROW;return;case X.TBODY:case X.THEAD:case X.TFOOT:this.insertionMode=$.IN_TABLE_BODY;return;case X.CAPTION:this.insertionMode=$.IN_CAPTION;return;case X.COLGROUP:this.insertionMode=$.IN_COLUMN_GROUP;return;case X.TABLE:this.insertionMode=$.IN_TABLE;return;case X.BODY:this.insertionMode=$.IN_BODY;return;case X.FRAMESET:this.insertionMode=$.IN_FRAMESET;return;case X.SELECT:this._resetInsertionModeForSelect(e);return;case X.TEMPLATE:this.insertionMode=this.tmplInsertionModeStack[0];return;case X.HTML:this.insertionMode=this.headElement?$.AFTER_HEAD:$.BEFORE_HEAD;return;case X.TD:case X.TH:if(e>0){this.insertionMode=$.IN_CELL;return}break;case X.HEAD:if(e>0){this.insertionMode=$.IN_HEAD;return}}this.insertionMode=$.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let t=e-1;t>0;t--){let e=this.openElements.tagIDs[t];if(e===X.TEMPLATE)break;if(e===X.TABLE){this.insertionMode=$.IN_SELECT_IN_TABLE;return}}this.insertionMode=$.IN_SELECT}_isElementCausesFosterParenting(e){return TQ.has(e)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let e=this.openElements.stackTop;e>=0;e--){let t=this.openElements.items[e];switch(this.openElements.tagIDs[e]){case X.TEMPLATE:if(this.treeAdapter.getNamespaceURI(t)===J.HTML)return{parent:this.treeAdapter.getTemplateContent(t),beforeElement:null};break;case X.TABLE:{let n=this.treeAdapter.getParentNode(t);return n?{parent:n,beforeElement:t}:{parent:this.openElements.items[e-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(e){let t=this._findFosterParentingLocation();t.beforeElement?this.treeAdapter.insertBefore(t.parent,e,t.beforeElement):this.treeAdapter.appendChild(t.parent,e)}_isSpecialElement(e,t){let n=this.treeAdapter.getNamespaceURI(e);return DZ[n].has(t)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){G1(this,e);return}switch(this.insertionMode){case $.INITIAL:BQ(this,e);break;case $.BEFORE_HTML:UQ(this,e);break;case $.BEFORE_HEAD:KQ(this,e);break;case $.IN_HEAD:XQ(this,e);break;case $.IN_HEAD_NO_SCRIPT:$Q(this,e);break;case $.AFTER_HEAD:n$(this,e);break;case $.IN_BODY:case $.IN_CAPTION:case $.IN_CELL:case $.IN_TEMPLATE:a$(this,e);break;case $.TEXT:case $.IN_SELECT:case $.IN_SELECT_IN_TABLE:this._insertCharacters(e);break;case $.IN_TABLE:case $.IN_TABLE_BODY:case $.IN_ROW:e1(this,e);break;case $.IN_TABLE_TEXT:p1(this,e);break;case $.IN_COLUMN_GROUP:b1(this,e);break;case $.AFTER_BODY:I1(this,e);break;case $.AFTER_AFTER_BODY:H1(this,e)}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){W1(this,e);return}switch(this.insertionMode){case $.INITIAL:BQ(this,e);break;case $.BEFORE_HTML:UQ(this,e);break;case $.BEFORE_HEAD:KQ(this,e);break;case $.IN_HEAD:XQ(this,e);break;case $.IN_HEAD_NO_SCRIPT:$Q(this,e);break;case $.AFTER_HEAD:n$(this,e);break;case $.TEXT:this._insertCharacters(e);break;case $.IN_TABLE:case $.IN_TABLE_BODY:case $.IN_ROW:e1(this,e);break;case $.IN_COLUMN_GROUP:b1(this,e);break;case $.AFTER_BODY:I1(this,e);break;case $.AFTER_AFTER_BODY:H1(this,e)}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML){FQ(this,e);return}switch(this.insertionMode){case $.INITIAL:case $.BEFORE_HTML:case $.BEFORE_HEAD:case $.IN_HEAD:case $.IN_HEAD_NO_SCRIPT:case $.AFTER_HEAD:case $.IN_BODY:case $.IN_TABLE:case $.IN_CAPTION:case $.IN_COLUMN_GROUP:case $.IN_TABLE_BODY:case $.IN_ROW:case $.IN_CELL:case $.IN_SELECT:case $.IN_SELECT_IN_TABLE:case $.IN_TEMPLATE:case $.IN_FRAMESET:case $.AFTER_FRAMESET:FQ(this,e);break;case $.IN_TABLE_TEXT:m1(this,e);break;case $.AFTER_BODY:IQ(this,e);break;case $.AFTER_AFTER_BODY:case $.AFTER_AFTER_FRAMESET:LQ(this,e)}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case $.INITIAL:zQ(this,e);break;case $.BEFORE_HEAD:case $.IN_HEAD:case $.IN_HEAD_NO_SCRIPT:case $.AFTER_HEAD:this._err(e,q.misplacedDoctype);break;case $.IN_TABLE_TEXT:m1(this,e)}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,q.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?q1(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case $.INITIAL:BQ(this,e);break;case $.BEFORE_HTML:VQ(this,e);break;case $.BEFORE_HEAD:WQ(this,e);break;case $.IN_HEAD:qQ(this,e);break;case $.IN_HEAD_NO_SCRIPT:ZQ(this,e);break;case $.AFTER_HEAD:e$(this,e);break;case $.IN_BODY:R$(this,e);break;case $.IN_TABLE:l1(this,e);break;case $.IN_TABLE_TEXT:m1(this,e);break;case $.IN_CAPTION:g1(this,e);break;case $.IN_COLUMN_GROUP:v1(this,e);break;case $.IN_TABLE_BODY:x1(this,e);break;case $.IN_ROW:C1(this,e);break;case $.IN_CELL:T1(this,e);break;case $.IN_SELECT:D1(this,e);break;case $.IN_SELECT_IN_TABLE:k1(this,e);break;case $.IN_TEMPLATE:j1(this,e);break;case $.AFTER_BODY:P1(this,e);break;case $.IN_FRAMESET:L1(this,e);break;case $.AFTER_FRAMESET:z1(this,e);break;case $.AFTER_AFTER_BODY:V1(this,e);break;case $.AFTER_AFTER_FRAMESET:U1(this,e)}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?J1(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case $.INITIAL:BQ(this,e);break;case $.BEFORE_HTML:HQ(this,e);break;case $.BEFORE_HEAD:GQ(this,e);break;case $.IN_HEAD:JQ(this,e);break;case $.IN_HEAD_NO_SCRIPT:QQ(this,e);break;case $.AFTER_HEAD:t$(this,e);break;case $.IN_BODY:X$(this,e);break;case $.TEXT:Q$(this,e);break;case $.IN_TABLE:u1(this,e);break;case $.IN_TABLE_TEXT:m1(this,e);break;case $.IN_CAPTION:_1(this,e);break;case $.IN_COLUMN_GROUP:y1(this,e);break;case $.IN_TABLE_BODY:S1(this,e);break;case $.IN_ROW:w1(this,e);break;case $.IN_CELL:E1(this,e);break;case $.IN_SELECT:O1(this,e);break;case $.IN_SELECT_IN_TABLE:A1(this,e);break;case $.IN_TEMPLATE:M1(this,e);break;case $.AFTER_BODY:F1(this,e);break;case $.IN_FRAMESET:R1(this,e);break;case $.AFTER_FRAMESET:B1(this,e);break;case $.AFTER_AFTER_BODY:H1(this,e)}}onEof(e){switch(this.insertionMode){case $.INITIAL:BQ(this,e);break;case $.BEFORE_HTML:UQ(this,e);break;case $.BEFORE_HEAD:KQ(this,e);break;case $.IN_HEAD:XQ(this,e);break;case $.IN_HEAD_NO_SCRIPT:$Q(this,e);break;case $.AFTER_HEAD:n$(this,e);break;case $.IN_BODY:case $.IN_TABLE:case $.IN_CAPTION:case $.IN_COLUMN_GROUP:case $.IN_TABLE_BODY:case $.IN_ROW:case $.IN_CELL:case $.IN_SELECT:case $.IN_SELECT_IN_TABLE:Z$(this,e);break;case $.TEXT:$$(this,e);break;case $.IN_TABLE_TEXT:m1(this,e);break;case $.IN_TEMPLATE:N1(this,e);break;case $.AFTER_BODY:case $.IN_FRAMESET:case $.AFTER_FRAMESET:case $.AFTER_AFTER_BODY:case $.AFTER_AFTER_FRAMESET:RQ(this,e)}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===K.LINE_FEED)){if(e.chars.length===1)return;e.chars=e.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(e);return}switch(this.insertionMode){case $.IN_HEAD:case $.IN_HEAD_NO_SCRIPT:case $.AFTER_HEAD:case $.TEXT:case $.IN_COLUMN_GROUP:case $.IN_SELECT:case $.IN_SELECT_IN_TABLE:case $.IN_FRAMESET:case $.AFTER_FRAMESET:this._insertCharacters(e);break;case $.IN_BODY:case $.IN_CAPTION:case $.IN_CELL:case $.IN_TEMPLATE:case $.AFTER_BODY:case $.AFTER_AFTER_BODY:case $.AFTER_AFTER_FRAMESET:i$(this,e);break;case $.IN_TABLE:case $.IN_TABLE_BODY:case $.IN_ROW:e1(this,e);break;case $.IN_TABLE_TEXT:f1(this,e)}}};function OQ(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):Y$(e,t),n}function kQ(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){let i=e.openElements.items[r];if(i===t.element)break;e._isSpecialElement(i,e.openElements.tagIDs[r])&&(n=i)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function AQ(e,t,n){let r=t,i=e.openElements.getCommonAncestor(t);for(let a=0,o=i;o!==n;a++,o=i){i=e.openElements.getCommonAncestor(o);let n=e.activeFormattingElements.getElementEntry(o),s=n&&a>=3;!n||s?(s&&e.activeFormattingElements.removeEntry(n),e.openElements.remove(o)):(o=jQ(e,n),r===t&&(e.activeFormattingElements.bookmark=n),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(o,r),r=o)}return r}function jQ(e,t){let n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function MQ(e,t,n){let r=EZ(e.treeAdapter.getTagName(t));if(e._isElementCausesFosterParenting(r))e._fosterParentElement(n);else{let i=e.treeAdapter.getNamespaceURI(t);r===X.TEMPLATE&&i===J.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function NQ(e,t,n){let r=e.treeAdapter.getNamespaceURI(n.element),{token:i}=n,a=e.treeAdapter.createElement(i.tagName,r,i.attrs);e._adoptNodes(t,a),e.treeAdapter.appendChild(t,a),e.activeFormattingElements.insertElementAfterBookmark(a,i),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,a,i.tagID)}function PQ(e,t){for(let n=0;n<8;n++){let n=OQ(e,t);if(!n)break;let r=kQ(e,n);if(!r)break;e.activeFormattingElements.bookmark=n;let i=AQ(e,r,n.element),a=e.openElements.getCommonAncestor(n.element);e.treeAdapter.detachNode(i),a&&MQ(e,a,i),NQ(e,r,n)}}function FQ(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function IQ(e,t){e._appendCommentNode(t,e.openElements.items[0])}function LQ(e,t){e._appendCommentNode(t,e.document)}function RQ(e,t){if(e.stopped=!0,t.location){let n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){let n=e.openElements.items[0],r=e.treeAdapter.getNodeSourceCodeLocation(n);if(r&&!r.endTag&&(e._setEndLocation(n,t),e.openElements.stackTop>=1)){let n=e.openElements.items[1],r=e.treeAdapter.getNodeSourceCodeLocation(n);r&&!r.endTag&&e._setEndLocation(n,t)}}}}function zQ(e,t){e._setDocumentType(t);let n=t.forceQuirks?wZ.QUIRKS:uQ(t);lQ(t)||e._err(t,q.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=$.BEFORE_HTML}function BQ(e,t){e._err(t,q.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,wZ.QUIRKS),e.insertionMode=$.BEFORE_HTML,e._processToken(t)}function VQ(e,t){t.tagID===X.HTML?(e._insertElement(t,J.HTML),e.insertionMode=$.BEFORE_HEAD):UQ(e,t)}function HQ(e,t){let n=t.tagID;(n===X.HTML||n===X.HEAD||n===X.BODY||n===X.BR)&&UQ(e,t)}function UQ(e,t){e._insertFakeRootElement(),e.insertionMode=$.BEFORE_HEAD,e._processToken(t)}function WQ(e,t){switch(t.tagID){case X.HTML:R$(e,t);break;case X.HEAD:e._insertElement(t,J.HTML),e.headElement=e.openElements.current,e.insertionMode=$.IN_HEAD;break;default:KQ(e,t)}}function GQ(e,t){let n=t.tagID;n===X.HEAD||n===X.BODY||n===X.HTML||n===X.BR?KQ(e,t):e._err(t,q.endTagWithoutMatchingOpenElement)}function KQ(e,t){e._insertFakeElement(Y.HEAD,X.HEAD),e.headElement=e.openElements.current,e.insertionMode=$.IN_HEAD,e._processToken(t)}function qQ(e,t){switch(t.tagID){case X.HTML:R$(e,t);break;case X.BASE:case X.BASEFONT:case X.BGSOUND:case X.LINK:case X.META:e._appendElement(t,J.HTML),t.ackSelfClosing=!0;break;case X.TITLE:e._switchToTextParsing(t,kZ.RCDATA);break;case X.NOSCRIPT:e.options.scriptingEnabled?e._switchToTextParsing(t,kZ.RAWTEXT):(e._insertElement(t,J.HTML),e.insertionMode=$.IN_HEAD_NO_SCRIPT);break;case X.NOFRAMES:case X.STYLE:e._switchToTextParsing(t,kZ.RAWTEXT);break;case X.SCRIPT:e._switchToTextParsing(t,kZ.SCRIPT_DATA);break;case X.TEMPLATE:e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=$.IN_TEMPLATE,e.tmplInsertionModeStack.unshift($.IN_TEMPLATE);break;case X.HEAD:e._err(t,q.misplacedStartTagForHeadElement);break;default:XQ(e,t)}}function JQ(e,t){switch(t.tagID){case X.HEAD:e.openElements.pop(),e.insertionMode=$.AFTER_HEAD;break;case X.BODY:case X.BR:case X.HTML:XQ(e,t);break;case X.TEMPLATE:YQ(e,t);break;default:e._err(t,q.endTagWithoutMatchingOpenElement)}}function YQ(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==X.TEMPLATE&&e._err(t,q.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(X.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,q.endTagWithoutMatchingOpenElement)}function XQ(e,t){e.openElements.pop(),e.insertionMode=$.AFTER_HEAD,e._processToken(t)}function ZQ(e,t){switch(t.tagID){case X.HTML:R$(e,t);break;case X.BASEFONT:case X.BGSOUND:case X.HEAD:case X.LINK:case X.META:case X.NOFRAMES:case X.STYLE:qQ(e,t);break;case X.NOSCRIPT:e._err(t,q.nestedNoscriptInHead);break;default:$Q(e,t)}}function QQ(e,t){switch(t.tagID){case X.NOSCRIPT:e.openElements.pop(),e.insertionMode=$.IN_HEAD;break;case X.BR:$Q(e,t);break;default:e._err(t,q.endTagWithoutMatchingOpenElement)}}function $Q(e,t){let n=t.type===cZ.EOF?q.openElementsLeftAfterEof:q.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=$.IN_HEAD,e._processToken(t)}function e$(e,t){switch(t.tagID){case X.HTML:R$(e,t);break;case X.BODY:e._insertElement(t,J.HTML),e.framesetOk=!1,e.insertionMode=$.IN_BODY;break;case X.FRAMESET:e._insertElement(t,J.HTML),e.insertionMode=$.IN_FRAMESET;break;case X.BASE:case X.BASEFONT:case X.BGSOUND:case X.LINK:case X.META:case X.NOFRAMES:case X.SCRIPT:case X.STYLE:case X.TEMPLATE:case X.TITLE:e._err(t,q.abandonedHeadElementChild),e.openElements.push(e.headElement,X.HEAD),qQ(e,t),e.openElements.remove(e.headElement);break;case X.HEAD:e._err(t,q.misplacedStartTagForHeadElement);break;default:n$(e,t)}}function t$(e,t){switch(t.tagID){case X.BODY:case X.HTML:case X.BR:n$(e,t);break;case X.TEMPLATE:YQ(e,t);break;default:e._err(t,q.endTagWithoutMatchingOpenElement)}}function n$(e,t){e._insertFakeElement(Y.BODY,X.BODY),e.insertionMode=$.IN_BODY,r$(e,t)}function r$(e,t){switch(t.type){case cZ.CHARACTER:a$(e,t);break;case cZ.WHITESPACE_CHARACTER:i$(e,t);break;case cZ.COMMENT:FQ(e,t);break;case cZ.START_TAG:R$(e,t);break;case cZ.END_TAG:X$(e,t);break;case cZ.EOF:Z$(e,t)}}function i$(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function a$(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function o$(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function s$(e,t){let n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function c$(e,t){let n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,J.HTML),e.insertionMode=$.IN_FRAMESET)}function l$(e,t){e.openElements.hasInButtonScope(X.P)&&e._closePElement(),e._insertElement(t,J.HTML)}function u$(e,t){e.openElements.hasInButtonScope(X.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&OZ.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,J.HTML)}function d$(e,t){e.openElements.hasInButtonScope(X.P)&&e._closePElement(),e._insertElement(t,J.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function f$(e,t){let n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(X.P)&&e._closePElement(),e._insertElement(t,J.HTML),n||(e.formElement=e.openElements.current))}function p$(e,t){e.framesetOk=!1;let n=t.tagID;for(let t=e.openElements.stackTop;t>=0;t--){let r=e.openElements.tagIDs[t];if(n===X.LI&&r===X.LI||(n===X.DD||n===X.DT)&&(r===X.DD||r===X.DT)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.popUntilTagNamePopped(r);break}if(r!==X.ADDRESS&&r!==X.DIV&&r!==X.P&&e._isSpecialElement(e.openElements.items[t],r))break}e.openElements.hasInButtonScope(X.P)&&e._closePElement(),e._insertElement(t,J.HTML)}function m$(e,t){e.openElements.hasInButtonScope(X.P)&&e._closePElement(),e._insertElement(t,J.HTML),e.tokenizer.state=kZ.PLAINTEXT}function h$(e,t){e.openElements.hasInScope(X.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(X.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,J.HTML),e.framesetOk=!1}function g$(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(Y.A);n&&(PQ(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,J.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function _$(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,J.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function v$(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(X.NOBR)&&(PQ(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,J.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function y$(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,J.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function b$(e,t){e.treeAdapter.getDocumentMode(e.document)!==wZ.QUIRKS&&e.openElements.hasInButtonScope(X.P)&&e._closePElement(),e._insertElement(t,J.HTML),e.framesetOk=!1,e.insertionMode=$.IN_TABLE}function x$(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,J.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function S$(e){let t=lZ(e,CZ.TYPE);return t!=null&&t.toLowerCase()===`hidden`}function C$(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,J.HTML),S$(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function w$(e,t){e._appendElement(t,J.HTML),t.ackSelfClosing=!0}function T$(e,t){e.openElements.hasInButtonScope(X.P)&&e._closePElement(),e._appendElement(t,J.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function E$(e,t){t.tagName=Y.IMG,t.tagID=X.IMG,x$(e,t)}function D$(e,t){e._insertElement(t,J.HTML),e.skipNextNewLine=!0,e.tokenizer.state=kZ.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=$.TEXT}function O$(e,t){e.openElements.hasInButtonScope(X.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,kZ.RAWTEXT)}function k$(e,t){e.framesetOk=!1,e._switchToTextParsing(t,kZ.RAWTEXT)}function A$(e,t){e._switchToTextParsing(t,kZ.RAWTEXT)}function j$(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,J.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===$.IN_TABLE||e.insertionMode===$.IN_CAPTION||e.insertionMode===$.IN_TABLE_BODY||e.insertionMode===$.IN_ROW||e.insertionMode===$.IN_CELL?$.IN_SELECT_IN_TABLE:$.IN_SELECT}function M$(e,t){e.openElements.currentTagId===X.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,J.HTML)}function N$(e,t){e.openElements.hasInScope(X.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,J.HTML)}function P$(e,t){e.openElements.hasInScope(X.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(X.RTC),e._insertElement(t,J.HTML)}function F$(e,t){e._reconstructActiveFormattingElements(),_Q(t),yQ(t),t.selfClosing?e._appendElement(t,J.MATHML):e._insertElement(t,J.MATHML),t.ackSelfClosing=!0}function I$(e,t){e._reconstructActiveFormattingElements(),vQ(t),yQ(t),t.selfClosing?e._appendElement(t,J.SVG):e._insertElement(t,J.SVG),t.ackSelfClosing=!0}function L$(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,J.HTML)}function R$(e,t){switch(t.tagID){case X.I:case X.S:case X.B:case X.U:case X.EM:case X.TT:case X.BIG:case X.CODE:case X.FONT:case X.SMALL:case X.STRIKE:case X.STRONG:_$(e,t);break;case X.A:g$(e,t);break;case X.H1:case X.H2:case X.H3:case X.H4:case X.H5:case X.H6:u$(e,t);break;case X.P:case X.DL:case X.OL:case X.UL:case X.DIV:case X.DIR:case X.NAV:case X.MAIN:case X.MENU:case X.ASIDE:case X.CENTER:case X.FIGURE:case X.FOOTER:case X.HEADER:case X.HGROUP:case X.DIALOG:case X.DETAILS:case X.ADDRESS:case X.ARTICLE:case X.SEARCH:case X.SECTION:case X.SUMMARY:case X.FIELDSET:case X.BLOCKQUOTE:case X.FIGCAPTION:l$(e,t);break;case X.LI:case X.DD:case X.DT:p$(e,t);break;case X.BR:case X.IMG:case X.WBR:case X.AREA:case X.EMBED:case X.KEYGEN:x$(e,t);break;case X.HR:T$(e,t);break;case X.RB:case X.RTC:N$(e,t);break;case X.RT:case X.RP:P$(e,t);break;case X.PRE:case X.LISTING:d$(e,t);break;case X.XMP:O$(e,t);break;case X.SVG:I$(e,t);break;case X.HTML:o$(e,t);break;case X.BASE:case X.LINK:case X.META:case X.STYLE:case X.TITLE:case X.SCRIPT:case X.BGSOUND:case X.BASEFONT:case X.TEMPLATE:qQ(e,t);break;case X.BODY:s$(e,t);break;case X.FORM:f$(e,t);break;case X.NOBR:v$(e,t);break;case X.MATH:F$(e,t);break;case X.TABLE:b$(e,t);break;case X.INPUT:C$(e,t);break;case X.PARAM:case X.TRACK:case X.SOURCE:w$(e,t);break;case X.IMAGE:E$(e,t);break;case X.BUTTON:h$(e,t);break;case X.APPLET:case X.OBJECT:case X.MARQUEE:y$(e,t);break;case X.IFRAME:k$(e,t);break;case X.SELECT:j$(e,t);break;case X.OPTION:case X.OPTGROUP:M$(e,t);break;case X.NOEMBED:case X.NOFRAMES:A$(e,t);break;case X.FRAMESET:c$(e,t);break;case X.TEXTAREA:D$(e,t);break;case X.NOSCRIPT:e.options.scriptingEnabled?A$(e,t):L$(e,t);break;case X.PLAINTEXT:m$(e,t);break;case X.COL:case X.TH:case X.TD:case X.TR:case X.HEAD:case X.FRAME:case X.TBODY:case X.TFOOT:case X.THEAD:case X.CAPTION:case X.COLGROUP:break;default:L$(e,t)}}function z$(e,t){if(e.openElements.hasInScope(X.BODY)&&(e.insertionMode=$.AFTER_BODY,e.options.sourceCodeLocationInfo)){let n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function B$(e,t){e.openElements.hasInScope(X.BODY)&&(e.insertionMode=$.AFTER_BODY,F1(e,t))}function V$(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function H$(e){let t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(X.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(X.FORM):n&&e.openElements.remove(n))}function U$(e){e.openElements.hasInButtonScope(X.P)||e._insertFakeElement(Y.P,X.P),e._closePElement()}function W$(e){e.openElements.hasInListItemScope(X.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(X.LI),e.openElements.popUntilTagNamePopped(X.LI))}function G$(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function K$(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function q$(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function J$(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(Y.BR,X.BR),e.openElements.pop(),e.framesetOk=!1}function Y$(e,t){let n=t.tagName,r=t.tagID;for(let t=e.openElements.stackTop;t>0;t--){let i=e.openElements.items[t],a=e.openElements.tagIDs[t];if(r===a&&(r!==X.UNKNOWN||e.treeAdapter.getTagName(i)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=t&&e.openElements.shortenToLength(t);break}if(e._isSpecialElement(i,a))break}}function X$(e,t){switch(t.tagID){case X.A:case X.B:case X.I:case X.S:case X.U:case X.EM:case X.TT:case X.BIG:case X.CODE:case X.FONT:case X.NOBR:case X.SMALL:case X.STRIKE:case X.STRONG:PQ(e,t);break;case X.P:U$(e);break;case X.DL:case X.UL:case X.OL:case X.DIR:case X.DIV:case X.NAV:case X.PRE:case X.MAIN:case X.MENU:case X.ASIDE:case X.BUTTON:case X.CENTER:case X.FIGURE:case X.FOOTER:case X.HEADER:case X.HGROUP:case X.DIALOG:case X.ADDRESS:case X.ARTICLE:case X.DETAILS:case X.SEARCH:case X.SECTION:case X.SUMMARY:case X.LISTING:case X.FIELDSET:case X.BLOCKQUOTE:case X.FIGCAPTION:V$(e,t);break;case X.LI:W$(e);break;case X.DD:case X.DT:G$(e,t);break;case X.H1:case X.H2:case X.H3:case X.H4:case X.H5:case X.H6:K$(e);break;case X.BR:J$(e);break;case X.BODY:z$(e,t);break;case X.HTML:B$(e,t);break;case X.FORM:H$(e);break;case X.APPLET:case X.OBJECT:case X.MARQUEE:q$(e,t);break;case X.TEMPLATE:YQ(e,t);break;default:Y$(e,t)}}function Z$(e,t){e.tmplInsertionModeStack.length>0?N1(e,t):RQ(e,t)}function Q$(e,t){var n;t.tagID===X.SCRIPT&&((n=e.scriptHandler)==null||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function $$(e,t){e._err(t,q.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function e1(e,t){if(e.openElements.currentTagId!==void 0&&TQ.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=$.IN_TABLE_TEXT,t.type){case cZ.CHARACTER:p1(e,t);break;case cZ.WHITESPACE_CHARACTER:f1(e,t)}else d1(e,t)}function t1(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,J.HTML),e.insertionMode=$.IN_CAPTION}function n1(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,J.HTML),e.insertionMode=$.IN_COLUMN_GROUP}function r1(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(Y.COLGROUP,X.COLGROUP),e.insertionMode=$.IN_COLUMN_GROUP,v1(e,t)}function i1(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,J.HTML),e.insertionMode=$.IN_TABLE_BODY}function a1(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(Y.TBODY,X.TBODY),e.insertionMode=$.IN_TABLE_BODY,x1(e,t)}function o1(e,t){e.openElements.hasInTableScope(X.TABLE)&&(e.openElements.popUntilTagNamePopped(X.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function s1(e,t){S$(t)?e._appendElement(t,J.HTML):d1(e,t),t.ackSelfClosing=!0}function c1(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,J.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function l1(e,t){switch(t.tagID){case X.TD:case X.TH:case X.TR:a1(e,t);break;case X.STYLE:case X.SCRIPT:case X.TEMPLATE:qQ(e,t);break;case X.COL:r1(e,t);break;case X.FORM:c1(e,t);break;case X.TABLE:o1(e,t);break;case X.TBODY:case X.TFOOT:case X.THEAD:i1(e,t);break;case X.INPUT:s1(e,t);break;case X.CAPTION:t1(e,t);break;case X.COLGROUP:n1(e,t);break;default:d1(e,t)}}function u1(e,t){switch(t.tagID){case X.TABLE:e.openElements.hasInTableScope(X.TABLE)&&(e.openElements.popUntilTagNamePopped(X.TABLE),e._resetInsertionMode());break;case X.TEMPLATE:YQ(e,t);break;case X.BODY:case X.CAPTION:case X.COL:case X.COLGROUP:case X.HTML:case X.TBODY:case X.TD:case X.TFOOT:case X.TH:case X.THEAD:case X.TR:break;default:d1(e,t)}}function d1(e,t){let n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,r$(e,t),e.fosterParentingEnabled=n}function f1(e,t){e.pendingCharacterTokens.push(t)}function p1(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function m1(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)d1(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const h1=new Set([X.CAPTION,X.COL,X.COLGROUP,X.TBODY,X.TD,X.TFOOT,X.TH,X.THEAD,X.TR]);function g1(e,t){let n=t.tagID;h1.has(n)?e.openElements.hasInTableScope(X.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(X.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=$.IN_TABLE,l1(e,t)):R$(e,t)}function _1(e,t){let n=t.tagID;switch(n){case X.CAPTION:case X.TABLE:e.openElements.hasInTableScope(X.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(X.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=$.IN_TABLE,n===X.TABLE&&u1(e,t));break;case X.BODY:case X.COL:case X.COLGROUP:case X.HTML:case X.TBODY:case X.TD:case X.TFOOT:case X.TH:case X.THEAD:case X.TR:break;default:X$(e,t)}}function v1(e,t){switch(t.tagID){case X.HTML:R$(e,t);break;case X.COL:e._appendElement(t,J.HTML),t.ackSelfClosing=!0;break;case X.TEMPLATE:qQ(e,t);break;default:b1(e,t)}}function y1(e,t){switch(t.tagID){case X.COLGROUP:e.openElements.currentTagId===X.COLGROUP&&(e.openElements.pop(),e.insertionMode=$.IN_TABLE);break;case X.TEMPLATE:YQ(e,t);break;case X.COL:break;default:b1(e,t)}}function b1(e,t){e.openElements.currentTagId===X.COLGROUP&&(e.openElements.pop(),e.insertionMode=$.IN_TABLE,e._processToken(t))}function x1(e,t){switch(t.tagID){case X.TR:e.openElements.clearBackToTableBodyContext(),e._insertElement(t,J.HTML),e.insertionMode=$.IN_ROW;break;case X.TH:case X.TD:e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(Y.TR,X.TR),e.insertionMode=$.IN_ROW,C1(e,t);break;case X.CAPTION:case X.COL:case X.COLGROUP:case X.TBODY:case X.TFOOT:case X.THEAD:e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE,l1(e,t));break;default:l1(e,t)}}function S1(e,t){let n=t.tagID;switch(t.tagID){case X.TBODY:case X.TFOOT:case X.THEAD:e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE);break;case X.TABLE:e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE,u1(e,t));break;case X.BODY:case X.CAPTION:case X.COL:case X.COLGROUP:case X.HTML:case X.TD:case X.TH:case X.TR:break;default:u1(e,t)}}function C1(e,t){switch(t.tagID){case X.TH:case X.TD:e.openElements.clearBackToTableRowContext(),e._insertElement(t,J.HTML),e.insertionMode=$.IN_CELL,e.activeFormattingElements.insertMarker();break;case X.CAPTION:case X.COL:case X.COLGROUP:case X.TBODY:case X.TFOOT:case X.THEAD:case X.TR:e.openElements.hasInTableScope(X.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE_BODY,x1(e,t));break;default:l1(e,t)}}function w1(e,t){switch(t.tagID){case X.TR:e.openElements.hasInTableScope(X.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE_BODY);break;case X.TABLE:e.openElements.hasInTableScope(X.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE_BODY,S1(e,t));break;case X.TBODY:case X.TFOOT:case X.THEAD:(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(X.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE_BODY,S1(e,t));break;case X.BODY:case X.CAPTION:case X.COL:case X.COLGROUP:case X.HTML:case X.TD:case X.TH:break;default:u1(e,t)}}function T1(e,t){let n=t.tagID;h1.has(n)?(e.openElements.hasInTableScope(X.TD)||e.openElements.hasInTableScope(X.TH))&&(e._closeTableCell(),C1(e,t)):R$(e,t)}function E1(e,t){let n=t.tagID;switch(n){case X.TD:case X.TH:e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=$.IN_ROW);break;case X.TABLE:case X.TBODY:case X.TFOOT:case X.THEAD:case X.TR:e.openElements.hasInTableScope(n)&&(e._closeTableCell(),w1(e,t));break;case X.BODY:case X.CAPTION:case X.COL:case X.COLGROUP:case X.HTML:break;default:X$(e,t)}}function D1(e,t){switch(t.tagID){case X.HTML:R$(e,t);break;case X.OPTION:e.openElements.currentTagId===X.OPTION&&e.openElements.pop(),e._insertElement(t,J.HTML);break;case X.OPTGROUP:e.openElements.currentTagId===X.OPTION&&e.openElements.pop(),e.openElements.currentTagId===X.OPTGROUP&&e.openElements.pop(),e._insertElement(t,J.HTML);break;case X.HR:e.openElements.currentTagId===X.OPTION&&e.openElements.pop(),e.openElements.currentTagId===X.OPTGROUP&&e.openElements.pop(),e._appendElement(t,J.HTML),t.ackSelfClosing=!0;break;case X.INPUT:case X.KEYGEN:case X.TEXTAREA:case X.SELECT:e.openElements.hasInSelectScope(X.SELECT)&&(e.openElements.popUntilTagNamePopped(X.SELECT),e._resetInsertionMode(),t.tagID!==X.SELECT&&e._processStartTag(t));break;case X.SCRIPT:case X.TEMPLATE:qQ(e,t)}}function O1(e,t){switch(t.tagID){case X.OPTGROUP:e.openElements.stackTop>0&&e.openElements.currentTagId===X.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===X.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===X.OPTGROUP&&e.openElements.pop();break;case X.OPTION:e.openElements.currentTagId===X.OPTION&&e.openElements.pop();break;case X.SELECT:e.openElements.hasInSelectScope(X.SELECT)&&(e.openElements.popUntilTagNamePopped(X.SELECT),e._resetInsertionMode());break;case X.TEMPLATE:YQ(e,t)}}function k1(e,t){let n=t.tagID;n===X.CAPTION||n===X.TABLE||n===X.TBODY||n===X.TFOOT||n===X.THEAD||n===X.TR||n===X.TD||n===X.TH?(e.openElements.popUntilTagNamePopped(X.SELECT),e._resetInsertionMode(),e._processStartTag(t)):D1(e,t)}function A1(e,t){let n=t.tagID;n===X.CAPTION||n===X.TABLE||n===X.TBODY||n===X.TFOOT||n===X.THEAD||n===X.TR||n===X.TD||n===X.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(X.SELECT),e._resetInsertionMode(),e.onEndTag(t)):O1(e,t)}function j1(e,t){switch(t.tagID){case X.BASE:case X.BASEFONT:case X.BGSOUND:case X.LINK:case X.META:case X.NOFRAMES:case X.SCRIPT:case X.STYLE:case X.TEMPLATE:case X.TITLE:qQ(e,t);break;case X.CAPTION:case X.COLGROUP:case X.TBODY:case X.TFOOT:case X.THEAD:e.tmplInsertionModeStack[0]=$.IN_TABLE,e.insertionMode=$.IN_TABLE,l1(e,t);break;case X.COL:e.tmplInsertionModeStack[0]=$.IN_COLUMN_GROUP,e.insertionMode=$.IN_COLUMN_GROUP,v1(e,t);break;case X.TR:e.tmplInsertionModeStack[0]=$.IN_TABLE_BODY,e.insertionMode=$.IN_TABLE_BODY,x1(e,t);break;case X.TD:case X.TH:e.tmplInsertionModeStack[0]=$.IN_ROW,e.insertionMode=$.IN_ROW,C1(e,t);break;default:e.tmplInsertionModeStack[0]=$.IN_BODY,e.insertionMode=$.IN_BODY,R$(e,t)}}function M1(e,t){t.tagID===X.TEMPLATE&&YQ(e,t)}function N1(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(X.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):RQ(e,t)}function P1(e,t){t.tagID===X.HTML?R$(e,t):I1(e,t)}function F1(e,t){if(t.tagID===X.HTML){if(e.fragmentContext||(e.insertionMode=$.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===X.HTML){e._setEndLocation(e.openElements.items[0],t);let n=e.openElements.items[1];n&&!e.treeAdapter.getNodeSourceCodeLocation(n)?.endTag&&e._setEndLocation(n,t)}}else I1(e,t)}function I1(e,t){e.insertionMode=$.IN_BODY,r$(e,t)}function L1(e,t){switch(t.tagID){case X.HTML:R$(e,t);break;case X.FRAMESET:e._insertElement(t,J.HTML);break;case X.FRAME:e._appendElement(t,J.HTML),t.ackSelfClosing=!0;break;case X.NOFRAMES:qQ(e,t)}}function R1(e,t){t.tagID===X.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==X.FRAMESET&&(e.insertionMode=$.AFTER_FRAMESET))}function z1(e,t){switch(t.tagID){case X.HTML:R$(e,t);break;case X.NOFRAMES:qQ(e,t)}}function B1(e,t){t.tagID===X.HTML&&(e.insertionMode=$.AFTER_AFTER_FRAMESET)}function V1(e,t){t.tagID===X.HTML?R$(e,t):H1(e,t)}function H1(e,t){e.insertionMode=$.IN_BODY,r$(e,t)}function U1(e,t){switch(t.tagID){case X.HTML:R$(e,t);break;case X.NOFRAMES:qQ(e,t)}}function W1(e,t){t.chars=`�`,e._insertCharacters(t)}function G1(e,t){e._insertCharacters(t),e.framesetOk=!1}function K1(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==J.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function q1(e,t){if(gQ(t))K1(e),e._startTagOutsideForeignContent(t);else{let n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===J.MATHML?_Q(t):r===J.SVG&&(bQ(t),vQ(t)),yQ(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function J1(e,t){if(t.tagID===X.P||t.tagID===X.BR){K1(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){let r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===J.HTML){e._endTagOutsideForeignContent(t);break}let i=e.treeAdapter.getTagName(r);if(i.toLowerCase()===t.tagName){t.tagName=i,e.openElements.shortenToLength(n);break}}}Y.AREA,Y.BASE,Y.BASEFONT,Y.BGSOUND,Y.BR,Y.COL,Y.EMBED,Y.FRAME,Y.HR,Y.IMG,Y.INPUT,Y.KEYGEN,Y.LINK,Y.META,Y.PARAM,Y.SOURCE,Y.TRACK,Y.WBR;function Y1(e,t){return DQ.parse(e,t)}function X1(e,t,n){typeof e==`string`&&(n=t,t=e,e=null);let r=DQ.getFragmentParser(e,n);return r.tokenizer.write(t,!0),r.getFragment()}const Z1={abandonedHeadElementChild:{reason:`Unexpected metadata element after head`,description:"Unexpected element after head. Expected the element before `</head>`",url:!1},abruptClosingOfEmptyComment:{reason:`Unexpected abruptly closed empty comment`,description:"Unexpected `>` or `->`. Expected `-->` to close comments"},abruptDoctypePublicIdentifier:{reason:`Unexpected abruptly closed public identifier`,description:"Unexpected `>`. Expected a closing `\"` or `'` after the public identifier"},abruptDoctypeSystemIdentifier:{reason:`Unexpected abruptly closed system identifier`,description:"Unexpected `>`. Expected a closing `\"` or `'` after the identifier identifier"},absenceOfDigitsInNumericCharacterReference:{reason:`Unexpected non-digit at start of numeric character reference`,description:"Unexpected `%c`. Expected `[0-9]` for decimal references or `[0-9a-fA-F]` for hexadecimal references"},cdataInHtmlContent:{reason:`Unexpected CDATA section in HTML`,description:"Unexpected `<![CDATA[` in HTML. Remove it, use a comment, or encode special characters instead"},characterReferenceOutsideUnicodeRange:{reason:`Unexpected too big numeric character reference`,description:`Unexpectedly high character reference. Expected character references to be at most hexadecimal 10ffff (or decimal 1114111)`},closingOfElementWithOpenChildElements:{reason:`Unexpected closing tag with open child elements`,description:`Unexpectedly closing tag. Expected other tags to be closed first`,url:!1},controlCharacterInInputStream:{reason:`Unexpected control character`,description:"Unexpected control character `%x`. Expected a non-control code point, 0x00, or ASCII whitespace"},controlCharacterReference:{reason:`Unexpected control character reference`,description:`Unexpectedly control character in reference. Expected a non-control code point, 0x00, or ASCII whitespace`},disallowedContentInNoscriptInHead:{reason:"Disallowed content inside `<noscript>` in `<head>`",description:"Unexpected text character `%c`. Only use text in `<noscript>`s in `<body>`",url:!1},duplicateAttribute:{reason:`Unexpected duplicate attribute`,description:`Unexpectedly double attribute. Expected attributes to occur only once`},endTagWithAttributes:{reason:`Unexpected attribute on closing tag`,description:"Unexpected attribute. Expected `>` instead"},endTagWithTrailingSolidus:{reason:`Unexpected slash at end of closing tag`,description:"Unexpected `%c-1`. Expected `>` instead"},endTagWithoutMatchingOpenElement:{reason:`Unexpected unopened end tag`,description:`Unexpected end tag. Expected no end tag or another end tag`,url:!1},eofBeforeTagName:{reason:`Unexpected end of file`,description:`Unexpected end of file. Expected tag name instead`},eofInCdata:{reason:`Unexpected end of file in CDATA`,description:"Unexpected end of file. Expected `]]>` to close the CDATA"},eofInComment:{reason:`Unexpected end of file in comment`,description:"Unexpected end of file. Expected `-->` to close the comment"},eofInDoctype:{reason:`Unexpected end of file in doctype`,description:"Unexpected end of file. Expected a valid doctype (such as `<!doctype html>`)"},eofInElementThatCanContainOnlyText:{reason:`Unexpected end of file in element that can only contain text`,description:`Unexpected end of file. Expected text or a closing tag`,url:!1},eofInScriptHtmlCommentLikeText:{reason:`Unexpected end of file in comment inside script`,description:"Unexpected end of file. Expected `-->` to close the comment"},eofInTag:{reason:`Unexpected end of file in tag`,description:"Unexpected end of file. Expected `>` to close the tag"},incorrectlyClosedComment:{reason:`Incorrectly closed comment`,description:"Unexpected `%c-1`. Expected `-->` to close the comment"},incorrectlyOpenedComment:{reason:`Incorrectly opened comment`,description:"Unexpected `%c`. Expected `<!--` to open the comment"},invalidCharacterSequenceAfterDoctypeName:{reason:`Invalid sequence after doctype name`,description:"Unexpected sequence at `%c`. Expected `public` or `system`"},invalidFirstCharacterOfTagName:{reason:`Invalid first character in tag name`,description:"Unexpected `%c`. Expected an ASCII letter instead"},misplacedDoctype:{reason:`Misplaced doctype`,description:`Unexpected doctype. Expected doctype before head`,url:!1},misplacedStartTagForHeadElement:{reason:"Misplaced `<head>` start tag",description:"Unexpected start tag `<head>`. Expected `<head>` directly after doctype",url:!1},missingAttributeValue:{reason:`Missing attribute value`,description:"Unexpected `%c-1`. Expected an attribute value or no `%c-1` instead"},missingDoctype:{reason:`Missing doctype before other content`,description:"Expected a `<!doctype html>` before anything else",url:!1},missingDoctypeName:{reason:`Missing doctype name`,description:"Unexpected doctype end at `%c`. Expected `html` instead"},missingDoctypePublicIdentifier:{reason:`Missing public identifier in doctype`,description:"Unexpected `%c`. Expected identifier for `public` instead"},missingDoctypeSystemIdentifier:{reason:`Missing system identifier in doctype`,description:'Unexpected `%c`. Expected identifier for `system` instead (suggested: `"about:legacy-compat"`)'},missingEndTagName:{reason:`Missing name in end tag`,description:"Unexpected `%c`. Expected an ASCII letter instead"},missingQuoteBeforeDoctypePublicIdentifier:{reason:`Missing quote before public identifier in doctype`,description:"Unexpected `%c`. Expected `\"` or `'` instead"},missingQuoteBeforeDoctypeSystemIdentifier:{reason:`Missing quote before system identifier in doctype`,description:"Unexpected `%c`. Expected `\"` or `'` instead"},missingSemicolonAfterCharacterReference:{reason:`Missing semicolon after character reference`,description:"Unexpected `%c`. Expected `;` instead"},missingWhitespaceAfterDoctypePublicKeyword:{reason:`Missing whitespace after public identifier in doctype`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceAfterDoctypeSystemKeyword:{reason:`Missing whitespace after system identifier in doctype`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceBeforeDoctypeName:{reason:`Missing whitespace before doctype name`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceBetweenAttributes:{reason:`Missing whitespace between attributes`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers:{reason:`Missing whitespace between public and system identifiers in doctype`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},nestedComment:{reason:`Unexpected nested comment`,description:"Unexpected `<!--`. Expected `-->`"},nestedNoscriptInHead:{reason:"Unexpected nested `<noscript>` in `<head>`",description:"Unexpected `<noscript>`. Expected a closing tag or a meta element",url:!1},nonConformingDoctype:{reason:`Unexpected non-conforming doctype declaration`,description:'Expected `<!doctype html>` or `<!doctype html system "about:legacy-compat">`',url:!1},nonVoidHtmlElementStartTagWithTrailingSolidus:{reason:`Unexpected trailing slash on start tag of non-void element`,description:"Unexpected `/`. Expected `>` instead"},noncharacterCharacterReference:{reason:`Unexpected noncharacter code point referenced by character reference`,description:`Unexpected code point. Do not use noncharacters in HTML`},noncharacterInInputStream:{reason:`Unexpected noncharacter character`,description:"Unexpected code point `%x`. Do not use noncharacters in HTML"},nullCharacterReference:{reason:`Unexpected NULL character referenced by character reference`,description:`Unexpected code point. Do not use NULL characters in HTML`},openElementsLeftAfterEof:{reason:`Unexpected end of file`,description:`Unexpected end of file. Expected closing tag instead`,url:!1},surrogateCharacterReference:{reason:`Unexpected surrogate character referenced by character reference`,description:`Unexpected code point. Do not use lone surrogate characters in HTML`},surrogateInInputStream:{reason:`Unexpected surrogate character`,description:"Unexpected code point `%x`. Do not use lone surrogate characters in HTML"},unexpectedCharacterAfterDoctypeSystemIdentifier:{reason:`Invalid character after system identifier in doctype`,description:"Unexpected character at `%c`. Expected `>`"},unexpectedCharacterInAttributeName:{reason:`Unexpected character in attribute name`,description:"Unexpected `%c`. Expected whitespace, `/`, `>`, `=`, or probably an ASCII letter"},unexpectedCharacterInUnquotedAttributeValue:{reason:`Unexpected character in unquoted attribute value`,description:"Unexpected `%c`. Quote the attribute value to include it"},unexpectedEqualsSignBeforeAttributeName:{reason:`Unexpected equals sign before attribute name`,description:"Unexpected `%c`. Add an attribute name before it"},unexpectedNullCharacter:{reason:`Unexpected NULL character`,description:"Unexpected code point `%x`. Do not use NULL characters in HTML"},unexpectedQuestionMarkInsteadOfTagName:{reason:`Unexpected question mark instead of tag name`,description:"Unexpected `%c`. Expected an ASCII letter instead"},unexpectedSolidusInTag:{reason:`Unexpected slash in tag`,description:"Unexpected `%c-1`. Expected it followed by `>` or in a quoted attribute value"},unknownNamedCharacterReference:{reason:`Unexpected unknown named character reference`,description:`Unexpected character reference. Expected known named character references`}},Q1=/-[a-z]/g,$1=/%c(?:([-+])(\d+))?/g,e0=/%x/g,t0={2:!0,1:!1,0:null},n0={};function r0(e,t){let n=t||n0,r=n.onerror,i=e instanceof Rw?e:new Rw(e),a=n.fragment?X1:Y1,o=String(i);return KX(a(o,{sourceCodeLocationInfo:!0,onParseError:n.onerror?s:null,scriptingEnabled:!1}),{file:i,space:n.space,verbose:n.verbose});function s(e){let t=e.code,a=i0(t),s=n[a]??!0,c=typeof s==`number`?s:+!!s;if(c){let n=Z1[a],o=new Fw(l(n.reason),{place:{start:{line:e.startLine,column:e.startCol,offset:e.startOffset},end:{line:e.endLine,column:e.endCol,offset:e.endOffset}},ruleId:t,source:`hast-util-from-html`});i.path&&(o.file=i.path,o.name=i.path+`:`+o.name),o.fatal=t0[c],o.note=l(n.description),o.url=n.url===!1?void 0:`https://html.spec.whatwg.org/multipage/parsing.html#parse-error-`+t,r(o)}function l(t){return t.replace($1,n).replace(e0,r);function n(t,n,r){let i=(r?Number.parseInt(r,10):0)*(n===`-`?-1:1);return o0(o.charAt(e.startOffset+i))}function r(){return s0(o.charCodeAt(e.startOffset))}}}}function i0(e){return e.replace(Q1,a0)}function a0(e){return e.charAt(1).toUpperCase()}function o0(e){return e==="`"?"` ` `":e}function s0(e){return`0x`+e.toString(16).toUpperCase()}function c0(e){let t=this;t.compiler=n;function n(n){return gx(n,{...t.data(`settings`),...e,extensions:t.data(`toMarkdownExtensions`)||[]})}}const l0=/^[A-Za-z0-9]{20,}$/,u0=/^(?:\d+s?|(?:\d+h)?(?:\d+m)?(?:\d+s)?)$/;function d0(e){let t=e.toLowerCase();return t===`loom.com`||t===`www.loom.com`}function f0(e){let t=e.pathname.match(/^\/(?:share|embed)\/([A-Za-z0-9]+)\/?$/);if(!t)return null;let n=t[1]??``;return l0.test(n)?n:null}function p0(e){if(typeof e!=`string`||e.length===0)return null;let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`http:`&&t.protocol!==`https:`||!d0(t.hostname))return null;let n=f0(t);if(!n)return null;let r=t.searchParams.get(`t`);return{id:n,startRaw:r&&r.length>0&&u0.test(r)?r:null}}function m0(e){return p0(e)!==null}function h0(e){let t=e.toLowerCase();return t===`vimeo.com`||t===`www.vimeo.com`||t===`player.vimeo.com`}function g0(e){if(typeof e!=`string`||e.length===0)return!1;let t;try{t=new URL(e)}catch{return!1}return t.protocol!==`http:`&&t.protocol!==`https:`?!1:h0(t.hostname)}const _0=/^[A-Za-z0-9_-]{11}$/;function v0(e){let t=e.toLowerCase();return t===`youtube.com`||t===`www.youtube.com`||t===`m.youtube.com`||t===`music.youtube.com`||t===`youtu.be`||t===`youtube-nocookie.com`||t===`www.youtube-nocookie.com`}function y0(e){if(e.length===0)return null;if(/^[0-9]+$/.test(e)){let t=Number.parseInt(e,10);return t>0?t:null}let t=e.match(/^(?:([0-9]+)h)?(?:([0-9]+)m)?(?:([0-9]+)s?)?$/);if(!t)return null;let n=t[1]?Number.parseInt(t[1],10):0,r=t[2]?Number.parseInt(t[2],10):0,i=t[3]?Number.parseInt(t[3],10):0,a=n*3600+r*60+i;return a>0?a:null}function b0(e){if(e.hostname.toLowerCase()===`youtu.be`){let t=e.pathname.replace(/^\//,``).split(`/`)[0]??``;return _0.test(t)?t:null}if(e.pathname===`/watch`){let t=e.searchParams.get(`v`)??``;return _0.test(t)?t:null}let t=e.pathname.match(/^\/(?:embed|shorts|v)\/([A-Za-z0-9_-]{11})\/?$/);return t?t[1]??null:null}function x0(e){if(typeof e!=`string`||e.length===0)return null;let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`http:`&&t.protocol!==`https:`||!v0(t.hostname))return null;let n=b0(t);if(!n)return null;let r=t.searchParams.get(`t`)??t.searchParams.get(`start`)??``;return{id:n,startSeconds:r.length>0?y0(r):null,noCookie:t.hostname.toLowerCase().endsWith(`youtube-nocookie.com`)}}function S0(e,t){let n=Array.isArray(e.attrs.attributes)?e.attrs.attributes.filter(e=>typeof e==`object`&&!!e&&`type`in e):[],r=e.attrs.props??{},i=new Map,a=new Set;if(t)for(let e of t)e.omitOnDefault===!0&&`defaultValue`in e&&e.defaultValue!==void 0&&i.set(e.name,e.defaultValue),e.type===`string`&&e.required===!1&&e.defaultValue===void 0&&a.add(e.name);for(let[e,t]of Object.entries(r)){let r=n.findIndex(t=>t.type===`mdxJsxAttribute`&&t.name===e);if(i.has(e)&&Object.is(i.get(e),t)){r>=0&&n.splice(r,1);continue}if(a.has(e)&&t===``){r>=0&&n.splice(r,1);continue}if(r>=0){let e=n[r];if(e.type===`mdxJsxAttribute`&&e.value!=null&&typeof e.value==`object`&&e.value.type===`mdxJsxAttributeValueExpression`&&C0(e.value.value,t))continue}let o=w0(e,t);r>=0?n[r]=o:n.push(o)}return n}function C0(e,t){try{return JSON.stringify(JSON.parse(e))===JSON.stringify(t)}catch{return!1}}function w0(e,t){if(t===!0)return{type:`mdxJsxAttribute`,name:e,value:null};if(t===!1)return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:`false`}};if(t==null)return{type:`mdxJsxAttribute`,name:e,value:null};if(typeof t==`string`)return{type:`mdxJsxAttribute`,name:e,value:t};if(typeof t==`number`)return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:JSON.stringify(t)}};if(typeof t==`object`){let n;try{n=JSON.stringify(t)}catch{n=String(t)}return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:n}}}return{type:`mdxJsxAttribute`,name:e,value:String(t)}}function T0(e,t,n,r){return{type:`mdxJsxFlowElement`,name:e,attributes:S0(t,r),children:n.all(t),data:{}}}function E0(e,t,n){let r=t.attrs.props?.children;return{type:`mdxJsxTextElement`,name:e,attributes:S0(t,n),children:typeof r==`string`&&r!==``?[{type:`text`,value:r}]:[],data:{}}}const D0=[{name:`type`,type:`enum`,enumValues:[`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`],defaultValue:`note`,required:!1,description:`Callout variant`},{name:`title`,type:`string`,required:!1,description:`Optional heading shown above the body`},{name:`icon`,type:`string`,required:!1,advanced:!0,description:"Custom lucide icon override (e.g. `lucide:Lightbulb`)",iconPicker:!0},{name:`color`,type:`string`,required:!1,advanced:!0,description:"Optional accent color override (hex — e.g. `#F05032`)",colorPicker:!0},{name:`collapsible`,type:`boolean`,required:!1,defaultValue:!1,advanced:!0,description:"Render as a foldable `<details>`; in the blockquote form, `> [!TYPE]+` starts open and `> [!TYPE]-` starts closed"},{name:`defaultOpen`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,description:`When collapsible, start in the open state`,hideWhen:e=>e.collapsible!==!0},{name:`children`,type:`reactnode`,required:!0,description:`Callout content`}],O0=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Image source URL`,accept:_p,autoFocus:!0},{name:`alt`,type:`string`,required:!0,description:`Alt text`},{name:`width`,type:`number`,required:!1,advanced:!0,description:`Image width`},{name:`height`,type:`number`,required:!1,advanced:!0,description:`Image height`},{name:`srcset`,type:`string`,required:!1,advanced:!0,description:`Responsive image candidate set (e.g. "x.png 1x, y.png 2x")`},{name:`sizes`,type:`string`,required:!1,advanced:!0,description:`Responsive image sizes hint paired with srcset`},{name:`loading`,type:`enum`,enumValues:[`eager`,`lazy`],defaultValue:`lazy`,required:!1,advanced:!0,omitOnDefault:!0,description:`Native img loading strategy (defaults to lazy)`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`decoding`,type:`enum`,enumValues:[`sync`,`async`,`auto`],defaultValue:`auto`,required:!1,advanced:!0,omitOnDefault:!0,description:`Hint for how the browser should decode the image`},{name:`fetchpriority`,type:`enum`,enumValues:[`high`,`low`,`auto`],defaultValue:`auto`,required:!1,advanced:!0,omitOnDefault:!0,description:`Resource fetch priority hint`},{name:`crossorigin`,type:`enum`,enumValues:[`anonymous`,`use-credentials`],required:!1,advanced:!0,description:`CORS mode for the image fetch`},{name:`referrerpolicy`,type:`string`,required:!1,advanced:!0,description:`Referrer policy for the image fetch (HTML referrerpolicy values)`},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],k0=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Embedded page URL (must start with http:// or https://)`,autoFocus:!0},{name:`title`,type:`string`,required:!1,description:`Iframe title (accessible label for screen readers)`},{name:`width`,type:`string`,required:!1,advanced:!0,description:`Embed width as a CSS length (e.g. "100%", "640px")`,cssLengthInput:!0},{name:`height`,type:`string`,required:!1,advanced:!0,description:`Embed height as a CSS length (e.g. "26rem", "480px")`,cssLengthInput:!0},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],A0=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Video source URL`,accept:Ite,autoFocus:!0},{name:`controls`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,omitOnDefault:!0,description:`Show native HTML5 video controls (defaults to true)`,hideWhen:e=>typeof e.src==`string`&&(g0(e.src)||m0(e.src))},{name:`autoplay`,type:`boolean`,required:!1,advanced:!0,description:`Begin playback as soon as possible (usually requires muted)`},{name:`poster`,type:`string`,required:!1,advanced:!0,description:`Poster image URL shown before playback`,accept:_p,hideWhen:e=>typeof e.src==`string`&&(g0(e.src)||m0(e.src))},{name:`width`,type:`number`,required:!1,advanced:!0,description:`Video width`},{name:`height`,type:`number`,required:!1,advanced:!0,description:`Video height`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`muted`,type:`boolean`,required:!1,advanced:!0,description:`Mute audio on load`},{name:`loop`,type:`boolean`,required:!1,advanced:!0,description:`Restart from the beginning when playback ends`,hideWhen:e=>typeof e.src==`string`&&m0(e.src)},{name:`playsinline`,type:`boolean`,required:!1,advanced:!0,description:`Play inline on iOS rather than entering fullscreen`,hideWhen:e=>typeof e.src==`string`&&(g0(e.src)||m0(e.src))},{name:`preload`,type:`enum`,enumValues:[`none`,`metadata`,`auto`],required:!1,advanced:!0,description:`Hint for how much of the video to preload`,hideWhen:e=>typeof e.src==`string`&&(x0(e.src)!==null||g0(e.src)||m0(e.src))},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],j0=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Audio source URL`,accept:Lte,autoFocus:!0},{name:`controls`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,omitOnDefault:!0,description:`Show native HTML5 audio controls (defaults to true)`},{name:`autoplay`,type:`boolean`,required:!1,advanced:!0,description:`Begin playback as soon as possible (usually requires muted)`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`muted`,type:`boolean`,required:!1,advanced:!0,description:`Mute audio on load`},{name:`loop`,type:`boolean`,required:!1,advanced:!0,description:`Restart from the beginning when playback ends`},{name:`preload`,type:`enum`,enumValues:[`none`,`metadata`,`auto`],required:!1,advanced:!0,description:`Hint for how much of the audio to preload`}],M0=[{name:`title`,type:`string`,required:!0,description:`Heading shown inside the <summary>`},{name:`defaultOpen`,type:`boolean`,required:!1,defaultValue:!1,description:`When true, the block renders expanded on initial load`},{name:`icon`,type:`string`,required:!1,advanced:!0,description:"Custom lucide icon override (e.g. `lucide:Rocket`)",iconPicker:!0},{name:`description`,type:`string`,required:!1,advanced:!0,description:`Optional subtitle rendered below the title inside <summary>`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#advanced-options`)"},{name:`name`,type:`string`,required:!1,advanced:!0,description:`HTML5 <details name=> group — siblings with the same name are mutually exclusive`}],N0=[D0[0],D0[1],D0[4],D0[5],D0[6]],P0=[O0[0],O0[1],O0[7]],F0=[M0[0],M0[1],M0[4],M0[5]],I0=[{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`,`justify`],required:!1,defaultValue:`center`,description:"Block alignment from the `<div align>` attribute."},{name:`tag`,type:`string`,required:!1,defaultValue:`div`,hidden:!0,description:`Source wrapper tag (div or center).`},{name:`sourceAttrs`,type:`string`,required:!1,defaultValue:``,hidden:!0,description:`Raw opener-tag attribute bytes preserved for round-trip.`}],L0=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Alt text (alias syntax: `![[file.png|alt text]]`)"}],R0=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Title text (alias syntax: `![[clip.mp4|title]]`)"}],z0=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Title text (alias syntax: `![[song.mp3|title]]`)"}],B0=[{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#install-tabs`)"}],V0=[{name:`label`,type:`string`,required:!0,autoFocus:!0,defaultValue:`Tab`,description:`Tab strip label — shown in the clickable pill at the top`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#tab-npm`)"}],H0=[{name:`formula`,type:`string`,required:!0,autoFocus:!0,language:`latex`,description:`LaTeX math source (rendered with KaTeX in the browser)`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#eq-pythagoras`)"},{name:`language`,type:`string`,required:!1,advanced:!0,description:"Forward-compat hint for the math source language (default `latex`). Reserved for future MathJax / Typst / AsciiMath substrates."}],U0=[H0[0]],W0=[H0[0]],G0=[{name:`chart`,type:`string`,required:!0,hidden:!0,description:`Mermaid chart source (graph / flowchart / sequenceDiagram / class / state / etc.)`}],K0=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Display name override (alias syntax: `![[file.zip|label]]`)"}],q0=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`File URL`,accept:[`*/*`],autoFocus:!0}],J0=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`PDF source URL`,accept:Rte,autoFocus:!0},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Accessible label for the embedded PDF viewer`},{name:`anchor`,type:`string`,required:!1,advanced:!0,description:"PDF viewer parameters as a single URL-fragment string (e.g. `page=3&height=600`)"}],Y0=[{name:`src`,type:`string`,required:!0,description:"Path to the `.excalidraw` board this embed renders",autoFocus:!0},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Accessible label for the embedded board`}],X0=[{name:`src`,type:`string`,required:!0,description:"Path of the source doc, extension-less (e.g. `api-spec`).",autoFocus:!0},{name:`anchor`,type:`string`,required:!0,description:"Id of the `<MirrorSource>` block within the source doc."}],Z0=[{name:`id`,type:`string`,required:!0,description:"Stable id agents and authors use to reference this block from `<Mirror>` elsewhere.",autoFocus:!0},{name:`children`,type:`reactnode`,required:!0,description:`Block content this MirrorSource owns — paragraphs, callouts, code, nested JSX, anything.`}];function Q0(e){return e.replace(/&/g,`&`).replace(/"/g,`"`).replace(/</g,`<`).replace(/>/g,`>`)}function $0(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`)}function e2(e){let t=e.attrs.props,n=t?.target??``,r=typeof t?.alias==`string`&&t.alias.length>0?t.alias:null,i=typeof t?.anchor==`string`&&t.anchor.length>0?t.anchor:null,a=typeof t?.sourceTarget==`string`?t.sourceTarget:null,o=typeof t?.sourceAnchor==`string`?t.sourceAnchor:null,s=typeof t?.sourceAlias==`string`?t.sourceAlias:null,c=r??(i?`${n}#${i}`:n);return{type:`wikiLinkEmbed`,value:c,data:{target:n,anchor:i,alias:r,sourceTarget:a,sourceAnchor:o,sourceAlias:s},children:[{type:`text`,value:c}]}}const t2=[{name:`Callout`,surface:`canonical`,hasChildren:!0,props:D0,icon:`MessageSquareWarning`,category:`content`,displayName:`Callout`,description:`Alert / admonition with 15 type variants — 5 GFM (note, tip, important, warning, caution) plus 10 extended (abstract, info, todo, success, question, failure, danger, bug, example, quote)`,searchTerms:[`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`,`alert`,`admonition`,`callout`],serialize:(e,t)=>T0(`Callout`,e,t,D0)},{name:`img`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:O0,icon:`Image`,category:`media`,displayName:`Image`,description:`Image with click-to-zoom and HTML-native attributes`,searchTerms:[`image`,`zoom`,`picture`,`photo`],placeholder:{label:`Add an image`},serialize:(e,t)=>T0(`img`,e,t,O0)},{name:`video`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:A0,icon:`SquarePlay`,category:`media`,displayName:`Video`,description:`HTML5 video player with native controls`,searchTerms:[`video`,`media`,`player`,`mp4`,`webm`,`movie`],placeholder:{label:`Add a video`},serialize:(e,t)=>T0(`video`,e,t,A0)},{name:`audio`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:j0,icon:`Volume2`,category:`media`,displayName:`Audio`,description:`HTML5 audio player with native controls`,searchTerms:[`audio`,`sound`,`music`,`mp3`,`podcast`,`player`],placeholder:{label:`Add audio`},serialize:(e,t)=>T0(`audio`,e,t,j0)},{name:`Pdf`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:J0,icon:`FileText`,category:`media`,displayName:`PDF`,description:"Embedded PDF viewer (`#page=N` to open at page N, `#height=N` for viewer height)",searchTerms:[`pdf`,`document`,`embed`,`pdfjs`],placeholder:{label:`Add a PDF`},serialize:(e,t)=>T0(`Pdf`,e,t,J0)},{name:`Excalidraw`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:Y0,icon:`PenTool`,category:`embed`,displayName:`Excalidraw`,description:"Embedded snapshot of an `.excalidraw` board, linking to its canvas editor",searchTerms:[`excalidraw`,`board`,`whiteboard`,`sketch`,`drawing`,`canvas`],serialize:(e,t)=>T0(`Excalidraw`,e,t,Y0)},{name:`File`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:q0,icon:`Paperclip`,category:`media`,displayName:`File`,description:`Downloadable file attachment — inline row with name + size + download link`,searchTerms:[`file`,`attachment`,`download`,`document`,`zip`,`docx`,`doc`],placeholder:{label:`Add a file`},serialize:(e,t)=>T0(`File`,e,t,q0)},{name:`Embed`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:k0,icon:`AppWindow`,category:`embed`,displayName:`Embed`,description:'Inline web embed (iframe) — drop a URL, get a resizable preview pane. For YouTube / Vimeo / Loom prefer `<video src="…">` (player props, click-facade); `<Embed>` auto-rewrites watch URLs as a fallback.',searchTerms:[`embed`,`iframe`,`website`,`page`,`inline`,`frame`,`preview`],placeholder:{label:`Embed a URL`},serialize:(e,t)=>T0(`Embed`,e,t,k0)},{name:`Accordion`,surface:`canonical`,hasChildren:!0,props:M0,icon:`ChevronRight`,category:`content`,displayName:`Accordion`,description:"Standalone expand/collapse via native HTML5 <details>/<summary>. Group siblings with the `name` prop for exclusive-accordion UX.",searchTerms:[`accordion`,`expandable`,`details`,`disclosure`,`collapse`,`fold`],exampleBody:`Body content revealed when the accordion is expanded.`,serialize:(e,t)=>T0(`Accordion`,e,t,M0)},{name:`Toggle`,surface:`canonical`,hasChildren:!0,props:M0,icon:`ChevronRight`,category:`content`,displayName:`Toggle`,description:"Standalone expand/collapse block. Same render + props as `<Accordion>` under a different tag name; pick whichever name the vault already uses.",searchTerms:[`toggle`,`collapsible`,`expand`,`details`,`disclosure`,`fold`],exampleBody:`Body content revealed when the toggle is expanded.`,serialize:(e,t)=>T0(`Toggle`,e,t,M0)},{name:`Tabs`,surface:`canonical`,hasChildren:!0,emptyChildName:`Tab`,props:B0,icon:`LayoutPanelTop`,category:`content`,displayName:`Tabs`,description:"Horizontal tab strip + active panel below. Each `<Tab>` child is one panel; clickable pills at the top switch the active one. Active selection is ephemeral (resets on reload).",searchTerms:[`tabs`,`tabbed`,`panels`,`tabgroup`,`switcher`],exampleBody:`<Tab label="One">Body of the first tab panel.</Tab>
|
|
297
|
+
<Tab label="Two">Body of the second tab panel.</Tab>`,serialize:(e,t)=>T0(`Tabs`,e,t,B0)},{name:`Tab`,surface:`canonical`,hasChildren:!0,props:V0,icon:`PanelTop`,category:`content`,displayName:`Tab`,description:"A single tab panel inside a `<Tabs>` container — carries the strip label and the block-content body.",searchTerms:[`tab`,`panel`],exampleBody:"Panel content — must be nested inside a `<Tabs>` parent.",serialize:(e,t)=>T0(`Tab`,e,t,V0)},{name:`Math`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:H0,icon:`Sigma`,category:`content`,displayName:`Math`,description:`Block math equation rendered with KaTeX from a LaTeX source string`,searchTerms:[`math`,`latex`,`equation`,`formula`,`katex`,`tex`],serialize:(e,t)=>T0(`Math`,e,t,H0)},{name:`MermaidFence`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:G0,icon:`Workflow`,category:`content`,displayName:`Mermaid`,placeholder:{label:`Add a Mermaid diagram`},description:"Diagram rendered from Mermaid source (flowchart, sequence, class, state, ER, gantt, pie). Authored exclusively as ` ```mermaid ` fenced code.",searchTerms:[`mermaid`,`diagram`,`flowchart`,`graph`,`sequence`,`sequencediagram`,`class`,`state`,`er`,`erdiagram`,`gantt`,`pie`,`chart`],serialize:e=>({type:`code`,lang:`mermaid`,meta:null,value:e.attrs.props?.chart??``})},{name:`Mirror`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:X0,icon:`CopyPlus`,category:`content`,displayName:`Mirror`,description:"Render a read-only copy of a `<MirrorSource>` block from another doc. Use to keep the same content in sync across multiple docs without copy-paste — edits land at the source, every Mirror reflects the change.",searchTerms:[`mirror`,`sync`,`synced`,`transclude`,`embed`,`reference`,`shared block`],serialize:(e,t)=>T0(`Mirror`,e,t,X0)},{name:`MirrorSource`,surface:`canonical`,hasChildren:!0,props:Z0,icon:`GitBranch`,category:`content`,displayName:`Mirror Source`,description:'Mark a block as the source of truth for content that appears in multiple docs. Wrap any block content; `<Mirror src="…" anchor="<id>">` references render this verbatim read-only at every call-site. Edit here, propagate everywhere.',searchTerms:[`mirror source`,`sync source`,`source block`,`master block`,`shared`],exampleBody:"Authoritative content lives inside this block — edits here propagate to every `<Mirror>` that references this id.",serialize:(e,t)=>T0(`MirrorSource`,e,t,Z0)},{name:`GFMCallout`,surface:`compat`,hasChildren:!0,props:N0,icon:`MessageSquareWarning`,category:`content`,displayName:`GFM Callout`,description:"GFM blockquote alert (`> [!NOTE]`) — read-only compat. Preserves `> [!NOTE]` syntax on round-trip; insert a fresh Callout block for the full prop surface.",rendersAs:`Callout`,translateProps:e=>e,serialize:(e,t)=>{let n=e.attrs.props,r=new Set([`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`]),i=n?.type??`note`;return{type:`blockquote`,children:[{type:`html`,value:`[!${(r.has(i.toLowerCase())?i:`note`).toUpperCase()}]${n?.collapsible?n.defaultOpen===!1?`-`:`+`:``}${n?.title?` ${n.title}`:``}`},...t.all(e).filter(e=>{if(e.type!==`paragraph`)return!0;let t=e;return Array.isArray(t.children)&&t.children.length>0})]}}},{name:`CommonMarkImage`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:P0,icon:`Image`,category:`media`,displayName:`CommonMark Image`,description:'CommonMark image (``) — read-only compat. Preserves `` syntax on round-trip; insert a fresh Image block for the full HTML-native attribute surface (srcset, sizes, decoding, etc.).',rendersAs:`img`,translateProps:e=>e,serialize:e=>{let t=e.attrs.props;return{type:`paragraph`,children:[{type:`image`,url:ju(t?.src??``,t?.sourceUrl),alt:t?.alt??``,title:t?.title??null}]}}},{name:`WikiEmbedImage`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:L0,icon:`ZoomIn`,category:`media`,displayName:`Wiki Embed Image`,description:"`![[file.png]]` wiki-embed — read-only compat. Edit the alt-text via the alias slot; the embed target / anchor stay on the prop bag and round-trip byte-identical.",rendersAs:`img`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.target==`string`?e.target:``;return{src:e.src,alt:t??n}},serialize:e2},{name:`WikiEmbedVideo`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:R0,icon:`Film`,category:`media`,displayName:`Wiki Embed Video`,description:"`![[clip.mp4]]` wiki-embed — read-only compat. Edit the title via the alias slot; the embed target / anchor stay on the prop bag and round-trip byte-identical.",rendersAs:`video`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.target==`string`?e.target:``;return{src:e.src,title:t??n}},serialize:e2},{name:`WikiEmbedAudio`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:z0,icon:`Volume2`,category:`media`,displayName:`Wiki Embed Audio`,description:"`![[song.mp3]]` wiki-embed — read-only compat. Edit the title via the alias slot; the embed target / anchor stay on the prop bag and round-trip byte-identical.",rendersAs:`audio`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.target==`string`?e.target:``;return{src:e.src,title:t??n}},serialize:e2},{name:`WikiEmbedFile`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:K0,icon:`Paperclip`,category:`media`,displayName:`Wiki Embed File`,description:"`![[file.zip]]` wiki-embed — read-only compat for arbitrary downloadable attachments. Renders through the `File` canonical (inline row with file-up icon + bold name + optional dim size). Edit the display name via the alias slot.",rendersAs:`File`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.size==`string`&&e.size.length>0?e.size:null;return{src:e.src,name:t??void 0,size:n??void 0}},serialize:e2},{name:`HtmlDetailsAccordion`,surface:`compat`,hasChildren:!0,props:F0,icon:`ChevronRight`,category:`content`,displayName:`HTML5 Details`,description:"HTML5 `<details><summary>` collapsible — read-only compat. Preserves `<details>` syntax on round-trip; insert a fresh Accordion block for icon / description / group-name props.",rendersAs:`Accordion`,translateProps:e=>e,serialize:(e,t)=>{let n=e.attrs.props,r=n?.defaultOpen?` open`:``,i=n?.name?` name="${Q0(n.name)}"`:``,a=n?.id?` id="${Q0(n.id)}"`:``,o=n?.title?.trim(),s=o?`<summary>${$0(o)}</summary>`:``;return{type:`mdxJsxFlowElement`,name:`HtmlDetailsAccordion`,attributes:[],children:t.all(e),data:{htmlBoundary:{opener:`<details${r}${i}${a}>\n${s}`,closer:`</details>`}}}}},{name:`HtmlAlignBlock`,surface:`canonical`,hasChildren:!0,props:I0,icon:`AlignCenter`,category:`content`,displayName:`Align block`,description:"GitHub-style `<div align>` wrapper. Children render as normal blocks with the alignment applied; the `<div align>` syntax is preserved on round-trip.",searchTerms:[`align`,`center`,`centered`,`div`],serialize:(e,t)=>{let n=e.attrs.props,r=n?.tag===`center`?`center`:`div`,i=typeof n?.align==`string`&&n.align?n.align:null,a=typeof n?.sourceAttrs==`string`?n.sourceAttrs:``,o=/(\balign\s*=\s*)(?:"[^"]*"|'[^']*'|[^\s"'<>]+)/i;return i!==null&&(r===`div`||i!==`center`)?a=o.test(a)?a.replace(o,`$1"${Q0(i)}"`):`${a} align="${Q0(i)}"`:(i===null||r===`center`&&i===`center`)&&(a=a.replace(RegExp(`\\s*${o.source}`,`i`),``)),{type:`mdxJsxFlowElement`,name:`HtmlAlignBlock`,attributes:[],children:t.all(e),data:{htmlBoundary:{opener:`<${r}${a}>`,closer:`</${r}>`}}}}},{name:`DollarMath`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:U0,icon:`Sigma`,category:`content`,displayName:`Dollar Math`,description:"Block math via `$$…$$` syntax — read-only compat. Preserves `$$…$$` form on round-trip; insert a fresh Math block for the full prop surface (id, language).",rendersAs:`Math`,translateProps:e=>e,serialize:e=>({type:`math`,value:e.attrs.props?.formula??``})},{name:`MathFence`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:W0,icon:`Sigma`,category:`content`,displayName:`Math Fence`,description:"Block math via ` ```math ` fenced code syntax — read-only compat. Preserves the fence form on round-trip; insert a fresh Math block for the full prop surface (id, language).",rendersAs:`Math`,translateProps:e=>e,serialize:e=>({type:`code`,lang:`math`,meta:null,value:e.attrs.props?.formula??``})}],n2={name:`*`,surface:`canonical`,hasChildren:!0,props:[],description:`Unregistered component — children editable as markdown`,serialize:(e,t)=>T0(e.attrs.componentName||`*`,e,t)};function r2(){let e=new Map;e.set(`*`,n2);for(let t of t2)e.set(t.name,t);return{get(t){return e.get(t)},getOrWildcard(t){return e.get(t)??e.get(`*`)},set(t,n){e.set(t,n)},has(t){return e.has(t)},entries(){return e.entries()}}}function i2(){let e=globalThis;return e.__okYpsCounters||={block:0,inline:0},e.__okYpsCounters}const a2={parseFallback:{blockLevel:0,wholeDoc:0,wholeDocBudget:0},jsxRenderFailure:{},jsxAutoConvertFailed:{},jsxAutoConvertSucceeded:{},jsxActionAborted:{},jsxPropDropped:{},jsxMoveFailed:{},jsxStuckCopyFailed:{},jsxStuckDeleteFailed:{},jsxPopoverCloseRestoreFailed:{},jsxKeyboardDeleteFailed:{},jsxChromeDeleteFailed:{},blockGripClickSelectFailed:{},jsxArrowNodeSelectFailed:{}};function o2(){a2.parseFallback.blockLevel++}function s2(){a2.parseFallback.wholeDoc++}function c2(){a2.parseFallback.wholeDocBudget++}function l2(){let e=i2();return{parseFallback:{...a2.parseFallback},ypsMismatch:{block:e.block,inline:e.inline},jsxRenderFailure:{...a2.jsxRenderFailure},jsxAutoConvertFailed:{...a2.jsxAutoConvertFailed},jsxAutoConvertSucceeded:{...a2.jsxAutoConvertSucceeded},jsxActionAborted:{...a2.jsxActionAborted},jsxPropDropped:{...a2.jsxPropDropped},jsxMoveFailed:{...a2.jsxMoveFailed},jsxStuckCopyFailed:{...a2.jsxStuckCopyFailed},jsxStuckDeleteFailed:{...a2.jsxStuckDeleteFailed},jsxPopoverCloseRestoreFailed:{...a2.jsxPopoverCloseRestoreFailed},jsxKeyboardDeleteFailed:{...a2.jsxKeyboardDeleteFailed},jsxChromeDeleteFailed:{...a2.jsxChromeDeleteFailed},blockGripClickSelectFailed:{...a2.blockGripClickSelectFailed},jsxArrowNodeSelectFailed:{...a2.jsxArrowNodeSelectFailed}}}function u2(){return{enter:{mdxFlowExpression:f2,mdxTextExpression:p2},exit:{mdxFlowExpression:m2,mdxFlowExpressionChunk:h2,mdxTextExpression:m2,mdxTextExpressionChunk:h2}}}function d2(){return{handlers:{mdxFlowExpression:g2,mdxTextExpression:g2},unsafe:[{character:`{`,inConstruct:[`phrasing`]},{atBreak:!0,character:`{`}]}}function f2(e){this.enter({type:`mdxFlowExpression`,value:``},e),this.buffer()}function p2(e){this.enter({type:`mdxTextExpression`,value:``},e),this.buffer()}function m2(e){let t=this.resume(),n=e.estree,r=this.stack[this.stack.length-1];r.type===`mdxFlowExpression`||r.type,this.exit(e),r.value=t,n&&(r.data={estree:n})}function h2(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function g2(e,t,n){let r=e.value||``;return`{`+n.indentLines(r,function(e,t,n){return(t===0||n?``:` `)+e})+`}`}const _2=/["&'<>`]/g,v2=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,y2=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,b2=/[|\\{}()[\]^$+*?.]/g,x2=new WeakMap;function S2(e,t){if(e=e.replace(t.subset?C2(t.subset):_2,r),t.subset||t.escapeOnly)return e;return e.replace(v2,n).replace(y2,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function C2(e){let t=x2.get(e);return t||(t=w2(e),x2.set(e,t)),t}function w2(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(b2,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}function qoe(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function T2(e,t){return S2(e,Object.assign({format:qoe},t))}function E2(){return{canContainEols:[`mdxJsxTextElement`],enter:{mdxJsxFlowTag:r,mdxJsxFlowTagClosingMarker:i,mdxJsxFlowTagAttribute:d,mdxJsxFlowTagExpressionAttribute:f,mdxJsxFlowTagAttributeValueLiteral:e,mdxJsxFlowTagAttributeValueExpression:e,mdxJsxFlowTagSelfClosingMarker:o,mdxJsxTextTag:r,mdxJsxTextTagClosingMarker:i,mdxJsxTextTagAttribute:d,mdxJsxTextTagExpressionAttribute:f,mdxJsxTextTagAttributeValueLiteral:e,mdxJsxTextTagAttributeValueExpression:e,mdxJsxTextTagSelfClosingMarker:o},exit:{mdxJsxFlowTagClosingMarker:s,mdxJsxFlowTagNamePrimary:c,mdxJsxFlowTagNameMember:l,mdxJsxFlowTagNameLocal:u,mdxJsxFlowTagExpressionAttribute:p,mdxJsxFlowTagExpressionAttributeValue:n,mdxJsxFlowTagAttributeNamePrimary:m,mdxJsxFlowTagAttributeNameLocal:h,mdxJsxFlowTagAttributeValueLiteral:g,mdxJsxFlowTagAttributeValueLiteralValue:n,mdxJsxFlowTagAttributeValueExpression:_,mdxJsxFlowTagAttributeValueExpressionValue:n,mdxJsxFlowTagSelfClosingMarker:v,mdxJsxFlowTag:y,mdxJsxTextTagClosingMarker:s,mdxJsxTextTagNamePrimary:c,mdxJsxTextTagNameMember:l,mdxJsxTextTagNameLocal:u,mdxJsxTextTagExpressionAttribute:p,mdxJsxTextTagExpressionAttributeValue:n,mdxJsxTextTagAttributeNamePrimary:m,mdxJsxTextTagAttributeNameLocal:h,mdxJsxTextTagAttributeValueLiteral:g,mdxJsxTextTagAttributeValueLiteralValue:n,mdxJsxTextTagAttributeValueExpression:_,mdxJsxTextTagAttributeValueExpressionValue:n,mdxJsxTextTagSelfClosingMarker:v,mdxJsxTextTag:y}};function e(){this.buffer()}function t(e){return{line:e.line,column:e.column,offset:e.offset}}function n(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function r(e){let t={name:void 0,attributes:[],close:!1,selfClosing:!1,start:e.start,end:e.end};this.data.mdxJsxTagStack||(this.data.mdxJsxTagStack=[]),this.data.mdxJsxTag=t,this.buffer()}function i(e){if(this.data.mdxJsxTagStack.length===0)throw new Fw("Unexpected closing slash `/` in tag, expected an open tag first",{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-closing-slash`)}function a(e){if(this.data.mdxJsxTag.close)throw new Fw(`Unexpected attribute in closing tag, expected the end of the tag`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-attribute`)}function o(e){if(this.data.mdxJsxTag.close)throw new Fw("Unexpected self-closing slash `/` in closing tag, expected the end of the tag",{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-self-closing-slash`)}function s(){let e=this.data.mdxJsxTag;e.close=!0}function c(e){let t=this.data.mdxJsxTag;t.name=this.sliceSerialize(e)}function l(e){let t=this.data.mdxJsxTag;t.name+=`.`+this.sliceSerialize(e)}function u(e){let t=this.data.mdxJsxTag;t.name+=`:`+this.sliceSerialize(e)}function d(e){let n=this.data.mdxJsxTag;a.call(this,e),n.attributes.push({type:`mdxJsxAttribute`,name:``,value:null,position:{start:t(e.start),end:void 0}})}function f(e){let n=this.data.mdxJsxTag;a.call(this,e),n.attributes.push({type:`mdxJsxExpressionAttribute`,value:``,position:{start:t(e.start),end:void 0}}),this.buffer()}function p(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type;let i=e.estree;r.value=this.resume(),r.position,r.position.end=t(e.end),i&&(r.data={estree:i})}function m(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type,r.name=this.sliceSerialize(e),r.position,r.position.end=t(e.end)}function h(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type,r.name+=`:`+this.sliceSerialize(e),r.position,r.position.end=t(e.end)}function g(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.value=Lae(this.resume(),{nonTerminated:!1}),r.position,r.position.end=t(e.end)}function _(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type;let i={type:`mdxJsxAttributeValueExpression`,value:this.resume()},a=e.estree;a&&(i.data={estree:a}),r.value=i,r.position,r.position.end=t(e.end)}function v(){let e=this.data.mdxJsxTag;e.selfClosing=!0}function y(e){let t=this.data.mdxJsxTag,n=this.data.mdxJsxTagStack,r=n[n.length-1];if(t.close&&r.name!==t.name)throw new Fw("Unexpected closing tag `"+S(t)+"`, expected corresponding closing tag for `"+S(r)+"` ("+jw(r)+`)`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:end-tag-mismatch`);this.resume(),t.close?n.pop():this.enter({type:e.type===`mdxJsxTextTag`?`mdxJsxTextElement`:`mdxJsxFlowElement`,name:t.name||null,attributes:t.attributes,children:[]},e,b),t.selfClosing||t.close?this.exit(e,x):n.push(t)}function b(e,t){let n=this.data.mdxJsxTagStack,r=n[n.length-1],i=e?" before the end of `"+e.type+"`":``,a=e?{start:e.start,end:e.end}:void 0;throw new Fw("Expected a closing tag for `"+S(r)+"` ("+jw({start:t.start,end:t.end})+`)`+i,a,`mdast-util-mdx-jsx:end-tag-mismatch`)}function x(e,t){let n=this.data.mdxJsxTag;throw new Fw("Expected the closing tag `"+S(n)+"` either after the end of `"+t.type+"` ("+jw(t.end)+") or another opening tag after the start of `"+t.type+"` ("+jw(t.start)+`)`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:end-tag-mismatch`)}function S(e){return`<`+(e.close?`/`:``)+(e.name||``)+`>`}}function D2(e){let t=e||{},n=t.quote||`"`,r=t.quoteSmart||!1,i=t.tightSelfClosing||!1,a=t.printWidth||1/0,o=n===`"`?`'`:`"`;if(n!==`"`&&n!==`'`)throw Error("Cannot serialize attribute values with `"+n+"` for `options.quote`, expected `\"`, or `'`");return s.peek=j2,{handlers:{mdxJsxFlowElement:s,mdxJsxTextElement:s},unsafe:[{character:`<`,inConstruct:[`phrasing`]},{atBreak:!0,character:`<`}],fences:!0,resourceLink:!0};function s(e,t,s,c){let l=e.type===`mdxJsxFlowElement`,u=e.name?!e.children||e.children.length===0:!1,d=A2(k2(s)),f=s.createTracker(c),p=s.createTracker(c),m=[],h=(l?d:``)+`<`+(e.name||``),g=s.enter(e.type);if(f.move(h),p.move(h),e.attributes&&e.attributes.length>0){if(!e.name)throw Error(`Cannot serialize fragment w/ attributes`);let t=-1;for(;++t<e.attributes.length;){let i=e.attributes[t],a;if(i.type===`mdxJsxExpressionAttribute`)a=`{`+(i.value||``)+`}`;else{if(!i.name)throw Error(`Cannot serialize attribute w/o name`);let e=i.value,t=i.name,s=``;if(e!=null){if(typeof e==`object`)s=`{`+(e.value||``)+`}`;else{let t=r&&xv(e,n)>xv(e,o)?o:n;s=t+T2(e,{subset:[t]})+t}}a=t+(s?`=`:``)+s}m.push(a)}}let _=!1,v=m.join(` `);l&&(/\r?\n|\r/.test(v)||f.current().now.column+v.length+(u?i?2:3:1)>a)&&(_=!0);let y=f,b=h;if(_){y=p;let e=-1;for(;++e<m.length;)m[e]=d+` `+m[e];b+=y.move(`
|
|
298
|
+
`+m.join(`
|
|
299
|
+
`)+`
|
|
300
|
+
`+d)}else v&&(b+=y.move(` `+v));return u&&(b+=y.move((i||_?``:` `)+`/`)),b+=y.move(`>`),e.children&&e.children.length>0&&(e.type===`mdxJsxTextElement`?b+=y.move(s.containerPhrasing(e,{...y.current(),before:`>`,after:`<`})):(y.shift(2),b+=y.move(`
|
|
301
|
+
`),b+=y.move(O2(e,s,y.current())),b+=y.move(`
|
|
302
|
+
`))),u||(b+=y.move((l?d:``)+`</`+(e.name||``)+`>`)),g(),b}}function O2(e,t,n){let r=t.indexStack,i=e.children,a=t.createTracker(n),o=A2(k2(t)),s=[],c=-1;for(r.push(-1);++c<i.length;){let n=i[c];r[r.length-1]=c;let l={before:`
|
|
303
|
+
`,after:`
|
|
304
|
+
`,...a.current()},u=t.handle(n,e,t,l),d=n.type===`mdxJsxFlowElement`?u:t.indentLines(u,function(e,t,n){return(n?``:o)+e});s.push(a.move(d)),n.type!==`list`&&(t.bulletLastUsed=void 0),c<i.length-1&&s.push(a.move(`
|
|
305
|
+
|
|
306
|
+
`))}return r.pop(),s.join(``)}function k2(e){let t=0,n=e.stack.length;for(;--n>-1;){let r=e.stack[n];if(r===`blockquote`||r===`listItem`)break;r===`mdxJsxFlowElement`&&t++}return t}function A2(e){return` `.repeat(e)}function j2(){return`<`}function M2(){return{enter:{mdxjsEsm:P2},exit:{mdxjsEsm:F2,mdxjsEsmData:I2}}}function N2(){return{handlers:{mdxjsEsm:L2}}}function P2(e){this.enter({type:`mdxjsEsm`,value:``},e),this.buffer()}function F2(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,this.exit(e);let r=e.estree;n.value=t,r&&(n.data={estree:r})}function I2(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function L2(e){return e.value||``}function R2(){return[u2(),E2(),M2()]}function z2(e){return{extensions:[d2(),D2(e),N2()]}}function B2(e){return`\x1B[33m`+e+`\x1B[39m`}const V2={}.hasOwnProperty,H2=Symbol(`continue`),U2=Symbol(`exit`),W2=Symbol(`skip`);function G2(e,t){let n,r;typeof t==`function`?n=t:t&&typeof t==`object`&&(t.enter&&(n=t.enter),t.leave&&(r=t.leave)),i(e,void 0,void 0,[])();function i(e,t,a,o){return q2(e)&&(s.displayName=`node (`+B2(e.type)+`)`),s;function s(){let s=n?K2(n(e,t,a,o)):[];if(s[0]===U2)return s;if(s[0]!==W2){let t;for(t in e)if(V2.call(e,t)&&e[t]&&typeof e[t]==`object`&&t!==`data`&&t!==`position`){let n=o.concat(e),r=e[t];if(Array.isArray(r)){let e=r,a=0;for(;a>-1&&a<e.length;){let r=e[a];if(q2(r)){let e=i(r,t,a,n)();if(e[0]===U2)return e;a=typeof e[1]==`number`?e[1]:a+1}else a++}}else if(q2(r)){let e=i(r,t,void 0,n)();if(e[0]===U2)return e}}}return r?K2(r(e,t,a,o)):s}}}function K2(e){return Array.isArray(e)?e:typeof e==`number`?[H2,e]:[e]}function q2(e){return!!(e&&typeof e==`object`&&`type`in e&&typeof e.type==`string`&&e.type.length>0)}function J2(e,t){let n=t.prefix||``,r=t.suffix||``,i=Object.assign({},t.acornOptions),a=[],o=[],s=i.onComment,c=i.onToken,l=!1,u,d,f=Object.assign({},i,{onComment:a,preserveParens:!0});c&&(f.onToken=o);let p=X2(e,t.tokenTypes),m=p.value,h=n+m+r,g=t.expression&&Y2(m);if(g&&!t.allowEmpty)throw new Fw(`Unexpected empty expression`,{place:v(0),ruleId:`unexpected-empty-expression`,source:`micromark-extension-mdx-expression`});try{u=t.expression&&!g?t.acorn.parseExpressionAt(h,0,f):t.acorn.parse(h,f)}catch(e){let t=e,r=v(t.pos);t.message=String(t.message).replace(/ \(\d+:\d+\)$/,``),t.pos=r.offset,t.loc={line:r.line,column:r.column-1},d=t,l=t.raisedAt>=n.length+m.length||t.message===`Unterminated comment`}if(u&&t.expression&&!g){if(Y2(h.slice(u.end,h.length-r.length)))u={type:`Program`,start:0,end:n.length+m.length,body:[{type:`ExpressionStatement`,expression:u,start:0,end:n.length+m.length}],sourceType:`module`,comments:[]};else{let e=v(u.end),t=Error(`Unexpected content after expression`);t.pos=e.offset,t.loc={line:e.line,column:e.column-1},d=t,u=void 0}}if(u){if(u.comments=a,G2(u,function(e,t,n,r){let i=r[r.length-1],a=t;e.type===`ParenthesizedExpression`&&i&&a&&(typeof n==`number`&&(i=i[a],a=n),i[a]=e.expression),_(e)}),Array.isArray(s))s.push(...a);else if(typeof s==`function`)for(let e of a)s(e.type===`Block`,e.value,e.start,e.end,e.loc.start,e.loc.end);for(let e of o)e.end<=n.length||e.start-n.length>=m.length||(_(e),Array.isArray(c)?c.push(e):c(e))}return{estree:u,error:d,swallow:l};function _(e){let t=v(e.start),n=v(e.end);e.start=t.offset,e.end=n.offset,e.loc={start:{line:t.line,column:t.column-1,offset:t.offset},end:{line:n.line,column:n.column-1,offset:n.offset}},e.range=[e.start,e.end]}function v(e){let r=e-n.length;r<0?r=0:r>m.length&&(r=m.length);let i=Z2(p.stops,r);return i||={line:t.start.line,column:t.start.column,offset:t.start.offset},i}}function Y2(e){return/^\s*$/.test(e.replace(/\/\*[\s\S]*?\*\//g,``).replace(/\/\/[^\r\n]*(\r\n|\n|\r)/g,``))}function X2(e,t){let n={value:``,stops:[]},r=-1;for(;++r<e.length;){let i=e[r];if(i[0]===`enter`){let e=i[1].type;if(e===`lineEnding`||t.includes(e)){let e=i[2].sliceStream(i[1]);for(;e.length>0&&e[0]===-1;)e.shift();let t=Q2(e);n.stops.push([n.value.length,i[1].start]),n.value+=t,n.stops.push([n.value.length,i[1].end])}}}return n}function Z2(e,t){let n=0;for(;n<e.length&&e[n][0]<=t;)n+=1;if(n===0)return;let[r,i]=e[n-1],a=t-r;return{line:i.line,column:i.column+a,offset:i.offset+a}}function Q2(e){let t=-1,n=[],r;for(;++t<e.length;){let i=e[t],a;if(typeof i==`string`)a=i;else switch(i){case-5:a=`\r`;break;case-4:a=`
|
|
307
|
+
`;break;case-3:a=`\r
|
|
308
|
+
`;break;case-2:a=` `;break;case-1:if(r)continue;a=` `;break;default:a=String.fromCharCode(i)}r=i===-2,n.push(a)}return n.join(``)}function $2(e){let t=e||{},n=t.loc||{},r=t.range||[void 0,void 0],i=e4(n.start,r[0]||t.start),a=e4(n.end,r[1]||t.end);if(i&&a)return{start:i,end:a}}function e4(e,t){if(e&&typeof e==`object`){let n=`line`in e?t4(e.line):void 0,r=`column`in e?t4(e.column):void 0;if(n&&r!==void 0)return{line:n,column:r+1,offset:t4(t)}}}function t4(e){return typeof e==`number`&&e>-1?e:void 0}const n4=`https://github.com/micromark/micromark-extension-mdx-expression/tree/main/packages/micromark-extension-mdx-expression`,r4=`#unexpected-type-in-code-expected-an-object-spread-spread`;function i4(e,t,n,r,i,a,o,s,c,l,u){let d=this,f=this.events.length+3,p=0,m,h;return g;function g(t){return e.enter(n),e.enter(r),e.consume(t),e.exit(r),m=d.now(),_}function _(u){if(u===null){if(h)throw h;let e=new Fw("Unexpected end of file in expression, expected a corresponding closing brace for `{`",{place:d.now(),ruleId:`unexpected-eof`,source:`micromark-extension-mdx-expression`});throw e.url=n4+`#unexpected-end-of-file-in-expression-expected-a-corresponding-closing-brace-for-`,e}if(B(u))return e.enter(`lineEnding`),e.consume(u),e.exit(`lineEnding`),y;if(u===125&&p===0){let p=a?a4.call(d,a,o,i,f,m,l||!1,c||!1):{type:`ok`,estree:void 0};if(p.type===`ok`){e.enter(r),e.consume(u),e.exit(r);let i=e.exit(n);return s&&p.estree&&Object.assign(i,{estree:p.estree}),t}return h=p.message,e.enter(i),e.consume(u),v}return e.enter(i),v(u)}function v(t){return t===125&&p===0||t===null||B(t)?(e.exit(i),_(t)):(t===123&&!a?p+=1:t===125&&--p,e.consume(t),v)}function y(t){let n=d.now();if(n.line!==m.line&&!u&&d.parser.lazy[n.line]){let e=new Fw("Unexpected lazy line in expression in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",{place:d.now(),ruleId:`unexpected-lazy`,source:`micromark-extension-mdx-expression`});throw e.url=n4+`#unexpected-lazy-line-in-expression-in-container-expected-line-to-be-prefixed`,e}return Av(t)?CS(e,_,`linePrefix`,3)(t):_(t)}}function a4(e,t,n,r,i,a,o){let s=J2(this.events.slice(r),{acorn:e,tokenTypes:[n],acornOptions:t,start:i,expression:!0,allowEmpty:a,prefix:o?`({`:``,suffix:o?`})`:``}),c=s.estree;if(o&&c){let e=c.body[0];if(e.type!==`ExpressionStatement`||e.expression.type!==`ObjectExpression`){let t=$2(e),n=new Fw("Unexpected `"+e.type+"` in code: expected an object spread (`{...spread}`)",{place:t.start,ruleId:`non-spread`,source:`micromark-extension-mdx-expression`});throw n.url=n4+r4,n}if(e.expression.properties[1]){let t=new Fw(`Unexpected extra content in spread: only a single spread is supported`,{place:$2(e.expression.properties[1]).start,ruleId:`spread-extra`,source:`micromark-extension-mdx-expression`});throw t.url=n4+`#unexpected-extra-content-in-spread-only-a-single-spread-is-supported`,t}if(e.expression.properties[0]&&e.expression.properties[0].type!==`SpreadElement`){let t=$2(e.expression.properties[0]),n=new Fw("Unexpected `"+e.expression.properties[0].type+"` in code: only spread elements are supported",{place:t.start,ruleId:`non-spread`,source:`micromark-extension-mdx-expression`});throw n.url=n4+r4,n}}if(s.error){let e=new Fw(`Could not parse expression with acorn`,{cause:s.error,place:{line:s.error.loc.line,column:s.error.loc.column+1,offset:s.error.pos},ruleId:`acorn`,source:`micromark-extension-mdx-expression`});return e.url=n4+`#could-not-parse-expression-with-acorn`,{type:`nok`,message:e}}return{type:`ok`,estree:c}}function o4(e){let t=e||{},n=t.addResult,r=t.acorn,i=t.spread,a=t.allowEmpty,o;if(a??=!0,r){if(!r.parseExpressionAt)throw Error("Expected a proper `acorn` instance passed in as `options.acorn`");o=Object.assign({ecmaVersion:2024,sourceType:`module`},t.acornOptions)}else if(t.acornOptions||t.addResult)throw Error("Expected an `acorn` instance passed in as `options.acorn`");return{flow:{123:{name:`mdxFlowExpression`,tokenize:s,concrete:!0}},text:{123:{name:`mdxTextExpression`,tokenize:c}}};function s(e,t,s){let c=this;return l;function l(e){return u(e)}function u(t){return i4.call(c,e,d,`mdxFlowExpression`,`mdxFlowExpressionMarker`,`mdxFlowExpressionChunk`,r,o,n,i,a)(t)}function d(t){return Av(t)?CS(e,f,`whitespace`)(t):f(t)}function f(n){let r=c.parser.constructs.flow[60],i=(Array.isArray(r)?r:r?[r]:[]).find(function(e){return e.name===`mdxJsxFlowTag`});return n===60&&i?e.attempt(i,f,s)(n):n===null||B(n)?t(n):s(n)}}function c(e,t){let s=this;return c;function c(c){return i4.call(s,e,t,`mdxTextExpression`,`mdxTextExpressionMarker`,`mdxTextExpressionChunk`,r,o,n,i,a,!0)(c)}}}const Joe=/[$_\p{ID_Start}]/u,Yoe=/[$_\u{200C}\u{200D}\p{ID_Continue}]/u,Xoe=/[-$_\u{200C}\u{200D}\p{ID_Continue}]/u,Zoe={};function s4(e){return e?Joe.test(String.fromCodePoint(e)):!1}function c4(e,t){let n=(t||Zoe).jsx?Xoe:Yoe;return e?n.test(String.fromCodePoint(e)):!1}const l4=`https://github.com/micromark/micromark-extension-mdx-jsx`;function u4(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,ee,te,ne,re,ie,ae){let oe=this,se,ce;return le;function le(t){return e.enter(s),e.enter(c),e.consume(t),e.exit(c),ue}function ue(e){return kv(e)?n(e):(se=E,Ae(e))}function E(t){if(t===47)return e.enter(l),e.consume(t),e.exit(l),se=de,Ae;if(t===62)return ke(t);if(t!==null&&t>=0&&s4(t))return e.enter(d),e.enter(f),e.consume(t),fe;Ne(t,`before name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===33?" (note: to create a comment in MDX, use `{/* text */}`)":``))}function de(t){if(t===62)return ke(t);if(t!==null&&t>=0&&s4(t))return e.enter(d),e.enter(f),e.consume(t),fe;Ne(t,`before name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===42||t===47?` (note: JS comments in JSX tags are not supported in MDX)`:``))}function fe(t){if(t!==null&&t>=0&&c4(t,{jsx:!0}))return e.consume(t),fe;if(t===46||t===47||t===58||t===62||t===123||kv(t)||Mv(t))return e.exit(f),se=pe,Ae(t);Ne(t,`in name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag"+(t===64?" (note: to create a link in MDX, use `[text](url)`)":``))}function pe(t){if(t===46)return e.enter(p),e.consume(t),e.exit(p),se=D,Ae;if(t===58)return e.enter(h),e.consume(t),e.exit(h),se=he,Ae;if(t===47||t===62||t===123||t!==null&&t>=0&&s4(t))return e.exit(d),ve(t);Ne(t,`after name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function D(t){if(t!==null&&t>=0&&s4(t))return e.enter(m),e.consume(t),O;Ne(t,`before member name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function O(t){if(t!==null&&t>=0&&c4(t,{jsx:!0}))return e.consume(t),O;if(t===46||t===47||t===62||t===123||kv(t)||Mv(t))return e.exit(m),se=me,Ae(t);Ne(t,`in member name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag"+(t===64?" (note: to create a link in MDX, use `[text](url)`)":``))}function me(t){if(t===46)return e.enter(p),e.consume(t),e.exit(p),se=D,Ae;if(t===47||t===62||t===123||t!==null&&t>=0&&s4(t))return e.exit(d),ve(t);Ne(t,`after member name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function he(t){if(t!==null&&t>=0&&s4(t))return e.enter(g),e.consume(t),ge;Ne(t,`before local name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===43||t!==null&&t>46&&t<58?" (note: to create a link in MDX, use `[text](url)`)":``))}function ge(t){if(t!==null&&t>=0&&c4(t,{jsx:!0}))return e.consume(t),ge;if(t===47||t===62||t===123||kv(t)||Mv(t))return e.exit(g),se=_e,Ae(t);Ne(t,`in local name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag")}function _e(t){if(t===47||t===62||t===123||t!==null&&t>=0&&s4(t))return e.exit(d),ve(t);Ne(t,`after local name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function ve(t){if(t===47)return e.enter(u),e.consume(t),e.exit(u),se=Oe,Ae;if(t===62)return ke(t);if(t===123)return i4.call(oe,e,ye,_,v,y,r,i,a,!0,!1,o)(t);if(t!==null&&t>=0&&s4(t))return e.enter(b),e.enter(x),e.enter(S),e.consume(t),be;Ne(t,`before attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function ye(e){return se=ve,Ae(e)}function be(t){if(t!==null&&t>=0&&c4(t,{jsx:!0}))return e.consume(t),be;if(t===47||t===58||t===61||t===62||t===123||kv(t)||Mv(t))return e.exit(S),se=xe,Ae(t);Ne(t,`in attribute name`,"an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag")}function xe(t){if(t===58)return e.enter(C),e.consume(t),e.exit(C),se=Se,Ae;if(t===61)return e.exit(x),e.enter(T),e.consume(t),e.exit(T),se=k,Ae;if(t===47||t===62||t===123||kv(t)||Mv(t)||t!==null&&t>=0&&s4(t))return e.exit(x),e.exit(b),se=ve,Ae(t);Ne(t,`after attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function Se(t){if(t!==null&&t>=0&&s4(t))return e.enter(w),e.consume(t),Ce;Ne(t,`before local attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function Ce(t){if(t!==null&&t>=0&&c4(t,{jsx:!0}))return e.consume(t),Ce;if(t===47||t===61||t===62||t===123||kv(t)||Mv(t))return e.exit(w),e.exit(x),se=we,Ae(t);Ne(t,`in local attribute name`,"an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag")}function we(t){if(t===61)return e.enter(T),e.consume(t),e.exit(T),se=k,Ae;if(t===47||t===62||t===123||t!==null&&t>=0&&s4(t))return e.exit(b),ve(t);Ne(t,`after local attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function k(t){if(t===34||t===39)return e.enter(ee),e.enter(te),e.consume(t),e.exit(te),ce=t,Ee;if(t===123)return i4.call(oe,e,Te,re,ie,ae,r,i,a,!1,!1,o)(t);Ne(t,`before attribute value`,"a character that can start an attribute value, such as `\"`, `'`, or `{`"+(t===60?" (note: to use an element or fragment as a prop value in MDX, use `{<element />}`)":``))}function Te(t){return e.exit(b),se=ve,Ae(t)}function Ee(t){return t===null&&Ne(t,`in attribute value`,"a corresponding closing quote `"+String.fromCodePoint(ce)+"`"),t===ce?(e.enter(te),e.consume(t),e.exit(te),e.exit(ee),e.exit(b),ce=void 0,se=ve,Ae):B(t)?(se=Ee,Ae(t)):(e.enter(ne),De(t))}function De(t){return t===null||t===ce||B(t)?(e.exit(ne),Ee(t)):(e.consume(t),De)}function Oe(e){if(e===62)return ke(e);Ne(e,`after self-closing slash`,"`>` to end the tag"+(e===42||e===47?` (note: JS comments in JSX tags are not supported in MDX)`:``))}function ke(n){return e.enter(c),e.consume(n),e.exit(c),e.exit(s),t}function Ae(t){return B(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Me):Av(t)||Mv(t)?(e.enter(`esWhitespace`),je(t)):se(t)}function je(t){return B(t)?(e.exit(`esWhitespace`),Ae(t)):Av(t)||Mv(t)?(e.consume(t),je):(e.exit(`esWhitespace`),se(t))}function Me(e){if(!o&&oe.parser.lazy[oe.now().line]){let e=new Fw("Unexpected lazy line in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",oe.now(),`micromark-extension-mdx-jsx:unexpected-lazy`);throw e.url=l4+`#unexpected-lazy-line-in-container-expected-line-to-be`,e}return Ae(e)}function Ne(e,t,n){let r=new Fw(`Unexpected `+(e===null?`end of file`:"character `"+(e===96?"` ` `":String.fromCodePoint(e))+"` ("+Qoe(e)+`)`)+` `+t+`, expected `+n,oe.now(),`micromark-extension-mdx-jsx:unexpected-`+(e===null?`eof`:`character`));throw r.url=l4+(e===null?`#unexpected-end-of-file-at-expected-expect`:`#unexpected-character-at-expected-expect`),r}}function Qoe(e){return`U+`+e.toString(16).toUpperCase().padStart(4,`0`)}function $oe(e,t){return{name:`mdxJsxTextTag`,tokenize:n};function n(n,r,i){return u4.call(this,n,r,i,e,t.acornOptions,t.addResult,!0,`mdxJsxTextTag`,`mdxJsxTextTagMarker`,`mdxJsxTextTagClosingMarker`,`mdxJsxTextTagSelfClosingMarker`,`mdxJsxTextTagName`,`mdxJsxTextTagNamePrimary`,`mdxJsxTextTagNameMemberMarker`,`mdxJsxTextTagNameMember`,`mdxJsxTextTagNamePrefixMarker`,`mdxJsxTextTagNameLocal`,`mdxJsxTextTagExpressionAttribute`,`mdxJsxTextTagExpressionAttributeMarker`,`mdxJsxTextTagExpressionAttributeValue`,`mdxJsxTextTagAttribute`,`mdxJsxTextTagAttributeName`,`mdxJsxTextTagAttributeNamePrimary`,`mdxJsxTextTagAttributeNamePrefixMarker`,`mdxJsxTextTagAttributeNameLocal`,`mdxJsxTextTagAttributeInitializerMarker`,`mdxJsxTextTagAttributeValueLiteral`,`mdxJsxTextTagAttributeValueLiteralMarker`,`mdxJsxTextTagAttributeValueLiteralValue`,`mdxJsxTextTagAttributeValueExpression`,`mdxJsxTextTagAttributeValueExpressionMarker`,`mdxJsxTextTagAttributeValueExpressionValue`)}}function ese(e,t){return{concrete:!0,name:`mdxJsxFlowTag`,tokenize:n};function n(n,r,i){let a=this;return o;function o(e){return s(e)}function s(r){return u4.call(a,n,c,i,e,t.acornOptions,t.addResult,!1,`mdxJsxFlowTag`,`mdxJsxFlowTagMarker`,`mdxJsxFlowTagClosingMarker`,`mdxJsxFlowTagSelfClosingMarker`,`mdxJsxFlowTagName`,`mdxJsxFlowTagNamePrimary`,`mdxJsxFlowTagNameMemberMarker`,`mdxJsxFlowTagNameMember`,`mdxJsxFlowTagNamePrefixMarker`,`mdxJsxFlowTagNameLocal`,`mdxJsxFlowTagExpressionAttribute`,`mdxJsxFlowTagExpressionAttributeMarker`,`mdxJsxFlowTagExpressionAttributeValue`,`mdxJsxFlowTagAttribute`,`mdxJsxFlowTagAttributeName`,`mdxJsxFlowTagAttributeNamePrimary`,`mdxJsxFlowTagAttributeNamePrefixMarker`,`mdxJsxFlowTagAttributeNameLocal`,`mdxJsxFlowTagAttributeInitializerMarker`,`mdxJsxFlowTagAttributeValueLiteral`,`mdxJsxFlowTagAttributeValueLiteralMarker`,`mdxJsxFlowTagAttributeValueLiteralValue`,`mdxJsxFlowTagAttributeValueExpression`,`mdxJsxFlowTagAttributeValueExpressionMarker`,`mdxJsxFlowTagAttributeValueExpressionValue`)(r)}function c(e){return Av(e)?CS(n,l,`whitespace`)(e):l(e)}function l(e){let t=a.parser.constructs.flow[123],s=Array.isArray(t)?t:t?[t]:[],c;for(let e of s)if(e.name===`mdxFlowExpression`){c=e;break}return e===60?o(e):e===123&&c?n.attempt(c,l,i)(e):e===null||B(e)?r(e):i(e)}}}function tse(e){let t=e||{},n=t.acorn,r;if(n){if(!n.parse||!n.parseExpressionAt)throw Error("Expected a proper `acorn` instance passed in as `options.acorn`");r=Object.assign({ecmaVersion:2024,sourceType:`module`},t.acornOptions,{locations:!0})}else if(t.acornOptions||t.addResult)throw Error("Expected an `acorn` instance passed in as `options.acorn`");return{flow:{60:ese(n||void 0,{acornOptions:r,addResult:t.addResult||void 0})},text:{60:$oe(n||void 0,{acornOptions:r,addResult:t.addResult||void 0})}}}function nse(){return{disable:{null:[`autolink`,`codeIndented`,`htmlFlow`,`htmlText`]}}}function d4(){return Hx([o4(),tse(),nse()])}const rse=/^(`{3,}|~{3,})/gm;function f4(e){let t=[],n=null;for(let r of e.matchAll(rse)){let e=r[1],i=r.index;n?e[0]===n.marker[0]&&e.length>=n.marker.length&&(t.push([n.offset,i+r[0].length]),n=null):n={marker:e,offset:i}}return n&&t.push([n.offset,e.length]),t}function p4(e,t){return t.some(([t,n])=>e>=t&&e<n)}const m4=/`+/g;function ise(e){let t=[];m4.lastIndex=0;for(let n of e.matchAll(m4))t.push({offset:n.index,length:n[0].length});let n=[];for(let e=0;e<t.length;e++){let r=t[e];for(let i=e+1;i<t.length;i++){let a=t[i];if(a.length===r.length){n.push([r.offset,a.offset+a.length]),e=i;break}}}return n}const ase=/^[!-/:-@[-`{-~]$/;function h4(e){return e!==void 0&&ase.test(e)}function g4(e){return e===`<`||e===`>`}function _4(e){return e===void 0||h4(e)}function ose(e){return g4(e)||e===`\\`}const sse=[{from:`&`,to:``},{from:`;`,to:``}],cse=/&(?:[A-Za-z][A-Za-z0-9]*|#[0-9]+|#[xX][0-9A-Fa-f]+);/g;function lse(e,t){let n=0;for(let r=t-1;r>=0&&e[r]===`\\`;r--)n++;return n}function v4(e,t,n){return t.lastIndex=0,e.replace(t,(t,r)=>typeof r!=`number`||lse(e,r)%2==1?t:n(t))}function use(e){return v4(e,cse,e=>`${e.slice(1,-1)}`)}const y4=RegExp(`([^]+)`,`g`);function b4(e){if(!e.includes(``))return{value:e,spans:[]};let t=[],n=``,r=0;y4.lastIndex=0;let i=y4.exec(e);for(;i!==null;){i.index>r&&(n+=e.slice(r,i.index));let a=`&${i[1]??``};`;t.push({offset:n.length,length:a.length,raw:a}),n+=a,r=i.index+i[0].length,i=y4.exec(e)}return r<e.length&&(n+=e.slice(r)),{value:n,spans:t}}function dse(){return e=>{ub(e,e=>{let t=e;if(typeof t.value==`string`&&t.value.includes(``)){let{value:n,spans:r}=b4(t.value);if(t.value=n,e.type===`text`&&r.length>0){let t=e;t.data??={},t.data.entityRefSpans=r}}for(let e of[`url`,`title`,`alt`,`lang`,`meta`]){let n=t[e];typeof n==`string`&&n.includes(``)&&(t[e]=b4(n).value)}})}}const fse=[{from:`\\`,to:``}],pse=/\\</g;function mse(e){return v4(e,pse,e=>`${e.slice(1)}`)}function hse(){return e=>{ub(e,e=>{let t=e;if(typeof t.value==`string`&&t.value.includes(``)){if(e.type===`text`){let t=e.value,n=Array(t.length+1),r=[],i=``;for(let e=0;e<t.length;e+=1)n[e]=i.length,t[e]===``?r.push({offset:i.length,char:t[e+1]??``}):i+=t[e];n[t.length]=i.length;let a=[...(e.data?.escapedChars??[]).map(e=>({...e,offset:n[e.offset]??e.offset})),...r].map(e=>({...e})).sort((e,t)=>e.offset-t.offset||e.char.localeCompare(t.char)).filter((e,t,n)=>t===0||e.offset!==n[t-1]?.offset||e.char!==n[t-1]?.char),o=e.data?.entityRefSpans?.map(e=>{let t=n[e.offset]??e.offset,r=n[e.offset+e.length]??e.offset+e.length;return{...e,offset:t,length:r-t}});e.value=i,e.data??={},e.data.escapedChars=a,o&&(e.data.entityRefSpans=o)}else t.value=t.value.split(``).join(``)}for(let e of[`url`,`title`,`alt`]){let n=t[e];typeof n==`string`&&n.includes(``)&&(t[e]=n.split(``).join(``))}})}}const x4=[[``,``],[``,``],[``,``],[``,``],[``,``]],S4=/[\uE000-\uE004]/,C4=/[\uE005-\uE009]/,gse=x4.map(([e,t])=>({from:e,to:t})),_se=/<([a-zA-Z][a-zA-Z0-9+.-]*:[^\s<>]+)>/g,vse=/<!--[\s\S]*?-->/g,yse=/<\/([a-z][a-z0-9]*)\s*>/g,bse=/<([a-z][a-z0-9]*)(\s[^>]*)?\/?>/g,w4=new Set([`img`,`video`,`audio`]),T4=new Set([`mark`,`u`,`ins`]);function xse(e,t,n,r,i){let a=0,o=0,s=`<${t}`;for(;o<n;){let t=e.indexOf(s,o);if(t===-1||t>=n)break;if(o=t+s.length,O4(i,t))continue;let c=e[t+s.length];if(c!==void 0&&c!==`>`&&c!==`/`&&!/\s/.test(c)||p4(t,r))continue;let l=e.indexOf(`>`,t);(l===-1||e[l-1]!==`/`)&&a++}return a}const Sse=/<\/([A-Z][A-Za-z0-9.]*)>/g;function E4(e,t){let n=0,r=e.length;for(;n<r;){let i=n+r>>>1;e[i]<t?n=i+1:r=i}return n}function Cse(e,t){let n=new Map,r=new RegExp(Sse.source,`g`),i=r.exec(e);for(;i!==null;){if(O4(t,i.index)){i=r.exec(e);continue}let a=n.get(i[1]);a?a.push(i.index):n.set(i[1],[i.index]),i=r.exec(e)}return n}function wse(e){let t=[],n=/\n\s*\n/g,r=n.exec(e);for(;r!==null;)t.push(r.index),r=n.exec(e);return t}function Tse(e){let t=[],n=e.indexOf(`>`);for(;n!==-1;)t.push(n),n=e.indexOf(`>`,n+1);return t}function Ese(e){let t=[],n=e.indexOf(`
|
|
309
|
+
|
|
310
|
+
`);for(;n!==-1;)t.push(n),n=e.indexOf(`
|
|
311
|
+
|
|
312
|
+
`,n+1);return t}const D4=1024,Dse=/(?<![^\n\r]) {0,3}\[/g,Ose=/^[ \t]*\|?[ \t]*:?-+:?[ \t]*(?:\|[ \t]*:?-+:?[ \t]*)*\|?[ \t]*$/;function O4(e,t){return e.opens.has(t)||e.forced.has(t)}function kse(e){return e===``||e===``||e===``||e===``||e===``}function k4(e){return e===` `||e===` `}function A4(e){return e===`
|
|
313
|
+
`||e===`\r`}function j4(e,t){let n=e;for(;k4(t[n]);)n++;return n}function M4(e,t){return t[e]===`\r`&&t[e+1]===`
|
|
314
|
+
`?e+1:e}function Ase(e,t){let n=0;for(let r=e-1;r>=0&&t[r]===`\\`;r--)n++;if(n%2==1)return-1;let r=Math.max(0,e-D4);for(let n=e-1;n>=r;n--){let e=t[n];if(A4(e)||e==="`")return-1;if((e===`[`||e===`]`)&&!N4(n,t))return e===`]`||t[n+1]===`^`||t[n-1]===`]`?-1:n}return-1}function N4(e,t){let n=0;for(let r=e-1;r>=0&&t[r]===`\\`;r--)n++;return n%2==1}function jse(e,t,n){for(let r=e;r<t;r++)if(n[r]===`|`&&!N4(r,n))return!0;return!1}function Mse(e,t){let n=e;for(;n<t.length&&!A4(t[n]);)n++;if(n>=t.length)return!1;n=M4(n,t)+1;let r=n;for(;r<t.length&&!A4(t[r]);)r++;let i=t.slice(n,r);return Ose.test(i)&&/[|:]/.test(i)}function Nse(e){return e===``||_4(e)}function P4(e,t,n){let r=Math.min(t.length,e+1+D4);for(let i=e+1;i<r;i++){let e=t[i];if(e===`>`)return i;if(e===``&&t[i+1]===`<`){n.push(i+1),i++;continue}if(e===`<`||A4(e)||kse(e))return-1;if(e===`\\`){let e=t[i+1];if(e===`\\`&&!Nse(t[i+2]))return-1;if(ose(e))i++;else if(h4(e))return-1}}return-1}function F4(e,t){let n=t[e],r=n===`(`?`)`:n===`"`||n===`'`?n:null;if(r===null)return-1;let i=Math.min(t.length,e+1+D4);for(let n=e+1;n<i;n++){let e=t[n];if(e===r)return n+1;if(A4(e)||r===`)`&&e===`(`)return-1;if(e===`\\`){let e=t[n+1];(e===r||e===`\\`||r===`)`&&e===`(`)&&n++}}return-1}function Pse(e,t){if(t[e]===`)`)return e;let n=j4(e,t);if(n===e)return-1;let r=F4(n,t);return r!==-1&&t[r]===`)`?r:-1}function Fse(e,t,n){let r=Ase(e-2,t);if(r===-1)return-1;let i=P4(e,t,n);if(i===-1)return-1;let a=Pse(i+1,t);return a===-1||jse(r,a,t)?-1:i}function Ise(e,t){let n=e-2;for(t[n]===`\r`&&n--;n>=0&&t[n]!==`
|
|
315
|
+
`;n--)if(!k4(t[n]))return!1;return!0}function Lse(e,t){if(t[e+1]===`^`)return-1;let n=!1,r=Math.min(t.length,e+2+999);for(let i=e+1;i<r;i++){let e=t[i];if(e===`]`)return n?i:-1;if(e===`[`||A4(e))return-1;if(e===`\\`){let e=t[i+1];(e===`[`||e===`]`||e===`\\`)&&i++,n=!0;continue}k4(e)||(n=!0)}return-1}function Rse(e,t){let n=F4(j4(e+1,t),t);if(n===-1)return e;let r=j4(n,t);return r>=t.length?t.length:A4(t[r])?M4(r,t):e}function zse(e,t){let n=j4(e,t);if(n>=t.length)return t.length;if(A4(t[n]))return Rse(M4(n,t),t);if(n===e)return-1;let r=F4(n,t);return r===-1?-1:(n=j4(r,t),n>=t.length?t.length:A4(t[n])?M4(n,t):-1)}function Bse(e,t,n,r){let i=-1;for(let a of e.matchAll(Dse)){let o=a.index;if(o!==0&&o!==i+1&&!Ise(o,e))continue;let s=Lse(o+a[0].length-1,e);if(s===-1||e[s+1]!==`:`)continue;let c=j4(s+2,e);if(e[c]!==`<`)continue;let l=[],u=P4(c,e,l);if(u===-1)continue;let d=zse(u+1,e);if(!(d===-1||Mse(u,e))){t.add(c),n.add(u);for(let e of l)r.add(e);i=d}}}function Vse(e){let t=new Set,n=new Set,r=new Set,i=e.indexOf(`](<`);for(;i!==-1;){let a=[],o=Fse(i+2,e,a);if(o!==-1){t.add(i+2),n.add(o);for(let e of a)r.add(e)}i=e.indexOf(`](<`,i+3)}return Bse(e,t,n,r),{opens:t,closes:n,forced:r}}function Hse(e,t,n,r){let i=`</${t}>`,a=e.indexOf(i,n);for(;a!==-1;){if(!O4(r,a))return!0;a=e.indexOf(i,a+1)}return!1}function I4(e,t,n){let r=``;for(let i=0;i<e.length;i++){let a=e[i];r+=a===`<`?n.opens.has(t+i)?a:``:a===`>`?n.closes.has(t+i)?a:``:a}return r}function Use(e,t,n,r){let i=E4(n,e);if(i>=n.length)return!1;let a=n[i],o=E4(r,e);return a>=(o<r.length?r[o]:t.length)?!1:t[a-1]===`/`}function L4(e,t,n){let r=new Int32Array(e.length+1),i=new Int32Array(e.length+1);r[e.length]=-1,i[e.length]=-1;let a=t===`all`?[`"`,`'`,"`"]:[`"`],o=a.map(()=>-1),s=a.map(()=>-1);for(let t=e.length-1;t>=0;t--){let c=e[t],l=a.indexOf(c),u=t+1;if(l!==-1||c===`{`){let n=l===-1?i[t+1]:o[l];u=n===-1?e.length:n+1}r[t]=c===`>`&&!n.has(t)?t:r[u],i[t]=c===`}`?t:i[u];for(let e=0;e<a.length;e++){let n=c===a[e]?t:c===`\\`?s[e]:o[e];s[e]=o[e],o[e]=n}}return r}function Wse(e,t){let n=[],r=Ese(e),i;for(let a of e.matchAll(/<\/?([A-Z][A-Za-z0-9.]*)/g)){let o=a.index;if(n.length>0){let[e,t]=n[n.length-1];if(o>e&&o<=t)continue}let s=o+a[0].length,c=E4(r,o),l=c<r.length?r[c]:e.length,u=E4(t,s);if(u>=t.length||t[u]>=l)continue;i??=L4(e,`all`,new Set);let d=i[s];d!==-1&&d<l&&n.push([o,d])}return n}function Gse(e,t){if(t.length===0)return!1;let n=0,r=t.length-1;for(;n<=r;){let i=n+r>>>1,[a,o]=t[i];if(e<=a)r=i-1;else if(e>o)n=i+1;else return!0}return!1}function Kse(e,t,n,r){let i=Math.min(t.length,n),a=r[e];return a>0&&a<i&&t[a-1]===`/`}function R4(e,t){let n=qse(e,t.escapeAware),r=new Set(n),i=[],a=[];return z4(e,t.escapeAware,{onFlush:()=>{a.length=0},onBrace:(e,t)=>{if(!r.has(e)){if(t===`{`)a.push(e);else if(a.length>0){let t=a.pop();a.length===0&&i.push({start:t,end:e+1})}}}}),{matched:i,unmatched:n}}function qse(e,t){let n=[],r=[];return z4(e,t,{onFlush:()=>{n.push(...r),r.length=0},onBrace:(e,t)=>{t===`{`?r.push(e):r.length>0&&r.pop()}}),n.push(...r),n}function z4(e,t,n){for(let r=0;r<e.length;r++){if(e[r]===`
|
|
316
|
+
`){let t=e[r+1];if(t===`
|
|
317
|
+
`||t===`>`){if(n.onFlush(),t===`
|
|
318
|
+
`)for(;e[r+1]===`
|
|
319
|
+
`;)r++;continue}}let i=e[r];if(i===`{`||i===`}`){if(t){let t=0;for(let n=r-1;n>=0&&e[n]===`\\`;n--)t++;if(t%2==1)continue}n.onBrace(r,i)}}}function Jse(e){let t=e;if(S4.test(t))for(let[e,n]of x4)t=t.replaceAll(e,n);t=t.replace(vse,e=>e.replace(/</g,``).replace(/>/g,``));let n=Vse(t);t=t.replace(_se,(e,t,r)=>n.opens.has(r)?e:n.forced.has(r)?`${e.slice(1)}`:`${t.replaceAll(`:`,``).replaceAll(`@`,``)}`);let r=new Map,i=[...f4(t),...ise(t)];t=t.replace(yse,(e,a,o)=>{if(n.opens.has(o))return e;if(n.forced.has(o))return`${e.slice(1)}`;if(T4.has(a)){let s=r.get(a)??0;if(s<xse(t,a,o,i,n))return r.set(a,s+1),e}return e.replace(/</g,``).replace(/>/g,``)}),t=t.replace(bse,(e,t,r,i)=>n.opens.has(i)?e:n.forced.has(i)?I4(e,i,n):w4.has(t)&&e.endsWith(`/>`)||T4.has(t)?e:t[0]===t[0].toLowerCase()&&t[0]!==t[0].toUpperCase()?I4(e,i,n):e),t=t.replace(/<>/g,(e,t)=>n.opens.has(t)?e:I4(e,t,n));let a=Cse(t,n),o=wse(t),s=Tse(t),c=Wse(t,s),l;t=t.replace(/</g,(e,r)=>{if(n.opens.has(r))return e;if(n.forced.has(r))return``;if(Gse(r,c))return e;let i=t.slice(r,r+256);if(i[1]===`/`)return/^<\/[a-zA-Z][a-zA-Z0-9.]*[ \t]*>/.test(i)?e:``;let u=/^<([a-z][a-z0-9]*)/.exec(i);if(u&&w4.has(u[1])&&Use(r,t,s,o))return e;let d=/^<([a-z][a-z0-9]*)([\s/>])/.exec(i);if(d&&T4.has(d[1])){let a=d[1];return i.startsWith(`<${a}/>`)||Hse(t,a,r,n)?e:``}let f=/^<([A-Z][a-zA-Z0-9.]*)[\s/>]/.exec(i);if(!f)return``;let p=f[1],m=E4(o,r),h=m<o.length?o[m]:t.length,g=r+1+p.length;if(s.length>0&&(l??=L4(t,`double`,n.closes),Kse(g,t,h,l)))return e;let _=a.get(p);return _&&E4(_,r)<_.length?e:``});{let{unmatched:e}=R4(t,{escapeAware:!0});if(e.length>0){let n=t.split(``);for(let t of e)n[t]=``;t=n.join(``)}}return t}function B4(e){return S4.test(e)||C4.test(e)}function Yse(){return e=>{ub(e,e=>{let t=e;typeof t.value==`string`&&B4(t.value)&&(t.value=V4(t.value)),typeof t.url==`string`&&B4(t.url)&&(t.url.startsWith(``)&&Xse(e),t.url=V4(t.url)),typeof t.title==`string`&&B4(t.title)&&(t.title=V4(t.title)),typeof t.alt==`string`&&B4(t.alt)&&(t.alt=V4(t.alt)),typeof t.lang==`string`&&B4(t.lang)&&(t.lang=V4(t.lang)),typeof t.meta==`string`&&B4(t.meta)&&(t.meta=V4(t.meta))})}}function Xse(e){(e.type===`link`||e.type===`image`||e.type===`definition`)&&(e.data??={},e.data.sourceGuardedDestinationOpen=!0)}function V4(e){let t=e.replaceAll(``,`<`).replaceAll(``,`>`).replaceAll(``,`:`).replaceAll(``,`@`).replaceAll(``,`{`);if(C4.test(t))for(let[e,n]of x4)t=t.replaceAll(n,e);return t}const H4=d4(),U4=R2(),W4=z2();function G4(){let e=this.data();e.micromarkExtensions||=[],e.fromMarkdownExtensions||=[],e.toMarkdownExtensions||=[];let t=e.micromarkExtensions;t.some(e=>e===H4)||t.push(H4);let n=e.fromMarkdownExtensions;n.some(e=>e===U4)||n.push(U4);let r=e.toMarkdownExtensions;r.some(e=>e===W4)||r.push(W4)}const K4=/(?<!\uE102)<br[ \t]*\/?>/g,Zse=new Set([`mdxJsxTextElement`,`mdxJsxFlowElement`]);function Qse(e,t){let n=[],r=!1;for(let i of e.children){if(i.type!==`text`){n.push(i);continue}let e=i.value;K4.lastIndex=0;let a=[],o=0;for(;;){let n=K4.exec(e);if(n===null)break;let s=n.index;s>o&&a.push(yY(t,i,o,s));let c={type:`break`,data:{sourceStyle:`html`,sourceRaw:n[0]}},l=CY(t,i,s,s+n[0].length);l&&(c.position=l),a.push(c),o=s+n[0].length,r=!0}a.length===0?n.push(i):(o<e.length&&a.push(yY(t,i,o,e.length)),n.push(...a))}r&&(e.children=n)}function $se(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;ub(e,e=>{if(Zse.has(e.type))return Gv;let t=e;Array.isArray(t.children)&&Qse(e,n)})}}function q4(e){return e===-2?` `:e===-1?` `:String.fromCharCode(e)}const ece={name:`wikiLink`,tokenize:(e,t,n)=>{let r=0,i=0,a=``;return o;function o(t){return t===91?(e.enter(`wikiLink`),e.enter(`wikiLinkMarker`),e.consume(t),s):n(t)}function s(t){return t===91?(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===91?n(t):t===93?a.trim()===``?n(t):(e.exit(`wikiLinkTarget`),d(t)):t===35?a.trim()===``?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAnchor`),l):t===124?QU(a)?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),u):(e.consume(t),a+=q4(t),c)}function l(t){return t===null||t===-5||t===-4||t===-3||t===91?n(t):t===93?r===0?n(t):(e.exit(`wikiLinkAnchor`),d(t)):t===124?r===0?n(t):(e.exit(`wikiLinkAnchor`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),u):(e.consume(t),r++,l)}function u(t){return t===null||t===-5||t===-4||t===-3||t===91?n(t):t===93?i===0?n(t):(e.exit(`wikiLinkAlias`),d(t)):(e.consume(t),i++,u)}function d(t){return t===93?(e.enter(`wikiLinkMarker`),e.consume(t),f):n(t)}function f(r){return r===93?(e.consume(r),e.exit(`wikiLinkMarker`),e.exit(`wikiLink`),t):n(r)}}},tce={name:`wikiLinkEmbed`,tokenize:(e,t,n)=>{let r=0,i=0,a=``;return o;function o(t){return t===33?(e.enter(`wikiLinkEmbed`),e.enter(`wikiLinkEmbedBang`),e.consume(t),e.exit(`wikiLinkEmbedBang`),s):n(t)}function s(t){return t===91?(e.enter(`wikiLinkMarker`),e.consume(t),c):n(t)}function c(t){return t===91?(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===91?n(t):t===93?a.trim()===``?n(t):(e.exit(`wikiLinkTarget`),f(t)):t===35?a.trim()===``?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAnchor`),u):t===124?QU(a)?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),d):(e.consume(t),a+=q4(t),l)}function u(t){return t===null||t===-5||t===-4||t===-3||t===91?n(t):t===93?r===0?n(t):(e.exit(`wikiLinkAnchor`),f(t)):t===124?r===0?n(t):(e.exit(`wikiLinkAnchor`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),d):(e.consume(t),r++,u)}function d(t){return t===null||t===-5||t===-4||t===-3||t===91?n(t):t===93?i===0?n(t):(e.exit(`wikiLinkAlias`),f(t)):(e.consume(t),i++,d)}function f(t){return t===93?(e.enter(`wikiLinkMarker`),e.consume(t),p):n(t)}function p(r){return r===93?(e.consume(r),e.exit(`wikiLinkMarker`),e.exit(`wikiLinkEmbed`),t):n(r)}}};function nce(){return{text:{91:ece,33:tce}}}function rce(e){this.enter({type:`wikiLink`,value:``,data:{target:``,anchor:null,alias:null},children:[]},e)}function ice(e){this.enter({type:`wikiLinkEmbed`,value:``,data:{target:``,anchor:null,alias:null},children:[]},e)}function J4(e){return e.stack[e.stack.length-1]}function ace(e){let t=J4(this),n=this.sliceSerialize(e);t.data.target=n.trim(),n!==t.data.target&&(t.data.sourceTarget=n)}function oce(e){let t=J4(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 sce(e){let t=J4(this),n=this.sliceSerialize(e),r=n.trim();t.data.alias=r.length?r:null,n!==r&&(t.data.sourceAlias=n)}function cce(e){let t={target:e.data.target,anchor:e.data.anchor??null,alias:e.data.alias??null},n=YU(t,{separatorCrossed:t.alias!==null||e.data.sourceAlias!=null});n.target!==t.target&&(e.data.sourceTarget??=t.target,e.data.target=n.target),n.anchor!==t.anchor&&(e.data.sourceAnchor??=t.anchor,e.data.anchor=n.anchor),n.alias!==t.alias&&(e.data.sourceAlias??=t.alias,e.data.alias=n.alias)}function Y4(e){cce(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 lce(e){Y4(J4(this)),this.exit(e)}function uce(e){Y4(J4(this)),this.exit(e)}const X4={enter:{wikiLink:rce,wikiLinkEmbed:ice},exit:{wikiLinkTarget:ace,wikiLinkAnchor:oce,wikiLinkAlias:sce,wikiLink:lce,wikiLinkEmbed:uce}};function Z4(e){return(t,n,r,i)=>{let a=t.data,o=r.stack.includes(`tableCell`),s=e=>o?tW(e):e,c=a?.target??``,l=a?.anchor,u=a?.alias,d=`${e}${s(ZU(a?.sourceTarget,c,`separatorAdjacent`))}`;if(l)d+=`#${s(ZU(a?.sourceAnchor,l,`separatorAdjacent`))}`;else{let e=s(ZU(a?.sourceAnchor,``,`separatorAdjacent`));e.length>0&&(d+=`#${e}`)}let f=u?ZU(a?.sourceAlias,u,`alias`):ZU(a?.sourceAlias,``,`alias`);if(f.length>0){let e=o&&!d.endsWith(`\\`)?`\\|`:`|`;d+=`${e}${s(f)}`}return`${d}]]`}}const Q4={handlers:{wikiLink:Z4(`[[`),wikiLinkEmbed:Z4(`![[`)},unsafe:[{character:`[`,inConstruct:[`phrasing`]}]},$4=nce();function e3(){let e=this.data();e.micromarkExtensions||=[],e.micromarkExtensions.some(e=>e===$4)||e.micromarkExtensions.push($4),e.fromMarkdownExtensions||=[],e.fromMarkdownExtensions.some(e=>e===X4)||e.fromMarkdownExtensions.push(X4),e.toMarkdownExtensions||=[],e.toMarkdownExtensions.some(e=>e===Q4)||e.toMarkdownExtensions.push(Q4)}function t3(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}function n3(){let e=!1,t=``,n=0;return r=>{let i=dce(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 dce(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 r3(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]}`}function fce(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(i3(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(i3(t.slice(i),i>0,!1)),a.join(``)}function i3(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===9||t===32;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===9||t===32;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function pce(e,t,n,r){let i=new Map,a=new Map,o={all:c,definitionById:i,footnoteById:a,footnoteCounts:new Map,footnoteOrder:[],one:s};return ub(r,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?i:a,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),o;function s(r,i){return s3(e,t,n,r,i,o)}function c(t){let n=[];if(`children`in t){let r=t.children,i=-1;for(;++i<r.length;){let a=o.one(r[i],t);if(a){let t=i?r[i-1]:void 0;if(t?.type===`break`&&t.data?.sourceStyle!==`html`){if(!Array.isArray(a)&&a.type===e.nodes.text){let t=a3(a.text);a=t.length>0?e.text(t):void 0}else if(!Array.isArray(a)&&a.type!==e.nodes.text){let t=a.firstChild;if(t&&t.type===e.nodes.text){let n=a3(t.text),r=U.from(a.content);a=a.copy(n.length>0?r.replaceChild(0,e.text(n)):r.cut(t.nodeSize))}}}}a&&(Array.isArray(a)?n.push(...a):n.push(a))}}return n}}function mce(e){return e.replaceAll(/\n([^\n])/g,` $1`)}function hce(e,t,n){let r=t.referenceType,i=`]`;if(r===`collapsed`?i+=`[]`:r===`full`&&(i+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[e.text(`![`+(t.alt??``)+i)];let a=n.all(t),o=a[0];o&&o.type===e.nodes.text?a[0]=o.copy(U.from(e.text(`[`+(o.text??``)))):a.unshift(e.text(`[`));let s=a[a.length-1];return s&&s.type===e.nodes.text?a[a.length-1]=s.copy(U.from(e.text((s.text??``)+i))):a.push(e.text(i)),a}function gce(e){throw Error(`unknown markdown node: ${e.type}`)}function a3(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function o3(){}function _ce(e){throw Error("Expected node, not `"+JSON.stringify(e)+"`")}function vce(e,t,n,r){return Vy(`tagName`,{handlers:e})(t,n,r)}function s3(e,t,n,r,i,a){return Vy(`type`,{invalid:_ce,unknown:gce,handlers:{toml:o3,yaml:o3,definition:o3,footnoteDefinition:o3,root(t,n,r){let i=r.all(t);return e.topNodeType.create(null,i)},html(t){let r=r0(t.value).children[0];if(r?.type!==`element`)return null;let[,i]=r.children;if(i?.type!==`element`)return null;let o=i.children[0];return o?.type===`element`?vce(n,o,void 0,a)||(t.value?e.text(t.value):null):null},text(t){let n=mce(fce(String(t.value)));return n?e.text(n):null},...t,linkReference(n,r,i){if(t.linkReference)return t.linkReference(n,r,i);let a=String(n.identifier).toUpperCase(),o=i.definitionById.get(a);if(!o)return hce(e,n,i);let s={type:`link`,url:o.url,title:o.title,children:n.children,data:{...o.data,...n.data}};return t.link?.(s,r,i)}}})(r,i,a)}function c3(e,t){return(n,r,i)=>{let a=i.all(n);return e.createAndFill(t?.(n)??null,a)}}function l3(e,t){return(n,r,i)=>{let a=i.all(n),o=e.create(t?.(n)??null);return a.map(e=>e.mark(o.addToSet(e.marks)))}}const yce=function(e,t){let n=s3(t.schema,t.handlers,t.htmlHandlers??{},e,void 0,pce(t.schema,t.handlers,t.htmlHandlers??{},e));return n.check(),n},bce=function(e){this.compiler=function(t){return yce(t,e)}};function xce(e,t){let n={one:r,all:u,nodeHandlers:e,markHandlers:t};function r(e,t){let r=e.type.schema,i=e.type.name,a=n.nodeHandlers[i];if(a)return a(e,t,n);if(e.type===r.topNodeType){let t=n.all(e);return t.some(e=>Fv(e,`root`)),{type:`root`,children:t}}return e.type===r.nodes.text?{type:`text`,value:e.text}:null}function i(e){if(e.length===0)return[];let t=e[0].marks,n=[];for(let r of t){let t=!0;for(let n=1;n<e.length;n++)if(!e[n].marks.some(e=>e.eq(r))){t=!1;break}t&&n.push(r)}return n}function a(e,t){let n=e.findIndex(e=>e.eq(t));return n===-1?e:e.slice(0,n).concat(e.slice(n+1))}function o(e,t){let n=[];for(let r of e)t.some(e=>e.eq(r))&&n.push(r);return n}function s(e,t,r){let i=n.markHandlers[e.type.name];if(!i)return r;let a=i(e,t,r,n);return(Array.isArray(a)?a:[a]).filter(e=>e!=null)}function c(e,t){let r=[];for(let i of e){let e=n.one(i.node,t);e!=null&&r.push(e)}return r}function l(e,t){if(e.length===0)return[];if(e.every(e=>e.marks.length===0))return c(e,t);let n=i(e);if(n.length>0){let r=n[0];return s(r,t,l(e.map(e=>({node:e.node,marks:a(e.marks,r)})),t))}let r=[],u=[e[0]],d=e[0].marks.slice();for(let t=1;t<e.length;t++){let n=e[t],i=o(d,n.marks),a=d.length===0&&n.marks.length===0;i.length>0||a?(u.push(n),d=a?[]:i):(r.push(u),u=[n],d=n.marks.slice())}if(r.push(u),r.length===1&&e.length>1){console.warn(`[mdast-util-from-prosemirror] degenerate mark partition; falling back to per-span rendering`,{spanCount:e.length,firstSpanMarks:e[0]?.marks.map(e=>e.type.name),lastSpanMarks:e[e.length-1]?.marks.map(e=>e.type.name)});let n=[];for(let r of e)for(let e of l([r],t))n.push(e);return n}let f=[];for(let e of r)for(let n of l(e,t))f.push(n);return f}function u(e){return l(e.children.map(e=>({node:e,marks:e.marks})),e)}return n}function Sce(e,t){return xce(t.nodeHandlers,t.markHandlers).one(e)}function u3(e,t){return(n,r,i)=>{let a=i.all(n);return{type:e,...t?.(n),children:a}}}function d3(e,t){return(n,r,i)=>({type:e,...t?.(n),children:i})}function Cce(e){return e.charAt(0).toUpperCase()+e.slice(1)}const wce={note:`<svg class="octicon octicon-info mr-2" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path></svg>`,tip:`<svg class="octicon octicon-light-bulb mr-2" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="M8 1.5c-2.363 0-4 1.69-4 3.75 0 .984.424 1.625.984 2.304l.214.253c.223.264.47.556.673.848.284.411.537.896.621 1.49a.75.75 0 0 1-1.484.211c-.04-.282-.163-.547-.37-.847a8.456 8.456 0 0 0-.542-.68c-.084-.1-.173-.205-.268-.32C3.201 7.75 2.5 6.766 2.5 5.25 2.5 2.31 4.863 0 8 0s5.5 2.31 5.5 5.25c0 1.516-.701 2.5-1.328 3.259-.095.115-.184.22-.268.319-.207.245-.383.453-.541.681-.208.3-.33.565-.37.847a.751.751 0 0 1-1.485-.212c.084-.593.337-1.078.621-1.489.203-.292.45-.584.673-.848.075-.088.147-.173.213-.253.561-.679.985-1.32.985-2.304 0-2.06-1.637-3.75-4-3.75ZM5.75 12h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5ZM6 15.25a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 0 1.5h-2.5a.75.75 0 0 1-.75-.75Z"></path></svg>`,important:`<svg class="octicon octicon-report mr-2" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v9.5A1.75 1.75 0 0 1 14.25 13H8.06l-2.573 2.573A1.458 1.458 0 0 1 3 14.543V13H1.75A1.75 1.75 0 0 1 0 11.25Zm1.75-.25a.25.25 0 0 0-.25.25v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25Zm7 2.25v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 9a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg>`,warning:`<svg class="octicon octicon-alert mr-2" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg>`,caution:`<svg class="octicon octicon-stop mr-2" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="M4.47.22A.749.749 0 0 1 5 0h6c.199 0 .389.079.53.22l4.25 4.25c.141.14.22.331.22.53v6a.749.749 0 0 1-.22.53l-4.25 4.25A.749.749 0 0 1 11 16H5a.749.749 0 0 1-.53-.22L.22 11.53A.749.749 0 0 1 0 11V5c0-.199.079-.389.22-.53Zm.84 1.28L1.5 5.31v5.38l3.81 3.81h5.38l3.81-3.81V5.31L10.69 1.5ZM8 4a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 4Zm0 8a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path></svg>`};function Tce(e){return e.replace(`<svg`,~e.indexOf(`xmlns`)?`<svg`:`<svg xmlns="http://www.w3.org/2000/svg"`).replaceAll(`"`,`'`).replaceAll(`%`,`%25`).replaceAll(`#`,`%23`).replaceAll(`{`,`%7B`).replaceAll(`}`,`%7D`).replaceAll(`<`,`%3C`).replaceAll(`>`,`%3E`)}const Ece=(e={})=>{let{markers:t=[`TIP`,`NOTE`,`IMPORTANT`,`WARNING`,`CAUTION`],icons:n=wce,matchCaseSensitive:r=!1,titles:i={},classPrefix:a=`markdown-alert`,ignoreSquareBracket:o=!1}=e,s=t===`*`?`\\w+`:t.join(`|`),c=RegExp(o?`^!(${s})([^\\n\\r]*)`:`^\\[\\!(${s})\\]([^\\n\\r]*)`,r?``:`i`);return e=>(ub(e,`blockquote`,(e,t,r)=>{let o=e.children[0];if(!o)return;let s=o.children?.[0];if(!s||(!(`value`in s)&&`children`in s&&s.children[0]&&(s=s.children[0]),s.type!==`text`))return;let l=s.value.match(c);if(!l)return;let u=l[1]?.toLowerCase(),d=l[2]?.trim()||(i[u]??Cce(u)),f=n[u],p=`data:image/svg+xml;utf8,${Tce(f)}`;t===void 0||!r||(s.value=s.value.slice(l[0].length).trimStart(),e.data={hName:`div`,hProperties:{class:`${a} ${a}-${u}`}},e.children=[{type:`paragraph`,data:{hName:`p`,hProperties:{class:`${a}-title`}},children:[{type:`span`,data:{hName:`span`,hProperties:{class:`octicon octicon-${u}`,style:`--oct-icon: url("${p}")`}}},{type:`text`,value:d}]},...e.children])}),e)};function Dce(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:a},exit:{mathFlow:i,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:s,mathText:o,mathTextData:s}};function e(e){this.enter({type:`math`,meta:null,value:``,data:{hName:`pre`,hChildren:[{type:`element`,tagName:`code`,properties:{className:[`language-math`,`math-display`]},children:[]}]}},e)}function t(){this.buffer()}function n(){let e=this.resume(),t=this.stack[this.stack.length-1];t.type,t.meta=e}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(e){let t=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),n=this.stack[this.stack.length-1];n.type,this.exit(e),n.value=t;let r=n.data.hChildren[0];r.type,r.tagName,r.children.push({type:`text`,value:t}),this.data.mathFlowInside=void 0}function a(e){this.enter({type:`inlineMath`,value:``,data:{hName:`code`,hProperties:{className:[`language-math`,`math-inline`]},hChildren:[]}},e),this.buffer()}function o(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,this.exit(e),n.value=t,n.data.hChildren.push({type:`text`,value:t})}function s(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}}function Oce(e){let t=(e||{}).singleDollarTextMath;return t??=!0,r.peek=i,{unsafe:[{character:`\r`,inConstruct:`mathFlowMeta`},{character:`
|
|
320
|
+
`,inConstruct:`mathFlowMeta`},{character:`$`,after:t?void 0:`\\$`,inConstruct:`phrasing`},{character:`$`,inConstruct:`mathFlowMeta`},{atBreak:!0,character:`$`,after:`\\$`}],handlers:{math:n,inlineMath:r}};function n(e,t,n,r){let i=e.value||``,a=n.createTracker(r),o=`$`.repeat(Math.max(Zy(i,`$`)+1,2)),s=n.enter(`mathFlow`),c=a.move(o);if(e.meta){let t=n.enter(`mathFlowMeta`);c+=a.move(n.safe(e.meta,{after:`
|
|
321
|
+
`,before:c,encode:[`$`],...a.current()})),t()}return c+=a.move(`
|
|
322
|
+
`),i&&(c+=a.move(i+`
|
|
323
|
+
`)),c+=a.move(o),s(),c}function r(e,n,r){let i=e.value||``,a=1;for(t||a++;RegExp(`(^|[^$])`+`\\$`.repeat(a)+`([^$]|$)`).test(i);)a++;let o=`$`.repeat(a);/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^\$|\$$/.test(i))&&(i=` `+i+` `);let s=-1;for(;++s<r.unsafe.length;){let e=r.unsafe[s];if(!e.atBreak)continue;let t=r.compilePattern(e),n;for(;n=t.exec(i);){let e=n.index;i.codePointAt(e)===10&&i.codePointAt(e-1)===13&&e--,i=i.slice(0,e)+` `+i.slice(n.index+1)}}return o+i+o}function i(){return`$`}}const kce={};function f3(e){let t=this,n=e||kce,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(FD(n)),a.push(Dce()),o.push(Oce(n))}const Ace=/[\s/>{]/;function p3(e){return Zu(ld(e))}function m3(e,t){return e.type===`mdxJsxFlowElement`&&e.name===t&&!e.data?.htmlBoundary?e:null}function jce(e,t){let n=e.indexOf(`<`);if(n<0||e.slice(0,n).trim()!==``)return null;let r=n+1+t.length;if(!e.startsWith(`<${t}`,n)||!Ace.test(e[r]??``))return null;let i=null,a=0;for(let o=r;o<e.length;o++){let r=e[o];if(i!==null)r===i&&(i=null);else if(a>0)r===`{`?a++:r===`}`&&a--;else if(r===`{`)a=1;else if(r===`"`||r===`'`)i=r;else if(r===`>`){if(e[o-1]===`/`)return null;let r=e.slice(o+1);return r.trimEnd().endsWith(`</${t}>`)?{leading:e.slice(0,n),afterOpenTag:r}:null}}return null}function Mce(e){let t=new Map,n=(t,n,r)=>{let i=e(t),a=i.childCount===1?i.firstChild:null;if(a?.type.name!==`jsxComponent`||a.attrs.kind!==`element`)return null;let o=m3(r(a),n);return o?{attributes:p3(o.attributes),children:p3(o.children)}:null},r=(e,r,i)=>{let a=t.get(e);if(a!==void 0)return a;let o=n(e,r,i);if(t.size>=256){let e=t.keys().next().value;e!==void 0&&t.delete(e)}return t.set(e,o),o};return{read(e,t,n){let{componentName:i,sourceRaw:a,kind:o}=e.attrs;if(o!==`element`||e.childCount===0||typeof i!=`string`||i===``||typeof a!=`string`||a===``)return null;let s=jce(a,i);if(!s)return null;let c=r(a,i,n);return!c||p3(t.children)!==c.children?null:p3(t.attributes)===c.attributes?{kind:`verbatim`}:{kind:`body`,body:s}}}}const Nce=/^[ \t]{0,3}\[([^\]]+)\]:\s*(\S+)(\s+(?:"[^"]*"|'[^']*'|\([^)]*\)))?\s*$/gm;function h3(e){let t=f4(e),n=[];for(let r of e.matchAll(Nce))p4(r.index,t)||n.push(r[0].trimEnd());return n.length>0?`${n.join(`
|
|
324
|
+
`)}\n\n`:``}function Pce(e,t){let n={startMs:typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now(),calls:0};return v3(e,t.parse,0,n)}function g3(e){return e.calls>=1e3||(typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now())-e.startMs>=500}function _3(e){return e instanceof Error?{name:e.name,message:e.message.slice(0,500),stack:e.stack?.split(`
|
|
325
|
+
`).slice(0,4).join(`
|
|
326
|
+
`)}:{name:`UnknownError`,message:String(e??`unknown`).slice(0,500)}}function v3(e,t,n,r){if(n>20)return s2(),console.warn(JSON.stringify({event:`mdx-whole-doc-fallback`,reason:`MAX_SPLIT_DEPTH exceeded`})),b3(e);if(r){if(g3(r))return c2(),console.warn(JSON.stringify({event:`mdx-whole-doc-fallback`,reason:`parse budget exhausted`,calls:r.calls})),b3(e);r.calls+=1}try{return t(e)}catch(i){let a=Fce(i),o=_3(i);if(a===void 0){if(n===0){let n=Vce(e,t,i,r);if(n)return n}return s2(),console.warn(JSON.stringify({event:`mdx-whole-doc-fallback`,reason:o.message,error:o})),b3(e)}o2(),console.warn(JSON.stringify({event:`mdx-block-fallback`,offset:a,reason:o.message,error:o}));try{let i=zce(e,a),s=e.slice(i.start,i.end),c=e.slice(0,i.start).replace(/\n+$/,``),l=e.slice(i.end).replace(/^\n+/,``),u=c.trim()?v3(c,t,n+1,r):{type:`doc`,content:[]},d=l.trim()?v3(h3(c)+l,t,n+1,r):{type:`doc`,content:[]},f={type:`rawMdxFallback`,attrs:{reason:o.message,originalSpan:{start:i.start,end:i.end}},content:s?[{type:`text`,text:s}]:[]},p=[...u.content??[],f,...d.content??[]];return{type:`doc`,content:p.length>0?p:[{type:`paragraph`,content:[]}]}}catch(t){s2();let n=_3(t);return console.warn(JSON.stringify({event:`mdx-whole-doc-fallback`,reason:`Recovery failed: ${n.message}`,recoveryPath:`block-split-then-rejoin`,error:n,originalError:o})),b3(e)}}}function Fce(e){if(!e||typeof e!=`object`)return;let t=e;if(t.place&&typeof t.place.offset==`number`)return t.place.offset;if(t.place?.start&&typeof t.place.start.offset==`number`)return t.place.start.offset;if(t.position&&typeof t.position.offset==`number`)return t.position.offset;if(t.position?.start&&typeof t.position.start.offset==`number`)return t.position.start.offset}function Ice(e,t){let n=/\n\s*\n/g,r=null;for(let i of e.matchAll(n)){if(i.index>=t)break;r=i.index+i[0].length}return r}function y3(e,t){for(let n of e.matchAll(/\n\s*\n/g))if(n.index>=t)return n.index;return null}function Lce(e,t){let n=[];for(let r of e.matchAll(/<(\/?)([A-Z][A-Za-z0-9.]*)/g)){let i=r.index;if(p4(i,t))continue;let a=r[1]===`/`,o=r[2],s=i+r[0].length,c=Math.min(e.length,s+32768),l=!1,u=0,d=-1,f=!1;for(let t=s;t<c;t++){let n=e[t];if(l){n===`"`&&(l=!1),n===`\\`&&t+1<c&&t++;continue}if(n===`"`){l=!0;continue}if(n===`{`){u++;continue}if(n===`}`&&u>0){u--;continue}if(!(u>0)&&n===`>`){d=t,t>0&&e[t-1]===`/`&&(f=!0);break}}if(d===-1)continue;let p=d+1;a?n.push({kind:`close`,name:o,start:i,end:p}):f?n.push({kind:`self-close`,name:o,start:i,end:p}):n.push({kind:`open`,name:o,start:i,end:p})}return n}function Rce(e){let t=Lce(e,f4(e)),n=[],r=[];for(let i of t){if(i.kind===`self-close`)continue;if(i.kind===`open`){n.push(i);continue}let t=-1;for(let e=n.length-1;e>=0;e--)if(n[e].name===i.name){t=e;break}if(t!==-1){for(let a=n.length-1;a>t;a--){let t=n[a],o=y3(e,t.start)??e.length;r.push({start:t.start,end:Math.min(i.start,o),source:`unmatched`})}r.push({start:n[t].start,end:i.end,source:`pair`}),n.length=t}}for(let t of n){let n=y3(e,t.start)??e.length;r.push({start:t.start,end:Math.min(e.length,n),source:`unmatched`})}return r}function zce(e,t){let n=Rce(e),r=null;for(let e of n)e.start<=t&&t<=e.end&&(!r||e.end-e.start<r.end-r.start)&&(r=e);return r?{start:r.start,end:r.end}:{start:Ice(e,t)??0,end:y3(e,t)??e.length}}function Bce(e){let t=f4(e),n=/\n[ \t]*\n/g,r=[0];for(let i of e.matchAll(n)){let e=i.index;p4(e,t)||r.push(e+i[0].length)}r.push(e.length);let i=[];for(let t=0;t<r.length-1;t++){let n=r[t],a=r[t+1];if(a<=n)continue;let o=e.slice(n,a);o.trim()&&i.push({src:o,start:n,end:a})}return i}function Vce(e,t,n,r){let i=Bce(e);if(i.length<2)return null;let a=[],o=!1,s=``;for(let e of i){if(r&&g3(r))break;r&&(r.calls+=1);let i=s+e.src;try{let n=t(i).content??[];s+=h3(e.src);let r=n.filter(e=>e.type!==`paragraph`||Array.isArray(e.content)&&e.content.length>0);if(r.length===0&&n.length>0){o=!0;continue}a.push(...r),o=!0}catch(t){o2();let r=t?.message?.slice(0,200)??`unknown block error`,i=n?.message?.slice(0,160)??`unknown`;console.warn(JSON.stringify({event:`mdx-block-fallback`,offset:e.start,reason:`Per-block recovery after position-less error: ${i}`,blockError:r,blockErrorName:t?.name})),a.push({type:`rawMdxFallback`,attrs:{reason:r,originalSpan:{start:e.start,end:e.end}},content:[{type:`text`,text:e.src}]})}}return o?{type:`doc`,content:a.length>0?a:[{type:`paragraph`,content:[]}]}:null}function b3(e){return{type:`doc`,content:[{type:`paragraph`,content:[{type:`text`,text:e}]}]}}const Hce=new Set([`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`]),Uce={note:`note`,tip:`tip`,important:`important`,warning:`warning`,caution:`caution`,abstract:`abstract`,info:`info`,todo:`todo`,success:`success`,question:`question`,failure:`failure`,danger:`danger`,bug:`bug`,example:`example`,quote:`quote`,summary:`abstract`,tldr:`abstract`,check:`success`,done:`success`,help:`question`,faq:`question`,fail:`failure`,missing:`failure`,error:`danger`,cite:`quote`,idea:`tip`,hint:`tip`,warn:`warning`,attention:`warning`},x3=`ok-alert`,Wce=RegExp(`(?:^|\\s)${x3}-(\\w+)(?:\\s|$)`),Gce=/^>\s*\[!(\w+)\]([+-])?(?:\s+(.*?))?\s*$/i;function S3(e,t){if(t<0||t>=e.length)return null;let n=e.indexOf(`
|
|
327
|
+
`,t),r=(n===-1?e.slice(t):e.slice(t,n)).match(Gce);return r?{rawType:r[1],foldableMarker:r[2]===`+`||r[2]===`-`?r[2]:null,title:r[3]?.trim()||null}:null}function Kce(e){if(e.data?.hName!==`div`)return null;let t=e.data?.hProperties?.class;if(typeof t!=`string`)return null;let n=t.match(Wce);return n?n[1].toLowerCase():null}function C3(e){let t=e.toLowerCase();return Uce[t]??null}function qce(e,t,n,r,i=null){let a=[{type:`mdxJsxAttribute`,name:`type`,value:t}];n&&a.push({type:`mdxJsxAttribute`,name:`title`,value:n}),i&&a.push({type:`mdxJsxAttribute`,name:`data-authored-as`,value:i}),r!==null&&(a.push({type:`mdxJsxAttribute`,name:`collapsible`,value:null}),r===`+`?a.push({type:`mdxJsxAttribute`,name:`defaultOpen`,value:null}):a.push({type:`mdxJsxAttribute`,name:`defaultOpen`,value:{type:`mdxJsxAttributeValueExpression`,value:`false`}}));let o=e.children.slice(1),s=e.position?.start.line;return{type:`mdxJsxFlowElement`,name:`GFMCallout`,attributes:a,children:n&&o.length>0&&s!==void 0&&Jce(o[0],s)?o.slice(1):o,position:e.position}}function Jce(e,t){if(!e||typeof e!=`object`)return!1;let n=e;if(n.type!==`paragraph`)return!1;let r=n.position?.start?.line,i=n.position?.end?.line;return r===t&&i===t}function Yce(e){if(!e||typeof e!=`object`||e.type!==`paragraph`)return!1;let t=e.data?.hProperties?.class;return typeof t==`string`&&t.includes(`${x3}-title`)}function Xce(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;ub(e,`blockquote`,(e,t,r)=>{if(r===void 0||typeof t!=`number`)return;let i=Kce(e);if(!i)return;let a=C3(i),o=null,s=null;e.position?.start?.offset!==void 0&&(s=S3(n,e.position.start.offset),s&&(o=s.title,a||=C3(s.rawType)));let c=a??`note`,l=s&&Hce.has(c)?s.foldableMarker:null,u=(()=>{if(e.position?.start?.offset!==void 0){let t=S3(n,e.position.start.offset);if(t?.rawType)return t.rawType}return i})(),d=u.toLowerCase()===c?null:u;if(!Yce(e.children[0]))return;let f=qce(e,c,o,l,d);r.children[t]=f})}}const Zce={markers:`*`,classPrefix:x3,matchCaseSensitive:!1,icons:new Proxy({},{get:()=>`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"></svg>`})},w3=/(?<!%)%%([^\n]*?[^\n%])%%(?!%)/g,T3=/<!--([\s\S]*?)-->/g;function Qce(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;ele(e,n),ub(e,`text`,(e,t,r)=>{if(r===void 0||t==null)return;let i=e.value;if(i.indexOf(`%%`)===-1&&i.indexOf(`<!--`)===-1)return;let a=$ce(i,gY(e));if(a.length===0)return;let o=[],s=0;for(let t of a){t.start>s&&o.push(yY(n,e,s,t.start));let r=t.sourceForm===`html`?4:2,a=t.start+r,c=t.sourceForm===`html`?a+i.slice(a,t.end-3).indexOf(t.body):a,l={type:`comment`,children:[yY(n,e,c,c+t.body.length)],data:{sourceForm:t.sourceForm}},u=CY(n,e,t.start,t.end);u&&(l.position=u),o.push(l),s=t.end}return s<i.length&&o.push(yY(n,e,s,i.length)),r.children.splice(t,1,...o),[Gv,t+o.length]}),ale(e,n)}}function $ce(e,t){let n=[];w3.lastIndex=0;let r;for(;(r=w3.exec(e))!==null;){if(bY(t,r.index,2)||bY(t,r.index+r[0].length-2,2)){w3.lastIndex=r.index+1;continue}r[1].trim().length!==0&&n.push({start:r.index,end:r.index+r[0].length,body:r[1],sourceForm:`percent`})}T3.lastIndex=0;let i;for(;(i=T3.exec(e))!==null;){if(bY(t,i.index,4)||bY(t,i.index+i[0].length-3,3)){T3.lastIndex=i.index+1;continue}let e=i[1].trim();e!==``&&n.push({start:i.index,end:i.index+i[0].length,body:e,sourceForm:`html`})}n.sort((e,t)=>e.start-t.start);let a=[],o=-1;for(let e of n)e.start<o||(a.push(e),o=e.end);return a}function ele(e,t){let n=e.children,r=0;for(;r<n.length;){let e=n[r];if(e.type===`paragraph`){let i=O3(e);if(i!==null){let t=e.children[0],a,o=()=>(a===void 0&&(a=gY(t)),a),s=tle(i);if(s!==null&&!bY(o(),0,2)&&!bY(o(),i.length-2,2)){let e={type:`commentBlock`,children:[{type:`paragraph`,children:[{type:`text`,value:s}]}],data:{sourceForm:`percent`,sourceLayout:`block`}};n.splice(r,1,e),r+=1;continue}let c=nle(i);if(c!==null&&!bY(o(),i.length-i.trimStart().length,4)&&!bY(o(),i.trimEnd().length-3,3)){let e={type:`commentBlock`,children:[{type:`paragraph`,children:[{type:`text`,value:c}]}],data:{sourceForm:`html`,sourceLayout:`inline`}};n.splice(r,1,e),r+=1;continue}}let a=rle(e,t);if(a!==null&&!D3(e,4,3)){let e={type:`commentBlock`,children:[a],data:{sourceForm:`html`,sourceLayout:`inline`}};n.splice(r,1,e),r+=1;continue}let o=ile(e,t);if(o!==null&&!D3(e,2,2)){let e={type:`commentBlock`,children:[o],data:{sourceForm:`percent`,sourceLayout:`inline`}};n.splice(r,1,e),r+=1;continue}}if(e.type===`paragraph`&&A3(e)){let e=r+1;for(;e<n.length;){let t=n[e];if(t.type===`paragraph`&&A3(t))break;e+=1}if(e<n.length&&e>r+1){let t={type:`commentBlock`,children:n.slice(r+1,e),data:{sourceForm:`percent`,sourceLayout:`block`}};n.splice(r,e-r+1,t),r+=1;continue}}r+=1}}function E3(e,t,n){return bY(gY(e),t,n)}function D3(e,t,n){let r=e.children[0],i=e.children[e.children.length-1];if(r.type!==`text`||i.type!==`text`)return!1;let a=r.value.length-r.value.trimStart().length,o=i.value.trimEnd().length-n,s=gY(r);return bY(s,a,t)?!0:bY(i===r?s:gY(i),o,n)}function O3(e){if(e.children.length!==1)return null;let t=e.children[0];return t.type===`text`?t.value:null}function tle(e){let t=e.match(/^%%\n((?:.|\n(?!\n))+?)\n%%$/);return t===null?null:t[1]}function nle(e){let t=e.trim();if(!t.startsWith(`<!--`)||!t.endsWith(`-->`))return null;let n=t.slice(4,-3);if(n.includes(`-->`)||n.includes(`<!--`))return null;let r=n.trim();return r===``?null:r}function rle(e,t){if(e.children.length<2)return null;let n=e.children[0],r=e.children[e.children.length-1];if(n.type!==`text`||r.type!==`text`)return null;let i=n.value.trimStart();if(!i.startsWith(`<!--`))return null;let a=r.value.trimEnd();if(!a.endsWith(`-->`))return null;for(let t=0;t<e.children.length;t++){let n=e.children[t];if(n.type!==`text`)continue;let r=n.value;if(t===0){if(k3(r,`<!--`)>1||k3(r,`-->`)>0)return null}else if(t===e.children.length-1){if(k3(r,`<!--`)>0||k3(r,`-->`)>1)return null}else if(r.includes(`<!--`)||r.includes(`-->`))return null}let o=n.value.length-i.length+4;n.value[o]===` `&&(o+=1);let s=a.length-3;r.value[s-1]===` `&&--s;let c=[];o<n.value.length&&c.push(yY(t,n,o,n.value.length));for(let t=1;t<e.children.length-1;t++)c.push(e.children[t]);return s>0&&c.push(yY(t,r,0,s)),c.length===0?null:{type:`paragraph`,children:c}}function ile(e,t){if(e.children.length<2)return null;let n=e.children[0],r=e.children[e.children.length-1];if(n.type!==`text`||r.type!==`text`)return null;let i=n.value.trimStart();if(!i.startsWith(`%%`)||i.startsWith(`%%%`))return null;let a=r.value.trimEnd();if(!a.endsWith(`%%`)||a.endsWith(`%%%`))return null;let o=n.value.length-i.length+2;n.value[o]===` `&&(o+=1);let s=a.length-2;r.value[s-1]===` `&&--s;let c=n.value.slice(o),l=r.value.slice(0,s);if(c.indexOf(`%%`)!==-1||l.indexOf(`%%`)!==-1)return null;for(let t=1;t<e.children.length-1;t++){let n=e.children[t];if(n.type===`text`&&n.value.indexOf(`%%`)!==-1)return null}if(!(e.children.slice(1,-1).some(e=>e.type!==`text`||e.value.trim().length>0)||c.trim().length>0||l.trim().length>0))return null;let u=[];c.length>0&&u.push(yY(t,n,o,n.value.length));for(let t=1;t<e.children.length-1;t++)u.push(e.children[t]);return l.length>0&&u.push(yY(t,r,0,s)),u.length===0?null:{type:`paragraph`,children:u}}function k3(e,t){if(!t)return 0;let n=0,r=0;for(;;){let i=e.indexOf(t,r);if(i===-1)break;n+=1,r=i+t.length}return n}function A3(e){let t=O3(e);return t===null||t.trim()!==`%%`?!1:!E3(e.children[0],t.indexOf(`%%`),2)}function ale(e,t){(t.indexOf(`%%`)!==-1||t.indexOf(`<!--`)!==-1)&&ub(e,e=>{if(!ole.has(e.type))return;let n=e.children;if(!(n===void 0||n.length<2)){for(let e of sle)if(cle(n,t,e))return}})}const ole=new Set([`paragraph`,`heading`,`tableCell`]),sle=[{sourceForm:`html`,open:`<!--`,close:`-->`},{sourceForm:`percent`,open:`%%`,close:`%%`}];function j3(e,t){let n=[];for(let r=0;r<e.length;r++){let i=e[r];if(i.type!==`text`)continue;let a=0;for(;;){let e=i.value.indexOf(t,a);if(e===-1)break;n.push({index:r,offset:e}),a=e+t.length}}return n}function cle(e,t,n){let r,i;if(n.sourceForm===`percent`){let t=j3(e,`%%`);if(t.length!==2)return!1;[r,i]=t}else{let t=j3(e,`<!--`),n=j3(e,`-->`);if(t.length!==1||n.length!==1)return!1;r=t[0],i=n[0]}if(r.index>=i.index)return!1;let a=e[r.index],o=e[i.index];if(n.sourceForm===`percent`&&(a.value[r.offset-1]===`%`||a.value[r.offset+2]===`%`||o.value[i.offset-1]===`%`||o.value[i.offset+2]===`%`)||ule(e,n,r,i)||E3(a,r.offset,n.open.length)||E3(o,i.offset,n.close.length))return!1;for(let t=r.index+1;t<i.index;t++)if(N3(e[t]))return!1;if(r.offset===0&&N3(e[r.index-1])||i.offset+n.close.length===o.value.length&&N3(e[i.index+1]))return!1;let s=lle(e,n,r,i,t);if(s===null)return!1;let c=[];a.value.slice(0,r.offset).length>0&&c.push(yY(t,a,0,r.offset));let l={type:`comment`,children:s,data:{sourceForm:n.sourceForm}},u=CY(t,a,r.offset,a.value.length),d=CY(t,o,0,i.offset+n.close.length);u&&d&&(l.position={start:u.start,end:d.end}),c.push(l);let f=i.offset+n.close.length;return o.value.slice(f).length>0&&c.push(yY(t,o,f,o.value.length)),e.splice(r.index,i.index-r.index+1,...c),!0}function lle(e,t,n,r,i){let a=e[n.index],o=e[r.index],s=n.offset+t.open.length,c=a.value.length,l=r.offset;if(t.sourceForm===`html`){for(;s<c&&/\s/.test(a.value[s]);)s+=1;for(;l>0&&/\s/.test(o.value[l-1]);)--l}let u=[];s<c&&u.push(yY(i,a,s,c));for(let t=n.index+1;t<r.index;t++)u.push(e[t]);return 0<l&&u.push(yY(i,o,0,l)),u.length===0||!u.some(e=>e.type!==`text`||e.value.trim().length>0)||!u.some(e=>e.type===`text`)?null:u}function ule(e,t,n,r){let i=e[n.index],a=e[r.index];if(i.value.indexOf(`
|
|
328
|
+
`,n.offset+t.open.length)!==-1||a.value.lastIndexOf(`
|
|
329
|
+
`,r.offset)!==-1)return!0;for(let t=n.index+1;t<r.index;t++)if(M3(e[t]))return!0;return!1}function M3(e){let t=e;return t?.type===`break`?!0:t?.type===`text`?(t.value??``).indexOf(`
|
|
330
|
+
`)!==-1:Array.isArray(t?.children)&&t.children.some(M3)}function N3(e){if(e==null)return!1;if(e.type===`comment`)return!0;let t=e.children;return Array.isArray(t)&&t.some(N3)}const dle=/^([ ]{1,3})(<\/[A-Z][A-Za-z0-9_]*\s*>)([ \t]*)$/gm,fle=/^[ ]{0,3}([-*+]|\d{1,9}[.)])([ \t]|$)/;function ple(e,t){if(t===0)return!1;let n=t-1;for(;n>=0;){let r=n;for(;r>0&&e[r-1]!==`
|
|
331
|
+
`;)r--;let i=e.slice(r,n===t-1?n:n+1);if(i.trim().length===0){n=r-2;continue}return fle.test(i)}return!1}function P3(e){if(!e.includes(`</`))return e;let t=f4(e),n=!1,r=e.replace(dle,(r,i,a,o,s)=>p4(s,t)||!ple(e,s)?r:(n=!0,`${a}${o}`));return n?r:e}const mle=/^<details(\s[^>]*)?>\s*<summary>([\s\S]*?)<\/summary>([\s\S]*?)<\/details>\s*$/,hle=/^<details(\s[^>]*)?>(?:\s*<summary>([\s\S]*?)<\/summary>)?[\s\S]*$/,gle=/^\s*<\/details>\s*$/;function F3(e){let t=!1,n=null,r=null;if(!e)return{defaultOpen:t,name:n,id:r};let i=/(\w+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'<>]+)))?/g,a=i.exec(e);for(;a!==null;){let o=a[1].toLowerCase(),s=a[2]??a[3]??a[4]??null;o===`open`?t=!0:o===`name`?n=s:o===`id`&&(r=s),a=i.exec(e)}return{defaultOpen:t,name:n,id:r}}function I3(e){let t=[];return e.title!==null&&t.push({type:`mdxJsxAttribute`,name:`title`,value:e.title}),e.defaultOpen&&t.push({type:`mdxJsxAttribute`,name:`defaultOpen`,value:null}),e.name!==null&&t.push({type:`mdxJsxAttribute`,name:`name`,value:e.name}),e.id!==null&&t.push({type:`mdxJsxAttribute`,name:`id`,value:e.id}),t}function L3(e){if(e.type!==`paragraph`)return!1;let t=e.children;return t.length===1&&t[0].type===`text`}function R3(e){return e.children[0].value??``}function _le(e){if(!L3(e))return null;let t=R3(e).match(mle);if(!t)return null;let{defaultOpen:n,name:r,id:i}=F3(t[1]),a=t[2].trim()||null,o=t[3].trim(),s=o?[{type:`paragraph`,children:[{type:`text`,value:o}]}]:[];return{type:`mdxJsxFlowElement`,name:`HtmlDetailsAccordion`,attributes:I3({title:a,defaultOpen:n,name:r,id:i}),children:s,position:e.position}}function vle(e,t){let n=e[t];if(!L3(n))return null;let r=R3(n);if(!r.startsWith(`<details`)||r.includes(`</details>`))return null;let i=r.match(hle);if(!i)return null;let{defaultOpen:a,name:o,id:s}=F3(i[1]),c=i[2]?.trim()||null;for(let n=t+1;n<e.length;n++){let t=e[n];if(!L3(t))continue;let r=R3(t);if(gle.test(r))return{closerIdx:n,title:c,defaultOpen:a,name:o,id:s};if(r.includes(`</details>`))return null}return null}function yle(e){let t=e.children,n=0;for(;n<t.length;){let e=t[n];if(L3(e)){let r=_le(e);if(r){t[n]=r,n++;continue}let i=vle(t,n);if(i){let r=e,a=t[i.closerIdx],o=n+1,s=i.closerIdx,c=t.slice(o,s),l=r.position,u=a.position,d={type:`mdxJsxFlowElement`,name:`HtmlDetailsAccordion`,attributes:I3(i),children:c,position:l&&u?{start:l.start,end:u.end}:void 0},f=i.closerIdx-n+1;t.splice(n,f,d),n++;continue}}n++}}function ble(){return e=>{ub(e,e=>{`children`in e&&Array.isArray(e.children)&&yle(e)})}}const xle=/^<(div|center)(\s[^>]*?)?\s*>$/i,Sle=new Set([`center`,`left`,`right`,`justify`]);function Cle(e){if(!e)return null;let t=e.match(/\balign\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'<>]+))/i);if(!t)return null;let n=(t[1]??t[2]??t[3]??``).toLowerCase();return Sle.has(n)?n:null}function z3(e){if(e.type!==`paragraph`)return!1;let t=e.children;return t.length===1&&t[0].type===`text`}function B3(e){return e.children[0].value??``}function wle(e){if(!z3(e))return null;let t=B3(e).trim().match(xle);if(!t)return null;let n=t[1].toLowerCase(),r=t[2]??``;return{tag:n,align:Cle(r)??(n===`center`?`center`:null),sourceAttrs:r}}function Tle(e,t,n){let r=new RegExp(String.raw`^\s*</${n}>\s*$`,`i`);for(let i=t+1;i<e.length;i++){let t=e[i];if(!z3(t))continue;let a=B3(t);if(r.test(a))return i;let o=a.trimStart().toLowerCase();if(o.startsWith(`<div`)||o.startsWith(`<center`)||o.includes(`</${n}>`))return null}return null}function Ele(e){let t=e.children,n=0;for(;n<t.length;){let e=wle(t[n]);if(e!==null){let r=Tle(t,n,e.tag);if(r!==null){let i=t[n],a=t[r],o=t.slice(n+1,r),s=i.position,c=a.position,l={type:`mdxJsxFlowElement`,name:`HtmlAlignBlock`,attributes:[...e.align===null?[]:[{type:`mdxJsxAttribute`,name:`align`,value:e.align}],{type:`mdxJsxAttribute`,name:`tag`,value:e.tag},{type:`mdxJsxAttribute`,name:`sourceAttrs`,value:e.sourceAttrs}],children:o,position:s&&c?{start:s.start,end:c.end}:void 0};t.splice(n,r-n+1,l),n++;continue}}n++}}function Dle(){return e=>{ub(e,e=>{`children`in e&&Array.isArray(e.children)&&Ele(e)})}}const V3=` `;function H3(e){return e.type===`listItem`&&typeof e.checked==`boolean`}function Ole(e){let t=e.children??[];if(t.length!==1)return!1;let n=t[0];return n?.type===`paragraph`&&(n.children?.length??0)===0}function kle(e){let t=e.children??[];if(t.length!==1)return!1;let n=t[0];if(n?.type!==`paragraph`||(n.children?.length??0)!==1)return!1;let r=n.children[0];if(r?.type!==`text`||r.value!==V3)return!1;let i=r.data?.entityRefSpans;if(!Array.isArray(i)||i.length!==1)return!1;let a=i[0];return a?.offset===0&&a.length===6&&a.raw===V3}function Ale(e){ub(e,`listItem`,e=>{if(!H3(e)||!Ole(e))return;let t=e.children[0];t.children=[{type:`text`,value:` `,data:{sourceRaw:V3}}]})}function jle(e){ub(e,`listItem`,e=>{!H3(e)||!kle(e)||(e.children[0].children=[])})}function Mle(){return e=>{jle(e)}}const U3=57856,W3=63743,G3=/&(?:[A-Za-z][A-Za-z0-9]*|#[0-9]+|#[xX][0-9A-Fa-f]+);/g;function Nle(e){return G3.lastIndex=0,e.replace(G3,e=>{let t=e.slice(1,-1);if(t.startsWith(`#`)){let e=t[1]===`x`||t[1]===`X`;return tx(t.slice(e?2:1),e?16:10)}let n=ex(t);return n===!1?e:n})}function Ple(e){let t=new Set,n=0;for(let r of e){let e=0;for(let i of r){let r=i.codePointAt(0);r!==void 0&&(r>=U3&&r<=W3&&t.add(r),r===U3?(e+=1,n=Math.max(n,e)):e=0)}}return{occupied:t,longestStartRun:n}}function Fle(e){let{occupied:t,longestStartRun:n}=Ple([e,Nle(e)]);for(let e=U3;e<=W3;e+=1)if(!t.has(e))return String.fromCharCode(e);return``.repeat(n+1)+``}function Ile(e){return{exit:{characterEscapeValue(t){let n=this.stack.pop();n.value+=e+this.sliceSerialize(t),n.position&&(n.position.end={line:t.end.line,column:t.end.column,offset:t.end.offset})}},transforms:[t=>(ub(t,t=>{if(t.type===`text`){let n=[],r=``,i=0;for(;;){let a=t.value.indexOf(e,i);if(a===-1)break;r+=t.value.slice(i,a);let o=t.value.slice(a+e.length,a+e.length+1);n.push({offset:r.length,char:o}),i=a+e.length}r+=t.value.slice(i),t.value=r,t.data??={},t.data.escapedChars=n;return}let n=t;for(let[t,r]of Object.entries(n))typeof r==`string`&&(n[t]=r.replaceAll(e,``))}),t)]}}function Lle(e,t){let n;return(r,i)=>{let a=t.data();a.fromMarkdownExtensions??=[];let o=a.fromMarkdownExtensions,s=Ile(Fle(r)),c=n,l=c?o.lastIndexOf(c):-1;l>=0?o.splice(l,1,s):o.push(s),n=s;try{return e(r,i)}finally{let e=o.lastIndexOf(s);e>=0&&(c&&l>=0?o.splice(e,1,c):o.splice(e,1)),n=c}}}const Rle=function(){let e=this;e.parser=Lle(e.parser,e)},K3=/(?<!=)==(?=\S)([^\n]*?[^\s=])==(?!=)/g;function zle(e){return e.type===`strong`||e.type===`emphasis`||e.type===`delete`||e.type===`inlineCode`}function q3(e){return e.type===`text`||e.type===`inlineCode`?e.value.length>0?e.value.charAt(0):null:`children`in e&&Array.isArray(e.children)&&e.children.length>0?q3(e.children[0]):null}function J3(e){if(e.type===`text`||e.type===`inlineCode`)return e.value.length>0?e.value.slice(-1):null;if(`children`in e&&Array.isArray(e.children)&&e.children.length>0){let t=e.children;return J3(t[t.length-1])}return null}function Ble(e,t){let n=e.children,r=new Map,i=e=>{let t=r.get(e);if(t!==void 0)return t;let n=gY(e);return r.set(e,n),n},a=0;for(;a<n.length;){let e=n[a];if(e.type!==`text`){a++;continue}let r=e.value,o=-1;for(let t=0;t<=r.length-2;t++){if(r.charCodeAt(t)!==61||r.charCodeAt(t+1)!==61||t>0&&r.charCodeAt(t-1)===61||bY(i(e),t,2))continue;let s;if(t+2<r.length)s=r.charAt(t+2);else{let e=n[a+1];if(!e)continue;s=q3(e)}if(!(s===null||/\s/.test(s))){o=t;break}}if(o===-1){a++;continue}let s=-1,c=-1,l=!1;for(let t=o+3;t<=r.length-2;t++){if(r.charCodeAt(t)!==61||r.charCodeAt(t+1)!==61||bY(i(e),t,2))continue;let o=r.charAt(t-1);if(/[\s=]/.test(o))continue;let c;if(t+2<r.length)c=r.charAt(t+2);else{let e=n[a+1];c=e?e.type===`text`?e.value[0]??null:q3(e):null}if(c!==`=`){s=-2;break}}if(s===-2){a++;continue}for(let e=a+1;e<n.length;e++){let t=n[e];if(t.type===`text`){for(let r=0;r<=t.value.length-2;r++){if(t.value.charCodeAt(r)!==61||t.value.charCodeAt(r+1)!==61||bY(i(t),r,2))continue;let a;if(r>0)a=t.value.charAt(r-1);else{let t=n[e-1];a=J3(t)}if(a===null||/[\s=]/.test(a))continue;let o;if(r+2<t.value.length)o=t.value.charAt(r+2);else{let t=n[e+1];o=t?t.type===`text`?t.value[0]??null:q3(t):null}if(o!==`=`){s=e,c=r,l=!0;break}}if(s>=0)break}else if(!zle(t))break}if(s<0){a++;continue}let u=n[s],d=r.slice(0,o),f=r.slice(o+2),p=u.value.slice(0,c),m=u.value.slice(c+2),h=[];f.length>0&&h.push(yY(t,e,o+2,r.length));for(let e=a+1;e<s;e++)h.push(n[e]);if(p.length>0&&h.push(yY(t,u,0,c)),!l){a++;continue}let g={type:`mark`,children:h},_=[];d.length>0&&_.push(yY(t,e,0,o)),_.push(g),m.length>0&&_.push(yY(t,u,c+2,u.value.length)),n.splice(a,s-a+1,..._),a+=+(d.length>0)+1}}function Y3(e,t){if(`children`in e&&Array.isArray(e.children)){Ble(e,t);for(let n of e.children)Y3(n,t)}}function Vle(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;ub(e,`text`,(e,t,r)=>{if(r===void 0||t==null)return;let i=e.value;if(i.indexOf(`==`)===-1)return;let a=gY(e);K3.lastIndex=0;let o=[],s;for(;(s=K3.exec(i))!==null;){let e=s.index,t=e+s[0].length;if(bY(a,e,2)||bY(a,t-2,2)){K3.lastIndex=e+1;continue}o.push(s)}if(o.length===0)return;let c=[],l=0;for(let t of o){let r=t.index,i=r+t[0].length;r>l&&c.push(yY(n,e,l,r));let a={type:`mark`,children:[yY(n,e,r+2,i-2)]},o=CY(n,e,r,i);o&&(a.position=o),c.push(a),l=i}return l<i.length&&c.push(yY(n,e,l,i.length)),r.children.splice(t,1,...c),[Gv,t+c.length]}),Y3(e,n),ub(e,`mdxJsxTextElement`,(e,t,n)=>{if(n===void 0||t==null||e.name!==`mark`)return;let r={type:`mark`,children:e.children??[]};return n.children.splice(t,1,r),t+1})}}function Hle(){return e=>{ub(e,`paragraph`,(e,t,n)=>{if(!n||t==null||e.children.length!==1)return;let r=e.children[0];if(r?.type!==`image`)return;let i=Ule(r,e);n.children[t]=i})}}function Ule(e,t){let n=[{type:`mdxJsxAttribute`,name:`src`,value:e.url}];typeof e.alt==`string`&&n.push({type:`mdxJsxAttribute`,name:`alt`,value:e.alt}),e.title&&n.push({type:`mdxJsxAttribute`,name:`title`,value:e.title});let r={type:`mdxJsxFlowElement`,name:`CommonMarkImage`,attributes:n,children:[]};return t.position&&(r.position=t.position),r}const X3=/^( {4}|\t)/;function Wle(e){let t=e.split(`
|
|
332
|
+
`),n=!1;for(let e of t)if(e.length!==0&&(n=!0,!X3.test(e)))return!1;return n}function Gle(e){return e.split(`
|
|
333
|
+
`).map(e=>e.length===0?e:e.startsWith(` `)?e.slice(4):e.startsWith(` `)?e.slice(1):e).join(`
|
|
334
|
+
`)}function Kle(e,t){let n=e.position;if(!n||typeof n.start.offset!=`number`||typeof n.end.offset!=`number`)return null;let r=n.start.offset,i=n.end.offset;if(r<0||i>t.length||r>=i)return null;let a=r;for(;a>0&&t[a-1]!==`
|
|
335
|
+
`;)a--;if(a===r)return null;let o=t.slice(a,r);if(!X3.test(o))return null;let s=t.slice(a,i);if(!Wle(s))return null;let c={start:{line:n.start.line,column:1,offset:a},end:n.end};return{type:`code`,lang:null,meta:null,value:Gle(s).replace(/\n+$/,``),position:c,data:{sourceStyle:`indented`}}}const qle=function(){return(e,t)=>{let n=String(t.value??``);n&&ub(e,`paragraph`,(e,t,r)=>{if(r?.type!==`root`||t==null)return;let i=r.children[t-1];if(i&&i.type===`list`)return;let a=Kle(e,n);a&&(r.children[t]=a)})}},Jle=/^\n+$/;function Yle(e){return e.length<3||!Jle.test(e)?0:e.length-2}function Xle(e,t){let n=[],r=e.children;for(let e=1;e<r.length;e++){let i=r[e-1],a=r[e],o=i?.position?.end?.offset,s=i?.position?.end?.line,c=a?.position?.start?.offset;if(typeof o!=`number`||typeof c!=`number`||typeof s!=`number`||c<o)continue;let l=Yle(t.slice(o,c));if(l===0)continue;let u=[],d=[];for(let e=0;e<l;e++)u.push(s+2+e),d.push(o+2+e);n.push({beforeChildIndex:e,lines:u,offsets:d})}return n}function Z3(e,t){let n=Xle(e,t);if(n.length===0)return;let r=[],i=0;for(let t=0;t<e.children.length;t++){let a=n[i];if(a&&a.beforeChildIndex===t){for(let e=0;e<a.lines.length;e++)r.push(Zle(a.lines[e],a.offsets[e]));i+=1}r.push(e.children[t])}e.children=r}function Zle(e,t){let n={line:e,column:1,offset:t};return{type:`paragraph`,children:[],position:{start:n,end:{...n}}}}function Q3(e){let t=e.identifier??e.label;if(typeof t!=`string`)return null;let n=t3(t);return n.length>0?n:null}function Qle(e){let t=new Map;return ub(e,`definition`,e=>{let n=Q3(e);n&&!t.has(n)&&t.set(n,e)}),t}function $le(){return e=>{let t=Qle(e);t.size!==0&&ub(e,`linkReference`,e=>{let n=Q3(e);if(!n)return;let r=t.get(n);r&&(e.data={...e.data,resolvedUrl:r.url,resolvedTitle:r.title??null})})}}function $3(e,t,n){let r={type:`mdxJsxFlowElement`,name:e,attributes:[{type:`mdxJsxAttribute`,name:`formula`,value:t}],children:[]};return n&&(r.position=n),r}function eue(){return e=>{ub(e,`math`,(e,t,n)=>{if(!n||t==null)return;let r=$3(`DollarMath`,typeof e.value==`string`?e.value:``,e.position);n.children[t]=r}),ub(e,`code`,(e,t,n)=>{if(!n||t==null||e.lang!==`math`)return;let r=$3(`MathFence`,typeof e.value==`string`?e.value:``,e.position);n.children[t]=r})}}const e6=/<([a-zA-Z][a-zA-Z0-9+.-]*:[^\s<>]+)>/g;function tue(e,t=``){let n=[],r=!1;for(let i of e.children){if(i.type!==`text`){n.push(i);continue}let e=i.value,a=gY(i);e6.lastIndex=0;let o=[],s=0;for(;;){let n=e6.exec(e);if(n===null)break;let c=n[0],l=n[1],u=n.index;if(bY(a,u,1))continue;u>s&&o.push(yY(t,i,s,u));let d={type:`link`,url:l,title:null,children:[yY(t,i,u+1,u+1+l.length)],data:{sourceStyle:`autolink`}},f=CY(t,i,u,u+c.length);f&&(d.position=f),o.push(d),s=u+c.length,r=!0}o.length===0?n.push(i):(s<e.length&&o.push(yY(t,i,s,e.length)),n.push(...o))}r&&(e.children=n)}const nue=new Set(`!"#$%&'()*+,-./:;<=>?@[\\]^_\`{|}~`.split(``));function t6(e){let t=[],n=``;for(let r=0;r<e.length;r++){let i=e[r];if(i===`\\`&&r+1<e.length&&e[r+1]===`|`){n+=`${i}|`,r++;continue}if(i===`|`){t.push(n),n=``;continue}n+=i}return t.push(n),t}function rue(e,t,n=!1,r){if(!t)return;let i=e.position;if(!i||typeof i.start?.offset!=`number`){n&&console.warn(`[position-slice] node type=${e.type} has no position — fidelity defaults apply`);return}let a=i.start.offset,o=i.end?.offset??a;if(a<0||o>t.length){n&&console.warn(`[position-slice] node type=${e.type} position out of bounds: start=${a} end=${o} sourceLen=${t.length}`);return}switch(e.data??={},e.type){case`text`:{let n=t.slice(a,o),r=e.value??``;if(!dY(e.data)&&n.length>r.length&&n.includes(`\\`)){let t=[],i=0,a=0;for(;i<n.length&&a<r.length;)n[i]===`\\`&&i+1<n.length&&nue.has(n[i+1])&&r[a]===n[i+1]?(t.push({offset:a,char:n[i+1]}),i+=2,a+=1):(i++,a++);t.length>0&&(e.data.escapedChars=t)}n.endsWith(`\\`)&&r.endsWith(`\\`)&&(e.data.sourceRaw=n);break}case`emphasis`:{let n=t[a];(n===`*`||n===`_`)&&(e.data.sourceDelimiter=n);break}case`strong`:{let n=t.slice(a,a+2);(n===`**`||n===`__`)&&(e.data.sourceDelimiter=n);break}case`heading`:{let n=t[a],i=t.slice(a,o);if(n===`#`){if(e.data.sourceStyle=`atx`,r?.type===`root`){let n=a;for(;n>0&&t[n-1]!==`
|
|
336
|
+
`;)n--;let r=t.slice(n,a);r.length>=1&&r.length<=3&&/^ +$/.test(r)&&(e.data.sourceLeadingIndent=r.length)}let n=/^#+( {2,})[^ ]/.exec(i);n&&(e.data.sourceInteriorSpacing=n[1].length);let o=/^.*?[ \t](#+)[ \t]*$/.exec(i);o&&(e.data.sourceTrailingHashes=o[1].length)}else{let t=/\n(=+)[ \t]*$/.exec(i),n=/\n(-+)[ \t]*$/.exec(i),r=t??n;r?(e.data.sourceStyle=`setext`,e.data.sourceUnderlineLength=r[1].length):e.data.sourceStyle=`atx`}break}case`blockquote`:{let n=a;for(;n>0&&t[n-1]!==`
|
|
337
|
+
`;)n--;let r=!1;for(let e=n;e<a;e++)if(t[e]===`>`){r=!0;break}let i=t.slice(a,o).split(`
|
|
338
|
+
`),s=[];for(let e=0;e<i.length;e++){let t=i[e];if(t.trim().length===0)continue;if(r&&e>0)break;let n=t.replace(/^ {1,3}/,``);if(n[0]!==`>`){e>0&&t.trimStart()[0]!==`>`&&s.push(`lazy`);continue}if(n.slice(1).trimEnd()!==``){if(n[1]===` `)s.push(1);else{let e=0;for(;n[1+e]===` `;)e++;s.push(e)}}}s.length>0&&(e.data.sourceMarkerSpacings=s);break}case`list`:{let n=e.children?.[0];if(n?.position?.start?.offset!=null){let r=n.position.start.offset;if(r>=0&&r<t.length){let n=t[r];if(!e.ordered&&(n===`-`||n===`*`||n===`+`))e.data.bulletMarker=n;else if(e.ordered){let n=t.slice(r,Math.min(r+10,t.length)).match(/^\d+([.)])/);n&&(e.data.listMarkerDelimiter=n[1])}}}break}case`listItem`:{let n=t.slice(a,o),r=/^(?:([-+*])|(\d{1,9})[.)])( *)/.exec(n);if(!r)break;let s=r[1]?1:(r[2]?.length??0)+1,c=r[3].length;c>=2&&c<=4&&(e.data.sourceMarkerSpacing=c),r[2]&&(e.data.sourceOrdinal=Number.parseInt(r[2],10)),e.checked!=null&&/^\[([xX])\] /.exec(n.slice(s+Math.max(c,1)))?.[1]===`X`&&(e.data.sourceCheckboxChar=`X`);let l=s+(c>=2&&c<=4?c:1),u=a;for(;u>0&&t[u-1]!==`
|
|
339
|
+
`;)u--;let d=i.start.column;for(let n of e.children??[]){if(n.type!==`list`)continue;let r=n.position?.start?.offset,i=n.position?.start?.column;if(typeof r!=`number`||typeof i!=`number`)continue;let a=r;for(;a>0&&t[a-1]!==`
|
|
340
|
+
`;)a--;if(a===u)continue;let o=i-d;o!==l&&o>=l&&o<=l+3&&/^ +$/.test(t.slice(a,r))&&(e.data.sourceContinuationIndent=o);break}break}case`delete`:t[a]===`~`&&(e.data.sourceDelimiter=t[a+1]===`~`?`~~`:`~`);break;case`code`:{let n=t[a];if(n==="`"||n===`~`){e.data.sourceStyle=`fenced`,e.data.sourceFenceChar=n;let i=0;for(;a+i<t.length&&t[a+i]===n;)i++;if(i>=3&&(e.data.sourceFenceLength=i),r?.type===`root`){let n=a;for(;n>0&&t[n-1]!==`
|
|
341
|
+
`;)n--;let r=t.slice(n,a);r.length>=1&&r.length<=3&&/^ +$/.test(r)&&(e.data.sourceFenceIndent=r.length)}if(e.lang){let n=0;for(;t[a+i+n]===` `;)n++;n>=1&&(e.data.sourceInfoPadding=n)}let s=t.slice(a,o),c=RegExp(`\\n[ \\t]*(\\${n}+)[ \\t]*$`).exec(s);c&&c[1].length>i&&(e.data.sourceClosingFenceLength=c[1].length),r?.type===`root`&&(RegExp(`\\n {0,3}\\${n}{${i},}[ \\t]*$`).test(s)||(e.data.sourceUnclosedFence=!0))}else if(e.data.sourceStyle=`indented`,r?.type===`root`){let n=t.slice(a,o).split(`
|
|
342
|
+
`),r=(e.value??``).split(`
|
|
343
|
+
`);if(n.length===r.length){let t=[],i=!1,a=!0;for(let e=0;e<n.length;e++){let o=n[e],s=r[e];if(!o.endsWith(s)){a=!1;break}let c=o.slice(0,o.length-s.length);if(!/^[ \t]*$/.test(c)){a=!1;break}t.push(c),c!==(s.length>0?` `:``)&&(i=!0)}a&&i&&(e.data.sourceIndents=t)}}break}case`inlineCode`:{let n=t[a];if(n==="`"||n===`~`){e.data.sourceFenceChar=n;let r=0;for(;a+r<t.length&&t[a+r]===n;)r++;r>=1&&(e.data.sourceFenceLength=r);let i=t.slice(a+r,o-r),s=e.value??``;i!==s&&i===` ${s} `&&(e.data.sourcePadded=!0)}break}case`inlineMath`:if(t[a]===`$`){let n=0;for(;a+n<t.length&&t[a+n]===`$`;)n++;e.data.sourceDelimiter=`$`.repeat(n)}break;case`thematicBreak`:e.data.sourceRaw=t.slice(a,o);break;case`table`:{let n=t.slice(a,o),r=n.indexOf(`
|
|
344
|
+
`);if(r===-1)break;let i=n.slice(r+1),s=i.indexOf(`
|
|
345
|
+
`),c=s===-1?i:i.slice(0,s),l=c.trim().replace(/^\|/,``).replace(/\|$/,``).split(`|`),u=[];for(let e of l){let t=e.match(/-/g);u.push(t?t.length:0)}u.some(e=>e>0)&&(e.data.sourceDashCounts=u);{let t=c.trim(),n=t6(t);n.length>0&&n[0]===``&&t.startsWith(`|`)&&n.shift(),n.length>0&&n[n.length-1]===``&&t.endsWith(`|`)&&n.pop();let r=n.every(e=>/^[-: ]+$/.test(e)),i=[];for(let e of n){let t=0;for(;t<e.length&&e[t]===` `;)t++;let n=0;for(;n<e.length-t&&e[e.length-1-n]===` `;)n++;i.push({left:t,right:n})}r&&i.length>0&&(e.data.sourceAlignmentPadding=i)}{let t=n.split(`
|
|
346
|
+
`).filter(e=>e.trim().length>0);if(t.length>=2){let n=t.map(e=>e.trimStart().startsWith(`|`)),r=t.map(e=>/(^|[^\\])\|$/.test(e.trimEnd())),i=n.every(e=>e===n[0]),a=r.every(e=>e===r[0]);if(i&&a){let t=n[0],i=r[0];(!t||!i)&&(e.data.sourceOuterPipes={leading:t,trailing:i})}}}for(let n of e.children??[]){if(n.type!==`tableRow`||!n.position)continue;let e=n.position.start.offset,r=n.position.end.offset;if(typeof e!=`number`||typeof r!=`number`)continue;let i=t.slice(e,r),a=i.indexOf(`
|
|
347
|
+
`);a!==-1&&(i=i.slice(0,a));let o=t6(i);o.length>0&&o[0]===``&&i.startsWith(`|`)&&o.shift(),o.length>0&&o[o.length-1]===``&&i.endsWith(`|`)&&o.pop();let s=n.children??[],c=Math.min(s.length,o.length);for(let e=0;e<c;e++){let t=s[e];if(t.type!==`tableCell`)continue;let n=o[e],r=0;for(;r<n.length&&n[r]===` `;)r++;let i=0;for(;i<n.length-r&&n[n.length-1-i]===` `;)i++;t.data||={},t.data.sourcePadding={left:r,right:i}}}break}case`link`:case`linkReference`:if(`children`in e&&e.children.length===0&&(e.data.sourceRaw=t.slice(a,o)),e.type===`link`){let n=t[a];if(n!==`[`&&n!==`<`&&!e.title)e.data.sourceStyle=`gfm-autolink`;else if(n===`[`){let n=t.slice(a,o),r=n.lastIndexOf(`](`);if(r!==-1){let t=r+2;for(;t<n.length&&(n[t]===` `||n[t]===` `);)t++;if(r6(n,t,e.data)&&(e.data.sourceUrlForm=`angle-bracketed`),e.title!==void 0&&e.title!==null&&n[n.length-1]===`)`){let t=n.length-2;for(;t>r+1&&(n[t]===` `||n[t]===` `||n[t]===`
|
|
348
|
+
`);)t--;n[t]===`"`?e.data.sourceTitleMarker=`double`:n[t]===`'`?e.data.sourceTitleMarker=`single`:n[t]===`)`&&(e.data.sourceTitleMarker=`paren`)}}}}break;case`image`:{let n=t.slice(a,o),r=n.lastIndexOf(`](`);r!==-1&&n6(n,r+2,e.data)&&(e.data.sourceUrlForm=`angle-bracketed`);break}case`definition`:{let n=t.slice(a,o);e.data.sourceLayout=n.includes(`
|
|
349
|
+
`)?`multiline`:`inline`;let r=iue(n);if(r!==-1&&n6(n,r+2,e.data)&&(e.data.sourceUrlForm=`angle-bracketed`),typeof e.title==`string`&&n.length>0){let t=n[n.length-1];t===`"`?e.data.sourceTitleMarker=`double`:t===`'`?e.data.sourceTitleMarker=`single`:t===`)`&&(e.data.sourceTitleMarker=`paren`)}break}case`mdxJsxFlowElement`:case`mdxJsxTextElement`:case`mdxFlowExpression`:case`mdxTextExpression`:e.data.sourceRaw=t.slice(a,o);break;case`break`:if(e.data.sourceRaw)break;t.slice(a,o).includes(`\\`)?e.data.sourceStyle=`backslash`:e.data.sourceStyle=`spaces`}}function n6(e,t,n){let r=t;for(;r<e.length&&/[ \t\r\n]/.test(e[r]);)r++;return r6(e,r,n)}function r6(e,t,n){return e[t]===`<`&&n.sourceGuardedDestinationOpen!==!0}function iue(e){for(let t=1;t<e.length;t++){let n=e[t];if(n===`\\`){t++;continue}if(n===`]`)return e[t+1]===`:`?t:-1}return-1}const aue=new Set([`mdxJsxFlowElement`,`mdxJsxTextElement`,`mdxFlowExpression`,`mdxTextExpression`]),i6=/^(?:[-+*]|\d{1,9}[.)])/;function a6(e){return aue.has(e.type)}function oue(e){return e.type===`blockquote`||e.type===`listItem`||e.type===`footnoteDefinition`}function sue(e,t){if(t===void 0||t.type===`root`||!a6(e))return!1;if(e.type===`mdxJsxFlowElement`&&t.type===`mdxJsxFlowElement`)return!0;let n=e.data?.sourceRaw;return typeof n==`string`&&n.includes(`
|
|
350
|
+
`)}function cue(e){let t=[0];for(let n=e.indexOf(`
|
|
351
|
+
`);n!==-1;n=e.indexOf(`
|
|
352
|
+
`,n+1))t.push(n+1);return{source:e,lineStarts:t,widths:new Map,contentOffsets:new Map}}function o6(e,t){let{lineStarts:n}=e,r=0,i=n.length-1;for(;r<i;){let e=r+i+1>>1;n[e]<=t?r=e:i=e-1}return n[r]}function s6(e,t){let n=t;for(;e[n]===` `||e[n]===` `||e[n]===`\r`;)n++;return n>=e.length||e[n]===`
|
|
353
|
+
`}function lue(e,t,n){for(let r=t;r<n;r++)if(e[r]!==` `)return!1;return!0}function uue(e,t,n){if(e.type===`footnoteDefinition`){let e=/\[\^[^\]\n]*\]:[ \t]*/y;e.lastIndex=n;let r=e.exec(t);return r?n+r[0].length:null}let r=i6.exec(t.slice(n,n+11));if(!r)return null;let i=n+r[0].length;for(;t[i]===` `;)i++;return i}function due(e,t,n){let r=e.contentOffsets.get(t);if(r!==void 0)return r;let i=uue(t,e.source,n);return e.contentOffsets.set(t,i),i}function fue(e,t,n){let r=t[n],i=e.widths.get(r);if(i!==void 0)return i;let a=null;return r.type===`footnoteDefinition`?a=4:r.type===`listItem`&&(a=pue(e,r,t.slice(0,n))),e.widths.set(r,a),a}function pue(e,t,n){let{source:r}=e,i=t.position?.start?.offset;if(typeof i!=`number`)return null;let a=c6(e,o6(e,i),n);if(!a.complete||a.offset>i||!lue(r,a.offset,i))return null;let o=i6.exec(r.slice(i,i+11));if(!o)return null;let s=i+o[0].length,c=0;for(;r[s+c]===` `;)c++;if(r[s+c]===` `)return null;let l=s6(r,s)?1:c;return i-a.offset+o[0].length+l}function mue(e,t,n,r,i){let{source:a}=e,o=r[i];if(o.type===`blockquote`){let e=t;for(;a[e]===` `;)e++;return a[e]===`>`?(e++,(a[e]===` `||a[e]===` `)&&e++,e):null}let s=o.position?.start?.offset;if(typeof s!=`number`)return null;if(s>=n)return due(e,o,s);let c=fue(e,r,i);if(c===null)return null;let l=t;for(;l<t+c&&a[l]===` `;)l++;return l===t+c||s6(a,l)?l:null}function c6(e,t,n){let r=t;for(let i=0;i<n.length;i++){let a=mue(e,r,t,n,i);if(a===null)return{offset:r,complete:!1};r=a}return{offset:r,complete:!0}}function hue(e,t,n,r){let{source:i}=n,a=e.data?.sourceRaw,o=e.position?.start?.offset;if(typeof a!=`string`||typeof o!=`number`||i.slice(o,o+a.length)!==a)return;let s=a.split(`
|
|
354
|
+
`),c=o+s[0].length+1;for(let e=1;e<s.length;e++){let t=s[e],n=r(c);s[e]=t.slice(Math.min(n.offset-c,t.length)),c+=t.length+1}let l=``;if(e.type===`mdxJsxFlowElement`&&t.type===`mdxJsxFlowElement`){let e=r(o6(n,o));e.complete&&e.contentStart===o&&(l=i.slice(e.offset,o))}let u=l+s.join(`
|
|
355
|
+
`);u!==a&&(e.data={...e.data,sourceRaw:u})}function gue(e,t){let n=cue(t),r=[],i=new Map,a=e=>{let a=i.get(e);if(a===void 0){let o=c6(n,e,r),s=o.offset;for(;t[s]===` `;)s++;a={...o,contentStart:s},i.set(e,a)}return a},o=(e,t)=>{if(t.type!==`root`&&a6(e)&&hue(e,t,n,a),!(`children`in e))return;let s=oue(e);s&&(r.push(e),i=new Map);for(let t of e.children)o(t,e);s&&(r.pop(),i=new Map)};for(let t of e.children)o(t,e)}const _ue=new Set(`root.paragraph.heading.text.emphasis.strong.blockquote.list.listItem.code.inlineCode.link.image.linkReference.imageReference.definition.html.thematicBreak.break.yaml.toml.table.tableRow.tableCell.delete.footnoteDefinition.footnoteReference.mdxFlowExpression.mdxJsxFlowElement.mdxJsxTextElement.mdxTextExpression.wikiLink.wikiLinkEmbed.tag.math.inlineMath.mark.underline.comment.commentBlock.rawMdxFallbackMdast`.split(`.`));function l6(e,t){if(!e||typeof e!=`object`)return null;if(typeof e.offset==`number`)return e.offset>=0&&e.offset<=t.length?e.offset:null;let{line:n,column:r}=e;if(typeof n!=`number`||typeof r!=`number`||n<1||r<1)return null;let i=0;for(let e=1;e<n;e++){let e=t.indexOf(`
|
|
356
|
+
`,i);if(e===-1)return null;i=e+1}let a=t.indexOf(`
|
|
357
|
+
`,i),o=a===-1?t.length:a,s=i+r-1;return s<=o?s:null}function vue(e,t){if(!e)return null;let n=l6(e.start,t),r=l6(e.end,t);return n===null||r===null||r<n?null:t.slice(n,r)}function yue(e,t){let n=vue(e.position,t);return{type:`rawMdxFallbackMdast`,originalType:e.type??`unknown`,value:n??``,unresolvedPosition:n===null,position:e.position}}function bue(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``,r=typeof process<`u`&&process.env?.OK_DEBUG_POSITION_SLICE===`1`,i=!1;ub(e,(e,t,a)=>{if(a!==void 0&&typeof t==`number`&&typeof e.type==`string`&&!_ue.has(e.type)){let r=yue(e,n);return a.children[t]=r,Gv}if(`children`in e&&Array.isArray(e.children)){let t=e;t.children.some(e=>e.type===`text`)&&(tue(t,n),AY(t,n))}if(rue(e,n,r,a),sue(e,a)&&(i=!0),e.type===`heading`&&a!==void 0&&typeof t==`number`){let n=e.position?.end?.line,r=a.children[t+1],i=r?.position?.start?.line;if(r?.type===`paragraph`&&typeof n==`number`&&typeof i==`number`&&i===n+1){let t=e;t.data??={},t.data.sourceContiguousNext=!0}}}),i&&gue(e,n)}}function xue(e,t){let n={type:`mdxJsxFlowElement`,name:`MermaidFence`,attributes:[{type:`mdxJsxAttribute`,name:`chart`,value:e}],children:[]};return t&&(n.position=t),n}function Sue(){return e=>{ub(e,`code`,(e,t,n)=>{if(!n||t==null||e.lang!==`mermaid`)return;let r=xue(typeof e.value==`string`?e.value:``,e.position);n.children[t]=r})}}function u6(e,t,n){for(let r=t;r<n;r++)e[r]=` `}function Cue(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 wue(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 d6(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 f6(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 p6(e){let t=n3(),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(u6(a,o,r),o=r,t<0)break;n=!1;continue}if(r!==null){let t=d6(e,o,r);if(u6(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=Cue(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=f6(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(u6(a,t,i),o=i,n=r<0,n)break;continue}let u=wue(e,i);if(u===null||s===null)break;let d=d6(e,u,s),f=d??e.length;if(u6(a,i,f),o=f,r=d===null?s:null,r!==null)break}return{text:a.join(``),start:i}})}function Tue(e){let t=[],n=0;for(let r=0;r<e.length;r++){let i=e[r];i===`
|
|
358
|
+
`?(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]===`
|
|
359
|
+
`&&(r+=1),n=r+1)}t.push({text:e.slice(n),start:n});let r=p6(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 Eue(e,t,n,r){return r<=n||e.slice(n,r).trim().length===0?!1:t.slice(n,r).trim().length===0}function Due(e){return e.type===`link`||e.type===`linkReference`}function Oue(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 kue(){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=Tue(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),!Due(a)))continue;let o=a.position?.start.offset,s=a.position?.end.offset;o!==void 0&&s!==void 0&&Eue(n,r,o,s)&&Oue(e,t,a,n)}};i(e)}}const Aue=Object.assign(ade,{peek:()=>`$`}),jue=Object.assign(ode,{peek:()=>`~`}),Mue=(()=>{for(let e of W4.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).`)})(),Nue=/^[ \t]*(?:$|#{1,6}(?:[ \t]|[ \t]*$)|>|(?:[-+*]|\d{1,9}[.)])[ \t]|`{3,}|~{3,}|=+[ \t]*$|-+[ \t]*$|(?:\*[ \t]*){3,}$|(?:_[ \t]*){3,}$)/;function Pue(e){let t=e;return t.type===`rawMdxFallback`?{type:`mdxJsxFlowElement`,name:null,attributes:[],children:[],data:{sourceRaw:t.value??``}}:e}const Fue={text(e,t,n,r){if(typeof e.data?.sourceRaw==`string`&&KU(e.data.sourceRaw,e.value??``))return e.data.sourceRaw;let i=uY(e.data);if(i.kind===`malformed`&&typeof process<`u`&&process.env?.OK_DEBUG_POSITION_SLICE===`1`&&console.warn(`[escape-provenance] malformed escapedChars metadata: CommonMark-safe serialization applies`),i.kind===`valid`&&i.data.escapedChars.length>0){let t=e.value??``,a=i.data.escapedChars,o=``,s=0,c,l=(e,t)=>{if(!e)return;let i=c===`<`?e.indexOf(`>`):-1;i>=0&&(o+=x6(n,e.slice(0,i+1),{...r,before:r.before+o,after:e.slice(i+1,i+2)||t},!0),e=e.slice(i+1)),e&&(o+=x6(n,e,{...r,before:r.before+o,after:t}))};for(let{offset:e,char:n}of a)e>s&&l(t.slice(s,e),`\\`),o+=`\\${n}`,s=e+1,c=n;return s<t.length&&l(t.slice(s),r.after),o}return x6(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+=w6(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+=w6(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`&&Hue(e))return`<${e.url}>`;if(e.data?.sourceStyle===`gfm-autolink`){let i=e.children?.length===1?e.children[0]:null;if(i?.type===`text`&&typeof i.value==`string`){let a=i.value,o=Vue(a,e.url);if(o===void 0||que(o,Gue(a,e,t,n,r)))return a;if(o===`protocol`&&Jue(a))return`<${a}>`}}let i=n.createTracker(r),a=n.enter(`link`),o=n.enter(`label`),s=i.move(`[`);if(s+=i.move(n.containerPhrasing(e,{before:s,after:`](`,...i.current()})),s+=i.move(`](`),o(),s+=b6(n,i,e),e.title){let t=e.data?.sourceTitleMarker??`double`;s+=i.move(y6(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(),s+=b6(n,i,e),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`?`
|
|
360
|
+
`:` `;l+=s.move(u);let d=String(e.url??``);if(l+=b6(n,s,e,!d||/[\0- ]/.test(d)),e.title){let t=i===`multiline`?`
|
|
361
|
+
`:` `;l+=s.move(y6(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`?`\\
|
|
362
|
+
`:`
|
|
363
|
+
`},code(e,t){let n=e.value??``;if(e.data?.sourceStyle===`indented`){let t=n.split(`
|
|
364
|
+
`),r=e.data.sourceIndents;return Array.isArray(r)&&r.length===t.length?t.map((e,t)=>`${r[t]??(e.length>0?` `:``)}${e}`).join(`
|
|
365
|
+
`):t.map(e=>e.length>0?` ${e}`:e).join(`
|
|
366
|
+
`)}let r=e.data?.sourceFenceChar===`~`?`~`:"`",i=KY(r,n,e.data?.sourceFenceLength??3),a=e.data?.sourceClosingFenceLength,o=typeof a==`number`&&a>i?a:i,s=e.data?.sourceFenceIndent,c=typeof s==`number`&&s>=1&&s<=3?` `.repeat(s):``,l=e.data?.sourceInfoPadding,u=r.repeat(i),d=e.lang??``,f=d&&typeof l==`number`&&l>=1?` `.repeat(l):``,p=e.meta?` ${e.meta}`:``;if(e.data?.sourceUnclosedFence===!0&&t?.type===`root`&&t.children[t.children.length-1]===e){let e=`${u}${f}${d}${p}${n.length>0?`\n${n}`:``}`;return c?e.split(`
|
|
367
|
+
`).map(e=>e.length>0?`${c}${e}`:e).join(`
|
|
368
|
+
`):e}let m=`${u}${f}${d}${p}\n${n}\n${r.repeat(o)}`;return c?m.split(`
|
|
369
|
+
`).map(e=>e.length>0?`${c}${e}`:e).join(`
|
|
370
|
+
`):m},inlineCode(e,t,n){let r=e.value??``,i=e.data?.sourceFenceChar===`~`?`~`:"`",a=typeof e.data?.sourceFenceLength==`number`&&e.data.sourceFenceLength>0?e.data.sourceFenceLength:1,o=i==="`"?"`":`~`,s=a;for(;RegExp(`(^|[^${o}])${o.repeat(s)}([^${o}]|$)`).test(r);)s+=1;let c=i.repeat(s);/[^ \r\n]/.test(r)&&(e.data?.sourcePadded===!0||/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||r.startsWith(i)||r.endsWith(i))&&(r=` ${r} `);let l=`${c}${r}${c}`;return n.stack.includes(`tableCell`)?nW(l):l},inlineMath:Aue,delete:jue,heading(e,t,n,r){let i=e.data?.sourceStyle??`atx`,a=e.depth;if(i===`setext`&&(a===1||a===2)){let t=n.containerPhrasing(e,{...r,before:`
|
|
371
|
+
`,after:`
|
|
372
|
+
`}),i=e.data?.sourceUnderlineLength,o=typeof i==`number`&&i>=1?i:Math.max(t.length,3);return`${t}\n${(a===1?`=`:`-`).repeat(o)}`}let o=e.data?.sourceLeadingIndent,s=typeof o==`number`&&o>=1&&o<=3?` `.repeat(o):``,c=e.data?.sourceInteriorSpacing,l=typeof c==`number`&&c>=2?` `.repeat(c):` `,u=`#`.repeat(a),d=n.enter(`okAtxHeading`),f=n.containerPhrasing(e,{...r,before:`${u} `,after:`
|
|
373
|
+
`});d();let p=e.data?.sourceTrailingHashes;if(typeof p==`number`&&p>0){let e=`#`.repeat(p);return f?`${s}${u}${l}${f} ${e}`:`${s}${u} ${e}`}return f?`${s}${u}${l}${f}`:`${s}${u}`},list(e,t,n,r){let i=n.options.bullet||`-`,a=!!e.ordered,o=n.bulletCurrent,s=n.bulletLastUsed;if(!a){let t=e.data?.bulletMarker;(t===`-`||t===`*`||t===`+`)&&(n.bulletCurrent=t)}let c=e.children||[],l=[],u=a?e.data?.listMarkerDelimiter??`.`:null,d=e.start??1;for(let t=0;t<c.length;t++){let o=c[t],s=o.data?.sourceOrdinal,f=typeof s==`number`&&s>=0?s:d+t,p=a?`${f}${u}`:e.data?.bulletMarker??i,m=o.data?.sourceMarkerSpacing,h=typeof m==`number`&&m>=2&&m<=4?m:1,g=` `.repeat(h),_=p;o.checked===!0?_+=`${g}[${o.data?.sourceCheckboxChar===`X`?`X`:`x`}]`:o.checked===!1&&(_+=`${g}[ ]`);let v=o.data?.sourceContinuationIndent,y=p.length+h,b=typeof v==`number`&&v>=y&&v<=y+3?v:y,x=` `.repeat(b),S=o.checked===null||o.checked===void 0?g:` `,C=o.children??[],w=C[0]?.type===`list`,T;if(w){let e=o.checked!==null&&o.checked!==void 0,t=n.containerFlow({...o,children:[C[0]]},r),i=C.slice(1),a=i.length?n.containerFlow({...o,children:i},r):``,s=t.split(`
|
|
374
|
+
`).map((t,n)=>n===0?e?`${x}${t}`:`${_}${S}${t}`:t&&`${x}${t}`).join(`
|
|
375
|
+
`),c=[];if(e?c.push(_,``,s):c.push(s),a){let e=a.split(`
|
|
376
|
+
`).map(e=>e&&`${x}${e}`).join(`
|
|
377
|
+
`);c.push(``,e)}T=c.join(`
|
|
378
|
+
`)}else T=n.containerFlow(o,r).split(`
|
|
379
|
+
`).map((e,t)=>t===0?`${_}${S}${e}`:e&&`${x}${e}`).join(`
|
|
380
|
+
`);l.push(T)}n.bulletCurrent=o,n.bulletLastUsed=s;let f=e.spread?`
|
|
381
|
+
|
|
382
|
+
`:`
|
|
383
|
+
`;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(`
|
|
384
|
+
`)},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=m6(i.attributes??[]),l=i.data?.sourceBody;if(l&&s&&!c.includes(`
|
|
385
|
+
`))return`${l.leading}<${s}${c?` ${c}`:``}>${l.afterOpenTag}`;if(!i.children||i.children.length===0)return s?c?`<${s} ${c} />`:`<${s} />`:``;let u={...i,attributes:(i.attributes??[]).map(Iue),children:(i.children??[]).map(Pue)};return Mue(u,t,n,r)},mark(e,t,n,r){let i=n.createTracker(r),a=n.enter(`mark`),o=i.move(`==`);return o+=w6(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=m6(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&&!Nue.test(e)?e:i===`none`||i===0?`>${e}`:typeof i==`number`&&i>=2&&!e.startsWith(` `)?`>${` `.repeat(i)}${e}`:`> ${e}`})}};function m6(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}={${h6(n.value)}}`):t.push(`${e}="${n.value}"`);continue}t.push(`${e}={${n.value.value}}`)}return t.join(` `)}function h6(e){return`"${e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}"`}function Iue(e){return e.type===`mdxJsxAttribute`&&typeof e.value==`string`&&e.value.includes(`"`)?{type:`mdxJsxAttribute`,name:e.name,value:{type:`mdxJsxAttributeValueExpression`,value:h6(e.value)}}:e}const Lue=/^https?:\/\//i,Rue=/^www\./i,zue=/^https?:\/\/[A-Za-z0-9./:?#@+,;()!'-]*$/i,Bue=/www\./i;function Vue(e,t){if(e===t&&Lue.test(e))return`protocol`;if(t===`http://${e}`&&Rue.test(e))return`www`;if(t===`mailto:${e}`)return`email`}function Hue(e){let t=``;for(let n of e.children){if(n.type!==`text`)return!1;t+=n.value}return t===e.url}function g6(e){return e>=65&&e<=90||e>=97&&e<=122}function _6(e){return g6(e)||e>=48&&e<=57}function v6(e){return e===45||e===95||_6(e)}function Uue(e){return e===43||e===46||v6(e)}function Wue(e){return e!==47&&!Uue(e)}function Gue(e,t,n,r,i){let a=n?.children??[],o=a.indexOf(t),s=o>0?a[o-1]:void 0,c=o>=0?a[o+1]:void 0,l=s?.type===`text`?s.value:i.before,u=c===void 0?i.after:r.handle(c,n,r,{...r.createTracker(i).current(),before:e,after:``});return{before:l.charCodeAt(l.length-1),after:u.charCodeAt(0),afterNext:u.charCodeAt(1)}}function Kue(e,t){return v6(e)||e===46&&_6(t)}function que(e,{before:t,after:n,afterNext:r}){return e===`email`?Wue(t)&&!Kue(n,r):(e===`protocol`?!g6(t):C6(t)!==`other`)&&C6(n)!==`other`}function Jue(e){return zue.test(e)&&!Bue.test(e)}function y6(e,t,n=` `){return t===`single`?`${n}'${e.replace(/'/g,`\\'`)}'`:t===`paren`?`${n}(${e.replace(/[()]/g,`\\$&`)})`:`${n}"${e.replace(/"/g,`\\"`)}"`}function b6(e,t,n,r=!1){let i=String(n.url??``),a=i.startsWith(`<`)&&i.endsWith(`>`);if(n.data?.sourceUrlForm===`angle-bracketed`&&!a||r){let n=e.enter(`destinationLiteral`),r=t.move(Yue(i,e.stack.includes(`tableCell`)));return n(),r}let o=e.enter(`destinationRaw`),s=t.move(Xue(i));return o(),s}function Yue(e,t=!1){let n=`<`;for(let r=0;r<e.length;r++){let i=e[r];g4(i)||t&&i===`|`?n+=`\\${i}`:n+=i===`
|
|
386
|
+
`?`
`:i===`\r`?`
`:i===`\\`?_4(e[r+1])?`\\\\`:`\\`:i}return`${n}>`}function Xue(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 Zue(e){return e.replace(/(?<!\\)&(?=(#[0-9]+|#[xX][0-9A-Fa-f]+|[A-Za-z][A-Za-z0-9]*);)/g,(e,t)=>Que(t)?e:`\\${e}`)}function Que(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}const $ue=/&#(?:x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);/g;function ede(e){return e.replace($ue,e=>rp(e)?``+e.slice(1):e)}function tde(e){return/[\r\n][\t ]*$/.test(e)}function x6(e,t,n,r=!1){let{matched:i}=R4(t,{escapeAware:!1});if(i.length===0)return S6(e,t,n,r);let a=``,o=0,s=i=>{i>o&&(a+=S6(e,t.slice(o,i),{...n,before:n.before+a,after:t.slice(i,i+1)||n.after},r)),o=i};for(let e of i)s(e.start),!tde(n.before+a)&&(a+=t.slice(e.start,e.end),o=e.end);return s(t.length),a}function S6(e,t,n,r=!1){let i=e.unsafe;e.unsafe=i.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]`||r&&e.character===`:`&&e.before===`[ps]`&&e.after===`\\/`||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
|
|
387
|
+
]|$)`};return delete t._compiled,t});let a;try{a=e.safe(ede(t),n)}finally{e.unsafe=i}return a=a.replaceAll(``,`\\&`),Zue(ide(a,n))}function C6(e){if(Number.isNaN(e))return`ws`;let t=ob(e);return t===1?`ws`:t===2?`punct`:`other`}function nde(e,t,n){let r=C6(t),i=C6(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 rde(e,t,n){let r=t;for(;r<e.length&&(e[r]===` `||e[r]===` `);)r++;if(r<e.length)return e[r]===`
|
|
388
|
+
`||e[r]===`\r`;let i=n.after.charCodeAt(0);return Number.isNaN(i)||i===10||i===13}function ide(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)&&rde(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+=nde(i,o,s)?`\\${i}`.repeat(a-r):e.slice(r,a)}r=a;continue}n+=i,r+=1}return n}function w6(e,t,n){let r=n.startsWith(`_`)?`_`:`*`,i=t.before??``,a=t.after??``,o=e,s=o.charCodeAt(0);T6(i.charCodeAt(i.length-1),s,r)&&(o=E6(s)+o.slice(1));let c=o.charCodeAt(o.length-1);return T6(a.charCodeAt(0),c,r)&&(o=o.slice(0,-1)+E6(c)),o}function T6(e,t,n){return!(ob(t)!==1||n===`_`&&ob(e)===void 0)}function E6(e){return`&#x${e.toString(16).toUpperCase()};`}function ade(e,t,n,r){let i=e.value??``,a=e.data?.sourceDelimiter,o=typeof a==`string`&&/^\$+$/.test(a)?a.length:2;for(o===1&&!sde(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 ode(e,t,n,r){let i=e.data?.sourceDelimiter===`~`?`~`:`~~`,a=n.createTracker(r),o=n.enter(`strikethrough`),s=a.move(i);return s+=w6(n.containerPhrasing(e,{...a.current(),before:s,after:`~`}),r,i),s+=a.move(i),o(),s}function sde(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(`\\`))}const D6=[{mode:`protecting`,protect:mse,reservations:fse},{mode:`protecting`,protect:Jse,reservations:gse},{mode:`protecting`,protect:use,reservations:sse},{mode:`serializer-only`,reservations:[{to:``}]}],cde=new Set(D6.flatMap(({reservations:e})=>e.map(({to:e})=>e)));function lde(e,t){switch(t.mode){case`protecting`:return t.protect(e);case`serializer-only`:return e}}function O6(e){return D6.reduce(lde,e)}function ude(e){return cde.has(e)}function k6(e){return e.data?.sourceRaw}function dde(e){return e.type===`text`?e.value===``:e.type===`mdxJsxTextElement`&&k6(e)===``}function A6(e){return e.type===`paragraph`&&(e.children??[]).every(dde)}function j6(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 fde(e){switch(e.type){case`table`:return j6(e)===0;case`code`:return e.data?.sourceStyle===`indented`&&/^\n*$/.test(e.value??``);case`thematicBreak`:return k6(e)===``;case`html`:return(e.value??``)===``;case`mdxJsxFlowElement`:return k6(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 pde(e){let t=[];for(let n of e.children){if(n.type===`table`&&j6(n)===0){console.warn(JSON.stringify({event:`table-serialize-dropped-empty`,rows:(n.children??[]).length}));continue}fde(n)||(n.type===`paragraph`&&n.children.length>0&&A6(n)&&(n.children=[]),t.push(n))}e.children=t}function mde(e,t){let n=e,r=t;return n.type===`heading`&&n.data?.sourceContiguousNext===!0&&r.type===`paragraph`}const hde=(e,t)=>{if(A6(e)||mde(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},M6=/(?<!\\)\$(?=\S)([^$\n]*?[^\s$])\$(?!\d)/g;function gde(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;ub(e,`text`,(e,t,r)=>{if(r===void 0||t==null)return;let i=e.value;if(i.indexOf(`$`)===-1)return;let a=gY(e);M6.lastIndex=0;let o=[],s;for(;(s=M6.exec(i))!==null;){let e=s.index,t=e+s[0].length;if(bY(a,e,1)||bY(a,t-1,1)){M6.lastIndex=e+1;continue}o.push(s)}if(o.length===0)return;let c=[],l=0;for(let t of o){let r=t.index,i=r+t[0].length;r>l&&c.push(yY(n,e,l,r));let a={type:`inlineMath`,value:t[1]},o=CY(n,e,r,i);o&&(a.position=o),c.push(a),l=i}return l<i.length&&c.push(yY(n,e,l,i.length)),r.children.splice(t,1,...c),[Gv,t+c.length]})}}const _de=new Set([`strong`,`emphasis`,`delete`,`link`,`mark`,`comment`]);function vde(e){if(e?.type!==`break`)return!1;let t=e.data?.sourceRaw;return typeof t!=`string`||t.length===0}function yde(e){e.data??={},e.data.sourceRaw=`<br />`,e.data.sourceStyle=`html`}function N6(e){if(e?.type!==`text`)return!1;let t=e.data?.sourceRaw;return typeof t!=`string`||t.length===0}const P6=/[ \t]+$/,F6=/^[ \t]*$/;function bde(e){return e.some(e=>!(N6(e)&&F6.test(e.value)))}function I6(e,t=!1){for(;e.length>0;){let n=e[e.length-1];if(vde(n)){yde(n);break}if(n&&_de.has(n.type)&&`children`in n){let t=n.children;if(I6(t,!0),t.length===0){e.pop();continue}}if(!t&&N6(n)&&P6.test(n.value)){let t=n.value.replace(P6,``);if(t.length>0){n.value=t;continue}if(bde(e.slice(0,-1))){e.pop();continue}if(e.every(e=>N6(e)&&F6.test(e.value))){let t=e[0];t.value=t.value.charAt(0),e.splice(1)}}break}}const xde=new Set([`paragraph`,`heading`,`tableCell`]);function Sde(e){let t=e=>{if(xde.has(e.type)&&`children`in e&&I6(e.children),`children`in e)for(let n of e.children)t(n)};t(e)}const L6={handlers:{tag:e=>`#${e.value}`},unsafe:[{character:`#`,inConstruct:[`phrasing`],before:`\\s`,after:`[A-Za-z]|[^\\x00-\\x7F]`}]};function Cde(){let e=this.data();e.toMarkdownExtensions||=[],e.toMarkdownExtensions.some(e=>e===L6)||e.toMarkdownExtensions.push(L6)}const wde=new Set([`u`,`ins`]);function Tde(){return e=>{ub(e,`mdxJsxTextElement`,(e,t,n)=>{if(n===void 0||t==null||e.name===null||!wde.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})}}function Ede(e){return e.children.some(e=>{let t=e.type;return t!==`yaml`&&t!==`toml`})?e:{...e,children:[...e.children,{type:`paragraph`,children:[]}]}}const Dde=[{name:`remark-parse`,plugin:aE},{name:`escape-provenance`,plugin:Rle},{name:`remark-mdx-agnostic`,plugin:G4},{name:`remark-gfm`,plugin:Tw},{name:`remark-math`,plugin:f3,options:{singleDollarTextMath:!1}},{name:`remark-wiki-link`,plugin:e3},{name:`remark-github-alerts`,plugin:Ece,options:Zce},{name:`callout-transformer`,plugin:Xce},{name:`restore-from-mdx`,plugin:Yse},{name:`void-br-promoter`,plugin:$se},{name:`restore-entity-refs`,plugin:dse},{name:`restore-backslash-escapes`,plugin:hse},{name:`details-accordion-promoter`,plugin:ble},{name:`div-align-promoter`,plugin:Dle},{name:`image-promoter`,plugin:Hle},{name:`indented-code-promoter`,plugin:qle},{name:`math-promoter`,plugin:eue},{name:`single-dollar-math-promoter`,plugin:gde},{name:`highlight-promoter`,plugin:Vle},{name:`underline-promoter`,plugin:Tde},{name:`mermaid-promoter`,plugin:Sue},{name:`comment-promoter`,plugin:Qce},{name:`merged-post-parse-walker`,plugin:bue},{name:`empty-task-item-unmint`,plugin:Mle},{name:`link-reference-destination`,plugin:$le},{name:`non-rendering-context-demote`,plugin:kue},{name:`ensure-non-empty-doc`,plugin:()=>Ede}];function Ode(e){let t=Gw();for(let e of Dde)t=`options`in e&&e.options!==void 0?t.use(e.plugin,e.options):t.use(e.plugin);return t=t.use(bce,{schema:e.schema,handlers:e.handlers}),t.freeze(),t}function kde(e){let t=Gw().use(bT,[`yaml`]).use(Tw,{tablePipeAlign:!1}).use(f3,{singleDollarTextMath:!1}).use(G4).use(e3).use(Cde).use(c0,{bullet:`-`,fences:!0,rule:`-`,join:[hde],...e.toMarkdownHandlers?{handlers:e.toMarkdownHandlers}:{}});return t.freeze(),t}function R6(e){return e.charCodeAt(0)===65279?{source:e.slice(1),hadBom:!0}:{source:e,hadBom:!1}}const z6=/^\n+$/,B6=/^\n{2,}$/;function V6(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);z6.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);B6.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 Ade(e){if(typeof e!=`object`||!e)return;let t=e,n={};return t.bom===!0&&(n.bom=!0),typeof t.leading==`string`&&z6.test(t.leading)&&(n.leading=t.leading),typeof t.trailing==`string`&&B6.test(t.trailing)&&(n.trailing=t.trailing),n.bom||n.leading||n.trailing?n:void 0}function jde(e,t){let{source:n,hadBom:r}=R6(e),i=P3(n),a=new Rw(O6(i)),o=t.parse(a);a.value=i;let s=t.runSync(o,a);Z3(s,i);let c=V6(s,i,r),l=c?Iu(s,c):void 0,u=t.stringify(s);return l?u.type.create({...u.attrs,sourceDocBoundary:l},u.content,u.marks):u}function Mde(e,t){return H6(e,t,!1)}function Nde(e,t){return H6(e,t,!0)}function H6(e,t,n){let{source:r,hadBom:i}=R6(e),a=P3(r),o=new Rw(O6(a)),s=t.parse(o);o.value=a;let c=t.runSync(s,o);n&&Z3(c,a);let l=V6(c,a,i);return n&&l&&Iu(c,l),c}function Pde(e,t,n){let r=Sce(e,{schema:n.schema,nodeHandlers:n.pmNodeHandlers,markHandlers:n.pmMarkHandlers});U6(r),Ale(r),Sde(r),pde(r);let i=Ade(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 U6(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)U6(t);for(let t=0;t+1<e.children.length;){let n=e.children[t],r=e.children[t+1],i=n?.data,a=r?.data,o=dY(i)?i.escapedChars:null,s=dY(a)?a.escapedChars:null;if(n?.type!==`text`||r?.type!==`text`||typeof n.data?.sourceRaw==`string`||typeof r.data?.sourceRaw==`string`||o===null&&s===null){t+=1;continue}let c=n.value.length;n.value+=r.value,n.data??={},n.data.escapedChars=[...o??[],...(s??[]).map(e=>({...e,offset:e.offset+c}))],r.data?.entityRefSpans?.length&&(n.data.entityRefSpans=[...n.data.entityRefSpans??[],...r.data.entityRefSpans.map(e=>({...e,offset:e.offset+c}))]),e.children.splice(t+1,1)}}}var Fde=class{schema;handlers;pmNodeHandlers;pmMarkHandlers;parseProcessor;serializeProcessor;parseCtx={current:{}};freshnessHolder={checker:void 0};authoredJsxSource=Mce(e=>this.schema.nodeFromJSON(this.parseWithFallback(e)));constructor(e){this.schema=UV(e.extensions),this.handlers=zde(this.schema,this.parseCtx),this.freshnessHolder.checker=e.deriveStructuralFreshness?dd({parse:e=>this.parseWithFallback(e)}):void 0;let{nodeHandlers:t,markHandlers:n}=Bde(this.schema,this.freshnessHolder,this.authoredJsxSource);this.pmNodeHandlers=t,this.pmMarkHandlers=n,this.parseProcessor=Ode({schema:this.schema,handlers:this.handlers,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers}),this.serializeProcessor=kde({toMarkdownHandlers:Fue})}parse(e,t){if(!e.trim())return{type:`doc`,content:[{type:`paragraph`,content:[]}]};this.parseCtx.current=t??{};try{return jde(e,this.parseProcessor).toJSON()}finally{this.parseCtx.current={}}}parseToMdast(e){return e.trim()?Mde(e,this.parseProcessor):{type:`root`,children:[]}}parseToEditorMdast(e){return e.trim()?Nde(e,this.parseProcessor):{type:`root`,children:[]}}parseWithFallback(e,t){return e.trim()?Pce(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 Pde(n,this.serializeProcessor,{schema:this.schema,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers})}finally{this.freshnessHolder.checker=r}}};const W6=r2();function G6(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 r[e]=i?.type===`boolean`?t.value===`true`:t.value;continue}let a=t.value.value;try{r[e]=JSON.parse(a)}catch{r[e]=a}}return r}function K6(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 Ide(e,t){return e.attrs.sourceDirty||K6(e)?!0:t?t.isDiverged(e.toJSON()):!1}function Lde(e){if(e.type!==`paragraph`)return!1;let t=e.children??[];return t.length===0||t.every(e=>e.type===`text`&&e.value===``)}function q6(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 J6(e,t){if(e.length===0)return q6({type:`inlineCode`,value:``},t);if(e.every(e=>e.type===`text`))return q6({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:[J6(n.children,t)]}}return q6({type:`inlineCode`,value:Y6(e)},t)}function Y6(e){let t=``;for(let n of e)n.type===`text`?t+=n.value:`children`in n&&Array.isArray(n.children)?t+=Y6(n.children):`value`in n&&typeof n.value==`string`&&(t+=n.value);return t}const Rde=vp;function zde(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=c3(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=c3(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=Mu(r,t.current.sourcePath);return n.image.createAndFill({src:i,alt:e.alt??null,title:e.title??null,sourceUrl:i===r?null:r,sourceUrlForm:e.data?.sourceUrlForm??null})},i.imageReference=n.imageReference?e=>n.imageReference.createAndFill({alt:e.alt??``,label:e.label??e.identifier??``,identifier:e.identifier??``,referenceType:e.referenceType??`shortcut`}):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&&op(t.raw)!==null&&rp(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=op(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=l3(a,e=>({sourceDelimiter:e.data?.sourceDelimiter===`~`?`~`:`~~`}))),r.highlight&&(i.mark=l3(r.highlight)),r.underline&&(i.underline=l3(r.underline,e=>({sourceForm:e.data?.sourceForm===`ins`?`ins`:`u`}))),r.comment&&(i.comment=l3(r.comment,e=>({sourceForm:e.data?.sourceForm??`percent`}))),n.commentBlock&&(i.commentBlock=c3(n.commentBlock,e=>({sourceForm:e.data?.sourceForm??`percent`,sourceLayout:e.data?.sourceLayout??`block`}))),r.emphasis&&(i.emphasis=l3(r.emphasis,e=>({sourceDelimiter:e.data?.sourceDelimiter??`*`}))),r.strong&&(i.strong=l3(r.strong,e=>({sourceDelimiter:e.data?.sourceDelimiter??`**`}))),n.heading&&(i.heading=c3(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=c3(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=c3(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,s=!!o.spec.attrs?.sourceUrlForm;i.definition=i=>{let c={title:i.title??null};return n&&(c.identifier=i.identifier??``),c.label=i.label??i.identifier??``,e?c.url=i.url??``:t&&(c.href=i.url??``),r&&(c.sourceLayout=i.data?.sourceLayout??null),a&&(c.sourceTitleMarker=i.data?.sourceTitleMarker??null),s&&(c.sourceUrlForm=i.data?.sourceUrlForm??null),o.createAndFill(c)}}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=W6.getOrWildcard(o),c=G6(e.attributes,s.props);if(o===`CommonMarkImage`&&typeof c.src==`string`){let e=c.src,n=Mu(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?W6.get(i):void 0;if(o&&n.jsxInline){let e=G6(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=i.data?.sourceTarget??null,u=i.data?.sourceAnchor??null,d=i.data?.sourceAlias??null,f=oW(o),{resolveEmbed:p,sourcePath:m}=t.current,h=p&&m?p(o,m)??null:null,g=h?`/${h}`:o,_=a?.type===`paragraph`&&Array.isArray(a.children)&&a.children.length===1;if(_&&Rde.has(f)&&n.jsxComponent&&W6.has(`WikiEmbedImage`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedImage`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:g,alt:s??o,target:o,anchor:c,alias:s,sourceTarget:l,sourceAnchor:u,sourceAlias:d}});if(_&&yp.has(f)&&n.jsxComponent&&W6.has(`WikiEmbedVideo`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedVideo`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:g,title:s??o,target:o,anchor:c,alias:s,sourceTarget:l,sourceAnchor:u,sourceAlias:d}});if(_&&bp.has(f)&&n.jsxComponent&&W6.has(`WikiEmbedAudio`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedAudio`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:g,title:s??o,target:o,anchor:c,alias:s,sourceTarget:l,sourceAnchor:u,sourceAlias:d}});if(_&&xp.has(f)&&n.jsxComponent&&W6.has(`WikiEmbedFile`)){let{resolveSize:e}=t.current,r=e&&m?e(o,m)??null:null,i=r===null?null:r3(r);return n.jsxComponent.createAndFill({componentName:`WikiEmbedFile`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:g,target:o,anchor:c,alias:s,size:i,sourceTarget:l,sourceAnchor:u,sourceAlias:d}})}let v=s||(c?`${o}#${c}`:o);if(r.link){let t=r.link.create({href:g,title:null,linkStyle:`inline`,refLabel:null,sourceForm:`wikiembed`,target:o,anchor:c,alias:s,sourceTarget:l,sourceAnchor:u,sourceAlias:d});return e.text(v,[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=c3(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 Bde(e,t,n){let r={},i={},a=e.nodes,o=e.marks;a.paragraph&&(r.paragraph=u3(`paragraph`)),a.blockquote&&(r.blockquote=u3(`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}:{}})),a.heading&&(r.heading=u3(`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||void 0,sourceLeadingIndent:e.attrs.sourceLeadingIndent??void 0,sourceInteriorSpacing:e.attrs.sourceInteriorSpacing??void 0}}))),a.codeBlock&&(r.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||void 0,sourceFenceIndent:e.attrs.sourceFenceIndent??void 0,sourceInfoPadding:e.attrs.sourceInfoPadding??void 0,sourceIndents:e.attrs.sourceIndents??void 0}}}),a.thematicBreak&&(r.thematicBreak=e=>({type:`thematicBreak`,data:{sourceRaw:e.attrs.sourceRaw}})),a.hardBreak&&(r.hardBreak=e=>({type:`break`,data:{sourceStyle:e.attrs.hardBreakStyle,...typeof e.attrs.sourceRaw==`string`&&e.attrs.sourceRaw.length>0?{sourceRaw:e.attrs.sourceRaw}:{}}})),a.list&&(r.list=u3(`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}}))),a.listItem&&(r.listItem=(e,t,n)=>{let r=n.all(e),i=r.length>1&&Lde(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}}),a.table&&(r.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}),a.tableRow&&(r.tableRow=u3(`tableRow`));let s=(e,t)=>{let n={type:`tableCell`,children:qY(t)},r=e.attrs.sourcePadding;return typeof r==`object`&&r&&typeof r.left==`number`&&typeof r.right==`number`&&(n.data={sourcePadding:r}),n};if(a.tableCell&&(r.tableCell=(e,t,n)=>s(e,n.all(e))),a.tableHeader&&(r.tableHeader=(e,t,n)=>s(e,n.all(e))),a.image&&(r.image=e=>{let t={type:`image`,url:ju(e.attrs.src,e.attrs.sourceUrl),alt:e.attrs.alt,title:e.attrs.title};return e.attrs.sourceUrlForm===`angle-bracketed`&&(t.data={sourceUrlForm:`angle-bracketed`}),t}),a.imageReference&&(r.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`}}),a.htmlBlock&&(r.htmlBlock=e=>({type:`html`,value:e.attrs.content})),a.linkDefinition??a.linkRefDef){let e=a.linkDefinition?`linkDefinition`:`linkRefDef`;r[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),e.attrs.sourceUrlForm===`angle-bracketed`&&(t.sourceUrlForm=`angle-bracketed`);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(a.jsxComponent&&(r.jsxComponent=(e,r,i)=>{if(e.attrs.kind===`expression`)return{type:`html`,value:e.attrs.sourceRaw??``};let a=e.attrs.componentName||null,o=Array.isArray(e.attrs.attributes)?e.attrs.attributes:[],s=()=>({type:`mdxJsxFlowElement`,name:a,attributes:o,children:[],data:{sourceRaw:String(e.attrs.sourceRaw)}});if(!Ide(e,t.checker)&&e.attrs.sourceRaw)return s();let c=W6.getOrWildcard(a??`*`),l={all:e=>i.all(e),registry:W6,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.`)}},u=c.serialize(e,l),d=m3(u,a);if(!d||K6(e))return u;let f=n.read(e,d,e=>c.serialize(e,l));return f?f.kind===`verbatim`?s():{...d,data:{...d.data,sourceBody:f.body}}:d}),a.rawMdxFallback&&(r.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}}}}),a.jsxInline&&(r.jsxInline=e=>{let t=e.attrs.componentName||``;if(t&&e.attrs.sourceDirty)return E0(t,e,W6.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)}}}),a.mathInline&&(r.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}}:{}}}),a.wikiLink&&(r.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}]}}),a.tag&&(r.tag=e=>({type:`tag`,value:String(e.attrs.value??``)})),a.wikiLinkEmbed&&(r.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}]}}),o.emphasis&&(i.emphasis=d3(`emphasis`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),o.strong&&(i.strong=d3(`strong`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),o.code&&(i.code=(e,t,n)=>{let r=e.attrs.sourceFenceChar,i=e.attrs.sourceFenceLength;return J6(n,{sourceFenceChar:r,sourceFenceLength:i,sourcePadded:e.attrs.sourcePadded===!0||void 0})}),o.strike??o.delete){let e=o.strike?`strike`:`delete`;i[e]=d3(`delete`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter===`~`?`~`:`~~`}}))}return o.highlight&&(i.highlight=d3(`mark`)),o.underline&&(i.underline=d3(`underline`,e=>({data:{sourceForm:e.attrs.sourceForm===`ins`?`ins`:`u`}}))),o.comment&&(i.comment=d3(`comment`,e=>({data:{sourceForm:e.attrs.sourceForm===`html`?`html`:`percent`}}))),a.commentBlock&&(r.commentBlock=u3(`commentBlock`,e=>({data:{sourceForm:e.attrs.sourceForm===`html`?`html`:`percent`,sourceLayout:e.attrs.sourceLayout===`inline`?`inline`:`block`}}))),a.footnoteReference&&(r.footnoteReference=e=>{let t=String(e.attrs.identifier??``);return{type:`footnoteReference`,identifier:t,label:e.attrs.label?String(e.attrs.label):t}}),a.footnoteDefinition&&(r.footnoteDefinition=u3(`footnoteDefinition`,e=>({identifier:String(e.attrs.identifier??``),label:e.attrs.label?String(e.attrs.label):String(e.attrs.identifier??``)}))),o.link&&(i.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=typeof e.attrs.sourceTarget==`string`?e.attrs.sourceTarget:null,o=typeof e.attrs.sourceAnchor==`string`?e.attrs.sourceAnchor:null,s=typeof e.attrs.sourceAlias==`string`?e.attrs.sourceAlias:null,c=i||(r?`${t}#${r}`:t),l=n.map(e=>`value`in e&&typeof e.value==`string`?e.value:``).join(``);return l!==c&&l.trim().length>0&&!l.includes(`]]`)&&(i=l,c=l),{type:`wikiLinkEmbed`,value:c,data:{target:t,anchor:r,alias:i,sourceTarget:a,sourceAnchor:o,sourceAlias:s},children:[{type:`text`,value:c}]}}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}}),o.escapeMark&&(i.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}),o.sourceLiteral&&(i.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 KU(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:r,markHandlers:i}}const Vde=/(^|\P{M})(\p{M}+)/gu,Hde=/^(?![\p{Script_Extensions=Latin}\p{Script_Extensions=Greek}\p{Script_Extensions=Cyrillic}\p{Script_Extensions=Arabic}\p{Script_Extensions=Hebrew}])\p{L}$/u,Ude=/\p{DI}/gu,Wde=/[^\p{L}\p{M}\p{N}]+/gu,Gde=/^-+|-+$/g;function Kde(e,t,n){return Hde.test(t)?t+n.replace(Ude,``):t}function X6(e){return e.trim().normalize(`NFKD`).replace(Vde,Kde).normalize(`NFC`).toLowerCase().replace(Wde,`-`).replace(Gde,``)}function qde(e,t){let n=t.get(e)??0;return t.set(e,n+1),n===0?e:`${e}-${n}`}function Jde(e,t){let n=X6(e);return n?qde(n,t):``}const Yde=new Set([`img`,`video`,`audio`,`mark`,`u`,`ins`]);new Map(t2.flatMap(e=>e.surface===`compat`&&Yde.has(e.rendersAs)?[[e.name,e]]:[])),hS(`<>`);var Z6={SINGLE_TILDE:0,COMPARISON_OPERATORS:5,HTML_TAGS:10,SETEXT_HEADINGS:15,LINKS:20,BOLD_ITALIC:30,BOLD:35,ITALIC_DOUBLE_UNDERSCORE:40,ITALIC_SINGLE_ASTERISK:41,ITALIC_SINGLE_UNDERSCORE:42,INLINE_CODE:50,STRIKETHROUGH:60,KATEX:70,INLINE_KATEX:75,DEFAULT:100};Z6.SINGLE_TILDE,Z6.COMPARISON_OPERATORS,Z6.HTML_TAGS,Z6.SETEXT_HEADINGS,Z6.LINKS,Z6.BOLD_ITALIC,Z6.BOLD,Z6.ITALIC_DOUBLE_UNDERSCORE,Z6.ITALIC_SINGLE_ASTERISK,Z6.ITALIC_SINGLE_UNDERSCORE,Z6.INLINE_CODE,Z6.STRIKETHROUGH,Z6.KATEX,Z6.INLINE_KATEX,Gw().use(aE).use(Tw);const Q6=I(le),Xde=I(ue);function Zde(e){return e===`agents`||ue.includes(e)}const Qde=F({alwaysOn:M().int().nonnegative(),onTrigger:M().int().nonnegative(),onDemand:M().int().nonnegative()}).strict(),$de=[`.md`,`.mdx`,`.txt`];function $6(e){return Math.round(e/4)}function efe(e){let t=e.lastIndexOf(`.`);return t!==-1&&$de.includes(e.slice(t).toLowerCase())}function tfe(e){let t=$6((e.name??``).length+(e.description??``).length),n=$6(iu(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/`)||efe(t.relPath)&&(i+=t.content.length));return{alwaysOn:t,onTrigger:n,onDemand:$6(i)}}const nfe=F({intents:P(F({satisfierId:j().min(1),desired:I([`present`,`absent`])}).loose()),...A_,summary:j_}).loose(),rfe=F({satisfierId:j(),agentId:j(),piece:j(),scope:j(),kind:j(),pathId:j().optional(),desired:I([`present`,`absent`]),action:I(_s),errorId:j().optional()}).loose(),ife=F({kind:j(),satisfierIds:P(j()),agentIds:P(j()),pathId:j().optional(),blockedReason:j().optional()}).loose(),afe=F({state:j(),strictness:P(I(ps)).optional()}).loose(),ofe=F({probes:F({env:I([`desktop`,`local-web`,`remote-web`]),satisfiers:ko(j(),afe)}).loose(),detection:F({detected:P(j()),probed:N()}).loose()}).loose(),sfe=F({actions:P(rfe),conflicts:P(ife),withheld:P(j()),snapshot:ofe}).loose(),cfe=F({entries:P(F({level:I([`info`,`warn`,`error`]),message:j().max(8192),event:j().optional(),fields:ko(j(),po()).optional(),ts:M().optional(),sourceId:j().optional(),lineNumber:M().optional()}).loose()).max(100),droppedSinceLastFlush:M().int().min(0).optional()}).loose(),lfe=F({accepted:M().int().min(0)}).loose(),ufe=F({exact:j().min(1),prefix:j(),suffix:j(),start:M().int().nonnegative(),end:M().int().nonnegative()}),dfe=P(xo([j(),M().int().nonnegative()])),ffe=Co(`kind`,[F({kind:L(`body`)}),F({kind:L(`property`),key:j().min(1),path:dfe.default([])})]).default({kind:`body`}),pfe=I([`anchored`,`orphaned`,`resolved`]),e8=F({threadId:j().min(1),docName:j().min(1),target:ffe,anchor:ufe.nullable(),state:pfe,queued:N(),latestComment:j(),createdBy:j().min(1),createdAt:M(),updatedAt:M().optional()}),t8=F({docName:j(),instruction:j(),property:j().nullable(),passage:F({exact:j(),prefix:j(),suffix:j()}).nullable(),anchorLost:N(),passageRepeats:N()}).loose(),n8=F({threadId:j(),ok:L(!0)}),r8=F({threadId:j(),ok:L(!1),error:L(`not-found`)}),mfe=F({threads:P(e8)}).loose(),hfe=F({meta:e8,orphaned:N()}).loose(),gfe=F({threadId:j()}).loose(),_fe=F({meta:e8,payload:t8}).loose(),vfe=F({results:P(xo([n8.extend({meta:e8,payload:t8}),r8]))}).loose(),yfe=F({results:P(xo([n8.extend({meta:e8}),r8]))}).loose(),i8=[`ours`,`theirs`],a8=[`check-failed`,`too-large`,`conflict-markers`,`no-base`,`no-merge-engine`,`outside-settings-applied`,`outside-settings-invalid`],bfe=[`no-history-or-backup`,`keeps-changing`,`not-utf8`,`unreadable`],xfe=F({duplicated:M().int().nonnegative(),restoredDeletedHere:M().int().nonnegative(),restoredDeletedOutside:M().int().nonnegative()}),o8={id:j().min(1),docName:j().min(1),file:j().min(1),firstAt:j().min(1),lastAt:j().min(1),events:M().int().positive(),entries:P(j().min(1))},s8=Co(`kind`,[F({...o8,kind:L(`both-kept`),kept:xfe}).loose(),F({...o8,kind:L(`moved-to-history`),side:I(i8),reason:I(a8)}).loose(),F({...o8,kind:L(`moved-to-backup`),side:I(i8),reason:I(a8),backup:j().min(1)}).loose(),F({...o8,kind:L(`save-held`),cause:I(bfe)}).loose()]),Sfe=F({notices:P(s8)}).loose(),Cfe=F({docName:j().min(1),id:j().min(1)}).loose(),wfe=F({dismissed:N()}).loose(),Tfe=F({status:j().min(1),reason:j()}).loose(),Efe=F({docName:j().min(1),content:j(),lifecycle:Tfe.nullable()}).loose(),Dfe=F({documents:P(F({kind:I([`document`,`asset`,`folder`,`file`]).default(`document`),docName:j().min(1).optional(),docExt:j().min(1).default(`.md`),size:M().int().nonnegative(),modified:j().min(1),isSymlink:N().default(!1),canonicalDocName:j().nullable().default(null),targetPath:j().nullable().default(null),path:j().min(1).optional(),assetExt:j().min(1).optional(),mediaKind:I([`image`,`video`,`audio`,`pdf`,`text`,`mermaid`,`excalidraw`]).nullable().optional(),referencedBy:P(j().min(1)).optional(),hasChildren:N().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)`})),truncated:N().optional()}).loose(),Ofe=F({source:j().min(1),anchor:j().nullable(),title:j(),snippet:j().nullable()}).loose(),kfe=F({docName:j().min(1),backlinks:P(Ofe)}).loose(),Afe=F({counts:ko(j().min(1),M().int().nonnegative())}).loose(),jfe=F({counts:ko(j().min(1),M().int().nonnegative())}).loose(),Mfe=Co(`kind`,[F({kind:L(`doc`),docName:j().min(1),anchor:j().nullable(),title:j(),snippet:j().nullable()}).loose(),F({kind:L(`external`),url:j().min(1),title:j(),snippet:j().nullable()}).loose()]),Nfe=F({role:j().min(1),sourceForm:j().min(1),targetKind:j().min(1),href:j(),resolvedTarget:j().nullable(),status:j().min(1),reason:j().nullable(),resolutionMethod:j().min(1),fallbackTarget:j().nullable().default(null),range:F({start:M().int().nonnegative(),end:M().int().nonnegative()}),line:M().int().nonnegative(),column:M().int().nonnegative(),definition:F({label:j(),line:M().int().nonnegative()}).nullable().default(null)}).loose(),Pfe=F({docName:j().min(1),forwardLinks:P(Mfe),localTargets:P(Nfe).optional()}).loose(),Ffe=Co(`kind`,[F({id:j().min(1),kind:L(`doc`),docName:j().min(1),anchor:j().nullable(),label:j(),cluster:j().nullable(),category:j().nullable(),tags:P(j()).nullable(),managed:N().optional()}).loose(),F({id:j().min(1),kind:L(`external`),url:j().min(1),label:j()}).loose()]),Ife=F({source:j().min(1),target:j().min(1)}).loose(),Lfe=F({nodes:P(Ffe),links:P(Ife)}).loose(),Rfe=F({docNames:P(j().min(1).max(1024)).min(1).max(64)}).loose(),zfe=F({checked:M().int().nonnegative(),found:M().int().nonnegative()}).loose(),Bfe=F({ts:M().int().min(0),url:j(),method:j(),ua:j().optional(),origin:j().optional(),referer:j().optional(),host:j().optional(),remote:j().optional(),secChUa:j().optional(),secChUaMobile:j().optional(),secChUaPlatform:j().optional(),secFetchSite:j().optional(),secFetchDest:j().optional(),secFetchMode:j().optional(),secFetchUser:j().optional()}).loose(),Vfe=F({app:xo([L(`cursor`),L(`codex`),L(`claude`),co()]),signals_fired:P(j())}).loose(),Hfe=F({entries:P(Bfe),count:M().int().min(0),detection:Vfe}).loose(),c8=[`M`,`A`,`D`,`R`,`C`,`U`,`T`,`?`,`!`,` `],l8=F({path:j().min(1),code:I(c8),origPath:j().min(1).optional(),syncScoped:N(),open:Co(`kind`,[F({kind:L(`doc`),docName:j().min(1)}),F({kind:L(`asset`),path:j().min(1)})]).optional()}).loose(),Ufe=F({branch:j().nullable(),detached:N(),upstream:j().nullable(),staged:P(l8),notStaged:P(l8),untracked:P(l8),incoming:P(l8),truncated:N(),readable:N().default(!0)}).loose(),Wfe=I([`AWAITING_CHECKS`,`LOCKED`,`MERGEABLE`,`QUEUED`,`UNMERGEABLE`]),Gfe=I([`BEHIND`,`BLOCKED`,`CLEAN`,`DIRTY`,`DRAFT`,`HAS_HOOKS`,`UNKNOWN`,`UNSTABLE`]),Kfe=I([`APPROVED`,`CHANGES_REQUESTED`,`REVIEW_REQUIRED`]),qfe=I([`ERROR`,`EXPECTED`,`FAILURE`,`PENDING`,`SUCCESS`]),Jfe=F({mergeQueue:F({position:M().int().nonnegative(),state:Wfe.nullable().catch(null)}).nullable().catch(null),autoMerge:N(),mergeState:Gfe.nullable().catch(null),reviewDecision:Kfe.nullable().catch(null),checks:qfe.nullable().catch(null)}).loose(),u8=F({kind:I([`pull`,`issue`]),repo:j().min(1),number:M().int().positive(),title:j(),author:j().nullable(),createdAt:j(),lifecycle:I([`open`,`draft`,`merged`,`closed`,`completed`,`not-planned`]),additions:M().int().nonnegative().optional(),deletions:M().int().nonnegative().optional(),status:Jfe.optional()}).loose(),Yfe=F({url:j()}).loose(),Xfe=Co(`ok`,[F({ok:L(!0),preview:u8}).loose(),F({ok:L(!1),reason:j()}).loose()]),Zfe=F({writers:P(F({id:j().min(1),name:j().optional(),email:j().optional()}).loose()).optional(),summary:j_,...A_}).loose(),Qfe=F({checkpointRef:j().min(1)}).loose(),$fe=F({v:M().int().optional(),id:j().min(1),name:j().min(1),colorSeed:j().optional(),docs:P(j()),summaries:P(j()).optional()}).loose(),epe=F({entries:P(F({sha:j().min(1),timestamp:j().min(1),author:j(),authorEmail:j(),type:I([`checkpoint`,`wip`,`upstream`,`park`]),message:j(),contributors:P($fe),checkpoint:po().nullable(),parentSha:j().nullable().optional()}).loose()),total:M().int().nonnegative().optional(),truncated:N().optional(),hasMore:N().optional()}).loose(),tpe=F({sha:j().regex(/^[0-9a-f]{40}$/i),content:j(),timestamp:j(),author:j()}).loose(),npe=F({contentDir:j().min(1),pathSeparator:I([`/`,`\\`]),symlinkResolved:N()}).loose(),rpe=P(Co(`source`,[F({docName:j().min(1),timestamp:j().min(1),size:M().int().nonnegative(),source:L(`flat`)}).loose(),F({docName:j().min(1),timestamp:j().min(1),source:L(`timeline`),sha:j().min(1)}).loose()])).meta({description:"Flat array of rescue buffer entries; discriminated via `source`."}),d8=F({domain:j().min(1),title:j().optional(),description:j().optional(),siteName:j().optional(),faviconDataUri:j().optional()}).loose(),ipe=F({url:j()}).loose(),ape=Co(`ok`,[F({ok:L(!0),metadata:d8}).loose(),F({ok:L(!1),reason:j()}).loose()]),ope=F({orphans:P(F({docName:j().min(1),title:j()}).loose())}).loose(),spe=F({hubs:P(F({docName:j().min(1),title:j(),count:M().int().nonnegative()}).loose())}).loose(),cpe=F({source:j().min(1),title:j(),snippet:j().nullable()}).loose(),lpe=F({deadLinks:P(F({target:j().min(1),sources:P(cpe)}).loose())}).loose(),upe=F({target:F({docName:j().min(1),title:j(),aliases:P(j())}).loose(),mentions:P(F({source:j().min(1),excerpt:j(),offset:M().int().nonnegative()}).loose()),truncated:N()}).loose(),dpe=F({projectPath:j().min(1)}).loose(),fpe=I([`not-a-git-worktree`,`init-failed`]),ppe=Co(`ok`,[F({ok:L(!0),projectPath:j().min(1)}).loose(),F({ok:L(!1),reason:fpe,message:j().min(1)}).loose()]),mpe=F({host:j().min(1).optional()}).loose(),hpe=F({host:j().min(1).optional(),token:j().min(1)}).loose(),gpe=F({host:j(),login:j()}).loose(),_pe=F({host:j().refine(f,{message:`Host must be a hostname with an optional :port, with no scheme or path`}),username:j().min(1),token:j().min(1)}).loose(),vpe=F({host:j(),login:j()}).loose(),ype=F({key:j().min(1)}).loose(),bpe=F({keyPresent:N()}).loose(),xpe=I([`no_key`,`invalid_endpoint`,`rate_limit`,`timeout`,`http_error`,`network`,`dims_mismatch`,`malformed_response`]),Spe=Co(`ok`,[F({ok:L(!0),endpoint:j().min(1),model:j().min(1),dimensions:M().int().positive()}).loose(),F({ok:L(!1),endpoint:j().min(1),model:j().min(1),reason:xpe,status:M().int().optional()}).loose()]),Cpe=F({name:j().refine(e=>e.trim().length>0,{message:`name must be non-empty`}),email:j().refine(e=>e.trim().length>0,{message:`email must be non-empty`})}).loose(),wpe=F({authenticated:N()}).loose(),Tpe=F({channel:I([`login`,`gh-login`]).default(`login`)}).loose(),Epe=F({}).loose(),Dpe=F({stackIndex:M().int().min(0),ts:M().int().min(0),additions:M().int().min(0),deletions:M().int().min(0)}).loose(),Ope=F({docName:j().min(1),additionsTotal:M().int().min(0),deletionsTotal:M().int().min(0),lastTs:M().int().min(0),bursts:P(Dpe)}).loose(),kpe=F({displayName:j().min(1),color:j().min(1),icon:j().optional(),connectionId:j().min(1)}).loose(),Ape=F({sessionAlive:N(),agent:kpe.nullable(),files:P(Ope)}).loose(),jpe=F({diff:j(),before:j(),after:j(),properties:FY,generatedAt:M().int().min(0)}).loose(),Mpe=F({}).loose(),Npe=F({}).loose(),Ppe=F({}).loose(),Fpe=F({}).loose(),Ipe=F({}).loose(),Lpe=F({}).loose(),Rpe=F({displayName:j().min(1),icon:j(),color:j().min(1),currentDoc:j().nullable(),mode:I([`idle`,`writing`]),ts:M().int().min(0)}).loose(),zpe=F({presence:ko(j().min(1),Rpe)}).loose(),Bpe=F({sessionId:j().min(1),agentType:j().min(1),ts:M().int().min(0),insertedChars:M().int().min(0),deletedChars:M().int().min(0)}).loose(),Vpe=F({effects:P(F({"doc.name":j().min(1),entries:P(Bpe)}).loose())}).loose(),Hpe=F({decisions:P(F({ts:M().int().min(0),decision:j().min(1),kind:j().min(1),"doc.name":j().min(1),pathRole:j().min(1)}).loose())}).loose(),Upe=ko(j().min(1),N()).meta({description:`Flat boolean record keyed by agent-scheme name (claude / codex / cursor). True = installed.`});F({path:j().min(1,`path must be non-empty`)}).loose();const Wpe=F({}).loose(),Gpe=F({fromDocName:j().min(1),toDocName:j().min(1)}).loose(),Kpe=F({fromPath:j().min(1),toPath:j().min(1)}).loose(),qpe=F({}).loose(),Jpe=F({path:j().min(1),...A_,summary:j_}).loose(),Ype=F({docName:j().min(1)}).loose(),Xpe=F({path:j().min(1),...A_,summary:j_}).loose(),Zpe=F({path:j().min(1)}).loose(),Qpe=F({kind:I([`file`,`folder`]),path:j().min(1),...A_,summary:j_}).loose(),$pe=F({kind:I([`file`,`folder`]),path:j().min(1),duplicatedDocNames:P(j().min(1))}).loose(),eme=F({pages:P(F({docName:j().min(1),title:j(),docExt:j().min(1),size:M().int().nonnegative(),modified:j().min(1),icon:j().min(1).max(2048).optional()}).loose())}).loose(),tme=F({level:M().int().min(1).max(6),text:j(),slug:j()}).loose(),nme=F({docName:j().min(1),headings:P(tme)}).loose(),rme=F({docName:j().min(1),rewrites:M().int().nonnegative()}).loose(),ime=F({kind:I([`file`,`folder`,`asset`]),fromPath:j().min(1),toPath:j().min(1),...A_,summary:j_}).loose(),ame=F({renamed:P(Gpe),renamedAssets:P(Kpe),rewrittenDocs:P(rme).optional(),summary:q_.optional()}).loose(),ome=F({kind:I([`file`,`folder`,`asset`]),path:j().min(1),...A_}).loose(),sme=F({deletedDocNames:P(j().min(1))}).loose(),cme=F({kind:I([`file`,`folder`,`asset`]),path:j().min(1),...A_,summary:j_}).loose(),lme=F({deletedDocNames:P(j().min(1))}).loose(),ume=F({docName:j().min(1),commitSha:j().regex(/^[0-9a-f]{40}$/i,{message:`commitSha must be a 40-char git SHA`}),summary:j_,...A_}).loose(),dme=F({...B_,restoredFrom:j().min(1),timestamp:j().min(1),summary:q_.optional(),warnings:ov.optional()}).loose(),fme=/^#[0-9a-fA-F]{6}$/,pme=F(Object.fromEntries(Lp.map(e=>[e,j().regex(fme,`must be a #rrggbb hex color`)]))),f8=j().min(1).refine(Bp,{message:`must contain a non-whitespace character`}),p8=F({name:f8,author:f8.optional(),variant:I([`dark`,`light`]),palette:pme}).loose(),mme=F({name:j().min(1),scheme:p8,stem:j().min(1).optional(),extension:I([`.yaml`,`.yml`]).optional()}).loose(),hme=F({id:j().min(1),filename:j().min(1)}).loose(),gme=F({id:j().min(1),scheme:p8}).loose(),_me=F({id:j().min(1),filename:j().min(1)}).loose(),vme=Co(`existed`,[F({existed:L(!1)}).loose(),F({existed:L(!0),filename:j().min(1),scheme:p8}).loose()]),yme=F({themes:P(Co(`ok`,[F({ok:L(!0),id:j().min(1),filename:j().min(1),scheme:p8}),F({ok:L(!1),filename:j().min(1),id:j().min(1).optional(),code:j().min(1),conflictingFilenames:P(j().min(1)).min(2).optional()})])),truncated:N()}).loose();function m8(e){return e.replace(/\\/g,`/`).split(`/`).filter(e=>e!==``&&e!==`.`)}function h8(e){let t=m8(e).at(-1);return t!==void 0&&hp.some(e=>t.toLowerCase().endsWith(e))}const bme=F({tags:P(F({name:j().min(1),count:M().int().nonnegative(),isLeaf:N()}).loose())}).loose(),xme=F({docName:j().min(1),title:j(),matchingTags:P(j().min(1)),snippet:j().nullable()}).loose(),Sme=F({name:j().min(1),docs:P(xme)}).loose(),Cme=F({folder:po(),frontmatter_local:ko(j(),po()).nullable(),warnings:P(j()).optional().meta({description:"Non-fatal degradations of this response, one per entry; the field each affects is absent, null, or incomplete — the aligned `warningCodes` entry names which field and how."}),warningCodes:P(I([`symlink-refused`,`malformed-yaml`,`unverifiable`,`templates-symlink-refused`,`templates-unverifiable`])).optional().meta({description:"Machine-readable codes aligned 1:1 with `warnings`; switch on these, never on the English. `symlink-refused` / `malformed-yaml` / `unverifiable`: this folder's own `.ok/frontmatter.yml` (a symlink, malformed YAML, or an lstat failure) — `frontmatter_local` is null. `templates-symlink-refused` / `templates-unverifiable`: the `.ok/templates` directory on this folder, or a `.ok` or `.ok/templates` directory on an ancestor it inherits from — a symlink (wherever it points, dangling included), or a non-ENOTDIR `lstat` failure — `folder.templates_available` omits that directory's templates and may still list others. A non-directory `.ok` / `.ok/templates` (ENOTDIR) is treated as empty and yields no `templates-*` code. This folder's own symlinked `.ok` is a 400, never a warning."})}).loose(),wme=F({path:j(),frontmatter:Yl(po()).optional()}).loose(),Tme=F({applied:po()}).loose(),g8=ko(j(),po()).meta({description:`Free-form frontmatter map embedded in template payloads.`}),Eme=F({template:F({name:j().min(1),folder:j(),scope:I([`local`,`inherited`]),path:j().min(1),frontmatter:g8,body:j()}).strict()}).strict(),Dme=F({templates:P(F({name:j().min(1),title:j().optional(),description:j().optional(),path:j().min(1),source_folder:j()}).strict()),truncated:N()}).strict(),Ome=F({folder:j(),name:j(),body:D_.optional(),frontmatter:g8.optional(),...A_,summary:j_}).strict(),kme=F({...B_,path:j().min(1),created:N(),warnings:P(j())}).strict(),Ame=F({sourcePath:j().min(1),targetFolder:j(),name:j().optional(),title:j().optional(),deleteSource:N().optional(),...A_,summary:j_}).strict(),jme=F({...B_,path:j().min(1),created:N(),warnings:P(j())}).strict(),Mme=F({existed:N(),path:j().min(1)}).strict(),Nme=F({fromFolder:j(),fromName:j(),toFolder:j(),toName:j(),body:D_.optional(),frontmatter:g8.optional(),...A_,summary:j_}).strict(),Pme=F({from:j().min(1),to:j().min(1),committed:N()}).strict(),_8=I(ug),Fme=/^[a-z0-9-]+$/,Ime=/<\/?[A-Za-z][^>]*>/;function Lme(e){return Ime.test(e)}const Rme=/^(?:(?!\p{DI})[\p{L}\p{M}\p{N}_-])+$/u,zme="letters and digits in any script, `_` or `-` only (no spaces, dots, slashes or invisible characters)";function v8(e){return e.normalize(`NFC`)}function Bme(e,t){let n=v8(t);return e.find(e=>e.name===t)??e.find(e=>v8(e.name)===n)}const y8=F({name:j(),description:j(),metadata:F({pack:j()}).strict().optional()}).strict(),Vme=F({skill:F({name:j().min(1),scope:_8,path:j().min(1),frontmatter:y8,body:j(),files:P(F({path:j().min(1),text:j().nullable()})).optional(),managed:N().optional()}).strict()}).strict(),Hme=F({source:j().min(1),publisher:j().optional(),skill:j().optional(),marketplaceUrl:j().optional(),importedAt:j().min(1),autoUpdate:N().optional()}).strict(),Ume=F({name:j().min(1),description:j().optional(),scope:_8,path:j().min(1),canonicalPath:j().min(1).optional(),filePaths:P(j()).optional(),absolutePath:j().min(1).optional(),installed:N(),hosts:P(j()),hostQualifier:j().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:P(j()).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:ko(j(),j()).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:P(j()).optional().meta({description:`Hosts whose dir holds a DIFFERENT same-name skill (fork/conflict) — occupied, not this skill.`}),symlinkedHosts:P(j()).optional(),installableEditors:P(j()).optional(),hubOffered:N().optional().meta({description:"Whether the vendor-neutral `.agents/skills` hub is a live destination at this scope on THIS machine — server-computed via the same predicate that filters the Folders surface, so the install menu and Settings cannot disagree. True when the project already uses the hub OR a host that reads it is installed (`HUB_READER_EDITORS`)."}),linkMode:N().optional(),customPlacements:P(F({path:j(),mode:I([`copy`,`link`])}).strict()).optional(),plugin:F({name:j().min(1),marketplace:j().min(1),provider:j().min(1),url:j().optional()}).strict().optional(),managed:N().optional(),origin:Hme.optional(),pack:j().optional(),modified:N().optional(),revertable:N().optional(),ignored:N().optional(),size:Qde.optional()}).strict(),Wme=F({name:j().min(1),scope:_8,apply:N().optional()}).strict(),Gme=F({line:j().min(1),gitignorePath:j().min(1),applied:N(),alreadyTracked:N().optional()}).strict(),Kme=F({skills:P(Ume),truncated:N()}).strict(),qme=F({scope:_8.default(`project`),name:j().meta({description:`Managed skill name to create or update.`}),body:D_.optional(),frontmatter:y8,...A_,summary:j_}).strict(),b8=[`skill-name-vendor-word`,`skill-body-too-long`],x8=P(I(b8)).meta({description:"Machine-readable codes aligned 1:1 with `warnings` (`warnings[i]` is the display text for `warningCodes[i]`)."}),Jme=F({...B_,path:j().min(1),created:N(),warnings:P(j()),warningCodes:x8}).strict(),Yme=F({scope:_8.default(`project`),name:j(),dryRun:N().optional(),setAutoUpdate:N().optional(),...A_,summary:j_}).strict(),Xme=F({name:j().min(1),updated:N(),source:j().min(1),localBody:j().optional(),upstreamBody:j().optional(),gitTracked:N().optional(),warnings:P(j()),warningCodes:x8}).strict(),Zme=F({scope:_8.default(`project`),name:j(),...A_,summary:j_}).strict(),Qme=F({name:j().min(1),baselineRef:j().min(1),restoredFiles:P(j()),warnings:P(j())}).strict(),S8=`This member also carries the one bookkeeping failure that does not undo the operation: the content change landed, but a state file this server keeps beside it refused to be rewritten because it could not be read, so the install or import records still describe the old state until an operator repairs that file. Absent when there is nothing to report; a server that predates this member omits it, so treat its absence as no warning rather than as an error.`,$me=F({existed:N(),path:j().min(1),warnings:P(j()).optional().meta({description:`Present when this delete removed a directory a retention record ties to a recovery copy an earlier failed move kept, whose source was never verified unchanged — either because this server verified the deleted directory against the copy that record describes, or because it could not read the directory and so could not confirm either way. Each entry says which of the two it is; neither claims more than the check established. ${S8}`})}).strict(),ehe=F({scope:_8.default(`project`),fromName:j(),toName:j(),body:D_.optional(),frontmatter:y8.optional(),...A_,summary:j_}).strict(),the=F({from:j().min(1),to:j().min(1),committed:N(),warnings:P(j()).optional().meta({description:`Present when the rename itself completed but something beside it did not. ${S8}`})}).strict(),nhe=F({name:j(),toName:j().optional().meta({description:"Name for the skill at the destination scope; defaults to `name`. The SKILL.md `name` frontmatter is rewritten to match."}),fromScope:_8,toScope:_8,...A_,summary:j_}).strict(),C8=[`nothing-written`,`destination-removed`,`destination-stray`,`destination-retained`,`destination-retained-blocking`,`destination-unreadable`,`partially-applied`];function rhe(e){return typeof e==`string`&&C8.includes(e)}const w8=[`intact`,`lossy`,`unknown`];function T8(e){return typeof e==`string`&&w8.includes(e)}const E8=[`unreadable`,`occupant-unverifiable`];function ihe(e){return typeof e==`string`&&E8.includes(e)}const ahe={"nothing-written":!1,"destination-removed":!1,"destination-stray":!1,"destination-retained":!0,"destination-retained-blocking":!0,"destination-unreadable":!1,"partially-applied":!1};function ohe(e){return ahe[e]}function she(e){let t=typeof e==`object`&&e?e:{},n=t.moveState,r=t.sourceState,i=t.retentionLedger;if(n===void 0&&r===void 0&&i===void 0)return{kind:`coherent`};let a=rhe(n)?n:void 0,o=T8(r)?r:void 0,s=ihe(i)?i:void 0,c={...a===void 0?{}:{moveState:a},...o===void 0?{}:{sourceState:o},...s===void 0?{}:{retentionLedger:s}};return n!==void 0&&a===void 0||r!==void 0&&o===void 0||i!==void 0&&s===void 0||a===void 0?{kind:`unverified`,...c}:(ohe(a)?o!==void 0&&s===void 0:a===`nothing-written`?o===void 0:o===void 0&&s===void 0)?{kind:`coherent`,...c}:{kind:`unverified`,...c}}const D8=`The server reported warnings in a shape this build does not recognise; treat this result as unverified.`;function che(e){if(e===void 0)return[];let t=D8;if(!Array.isArray(e))return[t];let n=e.filter(e=>typeof e==`string`);return n.length===e.length?n:[...n,t]}const lhe=F({scope:_8,path:j().optional(),droppedLocations:P(j()).default([]).meta({description:"Locations the skill occupied at the source that were removed and not re-created at the destination: the `agents` hub and custom roots, which projection does not cover. Entries are install location ids, so they can be passed straight back as an install `add` list with `scope` set to the destination scope; custom roots resolve against that scope's base."}),warnings:P(j()).optional().meta({description:`Present when the move itself completed but something beside it did not. ${S8}`})}).strict().meta({description:"Scope-move result. Rename paths deliberately do not emit authoring warnings, consistent with same-scope rename and duplicate. Content-authoring and import responses carry those warnings and their codes. The Skills Studio client parses `droppedLocations` off the wire but deliberately does not render it yet; how a human is told what was removed is an open product decision."}),uhe=F({scope:_8,name:j(),toName:j(),...A_,summary:j_}).strict(),dhe=F({name:j().min(1)}).strict(),fhe=F({name:j(),home:j().min(1)}).strict(),phe=F({docName:j().min(1)}).strict(),O8=I([`reference`,`script`,`file`]),mhe=F({scope:_8.default(`project`),name:j(),path:j().min(1),content:j(),...A_,summary:j_}).strict().superRefine((e,t)=>{h8(e.path)&&E_(e.content,t,[`content`])}),hhe=F({...B_,path:j().min(1),created:N(),kind:O8,content:N()}).strict(),ghe=F({scope:_8.default(`project`),name:j(),from:j().min(1),to:j().min(1),...A_,summary:j_}).strict(),_he=F({from:j().min(1),to:j().min(1),fromDocName:j().optional(),toDocName:j().optional()}).strict(),vhe=F({path:j().min(1),kind:O8,text:j()}).strict(),yhe=F({path:j().min(1),existed:N(),kind:O8}).strict(),k8=xo([Xde,L(`agents`)]),A8=j().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`}),j8=xo([k8,A8]),bhe=F({scope:_8.default(`project`),name:j(),targets:P(k8).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:P(j8).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:P(j8).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:I([`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:j8.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:N().optional(),setSource:j().min(1).optional(),place:F({dir:j().min(1).meta({description:`Project-relative directory the bundle dir is created under (e.g. ".windsurf/skills").`}),mode:I([`copy`,`link`])}).strict().optional(),convert:F({target:j8.meta({description:`The installed location to convert — an editor id, "agents", or a recorded custom placement path.`}),mode:I([`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:F({path:j().min(1).meta({description:`The recorded placement bundle path (e.g. ".windsurf/skills/my-skill").`})}).strict().optional(),...A_,summary:j_,fork:F({editor:j().min(1),action:I([`align`,`make-source`,`rename`]),toName:j().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"}),M8=[`no-targets`,`scripts-present`,`name-conflict`,`no-description`,`skill-fork-name-unpatched`,`place-path-invalid`,`place-fork-refused`,`links-not-permitted`],xhe=F({name:j().min(1).meta({description:`Managed skill name installed or uninstalled.`}),hosts:P(j()).meta({description:`Editor ids the skill is projected into after the operation; [] is expected after uninstall.`}),scripts:N().meta({description:`True when the skill ships executable scripts, projected but never run.`}),warnings:P(j()).meta({description:`Non-fatal install/uninstall warnings from target projection.`}),warningCodes:P(I(M8)).meta({description:"Machine-readable warning codes aligned with `warnings`."}),placedAt:j().optional(),sourceMovedTo:j().optional()}).strict(),She=F({scope:_8.default(`project`),name:j().meta({description:`Managed skill name to uninstall without deleting source.`})}).strict(),Che=F({name:j().min(1).meta({description:`Managed skill name requested for uninstall.`}),uninstalled:N().meta({description:`True when an install marker existed and was removed; false for an idempotent no-op.`})}).strict(),whe=F({targets:P(Q6),configured:N(),folders:P(F({scope:_8,host:j(),root:j(),state:I([`own`,`linked`,`linked-parent`,`absent`]),target:j().optional(),drift:L(!0).optional(),expected:j().optional()}).strict()).optional()}).strict(),N8=F({action:L(`link`),scope:_8,root:j().min(1).meta({description:`The folder to link (e.g. ".codex/skills").`}),target:j().min(1).meta({description:`The root it merges into (e.g. ".agents/skills"). Required.`})}),P8=F({action:L(`unlink`),scope:_8,root:j().min(1).meta({description:`The linked folder to materialize back.`}),exclude:P(j().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(),F8=F({action:L(`add-root`),scope:_8,root:A8.meta({description:`New custom skills root to declare (base-relative, e.g. ".team/skills").`})}).strict(),The=Co(`action`,[N8.extend({preview:N().optional().meta({description:`Return the merge plan only (moves, drops, removes, conflicts, strays) — nothing is written.`})}).strict(),P8,F8]),Ehe=Co(`action`,[N8.strict(),P8,F8]),Dhe=F({folderAction:The}).strict(),Ohe=F({moves:P(j()),drops:P(j()),removes:P(j()),replaces:P(j()),conflicts:P(j()),strays:P(j())}).strict(),khe=F({targets:P(Q6),reprojected:P(F({name:j(),hosts:P(j())}).strict()),bundleHosts:P(j()),removedFrom:P(j()),folder:F({moved:P(j()),dropped:P(j()),linked:P(j())}).strict().optional(),preview:Ohe.optional()}).strict(),Ahe=F({scope:_8.default(`project`),name:j(),version:j().regex(/^[0-9a-f]{40}$/i),...A_,summary:j_}).strict(),jhe=F({name:j().min(1),version:j(),restoredFiles:P(j()),warnings:P(j())}).strict(),Mhe=F({query:j().optional(),intent:I([`autocomplete`,`full_text`,`omnibar`]).optional(),ranking:I([`navigation`,`relevance`]).optional(),scopes:P(I([`page`,`folder`,`content`,`file`])).optional(),scope:j().optional(),limit:M().int().nonnegative().optional(),semantic:N().optional(),source:I([`omnibar`,`mcp`,`http`]).optional()}).loose(),Nhe=F({kind:I([`page`,`folder`,`content`,`file`]),path:j().min(1),title:j(),score:M(),signals:ko(j(),po()),snippet:j().optional()}).loose(),I8=I([`applied`,`no_match`,`warming`,`incapable`,`provider_error`,`restart_required`,`query_too_short`]),L8=I([`warm`,`corpus`,`query`,`dimensions`,`configured_dimensions`]);function Phe(e){return e?.providerErrorReason===`dimensions`?`restart_required`:e?.providerErrorReason===`configured_dimensions`?`incapable`:e?.providerError||e?.providerErrorReason?`provider_error`:null}function Fhe(e){throw Error(`Unhandled SemanticProviderErrorReason variant: ${JSON.stringify(e)}`)}function Ihe(e,t){let n=e?.providerErrorReason;switch(n){case null:case void 0:return e?.providerError===!0;case`corpus`:return!1;case`query`:return t===`query`;case`warm`:case`dimensions`:case`configured_dimensions`:return!0;default:return Fhe(n)}}function Lhe(e){throw Error(`Unhandled SemanticQueryOutcome variant: ${JSON.stringify(e)}`)}const R8=F({capable:N(),applied:N(),outcome:I8,providerErrorReason:L8.nullable().optional().catch(null),coverage:F({embedded:M().int().nonnegative(),total:M().int().nonnegative()})}).loose(),Rhe=F({enabled:N(),keyPresent:N(),keyNotRequired:N(),keySource:I([`project`,`file`,`env`]).nullable(),keyHint:j().nullable(),ready:N(),capable:N(),providerError:N().optional(),providerErrorReason:L8.nullable().optional().catch(null),embedded:M().int().nonnegative(),total:M().int().nonnegative()}).loose();function zhe(e){return!!(e?.enabled&&(e.keyPresent||e.keyNotRequired))}const Bhe=F({query:j(),intent:I([`autocomplete`,`full_text`,`omnibar`]),results:P(Nhe),elapsedMs:M().nonnegative(),semantic:R8.optional(),truncated:N().optional(),ready:N().optional()}).loose(),Vhe=F({version:j().min(1),recordedAt:j().min(1)}).loose(),Hhe=F({currentVersion:j().min(1),targets:ko(j(),Vhe.nullable())}).loose(),Uhe=F({scope:_8.default(`project`),source:j().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:j().min(1).optional().meta({description:`Specific skill name to import from a multi-skill source.`}),install:N().optional().meta({description:`Pass false to import WITHOUT the default-editor auto-projection (the caller installs explicitly afterwards). Default true.`}),marketplace:N().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."}),...A_,summary:j_}).strict(),Whe=F({scope:_8.default(`project`),source:j().min(1).meta({description:`External skill source: full skills.sh skill-page URL, GitHub owner/repo[/subpath], git URL, or local/file path.`}),skills:P(j().min(1)).min(1).max(100).meta({description:`Skill names to import from the source.`}),install:N().optional().meta({description:`Pass false to import WITHOUT the default-editor auto-projection. Default true.`}),marketplace:N().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."}),...A_,summary:j_}).strict(),Ghe=F({results:P(F({requested:j(),status:I([`imported`,`already-imported`,`not-found`,`failed`]),name:j().optional(),collisionRenamedFrom:j().optional(),warnings:P(j()),warningCodes:x8,error:j().optional()}).loose()),imported:M(),alreadyImported:M(),failed:M()}).loose(),Khe=F({scope:_8.default(`project`),names:P(j().min(1)).min(1).max(100).meta({description:`Managed skill names to refresh from their recorded upstreams.`}),...A_,summary:j_}).strict(),qhe=F({results:P(F({requested:j(),status:I([`updated`,`up-to-date`,`not-found`,`failed`]),source:j().optional(),warnings:P(j()),warningCodes:x8,error:j().optional()}).loose()),updated:M(),upToDate:M(),failed:M()}).loose(),Jhe=F({source:j(),ref:j().optional(),contentHash:j(),publisher:j().optional()}).loose(),Yhe=F({name:j().min(1).meta({description:`Managed skill name created or matched.`}),path:j().min(1).meta({description:`Store-relative path to the imported skill source.`}),created:N().meta({description:`True when this request created new source files.`}),alreadyImported:N().meta({description:`True when identical content was already present and no files changed.`}),collisionRenamedFrom:j().optional().meta({description:`Original source name when collision handling renamed the import.`}),provenance:Jhe,warnings:P(j()).meta({description:`Non-fatal import warnings, such as skipped unsupported files.`}),warningCodes:x8}).loose(),z8=`server-info`,B8=`branch-switched`,V8=`disk-ack`,H8=`config-validation-rejected`,U8=`config-ignore-nested-error`,Xhe=I([`files`,`backlinks`,`graph`,`sync-status`,`session-activity`,`tags`,`comments`,`lint-config`,`local-targets`]),Zhe=F({v:L(1),ch:L(z8),seq:M(),serverInstanceId:j().min(1),currentBranch:j().min(1).optional()}).loose(),Qhe=F({v:L(1),ch:L(B8),seq:M(),branch:j().min(1)}).loose(),$he=F({v:L(1),ch:Xhe,seq:M()}).loose(),ege=F({v:L(1),ch:L(V8),seq:M(),docName:j().min(1),sv:j().min(1)}).loose(),tge=F({v:L(1),ch:L(H8),seq:M(),docName:j().min(1),error:Gh}).loose(),nge=F({v:L(1),ch:L(U8),seq:M(),path:j().min(1),error:j().min(1)}).loose(),W8={arabic:`ar`,armenian:`am`,bulgarian:`bg`,czech:`cz`,danish:`dk`,dutch:`nl`,english:`en`,finnish:`fi`,french:`fr`,german:`de`,greek:`gr`,hungarian:`hu`,indian:`in`,indonesian:`id`,irish:`ie`,italian:`it`,lithuanian:`lt`,nepali:`np`,norwegian:`no`,portuguese:`pt`,romanian:`ro`,russian:`ru`,serbian:`rs`,slovenian:`ru`,spanish:`es`,swedish:`se`,tamil:`ta`,turkish:`tr`,ukrainian:`uk`,sanskrit:`sk`},rge={dutch:/[^A-Za-zàèéìòóù0-9_'-]+/gim,english:/[^A-Za-zàèéìòóù0-9_'-]+/gim,french:/[^a-z0-9äâàéèëêïîöôùüûœç-]+/gim,italian:/[^A-Za-zàèéìòóù0-9_'-]+/gim,norwegian:/[^a-z0-9_æøåÆØÅäÄöÖüÜ]+/gim,portuguese:/[^a-z0-9à-úÀ-Ú]/gim,russian:/[^a-z0-9а-яА-ЯёЁ]+/gim,spanish:/[^a-z0-9A-Zá-úÁ-ÚñÑüÜ]+/gim,swedish:/[^a-z0-9_åÅäÄöÖüÜ-]+/gim,german:/[^a-z0-9A-ZäöüÄÖÜß]+/gim,finnish:/[^a-z0-9äöÄÖ]+/gim,danish:/[^a-z0-9æøåÆØÅ]+/gim,hungarian:/[^a-z0-9áéíóöőúüűÁÉÍÓÖŐÚÜŰ]+/gim,romanian:/[^a-z0-9ăâîșțĂÂÎȘȚ]+/gim,serbian:/[^a-z0-9čćžšđČĆŽŠĐ]+/gim,turkish:/[^a-z0-9çÇğĞıİöÖşŞüÜ]+/gim,lithuanian:/[^a-z0-9ąčęėįšųūžĄČĘĖĮŠŲŪŽ]+/gim,arabic:/[^a-z0-9أ-ي]+/gim,nepali:/[^a-z0-9अ-ह]+/gim,irish:/[^a-z0-9áéíóúÁÉÍÓÚ]+/gim,indian:/[^a-z0-9अ-ह]+/gim,armenian:/[^a-z0-9ա-ֆ]+/gim,greek:/[^a-z0-9α-ωά-ώ]+/gim,indonesian:/[^a-z0-9]+/gim,ukrainian:/[^a-z0-9а-яА-ЯіїєІЇЄ]+/gim,slovenian:/[^a-z0-9螚ȎŠ]+/gim,bulgarian:/[^a-z0-9а-яА-Я]+/gim,tamil:/[^a-z0-9அ-ஹ]+/gim,sanskrit:/[^a-z0-9A-Zāīūṛḷṃṁḥśṣṭḍṇṅñḻḹṝ]+/gim,czech:/[^A-Z0-9a-zěščřžýáíéúůóťďĚŠČŘŽÝÁÍÉÓÚŮŤĎ-]+/gim},G8=Object.keys(W8);function ige(e){return e!==void 0&&G8.includes(e)?W8[e]:void 0}const age=Date.now().toString().slice(5);let oge=0;const K8=BigInt(1e3),q8=BigInt(1e6),J8=BigInt(1e9),Y8=65535;function X8(e,t){if(t.length<65535)Array.prototype.push.apply(e,t);else{let n=t.length;for(let r=0;r<n;r+=Y8)Array.prototype.push.apply(e,t.slice(r,r+Y8))}}function sge(e,...t){return e.replace(/%(?:(?<position>\d+)\$)?(?<width>-?\d*\.?\d*)(?<type>[dfs])/g,function(...e){let{width:n,type:r,position:i}=e[e.length-1],a=i?t[Number.parseInt(i)-1]:t.shift(),o=n===``?0:Number.parseInt(n);switch(r){case`d`:return a.toString().padStart(o,`0`);case`f`:{let e=a,[t,r]=n.split(`.`).map(e=>Number.parseFloat(e));return typeof r==`number`&&r>=0&&(e=e.toFixed(r)),typeof t==`number`&&t>=0?e.toString().padStart(o,`0`):e.toString()}case`s`:return o<0?a.toString().padEnd(-o,` `):a.toString().padStart(o,` `);default:return a}})}function cge(){return typeof WorkerGlobalScope<`u`&&self instanceof WorkerGlobalScope}function lge(){return typeof process<`u`&&process.release&&process.release.name===`node`}function Z8(){return BigInt(Math.floor(performance.now()*1e6))}function Q8(e){return typeof e==`number`&&(e=BigInt(e)),e<K8?`${e}ns`:e<q8?`${e/K8}μs`:e<J8?`${e/q8}ms`:`${e/J8}s`}function $8(){return cge()?Z8():lge()||typeof process<`u`&&typeof process?.hrtime?.bigint==`function`?process.hrtime.bigint():typeof performance<`u`?Z8():BigInt(0)}function e5(){return`${age}-${oge++}`}function t5(e,t){return Object.hasOwn===void 0?Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0:Object.hasOwn(e,t)?e[t]:void 0}function n5(e,t){return t[1]===e[1]?e[0]-t[0]:t[1]-e[1]}function uge(e){if(e.length===0)return[];if(e.length===1)return e[0];for(let t=1;t<e.length;t++)if(e[t].length<e[0].length){let n=e[0];e[0]=e[t],e[t]=n}let t=new Map;for(let n of e[0])t.set(n,1);for(let n=1;n<e.length;n++){let r=0;for(let i of e[n]){let e=t.get(i);e===n&&(t.set(i,e+1),r++)}if(r===0)return[]}return e[0].filter(n=>{let r=t.get(n);return r!==void 0&&t.set(n,0),r===e.length})}function r5(e,t){let n={},r=t.length;for(let i=0;i<r;i++){let r=t[i],a=r.split(`.`),o=e,s=a.length;for(let e=0;e<s;e++)if(o=o[a[e]],typeof o==`object`){if(o!==null&&`lat`in o&&`lon`in o&&typeof o.lat==`number`&&typeof o.lon==`number`){o=n[r]=o;break}if(!Array.isArray(o)&&o!==null&&e===s-1){o=void 0;break}}else if((typeof o!=`object`||!o)&&e<s-1){o=void 0;break}o!==void 0&&(n[r]=o)}return n}function i5(e,t){return r5(e,[t])[t]}const dge={cm:.01,m:1,km:1e3,ft:.3048,yd:.9144,mi:1609.344};function a5(e,t){let n=dge[t];if(n===void 0)throw Error(f5(`INVALID_DISTANCE_SUFFIX`,e).message);return e*n}function o5(e,t){e.hits=e.hits.map(e=>({...e,document:{...e.document,...t.reduce((e,t)=>{let n=t.split(`.`),r=n.pop(),i=e;for(let e of n)i[e]=i[e]??{},i=i[e];return i[r]=null,e},e.document)}}))}function s5(e){return Array.isArray(e)?e.some(e=>s5(e)):e?.constructor?.name===`AsyncFunction`}const c5=`intersection`in new Set;function l5(...e){if(e.length===0)return new Set;if(e.length===1)return e[0];if(e.length===2){let t=e[0],n=e[1];if(c5)return t.intersection(n);let r=new Set,i=t.size<n.size?t:n,a=i===t?n:t;for(let e of i)a.has(e)&&r.add(e);return r}let t={index:0,size:e[0].size};for(let n=1;n<e.length;n++)e[n].size<t.size&&(t.index=n,t.size=e[n].size);if(c5){let n=e[t.index];for(let r=0;r<e.length;r++)r!==t.index&&(n=n.intersection(e[r]));return n}let n=e[t.index];for(let r=0;r<e.length;r++){if(r===t.index)continue;let i=e[r];for(let e of n)i.has(e)||n.delete(e)}return n}const fge=`union`in new Set;function u5(e,t){return fge?e?e.union(t):t:e?new Set([...e,...t]):new Set(t)}function pge(e,t){let n=new Set;for(let r of e)t.has(r)||n.add(r);return n}function d5(e){if(typeof SharedArrayBuffer<`u`&&typeof Atomics<`u`){let t=new Int32Array(new SharedArrayBuffer(4));if(!(e>0&&e<1/0))throw typeof e!=`number`&&typeof e!=`bigint`?TypeError(`sleep: ms must be a number`):RangeError(`sleep: ms must be a number that is greater than 0 but less than Infinity`);Atomics.wait(t,0,0,Number(e))}else{if(!(e>0&&e<1/0))throw typeof e!=`number`&&typeof e!=`bigint`?TypeError(`sleep: ms must be a number`):RangeError(`sleep: ms must be a number that is greater than 0 but less than Infinity`);let t=Date.now()+Number(e);for(;t>Date.now(););}}const mge={NO_LANGUAGE_WITH_CUSTOM_TOKENIZER:`Do not pass the language option to create when using a custom tokenizer.`,LANGUAGE_NOT_SUPPORTED:`Language "%s" is not supported.\nSupported languages are:\n - ${G8.join(`
|
|
389
|
+
- `)}`,INVALID_STEMMER_FUNCTION_TYPE:`config.stemmer property must be a function.`,MISSING_STEMMER:`As of version 1.0.0 @orama/orama does not ship non English stemmers by default. To solve this, please explicitly import and specify the "%s" stemmer from the package @orama/stemmers. See https://docs.orama.com/docs/orama-js/text-analysis/stemming for more information.`,CUSTOM_STOP_WORDS_MUST_BE_FUNCTION_OR_ARRAY:`Custom stop words array must only contain strings.`,UNSUPPORTED_COMPONENT:`Unsupported component "%s".`,COMPONENT_MUST_BE_FUNCTION:`The component "%s" must be a function.`,COMPONENT_MUST_BE_FUNCTION_OR_ARRAY_FUNCTIONS:`The component "%s" must be a function or an array of functions.`,INVALID_SCHEMA_TYPE:`Unsupported schema type "%s" at "%s". Expected "string", "boolean" or "number" or array of them.`,DOCUMENT_ID_MUST_BE_STRING:`Document id must be of type "string". Got "%s" instead.`,DOCUMENT_ALREADY_EXISTS:`A document with id "%s" already exists.`,DOCUMENT_DOES_NOT_EXIST:`A document with id "%s" does not exists.`,MISSING_DOCUMENT_PROPERTY:`Missing searchable property "%s".`,INVALID_DOCUMENT_PROPERTY:`Invalid document property "%s": expected "%s", got "%s"`,UNKNOWN_INDEX:`Invalid property name "%s". Expected a wildcard string ("*") or array containing one of the following properties: %s`,INVALID_BOOST_VALUE:`Boost value must be a number greater than, or less than 0.`,INVALID_FILTER_OPERATION:`You can only use one operation per filter, you requested %d.`,SCHEMA_VALIDATION_FAILURE:`Cannot insert document due schema validation failure on "%s" property.`,INVALID_SORT_SCHEMA_TYPE:`Unsupported sort schema type "%s" at "%s". Expected "string" or "number".`,CANNOT_SORT_BY_ARRAY:`Cannot configure sort for "%s" because it is an array (%s).`,UNABLE_TO_SORT_ON_UNKNOWN_FIELD:`Unable to sort on unknown field "%s". Allowed fields: %s`,SORT_DISABLED:`Sort is disabled. Please read the documentation at https://docs.orama.com/docs/orama-js for more information.`,UNKNOWN_GROUP_BY_PROPERTY:`Unknown groupBy property "%s".`,INVALID_GROUP_BY_PROPERTY:`Invalid groupBy property "%s". Allowed types: "%s", but given "%s".`,UNKNOWN_FILTER_PROPERTY:`Unknown filter property "%s".`,UNKNOWN_VECTOR_PROPERTY:`Unknown vector property "%s". Make sure the property exists in the schema and is configured as a vector.`,INVALID_VECTOR_SIZE:`Vector size must be a number greater than 0. Got "%s" instead.`,INVALID_VECTOR_VALUE:`Vector value must be a number greater than 0. Got "%s" instead.`,INVALID_INPUT_VECTOR:`Property "%s" was declared as a %s-dimensional vector, but got a %s-dimensional vector instead.
|
|
390
|
+
Input vectors must be of the size declared in the schema, as calculating similarity between vectors of different sizes can lead to unexpected results.`,WRONG_SEARCH_PROPERTY_TYPE:`Property "%s" is not searchable. Only "string" properties are searchable.`,FACET_NOT_SUPPORTED:`Facet doens't support the type "%s".`,INVALID_DISTANCE_SUFFIX:`Invalid distance suffix "%s". Valid suffixes are: cm, m, km, mi, yd, ft.`,INVALID_SEARCH_MODE:`Invalid search mode "%s". Valid modes are: "fulltext", "vector", "hybrid".`,MISSING_VECTOR_AND_SECURE_PROXY:`No vector was provided and no secure proxy was configured. Please provide a vector or configure an Orama Secure Proxy to perform hybrid search.`,MISSING_TERM:`"term" is a required parameter when performing hybrid search. Please provide a search term.`,INVALID_VECTOR_INPUT:`Invalid "vector" property. Expected an object with "value" and "property" properties, but got "%s" instead.`,PLUGIN_CRASHED:`A plugin crashed during initialization. Please check the error message for more information:`,PLUGIN_SECURE_PROXY_NOT_FOUND:`Could not find '@orama/secure-proxy-plugin' installed in your Orama instance.
|
|
391
|
+
Please install it before proceeding with creating an answer session.
|
|
392
|
+
Read more at https://docs.orama.com/docs/orama-js/plugins/plugin-secure-proxy#plugin-secure-proxy
|
|
393
|
+
`,PLUGIN_SECURE_PROXY_MISSING_CHAT_MODEL:`Could not find a chat model defined in the secure proxy plugin configuration.
|
|
394
|
+
Please provide a chat model before proceeding with creating an answer session.
|
|
395
|
+
Read more at https://docs.orama.com/docs/orama-js/plugins/plugin-secure-proxy#plugin-secure-proxy
|
|
396
|
+
`,ANSWER_SESSION_LAST_MESSAGE_IS_NOT_ASSISTANT:`The last message in the session is not an assistant message. Cannot regenerate non-assistant messages.`,PLUGIN_COMPONENT_CONFLICT:`The component "%s" is already defined. The plugin "%s" is trying to redefine it.`};function f5(e,...t){let n=Error(sge(mge[e]??`Unsupported Orama Error code: ${e}`,...t));return n.code=e,`captureStackTrace`in Error.prototype&&Error.captureStackTrace(n),n}function hge(e){return{raw:Number(e),formatted:Q8(e)}}function gge(e){if(e.id){if(typeof e.id!=`string`)throw f5(`DOCUMENT_ID_MUST_BE_STRING`,typeof e.id);return e.id}return e5()}function p5(e,t){for(let[n,r]of Object.entries(t)){let t=e[n];if(t!==void 0&&(r!==`geopoint`||typeof t!=`object`||typeof t.lon!=`number`||typeof t.lat!=`number`)&&(r!==`enum`||typeof t!=`string`&&typeof t!=`number`)){if(r===`enum[]`&&Array.isArray(t)){let e=t.length;for(let r=0;r<e;r++)if(typeof t[r]!=`string`&&typeof t[r]!=`number`)return n+`.`+r;continue}if(m5(r)){let e=_5(r);if(!Array.isArray(t)||t.length!==e)throw f5(`INVALID_INPUT_VECTOR`,n,e,t.length);continue}if(h5(r)){if(!Array.isArray(t))return n;let e=g5(r),i=t.length;for(let r=0;r<i;r++)if(typeof t[r]!==e)return n+`.`+r;continue}if(typeof r==`object`){if(!t||typeof t!=`object`)return n;let e=p5(t,r);if(e)return n+`.`+e;continue}if(typeof t!==r)return n}}}const _ge={string:!1,number:!1,boolean:!1,enum:!1,geopoint:!1,"string[]":!0,"number[]":!0,"boolean[]":!0,"enum[]":!0},vge={"string[]":`string`,"number[]":`number`,"boolean[]":`boolean`,"enum[]":`enum`};function yge(e){return e===`geopoint`}function m5(e){return typeof e==`string`&&/^vector\[\d+\]$/.test(e)}function h5(e){return typeof e==`string`&&_ge[e]}function g5(e){return vge[e]}function _5(e){let t=Number(e.slice(7,-1));switch(!0){case isNaN(t):throw f5(`INVALID_VECTOR_VALUE`,e);case t<=0:throw f5(`INVALID_VECTOR_SIZE`,e);default:return t}}function bge(){return{idToInternalId:new Map,internalIdToId:[],save:xge,load:Sge}}function xge(e){return{internalIdToId:e.internalIdToId}}function Sge(e,t){let{internalIdToId:n}=t;e.internalDocumentIDStore.idToInternalId.clear(),e.internalDocumentIDStore.internalIdToId=[];let r=n.length;for(let t=0;t<r;t++){let r=n[t];e.internalDocumentIDStore.idToInternalId.set(r,t+1),e.internalDocumentIDStore.internalIdToId.push(r)}}function v5(e,t){if(typeof t==`string`){let n=e.idToInternalId.get(t);if(n)return n;let r=e.idToInternalId.size+1;return e.idToInternalId.set(t,r),e.internalIdToId.push(t),r}return t>e.internalIdToId.length?v5(e,t.toString()):t}function y5(e,t){if(e.internalIdToId.length<t)throw Error(`Invalid internalId ${t}`);return e.internalIdToId[t-1]}function Cge(e,t){return{sharedInternalDocumentStore:t,docs:{},count:0}}function wge(e,t){let n=v5(e.sharedInternalDocumentStore,t);return e.docs[n]}function Tge(e,t){let n=t.length,r=Array.from({length:n});for(let i=0;i<n;i++){let n=v5(e.sharedInternalDocumentStore,t[i]);r[i]=e.docs[n]}return r}function Ege(e){return e.docs}function Dge(e,t,n,r){return e.docs[n]===void 0&&(e.docs[n]=r,e.count++,!0)}function Oge(e,t){let n=v5(e.sharedInternalDocumentStore,t);return e.docs[n]!==void 0&&(delete e.docs[n],e.count--,!0)}function kge(e){return e.count}function Age(e,t){let n=t;return{docs:n.docs,count:n.count,sharedInternalDocumentStore:e}}function jge(e){return{docs:e.docs,count:e.count}}function Mge(){return{create:Cge,get:wge,getMultiple:Tge,getAll:Ege,store:Dge,remove:Oge,count:kge,load:Age,save:jge}}const Nge=[`beforeInsert`,`afterInsert`,`beforeRemove`,`afterRemove`,`beforeUpdate`,`afterUpdate`,`beforeUpsert`,`afterUpsert`,`beforeSearch`,`afterSearch`,`beforeInsertMultiple`,`afterInsertMultiple`,`beforeRemoveMultiple`,`afterRemoveMultiple`,`beforeUpdateMultiple`,`afterUpdateMultiple`,`beforeUpsertMultiple`,`afterUpsertMultiple`,`beforeLoad`,`afterLoad`,`afterCreate`];function Pge(e,t){let n=[],r=e.plugins?.length;if(!r)return n;for(let i=0;i<r;i++)try{let r=e.plugins[i];typeof r[t]==`function`&&n.push(r[t])}catch(e){throw console.error(`Caught error in getAllPluginsByHook:`,e),f5(`PLUGIN_CRASHED`)}return n}const Fge=[`tokenizer`,`index`,`documentsStore`,`sorter`,`pinning`],b5=[`validateSchema`,`getDocumentIndexId`,`getDocumentProperties`,`formatElapsedTime`];function x5(e,t,n,r){if(e.some(s5))return(async()=>{for(let i of e)await i(t,n,r)})();for(let i of e)i(t,n,r)}function S5(e,t,n){if(e.some(s5))return(async()=>{for(let r of e)await r(t,n)})();for(let r of e)r(t,n)}function C5(e,t,n,r,i){if(e.some(s5))return(async()=>{for(let a of e)await a(t,n,r,i)})();for(let a of e)a(t,n,r,i)}function w5(e,t,n,r){if(e.some(s5))return(async()=>{for(let i of e)await i(t,n,r)})();for(let i of e)i(t,n,r)}function Ige(e,t){if(e.some(s5))return(async()=>{for(let n of e)await n(t)})();for(let n of e)n(t)}var T5=class e{k;v;l=null;r=null;h=1;constructor(e,t){this.k=e,this.v=new Set(t)}updateHeight(){this.h=Math.max(e.getHeight(this.l),e.getHeight(this.r))+1}static getHeight(e){return e?e.h:0}getBalanceFactor(){return e.getHeight(this.l)-e.getHeight(this.r)}rotateLeft(){let e=this.r;return this.r=e.l,e.l=this,this.updateHeight(),e.updateHeight(),e}rotateRight(){let e=this.l;return this.l=e.r,e.r=this,this.updateHeight(),e.updateHeight(),e}toJSON(){return{k:this.k,v:Array.from(this.v),l:this.l?this.l.toJSON():null,r:this.r?this.r.toJSON():null,h:this.h}}static fromJSON(t){let n=new e(t.k,t.v);return n.l=t.l?e.fromJSON(t.l):null,n.r=t.r?e.fromJSON(t.r):null,n.h=t.h,n}},E5=class e{root=null;insertCount=0;constructor(e,t){e!==void 0&&t!==void 0&&(this.root=new T5(e,t))}insert(e,t,n=1e3){this.root=this.insertNode(this.root,e,t,n)}insertMultiple(e,t,n=1e3){for(let r of t)this.insert(e,r,n)}rebalance(){this.root&&=this.rebalanceNode(this.root)}toJSON(){return{root:this.root?this.root.toJSON():null,insertCount:this.insertCount}}static fromJSON(t){let n=new e;return n.root=t.root?T5.fromJSON(t.root):null,n.insertCount=t.insertCount||0,n}insertNode(e,t,n,r){if(e===null)return new T5(t,[n]);let i=[],a=e,o=null;for(;a!==null;)if(i.push({parent:o,node:a}),t<a.k){if(a.l===null){a.l=new T5(t,[n]),i.push({parent:a,node:a.l});break}o=a,a=a.l}else if(t>a.k){if(a.r===null){a.r=new T5(t,[n]),i.push({parent:a,node:a.r});break}o=a,a=a.r}else return a.v.add(n),e;let s=!1;this.insertCount++%r===0&&(s=!0);for(let t=i.length-1;t>=0;t--){let{parent:n,node:r}=i[t];if(r.updateHeight(),s){let t=this.rebalanceNode(r);n?n.l===r?n.l=t:n.r===r&&(n.r=t):e=t}}return e}rebalanceNode(e){let t=e.getBalanceFactor();if(t>1){if(e.l&&e.l.getBalanceFactor()>=0)return e.rotateRight();if(e.l)return e.l=e.l.rotateLeft(),e.rotateRight()}if(t<-1){if(e.r&&e.r.getBalanceFactor()<=0)return e.rotateLeft();if(e.r)return e.r=e.r.rotateRight(),e.rotateLeft()}return e}find(e){let t=this.findNodeByKey(e);return t?t.v:null}contains(e){return this.find(e)!==null}getSize(){let e=0,t=[],n=this.root;for(;n||t.length>0;){for(;n;)t.push(n),n=n.l;n=t.pop(),e++,n=n.r}return e}isBalanced(){if(!this.root)return!0;let e=[this.root];for(;e.length>0;){let t=e.pop(),n=t.getBalanceFactor();if(Math.abs(n)>1)return!1;t.l&&e.push(t.l),t.r&&e.push(t.r)}return!0}remove(e){this.root=this.removeNode(this.root,e)}removeDocument(e,t){let n=this.findNodeByKey(e);n&&(n.v.size===1?this.root=this.removeNode(this.root,e):n.v=new Set([...n.v.values()].filter(e=>e!==t)))}findNodeByKey(e){let t=this.root;for(;t;)if(e<t.k)t=t.l;else if(e>t.k)t=t.r;else return t;return null}removeNode(e,t){if(e===null)return null;let n=[],r=e;for(;r!==null&&r.k!==t;)n.push(r),r=t<r.k?r.l:r.r;if(r===null)return e;if(r.l===null||r.r===null){let t=r.l?r.l:r.r;if(n.length===0)e=t;else{let e=n[n.length-1];e.l===r?e.l=t:e.r=t}}else{let e=r,t=r.r;for(;t.l!==null;)e=t,t=t.l;r.k=t.k,r.v=t.v,e.l===t?e.l=t.r:e.r=t.r,r=e}n.push(r);for(let t=n.length-1;t>=0;t--){let r=n[t];r.updateHeight();let i=this.rebalanceNode(r);if(t>0){let e=n[t-1];e.l===r?e.l=i:e.r===r&&(e.r=i)}else e=i}return e}rangeSearch(e,t){let n=new Set,r=[],i=this.root;for(;i||r.length>0;){for(;i;)r.push(i),i=i.l;if(i=r.pop(),i.k>=e&&i.k<=t)for(let e of i.v)n.add(e);if(i.k>t)break;i=i.r}return n}greaterThan(e,t=!1){let n=new Set,r=[],i=this.root;for(;i||r.length>0;){for(;i;)r.push(i),i=i.r;if(i=r.pop(),t&&i.k>=e||!t&&i.k>e)for(let e of i.v)n.add(e);else if(i.k<=e)break;i=i.l}return n}lessThan(e,t=!1){let n=new Set,r=[],i=this.root;for(;i||r.length>0;){for(;i;)r.push(i),i=i.l;if(i=r.pop(),t&&i.k<=e||!t&&i.k<e)for(let e of i.v)n.add(e);else if(i.k>e)break;i=i.r}return n}},D5=class e{numberToDocumentId;constructor(){this.numberToDocumentId=new Map}insert(e,t){this.numberToDocumentId.has(e)?this.numberToDocumentId.get(e).add(t):this.numberToDocumentId.set(e,new Set([t]))}find(e){let t=this.numberToDocumentId.get(e);return t?Array.from(t):null}remove(e){this.numberToDocumentId.delete(e)}removeDocument(e,t){let n=this.numberToDocumentId.get(t);n&&(n.delete(e),n.size===0&&this.numberToDocumentId.delete(t))}contains(e){return this.numberToDocumentId.has(e)}getSize(){let e=0;for(let t of this.numberToDocumentId.values())e+=t.size;return e}filter(e){let t=Object.keys(e);if(t.length!==1)throw Error(`Invalid operation`);let n=t[0];switch(n){case`eq`:{let t=e[n],r=this.numberToDocumentId.get(t);return r?Array.from(r):[]}case`in`:{let t=e[n],r=new Set;for(let e of t){let t=this.numberToDocumentId.get(e);if(t)for(let e of t)r.add(e)}return Array.from(r)}case`nin`:{let t=new Set(e[n]),r=new Set;for(let[e,n]of this.numberToDocumentId.entries())if(!t.has(e))for(let e of n)r.add(e);return Array.from(r)}default:throw Error(`Invalid operation`)}}filterArr(e){let t=Object.keys(e);if(t.length!==1)throw Error(`Invalid operation`);let n=t[0];switch(n){case`containsAll`:{let t=e[n].map(e=>this.numberToDocumentId.get(e)??new Set);if(t.length===0)return[];let r=t.reduce((e,t)=>new Set([...e].filter(e=>t.has(e))));return Array.from(r)}case`containsAny`:{let t=e[n].map(e=>this.numberToDocumentId.get(e)??new Set);if(t.length===0)return[];let r=t.reduce((e,t)=>new Set([...e,...t]));return Array.from(r)}default:throw Error(`Invalid operation`)}}static fromJSON(t){if(!t.numberToDocumentId)throw Error(`Invalid Flat Tree JSON`);let n=new e;for(let[e,r]of t.numberToDocumentId)n.numberToDocumentId.set(e,new Set(r));return n}toJSON(){return{numberToDocumentId:Array.from(this.numberToDocumentId.entries()).map(([e,t])=>[e,Array.from(t)])}}};function Lge(e,t,n){if(n<0)return-1;if(e===t)return 0;let r=e.length,i=t.length;if(r===0)return i<=n?i:-1;if(i===0)return r<=n?r:-1;let a=Math.abs(r-i);if(e.startsWith(t))return a<=n?a:-1;if(t.startsWith(e))return 0;if(a>n)return-1;let o=[];for(let e=0;e<=r;e++){o[e]=[e];for(let t=1;t<=i;t++)o[e][t]=e===0?t:0}for(let a=1;a<=r;a++){let r=1/0;for(let n=1;n<=i;n++)e[a-1]===t[n-1]?o[a][n]=o[a-1][n-1]:o[a][n]=Math.min(o[a-1][n]+1,o[a][n-1]+1,o[a-1][n-1]+1),r=Math.min(r,o[a][n]);if(r>n)return-1}return o[r][i]<=n?o[r][i]:-1}function O5(e,t,n){let r=Lge(e,t,n);return{distance:r,isBounded:r>=0}}var k5=class e{k;s;c=new Map;d=new Set;e;w=``;constructor(e,t,n){this.k=e,this.s=t,this.e=n}updateParent(e){this.w=e.w+this.s}addDocument(e){this.d.add(e)}removeDocument(e){return this.d.delete(e)}findAllWords(e,t,n,r){let i=[this];for(;i.length>0;){let a=i.pop();if(a.e){let{w:i,d:o}=a;if(n&&i!==t)continue;if(t5(e,i)!==null){if(r){if(Math.abs(t.length-i.length)<=r&&O5(t,i,r).isBounded)e[i]=[];else continue}else e[i]=[]}if(t5(e,i)!=null&&o.size>0){let t=e[i];for(let e of o)t.includes(e)||t.push(e)}}a.c.size>0&&i.push(...a.c.values())}return e}insert(t,n){let r=this,i=0,a=t.length;for(;i<a;){let o=t[i],s=r.c.get(o);if(s){let o=s.s,c=o.length,l=0;for(;l<c&&i+l<a&&o[l]===t[i+l];)l++;if(l===c){if(r=s,i+=l,i===a){s.e||=!0,s.addDocument(n);return}continue}let u=o.slice(0,l),d=o.slice(l),f=t.slice(i+l),p=new e(u[0],u,!1);if(r.c.set(u[0],p),p.updateParent(r),s.s=d,s.k=d[0],p.c.set(d[0],s),s.updateParent(p),f){let t=new e(f[0],f,!0);t.addDocument(n),p.c.set(f[0],t),t.updateParent(p)}else p.e=!0,p.addDocument(n);return}{let a=new e(o,t.slice(i),!0);a.addDocument(n),r.c.set(o,a),a.updateParent(r);return}}r.e||(r.e=!0),r.addDocument(n)}_findLevenshtein(e,t,n,r,i){let a=[{node:this,index:t,tolerance:n}];for(;a.length>0;){let{node:t,index:n,tolerance:o}=a.pop();if(t.w.startsWith(e)){t.findAllWords(i,e,!1,0);continue}if(o<0)continue;if(t.e){let{w:n,d:a}=t;if(n&&(O5(e,n,r).isBounded&&(i[n]=[]),t5(i,n)!==void 0&&a.size>0)){let e=new Set(i[n]);for(let t of a)e.add(t);i[n]=Array.from(e)}}if(n>=e.length)continue;let s=e[n];if(t.c.has(s)){let e=t.c.get(s);a.push({node:e,index:n+1,tolerance:o})}a.push({node:t,index:n+1,tolerance:o-1});for(let[e,r]of t.c)a.push({node:r,index:n,tolerance:o-1}),e!==s&&a.push({node:r,index:n+1,tolerance:o-1})}}find(e){let{term:t,exact:n,tolerance:r}=e;if(r&&!n){let e={};return this._findLevenshtein(t,0,r,r,e),e}{let e=this,i=0,a=t.length;for(;i<a;){let o=t[i],s=e.c.get(o);if(s){let o=s.s,c=o.length,l=0;for(;l<c&&i+l<a&&o[l]===t[i+l];)l++;if(l===c)e=s,i+=l;else if(i+l===a){if(l===a-i){if(n)return{};{let e={};return s.findAllWords(e,t,n,r),e}}return{}}else return{}}else return{}}let o={};return e.findAllWords(o,t,n,r),o}}contains(e){let t=this,n=0,r=e.length;for(;n<r;){let i=e[n],a=t.c.get(i);if(a){let i=a.s,o=i.length,s=0;for(;s<o&&n+s<r&&i[s]===e[n+s];)s++;if(s<o)return!1;n+=o,t=a}else return!1}return!0}removeWord(e){if(!e)return!1;let t=this,n=e.length,r=[];for(let i=0;i<n;i++){let n=e[i];if(t.c.has(n)){let e=t.c.get(n);r.push({parent:t,character:n}),i+=e.s.length-1,t=e}else return!1}for(t.d.clear(),t.e=!1;r.length>0&&t.c.size===0&&!t.e&&t.d.size===0;){let{parent:e,character:n}=r.pop();e.c.delete(n),t=e}return!0}removeDocumentByWord(e,t,n=!0){if(!e)return!0;let r=this,i=e.length;for(let a=0;a<i;a++){let i=e[a];if(r.c.has(i)){let o=r.c.get(i);a+=o.s.length-1,r=o,n&&r.w!==e||r.removeDocument(t)}else return!1}return!0}static getCommonPrefix(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e.charCodeAt(r)===t.charCodeAt(r);)r++;return e.slice(0,r)}toJSON(){return{w:this.w,s:this.s,e:this.e,k:this.k,d:Array.from(this.d),c:Array.from(this.c?.entries())?.map(([e,t])=>[e,t.toJSON()])}}static fromJSON(t){let n=new e(t.k,t.s,t.e);return n.w=t.w,n.d=new Set(t.d),n.c=new Map(t?.c?.map(([t,n])=>[t,e.fromJSON(n)])||[]),n}},A5=class e extends k5{constructor(){super(``,``,!1)}static fromJSON(t){let n=new e;return n.w=t.w,n.s=t.s,n.e=t.e,n.k=t.k,n.d=new Set(t.d),n.c=new Map(t?.c?.map(([e,t])=>[e,k5.fromJSON(t)])||[]),n}toJSON(){return super.toJSON()}},j5=class e{point;docIDs;left;right;parent;constructor(e,t){this.point=e,this.docIDs=new Set(t),this.left=null,this.right=null,this.parent=null}toJSON(){return{point:this.point,docIDs:Array.from(this.docIDs),left:this.left?this.left.toJSON():null,right:this.right?this.right.toJSON():null}}static fromJSON(t,n=null){let r=new e(t.point,t.docIDs);return r.parent=n,t.left&&(r.left=e.fromJSON(t.left,r)),t.right&&(r.right=e.fromJSON(t.right,r)),r}},M5=class e{root;nodeMap;constructor(){this.root=null,this.nodeMap=new Map}getPointKey(e){return`${e.lon},${e.lat}`}insert(e,t){let n=this.getPointKey(e),r=this.nodeMap.get(n);if(r){t.forEach(e=>r.docIDs.add(e));return}let i=new j5(e,t);if(this.nodeMap.set(n,i),this.root==null){this.root=i;return}let a=this.root,o=0;for(;;){if(o%2==0){if(e.lon<a.point.lon){if(a.left==null){a.left=i,i.parent=a;return}a=a.left}else{if(a.right==null){a.right=i,i.parent=a;return}a=a.right}}else if(e.lat<a.point.lat){if(a.left==null){a.left=i,i.parent=a;return}a=a.left}else{if(a.right==null){a.right=i,i.parent=a;return}a=a.right}o++}}contains(e){let t=this.getPointKey(e);return this.nodeMap.has(t)}getDocIDsByCoordinates(e){let t=this.getPointKey(e),n=this.nodeMap.get(t);return n?Array.from(n.docIDs):null}removeDocByID(e,t){let n=this.getPointKey(e),r=this.nodeMap.get(n);r&&(r.docIDs.delete(t),r.docIDs.size===0&&(this.nodeMap.delete(n),this.deleteNode(r)))}deleteNode(e){let t=e.parent,n=e.left?e.left:e.right;n&&(n.parent=t),t?t.left===e?t.left=n:t.right===e&&(t.right=n):(this.root=n,this.root&&(this.root.parent=null))}searchByRadius(t,n,r=!0,i=`asc`,a=!1){let o=a?e.vincentyDistance:e.haversineDistance,s=[{node:this.root,depth:0}],c=[];for(;s.length>0;){let{node:e,depth:i}=s.pop();if(e==null)continue;let a=o(t,e.point);(r?a<=n:a>n)&&c.push({point:e.point,docIDs:Array.from(e.docIDs)}),e.left!=null&&s.push({node:e.left,depth:i+1}),e.right!=null&&s.push({node:e.right,depth:i+1})}return i&&c.sort((e,n)=>{let r=o(t,e.point),a=o(t,n.point);return i.toLowerCase()===`asc`?r-a:a-r}),c}searchByPolygon(t,n=!0,r=null,i=!1){let a=[{node:this.root,depth:0}],o=[];for(;a.length>0;){let{node:r,depth:i}=a.pop();if(r==null)continue;r.left!=null&&a.push({node:r.left,depth:i+1}),r.right!=null&&a.push({node:r.right,depth:i+1});let s=e.isPointInPolygon(t,r.point);(s&&n||!s&&!n)&&o.push({point:r.point,docIDs:Array.from(r.docIDs)})}let s=e.calculatePolygonCentroid(t);if(r){let t=i?e.vincentyDistance:e.haversineDistance;o.sort((e,n)=>{let i=t(s,e.point),a=t(s,n.point);return r.toLowerCase()===`asc`?i-a:a-i})}return o}toJSON(){return{root:this.root?this.root.toJSON():null}}static fromJSON(t){let n=new e;return t.root&&(n.root=j5.fromJSON(t.root),n.buildNodeMap(n.root)),n}buildNodeMap(e){if(e==null)return;let t=this.getPointKey(e.point);this.nodeMap.set(t,e),e.left&&this.buildNodeMap(e.left),e.right&&this.buildNodeMap(e.right)}static calculatePolygonCentroid(e){let t=0,n=0,r=0,i=e.length;for(let a=0,o=i-1;a<i;o=a++){let i=e[a].lon,s=e[a].lat,c=e[o].lon,l=e[o].lat,u=i*l-c*s;t+=u,n+=(i+c)*u,r+=(s+l)*u}t/=2;let a=6*t;return n/=a,r/=a,{lon:n,lat:r}}static isPointInPolygon(e,t){let n=!1,r=t.lon,i=t.lat,a=e.length;for(let t=0,o=a-1;t<a;o=t++){let a=e[t].lon,s=e[t].lat,c=e[o].lon,l=e[o].lat;s>i!=l>i&&r<(c-a)*(i-s)/(l-s)+a&&(n=!n)}return n}static haversineDistance(e,t){let n=Math.PI/180,r=e.lat*n,i=t.lat*n,a=(t.lat-e.lat)*n,o=(t.lon-e.lon)*n,s=Math.sin(a/2)*Math.sin(a/2)+Math.cos(r)*Math.cos(i)*Math.sin(o/2)*Math.sin(o/2);return 6371e3*(2*Math.atan2(Math.sqrt(s),Math.sqrt(1-s)))}static vincentyDistance(e,t){let n=6378137,r=1/298.257223563,i=.9966471893352525*n,a=Math.PI/180,o=e.lat*a,s=t.lat*a,c=(t.lon-e.lon)*a,l=Math.atan(.9966471893352525*Math.tan(o)),u=Math.atan(.9966471893352525*Math.tan(s)),d=Math.sin(l),f=Math.cos(l),p=Math.sin(u),m=Math.cos(u),h=c,g,_=1e3,v,y,b,x,S,C;do{let e=Math.sin(h),t=Math.cos(h);if(v=Math.sqrt(m*e*(m*e)+(f*p-d*m*t)*(f*p-d*m*t)),v===0)return 0;y=d*p+f*m*t,b=Math.atan2(v,y),x=f*m*e/v,S=1-x*x,C=y-2*d*p/S,isNaN(C)&&(C=0);let n=r/16*S*(4+r*(4-3*S));g=h,h=c+(1-n)*r*x*(b+n*v*(C+n*y*(-1+2*C*C)))}while(Math.abs(h-g)>1e-12&&--_>0);if(_===0)return NaN;let w=S*(n*n-i*i)/(i*i),T=1+w/16384*(4096+w*(-768+w*(320-175*w))),ee=w/1024*(256+w*(-128+w*(74-47*w))),te=ee*v*(C+ee/4*(y*(-1+2*C*C)-ee/6*C*(-3+4*v*v)*(-3+4*C*C)));return i*T*(b-te)}},N5=class e{true;false;constructor(){this.true=new Set,this.false=new Set}insert(e,t){t?this.true.add(e):this.false.add(e)}delete(e,t){t?this.true.delete(e):this.false.delete(e)}getSize(){return this.true.size+this.false.size}toJSON(){return{true:Array.from(this.true),false:Array.from(this.false)}}static fromJSON(t){let n=new e;return n.true=new Set(t.true),n.false=new Set(t.false),n}};function Rge(e,t,n,r,i,{k:a,b:o,d:s}){return Math.log(1+(n-t+.5)/(t+.5))*(s+e*(a+1))/(e+a*(1-o+o*r/i))}var P5=class e{size;vectors=new Map;constructor(e){this.size=e}add(e,t){t instanceof Float32Array||(t=new Float32Array(t));let n=F5(t,this.size);this.vectors.set(e,[n,t])}remove(e){this.vectors.delete(e)}find(e,t,n){return e instanceof Float32Array||(e=new Float32Array(e)),zge(e,n,this.vectors,this.size,t)}toJSON(){let e=[];for(let[t,[n,r]]of this.vectors)e.push([t,[n,Array.from(r)]]);return{size:this.size,vectors:e}}static fromJSON(t){let n=t,r=new e(n.size);for(let[e,[t,i]]of n.vectors)r.vectors.set(e,[t,new Float32Array(i)]);return r}};function F5(e,t){let n=0;for(let r=0;r<t;r++)n+=e[r]*e[r];return Math.sqrt(n)}function zge(e,t,n,r,i){let a=F5(e,r),o=[],s=t||n.keys();for(let t of s){let s=n.get(t);if(!s)continue;let c=s[0],l=s[1],u=0;for(let t=0;t<r;t++)u+=e[t]*l[t];let d=u/(a*c);d>=i&&o.push([t,d])}return o}function Bge(e,t,n,r,i){let a=v5(e.sharedInternalDocumentStore,n);e.avgFieldLength[t]=((e.avgFieldLength[t]??0)*(i-1)+r.length)/i,e.fieldLengths[t][a]=r.length,e.frequencies[t][a]={}}function Vge(e,t,n,r,i){let a=0;for(let e of r)e===i&&a++;let o=v5(e.sharedInternalDocumentStore,n),s=a/r.length;e.frequencies[t][o][i]=s,i in e.tokenOccurrences[t]||(e.tokenOccurrences[t][i]=0),e.tokenOccurrences[t][i]=(e.tokenOccurrences[t][i]??0)+1}function Hge(e,t,n,r){let i=v5(e.sharedInternalDocumentStore,n);r>1?e.avgFieldLength[t]=(e.avgFieldLength[t]*r-e.fieldLengths[t][i])/(r-1):e.avgFieldLength[t]=void 0,e.fieldLengths[t][i]=void 0,e.frequencies[t][i]=void 0}function Uge(e,t,n){e.tokenOccurrences[t][n]--}function I5(e,t,n,r,i=``){r||={sharedInternalDocumentStore:t,indexes:{},vectorIndexes:{},searchableProperties:[],searchablePropertiesWithTypes:{},frequencies:{},tokenOccurrences:{},avgFieldLength:{},fieldLengths:{}};for(let[a,o]of Object.entries(n)){let n=`${i}${i?`.`:``}${a}`;if(typeof o==`object`&&!Array.isArray(o)){I5(e,t,o,r,n);continue}if(m5(o))r.searchableProperties.push(n),r.searchablePropertiesWithTypes[n]=o,r.vectorIndexes[n]={type:`Vector`,node:new P5(_5(o)),isArray:!1};else{let e=/\[/.test(o);switch(o){case`boolean`:case`boolean[]`:r.indexes[n]={type:`Bool`,node:new N5,isArray:e};break;case`number`:case`number[]`:r.indexes[n]={type:`AVL`,node:new E5(0,[]),isArray:e};break;case`string`:case`string[]`:r.indexes[n]={type:`Radix`,node:new A5,isArray:e},r.avgFieldLength[n]=0,r.frequencies[n]={},r.tokenOccurrences[n]={},r.fieldLengths[n]={};break;case`enum`:case`enum[]`:r.indexes[n]={type:`Flat`,node:new D5,isArray:e};break;case`geopoint`:r.indexes[n]={type:`BKD`,node:new M5,isArray:e};break;default:throw f5(`INVALID_SCHEMA_TYPE`,Array.isArray(o)?`array`:o,n)}r.searchableProperties.push(n),r.searchablePropertiesWithTypes[n]=o}}return r}function Wge(e,t,n,r,i,a,o,s){return c=>{let{type:l,node:u}=t.indexes[n];switch(l){case`Bool`:u[c?`true`:`false`].add(r);break;case`AVL`:{let e=s?.avlRebalanceThreshold??1;u.insert(c,r,e);break}case`Radix`:{let s=a.tokenize(c,i,n,!1);e.insertDocumentScoreParameters(t,n,r,s,o);for(let i of s)e.insertTokenScoreParameters(t,n,r,s,i),u.insert(i,r);break}case`Flat`:u.insert(c,r);break;case`BKD`:u.insert(c,[r])}}}function Gge(e,t,n,r,i,a,o,s,c,l,u){if(m5(o))return Kge(t,n,a,r,i);let d=Wge(e,t,n,i,s,c,l,u);if(!h5(o))return d(a);let f=a,p=f.length;for(let e=0;e<p;e++)d(f[e])}function Kge(e,t,n,r,i){e.vectorIndexes[t].node.add(i,n)}function L5(e,t,n,r,i,a,o,s,c,l){if(m5(o))return t.vectorIndexes[n].node.remove(i),!0;let{type:u,node:d}=t.indexes[n];switch(u){case`AVL`:return d.removeDocument(a,i),!0;case`Bool`:return d[a?`true`:`false`].delete(i),!0;case`Radix`:{let o=c.tokenize(a,s,n);e.removeDocumentScoreParameters(t,n,r,l);for(let r of o)e.removeTokenScoreParameters(t,n,r),d.removeDocumentByWord(r,i);return!0}case`Flat`:return d.removeDocument(i,a),!0;case`BKD`:return d.removeDocByID(a,i),!1}}function qge(e,t,n,r,i,a,o,s,c,l){if(!h5(o))return L5(e,t,n,r,i,a,o,s,c,l);let u=g5(o),d=a,f=d.length;for(let a=0;a<f;a++)L5(e,t,n,r,i,d[a],u,s,c,l);return!0}function R5(e,t,n,r,i,a,o,s,c,l){let u=Array.from(r),d=e.avgFieldLength[t],f=e.fieldLengths[t],p=e.tokenOccurrences[t],m=e.frequencies[t],h=typeof p[n]==`number`?p[n]??0:0,g=u.length;for(let e=0;e<g;e++){let r=u[e];if(c&&!c.has(r))continue;l.has(r)||l.set(r,new Map);let p=l.get(r);p.set(t,(p.get(t)||0)+1);let g=Rge(m?.[r]?.[n]??0,h,i,f[r],d,a);o.has(r)?o.set(r,o.get(r)+g*s):o.set(r,g*s)}}function Jge(e,t,n,r,i,a,o,s,c,l,u,d=0){let f=n.tokenize(t,r),p=f.length||1,m=new Map,h=new Map,g=new Map;for(let n of i){if(!(n in e.indexes))continue;let r=e.indexes[n],{type:i}=r;if(i!==`Radix`)throw f5(`WRONG_SEARCH_PROPERTY_TYPE`,n);let d=s[n]??1;if(d<=0)throw f5(`INVALID_BOOST_VALUE`,d);f.length===0&&!t&&f.push(``);let p=f.length;for(let t=0;t<p;t++){let i=f[t],s=r.node.find({term:i,exact:a,tolerance:o}),p=Object.keys(s);p.length>0&&h.set(i,!0);let _=p.length;for(let t=0;t<_;t++){let r=p[t],i=s[r];R5(e,n,r,i,l,c,g,d,u,m)}}}let _=Array.from(g.entries()).map(([e,t])=>[e,t]).sort((e,t)=>t[1]-e[1]);if(_.length===0)return[];if(d===1)return _;if(d===0){if(p===1)return _;for(let e of f)if(!h.get(e))return[];return _.filter(([e])=>{let t=m.get(e);return t?Array.from(t.values()).some(e=>e===p):!1})}let v=_.filter(([e])=>{let t=m.get(e);return t?Array.from(t.values()).some(e=>e===p):!1});if(v.length>0){let e=_.filter(([e])=>!v.some(([t])=>t===e)),t=Math.ceil(e.length*d);return[...v,...e.slice(0,t)]}return _}function z5(e,t,n,r){if(`and`in n&&n.and&&Array.isArray(n.and)){let i=n.and;return i.length===0?new Set:l5(...i.map(n=>z5(e,t,n,r)))}if(`or`in n&&n.or&&Array.isArray(n.or)){let i=n.or;return i.length===0?new Set:i.map(n=>z5(e,t,n,r)).reduce((e,t)=>u5(e,t),new Set)}if(`not`in n&&n.not){let i=n.not,a=new Set,o=e.sharedInternalDocumentStore;for(let e=1;e<=o.internalIdToId.length;e++)a.add(e);return pge(a,z5(e,t,i,r))}let i=Object.keys(n),a=i.reduce((e,t)=>({[t]:new Set,...e}),{});for(let o of i){let i=n[o];if(e.indexes[o]===void 0)throw f5(`UNKNOWN_FILTER_PROPERTY`,o);let{node:s,type:c,isArray:l}=e.indexes[o];if(c===`Bool`){let e=s,t=i?e.true:e.false;a[o]=u5(a[o],t);continue}if(c===`BKD`){let e;if(`radius`in i)e=`radius`;else if(`polygon`in i)e=`polygon`;else throw Error(`Invalid operation ${i}`);if(e===`radius`){let{value:t,coordinates:n,unit:r=`m`,inside:c=!0,highPrecision:l=!1}=i[e],u=a5(t,r),d=s.searchByRadius(n,u,c,void 0,l);a[o]=B5(a[o],d)}else{let{coordinates:t,inside:n=!0,highPrecision:r=!1}=i[e],c=s.searchByPolygon(t,n,void 0,r);a[o]=B5(a[o],c)}continue}if(c===`Radix`&&(typeof i==`string`||Array.isArray(i))){for(let e of[i].flat()){let n=t.tokenize(e,r,o);for(let e of n){let t=s.find({term:e,exact:!0});a[o]=n_e(a[o],t)}}continue}let u=Object.keys(i);if(u.length>1)throw f5(`INVALID_FILTER_OPERATION`,u.length);if(c===`Flat`){let e=new Set(l?s.filterArr(i):s.filter(i));a[o]=u5(a[o],e);continue}if(c===`AVL`){let e=u[0],t=i[e],n;switch(e){case`gt`:n=s.greaterThan(t,!1);break;case`gte`:n=s.greaterThan(t,!0);break;case`lt`:n=s.lessThan(t,!1);break;case`lte`:n=s.lessThan(t,!0);break;case`eq`:n=s.find(t)??new Set;break;case`between`:{let[e,r]=t;n=s.rangeSearch(e,r);break}default:throw f5(`INVALID_FILTER_OPERATION`,e)}a[o]=u5(a[o],n)}}return l5(...Object.values(a))}function Yge(e){return e.searchableProperties}function Xge(e){return e.searchablePropertiesWithTypes}function Zge(e,t){let{indexes:n,vectorIndexes:r,searchableProperties:i,searchablePropertiesWithTypes:a,frequencies:o,tokenOccurrences:s,avgFieldLength:c,fieldLengths:l}=t,u={},d={};for(let e of Object.keys(n)){let{node:t,type:r,isArray:i}=n[e];switch(r){case`Radix`:u[e]={type:`Radix`,node:A5.fromJSON(t),isArray:i};break;case`Flat`:u[e]={type:`Flat`,node:D5.fromJSON(t),isArray:i};break;case`AVL`:u[e]={type:`AVL`,node:E5.fromJSON(t),isArray:i};break;case`BKD`:u[e]={type:`BKD`,node:M5.fromJSON(t),isArray:i};break;case`Bool`:u[e]={type:`Bool`,node:N5.fromJSON(t),isArray:i};break;default:u[e]=n[e]}}for(let e of Object.keys(r))d[e]={type:`Vector`,isArray:!1,node:P5.fromJSON(r[e])};return{sharedInternalDocumentStore:e,indexes:u,vectorIndexes:d,searchableProperties:i,searchablePropertiesWithTypes:a,frequencies:o,tokenOccurrences:s,avgFieldLength:c,fieldLengths:l}}function Qge(e){let{indexes:t,vectorIndexes:n,searchableProperties:r,searchablePropertiesWithTypes:i,frequencies:a,tokenOccurrences:o,avgFieldLength:s,fieldLengths:c}=e,l={};for(let e of Object.keys(n))l[e]=n[e].node.toJSON();let u={};for(let e of Object.keys(t)){let{type:n,node:r,isArray:i}=t[e];n===`Flat`||n===`Radix`||n===`AVL`||n===`BKD`||n===`Bool`?u[e]={type:n,node:r.toJSON(),isArray:i}:(u[e]=t[e],u[e].node=u[e].node.toJSON())}return{indexes:u,vectorIndexes:l,searchableProperties:r,searchablePropertiesWithTypes:i,frequencies:a,tokenOccurrences:o,avgFieldLength:s,fieldLengths:c}}function $ge(){return{create:I5,insert:Gge,remove:qge,insertDocumentScoreParameters:Bge,insertTokenScoreParameters:Vge,removeDocumentScoreParameters:Hge,removeTokenScoreParameters:Uge,calculateResultScores:R5,search:Jge,searchByWhereClause:z5,getSearchableProperties:Yge,getSearchablePropertiesWithTypes:Xge,load:Zge,save:Qge}}function B5(e,t){e||=new Set;let n=t.length;for(let r=0;r<n;r++){let n=t[r].docIDs,i=n.length;for(let t=0;t<i;t++)e.add(n[t])}return e}function V5(e,t,n=!1){let r=n?M5.vincentyDistance:M5.haversineDistance,i=[],a=[];for(let{point:n}of e)a.push(r(t,n));let o=Math.max(...a),s=0;for(let{docIDs:t}of e){let e=o-a[s]+1;for(let n of t)i.push([n,e]);s++}return i.sort((e,t)=>t[1]-e[1]),i}function e_e(e,t){let n=Object.keys(e);if(n.length!==1)return{isGeoOnly:!1};let r=n[0],i=e[r];if(t.indexes[r]===void 0)return{isGeoOnly:!1};let{type:a}=t.indexes[r];return a===`BKD`&&i&&(`radius`in i||`polygon`in i)?{isGeoOnly:!0,geoProperty:r,geoOperation:i}:{isGeoOnly:!1}}function t_e(e,t){let n=e,r=e_e(t,n);if(!r.isGeoOnly||!r.geoProperty||!r.geoOperation)return null;let{node:i}=n.indexes[r.geoProperty],a=r.geoOperation,o=i,s;if(`radius`in a){let{value:e,coordinates:t,unit:n=`m`,inside:r=!0,highPrecision:i=!1}=a.radius,c=t,l=a5(e,n);return s=o.searchByRadius(c,l,r,`asc`,i),V5(s,c,i)}if(`polygon`in a){let{coordinates:e,inside:t=!0,highPrecision:n=!1}=a.polygon;s=o.searchByPolygon(e,t,`asc`,n);let r=M5.calculatePolygonCentroid(e);return V5(s,r,n)}return null}function n_e(e,t){e||=new Set;let n=Object.keys(t),r=n.length;for(let i=0;i<r;i++){let r=t[n[i]],a=r.length;for(let t=0;t<a;t++)e.add(r[t])}return e}function H5(e,t,n,r,i){let a={language:e.tokenizer.language,sharedInternalDocumentStore:t,enabled:!0,isSorted:!0,sortableProperties:[],sortablePropertiesWithTypes:{},sorts:{}};for(let[o,s]of Object.entries(n)){let n=`${i}${i?`.`:``}${o}`;if(!r.includes(n)){if(typeof s==`object`&&!Array.isArray(s)){let i=H5(e,t,s,r,n);X8(a.sortableProperties,i.sortableProperties),a.sorts={...a.sorts,...i.sorts},a.sortablePropertiesWithTypes={...a.sortablePropertiesWithTypes,...i.sortablePropertiesWithTypes};continue}if(!m5(s))switch(s){case`boolean`:case`number`:case`string`:a.sortableProperties.push(n),a.sortablePropertiesWithTypes[n]=s,a.sorts[n]={docs:new Map,orderedDocsToRemove:new Map,orderedDocs:[],type:s};break;case`geopoint`:case`enum`:continue;case`enum[]`:case`boolean[]`:case`number[]`:case`string[]`:continue;default:throw f5(`INVALID_SORT_SCHEMA_TYPE`,Array.isArray(s)?`array`:s,n)}}}return a}function r_e(e,t,n,r){return r?.enabled===!1?{disabled:!0}:H5(e,t,n,(r||{}).unsortableProperties||[],``)}function i_e(e,t,n,r){if(!e.enabled)return;e.isSorted=!1;let i=v5(e.sharedInternalDocumentStore,n),a=e.sorts[t];a.orderedDocsToRemove.has(i)&&W5(e,t),a.docs.set(i,a.orderedDocs.length),a.orderedDocs.push([i,r])}function U5(e){if(e.isSorted||!e.enabled)return;let t=Object.keys(e.sorts);for(let n of t)c_e(e,n);e.isSorted=!0}function a_e(e,t,n){return t[1].localeCompare(n[1],ige(e))}function o_e(e,t){return e[1]-t[1]}function s_e(e,t){return t[1]?-1:1}function c_e(e,t){let n=e.sorts[t],r;switch(n.type){case`string`:r=a_e.bind(null,e.language);break;case`number`:r=o_e.bind(null);break;case`boolean`:r=s_e.bind(null)}n.orderedDocs.sort(r);let i=n.orderedDocs.length;for(let e=0;e<i;e++){let t=n.orderedDocs[e][0];n.docs.set(t,e)}}function l_e(e){let t=Object.keys(e.sorts);for(let n of t)W5(e,n)}function W5(e,t){let n=e.sorts[t];n.orderedDocsToRemove.size&&(n.orderedDocs=n.orderedDocs.filter(e=>!n.orderedDocsToRemove.has(e[0])),n.orderedDocsToRemove.clear())}function u_e(e,t,n){if(!e.enabled)return;let r=e.sorts[t],i=v5(e.sharedInternalDocumentStore,n);r.docs.get(i)&&(r.docs.delete(i),r.orderedDocsToRemove.set(i,!0))}function d_e(e,t,n){if(!e.enabled)throw f5(`SORT_DISABLED`);let r=n.property,i=n.order===`DESC`,a=e.sorts[r];if(!a)throw f5(`UNABLE_TO_SORT_ON_UNKNOWN_FIELD`,r,e.sortableProperties.join(`, `));return W5(e,r),U5(e),t.sort((t,n)=>{let r=a.docs.get(v5(e.sharedInternalDocumentStore,t[0])),o=a.docs.get(v5(e.sharedInternalDocumentStore,n[0])),s=r!==void 0,c=o!==void 0;return!s&&!c?0:s?c?i?o-r:r-o:-1:1}),t}function f_e(e){return e.enabled?e.sortableProperties:[]}function p_e(e){return e.enabled?e.sortablePropertiesWithTypes:{}}function m_e(e,t){let n=t;if(!n.enabled)return{enabled:!1};let r=Object.keys(n.sorts).reduce((e,t)=>{let{docs:r,orderedDocs:i,type:a}=n.sorts[t];return e[t]={docs:new Map(Object.entries(r).map(([e,t])=>[+e,t])),orderedDocsToRemove:new Map,orderedDocs:i,type:a},e},{});return{sharedInternalDocumentStore:e,language:n.language,sortableProperties:n.sortableProperties,sortablePropertiesWithTypes:n.sortablePropertiesWithTypes,sorts:r,enabled:!0,isSorted:n.isSorted}}function h_e(e){if(!e.enabled)return{enabled:!1};l_e(e),U5(e);let t=Object.keys(e.sorts).reduce((t,n)=>{let{docs:r,orderedDocs:i,type:a}=e.sorts[n];return t[n]={docs:Object.fromEntries(r.entries()),orderedDocs:i,type:a},t},{});return{language:e.language,sortableProperties:e.sortableProperties,sortablePropertiesWithTypes:e.sortablePropertiesWithTypes,sorts:t,enabled:e.enabled,isSorted:e.isSorted}}function g_e(){return{create:r_e,insert:i_e,remove:u_e,save:h_e,load:m_e,sortBy:d_e,getSortableProperties:f_e,getSortablePropertiesWithTypes:p_e}}const __e=[65,65,65,65,65,65,65,67,69,69,69,69,73,73,73,73,69,78,79,79,79,79,79,null,79,85,85,85,85,89,80,115,97,97,97,97,97,97,97,99,101,101,101,101,105,105,105,105,101,110,111,111,111,111,111,null,111,117,117,117,117,121,112,121,65,97,65,97,65,97,67,99,67,99,67,99,67,99,68,100,68,100,69,101,69,101,69,101,69,101,69,101,71,103,71,103,71,103,71,103,72,104,72,104,73,105,73,105,73,105,73,105,73,105,73,105,74,106,75,107,107,76,108,76,108,76,108,76,108,76,108,78,110,78,110,78,110,110,78,110,79,111,79,111,79,111,79,111,82,114,82,114,82,114,83,115,83,115,83,115,83,115,84,116,84,116,84,116,85,117,85,117,85,117,85,117,85,117,85,117,87,119,89,121,89,90,122,90,122,90,122,115];function v_e(e){return e<192||e>383?e:__e[e-192]||e}function y_e(e){let t=[];for(let n=0;n<e.length;n++)t[n]=v_e(e.charCodeAt(n));return String.fromCharCode(...t)}const b_e={ational:`ate`,tional:`tion`,enci:`ence`,anci:`ance`,izer:`ize`,bli:`ble`,alli:`al`,entli:`ent`,eli:`e`,ousli:`ous`,ization:`ize`,ation:`ate`,ator:`ate`,alism:`al`,iveness:`ive`,fulness:`ful`,ousness:`ous`,aliti:`al`,iviti:`ive`,biliti:`ble`,logi:`log`},x_e={icate:`ic`,ative:``,alize:`al`,iciti:`ic`,ical:`ic`,ful:``,ness:``},G5=`[aeiouy]`,K5=`[^aeiou][^aeiouy]*`,q5=G5+`[aeiou]*`,J5=`^(`+K5+`)?`+q5+K5,Y5=`^(`+K5+`)?`+q5+K5+q5+K5,X5=`^(`+K5+`)?`+G5;function S_e(e){let t,n,r,i,a,o;if(e.length<3)return e;let s=e.substring(0,1);if(s==`y`&&(e=s.toUpperCase()+e.substring(1)),r=/^(.+?)(ss|i)es$/,i=/^(.+?)([^s])s$/,r.test(e)?e=e.replace(r,`$1$2`):i.test(e)&&(e=e.replace(i,`$1$2`)),r=/^(.+?)eed$/,i=/^(.+?)(ed|ing)$/,r.test(e)){let t=r.exec(e);r=RegExp(J5),r.test(t[1])&&(r=/.$/,e=e.replace(r,``))}else i.test(e)&&(t=i.exec(e)[1],i=RegExp(X5),i.test(t)&&(e=t,i=/(at|bl|iz)$/,a=RegExp(`([^aeiouylsz])\\1$`),o=RegExp(`^`+K5+G5+`[^aeiouwxy]$`),i.test(e)?e+=`e`:a.test(e)?(r=/.$/,e=e.replace(r,``)):o.test(e)&&(e+=`e`)));if(r=/^(.+?)y$/,r.test(e)&&(t=r.exec(e)?.[1],r=RegExp(X5),t&&r.test(t)&&(e=t+`i`)),r=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,r.test(e)){let i=r.exec(e);t=i?.[1],n=i?.[2],r=RegExp(J5),t&&r.test(t)&&(e=t+b_e[n])}if(r=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,r.test(e)){let i=r.exec(e);t=i?.[1],n=i?.[2],r=RegExp(J5),t&&r.test(t)&&(e=t+x_e[n])}if(r=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,i=/^(.+?)(s|t)(ion)$/,r.test(e))t=r.exec(e)?.[1],r=RegExp(Y5),t&&r.test(t)&&(e=t);else if(i.test(e)){let n=i.exec(e);t=n?.[1]??``+n?.[2]??``,i=RegExp(Y5),i.test(t)&&(e=t)}return r=/^(.+?)e$/,r.test(e)&&(t=r.exec(e)?.[1],r=RegExp(Y5),i=RegExp(`^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*([aeiouy][aeiou]*)?$`),a=RegExp(`^`+K5+G5+`[^aeiouwxy]$`),t&&(r.test(t)||i.test(t)&&!a.test(t))&&(e=t)),r=/ll$/,i=RegExp(Y5),r.test(e)&&i.test(e)&&(r=/.$/,e=e.replace(r,``)),s==`y`&&(e=s.toLowerCase()+e.substring(1)),e}function Z5(e,t,n=!0){let r=`${this.language}:${e}:${t}`;return n&&this.normalizationCache.has(r)?this.normalizationCache.get(r):this.stopWords?.includes(t)?(n&&this.normalizationCache.set(r,``),``):(this.stemmer&&!this.stemmerSkipProperties.has(e)&&(t=this.stemmer(t)),t=y_e(t),n&&this.normalizationCache.set(r,t),t)}function C_e(e){for(;e[e.length-1]===``;)e.pop();for(;e[0]===``;)e.shift();return e}function Q5(e,t,n,r=!0){if(t&&t!==this.language)throw f5(`LANGUAGE_NOT_SUPPORTED`,t);if(typeof e!=`string`)return[e];let i=this.normalizeToken.bind(this,n??``),a;if(n&&this.tokenizeSkipProperties.has(n))a=[i(e,r)];else{let t=rge[this.language];a=e.toLowerCase().split(t).map(e=>i(e,r)).filter(Boolean)}let o=C_e(a);return this.allowDuplicates?o:Array.from(new Set(o))}function $5(e={}){if(!e.language)e.language=`english`;else if(!G8.includes(e.language))throw f5(`LANGUAGE_NOT_SUPPORTED`,e.language);let t;if(e.stemming||e.stemmer&&!(`stemming`in e)){if(e.stemmer){if(typeof e.stemmer!=`function`)throw f5(`INVALID_STEMMER_FUNCTION_TYPE`);t=e.stemmer}else if(e.language===`english`)t=S_e;else throw f5(`MISSING_STEMMER`,e.language)}let n;if(e.stopWords!==!1){if(n=[],Array.isArray(e.stopWords))n=e.stopWords;else if(typeof e.stopWords==`function`)n=e.stopWords(n);else if(e.stopWords)throw f5(`CUSTOM_STOP_WORDS_MUST_BE_FUNCTION_OR_ARRAY`);if(!Array.isArray(n))throw f5(`CUSTOM_STOP_WORDS_MUST_BE_FUNCTION_OR_ARRAY`);for(let e of n)if(typeof e!=`string`)throw f5(`CUSTOM_STOP_WORDS_MUST_BE_FUNCTION_OR_ARRAY`)}let r={tokenize:Q5,language:e.language,stemmer:t,stemmerSkipProperties:new Set(e.stemmerSkipProperties?[e.stemmerSkipProperties].flat():[]),tokenizeSkipProperties:new Set(e.tokenizeSkipProperties?[e.tokenizeSkipProperties].flat():[]),stopWords:n,allowDuplicates:!!e.allowDuplicates,normalizeToken:Z5,normalizationCache:new Map};return r.tokenize=Q5.bind(r),r.normalizeToken=Z5,r}function w_e(e){return{sharedInternalDocumentStore:e,rules:new Map}}function T_e(e,t){if(e.rules.has(t.id))throw Error(`PINNING_RULE_ALREADY_EXISTS: A pinning rule with id "${t.id}" already exists. Use updateRule to modify it.`);e.rules.set(t.id,t)}function E_e(e,t){if(!e.rules.has(t.id))throw Error(`PINNING_RULE_NOT_FOUND: Cannot update pinning rule with id "${t.id}" because it does not exist. Use addRule to create it.`);e.rules.set(t.id,t)}function D_e(e,t){return e.rules.delete(t)}function O_e(e,t){return e.rules.get(t)}function k_e(e){return Array.from(e.rules.values())}function A_e(e,t){let n=e.toLowerCase().trim(),r=t.pattern.toLowerCase().trim();switch(t.anchoring){case`is`:return n===r;case`starts_with`:return n.startsWith(r);case`contains`:return n.includes(r);default:return!1}}function j_e(e,t){return e?t.conditions.every(t=>A_e(e,t)):!1}function e7(e,t){if(!t)return[];let n=[];for(let r of e.rules.values())j_e(t,r)&&n.push(r);return n}function M_e(e,t){return{sharedInternalDocumentStore:e,rules:new Map(t?.rules??[])}}function N_e(e){return{rules:Array.from(e.rules.entries())}}function P_e(){return{create:w_e,addRule:T_e,updateRule:E_e,removeRule:D_e,getRule:O_e,getAllRules:k_e,getMatchingRules:e7,load:M_e,save:N_e}}function F_e(e){let t={formatElapsedTime:hge,getDocumentIndexId:gge,getDocumentProperties:r5,validateSchema:p5};for(let n of b5){let r=n;if(e[r]){if(typeof e[r]!=`function`)throw f5(`COMPONENT_MUST_BE_FUNCTION`,r)}else e[r]=t[r]}for(let t of Object.keys(e))if(!Fge.includes(t)&&!b5.includes(t))throw f5(`UNSUPPORTED_COMPONENT`,t)}function I_e({schema:e,sort:t,language:n,components:r,id:i,plugins:a}){r||={};for(let t of a??[]){if(!(`getComponents`in t)||typeof t.getComponents!=`function`)continue;let n=t.getComponents(e),i=Object.keys(n);for(let e of i)if(r[e])throw f5(`PLUGIN_COMPONENT_CONFLICT`,e,t.name);r={...r,...n}}i||=e5();let o=r.tokenizer,s=r.index,c=r.documentsStore,l=r.sorter,u=r.pinning;if(o=o?o.tokenize?o:$5(o):$5({language:n??`english`}),r.tokenizer&&n)throw f5(`NO_LANGUAGE_WITH_CUSTOM_TOKENIZER`);let d=bge();s||=$ge(),l||=g_e(),c||=Mge(),u||=P_e(),F_e(r);let{getDocumentProperties:f,getDocumentIndexId:p,validateSchema:m,formatElapsedTime:h}=r,g={data:{},caches:{},schema:e,tokenizer:o,index:s,sorter:l,documentsStore:c,pinning:u,internalDocumentIDStore:d,getDocumentProperties:f,getDocumentIndexId:p,validateSchema:m,beforeInsert:[],afterInsert:[],beforeRemove:[],afterRemove:[],beforeUpdate:[],afterUpdate:[],beforeUpsert:[],afterUpsert:[],beforeSearch:[],afterSearch:[],beforeInsertMultiple:[],afterInsertMultiple:[],beforeRemoveMultiple:[],afterRemoveMultiple:[],beforeUpdateMultiple:[],afterUpdateMultiple:[],beforeUpsertMultiple:[],afterUpsertMultiple:[],afterCreate:[],formatElapsedTime:h,id:i,plugins:a,version:L_e()};g.data={index:g.index.create(g,d,e),docs:g.documentsStore.create(g,d),sorting:g.sorter.create(g,d,e,t),pinning:g.pinning.create(d)};for(let e of Nge)g[e]=(g[e]??[]).concat(Pge(g,e));let _=g.afterCreate;return _&&Ige(_,g),g}function L_e(){return`{{VERSION}}`}function t7(e){return e.documentsStore.count(e.data.docs)}function n7(e,t,n,r,i){let a=e.validateSchema(t,e.schema);if(a)throw f5(`SCHEMA_VALIDATION_FAILURE`,a);return s5(e.beforeInsert)||s5(e.afterInsert)||s5(e.index.beforeInsert)||s5(e.index.insert)||s5(e.index.afterInsert)?B_e(e,t,n,r,i):V_e(e,t,n,r,i)}const R_e=new Set([`enum`,`enum[]`]),z_e=new Set([`string`,`number`]);async function B_e(e,t,n,r,i){let{index:a,docs:o}=e.data,s=e.getDocumentIndexId(t);if(typeof s!=`string`)throw f5(`DOCUMENT_ID_MUST_BE_STRING`,typeof s);let c=v5(e.internalDocumentIDStore,s);if(r||await x5(e.beforeInsert,e,s,t),!e.documentsStore.store(o,s,c,t))throw f5(`DOCUMENT_ALREADY_EXISTS`,s);let l=e.documentsStore.count(o),u=e.index.getSearchableProperties(a),d=e.index.getSearchablePropertiesWithTypes(a),f=e.getDocumentProperties(t,u);for(let[e,t]of Object.entries(f)){if(t===void 0)continue;let n=typeof t,r=d[e];r7(n,r,e,t)}return await H_e(e,s,u,f,l,n,t,i),r||await x5(e.afterInsert,e,s,t),s}function V_e(e,t,n,r,i){let{index:a,docs:o}=e.data,s=e.getDocumentIndexId(t);if(typeof s!=`string`)throw f5(`DOCUMENT_ID_MUST_BE_STRING`,typeof s);let c=v5(e.internalDocumentIDStore,s);if(r||x5(e.beforeInsert,e,s,t),!e.documentsStore.store(o,s,c,t))throw f5(`DOCUMENT_ALREADY_EXISTS`,s);let l=e.documentsStore.count(o),u=e.index.getSearchableProperties(a),d=e.index.getSearchablePropertiesWithTypes(a),f=e.getDocumentProperties(t,u);for(let[e,t]of Object.entries(f)){if(t===void 0)continue;let n=typeof t,r=d[e];r7(n,r,e,t)}return U_e(e,s,u,f,l,n,t,i),r||x5(e.afterInsert,e,s,t),s}function r7(e,t,n,r){if(!(yge(t)&&typeof r==`object`&&typeof r.lon==`number`&&typeof r.lat==`number`)&&!(m5(t)&&Array.isArray(r))&&!(h5(t)&&Array.isArray(r))&&!(R_e.has(t)&&z_e.has(e))&&e!==t)throw f5(`INVALID_DOCUMENT_PROPERTY`,n,t,e)}async function H_e(e,t,n,r,i,a,o,s){for(let o of n){let n=r[o];if(n===void 0)continue;let c=e.index.getSearchablePropertiesWithTypes(e.data.index)[o];await e.index.beforeInsert?.(e.data.index,o,t,n,c,a,e.tokenizer,i);let l=e.internalDocumentIDStore.idToInternalId.get(t);await e.index.insert(e.index,e.data.index,o,t,l,n,c,a,e.tokenizer,i,s),await e.index.afterInsert?.(e.data.index,o,t,n,c,a,e.tokenizer,i)}let c=e.sorter.getSortableProperties(e.data.sorting),l=e.getDocumentProperties(o,c);for(let n of c){let r=l[n];if(r===void 0)continue;let i=e.sorter.getSortablePropertiesWithTypes(e.data.sorting)[n];e.sorter.insert(e.data.sorting,n,t,r,i,a)}}function U_e(e,t,n,r,i,a,o,s){for(let o of n){let n=r[o];if(n===void 0)continue;let c=e.index.getSearchablePropertiesWithTypes(e.data.index)[o],l=v5(e.internalDocumentIDStore,t);e.index.beforeInsert?.(e.data.index,o,t,n,c,a,e.tokenizer,i),e.index.insert(e.index,e.data.index,o,t,l,n,c,a,e.tokenizer,i,s),e.index.afterInsert?.(e.data.index,o,t,n,c,a,e.tokenizer,i)}let c=e.sorter.getSortableProperties(e.data.sorting),l=e.getDocumentProperties(o,c);for(let n of c){let r=l[n];if(r===void 0)continue;let i=e.sorter.getSortablePropertiesWithTypes(e.data.sorting)[n];e.sorter.insert(e.data.sorting,n,t,r,i,a)}}function i7(e,t,n,r,i,a){return s5(e.afterInsertMultiple)||s5(e.beforeInsertMultiple)||s5(e.index.beforeInsert)||s5(e.index.insert)||s5(e.index.afterInsert)?W_e(e,t,n,r,i,a):G_e(e,t,n,r,i,a)}async function W_e(e,t,n=1e3,r,i,a=0){let o=[],s=async a=>{let s=Math.min(a+n,t.length),c=t.slice(a,s);for(let t of c){let n=await n7(e,t,r,i,{avlRebalanceThreshold:c.length});o.push(n)}return s};return await(async()=>{let e=0;for(;e<t.length;){let t=Date.now();if(e=await s(e),a>0){let e=a-(Date.now()-t);e>0&&d5(e)}}})(),i||await S5(e.afterInsertMultiple,e,t),o}function G_e(e,t,n=1e3,r,i,a=0){let o=[],s=0;function c(){let a=t.slice(s*n,(s+1)*n);if(a.length===0)return!1;for(let t of a){let n=n7(e,t,r,i,{avlRebalanceThreshold:a.length});o.push(n)}return s++,!0}function l(){let e=Date.now();for(;c();)if(a>0){let t=Date.now()-e;if(t>=a){let e=a-t%a;e>0&&d5(e)}}}return l(),i||S5(e.afterInsertMultiple,e,t),o}function a7(e,t,n,r){return s5(e.index.beforeRemove)||s5(e.index.remove)||s5(e.index.afterRemove)?K_e(e,t,n,r):q_e(e,t,n,r)}async function K_e(e,t,n,r){let i=!0,{index:a,docs:o}=e.data,s=e.documentsStore.get(o,t);if(!s)return!1;let c=v5(e.internalDocumentIDStore,t),l=y5(e.internalDocumentIDStore,c),u=e.documentsStore.count(o);r||await x5(e.beforeRemove,e,l);let d=e.index.getSearchableProperties(a),f=e.index.getSearchablePropertiesWithTypes(a),p=e.getDocumentProperties(s,d);for(let r of d){let a=p[r];if(a===void 0)continue;let o=f[r];await e.index.beforeRemove?.(e.data.index,r,l,a,o,n,e.tokenizer,u),await e.index.remove(e.index,e.data.index,r,t,c,a,o,n,e.tokenizer,u)||(i=!1),await e.index.afterRemove?.(e.data.index,r,l,a,o,n,e.tokenizer,u)}let m=await e.sorter.getSortableProperties(e.data.sorting),h=await e.getDocumentProperties(s,m);for(let n of m)h[n]!==void 0&&e.sorter.remove(e.data.sorting,n,t);return r||await x5(e.afterRemove,e,l),e.documentsStore.remove(e.data.docs,t,c),i}function q_e(e,t,n,r){let i=!0,{index:a,docs:o}=e.data,s=e.documentsStore.get(o,t);if(!s)return!1;let c=v5(e.internalDocumentIDStore,t),l=y5(e.internalDocumentIDStore,c),u=e.documentsStore.count(o);r||x5(e.beforeRemove,e,l);let d=e.index.getSearchableProperties(a),f=e.index.getSearchablePropertiesWithTypes(a),p=e.getDocumentProperties(s,d);for(let r of d){let a=p[r];if(a===void 0)continue;let o=f[r];e.index.beforeRemove?.(e.data.index,r,l,a,o,n,e.tokenizer,u),e.index.remove(e.index,e.data.index,r,t,c,a,o,n,e.tokenizer,u)||(i=!1),e.index.afterRemove?.(e.data.index,r,l,a,o,n,e.tokenizer,u)}let m=e.sorter.getSortableProperties(e.data.sorting),h=e.getDocumentProperties(s,m);for(let n of m)h[n]!==void 0&&e.sorter.remove(e.data.sorting,n,t);return r||x5(e.afterRemove,e,l),e.documentsStore.remove(e.data.docs,t,c),i}function J_e(e,t,n,r,i){return s5(e.index.beforeRemove)||s5(e.index.remove)||s5(e.index.afterRemove)||s5(e.beforeRemoveMultiple)||s5(e.afterRemoveMultiple)?Y_e(e,t,n,r,i):X_e(e,t,n,r,i)}async function Y_e(e,t,n,r,i){let a=0;n||=1e3;let o=i?[]:t.map(t=>y5(e.internalDocumentIDStore,v5(e.internalDocumentIDStore,t)));return i||await S5(e.beforeRemoveMultiple,e,o),await new Promise((o,s)=>{let c=0;async function l(){let u=t.slice(c*n,++c*n);if(!u.length)return o();for(let t of u)try{await a7(e,t,r,i)&&a++}catch(e){s(e)}setTimeout(l,0)}setTimeout(l,0)}),i||await S5(e.afterRemoveMultiple,e,o),a}function X_e(e,t,n,r,i){let a=0;n||=1e3;let o=i?[]:t.map(t=>y5(e.internalDocumentIDStore,v5(e.internalDocumentIDStore,t)));i||S5(e.beforeRemoveMultiple,e,o);let s=0;function c(){let o=t.slice(s*n,++s*n);if(o.length){for(let t of o)a7(e,t,r,i)&&a++;setTimeout(c,0)}}return c(),i||S5(e.afterRemoveMultiple,e,o),a}function Z_e(e,t){return e[1]-t[1]}function Q_e(e,t){return t[1]-e[1]}function $_e(e=`desc`){return e.toLowerCase()===`asc`?Z_e:Q_e}function o7(e,t,n){let r={},i=t.map(([e])=>e),a=e.documentsStore.getMultiple(e.data.docs,i),o=Object.keys(n),s=e.index.getSearchablePropertiesWithTypes(e.data.index);for(let e of o){let t;if(s[e]===`number`){let{ranges:r}=n[e],i=r.length,a=Array.from({length:i});for(let e=0;e<i;e++){let t=r[e];a[e]=[`${t.from}-${t.to}`,0]}t=Object.fromEntries(a)}r[e]={count:0,values:t??{}}}let c=a.length;for(let e=0;e<c;e++){let t=a[e];for(let e of o){let i=e.includes(`.`)?i5(t,e):t[e],a=s[e],o=r[e].values;switch(a){case`number`:{let t=n[e].ranges;s7(t,o)(i);break}case`number[]`:{let t=new Set,r=n[e].ranges,a=s7(r,o,t);for(let e of i)a(e);break}case`boolean`:case`enum`:case`string`:c7(o,a)(i);break;case`boolean[]`:case`enum[]`:case`string[]`:{let e=c7(o,a===`boolean[]`?`boolean`:`string`,new Set);for(let t of i)e(t);break}default:throw f5(`FACET_NOT_SUPPORTED`,a)}}}for(let e of o){let t=r[e];if(t.count=Object.keys(t.values).length,s[e]===`string`){let r=n[e],i=$_e(r.sort);t.values=Object.fromEntries(Object.entries(t.values).sort(i).slice(r.offset??0,r.limit??10))}}return r}function s7(e,t,n){return r=>{for(let i of e){let e=`${i.from}-${i.to}`;n?.has(e)||r>=i.from&&r<=i.to&&(t[e]===void 0?t[e]=1:(t[e]++,n?.add(e)))}}}function c7(e,t,n){let r=t===`boolean`?`false`:``;return t=>{let i=t?.toString()??r;n?.has(i)||(e[i]=(e[i]??0)+1,n?.add(i))}}const eve={reducer:(e,t,n,r)=>(t[r]=n,t),getInitialValue:e=>Array.from({length:e})},l7=[`string`,`number`,`boolean`];function u7(e,t,n){let r=n.properties,i=r.length,a=e.index.getSearchablePropertiesWithTypes(e.data.index);for(let e=0;e<i;e++){let t=r[e];if(a[t]===void 0)throw f5(`UNKNOWN_GROUP_BY_PROPERTY`,t);if(!l7.includes(a[t]))throw f5(`INVALID_GROUP_BY_PROPERTY`,t,l7.join(`, `),a[t])}let o=t.map(([t])=>y5(e.internalDocumentIDStore,t)),s=e.documentsStore.getMultiple(e.data.docs,o),c=s.length,l=n.maxResult||2**53-1,u=[],d={};for(let e=0;e<i;e++){let t=r[e],n={property:t,perValue:{}},i=new Set;for(let e=0;e<c;e++){let r=s[e],a=i5(r,t);if(a===void 0)continue;let o=typeof a==`boolean`?``+a:a,c=n.perValue[o]??{indexes:[],count:0};c.count>=l||(c.indexes.push(e),c.count++,n.perValue[o]=c,i.add(a))}u.push(Array.from(i)),d[t]=n}let f=d7(u),p=f.length,m=[];for(let e=0;e<p;e++){let t=f[e],n=t.length,i={values:[],indexes:[]},a=[];for(let e=0;e<n;e++){let n=t[e],o=r[e];a.push(d[o].perValue[typeof n==`boolean`?``+n:n].indexes),i.values.push(n)}i.indexes=uge(a).sort((e,t)=>e-t),i.indexes.length!==0&&m.push(i)}let h=m.length,g=Array.from({length:h});for(let e=0;e<h;e++){let r=m[e],i=n.reduce||eve,a=r.indexes.map(e=>({id:o[e],score:t[e][1],document:s[e]})),c=i.reducer.bind(null,r.values),l=i.getInitialValue(r.indexes.length),u=a.reduce(c,l);g[e]={values:r.values,result:u}}return g}function d7(e,t=0){if(t+1===e.length)return e[t].map(e=>[e]);let n=e[t],r=d7(e,t+1),i=[];for(let e of n)for(let t of r){let n=[e];X8(n,t),i.push(n)}return i}function f7(e,t,n,r){let i=e7(t,r);if(i.length===0)return n;let a=i.flatMap(e=>e.consequence.promote);a.sort((e,t)=>e.position-t.position);let o=new Set,s=new Map,c=new Set;for(let t of a){let n=v5(e.internalDocumentIDStore,t.doc_id);if(n!==void 0){if(s.has(n)){let e=s.get(n);t.position<e&&s.set(n,t.position);continue}c.has(t.position)||(o.add(n),s.set(n,t.position),c.add(t.position))}}if(s.size===0)return n;let l=n.filter(([e])=>!o.has(e)),u=[];for(let[t,r]of s.entries())n.find(([e])=>e===t)?u.push([t,1e6-r]):e.documentsStore.get(e.data.docs,t)&&u.push([t,0]);u.sort((e,t)=>(s.get(e[0])??1/0)-(s.get(t[0])??1/0));let d=[],f=new Map;for(let e of u){let t=s.get(e[0]);f.set(t,e)}let p=0,m=0;for(;m<l.length+u.length;)if(f.has(m))d.push(f.get(m)),m++;else if(p<l.length)d.push(l[p]),p++,m++;else break;for(let[e,t]of f.entries())e>=d.length&&d.push(t);return d}function p7(e,t,n){let{term:r,properties:i}=t,a=e.data.index,o=e.caches.propertiesToSearch;if(!o){let t=e.index.getSearchablePropertiesWithTypes(a);o=e.index.getSearchableProperties(a),o=o.filter(e=>t[e].startsWith(`string`)),e.caches.propertiesToSearch=o}if(i&&i!==`*`){for(let e of i)if(!o.includes(e))throw f5(`UNKNOWN_INDEX`,e,o.join(`, `));o=o.filter(e=>i.includes(e))}let s=Object.keys(t.where??{}).length>0,c;s&&(c=e.index.searchByWhereClause(a,e.tokenizer,t.where,n));let l,u=t.threshold!==void 0&&t.threshold!==null?t.threshold:1;if(r||i){let i=t7(e);if(l=e.index.search(a,r||``,e.tokenizer,n,o,t.exact||!1,t.tolerance||0,t.boost||{},ive(t.relevance),i,c,u),t.exact&&r){let t=r.trim().split(/\s+/);l=l.filter(([n])=>{let r=e.documentsStore.get(e.data.docs,n);if(!r)return!1;for(let e of o){let n=nve(r,e);if(typeof n==`string`&&t.every(e=>RegExp(`\\b${tve(e)}\\b`).test(n)))return!0}return!1})}}else l=s?t_e(a,t.where)||(c?Array.from(c):[]).map(e=>[+e,0]):Object.keys(e.documentsStore.getAll(e.data.docs)).map(e=>[+e,0]);return l}function tve(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function nve(e,t){let n=t.split(`.`),r=e;for(let e of n)if(r&&typeof r==`object`&&e in r)r=r[e];else return;return r}function rve(e,t,n){let r=$8();function i(){let i=Object.keys(e.data.index.vectorIndexes),a=t.facets&&Object.keys(t.facets).length>0,{limit:o=10,offset:s=0,distinctOn:c,includeVectors:l=!1}=t,u=t.preflight===!0,d=p7(e,t,n);if(t.sortBy){if(typeof t.sortBy==`function`){let n=d.map(([e])=>e),r=e.documentsStore.getMultiple(e.data.docs,n).map((e,t)=>[d[t][0],d[t][1],e]);r.sort(t.sortBy),d=r.map(([e,t])=>[e,t])}else d=e.sorter.sortBy(e.data.sorting,d,t.sortBy).map(([t,n])=>[v5(e.internalDocumentIDStore,t),n])}else d=d.sort(n5);d=f7(e,e.data.pinning,d,t.term);let f;u||(f=c?pve(e,d,s,o,c):v7(e,d,s,o));let p={elapsed:{formatted:``,raw:0},hits:[],count:d.length};return f!==void 0&&(p.hits=f.filter(Boolean),l||o5(p,i)),a&&(p.facets=o7(e,d,t.facets)),t.groupBy&&(p.groups=u7(e,d,t.groupBy)),p.elapsed=e.formatElapsedTime($8()-r),p}async function a(){e.beforeSearch&&await w5(e.beforeSearch,e,t,n);let r=i();return e.afterSearch&&await C5(e.afterSearch,e,t,n,r),r}return e.beforeSearch?.length||e.afterSearch?.length?a():i()}const m7={k:1.2,b:.75,d:.5};function ive(e){let t=e??{};return t.k=t.k??m7.k,t.b=t.b??m7.b,t.d=t.d??m7.d,t}function h7(e,t,n){let r=t.vector;if(r&&(!(`value`in r)||!(`property`in r)))throw f5(`INVALID_VECTOR_INPUT`,Object.keys(r).join(`, `));let i=e.data.index.vectorIndexes[r.property];if(!i)throw f5(`UNKNOWN_VECTOR_PROPERTY`,r.property);let a=i.node.size;if(r?.value.length!==a)throw r?.property===void 0||r?.value.length===void 0?f5(`INVALID_INPUT_VECTOR`,`undefined`,a,`undefined`):f5(`INVALID_INPUT_VECTOR`,r.property,a,r.value.length);let o=e.data.index,s;return Object.keys(t.where??{}).length>0&&(s=e.index.searchByWhereClause(o,e.tokenizer,t.where,n)),i.node.find(r.value,t.similarity??.8,s)}function ave(e,t,n=`english`){let r=$8();function i(){let i=h7(e,t,n).sort(n5);i=f7(e,e.data.pinning,i,void 0);let a=[];t.facets&&Object.keys(t.facets).length>0&&(a=o7(e,i,t.facets));let o=t.vector.property,s=t.includeVectors??!1,c=t.limit??10,l=t.offset??0,u=Array.from({length:c});for(let t=0;t<c;t++){let n=i[t+l];if(!n)break;let r=e.data.docs.docs[n[0]];if(r){s||(r[o]=null);let i={id:y5(e.internalDocumentIDStore,n[0]),score:n[1],document:r};u[t]=i}}let d=[];t.groupBy&&(d=u7(e,i,t.groupBy));let f=$8()-r;return{count:i.length,hits:u.filter(Boolean),elapsed:{raw:Number(f),formatted:Q8(f)},...a?{facets:a}:{},...d?{groups:d}:{}}}async function a(){e.beforeSearch&&await w5(e.beforeSearch,e,t,n);let r=i();return e.afterSearch&&await C5(e.afterSearch,e,t,n,r),r}return e.beforeSearch?.length||e.afterSearch?.length?a():i()}function ove(e,t,n){let r=cve(p7(e,t,n)),i=h7(e,t,n),a=t.hybridWeights;return uve(r,i,t.term??``,a)}function sve(e,t,n){let r=$8();function i(){let i=ove(e,t,n);i=f7(e,e.data.pinning,i,t.term);let a;t.facets&&Object.keys(t.facets).length>0&&(a=o7(e,i,t.facets));let o;t.groupBy&&(o=u7(e,i,t.groupBy));let s=t.offset??0,c=t.limit??10,l=v7(e,i,s,c).filter(Boolean),u=$8(),d={count:i.length,elapsed:{raw:Number(u-r),formatted:Q8(u-r)},hits:l,...a?{facets:a}:{},...o?{groups:o}:{}};return(t.includeVectors??!1)||o5(d,Object.keys(e.data.index.vectorIndexes)),d}async function a(){e.beforeSearch&&await w5(e.beforeSearch,e,t,n);let r=i();return e.afterSearch&&await C5(e.afterSearch,e,t,n,r),r}return e.beforeSearch?.length||e.afterSearch?.length?a():i()}function g7(e){return e[1]}function cve(e){let t=Math.max.apply(Math,e.map(g7));return e.map(([e,n])=>[e,n/t])}function _7(e,t){return e/t}function lve(e,t){return(n,r)=>n*e+r*t}function uve(e,t,n,r){let i=Math.max.apply(Math,e.map(g7)),a=Math.max.apply(Math,t.map(g7)),{text:o,vector:s}=r&&r.text&&r.vector?r:dve(n),c=new Map,l=e.length,u=lve(o,s);for(let t=0;t<l;t++){let[n,r]=e[t],a=u(_7(r,i),0);c.set(n,a)}let d=t.length;for(let e=0;e<d;e++){let[n,r]=t[e],i=_7(r,a),o=c.get(n)??0;c.set(n,o+u(0,i))}return[...c].sort((e,t)=>t[1]-e[1])}function dve(e){return{text:.5,vector:.5}}function fve(e,t,n){let r=t.mode??`fulltext`;if(r===`fulltext`)return rve(e,t,n);if(r===`vector`)return ave(e,t);if(r===`hybrid`)return sve(e,t);throw f5(`INVALID_SEARCH_MODE`,r)}function pve(e,t,n,r,i){let a=e.data.docs,o=new Map,s=[],c=new Set,l=t.length,u=0;for(let d=0;d<l;d++){let l=t[d];if(l===void 0)continue;let[f,p]=l;if(c.has(f))continue;let m=e.documentsStore.get(a,f),h=i5(m,i);if(!(h===void 0||o.has(h))&&(o.set(h,!0),u++,!(u<=n)&&(s.push({id:y5(e.internalDocumentIDStore,f),score:p,document:m}),c.add(f),u>=n+r)))break}return s}function v7(e,t,n,r){let i=e.data.docs,a=Array.from({length:r}),o=new Set;for(let s=n;s<r+n;s++){let n=t[s];if(n===void 0)break;let[r,c]=n;if(!o.has(r)){let t=e.documentsStore.get(i,r);a[s]={id:y5(e.internalDocumentIDStore,r),score:c,document:t},o.add(r)}}return a}const mve={id:`string`,kind:`enum`,path:`string`,title:`string`,name:`string`,pathSegments:`string`,content:`string`,modifiedTs:`number`},y7=new WeakMap;function hve(e){return e===void 0||!Number.isFinite(e)?20:Math.max(1,Math.min(100,Math.trunc(e)))}function b7(e){return e.trim().toLowerCase()}const gve=/\.(?:md|mdx)$/;function _ve(e,t){if(t!==`page`)return e;let n=e.replace(gve,``);return n.length>0?n:e}function vve(e){let t=e.split(`/`).filter(Boolean);return t[t.length-1]??e}function yve(e){let t=vve(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}}const x7=/[^\P{L}a-zàèéìòóù]|[^\P{Nd}0-9]|\p{Nl}/iu,S7=(()=>{let e=globalThis.Intl.Segmenter;return e?new e(`en`,{granularity:`word`}):null})();function bve(){let e=$5({language:`english`}),t=e.tokenize.bind(e);return e.tokenize=(e,n,r,i)=>{let a=t(e,n,r,i);if(!S7||typeof e!=`string`||!x7.test(e))return a;let o=new Set(a);for(let{segment:t,isWordLike:n}of S7.segment(e)){if(!n||!x7.test(t))continue;let e=t.toLowerCase();o.has(e)||(o.add(e),a.push(e))}return a},e}function C7(e){let t=I_e({schema:mve,components:{tokenizer:bve()}});return e.length>0&&i7(t,e),t}function w7(e){let t={documents:e};return y7.set(t,C7(e)),t}function xve(e){let t=y7.get(e);if(t)return t;let n=C7(e.documents);return y7.set(e,n),n}const T7=new WeakSet;function Sve(e,t){return e===t||e.kind===t.kind&&e.path===t.path&&e.title===t.title&&e.name===t.name&&e.pathSegments===t.pathSegments&&e.modifiedTs===t.modifiedTs&&e.content===t.content}function Cve(e,t){let n=e=>({corpus:w7(t),inserted:0,updated:0,removed:0,rebuilt:!0,rebuildReason:e}),r=y7.get(e);if(!r)return n(`no-index`);if(T7.has(e))return n(`stale-base`);let i=new Map(t.map(e=>[e.id,e]));if(i.size!==t.length)return n(`duplicate-id`);let a=[],o=[],s=0;for(let t of e.documents){let e=i.get(t.id);e?Sve(t,e)||(a.push(t.id),o.push(e),s+=1):a.push(t.id)}let c=new Set(e.documents.map(e=>e.id));for(let e of t)c.has(e.id)||o.push(e);if(a.length+o.length>t.length)return n(`bulk-change`);T7.add(e);try{if(a.length>0&&J_e(r,a),o.length>0&&i7(r,o),t7(r)!==t.length)throw Error(`Search index count ${t7(r)} diverged from document count ${t.length} after incremental update`)}catch{return n(`mutation-failed`)}let l={documents:t};return y7.set(l,r),{corpus:l,inserted:o.length-s,updated:s,removed:a.length-s,rebuilt:!1}}function wve(e){return e===`autocomplete`?[`page`]:e===`full_text`?[`page`,`content`,`file`]:[`page`,`folder`,`file`]}function E7(e,t){return t.has(e.kind)?!0:e.kind===`page`&&t.has(`content`)}function Tve(e,t){let n=b7(t);if(!n)return 0;let r=_ve(n,e.kind),i=b7(e.title),a=b7(e.name),o=b7(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}function D7(e,t){let n=Tve(e,t);return n<=0?n:zg(e.path)?n*.5:n}function Eve(e){return e===`file`?-60:0}function Dve(e,t,n,r,i){let a=i>0?t/i:0,o=n/50,s=r===`file`?-.001:0,c=1*a+1*o+s;return e*1e3+c}function O7(e,t,n,r){return e+t*20+n+Eve(r)}function k7(e,t,n,r,i,a){return e===`relevance`?O7(t,n,r,i):Dve(t,n,r,i,a)}function Ove(e,t){return t||(e===`full_text`?`relevance`:`navigation`)}function A7(e,t){let n=0;for(let r of e){let e=t.get(r.id)??0;e>n&&(n=e)}return n}function kve(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 Ave(e){return e===`full_text`?[`title`,`name`,`path`,`pathSegments`,`content`]:[`title`,`name`,`path`,`pathSegments`]}function jve(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}}const Mve=/[-ក- -〿-ゟ゠-ヿ㐀-䶿一-鿿\uf900--\u1100-\u11ff\u3130-\u318f\ua960-\ua97f\uac00-\ud7ff]/;function Nve(e,t){let n=b7(t);return n.length<4||Mve.test(n)?0:+(e===`full_text`)}function Pve(e){let{lexical:t,fullText:n}=e.signals;return t>=500?`lexical`:t===450&&n<=0?`pathOnly`:`body`}function Fve(e){let t=[],n=[],r=[];for(let i of e){let e=Pve(i);e===`lexical`?t.length<100&&t.push(i):e===`body`?n.length<6&&n.push(i):r.length<4&&r.push(i)}return[...t,...n,...r]}function j7(e,t,n){if(t===`relevance`)return e.slice(0,n);let r=Fve(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 Ive(e,t,n={}){let r=n.intent??`omnibar`,i=Ove(r,n.ranking),a=hve(n.limit),o=new Set(n.scopes??wve(r)),s=e.documents.filter(e=>E7(e,o)),c=b7(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=fve(xve(e),{term:c,properties:Ave(r),boost:jve(r),tolerance:Nve(r,c),limit:Math.max(a*4,40)}),u=new Map(l.hits.filter(e=>E7(e.document,o)).map(e=>[e.document.id,e.score])),d=kve(s),f=new Map;for(let e of s)D7(e,c)>=0&&f.set(e.id,e);for(let e of l.hits)E7(e.document,o)&&f.set(e.document.id,e.document);if(!n.semantic){let e=A7(f.values(),u);return j7([...f.values()].map(t=>{let n=Math.max(0,D7(t,c)),r=u.get(t.id)??0,a=d.get(t.id)??0;return{document:t,score:k7(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 j7(Lve({scopedDocuments:s,candidates:f,fullTextScores:u,recency:d,normalizedQuery:c,ranking:i,semantic:n.semantic}),i,a)}function M7(e){let t=new Map;return e.forEach((e,n)=>{t.set(e,n+1)}),t}function Lve(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=A7(n.values(),r),h=[...n.values()].map(e=>{let t=Math.max(0,D7(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?k7(o,t,n,s,e.kind,m):O7(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=M7(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)),_=M7(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}))}const Rve=/^[A-Za-z0-9._-]+$/,zve=/^(?:\d{1,3}\.){3}\d{1,3}$/;var N7=class extends Error{constructor(e){super(e),this.name=`InvalidShareUrlError`}};function Bve(e,t=0){if(F7(t,!0),t===0)return Uve(e);if(e.length>2985)throw new N7(`Share URL exceeds the v2 URL size limit`);Hve(P7(e),t);let n=new TextEncoder().encode(e);if(n.length>2985)throw new N7(`Share URL exceeds the v2 URL size limit`);let r=new Uint8Array(3+n.length);if(r[0]=2,r[1]=t>>>8,r[2]=t&255,r.set(n,3),r.length>2988)throw new N7(`Share payload exceeds the v2 size limit`);let i=V7(r);if(i.length>3984)throw new N7(`Share token exceeds the v2 size limit`);return i}function P7(e){if(!e.startsWith(`https://`))throw new N7(`Share URL must use canonical HTTPS spelling`);if(e.includes(`?`)||e.includes(`#`))throw new N7(`Share URL cannot contain a query or fragment`);let t=e.slice(8),n=t.indexOf(`/`);if(n<=0)throw new N7(`Share URL is missing its repository path`);let r=t.slice(0,n);I7(r);let i=t.slice(n+1).split(`/`);if(i.length<4||i.some(e=>e.length===0))throw new N7(`Share URL has an invalid path shape`);let[a,o,s,c,...l]=i;if(s!==`blob`&&s!==`tree`)throw new N7(`Share URL has an unsupported repository path shape`);let u=L7(a,`owner`),d=L7(o,`repository`),f=Wve(c),p=l.map(e=>Gve(e,`target`)),m=s===`blob`?`doc`:`folder`;if(m===`doc`&&p.length===0)throw new N7(`Document share URL is missing its target path`);let h={host:r,owner:u,repo:d,branch:f,kind:m,targetSegments:p};if(Vve(h)!==e)throw new N7(`Share URL is not canonically serialized`);return h}function Vve(e){if(I7(e.host),B7(e.owner,`owner`),B7(e.repo,`repository`),!S_(e.branch))throw new N7(`Share URL branch is invalid`);if(e.kind!==`doc`&&e.kind!==`folder`)throw new N7(`Share URL target kind is invalid`);if(e.kind===`doc`&&e.targetSegments.length===0)throw new N7(`Document share URL is missing its target path`);for(let t of e.targetSegments)z7(t,`target`);let t=e.kind===`doc`?`blob`:`tree`,n=[encodeURIComponent(e.owner),encodeURIComponent(e.repo),t,encodeURIComponent(e.branch),...e.targetSegments.map(e=>encodeURIComponent(e))];return`https://${e.host}/${n.join(`/`)}`}function Hve(e,t){if(F7(t,!1),t>e.targetSegments.length)throw new N7(`Content root depth exceeds the repository target path`);let n=e.targetSegments.slice(t).join(`/`);if(e.kind===`doc`){if(n.length===0)throw new N7(`Document share target cannot be the content root`);return{kind:`doc`,docPath:n}}return{kind:`folder`,folderPath:n}}function Uve(e){let t=new TextEncoder().encode(e),n=new Uint8Array(1+t.length);return n[0]=1,n.set(t,1),V7(n)}function F7(e,t){if(!Number.isInteger(e)||e<+!t||e>65535)throw new N7(`Content root depth is invalid`)}function I7(e){if(e.length===0||e.length>253||e.endsWith(`.`)||e!==e.toLowerCase()||zve.test(e))throw new N7(`Share URL host is not canonical`);if(e.split(`.`).some(e=>e.length===0||e.length>63||!/^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/.test(e)))throw new N7(`Share URL host is not a DNS name`);if(c(e)!==e)throw new N7(`Share URL host is not a canonical GitHub host`)}function Wve(e){let t=R7(e,`branch`);if(!S_(t))throw new N7(`Share URL branch is invalid`);return t}function Gve(e,t){let n=R7(e,t);return z7(n,t),n}function L7(e,t){let n=R7(e,t);return B7(n,t),n}function R7(e,t){let n;try{n=decodeURIComponent(e)}catch{throw new N7(`Share URL ${t} has malformed percent encoding`)}if(encodeURIComponent(n)!==e)throw new N7(`Share URL ${t} is not canonically encoded`);return n}function z7(e,t){if(e.length===0||e===`.`||e===`..`||e.toLowerCase()===`.git`||e.includes(`/`)||e.includes(`\\`)||Kve(e))throw new N7(`Share URL ${t} component is invalid`)}function B7(e,t){if(z7(e,t),!Rve.test(e)||e.startsWith(`-`))throw new N7(`Share URL ${t} component is invalid`)}function Kve(e){for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n<=31||n===127)return!0}return!1}function V7(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)}const qve=yo({name:j(),description:j(),files:yo({skillMd:j(),scripts:P(j()),references:P(j())})}),Jve=yo({pluginProvider:j().optional(),plugin:j().optional(),marketplace:j().optional(),repositoryUrl:j().optional(),version:j().optional(),gitCommitSha:j().optional(),scope:j().optional(),projectPath:j().optional()}),Yve=yo({commands:N(),hooks:N(),mcp:N()}),Xve=yo({...qve.shape,sourceHarness:j(),sourceHarnesses:P(j()),home:j(),provenance:Jve,inert:Yve,outsideProject:N().optional()}),Zve=yo({schema:L(1),name:j(),version:j(),description:j().optional(),author:yo({name:j()}).optional(),skills:P(j()),hostCompatibility:P(j()).optional(),capabilities:yo({scripts:j(),network:j(),inert:P(j())}).optional(),provenance:yo({source:j(),ref:j(),contentHash:j()}).optional()}),Qve=F({skills:P(Xve),packs:P(Zve)}).loose(),$ve=F({results:P(F({id:j().min(1),name:j().min(1),source:j().min(1),description:j(),installs:M().int().nonnegative().nullable(),publisher:j().nullable()}).loose()),backend:I([`skills.sh`,`github-fallback`]),degraded:N()}).loose(),eye=F({title:j(),description:j(),image:j().nullable(),skillsUrl:j().nullable(),sourceKind:I([`github`,`site`]),sourceUrl:j()}).loose(),tye=F({skills:P(F({name:j(),description:j().nullable()}).loose())}).loose(),nye=F({kind:I([`local`,`import`,`none`]),scope:I(ug).optional(),name:j().optional(),dir:j().optional(),source:j().optional(),ref:j().optional(),via:I([`source`,`publisher`]).optional()}).loose(),rye=F({relPath:j(),content:j().nullable()}).loose(),iye=F({provider:j(),plugin:j(),version:j().optional(),marketplace:j().optional(),repositoryUrl:j().optional()}).loose(),aye=F({provider:j(),plugin:j(),version:j().optional(),description:j().optional(),repositoryUrl:j().optional(),bundledSkills:P(j()),capabilities:F({commands:N(),hooks:N(),mcp:N(),agents:N()}),setupSupported:N()}).loose(),oye=F({name:j(),description:j().nullable(),skillMd:j(),files:P(rye),plugin:iye.optional(),pluginBundle:aye.optional()}).loose(),H7=e=>e*8+4;H7(92),H7(40);const U7=(()=>{let e=globalThis.Intl.Segmenter;return e?new e(void 0,{granularity:`grapheme`}):null})();function sye(e){return e>=56320&&e<=57343}function cye(e){return e>=55296&&e<=56319}function lye(e,t){if(U7){let n=U7.segment(e).containing(t);return n===void 0?t:n.index}return sye(e.charCodeAt(t))&&cye(e.charCodeAt(t-1))?t-1:t}function uye(e,t){return e.length<=t?e:t<=0?``:e.slice(0,lye(e,t))}Array.from({length:256},(e,t)=>(t+256).toString(16).slice(1));const dye={fileSystem:`File System`,gitUpstream:`Git (upstream)`,service:`OpenKnowledge (service)`,generator:`OpenKnowledge (generated)`},fye=[`#D97757`,`#1B1912`,`#F9F3E9`,`#7A9DFF`,`#8534F3`,`#9663F0`,`#727CF3`],pye={claude:`#D97757`,cursor:`#1B1912`,windsurf:`#0B100F`,openai:`#7A9DFF`,github:`#8534F3`,cline:`#9663F0`,bot:`#727CF3`};function mye(e,t=fye){let n=0;for(let t of e)n=(n<<5)-n+t.charCodeAt(0)|0;return t[Math.abs(n)%t.length]}const hye={"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 W7(e){return e?hye[e]||(e.startsWith(`local-agent-mode-`)?`claude`:`bot`):`bot`}const gye={claude:`Claude`,cursor:`Cursor`,windsurf:`Windsurf`,openai:`Codex`,github:`Copilot`,cline:`Cline`};function _ye(e){let t=e?.trim();return t?gye[W7(t)]??t:`Agent`}function G7(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 K7(e){return e===`.`||e===`..`?e:encodeURIComponent(e).replace(/[!'()*]/g,e=>`%${e.codePointAt(0)?.toString(16).toUpperCase()}`)}function vye(e){return e.split(`/`).map(K7).join(`/`)}function q7(e){return e.split(`/`).map(G7).join(`/`)}function J7(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=G7(o.split(`/`).pop()??``).match(/\.([a-z0-9]+)$/i);if(s){let e=`.${(s[1]??``).toLowerCase()}`;if(!hp.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=G7(d[e]??``);if(e===f&&(t=mg(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 yye(e){throw Error(`Unhandled ClassifiedLinkTarget variant: ${JSON.stringify(e)}`)}const Y7=/^[a-zA-Z][a-zA-Z\d+\-.]*:/;function X7(e){let t=(e.split(/[?#]/)[0]??e).match(/\.([a-z0-9]+)$/i);return t?(t[1]??``).toLowerCase():null}function Z7(e){let t=e.trim();return Y7.test(t)||t.startsWith(`//`)}function bye(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(Z7(n))return{kind:`external`,url:n};let r=n.indexOf(`#`),i=q7(r<0?n:n.slice(0,r)),a=yg(i,t);if(a)return{kind:`doc`,docName:a,anchor:r<0?null:n.slice(r+1)};let o=vg(i,t);if(o)return{kind:`doc`,docName:o,anchor:r<0?null:n.slice(r+1)};let s=J7(n,t);if(s)return{kind:`doc`,docName:s.docName,anchor:s.anchor};let c=X7(i);return c&&c!==`md`&&c!==`mdx`?{kind:`asset`,url:n,ext:c,literal:!1}:null}function Q7(e,t){let n=e.trim();if(!n)return null;if(Z7(n))return{kind:`external`,url:t?`${n}#${t}`:n};let r=X7(n);return r&&r!==`md`&&r!==`mdx`?{kind:`asset`,url:n,ext:r,literal:!0}:{kind:`doc`,docName:n,anchor:t?.trim()||null}}function xye(e,t,n){let r=e.trim();if(!r||Y7.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:G7(e));return c.length===0?null:c.join(`/`)}const Sye={document:{unicode:`NFC`,case:`sensitive`},folder:{unicode:`NFC`,case:`sensitive`},file:{unicode:`NFC`,case:`insensitive`}};function $7(e,t){let n=Sye[e],r=t.normalize(n.unicode);return n.case===`insensitive`?r.toLowerCase():r}function e9(e){return $7(`file`,e)}function t9(e,t){return e<t?-1:+(e>t)}function n9(e,t){let n=t.split(`/`),r=n.length-1;return n.map((t,n)=>$7(n===r?e:`folder`,t)).join(`/`)}function Cye(e){let t=n9(`file`,e);return X6(t)||t}const r9=Symbol.for(`@inkeep/open-knowledge-core/target-namespace`);var wye=class extends Set{kind;[r9]=!0;byKey=new Map;constructor(e,t){super(),this.kind=e;for(let e of t)this.add(e)}add(e){if(super.has(e))return this;super.add(e);let t=n9(this.kind,e),n=this.byKey.get(t);if(n===void 0)return this.byKey.set(t,[e]),this;let r=0;for(;r<n.length&&t9(n[r],e)<0;)r++;return n.splice(r,0,e),this}delete(e){if(!super.delete(e))return!1;let t=n9(this.kind,e),n=this.byKey.get(t);return n===void 0||(n.splice(n.indexOf(e),1),n.length===0&&this.byKey.delete(t),!0)}clear(){super.clear(),this.byKey.clear()}lookup(e){if(super.has(e))return{kind:`exact`,name:e};let t=this.byKey.get(n9(this.kind,e));if(t===void 0)return{kind:`absent`};let n=t[0];return t.length===1?{kind:`equivalent`,name:n}:{kind:`ambiguous`,name:n,candidates:[...t]}}resolve(e){return super.has(e)?e:this.byKey.get(n9(this.kind,e))?.[0]}};function i9(e,t=[]){return new wye(e,t)}function Tye(e,t){for(let n of t)for(let t=n.indexOf(`/`);t!==-1;t=n.indexOf(`/`,t+1))e.add(n.slice(0,t));return e}function Eye(e){return e[r9]===!0}function a9(e,t){return Eye(e)?e.resolve(t):e.has(t)?t:void 0}function Dye(e,t){let n=e;return n[r9]===!0&&n.kind===t}function o9(e,t){return Dye(t,e)?t:i9(e,t)}function s9(e){return`pagesBySlug`in e}function c9(e){return s9(e)?e.pages:e}function Oye(e,t){return s9(e)?e.assetPaths??new Set:t??new Set}function kye(e,t){return s9(e)?e.filePaths??new Set:t??new Set}function Aye(e,t){let n=new Map;for(let r of e){let e=t(r),i=n.get(e);e&&(i===void 0||t9(r,i)<0)&&n.set(e,r)}return n}function jye(e,t){let n=new Map,r=[...e].sort(t9);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 Mye(e,t){let n=X6(e);if(!n)return;if(s9(t))return t.pagesBySlug.get(n);let r;for(let e of t)X6(e)===n&&(r===void 0||t9(e,r)<0)&&(r=e);return r}function Nye(e,t){if(e.includes(`/`))return;let n=X6(e);if(!n)return;if(s9(t))return t.pagesByBasename?.get(n);let r;for(let e of t){let t=e.lastIndexOf(`/`);X6(t===-1?e:e.slice(t+1))===n&&(r===void 0||t9(e,r)<0)&&(r=e)}return r}function Pye(e){let t=e.trim();if(!t)return[];let n=X6(t);return n.length>0&&n!==t?[n]:[]}function l9(e,t){let n=e.trim();if(!n)return;let r=a9(c9(t),n);if(r!==void 0)return r;let i=n.replace(/\.(md|mdx)$/i,``);if(i!==n){let e=u9(i,t);if(e!==void 0)return e}return u9(n,t)}function u9(e,t){let n=e.trim();if(!n)return;let r=c9(t),i=a9(r,n);if(i!==void 0)return i;let a=Mye(n,t);if(a)return a;for(let e of Pye(n)){let t=a9(r,e);if(t!==void 0)return t}return Fye(n,r)||Nye(n,t)}function Fye(e,t){let n=a9(t,`${e}/index`);if(n!==void 0)return n;let r=e.lastIndexOf(`/`),i=r===-1?e:e.slice(r+1);return i?a9(t,`${e}/${i}`):void 0}function Iye(e){let t=((e.trim().split(`#`)[0]??``).trim().split(`?`)[0]??``).trim();return t.startsWith(`/`)?t.slice(1):t}function Lye(e){let t=new Map;for(let n of e){let e=e9(n),r=t.get(e);(r===void 0||t9(n,r)<0)&&t.set(e,n)}return t}function d9(e){let t=o9(`file`,e),n;return e=>{let r=t.resolve(e);return r===void 0?(n??=Lye(t),n.get(e9(e))):r}}function Rye(e,t,n){let r=Iye(e);if(!r)return null;let i=n?[t,n]:[t];for(let e of i){let t=d9(e)(r);if(t!==void 0)return t}if(r.includes(`/`))return null;let a=$7(`file`,r),o=[];for(let e of i)for(let t of e){let e=t.lastIndexOf(`/`);$7(`file`,e===-1?t:t.slice(e+1))===a&&o.push(t)}return o.length===0?null:o.sort(t9)[0]??null}function zye(e,t,n){let r=Q7(e,t);return r===null||r.kind!==`asset`||Rye(r.url,Oye(n),kye(n))!==null||l9(e,n)===void 0?r:{kind:`doc`,docName:e.trim(),anchor:t?.trim()||null}}const Bye=`state/bug-reports`,Vye=yo({at:j(),transport:j(),outcome:j(),reference:j().optional(),error:j().optional(),errorCode:j().optional()}),Hye=yo({reason:j(),at:j(),errorCode:j().optional()});yo({version:M().int().catch(1),id:j(),createdAt:j(),bundleLevel:j(),zipBytes:M().int().nonnegative().catch(0),zipDeleted:N().optional(),state:j(),systemWide:N().optional(),projectSlug:j().nullable().optional(),reference:j().optional(),lastError:Hye.optional(),attempts:P(Vye).optional(),note:j().optional()});const Uye=`.sent.yaml`;yo({version:M().int().catch(1),id:j().optional(),sentAt:j().optional(),reference:j().optional()});var f9=class extends Error{envVar;constructor(e,t){super(`${e}: ${t}`),this.name=`EnvVarError`,this.envVar=e}};const p9=new Map([[`PORT`,[`server`,`port`]],[`OK_BIND`,[`server`,`bind`]],[`OK_EXTERNAL_URL`,[`server`,`externalUrl`]],[`OK_ALLOW_EXTERNAL`,[`server`,`allowExternal`]],[`OK_OPEN_BROWSER`,[`server`,`openBrowser`]],[`OK_IDLE_SHUTDOWN`,[`server`,`idleShutdown`]]]);function Wye(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1_$2`).toUpperCase()}function m9(e){return`OK_${(e[0]===`server`?e.slice(1):e).map(Wye).join(`_`)}`}function h9(e){let t=e;for(let e=0;e<16;e++){let e=t?._zod?.def;if(e===void 0||e.type!=="default"&&e.type!==`optional`&&e.type!==`nullable`)return t;t=e.innerType}return t}function Gye(e){return h9(e)?._zod?.def?.type}function Kye(e=eh){let t=[],n=(e,r)=>{let i=h9(e)?._zod?.def?.shape;if(i===void 0){r.length>0&&t.push(r);return}for(let[e,t]of Object.entries(i))n(t,[...r,e])};return n(e,[]),t}function qye(){let e=new Map;for(let t of Kye())e.set(m9(t),t);return e}function Jye(e,t,n){switch(Gye(n)){case`boolean`:if(t===`1`||t===`true`)return!0;if(t===`0`||t===`false`)return!1;throw new f9(e,`expected a boolean (1/0/true/false), got ${JSON.stringify(t)}`);case`number`:{let n=Number(t);if(!Number.isFinite(n))throw new f9(e,`expected a number, got ${JSON.stringify(t)}`);return n}case`array`:return t.split(/\s+/).filter(e=>e!==``);default:return t}}function Yye(e,t){let n=Array(t.length+1);for(let e=0;e<=t.length;e++)n[e]=e;for(let r=1;r<=e.length;r++){let i=n[0];n[0]=r;for(let a=1;a<=t.length;a++){let o=Math.min(n[a]+1,n[a-1]+1,i+(e[r-1]===t[a-1]?0:1));i=n[a],n[a]=o}}return n[t.length]}function Xye(e,t){if(e===`OK_PORT`)return{envVar:e,message:`OK_PORT is not read — the port variable is unprefixed PORT.`};let n=t.get(e);if(n!==void 0)return{envVar:e,message:`${e} maps to config key ${n.join(`.`)}, which is not env-configurable — set it in the config file instead.`};for(let t of p9.keys())if(t!==`PORT`&&Yye(e,t)<=2)return{envVar:e,message:`Unknown variable ${e} — did you mean ${t}?`};return null}function g9(e,t){let n={...e};for(let[e,r]of Object.entries(t)){if(r===void 0)continue;let t=n[e];n[e]=_9(r)&&_9(t)?g9(t,r):r}return n}function _9(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Zye(e){let t=[],n=[],r=qye();for(let[n,r]of p9){let i=e[n];if(i===void 0||i.trim()===``)continue;let a=th(eh,r);if(a===void 0)throw new f9(n,`internal: config path ${r.join(`.`)} does not resolve`);let o=Jye(n,i.trim(),a),s=a.safeParse(o);if(!s.success)throw new f9(n,`${s.error.issues.map(e=>e.message).join(`; `)||`invalid value`} (got ${JSON.stringify(i)})`);t.push({path:r,envVar:n,value:s.data})}for(let t of Object.keys(e)){if(!t.startsWith(`OK_`)||p9.has(t)||e[t]===void 0)continue;let i=Xye(t,r);i!==null&&n.push(i)}let i={};for(let{path:e,value:n}of t){let t=i;for(let n of e.slice(0,-1))t[n]??={},t=t[n];t[e[e.length-1]]=n}return{overrides:t,layer:i,diagnostics:n}}function Qye(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function $ye(e){let{value:t,file:n,source:r,doc:i}=e,a=[],o=(e,t)=>{if(t.length>0){let e=nh(eh,t);if(e!==void 0){if(e.scope===`project-local`){let e=m9(t),o;i!=null&&r!=null&&n!=null&&(o=fh({file:n,source:r,doc:i,path:t})),a.push({path:[...t],...p9.has(e)?{envVar:e}:{},...o===void 0?{}:{source:o}})}return}}if(Qye(e))for(let[n,r]of Object.entries(e))o(r,[...t,n])};return o(t,[]),a}function ebe(e){let t=e.path.join(`.`);return`${e.source===void 0?``:`${e.source.file}:${e.source.line}:${e.source.column}: `}${t} is a per-machine (project-local) setting; the value committed in .ok/config.yml is ignored. Set it in .ok/local/config.yml (this machine only)${e.envVar===void 0?``:`, or set ${e.envVar} on this host`}.`}const v9=`(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)`,tbe=RegExp(`^127\\.${v9}\\.${v9}\\.${v9}$`);function nbe(e){let t=e.trim().toLowerCase();return t===`localhost`||t===`::1`||t===`[::1]`||tbe.test(t)}function y9(e){return e.every(nbe)}function rbe(e){return!e.loopbackOnly}function ibe(e){if(e===`off`)return null;if(!zm.test(e))throw Error(`invalid idleShutdown duration: ${JSON.stringify(e)}`);let t=Number(e.slice(0,-1));switch(e.at(-1)){case`s`:return t*1e3;case`m`:return t*6e4;default:return t*36e5}}function abe(e){let t=e?.server,n=t?.bind===void 0||t.bind.length===0?Rm:t.bind,r=y9(n),i=t?.port,a=t?.externalUrl,o=(t?.allowExternal??!1)&&a!==void 0;return{port:i,bind:n,externalUrl:a,allowExternal:t?.allowExternal??!1,openBrowser:t?.openBrowser??r,idleShutdown:t?.idleShutdown??(r&&!o?`30m`:`off`),loopbackOnly:r}}const obe={"unix-chain":{1:[`macos-bundle`,`npx-fallback`],2:[`macos-bundle`,`linux-deb-bundle`,`npx-fallback`]},"windows-chain":{1:[`windows-global-cli`,`npx-fallback`]}};function b9(e){return{kind:`declined`,reason:e}}function sbe(e){if(e.command===`node`)return b9(`dev-mode`);if(typeof e.command==`string`)return Array.isArray(e.args)?e.command===`/bin/sh`?e.args.length!==3||e.args[0]!==`-l`||e.args[1]!==`-c`||typeof e.args[2]!=`string`?b9(`malformed-argv`):{envelope:`split-command-args`,family:`unix-chain`,body:e.args[2]}:e.command===`powershell`?e.args.length!==4||e.args[0]!==`-NoProfile`||e.args[1]!==`-NonInteractive`||e.args[2]!==`-Command`||typeof e.args[3]!=`string`?b9(`malformed-argv`):{envelope:`split-command-args`,family:`windows-chain`,body:e.args[3]}:b9(`foreign-command`):b9(`malformed-argv`);if(e.type!==`local`||!Array.isArray(e.command))return b9(`unknown-envelope`);let[t,...n]=e.command;return t===`node`?b9(`dev-mode`):t===`/bin/sh`?n.length!==3||n[0]!==`-l`||n[1]!==`-c`||typeof n[2]!=`string`?b9(`malformed-argv`):{envelope:`opencode-argv`,family:`unix-chain`,body:n[2]}:t===`powershell`?n.length!==4||n[0]!==`-NoProfile`||n[1]!==`-NonInteractive`||n[2]!==`-Command`||typeof n[3]!=`string`?b9(`malformed-argv`):{envelope:`opencode-argv`,family:`windows-chain`,body:n[3]}:b9(`foreign-command`)}function x9(e,t){return e===`unix-chain`?`# ok-mcp${t}-v`:`# ok-mcp${t}-win-v`}function cbe(e,t,n){let r=e.split(/\r?\n/,1)[0],i=x9(t,n);if(r===void 0||!r.startsWith(i))return null;let a=r.slice(i.length).match(/^([1-9]\d*)$/);if(a==null)return null;let o=Number(a[1]);return Number.isSafeInteger(o)?o:null}function lbe(e,t=obe,n=s().mcpChainTag){if(typeof e!=`object`||!e)return b9(`not-an-object`);let r=sbe(e);if(`kind`in r)return r;let i=cbe(r.body,r.family,n);if(i===null)return b9(`malformed-marker`);let a=t[r.family],o=Math.max(...Object.keys(a).map(Number));if(i>o)return{kind:`recognized`,disposition:`keep`,descriptor:{envelope:r.envelope,family:r.family,revision:i,knowledge:`future`,capabilities:`opaque`}};let c=a[i];return c===void 0?b9(`unknown-revision`):{kind:`recognized`,disposition:i===o?`keep`:`upgrade`,descriptor:{envelope:r.envelope,family:r.family,revision:i,knowledge:`known`,capabilities:c}}}function S9(e){return e.replace(/\/+/g,`/`).replace(/\/+$/,``)}function ube(e){return i[e].userHomeDirName}function dbe(e,t,n=`darwin`,r){return e===`stable`?n===`linux`?`${S9(r?.startsWith(`/`)?r:`${S9(t)}/.config`)}/OpenKnowledge/path-install.json`:`${S9(t)}/Library/Application Support/OpenKnowledge/path-install.json`:`${S9(t)}/${ube(e)}/path-install.json`}function fbe(e){return e===`stable`?`open-knowledge cli`:`open-knowledge ${e} cli`}function pbe(e){return e===`stable`?`open-knowledge.fish`:`open-knowledge-${e}.fish`}const mbe=`127.0.0.1`,C9=`installed-skills.json`,hbe=[`.ok`,u,C9],gbe=I(ug),_be=yo({hosts:P(j()),scope:gbe,scripts:N(),installedAt:wa(),projection:I([`symlink`,`copy`]).optional(),contentHash:j().optional()}),w9=yo({schema:L(1),skills:ko(j(),_be).default({})});function vbe(){return{schema:1,skills:{}}}function ybe(e){let t;try{t=JSON.parse(e)}catch{return null}let n=w9.safeParse(t);return n.success?n.data:null}const T9=`machine-id`,E9=`skills`,D9=`skill-placements.json`,O9=`skill-move-retained.json`,k9=`server-authority.sqlite`,A9=`server-authority-leases`,bbe=[T9,E9,Tj,`${u}/${C9}`,`${u}/${D9}`,`${u}/${O9}`,`${u}/${k9}`,`${u}/${k9}-journal`,`${u}/${A9}`];function xbe(e){let{frontmatter:t}=iu(e);if(t===``)return null;let n;try{let e=(0,su.parseDocument)(ou(t));if(e.errors.length>0)return null;n=e.toJS()}catch{return null}return typeof n!=`object`||!n||Array.isArray(n)?null:n}function j9(e,t){switch(e){case`darwin`:return[`/opt/homebrew/bin`,`/usr/local/bin`,`/opt/local/bin`,`${t}/.local/bin`,`${t}/.asdf/shims`,`${t}/.local/share/mise/shims`];case`win32`:return[];default:return[`/usr/local/bin`,`/home/linuxbrew/.linuxbrew/bin`,`${t}/.local/bin`,`${t}/.asdf/shims`,`${t}/.local/share/mise/shims`]}}function M9(e,t,n){let r=n.delimiter,i=(e??``).split(r).filter(e=>e.length>0),a=new Set(i),o=[];for(let e of t)!a.has(e)&&n.isDir(e)&&(a.add(e),o.push(e));return[...i,...o].join(r)}function Sbe(e,t){return M9(e,j9(t.platform,t.homeDir),t)}function Cbe(e,t){switch(e){case`darwin`:return[`${t}/Library/pnpm`,`${t}/.bun/bin`,`${t}/.volta/bin`,`${t}/.yarn/bin`,`${t}/.npm-global/bin`];case`win32`:return[];default:return[`${t}/.local/share/pnpm`,`${t}/.bun/bin`,`${t}/.volta/bin`,`${t}/.yarn/bin`,`${t}/.npm-global/bin`]}}function wbe(e,t){return M9(e,[...j9(t.platform,t.homeDir),...Cbe(t.platform,t.homeDir)],t)}`${d}`;const N9=`:(literal)`;function P9(e){if(e===``)throw Error(`toPathspec: empty path. ":(literal)" is an empty pattern that matches every tracked path; pass "." if you meant the repo root.`);return`${N9}${e}`}function Tbe(e){if(e.length===0)throw Error(`pathspecArgs: empty path list. A bare "--" removes the pathspec restriction rather than selecting nothing.`);return[`--`,...e.map(e=>P9(e))]}function Ebe(e){return e.replaceAll(N9,``)}const F9=[{tagName:`Mirror`,attrName:`src`,resolution:`bare-doc-name`},{tagName:`Excalidraw`,attrName:`src`,resolution:`doc-relative`}];for(let e of F9){let t=t2.find(t=>t.name===e.tagName);if(!t)throw Error(`JSX_SRC_REF_TAGS: no built-in component descriptor named '${e.tagName}' — the rename-rewrite and backlink passes for this entry would silently never match. Fix the tagName to match a descriptor in builtInComponents.`);if(!t.props.some(t=>t.name===e.attrName))throw Error(`JSX_SRC_REF_TAGS: component '${e.tagName}' declares no prop named '${e.attrName}' — the rename-rewrite and backlink passes for this entry would silently never match. Fix the attrName to match one of the descriptor's props.`)}const Dbe=d4(),Obe=R2(),kbe=z2();function Abe(){return t2.filter(e=>e.surface===`canonical`&&e.name!==`*`)}function jbe(){return Abe().filter(e=>{let t=I9(e);return t!==`fence`&&t!==`html`})}function I9(e){return e.name===`MermaidFence`?`fence`:e.name===`HtmlAlignBlock`?`html`:e.hasChildren?`jsx-block`:`jsx-void`}function Mbe(e){return{id:e.name,displayName:e.displayName??e.name,description:e.description??``,kind:I9(e)}}function Nbe(e){if(e.hidden!==!0&&e.type!==`reactnode`){if(`defaultValue`in e&&e.defaultValue!==void 0)return e.defaultValue;if(e.type===`enum`)return e.enumValues[0];if(e.type===`string`)return``;if(e.type===`number`)return 0;if(e.type===`boolean`)return!1}}function Pbe(e,t){return!(e.omitOnDefault===!0&&`defaultValue`in e&&Object.is(e.defaultValue,t)||e.type===`string`&&e.required===!1&&e.defaultValue===void 0&&t===``)}function Fbe(e){let t=[];for(let n of e.props){let e=Nbe(n);e!==void 0&&Pbe(n,e)&&t.push(w0(n.name,e))}return t}function Ibe(e){return $T(e.exampleBody&&e.exampleBody.trim().length>0?e.exampleBody:`Body content here.`,{extensions:[Dbe],mdastExtensions:[Obe]}).children}function Lbe(e){let t=I9(e),n;if(t===`fence`)n={type:`code`,lang:`mermaid`,meta:null,value:e.exampleBody&&e.exampleBody.trim().length>0?e.exampleBody:`graph LR
|
|
397
|
+
A --> B`};else{let r=Fbe(e),i=t===`jsx-block`?Ibe(e):[];n={type:`mdxJsxFlowElement`,name:e.name,attributes:r,children:i}}return gx({type:`root`,children:[n]},{extensions:[kbe]}).trimEnd()}function Rbe(e){let t=[];for(let n of e.props){if(n.hidden===!0)continue;let e={name:n.name,type:n.type,required:n.required};n.description!==void 0&&(e.description=n.description),n.advanced===!0&&(e.advanced=!0),n.omitOnDefault===!0&&(e.omitOnDefault=!0),n.type===`enum`&&(e.values=n.enumValues,n.defaultValue!==void 0&&(e.defaultValue=n.defaultValue)),n.type===`string`&&(n.defaultValue!==void 0&&(e.defaultValue=n.defaultValue),n.language!==void 0&&(e.language=n.language),n.accept!==void 0&&(e.accept=n.accept)),n.type===`boolean`&&n.defaultValue!==void 0&&(e.defaultValue=n.defaultValue),n.type===`number`&&n.defaultValue!==void 0&&(e.defaultValue=n.defaultValue),t.push(e)}return t}function zbe(e){return{...Mbe(e),example:Lbe(e),params:Rbe(e)}}const L9=Symbol.for(`@inkeep/open-knowledge/skill-state-field-registry`),R9=globalThis;R9[L9]===void 0&&(R9[L9]=Vr());const z9=R9[L9],Bbe=`skill-state.yml`,Vbe=[`claude-cowork`,`cli-hosts`],Hbe=[`server-build-and-open`,`electron-build-and-open`,`cli-npx-skills-add`,`desktop-direct`,`cli-start`],B9=/^\d+\.\d+\.\d+(?:[-+][\w.-]+)?$/,V9=yo({version:j().regex(B9,`version must match /^\\d+\\.\\d+\\.\\d+(?:[-+][\\w.-]+)?$/`).register(z9,{description:`Recorded skill version for this target.`}),recordedAt:wa().register(z9,{description:`ISO 8601 timestamp of the most recent successful write. Updated on every write, including reinstalls of the same version.`}),surface:I(Hbe).register(z9,{description:`Install-source surface that recorded this entry.`}).optional()}),Ube=yo({enabled:N().register(z9,{description:`Whether this user-global skill bundle is opted in.`}),decidedAt:wa().register(z9,{description:`ISO 8601 timestamp of the opt-in / opt-out decision.`})}),Wbe=yo({schema:L(1).register(z9,{description:`Schema major version. Bumped only on breaking shape changes.`}),targets:yo({"claude-cowork":V9.optional(),"cli-hosts":V9.optional()}).register(z9,{description:`Per-target install-state entries. Absent target = no recorded install.`}).default({}),bundles:ko(j(),Ube).register(z9,{description:`Per-bundle opt-in decisions keyed by install name. Absent key = no recorded decision.`}).optional(),installsReported:P(j()).register(z9,{description:"Skill installs already reported to skills.sh from this machine, as `<owner/repo>#<skill>`. Append-only; presence suppresses a re-report."}).optional()});function Gbe(e,t){return e??t.installedOnDisk}function Kbe(){return{schema:1,targets:{}}}const H9=`template`;function U9(e){if(e.trim()===``)return{};let t;try{t=(0,su.parse)(e)}catch{return{}}return typeof t!=`object`||!t||Array.isArray(t)?{}:t}function W9(e,t){return e.trim()===``?t:`---\n${e}\n---\n${t}`}function qbe(e){let{frontmatter:t,body:n}=iu(e);return t===``?{docFrontmatterText:``,markdown:e}:{docFrontmatterText:ou(t),markdown:n}}function Jbe(e){let t=e.split(`
|
|
398
|
+
`);if(!(t[0]??``).startsWith(`template:`))return null;let n=[t[0]??``],r=1;for(;r<t.length;){let e=t[r]??``;if(/^[ \t]/.test(e)){n.push(e),r++;continue}if(e.trim()===``){let i=r+1;for(;i<t.length&&(t[i]??``).trim()===``;)i++;if(i<t.length&&/^[ \t]/.test(t[i]??``)){n.push(e),r++;continue}}break}let i=U9(n.join(`
|
|
399
|
+
`))[H9];return{identity:typeof i==`object`&&i&&!Array.isArray(i)?i:{},docFrontmatterText:t.slice(r).join(`
|
|
400
|
+
`).replace(/\n+$/,``)}}function G9(e){let t=e.charCodeAt(0)===65279?e.slice(1):e,{frontmatter:n,body:r}=iu(t);if(n===``)return{identity:{},starterContent:t};let i=ou(n),a=Jbe(i);if(a)return{identity:a.identity,starterContent:W9(a.docFrontmatterText,r)};let{frontmatter:o}=iu(r);if(o!==``)return{identity:U9(i),starterContent:r};let s=U9(i);return typeof s.title==`string`?{identity:s,starterContent:r}:{identity:{},starterContent:W9(i,r)}}function Ybe(e,t){let{docFrontmatterText:n,markdown:r}=qbe(t),i={};for(let[t,n]of Object.entries(e))n!==void 0&&(i[t]=n);let a=(0,su.stringify)({[H9]:i});return`---\n${n.trim()===``?a:`${a}${n}\n`}---\n${r}`}function Xbe(e){return G9(e).starterContent}const Zbe=`core-base`;function K9(e){let t=e;return t.startsWith(`./`)&&(t=t.slice(2)),t.startsWith(`/`)&&(t=t.slice(1)),t}function q9(e){let t=e.lastIndexOf(`/`);return t===-1?e:e.slice(t+1)}function J9(e){let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)}function Y9(e){return e.split(`/`).filter(e=>e!==``)}function Qbe(e,t){let n=J9(t);return e===``||n===e||n.startsWith(`${e}/`)}function X9(e,t){let n=J9(t);if(e===n)return 0;let r=e===``?n:n.slice(e.length+1);return r===``?0:Y9(r).length}function Z9(e,t){let n=Y9(e),r=Y9(t),i=0;for(;i<n.length&&i<r.length&&n[i]===r[i];)i++;return n.length-i+(r.length-i)}function $be(){let e=new Map;function t(t){let n=K9(t);if(n===``)return;let r=q9(n);if(r===``)return;let i=$7(`file`,r),a=e.get(i);if(!a){e.set(i,[n]);return}a.includes(n)||a.push(n)}function n(t){let n=K9(t),r=$7(`file`,q9(n)),i=e.get(r);if(!i)return;let a=i.indexOf(n);a!==-1&&(i.splice(a,1),i.length===0&&e.delete(r))}function r(e,r){n(e),t(r)}function i(t,n){let r=$7(`file`,t),i=e.get(r);if(!i||i.length===0)return null;if(i.length===1)return i[0];let a=J9(K9(n)),o=[],s=[];for(let e of i)Qbe(a,e)?o.push(e):s.push(e);return o.length>0?(e=>{let t=e[0],n=X9(a,t);for(let r=1;r<e.length;r++){let i=e[r],o=X9(a,i);(o<n||o===n&&i<t)&&(t=i,n=o)}return t})(o):(e=>{let t=e[0],n=Z9(a,J9(t));for(let r=1;r<e.length;r++){let i=e[r],o=Z9(a,J9(i));(o<n||o===n&&i<t)&&(t=i,n=o)}return t})(s)}function a(){let t=new Map;for(let[n,r]of e)t.set(n,[...r]);return t}function o(){e.clear()}return{add:t,remove:n,rename:r,resolveEmbed:i,clear:o,snapshot:a,size:()=>e.size}}function exe(e){if(!e)return[];let t=e.split(`/`),n=[],r=``;for(let e of t)r=r?`${r}/${e}`:e,n.push(r);return n}function txe(e,t){if(e.size===0)return new Set;if(t===``)return new Set(e);let n=new Set,r=`${t}/`;for(let i of e)(i===t||i.startsWith(r))&&n.add(i);return n}function Q9(e){let t=e?.trim();return t===void 0||t===``?void 0:t}function nxe(e){return e.reason!==void 0||Q9(e.note)!==void 0||Q9(e.email)!==void 0}function rxe(e){let t;try{t=new URL(e)}catch{return null}if(t.protocol===`https:`)return t;let n=t.hostname===`localhost`||t.hostname===`127.0.0.1`||t.hostname===`[::1]`;return t.protocol===`http:`&&n?t:null}function ixe(){return rxe((typeof process>`u`?void 0:Q9(process.env?.OK_FEEDBACK_INTAKE_ORIGIN))??`https://openknowledge.ai`)}function axe(e){let t=Q9(e);if(t!==void 0)return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)?t:void 0}async function $9(e,t,n){try{let r=await fetch(e,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(t),signal:AbortSignal.timeout(n)});if(r.ok){let e=await r.json().catch(()=>null);return{ok:!0,reference:typeof e?.reference==`string`?e.reference:``}}return r.status===400||r.status===413?{ok:!1,reason:`invalid`}:r.status===503?{ok:!1,reason:`unavailable`}:{ok:!1,reason:`error`}}catch(e){return{ok:!1,reason:e instanceof Error&&(e.name===`TimeoutError`||e.name===`AbortError`)?`timeout`:`error`}}}async function oxe(e,t={}){let n=ixe();if(n===null)return{ok:!1,reason:`error`};let r=new URL(`/api/feedback`,n),i=Q9(e.note),a=axe(e.email),o={kind:`uninstall`,reasons:e.reason===void 0?[]:[e.reason],...i===void 0?{}:{message:i},appVersion:e.appVersion,platform:e.platform,source:e.source},s=Date.now()+(t.timeoutMs??4e3),c=()=>s-Date.now();if(a===void 0)return $9(r,o,c());let l=await $9(r,{...o,email:a},c());return l.ok||l.reason!==`invalid`||c()<=0?l:$9(r,o,c())}const sxe=new Fde({extensions:lY,deriveStructuralFreshness:!0}),cxe=UV(lY);export{Ebe as $,pj as $a,mh as $c,St as $d,mfe as $i,Hte as $l,Cpe as $n,P_ as $o,ghe as $r,Wne as $s,z8 as $t,pu as $u,vbe as A,LY as Aa,lg as Ac,so as Ad,Ghe as Ai,Ym as Al,qpe as An,zO as Ao,Zfe as Ar,ere as As,eye as At,Df as Au,xbe as B,Lj as Ba,xg as Bc,Do as Bd,Mme as Bi,hne as Bl,epe as Bn,cj as Bo,Bhe as Br,l_ as Bs,yve as Bt,zd as Bu,g9 as C,r3 as Ca,tg as Cc,I as Cd,O as Cf,Dhe as Ci,ym as Cl,Dfe as Cn,RA as Co,dme as Cr,Qne as Cs,J7 as Ct,Md as Cu,Ybe as D,UY as Da,ig as Dc,N as Dd,She as Di,Fm as Dl,Qpe as Dn,ij as Do,Fme as Dr,Xne as Ds,_ye as Dt,af as Du,lbe as E,l2 as Ea,ng as Ec,P as Ed,Gme as Ei,Im as El,zfe as En,rj as Eo,C8 as Er,N_ as Es,mye as Et,ate as Eu,nxe as F,ZU as Fa,fg as Fc,F as Fd,upe as Fi,Qm as Fl,c8 as Fn,gk as Fo,gme as Fr,Une as Fs,$ve as Ft,yf as Fu,dbe as G,Aj as Ga,Xh as Gc,Ma as Gd,Pme as Gi,ene as Gl,d8 as Gn,aA as Go,uhe as Gr,y_ as Gs,tge as Gt,td as Gu,G9 as H,kj as Ha,yg as Hc,po as Hd,Ame as Hi,dne as Hl,spe as Hn,WA as Ho,L8 as Hr,d_ as Hs,Cve as Ht,nf as Hu,ibe as I,PP as Ia,dg as Ic,Io as Id,Rme as Ii,Um as Il,u8 as In,DA as Io,_me as Ir,h_ as Is,N7 as It,rte as Iu,zbe as J,jj as Ja,Kh as Jc,ti as Jd,Dme as Ji,wp as Jl,Tpe as Jn,sj as Jo,phe as Jr,b_ as Js,Zhe as Jt,Cu as Ju,Tbe as K,zj as Ka,Uh as Kc,wa as Kd,Ome as Ki,Fp as Kl,ipe as Kn,QA as Ko,dhe as Kr,v_ as Ks,$he as Kt,Mu as Ku,Xbe as L,U as La,pg as Lc,ss as Ld,zme as Li,mm as Ll,Yfe as Ln,kA as Lo,yme as Lr,__ as Ls,Bve as Lt,cf as Lu,exe as M,OY as Ma,cg as Mc,L as Md,Khe as Mi,Hm as Ml,wme as Mn,tk as Mo,vme as Mr,Bne as Ms,oye as Mt,uf as Mu,ebe as N,iW as Na,ug as Nc,yo as Nd,qhe as Ni,Xm as Nl,Tme as Nn,oj as No,mme as Nr,Qg as Ns,nye as Nt,ute as Nu,$be as O,WY as Oa,rg as Oc,rs as Od,Che as Oi,pm as Ol,$pe as On,MA as Oo,E8 as Or,rre as Os,W7 as Ot,hf as Ou,jbe as P,YU as Pa,eg as Pc,M as Pd,Wpe as Pi,Vm as Pl,Pfe as Pn,PA as Po,hme as Pr,Vne as Ps,Qve as Pt,Ud as Pu,abe as Q,Cj as Qa,Ch as Qc,bt as Qd,Mpe as Qi,Zte as Ql,gpe as Qn,L_ as Qo,hhe as Qr,jne as Qs,V8 as Qt,uu as Qu,y9 as R,Bj as Ra,Cg as Rc,ko as Rd,Sme as Ri,xm as Rl,Xfe as Rn,PO as Ro,Mhe as Rr,e_ as Rs,P7 as Rt,df as Ru,Zbe as S,f6 as Sa,Pg as Sc,Fo as Sd,ge as Sf,whe as Si,Dm as Sl,Sfe as Sn,SA as So,ume as Sr,H_ as Ss,K7 as St,jd as Su,Sbe as T,t3 as Ta,ag as Tc,uo as Td,ce as Tf,Wme as Ti,Lm as Tl,Rfe as Tn,RO as To,M8 as Tr,Zne as Ts,dye as Tt,dte as Tu,fbe as U,Ij as Ua,wg as Uc,ro as Ud,jme as Ui,fne as Ul,Upe as Un,GA as Uo,I8 as Ur,m_ as Us,Qhe as Ut,Nd as Uu,ybe as V,Rj as Va,gg as Vc,xo as Vd,Eme as Vi,gne as Vl,tpe as Vn,UA as Vo,Rhe as Vr,u_ as Vs,Ive as Vt,gf as Vu,pbe as W,Nj as Wa,Og as Wc,to as Wd,Nme as Wi,Ip as Wl,Lfe as Wn,YA as Wo,$me as Wr,s_ as Ws,nge as Wt,xf as Wu,Gbe as X,_j as Xa,bh as Xc,wn as Xd,Npe as Xi,Bte as Xl,mpe as Xn,QE as Xo,vhe as Xr,Ene as Xs,U8 as Xt,vu as Xu,rbe as Y,fj as Ya,Th as Yc,dr as Yd,Fpe as Yi,Ute as Yl,Epe as Yn,iD as Yo,yhe as Yr,Dne as Ys,B8 as Yt,hu as Yu,Zye as Z,gj as Za,xh as Zc,vt as Zd,Ppe as Zi,Cp as Zl,hpe as Zn,F_ as Zo,mhe as Zr,kne as Zs,H8 as Zt,lu as Zu,Bbe as _,Zde as _a,kg as _c,Sc as _d,de as _f,Ahe as _i,Pm as _l,sme as _n,_k as _o,_fe as _r,ev as _s,Q7 as _t,Cf as _u,hbe as a,v8 as aa,i_ as ac,tu as ad,k as af,bhe as ai,fh as al,kfe as an,FO as ao,Spe as ar,mv as as,zye as at,hp as au,Wbe as b,ude as ba,jg as bc,Ls as bd,ue as bf,Qme as bi,km as bl,wfe as bn,HO as bo,ame as br,Q_ as bs,q7 as bt,xd as bu,T9 as c,Bme as ca,Xg as cc,pl as cd,be as cf,j8 as ci,Eh as cl,jfe as cn,pA as co,Vpe as cr,W_ as cs,o9 as ct,kte as cu,A9 as d,zhe as da,Mne as dc,Wc as dd,re as df,lhe as di,ch as dl,Xpe as dn,cA as do,Ipe as dr,dv as ds,Cye as dt,$f as du,cme as ea,Gne as ec,au as ed,wt as ef,_he as ei,Ah as el,Ape as en,vj as eo,wpe as er,I_ as es,txe as et,Vte as eu,k9 as f,T8 as fa,zne as fc,Dl as fd,ie as ff,the as fi,ih as fl,Zpe as fn,yA as fo,Hpe as fr,lv as fs,n9 as ft,_te as fu,D9 as g,tfe as ga,Fg as gc,Oc as gd,le as gf,Xme as gi,jm as gl,ome as gn,Dk as go,vfe as gr,bv as gs,bye as gt,Pd as gu,O9 as h,m8 as ha,Rg as hc,kc as hd,oe as hf,Yme as hi,eh as hl,lpe as hn,fA as ho,eme as hr,yv as hs,yye as ht,gte as hu,f9 as i,Lhe as ia,Jg as ic,Jl as id,A as if,Yhe as ii,Dh as il,Afe as in,rA as io,ype as ir,K_ as is,d9 as it,Fte as iu,Kbe as j,PY as ja,sg as jc,To as jd,Kme as ji,yne as jl,Cme as jn,lj as jo,Qfe as jr,$ne as js,tye as jt,kf as ju,$ye as k,GY as ka,hg as kc,Co as kd,Whe as ki,vne as kl,Hfe as kn,nj as ko,w8 as kr,tre as ks,uye as kt,Bd as ku,Uye as l,she as la,Zg as lc,Nl as ld,ve as lf,ehe as li,yh as ll,e8 as ln,mA as lo,zpe as lr,fv as ls,i9 as lt,ip as lu,E9 as m,Ihe as ma,zg as mc,Ac as md,fe as mf,Jme as mi,Cm as ml,Ype as mn,jA as mo,nme as mr,uv as ms,e9 as mt,yte as mu,cxe as n,D8 as na,r_ as nc,ou as nd,Je as nf,Vme as ni,Sh as nl,nfe as nn,aj as no,vpe as nr,G_ as ns,jye as nt,Yte as nu,w9 as o,Phe as oa,a_ as oc,Xc as od,we as of,Hhe as oi,jh as ol,cfe as on,UO as oo,dpe as or,hv as os,l9 as ot,Ote as ou,bbe as p,che as pa,S_ as pc,hl as pd,ae as pf,qme as pi,ah as pl,Jpe as pn,TA as po,ope as pr,sv as ps,$7 as pt,bte as pu,oxe as q,Pj as qa,Yh as qc,Sa as qd,kme as qi,Sp as ql,ape as qn,oA as qo,fhe as qr,Cne as qs,ege as qt,wu as qu,mbe as r,npe as ra,Yg as rc,Zl as rd,Ie as rf,Uhe as ri,_h as rl,sfe as rn,VO as ro,bpe as rr,pv as rs,Aye as rt,Qte as ru,F9 as s,Lme as sa,qg as sc,Vl as sd,xe as sf,xhe as si,Oh as sl,lfe as sn,FA as so,ppe as sr,vv as ss,Tye as st,Ate as su,sxe as t,lme as ta,o_ as tc,iu as td,gt as tf,Ehe as ti,kh as tl,jpe as tn,wj as to,_pe as tr,av as ts,P9 as tt,Xte as tu,Bye as u,h8 as ua,Rne as uc,Yc as ud,ne as uf,nhe as ui,oh as ul,yfe as un,bA as uo,Lpe as ur,U_ as us,a9 as ut,vte as uu,Vbe as v,Jde as va,Ng as vc,jc as vd,E as vf,jhe as vi,Nm as vl,gfe as vn,EA as vo,hfe as vr,B_ as vs,Z7 as vt,ote as vu,wbe as w,n3 as wa,og as wc,co as wd,me as wf,khe as wi,zm as wl,Efe as wn,tj as wo,b8 as wr,nre as ws,pye as wt,Yd as wu,H9 as x,p6 as xa,Ag as xc,oo as xd,pe as xf,_8 as xi,Om as xl,s8 as xn,wA as xo,rpe as xr,tv as xs,vye as xt,bd as xu,B9 as y,X6 as ya,Mg as yc,Ic as yd,_e as yf,Zme as yi,Mm as yl,Cfe as yn,AA as yo,ime as yr,nv as ys,xye as yt,ite as yu,x9 as z,Ej as za,Dg as zc,j as zd,bme as zi,dm as zl,Ufe as zn,qO as zo,R8 as zr,c_ as zs,w7 as zt,_f as zu};
|