@inkeep/open-knowledge 0.30.0-beta.0 → 0.30.0-beta.2
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/{_baseFor-m0TxKeb9.mjs → _baseFor-DZZBdGCl.mjs} +1 -1
- package/dist/alias-JE7RI5QX-DCQQF1DX.mjs +1 -0
- package/dist/{arc-Doj9VrmJ.mjs → arc-ZIh9aOme.mjs} +2 -2
- package/dist/architecture-YZFGNWBL-BjBc8yjs.mjs +1 -0
- package/dist/{architectureDiagram-Q4EWVU46-Dwlx8W7J.mjs → architectureDiagram-Q4EWVU46-B9_FLf6A.mjs} +2 -2
- package/dist/{array-1jkOhClC.mjs → array-DzQVq_wL.mjs} +1 -1
- package/dist/assets/skills/discovery/SKILL.md +3 -8
- package/dist/assets/skills/project/SKILL.md +2 -2
- package/dist/assets/skills/project/references/anti-patterns.md +2 -2
- package/dist/assets/skills/project/references/preview.md +6 -7
- package/dist/{awk2-BBAGSFUB-Clvg_OoV.mjs → awk2-BBAGSFUB-J2xHCDg9.mjs} +1 -1
- package/dist/{banner-BxCFCyu8.mjs → banner-BLebOalA.mjs} +1 -1
- package/dist/{base64-4YMZCVJ5-bqN_UBX0.mjs → base64-4YMZCVJ5-7sdZaIym.mjs} +1 -1
- package/dist/{basename-AA2KJYZQ-GWPOMupJ.mjs → basename-AA2KJYZQ-2wWbuvGo.mjs} +1 -1
- package/dist/bash-IJWYRKFO-DZw47AKL.mjs +1 -0
- package/dist/{blockDiagram-DXYQGD6D-D_l7RLVS.mjs → blockDiagram-DXYQGD6D-CDF9Ye8Y.mjs} +2 -2
- package/dist/{c4Diagram-AHTNJAMY-QadWjRVL.mjs → c4Diagram-AHTNJAMY-Bckbt7OJ.mjs} +2 -2
- package/dist/{cat-RDUMLXKC-Cqi4_PjZ.mjs → cat-RDUMLXKC-CokinDWR.mjs} +1 -1
- package/dist/channel-DR5xnYq9.mjs +2 -0
- package/dist/{chmod-SYMGL4JA-C_dD-tNl.mjs → chmod-SYMGL4JA-BgW31dpi.mjs} +1 -1
- package/dist/{chokidar-D1eNAlbX.mjs → chokidar-987bEGiR.mjs} +1 -1
- package/dist/{chunk-2KRD3SAO-BXl7sX-7.mjs → chunk-2KRD3SAO-CS4H0Mr8.mjs} +2 -2
- package/dist/{chunk-2TRDZQLB-C2G-sahM.mjs → chunk-2TRDZQLB-FBZrMh7I.mjs} +1 -1
- package/dist/{chunk-336JU56O-5giJrfiv.mjs → chunk-336JU56O-41A5UOXQ.mjs} +2 -2
- package/dist/{chunk-3BS5SKQH-HZ1-1bfb.mjs → chunk-3BS5SKQH-BgobawvM.mjs} +3 -3
- package/dist/{chunk-3H6UQG3A-DdNaIxPm.mjs → chunk-3H6UQG3A-81boVLpx.mjs} +2 -2
- package/dist/{chunk-3ZUFRYJ4-Bv1jGN68.mjs → chunk-3ZUFRYJ4-BvA54ZND.mjs} +1 -1
- package/dist/chunk-426QAEUC-BMDn-Km8.mjs +2 -0
- package/dist/{chunk-4BX2VUAB-DM-mXRDw.mjs → chunk-4BX2VUAB-qQBUBIK0.mjs} +2 -2
- package/dist/{chunk-4GTNDTRF-DLnFbNSw.mjs → chunk-4GTNDTRF-l-JvU_6a.mjs} +2 -2
- package/dist/{chunk-4HHKTUW3-Ct4ue15f.mjs → chunk-4HHKTUW3-B-MXADMt.mjs} +1 -1
- package/dist/{chunk-4Q4SM6WR-CAvCnPq5.mjs → chunk-4Q4SM6WR-Dgi6n3oq.mjs} +2 -2
- package/dist/{chunk-4TB4RGXK-DWREoP49.mjs → chunk-4TB4RGXK-EuzZYGK6.mjs} +2 -2
- package/dist/{chunk-55IACEB6-Cmyc0XwJ.mjs → chunk-55IACEB6-BWXxTtYm.mjs} +2 -2
- package/dist/{chunk-55VFSPNA-RFvY6zq0.mjs → chunk-55VFSPNA-Bi0b3AwI.mjs} +2 -2
- package/dist/{chunk-5FUZZQ4R-DFR5eSi-.mjs → chunk-5FUZZQ4R-BQ_uOgdA.mjs} +2 -2
- package/dist/{chunk-5PVQY5BW-C5V4E1lO.mjs → chunk-5PVQY5BW-Bv35hkyA.mjs} +2 -2
- package/dist/{chunk-5QVNJEHU-BV0xuiYW.mjs → chunk-5QVNJEHU-HZCmTBXX.mjs} +2 -2
- package/dist/{chunk-5V6VZH6T-ByuVaPWr.mjs → chunk-5V6VZH6T-DtvstltO.mjs} +2 -2
- package/dist/{chunk-62RKD26F-K5NW6_Si.mjs → chunk-62RKD26F-BCWvPKD3.mjs} +2 -2
- package/dist/{chunk-64BAICW3-BlirlXmE.mjs → chunk-64BAICW3-ldBoH9M8.mjs} +2 -2
- package/dist/{chunk-67CJDMHE-C58W8DAL.mjs → chunk-67CJDMHE-DDQINw-J.mjs} +2 -2
- package/dist/{chunk-6Z5SFZXK-C3WlMqq-.mjs → chunk-6Z5SFZXK-DHOjsS81.mjs} +2 -2
- package/dist/{chunk-74CEPOFO-V0JXh91S.mjs → chunk-74CEPOFO-BnsihHv5.mjs} +1 -1
- package/dist/{chunk-7L36YK2X-B3QRwLbB.mjs → chunk-7L36YK2X-B6FqeSqt.mjs} +1 -1
- package/dist/{chunk-7N4EOEYR-DzEIb3Sc.mjs → chunk-7N4EOEYR-BzlThL0w.mjs} +2 -2
- package/dist/{chunk-7TSDKFEO-CMVuiOdP.mjs → chunk-7TSDKFEO-toaIg90F.mjs} +1 -1
- package/dist/{chunk-A4HU7SVR-Bjuqsbev.mjs → chunk-A4HU7SVR-hpfRmc5Q.mjs} +1 -1
- package/dist/{chunk-A4JSPFCI-BA544Kdp.mjs → chunk-A4JSPFCI-DiA7Hz_1.mjs} +2 -2
- package/dist/{chunk-A65PWWJC-GGt9898w.mjs → chunk-A65PWWJC-BZ0ifC4p.mjs} +2 -2
- package/dist/{chunk-A7A2DBEE-BqvlRSRw.mjs → chunk-A7A2DBEE-CTyGeCV-.mjs} +1 -1
- package/dist/{chunk-A7ICOL4V-D5TsVU6v.mjs → chunk-A7ICOL4V-Mvr5jw7a.mjs} +2 -2
- package/dist/{chunk-AA7GKIK3-DKgpQZxa.mjs → chunk-AA7GKIK3-CIHY93mN.mjs} +2 -2
- package/dist/{chunk-ALLTKNUZ-4H3OLfNN.mjs → chunk-ALLTKNUZ-_L2HGfkh.mjs} +2 -2
- package/dist/{chunk-APT7OOP2-DnIeUlVe.mjs → chunk-APT7OOP2-Dtyp8EZq.mjs} +2 -2
- package/dist/{chunk-BSJP7CBP-BG3yJGkJ.mjs → chunk-BSJP7CBP-DLDhpSB6.mjs} +2 -2
- package/dist/{chunk-CIAEETIT-CH33zQ9L.mjs → chunk-CIAEETIT-CFi4NG_D.mjs} +2 -2
- package/dist/{chunk-D4J545R4-KlK3EOFl.mjs → chunk-D4J545R4-BtxtW2-r.mjs} +2 -2
- package/dist/{chunk-D6CWQ5DW-CaV8X9is.mjs → chunk-D6CWQ5DW-Cv88ySaX.mjs} +2 -2
- package/dist/{chunk-D7MEQ3VN-BM_kIbvf.mjs → chunk-D7MEQ3VN-s3ii1vV3.mjs} +2 -2
- package/dist/{chunk-DBKNVD4L-BVx-WyDG.mjs → chunk-DBKNVD4L-CXGQWbr1.mjs} +2 -2
- package/dist/{chunk-DCAAORBQ-BUMlCZ4-.mjs → chunk-DCAAORBQ-Cwpta7jB.mjs} +2 -2
- package/dist/{chunk-EDXVE4YY-B_wA-KGy.mjs → chunk-EDXVE4YY-CypRnEuH.mjs} +2 -2
- package/dist/{chunk-EEXR5ZDP-CvpAxUxM.mjs → chunk-EEXR5ZDP-Cg_MqHXw.mjs} +1 -1
- package/dist/{chunk-EIZGF4BS-C8wRSfCC.mjs → chunk-EIZGF4BS-BcAccPFl.mjs} +2 -2
- package/dist/{chunk-ENJZ2VHE-DwiyImt2.mjs → chunk-ENJZ2VHE-dY0aiIZS.mjs} +2 -2
- package/dist/{chunk-F23WWYKW-DLeNVzzD.mjs → chunk-F23WWYKW-hlCDVuyH.mjs} +2 -2
- package/dist/{chunk-FMBD7UC4-CAloFUY3.mjs → chunk-FMBD7UC4-DWi7gSvW.mjs} +2 -2
- package/dist/{chunk-FOC6F5B3-Cv5O0Fxp.mjs → chunk-FOC6F5B3-DWNL6Y45.mjs} +2 -2
- package/dist/{chunk-GCTKCWKD-D3J1Ev9z.mjs → chunk-GCTKCWKD-Ca87JXBd.mjs} +1 -1
- package/dist/{chunk-GOV5EKKI-x0jEbztj.mjs → chunk-GOV5EKKI-B5v6YeVX.mjs} +2 -2
- package/dist/{chunk-GXVXFKBA-D0BDCtkE.mjs → chunk-GXVXFKBA-CtGvxFMt.mjs} +2 -2
- package/dist/{chunk-HDQ56CKY-DZc2LbWr.mjs → chunk-HDQ56CKY-Dw8W-PIc.mjs} +2 -2
- package/dist/{chunk-HJQJAYMS-BS_JF11O.mjs → chunk-HJQJAYMS-QHp_mUpd.mjs} +1 -1
- package/dist/{chunk-HJWBQKYG-DknkBuxy.mjs → chunk-HJWBQKYG-pJ7ff6Os.mjs} +2 -2
- package/dist/{chunk-HKLCLINH-DwmCAW4U.mjs → chunk-HKLCLINH-FUIlJZ9Y.mjs} +3 -3
- package/dist/{chunk-HL6NGDO2-978327U5.mjs → chunk-HL6NGDO2-CONVsScQ.mjs} +2 -2
- package/dist/{chunk-HWKDQ44K-BJxdK4fT.mjs → chunk-HWKDQ44K-1iwkoMQO.mjs} +2 -2
- package/dist/{chunk-I57KEIP3-DpiJySG6.mjs → chunk-I57KEIP3-ok19Mtn9.mjs} +1 -1
- package/dist/{chunk-ICPOFSXX-D0MVsm4H.mjs → chunk-ICPOFSXX-d7VyKeM8.mjs} +2 -2
- package/dist/{chunk-JVPRLUMK-D6CRdXSO.mjs → chunk-JVPRLUMK-cjhtQJTo.mjs} +2 -2
- package/dist/{chunk-K5T4RW27-BPgPjo39.mjs → chunk-K5T4RW27-CkUFJKhh.mjs} +2 -2
- package/dist/{chunk-K6LIBGJA-DpjaSGfc.mjs → chunk-K6LIBGJA-RtZC97IJ.mjs} +2 -2
- package/dist/{chunk-KGLVRYIC-CmkADDeV.mjs → chunk-KGLVRYIC-CBBBeMsl.mjs} +2 -2
- package/dist/{chunk-KMEYNNUA-Qk0eg7gN.mjs → chunk-KMEYNNUA-DG96DsNs.mjs} +2 -2
- package/dist/{chunk-KRBPSX3W-nYEMVABW.mjs → chunk-KRBPSX3W-plcpns8G.mjs} +2 -2
- package/dist/{chunk-LIHQZDEY-Fy8O-IVI.mjs → chunk-LIHQZDEY-clY2P5Xu.mjs} +2 -2
- package/dist/{chunk-LL3S3NLB-CH16p_-s.mjs → chunk-LL3S3NLB-YW2mgOlX.mjs} +2 -2
- package/dist/{chunk-LTZRCH7N-BfgCUlp9.mjs → chunk-LTZRCH7N-CyLjQtsr.mjs} +2 -2
- package/dist/{chunk-LWEGUNWT-DhbhFY11.mjs → chunk-LWEGUNWT-CXnfCeY3.mjs} +2 -2
- package/dist/{chunk-MDDMCKUK-CuQlmIio.mjs → chunk-MDDMCKUK-xLFNbrrZ.mjs} +2 -2
- package/dist/{chunk-MDLLFABN-UsHGHHoh.mjs → chunk-MDLLFABN-Dp0zh05T.mjs} +2 -2
- package/dist/{chunk-MHTUABJP-Dk5ocjFo.mjs → chunk-MHTUABJP-hQBYMJwY.mjs} +1 -1
- package/dist/{chunk-MIZPJHVH-Bo1j-3C3.mjs → chunk-MIZPJHVH-CxUaLYah.mjs} +2 -2
- package/dist/{chunk-MLXIYONF-DRuy-_4a.mjs → chunk-MLXIYONF-Bt-276H_.mjs} +1 -1
- package/dist/{chunk-MYE6AGBJ-DwzjGrc0.mjs → chunk-MYE6AGBJ-DmBUXN6H.mjs} +2 -2
- package/dist/{chunk-NAERJDUW-0UrOIQ6q.mjs → chunk-NAERJDUW-Cav--2Fy.mjs} +2 -2
- package/dist/{chunk-NCNPKYJZ-Ct0_l0YT.mjs → chunk-NCNPKYJZ-LS-Ky-i5.mjs} +2 -2
- package/dist/{chunk-NUYSJFDK-BvwS54ju.mjs → chunk-NUYSJFDK-D6pqIPwG.mjs} +2 -2
- package/dist/{chunk-OCLXQMOG-CCPg8vjW.mjs → chunk-OCLXQMOG-Dd0G6A5F.mjs} +2 -2
- package/dist/{chunk-OCS6LSEM-DkbaohJu.mjs → chunk-OCS6LSEM-CALXGrIt.mjs} +2 -2
- package/dist/{chunk-ORNJ4GCN-R_gUIosC.mjs → chunk-ORNJ4GCN-CqFReEiX.mjs} +2 -2
- package/dist/{chunk-OYMX7WX6-BrOfVMt8.mjs → chunk-OYMX7WX6-CQi5rS4T.mjs} +2 -2
- package/dist/{chunk-PBXLG62G-C7MEQojr.mjs → chunk-PBXLG62G-BaQR-Pos.mjs} +2 -2
- package/dist/{chunk-PP6PSHAB-DQ3LPONR.mjs → chunk-PP6PSHAB-DAEjIF1x.mjs} +1 -1
- package/dist/{chunk-PXTK5WE2-B17f9YTq.mjs → chunk-PXTK5WE2-DtNgPWAM.mjs} +1 -1
- package/dist/{chunk-PYSFUGCK-B_Gv8rUn.mjs → chunk-PYSFUGCK-Dy_8qlqA.mjs} +2 -2
- package/dist/{chunk-QCDB2VPH-Bays5mAr.mjs → chunk-QCDB2VPH-XUYEp26q.mjs} +2 -2
- package/dist/{chunk-QJ7O6ZN3-BCF2wp2J.mjs → chunk-QJ7O6ZN3-jw3_Ap-D.mjs} +2 -2
- package/dist/{chunk-QZHKN3VN-D0OJ2eQ1.mjs → chunk-QZHKN3VN-drjmYlbU.mjs} +2 -2
- package/dist/{chunk-R6QSAL5T-RaNW7MSS.mjs → chunk-R6QSAL5T-ChOEHgTM.mjs} +1 -1
- package/dist/{chunk-RPNGRAAP-yHFoBjjv.mjs → chunk-RPNGRAAP-CihnEKHU.mjs} +2 -2
- package/dist/{chunk-SDNKECQQ-BsAYzqU5.mjs → chunk-SDNKECQQ-CD_0Ct0o.mjs} +2 -2
- package/dist/{chunk-SNN4IESC-C-P75V1I.mjs → chunk-SNN4IESC-Io5Uw9il.mjs} +1 -1
- package/dist/{chunk-T56QNPHK-B6DfVzfs.mjs → chunk-T56QNPHK-CBaNulWg.mjs} +2 -2
- package/dist/{chunk-TLSUDHID-SuIGgADo.mjs → chunk-TLSUDHID-B89Qk3Em.mjs} +2 -2
- package/dist/{chunk-TOMNU26N-Dw9Enq1O.mjs → chunk-TOMNU26N-C1sG6Msz.mjs} +2 -2
- package/dist/{chunk-TP4BZANS-eJW0TOjs.mjs → chunk-TP4BZANS-CTpZAzJp.mjs} +2 -2
- package/dist/{chunk-TXBZCHCQ-BxbbtyNr.mjs → chunk-TXBZCHCQ-DVmekj_k.mjs} +2 -2
- package/dist/{chunk-U2HBQHQK-DB1SzWgs.mjs → chunk-U2HBQHQK-C6hC2wN2.mjs} +2 -2
- package/dist/{chunk-V5MWI2OL-CDEVEp7K.mjs → chunk-V5MWI2OL-DHeEw-Bw.mjs} +1 -1
- package/dist/{chunk-V7TAPXDL-CKif4_mH.mjs → chunk-V7TAPXDL-C2zCZaaT.mjs} +2 -2
- package/dist/{chunk-VJFXDYWH-CWlZv59U.mjs → chunk-VJFXDYWH-CMil6w7F.mjs} +2 -2
- package/dist/{chunk-VOBGTVA6-D6fSjWnx.mjs → chunk-VOBGTVA6-DUmK2uFM.mjs} +2 -2
- package/dist/{chunk-VYOJP4TV-DN1CSkP5.mjs → chunk-VYOJP4TV-NY3mkQfC.mjs} +2 -2
- package/dist/{chunk-WKFATFPP-CoPg2OGf.mjs → chunk-WKFATFPP-CCzbk9l_.mjs} +2 -2
- package/dist/{chunk-X2AJGDEF-ClcErtij.mjs → chunk-X2AJGDEF-B2IEuWMO.mjs} +1 -1
- package/dist/{chunk-X2U36JSP-CqOGcGN3.mjs → chunk-X2U36JSP-DUT3KN7v.mjs} +2 -2
- package/dist/{chunk-XKQRETAK-BC2HZ_y9.mjs → chunk-XKQRETAK-DBH8-r13.mjs} +2 -2
- package/dist/{chunk-XKWWSDBF-XuPgN5BP.mjs → chunk-XKWWSDBF-CkT22GKu.mjs} +2 -2
- package/dist/{chunk-XPW4576I-BkucPPwf.mjs → chunk-XPW4576I-BUNNk3WJ.mjs} +2 -2
- package/dist/{chunk-XVDPCNWR-CkzIJQaO.mjs → chunk-XVDPCNWR-Dpmdq7tW.mjs} +2 -2
- package/dist/{chunk-YMMW5UAP-uYgeXT56.mjs → chunk-YMMW5UAP-x2y4_E_a.mjs} +2 -2
- package/dist/{chunk-YTNYSM6T-DcovOiF_.mjs → chunk-YTNYSM6T-B7Pxr8mf.mjs} +2 -2
- package/dist/{chunk-YULBWSET-BYBVdNmi.mjs → chunk-YULBWSET-DXl2KqKD.mjs} +2 -2
- package/dist/{chunk-YZCP3GAM-CkC6DoBJ.mjs → chunk-YZCP3GAM-DyF0VN0o.mjs} +2 -2
- package/dist/{chunk-Z6LRHWXI-BLaYoFnT.mjs → chunk-Z6LRHWXI-cYQeZ0uN.mjs} +1 -1
- package/dist/{chunk-Z7JVV2SM-BtFBVQEW.mjs → chunk-Z7JVV2SM-Bx_fzdEl.mjs} +2 -2
- package/dist/{chunk-ZZ45TVLE-CXznFlWR.mjs → chunk-ZZ45TVLE-CHtfsZGo.mjs} +2 -2
- package/dist/{chunk-ZZO3UDB3-CdVtmXn4.mjs → chunk-ZZO3UDB3-CLOJXZMQ.mjs} +2 -2
- package/dist/classDiagram-6PBFFD2Q-B7c1vwT5.mjs +2 -0
- package/dist/classDiagram-v2-HSJHXN6E-B6n2AR2x.mjs +2 -0
- package/dist/{clear-5CZ5X4YR-C4DTv-gF.mjs → clear-5CZ5X4YR-CvTPqJ5U.mjs} +1 -1
- package/dist/cli.mjs +66 -65
- package/dist/clone-BftAxCKp.mjs +2 -0
- package/dist/{column-WLPMMSTS-Bg1ZsVDm.mjs → column-WLPMMSTS-D4CsWORw.mjs} +1 -1
- package/dist/{comm-5SLSESQG-CTh1BUfn.mjs → comm-5SLSESQG-CHmFSxue.mjs} +1 -1
- package/dist/constants-BGBZW_Qv.mjs +2 -0
- package/dist/{cose-bilkent-S5V4N54A-E5vxHQ63.mjs → cose-bilkent-S5V4N54A-C3h1ARwX.mjs} +2 -2
- package/dist/{du-WO2ENHXQ-Cq3dzRFU.mjs → cp-XOYR4ABJ-DiV6v-rq.mjs} +1 -1
- package/dist/{curl-47BFPSFW-ClMENMWY.mjs → curl-47BFPSFW-C96qO4u5.mjs} +2 -2
- package/dist/{cut-OPC3VAGB-BDAM8WY8.mjs → cut-OPC3VAGB-Dh_rqL_i.mjs} +1 -1
- package/dist/{cytoscape.esm-BNCKY88j.mjs → cytoscape.esm-oBubee51.mjs} +1 -1
- package/dist/{dagre-LJG-5J7U.mjs → dagre-DxZjUi2H.mjs} +2 -2
- package/dist/{dagre-KV5264BT-C5SrnhX7.mjs → dagre-KV5264BT-JumxHSx7.mjs} +2 -2
- package/dist/{head-HT2B6D2J-DSAed845.mjs → date-DD7FVA2V-BUi7854q.mjs} +1 -1
- package/dist/{defaultLocale-BljHASC9.mjs → defaultLocale-BoxjDp6q.mjs} +1 -1
- package/dist/{diagram-5BDNPKRD-biBuhEzo.mjs → diagram-5BDNPKRD-BKDmayAE.mjs} +2 -2
- package/dist/{diagram-G4DWMVQ6-CHhS5h96.mjs → diagram-G4DWMVQ6-BBJ-sDt9.mjs} +2 -2
- package/dist/{diagram-MMDJMWI5-BgulNwvp.mjs → diagram-MMDJMWI5-i6W6mBce.mjs} +2 -2
- package/dist/{diagram-TYMM5635-DpmgERPD.mjs → diagram-TYMM5635-DkpztQam.mjs} +2 -2
- package/dist/diff-HJF2MPDN-Be83Imv3.mjs +1 -0
- package/dist/{dirname-LEMTZZFS-VsUIxZwx.mjs → dirname-LEMTZZFS-COuSzSN5.mjs} +1 -1
- package/dist/{dist-DU6kAT_L.mjs → dist-DAVo_TRx.mjs} +19 -19
- package/dist/dist-DJ0wJimx.mjs +1 -0
- package/dist/{dist-DZb_HoiN.mjs → dist-DpbxhJFx.mjs} +1 -1
- package/dist/{cp-XOYR4ABJ-VqiK1WcH.mjs → du-WO2ENHXQ-BrzeR0-x.mjs} +1 -1
- package/dist/echo-O45JWWI2-WsFSMrjp.mjs +1 -0
- package/dist/env-5EPCWSXR-BJC9qdBG.mjs +1 -0
- package/dist/{erDiagram-SMLLAGMA-BNISHenz.mjs → erDiagram-SMLLAGMA-B3ODWJAo.mjs} +2 -2
- package/dist/{execAsync-B4xEJACY.mjs → execAsync-03jh9_uL.mjs} +1 -1
- package/dist/{execAsync-Chx_LJuI.mjs → execAsync-BCYkb_Yo.mjs} +1 -1
- package/dist/{execAsync-DunQtInX.mjs → execAsync-bfdilfbQ.mjs} +1 -1
- package/dist/{expand-DTNXU4LQ-Bp3M0RnL.mjs → expand-DTNXU4LQ-BSxRnNK8.mjs} +1 -1
- package/dist/expr-YYCVMXE3-DEtS2Bb0.mjs +1 -0
- package/dist/{date-DD7FVA2V-nDqDn5ZQ.mjs → file-IGDTDPLG-DlvUkVAa.mjs} +1 -1
- package/dist/find-DH2ALKQS-DSbKkobO.mjs +1 -0
- package/dist/flag-coverage-6JEX67RU-BpprwupD.mjs +2 -0
- package/dist/{flatten-CX5MwHL4.mjs → flatten-DN9kjoEG.mjs} +2 -2
- package/dist/{flowDiagram-DWJPFMVM-CFu645eN.mjs → flowDiagram-DWJPFMVM-IgVXZy1K.mjs} +2 -2
- package/dist/{fold-LDSORVYE-Bx5XDGgK.mjs → fold-LDSORVYE-Cgx6V7hj.mjs} +1 -1
- package/dist/{ganttDiagram-T4ZO3ILL-DhKUbpmR.mjs → ganttDiagram-T4ZO3ILL-2GQbgjw4.mjs} +2 -2
- package/dist/{getMachineId-bsd-Bt-frlcx.mjs → getMachineId-bsd-CZV52euR.mjs} +2 -2
- package/dist/{getMachineId-bsd-DC8LkcdK.mjs → getMachineId-bsd-CiJGYKVm.mjs} +2 -2
- package/dist/{getMachineId-bsd-DFsE-K5i.mjs → getMachineId-bsd-rBzlEMXn.mjs} +2 -2
- package/dist/{getMachineId-darwin-B9GQUU0e.mjs → getMachineId-darwin-CBVWH2ev.mjs} +2 -2
- package/dist/{getMachineId-darwin-DMNBrKWp.mjs → getMachineId-darwin-DZ2QXoUt.mjs} +2 -2
- package/dist/{getMachineId-darwin-DRxpszyZ.mjs → getMachineId-darwin-ZfRSQhwf.mjs} +2 -2
- package/dist/{getMachineId-linux-D9dNX75P.mjs → getMachineId-linux-CRpWR2Xf.mjs} +1 -1
- package/dist/{getMachineId-linux-DOv7iOg-.mjs → getMachineId-linux-DwNbOq4U.mjs} +1 -1
- package/dist/{getMachineId-linux-B5vQV4C7.mjs → getMachineId-linux-myvu2F75.mjs} +1 -1
- package/dist/{getMachineId-unsupported-D6sWFm_K.mjs → getMachineId-unsupported-BUNmL05z.mjs} +1 -1
- package/dist/{getMachineId-unsupported-DdAD6gRb.mjs → getMachineId-unsupported-BoA-zzsf.mjs} +1 -1
- package/dist/{getMachineId-unsupported-BQ6KY9w-.mjs → getMachineId-unsupported-DnLw1pHF.mjs} +1 -1
- package/dist/{getMachineId-win-BZsHRo32.mjs → getMachineId-win-BykI_KPM.mjs} +2 -2
- package/dist/{getMachineId-win-CpDtoa22.mjs → getMachineId-win-C_OepWkK.mjs} +2 -2
- package/dist/{getMachineId-win-BMQSc3Xj.mjs → getMachineId-win-DdqXbGCa.mjs} +2 -2
- package/dist/{gh-detect-C8cgnhPS.mjs → gh-detect-BxDh8M_E.mjs} +2 -2
- package/dist/gitGraph-7Q5UKJZL-BHgBQaev.mjs +1 -0
- package/dist/{gitGraphDiagram-UUTBAWPF-Cwemn6Ch.mjs → gitGraphDiagram-UUTBAWPF-WoVzHmmn.mjs} +2 -2
- package/dist/{graphlib-5CpUx0Yq.mjs → graphlib-CnQJqmVu.mjs} +2 -2
- package/dist/grep-2HUTXO5U-C40o2gtS.mjs +1 -0
- package/dist/gzip-AQXSGOVS-D7nHvr3D.mjs +1 -0
- package/dist/{file-IGDTDPLG-DQaFkvTu.mjs → head-HT2B6D2J-CQ8o4Vkb.mjs} +1 -1
- package/dist/help-VVWX7SA5-CiA7qg3p.mjs +1 -0
- package/dist/history-J4QRNGRO-CW1hmcPP.mjs +1 -0
- package/dist/{hostname-BK6HG2DE-_qJ9gN13.mjs → hostname-BK6HG2DE-BeHMNLVT.mjs} +1 -1
- package/dist/html-to-markdown-TFCECAGV-DxAcnDx-.mjs +1 -0
- package/dist/index.d.mts +6 -62
- package/dist/index.mjs +1 -1
- package/dist/info-OMHHGYJF-DFOa7qkq.mjs +1 -0
- package/dist/{infoDiagram-42DDH7IO-D0XeM9Mm.mjs → infoDiagram-42DDH7IO-DMFBf33Y.mjs} +2 -2
- package/dist/init-B02GcqsQ.mjs +1 -0
- package/dist/{init-L1KCVOHH.mjs → init-BL40T-Vz.mjs} +1 -1
- package/dist/init-E8FDYW-D.mjs +653 -0
- package/dist/{isEmpty-CaTO-fHo.mjs → isEmpty-CNxsONwW.mjs} +2 -2
- package/dist/{ishikawaDiagram-UXIWVN3A-vTBTHzHj.mjs → ishikawaDiagram-UXIWVN3A-CJ8lY0Nl.mjs} +2 -2
- package/dist/{join-GG2LDHE5-BMnXfCXQ.mjs → join-GG2LDHE5-DWqB9tv7.mjs} +1 -1
- package/dist/{journeyDiagram-VCZTEJTY-Dq1fLo6N.mjs → journeyDiagram-VCZTEJTY-IdyKUh_g.mjs} +2 -2
- package/dist/jq-LYZFFBZB-Bq_F0mxX.mjs +1 -0
- package/dist/{js-exec-VXN6TZ7U-fCXuAS2-.mjs → js-exec-VXN6TZ7U-DRTFMoYG.mjs} +2 -2
- package/dist/{kanban-definition-6JOO6SKY-B03_bODj.mjs → kanban-definition-6JOO6SKY-C1sB4ii4.mjs} +2 -2
- package/dist/launch-json-removal-ByWYRF7W.mjs +2 -0
- package/dist/{lib-CCQO9uWA.mjs → lib-BLR9KuxL.mjs} +1 -1
- package/dist/{lib-BbNAtG4h.mjs → lib-De0kNlJU.mjs} +1 -1
- package/dist/{line-C62ka-l9.mjs → line-T8d2uu7j.mjs} +2 -2
- package/dist/{linear-gA98NGf7.mjs → linear-BVIeiSZs.mjs} +2 -2
- package/dist/{ln-4TRFBYAT-Byit-TLI.mjs → ln-4TRFBYAT-CpScyeFk.mjs} +1 -1
- package/dist/{loader-Bu_CIw6G.mjs → loader-Bi7zAoyk.mjs} +2 -2
- package/dist/loader-CT3CzsPt.mjs +1 -0
- package/dist/ls-KSXFZCWH-BMq2C6AP.mjs +1 -0
- package/dist/{lzma-BSEvzrCT.mjs → lzma-6vaD4w9R.mjs} +1 -1
- package/dist/{mcp-migrate-event-D0NrGjvc.mjs → mcp-migrate-event-CyH1VVyy.mjs} +1 -1
- package/dist/md5sum-INMIK4DX-BbHBkH1A.mjs +1 -0
- package/dist/{mermaid-parser.core-Cx4njenA.mjs → mermaid-parser.core-DjFy6YnS.mjs} +2 -2
- package/dist/{mermaid.core-LrO0u_wA.mjs → mermaid.core-DyEIpJO9.mjs} +3 -3
- package/dist/{mindmap-definition-QFDTVHPH-b0aFdJAS.mjs → mindmap-definition-QFDTVHPH-BdMSEWgq.mjs} +2 -2
- package/dist/mkdir-TDEMSB6C-9ppkyu1-.mjs +1 -0
- package/dist/mv-Z6MORUFL-CZIq395W.mjs +1 -0
- package/dist/{nl-U5YJDM32-Bs_nMrMg.mjs → nl-U5YJDM32-DdxB9n-y.mjs} +1 -1
- package/dist/{od-VJEF2UR5-DwpkPMHp.mjs → od-VJEF2UR5-DIQMQQUN.mjs} +1 -1
- package/dist/{open-browser-Csh_BnzS.mjs → open-browser-6ztGUs93.mjs} +2 -2
- package/dist/{ordinal-BCuCMCHk.mjs → ordinal-DNNCjWTJ.mjs} +2 -2
- package/dist/packet-4T2RLAQJ-CdySh7r7.mjs +1 -0
- package/dist/paste-7N6AFSDS-D89jcQ7Z.mjs +1 -0
- package/dist/{path-C9DYqGo_.mjs → path-oDLMmjI_.mjs} +1 -1
- package/dist/pie-ZZUOXDRM-BSuHluiX.mjs +1 -0
- package/dist/{pieDiagram-DEJITSTG-C77h8TOO.mjs → pieDiagram-DEJITSTG-2VW9qBbL.mjs} +2 -2
- package/dist/preview-DtuXRRGi.mjs +1 -0
- package/dist/{preview-CrxTN9jZ.mjs → preview-hq0cdoZw.mjs} +2 -2
- package/dist/printf-CX64KX2P-m6K8MBPi.mjs +1 -0
- package/dist/public/assets/{ActivityModeContent-5_bqDHKH.js → ActivityModeContent-D1snXuNs.js} +1 -1
- package/dist/public/assets/{CodeMirrorPropInput-BseWsWBZ.js → CodeMirrorPropInput-C3FZ7AWB.js} +1 -1
- package/dist/public/assets/{ConsentDialogBody-DpW_fWHO.js → ConsentDialogBody-BuKqWdML.js} +2 -2
- package/dist/public/assets/{DocumentContext-CJECYBYb.js → DocumentContext-CPgyt-fa.js} +1 -1
- package/dist/public/assets/{EnableSyncConfirmDialog-J2fWLuKx.js → EnableSyncConfirmDialog-a1BAa003.js} +1 -1
- package/dist/public/assets/{GraphPanel-D-EeiCv_.js → GraphPanel-Dqn1R3FA.js} +1 -1
- package/dist/public/assets/{ManagedArtifactProperties-BrMSVlga.js → ManagedArtifactProperties-D9gtQzwY.js} +1 -1
- package/dist/public/assets/{McpConsentDialogBody-BeIUh4bz.js → McpConsentDialogBody-B3eYpOil.js} +1 -1
- package/dist/public/assets/{MermaidDocEditor-LaRaKhRV.js → MermaidDocEditor-CZKy1wMI.js} +1 -1
- package/dist/public/assets/{PropertyPanel-DDXKhF6k.js → PropertyPanel-k3LSAy4u.js} +1 -1
- package/dist/public/assets/{SettingsDialogBody-Bfut9hkr.js → SettingsDialogBody-do88Fri6.js} +1 -1
- package/dist/public/assets/{ShareBranchSwitchDialog-CSO2vi9J.js → ShareBranchSwitchDialog-OJA4wjqQ.js} +1 -1
- package/dist/public/assets/{ShareReceiveDialog-DddOjvn2.js → ShareReceiveDialog-7EizE4VA.js} +1 -1
- package/dist/public/assets/{ShareReceiveMissDialog-CysnnPRz.js → ShareReceiveMissDialog-D8Up16fz.js} +1 -1
- package/dist/public/assets/{SkillEditorActions-B0MNz80x.js → SkillEditorActions-B25PfvD1.js} +1 -1
- package/dist/public/assets/{SourceEditor-B663Yw8O.js → SourceEditor-D_fZ07fz.js} +1 -1
- package/dist/public/assets/{TerminalPanel-D6hQKvpb.js → TerminalPanel-Dw3H1oil.js} +1 -1
- package/dist/public/assets/{agent-presence-SWQihO8a.js → agent-presence-c_qxeP7e.js} +1 -1
- package/dist/public/assets/{auth-state-cache-DJAi3NoE.js → auth-state-cache-D4z3eiMF.js} +1 -1
- package/dist/public/assets/{config-provider-DptJpHL2.js → config-provider-BONo47Qc.js} +1 -1
- package/dist/public/assets/{dist-CMWIIV76.js → dist-BDGd7UYM.js} +1 -1
- package/dist/public/assets/{dist-Chq5t0fA.js → dist-CJfVM-iJ.js} +2 -2
- package/dist/public/assets/{doc-hash-KNy1saqI.js → doc-hash-BLS3MEoj.js} +1 -1
- package/dist/public/assets/{documents-events-kyp3S2Nf.js → documents-events-H4-z8Qjp.js} +1 -1
- package/dist/public/assets/{file-tree-adapter-BrTWXp63.js → file-tree-adapter-B8tTfm_Y.js} +1 -1
- package/dist/public/assets/{index-gPUerME8.js → index-Ci4eWUi8.js} +7 -7
- package/dist/public/assets/{keyboard-shortcuts-BMEqPQU6.js → keyboard-shortcuts-DnJWzgZ1.js} +1 -1
- package/dist/public/assets/{navigation-targets-B4NGITKp.js → navigation-targets-DM3L8UZy.js} +1 -1
- package/dist/public/assets/{open-managed-artifact-tab-D20KCZaE.js → open-managed-artifact-tab-NBmHUyDy.js} +1 -1
- package/dist/public/assets/{pending-receive-nav-store-CHWJDSOf.js → pending-receive-nav-store-D7JjzV1n.js} +1 -1
- package/dist/public/assets/{project-paths-Cv9JzTbQ.js → project-paths-Bdm7wr4i.js} +1 -1
- package/dist/public/assets/{prop-types-Ci7AGShX.js → prop-types-Cl1SYZho.js} +1 -1
- package/dist/public/assets/{radio-group-CXUz67M8.js → radio-group-B0RG5um-.js} +1 -1
- package/dist/public/assets/{receive-store-BzfAUT48.js → receive-store-DWC9dc5j.js} +1 -1
- package/dist/public/assets/{selection-context-BoRyg1Sb.js → selection-context-DALYXIVY.js} +1 -1
- package/dist/public/assets/{skill-actions-CW-DAvgj.js → skill-actions-BV30AE89.js} +1 -1
- package/dist/public/assets/{skills-api-DhQjjD9F.js → skills-api-B0z9Mw2W.js} +1 -1
- package/dist/public/assets/{src-B1E05HAZ.js → src-DZ97WDxX.js} +1 -1
- package/dist/public/assets/{target-navigation-intent-DSkE5CGB.js → target-navigation-intent-CpKCAQDV.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-0adggLGY.js → typing-burst-detector-ko_Nb-fG.js} +1 -1
- package/dist/public/assets/{workspace-paths-CLhojMmt.js → workspace-paths-CMbeqczX.js} +1 -1
- package/dist/public/index.html +27 -27
- package/dist/pwd-D4OZ7N27-DTcVtxaf.mjs +1 -0
- package/dist/{python3-DNGS4G3E-bGzU9nm-.mjs → python3-DNGS4G3E-7DCL_jPA.mjs} +2 -2
- package/dist/{quadrantDiagram-34T5L4WZ-CLL-GTlz.mjs → quadrantDiagram-34T5L4WZ-CZz9f0uY.mjs} +2 -2
- package/dist/radar-PYXPWWZC-F8ZyHWJj.mjs +1 -0
- package/dist/readlink-MI4GCHJF-BaR3b_s7.mjs +1 -0
- package/dist/{reduce-V0ODtSr4.mjs → reduce-Liz4w9mV.mjs} +2 -2
- package/dist/repair-launch-json-BdfDMobg.mjs +2 -0
- package/dist/{repair-mcp-configs-DqSXFZsw.mjs → repair-mcp-configs-DZMxi-7M.mjs} +2 -2
- package/dist/repair-skills-B0TdudPZ.mjs +1 -0
- package/dist/{repair-skills-C_l1phOf.mjs → repair-skills-zutt1is6.mjs} +2 -2
- package/dist/{requirementDiagram-MS252O5E-JIzm76n0.mjs → requirementDiagram-MS252O5E-BKR-IjfU.mjs} +2 -2
- package/dist/{rev-XOSYPP45-4azlKYu4.mjs → rev-XOSYPP45-CiowreCc.mjs} +1 -1
- package/dist/rg-XNF3R3II-BK6WaEMK.mjs +1 -0
- package/dist/rm-RTZG23RL-kkSjZLZ9.mjs +1 -0
- package/dist/rmdir-XTQXT7RK-BcuPRlwS.mjs +1 -0
- package/dist/{rough.cjs-C-63phNL.mjs → rough.cjs-C4mRMCLz.mjs} +1 -1
- package/dist/{sankeyDiagram-XADWPNL6-Bpk8eTPe.mjs → sankeyDiagram-XADWPNL6-BQFoQHCj.mjs} +2 -2
- package/dist/{sed-JAPPVBEU-BvDbOHs0.mjs → sed-JAPPVBEU-BGk7n3so.mjs} +1 -1
- package/dist/seq-RN5ZUASB-HvlCfepP.mjs +1 -0
- package/dist/{sequenceDiagram-FGHM5R23-CHCigzvZ.mjs → sequenceDiagram-FGHM5R23-D2GOGb_q.mjs} +2 -2
- package/dist/server-lock-GuuouVft-CCnjEa8y.mjs +1 -0
- package/dist/{server-lock-iLcBw_q0-CdaRzkXM.mjs → server-lock-iLcBw_q0-RDMfTH6b.mjs} +3 -3
- package/dist/sha1sum-VJPNLNU6-DIj6JJG_.mjs +1 -0
- package/dist/sha256sum-PI32XWXY-DDy3JdOM.mjs +1 -0
- package/dist/{sleep-VZFPZFWA-BgSOeH2N.mjs → sleep-VZFPZFWA-CrstvTLq.mjs} +1 -1
- package/dist/sort-DCNRDA7U-g5MLXkqb.mjs +1 -0
- package/dist/{split-SITCSYCZ-DqhMcIGL.mjs → split-SITCSYCZ-DgZtYh2-.mjs} +1 -1
- package/dist/{sqlite3-TE5AIOTF-DW7pT7NE.mjs → sqlite3-TE5AIOTF-Dj7QrkUm.mjs} +1 -1
- package/dist/src-Bi9Si6vM.mjs +11 -0
- package/dist/{src-BkCVz_TJ.mjs → src-DBL0Mxlv.mjs} +1 -1
- package/dist/start-CDJKwObu.mjs +1 -0
- package/dist/{start-C8xPgt3v.mjs → start-DqcZAaBv.mjs} +2 -2
- package/dist/stat-BT5A227F-CN4E-TuS.mjs +1 -0
- package/dist/{stateDiagram-FHFEXIEX-CiIJxbDV.mjs → stateDiagram-FHFEXIEX-BXMAtbov.mjs} +2 -2
- package/dist/stateDiagram-v2-QKLJ7IA2-BtFX1akc.mjs +2 -0
- package/dist/strings-7PLOGTPD-CbCHpRt7.mjs +1 -0
- package/dist/{tac-SJGXQ4T2-DMDGVNTy.mjs → tac-SJGXQ4T2-BGgbS4Fn.mjs} +1 -1
- package/dist/tail-S5ULNTJU-mZjo68yb.mjs +1 -0
- package/dist/{tar-MZQD7NO4-46pC0DHj.mjs → tar-MZQD7NO4-CsVdP0sN.mjs} +1 -1
- package/dist/tee-O7VXZDCO-BKm8apzS.mjs +1 -0
- package/dist/time-DEUO3QV2-BOZv1JPT.mjs +1 -0
- package/dist/{timeline-definition-GMOUNBTQ-BBhlpYO9.mjs → timeline-definition-GMOUNBTQ-qIdeCiEK.mjs} +2 -2
- package/dist/{timeout-VRKMCG72-aaC7r4sX.mjs → timeout-VRKMCG72-CEWGEjty.mjs} +1 -1
- package/dist/touch-DX2IJOQ4-CjAZX3M6.mjs +1 -0
- package/dist/tr-2HXZRDSW-CehGhb2g.mjs +1 -0
- package/dist/tree-LYXBS7DC-CwBffKRV.mjs +1 -0
- package/dist/treeView-SZITEDCU-DkCY1vEP.mjs +1 -0
- package/dist/treemap-W4RFUUIX-CqZE2-qw.mjs +1 -0
- package/dist/true-WHJNXCHG-Uj-a5-Dz.mjs +1 -0
- package/dist/unexpand-RGTMIGZM-DfngOCy5.mjs +1 -0
- package/dist/uniq-SUNANL47-CEP8kP6J.mjs +1 -0
- package/dist/{vennDiagram-DHZGUBPP-CATweP9B.mjs → vennDiagram-DHZGUBPP-B0wW_yMZ.mjs} +2 -2
- package/dist/wardley-RL74JXVD-Lx0wZS2z.mjs +1 -0
- package/dist/{wardleyDiagram-NUSXRM2D-3qxY3I6a.mjs → wardleyDiagram-NUSXRM2D-C9FhrgKS.mjs} +2 -2
- package/dist/wc-TQB3VNOX-bJMe7ljH.mjs +1 -0
- package/dist/which-XZHEH76L-sa5veBMg.mjs +1 -0
- package/dist/whoami-DGKU3D2X-BbTFjdCR.mjs +1 -0
- package/dist/{write-project-skill-BnCIY7g1.mjs → write-project-skill-BzVHToYO.mjs} +3 -3
- package/dist/xan-UD7JYIL2-2nWetB-o.mjs +1 -0
- package/dist/xan-view-OW2TB7Z3-Oo5v6Y-1.mjs +1 -0
- package/dist/xargs-I6EZUCYF-Bp4XAy4N.mjs +1 -0
- package/dist/{xychartDiagram-5P7HB3ND-BAWpa2N2.mjs → xychartDiagram-5P7HB3ND-DNlCf9Gt.mjs} +2 -2
- package/dist/yq-OAKYHSXH-tZjjvK0i.mjs +1 -0
- package/package.json +1 -1
- package/dist/alias-JE7RI5QX-DxvTrQH3.mjs +0 -1
- package/dist/architecture-YZFGNWBL-YPACCZ88.mjs +0 -1
- package/dist/bash-IJWYRKFO-C7Yi9aK0.mjs +0 -1
- package/dist/channel-Dq8ADXfq.mjs +0 -2
- package/dist/chunk-426QAEUC-BGn1TCpd.mjs +0 -2
- package/dist/classDiagram-6PBFFD2Q-cIblqhKe.mjs +0 -2
- package/dist/classDiagram-v2-HSJHXN6E-CnZ_g-6O.mjs +0 -2
- package/dist/clone-s6xjJkoz.mjs +0 -2
- package/dist/constants-WwSYoAhh.mjs +0 -2
- package/dist/diff-HJF2MPDN-DSY9AfjL.mjs +0 -1
- package/dist/dist-BC-5uOuA.mjs +0 -1
- package/dist/echo-O45JWWI2-B99ElfBo.mjs +0 -1
- package/dist/env-5EPCWSXR-CsaomJHQ.mjs +0 -1
- package/dist/expr-YYCVMXE3-CHnBeIXW.mjs +0 -1
- package/dist/find-DH2ALKQS-6y8KktlA.mjs +0 -1
- package/dist/flag-coverage-6JEX67RU-BqC6mFKB.mjs +0 -2
- package/dist/gitGraph-7Q5UKJZL-ClGjTWw6.mjs +0 -1
- package/dist/grep-2HUTXO5U-Dbnjl3Iq.mjs +0 -1
- package/dist/gzip-AQXSGOVS-BtiMTiZG.mjs +0 -1
- package/dist/help-VVWX7SA5-DCBusWam.mjs +0 -1
- package/dist/history-J4QRNGRO-BwBOMO5i.mjs +0 -1
- package/dist/html-to-markdown-TFCECAGV-D7XdAo13.mjs +0 -1
- package/dist/info-OMHHGYJF-11Qh6VJr.mjs +0 -1
- package/dist/init-BYvS_cgc.mjs +0 -1
- package/dist/init-BoNJQ0RQ.mjs +0 -690
- package/dist/jq-LYZFFBZB-CSF_TJhe.mjs +0 -1
- package/dist/loader-LvQJaM9_.mjs +0 -1
- package/dist/ls-KSXFZCWH-CNZ_hN8P.mjs +0 -1
- package/dist/md5sum-INMIK4DX-pTX2tfQd.mjs +0 -1
- package/dist/mkdir-TDEMSB6C-Bl16kSBR.mjs +0 -1
- package/dist/mv-Z6MORUFL-D9pw6nb9.mjs +0 -1
- package/dist/packet-4T2RLAQJ-jzF54bgp.mjs +0 -1
- package/dist/paste-7N6AFSDS-C8EyimeA.mjs +0 -1
- package/dist/pie-ZZUOXDRM-x8WFG16Q.mjs +0 -1
- package/dist/preview-Gb5GqloB.mjs +0 -1
- package/dist/printf-CX64KX2P-2Mks7IIT.mjs +0 -1
- package/dist/pwd-D4OZ7N27-m5fzqroZ.mjs +0 -1
- package/dist/radar-PYXPWWZC-C-wbHKao.mjs +0 -1
- package/dist/readlink-MI4GCHJF-BMheCA1U.mjs +0 -1
- package/dist/repair-launch-json-B5iZEpFW.mjs +0 -2
- package/dist/repair-skills-B0B7a5IA.mjs +0 -1
- package/dist/rg-XNF3R3II-ivb6d3Sm.mjs +0 -1
- package/dist/rm-RTZG23RL-F9g7gQHU.mjs +0 -1
- package/dist/rmdir-XTQXT7RK-CFMuhNvO.mjs +0 -1
- package/dist/seq-RN5ZUASB-BaUQfYSh.mjs +0 -1
- package/dist/server-lock-GuuouVft-DSQyMetL.mjs +0 -1
- package/dist/sha1sum-VJPNLNU6-NRAU83Yg.mjs +0 -1
- package/dist/sha256sum-PI32XWXY-Cfe-w5CY.mjs +0 -1
- package/dist/sort-DCNRDA7U-DqMg1dll.mjs +0 -1
- package/dist/src-cDAswqAJ.mjs +0 -7
- package/dist/start-D3VXyjQg.mjs +0 -1
- package/dist/stat-BT5A227F-DOG39Ce5.mjs +0 -1
- package/dist/stateDiagram-v2-QKLJ7IA2-CTdt2FVd.mjs +0 -2
- package/dist/strings-7PLOGTPD-l9kho9ff.mjs +0 -1
- package/dist/tail-S5ULNTJU-knoYRbXD.mjs +0 -1
- package/dist/tee-O7VXZDCO-BgHEibOy.mjs +0 -1
- package/dist/time-DEUO3QV2-CXWA3kJ0.mjs +0 -1
- package/dist/touch-DX2IJOQ4-DGiKr2c0.mjs +0 -1
- package/dist/tr-2HXZRDSW-BDNDgux2.mjs +0 -1
- package/dist/tree-LYXBS7DC-BK2c44-E.mjs +0 -1
- package/dist/treeView-SZITEDCU-DXyZ3zQc.mjs +0 -1
- package/dist/treemap-W4RFUUIX-CZRYHpYU.mjs +0 -1
- package/dist/true-WHJNXCHG-B6CZ-ZF1.mjs +0 -1
- package/dist/unexpand-RGTMIGZM-BWFllY1p.mjs +0 -1
- package/dist/uniq-SUNANL47-CiXMC2Qh.mjs +0 -1
- package/dist/wardley-RL74JXVD-UKzwcBOa.mjs +0 -1
- package/dist/wc-TQB3VNOX-Bof613yN.mjs +0 -1
- package/dist/which-XZHEH76L-DfnqWxtA.mjs +0 -1
- package/dist/whoami-DGKU3D2X-DhtD1OhF.mjs +0 -1
- package/dist/xan-UD7JYIL2-DnWVVFeC.mjs +0 -1
- package/dist/xan-view-OW2TB7Z3-DBl8NjSB.mjs +0 -1
- package/dist/xargs-I6EZUCYF-CdKFilDT.mjs +0 -1
- package/dist/yq-OAKYHSXH-CpYttz-E.mjs +0 -1
- /package/dist/{expansion-VBDYWVZR-k3W3Rc7R.mjs → expansion-VBDYWVZR-1XLTRUEG.mjs} +0 -0
- /package/dist/{git-handle-BMLM1Bxa-Dc3Lq9P5.mjs → git-handle-BMLM1Bxa-C8CZ9W34.mjs} +0 -0
|
@@ -301,7 +301,7 @@ Read more at https://docs.orama.com/docs/orama-js/plugins/plugin-secure-proxy#pl
|
|
|
301
301
|
`,PLUGIN_SECURE_PROXY_MISSING_CHAT_MODEL:`Could not find a chat model defined in the secure proxy plugin configuration.
|
|
302
302
|
Please provide a chat model before proceeding with creating an answer session.
|
|
303
303
|
Read more at https://docs.orama.com/docs/orama-js/plugins/plugin-secure-proxy#plugin-secure-proxy
|
|
304
|
-
`,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 pH(e,...t){let n=Error(WV(fH[e]??`Unsupported Orama Error code: ${e}`,...t));return n.code=e,`captureStackTrace`in Error.prototype&&Error.captureStackTrace(n),n}function mH(e){return{raw:Number(e),formatted:JV(e)}}function hH(e){if(e.id){if(typeof e.id!=`string`)throw pH(`DOCUMENT_ID_MUST_BE_STRING`,typeof e.id);return e.id}return XV()}function gH(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(bH(r)){let e=CH(r);if(!Array.isArray(t)||t.length!==e)throw pH(`INVALID_INPUT_VECTOR`,n,e,t.length);continue}if(xH(r)){if(!Array.isArray(t))return n;let e=SH(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=gH(t,r);if(e)return n+`.`+e;continue}if(typeof t!==r)return n}}}const _H={string:!1,number:!1,boolean:!1,enum:!1,geopoint:!1,"string[]":!0,"number[]":!0,"boolean[]":!0,"enum[]":!0},vH={"string[]":`string`,"number[]":`number`,"boolean[]":`boolean`,"enum[]":`enum`};function yH(e){return e===`geopoint`}function bH(e){return typeof e==`string`&&/^vector\[\d+\]$/.test(e)}function xH(e){return typeof e==`string`&&_H[e]}function SH(e){return vH[e]}function CH(e){let t=Number(e.slice(7,-1));switch(!0){case isNaN(t):throw pH(`INVALID_VECTOR_VALUE`,e);case t<=0:throw pH(`INVALID_VECTOR_SIZE`,e);default:return t}}function wH(){return{idToInternalId:new Map,internalIdToId:[],save:TH,load:EH}}function TH(e){return{internalIdToId:e.internalIdToId}}function EH(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 DH(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?DH(e,t.toString()):t}function OH(e,t){if(e.internalIdToId.length<t)throw Error(`Invalid internalId ${t}`);return e.internalIdToId[t-1]}function kH(e,t){return{sharedInternalDocumentStore:t,docs:{},count:0}}function AH(e,t){let n=DH(e.sharedInternalDocumentStore,t);return e.docs[n]}function jH(e,t){let n=t.length,r=Array.from({length:n});for(let i=0;i<n;i++){let n=DH(e.sharedInternalDocumentStore,t[i]);r[i]=e.docs[n]}return r}function MH(e){return e.docs}function NH(e,t,n,r){return e.docs[n]===void 0?(e.docs[n]=r,e.count++,!0):!1}function PH(e,t){let n=DH(e.sharedInternalDocumentStore,t);return e.docs[n]===void 0?!1:(delete e.docs[n],e.count--,!0)}function FH(e){return e.count}function IH(e,t){let n=t;return{docs:n.docs,count:n.count,sharedInternalDocumentStore:e}}function LH(e){return{docs:e.docs,count:e.count}}function RH(){return{create:kH,get:AH,getMultiple:jH,getAll:MH,store:NH,remove:PH,count:FH,load:IH,save:LH}}const zH=[`beforeInsert`,`afterInsert`,`beforeRemove`,`afterRemove`,`beforeUpdate`,`afterUpdate`,`beforeUpsert`,`afterUpsert`,`beforeSearch`,`afterSearch`,`beforeInsertMultiple`,`afterInsertMultiple`,`beforeRemoveMultiple`,`afterRemoveMultiple`,`beforeUpdateMultiple`,`afterUpdateMultiple`,`beforeUpsertMultiple`,`afterUpsertMultiple`,`beforeLoad`,`afterLoad`,`afterCreate`];function BH(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),pH(`PLUGIN_CRASHED`)}return n}const VH=[`tokenizer`,`index`,`documentsStore`,`sorter`,`pinning`],HH=[`validateSchema`,`getDocumentIndexId`,`getDocumentProperties`,`formatElapsedTime`];function UH(e,t,n,r){if(e.some(aH))return(async()=>{for(let i of e)await i(t,n,r)})();for(let i of e)i(t,n,r)}function WH(e,t,n){if(e.some(aH))return(async()=>{for(let r of e)await r(t,n)})();for(let r of e)r(t,n)}function GH(e,t,n,r,i){if(e.some(aH))return(async()=>{for(let a of e)await a(t,n,r,i)})();for(let a of e)a(t,n,r,i)}function KH(e,t,n,r){if(e.some(aH))return(async()=>{for(let i of e)await i(t,n,r)})();for(let i of e)i(t,n,r)}function qH(e,t){if(e.some(aH))return(async()=>{for(let n of e)await n(t)})();for(let n of e)n(t)}var JH=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}},YH=class e{root=null;insertCount=0;constructor(e,t){e!==void 0&&t!==void 0&&(this.root=new JH(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?JH.fromJSON(t.root):null,n.insertCount=t.insertCount||0,n}insertNode(e,t,n,r){if(e===null)return new JH(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 JH(t,[n]),i.push({parent:a,node:a.l});break}else o=a,a=a.l;else if(t>a.k)if(a.r===null){a.r=new JH(t,[n]),i.push({parent:a,node:a.r});break}else o=a,a=a.r;else return a.v.add(n),e;let s=!1;this.insertCount++%r===0&&(s=!0);for(let t=i.length-1;t>=0;t--){let{parent:n,node:r}=i[t];if(r.updateHeight(),s){let t=this.rebalanceNode(r);n?n.l===r?n.l=t:n.r===r&&(n.r=t):e=t}}return e}rebalanceNode(e){let t=e.getBalanceFactor();if(t>1){if(e.l&&e.l.getBalanceFactor()>=0)return e.rotateRight();if(e.l)return e.l=e.l.rotateLeft(),e.rotateRight()}if(t<-1){if(e.r&&e.r.getBalanceFactor()<=0)return e.rotateLeft();if(e.r)return e.r=e.r.rotateRight(),e.rotateLeft()}return e}find(e){let t=this.findNodeByKey(e);return t?t.v:null}contains(e){return this.find(e)!==null}getSize(){let e=0,t=[],n=this.root;for(;n||t.length>0;){for(;n;)t.push(n),n=n.l;n=t.pop(),e++,n=n.r}return e}isBalanced(){if(!this.root)return!0;let e=[this.root];for(;e.length>0;){let t=e.pop(),n=t.getBalanceFactor();if(Math.abs(n)>1)return!1;t.l&&e.push(t.l),t.r&&e.push(t.r)}return!0}remove(e){this.root=this.removeNode(this.root,e)}removeDocument(e,t){let n=this.findNodeByKey(e);n&&(n.v.size===1?this.root=this.removeNode(this.root,e):n.v=new Set([...n.v.values()].filter(e=>e!==t)))}findNodeByKey(e){let t=this.root;for(;t;)if(e<t.k)t=t.l;else if(e>t.k)t=t.r;else return t;return null}removeNode(e,t){if(e===null)return null;let n=[],r=e;for(;r!==null&&r.k!==t;)n.push(r),r=t<r.k?r.l:r.r;if(r===null)return e;if(r.l===null||r.r===null){let t=r.l?r.l:r.r;if(n.length===0)e=t;else{let e=n[n.length-1];e.l===r?e.l=t:e.r=t}}else{let e=r,t=r.r;for(;t.l!==null;)e=t,t=t.l;r.k=t.k,r.v=t.v,e.l===t?e.l=t.r:e.r=t.r,r=e}n.push(r);for(let t=n.length-1;t>=0;t--){let r=n[t];r.updateHeight();let i=this.rebalanceNode(r);if(t>0){let e=n[t-1];e.l===r?e.l=i:e.r===r&&(e.r=i)}else e=i}return e}rangeSearch(e,t){let n=new Set,r=[],i=this.root;for(;i||r.length>0;){for(;i;)r.push(i),i=i.l;if(i=r.pop(),i.k>=e&&i.k<=t)for(let e of i.v)n.add(e);if(i.k>t)break;i=i.r}return n}greaterThan(e,t=!1){let n=new Set,r=[],i=this.root;for(;i||r.length>0;){for(;i;)r.push(i),i=i.r;if(i=r.pop(),t&&i.k>=e||!t&&i.k>e)for(let e of i.v)n.add(e);else if(i.k<=e)break;i=i.l}return n}lessThan(e,t=!1){let n=new Set,r=[],i=this.root;for(;i||r.length>0;){for(;i;)r.push(i),i=i.l;if(i=r.pop(),t&&i.k<=e||!t&&i.k<e)for(let e of i.v)n.add(e);else if(i.k>e)break;i=i.r}return n}},XH=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 ZH(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 QH(e,t,n){let r=ZH(e,t,n);return{distance:r,isBounded:r>=0}}var $H=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(ZV(e,i)!==null)if(r)if(Math.abs(t.length-i.length)<=r&&QH(t,i,r).isBounded)e[i]=[];else continue;else e[i]=[];if(ZV(e,i)!=null&&o.size>0){let t=e[i];for(let e of o)t.includes(e)||t.push(e)}}a.c.size>0&&i.push(...a.c.values())}return e}insert(t,n){let r=this,i=0,a=t.length;for(;i<a;){let o=t[i],s=r.c.get(o);if(s){let o=s.s,c=o.length,l=0;for(;l<c&&i+l<a&&o[l]===t[i+l];)l++;if(l===c){if(r=s,i+=l,i===a){s.e||=!0,s.addDocument(n);return}continue}let u=o.slice(0,l),d=o.slice(l),f=t.slice(i+l),p=new e(u[0],u,!1);if(r.c.set(u[0],p),p.updateParent(r),s.s=d,s.k=d[0],p.c.set(d[0],s),s.updateParent(p),f){let t=new e(f[0],f,!0);t.addDocument(n),p.c.set(f[0],t),t.updateParent(p)}else p.e=!0,p.addDocument(n);return}else{let a=new e(o,t.slice(i),!0);a.addDocument(n),r.c.set(o,a),a.updateParent(r);return}}r.e||=!0,r.addDocument(n)}_findLevenshtein(e,t,n,r,i){let a=[{node:this,index:t,tolerance:n}];for(;a.length>0;){let{node:t,index:n,tolerance:o}=a.pop();if(t.w.startsWith(e)){t.findAllWords(i,e,!1,0);continue}if(o<0)continue;if(t.e){let{w:n,d:a}=t;if(n&&(QH(e,n,r).isBounded&&(i[n]=[]),ZV(i,n)!==void 0&&a.size>0)){let e=new Set(i[n]);for(let t of a)e.add(t);i[n]=Array.from(e)}}if(n>=e.length)continue;let s=e[n];if(t.c.has(s)){let e=t.c.get(s);a.push({node:e,index:n+1,tolerance:o})}a.push({node:t,index:n+1,tolerance:o-1});for(let[e,r]of t.c)a.push({node:r,index:n,tolerance:o-1}),e!==s&&a.push({node:r,index:n+1,tolerance:o-1})}}find(e){let{term:t,exact:n,tolerance:r}=e;if(r&&!n){let e={};return this._findLevenshtein(t,0,r,r,e),e}else{let e=this,i=0,a=t.length;for(;i<a;){let o=t[i],s=e.c.get(o);if(s){let o=s.s,c=o.length,l=0;for(;l<c&&i+l<a&&o[l]===t[i+l];)l++;if(l===c)e=s,i+=l;else if(i+l===a)if(l===a-i){if(n)return{};{let e={};return s.findAllWords(e,t,n,r),e}}else return{};else return{}}else return{}}let o={};return e.findAllWords(o,t,n,r),o}}contains(e){let t=this,n=0,r=e.length;for(;n<r;){let i=e[n],a=t.c.get(i);if(a){let i=a.s,o=i.length,s=0;for(;s<o&&n+s<r&&i[s]===e[n+s];)s++;if(s<o)return!1;n+=o,t=a}else return!1}return!0}removeWord(e){if(!e)return!1;let t=this,n=e.length,r=[];for(let i=0;i<n;i++){let n=e[i];if(t.c.has(n)){let e=t.c.get(n);r.push({parent:t,character:n}),i+=e.s.length-1,t=e}else return!1}for(t.d.clear(),t.e=!1;r.length>0&&t.c.size===0&&!t.e&&t.d.size===0;){let{parent:e,character:n}=r.pop();e.c.delete(n),t=e}return!0}removeDocumentByWord(e,t,n=!0){if(!e)return!0;let r=this,i=e.length;for(let a=0;a<i;a++){let i=e[a];if(r.c.has(i)){let o=r.c.get(i);a+=o.s.length-1,r=o,n&&r.w!==e||r.removeDocument(t)}else return!1}return!0}static getCommonPrefix(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e.charCodeAt(r)===t.charCodeAt(r);)r++;return e.slice(0,r)}toJSON(){return{w:this.w,s:this.s,e:this.e,k:this.k,d:Array.from(this.d),c:Array.from(this.c?.entries())?.map(([e,t])=>[e,t.toJSON()])}}static fromJSON(t){let n=new e(t.k,t.s,t.e);return n.w=t.w,n.d=new Set(t.d),n.c=new Map(t?.c?.map(([t,n])=>[t,e.fromJSON(n)])||[]),n}},eU=class e extends $H{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,$H.fromJSON(t)])||[]),n}toJSON(){return super.toJSON()}},tU=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}},nU=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 tU(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=tU.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=(1-r)*n,a=Math.PI/180,o=e.lat*a,s=t.lat*a,c=(t.lon-e.lon)*a,l=Math.atan((1-r)*Math.tan(o)),u=Math.atan((1-r)*Math.tan(s)),d=Math.sin(l),f=Math.cos(l),p=Math.sin(u),m=Math.cos(u),h=c,g,_=1e3,v,y,b,x,S,C;do{let e=Math.sin(h),t=Math.cos(h);if(v=Math.sqrt(m*e*(m*e)+(f*p-d*m*t)*(f*p-d*m*t)),v===0)return 0;y=d*p+f*m*t,b=Math.atan2(v,y),x=f*m*e/v,S=1-x*x,C=y-2*d*p/S,isNaN(C)&&(C=0);let n=r/16*S*(4+r*(4-3*S));g=h,h=c+(1-n)*r*x*(b+n*v*(C+n*y*(-1+2*C*C)))}while(Math.abs(h-g)>1e-12&&--_>0);if(_===0)return NaN;let w=S*(n*n-i*i)/(i*i),T=1+w/16384*(4096+w*(-768+w*(320-175*w))),E=w/1024*(256+w*(-128+w*(74-47*w))),ee=E*v*(C+E/4*(y*(-1+2*C*C)-E/6*C*(-3+4*v*v)*(-3+4*C*C)));return i*T*(b-ee)}},rU=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 iU(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 aU=class e{size;vectors=new Map;constructor(e){this.size=e}add(e,t){t instanceof Float32Array||(t=new Float32Array(t));let n=oU(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)),sU(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 oU(e,t){let n=0;for(let r=0;r<t;r++)n+=e[r]*e[r];return Math.sqrt(n)}function sU(e,t,n,r,i){let a=oU(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 cU(e,t,n,r,i){let a=DH(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 lU(e,t,n,r,i){let a=0;for(let e of r)e===i&&a++;let o=DH(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 uU(e,t,n,r){let i=DH(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 dU(e,t,n){e.tokenOccurrences[t][n]--}function fU(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)){fU(e,t,o,r,n);continue}if(bH(o))r.searchableProperties.push(n),r.searchablePropertiesWithTypes[n]=o,r.vectorIndexes[n]={type:`Vector`,node:new aU(CH(o)),isArray:!1};else{let e=/\[/.test(o);switch(o){case`boolean`:case`boolean[]`:r.indexes[n]={type:`Bool`,node:new rU,isArray:e};break;case`number`:case`number[]`:r.indexes[n]={type:`AVL`,node:new YH(0,[]),isArray:e};break;case`string`:case`string[]`:r.indexes[n]={type:`Radix`,node:new eU,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 XH,isArray:e};break;case`geopoint`:r.indexes[n]={type:`BKD`,node:new nU,isArray:e};break;default:throw pH(`INVALID_SCHEMA_TYPE`,Array.isArray(o)?`array`:o,n)}r.searchableProperties.push(n),r.searchablePropertiesWithTypes[n]=o}}return r}function pU(e,t,n,r,i,a,o,s){return c=>{let{type:l,node:u}=t.indexes[n];switch(l){case`Bool`:u[c?`true`:`false`].add(r);break;case`AVL`:{let e=s?.avlRebalanceThreshold??1;u.insert(c,r,e);break}case`Radix`:{let s=a.tokenize(c,i,n,!1);e.insertDocumentScoreParameters(t,n,r,s,o);for(let i of s)e.insertTokenScoreParameters(t,n,r,s,i),u.insert(i,r);break}case`Flat`:u.insert(c,r);break;case`BKD`:u.insert(c,[r]);break}}}function mU(e,t,n,r,i,a,o,s,c,l,u){if(bH(o))return hU(t,n,a,r,i);let d=pU(e,t,n,i,s,c,l,u);if(!xH(o))return d(a);let f=a,p=f.length;for(let e=0;e<p;e++)d(f[e])}function hU(e,t,n,r,i){e.vectorIndexes[t].node.add(i,n)}function gU(e,t,n,r,i,a,o,s,c,l){if(bH(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 _U(e,t,n,r,i,a,o,s,c,l){if(!xH(o))return gU(e,t,n,r,i,a,o,s,c,l);let u=SH(o),d=a,f=d.length;for(let a=0;a<f;a++)gU(e,t,n,r,i,d[a],u,s,c,l);return!0}function vU(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=iU(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 yU(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 pH(`WRONG_SEARCH_PROPERTY_TYPE`,n);let d=s[n]??1;if(d<=0)throw pH(`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];vU(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 bU(e,t,n,r){if(`and`in n&&n.and&&Array.isArray(n.and)){let i=n.and;return i.length===0?new Set:sH(...i.map(n=>bU(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=>bU(e,t,n,r)).reduce((e,t)=>lH(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 uH(a,bU(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 pH(`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]=lH(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=rH(t,r),d=s.searchByRadius(n,u,c,void 0,l);a[o]=EU(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]=EU(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]=AU(a[o],t)}}continue}let u=Object.keys(i);if(u.length>1)throw pH(`INVALID_FILTER_OPERATION`,u.length);if(c===`Flat`){let e=new Set(l?s.filterArr(i):s.filter(i));a[o]=lH(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 pH(`INVALID_FILTER_OPERATION`,e)}a[o]=lH(a[o],n)}}return sH(...Object.values(a))}function xU(e){return e.searchableProperties}function SU(e){return e.searchablePropertiesWithTypes}function CU(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:eU.fromJSON(t),isArray:i};break;case`Flat`:u[e]={type:`Flat`,node:XH.fromJSON(t),isArray:i};break;case`AVL`:u[e]={type:`AVL`,node:YH.fromJSON(t),isArray:i};break;case`BKD`:u[e]={type:`BKD`,node:nU.fromJSON(t),isArray:i};break;case`Bool`:u[e]={type:`Bool`,node:rU.fromJSON(t),isArray:i};break;default:u[e]=n[e]}}for(let e of Object.keys(r))d[e]={type:`Vector`,isArray:!1,node:aU.fromJSON(r[e])};return{sharedInternalDocumentStore:e,indexes:u,vectorIndexes:d,searchableProperties:i,searchablePropertiesWithTypes:a,frequencies:o,tokenOccurrences:s,avgFieldLength:c,fieldLengths:l}}function wU(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 TU(){return{create:fU,insert:mU,remove:_U,insertDocumentScoreParameters:cU,insertTokenScoreParameters:lU,removeDocumentScoreParameters:uU,removeTokenScoreParameters:dU,calculateResultScores:vU,search:yU,searchByWhereClause:bU,getSearchableProperties:xU,getSearchablePropertiesWithTypes:SU,load:CU,save:wU}}function EU(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 DU(e,t,n=!1){let r=n?nU.vincentyDistance:nU.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 OU(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 kU(e,t){let n=e,r=OU(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=rH(e,n);return s=o.searchByRadius(c,l,r,`asc`,i),DU(s,c,i)}else if(`polygon`in a){let{coordinates:e,inside:t=!0,highPrecision:n=!1}=a.polygon;s=o.searchByPolygon(e,t,`asc`,n);let r=nU.calculatePolygonCentroid(e);return DU(s,r,n)}return null}function AU(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 jU(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=jU(e,t,s,r,n);UV(a.sortableProperties,i.sortableProperties),a.sorts={...a.sorts,...i.sorts},a.sortablePropertiesWithTypes={...a.sortablePropertiesWithTypes,...i.sortablePropertiesWithTypes};continue}if(!bH(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 pH(`INVALID_SORT_SCHEMA_TYPE`,Array.isArray(s)?`array`:s,n)}}}return a}function MU(e,t,n,r){return r?.enabled===!1?{disabled:!0}:jU(e,t,n,(r||{}).unsortableProperties||[],``)}function NU(e,t,n,r){if(!e.enabled)return;e.isSorted=!1;let i=DH(e.sharedInternalDocumentStore,n),a=e.sorts[t];a.orderedDocsToRemove.has(i)&&BU(e,t),a.docs.set(i,a.orderedDocs.length),a.orderedDocs.push([i,r])}function PU(e){if(e.isSorted||!e.enabled)return;let t=Object.keys(e.sorts);for(let n of t)RU(e,n);e.isSorted=!0}function FU(e,t,n){return t[1].localeCompare(n[1],IV(e))}function IU(e,t){return e[1]-t[1]}function LU(e,t){return t[1]?-1:1}function RU(e,t){let n=e.sorts[t],r;switch(n.type){case`string`:r=FU.bind(null,e.language);break;case`number`:r=IU.bind(null);break;case`boolean`:r=LU.bind(null);break}n.orderedDocs.sort(r);let i=n.orderedDocs.length;for(let e=0;e<i;e++){let t=n.orderedDocs[e][0];n.docs.set(t,e)}}function zU(e){let t=Object.keys(e.sorts);for(let n of t)BU(e,n)}function BU(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 VU(e,t,n){if(!e.enabled)return;let r=e.sorts[t],i=DH(e.sharedInternalDocumentStore,n);r.docs.get(i)&&(r.docs.delete(i),r.orderedDocsToRemove.set(i,!0))}function HU(e,t,n){if(!e.enabled)throw pH(`SORT_DISABLED`);let r=n.property,i=n.order===`DESC`,a=e.sorts[r];if(!a)throw pH(`UNABLE_TO_SORT_ON_UNKNOWN_FIELD`,r,e.sortableProperties.join(`, `));return BU(e,r),PU(e),t.sort((t,n)=>{let r=a.docs.get(DH(e.sharedInternalDocumentStore,t[0])),o=a.docs.get(DH(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 UU(e){return e.enabled?e.sortableProperties:[]}function WU(e){return e.enabled?e.sortablePropertiesWithTypes:{}}function GU(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 KU(e){if(!e.enabled)return{enabled:!1};zU(e),PU(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 qU(){return{create:MU,insert:NU,remove:VU,save:KU,load:GU,sortBy:HU,getSortableProperties:UU,getSortablePropertiesWithTypes:WU}}const JU=[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 YU(e){return e<192||e>383?e:JU[e-192]||e}function XU(e){let t=[];for(let n=0;n<e.length;n++)t[n]=YU(e.charCodeAt(n));return String.fromCharCode(...t)}const ZU={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`},QU={icate:`ic`,ative:``,alize:`al`,iciti:`ic`,ical:`ic`,ful:``,ness:``},$U=`[aeiouy]`,eW=`[^aeiou][^aeiouy]*`;$U+``;const tW=`^(`+eW+`)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*`;``+eW;const nW=`^(`+eW+`)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*[aeiouy][aeiou]*[^aeiou][^aeiouy]*`,rW=`^(`+eW+`)?[aeiouy]`;function iW(e){let t,n,r,i,a,o;if(e.length<3)return e;let s=e.substring(0,1);if(s==`y`&&(e=s.toUpperCase()+e.substring(1)),r=/^(.+?)(ss|i)es$/,i=/^(.+?)([^s])s$/,r.test(e)?e=e.replace(r,`$1$2`):i.test(e)&&(e=e.replace(i,`$1$2`)),r=/^(.+?)eed$/,i=/^(.+?)(ed|ing)$/,r.test(e)){let t=r.exec(e);r=new RegExp(tW),r.test(t[1])&&(r=/.$/,e=e.replace(r,``))}else i.test(e)&&(t=i.exec(e)[1],i=new RegExp(rW),i.test(t)&&(e=t,i=/(at|bl|iz)$/,a=RegExp(`([^aeiouylsz])\\1$`),o=RegExp(`^`+eW+$U+`[^aeiouwxy]$`),i.test(e)?e+=`e`:a.test(e)?(r=/.$/,e=e.replace(r,``)):o.test(e)&&(e+=`e`)));if(r=/^(.+?)y$/,r.test(e)&&(t=r.exec(e)?.[1],r=new RegExp(rW),t&&r.test(t)&&(e=t+`i`)),r=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,r.test(e)){let i=r.exec(e);t=i?.[1],n=i?.[2],r=new RegExp(tW),t&&r.test(t)&&(e=t+ZU[n])}if(r=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,r.test(e)){let i=r.exec(e);t=i?.[1],n=i?.[2],r=new RegExp(tW),t&&r.test(t)&&(e=t+QU[n])}if(r=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,i=/^(.+?)(s|t)(ion)$/,r.test(e))t=r.exec(e)?.[1],r=new RegExp(nW),t&&r.test(t)&&(e=t);else if(i.test(e)){let n=i.exec(e);t=n?.[1]??``+n?.[2]??``,i=new RegExp(nW),i.test(t)&&(e=t)}return r=/^(.+?)e$/,r.test(e)&&(t=r.exec(e)?.[1],r=new RegExp(nW),i=RegExp(`^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*([aeiouy][aeiou]*)?$`),a=RegExp(`^`+eW+$U+`[^aeiouwxy]$`),t&&(r.test(t)||i.test(t)&&!a.test(t))&&(e=t)),r=/ll$/,i=new RegExp(nW),r.test(e)&&i.test(e)&&(r=/.$/,e=e.replace(r,``)),s==`y`&&(e=s.toLowerCase()+e.substring(1)),e}function aW(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=XU(t),n&&this.normalizationCache.set(r,t),t)}function oW(e){for(;e[e.length-1]===``;)e.pop();for(;e[0]===``;)e.shift();return e}function sW(e,t,n,r=!0){if(t&&t!==this.language)throw pH(`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=PV[this.language];a=e.toLowerCase().split(t).map(e=>i(e,r)).filter(Boolean)}let o=oW(a);return this.allowDuplicates?o:Array.from(new Set(o))}function cW(e={}){if(!e.language)e.language=`english`;else if(!FV.includes(e.language))throw pH(`LANGUAGE_NOT_SUPPORTED`,e.language);let t;if(e.stemming||e.stemmer&&!(`stemming`in e))if(e.stemmer){if(typeof e.stemmer!=`function`)throw pH(`INVALID_STEMMER_FUNCTION_TYPE`);t=e.stemmer}else if(e.language===`english`)t=iW;else throw pH(`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 pH(`CUSTOM_STOP_WORDS_MUST_BE_FUNCTION_OR_ARRAY`);if(!Array.isArray(n))throw pH(`CUSTOM_STOP_WORDS_MUST_BE_FUNCTION_OR_ARRAY`);for(let e of n)if(typeof e!=`string`)throw pH(`CUSTOM_STOP_WORDS_MUST_BE_FUNCTION_OR_ARRAY`)}let r={tokenize:sW,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:aW,normalizationCache:new Map};return r.tokenize=sW.bind(r),r.normalizeToken=aW,r}function lW(e){return{sharedInternalDocumentStore:e,rules:new Map}}function uW(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 dW(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 fW(e,t){return e.rules.delete(t)}function pW(e,t){return e.rules.get(t)}function mW(e){return Array.from(e.rules.values())}function hW(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 gW(e,t){return e?t.conditions.every(t=>hW(e,t)):!1}function _W(e,t){if(!t)return[];let n=[];for(let r of e.rules.values())gW(t,r)&&n.push(r);return n}function vW(e,t){return{sharedInternalDocumentStore:e,rules:new Map(t?.rules??[])}}function yW(e){return{rules:Array.from(e.rules.entries())}}function bW(){return{create:lW,addRule:uW,updateRule:dW,removeRule:fW,getRule:pW,getAllRules:mW,getMatchingRules:_W,load:vW,save:yW}}function xW(e){let t={formatElapsedTime:mH,getDocumentIndexId:hH,getDocumentProperties:eH,validateSchema:gH};for(let n of HH){let r=n;if(e[r]){if(typeof e[r]!=`function`)throw pH(`COMPONENT_MUST_BE_FUNCTION`,r)}else e[r]=t[r]}for(let t of Object.keys(e))if(!VH.includes(t)&&!HH.includes(t))throw pH(`UNSUPPORTED_COMPONENT`,t)}function SW({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 pH(`PLUGIN_COMPONENT_CONFLICT`,e,t.name);r={...r,...n}}i||=XV();let o=r.tokenizer,s=r.index,c=r.documentsStore,l=r.sorter,u=r.pinning;if(o=o?o.tokenize?o:cW(o):cW({language:n??`english`}),r.tokenizer&&n)throw pH(`NO_LANGUAGE_WITH_CUSTOM_TOKENIZER`);let d=wH();s||=TU(),l||=qU(),c||=RH(),u||=bW(),xW(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:CW()};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 zH)g[e]=(g[e]??[]).concat(BH(g,e));let _=g.afterCreate;return _&&qH(_,g),g}function CW(){return`{{VERSION}}`}function wW(e){return e.documentsStore.count(e.data.docs)}function TW(e,t,n,r,i){let a=e.validateSchema(t,e.schema);if(a)throw pH(`SCHEMA_VALIDATION_FAILURE`,a);return aH(e.beforeInsert)||aH(e.afterInsert)||aH(e.index.beforeInsert)||aH(e.index.insert)||aH(e.index.afterInsert)?OW(e,t,n,r,i):kW(e,t,n,r,i)}const EW=new Set([`enum`,`enum[]`]),DW=new Set([`string`,`number`]);async function OW(e,t,n,r,i){let{index:a,docs:o}=e.data,s=e.getDocumentIndexId(t);if(typeof s!=`string`)throw pH(`DOCUMENT_ID_MUST_BE_STRING`,typeof s);let c=DH(e.internalDocumentIDStore,s);if(r||await UH(e.beforeInsert,e,s,t),!e.documentsStore.store(o,s,c,t))throw pH(`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];AW(n,r,e,t)}return await jW(e,s,u,f,l,n,t,i),r||await UH(e.afterInsert,e,s,t),s}function kW(e,t,n,r,i){let{index:a,docs:o}=e.data,s=e.getDocumentIndexId(t);if(typeof s!=`string`)throw pH(`DOCUMENT_ID_MUST_BE_STRING`,typeof s);let c=DH(e.internalDocumentIDStore,s);if(r||UH(e.beforeInsert,e,s,t),!e.documentsStore.store(o,s,c,t))throw pH(`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];AW(n,r,e,t)}return MW(e,s,u,f,l,n,t,i),r||UH(e.afterInsert,e,s,t),s}function AW(e,t,n,r){if(!(yH(t)&&typeof r==`object`&&typeof r.lon==`number`&&typeof r.lat==`number`)&&!(bH(t)&&Array.isArray(r))&&!(xH(t)&&Array.isArray(r))&&!(EW.has(t)&&DW.has(e))&&e!==t)throw pH(`INVALID_DOCUMENT_PROPERTY`,n,t,e)}async function jW(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 MW(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=DH(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 NW(e,t,n,r,i,a){return aH(e.afterInsertMultiple)||aH(e.beforeInsertMultiple)||aH(e.index.beforeInsert)||aH(e.index.insert)||aH(e.index.afterInsert)?PW(e,t,n,r,i,a):FW(e,t,n,r,i,a)}async function PW(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 TW(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&&dH(e)}}})(),i||await WH(e.afterInsertMultiple,e,t),o}function FW(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=TW(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&&dH(e)}}}return l(),i||WH(e.afterInsertMultiple,e,t),o}function IW(e,t){return e[1]-t[1]}function LW(e,t){return t[1]-e[1]}function RW(e=`desc`){return e.toLowerCase()===`asc`?IW:LW}function zW(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(`.`)?tH(t,e):t[e],a=s[e],o=r[e].values;switch(a){case`number`:{let t=n[e].ranges;BW(t,o)(i);break}case`number[]`:{let t=new Set,r=n[e].ranges,a=BW(r,o,t);for(let e of i)a(e);break}case`boolean`:case`enum`:case`string`:VW(o,a)(i);break;case`boolean[]`:case`enum[]`:case`string[]`:{let e=VW(o,a===`boolean[]`?`boolean`:`string`,new Set);for(let t of i)e(t);break}default:throw pH(`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=RW(r.sort);t.values=Object.fromEntries(Object.entries(t.values).sort(i).slice(r.offset??0,r.limit??10))}}return r}function BW(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 VW(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 HW={reducer:(e,t,n,r)=>(t[r]=n,t),getInitialValue:e=>Array.from({length:e})},UW=[`string`,`number`,`boolean`];function WW(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 pH(`UNKNOWN_GROUP_BY_PROPERTY`,t);if(!UW.includes(a[t]))throw pH(`INVALID_GROUP_BY_PROPERTY`,t,UW.join(`, `),a[t])}let o=t.map(([t])=>OH(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=tH(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=GW(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=$V(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||HW,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 GW(e,t=0){if(t+1===e.length)return e[t].map(e=>[e]);let n=e[t],r=GW(e,t+1),i=[];for(let e of n)for(let t of r){let n=[e];UV(n,t),i.push(n)}return i}function KW(e,t,n,r){let i=_W(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=DH(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 qW(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 pH(`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=wW(e);if(l=e.index.search(a,r||``,e.tokenizer,n,o,t.exact||!1,t.tolerance||0,t.boost||{},QW(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=YW(r,e);if(typeof n==`string`&&t.every(e=>RegExp(`\\b${JW(e)}\\b`).test(n)))return!0}return!1})}}else l=s?kU(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 JW(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function YW(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 XW(e,t,n){let r=YV();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=qW(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])=>[DH(e.internalDocumentIDStore,t),n]);else d=d.sort(QV);d=KW(e,e.data.pinning,d,t.term);let f;u||(f=c?uG(e,d,s,o,c):dG(e,d,s,o));let p={elapsed:{formatted:``,raw:0},hits:[],count:d.length};return f!==void 0&&(p.hits=f.filter(Boolean),l||iH(p,i)),a&&(p.facets=zW(e,d,t.facets)),t.groupBy&&(p.groups=WW(e,d,t.groupBy)),p.elapsed=e.formatElapsedTime(YV()-r),p}async function a(){e.beforeSearch&&await KH(e.beforeSearch,e,t,n);let r=i();return e.afterSearch&&await GH(e.afterSearch,e,t,n,r),r}return e.beforeSearch?.length||e.afterSearch?.length?a():i()}const ZW={k:1.2,b:.75,d:.5};function QW(e){let t=e??{};return t.k=t.k??ZW.k,t.b=t.b??ZW.b,t.d=t.d??ZW.d,t}function $W(e,t,n){let r=t.vector;if(r&&(!(`value`in r)||!(`property`in r)))throw pH(`INVALID_VECTOR_INPUT`,Object.keys(r).join(`, `));let i=e.data.index.vectorIndexes[r.property];if(!i)throw pH(`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?pH(`INVALID_INPUT_VECTOR`,`undefined`,a,`undefined`):pH(`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 eG(e,t,n=`english`){let r=YV();function i(){let i=$W(e,t,n).sort(QV);i=KW(e,e.data.pinning,i,void 0);let a=[];t.facets&&Object.keys(t.facets).length>0&&(a=zW(e,i,t.facets));let o=t.vector.property,s=t.includeVectors??!1,c=t.limit??10,l=t.offset??0,u=Array.from({length:c});for(let t=0;t<c;t++){let n=i[t+l];if(!n)break;let r=e.data.docs.docs[n[0]];r&&(s||(r[o]=null),u[t]={id:OH(e.internalDocumentIDStore,n[0]),score:n[1],document:r})}let d=[];t.groupBy&&(d=WW(e,i,t.groupBy));let f=YV()-r;return{count:i.length,hits:u.filter(Boolean),elapsed:{raw:Number(f),formatted:JV(f)},...a?{facets:a}:{},...d?{groups:d}:{}}}async function a(){e.beforeSearch&&await KH(e.beforeSearch,e,t,n);let r=i();return e.afterSearch&&await GH(e.afterSearch,e,t,n,r),r}return e.beforeSearch?.length||e.afterSearch?.length?a():i()}function tG(e,t,n){let r=iG(qW(e,t,n)),i=$W(e,t,n),a=t.hybridWeights;return sG(r,i,t.term??``,a)}function nG(e,t,n){let r=YV();function i(){let i=tG(e,t,n);i=KW(e,e.data.pinning,i,t.term);let a;t.facets&&Object.keys(t.facets).length>0&&(a=zW(e,i,t.facets));let o;t.groupBy&&(o=WW(e,i,t.groupBy));let s=t.offset??0,c=t.limit??10,l=dG(e,i,s,c).filter(Boolean),u=YV(),d={count:i.length,elapsed:{raw:Number(u-r),formatted:JV(u-r)},hits:l,...a?{facets:a}:{},...o?{groups:o}:{}};return(t.includeVectors??!1)||iH(d,Object.keys(e.data.index.vectorIndexes)),d}async function a(){e.beforeSearch&&await KH(e.beforeSearch,e,t,n);let r=i();return e.afterSearch&&await GH(e.afterSearch,e,t,n,r),r}return e.beforeSearch?.length||e.afterSearch?.length?a():i()}function rG(e){return e[1]}function iG(e){let t=Math.max.apply(Math,e.map(rG));return e.map(([e,n])=>[e,n/t])}function aG(e,t){return e/t}function oG(e,t){return(n,r)=>n*e+r*t}function sG(e,t,n,r){let i=Math.max.apply(Math,e.map(rG)),a=Math.max.apply(Math,t.map(rG)),{text:o,vector:s}=r&&r.text&&r.vector?r:cG(n),c=new Map,l=e.length,u=oG(o,s);for(let t=0;t<l;t++){let[n,r]=e[t],a=u(aG(r,i),0);c.set(n,a)}let d=t.length;for(let e=0;e<d;e++){let[n,r]=t[e],i=aG(r,a),o=c.get(n)??0;c.set(n,o+u(0,i))}return[...c].sort((e,t)=>t[1]-e[1])}function cG(e){return{text:.5,vector:.5}}function lG(e,t,n){let r=t.mode??`fulltext`;if(r===`fulltext`)return XW(e,t,n);if(r===`vector`)return eG(e,t);if(r===`hybrid`)return nG(e,t);throw pH(`INVALID_SEARCH_MODE`,r)}function uG(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=tH(m,i);if(!(h===void 0||o.has(h))&&(o.set(h,!0),u++,!(u<=n)&&(s.push({id:OH(e.internalDocumentIDStore,f),score:p,document:m}),c.add(f),u>=n+r)))break}return s}function dG(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:OH(e.internalDocumentIDStore,r),score:c,document:t},o.add(r)}}return a}var fG=n(OV(),1);const pG=1,mG={protocol:`x-ok-client-protocol`,runtime:`x-ok-client-runtime`,kind:`x-ok-client-kind`};function hG({kind:e,runtimeVersion:t}){return{[mG.protocol]:`1`,[mG.runtime]:t,[mG.kind]:e}}const gG=`__system__`,_G=1,vG=`__config__/project`,yG=`__user__/config.yml`,bG=`__local__/project`,xG=`__config__/okignore`,SG=Object.freeze([vG,bG,yG,xG]),CG=`__skill__/`,wG=`__template__/`,TG=[`project`,`global`];function EG(e){return e.startsWith(`__skill__/`)||e.startsWith(`__template__/`)}const DG=`.ok/skills`;function OG(e){return`${DG}/${e}/SKILL`}const kG=[`references`,`scripts`];function AG(e,t){let n=/^(\.ok\/skills\/[^/]+)\/SKILL$/.exec(t);if(!n)return null;let r=n[1],i=e.trim().replace(/\.mdx?$/i,``).split(`/`).filter(e=>e!==``&&e!==`.`),[a]=i;return!a||!kG.includes(a)||i.includes(`..`)||i.length<2?null:`${r}/${i.join(`/`)}`}const jG=/^\.ok\/skills\/([^/]+)\/(SKILL|references\/.+)$/;function MG(e){let t=jG.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 NG=/^__skill__\/global\/([^/]+)(?:\/(references\/.+))?$/;function PG(e){let t=NG.exec(e);if(!t)return null;let n=t[1],r=t[2];return r===void 0?{name:n,kind:`skill`,rel:null}:{name:n,kind:`reference`,rel:r.slice(11)}}function FG(e,t){return e===`project`?OG(t):`${CG}${e}/${t}`}function IG(e){if(e===``)return``;try{return e.split(`/`).map(e=>decodeURIComponent(e)).join(`/`)}catch{return e}}function LG(e){if(e.startsWith(`__skill__/`)){let t=e.slice(10),n=t.indexOf(`/`);if(n<0)return null;let r=t.slice(0,n);if(r!==`global`&&r!==`project`)return null;let i=t.slice(n+1);return i?{kind:`skill`,scope:r,name:IG(i)}:null}if(e.startsWith(`__template__/`)){let t=e.slice(13);if(!t)return null;let n=t.lastIndexOf(`/`),r=n<0?t:t.slice(n+1);return r?{kind:`template`,folder:IG(n<0?``:t.slice(0,n)),name:IG(r)}:null}return null}const RG=/^(?:(.+)\/)?\.ok\/templates\/([^/]+?)(?:\.mdx?)?$/;function zG(e){let t=RG.exec(e);if(t){let e=(t[1]??``).replace(/^\/+|\/+$/g,``);return`${wG}${e?`${e}/`:``}${t[2]}`}return null}const BG=[`.mdx`,`.md`],VG=`epoch`,HG=512*1024,UG=[`claude`,`claude-desktop`,`cursor`,`codex`,`opencode`,`openclaw`,`pi`,`antigravity`,`lm-studio`],WG={claude:`Claude`,"claude-desktop":`Claude Desktop`,cursor:`Cursor`,codex:`Codex`,opencode:`OpenCode`,openclaw:`OpenClaw`,pi:`Pi`,antigravity:`Antigravity`,"lm-studio":`LM Studio`},GG={claude:`.claude/skills`,"claude-desktop":null,cursor:`.cursor/skills`,codex:`.codex/skills`,opencode:`.opencode/skills`,openclaw:null,pi:`.pi/skills`,antigravity:null,"lm-studio":null},KG=UG.filter(e=>GG[e]!==null),qG=KG.filter(e=>e!==`pi`).map(e=>({hostDir:(GG[e]??``).split(`/`)[0],editorId:e})),JG={claude:`.mcp.json`,"claude-desktop":null,cursor:`.cursor/mcp.json`,codex:`.codex/config.toml`,opencode:`opencode.json`,openclaw:null,pi:`.pi/extensions/open-knowledge.ts`,antigravity:null,"lm-studio":null},YG={cursor:/\bCursor(?:\([^)]+\))?\/\d/,codex:/\bCodex(?:\([^)]+\))?\/\d/,"claude-desktop":/\bClaude(?:\([^)]+\))?\/\d/},XG=`Ov23liqlSd0V1MwR6rhI`,ZG=[`incoming`,`outgoing`,`both`];function QG(e){return ZG.includes(e)}const $G=`open-knowledge`,eK=[{id:`chart`,title:`Chart`,description:`A bar chart whose series colors track the OK chart palette.`,html:`<div style="font-family:system-ui,sans-serif;padding:20px;color:var(--foreground)">
|
|
304
|
+
`,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 pH(e,...t){let n=Error(WV(fH[e]??`Unsupported Orama Error code: ${e}`,...t));return n.code=e,`captureStackTrace`in Error.prototype&&Error.captureStackTrace(n),n}function mH(e){return{raw:Number(e),formatted:JV(e)}}function hH(e){if(e.id){if(typeof e.id!=`string`)throw pH(`DOCUMENT_ID_MUST_BE_STRING`,typeof e.id);return e.id}return XV()}function gH(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(bH(r)){let e=CH(r);if(!Array.isArray(t)||t.length!==e)throw pH(`INVALID_INPUT_VECTOR`,n,e,t.length);continue}if(xH(r)){if(!Array.isArray(t))return n;let e=SH(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=gH(t,r);if(e)return n+`.`+e;continue}if(typeof t!==r)return n}}}const _H={string:!1,number:!1,boolean:!1,enum:!1,geopoint:!1,"string[]":!0,"number[]":!0,"boolean[]":!0,"enum[]":!0},vH={"string[]":`string`,"number[]":`number`,"boolean[]":`boolean`,"enum[]":`enum`};function yH(e){return e===`geopoint`}function bH(e){return typeof e==`string`&&/^vector\[\d+\]$/.test(e)}function xH(e){return typeof e==`string`&&_H[e]}function SH(e){return vH[e]}function CH(e){let t=Number(e.slice(7,-1));switch(!0){case isNaN(t):throw pH(`INVALID_VECTOR_VALUE`,e);case t<=0:throw pH(`INVALID_VECTOR_SIZE`,e);default:return t}}function wH(){return{idToInternalId:new Map,internalIdToId:[],save:TH,load:EH}}function TH(e){return{internalIdToId:e.internalIdToId}}function EH(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 DH(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?DH(e,t.toString()):t}function OH(e,t){if(e.internalIdToId.length<t)throw Error(`Invalid internalId ${t}`);return e.internalIdToId[t-1]}function kH(e,t){return{sharedInternalDocumentStore:t,docs:{},count:0}}function AH(e,t){let n=DH(e.sharedInternalDocumentStore,t);return e.docs[n]}function jH(e,t){let n=t.length,r=Array.from({length:n});for(let i=0;i<n;i++){let n=DH(e.sharedInternalDocumentStore,t[i]);r[i]=e.docs[n]}return r}function MH(e){return e.docs}function NH(e,t,n,r){return e.docs[n]===void 0?(e.docs[n]=r,e.count++,!0):!1}function PH(e,t){let n=DH(e.sharedInternalDocumentStore,t);return e.docs[n]===void 0?!1:(delete e.docs[n],e.count--,!0)}function FH(e){return e.count}function IH(e,t){let n=t;return{docs:n.docs,count:n.count,sharedInternalDocumentStore:e}}function LH(e){return{docs:e.docs,count:e.count}}function RH(){return{create:kH,get:AH,getMultiple:jH,getAll:MH,store:NH,remove:PH,count:FH,load:IH,save:LH}}const zH=[`beforeInsert`,`afterInsert`,`beforeRemove`,`afterRemove`,`beforeUpdate`,`afterUpdate`,`beforeUpsert`,`afterUpsert`,`beforeSearch`,`afterSearch`,`beforeInsertMultiple`,`afterInsertMultiple`,`beforeRemoveMultiple`,`afterRemoveMultiple`,`beforeUpdateMultiple`,`afterUpdateMultiple`,`beforeUpsertMultiple`,`afterUpsertMultiple`,`beforeLoad`,`afterLoad`,`afterCreate`];function BH(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),pH(`PLUGIN_CRASHED`)}return n}const VH=[`tokenizer`,`index`,`documentsStore`,`sorter`,`pinning`],HH=[`validateSchema`,`getDocumentIndexId`,`getDocumentProperties`,`formatElapsedTime`];function UH(e,t,n,r){if(e.some(aH))return(async()=>{for(let i of e)await i(t,n,r)})();for(let i of e)i(t,n,r)}function WH(e,t,n){if(e.some(aH))return(async()=>{for(let r of e)await r(t,n)})();for(let r of e)r(t,n)}function GH(e,t,n,r,i){if(e.some(aH))return(async()=>{for(let a of e)await a(t,n,r,i)})();for(let a of e)a(t,n,r,i)}function KH(e,t,n,r){if(e.some(aH))return(async()=>{for(let i of e)await i(t,n,r)})();for(let i of e)i(t,n,r)}function qH(e,t){if(e.some(aH))return(async()=>{for(let n of e)await n(t)})();for(let n of e)n(t)}var JH=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}},YH=class e{root=null;insertCount=0;constructor(e,t){e!==void 0&&t!==void 0&&(this.root=new JH(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?JH.fromJSON(t.root):null,n.insertCount=t.insertCount||0,n}insertNode(e,t,n,r){if(e===null)return new JH(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 JH(t,[n]),i.push({parent:a,node:a.l});break}else o=a,a=a.l;else if(t>a.k)if(a.r===null){a.r=new JH(t,[n]),i.push({parent:a,node:a.r});break}else o=a,a=a.r;else return a.v.add(n),e;let s=!1;this.insertCount++%r===0&&(s=!0);for(let t=i.length-1;t>=0;t--){let{parent:n,node:r}=i[t];if(r.updateHeight(),s){let t=this.rebalanceNode(r);n?n.l===r?n.l=t:n.r===r&&(n.r=t):e=t}}return e}rebalanceNode(e){let t=e.getBalanceFactor();if(t>1){if(e.l&&e.l.getBalanceFactor()>=0)return e.rotateRight();if(e.l)return e.l=e.l.rotateLeft(),e.rotateRight()}if(t<-1){if(e.r&&e.r.getBalanceFactor()<=0)return e.rotateLeft();if(e.r)return e.r=e.r.rotateRight(),e.rotateLeft()}return e}find(e){let t=this.findNodeByKey(e);return t?t.v:null}contains(e){return this.find(e)!==null}getSize(){let e=0,t=[],n=this.root;for(;n||t.length>0;){for(;n;)t.push(n),n=n.l;n=t.pop(),e++,n=n.r}return e}isBalanced(){if(!this.root)return!0;let e=[this.root];for(;e.length>0;){let t=e.pop(),n=t.getBalanceFactor();if(Math.abs(n)>1)return!1;t.l&&e.push(t.l),t.r&&e.push(t.r)}return!0}remove(e){this.root=this.removeNode(this.root,e)}removeDocument(e,t){let n=this.findNodeByKey(e);n&&(n.v.size===1?this.root=this.removeNode(this.root,e):n.v=new Set([...n.v.values()].filter(e=>e!==t)))}findNodeByKey(e){let t=this.root;for(;t;)if(e<t.k)t=t.l;else if(e>t.k)t=t.r;else return t;return null}removeNode(e,t){if(e===null)return null;let n=[],r=e;for(;r!==null&&r.k!==t;)n.push(r),r=t<r.k?r.l:r.r;if(r===null)return e;if(r.l===null||r.r===null){let t=r.l?r.l:r.r;if(n.length===0)e=t;else{let e=n[n.length-1];e.l===r?e.l=t:e.r=t}}else{let e=r,t=r.r;for(;t.l!==null;)e=t,t=t.l;r.k=t.k,r.v=t.v,e.l===t?e.l=t.r:e.r=t.r,r=e}n.push(r);for(let t=n.length-1;t>=0;t--){let r=n[t];r.updateHeight();let i=this.rebalanceNode(r);if(t>0){let e=n[t-1];e.l===r?e.l=i:e.r===r&&(e.r=i)}else e=i}return e}rangeSearch(e,t){let n=new Set,r=[],i=this.root;for(;i||r.length>0;){for(;i;)r.push(i),i=i.l;if(i=r.pop(),i.k>=e&&i.k<=t)for(let e of i.v)n.add(e);if(i.k>t)break;i=i.r}return n}greaterThan(e,t=!1){let n=new Set,r=[],i=this.root;for(;i||r.length>0;){for(;i;)r.push(i),i=i.r;if(i=r.pop(),t&&i.k>=e||!t&&i.k>e)for(let e of i.v)n.add(e);else if(i.k<=e)break;i=i.l}return n}lessThan(e,t=!1){let n=new Set,r=[],i=this.root;for(;i||r.length>0;){for(;i;)r.push(i),i=i.l;if(i=r.pop(),t&&i.k<=e||!t&&i.k<e)for(let e of i.v)n.add(e);else if(i.k>e)break;i=i.r}return n}},XH=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 ZH(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 QH(e,t,n){let r=ZH(e,t,n);return{distance:r,isBounded:r>=0}}var $H=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(ZV(e,i)!==null)if(r)if(Math.abs(t.length-i.length)<=r&&QH(t,i,r).isBounded)e[i]=[];else continue;else e[i]=[];if(ZV(e,i)!=null&&o.size>0){let t=e[i];for(let e of o)t.includes(e)||t.push(e)}}a.c.size>0&&i.push(...a.c.values())}return e}insert(t,n){let r=this,i=0,a=t.length;for(;i<a;){let o=t[i],s=r.c.get(o);if(s){let o=s.s,c=o.length,l=0;for(;l<c&&i+l<a&&o[l]===t[i+l];)l++;if(l===c){if(r=s,i+=l,i===a){s.e||=!0,s.addDocument(n);return}continue}let u=o.slice(0,l),d=o.slice(l),f=t.slice(i+l),p=new e(u[0],u,!1);if(r.c.set(u[0],p),p.updateParent(r),s.s=d,s.k=d[0],p.c.set(d[0],s),s.updateParent(p),f){let t=new e(f[0],f,!0);t.addDocument(n),p.c.set(f[0],t),t.updateParent(p)}else p.e=!0,p.addDocument(n);return}else{let a=new e(o,t.slice(i),!0);a.addDocument(n),r.c.set(o,a),a.updateParent(r);return}}r.e||=!0,r.addDocument(n)}_findLevenshtein(e,t,n,r,i){let a=[{node:this,index:t,tolerance:n}];for(;a.length>0;){let{node:t,index:n,tolerance:o}=a.pop();if(t.w.startsWith(e)){t.findAllWords(i,e,!1,0);continue}if(o<0)continue;if(t.e){let{w:n,d:a}=t;if(n&&(QH(e,n,r).isBounded&&(i[n]=[]),ZV(i,n)!==void 0&&a.size>0)){let e=new Set(i[n]);for(let t of a)e.add(t);i[n]=Array.from(e)}}if(n>=e.length)continue;let s=e[n];if(t.c.has(s)){let e=t.c.get(s);a.push({node:e,index:n+1,tolerance:o})}a.push({node:t,index:n+1,tolerance:o-1});for(let[e,r]of t.c)a.push({node:r,index:n,tolerance:o-1}),e!==s&&a.push({node:r,index:n+1,tolerance:o-1})}}find(e){let{term:t,exact:n,tolerance:r}=e;if(r&&!n){let e={};return this._findLevenshtein(t,0,r,r,e),e}else{let e=this,i=0,a=t.length;for(;i<a;){let o=t[i],s=e.c.get(o);if(s){let o=s.s,c=o.length,l=0;for(;l<c&&i+l<a&&o[l]===t[i+l];)l++;if(l===c)e=s,i+=l;else if(i+l===a)if(l===a-i){if(n)return{};{let e={};return s.findAllWords(e,t,n,r),e}}else return{};else return{}}else return{}}let o={};return e.findAllWords(o,t,n,r),o}}contains(e){let t=this,n=0,r=e.length;for(;n<r;){let i=e[n],a=t.c.get(i);if(a){let i=a.s,o=i.length,s=0;for(;s<o&&n+s<r&&i[s]===e[n+s];)s++;if(s<o)return!1;n+=o,t=a}else return!1}return!0}removeWord(e){if(!e)return!1;let t=this,n=e.length,r=[];for(let i=0;i<n;i++){let n=e[i];if(t.c.has(n)){let e=t.c.get(n);r.push({parent:t,character:n}),i+=e.s.length-1,t=e}else return!1}for(t.d.clear(),t.e=!1;r.length>0&&t.c.size===0&&!t.e&&t.d.size===0;){let{parent:e,character:n}=r.pop();e.c.delete(n),t=e}return!0}removeDocumentByWord(e,t,n=!0){if(!e)return!0;let r=this,i=e.length;for(let a=0;a<i;a++){let i=e[a];if(r.c.has(i)){let o=r.c.get(i);a+=o.s.length-1,r=o,n&&r.w!==e||r.removeDocument(t)}else return!1}return!0}static getCommonPrefix(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e.charCodeAt(r)===t.charCodeAt(r);)r++;return e.slice(0,r)}toJSON(){return{w:this.w,s:this.s,e:this.e,k:this.k,d:Array.from(this.d),c:Array.from(this.c?.entries())?.map(([e,t])=>[e,t.toJSON()])}}static fromJSON(t){let n=new e(t.k,t.s,t.e);return n.w=t.w,n.d=new Set(t.d),n.c=new Map(t?.c?.map(([t,n])=>[t,e.fromJSON(n)])||[]),n}},eU=class e extends $H{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,$H.fromJSON(t)])||[]),n}toJSON(){return super.toJSON()}},tU=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}},nU=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 tU(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=tU.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=(1-r)*n,a=Math.PI/180,o=e.lat*a,s=t.lat*a,c=(t.lon-e.lon)*a,l=Math.atan((1-r)*Math.tan(o)),u=Math.atan((1-r)*Math.tan(s)),d=Math.sin(l),f=Math.cos(l),p=Math.sin(u),m=Math.cos(u),h=c,g,_=1e3,v,y,b,x,S,C;do{let e=Math.sin(h),t=Math.cos(h);if(v=Math.sqrt(m*e*(m*e)+(f*p-d*m*t)*(f*p-d*m*t)),v===0)return 0;y=d*p+f*m*t,b=Math.atan2(v,y),x=f*m*e/v,S=1-x*x,C=y-2*d*p/S,isNaN(C)&&(C=0);let n=r/16*S*(4+r*(4-3*S));g=h,h=c+(1-n)*r*x*(b+n*v*(C+n*y*(-1+2*C*C)))}while(Math.abs(h-g)>1e-12&&--_>0);if(_===0)return NaN;let w=S*(n*n-i*i)/(i*i),T=1+w/16384*(4096+w*(-768+w*(320-175*w))),E=w/1024*(256+w*(-128+w*(74-47*w))),ee=E*v*(C+E/4*(y*(-1+2*C*C)-E/6*C*(-3+4*v*v)*(-3+4*C*C)));return i*T*(b-ee)}},rU=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 iU(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 aU=class e{size;vectors=new Map;constructor(e){this.size=e}add(e,t){t instanceof Float32Array||(t=new Float32Array(t));let n=oU(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)),sU(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 oU(e,t){let n=0;for(let r=0;r<t;r++)n+=e[r]*e[r];return Math.sqrt(n)}function sU(e,t,n,r,i){let a=oU(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 cU(e,t,n,r,i){let a=DH(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 lU(e,t,n,r,i){let a=0;for(let e of r)e===i&&a++;let o=DH(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 uU(e,t,n,r){let i=DH(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 dU(e,t,n){e.tokenOccurrences[t][n]--}function fU(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)){fU(e,t,o,r,n);continue}if(bH(o))r.searchableProperties.push(n),r.searchablePropertiesWithTypes[n]=o,r.vectorIndexes[n]={type:`Vector`,node:new aU(CH(o)),isArray:!1};else{let e=/\[/.test(o);switch(o){case`boolean`:case`boolean[]`:r.indexes[n]={type:`Bool`,node:new rU,isArray:e};break;case`number`:case`number[]`:r.indexes[n]={type:`AVL`,node:new YH(0,[]),isArray:e};break;case`string`:case`string[]`:r.indexes[n]={type:`Radix`,node:new eU,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 XH,isArray:e};break;case`geopoint`:r.indexes[n]={type:`BKD`,node:new nU,isArray:e};break;default:throw pH(`INVALID_SCHEMA_TYPE`,Array.isArray(o)?`array`:o,n)}r.searchableProperties.push(n),r.searchablePropertiesWithTypes[n]=o}}return r}function pU(e,t,n,r,i,a,o,s){return c=>{let{type:l,node:u}=t.indexes[n];switch(l){case`Bool`:u[c?`true`:`false`].add(r);break;case`AVL`:{let e=s?.avlRebalanceThreshold??1;u.insert(c,r,e);break}case`Radix`:{let s=a.tokenize(c,i,n,!1);e.insertDocumentScoreParameters(t,n,r,s,o);for(let i of s)e.insertTokenScoreParameters(t,n,r,s,i),u.insert(i,r);break}case`Flat`:u.insert(c,r);break;case`BKD`:u.insert(c,[r]);break}}}function mU(e,t,n,r,i,a,o,s,c,l,u){if(bH(o))return hU(t,n,a,r,i);let d=pU(e,t,n,i,s,c,l,u);if(!xH(o))return d(a);let f=a,p=f.length;for(let e=0;e<p;e++)d(f[e])}function hU(e,t,n,r,i){e.vectorIndexes[t].node.add(i,n)}function gU(e,t,n,r,i,a,o,s,c,l){if(bH(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 _U(e,t,n,r,i,a,o,s,c,l){if(!xH(o))return gU(e,t,n,r,i,a,o,s,c,l);let u=SH(o),d=a,f=d.length;for(let a=0;a<f;a++)gU(e,t,n,r,i,d[a],u,s,c,l);return!0}function vU(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=iU(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 yU(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 pH(`WRONG_SEARCH_PROPERTY_TYPE`,n);let d=s[n]??1;if(d<=0)throw pH(`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];vU(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 bU(e,t,n,r){if(`and`in n&&n.and&&Array.isArray(n.and)){let i=n.and;return i.length===0?new Set:sH(...i.map(n=>bU(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=>bU(e,t,n,r)).reduce((e,t)=>lH(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 uH(a,bU(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 pH(`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]=lH(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=rH(t,r),d=s.searchByRadius(n,u,c,void 0,l);a[o]=EU(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]=EU(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]=AU(a[o],t)}}continue}let u=Object.keys(i);if(u.length>1)throw pH(`INVALID_FILTER_OPERATION`,u.length);if(c===`Flat`){let e=new Set(l?s.filterArr(i):s.filter(i));a[o]=lH(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 pH(`INVALID_FILTER_OPERATION`,e)}a[o]=lH(a[o],n)}}return sH(...Object.values(a))}function xU(e){return e.searchableProperties}function SU(e){return e.searchablePropertiesWithTypes}function CU(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:eU.fromJSON(t),isArray:i};break;case`Flat`:u[e]={type:`Flat`,node:XH.fromJSON(t),isArray:i};break;case`AVL`:u[e]={type:`AVL`,node:YH.fromJSON(t),isArray:i};break;case`BKD`:u[e]={type:`BKD`,node:nU.fromJSON(t),isArray:i};break;case`Bool`:u[e]={type:`Bool`,node:rU.fromJSON(t),isArray:i};break;default:u[e]=n[e]}}for(let e of Object.keys(r))d[e]={type:`Vector`,isArray:!1,node:aU.fromJSON(r[e])};return{sharedInternalDocumentStore:e,indexes:u,vectorIndexes:d,searchableProperties:i,searchablePropertiesWithTypes:a,frequencies:o,tokenOccurrences:s,avgFieldLength:c,fieldLengths:l}}function wU(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 TU(){return{create:fU,insert:mU,remove:_U,insertDocumentScoreParameters:cU,insertTokenScoreParameters:lU,removeDocumentScoreParameters:uU,removeTokenScoreParameters:dU,calculateResultScores:vU,search:yU,searchByWhereClause:bU,getSearchableProperties:xU,getSearchablePropertiesWithTypes:SU,load:CU,save:wU}}function EU(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 DU(e,t,n=!1){let r=n?nU.vincentyDistance:nU.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 OU(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 kU(e,t){let n=e,r=OU(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=rH(e,n);return s=o.searchByRadius(c,l,r,`asc`,i),DU(s,c,i)}else if(`polygon`in a){let{coordinates:e,inside:t=!0,highPrecision:n=!1}=a.polygon;s=o.searchByPolygon(e,t,`asc`,n);let r=nU.calculatePolygonCentroid(e);return DU(s,r,n)}return null}function AU(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 jU(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=jU(e,t,s,r,n);UV(a.sortableProperties,i.sortableProperties),a.sorts={...a.sorts,...i.sorts},a.sortablePropertiesWithTypes={...a.sortablePropertiesWithTypes,...i.sortablePropertiesWithTypes};continue}if(!bH(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 pH(`INVALID_SORT_SCHEMA_TYPE`,Array.isArray(s)?`array`:s,n)}}}return a}function MU(e,t,n,r){return r?.enabled===!1?{disabled:!0}:jU(e,t,n,(r||{}).unsortableProperties||[],``)}function NU(e,t,n,r){if(!e.enabled)return;e.isSorted=!1;let i=DH(e.sharedInternalDocumentStore,n),a=e.sorts[t];a.orderedDocsToRemove.has(i)&&BU(e,t),a.docs.set(i,a.orderedDocs.length),a.orderedDocs.push([i,r])}function PU(e){if(e.isSorted||!e.enabled)return;let t=Object.keys(e.sorts);for(let n of t)RU(e,n);e.isSorted=!0}function FU(e,t,n){return t[1].localeCompare(n[1],IV(e))}function IU(e,t){return e[1]-t[1]}function LU(e,t){return t[1]?-1:1}function RU(e,t){let n=e.sorts[t],r;switch(n.type){case`string`:r=FU.bind(null,e.language);break;case`number`:r=IU.bind(null);break;case`boolean`:r=LU.bind(null);break}n.orderedDocs.sort(r);let i=n.orderedDocs.length;for(let e=0;e<i;e++){let t=n.orderedDocs[e][0];n.docs.set(t,e)}}function zU(e){let t=Object.keys(e.sorts);for(let n of t)BU(e,n)}function BU(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 VU(e,t,n){if(!e.enabled)return;let r=e.sorts[t],i=DH(e.sharedInternalDocumentStore,n);r.docs.get(i)&&(r.docs.delete(i),r.orderedDocsToRemove.set(i,!0))}function HU(e,t,n){if(!e.enabled)throw pH(`SORT_DISABLED`);let r=n.property,i=n.order===`DESC`,a=e.sorts[r];if(!a)throw pH(`UNABLE_TO_SORT_ON_UNKNOWN_FIELD`,r,e.sortableProperties.join(`, `));return BU(e,r),PU(e),t.sort((t,n)=>{let r=a.docs.get(DH(e.sharedInternalDocumentStore,t[0])),o=a.docs.get(DH(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 UU(e){return e.enabled?e.sortableProperties:[]}function WU(e){return e.enabled?e.sortablePropertiesWithTypes:{}}function GU(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 KU(e){if(!e.enabled)return{enabled:!1};zU(e),PU(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 qU(){return{create:MU,insert:NU,remove:VU,save:KU,load:GU,sortBy:HU,getSortableProperties:UU,getSortablePropertiesWithTypes:WU}}const JU=[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 YU(e){return e<192||e>383?e:JU[e-192]||e}function XU(e){let t=[];for(let n=0;n<e.length;n++)t[n]=YU(e.charCodeAt(n));return String.fromCharCode(...t)}const ZU={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`},QU={icate:`ic`,ative:``,alize:`al`,iciti:`ic`,ical:`ic`,ful:``,ness:``},$U=`[aeiouy]`,eW=`[^aeiou][^aeiouy]*`;$U+``;const tW=`^(`+eW+`)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*`;``+eW;const nW=`^(`+eW+`)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*[aeiouy][aeiou]*[^aeiou][^aeiouy]*`,rW=`^(`+eW+`)?[aeiouy]`;function iW(e){let t,n,r,i,a,o;if(e.length<3)return e;let s=e.substring(0,1);if(s==`y`&&(e=s.toUpperCase()+e.substring(1)),r=/^(.+?)(ss|i)es$/,i=/^(.+?)([^s])s$/,r.test(e)?e=e.replace(r,`$1$2`):i.test(e)&&(e=e.replace(i,`$1$2`)),r=/^(.+?)eed$/,i=/^(.+?)(ed|ing)$/,r.test(e)){let t=r.exec(e);r=new RegExp(tW),r.test(t[1])&&(r=/.$/,e=e.replace(r,``))}else i.test(e)&&(t=i.exec(e)[1],i=new RegExp(rW),i.test(t)&&(e=t,i=/(at|bl|iz)$/,a=RegExp(`([^aeiouylsz])\\1$`),o=RegExp(`^`+eW+$U+`[^aeiouwxy]$`),i.test(e)?e+=`e`:a.test(e)?(r=/.$/,e=e.replace(r,``)):o.test(e)&&(e+=`e`)));if(r=/^(.+?)y$/,r.test(e)&&(t=r.exec(e)?.[1],r=new RegExp(rW),t&&r.test(t)&&(e=t+`i`)),r=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,r.test(e)){let i=r.exec(e);t=i?.[1],n=i?.[2],r=new RegExp(tW),t&&r.test(t)&&(e=t+ZU[n])}if(r=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,r.test(e)){let i=r.exec(e);t=i?.[1],n=i?.[2],r=new RegExp(tW),t&&r.test(t)&&(e=t+QU[n])}if(r=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,i=/^(.+?)(s|t)(ion)$/,r.test(e))t=r.exec(e)?.[1],r=new RegExp(nW),t&&r.test(t)&&(e=t);else if(i.test(e)){let n=i.exec(e);t=n?.[1]??``+n?.[2]??``,i=new RegExp(nW),i.test(t)&&(e=t)}return r=/^(.+?)e$/,r.test(e)&&(t=r.exec(e)?.[1],r=new RegExp(nW),i=RegExp(`^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*([aeiouy][aeiou]*)?$`),a=RegExp(`^`+eW+$U+`[^aeiouwxy]$`),t&&(r.test(t)||i.test(t)&&!a.test(t))&&(e=t)),r=/ll$/,i=new RegExp(nW),r.test(e)&&i.test(e)&&(r=/.$/,e=e.replace(r,``)),s==`y`&&(e=s.toLowerCase()+e.substring(1)),e}function aW(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=XU(t),n&&this.normalizationCache.set(r,t),t)}function oW(e){for(;e[e.length-1]===``;)e.pop();for(;e[0]===``;)e.shift();return e}function sW(e,t,n,r=!0){if(t&&t!==this.language)throw pH(`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=PV[this.language];a=e.toLowerCase().split(t).map(e=>i(e,r)).filter(Boolean)}let o=oW(a);return this.allowDuplicates?o:Array.from(new Set(o))}function cW(e={}){if(!e.language)e.language=`english`;else if(!FV.includes(e.language))throw pH(`LANGUAGE_NOT_SUPPORTED`,e.language);let t;if(e.stemming||e.stemmer&&!(`stemming`in e))if(e.stemmer){if(typeof e.stemmer!=`function`)throw pH(`INVALID_STEMMER_FUNCTION_TYPE`);t=e.stemmer}else if(e.language===`english`)t=iW;else throw pH(`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 pH(`CUSTOM_STOP_WORDS_MUST_BE_FUNCTION_OR_ARRAY`);if(!Array.isArray(n))throw pH(`CUSTOM_STOP_WORDS_MUST_BE_FUNCTION_OR_ARRAY`);for(let e of n)if(typeof e!=`string`)throw pH(`CUSTOM_STOP_WORDS_MUST_BE_FUNCTION_OR_ARRAY`)}let r={tokenize:sW,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:aW,normalizationCache:new Map};return r.tokenize=sW.bind(r),r.normalizeToken=aW,r}function lW(e){return{sharedInternalDocumentStore:e,rules:new Map}}function uW(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 dW(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 fW(e,t){return e.rules.delete(t)}function pW(e,t){return e.rules.get(t)}function mW(e){return Array.from(e.rules.values())}function hW(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 gW(e,t){return e?t.conditions.every(t=>hW(e,t)):!1}function _W(e,t){if(!t)return[];let n=[];for(let r of e.rules.values())gW(t,r)&&n.push(r);return n}function vW(e,t){return{sharedInternalDocumentStore:e,rules:new Map(t?.rules??[])}}function yW(e){return{rules:Array.from(e.rules.entries())}}function bW(){return{create:lW,addRule:uW,updateRule:dW,removeRule:fW,getRule:pW,getAllRules:mW,getMatchingRules:_W,load:vW,save:yW}}function xW(e){let t={formatElapsedTime:mH,getDocumentIndexId:hH,getDocumentProperties:eH,validateSchema:gH};for(let n of HH){let r=n;if(e[r]){if(typeof e[r]!=`function`)throw pH(`COMPONENT_MUST_BE_FUNCTION`,r)}else e[r]=t[r]}for(let t of Object.keys(e))if(!VH.includes(t)&&!HH.includes(t))throw pH(`UNSUPPORTED_COMPONENT`,t)}function SW({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 pH(`PLUGIN_COMPONENT_CONFLICT`,e,t.name);r={...r,...n}}i||=XV();let o=r.tokenizer,s=r.index,c=r.documentsStore,l=r.sorter,u=r.pinning;if(o=o?o.tokenize?o:cW(o):cW({language:n??`english`}),r.tokenizer&&n)throw pH(`NO_LANGUAGE_WITH_CUSTOM_TOKENIZER`);let d=wH();s||=TU(),l||=qU(),c||=RH(),u||=bW(),xW(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:CW()};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 zH)g[e]=(g[e]??[]).concat(BH(g,e));let _=g.afterCreate;return _&&qH(_,g),g}function CW(){return`{{VERSION}}`}function wW(e){return e.documentsStore.count(e.data.docs)}function TW(e,t,n,r,i){let a=e.validateSchema(t,e.schema);if(a)throw pH(`SCHEMA_VALIDATION_FAILURE`,a);return aH(e.beforeInsert)||aH(e.afterInsert)||aH(e.index.beforeInsert)||aH(e.index.insert)||aH(e.index.afterInsert)?OW(e,t,n,r,i):kW(e,t,n,r,i)}const EW=new Set([`enum`,`enum[]`]),DW=new Set([`string`,`number`]);async function OW(e,t,n,r,i){let{index:a,docs:o}=e.data,s=e.getDocumentIndexId(t);if(typeof s!=`string`)throw pH(`DOCUMENT_ID_MUST_BE_STRING`,typeof s);let c=DH(e.internalDocumentIDStore,s);if(r||await UH(e.beforeInsert,e,s,t),!e.documentsStore.store(o,s,c,t))throw pH(`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];AW(n,r,e,t)}return await jW(e,s,u,f,l,n,t,i),r||await UH(e.afterInsert,e,s,t),s}function kW(e,t,n,r,i){let{index:a,docs:o}=e.data,s=e.getDocumentIndexId(t);if(typeof s!=`string`)throw pH(`DOCUMENT_ID_MUST_BE_STRING`,typeof s);let c=DH(e.internalDocumentIDStore,s);if(r||UH(e.beforeInsert,e,s,t),!e.documentsStore.store(o,s,c,t))throw pH(`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];AW(n,r,e,t)}return MW(e,s,u,f,l,n,t,i),r||UH(e.afterInsert,e,s,t),s}function AW(e,t,n,r){if(!(yH(t)&&typeof r==`object`&&typeof r.lon==`number`&&typeof r.lat==`number`)&&!(bH(t)&&Array.isArray(r))&&!(xH(t)&&Array.isArray(r))&&!(EW.has(t)&&DW.has(e))&&e!==t)throw pH(`INVALID_DOCUMENT_PROPERTY`,n,t,e)}async function jW(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 MW(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=DH(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 NW(e,t,n,r,i,a){return aH(e.afterInsertMultiple)||aH(e.beforeInsertMultiple)||aH(e.index.beforeInsert)||aH(e.index.insert)||aH(e.index.afterInsert)?PW(e,t,n,r,i,a):FW(e,t,n,r,i,a)}async function PW(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 TW(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&&dH(e)}}})(),i||await WH(e.afterInsertMultiple,e,t),o}function FW(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=TW(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&&dH(e)}}}return l(),i||WH(e.afterInsertMultiple,e,t),o}function IW(e,t){return e[1]-t[1]}function LW(e,t){return t[1]-e[1]}function RW(e=`desc`){return e.toLowerCase()===`asc`?IW:LW}function zW(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(`.`)?tH(t,e):t[e],a=s[e],o=r[e].values;switch(a){case`number`:{let t=n[e].ranges;BW(t,o)(i);break}case`number[]`:{let t=new Set,r=n[e].ranges,a=BW(r,o,t);for(let e of i)a(e);break}case`boolean`:case`enum`:case`string`:VW(o,a)(i);break;case`boolean[]`:case`enum[]`:case`string[]`:{let e=VW(o,a===`boolean[]`?`boolean`:`string`,new Set);for(let t of i)e(t);break}default:throw pH(`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=RW(r.sort);t.values=Object.fromEntries(Object.entries(t.values).sort(i).slice(r.offset??0,r.limit??10))}}return r}function BW(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 VW(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 HW={reducer:(e,t,n,r)=>(t[r]=n,t),getInitialValue:e=>Array.from({length:e})},UW=[`string`,`number`,`boolean`];function WW(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 pH(`UNKNOWN_GROUP_BY_PROPERTY`,t);if(!UW.includes(a[t]))throw pH(`INVALID_GROUP_BY_PROPERTY`,t,UW.join(`, `),a[t])}let o=t.map(([t])=>OH(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=tH(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=GW(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=$V(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||HW,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 GW(e,t=0){if(t+1===e.length)return e[t].map(e=>[e]);let n=e[t],r=GW(e,t+1),i=[];for(let e of n)for(let t of r){let n=[e];UV(n,t),i.push(n)}return i}function KW(e,t,n,r){let i=_W(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=DH(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 qW(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 pH(`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=wW(e);if(l=e.index.search(a,r||``,e.tokenizer,n,o,t.exact||!1,t.tolerance||0,t.boost||{},QW(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=YW(r,e);if(typeof n==`string`&&t.every(e=>RegExp(`\\b${JW(e)}\\b`).test(n)))return!0}return!1})}}else l=s?kU(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 JW(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function YW(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 XW(e,t,n){let r=YV();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=qW(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])=>[DH(e.internalDocumentIDStore,t),n]);else d=d.sort(QV);d=KW(e,e.data.pinning,d,t.term);let f;u||(f=c?uG(e,d,s,o,c):dG(e,d,s,o));let p={elapsed:{formatted:``,raw:0},hits:[],count:d.length};return f!==void 0&&(p.hits=f.filter(Boolean),l||iH(p,i)),a&&(p.facets=zW(e,d,t.facets)),t.groupBy&&(p.groups=WW(e,d,t.groupBy)),p.elapsed=e.formatElapsedTime(YV()-r),p}async function a(){e.beforeSearch&&await KH(e.beforeSearch,e,t,n);let r=i();return e.afterSearch&&await GH(e.afterSearch,e,t,n,r),r}return e.beforeSearch?.length||e.afterSearch?.length?a():i()}const ZW={k:1.2,b:.75,d:.5};function QW(e){let t=e??{};return t.k=t.k??ZW.k,t.b=t.b??ZW.b,t.d=t.d??ZW.d,t}function $W(e,t,n){let r=t.vector;if(r&&(!(`value`in r)||!(`property`in r)))throw pH(`INVALID_VECTOR_INPUT`,Object.keys(r).join(`, `));let i=e.data.index.vectorIndexes[r.property];if(!i)throw pH(`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?pH(`INVALID_INPUT_VECTOR`,`undefined`,a,`undefined`):pH(`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 eG(e,t,n=`english`){let r=YV();function i(){let i=$W(e,t,n).sort(QV);i=KW(e,e.data.pinning,i,void 0);let a=[];t.facets&&Object.keys(t.facets).length>0&&(a=zW(e,i,t.facets));let o=t.vector.property,s=t.includeVectors??!1,c=t.limit??10,l=t.offset??0,u=Array.from({length:c});for(let t=0;t<c;t++){let n=i[t+l];if(!n)break;let r=e.data.docs.docs[n[0]];r&&(s||(r[o]=null),u[t]={id:OH(e.internalDocumentIDStore,n[0]),score:n[1],document:r})}let d=[];t.groupBy&&(d=WW(e,i,t.groupBy));let f=YV()-r;return{count:i.length,hits:u.filter(Boolean),elapsed:{raw:Number(f),formatted:JV(f)},...a?{facets:a}:{},...d?{groups:d}:{}}}async function a(){e.beforeSearch&&await KH(e.beforeSearch,e,t,n);let r=i();return e.afterSearch&&await GH(e.afterSearch,e,t,n,r),r}return e.beforeSearch?.length||e.afterSearch?.length?a():i()}function tG(e,t,n){let r=iG(qW(e,t,n)),i=$W(e,t,n),a=t.hybridWeights;return sG(r,i,t.term??``,a)}function nG(e,t,n){let r=YV();function i(){let i=tG(e,t,n);i=KW(e,e.data.pinning,i,t.term);let a;t.facets&&Object.keys(t.facets).length>0&&(a=zW(e,i,t.facets));let o;t.groupBy&&(o=WW(e,i,t.groupBy));let s=t.offset??0,c=t.limit??10,l=dG(e,i,s,c).filter(Boolean),u=YV(),d={count:i.length,elapsed:{raw:Number(u-r),formatted:JV(u-r)},hits:l,...a?{facets:a}:{},...o?{groups:o}:{}};return(t.includeVectors??!1)||iH(d,Object.keys(e.data.index.vectorIndexes)),d}async function a(){e.beforeSearch&&await KH(e.beforeSearch,e,t,n);let r=i();return e.afterSearch&&await GH(e.afterSearch,e,t,n,r),r}return e.beforeSearch?.length||e.afterSearch?.length?a():i()}function rG(e){return e[1]}function iG(e){let t=Math.max.apply(Math,e.map(rG));return e.map(([e,n])=>[e,n/t])}function aG(e,t){return e/t}function oG(e,t){return(n,r)=>n*e+r*t}function sG(e,t,n,r){let i=Math.max.apply(Math,e.map(rG)),a=Math.max.apply(Math,t.map(rG)),{text:o,vector:s}=r&&r.text&&r.vector?r:cG(n),c=new Map,l=e.length,u=oG(o,s);for(let t=0;t<l;t++){let[n,r]=e[t],a=u(aG(r,i),0);c.set(n,a)}let d=t.length;for(let e=0;e<d;e++){let[n,r]=t[e],i=aG(r,a),o=c.get(n)??0;c.set(n,o+u(0,i))}return[...c].sort((e,t)=>t[1]-e[1])}function cG(e){return{text:.5,vector:.5}}function lG(e,t,n){let r=t.mode??`fulltext`;if(r===`fulltext`)return XW(e,t,n);if(r===`vector`)return eG(e,t);if(r===`hybrid`)return nG(e,t);throw pH(`INVALID_SEARCH_MODE`,r)}function uG(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=tH(m,i);if(!(h===void 0||o.has(h))&&(o.set(h,!0),u++,!(u<=n)&&(s.push({id:OH(e.internalDocumentIDStore,f),score:p,document:m}),c.add(f),u>=n+r)))break}return s}function dG(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:OH(e.internalDocumentIDStore,r),score:c,document:t},o.add(r)}}return a}var fG=n(OV(),1);const pG=1,mG={protocol:`x-ok-client-protocol`,runtime:`x-ok-client-runtime`,kind:`x-ok-client-kind`};function hG({kind:e,runtimeVersion:t}){return{[mG.protocol]:`1`,[mG.runtime]:t,[mG.kind]:e}}const gG=`__system__`,_G=1,vG=`__config__/project`,yG=`__user__/config.yml`,bG=`__local__/project`,xG=`__config__/okignore`,SG=Object.freeze([vG,bG,yG,xG]),CG=`__skill__/`,wG=`__template__/`,TG=[`project`,`global`];function EG(e){return e.startsWith(`__skill__/`)||e.startsWith(`__template__/`)}const DG=`.ok/skills`;function OG(e){return`${DG}/${e}/SKILL`}const kG=[`references`,`scripts`];function AG(e,t){let n=/^(\.ok\/skills\/[^/]+)\/SKILL$/.exec(t);if(!n)return null;let r=n[1],i=e.trim().replace(/\.mdx?$/i,``).split(`/`).filter(e=>e!==``&&e!==`.`),[a]=i;return!a||!kG.includes(a)||i.includes(`..`)||i.length<2?null:`${r}/${i.join(`/`)}`}const jG=/^\.ok\/skills\/([^/]+)\/(SKILL|references\/.+)$/;function MG(e){let t=jG.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 NG=/^__skill__\/global\/([^/]+)(?:\/(references\/.+))?$/;function PG(e){let t=NG.exec(e);if(!t)return null;let n=t[1],r=t[2];return r===void 0?{name:n,kind:`skill`,rel:null}:{name:n,kind:`reference`,rel:r.slice(11)}}function FG(e,t){return e===`project`?OG(t):`${CG}${e}/${t}`}function IG(e){if(e===``)return``;try{return e.split(`/`).map(e=>decodeURIComponent(e)).join(`/`)}catch{return e}}function LG(e){if(e.startsWith(`__skill__/`)){let t=e.slice(10),n=t.indexOf(`/`);if(n<0)return null;let r=t.slice(0,n);if(r!==`global`&&r!==`project`)return null;let i=t.slice(n+1);return i?{kind:`skill`,scope:r,name:IG(i)}:null}if(e.startsWith(`__template__/`)){let t=e.slice(13);if(!t)return null;let n=t.lastIndexOf(`/`),r=n<0?t:t.slice(n+1);return r?{kind:`template`,folder:IG(n<0?``:t.slice(0,n)),name:IG(r)}:null}return null}const RG=/^(?:(.+)\/)?\.ok\/templates\/([^/]+?)(?:\.mdx?)?$/;function zG(e){let t=RG.exec(e);if(t){let e=(t[1]??``).replace(/^\/+|\/+$/g,``);return`${wG}${e?`${e}/`:``}${t[2]}`}return null}const BG=[`.mdx`,`.md`],VG=`epoch`,HG=512*1024,UG=[`claude`,`claude-desktop`,`cursor`,`codex`,`opencode`,`openclaw`,`pi`,`antigravity`,`lm-studio`,`hermes`],WG={claude:`Claude`,"claude-desktop":`Claude Desktop`,cursor:`Cursor`,codex:`Codex`,opencode:`OpenCode`,openclaw:`OpenClaw`,pi:`Pi`,antigravity:`Antigravity`,"lm-studio":`LM Studio`,hermes:`Hermes`},GG={claude:`.claude/skills`,"claude-desktop":null,cursor:`.cursor/skills`,codex:`.codex/skills`,opencode:`.opencode/skills`,openclaw:null,pi:`.pi/skills`,antigravity:null,"lm-studio":null,hermes:null},KG=UG.filter(e=>GG[e]!==null),qG=KG.filter(e=>e!==`pi`).map(e=>({hostDir:(GG[e]??``).split(`/`)[0],editorId:e})),JG={claude:`.mcp.json`,"claude-desktop":null,cursor:`.cursor/mcp.json`,codex:`.codex/config.toml`,opencode:`opencode.json`,openclaw:null,pi:`.pi/extensions/open-knowledge.ts`,antigravity:null,"lm-studio":null,hermes:null},YG={cursor:/\bCursor(?:\([^)]+\))?\/\d/,codex:/\bCodex(?:\([^)]+\))?\/\d/,"claude-desktop":/\bClaude(?:\([^)]+\))?\/\d/},XG=`Ov23liqlSd0V1MwR6rhI`,ZG=[`incoming`,`outgoing`,`both`];function QG(e){return ZG.includes(e)}const $G=`open-knowledge`,eK=[{id:`chart`,title:`Chart`,description:`A bar chart whose series colors track the OK chart palette.`,html:`<div style="font-family:system-ui,sans-serif;padding:20px;color:var(--foreground)">
|
|
305
305
|
<h3 style="margin:0 0 14px;font-size:15px;font-weight:600">Revenue by region</h3>
|
|
306
306
|
<div id="bars" style="display:flex;align-items:flex-end;gap:14px;height:170px"></div>
|
|
307
307
|
<script>
|
|
@@ -364,7 +364,7 @@ Read more at https://docs.orama.com/docs/orama-js/plugins/plugin-secure-proxy#pl
|
|
|
364
364
|
});
|
|
365
365
|
<\/script>
|
|
366
366
|
</div>`}];function tK(e){return["```html preview",e.html,"```"].join(`
|
|
367
|
-
`)}const nK=[{name:`--chart-1`,light:`oklch(0.62 0.19 259)`,dark:`oklch(0.72 0.14 259)`},{name:`--chart-2`,light:`oklch(0.58 0.14 145)`,dark:`oklch(0.73 0.13 145)`},{name:`--chart-3`,light:`oklch(0.62 0.15 70)`,dark:`oklch(0.77 0.14 70)`},{name:`--chart-4`,light:`oklch(0.55 0.18 290)`,dark:`oklch(0.72 0.16 290)`},{name:`--chart-5`,light:`oklch(0.58 0.21 25)`,dark:`oklch(0.72 0.2 25)`},{name:`--primary`,light:`oklch(0.6321 0.1983 259.59)`,dark:`#69a3ff`},{name:`--primary-foreground`,light:`oklch(0.985 0 0)`,dark:`oklch(0.205 0 0)`},{name:`--foreground`,light:`oklch(0.145 0 0)`,dark:`oklch(0.985 0 0)`},{name:`--background`,light:`oklch(1 0 0)`,dark:`oklch(0.145 0 0)`},{name:`--card`,light:`oklch(1 0 0)`,dark:`oklch(0.205 0 0)`},{name:`--card-foreground`,light:`oklch(0.145 0 0)`,dark:`oklch(0.985 0 0)`},{name:`--muted-foreground`,light:`oklch(0.556 0 0)`,dark:`oklch(0.708 0 0)`},{name:`--border`,light:`oklch(0.922 0 0)`,dark:`oklch(1 0 0 / 10%)`},{name:`--destructive`,light:`oklch(0.577 0.245 27.325)`,dark:`oklch(0.704 0.191 22.216)`},{name:`--radius`,light:`0.625rem`,dark:`0.625rem`}],rK=`127.0.0.1`,iK=aS.extend({priority:60,addAttributes(){return{...this.parent?.(),fenceDelimiter:{default:"`"},fenceLength:{default:3},meta:{default:null},sourceStyle:{default:`fenced`},sourceClosingFenceLength:{default:null,rendered:!1},sourceFenceIndent:{default:null,rendered:!1},sourceInfoPadding:{default:null,rendered:!1},sourceIndents:{default:null,rendered:!1}}}}),aK=vS.extend({name:`emphasis`,priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`*`}}},addInputRules(){return[Ix({find:pS,type:this.type,getAttributes:{sourceDelimiter:`*`}}),Ix({find:hS,type:this.type,getAttributes:{sourceDelimiter:`_`}})]}}),oK=fS.extend({name:`strong`,priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`**`}}},addInputRules(){return[Ix({find:sS,type:this.type,getAttributes:{sourceDelimiter:`**`}}),Ix({find:lS,type:this.type,getAttributes:{sourceDelimiter:`__`}})]}}),sK=hx.create({name:`escapeMark`,priority:10,excludes:``,inclusive:!1,parseHTML(){return[{tag:`span[data-escape-mark]`}]},renderHTML(){return[`span`,{"data-escape-mark":``},0]}}),cK=$x.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`}]})}}}),lK=$x.create({name:`footnoteReference`,group:`inline`,inline:!0,atom:!0,selectable:!0,draggable:!1,priority:60,addAttributes(){return{identifier:{default:``},label:{default:null}}},parseHTML(){return[{tag:`sup[data-footnote-ref]`,getAttrs:e=>{if(typeof e==`string`)return!1;let t=e.getAttribute(`data-footnote-id`)||``;return{identifier:t,label:t||null}}}]},renderHTML({node:e}){let t=String(e.attrs.identifier??``);return[`sup`,{id:`fnref-${t}`,"data-footnote-ref":``,"data-footnote-id":t,class:`footnote-ref`},[`a`,{href:`#fn-${t}`,class:`footnote-ref-link`},`[${t}]`]]},addCommands(){return{insertFootnoteReference:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{identifier:e,label:e}})}}}),uK=/^---[ \t]*\r?\n([\s\S]*?\r?\n)?---[ \t]*(\r?\n|$)/;function dK(e){let t=e.match(uK);return t?{frontmatter:t[0],body:e.slice(t[0].length)}:{frontmatter:``,body:e}}function fK(e,t){return e?e+t:t}function pK(e){if(e===``)return``;let t=e.match(uK);return t?(t[1]??``).replace(/\r?\n$/,``):e}const mK=bS.extend({priority:60,addAttributes(){return{...this.parent?.(),hardBreakStyle:{default:`backslash`},sourceRaw:{default:null}}}}),hK=SS.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}}}}),gK=$x.create({name:`htmlBlock`,group:`block`,atom:!0,priority:60,addAttributes(){return{content:{default:``}}},parseHTML(){return[{tag:`div[data-html-block]`}]},renderHTML({node:e}){return[`div`,{"data-html-block":``,class:`html-block`},e.attrs.content]}});function _K(e){if(typeof e!=`string`||!e.startsWith(`/`))return e;let t=globalThis.window?.okDesktop?.config?.apiOrigin;return typeof t==`string`&&t?t+e:e}const vK=wS.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceUrl:{default:null,rendered:!1}}},renderHTML({HTMLAttributes:e}){let t=ob(this.options.HTMLAttributes,e);return typeof t.src==`string`&&(t.src=_K(t.src)),[`img`,t]}}),yK=$x.create({name:`jsxComponent`,group:`block`,atom:!1,content:`block*`,isolating:!0,selectable:!0,defining:!0,priority:60,addAttributes(){return{componentName:{default:``},kind:{default:`element`},attributes:{default:[]},sourceRaw:{default:``},sourceDirty:{default:!1},props:{default:{}}}},parseHTML(){return[{tag:`div[data-jsx-component]`,getAttrs:e=>typeof e==`string`?!1:{componentName:e.getAttribute(`data-component-name`)||``,sourceRaw:e.getAttribute(`data-source-raw`)||``}}]},renderHTML({HTMLAttributes:e}){return[`div`,{"data-jsx-component":``,"data-component-name":e.componentName,"data-source-raw":e.sourceRaw},0]},addCommands(){return{insertJsxComponent:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{sourceRaw:e}})}}}),bK=$x.create({name:`jsxInline`,group:`inline`,inline:!0,atom:!1,content:`text*`,isolating:!1,selectable:!0,priority:60,addAttributes(){return{}},parseHTML(){return[{tag:`span[data-jsx-inline]`}]},renderHTML(){return[`span`,{"data-jsx-inline":``},0]}}),xK=[`https`,`http`,`mailto`,`tel`,`ftp`,`sms`],SK=xK.map(e=>`${e}:`).join(`|`);RegExp(`^(?:${SK}|\\/|#|\\?|\\.\\/|\\.\\.\\/)`,`i`);function CK(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)}const wK=new Set(xK.map(e=>`${e}:`));function TK(e){try{let t=new URL(e,`https://placeholder.invalid`);return wK.has(t.protocol.toLowerCase())}catch{return!1}}const EK=IS.extend({priority:60,addOptions(){return{openOnClick:!1,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:`http`,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer`},isAllowedUri:TK,validate:TK,shouldAutoLink:()=>!0}},addAttributes(){return{...this.parent?.(),linkStyle:{default:`inline`,rendered:!1},refLabel:{default:null,rendered:!1},sourceForm:{default:null,rendered:!1},target:{default:null,rendered:!1},anchor:{default:null,rendered:!1},alias:{default:null,rendered:!1},sourceUrlForm:{default:null,rendered:!1},sourceTitleMarker:{default:null,rendered:!1}}}}),DK=$x.create({name:`linkRefDef`,group:`block`,atom:!0,priority:60,addAttributes(){return{label:{default:``},href:{default:``},title:{default:null},sourceLayout:{default:null},sourceTitleMarker:{default:null}}},parseHTML(){return[{tag:`div[data-link-ref-def]`}]},renderHTML({node:e}){let{label:t,href:n,title:r}=e.attrs,i=r?`[${t}]: ${n} "${r}"`:`[${t}]: ${n}`;return[`div`,{"data-link-ref-def":``,class:`link-ref-def`},i]}});function OK(e){return e.type.name===`list`&&!e.attrs.ordered}function kK(e){return e.type.name===`list`&&!!e.attrs.ordered}function AK(e){let t=!1;return e.forEach(e=>{e.type.name===`listItem`&&e.attrs.checked!==null&&(t=!0)}),t}function jK(e,t,n,r,i,a,o){let s=Xy(e=>e.type.name===`list`)(e.selection);if(s&&i(s.node)){let{$from:n,$to:i}=e.selection;return n.blockRange(i)?qp(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 Wp(n,a)(e,void 0)?t?Wp(n,a)(e,n=>{if(o){let t=n.mapping.map(e.selection.$from.pos),r=n.doc.resolve(t);for(let e=r.depth;e>0;e--){let t=r.node(e);if(t.type.name===`listItem`){n.setNodeMarkup(r.before(e),void 0,{...t.attrs,...o});break}}}t(n)}):!0:!1}const MK=$x.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,ob(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:jK(e,t,n,r,e=>OK(e)&&!AK(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:jK(e,t,n,r,e=>kK(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:jK(e,t,n,r,e=>OK(e)&&AK(e),{ordered:!1},{checked:!1})}}},addInputRules(){return[zx({find:/^\s*([-+*])(?!\s*\[[ xX]\])\s$/,type:this.type,getAttributes:e=>({ordered:!1,bulletMarker:e[1]}),joinPredicate:(e,t)=>t.attrs.ordered===!1}),zx({find:/^\s*(\d+)([.)])\s$/,type:this.type,getAttributes:e=>({ordered:!0,start:Number(e[1]),listMarkerDelimiter:e[2]}),joinPredicate:(e,t)=>t.attrs.ordered===!0}),new sx({find:/^\s*[-*+]\s\[([ xX])\]\s$/,handler:({state:e,range:t,match:n})=>{let r=e.schema.nodes.list;if(!r)return null;let i=n[1]!==` `,a=e.tr.delete(t.from,t.to),o=a.doc.resolve(t.from).blockRange();if(!o)return null;let s=of(o,r,{ordered:!1});if(!s)return null;a.wrap(o,s);let c=a.doc.resolve(a.mapping.map(t.from));for(let e=c.depth;e>0;e--){let t=c.node(e);if(t.type.name===`listItem`){a.setNodeMarkup(c.before(e),void 0,{...t.attrs,checked:i});break}}}})]},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList(),"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList(),"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),NK=$x.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`,ob(t),0]:[`li`,ob(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(ob(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}}}}),PK=MK,FK=NK,IK=$x.create({name:`mathInline`,group:`inline`,inline:!0,atom:!0,selectable:!0,priority:60,addAttributes(){return{formula:{default:``},id:{default:null},language:{default:`latex`},sourceDelimiter:{default:null,rendered:!1}}},parseHTML(){return[{tag:`span[data-math-inline]`,getAttrs:e=>typeof e==`string`?!1:{formula:e.getAttribute(`data-formula`)||``,id:e.getAttribute(`id`)||null,language:e.getAttribute(`data-language`)||`latex`}}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-math-inline":``,"data-formula":e.formula,"data-language":e.language,...e.id?{id:e.id}:{}}]},addCommands(){return{insertMathInline:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{formula:e}})}}}),LK=$x.create({name:`rawMdxFallback`,group:`block`,atom:!1,content:`text*`,isolating:!0,selectable:!0,defining:!0,priority:60,addAttributes(){return{reason:{default:``},originalSpan:{default:{start:0,end:0}}}},parseHTML(){let e=e=>typeof e==`string`?!1:{reason:e.getAttribute(`data-reason`)||``};return[{tag:`div[data-raw-mdx-fallback]`,getAttrs:e},{tag:`pre[data-raw-mdx-fallback]`,getAttrs:e}]},renderHTML({HTMLAttributes:e}){return[`div`,{"data-raw-mdx-fallback":``,"data-raw-badge":`raw`,"data-reason":e.reason,contenteditable:`false`,class:`raw-mdx-fallback`},0]},addNodeView(){return({HTMLAttributes:e})=>{let t=document.createElement(`div`);t.setAttribute(`data-raw-mdx-fallback`,``),t.setAttribute(`data-raw-badge`,`raw`),t.setAttribute(`contenteditable`,`false`),t.classList.add(`raw-mdx-fallback`),e.reason&&t.setAttribute(`data-reason`,e.reason);let n=document.createElement(`pre`);return n.classList.add(`raw-mdx-fallback-content`),n.setAttribute(`contenteditable`,`false`),t.appendChild(n),{dom:t,contentDOM:n,ignoreMutation:()=>!0}}}}),RK=qw.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceMarkerSpacings:{default:null}}}}),zK=Zw.extend({excludes:``,addAttributes(){return{...this.parent?.(),sourceFenceChar:{default:"`"},sourceFenceLength:{default:1},sourcePadded:{default:!1,rendered:!1}}}}),BK=$x.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`,style:`display: none;`,...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)}}}),VK=hx.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`,style:`display: none;`,...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)}}}),HK=wx.create({name:`docFidelity`,addGlobalAttributes(){return[{types:[`doc`],attributes:{sourceDocBoundary:{default:null,rendered:!1}}}]}}),UK=$x.create({name:`imageReference`,group:`inline`,inline:!0,atom:!0,priority:60,addAttributes(){return{alt:{default:``},label:{default:``},identifier:{default:``},referenceType:{default:`shortcut`}}},parseHTML(){return[{tag:`img[data-image-reference]`}]},renderHTML({node:e}){let{alt:t,label:n,referenceType:r}=e.attrs,i=t||n;return[`img`,{"data-image-reference":``,"data-reference-type":r,"data-label":n,alt:i}]}}),WK=new Map([[32,` `],[9,` `]]);function GK(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 KK(e){let t=GK(e);return t!==null&&WK.has(t)}function qK(e){let t=GK(e);return t===null?null:WK.get(t)??null}const JK=/&#(?:x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);/g;function YK(e){JK.lastIndex=0;let t=e.match(JK);if(t===null||t.join(``)!==e)return null;let n=``;for(let e of t){let t=qK(e);if(t===null)return null;n+=t}return n}const XK=hx.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 ZK(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||QK(n)===r?!0:YK(n)===r}function QK(e){return e.replace(/\\([!-/:-@[-`{-~])/g,`$1`)}const $K=LT.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`~~`,rendered:!1}}}}),eq=Ww.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceDashCounts:{default:null},sourceOuterPipes:{default:null,rendered:!1},sourceAlignmentPadding:{default:null,rendered:!1}}}}),tq=kw.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),nq=Aw.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),rq=$x.create({name:`tag`,group:`inline`,inline:!0,atom:!0,selectable:!0,priority:60,addAttributes(){return{value:{default:``}}},parseHTML(){return[{tag:`a[data-tag]`,getAttrs:e=>typeof e==`string`?!1:{value:e.getAttribute(`data-tag`)||``}}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.value??``);return[`a`,{...t,"data-tag":n,href:`#tag/${n}`,class:`tag`},`#${n}`]},addCommands(){return{insertTag:e=>({chain:t})=>t().insertContent({type:`tag`,attrs:{value:e}}).run()}}}),iq=/^(?:---|—-|___\s|\*\*\*\s)$/;function aq(e){let t=String(e[0]??``).replace(/\s+$/,``);return t===`—-`?`---`:t}const oq=eT.extend({name:`thematicBreak`,priority:60,addAttributes(){return{...this.parent?.(),sourceRaw:{default:`---`}}},addInputRules(){return[Lx({find:iq,type:this.type,getAttributes:e=>({sourceRaw:aq(e)})})]}});function sq(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function cq(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}const lq=$x.create({name:`wikiLink`,group:`inline`,inline:!0,atom:!0,priority:60,addAttributes(){return{target:{default:``},alias:{default:null},anchor:{default:null},resolved:{default:!1},sourceTarget:{default:null,rendered:!1},sourceAnchor:{default:null,rendered:!1},sourceAlias:{default:null,rendered:!1}}},parseHTML(){return[{tag:`span[data-wiki-link]`,getAttrs:e=>typeof e==`string`?!1:{target:e.getAttribute(`data-target`)||``,alias:sq(e.getAttribute(`data-alias`)),anchor:sq(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:sq(e.getAttribute(`data-alias`)),anchor:sq(e.getAttribute(`data-anchor`)),resolved:!1}:!1}}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.target??``),r=sq(e.attrs.alias),i=sq(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`},cq({target:n,alias:r,anchor:i})]}});function uq(e){let t=e.split(`/`).pop()??e,n=t.lastIndexOf(`.`);return n<=0||n===t.length-1?``:t.slice(n+1).toLowerCase()}function dq(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}const fq=[yK,LK,bK,IK,lq,$x.create({name:`wikiLinkEmbed`,group:`inline`,inline:!0,atom:!0,priority:60,addAttributes(){return{target:{default:``},alias:{default:null},anchor:{default:null},resolvedSrc:{default:null,rendered:!1,parseHTML:()=>null}}},parseHTML(){let e=e=>typeof e==`string`||!e.hasAttribute(`data-wiki-embed`)?!1:{target:e.getAttribute(`data-target`)||``,alias:sq(e.getAttribute(`data-alias`)),anchor:sq(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=sq(e.attrs.alias),i=sq(e.attrs.anchor),a=sq(e.attrs.resolvedSrc),o=uq(n);if(Vc.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`},dq({target:n,alias:r,anchor:i})]}}),rq,PK,FK,aK,oK,$K,zK,iK,RK,hK,oq,EK,gK,DK,mK,sK,HK,XK,kE.configure({undoRedo:!1,bulletList:!1,orderedList:!1,listItem:!1,listKeymap:{listTypes:[{itemName:`listItem`,wrapperNames:[`list`]}]},italic:!1,bold:!1,strike:!1,code:!1,codeBlock:!1,heading:!1,horizontalRule:!1,hardBreak:!1,link:!1,blockquote:!1,dropcursor:{color:`color-mix(in oklch, var(--primary) 50%, transparent)`,width:2}}),eq.configure({resizable:!0}),jw,nq,tq,vK.configure({inline:!0}),UK,zS,VK,BK,lK,cK];3072-pq("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`);function pq(e,t){let n=encodeURIComponent(e);return t===`cursor`?encodeURIComponent(n).length:n.length}function mq(e){return`'${e.replace(/'/g,`'\\''`)}'`}`${$G}`,[`delete`,`move`,`share_link`,`install`].map(e=>`mcp__${$G}__${e}`),`${mq(`mcp_servers.${$G}.default_tools_approval_mode="approve"`)}`;function hq(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 gq=new Set([`opencode.json`]);function _q(e){return e.split(`/`).some(e=>e.startsWith(`.`))?!0:gq.has(e.slice(e.lastIndexOf(`/`)+1))}function vq(e,t){let n=hq(e);n.ok||t.addIssue({code:`custom`,message:n.reason})}const yq=A().superRefine(vq).optional(),bq={agentId:A().optional(),agentName:A().optional(),colorSeed:A().optional(),clientName:A().optional(),clientVersion:A().optional(),label:A().optional()},xq=A().optional(),Sq=/^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,Cq=tc(`kind`,[P({kind:I(`doc`),docPath:A().min(1)}).loose(),P({kind:I(`folder`),folderPath:A()}).loose()]),wq=F([`no-remote`,`detached-head`,`branch-not-on-origin`,`non-github-remote`,`invalid-path`]),Tq=F([`current`,`stale`,`absent`]),Eq=tc(`ok`,[P({ok:I(!0),shareUrl:A().min(1),sharedUrl:A().min(1),branch:A().min(1),freshness:Tq.optional().catch(void 0)}).loose(),P({ok:I(!1),error:wq,branch:A().min(1).optional()}).loose()]),Dq=F([`user`,`org`]),Oq=P({login:A().min(1),kind:Dq,avatarUrl:A().optional()}).loose(),kq=F([`auth-required`,`network`]),Aq=tc(`ok`,[P({ok:I(!0),owners:N(Oq)}).loose(),P({ok:I(!1),error:kq}).loose()]),jq=tc(`ok`,[P({ok:I(!0),available:M()}).loose(),P({ok:I(!1),error:kq}).loose()]),Mq=F([`public`,`private`]),Nq=P({owner:A().min(1),name:A().min(1),visibility:Mq,description:A().optional()}).loose(),Pq=F([`name-conflict`,`saml-sso`,`auth-required`,`push-failed`,`init-failed`,`network`,`no-project`]),Fq=tc(`ok`,[P({ok:I(!0),ownerLogin:A().min(1),repoName:A().min(1),cloneUrl:A().min(1),defaultBranch:A().min(1)}).loose(),P({ok:I(!1),error:Pq}).loose()]);function Iq(e){return!(typeof e!=`string`||e.length===0||e.startsWith(`-`)||/[\x00-\x1F\x7F]/.test(e)||/\s/.test(e)||e.includes(`:`)||e.split(`/`).includes(`..`))}const Lq=e=>e.refine(Iq,`invalid branch name`);function Rq(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 zq=[/could not read (username|password)/i,/terminal prompts disabled/i],Bq=[/insufficient scopes/i,/missing.*scope/i,/required scope/i],Vq=[/permission denied.*\(publickey\)/i,/host key verification failed/i],Hq=[/\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,/fatal:.*repository.*not found/i];function Uq(e){if(typeof e!=`object`||!e)return``;let t=e.git;return t==null?``:String(t)}function Wq(e){if(e==null)return{kind:`non-auth`};let t=`${e instanceof Error?e.message:String(e)}\n${Uq(e)}`;return zq.some(e=>e.test(t))?{kind:`auth`,subclass:`no-credential`}:Bq.some(e=>e.test(t))?{kind:`auth`,subclass:`scope-mismatch`}:Vq.some(e=>e.test(t))?{kind:`auth`,subclass:`ssh-auth`}:Hq.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`}:{kind:`auth`,subclass:`unknown-auth`}:{kind:`non-auth`}}function Gq(e){return e.kind===`auth`?e.subclass===`no-credential`||e.subclass===`401`||e.subclass===`unknown-auth`:!1}const Kq={shareTargetExists:M(),dirtyConflicts:P({conflicts:M(),files:N(A().min(1))}).loose(),branchIsLocal:M(),shareTargetOnOriginBranch:M().optional()},qq=tc(`detached`,[P({detached:I(!1),currentBranch:A().min(1).nullable(),currentHeadSha:Hs(),...Kq}).loose(),P({detached:I(!0),currentBranch:Hs(),currentHeadSha:A().min(1),...Kq}).loose()]),Jq=P({branch:Lq(A().min(1)),principalId:A().optional(),fastForward:M().optional()}).loose(),Yq=F([`dirty-conflict`,`branch-not-found`,`fetch-failed`,`checkout-failed`,`branch-in-other-worktree`,`ff-diverged`]),Xq=tc(`ok`,[P({ok:I(!0)}).loose(),P({ok:I(!1),reason:Yq,files:N(A().min(1)).optional(),otherWorktreePath:A().min(1).optional()}).loose()]);F([`on-origin`,`renamed`,`deleted`,`never-on-branch`,`changed-locally`,`unknown`]);const Zq=P({branch:Lq(A().min(1)),path:A(),kind:F([`doc`,`folder`])}).loose(),Qq=tc(`verdict`,[P({verdict:I(`on-origin`)}).loose(),P({verdict:I(`renamed`),renamedTo:A().min(1)}).loose(),P({verdict:I(`deleted`)}).loose(),P({verdict:I(`never-on-branch`)}).loose(),P({verdict:I(`changed-locally`)}).loose(),P({verdict:I(`unknown`)}).loose()]).catch({verdict:`unknown`}),$q=P({startedAt:A().min(1),httpListenMs:j().nonnegative().optional(),seedWalkMs:j().nonnegative().optional(),indexesMs:j().nonnegative().optional(),readyMs:j().nonnegative().optional(),fileCount:j().nonnegative().optional()}),eJ=P({serverInstanceId:A().min(1),currentBranch:A().min(1).optional(),currentDiskAckSVs:ac(A().min(1),A().min(1)).optional(),boot:$q.optional()}).loose(),tJ=P({id:A().min(1),display_name:A().min(1),display_email:A(),source:F([`git-config`,`synthesized`]),created_at:A().min(1)}).loose(),nJ=P({collabUrl:A().nullable(),previewUrl:A().nullable(),port:j(),paneTarget:A().nullable(),singleFile:M().default(!1)}).loose(),rJ=F(`urn:ok:error:malformed-upload.urn:ok:error:collision-exhaustion.urn:ok:error:storage-full.urn:ok:error:storage-readonly.urn:ok:error:storage-error.urn:ok:error:no-file-received.urn:ok:error:path-escape.urn:ok:error:method-not-allowed.urn:ok:error:invalid-request.urn:ok:error:payload-too-large.urn:ok:error:request-timeout.urn:ok:error:internal-server-error.urn:ok:error:loopback-required.urn:ok:error:invalid-origin.urn:ok:error:url-not-allowed.urn:ok:error:dir-outside-home.urn:ok:error:concurrent-operation.urn:ok:error:clone-failed.urn:ok:error:clone-timeout.urn:ok:error:server-start-failed.urn:ok:error:reserved-doc-name.urn:ok:error:target-not-found.urn:ok:error:stale-target.urn:ok:error:frontmatter-edit-not-supported.urn:ok:error:invalid-frontmatter-patch.urn:ok:error:frontmatter-malformed.urn:ok:error:no-active-session.urn:ok:error:too-many-agent-sessions.urn:ok:error:disk-divergence.urn:ok:error:doc-not-found.urn:ok:error:doc-already-exists.urn:ok:error:doc-not-open.urn:ok:error:rollback-not-configured.urn:ok:error:doc-not-available.urn:ok:error:backlink-index-not-configured.urn:ok:error:file-rescan-not-configured.urn:ok:error:shadow-not-configured.urn:ok:error:host-not-allowed.urn:ok:error:principal-not-available.urn:ok:error:not-found.urn:ok:error:auth-failed.urn:ok:error:no-project-dir.urn:ok:error:server-open-failed.urn:ok:error:doc-in-conflict.urn:ok:error:no-conflict-tracked.urn:ok:error:sync-not-active.urn:ok:error:project-repo-not-configured.urn:ok:error:seed-prerequisite-missing.urn:ok:error:seed-invalid-root.urn:ok:error:tag-index-not-configured.urn:ok:error:template-not-found.urn:ok:error:unsupported-asset-type.urn:ok:error:asset-not-found.urn:ok:error:single-file-mode.urn:ok:error:collab-server-not-running.urn:ok:error:gateway-timeout.urn:ok:error:cursor-not-installed.urn:ok:error:cursor-spawn-timeout.urn:ok:error:cursor-spawn-failed.urn:ok:error:handoff-target-not-installed.urn:ok:error:handoff-spawn-timeout.urn:ok:error:handoff-spawn-failed`.split(`.`));function iJ(e){throw Error(`Unexpected ProblemType variant: ${JSON.stringify(e)}`)}const aJ=P({type:rJ,title:A().min(1),status:j().int().min(400).max(599),instance:A().regex(Sq,`instance must be urn:uuid:<uuid>`).optional(),detail:A().optional()}).loose(),oJ=P({parentDocName:A().min(1),placement:F([`configured-attachments`,`parent-dir`]).default(`configured-attachments`),agentId:A().min(1).optional(),agentName:A().min(1).optional()}).loose(),sJ=P({src:A().min(1),path:A().min(1).optional(),deduped:M().optional()}).loose(),cJ=P({url:A().min(1),dir:A().min(1),branch:A().min(1).refine(Iq,`invalid branch name`).optional()}).loose(),lJ=P({type:I(`error`),problem:aJ}).loose();function uJ(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(`
|
|
367
|
+
`)}const nK=[{name:`--chart-1`,light:`oklch(0.62 0.19 259)`,dark:`oklch(0.72 0.14 259)`},{name:`--chart-2`,light:`oklch(0.58 0.14 145)`,dark:`oklch(0.73 0.13 145)`},{name:`--chart-3`,light:`oklch(0.62 0.15 70)`,dark:`oklch(0.77 0.14 70)`},{name:`--chart-4`,light:`oklch(0.55 0.18 290)`,dark:`oklch(0.72 0.16 290)`},{name:`--chart-5`,light:`oklch(0.58 0.21 25)`,dark:`oklch(0.72 0.2 25)`},{name:`--primary`,light:`oklch(0.6321 0.1983 259.59)`,dark:`#69a3ff`},{name:`--primary-foreground`,light:`oklch(0.985 0 0)`,dark:`oklch(0.205 0 0)`},{name:`--foreground`,light:`oklch(0.145 0 0)`,dark:`oklch(0.985 0 0)`},{name:`--background`,light:`oklch(1 0 0)`,dark:`oklch(0.145 0 0)`},{name:`--card`,light:`oklch(1 0 0)`,dark:`oklch(0.205 0 0)`},{name:`--card-foreground`,light:`oklch(0.145 0 0)`,dark:`oklch(0.985 0 0)`},{name:`--muted-foreground`,light:`oklch(0.556 0 0)`,dark:`oklch(0.708 0 0)`},{name:`--border`,light:`oklch(0.922 0 0)`,dark:`oklch(1 0 0 / 10%)`},{name:`--destructive`,light:`oklch(0.577 0.245 27.325)`,dark:`oklch(0.704 0.191 22.216)`},{name:`--radius`,light:`0.625rem`,dark:`0.625rem`}],rK=`127.0.0.1`,iK=aS.extend({priority:60,addAttributes(){return{...this.parent?.(),fenceDelimiter:{default:"`"},fenceLength:{default:3},meta:{default:null},sourceStyle:{default:`fenced`},sourceClosingFenceLength:{default:null,rendered:!1},sourceFenceIndent:{default:null,rendered:!1},sourceInfoPadding:{default:null,rendered:!1},sourceIndents:{default:null,rendered:!1}}}}),aK=vS.extend({name:`emphasis`,priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`*`}}},addInputRules(){return[Ix({find:pS,type:this.type,getAttributes:{sourceDelimiter:`*`}}),Ix({find:hS,type:this.type,getAttributes:{sourceDelimiter:`_`}})]}}),oK=fS.extend({name:`strong`,priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`**`}}},addInputRules(){return[Ix({find:sS,type:this.type,getAttributes:{sourceDelimiter:`**`}}),Ix({find:lS,type:this.type,getAttributes:{sourceDelimiter:`__`}})]}}),sK=hx.create({name:`escapeMark`,priority:10,excludes:``,inclusive:!1,parseHTML(){return[{tag:`span[data-escape-mark]`}]},renderHTML(){return[`span`,{"data-escape-mark":``},0]}}),cK=$x.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`}]})}}}),lK=$x.create({name:`footnoteReference`,group:`inline`,inline:!0,atom:!0,selectable:!0,draggable:!1,priority:60,addAttributes(){return{identifier:{default:``},label:{default:null}}},parseHTML(){return[{tag:`sup[data-footnote-ref]`,getAttrs:e=>{if(typeof e==`string`)return!1;let t=e.getAttribute(`data-footnote-id`)||``;return{identifier:t,label:t||null}}}]},renderHTML({node:e}){let t=String(e.attrs.identifier??``);return[`sup`,{id:`fnref-${t}`,"data-footnote-ref":``,"data-footnote-id":t,class:`footnote-ref`},[`a`,{href:`#fn-${t}`,class:`footnote-ref-link`},`[${t}]`]]},addCommands(){return{insertFootnoteReference:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{identifier:e,label:e}})}}}),uK=/^---[ \t]*\r?\n([\s\S]*?\r?\n)?---[ \t]*(\r?\n|$)/;function dK(e){let t=e.match(uK);return t?{frontmatter:t[0],body:e.slice(t[0].length)}:{frontmatter:``,body:e}}function fK(e,t){return e?e+t:t}function pK(e){if(e===``)return``;let t=e.match(uK);return t?(t[1]??``).replace(/\r?\n$/,``):e}const mK=bS.extend({priority:60,addAttributes(){return{...this.parent?.(),hardBreakStyle:{default:`backslash`},sourceRaw:{default:null}}}}),hK=SS.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}}}}),gK=$x.create({name:`htmlBlock`,group:`block`,atom:!0,priority:60,addAttributes(){return{content:{default:``}}},parseHTML(){return[{tag:`div[data-html-block]`}]},renderHTML({node:e}){return[`div`,{"data-html-block":``,class:`html-block`},e.attrs.content]}});function _K(e){if(typeof e!=`string`||!e.startsWith(`/`))return e;let t=globalThis.window?.okDesktop?.config?.apiOrigin;return typeof t==`string`&&t?t+e:e}const vK=wS.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceUrl:{default:null,rendered:!1}}},renderHTML({HTMLAttributes:e}){let t=ob(this.options.HTMLAttributes,e);return typeof t.src==`string`&&(t.src=_K(t.src)),[`img`,t]}}),yK=$x.create({name:`jsxComponent`,group:`block`,atom:!1,content:`block*`,isolating:!0,selectable:!0,defining:!0,priority:60,addAttributes(){return{componentName:{default:``},kind:{default:`element`},attributes:{default:[]},sourceRaw:{default:``},sourceDirty:{default:!1},props:{default:{}}}},parseHTML(){return[{tag:`div[data-jsx-component]`,getAttrs:e=>typeof e==`string`?!1:{componentName:e.getAttribute(`data-component-name`)||``,sourceRaw:e.getAttribute(`data-source-raw`)||``}}]},renderHTML({HTMLAttributes:e}){return[`div`,{"data-jsx-component":``,"data-component-name":e.componentName,"data-source-raw":e.sourceRaw},0]},addCommands(){return{insertJsxComponent:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{sourceRaw:e}})}}}),bK=$x.create({name:`jsxInline`,group:`inline`,inline:!0,atom:!1,content:`text*`,isolating:!1,selectable:!0,priority:60,addAttributes(){return{}},parseHTML(){return[{tag:`span[data-jsx-inline]`}]},renderHTML(){return[`span`,{"data-jsx-inline":``},0]}}),xK=[`https`,`http`,`mailto`,`tel`,`ftp`,`sms`],SK=xK.map(e=>`${e}:`).join(`|`);RegExp(`^(?:${SK}|\\/|#|\\?|\\.\\/|\\.\\.\\/)`,`i`);function CK(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)}const wK=new Set(xK.map(e=>`${e}:`));function TK(e){try{let t=new URL(e,`https://placeholder.invalid`);return wK.has(t.protocol.toLowerCase())}catch{return!1}}const EK=IS.extend({priority:60,addOptions(){return{openOnClick:!1,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:`http`,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer`},isAllowedUri:TK,validate:TK,shouldAutoLink:()=>!0}},addAttributes(){return{...this.parent?.(),linkStyle:{default:`inline`,rendered:!1},refLabel:{default:null,rendered:!1},sourceForm:{default:null,rendered:!1},target:{default:null,rendered:!1},anchor:{default:null,rendered:!1},alias:{default:null,rendered:!1},sourceUrlForm:{default:null,rendered:!1},sourceTitleMarker:{default:null,rendered:!1}}}}),DK=$x.create({name:`linkRefDef`,group:`block`,atom:!0,priority:60,addAttributes(){return{label:{default:``},href:{default:``},title:{default:null},sourceLayout:{default:null},sourceTitleMarker:{default:null}}},parseHTML(){return[{tag:`div[data-link-ref-def]`}]},renderHTML({node:e}){let{label:t,href:n,title:r}=e.attrs,i=r?`[${t}]: ${n} "${r}"`:`[${t}]: ${n}`;return[`div`,{"data-link-ref-def":``,class:`link-ref-def`},i]}});function OK(e){return e.type.name===`list`&&!e.attrs.ordered}function kK(e){return e.type.name===`list`&&!!e.attrs.ordered}function AK(e){let t=!1;return e.forEach(e=>{e.type.name===`listItem`&&e.attrs.checked!==null&&(t=!0)}),t}function jK(e,t,n,r,i,a,o){let s=Xy(e=>e.type.name===`list`)(e.selection);if(s&&i(s.node)){let{$from:n,$to:i}=e.selection;return n.blockRange(i)?qp(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 Wp(n,a)(e,void 0)?t?Wp(n,a)(e,n=>{if(o){let t=n.mapping.map(e.selection.$from.pos),r=n.doc.resolve(t);for(let e=r.depth;e>0;e--){let t=r.node(e);if(t.type.name===`listItem`){n.setNodeMarkup(r.before(e),void 0,{...t.attrs,...o});break}}}t(n)}):!0:!1}const MK=$x.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,ob(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:jK(e,t,n,r,e=>OK(e)&&!AK(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:jK(e,t,n,r,e=>kK(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:jK(e,t,n,r,e=>OK(e)&&AK(e),{ordered:!1},{checked:!1})}}},addInputRules(){return[zx({find:/^\s*([-+*])(?!\s*\[[ xX]\])\s$/,type:this.type,getAttributes:e=>({ordered:!1,bulletMarker:e[1]}),joinPredicate:(e,t)=>t.attrs.ordered===!1}),zx({find:/^\s*(\d+)([.)])\s$/,type:this.type,getAttributes:e=>({ordered:!0,start:Number(e[1]),listMarkerDelimiter:e[2]}),joinPredicate:(e,t)=>t.attrs.ordered===!0}),new sx({find:/^\s*[-*+]\s\[([ xX])\]\s$/,handler:({state:e,range:t,match:n})=>{let r=e.schema.nodes.list;if(!r)return null;let i=n[1]!==` `,a=e.tr.delete(t.from,t.to),o=a.doc.resolve(t.from).blockRange();if(!o)return null;let s=of(o,r,{ordered:!1});if(!s)return null;a.wrap(o,s);let c=a.doc.resolve(a.mapping.map(t.from));for(let e=c.depth;e>0;e--){let t=c.node(e);if(t.type.name===`listItem`){a.setNodeMarkup(c.before(e),void 0,{...t.attrs,checked:i});break}}}})]},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList(),"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList(),"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),NK=$x.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`,ob(t),0]:[`li`,ob(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(ob(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}}}}),PK=MK,FK=NK,IK=$x.create({name:`mathInline`,group:`inline`,inline:!0,atom:!0,selectable:!0,priority:60,addAttributes(){return{formula:{default:``},id:{default:null},language:{default:`latex`},sourceDelimiter:{default:null,rendered:!1}}},parseHTML(){return[{tag:`span[data-math-inline]`,getAttrs:e=>typeof e==`string`?!1:{formula:e.getAttribute(`data-formula`)||``,id:e.getAttribute(`id`)||null,language:e.getAttribute(`data-language`)||`latex`}}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-math-inline":``,"data-formula":e.formula,"data-language":e.language,...e.id?{id:e.id}:{}}]},addCommands(){return{insertMathInline:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{formula:e}})}}}),LK=$x.create({name:`rawMdxFallback`,group:`block`,atom:!1,content:`text*`,isolating:!0,selectable:!0,defining:!0,priority:60,addAttributes(){return{reason:{default:``},originalSpan:{default:{start:0,end:0}}}},parseHTML(){let e=e=>typeof e==`string`?!1:{reason:e.getAttribute(`data-reason`)||``};return[{tag:`div[data-raw-mdx-fallback]`,getAttrs:e},{tag:`pre[data-raw-mdx-fallback]`,getAttrs:e}]},renderHTML({HTMLAttributes:e}){return[`div`,{"data-raw-mdx-fallback":``,"data-raw-badge":`raw`,"data-reason":e.reason,contenteditable:`false`,class:`raw-mdx-fallback`},0]},addNodeView(){return({HTMLAttributes:e})=>{let t=document.createElement(`div`);t.setAttribute(`data-raw-mdx-fallback`,``),t.setAttribute(`data-raw-badge`,`raw`),t.setAttribute(`contenteditable`,`false`),t.classList.add(`raw-mdx-fallback`),e.reason&&t.setAttribute(`data-reason`,e.reason);let n=document.createElement(`pre`);return n.classList.add(`raw-mdx-fallback-content`),n.setAttribute(`contenteditable`,`false`),t.appendChild(n),{dom:t,contentDOM:n,ignoreMutation:()=>!0}}}}),RK=qw.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceMarkerSpacings:{default:null}}}}),zK=Zw.extend({excludes:``,addAttributes(){return{...this.parent?.(),sourceFenceChar:{default:"`"},sourceFenceLength:{default:1},sourcePadded:{default:!1,rendered:!1}}}}),BK=$x.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`,style:`display: none;`,...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)}}}),VK=hx.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`,style:`display: none;`,...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)}}}),HK=wx.create({name:`docFidelity`,addGlobalAttributes(){return[{types:[`doc`],attributes:{sourceDocBoundary:{default:null,rendered:!1}}}]}}),UK=$x.create({name:`imageReference`,group:`inline`,inline:!0,atom:!0,priority:60,addAttributes(){return{alt:{default:``},label:{default:``},identifier:{default:``},referenceType:{default:`shortcut`}}},parseHTML(){return[{tag:`img[data-image-reference]`}]},renderHTML({node:e}){let{alt:t,label:n,referenceType:r}=e.attrs,i=t||n;return[`img`,{"data-image-reference":``,"data-reference-type":r,"data-label":n,alt:i}]}}),WK=new Map([[32,` `],[9,` `]]);function GK(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 KK(e){let t=GK(e);return t!==null&&WK.has(t)}function qK(e){let t=GK(e);return t===null?null:WK.get(t)??null}const JK=/&#(?:x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);/g;function YK(e){JK.lastIndex=0;let t=e.match(JK);if(t===null||t.join(``)!==e)return null;let n=``;for(let e of t){let t=qK(e);if(t===null)return null;n+=t}return n}const XK=hx.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 ZK(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||QK(n)===r?!0:YK(n)===r}function QK(e){return e.replace(/\\([!-/:-@[-`{-~])/g,`$1`)}const $K=LT.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`~~`,rendered:!1}}}}),eq=Ww.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceDashCounts:{default:null},sourceOuterPipes:{default:null,rendered:!1},sourceAlignmentPadding:{default:null,rendered:!1}}}}),tq=kw.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),nq=Aw.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),rq=$x.create({name:`tag`,group:`inline`,inline:!0,atom:!0,selectable:!0,priority:60,addAttributes(){return{value:{default:``}}},parseHTML(){return[{tag:`a[data-tag]`,getAttrs:e=>typeof e==`string`?!1:{value:e.getAttribute(`data-tag`)||``}}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.value??``);return[`a`,{...t,"data-tag":n,href:`#tag/${n}`,class:`tag`},`#${n}`]},addCommands(){return{insertTag:e=>({chain:t})=>t().insertContent({type:`tag`,attrs:{value:e}}).run()}}}),iq=/^(?:---|—-|___\s|\*\*\*\s)$/;function aq(e){let t=String(e[0]??``).replace(/\s+$/,``);return t===`—-`?`---`:t}const oq=eT.extend({name:`thematicBreak`,priority:60,addAttributes(){return{...this.parent?.(),sourceRaw:{default:`---`}}},addInputRules(){return[Lx({find:iq,type:this.type,getAttributes:e=>({sourceRaw:aq(e)})})]}});function sq(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function cq(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}const lq=$x.create({name:`wikiLink`,group:`inline`,inline:!0,atom:!0,priority:60,addAttributes(){return{target:{default:``},alias:{default:null},anchor:{default:null},resolved:{default:!1},sourceTarget:{default:null,rendered:!1},sourceAnchor:{default:null,rendered:!1},sourceAlias:{default:null,rendered:!1}}},parseHTML(){return[{tag:`span[data-wiki-link]`,getAttrs:e=>typeof e==`string`?!1:{target:e.getAttribute(`data-target`)||``,alias:sq(e.getAttribute(`data-alias`)),anchor:sq(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:sq(e.getAttribute(`data-alias`)),anchor:sq(e.getAttribute(`data-anchor`)),resolved:!1}:!1}}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.target??``),r=sq(e.attrs.alias),i=sq(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`},cq({target:n,alias:r,anchor:i})]}});function uq(e){let t=e.split(`/`).pop()??e,n=t.lastIndexOf(`.`);return n<=0||n===t.length-1?``:t.slice(n+1).toLowerCase()}function dq(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}const fq=[yK,LK,bK,IK,lq,$x.create({name:`wikiLinkEmbed`,group:`inline`,inline:!0,atom:!0,priority:60,addAttributes(){return{target:{default:``},alias:{default:null},anchor:{default:null},resolvedSrc:{default:null,rendered:!1,parseHTML:()=>null}}},parseHTML(){let e=e=>typeof e==`string`||!e.hasAttribute(`data-wiki-embed`)?!1:{target:e.getAttribute(`data-target`)||``,alias:sq(e.getAttribute(`data-alias`)),anchor:sq(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=sq(e.attrs.alias),i=sq(e.attrs.anchor),a=sq(e.attrs.resolvedSrc),o=uq(n);if(Vc.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`},dq({target:n,alias:r,anchor:i})]}}),rq,PK,FK,aK,oK,$K,zK,iK,RK,hK,oq,EK,gK,DK,mK,sK,HK,XK,kE.configure({undoRedo:!1,bulletList:!1,orderedList:!1,listItem:!1,listKeymap:{listTypes:[{itemName:`listItem`,wrapperNames:[`list`]}]},italic:!1,bold:!1,strike:!1,code:!1,codeBlock:!1,heading:!1,horizontalRule:!1,hardBreak:!1,link:!1,blockquote:!1,dropcursor:{color:`color-mix(in oklch, var(--primary) 50%, transparent)`,width:2}}),eq.configure({resizable:!0}),jw,nq,tq,vK.configure({inline:!0}),UK,zS,VK,BK,lK,cK];3072-pq("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`);function pq(e,t){let n=encodeURIComponent(e);return t===`cursor`?encodeURIComponent(n).length:n.length}function mq(e){return`'${e.replace(/'/g,`'\\''`)}'`}`${$G}`,[`delete`,`move`,`share_link`,`install`].map(e=>`mcp__${$G}__${e}`),`${mq(`mcp_servers.${$G}.default_tools_approval_mode="approve"`)}`;function hq(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 gq=new Set([`opencode.json`]);function _q(e){return e.split(`/`).some(e=>e.startsWith(`.`))?!0:gq.has(e.slice(e.lastIndexOf(`/`)+1))}function vq(e,t){let n=hq(e);n.ok||t.addIssue({code:`custom`,message:n.reason})}const yq=A().superRefine(vq).optional(),bq={agentId:A().optional(),agentName:A().optional(),colorSeed:A().optional(),clientName:A().optional(),clientVersion:A().optional(),label:A().optional()},xq=A().optional(),Sq=/^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,Cq=tc(`kind`,[P({kind:I(`doc`),docPath:A().min(1)}).loose(),P({kind:I(`folder`),folderPath:A()}).loose()]),wq=F([`no-remote`,`detached-head`,`branch-not-on-origin`,`non-github-remote`,`invalid-path`]),Tq=F([`current`,`stale`,`absent`]),Eq=tc(`ok`,[P({ok:I(!0),shareUrl:A().min(1),sharedUrl:A().min(1),branch:A().min(1),freshness:Tq.optional().catch(void 0)}).loose(),P({ok:I(!1),error:wq,branch:A().min(1).optional()}).loose()]),Dq=F([`user`,`org`]),Oq=P({login:A().min(1),kind:Dq,avatarUrl:A().optional()}).loose(),kq=F([`auth-required`,`network`]),Aq=tc(`ok`,[P({ok:I(!0),owners:N(Oq)}).loose(),P({ok:I(!1),error:kq}).loose()]),jq=tc(`ok`,[P({ok:I(!0),available:M()}).loose(),P({ok:I(!1),error:kq}).loose()]),Mq=F([`public`,`private`]),Nq=P({owner:A().min(1),name:A().min(1),visibility:Mq,description:A().optional()}).loose(),Pq=F([`name-conflict`,`saml-sso`,`auth-required`,`push-failed`,`init-failed`,`network`,`no-project`]),Fq=tc(`ok`,[P({ok:I(!0),ownerLogin:A().min(1),repoName:A().min(1),cloneUrl:A().min(1),defaultBranch:A().min(1)}).loose(),P({ok:I(!1),error:Pq}).loose()]);function Iq(e){return!(typeof e!=`string`||e.length===0||e.startsWith(`-`)||/[\x00-\x1F\x7F]/.test(e)||/\s/.test(e)||e.includes(`:`)||e.split(`/`).includes(`..`))}const Lq=e=>e.refine(Iq,`invalid branch name`);function Rq(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 zq=[/could not read (username|password)/i,/terminal prompts disabled/i],Bq=[/insufficient scopes/i,/missing.*scope/i,/required scope/i],Vq=[/permission denied.*\(publickey\)/i,/host key verification failed/i],Hq=[/\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,/fatal:.*repository.*not found/i];function Uq(e){if(typeof e!=`object`||!e)return``;let t=e.git;return t==null?``:String(t)}function Wq(e){if(e==null)return{kind:`non-auth`};let t=`${e instanceof Error?e.message:String(e)}\n${Uq(e)}`;return zq.some(e=>e.test(t))?{kind:`auth`,subclass:`no-credential`}:Bq.some(e=>e.test(t))?{kind:`auth`,subclass:`scope-mismatch`}:Vq.some(e=>e.test(t))?{kind:`auth`,subclass:`ssh-auth`}:Hq.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`}:{kind:`auth`,subclass:`unknown-auth`}:{kind:`non-auth`}}function Gq(e){return e.kind===`auth`?e.subclass===`no-credential`||e.subclass===`401`||e.subclass===`unknown-auth`:!1}const Kq={shareTargetExists:M(),dirtyConflicts:P({conflicts:M(),files:N(A().min(1))}).loose(),branchIsLocal:M(),shareTargetOnOriginBranch:M().optional()},qq=tc(`detached`,[P({detached:I(!1),currentBranch:A().min(1).nullable(),currentHeadSha:Hs(),...Kq}).loose(),P({detached:I(!0),currentBranch:Hs(),currentHeadSha:A().min(1),...Kq}).loose()]),Jq=P({branch:Lq(A().min(1)),principalId:A().optional(),fastForward:M().optional()}).loose(),Yq=F([`dirty-conflict`,`branch-not-found`,`fetch-failed`,`checkout-failed`,`branch-in-other-worktree`,`ff-diverged`]),Xq=tc(`ok`,[P({ok:I(!0)}).loose(),P({ok:I(!1),reason:Yq,files:N(A().min(1)).optional(),otherWorktreePath:A().min(1).optional()}).loose()]);F([`on-origin`,`renamed`,`deleted`,`never-on-branch`,`changed-locally`,`unknown`]);const Zq=P({branch:Lq(A().min(1)),path:A(),kind:F([`doc`,`folder`])}).loose(),Qq=tc(`verdict`,[P({verdict:I(`on-origin`)}).loose(),P({verdict:I(`renamed`),renamedTo:A().min(1)}).loose(),P({verdict:I(`deleted`)}).loose(),P({verdict:I(`never-on-branch`)}).loose(),P({verdict:I(`changed-locally`)}).loose(),P({verdict:I(`unknown`)}).loose()]).catch({verdict:`unknown`}),$q=P({startedAt:A().min(1),httpListenMs:j().nonnegative().optional(),seedWalkMs:j().nonnegative().optional(),indexesMs:j().nonnegative().optional(),readyMs:j().nonnegative().optional(),fileCount:j().nonnegative().optional()}),eJ=P({serverInstanceId:A().min(1),currentBranch:A().min(1).optional(),currentDiskAckSVs:ac(A().min(1),A().min(1)).optional(),boot:$q.optional()}).loose(),tJ=P({id:A().min(1),display_name:A().min(1),display_email:A(),source:F([`git-config`,`synthesized`]),created_at:A().min(1)}).loose(),nJ=P({collabUrl:A().nullable(),previewUrl:A().nullable(),port:j(),singleFile:M().default(!1)}).loose(),rJ=F(`urn:ok:error:malformed-upload.urn:ok:error:collision-exhaustion.urn:ok:error:storage-full.urn:ok:error:storage-readonly.urn:ok:error:storage-error.urn:ok:error:no-file-received.urn:ok:error:path-escape.urn:ok:error:method-not-allowed.urn:ok:error:invalid-request.urn:ok:error:payload-too-large.urn:ok:error:request-timeout.urn:ok:error:internal-server-error.urn:ok:error:loopback-required.urn:ok:error:invalid-origin.urn:ok:error:url-not-allowed.urn:ok:error:dir-outside-home.urn:ok:error:concurrent-operation.urn:ok:error:clone-failed.urn:ok:error:clone-timeout.urn:ok:error:server-start-failed.urn:ok:error:reserved-doc-name.urn:ok:error:target-not-found.urn:ok:error:stale-target.urn:ok:error:frontmatter-edit-not-supported.urn:ok:error:invalid-frontmatter-patch.urn:ok:error:frontmatter-malformed.urn:ok:error:no-active-session.urn:ok:error:too-many-agent-sessions.urn:ok:error:disk-divergence.urn:ok:error:doc-not-found.urn:ok:error:doc-already-exists.urn:ok:error:doc-not-open.urn:ok:error:rollback-not-configured.urn:ok:error:doc-not-available.urn:ok:error:backlink-index-not-configured.urn:ok:error:file-rescan-not-configured.urn:ok:error:shadow-not-configured.urn:ok:error:host-not-allowed.urn:ok:error:principal-not-available.urn:ok:error:not-found.urn:ok:error:auth-failed.urn:ok:error:no-project-dir.urn:ok:error:server-open-failed.urn:ok:error:doc-in-conflict.urn:ok:error:no-conflict-tracked.urn:ok:error:sync-not-active.urn:ok:error:project-repo-not-configured.urn:ok:error:seed-prerequisite-missing.urn:ok:error:seed-invalid-root.urn:ok:error:tag-index-not-configured.urn:ok:error:template-not-found.urn:ok:error:unsupported-asset-type.urn:ok:error:asset-not-found.urn:ok:error:single-file-mode.urn:ok:error:collab-server-not-running.urn:ok:error:gateway-timeout.urn:ok:error:cursor-not-installed.urn:ok:error:cursor-spawn-timeout.urn:ok:error:cursor-spawn-failed.urn:ok:error:handoff-target-not-installed.urn:ok:error:handoff-spawn-timeout.urn:ok:error:handoff-spawn-failed`.split(`.`));function iJ(e){throw Error(`Unexpected ProblemType variant: ${JSON.stringify(e)}`)}const aJ=P({type:rJ,title:A().min(1),status:j().int().min(400).max(599),instance:A().regex(Sq,`instance must be urn:uuid:<uuid>`).optional(),detail:A().optional()}).loose(),oJ=P({parentDocName:A().min(1),placement:F([`configured-attachments`,`parent-dir`]).default(`configured-attachments`),agentId:A().min(1).optional(),agentName:A().min(1).optional()}).loose(),sJ=P({src:A().min(1),path:A().min(1).optional(),deduped:M().optional()}).loose(),cJ=P({url:A().min(1),dir:A().min(1),branch:A().min(1).refine(Iq,`invalid branch name`).optional()}).loose(),lJ=P({type:I(`error`),problem:aJ}).loose();function uJ(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(`
|
|
368
368
|
`).forEach((e,t)=>{t>0&&r(),e.length>0&&i({type:`text`,value:e})})},o=e=>{let t=e.ordered===!0,n=typeof e.start==`number`?e.start:1,a=e.data,o=typeof a?.bulletMarker==`string`?a.bulletMarker:`-`,c=typeof a?.listMarkerDelimiter==`string`?a.listMarkerDelimiter:`.`;e.children.forEach((e,a)=>{a>0&&r(),i({type:`text`,value:t?`${n+a}${c} `:`${o} `}),e.children.forEach((e,t)=>{t>0&&r(),s(e)})})},s=e=>{switch(e.type){case`paragraph`:case`heading`:e.children.forEach(i);return;case`list`:o(e);return;case`code`:case`html`:a(e.value);return;case`thematicBreak`:i({type:`text`,value:e.data?.sourceRaw??`---`});return;default:{let t=e;if(Array.isArray(t.children)&&t.children.length>0){t.children.forEach((e,t)=>{t>0&&r(),s(e)});return}let n=e;if(typeof n.value==`string`){a(n.value);return}console.warn(JSON.stringify({event:`table-cell-flatten-dropped-block`,nodeType:e.type}))}}};return e.forEach((e,t)=>{t>0&&r(),s(e)}),t}function dJ(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 fJ=new Set([`sourceRaw`,`sourceDirty`,`position`]),pJ=new Set([`jsxComponent`,`table`,`tableRow`,`tableCell`,`tableHeader`,`list`,`listItem`,`blockquote`,`codeBlock`,`heading`]),mJ={type:`__br__`},hJ=/^<br\s*\/?>$/i;function gJ(e){let t=xJ(e,gJ);return(t.type===`tableCell`||t.type===`tableHeader`)&&t.content?{...t,content:_J(t.content)}:t}function _J(e){let t=[];for(let n of e){let e=vJ(n);e.length!==0&&(t.length>0&&t.push(mJ),t.push(...e))}return t}function vJ(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)?_J(e.content):e.content}function yJ(e){return e.type===`hardBreak`||e.type===mJ.type||e.text!==void 0&&hJ.test(e.text.trim())?mJ:xJ(e,yJ)}const bJ=[{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:gJ},{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:yJ}];function xJ(e,t){return e.content?{...e,content:e.content.map(t)}:e}function SJ(e,t){let n={};e.type!==void 0&&(n.type=e.type),e.text!==void 0&&(n.text=e.text);let r=CJ(e.attrs,t);return r&&(n.attrs=r),e.marks&&e.marks.length>0&&(n.marks=[...e.marks].map(e=>({type:e.type,attrs:CJ(e.attrs,t)})).sort((e,t)=>TJ(e).localeCompare(TJ(t)))),e.content&&e.content.length>0&&(n.content=e.content.map(e=>SJ(e,t))),n}function CJ(e,t){if(!e)return null;let n={};for(let r of Object.keys(e).sort()){if(fJ.has(r)||t?.(r))continue;let i=e[r];i!=null&&(n[r]=t?wJ(i,t):i)}return Object.keys(n).length>0?n:null}function wJ(e,t){if(Array.isArray(e))return e.map(e=>wJ(e,t));if(e&&typeof e==`object`){let n={};for(let[r,i]of Object.entries(e))t(r)||(n[r]=wJ(i,t));return n}return e}function TJ(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 EJ(e){let t=``,n=e=>{if(e.text!==void 0&&(t+=e.text),e.content)for(let t of e.content)n(t)};return n(e),t.replace(/\s+/g,``)}function DJ(e){let t=[],n=e=>{if(e.type&&pJ.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 OJ(e){let t=e,n=[];for(let e of bJ){let r=TJ(t),i=e.canonicalize(t);TJ(i)!==r&&n.push(e.label),t=i}return{normalized:t,fired:n}}function kJ(e,t,n={}){let r=OJ(e),i=OJ(t),a=[...new Set([...r.fired,...i.fired])];if(!dJ(EJ(r.normalized),EJ(i.normalized)))return{equivalent:!1,level:`L1`,reason:`content-loss`,appliedDegrades:a,detail:`authored text did not survive the round-trip`};let o=DJ(r.normalized),s=DJ(i.normalized);if(TJ(o)!==TJ(s))return{equivalent:!1,level:`L1`,reason:`structural-shatter`,appliedDegrades:a,detail:`container multiset diverged: [${o.join(`, `)}] vs [${s.join(`, `)}]`};let c=SJ(r.normalized,n.ignoreAttrs),l=SJ(i.normalized,n.ignoreAttrs);return TJ(c)===TJ(l)?{equivalent:!0,level:a.length>0?`L2`:`L1`,appliedDegrades:a}:{equivalent:!1,level:`L2`,reason:`structural-divergence`,appliedDegrades:a,detail:AJ(c,l)}}function AJ(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(TJ(a[e])!==TJ(o[e]))return AJ(a[e],o[e],`${n}>${String(r.type)}[${e}]`);return`${n}(${String(r.type)}): attrs or marks differ`}function jJ(e,t,n){return!kJ(e,t,{ignoreAttrs:n}).equivalent}const MJ=new Set([`src`,`href`,`size`]),NJ=new Set([`WikiEmbedImage`,`WikiEmbedVideo`,`WikiEmbedAudio`,`WikiEmbedFile`]);function PJ(e){if(Array.isArray(e))return e.map(e=>PJ(e));if(e&&typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))MJ.has(n)||(t[n]=PJ(r));return t}return e}function FJ(e){return e.type===`jsxComponent`&&typeof e.attrs?.componentName==`string`&&NJ.has(e.attrs.componentName)?PJ(e):e.content?{...e,content:e.content.map(FJ)}:e}function IJ(e){if(Array.isArray(e))return e.map(e=>IJ(e));if(e&&typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))n!==`position`&&(t[n]=IJ(r));return t}return e}function LJ(e){if(e.type===`jsxComponent`)return e;if(e.content)for(let t of e.content){let e=LJ(t);if(e)return e}}function RJ(e){let t=e.cacheLimit??2048,n=new Map,r=r=>{let i=n.get(r);if(i!==void 0)return i;let a=LJ(e.parse(r)),o=a?FJ(IJ(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?jJ(n,FJ(IJ(e))):!1}}}function zJ(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`&&BJ(e.value.value,t))continue}let o=VJ(e,t);r>=0?n[r]=o:n.push(o)}return n}function BJ(e,t){try{return JSON.stringify(JSON.parse(e))===JSON.stringify(t)}catch{return!1}}function VJ(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 HJ(e,t,n,r){return{type:`mdxJsxFlowElement`,name:e,attributes:zJ(t,r),children:n.all(t),data:{}}}const UJ=/^[A-Za-z0-9]{20,}$/,WJ=/^(?:\d+s?|(?:\d+h)?(?:\d+m)?(?:\d+s)?)$/;function GJ(e){let t=e.toLowerCase();return t===`loom.com`||t===`www.loom.com`}function KJ(e){let t=e.pathname.match(/^\/(?:share|embed)\/([A-Za-z0-9]+)\/?$/);if(!t)return null;let n=t[1]??``;return UJ.test(n)?n:null}function qJ(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:`||!GJ(t.hostname))return null;let n=KJ(t);if(!n)return null;let r=t.searchParams.get(`t`);return{id:n,startRaw:r&&r.length>0&&WJ.test(r)?r:null}}function JJ(e){return qJ(e)!==null}function YJ(e){let t=e.toLowerCase();return t===`vimeo.com`||t===`www.vimeo.com`||t===`player.vimeo.com`}function XJ(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:YJ(t.hostname)}const ZJ=/^[A-Za-z0-9_-]{11}$/;function QJ(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 $J(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 eY(e){if(e.hostname.toLowerCase()===`youtu.be`){let t=e.pathname.replace(/^\//,``).split(`/`)[0]??``;return ZJ.test(t)?t:null}if(e.pathname===`/watch`){let t=e.searchParams.get(`v`)??``;return ZJ.test(t)?t:null}let t=e.pathname.match(/^\/(?:embed|shorts|v)\/([A-Za-z0-9_-]{11})\/?$/);return t?t[1]??null:null}function tY(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:`||!QJ(t.hostname))return null;let n=eY(t);if(!n)return null;let r=t.searchParams.get(`t`)??t.searchParams.get(`start`)??``;return{id:n,startSeconds:r.length>0?$J(r):null,noCookie:t.hostname.toLowerCase().endsWith(`youtube-nocookie.com`)}}const nY=[{name:`type`,type:`enum`,enumValues:[`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`],defaultValue:`note`,required:!1,description:`Callout variant`},{name:`title`,type:`string`,required:!1,description:`Optional heading shown above the body`},{name:`icon`,type:`string`,required:!1,advanced:!0,description:"Custom lucide icon override (e.g. `lucide:Lightbulb`)",iconPicker:!0},{name:`color`,type:`string`,required:!1,advanced:!0,description:"Optional accent color override (hex — e.g. `#F05032`)",colorPicker:!0},{name:`collapsible`,type:`boolean`,required:!1,defaultValue:!1,advanced:!0,description:"Render as a foldable `<details>` (Obsidian `[!TYPE]+/-`)"},{name:`defaultOpen`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,description:`When collapsible, start in the open state`,hideWhen:e=>e.collapsible!==!0},{name:`children`,type:`reactnode`,required:!0,description:`Callout content`}],rY=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Image source URL`,accept:Lc,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}],iY=[{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}],aY=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Video source URL`,accept:Rc,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`&&(XJ(e.src)||JJ(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:Lc,hideWhen:e=>typeof e.src==`string`&&(XJ(e.src)||JJ(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`&&JJ(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`&&(XJ(e.src)||JJ(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`&&(tY(e.src)!==null||XJ(e.src)||JJ(e.src))},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],oY=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Audio source URL`,accept:zc,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`}],sY=[{name:`title`,type:`string`,required:!0,description:`Accordion heading shown inside the <summary>`},{name:`defaultOpen`,type:`boolean`,required:!1,defaultValue:!1,description:`When true, the accordion renders expanded on initial load`},{name:`icon`,type:`string`,required:!1,advanced:!0,description:"Custom lucide icon override (e.g. `lucide:Rocket`)",iconPicker:!0},{name:`description`,type:`string`,required:!1,advanced:!0,description:`Optional subtitle rendered below the title inside <summary>`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#advanced-options`)"},{name:`name`,type:`string`,required:!1,advanced:!0,description:`HTML5 <details name=> group — siblings with the same name are mutually exclusive`}],cY=[nY[0],nY[1],nY[4],nY[5],nY[6]],lY=[rY[0],rY[1],rY[7]],uY=[sY[0],sY[1],sY[4],sY[5]],dY=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Alt text (Obsidian alias syntax: `![[file.png|alt text]]`)"}],fY=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Title text (Obsidian alias syntax: `![[clip.mp4|title]]`)"}],pY=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Title text (Obsidian alias syntax: `![[song.mp3|title]]`)"}],mY=[{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#install-tabs`)"}],hY=[{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`)"}],gY=[{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."}],_Y=[gY[0]],vY=[gY[0]],yY=[{name:`chart`,type:`string`,required:!0,hidden:!0,description:`Mermaid chart source (graph / flowchart / sequenceDiagram / class / state / etc.)`}],bY=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Display name override (Obsidian alias syntax: `![[file.zip|label]]`)"}],xY=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`File URL`,accept:[`*/*`],autoFocus:!0}],SY=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`PDF source URL`,accept:Bc,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`)"}],CY=[{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."}],wY=[{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 TY(e){return e.replace(/&/g,`&`).replace(/"/g,`"`).replace(/</g,`<`).replace(/>/g,`>`)}function EY(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`)}function DY(e){let t=e.attrs.props,n=t?.target??``,r=typeof t?.alias==`string`&&t.alias.length>0?t.alias:null,i=typeof t?.anchor==`string`&&t.anchor.length>0?t.anchor:null,a=r??(i?`${n}#${i}`:n);return{type:`wikiLinkEmbed`,value:a,data:{target:n,anchor:i,alias:r},children:[{type:`text`,value:a}]}}const OY=[{name:`Callout`,surface:`canonical`,hasChildren:!0,props:nY,icon:`MessageSquareWarning`,category:`content`,displayName:`Callout`,description:`Alert / admonition with 15 type variants — 5 GFM (note, tip, important, warning, caution) plus 10 Obsidian-parity (abstract, info, todo, success, question, failure, danger, bug, example, quote)`,searchTerms:[`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`,`alert`,`admonition`,`callout`],serialize:(e,t)=>HJ(`Callout`,e,t,nY)},{name:`img`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:rY,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)=>HJ(`img`,e,t,rY)},{name:`video`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:aY,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)=>HJ(`video`,e,t,aY)},{name:`audio`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:oY,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)=>HJ(`audio`,e,t,oY)},{name:`Pdf`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:SY,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)=>HJ(`Pdf`,e,t,SY)},{name:`File`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:xY,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)=>HJ(`File`,e,t,xY)},{name:`Embed`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:iY,icon:`AppWindow`,category:`media`,displayName:`Embed`,description:'Inline web embed (iframe) — drop a URL, get a resizable preview pane. For YouTube / Vimeo / Loom prefer `<video src="…">` (player props, click-facade); `<Embed>` auto-rewrites watch URLs as a fallback.',searchTerms:[`embed`,`iframe`,`website`,`page`,`inline`,`frame`,`preview`],placeholder:{label:`Embed a URL`},serialize:(e,t)=>HJ(`Embed`,e,t,iY)},{name:`Accordion`,surface:`canonical`,hasChildren:!0,props:sY,icon:`ChevronRight`,category:`content`,displayName:`Accordion`,description:"Standalone expand/collapse via native HTML5 <details>/<summary>. Group siblings with the `name` prop for exclusive-accordion UX.",searchTerms:[`toggle`,`accordion`,`expandable`,`details`,`disclosure`,`collapse`,`fold`],exampleBody:`Body content revealed when the accordion is expanded.`,serialize:(e,t)=>HJ(`Accordion`,e,t,sY)},{name:`Tabs`,surface:`canonical`,hasChildren:!0,emptyChildName:`Tab`,props:mY,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>
|
|
369
369
|
<Tab label="Two">Body of the second tab panel.</Tab>`,serialize:(e,t)=>HJ(`Tabs`,e,t,mY)},{name:`Tab`,surface:`canonical`,hasChildren:!0,props:hY,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)=>HJ(`Tab`,e,t,hY)},{name:`Math`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:gY,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)=>HJ(`Math`,e,t,gY)},{name:`MermaidFence`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:yY,icon:`Workflow`,category:`content`,displayName:`Mermaid`,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:CY,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)=>HJ(`Mirror`,e,t,CY)},{name:`MirrorSource`,surface:`canonical`,hasChildren:!0,props:wY,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)=>HJ(`MirrorSource`,e,t,wY)},{name:`GFMCallout`,surface:`compat`,hasChildren:!0,props:cY,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:lY,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:t?.sourceUrl??t?.src??``,alt:t?.alt??``,title:t?.title??null}]}}},{name:`WikiEmbedImage`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:dY,icon:`ZoomIn`,category:`media`,displayName:`Wiki Embed Image`,description:"Obsidian-style `![[file.png]]` wiki-embed — read-only compat. Edit the alt-text via the alias slot; the embed target / anchor stay on the prop bag and round-trip byte-identical.",rendersAs:`img`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.target==`string`?e.target:``;return{src:e.src,alt:t??n}},serialize:DY},{name:`WikiEmbedVideo`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:fY,icon:`Film`,category:`media`,displayName:`Wiki Embed Video`,description:"Obsidian-style `![[clip.mp4]]` wiki-embed — read-only compat. Edit the title via the alias slot; the embed target / anchor stay on the prop bag and round-trip byte-identical.",rendersAs:`video`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.target==`string`?e.target:``;return{src:e.src,title:t??n}},serialize:DY},{name:`WikiEmbedAudio`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:pY,icon:`Volume2`,category:`media`,displayName:`Wiki Embed Audio`,description:"Obsidian-style `![[song.mp3]]` wiki-embed — read-only compat. Edit the title via the alias slot; the embed target / anchor stay on the prop bag and round-trip byte-identical.",rendersAs:`audio`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.target==`string`?e.target:``;return{src:e.src,title:t??n}},serialize:DY},{name:`WikiEmbedFile`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:bY,icon:`Paperclip`,category:`media`,displayName:`Wiki Embed File`,description:"Obsidian-style `![[file.zip]]` wiki-embed — read-only compat for arbitrary downloadable attachments. Renders through the `File` canonical (inline row with file-up icon + bold name + optional dim size). Edit the display name via the alias slot.",rendersAs:`File`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.size==`string`&&e.size.length>0?e.size:null;return{src:e.src,name:t??void 0,size:n??void 0}},serialize:DY},{name:`HtmlDetailsAccordion`,surface:`compat`,hasChildren:!0,props:uY,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="${TY(n.name)}"`:``,a=n?.id?` id="${TY(n.id)}"`:``,o=n?.title?.trim(),s=o?`<summary>${EY(o)}</summary>`:``;return{type:`mdxJsxFlowElement`,name:`HtmlDetailsAccordion`,attributes:[],children:t.all(e),data:{htmlBoundary:{opener:`<details${r}${i}${a}>\n${s}`,closer:`</details>`}}}}},{name:`DollarMath`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:_Y,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:vY,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??``})}],kY={name:`*`,surface:`canonical`,hasChildren:!0,props:[],description:`Unregistered component — children editable as markdown`,serialize:(e,t)=>HJ(e.attrs.componentName||`*`,e,t)};function AY(){let e=new Map;e.set(`*`,kY);for(let t of OY)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 jY(){let e=globalThis;return e.__okYpsCounters||={block:0,inline:0},e.__okYpsCounters}const MY={parseFallback:{blockLevel:0,wholeDoc:0,wholeDocBudget:0},jsxRenderFailure:{},jsxAutoConvertFailed:{},jsxAutoConvertSucceeded:{},jsxPropDropped:{},jsxMoveFailed:{},jsxStuckCopyFailed:{},jsxStuckDeleteFailed:{},jsxPopoverCloseRestoreFailed:{},jsxKeyboardDeleteFailed:{},blockGripClickSelectFailed:{},jsxArrowNodeSelectFailed:{}};function NY(){MY.parseFallback.blockLevel++}function PY(){MY.parseFallback.wholeDoc++}function FY(){MY.parseFallback.wholeDocBudget++}function IY(){let e=jY();return{parseFallback:{...MY.parseFallback},ypsMismatch:{block:e.block,inline:e.inline},jsxRenderFailure:{...MY.jsxRenderFailure},jsxAutoConvertFailed:{...MY.jsxAutoConvertFailed},jsxAutoConvertSucceeded:{...MY.jsxAutoConvertSucceeded},jsxPropDropped:{...MY.jsxPropDropped},jsxMoveFailed:{...MY.jsxMoveFailed},jsxStuckCopyFailed:{...MY.jsxStuckCopyFailed},jsxStuckDeleteFailed:{...MY.jsxStuckDeleteFailed},jsxPopoverCloseRestoreFailed:{...MY.jsxPopoverCloseRestoreFailed},jsxKeyboardDeleteFailed:{...MY.jsxKeyboardDeleteFailed},blockGripClickSelectFailed:{...MY.blockGripClickSelectFailed},jsxArrowNodeSelectFailed:{...MY.jsxArrowNodeSelectFailed}}}const LY=/^(`{3,}|~{3,})/gm;function RY(e){let t=[],n=null;for(let r of e.matchAll(LY)){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 zY(e,t){return t.some(([t,n])=>e>=t&&e<n)}const BY=/^[ \t]{0,3}\[([^\]]+)\]:\s*(\S+)(\s+(?:"[^"]*"|'[^']*'|\([^)]*\)))?\s*$/gm;function VY(e){let t=RY(e),n=[];for(let r of e.matchAll(BY))zY(r.index,t)||n.push(r[0].trimEnd());return n.length>0?`${n.join(`
|
|
370
370
|
`)}\n\n`:``}function HY(e,t){let n={startMs:typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now(),calls:0};return GY(e,t.parse,0,n)}function UY(e){return e.calls>=1e3?!0:(typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now())-e.startMs>=500}function WY(e){return e instanceof Error?{name:e.name,message:e.message.slice(0,500),stack:e.stack?.split(`
|
|
@@ -450,4 +450,4 @@ $2`).split(`
|
|
|
450
450
|
`);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=B6(n.join(`
|
|
451
451
|
`))[z6];return{identity:typeof i==`object`&&i&&!Array.isArray(i)?i:{},docFrontmatterText:t.slice(r).join(`
|
|
452
452
|
`).replace(/\n+$/,``)}}function W6(e){let t=e.charCodeAt(0)===65279?e.slice(1):e,{frontmatter:n,body:r}=dK(t);if(n===``)return{identity:{},starterContent:t};let i=pK(n),a=U6(i);if(a)return{identity:a.identity,starterContent:V6(a.docFrontmatterText,r)};let{frontmatter:o}=dK(r);if(o!==``)return{identity:B6(i),starterContent:r};let s=B6(i);return typeof s.title==`string`?{identity:s,starterContent:r}:{identity:{},starterContent:V6(i,r)}}function G6(e,t){let{docFrontmatterText:n,markdown:r}=H6(t),i={};for(let[t,n]of Object.entries(e))n!==void 0&&(i[t]=n);let a=(0,Fc.stringify)({[z6]:i});return`---\n${n.trim()===``?a:`${a}${n}\n`}---\n${r}`}function K6(e){return W6(e).starterContent}function q6(){let e=!1,t=``,n=0;return r=>{let i=J6(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 J6(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}const Y6=[`#D97757`,`#1B1912`,`#F9F3E9`,`#7A9DFF`,`#8534F3`,`#9663F0`,`#727CF3`],X6={claude:`#D97757`,cursor:`#1B1912`,windsurf:`#0B100F`,openai:`#7A9DFF`,github:`#8534F3`,cline:`#9663F0`,bot:`#727CF3`};function Z6(e,t=Y6){let n=0;for(let t of e)n=(n<<5)-n+t.charCodeAt(0)|0;return t[Math.abs(n)%t.length]}const Q6={"claude-code":`claude`,"claude-ai":`claude`,cursor:`cursor`,"cursor-vscode":`cursor`,cascade:`windsurf`,codex:`openai`,"codex-mcp-client":`openai`,copilot:`github`,cline:`cline`};function $6(e){return e?Q6[e]||(e.startsWith(`local-agent-mode-`)?`claude`:`bot`):`bot`}const e8={claude:`Claude`,cursor:`Cursor`,windsurf:`Windsurf`,openai:`Codex`,github:`Copilot`,cline:`Cline`};function t8(e){let t=e?.trim();return t?e8[$6(t)]??t:`Agent`}function n8(e,t){let n=e.trim();if(!n||/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(n)||n.startsWith(`//`)||n.startsWith(`#`))return null;let r=n.indexOf(`#`),i=r>=0?n.slice(0,r):n,a=r>=0?n.slice(r+1):null,o=(i.split(`?`)[0]??``).trim();if(!o)return null;let s=(o.split(`/`).pop()??``).match(/\.([a-z0-9]+)$/i);if(s){let e=(s[1]??``).toLowerCase();if(e!==`md`&&e!==`mdx`)return null}let c=o.toLowerCase(),l=c.endsWith(`.mdx`)?o.slice(0,-4):c.endsWith(`.md`)?o.slice(0,-3):o,u=l.startsWith(`/`),d=u?l.slice(1):l,f=u?[]:t.includes(`/`)?t.split(`/`).slice(0,-1):[];for(let e of d.split(`/`))if(e===`..`){if(f.length===0)return null;f.pop()}else e!==`.`&&e!==``&&f.push(e);return f.length===0?null:{docName:f.join(`/`),anchor:a||null}}const r8=/^[a-zA-Z][a-zA-Z\d+\-.]*:/;function i8(e){let t=(e.split(/[?#]/)[0]??e).match(/\.([a-z0-9]+)$/i);return t?(t[1]??``).toLowerCase():null}function a8(e){let t=e.trim();return r8.test(t)||t.startsWith(`//`)}function o8(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(a8(n))return{kind:`external`,url:n};let r=n8(n,t);if(r)return{kind:`doc`,docName:r.docName,anchor:r.anchor};let i=i8(n);return i&&i!==`md`&&i!==`mdx`?{kind:`asset`,url:n,ext:i}:null}function s8(e,t){let n=e.trim();if(!n)return null;if(a8(n))return{kind:`external`,url:t?`${n}#${t}`:n};let r=i8(n);return r&&r!==`md`&&r!==`mdx`?{kind:`asset`,url:n,ext:r}:{kind:`doc`,docName:n,anchor:t?.trim()||null}}function c8(e,t){let n=e.trim();if(!n||r8.test(n)||n.startsWith(`//`)||n.startsWith(`#`))return null;let r=n.indexOf(`#`),i=((r>=0?n.slice(0,r):n).split(`?`)[0]??``).trim();if(!i)return null;let a=i.startsWith(`/`),o=a?i.slice(1):i,s=a?[]:t.includes(`/`)?t.split(`/`).slice(0,-1):[];for(let e of o.split(`/`))if(e===`..`){if(s.length===0)return null;s.pop()}else e!==`.`&&e!==``&&s.push(e);return s.length===0?null:s.join(`/`)}function l8(e){let t=e;return t.startsWith(`./`)&&(t=t.slice(2)),t.startsWith(`/`)&&(t=t.slice(1)),t}function u8(e){let t=e.lastIndexOf(`/`);return t===-1?e:e.slice(t+1)}function d8(e){let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)}function f8(e){return e.split(`/`).filter(e=>e!==``)}function p8(e,t){let n=d8(t);return e===``||n===e?!0:n.startsWith(`${e}/`)}function m8(e,t){let n=d8(t);if(e===n)return 0;let r=e===``?n:n.slice(e.length+1);return r===``?0:f8(r).length}function h8(e,t){let n=f8(e),r=f8(t),i=0;for(;i<n.length&&i<r.length&&n[i]===r[i];)i++;return n.length-i+(r.length-i)}function g8(){let e=new Map;function t(t){let n=l8(t);if(n===``)return;let r=u8(n);if(r===``)return;let i=r.toLowerCase(),a=e.get(i);if(!a){e.set(i,[n]);return}a.includes(n)||a.push(n)}function n(t){let n=l8(t),r=u8(n).toLowerCase(),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=t.toLowerCase(),i=e.get(r);if(!i||i.length===0)return null;if(i.length===1)return i[0];let a=d8(l8(n)),o=[],s=[];for(let e of i)p8(a,e)?o.push(e):s.push(e);return o.length>0?(e=>{let t=e[0],n=m8(a,t);for(let r=1;r<e.length;r++){let i=e[r],o=m8(a,i);(o<n||o===n&&i<t)&&(t=i,n=o)}return t})(o):(e=>{let t=e[0],n=h8(a,d8(t));for(let r=1;r<e.length;r++){let i=e[r],o=h8(a,d8(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 _8(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 v8(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 y8(e){try{return process.kill(e,0),!0}catch(e){return!!(e&&typeof e==`object`&&`code`in e&&e.code===`EPERM`)}}function b8(e){return!(typeof e!=`number`||!Number.isInteger(e)||e<2||e>2147483647)}const x8=/^[A-Za-z0-9-]{8,64}$/;let S8=null;function C8(e){return l(e??m(),`.ok`,`machine-id`)}function w8(e){if(e===void 0&&S8!==null)return S8;let t=C8(e),n=null;try{let e=b(t,`utf-8`).trim();x8.test(e)&&(n=e)}catch{}if(n===null){n=w();try{v(c(t),{recursive:!0}),S(t,`${n}\n`,{encoding:`utf-8`,mode:384})}catch(e){console.warn(`[machine-id] Failed to persist ${t} — using an ephemeral per-process id; lock ownership checks will fail closed (collision) instead of recognizing this machine: ${e instanceof Error?e.message:String(e)}`)}}return e===void 0&&(S8=n),n}function T8(){try{let e=u(c(f(import.meta.url)),`..`,`package.json`),t=JSON.parse(b(e,`utf-8`));if(typeof t.version==`string`&&t.version.length>0)return t.version}catch{}return`0.0.0-unknown`}const E8=T8(),D8=1;var O8=class extends Error{existing;lockPath;lockName;constructor(e,t,n){super(`OpenKnowledge ${n} already running on port ${e.port} (pid ${e.pid}, started ${e.startedAt}). Stop it first or use a different directory. Lock: ${t}`),this.name=`ProcessLockCollisionError`,this.existing=e,this.lockPath=t,this.lockName=n}};function k8(e,t){return u(e,`${t}.lock`)}const A8=new Map;function j8(e){A8.set(e,(A8.get(e)??0)+1)}function M8(e){let t=A8.get(e);return t===void 0||t<=1?(A8.delete(e),!0):(A8.set(e,t-1),!1)}function N8(e){return typeof e.machineId==`string`?e.machineId===w8():e.hostname===h()}const P8=new Set;let F8=!1;function I8(e){P8.add(e),!F8&&(F8=!0,process.on(`exit`,()=>{for(let e of P8)try{let t=JSON.parse(b(e,`utf-8`));if(t?.pid!==process.pid||typeof t.machineId==`string`&&t.machineId!==w8()||t.machineId===void 0&&typeof t.hostname==`string`&&t.hostname!==h())continue;x(e)}catch{}}))}function L8(e,t){try{let n=JSON.parse(b(e,`utf-8`));return n&&typeof n==`object`&&b8(n.pid)?n:(console.warn(`${t} Corrupt lock file at ${e} — replacing`),null)}catch{return console.warn(`${t} Corrupt lock file at ${e} — replacing`),null}}function R8(e){let{lockName:t,lockDir:n,metadata:r}=e,i=`[${t}-lock]`;v(n,{recursive:!0});let a=k8(n,t),o={pid:process.pid,hostname:h(),port:r.port,startedAt:new Date().toISOString(),worktreeRoot:r.worktreeRoot,machineId:w8(),...r.kind!==void 0&&{kind:r.kind},...r.parentPid!==void 0&&{parentPid:r.parentPid},...r.capabilities!==void 0&&{capabilities:r.capabilities},protocolVersion:r.protocolVersion??1,runtimeVersion:r.runtimeVersion??E8},s=JSON.stringify(o,null,2);for(let e=0;e<3;e++){if(!_(a))try{let e=y(a,`wx`,384);try{C(e,s)}finally{g(e)}return j8(a),I8(a),z8({lockName:t,lockDir:n,lockPath:a})}catch(e){if(e.code!==`EEXIST`)throw e}let e=L8(a,i);if(e){if(N8(e)&&e.pid===process.pid)return S(a,s,{encoding:`utf-8`,mode:384}),j8(a),I8(a),z8({lockName:t,lockDir:n,lockPath:a});if(y8(e.pid))throw new O8(e,a,t);console.warn(`${i} Stale lock detected (pid=${e.pid}, host=${e.hostname}) — replacing`)}try{x(a)}catch{}}throw Error(`${i} Failed to acquire ${a} after 3 attempts (concurrent acquire contention).`)}function z8(e){let{lockName:t,lockDir:n,lockPath:r}=e;return{lockPath:r,release:()=>G8({lockName:t,lockDir:n}),updatePort:e=>B8({lockName:t,lockDir:n,port:e})}}function B8(e){let{lockName:t,lockDir:n,port:r}=e,i=`[${t}-lock]`,a=k8(n,t);if(!_(a)){console.warn(`${i} Lock file missing at ${a} during port update — skipping`);return}let o;try{let e=JSON.parse(b(a,`utf-8`));if(!e||typeof e!=`object`||!b8(e.pid)){console.warn(`${i} Corrupt lock at ${a} during port update — skipping`);return}o=e}catch{console.warn(`${i} Unreadable lock at ${a} during port update — skipping`);return}if(o.pid===process.pid&&N8(o)){o.port=r;try{S(a,JSON.stringify(o,null,2),{encoding:`utf-8`,mode:384})}catch(e){console.warn(`${i} Failed to update port in ${a}: ${e instanceof Error?e.message:String(e)}`)}}}function V8(e){let{lockName:t,lockDir:n}=e,r=`[${t}-lock]`,i=k8(n,t);if((A8.get(i)??0)>1)return;let a;try{let e=JSON.parse(b(i,`utf-8`));if(!e||typeof e!=`object`||!b8(e.pid)){console.warn(`${r} Corrupt lock at ${i} during draining mark — skipping`);return}a=e}catch(e){e.code!==`ENOENT`&&console.warn(`${r} Unreadable lock at ${i} during draining mark — skipping: ${e instanceof Error?e.message:String(e)}`);return}if(a.pid===process.pid&&N8(a)&&a.draining!==!0){a.draining=!0;try{S(i,JSON.stringify(a,null,2),{encoding:`utf-8`,mode:384})}catch(e){console.warn(`${r} Failed to mark ${i} draining: ${e instanceof Error?e.message:String(e)}`)}}}function H8(e){let{lockName:t,lockDir:n}=e,r=k8(n,t);if(!_(r))return null;let i;try{let e=JSON.parse(b(r,`utf-8`));if(!e||typeof e!=`object`||!b8(e.pid))return null;i=e}catch{return null}if(!N8(i))return null;if(!y8(i.pid)){try{x(r)}catch{}return null}return i}function U8(e){let{lockName:t,lockDir:n}=e,r=k8(n,t);if(!_(r))return{status:`absent`};let i;try{i=JSON.parse(b(r,`utf-8`))}catch{return{status:`incompatible`,reason:`corrupt`,raw:void 0}}if(!i||typeof i!=`object`)return{status:`incompatible`,reason:`corrupt`,raw:i};let a=i;if(!b8(a.pid)||typeof a.hostname!=`string`||typeof a.port!=`number`||typeof a.startedAt!=`string`||typeof a.worktreeRoot!=`string`)return{status:`incompatible`,reason:`corrupt`,raw:i};let o={pid:a.pid,hostname:a.hostname,port:a.port,startedAt:a.startedAt,worktreeRoot:a.worktreeRoot,machineId:typeof a.machineId==`string`?a.machineId:void 0,draining:a.draining===!0?!0:void 0,protocolVersion:typeof a.protocolVersion==`number`?a.protocolVersion:void 0,runtimeVersion:typeof a.runtimeVersion==`string`?a.runtimeVersion:void 0};if(!N8(o))return{status:`stale`,lock:o};if(!y8(o.pid)){try{x(r)}catch{}return{status:`stale`,lock:o}}return o.protocolVersion===void 0||o.runtimeVersion===void 0?{status:`incompatible`,reason:`missing-fields`,raw:i}:{status:`live`,lock:o}}async function W8(e){let{lockName:t,lockDir:n}=e,r=e.timeoutMs??1e4,i=e.pollIntervalMs??100,a=e.readLock??(()=>H8({lockName:t,lockDir:n})),o=e.sleep??(e=>new Promise(t=>setTimeout(t,e))),s=a();if(s===null||s.draining!==!0)return`no-drain`;let c=Date.now()+r;for(;Date.now()<c;){await o(i);let e=a();if(e===null)return`released`;if(e.draining!==!0)return`no-drain`}return`timeout`}function G8(e){let{lockName:t,lockDir:n,deferUnlinkToExit:r=!1}=e,i=`[${t}-lock]`,a=k8(n,t);if(M8(a)){if(r){V8({lockName:t,lockDir:n});return}if(_(a))try{let e=JSON.parse(b(a,`utf-8`));if(!e||typeof e!=`object`||typeof e.pid!=`number`||e.pid!==process.pid||!N8(e))return;x(a),P8.delete(a)}catch(e){console.warn(`${i} Failed to release ${a}: ${e instanceof Error?e.message:String(e)}`)}}}var K8=class extends O8{constructor(e,t){super(e,t,`server`),this.name=`ServerLockCollisionError`}};function q8(e,t){try{return R8({lockName:`server`,lockDir:e,metadata:t}).lockPath}catch(e){throw e instanceof O8&&e.lockName===`server`?new K8(e.existing,e.lockPath):e}}function J8(e,t){B8({lockName:`server`,lockDir:e,port:t})}function Y8(e){return H8({lockName:`server`,lockDir:e})}function X8(e,t){G8({lockName:`server`,lockDir:e,...t})}function Z8(e){V8({lockName:`server`,lockDir:e})}function Q8(e,t){return W8({lockName:`server`,lockDir:e,...t})}export{mG as $,fl as $a,f2 as $i,z2 as $n,YG as $r,n0 as $t,a1 as A,lu as Aa,g$ as Ai,N6 as An,Uo as Ao,X0 as Ar,_2 as At,g1 as B,Kc as Ba,Gq as Bi,n2 as Bn,cn as Bo,w2 as Br,H3 as Bt,m1 as C,M$ as Ca,t8 as Ci,K1 as Cn,Pc as Co,L2 as Cr,A0 as Ct,b1 as D,gb as Da,T6 as Di,O2 as Dn,Ks as Do,lJ as Dr,z1 as Dt,o1 as E,P4 as Ea,R6 as Ei,DG as En,$s as Eo,x0 as Er,GG as Et,j1 as F,Cl as Fa,$6 as Fi,B1 as Fn,br as Fo,Y0 as Fr,e1 as Ft,v4 as G,nu as Ga,zG as Gi,Cq as Gn,ht as Go,C2 as Gr,VG as Gt,b4 as H,pl as Ha,QG as Hi,e2 as Hn,Dt as Ho,T2 as Hr,c2 as Ht,A1 as I,wl as Ia,K6 as Ii,V1 as In,un as Io,z6 as Ir,qG as It,p4 as J,jl as Ja,A4 as Ji,Aq as Jn,p0 as Jr,t0 as Jt,h4 as K,Yc as Ka,Z4 as Ki,Eq as Kn,mt as Ko,x2 as Kr,I1 as Kt,qq as L,Sl as La,Rq as Li,n4 as Ln,fn as Lo,j2 as Lr,U1 as Lt,i1 as M,ou as Ma,P$ as Mi,L3 as Mn,Ka as Mo,Q0 as Mr,N1 as Mt,v1 as N,Dl as Na,IY as Ni,BG as Nn,qa as No,q0 as Nr,S1 as Nt,s1 as O,op as Oa,_8 as Oi,A6 as On,xs as Oo,Z1 as Or,w0 as Ot,nJ as P,Zc as Pa,cq as Pi,gG as Pn,si as Po,J0 as Pr,C1 as Pt,_G as Q,ql as Qa,MG as Qi,Qq as Qn,B0 as Qr,r0 as Qt,G4 as R,xl as Ra,r1 as Ri,o4 as Rn,mn as Ro,h2 as Rr,W1 as Rt,UG as S,W4 as Sa,F4 as Si,I0 as Sn,dc as So,X2 as Sr,k0 as St,d0 as T,hq as Ta,K3 as Ti,H0 as Tn,A as To,P2 as Tr,JG as Tt,y4 as U,cu as Ua,O3 as Ui,a4 as Un,k as Uo,E2 as Ur,b0 as Ut,g4 as V,Xc as Va,EG as Vi,a2 as Vn,zt as Vo,b2 as Vr,o2 as Vt,_4 as W,su as Wa,Iq as Wi,eJ as Wn,O as Wo,S2 as Wr,G3 as Wt,d4 as X,au as Xa,q3 as Xi,Fq as Xn,f0 as Xr,a0 as Xt,f4 as Y,Rl as Ya,PG as Yi,Nq as Yn,m0 as Yr,i0 as Yt,l4 as Z,Xl as Za,LG as Zi,Zq as Zn,z0 as Zr,cJ as Zt,X8 as _,mq as _a,WZ as _i,N0 as _n,rc as _o,Z2 as _r,X1 as _t,R8 as a,OG as aa,U4 as ai,$G as an,Il as ao,q2 as ar,Jq as at,Q8 as b,dK as ba,k3 as bi,aJ as bn,j as bo,d2 as br,O1 as bt,y8 as c,X$ as ca,o8 as ci,_0 as cn,Ls as co,B2 as cr,T1 as ct,V8 as d,n8 as da,Z6 as di,q1 as dn,Hs as do,I2 as dr,T0 as dt,W6 as ea,sJ as ei,Q1 as en,El as eo,K2 as er,SG as et,Z8 as f,AG as fa,kJ as fi,S3 as fn,Ws as fo,e4 as fr,E0 as ft,G8 as g,fq as ga,q6 as gi,pG as gn,tc as go,u2 as gr,HG as gt,Y8 as h,P3 as ha,g8 as hi,KG as hn,jc as ho,I6 as hr,I3 as ht,K8 as i,Y4 as ia,T4 as ii,TG as in,zl as io,N2 as ir,yG as it,y1 as j,qc as ja,B$ as ji,l2 as jn,ma as jo,Z0 as jr,v2 as jt,x1 as k,L as ka,V3 as ki,j6 as kn,Go as ko,$0 as kr,g2 as kt,b8 as l,c8 as la,s8 as li,g0 as ln,uc as lo,V2 as lr,D0 as lt,U8 as m,j4 as ma,A2 as mi,nK as mn,M as mo,D2 as mr,rK as mt,E8 as n,tK as na,G1 as ni,CG as nn,ml as no,U2 as nr,vG as nt,q8 as o,R4 as oa,iJ as oi,_$ as on,kl as oo,c4 as or,Xq as ot,H8 as p,S6 as pa,G6 as pi,eK as pn,N as po,t4 as pr,XG as pt,u4 as q,Jc as qa,b3 as qi,jq as qn,h0 as qr,o0 as qt,D8 as r,Y$ as ra,E4 as ri,wG as rn,Tl as ro,W2 as rr,bG as rt,w8 as s,J4 as sa,Wq as si,y0 as sn,Al as so,J2 as sr,w1 as st,O8 as t,fK as ta,oJ as ti,e0 as tn,eu as to,G2 as tr,xG as tt,k8 as u,L6 as ua,hG as ui,ZG as un,F as uo,F2 as ur,O0 as ut,B8 as v,FG as va,r6 as vi,j0 as vn,I as vo,Q2 as vr,L0 as vt,u0 as w,pK as wa,F3 as wi,V0 as wn,ac as wo,R2 as wr,WG as wt,X6 as x,v8 as xa,x3 as xi,F0 as xn,P as xo,Y2 as xr,D1 as xt,J8 as y,q4 as ya,t6 as yi,tJ as yn,Zs as yo,$2 as yr,R0 as yt,e3 as z,bl as za,_q as zi,t2 as zn,gn as zo,p2 as zr,J1 as zt};
|
|
453
|
-
//# sourceMappingURL=server-lock-iLcBw_q0-
|
|
453
|
+
//# sourceMappingURL=server-lock-iLcBw_q0-RDMfTH6b.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-DXB73IDG-Bx-Ikbnu.mjs";import{t as e}from"./chunk-XKQRETAK-DBH8-r13.mjs";export{e as sha1sumCommand};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-DXB73IDG-Bx-Ikbnu.mjs";import{t as e}from"./chunk-5V6VZH6T-DtvstltO.mjs";export{e as sha256sumCommand};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk-DXB73IDG-Bx-Ikbnu.mjs";import"./chunk-5QMZ5MUS-_0tQyQsf.mjs";import"./chunk-A5O5YHGN-Kbs3GRxW.mjs";import{n as e}from"./chunk-GOV5EKKI-
|
|
1
|
+
import"./chunk-DXB73IDG-Bx-Ikbnu.mjs";import"./chunk-5QMZ5MUS-_0tQyQsf.mjs";import"./chunk-A5O5YHGN-Kbs3GRxW.mjs";import{n as e}from"./chunk-GOV5EKKI-B5v6YeVX.mjs";export{e as sleepCommand};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-DXB73IDG-Bx-Ikbnu.mjs";import{n as e}from"./chunk-KMEYNNUA-DG96DsNs.mjs";export{e as sortCommand};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk-DXB73IDG-Bx-Ikbnu.mjs";import{n as e}from"./chunk-MYE6AGBJ-
|
|
1
|
+
import"./chunk-DXB73IDG-Bx-Ikbnu.mjs";import{n as e}from"./chunk-MYE6AGBJ-DmBUXN6H.mjs";export{e as split};
|