decocms 2.366.7 → 2.366.8
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/client/assets/{AlertCircle-DFcOa31f.js → AlertCircle-Dyh2dUBt.js} +1 -1
- package/dist/client/assets/{ArrowNarrowLeft-CbOlEr1w.js → ArrowNarrowLeft-DOeeOVat.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-C6axmKPR.js → ArrowUpRight-C5h8eEJl.js} +1 -1
- package/dist/client/assets/{Check-JQri_6PS.js → Check-BBN8jtrj.js} +1 -1
- package/dist/client/assets/{CheckCircle-B6HzfzYv.js → CheckCircle-BodpoDGR.js} +1 -1
- package/dist/client/assets/{ChevronDown-CNNU2L0m.js → ChevronDown-BHt79TDc.js} +1 -1
- package/dist/client/assets/{ChevronRight-BuVcgGSu.js → ChevronRight-CgiGzJK2.js} +1 -1
- package/dist/client/assets/{ChevronUp-DyIOyS2u.js → ChevronUp-Hv5s5GCl.js} +1 -1
- package/dist/client/assets/{Container-Cy3AGglh.js → Container-CmZ_UAMx.js} +1 -1
- package/dist/client/assets/{DotsVertical-DIehc2A5.js → DotsVertical-BFb-15-m.js} +1 -1
- package/dist/client/assets/{FilterLines-DHlq5ZtE.js → FilterLines-BNco6Knh.js} +1 -1
- package/dist/client/assets/{HardDrive-CAAHpLeS.js → HardDrive-Bs4cIN_I.js} +1 -1
- package/dist/client/assets/{Key01-C29UL5qH.js → Key01-BOHiIHj-.js} +1 -1
- package/dist/client/assets/{LayoutLeft-5sSkIfFI.js → LayoutLeft-NsiLg-Hz.js} +1 -1
- package/dist/client/assets/{LinkExternal01-QpHHOJbZ.js → LinkExternal01-DXkr_udM.js} +1 -1
- package/dist/client/assets/{Lock01-Ju5ifHNn.js → Lock01-BheAsQQx.js} +1 -1
- package/dist/client/assets/{Monitor01-DHHvwXbl.js → Monitor01-BkzEm6bw.js} +1 -1
- package/dist/client/assets/{Palette-CJqBw6AH.js → Palette-DPP_bV0e.js} +1 -1
- package/dist/client/assets/{Play-DPs1Pbq2.js → Play-BqGgMbL5.js} +1 -1
- package/dist/client/assets/{Plus-DgrNRFK5.js → Plus-C5l4faC1.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-Bf15qfNS.js → RefreshCcw01-Cr7WlxPS.js} +1 -1
- package/dist/client/assets/{SearchMd-CuY4_41I.js → SearchMd-rTsELW21.js} +1 -1
- package/dist/client/assets/{Settings02-Cjzbasby.js → Settings02-BSu9v11-.js} +1 -1
- package/dist/client/assets/{Shield01-rI42zX_N.js → Shield01-BzHuCaEB.js} +1 -1
- package/dist/client/assets/{Star01-CiaU9xFe.js → Star01-HKceyVo1.js} +1 -1
- package/dist/client/assets/{Stars02-BHNtUcIC.js → Stars02-LrVE5fus.js} +1 -1
- package/dist/client/assets/{Sun-DA9iSyj3.js → Sun-D9eEy7za.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-B0nDhziZ.js → SwitchHorizontal01-C1fzb4rn.js} +1 -1
- package/dist/client/assets/{Tool01-BpLh90bx.js → Tool01-DHXrZh_c.js} +1 -1
- package/dist/client/assets/{Trash01-BU1vvG1i.js → Trash01-v5Dy47Wj.js} +1 -1
- package/dist/client/assets/{Upload01-D2aoviL7.js → Upload01-p8VtXdXS.js} +1 -1
- package/dist/client/assets/{User01-BUxAdPGO.js → User01-CtanRIko.js} +1 -1
- package/dist/client/assets/{Users01-X9W80ATA.js → Users01-BbxKMG6t.js} +1 -1
- package/dist/client/assets/{Users03-DERc_3KT.js → Users03-Bq46oqMB.js} +1 -1
- package/dist/client/assets/{X-CpxCwBcO.js → X-DkujvqvQ.js} +1 -1
- package/dist/client/assets/{XCircle-BlhQtOFW.js → XCircle-BkF11s9b.js} +1 -1
- package/dist/client/assets/{XClose-6T_HfnSF.js → XClose-DgRHRNhM.js} +1 -1
- package/dist/client/assets/{Zap-C_gPmGTu.js → Zap-XzlBn_sj.js} +1 -1
- package/dist/client/assets/{ZapSquare-D-9nYZGQ.js → ZapSquare-sMv-roxP.js} +1 -1
- package/dist/client/assets/{accordion-CBF1VPy1.js → accordion-dqQUHOnH.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-WM_qTQCr.js → add-connection-dialog-Doxko4pY.js} +1 -1
- package/dist/client/assets/{agent-icon-BZLvaskO.js → agent-icon-q6iHyexc.js} +1 -1
- package/dist/client/assets/{agent-icons-ZEbpuDyp.js → agent-icons-A7w_l1KK.js} +1 -1
- package/dist/client/assets/{agents-list-BD4seTwq.js → agents-list-_CO5Xl7p.js} +1 -1
- package/dist/client/assets/{ai-providers-Dps_1J2i.js → ai-providers-B1ZbPwoq.js} +1 -1
- package/dist/client/assets/{alert-CmozMRgO.js → alert-DL1cbRoM.js} +1 -1
- package/dist/client/assets/{alert-dialog-Bzj7Dj8A.js → alert-dialog-B_i_ps7f.js} +1 -1
- package/dist/client/assets/{auth-catchall-Ck-h53ka.js → auth-catchall-AHvA5vWD.js} +1 -1
- package/dist/client/assets/{auth-split-layout-COCXQjkb.js → auth-split-layout-CT4AkDzg.js} +1 -1
- package/dist/client/assets/{automation-list-row-BK4XzBrA.js → automation-list-row-DxuoSGb8.js} +1 -1
- package/dist/client/assets/{automations-BIQRZeWE.js → automations-CmZJlJt9.js} +1 -1
- package/dist/client/assets/{avatar-DCmff7mq.js → avatar-BRyrVRDm.js} +1 -1
- package/dist/client/assets/{badge-ONnaTLOr.js → badge-BTq6_dwU.js} +1 -1
- package/dist/client/assets/{brand-context-DWdSQDXw.js → brand-context-D5z_TG2J.js} +1 -1
- package/dist/client/assets/{card-BsL17xby.js → card-CSM7jg8b.js} +1 -1
- package/dist/client/assets/{chat-context-4LDn0s0C.js → chat-context-CICjyzMY.js} +1 -1
- package/dist/client/assets/{checkbox-CupWiQrC.js → checkbox-Dz5JG34i.js} +1 -1
- package/dist/client/assets/{cli-auth-success-C_FSoZy8.js → cli-auth-success-CvhsqEgg.js} +1 -1
- package/dist/client/assets/{collection-detail-rvEMorEg.js → collection-detail-CzazaoJP.js} +1 -1
- package/dist/client/assets/{collection-display-button-BMPAqbiG.js → collection-display-button-mD3oc4np.js} +1 -1
- package/dist/client/assets/{collection-search-DBZ50buZ.js → collection-search-BRyI5tKN.js} +1 -1
- package/dist/client/assets/{collection-search-Um_OB9Yj.js → collection-search-CXtVb7nz.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-Dtog_f2p.js → collection-table-wrapper-C7oTCBDJ.js} +1 -1
- package/dist/client/assets/{collection-tabs-DBGScRHK.js → collection-tabs-BzSk0IWN.js} +1 -1
- package/dist/client/assets/{collections-B7Zm82Yd.js → collections-BvhsS_z2.js} +1 -1
- package/dist/client/assets/{command-BbOyBJF2.js → command-CE-N-Fow.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-BB6OqliN.js → connect-desktop-dialog-C-R7zEUP.js} +1 -1
- package/dist/client/assets/{connection-card-CfeWMSHF.js → connection-card-PlQwrunz.js} +1 -1
- package/dist/client/assets/{connection-detail-pLHIqTQT.js → connection-detail-B7sBzrsj.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-CU39ex55.js → connection-form-helpers-BPskqY8x.js} +1 -1
- package/dist/client/assets/{connections-Dcfpl5Vt.js → connections-BO5GNb9A.js} +1 -1
- package/dist/client/assets/{constants-z8N0NNar.js → constants-B8os5nMI.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-BmH40IlP.js → decopilot-sse-pool-CibYuCaE.js} +1 -1
- package/dist/client/assets/{dialog-1TuinsgZ.js → dialog-C40tWbjB.js} +1 -1
- package/dist/client/assets/{domain-settings-CK5mrQIi.js → domain-settings-CzQQxHOD.js} +1 -1
- package/dist/client/assets/{drawer-DQoKQZB2.js → drawer-im0a0-JE.js} +1 -1
- package/dist/client/assets/{dropdown-menu-Dzjyztci.js → dropdown-menu-nlgjcLMp.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-VBJnbblQ.js → dynamic-plugin-layout-DlWKLIeK.js} +1 -1
- package/dist/client/assets/{empty-state-oNm48kH8.js → empty-state-Cw3XK_Gs.js} +1 -1
- package/dist/client/assets/{empty-state-DoRCByZ3.js → empty-state-Rnc2dhkR.js} +1 -1
- package/dist/client/assets/{extract-connection-data-DhUh4JIU.js → extract-connection-data-D00SSnkh.js} +1 -1
- package/dist/client/assets/{features-BLue5eI4.js → features-DZ0ghQyn.js} +1 -1
- package/dist/client/assets/{file-explorer-CEsWFSVG.js → file-explorer-DMwROQk0.js} +1 -1
- package/dist/client/assets/{files-DnOIW6UR.js → files-mqgIbtsb.js} +1 -1
- package/dist/client/assets/{form-BACtGvj-.js → form-C2fWcpmD.js} +1 -1
- package/dist/client/assets/{general-D8M9QTub.js → general-BGSI6aBj.js} +1 -1
- package/dist/client/assets/{generate-id-D8MMm0i_.js → generate-id-DzmzOPfM.js} +1 -1
- package/dist/client/assets/{github-repo-picker-rt9Vt0dE.js → github-repo-picker-C0GpV9eM.js} +1 -1
- package/dist/client/assets/{hooks-BsbVht9n.js → hooks-NevP65mb.js} +1 -1
- package/dist/client/assets/{hover-card-CxINYsQV.js → hover-card-RfUTMsZA.js} +1 -1
- package/dist/client/assets/{import-from-deco-dialog-C0AXmTvu.js → import-from-deco-dialog-B0MmDUtr.js} +1 -1
- package/dist/client/assets/{index-raVE4iMU.js → index-Bf7aO1A-.js} +2 -2
- package/dist/client/assets/{index-CZPd3hrs.js → index-Bj3Gsvmx.js} +4 -4
- package/dist/client/assets/{index-BuEd39Tz.js → index-BlXuTZUL.js} +1 -1
- package/dist/client/assets/{index-D2D8zFsJ.js → index-CP1SUcsr.js} +1 -1
- package/dist/client/assets/{index-CdAXbXCD.js → index-CPUASH8Y.js} +1 -1
- package/dist/client/assets/{index-B7X0Dr5K.js → index-CbpIdzH6.js} +1 -1
- package/dist/client/assets/{index-DRu0KGyt.js → index-Ce5SKvT1.js} +1 -1
- package/dist/client/assets/{index-Bid6pGzX.js → index-D1V7gFaI.js} +1 -1
- package/dist/client/assets/{index-DsfxL555.js → index-D3AvleZU.js} +1 -1
- package/dist/client/assets/{index-zqEjYnv0.js → index-D3GzwlSX.js} +1 -1
- package/dist/client/assets/{index-CSjyCM-u.js → index-DBGGjq4P.js} +1 -1
- package/dist/client/assets/{index-DktH-nwk.js → index-DBIBJV0k.js} +1 -1
- package/dist/client/assets/{index-5btRi0pB.js → index-DGa9X7kA.js} +1 -1
- package/dist/client/assets/{index-oYU8P956.js → index-DPqqDw7W.js} +1 -1
- package/dist/client/assets/{index-DOyZEChd.js → index-DokSGh4p.js} +1 -1
- package/dist/client/assets/{index-Btb-lxzO.js → index-DsxbUaF_.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-ZgItTY4U.js → infiniteQueryObserver-Cv7QlLOi.js} +1 -1
- package/dist/client/assets/{input-CcEL_8zI.js → input-Fpo5hVEP.js} +1 -1
- package/dist/client/assets/{integration-icon-C6CHfqhT.js → integration-icon-DX7WoZFw.js} +1 -1
- package/dist/client/assets/{label-P_F_-Q8z.js → label-FRw7B4TG.js} +1 -1
- package/dist/client/assets/{layout-Cy8BIgv4.js → layout-DRV6GiLr.js} +1 -1
- package/dist/client/assets/{login-C0__NyWq.js → login-CfCMY-Xx.js} +1 -1
- package/dist/client/assets/{members-CvLryIsr.js → members-xAPoZeMG.js} +1 -1
- package/dist/client/assets/{monaco-editor-BeYwPRx7.js → monaco-editor-BqbZT3K3.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-oa232c6w.js → monitoring-stats-row-BFEaeHW_.js} +1 -1
- package/dist/client/assets/{oauth-callback-nhW5Hk7K.js → oauth-callback-ZvrYBv1e.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-CBGn5V2N.js → oauth-callback-ai-provider-BUr_Gk3g.js} +1 -1
- package/dist/client/assets/{onboarding-CJebl9bX.js → onboarding-DAlRszwq.js} +1 -1
- package/dist/client/assets/{org-layout-C77vl6Iy.js → org-layout-CG7hQKSm.js} +1 -1
- package/dist/client/assets/{org-plugin-layout-iBgNZvjR.js → org-plugin-layout-B2xqOhgA.js} +1 -1
- package/dist/client/assets/{pair-D5k2ePIl.js → pair-D1bgeRCX.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-C6vbSsTR.js → plugin-empty-state-CuVTFSVp.js} +1 -1
- package/dist/client/assets/{plugin-header-CERNSvWs.js → plugin-header-CLNGHNmz.js} +1 -1
- package/dist/client/assets/{plugin-layout-Dqtz19-C.js → plugin-layout-DD5D4ZYp.js} +1 -1
- package/dist/client/assets/{popover-Biu5bUpE.js → popover-BkyXjLv-.js} +1 -1
- package/dist/client/assets/{profile-CiZbXHxj.js → profile-DJyl7mco.js} +1 -1
- package/dist/client/assets/{project-app-view-C5c0g4mg.js → project-app-view-BBzvPrjP.js} +1 -1
- package/dist/client/assets/registry-CZacfzmC.js +2 -0
- package/dist/client/assets/{registry-layout-BV5ALzTv.js → registry-layout-DmSpIEFO.js} +1 -1
- package/dist/client/assets/{required-auth-layout-6caiGmq6.js → required-auth-layout-CawOOa2O.js} +1 -1
- package/dist/client/assets/{reset-password-D0Ak5nrj.js → reset-password-rYx9wxY5.js} +1 -1
- package/dist/client/assets/{roles-DaLbowGy.js → roles-DRxguWZW.js} +1 -1
- package/dist/client/assets/{search-input-DN3bxChj.js → search-input-DglPcAnH.js} +1 -1
- package/dist/client/assets/{secrets-B6jYZgCT.js → secrets-DmZX9LsT.js} +1 -1
- package/dist/client/assets/{sections-editor-2l7dT3ea.js → sections-editor-BMpgMeff.js} +1 -1
- package/dist/client/assets/{select-BI295XE-.js → select-ufdAhrF_.js} +1 -1
- package/dist/client/assets/{settings-layout-0UTQAxIu.js → settings-layout-BBUh6Vlw.js} +1 -1
- package/dist/client/assets/{settings-section-DCgrgvZN.js → settings-section-DbssupiX.js} +1 -1
- package/dist/client/assets/{shell-controls-B5In6zvk.js → shell-controls-wYSme1hd.js} +1 -1
- package/dist/client/assets/{shell-layout-B4sASmIz.js → shell-layout-iPI2JI8_.js} +1 -1
- package/dist/client/assets/{sidebar-BQJxM_Xs.js → sidebar-CkEPveNS.js} +1 -1
- package/dist/client/assets/{skeleton-Cz-aBL4t.js → skeleton-DYoQoQqq.js} +1 -1
- package/dist/client/assets/{sortable.esm-CVet_wfm.js → sortable.esm-DUaPlB_W.js} +1 -1
- package/dist/client/assets/{spinner-CW1wo-Y2.js → spinner-CvW_7LWr.js} +1 -1
- package/dist/client/assets/{sso-DLX1tDyb.js → sso-BQiNOjXF.js} +1 -1
- package/dist/client/assets/{store-yTIcf52L.js → store-DkONcJaZ.js} +1 -1
- package/dist/client/assets/store-registry-DdExMpCJ.js +2 -0
- package/dist/client/assets/{switch-Cgc8prv4.js → switch-C_oh8iVS.js} +1 -1
- package/dist/client/assets/{table-Guyc6r0i.js → table-Dy93uecr.js} +1 -1
- package/dist/client/assets/{tabs-CbnJ7Xfx.js → tabs-Bnmd0UmR.js} +1 -1
- package/dist/client/assets/{task-status-D5nCekWh.js → task-status-Bn2_Ktxd.js} +1 -1
- package/dist/client/assets/{textarea-CUr0kaZB.js → textarea-Cna17PTh.js} +1 -1
- package/dist/client/assets/{toggle-group-D-Azql3v.js → toggle-group-Cwno-ULj.js} +1 -1
- package/dist/client/assets/{toolbar-DWP3DcTB.js → toolbar-BBemLolp.js} +1 -1
- package/dist/client/assets/{tools-list-Yx20h0-O.js → tools-list-DF6pe9Ta.js} +1 -1
- package/dist/client/assets/{tooltip-BrUaJepM.js → tooltip-Kfr4gA8D.js} +1 -1
- package/dist/client/assets/{types-C22VRq2r.js → types-DLDiONif.js} +1 -1
- package/dist/client/assets/{use-ai-providers-DWeBiBfE.js → use-ai-providers-CewbWKWW.js} +1 -1
- package/dist/client/assets/{use-collections-DBbGR_3H.js → use-collections-JGA7MsfD.js} +1 -1
- package/dist/client/assets/{use-connection-3197jn_F.js → use-connection-IocO3s2Q.js} +1 -1
- package/dist/client/assets/{use-copy-DeOqBGNE.js → use-copy-DQ7SkKXE.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-CDYPVS3p.js → use-create-virtual-mcp-BSfa--sD.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-Blm-Cns4.js → use-debounced-autosave-DWrKZmHW.js} +1 -1
- package/dist/client/assets/{use-delete-connection-CgDNCbAv.js → use-delete-connection-Bg4nH-Nd.js} +1 -1
- package/dist/client/assets/{use-file-configs-CkITamMd.js → use-file-configs-DDjVwmYE.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-C3Cp1KLu.js → use-infinite-scroll-jDpA-_cW.js} +1 -1
- package/dist/client/assets/{use-list-state-D2ojxj9D.js → use-list-state--Z7pVdDS.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-DgIPs9M6.js → use-mcp-prompts-CvpPBs_y.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-DycYaXyV.js → use-mcp-tools-POhiNXdT.js} +1 -1
- package/dist/client/assets/{use-members-XY8cJPkc.js → use-members-cPnrxPK_.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-VrXIL0dL.js → use-navigate-to-agent-DIIPigDX.js} +1 -1
- package/dist/client/assets/{use-org-auth-client--KUUMHp0.js → use-org-auth-client-DOzELmrd.js} +1 -1
- package/dist/client/assets/{use-org-sso-mHvkRXYR.js → use-org-sso-CyDwJDEM.js} +1 -1
- package/dist/client/assets/{use-organization-roles-DvMKsAzI.js → use-organization-roles-CZP0dNKh.js} +1 -1
- package/dist/client/assets/{use-organization-settings-yjaKZxoH.js → use-organization-settings-DJc_W4n4.js} +1 -1
- package/dist/client/assets/{use-registry-connections-CPtKKagv.js → use-registry-connections-SwizXZVX.js} +1 -1
- package/dist/client/assets/{use-secrets-DaKsY9Qa.js → use-secrets-BAD7O6nA.js} +1 -1
- package/dist/client/assets/{use-status-sounds-piyGyRnD.js → use-status-sounds-RHGSJdHR.js} +1 -1
- package/dist/client/assets/{use-view-mode-FiZLQ7H4.js → use-view-mode-isYjr9TL.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-wzufKfmA.js → use-virtual-mcp-D3NBTQSJ.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-CedWd5FM.js +1 -0
- package/dist/client/assets/{useRouterState-C5I8d05V.js → useRouterState-CD2kdIEW.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-Cu6z25rm.js +1 -0
- package/dist/client/assets/{user-CGJGTWyL.js → user-Csugwi5K.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-BV9N1_6z.js → view-mode-toggle-DXRcEzPg.js} +1 -1
- package/dist/client/assets/{workflow-BhGQkDG3.js → workflow-DvcXfyy4.js} +1 -1
- package/dist/client/assets/workflow-detail-BrOvUZpc.js +1 -0
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +1 -1
- package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/esm/generated/root.js +6 -36
- package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/esm/generated/root.js.map +1 -1
- package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/esm/trace/internal.js +0 -15
- package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/esm/trace/internal.js.map +1 -1
- package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/esnext/generated/root.js +6 -36
- package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/esnext/generated/root.js.map +1 -1
- package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/esnext/trace/internal.js +0 -15
- package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/esnext/trace/internal.js.map +1 -1
- package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/src/generated/root.js +6 -36
- package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/src/generated/root.js.map +1 -1
- package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/src/trace/internal.js +0 -15
- package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/src/trace/internal.js.map +1 -1
- package/dist/server/node_modules/@opentelemetry/otlp-transformer/package.json +14 -12
- package/dist/server/node_modules/{pg → pg-connection-string}/LICENSE +3 -3
- package/dist/server/node_modules/pg-connection-string/README.md +105 -0
- package/dist/server/node_modules/pg-connection-string/esm/index.mjs +8 -0
- package/dist/server/node_modules/pg-connection-string/index.d.ts +36 -0
- package/dist/server/node_modules/pg-connection-string/index.js +231 -0
- package/dist/server/node_modules/pg-connection-string/package.json +52 -0
- package/dist/server/node_modules/protobufjs/dist/light/protobuf.js +10 -13
- package/dist/server/node_modules/protobufjs/dist/light/protobuf.js.map +1 -1
- package/dist/server/node_modules/protobufjs/dist/light/protobuf.min.js +3 -3
- package/dist/server/node_modules/protobufjs/dist/light/protobuf.min.js.map +1 -1
- package/dist/server/node_modules/protobufjs/dist/minimal/protobuf.js +2 -2
- package/dist/server/node_modules/protobufjs/dist/minimal/protobuf.min.js +2 -2
- package/dist/server/node_modules/protobufjs/dist/protobuf.js +55 -14
- package/dist/server/node_modules/protobufjs/dist/protobuf.js.map +1 -1
- package/dist/server/node_modules/protobufjs/dist/protobuf.min.js +3 -3
- package/dist/server/node_modules/protobufjs/dist/protobuf.min.js.map +1 -1
- package/dist/server/node_modules/protobufjs/package.json +1 -1
- package/dist/server/node_modules/protobufjs/src/message.js +3 -7
- package/dist/server/node_modules/protobufjs/src/object.js +6 -3
- package/dist/server/node_modules/protobufjs/src/parse.js +45 -1
- package/dist/server/node_modules/protobufjs/src/type.js +0 -1
- package/package.json +1 -1
- package/dist/client/assets/registry-a_Y0eqBG.js +0 -2
- package/dist/client/assets/store-registry-ClO-HCd4.js +0 -2
- package/dist/client/assets/useInfiniteQuery-Dn69KZzX.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CFbzjyFd.js +0 -1
- package/dist/client/assets/workflow-detail-CgGFXY1-.js +0 -1
- package/dist/server/node_modules/pg/README.md +0 -89
- package/dist/server/node_modules/pg/lib/client.js +0 -631
- package/dist/server/node_modules/pg/lib/connection-parameters.js +0 -167
- package/dist/server/node_modules/pg/lib/connection.js +0 -223
- package/dist/server/node_modules/pg/lib/crypto/sasl.js +0 -186
- package/dist/server/node_modules/pg/lib/crypto/utils-legacy.js +0 -37
- package/dist/server/node_modules/pg/lib/crypto/utils-webcrypto.js +0 -83
- package/dist/server/node_modules/pg/lib/crypto/utils.js +0 -9
- package/dist/server/node_modules/pg/lib/defaults.js +0 -84
- package/dist/server/node_modules/pg/lib/index.js +0 -58
- package/dist/server/node_modules/pg/lib/native/client.js +0 -307
- package/dist/server/node_modules/pg/lib/native/index.js +0 -2
- package/dist/server/node_modules/pg/lib/native/query.js +0 -165
- package/dist/server/node_modules/pg/lib/query.js +0 -241
- package/dist/server/node_modules/pg/lib/result.js +0 -107
- package/dist/server/node_modules/pg/lib/stream.js +0 -28
- package/dist/server/node_modules/pg/lib/type-overrides.js +0 -35
- package/dist/server/node_modules/pg/lib/utils.js +0 -204
- package/dist/server/node_modules/pg/package.json +0 -64
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as R,d5 as wl,be as uu,j as J,az as du,ba as mt,d6 as fu,a4 as Zs,a5 as hu,aV as pu,aS as mu,aT as gu,b4 as yu,c$ as bu,ab as ku}from"./index-raVE4iMU.js";function X(n){this.content=n}X.prototype={constructor:X,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,s=r.find(n),i=r.content.slice();return s==-1?i.push(t||n,e):(i[s+1]=e,t&&(i[s]=t)),new X(i)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new X(t)},addToStart:function(n,e){return new X([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new X(t)},addBefore:function(n,e,t){var r=this.remove(e),s=r.content.slice(),i=r.find(n);return s.splice(i==-1?s.length:i,0,e,t),new X(s)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=X.from(n),n.size?new X(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=X.from(n),n.size?new X(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=X.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}};X.from=function(n){if(n instanceof X)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new X(e)};function Ml(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let s=n.child(r),i=e.child(r);if(s==i){t+=s.nodeSize;continue}if(!s.sameMarkup(i))return t;if(s.isText&&s.text!=i.text){for(let o=0;s.text[o]==i.text[o];o++)t++;return t}if(s.content.size||i.content.size){let o=Ml(s.content,i.content,t+1);if(o!=null)return o}t+=s.nodeSize}}function El(n,e,t,r){for(let s=n.childCount,i=e.childCount;;){if(s==0||i==0)return s==i?null:{a:t,b:r};let o=n.child(--s),l=e.child(--i),a=o.nodeSize;if(o==l){t-=a,r-=a;continue}if(!o.sameMarkup(l))return{a:t,b:r};if(o.isText&&o.text!=l.text){let c=0,u=Math.min(o.text.length,l.text.length);for(;c<u&&o.text[o.text.length-c-1]==l.text[l.text.length-c-1];)c++,t--,r--;return{a:t,b:r}}if(o.content.size||l.content.size){let c=El(o.content,l.content,t-1,r-1);if(c)return c}t-=a,r-=a}}class k{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,s=0,i){for(let o=0,l=0;l<t;o++){let a=this.content[o],c=l+a.nodeSize;if(c>e&&r(a,s+l,i||null,o)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,t-u),r,s+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,s){let i="",o=!0;return this.nodesBetween(e,t,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,t-a):l.isLeaf?s?typeof s=="function"?s(l):s:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(o?o=!1:i+=r),i+=c},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,s=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(r)&&(s[s.length-1]=t.withText(t.text+r.text),i=1);i<e.content.length;i++)s.push(e.content[i]);return new k(s,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],s=0;if(t>e)for(let i=0,o=0;o<t;i++){let l=this.content[i],a=o+l.nodeSize;a>e&&((o<e||a>t)&&(l.isText?l=l.cut(Math.max(0,e-o),Math.min(l.text.length,t-o)):l=l.cut(Math.max(0,e-o-1),Math.min(l.content.size,t-o-1))),r.push(l),s+=l.nodeSize),o=a}return new k(r,s)}cutByIndex(e,t){return e==t?k.empty:e==0&&t==this.content.length?this:new k(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let s=this.content.slice(),i=this.size+t.nodeSize-r.nodeSize;return s[e]=t,new k(s,i)}addToStart(e){return new k([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new k(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let s=this.content[t];e(s,r,t),r+=s.nodeSize}}findDiffStart(e,t=0){return Ml(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return El(this,e,t,r)}findIndex(e){if(e==0)return vn(0,e);if(e==this.size)return vn(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,r=0;;t++){let s=this.child(t),i=r+s.nodeSize;if(i>=e)return i==e?vn(t+1,i):vn(t,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return k.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new k(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return k.empty;let t,r=0;for(let s=0;s<e.length;s++){let i=e[s];r+=i.nodeSize,s&&i.isText&&e[s-1].sameMarkup(i)?(t||(t=e.slice(0,s)),t[t.length-1]=i.withText(t[t.length-1].text+i.text)):t&&t.push(i)}return new k(t||e,r)}static from(e){if(!e)return k.empty;if(e instanceof k)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new k([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}k.empty=new k([],0);const Jr={index:0,offset:0};function vn(n,e){return Jr.index=n,Jr.offset=e,Jr}function Wn(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!Wn(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!Wn(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let B=class Cs{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let s=0;s<e.length;s++){let i=e[s];if(this.eq(i))return e;if(this.type.excludes(i.type))t||(t=e.slice(0,s));else{if(i.type.excludes(this.type))return e;!r&&i.type.rank>this.type.rank&&(t||(t=e.slice(0,s)),t.push(this),r=!0),t&&t.push(i)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Wn(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);let s=r.create(t.attrs);return r.checkAttrs(s.attrs),s}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Cs.none;if(e instanceof Cs)return[e];let t=e.slice();return t.sort((r,s)=>r.type.rank-s.type.rank),t}};B.none=[];class qn extends Error{}class w{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=vl(this.content,e+this.openStart,t);return r&&new w(r,this.openStart,this.openEnd)}removeBetween(e,t){return new w(Tl(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return w.empty;let r=t.openStart||0,s=t.openEnd||0;if(typeof r!="number"||typeof s!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new w(k.fromJSON(e,t.content),r,s)}static maxOpen(e,t=!0){let r=0,s=0;for(let i=e.firstChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.lastChild)s++;return new w(e,r,s)}}w.empty=new w(k.empty,0,0);function Tl(n,e,t){let{index:r,offset:s}=n.findIndex(e),i=n.maybeChild(r),{index:o,offset:l}=n.findIndex(t);if(s==e||i.isText){if(l!=t&&!n.child(o).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=o)throw new RangeError("Removing non-flat range");return n.replaceChild(r,i.copy(Tl(i.content,e-s-1,t-s-1)))}function vl(n,e,t,r){let{index:s,offset:i}=n.findIndex(e),o=n.maybeChild(s);if(i==e||o.isText)return r&&!r.canReplace(s,s,t)?null:n.cut(0,e).append(t).append(n.cut(e));let l=vl(o.content,e-i-1,t,o);return l&&n.replaceChild(s,o.copy(l))}function xu(n,e,t){if(t.openStart>n.depth)throw new qn("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new qn("Inconsistent open depths");return Al(n,e,t,0)}function Al(n,e,t,r){let s=n.index(r),i=n.node(r);if(s==e.index(r)&&r<n.depth-t.openStart){let o=Al(n,e,t,r+1);return i.copy(i.content.replaceChild(s,o))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let o=n.parent,l=o.content;return dt(o,l.cut(0,n.parentOffset).append(t.content).append(l.cut(e.parentOffset)))}else{let{start:o,end:l}=Su(t,n);return dt(i,Ol(n,o,l,e,r))}else return dt(i,Un(n,e,r))}function Nl(n,e){if(!e.type.compatibleContent(n.type))throw new qn("Cannot join "+e.type.name+" onto "+n.type.name)}function ws(n,e,t){let r=n.node(t);return Nl(r,e.node(t)),r}function ut(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function en(n,e,t,r){let s=(e||n).node(t),i=0,o=e?e.index(t):s.childCount;n&&(i=n.index(t),n.depth>t?i++:n.textOffset&&(ut(n.nodeAfter,r),i++));for(let l=i;l<o;l++)ut(s.child(l),r);e&&e.depth==t&&e.textOffset&&ut(e.nodeBefore,r)}function dt(n,e){return n.type.checkContent(e),n.copy(e)}function Ol(n,e,t,r,s){let i=n.depth>s&&ws(n,e,s+1),o=r.depth>s&&ws(t,r,s+1),l=[];return en(null,n,s,l),i&&o&&e.index(s)==t.index(s)?(Nl(i,o),ut(dt(i,Ol(n,e,t,r,s+1)),l)):(i&&ut(dt(i,Un(n,e,s+1)),l),en(e,t,s,l),o&&ut(dt(o,Un(t,r,s+1)),l)),en(r,null,s,l),new k(l)}function Un(n,e,t){let r=[];if(en(null,n,t,r),n.depth>t){let s=ws(n,e,t+1);ut(dt(s,Un(n,e,t+1)),r)}return en(e,null,t,r),new k(r)}function Su(n,e){let t=e.depth-n.openStart,s=e.node(t).copy(n.content);for(let i=t-1;i>=0;i--)s=e.node(i).copy(k.from(s));return{start:s.resolveNoCache(n.openStart+t),end:s.resolveNoCache(s.content.size-n.openEnd-t)}}class fn{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],s=e.child(t);return r?e.child(t).cut(r):s}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],s=t==0?0:this.path[t*3-1]+1;for(let i=0;i<e;i++)s+=r.child(i).nodeSize;return s}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return B.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),s=e.maybeChild(t);if(!r){let l=r;r=s,s=l}let i=r.marks;for(var o=0;o<i.length;o++)i[o].type.spec.inclusive===!1&&(!s||!i[o].isInSet(s.marks))&&(i=i[o--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,s=e.parent.maybeChild(e.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!s||!r[i].isInSet(s.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new Kn(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],s=0,i=t;for(let o=e;;){let{index:l,offset:a}=o.content.findIndex(i),c=i-a;if(r.push(o,l,s+a),!c||(o=o.child(l),o.isText))break;i=c-1,s+=a+1}return new fn(t,r,i)}static resolveCached(e,t){let r=Wi.get(e);if(r)for(let i=0;i<r.elts.length;i++){let o=r.elts[i];if(o.pos==t)return o}else Wi.set(e,r=new Cu);let s=r.elts[r.i]=fn.resolve(e,t);return r.i=(r.i+1)%wu,s}}class Cu{constructor(){this.elts=[],this.i=0}}const wu=12,Wi=new WeakMap;class Kn{constructor(e,t,r){this.$from=e,this.$to=t,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const Mu=Object.create(null);class we{constructor(e,t,r,s=B.none){this.type=e,this.attrs=t,this.marks=s,this.content=r||k.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,r,s=0){this.content.nodesBetween(e,t,r,s,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,r,s){return this.content.textBetween(e,t,r,s)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,r){return this.type==e&&Wn(this.attrs,t||e.defaultAttrs||Mu)&&B.sameSet(this.marks,r||B.none)}copy(e=null){return e==this.content?this:new we(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new we(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return w.empty;let s=this.resolve(e),i=this.resolve(t),o=r?0:s.sharedDepth(t),l=s.start(o),c=s.node(o).content.cut(s.pos-l,i.pos-l);return new w(c,s.depth-o,i.depth-o)}replace(e,t,r){return xu(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:s}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(s==e||t.isText)return t;e-=s+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let s=this.content.child(t-1);return{node:s,index:t-1,offset:r-s.nodeSize}}resolve(e){return fn.resolveCached(this,e)}resolveNoCache(e){return fn.resolve(this,e)}rangeHasMark(e,t,r){let s=!1;return t>e&&this.nodesBetween(e,t,i=>(r.isInSet(i.marks)&&(s=!0),!s)),s}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Dl(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=k.empty,s=0,i=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,s,i),l=o&&o.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let a=s;a<i;a++)if(!this.type.allowsMarks(r.child(a).marks))return!1;return!0}canReplaceWith(e,t,r,s){if(s&&!this.type.allowsMarks(s))return!1;let i=this.contentMatchAt(e).matchType(r),o=i&&i.matchFragment(this.content,t);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=B.none;for(let t=0;t<this.marks.length;t++){let r=this.marks[t];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!B.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let s=k.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,s,r);return i.type.checkAttrs(i.attrs),i}}we.prototype.text=void 0;class Jn extends we{constructor(e,t,r,s){if(super(e,t,null,s),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Dl(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Jn(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Jn(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Dl(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class gt{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new Eu(e,t);if(r.next==null)return gt.empty;let s=Il(r);r.next&&r.err("Unexpected trailing text");let i=Iu(Du(s));return Ru(i,r),i}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let s=this;for(let i=t;s&&i<r;i++)s=s.matchType(e.child(i).type);return s}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let s=[this];function i(o,l){let a=o.matchFragment(e,r);if(a&&(!t||a.validEnd))return k.from(l.map(c=>c.createAndFill()));for(let c=0;c<o.next.length;c++){let{type:u,next:d}=o.next[c];if(!(u.isText||u.hasRequiredAttrs())&&s.indexOf(d)==-1){s.push(d);let f=i(d,l.concat(u));if(f)return f}}return null}return i(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let s=r.shift(),i=s.match;if(i.matchType(e)){let o=[];for(let l=s;l.type;l=l.via)o.push(l.type);return o.reverse()}for(let o=0;o<i.next.length;o++){let{type:l,next:a}=i.next[o];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in t)&&(!s.type||a.validEnd)&&(r.push({match:l.contentMatch,type:l,via:s}),t[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(r){e.push(r);for(let s=0;s<r.next.length;s++)e.indexOf(r.next[s].next)==-1&&t(r.next[s].next)}return t(this),e.map((r,s)=>{let i=s+(r.validEnd?"*":" ")+" ";for(let o=0;o<r.next.length;o++)i+=(o?", ":"")+r.next[o].type.name+"->"+e.indexOf(r.next[o].next);return i}).join(`
|
|
1
|
+
import{r as R,d5 as wl,be as uu,j as J,az as du,ba as mt,d6 as fu,a4 as Zs,a5 as hu,aV as pu,aS as mu,aT as gu,b4 as yu,c$ as bu,ab as ku}from"./index-Bf7aO1A-.js";function X(n){this.content=n}X.prototype={constructor:X,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,s=r.find(n),i=r.content.slice();return s==-1?i.push(t||n,e):(i[s+1]=e,t&&(i[s]=t)),new X(i)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new X(t)},addToStart:function(n,e){return new X([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new X(t)},addBefore:function(n,e,t){var r=this.remove(e),s=r.content.slice(),i=r.find(n);return s.splice(i==-1?s.length:i,0,e,t),new X(s)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=X.from(n),n.size?new X(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=X.from(n),n.size?new X(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=X.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}};X.from=function(n){if(n instanceof X)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new X(e)};function Ml(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let s=n.child(r),i=e.child(r);if(s==i){t+=s.nodeSize;continue}if(!s.sameMarkup(i))return t;if(s.isText&&s.text!=i.text){for(let o=0;s.text[o]==i.text[o];o++)t++;return t}if(s.content.size||i.content.size){let o=Ml(s.content,i.content,t+1);if(o!=null)return o}t+=s.nodeSize}}function El(n,e,t,r){for(let s=n.childCount,i=e.childCount;;){if(s==0||i==0)return s==i?null:{a:t,b:r};let o=n.child(--s),l=e.child(--i),a=o.nodeSize;if(o==l){t-=a,r-=a;continue}if(!o.sameMarkup(l))return{a:t,b:r};if(o.isText&&o.text!=l.text){let c=0,u=Math.min(o.text.length,l.text.length);for(;c<u&&o.text[o.text.length-c-1]==l.text[l.text.length-c-1];)c++,t--,r--;return{a:t,b:r}}if(o.content.size||l.content.size){let c=El(o.content,l.content,t-1,r-1);if(c)return c}t-=a,r-=a}}class k{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,s=0,i){for(let o=0,l=0;l<t;o++){let a=this.content[o],c=l+a.nodeSize;if(c>e&&r(a,s+l,i||null,o)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,t-u),r,s+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,s){let i="",o=!0;return this.nodesBetween(e,t,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,t-a):l.isLeaf?s?typeof s=="function"?s(l):s:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(o?o=!1:i+=r),i+=c},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,s=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(r)&&(s[s.length-1]=t.withText(t.text+r.text),i=1);i<e.content.length;i++)s.push(e.content[i]);return new k(s,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],s=0;if(t>e)for(let i=0,o=0;o<t;i++){let l=this.content[i],a=o+l.nodeSize;a>e&&((o<e||a>t)&&(l.isText?l=l.cut(Math.max(0,e-o),Math.min(l.text.length,t-o)):l=l.cut(Math.max(0,e-o-1),Math.min(l.content.size,t-o-1))),r.push(l),s+=l.nodeSize),o=a}return new k(r,s)}cutByIndex(e,t){return e==t?k.empty:e==0&&t==this.content.length?this:new k(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let s=this.content.slice(),i=this.size+t.nodeSize-r.nodeSize;return s[e]=t,new k(s,i)}addToStart(e){return new k([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new k(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let s=this.content[t];e(s,r,t),r+=s.nodeSize}}findDiffStart(e,t=0){return Ml(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return El(this,e,t,r)}findIndex(e){if(e==0)return vn(0,e);if(e==this.size)return vn(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,r=0;;t++){let s=this.child(t),i=r+s.nodeSize;if(i>=e)return i==e?vn(t+1,i):vn(t,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return k.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new k(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return k.empty;let t,r=0;for(let s=0;s<e.length;s++){let i=e[s];r+=i.nodeSize,s&&i.isText&&e[s-1].sameMarkup(i)?(t||(t=e.slice(0,s)),t[t.length-1]=i.withText(t[t.length-1].text+i.text)):t&&t.push(i)}return new k(t||e,r)}static from(e){if(!e)return k.empty;if(e instanceof k)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new k([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}k.empty=new k([],0);const Jr={index:0,offset:0};function vn(n,e){return Jr.index=n,Jr.offset=e,Jr}function Wn(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!Wn(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!Wn(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let B=class Cs{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let s=0;s<e.length;s++){let i=e[s];if(this.eq(i))return e;if(this.type.excludes(i.type))t||(t=e.slice(0,s));else{if(i.type.excludes(this.type))return e;!r&&i.type.rank>this.type.rank&&(t||(t=e.slice(0,s)),t.push(this),r=!0),t&&t.push(i)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Wn(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);let s=r.create(t.attrs);return r.checkAttrs(s.attrs),s}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Cs.none;if(e instanceof Cs)return[e];let t=e.slice();return t.sort((r,s)=>r.type.rank-s.type.rank),t}};B.none=[];class qn extends Error{}class w{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=vl(this.content,e+this.openStart,t);return r&&new w(r,this.openStart,this.openEnd)}removeBetween(e,t){return new w(Tl(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return w.empty;let r=t.openStart||0,s=t.openEnd||0;if(typeof r!="number"||typeof s!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new w(k.fromJSON(e,t.content),r,s)}static maxOpen(e,t=!0){let r=0,s=0;for(let i=e.firstChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.lastChild)s++;return new w(e,r,s)}}w.empty=new w(k.empty,0,0);function Tl(n,e,t){let{index:r,offset:s}=n.findIndex(e),i=n.maybeChild(r),{index:o,offset:l}=n.findIndex(t);if(s==e||i.isText){if(l!=t&&!n.child(o).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=o)throw new RangeError("Removing non-flat range");return n.replaceChild(r,i.copy(Tl(i.content,e-s-1,t-s-1)))}function vl(n,e,t,r){let{index:s,offset:i}=n.findIndex(e),o=n.maybeChild(s);if(i==e||o.isText)return r&&!r.canReplace(s,s,t)?null:n.cut(0,e).append(t).append(n.cut(e));let l=vl(o.content,e-i-1,t,o);return l&&n.replaceChild(s,o.copy(l))}function xu(n,e,t){if(t.openStart>n.depth)throw new qn("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new qn("Inconsistent open depths");return Al(n,e,t,0)}function Al(n,e,t,r){let s=n.index(r),i=n.node(r);if(s==e.index(r)&&r<n.depth-t.openStart){let o=Al(n,e,t,r+1);return i.copy(i.content.replaceChild(s,o))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let o=n.parent,l=o.content;return dt(o,l.cut(0,n.parentOffset).append(t.content).append(l.cut(e.parentOffset)))}else{let{start:o,end:l}=Su(t,n);return dt(i,Ol(n,o,l,e,r))}else return dt(i,Un(n,e,r))}function Nl(n,e){if(!e.type.compatibleContent(n.type))throw new qn("Cannot join "+e.type.name+" onto "+n.type.name)}function ws(n,e,t){let r=n.node(t);return Nl(r,e.node(t)),r}function ut(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function en(n,e,t,r){let s=(e||n).node(t),i=0,o=e?e.index(t):s.childCount;n&&(i=n.index(t),n.depth>t?i++:n.textOffset&&(ut(n.nodeAfter,r),i++));for(let l=i;l<o;l++)ut(s.child(l),r);e&&e.depth==t&&e.textOffset&&ut(e.nodeBefore,r)}function dt(n,e){return n.type.checkContent(e),n.copy(e)}function Ol(n,e,t,r,s){let i=n.depth>s&&ws(n,e,s+1),o=r.depth>s&&ws(t,r,s+1),l=[];return en(null,n,s,l),i&&o&&e.index(s)==t.index(s)?(Nl(i,o),ut(dt(i,Ol(n,e,t,r,s+1)),l)):(i&&ut(dt(i,Un(n,e,s+1)),l),en(e,t,s,l),o&&ut(dt(o,Un(t,r,s+1)),l)),en(r,null,s,l),new k(l)}function Un(n,e,t){let r=[];if(en(null,n,t,r),n.depth>t){let s=ws(n,e,t+1);ut(dt(s,Un(n,e,t+1)),r)}return en(e,null,t,r),new k(r)}function Su(n,e){let t=e.depth-n.openStart,s=e.node(t).copy(n.content);for(let i=t-1;i>=0;i--)s=e.node(i).copy(k.from(s));return{start:s.resolveNoCache(n.openStart+t),end:s.resolveNoCache(s.content.size-n.openEnd-t)}}class fn{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],s=e.child(t);return r?e.child(t).cut(r):s}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],s=t==0?0:this.path[t*3-1]+1;for(let i=0;i<e;i++)s+=r.child(i).nodeSize;return s}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return B.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),s=e.maybeChild(t);if(!r){let l=r;r=s,s=l}let i=r.marks;for(var o=0;o<i.length;o++)i[o].type.spec.inclusive===!1&&(!s||!i[o].isInSet(s.marks))&&(i=i[o--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,s=e.parent.maybeChild(e.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!s||!r[i].isInSet(s.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new Kn(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],s=0,i=t;for(let o=e;;){let{index:l,offset:a}=o.content.findIndex(i),c=i-a;if(r.push(o,l,s+a),!c||(o=o.child(l),o.isText))break;i=c-1,s+=a+1}return new fn(t,r,i)}static resolveCached(e,t){let r=Wi.get(e);if(r)for(let i=0;i<r.elts.length;i++){let o=r.elts[i];if(o.pos==t)return o}else Wi.set(e,r=new Cu);let s=r.elts[r.i]=fn.resolve(e,t);return r.i=(r.i+1)%wu,s}}class Cu{constructor(){this.elts=[],this.i=0}}const wu=12,Wi=new WeakMap;class Kn{constructor(e,t,r){this.$from=e,this.$to=t,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const Mu=Object.create(null);class we{constructor(e,t,r,s=B.none){this.type=e,this.attrs=t,this.marks=s,this.content=r||k.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,r,s=0){this.content.nodesBetween(e,t,r,s,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,r,s){return this.content.textBetween(e,t,r,s)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,r){return this.type==e&&Wn(this.attrs,t||e.defaultAttrs||Mu)&&B.sameSet(this.marks,r||B.none)}copy(e=null){return e==this.content?this:new we(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new we(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return w.empty;let s=this.resolve(e),i=this.resolve(t),o=r?0:s.sharedDepth(t),l=s.start(o),c=s.node(o).content.cut(s.pos-l,i.pos-l);return new w(c,s.depth-o,i.depth-o)}replace(e,t,r){return xu(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:s}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(s==e||t.isText)return t;e-=s+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let s=this.content.child(t-1);return{node:s,index:t-1,offset:r-s.nodeSize}}resolve(e){return fn.resolveCached(this,e)}resolveNoCache(e){return fn.resolve(this,e)}rangeHasMark(e,t,r){let s=!1;return t>e&&this.nodesBetween(e,t,i=>(r.isInSet(i.marks)&&(s=!0),!s)),s}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Dl(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=k.empty,s=0,i=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,s,i),l=o&&o.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let a=s;a<i;a++)if(!this.type.allowsMarks(r.child(a).marks))return!1;return!0}canReplaceWith(e,t,r,s){if(s&&!this.type.allowsMarks(s))return!1;let i=this.contentMatchAt(e).matchType(r),o=i&&i.matchFragment(this.content,t);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=B.none;for(let t=0;t<this.marks.length;t++){let r=this.marks[t];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!B.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let s=k.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,s,r);return i.type.checkAttrs(i.attrs),i}}we.prototype.text=void 0;class Jn extends we{constructor(e,t,r,s){if(super(e,t,null,s),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Dl(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Jn(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Jn(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Dl(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class gt{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new Eu(e,t);if(r.next==null)return gt.empty;let s=Il(r);r.next&&r.err("Unexpected trailing text");let i=Iu(Du(s));return Ru(i,r),i}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let s=this;for(let i=t;s&&i<r;i++)s=s.matchType(e.child(i).type);return s}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let s=[this];function i(o,l){let a=o.matchFragment(e,r);if(a&&(!t||a.validEnd))return k.from(l.map(c=>c.createAndFill()));for(let c=0;c<o.next.length;c++){let{type:u,next:d}=o.next[c];if(!(u.isText||u.hasRequiredAttrs())&&s.indexOf(d)==-1){s.push(d);let f=i(d,l.concat(u));if(f)return f}}return null}return i(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let s=r.shift(),i=s.match;if(i.matchType(e)){let o=[];for(let l=s;l.type;l=l.via)o.push(l.type);return o.reverse()}for(let o=0;o<i.next.length;o++){let{type:l,next:a}=i.next[o];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in t)&&(!s.type||a.validEnd)&&(r.push({match:l.contentMatch,type:l,via:s}),t[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(r){e.push(r);for(let s=0;s<r.next.length;s++)e.indexOf(r.next[s].next)==-1&&t(r.next[s].next)}return t(this),e.map((r,s)=>{let i=s+(r.validEnd?"*":" ")+" ";for(let o=0;o<r.next.length;o++)i+=(o?", ":"")+r.next[o].type.name+"->"+e.indexOf(r.next[o].next);return i}).join(`
|
|
2
2
|
`)}}gt.empty=new gt(!0);class Eu{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function Il(n){let e=[];do e.push(Tu(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Tu(n){let e=[];do e.push(vu(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function vu(n){let e=Ou(n);for(;;)if(n.eat("+"))e={type:"plus",expr:e};else if(n.eat("*"))e={type:"star",expr:e};else if(n.eat("?"))e={type:"opt",expr:e};else if(n.eat("{"))e=Au(n,e);else break;return e}function qi(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function Au(n,e){let t=qi(n),r=t;return n.eat(",")&&(n.next!="}"?r=qi(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function Nu(n,e){let t=n.nodeTypes,r=t[e];if(r)return[r];let s=[];for(let i in t){let o=t[i];o.isInGroup(e)&&s.push(o)}return s.length==0&&n.err("No node type or group '"+e+"' found"),s}function Ou(n){if(n.eat("(")){let e=Il(n);return n.eat(")")||n.err("Missing closing paren"),e}else if(/\W/.test(n.next))n.err("Unexpected token '"+n.next+"'");else{let e=Nu(n,n.next).map(t=>(n.inline==null?n.inline=t.isInline:n.inline!=t.isInline&&n.err("Mixing inline and block content"),{type:"name",value:t}));return n.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function Du(n){let e=[[]];return s(i(n,0),t()),e;function t(){return e.push([])-1}function r(o,l,a){let c={term:a,to:l};return e[o].push(c),c}function s(o,l){o.forEach(a=>a.to=l)}function i(o,l){if(o.type=="choice")return o.exprs.reduce((a,c)=>a.concat(i(c,l)),[]);if(o.type=="seq")for(let a=0;;a++){let c=i(o.exprs[a],l);if(a==o.exprs.length-1)return c;s(c,l=t())}else if(o.type=="star"){let a=t();return r(l,a),s(i(o.expr,a),a),[r(a)]}else if(o.type=="plus"){let a=t();return s(i(o.expr,l),a),s(i(o.expr,a),a),[r(a)]}else{if(o.type=="opt")return[r(l)].concat(i(o.expr,l));if(o.type=="range"){let a=l;for(let c=0;c<o.min;c++){let u=t();s(i(o.expr,a),u),a=u}if(o.max==-1)s(i(o.expr,a),a);else for(let c=o.min;c<o.max;c++){let u=t();r(a,u),s(i(o.expr,a),u),a=u}return[r(a)]}else{if(o.type=="name")return[r(l,void 0,o.value)];throw new Error("Unknown expr type")}}}}function Rl(n,e){return e-n}function Ui(n,e){let t=[];return r(e),t.sort(Rl);function r(s){let i=n[s];if(i.length==1&&!i[0].term)return r(i[0].to);t.push(s);for(let o=0;o<i.length;o++){let{term:l,to:a}=i[o];!l&&t.indexOf(a)==-1&&r(a)}}}function Iu(n){let e=Object.create(null);return t(Ui(n,0));function t(r){let s=[];r.forEach(o=>{n[o].forEach(({term:l,to:a})=>{if(!l)return;let c;for(let u=0;u<s.length;u++)s[u][0]==l&&(c=s[u][1]);Ui(n,a).forEach(u=>{c||s.push([l,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let i=e[r.join(",")]=new gt(r.indexOf(n.length-1)>-1);for(let o=0;o<s.length;o++){let l=s[o][1].sort(Rl);i.next.push({type:s[o][0],next:e[l.join(",")]||t(l)})}return i}}function Ru(n,e){for(let t=0,r=[n];t<r.length;t++){let s=r[t],i=!s.validEnd,o=[];for(let l=0;l<s.next.length;l++){let{type:a,next:c}=s.next[l];o.push(a.name),i&&!(a.isText||a.hasRequiredAttrs())&&(i=!1),r.indexOf(c)==-1&&r.push(c)}i&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Pl(n){let e=Object.create(null);for(let t in n){let r=n[t];if(!r.hasDefault)return null;e[t]=r.default}return e}function Ll(n,e){let t=Object.create(null);for(let r in n){let s=e&&e[r];if(s===void 0){let i=n[r];if(i.hasDefault)s=i.default;else throw new RangeError("No value supplied for attribute "+r)}t[r]=s}return t}function Bl(n,e,t,r){for(let s in e)if(!(s in n))throw new RangeError(`Unsupported attribute ${s} for ${t} of type ${s}`);for(let s in n){let i=n[s];i.validate&&i.validate(e[s])}}function zl(n,e){let t=Object.create(null);if(e)for(let r in e)t[r]=new Lu(n,r,e[r]);return t}let Ki=class $l{constructor(e,t,r){this.name=e,this.schema=t,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=zl(e,r.attrs),this.defaultAttrs=Pl(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==gt.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Ll(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new we(this,this.computeAttrs(e),k.from(t),B.setFrom(r))}createChecked(e=null,t,r){return t=k.from(t),this.checkContent(t),new we(this,this.computeAttrs(e),t,B.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),t=k.from(t),t.size){let o=this.contentMatch.fillBefore(t);if(!o)return null;t=o.append(t)}let s=this.contentMatch.matchFragment(t),i=s&&s.fillBefore(k.empty,!0);return i?new we(this,e,t.append(i),B.setFrom(r)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){Bl(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?t&&t.push(e[r]):t||(t=e.slice(0,r));return t?t.length?t:B.none:e}static compile(e,t){let r=Object.create(null);e.forEach((i,o)=>r[i]=new $l(i,t,o));let s=t.spec.topNode||"doc";if(!r[s])throw new RangeError("Schema is missing its top node type ('"+s+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let i in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function Pu(n,e,t){let r=t.split("|");return s=>{let i=s===null?"null":typeof s;if(r.indexOf(i)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${n}, got ${i}`)}}class Lu{constructor(e,t,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?Pu(e,t,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Ir{constructor(e,t,r,s){this.name=e,this.rank=t,this.schema=r,this.spec=s,this.attrs=zl(e,s.attrs),this.excluded=null;let i=Pl(this.attrs);this.instance=i?new B(this,i):null}create(e=null){return!e&&this.instance?this.instance:new B(this,Ll(this.attrs,e))}static compile(e,t){let r=Object.create(null),s=0;return e.forEach((i,o)=>r[i]=new Ir(i,s++,t,o)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){Bl(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class Fl{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let s in e)t[s]=e[s];t.nodes=X.from(e.nodes),t.marks=X.from(e.marks||{}),this.nodes=Ki.compile(this.spec.nodes,this),this.marks=Ir.compile(this.spec.marks,this);let r=Object.create(null);for(let s in this.nodes){if(s in this.marks)throw new RangeError(s+" can not be both a node and a mark");let i=this.nodes[s],o=i.spec.content||"",l=i.spec.marks;if(i.contentMatch=r[o]||(r[o]=gt.parse(o,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!i.isInline||!i.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=i}i.markSet=l=="_"?null:l?Ji(this,l.split(" ")):l==""||!i.inlineContent?[]:null}for(let s in this.marks){let i=this.marks[s],o=i.spec.excludes;i.excluded=o==null?[i]:o==""?[]:Ji(this,o.split(" "))}this.nodeFromJSON=s=>we.fromJSON(this,s),this.markFromJSON=s=>B.fromJSON(this,s),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,r,s){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Ki){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(t,r,s)}text(e,t){let r=this.nodes.text;return new Jn(r,r.defaultAttrs,e,B.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function Ji(n,e){let t=[];for(let r=0;r<e.length;r++){let s=e[r],i=n.marks[s],o=i;if(i)t.push(i);else for(let l in n.marks){let a=n.marks[l];(s=="_"||a.spec.group&&a.spec.group.split(" ").indexOf(s)>-1)&&t.push(o=a)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return t}function Bu(n){return n.tag!=null}function zu(n){return n.style!=null}class Ge{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let r=this.matchedStyles=[];t.forEach(s=>{if(Bu(s))this.tags.push(s);else if(zu(s)){let i=/[^=]*/.exec(s.style)[0];r.indexOf(i)<0&&r.push(i),this.styles.push(s)}}),this.normalizeLists=!this.tags.some(s=>{if(!/^(ul|ol)\b/.test(s.tag)||!s.node)return!1;let i=e.nodes[s.node];return i.contentMatch.matchType(i)})}parse(e,t={}){let r=new Yi(this,t,!1);return r.addAll(e,B.none,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new Yi(this,t,!0);return r.addAll(e,B.none,t.from,t.to),w.maxOpen(r.finish())}matchTag(e,t,r){for(let s=r?this.tags.indexOf(r)+1:0;s<this.tags.length;s++){let i=this.tags[s];if(Vu(e,i.tag)&&(i.namespace===void 0||e.namespaceURI==i.namespace)&&(!i.context||t.matchesContext(i.context))){if(i.getAttrs){let o=i.getAttrs(e);if(o===!1)continue;i.attrs=o||void 0}return i}}}matchStyle(e,t,r,s){for(let i=s?this.styles.indexOf(s)+1:0;i<this.styles.length;i++){let o=this.styles[i],l=o.style;if(!(l.indexOf(e)!=0||o.context&&!r.matchesContext(o.context)||l.length>e.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=t))){if(o.getAttrs){let a=o.getAttrs(t);if(a===!1)continue;o.attrs=a||void 0}return o}}}static schemaRules(e){let t=[];function r(s){let i=s.priority==null?50:s.priority,o=0;for(;o<t.length;o++){let l=t[o];if((l.priority==null?50:l.priority)<i)break}t.splice(o,0,s)}for(let s in e.marks){let i=e.marks[s].spec.parseDOM;i&&i.forEach(o=>{r(o=Xi(o)),o.mark||o.ignore||o.clearMark||(o.mark=s)})}for(let s in e.nodes){let i=e.nodes[s].spec.parseDOM;i&&i.forEach(o=>{r(o=Xi(o)),o.node||o.ignore||o.mark||(o.node=s)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Ge(e,Ge.schemaRules(e)))}}const Vl={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},$u={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},_l={ol:!0,ul:!0},hn=1,Ms=2,tn=4;function Gi(n,e,t){return e!=null?(e?hn:0)|(e==="full"?Ms:0):n&&n.whitespace=="pre"?hn|Ms:t&~tn}class An{constructor(e,t,r,s,i,o){this.type=e,this.attrs=t,this.marks=r,this.solid=s,this.options=o,this.content=[],this.activeMarks=B.none,this.match=i||(o&tn?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(k.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let r=this.type.contentMatch,s;return(s=r.findWrapping(e.type))?(this.match=r,s):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&hn)){let r=this.content[this.content.length-1],s;if(r&&r.isText&&(s=/[ \t\r\n\u000c]+$/.exec(r.text))){let i=r;r.text.length==s[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-s[0].length))}}let t=k.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(k.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Vl.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Yi{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let s=t.topNode,i,o=Gi(null,t.preserveWhitespace,0)|(r?tn:0);s?i=new An(s.type,s.attrs,B.none,!0,t.topMatch||s.type.contentMatch,o):r?i=new An(null,null,B.none,!0,null,o):i=new An(e.schema.topNodeType,null,B.none,!0,null,o),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let r=e.nodeValue,s=this.top,i=s.options&Ms?"full":this.localPreserveWS||(s.options&hn)>0,{schema:o}=this.parser;if(i==="full"||s.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(i)if(i==="full")r=r.replace(/\r\n?/g,`
|
|
3
3
|
`);else if(o.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(o.linebreakReplacement.create())){let l=r.split(/\r?\n|\r/);for(let a=0;a<l.length;a++)a&&this.insertNode(o.linebreakReplacement.create(),t,!0),l[a]&&this.insertNode(o.text(l[a]),t,!/\S/.test(l[a]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let l=s.content[s.content.length-1],a=e.previousSibling;(!l||a&&a.nodeName=="BR"||l.isText&&/[ \t\r\n\u000c]$/.test(l.text))&&(r=r.slice(1))}r&&this.insertNode(o.text(r),t,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,t,r){let s=this.localPreserveWS,i=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),l;_l.hasOwnProperty(o)&&this.parser.normalizeLists&&Fu(e);let a=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(l=this.parser.matchTag(e,this,r));e:if(a?a.ignore:$u.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,t);else if(!a||a.skip||a.closeParent){a&&a.closeParent?this.open=Math.max(0,this.open-1):a&&a.skip.nodeType&&(e=a.skip);let c,u=this.needsBlock;if(Vl.hasOwnProperty(o))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),c=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let d=a&&a.skip?t:this.readStyles(e,t);d&&this.addAll(e,d),c&&this.sync(i),this.needsBlock=u}else{let c=this.readStyles(e,t);c&&this.addElementByRule(e,a,c,a.consuming===!1?l:void 0)}this.localPreserveWS=s}leafFallback(e,t){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
4
4
|
`),t)}ignoreFallback(e,t){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),t,!0)}readStyles(e,t){let r=e.style;if(r&&r.length)for(let s=0;s<this.parser.matchedStyles.length;s++){let i=this.parser.matchedStyles[s],o=r.getPropertyValue(i);if(o)for(let l=void 0;;){let a=this.parser.matchStyle(i,o,this,l);if(!a)break;if(a.ignore)return null;if(a.clearMark?t=t.filter(c=>!a.clearMark(c)):t=t.concat(this.parser.schema.marks[a.mark].create(a.attrs)),a.consuming===!1)l=a;else break}}return t}addElementByRule(e,t,r,s){let i,o;if(t.node)if(o=this.parser.schema.nodes[t.node],o.isLeaf)this.insertNode(o.create(t.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let a=this.enter(o,t.attrs||null,r,t.preserveWhitespace);a&&(i=!0,r=a)}else{let a=this.parser.schema.marks[t.mark];r=r.concat(a.create(t.attrs))}let l=this.top;if(o&&o.isLeaf)this.findInside(e);else if(s)this.addElement(e,r,s);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(a=>this.insertNode(a,r,!1));else{let a=e;typeof t.contentElement=="string"?a=e.querySelector(t.contentElement):typeof t.contentElement=="function"?a=t.contentElement(e):t.contentElement&&(a=t.contentElement),this.findAround(e,a,!0),this.addAll(a,r),this.findAround(e,a,!1)}i&&this.sync(l)&&this.open--}addAll(e,t,r,s){let i=r||0;for(let o=r?e.childNodes[r]:e.firstChild,l=s==null?null:e.childNodes[s];o!=l;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o,t);this.findAtPoint(e,i)}findPlace(e,t,r){let s,i;for(let o=this.open,l=0;o>=0;o--){let a=this.nodes[o],c=a.findWrapping(e);if(c&&(!s||s.length>c.length+l)&&(s=c,i=a,!c.length))break;if(a.solid){if(r)break;l+=2}}if(!s)return null;this.sync(i);for(let o=0;o<s.length;o++)t=this.enterInner(s[o],null,t,!1);return t}insertNode(e,t,r){if(e.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(t=this.enterInner(i,null,t))}let s=this.findPlace(e,t,r);if(s){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(e.type));let o=B.none;for(let l of s.concat(e.marks))(i.type?i.type.allowsMarkType(l.type):Qi(l.type,e.type))&&(o=l.addToSet(o));return i.content.push(e.mark(o)),!0}return!1}enter(e,t,r,s){let i=this.findPlace(e.create(t),r,!1);return i&&(i=this.enterInner(e,t,r,!0,s)),i}enterInner(e,t,r,s=!1,i){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let l=Gi(e,i,o.options);o.options&tn&&o.content.length==0&&(l|=tn);let a=B.none;return r=r.filter(c=>(o.type?o.type.allowsMarkType(c.type):Qi(c.type,e))?(a=c.addToSet(a),!1):!0),this.nodes.push(new An(e,t,a,s,null,l)),this.open++,r}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--){if(this.nodes[t]==e)return this.open=t,!0;this.localPreserveWS&&(this.nodes[t].options|=hn)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let r=this.nodes[t].content;for(let s=r.length-1;s>=0;s--)e+=r[s].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==t&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,r){if(e!=t&&this.find)for(let s=0;s<this.find.length;s++)this.find[s].pos==null&&e.nodeType==1&&e.contains(this.find[s].node)&&t.compareDocumentPosition(this.find[s].node)&(r?2:4)&&(this.find[s].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),r=this.options.context,s=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(s?0:1),o=(l,a)=>{for(;l>=0;l--){let c=t[l];if(c==""){if(l==t.length-1||l==0)continue;for(;a>=i;a--)if(o(l-1,a))return!0;return!1}else{let u=a>0||a==0&&s?this.nodes[a].type:r&&a>=i?r.node(a-i).type:null;if(!u||u.name!=c&&!u.isInGroup(c))return!1;a--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let r=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let t in this.parser.schema.nodes){let r=this.parser.schema.nodes[t];if(r.isTextblock&&r.defaultAttrs)return r}}}function Fu(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&_l.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function Vu(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function Xi(n){let e={};for(let t in n)e[t]=n[t];return e}function Qi(n,e){let t=e.schema.nodes;for(let r in t){let s=t[r];if(!s.allowsMarkType(n))continue;let i=[],o=l=>{i.push(l);for(let a=0;a<l.edgeCount;a++){let{type:c,next:u}=l.edge(a);if(c==e||i.indexOf(u)<0&&o(u))return!0}};if(o(s.contentMatch))return!0}}class St{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},r){r||(r=Gr(t).createDocumentFragment());let s=r,i=[];return e.forEach(o=>{if(i.length||o.marks.length){let l=0,a=0;for(;l<i.length&&a<o.marks.length;){let c=o.marks[a];if(!this.marks[c.type.name]){a++;continue}if(!c.eq(i[l][0])||c.type.spec.spanning===!1)break;l++,a++}for(;l<i.length;)s=i.pop()[1];for(;a<o.marks.length;){let c=o.marks[a++],u=this.serializeMark(c,o.isInline,t);u&&(i.push([c,s]),s.appendChild(u.dom),s=u.contentDOM||u.dom)}}s.appendChild(this.serializeNodeInner(o,t))}),r}serializeNodeInner(e,t){let{dom:r,contentDOM:s}=Fn(Gr(t),this.nodes[e.type.name](e),null,e.attrs);if(s){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,s)}return r}serializeNode(e,t={}){let r=this.serializeNodeInner(e,t);for(let s=e.marks.length-1;s>=0;s--){let i=this.serializeMark(e.marks[s],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(r),r=i.dom)}return r}serializeMark(e,t,r={}){let s=this.marks[e.type.name];return s&&Fn(Gr(r),s(e,t),null,e.attrs)}static renderSpec(e,t,r=null,s){return Fn(e,t,r,s)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new St(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=Zi(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return Zi(e.marks)}}function Zi(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function Gr(n){return n.document||window.document}const eo=new WeakMap;function _u(n){let e=eo.get(n);return e===void 0&&eo.set(n,e=Hu(n)),e}function Hu(n){let e=null;function t(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let s=0;s<r.length;s++)t(r[s]);else for(let s in r)t(r[s])}return t(n),e}function Fn(n,e,t,r){if(typeof e=="string")return{dom:n.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let s=e[0],i;if(typeof s!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(i=_u(r))&&i.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o=s.indexOf(" ");o>0&&(t=s.slice(0,o),s=s.slice(o+1));let l,a=t?n.createElementNS(t,s):n.createElement(s),c=e[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let d in c)if(c[d]!=null){let f=d.indexOf(" ");f>0?a.setAttributeNS(d.slice(0,f),d.slice(f+1),c[d]):d=="style"&&a.style?a.style.cssText=c[d]:a.setAttribute(d,c[d])}}for(let d=u;d<e.length;d++){let f=e[d];if(f===0){if(d<e.length-1||d>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else{let{dom:h,contentDOM:p}=Fn(n,f,t,r);if(a.appendChild(h),p){if(l)throw new RangeError("Multiple content holes");l=p}}}return{dom:a,contentDOM:l}}const Hl=65535,jl=Math.pow(2,16);function ju(n,e){return n+e*jl}function to(n){return n&Hl}function Wu(n){return(n-(n&Hl))/jl}const Wl=1,ql=2,Vn=4,Ul=8;class Es{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&Ul)>0}get deletedBefore(){return(this.delInfo&(Wl|Vn))>0}get deletedAfter(){return(this.delInfo&(ql|Vn))>0}get deletedAcross(){return(this.delInfo&Vn)>0}}class de{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&de.empty)return de.empty}recover(e){let t=0,r=to(e);if(!this.inverted)for(let s=0;s<r;s++)t+=this.ranges[s*3+2]-this.ranges[s*3+1];return this.ranges[r*3]+t+Wu(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,r){let s=0,i=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?s:0);if(a>e)break;let c=this.ranges[l+i],u=this.ranges[l+o],d=a+c;if(e<=d){let f=c?e==a?-1:e==d?1:t:t,h=a+s+(f<0?0:u);if(r)return h;let p=e==(t<0?a:d)?null:ju(l/3,e-a),m=e==a?ql:e==d?Wl:Vn;return(t<0?e!=a:e!=d)&&(m|=Ul),new Es(h,m,p)}s+=u-c}return r?e+s:new Es(e+s,0,null)}touches(e,t){let r=0,s=to(t),i=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?r:0);if(a>e)break;let c=this.ranges[l+i],u=a+c;if(e<=u&&l==s*3)return!0;r+=this.ranges[l+o]-c}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let s=0,i=0;s<this.ranges.length;s+=3){let o=this.ranges[s],l=o-(this.inverted?i:0),a=o+(this.inverted?0:i),c=this.ranges[s+t],u=this.ranges[s+r];e(l,l+c,a,a+u),i+=u-c}}invert(){return new de(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?de.empty:new de(e<0?[0,-e,0]:[0,0,e])}}de.empty=new de([]);class pn{constructor(e,t,r=0,s=e?e.length:0){this.mirror=t,this.from=r,this.to=s,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(e=0,t=this.maps.length){return new pn(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,r=this._maps.length;t<e._maps.length;t++){let s=e.getMirror(t);this.appendMap(e._maps[t],s!=null&&s<t?r+s:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,r=this._maps.length+e._maps.length;t>=0;t--){let s=e.getMirror(t);this.appendMap(e._maps[t].invert(),s!=null&&s>t?r-s-1:void 0)}}invert(){let e=new pn;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,r){let s=0;for(let i=this.from;i<this.to;i++){let o=this._maps[i],l=o.mapResult(e,t);if(l.recover!=null){let a=this.getMirror(i);if(a!=null&&a>i&&a<this.to){i=a,e=this._maps[a].recover(l.recover);continue}}s|=l.delInfo,e=l.pos}return r?e:new Es(e,s,null)}}const Yr=Object.create(null);class re{getMap(){return de.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=Yr[t.stepType];if(!r)throw new RangeError(`No step type ${t.stepType} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in Yr)throw new RangeError("Duplicate use of step JSON ID "+e);return Yr[e]=t,t.prototype.jsonID=e,t}}class W{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new W(e,null)}static fail(e){return new W(null,e)}static fromReplace(e,t,r,s){try{return W.ok(e.replace(t,r,s))}catch(i){if(i instanceof qn)return W.fail(i.message);throw i}}}function ei(n,e,t){let r=[];for(let s=0;s<n.childCount;s++){let i=n.child(s);i.content.size&&(i=i.copy(ei(i.content,e,i))),i.isInline&&(i=e(i,t,s)),r.push(i)}return k.fromArray(r)}class Ue extends re{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=e.resolve(this.from),s=r.node(r.sharedDepth(this.to)),i=new w(ei(t.content,(o,l)=>!o.isAtom||!l.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),s),t.openStart,t.openEnd);return W.fromReplace(e,this.from,this.to,i)}invert(){return new Ce(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new Ue(t.pos,r.pos,this.mark)}merge(e){return e instanceof Ue&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ue(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Ue(t.from,t.to,e.markFromJSON(t.mark))}}re.jsonID("addMark",Ue);class Ce extends re{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new w(ei(t.content,s=>s.mark(this.mark.removeFromSet(s.marks)),e),t.openStart,t.openEnd);return W.fromReplace(e,this.from,this.to,r)}invert(){return new Ue(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new Ce(t.pos,r.pos,this.mark)}merge(e){return e instanceof Ce&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ce(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Ce(t.from,t.to,e.markFromJSON(t.mark))}}re.jsonID("removeMark",Ce);class Ke extends re{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return W.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return W.fromReplace(e,this.pos,this.pos+1,new w(k.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let s=0;s<t.marks.length;s++)if(!t.marks[s].isInSet(r))return new Ke(this.pos,t.marks[s]);return new Ke(this.pos,this.mark)}}return new yt(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Ke(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Ke(t.pos,e.markFromJSON(t.mark))}}re.jsonID("addNodeMark",Ke);class yt extends re{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return W.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return W.fromReplace(e,this.pos,this.pos+1,new w(k.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new Ke(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new yt(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new yt(t.pos,e.markFromJSON(t.mark))}}re.jsonID("removeNodeMark",yt);class j extends re{constructor(e,t,r,s=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=s}apply(e){return this.structure&&Ts(e,this.from,this.to)?W.fail("Structure replace would overwrite content"):W.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new de([this.from,this.to-this.from,this.slice.size])}invert(e){return new j(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.to,-1),r=this.from==this.to&&j.MAP_BIAS<0?t:e.mapResult(this.from,1);return r.deletedAcross&&t.deletedAcross?null:new j(r.pos,Math.max(r.pos,t.pos),this.slice,this.structure)}merge(e){if(!(e instanceof j)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let t=this.slice.size+e.slice.size==0?w.empty:new w(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new j(this.from,this.to+(e.to-e.from),t,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let t=this.slice.size+e.slice.size==0?w.empty:new w(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new j(e.from,this.to,t,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new j(t.from,t.to,w.fromJSON(e,t.slice),!!t.structure)}}j.MAP_BIAS=1;re.jsonID("replace",j);class G extends re{constructor(e,t,r,s,i,o,l=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=s,this.slice=i,this.insert=o,this.structure=l}apply(e){if(this.structure&&(Ts(e,this.from,this.gapFrom)||Ts(e,this.gapTo,this.to)))return W.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return W.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?W.fromReplace(e,this.from,this.to,r):W.fail("Content does not fit in gap")}getMap(){return new de([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new G(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),s=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),i=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||s<t.pos||i>r.pos?null:new G(t.pos,r.pos,s,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new G(t.from,t.to,t.gapFrom,t.gapTo,w.fromJSON(e,t.slice),t.insert,!!t.structure)}}re.jsonID("replaceAround",G);function Ts(n,e,t){let r=n.resolve(e),s=t-e,i=r.depth;for(;s>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,s--;if(s>0){let o=r.node(i).maybeChild(r.indexAfter(i));for(;s>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,s--}}return!1}function qu(n,e,t,r){let s=[],i=[],o,l;n.doc.nodesBetween(e,t,(a,c,u)=>{if(!a.isInline)return;let d=a.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let f=Math.max(c,e),h=Math.min(c+a.nodeSize,t),p=r.addToSet(d);for(let m=0;m<d.length;m++)d[m].isInSet(p)||(o&&o.to==f&&o.mark.eq(d[m])?o.to=h:s.push(o=new Ce(f,h,d[m])));l&&l.to==f?l.to=h:i.push(l=new Ue(f,h,r))}}),s.forEach(a=>n.step(a)),i.forEach(a=>n.step(a))}function Uu(n,e,t,r){let s=[],i=0;n.doc.nodesBetween(e,t,(o,l)=>{if(!o.isInline)return;i++;let a=null;if(r instanceof Ir){let c=o.marks,u;for(;u=r.isInSet(c);)(a||(a=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(o.marks)&&(a=[r]):a=o.marks;if(a&&a.length){let c=Math.min(l+o.nodeSize,t);for(let u=0;u<a.length;u++){let d=a[u],f;for(let h=0;h<s.length;h++){let p=s[h];p.step==i-1&&d.eq(s[h].style)&&(f=p)}f?(f.to=c,f.step=i):s.push({style:d,from:Math.max(l,e),to:c,step:i})}}}),s.forEach(o=>n.step(new Ce(o.from,o.to,o.style)))}function ti(n,e,t,r=t.contentMatch,s=!0){let i=n.doc.nodeAt(e),o=[],l=e+1;for(let a=0;a<i.childCount;a++){let c=i.child(a),u=l+c.nodeSize,d=r.matchType(c.type);if(!d)o.push(new j(l,u,w.empty));else{r=d;for(let f=0;f<c.marks.length;f++)t.allowsMarkType(c.marks[f].type)||n.step(new Ce(l,u,c.marks[f]));if(s&&c.isText&&t.whitespace!="pre"){let f,h=/\r?\n|\r/g,p;for(;f=h.exec(c.text);)p||(p=new w(k.from(t.schema.text(" ",t.allowedMarks(c.marks))),0,0)),o.push(new j(l+f.index,l+f.index+f[0].length,p))}}l=u}if(!r.validEnd){let a=r.fillBefore(k.empty,!0);n.replace(l,l,new w(a,0,0))}for(let a=o.length-1;a>=0;a--)n.step(o[a])}function Ku(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function jt(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth,s=0,i=0;;--r){let o=n.$from.node(r),l=n.$from.index(r)+s,a=n.$to.indexAfter(r)-i;if(r<n.depth&&o.canReplace(l,a,t))return r;if(r==0||o.type.spec.isolating||!Ku(o,l,a))break;l&&(s=1),a<o.childCount&&(i=1)}return null}function Ju(n,e,t){let{$from:r,$to:s,depth:i}=e,o=r.before(i+1),l=s.after(i+1),a=o,c=l,u=k.empty,d=0;for(let p=i,m=!1;p>t;p--)m||r.index(p)>0?(m=!0,u=k.from(r.node(p).copy(u)),d++):a--;let f=k.empty,h=0;for(let p=i,m=!1;p>t;p--)m||s.after(p+1)<s.end(p)?(m=!0,f=k.from(s.node(p).copy(f)),h++):c++;n.step(new G(a,c,o,l,new w(u.append(f),d,h),u.size-d,!0))}function ni(n,e,t=null,r=n){let s=Gu(n,e),i=s&&Yu(r,e);return i?s.map(no).concat({type:e,attrs:t}).concat(i.map(no)):null}function no(n){return{type:n,attrs:null}}function Gu(n,e){let{parent:t,startIndex:r,endIndex:s}=n,i=t.contentMatchAt(r).findWrapping(e);if(!i)return null;let o=i.length?i[0]:e;return t.canReplaceWith(r,s,o)?i:null}function Yu(n,e){let{parent:t,startIndex:r,endIndex:s}=n,i=t.child(r),o=e.contentMatch.findWrapping(i.type);if(!o)return null;let a=(o.length?o[o.length-1]:e).contentMatch;for(let c=r;a&&c<s;c++)a=a.matchType(t.child(c).type);return!a||!a.validEnd?null:o}function Xu(n,e,t){let r=k.empty;for(let o=t.length-1;o>=0;o--){if(r.size){let l=t[o].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=k.from(t[o].type.create(t[o].attrs,r))}let s=e.start,i=e.end;n.step(new G(s,i,s,i,new w(r,0,0),t.length,!0))}function Qu(n,e,t,r,s){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=n.steps.length;n.doc.nodesBetween(e,t,(o,l)=>{let a=typeof s=="function"?s(o):s;if(o.isTextblock&&!o.hasMarkup(r,a)&&Zu(n.doc,n.mapping.slice(i).map(l),r)){let c=null;if(r.schema.linebreakReplacement){let h=r.whitespace=="pre",p=!!r.contentMatch.matchType(r.schema.linebreakReplacement);h&&!p?c=!1:!h&&p&&(c=!0)}c===!1&&Jl(n,o,l,i),ti(n,n.mapping.slice(i).map(l,1),r,void 0,c===null);let u=n.mapping.slice(i),d=u.map(l,1),f=u.map(l+o.nodeSize,1);return n.step(new G(d,f,d+1,f-1,new w(k.from(r.create(a,null,o.marks)),0,0),1,!0)),c===!0&&Kl(n,o,l,i),!1}})}function Kl(n,e,t,r){e.forEach((s,i)=>{if(s.isText){let o,l=/\r?\n|\r/g;for(;o=l.exec(s.text);){let a=n.mapping.slice(r).map(t+1+i+o.index);n.replaceWith(a,a+1,e.type.schema.linebreakReplacement.create())}}})}function Jl(n,e,t,r){e.forEach((s,i)=>{if(s.type==s.type.schema.linebreakReplacement){let o=n.mapping.slice(r).map(t+1+i);n.replaceWith(o,o+1,e.type.schema.text(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as n,aT as q,bY as R,bZ as Ee,b_ as ke,b$ as Se,bc as xe,c0 as j}from"./index-raVE4iMU.js";var de=1,Ie=.9,Ce=.8,Re=.17,Z=.1,Q=.999,Ae=.9999,Me=.99,$e=/[\\\/_+.#"@\[\(\{&]/,De=/[\\\/_+.#"@\[\(\{&]/g,Fe=/[\s-]/,ve=/[\s-]/g;function ee(t,l,r,f,u,c,d){if(c===l.length)return u===t.length?de:Me;var v=`${u},${c}`;if(d[v]!==void 0)return d[v];for(var b=f.charAt(c),i=r.indexOf(b,u),p=0,h,x,E,I;i>=0;)h=ee(t,l,r,f,i+1,c+1,d),h>p&&(i===u?h*=de:$e.test(t.charAt(i-1))?(h*=Ce,E=t.slice(u,i-1).match(De),E&&u>0&&(h*=Math.pow(Q,E.length))):Fe.test(t.charAt(i-1))?(h*=Ie,I=t.slice(u,i-1).match(ve),I&&u>0&&(h*=Math.pow(Q,I.length))):(h*=Re,u>0&&(h*=Math.pow(Q,i-u))),t.charAt(i)!==l.charAt(c)&&(h*=Ae)),(h<Z&&r.charAt(i-1)===f.charAt(c+1)||f.charAt(c+1)===f.charAt(c)&&r.charAt(i-1)!==f.charAt(c))&&(x=ee(t,l,r,f,i+1,c+2,d),x*Z>h&&(h=x*Z)),h>p&&(p=h),i=r.indexOf(b,i+1);return d[v]=p,p}function se(t){return t.toLowerCase().replace(ve," ")}function Ke(t,l,r){return t=r&&r.length>0?`${t+" "+r.join(" ")}`:t,ee(t,l,se(t),se(l),0,0,{})}var V='[cmdk-group=""]',_='[cmdk-group-items=""]',qe='[cmdk-group-heading=""]',me='[cmdk-item=""]',fe=`${me}:not([aria-disabled="true"])`,te="cmdk-item-select",F="data-value",Pe=(t,l,r)=>Ke(t,l,r),pe=n.createContext(void 0),L=()=>n.useContext(pe),he=n.createContext(void 0),re=()=>n.useContext(he),ge=n.createContext(void 0),be=n.forwardRef((t,l)=>{let r=K(()=>{var e,o;return{search:"",value:(o=(e=t.value)!=null?e:t.defaultValue)!=null?o:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),f=K(()=>new Set),u=K(()=>new Map),c=K(()=>new Map),d=K(()=>new Set),v=we(t),{label:b,children:i,value:p,onValueChange:h,filter:x,shouldFilter:E,loop:I,disablePointerSelection:T=!1,vimBindings:A=!0,...O}=t,U=q(),ne=q(),H=q(),M=n.useRef(null),w=We();$(()=>{if(p!==void 0){let e=p.trim();r.current.value=e,k.emit()}},[p]),$(()=>{w(6,ae)},[]);let k=n.useMemo(()=>({subscribe:e=>(d.current.add(e),()=>d.current.delete(e)),snapshot:()=>r.current,setState:(e,o,s)=>{var a,m,g,S;if(!Object.is(r.current[e],o)){if(r.current[e]=o,e==="search")G(),W(),w(1,Y);else if(e==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let y=document.getElementById(H);y?y.focus():(a=document.getElementById(U))==null||a.focus()}if(w(7,()=>{var y;r.current.selectedItemId=(y=D())==null?void 0:y.id,k.emit()}),s||w(5,ae),((m=v.current)==null?void 0:m.value)!==void 0){let y=o??"";(S=(g=v.current).onValueChange)==null||S.call(g,y);return}}k.emit()}},emit:()=>{d.current.forEach(e=>e())}}),[]),N=n.useMemo(()=>({value:(e,o,s)=>{var a;o!==((a=c.current.get(e))==null?void 0:a.value)&&(c.current.set(e,{value:o,keywords:s}),r.current.filtered.items.set(e,le(o,s)),w(2,()=>{W(),k.emit()}))},item:(e,o)=>(f.current.add(e),o&&(u.current.has(o)?u.current.get(o).add(e):u.current.set(o,new Set([e]))),w(3,()=>{G(),W(),r.current.value||Y(),k.emit()}),()=>{c.current.delete(e),f.current.delete(e),r.current.filtered.items.delete(e);let s=D();w(4,()=>{G(),s?.getAttribute("id")===e&&Y(),k.emit()})}),group:e=>(u.current.has(e)||u.current.set(e,new Set),()=>{c.current.delete(e),u.current.delete(e)}),filter:()=>v.current.shouldFilter,label:b||t["aria-label"],getDisablePointerSelection:()=>v.current.disablePointerSelection,listId:U,inputId:H,labelId:ne,listInnerRef:M}),[]);function le(e,o){var s,a;let m=(a=(s=v.current)==null?void 0:s.filter)!=null?a:Pe;return e?m(e,r.current.search,o):0}function W(){if(!r.current.search||v.current.shouldFilter===!1)return;let e=r.current.filtered.items,o=[];r.current.filtered.groups.forEach(a=>{let m=u.current.get(a),g=0;m.forEach(S=>{let y=e.get(S);g=Math.max(y,g)}),o.push([a,g])});let s=M.current;P().sort((a,m)=>{var g,S;let y=a.getAttribute("id"),B=m.getAttribute("id");return((g=e.get(B))!=null?g:0)-((S=e.get(y))!=null?S:0)}).forEach(a=>{let m=a.closest(_);m?m.appendChild(a.parentElement===m?a:a.closest(`${_} > *`)):s.appendChild(a.parentElement===s?a:a.closest(`${_} > *`))}),o.sort((a,m)=>m[1]-a[1]).forEach(a=>{var m;let g=(m=M.current)==null?void 0:m.querySelector(`${V}[${F}="${encodeURIComponent(a[0])}"]`);g?.parentElement.appendChild(g)})}function Y(){let e=P().find(s=>s.getAttribute("aria-disabled")!=="true"),o=e?.getAttribute(F);k.setState("value",o||void 0)}function G(){var e,o,s,a;if(!r.current.search||v.current.shouldFilter===!1){r.current.filtered.count=f.current.size;return}r.current.filtered.groups=new Set;let m=0;for(let g of f.current){let S=(o=(e=c.current.get(g))==null?void 0:e.value)!=null?o:"",y=(a=(s=c.current.get(g))==null?void 0:s.keywords)!=null?a:[],B=le(S,y);r.current.filtered.items.set(g,B),B>0&&m++}for(let[g,S]of u.current)for(let y of S)if(r.current.filtered.items.get(y)>0){r.current.filtered.groups.add(g);break}r.current.filtered.count=m}function ae(){var e,o,s;let a=D();a&&(((e=a.parentElement)==null?void 0:e.firstChild)===a&&((s=(o=a.closest(V))==null?void 0:o.querySelector(qe))==null||s.scrollIntoView({block:"nearest"})),a.scrollIntoView({block:"nearest"}))}function D(){var e;return(e=M.current)==null?void 0:e.querySelector(`${me}[aria-selected="true"]`)}function P(){var e;return Array.from(((e=M.current)==null?void 0:e.querySelectorAll(fe))||[])}function J(e){let o=P()[e];o&&k.setState("value",o.getAttribute(F))}function X(e){var o;let s=D(),a=P(),m=a.findIndex(S=>S===s),g=a[m+e];(o=v.current)!=null&&o.loop&&(g=m+e<0?a[a.length-1]:m+e===a.length?a[0]:a[m+e]),g&&k.setState("value",g.getAttribute(F))}function ue(e){let o=D(),s=o?.closest(V),a;for(;s&&!a;)s=e>0?He(s,V):Ne(s,V),a=s?.querySelector(fe);a?k.setState("value",a.getAttribute(F)):X(e)}let ie=()=>J(P().length-1),oe=e=>{e.preventDefault(),e.metaKey?ie():e.altKey?ue(1):X(1)},ce=e=>{e.preventDefault(),e.metaKey?J(0):e.altKey?ue(-1):X(-1)};return n.createElement(R.div,{ref:l,tabIndex:-1,...O,"cmdk-root":"",onKeyDown:e=>{var o;(o=O.onKeyDown)==null||o.call(O,e);let s=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||s))switch(e.key){case"n":case"j":{A&&e.ctrlKey&&oe(e);break}case"ArrowDown":{oe(e);break}case"p":case"k":{A&&e.ctrlKey&&ce(e);break}case"ArrowUp":{ce(e);break}case"Home":{e.preventDefault(),J(0);break}case"End":{e.preventDefault(),ie();break}case"Enter":{e.preventDefault();let a=D();if(a){let m=new Event(te);a.dispatchEvent(m)}}}}},n.createElement("label",{"cmdk-label":"",htmlFor:N.inputId,id:N.labelId,style:Ge},b),z(t,e=>n.createElement(he.Provider,{value:k},n.createElement(pe.Provider,{value:N},e))))}),Ve=n.forwardRef((t,l)=>{var r,f;let u=q(),c=n.useRef(null),d=n.useContext(ge),v=L(),b=we(t),i=(f=(r=b.current)==null?void 0:r.forceMount)!=null?f:d?.forceMount;$(()=>{if(!i)return v.item(u,d?.id)},[i]);let p=ye(u,c,[t.value,t.children,c],t.keywords),h=re(),x=C(w=>w.value&&w.value===p.current),E=C(w=>i||v.filter()===!1?!0:w.search?w.filtered.items.get(u)>0:!0);n.useEffect(()=>{let w=c.current;if(!(!w||t.disabled))return w.addEventListener(te,I),()=>w.removeEventListener(te,I)},[E,t.onSelect,t.disabled]);function I(){var w,k;T(),(k=(w=b.current).onSelect)==null||k.call(w,p.current)}function T(){h.setState("value",p.current,!0)}if(!E)return null;let{disabled:A,value:O,onSelect:U,forceMount:ne,keywords:H,...M}=t;return n.createElement(R.div,{ref:j(c,l),...M,id:u,"cmdk-item":"",role:"option","aria-disabled":!!A,"aria-selected":!!x,"data-disabled":!!A,"data-selected":!!x,onPointerMove:A||v.getDisablePointerSelection()?void 0:T,onClick:A?void 0:I},t.children)}),je=n.forwardRef((t,l)=>{let{heading:r,children:f,forceMount:u,...c}=t,d=q(),v=n.useRef(null),b=n.useRef(null),i=q(),p=L(),h=C(E=>u||p.filter()===!1?!0:E.search?E.filtered.groups.has(d):!0);$(()=>p.group(d),[]),ye(d,v,[t.value,t.heading,b]);let x=n.useMemo(()=>({id:d,forceMount:u}),[u]);return n.createElement(R.div,{ref:j(v,l),...c,"cmdk-group":"",role:"presentation",hidden:h?void 0:!0},r&&n.createElement("div",{ref:b,"cmdk-group-heading":"","aria-hidden":!0,id:i},r),z(t,E=>n.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?i:void 0},n.createElement(ge.Provider,{value:x},E))))}),Le=n.forwardRef((t,l)=>{let{alwaysRender:r,...f}=t,u=n.useRef(null),c=C(d=>!d.search);return!r&&!c?null:n.createElement(R.div,{ref:j(u,l),...f,"cmdk-separator":"",role:"separator"})}),Oe=n.forwardRef((t,l)=>{let{onValueChange:r,...f}=t,u=t.value!=null,c=re(),d=C(i=>i.search),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{t.value!=null&&c.setState("search",t.value)},[t.value]),n.createElement(R.input,{ref:l,...f,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":b.listId,"aria-labelledby":b.labelId,"aria-activedescendant":v,id:b.inputId,type:"text",value:u?t.value:d,onChange:i=>{u||c.setState("search",i.target.value),r?.(i.target.value)}})}),Be=n.forwardRef((t,l)=>{let{children:r,label:f="Suggestions",...u}=t,c=n.useRef(null),d=n.useRef(null),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{if(d.current&&c.current){let i=d.current,p=c.current,h,x=new ResizeObserver(()=>{h=requestAnimationFrame(()=>{let E=i.offsetHeight;p.style.setProperty("--cmdk-list-height",E.toFixed(1)+"px")})});return x.observe(i),()=>{cancelAnimationFrame(h),x.unobserve(i)}}},[]),n.createElement(R.div,{ref:j(c,l),...u,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":v,"aria-label":f,id:b.listId},z(t,i=>n.createElement("div",{ref:j(d,b.listInnerRef),"cmdk-list-sizer":""},i)))}),ze=n.forwardRef((t,l)=>{let{open:r,onOpenChange:f,overlayClassName:u,contentClassName:c,container:d,...v}=t;return n.createElement(Ee,{open:r,onOpenChange:f},n.createElement(ke,{container:d},n.createElement(Se,{"cmdk-overlay":"",className:u}),n.createElement(xe,{"aria-label":t.label,"cmdk-dialog":"",className:c},n.createElement(be,{ref:l,...v}))))}),Te=n.forwardRef((t,l)=>C(r=>r.filtered.count===0)?n.createElement(R.div,{ref:l,...t,"cmdk-empty":"",role:"presentation"}):null),Ue=n.forwardRef((t,l)=>{let{progress:r,children:f,label:u="Loading...",...c}=t;return n.createElement(R.div,{ref:l,...c,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":u},z(t,d=>n.createElement("div",{"aria-hidden":!0},d)))}),Xe=Object.assign(be,{List:Be,Item:Ve,Input:Oe,Group:je,Separator:Le,Dialog:ze,Empty:Te,Loading:Ue});function He(t,l){let r=t.nextElementSibling;for(;r;){if(r.matches(l))return r;r=r.nextElementSibling}}function Ne(t,l){let r=t.previousElementSibling;for(;r;){if(r.matches(l))return r;r=r.previousElementSibling}}function we(t){let l=n.useRef(t);return $(()=>{l.current=t}),l}var $=typeof window>"u"?n.useEffect:n.useLayoutEffect;function K(t){let l=n.useRef();return l.current===void 0&&(l.current=t()),l}function C(t){let l=re(),r=()=>t(l.snapshot());return n.useSyncExternalStore(l.subscribe,r,r)}function ye(t,l,r,f=[]){let u=n.useRef(),c=L();return $(()=>{var d;let v=(()=>{var i;for(let p of r){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(i=p.current.textContent)==null?void 0:i.trim():u.current}})(),b=f.map(i=>i.trim());c.value(t,v,b),(d=l.current)==null||d.setAttribute(F,v),u.current=v}),u}var We=()=>{let[t,l]=n.useState(),r=K(()=>new Map);return $(()=>{r.current.forEach(f=>f()),r.current=new Map},[t]),(f,u)=>{r.current.set(f,u),l({})}};function Ye(t){let l=t.type;return typeof l=="function"?l(t.props):"render"in l?l.render(t.props):t}function z({asChild:t,children:l},r){return t&&n.isValidElement(l)?n.cloneElement(Ye(l),{ref:l.ref},r(l.props.children)):r(l)}var Ge={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};export{Xe as _};
|
|
1
|
+
import{r as n,aT as q,bY as R,bZ as Ee,b_ as ke,b$ as Se,bc as xe,c0 as j}from"./index-Bf7aO1A-.js";var de=1,Ie=.9,Ce=.8,Re=.17,Z=.1,Q=.999,Ae=.9999,Me=.99,$e=/[\\\/_+.#"@\[\(\{&]/,De=/[\\\/_+.#"@\[\(\{&]/g,Fe=/[\s-]/,ve=/[\s-]/g;function ee(t,l,r,f,u,c,d){if(c===l.length)return u===t.length?de:Me;var v=`${u},${c}`;if(d[v]!==void 0)return d[v];for(var b=f.charAt(c),i=r.indexOf(b,u),p=0,h,x,E,I;i>=0;)h=ee(t,l,r,f,i+1,c+1,d),h>p&&(i===u?h*=de:$e.test(t.charAt(i-1))?(h*=Ce,E=t.slice(u,i-1).match(De),E&&u>0&&(h*=Math.pow(Q,E.length))):Fe.test(t.charAt(i-1))?(h*=Ie,I=t.slice(u,i-1).match(ve),I&&u>0&&(h*=Math.pow(Q,I.length))):(h*=Re,u>0&&(h*=Math.pow(Q,i-u))),t.charAt(i)!==l.charAt(c)&&(h*=Ae)),(h<Z&&r.charAt(i-1)===f.charAt(c+1)||f.charAt(c+1)===f.charAt(c)&&r.charAt(i-1)!==f.charAt(c))&&(x=ee(t,l,r,f,i+1,c+2,d),x*Z>h&&(h=x*Z)),h>p&&(p=h),i=r.indexOf(b,i+1);return d[v]=p,p}function se(t){return t.toLowerCase().replace(ve," ")}function Ke(t,l,r){return t=r&&r.length>0?`${t+" "+r.join(" ")}`:t,ee(t,l,se(t),se(l),0,0,{})}var V='[cmdk-group=""]',_='[cmdk-group-items=""]',qe='[cmdk-group-heading=""]',me='[cmdk-item=""]',fe=`${me}:not([aria-disabled="true"])`,te="cmdk-item-select",F="data-value",Pe=(t,l,r)=>Ke(t,l,r),pe=n.createContext(void 0),L=()=>n.useContext(pe),he=n.createContext(void 0),re=()=>n.useContext(he),ge=n.createContext(void 0),be=n.forwardRef((t,l)=>{let r=K(()=>{var e,o;return{search:"",value:(o=(e=t.value)!=null?e:t.defaultValue)!=null?o:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),f=K(()=>new Set),u=K(()=>new Map),c=K(()=>new Map),d=K(()=>new Set),v=we(t),{label:b,children:i,value:p,onValueChange:h,filter:x,shouldFilter:E,loop:I,disablePointerSelection:T=!1,vimBindings:A=!0,...O}=t,U=q(),ne=q(),H=q(),M=n.useRef(null),w=We();$(()=>{if(p!==void 0){let e=p.trim();r.current.value=e,k.emit()}},[p]),$(()=>{w(6,ae)},[]);let k=n.useMemo(()=>({subscribe:e=>(d.current.add(e),()=>d.current.delete(e)),snapshot:()=>r.current,setState:(e,o,s)=>{var a,m,g,S;if(!Object.is(r.current[e],o)){if(r.current[e]=o,e==="search")G(),W(),w(1,Y);else if(e==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let y=document.getElementById(H);y?y.focus():(a=document.getElementById(U))==null||a.focus()}if(w(7,()=>{var y;r.current.selectedItemId=(y=D())==null?void 0:y.id,k.emit()}),s||w(5,ae),((m=v.current)==null?void 0:m.value)!==void 0){let y=o??"";(S=(g=v.current).onValueChange)==null||S.call(g,y);return}}k.emit()}},emit:()=>{d.current.forEach(e=>e())}}),[]),N=n.useMemo(()=>({value:(e,o,s)=>{var a;o!==((a=c.current.get(e))==null?void 0:a.value)&&(c.current.set(e,{value:o,keywords:s}),r.current.filtered.items.set(e,le(o,s)),w(2,()=>{W(),k.emit()}))},item:(e,o)=>(f.current.add(e),o&&(u.current.has(o)?u.current.get(o).add(e):u.current.set(o,new Set([e]))),w(3,()=>{G(),W(),r.current.value||Y(),k.emit()}),()=>{c.current.delete(e),f.current.delete(e),r.current.filtered.items.delete(e);let s=D();w(4,()=>{G(),s?.getAttribute("id")===e&&Y(),k.emit()})}),group:e=>(u.current.has(e)||u.current.set(e,new Set),()=>{c.current.delete(e),u.current.delete(e)}),filter:()=>v.current.shouldFilter,label:b||t["aria-label"],getDisablePointerSelection:()=>v.current.disablePointerSelection,listId:U,inputId:H,labelId:ne,listInnerRef:M}),[]);function le(e,o){var s,a;let m=(a=(s=v.current)==null?void 0:s.filter)!=null?a:Pe;return e?m(e,r.current.search,o):0}function W(){if(!r.current.search||v.current.shouldFilter===!1)return;let e=r.current.filtered.items,o=[];r.current.filtered.groups.forEach(a=>{let m=u.current.get(a),g=0;m.forEach(S=>{let y=e.get(S);g=Math.max(y,g)}),o.push([a,g])});let s=M.current;P().sort((a,m)=>{var g,S;let y=a.getAttribute("id"),B=m.getAttribute("id");return((g=e.get(B))!=null?g:0)-((S=e.get(y))!=null?S:0)}).forEach(a=>{let m=a.closest(_);m?m.appendChild(a.parentElement===m?a:a.closest(`${_} > *`)):s.appendChild(a.parentElement===s?a:a.closest(`${_} > *`))}),o.sort((a,m)=>m[1]-a[1]).forEach(a=>{var m;let g=(m=M.current)==null?void 0:m.querySelector(`${V}[${F}="${encodeURIComponent(a[0])}"]`);g?.parentElement.appendChild(g)})}function Y(){let e=P().find(s=>s.getAttribute("aria-disabled")!=="true"),o=e?.getAttribute(F);k.setState("value",o||void 0)}function G(){var e,o,s,a;if(!r.current.search||v.current.shouldFilter===!1){r.current.filtered.count=f.current.size;return}r.current.filtered.groups=new Set;let m=0;for(let g of f.current){let S=(o=(e=c.current.get(g))==null?void 0:e.value)!=null?o:"",y=(a=(s=c.current.get(g))==null?void 0:s.keywords)!=null?a:[],B=le(S,y);r.current.filtered.items.set(g,B),B>0&&m++}for(let[g,S]of u.current)for(let y of S)if(r.current.filtered.items.get(y)>0){r.current.filtered.groups.add(g);break}r.current.filtered.count=m}function ae(){var e,o,s;let a=D();a&&(((e=a.parentElement)==null?void 0:e.firstChild)===a&&((s=(o=a.closest(V))==null?void 0:o.querySelector(qe))==null||s.scrollIntoView({block:"nearest"})),a.scrollIntoView({block:"nearest"}))}function D(){var e;return(e=M.current)==null?void 0:e.querySelector(`${me}[aria-selected="true"]`)}function P(){var e;return Array.from(((e=M.current)==null?void 0:e.querySelectorAll(fe))||[])}function J(e){let o=P()[e];o&&k.setState("value",o.getAttribute(F))}function X(e){var o;let s=D(),a=P(),m=a.findIndex(S=>S===s),g=a[m+e];(o=v.current)!=null&&o.loop&&(g=m+e<0?a[a.length-1]:m+e===a.length?a[0]:a[m+e]),g&&k.setState("value",g.getAttribute(F))}function ue(e){let o=D(),s=o?.closest(V),a;for(;s&&!a;)s=e>0?He(s,V):Ne(s,V),a=s?.querySelector(fe);a?k.setState("value",a.getAttribute(F)):X(e)}let ie=()=>J(P().length-1),oe=e=>{e.preventDefault(),e.metaKey?ie():e.altKey?ue(1):X(1)},ce=e=>{e.preventDefault(),e.metaKey?J(0):e.altKey?ue(-1):X(-1)};return n.createElement(R.div,{ref:l,tabIndex:-1,...O,"cmdk-root":"",onKeyDown:e=>{var o;(o=O.onKeyDown)==null||o.call(O,e);let s=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||s))switch(e.key){case"n":case"j":{A&&e.ctrlKey&&oe(e);break}case"ArrowDown":{oe(e);break}case"p":case"k":{A&&e.ctrlKey&&ce(e);break}case"ArrowUp":{ce(e);break}case"Home":{e.preventDefault(),J(0);break}case"End":{e.preventDefault(),ie();break}case"Enter":{e.preventDefault();let a=D();if(a){let m=new Event(te);a.dispatchEvent(m)}}}}},n.createElement("label",{"cmdk-label":"",htmlFor:N.inputId,id:N.labelId,style:Ge},b),z(t,e=>n.createElement(he.Provider,{value:k},n.createElement(pe.Provider,{value:N},e))))}),Ve=n.forwardRef((t,l)=>{var r,f;let u=q(),c=n.useRef(null),d=n.useContext(ge),v=L(),b=we(t),i=(f=(r=b.current)==null?void 0:r.forceMount)!=null?f:d?.forceMount;$(()=>{if(!i)return v.item(u,d?.id)},[i]);let p=ye(u,c,[t.value,t.children,c],t.keywords),h=re(),x=C(w=>w.value&&w.value===p.current),E=C(w=>i||v.filter()===!1?!0:w.search?w.filtered.items.get(u)>0:!0);n.useEffect(()=>{let w=c.current;if(!(!w||t.disabled))return w.addEventListener(te,I),()=>w.removeEventListener(te,I)},[E,t.onSelect,t.disabled]);function I(){var w,k;T(),(k=(w=b.current).onSelect)==null||k.call(w,p.current)}function T(){h.setState("value",p.current,!0)}if(!E)return null;let{disabled:A,value:O,onSelect:U,forceMount:ne,keywords:H,...M}=t;return n.createElement(R.div,{ref:j(c,l),...M,id:u,"cmdk-item":"",role:"option","aria-disabled":!!A,"aria-selected":!!x,"data-disabled":!!A,"data-selected":!!x,onPointerMove:A||v.getDisablePointerSelection()?void 0:T,onClick:A?void 0:I},t.children)}),je=n.forwardRef((t,l)=>{let{heading:r,children:f,forceMount:u,...c}=t,d=q(),v=n.useRef(null),b=n.useRef(null),i=q(),p=L(),h=C(E=>u||p.filter()===!1?!0:E.search?E.filtered.groups.has(d):!0);$(()=>p.group(d),[]),ye(d,v,[t.value,t.heading,b]);let x=n.useMemo(()=>({id:d,forceMount:u}),[u]);return n.createElement(R.div,{ref:j(v,l),...c,"cmdk-group":"",role:"presentation",hidden:h?void 0:!0},r&&n.createElement("div",{ref:b,"cmdk-group-heading":"","aria-hidden":!0,id:i},r),z(t,E=>n.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?i:void 0},n.createElement(ge.Provider,{value:x},E))))}),Le=n.forwardRef((t,l)=>{let{alwaysRender:r,...f}=t,u=n.useRef(null),c=C(d=>!d.search);return!r&&!c?null:n.createElement(R.div,{ref:j(u,l),...f,"cmdk-separator":"",role:"separator"})}),Oe=n.forwardRef((t,l)=>{let{onValueChange:r,...f}=t,u=t.value!=null,c=re(),d=C(i=>i.search),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{t.value!=null&&c.setState("search",t.value)},[t.value]),n.createElement(R.input,{ref:l,...f,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":b.listId,"aria-labelledby":b.labelId,"aria-activedescendant":v,id:b.inputId,type:"text",value:u?t.value:d,onChange:i=>{u||c.setState("search",i.target.value),r?.(i.target.value)}})}),Be=n.forwardRef((t,l)=>{let{children:r,label:f="Suggestions",...u}=t,c=n.useRef(null),d=n.useRef(null),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{if(d.current&&c.current){let i=d.current,p=c.current,h,x=new ResizeObserver(()=>{h=requestAnimationFrame(()=>{let E=i.offsetHeight;p.style.setProperty("--cmdk-list-height",E.toFixed(1)+"px")})});return x.observe(i),()=>{cancelAnimationFrame(h),x.unobserve(i)}}},[]),n.createElement(R.div,{ref:j(c,l),...u,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":v,"aria-label":f,id:b.listId},z(t,i=>n.createElement("div",{ref:j(d,b.listInnerRef),"cmdk-list-sizer":""},i)))}),ze=n.forwardRef((t,l)=>{let{open:r,onOpenChange:f,overlayClassName:u,contentClassName:c,container:d,...v}=t;return n.createElement(Ee,{open:r,onOpenChange:f},n.createElement(ke,{container:d},n.createElement(Se,{"cmdk-overlay":"",className:u}),n.createElement(xe,{"aria-label":t.label,"cmdk-dialog":"",className:c},n.createElement(be,{ref:l,...v}))))}),Te=n.forwardRef((t,l)=>C(r=>r.filtered.count===0)?n.createElement(R.div,{ref:l,...t,"cmdk-empty":"",role:"presentation"}):null),Ue=n.forwardRef((t,l)=>{let{progress:r,children:f,label:u="Loading...",...c}=t;return n.createElement(R.div,{ref:l,...c,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":u},z(t,d=>n.createElement("div",{"aria-hidden":!0},d)))}),Xe=Object.assign(be,{List:Be,Item:Ve,Input:Oe,Group:je,Separator:Le,Dialog:ze,Empty:Te,Loading:Ue});function He(t,l){let r=t.nextElementSibling;for(;r;){if(r.matches(l))return r;r=r.nextElementSibling}}function Ne(t,l){let r=t.previousElementSibling;for(;r;){if(r.matches(l))return r;r=r.previousElementSibling}}function we(t){let l=n.useRef(t);return $(()=>{l.current=t}),l}var $=typeof window>"u"?n.useEffect:n.useLayoutEffect;function K(t){let l=n.useRef();return l.current===void 0&&(l.current=t()),l}function C(t){let l=re(),r=()=>t(l.snapshot());return n.useSyncExternalStore(l.subscribe,r,r)}function ye(t,l,r,f=[]){let u=n.useRef(),c=L();return $(()=>{var d;let v=(()=>{var i;for(let p of r){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(i=p.current.textContent)==null?void 0:i.trim():u.current}})(),b=f.map(i=>i.trim());c.value(t,v,b),(d=l.current)==null||d.setAttribute(F,v),u.current=v}),u}var We=()=>{let[t,l]=n.useState(),r=K(()=>new Map);return $(()=>{r.current.forEach(f=>f()),r.current=new Map},[t]),(f,u)=>{r.current.set(f,u),l({})}};function Ye(t){let l=t.type;return typeof l=="function"?l(t.props):"render"in l?l.render(t.props):t}function z({asChild:t,children:l},r){return t&&n.isValidElement(l)?n.cloneElement(Ye(l),{ref:l.ref},r(l.props.children)):r(l)}var Ge={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};export{Xe as _};
|
package/dist/client/assets/{infiniteQueryObserver-ZgItTY4U.js → infiniteQueryObserver-Cv7QlLOi.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d2 as g,d3 as d,d4 as v}from"./index-
|
|
1
|
+
import{d2 as g,d3 as d,d4 as v}from"./index-Bf7aO1A-.js";var b=class extends g{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:s}=e,i=super.createResult(e,t),{isFetching:c,isRefetching:u,isError:a,isRefetchError:P}=i,r=s.fetchMeta?.fetchMore?.direction,h=a&&r==="forward",o=c&&r==="forward",n=a&&r==="backward",f=c&&r==="backward";return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:v(t,s.data),hasPreviousPage:d(t,s.data),isFetchNextPageError:h,isFetchingNextPage:o,isFetchPreviousPageError:n,isFetchingPreviousPage:f,isRefetchError:P&&!h&&!n,isRefetching:u&&!o&&!f}}};export{b as I};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as s,c as a,j as d}from"./index-
|
|
1
|
+
import{e as s,c as a,j as d}from"./index-Bf7aO1A-.js";function f(l){const e=s.c(10);let i,t,r;e[0]!==l?({className:i,type:r,...t}=l,e[0]=l,e[1]=i,e[2]=t,e[3]=r):(i=e[1],t=e[2],r=e[3]);let n;e[4]!==i?(n=a("file:text-foreground text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground flex h-9 w-full min-w-0 rounded-lg bg-background dark:bg-input/30 px-3 py-1 text-sm transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:opacity-50 card-shadow","focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:ring-[2px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",i),e[4]=i,e[5]=n):n=e[5];let o;return e[6]!==t||e[7]!==n||e[8]!==r?(o=d.jsx("input",{type:r,"data-slot":"input",className:n,...t}),e[6]=t,e[7]=n,e[8]=r,e[9]=o):o=e[9],o}export{f as I};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as A,j as h,r as z,c as _}from"./index-
|
|
1
|
+
import{e as A,j as h,r as z,c as _}from"./index-Bf7aO1A-.js";import{n as L}from"./Container-CmZ_UAMx.js";import{A as k}from"./agent-icon-q6iHyexc.js";const C={"2xs":"h-4 w-4",xs:"h-6 w-6",sm:"h-9 w-9",md:"h-12 w-12",lg:"h-16 w-16",xl:"h-14 w-14"},Z={"2xs":"min-w-4",xs:"min-w-6",sm:"min-w-9",md:"min-w-12",lg:"min-w-16",xl:"min-w-14"},y={"2xs":8,xs:12,sm:16,md:24,lg:32,xl:28},M={"2xs":"xs",xs:"xs",sm:"sm",md:"md",lg:"lg",xl:"lg"};function q(E){const e=A.c(12),{icon:t,name:s,size:w,className:o,fallbackIcon:c}=E,n=w===void 0?"md":w;if(t?.startsWith("icon://")||t?.includes("#agentcolor=")){const r=M[n];let l;return e[0]!==o||e[1]!==t||e[2]!==s||e[3]!==r?(l=h.jsx(k,{icon:t,name:s,size:r,className:o}),e[0]=o,e[1]=t,e[2]=s,e[3]=r,e[4]=l):l=e[4],l}const g=t??"no-icon";let i;return e[5]!==o||e[6]!==c||e[7]!==t||e[8]!==s||e[9]!==n||e[10]!==g?(i=h.jsx(R,{icon:t,name:s,size:n,className:o,fallbackIcon:c},g),e[5]=o,e[6]=c,e[7]=t,e[8]=s,e[9]=n,e[10]=g,e[11]=i):i=e[11],i}function R(E){const e=A.c(24),{icon:t,name:s,size:w,className:o,fallbackIcon:c}=E,n=w===void 0?"md":w,[g,i]=z.useState(!1),r=!!t&&g,l=C[n],b=Z[n];let a;e[0]!==o||e[1]!==l||e[2]!==b?(a=_("rounded-lg border border-border shrink-0 overflow-hidden aspect-square bg-white",l,b,o),e[0]=o,e[1]=l,e[2]=b,e[3]=a):a=e[3];const p=t||void 0,N=!r&&"hidden";let m;e[4]!==N?(m=_("h-full w-full object-cover",N),e[4]=N,e[5]=m):m=e[5];let I,S;e[6]===Symbol.for("react.memo_cache_sentinel")?(I=()=>i(!1),S=()=>i(!0),e[6]=I,e[7]=S):(I=e[6],S=e[7]);let d;e[8]!==s||e[9]!==p||e[10]!==m?(d=h.jsx("img",{src:p,alt:s,className:m,onError:I,onLoad:S}),e[8]=s,e[9]=p,e[10]=m,e[11]=d):d=e[11];const v=r&&"hidden";let f;e[12]!==v?(f=_("h-full w-full flex items-center justify-center bg-muted/20",v),e[12]=v,e[13]=f):f=e[13];let x;e[14]!==c||e[15]!==n?(x=c??h.jsx(L,{size:y[n],className:"text-muted-foreground"}),e[14]=c,e[15]=n,e[16]=x):x=e[16];let u;e[17]!==f||e[18]!==x?(u=h.jsx("div",{className:f,children:x}),e[17]=f,e[18]=x,e[19]=u):u=e[19];let j;return e[20]!==d||e[21]!==u||e[22]!==a?(j=h.jsxs("div",{className:a,children:[d,u]}),e[20]=d,e[21]=u,e[22]=a,e[23]=j):j=e[23],j}export{q as I};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as n,c as r,j as i,b3 as p}from"./index-
|
|
1
|
+
import{e as n,c as r,j as i,b3 as p}from"./index-Bf7aO1A-.js";function c(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=r("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(p,{"data-slot":"label",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{c as L};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as C,r as i,c as z,j as a,az as V}from"./index-
|
|
1
|
+
import{e as C,r as i,c as z,j as a,az as V}from"./index-Bf7aO1A-.js";import{P as E}from"./index-DPqqDw7W.js";const H=i.createContext(null);function q(x){const e=C.c(3),{children:l}=x,s=i.useContext(H);if(!s?.tabsEl)return null;let c;return e[0]!==l||e[1]!==s.tabsEl?(c=V.createPortal(l,s.tabsEl),e[0]=l,e[1]=s.tabsEl,e[2]=c):c=e[2],c}function A(x){const e=C.c(3),{children:l}=x,s=i.useContext(H);if(!s?.actionsEl)return null;let c;return e[0]!==l||e[1]!==s.actionsEl?(c=V.createPortal(l,s.actionsEl),e[0]=l,e[1]=s.actionsEl,e[2]=c):c=e[2],c}const B=A;function F(x){const e=C.c(21),{children:l,breadcrumb:s,hideHeader:c}=x;let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b={leftEl:null,tabsEl:null,actionsEl:null},e[0]=b):b=e[0];const[w,g]=i.useState(b),N=i.useRef(null),P=i.useRef(null),L=i.useRef(null);let h;e[1]===Symbol.for("react.memo_cache_sentinel")?(h=t=>{N.current=t,t&&g(n=>n.leftEl===t?n:{...n,leftEl:t})},e[1]=h):h=e[1];const $=h;let R;e[2]===Symbol.for("react.memo_cache_sentinel")?(R=t=>{P.current=t,t&&g(n=>n.tabsEl===t?n:{...n,tabsEl:t})},e[2]=R):R=e[2];const _=R;let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=t=>{L.current=t,t&&g(n=>n.actionsEl===t?n:{...n,actionsEl:t})},e[3]=d):d=e[3];const k=d,p=c&&"hidden";let o;e[4]!==p?(o=z(p),e[4]=p,e[5]=o):o=e[5];let j;e[6]===Symbol.for("react.memo_cache_sentinel")?(j=a.jsx("div",{ref:$,className:"flex items-center gap-2 min-w-0"}),e[6]=j):j=e[6];let r;e[7]!==s?(r=a.jsxs(E.Header.Left,{children:[s,j]}),e[7]=s,e[8]=r):r=e[8];let y;e[9]===Symbol.for("react.memo_cache_sentinel")?(y=a.jsxs(E.Header.Right,{children:[a.jsx("div",{ref:_,className:"flex items-center gap-2 overflow-x-auto min-w-0"}),a.jsx("div",{ref:k,className:"flex items-center gap-2 shrink-0"})]}),e[9]=y):y=e[9];let f;e[10]!==o||e[11]!==r?(f=a.jsxs(E.Header,{className:o,children:[r,y]}),e[10]=o,e[11]=r,e[12]=f):f=e[12];let m;e[13]!==l?(m=a.jsx(E.Content,{children:l}),e[13]=l,e[14]=m):m=e[14];let u;e[15]!==f||e[16]!==m?(u=a.jsxs(E,{children:[f,m]}),e[15]=f,e[16]=m,e[17]=u):u=e[17];let S;return e[18]!==w||e[19]!==u?(S=a.jsx(H,{value:w,children:u}),e[18]=w,e[19]=u,e[20]=S):S=e[20],S}export{F as V,B as a,q as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as X,r as m,a as z,t as P,b,j as e,c as B,B as Q,d as ie,S as W,N as oe,e as le}from"./index-raVE4iMU.js";import{I}from"./input-CcEL_8zI.js";import{A as de}from"./auth-split-layout-COCXQjkb.js";function ce({redirectUrl:s,callbackUrl:n="/"}){const{emailAndPassword:d,resetPassword:u,emailOtp:i,socialProviders:l}=X(),[r,j]=m.useState(""),[y,D]=m.useState(""),[w,C]=m.useState(""),[A,O]=m.useState(""),[f,L]=m.useState(!1),[F,N]=m.useState(()=>i.enabled?"emailOtp":globalThis.localStorage?.getItem("hasLoggedIn")!=="true"?"signUp":"signIn"),[c,S]=m.useState(""),[$,Y]=m.useState(!1),h=F==="signUp",p=F==="forgotPassword",x=F==="emailOtp",R=z({mutationFn:async({email:t,password:a,name:q})=>{try{if(h){const g=await b.signUp.email({email:t,password:a,name:q||""});if(g.error)throw new Error(g.error.message||"Sign up failed");return g}else{const g=await b.signIn.email({email:t,password:a});if(g.error)throw new Error(g.error.message||"Sign in failed");return g}}catch(g){throw g instanceof Error?g:new Error("Authentication failed")}},onSuccess:()=>{globalThis.localStorage?.setItem("hasLoggedIn","true"),window.location.href=s??n},onError:t=>{P(h?"user_signup_failed":"user_signin_failed",{error:t instanceof Error?t.message:String(t)})}}),U=z({mutationFn:async({email:t})=>{const a=await b.requestPasswordReset({email:t,redirectTo:"/reset-password"});if(a.error)throw new Error(a.error.message||"Failed to send reset email");return a},onSuccess:()=>{P("password_reset_requested"),Y(!0)},onError:t=>{P("password_reset_request_failed",{error:t instanceof Error?t.message:String(t)})}}),E=z({mutationFn:async({email:t})=>{const a=await b.emailOtp.sendVerificationOtp({email:t,type:"sign-in"});if(a.error)throw new Error(a.error.message||"Failed to send code");return a},onSuccess:()=>{P("email_otp_sent"),L(!0)},onError:t=>{P("email_otp_send_failed",{error:t instanceof Error?t.message:String(t)})}}),_=z({mutationFn:async({email:t,otp:a})=>{const q=await b.signIn.emailOtp({email:t,otp:a});if(q.error)throw new Error(q.error.message||"Invalid code");return q},onSuccess:()=>{globalThis.localStorage?.setItem("hasLoggedIn","true"),window.location.href=s??n},onError:t=>{P("email_otp_verify_failed",{error:t instanceof Error?t.message:String(t)})}}),T=t=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t),V=()=>{r.trim()&&!T(r)&&S("Invalid email address")},Z=t=>{if(t.preventDefault(),!T(r)){S("Invalid email address");return}R.mutate({email:r,password:y,name:w})},ee=t=>{if(t.preventDefault(),!T(r)){S("Invalid email address");return}U.mutate({email:r})},te=t=>{if(t.preventDefault(),!T(r)){S("Invalid email address");return}E.mutate({email:r})},se=t=>{t.preventDefault(),_.mutate({email:r,otp:A})},k=t=>a=>{t(a.target.value),G&&R.reset(),H&&U.reset(),J&&(E.reset(),_.reset()),t===j&&c&&S("")},M=t=>{N(t),C(""),O(""),L(!1),S(""),Y(!1),R.reset(),U.reset(),E.reset(),_.reset()},o=R.isPending||U.isPending||E.isPending||_.isPending,G=R.error,H=U.error,J=E.error||_.error,v=h?r.trim()&&y.trim()&&w.trim():p?r.trim():x?f?A.trim():r.trim():r.trim()&&y.trim(),ne=t=>{if(!t)return null;const a=t.message.toLowerCase();return a.includes("unauthorized")||a.includes("401")?"Invalid email or password. Please try again.":a.includes("already exists")||a.includes("409")?"An account with this email already exists. Try signing in instead.":a.includes("network")||a.includes("fetch")?"Network error. Please check your connection and try again.":a.includes("rate limit")||a.includes("429")?"Too many attempts. Please wait a moment and try again.":a.includes("invalid")&&a.includes("otp")?"Invalid or expired code. Please try again.":t.message||"An error occurred. Please try again."},K=G||H||J,re=p?"Reset your password":x&&f?"Enter verification code":"Welcome to deco",ae=p?"We'll send you a reset link":x&&f?`Code sent to ${r}`:"Sign in or create a new account";return e.jsxs("div",{className:"w-full grid gap-10",children:[e.jsxs("div",{children:[e.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),e.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h1",{className:"text-2xl font-medium leading-8",children:re}),e.jsx("p",{className:"text-base text-muted-foreground leading-6",children:ae})]}),K&&e.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:ne(K)}),$&&e.jsx("div",{className:"rounded-xl bg-emerald-500/10 p-3 text-sm text-emerald-600 dark:text-emerald-400 text-center",children:"Check your email for a password reset link."}),!p&&!(x&&f)&&l.enabled&&e.jsx("div",{className:"grid gap-2",children:l.providers.map(t=>e.jsxs("button",{type:"button",disabled:o,onClick:()=>{b.signIn.social({provider:t.name,callbackURL:s??n})},className:"flex h-12 w-full items-center justify-center gap-3 rounded-xl bg-background dark:bg-input/30 px-3 text-sm font-medium text-foreground card-shadow transition-colors hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 disabled:opacity-50 disabled:pointer-events-none",children:[t.icon&&e.jsx("img",{src:t.icon,alt:"",className:B("h-5 w-5",t.name==="github"&&"dark:invert"),"aria-hidden":"true"}),"Continue with"," ",t.name.charAt(0).toUpperCase()+t.name.slice(1)]},t.name))}),!p&&!(x&&f)&&l.enabled&&(d.enabled||i.enabled)&&e.jsxs("div",{className:"flex items-center gap-2.5 -my-4",children:[e.jsx("div",{className:"h-px flex-1 bg-border"}),e.jsx("span",{className:"text-base text-muted-foreground",children:"or"}),e.jsx("div",{className:"h-px flex-1 bg-border"})]}),x&&i.enabled&&e.jsx(e.Fragment,{children:f?e.jsxs("form",{onSubmit:se,className:"grid gap-2",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:"Verification code"}),e.jsx(I,{type:"text",placeholder:"Enter code",value:A,onChange:k(O),required:!0,disabled:o,autoFocus:!0,inputMode:"numeric",autoComplete:"one-time-code",className:"h-11 rounded-lg"})]}),e.jsx("button",{type:"submit",disabled:o||!v,className:"flex h-12 w-full items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:opacity-50 disabled:pointer-events-none",children:o?"Verifying...":"Verify"}),e.jsx("button",{type:"button",onClick:()=>{L(!1),O(""),E.reset(),_.reset()},disabled:o,className:"mt-1 text-sm text-muted-foreground hover:text-foreground transition-colors",children:"Use a different email"})]}):e.jsxs("form",{onSubmit:te,className:"grid gap-2",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:"Email"}),e.jsx(I,{type:"email",placeholder:"Email address",value:r,onChange:k(j),onBlur:V,required:!0,disabled:o,"aria-invalid":!!c,className:"h-11 rounded-lg"}),c&&e.jsx("p",{className:"text-xs text-destructive",children:c})]}),e.jsx("button",{type:"submit",disabled:o||!v,className:"flex h-12 w-full items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:opacity-50 disabled:pointer-events-none",children:o?"Sending...":"Send code"})]})}),p&&d.enabled&&!$&&e.jsxs("form",{onSubmit:ee,className:"grid gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Email"}),e.jsx(I,{type:"email",placeholder:"you@example.com",value:r,onChange:k(j),onBlur:V,required:!0,disabled:o,"aria-invalid":!!c,className:"h-11 rounded-lg"}),c&&e.jsx("p",{className:"text-xs text-destructive mt-1.5",children:c})]}),e.jsx(Q,{type:"submit",disabled:o||!v,className:"w-full font-semibold",size:"xl",children:o?"Sending...":"Send reset link"})]}),!p&&!x&&d.enabled&&e.jsxs("form",{onSubmit:Z,className:"grid gap-5",children:[h&&e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Name"}),e.jsx(I,{type:"text",placeholder:"Your name",value:w,onChange:k(C),required:!0,disabled:o,className:"h-11 rounded-lg"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Email"}),e.jsx(I,{type:"email",placeholder:"you@example.com",value:r,onChange:k(j),onBlur:V,required:!0,disabled:o,"aria-invalid":!!c,className:"h-11 rounded-lg"}),c&&e.jsx("p",{className:"text-xs text-destructive mt-1.5",children:c})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("label",{className:"block text-sm font-medium text-foreground",children:"Password"}),!h&&u.enabled&&e.jsx("button",{type:"button",onClick:()=>M("forgotPassword"),className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:"Forgot password?"})]}),e.jsx(I,{type:"password",placeholder:"••••••••",value:y,onChange:k(D),required:!0,disabled:o,className:"h-11 rounded-lg"})]}),e.jsx("div",{className:B("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",v?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:e.jsx("div",{className:B("p-1",!v&&"pointer-events-none"),children:e.jsx(Q,{type:"submit",disabled:o||!v,className:B("w-full font-semibold"),size:"xl","aria-hidden":!v,children:o?h?"Creating account...":"Signing in...":"Continue"})})})]}),e.jsx("div",{className:"text-sm text-muted-foreground",children:p?e.jsx("button",{type:"button",onClick:()=>M("signIn"),disabled:o,className:"font-medium text-[#8CAA25] hover:underline disabled:opacity-50",children:"Back to sign in"}):x&&d.enabled?e.jsx("button",{type:"button",onClick:()=>M("signIn"),disabled:o,className:"font-medium text-[#8CAA25] hover:underline disabled:opacity-50",children:"Sign in with password instead"}):!x&&d.enabled?e.jsxs(e.Fragment,{children:[h?"Already have an account? ":"Don't have an account? ",e.jsx("button",{type:"button",onClick:()=>M(h?"signIn":"signUp"),disabled:o,className:"font-medium text-[#8CAA25] hover:underline disabled:opacity-50",children:h?"Sign in":"Sign up"}),i.enabled&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"mx-2",children:"·"}),e.jsx("button",{type:"button",onClick:()=>M("emailOtp"),disabled:o,className:"font-medium text-[#8CAA25] hover:underline disabled:opacity-50",children:"Sign in with email code"})]})]}):null})]})}function ue({redirectTo:s}){const[n,d]=m.useState(null);return m.useEffect(()=>{let u=!1;return(async()=>{try{let i;for(let l=0;l<5&&(i=await fetch("/api/auth/custom/local-session",{method:"POST",credentials:"include"}),!(i.ok||i.status<500));l++)await new Promise(r=>setTimeout(r,Math.min(1e3*2**l,1e4)));if(!i?.ok){const l=await i?.json().catch(()=>({}));throw new Error(l?.error||"Auto-login failed")}if(!u){const l=s.startsWith("/")&&!s.startsWith("//")?s:"/";window.location.href=l}}catch(i){u||d(i instanceof Error?i.message:"Auto-login failed")}})(),()=>{u=!0}},[s]),n?e.jsx("div",{className:"flex min-h-screen items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsxs("p",{className:"text-destructive mb-2",children:["Auto-login failed: ",n]}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Try restarting the server."})]})}):e.jsx(W,{})}function me(s){if(!s.client_id||s.response_type!=="code")return null;const n=new URLSearchParams;return s.client_id&&n.set("client_id",s.client_id),s.redirect_uri&&n.set("redirect_uri",s.redirect_uri),s.response_type&&n.set("response_type",s.response_type),s.state&&n.set("state",s.state),s.scope&&n.set("scope",s.scope),s.code_challenge&&n.set("code_challenge",s.code_challenge),s.code_challenge_method&&n.set("code_challenge_method",s.code_challenge_method),`/api/auth/mcp/authorize?${n.toString()}`}function ge(s){const n=le.c(5),{callbackURL:d,providerId:u}=s;let i,l;n[0]!==d||n[1]!==u?(i=()=>{(async()=>await b.signIn.sso({providerId:u,callbackURL:d}))()},l=[u,d],n[0]=d,n[1]=u,n[2]=i,n[3]=l):(i=n[2],l=n[3]),m.useEffect(i,l);let r;return n[4]===Symbol.for("react.memo_cache_sentinel")?(r=e.jsx(W,{}),n[4]=r):r=n[4],r}function pe(){const s=b.useSession(),n=ie({from:"/login"}),{next:d="/",client_id:u,redirect_uri:i,response_type:l,state:r,scope:j,code_challenge:y,code_challenge_method:D}=n,w=d.startsWith("/")&&!d.startsWith("//")?d:"/",{sso:C,emailAndPassword:A,magicLink:O,emailOtp:f,socialProviders:L,localMode:F}=X(),N=me({client_id:u,redirect_uri:i,response_type:l,state:r,scope:j,code_challenge:y,code_challenge_method:D}),c=N||w;return s.data?N?(window.location.href=N,e.jsx(W,{})):e.jsx(oe,{to:w}):F?e.jsx(ue,{redirectTo:c}):C.enabled?e.jsx(ge,{callbackURL:c,providerId:C.providerId}):A.enabled||O.enabled||f.enabled||L.enabled?e.jsx(de,{children:e.jsx(ce,{redirectUrl:N,callbackUrl:w})}):e.jsx("div",{children:"No login options available"})}export{pe as default};
|
|
1
|
+
import{u as X,r as m,a as z,t as P,b,j as e,c as B,B as Q,d as ie,S as W,N as oe,e as le}from"./index-Bf7aO1A-.js";import{I}from"./input-Fpo5hVEP.js";import{A as de}from"./auth-split-layout-CT4AkDzg.js";function ce({redirectUrl:s,callbackUrl:n="/"}){const{emailAndPassword:d,resetPassword:u,emailOtp:i,socialProviders:l}=X(),[r,j]=m.useState(""),[y,D]=m.useState(""),[w,C]=m.useState(""),[A,O]=m.useState(""),[f,L]=m.useState(!1),[F,N]=m.useState(()=>i.enabled?"emailOtp":globalThis.localStorage?.getItem("hasLoggedIn")!=="true"?"signUp":"signIn"),[c,S]=m.useState(""),[$,Y]=m.useState(!1),h=F==="signUp",p=F==="forgotPassword",x=F==="emailOtp",R=z({mutationFn:async({email:t,password:a,name:q})=>{try{if(h){const g=await b.signUp.email({email:t,password:a,name:q||""});if(g.error)throw new Error(g.error.message||"Sign up failed");return g}else{const g=await b.signIn.email({email:t,password:a});if(g.error)throw new Error(g.error.message||"Sign in failed");return g}}catch(g){throw g instanceof Error?g:new Error("Authentication failed")}},onSuccess:()=>{globalThis.localStorage?.setItem("hasLoggedIn","true"),window.location.href=s??n},onError:t=>{P(h?"user_signup_failed":"user_signin_failed",{error:t instanceof Error?t.message:String(t)})}}),U=z({mutationFn:async({email:t})=>{const a=await b.requestPasswordReset({email:t,redirectTo:"/reset-password"});if(a.error)throw new Error(a.error.message||"Failed to send reset email");return a},onSuccess:()=>{P("password_reset_requested"),Y(!0)},onError:t=>{P("password_reset_request_failed",{error:t instanceof Error?t.message:String(t)})}}),E=z({mutationFn:async({email:t})=>{const a=await b.emailOtp.sendVerificationOtp({email:t,type:"sign-in"});if(a.error)throw new Error(a.error.message||"Failed to send code");return a},onSuccess:()=>{P("email_otp_sent"),L(!0)},onError:t=>{P("email_otp_send_failed",{error:t instanceof Error?t.message:String(t)})}}),_=z({mutationFn:async({email:t,otp:a})=>{const q=await b.signIn.emailOtp({email:t,otp:a});if(q.error)throw new Error(q.error.message||"Invalid code");return q},onSuccess:()=>{globalThis.localStorage?.setItem("hasLoggedIn","true"),window.location.href=s??n},onError:t=>{P("email_otp_verify_failed",{error:t instanceof Error?t.message:String(t)})}}),T=t=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t),V=()=>{r.trim()&&!T(r)&&S("Invalid email address")},Z=t=>{if(t.preventDefault(),!T(r)){S("Invalid email address");return}R.mutate({email:r,password:y,name:w})},ee=t=>{if(t.preventDefault(),!T(r)){S("Invalid email address");return}U.mutate({email:r})},te=t=>{if(t.preventDefault(),!T(r)){S("Invalid email address");return}E.mutate({email:r})},se=t=>{t.preventDefault(),_.mutate({email:r,otp:A})},k=t=>a=>{t(a.target.value),G&&R.reset(),H&&U.reset(),J&&(E.reset(),_.reset()),t===j&&c&&S("")},M=t=>{N(t),C(""),O(""),L(!1),S(""),Y(!1),R.reset(),U.reset(),E.reset(),_.reset()},o=R.isPending||U.isPending||E.isPending||_.isPending,G=R.error,H=U.error,J=E.error||_.error,v=h?r.trim()&&y.trim()&&w.trim():p?r.trim():x?f?A.trim():r.trim():r.trim()&&y.trim(),ne=t=>{if(!t)return null;const a=t.message.toLowerCase();return a.includes("unauthorized")||a.includes("401")?"Invalid email or password. Please try again.":a.includes("already exists")||a.includes("409")?"An account with this email already exists. Try signing in instead.":a.includes("network")||a.includes("fetch")?"Network error. Please check your connection and try again.":a.includes("rate limit")||a.includes("429")?"Too many attempts. Please wait a moment and try again.":a.includes("invalid")&&a.includes("otp")?"Invalid or expired code. Please try again.":t.message||"An error occurred. Please try again."},K=G||H||J,re=p?"Reset your password":x&&f?"Enter verification code":"Welcome to deco",ae=p?"We'll send you a reset link":x&&f?`Code sent to ${r}`:"Sign in or create a new account";return e.jsxs("div",{className:"w-full grid gap-10",children:[e.jsxs("div",{children:[e.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),e.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h1",{className:"text-2xl font-medium leading-8",children:re}),e.jsx("p",{className:"text-base text-muted-foreground leading-6",children:ae})]}),K&&e.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:ne(K)}),$&&e.jsx("div",{className:"rounded-xl bg-emerald-500/10 p-3 text-sm text-emerald-600 dark:text-emerald-400 text-center",children:"Check your email for a password reset link."}),!p&&!(x&&f)&&l.enabled&&e.jsx("div",{className:"grid gap-2",children:l.providers.map(t=>e.jsxs("button",{type:"button",disabled:o,onClick:()=>{b.signIn.social({provider:t.name,callbackURL:s??n})},className:"flex h-12 w-full items-center justify-center gap-3 rounded-xl bg-background dark:bg-input/30 px-3 text-sm font-medium text-foreground card-shadow transition-colors hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 disabled:opacity-50 disabled:pointer-events-none",children:[t.icon&&e.jsx("img",{src:t.icon,alt:"",className:B("h-5 w-5",t.name==="github"&&"dark:invert"),"aria-hidden":"true"}),"Continue with"," ",t.name.charAt(0).toUpperCase()+t.name.slice(1)]},t.name))}),!p&&!(x&&f)&&l.enabled&&(d.enabled||i.enabled)&&e.jsxs("div",{className:"flex items-center gap-2.5 -my-4",children:[e.jsx("div",{className:"h-px flex-1 bg-border"}),e.jsx("span",{className:"text-base text-muted-foreground",children:"or"}),e.jsx("div",{className:"h-px flex-1 bg-border"})]}),x&&i.enabled&&e.jsx(e.Fragment,{children:f?e.jsxs("form",{onSubmit:se,className:"grid gap-2",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:"Verification code"}),e.jsx(I,{type:"text",placeholder:"Enter code",value:A,onChange:k(O),required:!0,disabled:o,autoFocus:!0,inputMode:"numeric",autoComplete:"one-time-code",className:"h-11 rounded-lg"})]}),e.jsx("button",{type:"submit",disabled:o||!v,className:"flex h-12 w-full items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:opacity-50 disabled:pointer-events-none",children:o?"Verifying...":"Verify"}),e.jsx("button",{type:"button",onClick:()=>{L(!1),O(""),E.reset(),_.reset()},disabled:o,className:"mt-1 text-sm text-muted-foreground hover:text-foreground transition-colors",children:"Use a different email"})]}):e.jsxs("form",{onSubmit:te,className:"grid gap-2",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:"Email"}),e.jsx(I,{type:"email",placeholder:"Email address",value:r,onChange:k(j),onBlur:V,required:!0,disabled:o,"aria-invalid":!!c,className:"h-11 rounded-lg"}),c&&e.jsx("p",{className:"text-xs text-destructive",children:c})]}),e.jsx("button",{type:"submit",disabled:o||!v,className:"flex h-12 w-full items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:opacity-50 disabled:pointer-events-none",children:o?"Sending...":"Send code"})]})}),p&&d.enabled&&!$&&e.jsxs("form",{onSubmit:ee,className:"grid gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Email"}),e.jsx(I,{type:"email",placeholder:"you@example.com",value:r,onChange:k(j),onBlur:V,required:!0,disabled:o,"aria-invalid":!!c,className:"h-11 rounded-lg"}),c&&e.jsx("p",{className:"text-xs text-destructive mt-1.5",children:c})]}),e.jsx(Q,{type:"submit",disabled:o||!v,className:"w-full font-semibold",size:"xl",children:o?"Sending...":"Send reset link"})]}),!p&&!x&&d.enabled&&e.jsxs("form",{onSubmit:Z,className:"grid gap-5",children:[h&&e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Name"}),e.jsx(I,{type:"text",placeholder:"Your name",value:w,onChange:k(C),required:!0,disabled:o,className:"h-11 rounded-lg"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Email"}),e.jsx(I,{type:"email",placeholder:"you@example.com",value:r,onChange:k(j),onBlur:V,required:!0,disabled:o,"aria-invalid":!!c,className:"h-11 rounded-lg"}),c&&e.jsx("p",{className:"text-xs text-destructive mt-1.5",children:c})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("label",{className:"block text-sm font-medium text-foreground",children:"Password"}),!h&&u.enabled&&e.jsx("button",{type:"button",onClick:()=>M("forgotPassword"),className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:"Forgot password?"})]}),e.jsx(I,{type:"password",placeholder:"••••••••",value:y,onChange:k(D),required:!0,disabled:o,className:"h-11 rounded-lg"})]}),e.jsx("div",{className:B("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",v?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:e.jsx("div",{className:B("p-1",!v&&"pointer-events-none"),children:e.jsx(Q,{type:"submit",disabled:o||!v,className:B("w-full font-semibold"),size:"xl","aria-hidden":!v,children:o?h?"Creating account...":"Signing in...":"Continue"})})})]}),e.jsx("div",{className:"text-sm text-muted-foreground",children:p?e.jsx("button",{type:"button",onClick:()=>M("signIn"),disabled:o,className:"font-medium text-[#8CAA25] hover:underline disabled:opacity-50",children:"Back to sign in"}):x&&d.enabled?e.jsx("button",{type:"button",onClick:()=>M("signIn"),disabled:o,className:"font-medium text-[#8CAA25] hover:underline disabled:opacity-50",children:"Sign in with password instead"}):!x&&d.enabled?e.jsxs(e.Fragment,{children:[h?"Already have an account? ":"Don't have an account? ",e.jsx("button",{type:"button",onClick:()=>M(h?"signIn":"signUp"),disabled:o,className:"font-medium text-[#8CAA25] hover:underline disabled:opacity-50",children:h?"Sign in":"Sign up"}),i.enabled&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"mx-2",children:"·"}),e.jsx("button",{type:"button",onClick:()=>M("emailOtp"),disabled:o,className:"font-medium text-[#8CAA25] hover:underline disabled:opacity-50",children:"Sign in with email code"})]})]}):null})]})}function ue({redirectTo:s}){const[n,d]=m.useState(null);return m.useEffect(()=>{let u=!1;return(async()=>{try{let i;for(let l=0;l<5&&(i=await fetch("/api/auth/custom/local-session",{method:"POST",credentials:"include"}),!(i.ok||i.status<500));l++)await new Promise(r=>setTimeout(r,Math.min(1e3*2**l,1e4)));if(!i?.ok){const l=await i?.json().catch(()=>({}));throw new Error(l?.error||"Auto-login failed")}if(!u){const l=s.startsWith("/")&&!s.startsWith("//")?s:"/";window.location.href=l}}catch(i){u||d(i instanceof Error?i.message:"Auto-login failed")}})(),()=>{u=!0}},[s]),n?e.jsx("div",{className:"flex min-h-screen items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsxs("p",{className:"text-destructive mb-2",children:["Auto-login failed: ",n]}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Try restarting the server."})]})}):e.jsx(W,{})}function me(s){if(!s.client_id||s.response_type!=="code")return null;const n=new URLSearchParams;return s.client_id&&n.set("client_id",s.client_id),s.redirect_uri&&n.set("redirect_uri",s.redirect_uri),s.response_type&&n.set("response_type",s.response_type),s.state&&n.set("state",s.state),s.scope&&n.set("scope",s.scope),s.code_challenge&&n.set("code_challenge",s.code_challenge),s.code_challenge_method&&n.set("code_challenge_method",s.code_challenge_method),`/api/auth/mcp/authorize?${n.toString()}`}function ge(s){const n=le.c(5),{callbackURL:d,providerId:u}=s;let i,l;n[0]!==d||n[1]!==u?(i=()=>{(async()=>await b.signIn.sso({providerId:u,callbackURL:d}))()},l=[u,d],n[0]=d,n[1]=u,n[2]=i,n[3]=l):(i=n[2],l=n[3]),m.useEffect(i,l);let r;return n[4]===Symbol.for("react.memo_cache_sentinel")?(r=e.jsx(W,{}),n[4]=r):r=n[4],r}function pe(){const s=b.useSession(),n=ie({from:"/login"}),{next:d="/",client_id:u,redirect_uri:i,response_type:l,state:r,scope:j,code_challenge:y,code_challenge_method:D}=n,w=d.startsWith("/")&&!d.startsWith("//")?d:"/",{sso:C,emailAndPassword:A,magicLink:O,emailOtp:f,socialProviders:L,localMode:F}=X(),N=me({client_id:u,redirect_uri:i,response_type:l,state:r,scope:j,code_challenge:y,code_challenge_method:D}),c=N||w;return s.data?N?(window.location.href=N,e.jsx(W,{})):e.jsx(oe,{to:w}):F?e.jsx(ue,{redirectTo:c}):C.enabled?e.jsx(ge,{callbackURL:c,providerId:C.providerId}):A.enabled||O.enabled||f.enabled||L.enabled?e.jsx(de,{children:e.jsx(ce,{redirectUrl:N,callbackUrl:w})}):e.jsx("div",{children:"No login options available"})}export{pe as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{P as Dt,r as ce,q as fe,D as De,b as $t,F as kt,a as pe,t as ue,o as G,K as ie,j as s,B as Pe,e as Y,s as Ft,n as Tt,c as ze,l as Xe,E as Lt}from"./index-
|
|
1
|
+
import{P as Dt,r as ce,q as fe,D as De,b as $t,F as kt,a as pe,t as ue,o as G,K as ie,j as s,B as Pe,e as Y,s as Ft,n as Tt,c as ze,l as Xe,E as Lt}from"./index-Bf7aO1A-.js";import{C as Ot}from"./collection-display-button-mD3oc4np.js";import{S as qt}from"./search-input-DglPcAnH.js";import{P as Ee}from"./index-DPqqDw7W.js";import{C as Bt}from"./collection-table-wrapper-C7oTCBDJ.js";import{E as We}from"./empty-state-Rnc2dhkR.js";import{b as Kt,h as Vt,a as Qt,c as Ut,d as Gt,D as Jt}from"./dialog-C40tWbjB.js";import{a as Ht,F as rt,b as ct,c as Wt,d as mt,f as dt}from"./form-C2fWcpmD.js";import{S as et,a as tt,b as st,c as nt,d as it}from"./select-ufdAhrF_.js";import{T as Yt}from"./textarea-Cna17PTh.js";import{u as at}from"./use-org-auth-client-DOzELmrd.js";import{u as It}from"./use-organization-roles-CZP0dNKh.js";import{u as Zt}from"./use-members-cPnrxPK_.js";import{S as $e,u as ke}from"./constants-B8os5nMI.js";import{T as Xt,a as es,c as ts,b as ss}from"./tooltip-Kfr4gA8D.js";import{a as ut,e as ft,g as gt,b as ht,c as pt,d as xt,f as bt,A as jt}from"./alert-dialog-B_i_ps7f.js";import{A as Ve}from"./avatar-BRyrVRDm.js";import{B as Ue}from"./badge-BTq6_dwU.js";import{C as vt}from"./card-CSM7jg8b.js";import{D as At,a as Mt,b as Et,d as ns,e as is,f as ls,c as lt,i as as}from"./dropdown-menu-nlgjcLMp.js";import{i as Pt}from"./DotsVertical-BFb-15-m.js";import{i as os}from"./Key01-BOHiIHj-.js";import{i as rs}from"./Shield01-BzHuCaEB.js";import{a as cs}from"./SwitchHorizontal01-C1fzb4rn.js";import{s as ms}from"./Trash01-v5Dy47Wj.js";import{s as _t}from"./XClose-DgRHRNhM.js";import{C as Ct}from"./checkbox-Dz5JG34i.js";import{e as Ye,a as Ze,f as yt,C as ds,c as us,d as fs,b as gs}from"./command-CE-N-Fow.js";import{b as hs,P as ps,a as xs}from"./popover-BkyXjLv-.js";import{t as bs}from"./ChevronDown-BHt79TDc.js";import{s as js}from"./Plus-C5l4faC1.js";import"./Check-BBN8jtrj.js";import"./view-mode-toggle-DXRcEzPg.js";import"./SearchMd-rTsELW21.js";import"./sidebar-CkEPveNS.js";import"./LayoutLeft-NsiLg-Hz.js";import"./X-DkujvqvQ.js";import"./table-Dy93uecr.js";import"./label-FRw7B4TG.js";import"./ChevronUp-Hv5s5GCl.js";import"./User01-CtanRIko.js";import"./ChevronRight-CgiGzJK2.js";import"./index-DsxbUaF_.js";const vs=Dt().email("Invalid email address");function Cs(t){if(!t.trim())return[];const e=t.split(/[,;\n]/).map(n=>n.trim().toLowerCase()).filter(n=>n.length>0);return Array.from(new Set(e))}function ys({trigger:t}){const[e,n]=ce.useState(!1),{locator:o}=fe(),r=at(),l=De(),{data:i}=$t.useSession(),a=i?.user?.email,{roles:m,isLoading:g}=It(),h=m.filter(d=>d.role!=="owner"),p=kt({mode:"onChange",defaultValues:{emailsText:"",role:"user"}}),j=p.watch("emailsText"),I=p.watch("role"),v=Cs(j).filter(d=>{const c=vs.safeParse(d).success,x=!a||d!==a.toLowerCase();return c&&x}),N=pe({mutationFn:async({emails:d,role:c})=>{if(!c)throw new Error("Please select a role");const x=await Promise.allSettled(d.map(async w=>{const M=await r.organization.inviteMember({email:w,role:c});if(M.error)throw new Error(M.error.message);return M.data})),A=x.filter(w=>w.status==="rejected");if(A.length>0)throw new Error(`Failed to invite ${A.length} member${A.length>1?"s":""}`);return x},onSuccess:(d,{emails:c,role:x})=>{ue("member_invited",{count:c.length,role:x}),l.invalidateQueries({queryKey:ie.members(o)}),l.invalidateQueries({queryKey:ie.invitations(o)}),G.success(c.length===1?"Member invited successfully!":`${c.length} members invited successfully!`),p.reset({emailsText:"",role:"user"}),n(!1)},onError:(d,{emails:c,role:x})=>{ue("member_invite_failed",{count:c.length,role:x,error:d instanceof Error?d.message:String(d)}),G.error(d instanceof Error?d.message:"Failed to invite members")}}),y=d=>{if(v.length===0){G.error("Please enter at least one valid email address");return}if(!d.role){G.error("Please select a role");return}N.mutate({emails:v,role:d.role})},D=v.length>0&&!!I;return s.jsxs(Kt,{open:e,onOpenChange:n,children:[s.jsx(Vt,{asChild:!0,children:t}),s.jsxs(Qt,{className:"sm:max-w-lg",children:[s.jsx(Ut,{children:s.jsx(Gt,{children:"Invite members"})}),s.jsx(Ht,{...p,children:s.jsxs("form",{onSubmit:p.handleSubmit(y),className:"space-y-4",children:[s.jsx(rt,{control:p.control,name:"emailsText",render:({field:d})=>s.jsxs(ct,{children:[s.jsx(Wt,{children:"Email addresses"}),s.jsx(mt,{children:s.jsx(Yt,{...d,disabled:N.isPending,placeholder:`Enter email addresses separated by commas or new lines
|
|
2
2
|
e.g. user1@example.com, user2@example.com
|
|
3
3
|
or one per line`,className:"min-h-[120px] resize-none"})}),s.jsx(dt,{})]})}),s.jsx(rt,{control:p.control,name:"role",render:({field:d})=>s.jsxs(ct,{children:[s.jsx(mt,{children:s.jsxs(et,{value:d.value,onValueChange:d.onChange,disabled:N.isPending||g,children:[s.jsx(tt,{className:"w-full",children:s.jsx(st,{placeholder:"Select a role"})}),s.jsx(nt,{children:h.map(c=>{const x=[];return c.isBuiltin||(c.allowsAllStaticPermissions?x.push("Full org access"):c.staticPermissionCount&&c.staticPermissionCount>0&&x.push(`${c.staticPermissionCount} org perm${c.staticPermissionCount!==1?"s":""}`),c.allowsAllConnections?x.push("All connections"):c.connectionCount&&c.connectionCount>0&&x.push(`${c.connectionCount} connection${c.connectionCount!==1?"s":""}`),(c.connectionCount!==0||c.allowsAllConnections)&&(c.allowsAllTools?x.push("all tools"):c.toolCount&&c.toolCount>0&&x.push(`${c.toolCount} tool${c.toolCount!==1?"s":""}`))),s.jsx(it,{value:c.role,children:s.jsxs("div",{className:"flex flex-col",children:[s.jsx("span",{children:c.label}),!c.isBuiltin&&x.length>0&&s.jsx("span",{className:"text-xs text-muted-foreground",children:x.join(", ")})]})},c.role)})})]})}),s.jsx(dt,{})]})}),s.jsxs(Jt,{children:[s.jsx(Pe,{variant:"outline",onClick:()=>{p.reset({emailsText:"",role:"user"}),n(!1)},type:"button",disabled:N.isPending,children:"Cancel"}),s.jsx(Pe,{type:"submit",disabled:N.isPending||!D,children:N.isPending?"Inviting...":`Invite ${v.length||0} Member${v.length!==1?"s":""}`})]})]})})]})]})}function Ss(){const t=Y.c(10),{org:e,locator:n}=fe();let o;t[0]!==e.id||t[1]!==e.slug?(o={connectionId:$e,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=o):o=t[2];const r=ke(o);let l;t[3]!==n?(l=ie.invitations(n),t[3]=n,t[4]=l):l=t[4];let i;t[5]!==r?(i=async()=>{const m=await r.callTool({name:"ORGANIZATION_GET",arguments:{}});return(m.structuredContent??m)?.invitations??[]},t[5]=r,t[6]=i):i=t[6];let a;return t[7]!==l||t[8]!==i?(a={queryKey:l,queryFn:i},t[7]=l,t[8]=i,t[9]=a):a=t[9],Ft(a)}function ws(){const t=Y.c(10),{locator:e}=fe(),n=at(),o=De();let r;t[0]!==n?(r=async g=>{const h=await n.organization.cancelInvitation({invitationId:g});if(h?.error)throw new Error(h.error.message);return h.data},t[0]=n,t[1]=r):r=t[1];let l;t[2]!==e||t[3]!==o?(l=()=>{o.invalidateQueries({queryKey:ie.invitations(e)}),G.success("Invitation cancelled")},t[2]=e,t[3]=o,t[4]=l):l=t[4];let i;t[5]!==r||t[6]!==l?(i={mutationFn:r,onSuccess:l,onError:Ns},t[5]=r,t[6]=l,t[7]=i):i=t[7];const a=pe(i);let m;return t[8]!==a?(m={cancel:a},t[8]=a,t[9]=m):m=t[9],m}function Ns(t){G.error(t instanceof Error?t.message:"Failed to cancel invitation")}function Ts(){const t=Y.c(10),{org:e,locator:n}=fe();let o;t[0]!==e.id||t[1]!==e.slug?(o={connectionId:$e,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=o):o=t[2];const r=ke(o);let l;t[3]!==n?(l=ie.tags(n),t[3]=n,t[4]=l):l=t[4];let i;t[5]!==r?(i=async()=>{const m=await r.callTool({name:"TAGS_LIST",arguments:{}});return(m.structuredContent??m).tags},t[5]=r,t[6]=i):i=t[6];let a;return t[7]!==l||t[8]!==i?(a={queryKey:l,queryFn:i,staleTime:3e4},t[7]=l,t[8]=i,t[9]=a):a=t[9],Tt(a)}function Is(){const t=Y.c(11),e=De(),{org:n,locator:o}=fe();let r;t[0]!==n.id||t[1]!==n.slug?(r={connectionId:$e,orgId:n.id,orgSlug:n.slug},t[0]=n.id,t[1]=n.slug,t[2]=r):r=t[2];const l=ke(r);let i;t[3]!==l?(i=async g=>{const h=await l.callTool({name:"TAGS_CREATE",arguments:{name:g}});return(h.structuredContent??h).tag},t[3]=l,t[4]=i):i=t[4];let a;t[5]!==o||t[6]!==e?(a=()=>{e.invalidateQueries({queryKey:ie.tags(o)})},t[5]=o,t[6]=e,t[7]=a):a=t[7];let m;return t[8]!==i||t[9]!==a?(m={mutationFn:i,onSuccess:a,onError:As},t[8]=i,t[9]=a,t[10]=m):m=t[10],pe(m)}function As(t){G.error(t instanceof Error?t.message:"Failed to create tag")}function Ms(t){const e=Y.c(13),{org:n,locator:o}=fe();let r;e[0]!==n.id||e[1]!==n.slug?(r={connectionId:$e,orgId:n.id,orgSlug:n.slug},e[0]=n.id,e[1]=n.slug,e[2]=r):r=e[2];const l=ke(r);let i;e[3]!==o||e[4]!==t?(i=ie.memberTags(o,t),e[3]=o,e[4]=t,e[5]=i):i=e[5];let a;e[6]!==l||e[7]!==t?(a=async()=>{const h=await l.callTool({name:"MEMBER_TAGS_GET",arguments:{memberId:t}});return(h.structuredContent??h).tags},e[6]=l,e[7]=t,e[8]=a):a=e[8];const m=!!t;let g;return e[9]!==i||e[10]!==a||e[11]!==m?(g={queryKey:i,queryFn:a,staleTime:3e4,enabled:m},e[9]=i,e[10]=a,e[11]=m,e[12]=g):g=e[12],Tt(g)}function Es(){const t=Y.c(11),e=De(),{org:n,locator:o}=fe();let r;t[0]!==n.id||t[1]!==n.slug?(r={connectionId:$e,orgId:n.id,orgSlug:n.slug},t[0]=n.id,t[1]=n.slug,t[2]=r):r=t[2];const l=ke(r);let i;t[3]!==l?(i=async g=>{const{memberId:h,tagIds:p}=g,j=await l.callTool({name:"MEMBER_TAGS_SET",arguments:{memberId:h,tagIds:p}});return j.structuredContent??j},t[3]=l,t[4]=i):i=t[4];let a;t[5]!==o||t[6]!==e?(a=(g,h)=>{e.invalidateQueries({queryKey:ie.memberTags(o,h.memberId)})},t[5]=o,t[6]=e,t[7]=a):a=t[7];let m;return t[8]!==i||t[9]!==a?(m={mutationFn:i,onSuccess:a,onError:Ps},t[8]=i,t[9]=a,t[10]=m):m=t[10],pe(m)}function Ps(t){G.error(t instanceof Error?t.message:"Failed to update member tags")}function Rt(t){const e=Y.c(44),{memberId:n,className:o,disabled:r,placeholder:l,maxDisplay:i}=t,a=r===void 0?!1:r,m=l===void 0?"Add tags...":l,g=i===void 0?2:i,[h,p]=ce.useState(!1),[j,I]=ce.useState(""),{data:R,isLoading:v}=Ts(),N=R===void 0?[]:R,{data:y,isLoading:D}=Ms(n),d=y===void 0?[]:y,c=Is(),x=Es(),A=v||D,w=d.map(Rs);let M;e[0]!==j?(M=S=>S.name.toLowerCase().includes(j.toLowerCase()),e[0]=j,e[1]=M):M=e[1];const z=N.filter(M);let T;e[2]!==j?(T=S=>S.name.toLowerCase()===j.toLowerCase(),e[2]=j,e[3]=T):T=e[3];const K=N.find(T),E=j.trim()&&!K,k=async S=>{const he=w.includes(S.id)?w.filter(je=>je!==S.id):[...w,S.id];await x.mutateAsync({memberId:n,tagIds:he})},P=async()=>{if(!j.trim())return;const S=await c.mutateAsync(j.trim());await x.mutateAsync({memberId:n,tagIds:[...w,S.id]}),I("")},u=async S=>{const ne=w.filter(he=>he!==S);await x.mutateAsync({memberId:n,tagIds:ne})},C=c.isPending||x.isPending,O=ps;let $;e[4]!==h?($=()=>p(!h),e[4]=h,e[5]=$):$=e[5];let F;e[6]!==o?(F=ze("h-auto min-h-8 px-2 py-1 justify-start font-normal","hover:bg-accent/50",o),e[6]=o,e[7]=F):F=e[7];const V=a||A,L=A?s.jsx(Xe,{size:14,className:"animate-spin text-muted-foreground"}):d.length>0?s.jsxs("div",{className:"flex items-center gap-1 flex-wrap",children:[d.slice(0,g).map(_s),d.length>g&&s.jsxs(Ue,{variant:"secondary",className:"text-xs px-1.5 py-0 h-5",children:["+",d.length-g]})]}):s.jsx("span",{className:"text-muted-foreground text-xs",children:m});let Q;e[8]===Symbol.for("react.memo_cache_sentinel")?(Q=s.jsx(bs,{size:14,className:"ml-1 shrink-0 opacity-50"}),e[8]=Q):Q=e[8];let q;e[9]!==V||e[10]!==L||e[11]!==$||e[12]!==F?(q=s.jsx(xs,{asChild:!0,children:s.jsxs(Pe,{variant:"ghost",size:"sm",onClick:$,className:F,disabled:V,children:[L,Q]})}),e[9]=V,e[10]=L,e[11]=$,e[12]=F,e[13]=q):q=e[13];const U=hs,J="w-56 p-0",H="start";let W;e[14]===Symbol.for("react.memo_cache_sentinel")?(W=()=>p(!1),e[14]=W):W=e[14];const le=fs,xe=!1;let Z;e[15]!==j?(Z=s.jsx(gs,{placeholder:"Search or create...",value:j,onValueChange:I,className:"h-9"}),e[15]=j,e[16]=Z):Z=e[16];const ae=us,me=d.length>0&&s.jsxs(s.Fragment,{children:[s.jsx(Ye,{heading:"Selected",children:d.map(S=>s.jsx(Ze,{onSelect:()=>k(S),className:"cursor-pointer",children:s.jsxs("div",{className:"flex items-center justify-between w-full",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ct,{checked:!0,className:"[&_svg]:!text-primary-foreground"}),s.jsx("span",{children:S.name})]}),s.jsx("button",{onClick:ne=>{ne.stopPropagation(),u(S.id)},className:"opacity-50 hover:opacity-100",disabled:C,children:s.jsx(_t,{size:14})})]})},S.id))}),s.jsx(yt,{})]}),_e=Ye,be="Available",Re=z.length===0&&!E&&s.jsx(ds,{children:"No tags found."}),ge=z.filter(S=>!w.includes(S.id)).map(S=>s.jsx(Ze,{onSelect:()=>k(S),className:"cursor-pointer",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ct,{checked:!1,className:"[&_svg]:!text-primary-foreground"}),s.jsx("span",{children:S.name})]})},S.id));let oe;e[17]!==_e||e[18]!==Re||e[19]!==ge?(oe=s.jsxs(_e,{heading:be,children:[Re,ge]}),e[17]=_e,e[18]=Re,e[19]=ge,e[20]=oe):oe=e[20];let re;e[21]!==P||e[22]!==C||e[23]!==j||e[24]!==E?(re=E&&s.jsxs(s.Fragment,{children:[s.jsx(yt,{}),s.jsx(Ye,{children:s.jsx(Ze,{onSelect:P,className:"cursor-pointer",disabled:C,children:s.jsxs("div",{className:"flex items-center gap-2 text-primary",children:[C?s.jsx(Xe,{size:14,className:"animate-spin"}):s.jsx(js,{size:14}),s.jsxs("span",{children:['Create "',j.trim(),'"']})]})})})]}),e[21]=P,e[22]=C,e[23]=j,e[24]=E,e[25]=re):re=e[25];let X;e[26]!==ae||e[27]!==me||e[28]!==oe||e[29]!==re?(X=s.jsxs(ae,{children:[me,oe,re]}),e[26]=ae,e[27]=me,e[28]=oe,e[29]=re,e[30]=X):X=e[30];let ee;e[31]!==le||e[32]!==Z||e[33]!==X?(ee=s.jsxs(le,{shouldFilter:xe,children:[Z,X]}),e[31]=le,e[32]=Z,e[33]=X,e[34]=ee):ee=e[34];let te;e[35]!==U||e[36]!==W||e[37]!==ee?(te=s.jsx(U,{className:J,align:H,onEscapeKeyDown:W,children:ee}),e[35]=U,e[36]=W,e[37]=ee,e[38]=te):te=e[38];let se;return e[39]!==O||e[40]!==h||e[41]!==q||e[42]!==te?(se=s.jsxs(O,{open:h,onOpenChange:p,children:[q,te]}),e[39]=O,e[40]=h,e[41]=q,e[42]=te,e[43]=se):se=e[43],se}function _s(t){return s.jsx(Ue,{variant:"secondary",className:"text-xs px-1.5 py-0 h-5",children:t.name},t.id)}function Rs(t){return t.id}const St=["bg-neutral-400","bg-red-500","bg-orange-500","bg-amber-500","bg-yellow-500","bg-lime-500","bg-green-500","bg-emerald-500","bg-teal-500","bg-cyan-500","bg-sky-500","bg-blue-500","bg-indigo-500","bg-violet-500","bg-purple-500","bg-fuchsia-500","bg-pink-500","bg-rose-500","bg-slate-500"],zs={owner:"bg-red-500",admin:"bg-blue-500",user:"bg-green-500"};function Qe(t){return t?t.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2):"?"}function Ds(t){const e=new Map;for(const[n,o]of Object.entries(zs))e.set(n,o);for(let n=0;n<t.length;n++){const o=t[n];o&&!e.has(o.role)&&e.set(o.role,St[n%St.length]??"bg-neutral-400")}return e}function $s(t){return new Date(t).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})}function Ke(t){const e=Y.c(79),{role:n,memberId:o,isOwner:r,roleColorMap:l,selectableRoles:i,onRoleChange:a,size:m,className:g}=t,h=m===void 0?"xs":m;let p,j,I,R,v,N,y,D,d,c,x;if(e[0]!==g||e[1]!==r||e[2]!==o||e[3]!==a||e[4]!==n||e[5]!==l||e[6]!==i||e[7]!==h){x=Symbol.for("react.early_return_sentinel");e:{const P=l.get(n)??"bg-neutral-400";if(r){let u;e[19]!==o||e[20]!==a?(u=J=>a(o,J),e[19]=o,e[20]=a,e[21]=u):u=e[21];let C;e[22]!==n?(C=s.jsx("span",{className:"capitalize truncate",children:n}),e[22]=n,e[23]=C):C=e[23];const O=s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[s.jsx("div",{className:ze("size-2 rounded-full shrink-0",P)}),C]});let $;e[24]!==O?($=s.jsx(st,{children:O}),e[24]=O,e[25]=$):$=e[25];let F;e[26]!==g||e[27]!==h||e[28]!==$?(F=s.jsx(tt,{size:h,className:g,children:$}),e[26]=g,e[27]=h,e[28]=$,e[29]=F):F=e[29];let V;if(e[30]!==l||e[31]!==i){let J;e[33]!==l?(J=H=>{const W=l.get(H.role)??"bg-neutral-400";return s.jsx(it,{value:H.role,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:ze("size-3 rounded-full",W)}),s.jsx("span",{className:"capitalize",children:H.label})]})},H.role)},e[33]=l,e[34]=J):J=e[34],V=i.map(J),e[30]=l,e[31]=i,e[32]=V}else V=e[32];let L;e[35]!==V?(L=s.jsx(nt,{children:V}),e[35]=V,e[36]=L):L=e[36];let Q;e[37]!==r||e[38]!==n||e[39]!==u||e[40]!==F||e[41]!==L?(Q=s.jsx(Xt,{asChild:!0,children:s.jsx("div",{className:"w-fit",children:s.jsxs(et,{value:n,onValueChange:u,disabled:r,children:[F,L]})})}),e[37]=r,e[38]=n,e[39]=u,e[40]=F,e[41]=L,e[42]=Q):Q=e[42];let q;e[43]===Symbol.for("react.memo_cache_sentinel")?(q=s.jsx(es,{children:s.jsx("p",{children:"The owner role cannot be changed"})}),e[43]=q):q=e[43];let U;e[44]!==Q?(U=s.jsx(ts,{children:s.jsxs(ss,{children:[Q,q]})}),e[44]=Q,e[45]=U):U=e[45],x=U;break e}I=et,D=n,e[46]!==o||e[47]!==a?(d=u=>a(o,u),e[46]=o,e[47]=a,e[48]=d):d=e[48],c=r,j=tt,N=h,y=g,p=st,v="flex items-center gap-2 min-w-0",R=ze("size-2 rounded-full shrink-0",P)}e[0]=g,e[1]=r,e[2]=o,e[3]=a,e[4]=n,e[5]=l,e[6]=i,e[7]=h,e[8]=p,e[9]=j,e[10]=I,e[11]=R,e[12]=v,e[13]=N,e[14]=y,e[15]=D,e[16]=d,e[17]=c,e[18]=x}else p=e[8],j=e[9],I=e[10],R=e[11],v=e[12],N=e[13],y=e[14],D=e[15],d=e[16],c=e[17],x=e[18];if(x!==Symbol.for("react.early_return_sentinel"))return x;let A;e[49]!==R?(A=s.jsx("div",{className:R}),e[49]=R,e[50]=A):A=e[50];let w;e[51]!==n?(w=s.jsx("span",{className:"capitalize truncate",children:n}),e[51]=n,e[52]=w):w=e[52];let M;e[53]!==A||e[54]!==w||e[55]!==v?(M=s.jsxs("div",{className:v,children:[A,w]}),e[53]=A,e[54]=w,e[55]=v,e[56]=M):M=e[56];let z;e[57]!==p||e[58]!==M?(z=s.jsx(p,{children:M}),e[57]=p,e[58]=M,e[59]=z):z=e[59];let T;e[60]!==j||e[61]!==z||e[62]!==N||e[63]!==y?(T=s.jsx(j,{size:N,className:y,children:z}),e[60]=j,e[61]=z,e[62]=N,e[63]=y,e[64]=T):T=e[64];let K;if(e[65]!==l||e[66]!==i){let P;e[68]!==l?(P=u=>{const C=l.get(u.role)??"bg-neutral-400";return s.jsx(it,{value:u.role,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:ze("size-3 rounded-full",C)}),s.jsx("span",{className:"capitalize",children:u.label})]})},u.role)},e[68]=l,e[69]=P):P=e[69],K=i.map(P),e[65]=l,e[66]=i,e[67]=K}else K=e[67];let E;e[70]!==K?(E=s.jsx(nt,{children:K}),e[70]=K,e[71]=E):E=e[71];let k;return e[72]!==I||e[73]!==T||e[74]!==E||e[75]!==D||e[76]!==d||e[77]!==c?(k=s.jsxs(I,{value:D,onValueChange:d,disabled:c,children:[T,E]}),e[72]=I,e[73]=T,e[74]=E,e[75]=D,e[76]=d,e[77]=c,e[78]=k):k=e[78],k}function wt(t){const e=Y.c(51),{member:n,roles:o,onChangeRole:r,onRemove:l,isUpdating:i}=t,a=i===void 0?!1:i,m=n.role==="owner";let g,h,p,j,I,R,v,N,y;if(e[0]!==m||e[1]!==a||e[2]!==n.id||e[3]!==n.role||e[4]!==r||e[5]!==o){let T;e[15]!==n.role?(T=u=>u.role!==n.role&&u.role!=="owner",e[15]=n.role,e[16]=T):T=e[16];const K=o.filter(T);j=At;let E;e[17]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx(Pt,{size:20}),e[17]=E):E=e[17],e[18]!==m?(y=s.jsx(Mt,{asChild:!0,children:s.jsx(Pe,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",disabled:m,onClick:Fs,children:E})}),e[18]=m,e[19]=y):y=e[19],p=Et,v="end",N=ks,h=ns;let k;e[20]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(cs,{size:16}),e[20]=k):k=e[20],e[21]!==a?(R=s.jsxs(is,{disabled:a,children:[k,"Change Role"]}),e[21]=a,e[22]=R):R=e[22],g=ls;let P;e[23]!==a||e[24]!==n.id||e[25]!==r?(P=u=>{const C=[];return u.isBuiltin||(u.allowsAllStaticPermissions?C.push("Full org access"):u.staticPermissionCount&&u.staticPermissionCount>0&&C.push(`${u.staticPermissionCount} org perm${u.staticPermissionCount!==1?"s":""}`),u.allowsAllConnections?C.push("All connections"):u.connectionCount&&u.connectionCount>0&&C.push(`${u.connectionCount} connection${u.connectionCount!==1?"s":""}`),(u.connectionCount!==0||u.allowsAllConnections)&&(u.allowsAllTools?C.push("all tools"):u.toolCount&&u.toolCount>0&&C.push(`${u.toolCount} tool${u.toolCount!==1?"s":""}`))),s.jsxs(lt,{onClick:O=>{O.stopPropagation(),r(n.id,u.role)},disabled:a,children:[u.isBuiltin?s.jsx(rs,{size:16}):s.jsx(os,{size:16}),s.jsxs("span",{className:"flex flex-col",children:[s.jsx("span",{children:u.label}),!u.isBuiltin&&C.length>0&&s.jsx("span",{className:"text-xs text-muted-foreground",children:C.join(", ")})]})]},u.role)},e[23]=a,e[24]=n.id,e[25]=r,e[26]=P):P=e[26],I=K.map(P),e[0]=m,e[1]=a,e[2]=n.id,e[3]=n.role,e[4]=r,e[5]=o,e[6]=g,e[7]=h,e[8]=p,e[9]=j,e[10]=I,e[11]=R,e[12]=v,e[13]=N,e[14]=y}else g=e[6],h=e[7],p=e[8],j=e[9],I=e[10],R=e[11],v=e[12],N=e[13],y=e[14];let D;e[27]!==g||e[28]!==I?(D=s.jsx(g,{children:I}),e[27]=g,e[28]=I,e[29]=D):D=e[29];let d;e[30]!==h||e[31]!==R||e[32]!==D?(d=s.jsxs(h,{children:[R,D]}),e[30]=h,e[31]=R,e[32]=D,e[33]=d):d=e[33];let c;e[34]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(as,{}),e[34]=c):c=e[34];let x;e[35]!==n.id||e[36]!==l?(x=T=>{T.stopPropagation(),l(n.id)},e[35]=n.id,e[36]=l,e[37]=x):x=e[37];let A;e[38]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(ms,{size:16}),e[38]=A):A=e[38];let w;e[39]!==x?(w=s.jsxs(lt,{variant:"destructive",onClick:x,children:[A,"Remove Member"]}),e[39]=x,e[40]=w):w=e[40];let M;e[41]!==p||e[42]!==w||e[43]!==v||e[44]!==N||e[45]!==d?(M=s.jsxs(p,{align:v,onClick:N,children:[d,c,w]}),e[41]=p,e[42]=w,e[43]=v,e[44]=N,e[45]=d,e[46]=M):M=e[46];let z;return e[47]!==j||e[48]!==M||e[49]!==y?(z=s.jsxs(j,{children:[y,M]}),e[47]=j,e[48]=M,e[49]=y,e[50]=z):z=e[50],z}function ks(t){return t.stopPropagation()}function Fs(t){return t.stopPropagation()}function Nt(t){const e=Y.c(8),{invitationId:n,onCancel:o,isCancelling:r}=t,l=r===void 0?!1:r;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Mt,{asChild:!0,children:s.jsx(Pe,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Os,children:s.jsx(Pt,{size:20})})}),e[0]=i):i=e[0];let a;e[1]!==n||e[2]!==o?(a=h=>{h.stopPropagation(),o(n)},e[1]=n,e[2]=o,e[3]=a):a=e[3];let m;e[4]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(_t,{size:16}),e[4]=m):m=e[4];let g;return e[5]!==l||e[6]!==a?(g=s.jsxs(At,{children:[i,s.jsx(Et,{align:"end",onClick:Ls,children:s.jsxs(lt,{variant:"destructive",onClick:a,disabled:l,children:[m,"Cancel Invitation"]})})]}),e[5]=l,e[6]=a,e[7]=g):g=e[7],g}function Ls(t){return t.stopPropagation()}function Os(t){return t.stopPropagation()}function qs(){const t=Y.c(101),{data:e}=Zt(),{data:n}=Ss(),o=ws(),r=De(),{locator:l}=fe(),i=at(),[a,m]=ce.useState(null),[g,h]=ce.useState(null),[p,j]=ce.useState(""),[I,R]=ce.useState("table"),[v,N]=ce.useState("member"),[y,D]=ce.useState("asc"),d=e?.data?.members;let c;t[0]!==v?(c=f=>{v===f?D(Zs):(N(f),D("asc"))},t[0]=v,t[1]=c):c=t[1];const x=c;let A=d??[],w=n??[];if(p){const f=p.toLowerCase();A=A.filter(b=>b.user?.name?.toLowerCase().includes(f)||b.user?.email?.toLowerCase().includes(f)||b.role?.toLowerCase().includes(f)),w=w.filter(b=>b.email?.toLowerCase().includes(f)||b.role?.toLowerCase().includes(f))}if(v&&y){let f;t[2]!==y||t[3]!==v?(f=(b,_)=>{let B,de;e:switch(v){case"member":{B=b.user?.name||"",de=_.user?.name||"";break e}case"role":{B=b.role||"",de=_.role||"";break e}case"joined":{B=b.createdAt?typeof b.createdAt=="string"?b.createdAt:b.createdAt.toISOString():"",de=_.createdAt?typeof _.createdAt=="string"?_.createdAt:_.createdAt.toISOString():"";break e}default:return 0}return y==="asc"?B.localeCompare(de):de.localeCompare(B)},t[2]=y,t[3]=v,t[4]=f):f=t[4],A=[...A].sort(f)}const M=A;let z;t[5]!==i?(z=async f=>{const b=await i.organization.removeMember({memberIdOrEmail:f});if(b?.error)throw new Error(b.error.message)},t[5]=i,t[6]=z):z=t[6];let T;t[7]!==l||t[8]!==r?(T=()=>{ue("member_removed"),r.invalidateQueries({queryKey:ie.members(l)}),G.success("Member has been removed from the organization"),m(null)},t[7]=l,t[8]=r,t[9]=T):T=t[9];let K;t[10]!==z||t[11]!==T?(K={mutationFn:z,onSuccess:T,onError:Ys},t[10]=z,t[11]=T,t[12]=K):K=t[12];const E=pe(K);let k;t[13]!==i?(k=async f=>{const{memberId:b,role:_}=f,B=await i.organization.updateMemberRole({memberId:b,role:[_]});if(B?.error)throw new Error(B.error.message)},t[13]=i,t[14]=k):k=t[14];let P;t[15]!==l||t[16]!==r?(P=(f,b)=>{ue("member_role_updated",{new_role:b.role}),r.invalidateQueries({queryKey:ie.members(l)}),G.success("Member's role has been updated")},t[15]=l,t[16]=r,t[17]=P):P=t[17];let u;t[18]!==k||t[19]!==P?(u={mutationFn:k,onSuccess:P,onError:Ws},t[18]=k,t[19]=P,t[20]=u):u=t[20];const C=pe(u);let O;t[21]!==i?(O=async f=>{const{invitationId:b,role:_,email:B}=f,de=await i.organization.cancelInvitation({invitationId:b});if(de?.error)throw new Error(de.error.message);const ot=await i.organization.inviteMember({email:B,role:_});if(ot?.error)throw new Error(ot.error.message)},t[21]=i,t[22]=O):O=t[22];let $;t[23]!==l||t[24]!==r?($=(f,b)=>{ue("invitation_role_updated",{new_role:b.role}),r.invalidateQueries({queryKey:ie.invitations(l)}),G.success("Invitation role has been updated")},t[23]=l,t[24]=r,t[25]=$):$=t[25];let F;t[26]!==O||t[27]!==$?(F={mutationFn:O,onSuccess:$,onError:Hs},t[26]=O,t[27]=$,t[28]=F):F=t[28];const V=pe(F),{roles:L,customRoles:Q}=It();let q;t[29]!==Q?(q=Ds(Q),t[29]=Q,t[30]=q):q=t[30];const U=q;let J;t[31]!==L?(J=L.filter(Js),t[31]=L,t[32]=J):J=t[32];const H=J;let W;t[33]===Symbol.for("react.memo_cache_sentinel")?(W={id:"member",header:"Member",render:Gs,cellClassName:"flex-1 min-w-0",sortable:!0},t[33]=W):W=t[33];let le;t[34]!==U||t[35]!==H||t[36]!==V||t[37]!==C?(le={id:"role",header:"Role",render:f=>f.type==="member"?s.jsx(Ke,{role:f.data.role,memberId:f.data.id,isOwner:f.data.role==="owner",roleColorMap:U,selectableRoles:H,onRoleChange:(b,_)=>C.mutate({memberId:b,role:_}),className:"w-36"}):s.jsx(Ke,{role:f.data.role,memberId:f.data.id,isOwner:!1,roleColorMap:U,selectableRoles:H,onRoleChange:(b,_)=>V.mutate({invitationId:b,role:_,email:f.data.email}),className:"w-36"}),cellClassName:"w-36 shrink-0",sortable:!0},t[34]=U,t[35]=H,t[36]=V,t[37]=C,t[38]=le):le=t[38];let xe,Z;t[39]===Symbol.for("react.memo_cache_sentinel")?(xe={id:"tags",header:"Tags",render:Us,cellClassName:"w-40 shrink-0"},Z={id:"joined",header:"Joined",render:Qs,cellClassName:"w-48 shrink-0",sortable:!0},t[39]=xe,t[40]=Z):(xe=t[39],Z=t[40]);let ae;t[41]!==o.cancel.isPending||t[42]!==L||t[43]!==C?(ae={id:"actions",header:"",render:f=>f.type==="member"?s.jsx(wt,{member:f.data,roles:L,onChangeRole:(b,_)=>C.mutate({memberId:b,role:_}),onRemove:m,isUpdating:C.isPending}):s.jsx(Nt,{invitationId:f.data.id,onCancel:h,isCancelling:o.cancel.isPending}),cellClassName:"w-12 shrink-0"},t[41]=o.cancel.isPending,t[42]=L,t[43]=C,t[44]=ae):ae=t[44];let me;t[45]!==le||t[46]!==ae?(me=[W,le,xe,Z,ae],t[45]=le,t[46]=ae,t[47]=me):me=t[47];const _e=me;let be;t[48]===Symbol.for("react.memo_cache_sentinel")?(be=s.jsx("div",{className:"flex items-center gap-2",children:s.jsx(ys,{trigger:s.jsx(Pe,{children:"Invite Member"})})}),t[48]=be):be=t[48];const Re=be,ge=[...M.map(Vs),...w.filter(Ks).map(Bs)],oe=Ee,re=!!g;let X;t[49]===Symbol.for("react.memo_cache_sentinel")?(X=()=>h(null),t[49]=X):X=t[49];let ee;t[50]===Symbol.for("react.memo_cache_sentinel")?(ee=s.jsxs(ht,{children:[s.jsx(pt,{children:"Cancel Invitation"}),s.jsx(xt,{children:"Are you sure you want to cancel this invitation? The invitee will no longer be able to join the organization with this invitation."})]}),t[50]=ee):ee=t[50];let te;t[51]===Symbol.for("react.memo_cache_sentinel")?(te=s.jsx(bt,{children:"Keep Invitation"}),t[51]=te):te=t[51];let se;t[52]!==o.cancel||t[53]!==g?(se=()=>{g&&(o.cancel.mutate(g),h(null))},t[52]=o.cancel,t[53]=g,t[54]=se):se=t[54];let S;t[55]!==o.cancel.isPending||t[56]!==se?(S=s.jsxs(ut,{children:[ee,s.jsxs(ft,{children:[te,s.jsx(gt,{onClick:se,disabled:o.cancel.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Cancel Invitation"})]})]}),t[55]=o.cancel.isPending,t[56]=se,t[57]=S):S=t[57];let ne;t[58]!==re||t[59]!==S?(ne=s.jsx(jt,{open:re,onOpenChange:X,children:S}),t[58]=re,t[59]=S,t[60]=ne):ne=t[60];const he=!!a;let je;t[61]===Symbol.for("react.memo_cache_sentinel")?(je=()=>m(null),t[61]=je):je=t[61];let Fe;t[62]===Symbol.for("react.memo_cache_sentinel")?(Fe=s.jsxs(ht,{children:[s.jsx(pt,{children:"Remove Member"}),s.jsx(xt,{children:"Are you sure you want to remove this member from the organization? This action cannot be undone."})]}),t[62]=Fe):Fe=t[62];let Le;t[63]===Symbol.for("react.memo_cache_sentinel")?(Le=s.jsx(bt,{children:"Cancel"}),t[63]=Le):Le=t[63];let ve;t[64]!==a||t[65]!==E?(ve=()=>a&&E.mutate(a),t[64]=a,t[65]=E,t[66]=ve):ve=t[66];let Ce;t[67]!==E.isPending||t[68]!==ve?(Ce=s.jsxs(ut,{children:[Fe,s.jsxs(ft,{children:[Le,s.jsx(gt,{onClick:ve,disabled:E.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Remove"})]})]}),t[67]=E.isPending,t[68]=ve,t[69]=Ce):Ce=t[69];let ye;t[70]!==he||t[71]!==Ce?(ye=s.jsx(jt,{open:he,onOpenChange:je,children:Ce}),t[70]=he,t[71]=Ce,t[72]=ye):ye=t[72];const Ge=Ee,Je=Ee,zt="flex flex-col gap-6";let Se;t[73]===Symbol.for("react.memo_cache_sentinel")?(Se=s.jsx(Ee.Title,{children:"Members"}),t[73]=Se):Se=t[73];let Oe;t[74]===Symbol.for("react.memo_cache_sentinel")?(Oe=f=>{f.key==="Escape"&&(j(""),f.target.blur())},t[74]=Oe):Oe=t[74];let we;t[75]!==p?(we=s.jsx(qt,{value:p,onChange:j,placeholder:"Search members...",className:"w-full md:w-[375px]",onKeyDown:Oe}),t[75]=p,t[76]=we):we=t[76];let qe;t[77]===Symbol.for("react.memo_cache_sentinel")?(qe=[{id:"member",label:"Name"},{id:"role",label:"Role"},{id:"joined",label:"Joined"}],t[77]=qe):qe=t[77];let Ne;t[78]!==x||t[79]!==y||t[80]!==v||t[81]!==I?(Ne=s.jsx(Ot,{viewMode:I,onViewModeChange:R,sortKey:v,sortDirection:y,onSort:x,sortOptions:qe}),t[78]=x,t[79]=y,t[80]=v,t[81]=I,t[82]=Ne):Ne=t[82];let Te;t[83]!==we||t[84]!==Ne?(Te=s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[we,Ne]}),Re]}),t[83]=we,t[84]=Ne,t[85]=Te):Te=t[85];const He=I==="cards"?s.jsx("div",{children:ge.length===0?s.jsx(We,{title:"No members found",description:p?`No members match "${p}"`:"Invite members to get started."}):s.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:ge.map(f=>{if(f.type==="invitation")return s.jsxs(vt,{className:"transition-colors relative opacity-75",children:[s.jsx("div",{className:"absolute top-4 right-4 z-10",children:s.jsx(Nt,{invitationId:f.data.id,onCancel:h,isCancelling:o.cancel.isPending})}),s.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[s.jsx(Ve,{fallback:Qe(f.data.email),shape:"circle",size:"lg",className:"shrink-0"}),s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:f.data.email}),s.jsx("div",{className:"flex items-center gap-2",children:s.jsx(Ue,{variant:"outline",className:"w-fit text-amber-600 border-amber-400",children:"Pending"})}),s.jsx(Ke,{role:f.data.role,memberId:f.data.id,isOwner:!1,roleColorMap:U,selectableRoles:H,onRoleChange:(_,B)=>V.mutate({invitationId:_,role:B,email:f.data.email}),className:"w-fit"})]})]})]},`inv-${f.data.id}`);const b=f.data;return s.jsxs(vt,{className:"transition-colors relative",children:[s.jsx("div",{className:"absolute top-4 right-4 z-10",children:s.jsx(wt,{member:b,roles:L,onChangeRole:(_,B)=>C.mutate({memberId:_,role:B}),onRemove:m,isUpdating:C.isPending})}),s.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[s.jsx(Ve,{url:b.user?.image??void 0,fallback:Qe(b.user?.name),shape:"circle",size:"lg",className:"shrink-0"}),s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:b.user?.name||"Unknown"}),s.jsx("p",{className:"text-sm text-muted-foreground truncate",children:b.user?.email}),s.jsx(Ke,{role:b.role,memberId:b.id,isOwner:b.role==="owner",roleColorMap:U,selectableRoles:H,onRoleChange:(_,B)=>C.mutate({memberId:_,role:B}),className:"w-fit"}),s.jsx(Rt,{memberId:b.id,maxDisplay:3})]})]})]},b.id)})})}):s.jsx(Bt,{columns:_e,data:ge,isLoading:!1,sortKey:v,sortDirection:y,onSort:x,emptyState:p?s.jsx(We,{title:"No members found",description:`No members match "${p}"`}):s.jsx(We,{title:"No members found",description:"Invite members to get started."})});let Ie;t[86]!==Se||t[87]!==Te||t[88]!==He?(Ie=s.jsxs("div",{className:zt,children:[Se,Te,He]}),t[86]=Se,t[87]=Te,t[88]=He,t[89]=Ie):Ie=t[89];let Ae;t[90]!==Je.Body||t[91]!==Ie?(Ae=s.jsx(Je.Body,{children:Ie}),t[90]=Je.Body,t[91]=Ie,t[92]=Ae):Ae=t[92];let Me;t[93]!==Ge.Content||t[94]!==Ae?(Me=s.jsx(Ge.Content,{children:Ae}),t[93]=Ge.Content,t[94]=Ae,t[95]=Me):Me=t[95];let Be;return t[96]!==oe||t[97]!==ne||t[98]!==ye||t[99]!==Me?(Be=s.jsxs(oe,{children:[ne,ye,Me]}),t[96]=oe,t[97]=ne,t[98]=ye,t[99]=Me,t[100]=Be):Be=t[100],Be}function Bs(t){return{type:"invitation",data:t}}function Ks(t){return t.status==="pending"}function Vs(t){return{type:"member",data:t}}function Qs(t){return t.type==="member"?s.jsx("span",{className:"text-sm text-foreground",children:t.data.createdAt?$s(t.data.createdAt):"N/A"}):s.jsx(Ue,{variant:"outline",children:"Pending"})}function Us(t){return t.type==="member"?s.jsx(Rt,{memberId:t.data.id,maxDisplay:2}):s.jsx("span",{className:"text-xs text-muted-foreground",children:"-"})}function Gs(t){return t.type==="member"?s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Ve,{url:t.data.user?.image??void 0,fallback:Qe(t.data.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-sm font-medium text-foreground truncate",children:t.data.user?.name||"Unknown"}),s.jsx("div",{className:"text-sm text-muted-foreground truncate",children:t.data.user?.email})]})]}):s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Ve,{fallback:Qe(t.data.email),shape:"circle",size:"sm"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-sm font-medium text-foreground truncate",children:t.data.email}),s.jsx("div",{className:"text-sm text-muted-foreground truncate",children:"Invitation sent"})]})]})}function Js(t){return t.role!=="owner"}function Hs(t,e){ue("invitation_role_update_failed",{new_role:e.role,error:t instanceof Error?t.message:String(t)}),G.error(t instanceof Error?t.message:"Failed to update invitation role")}function Ws(t,e){ue("member_role_update_failed",{new_role:e.role,error:t instanceof Error?t.message:String(t)}),G.error(t instanceof Error?t.message:"Failed to update role")}function Ys(t){ue("member_remove_failed",{error:t instanceof Error?t.message:String(t)}),G.error(t instanceof Error?t.message:"Failed to remove member")}function Zs(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function Kn(){const t=Y.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Ee,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-sm text-muted-foreground",children:"Failed to load members"})})}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Lt,{fallback:e,children:s.jsx(ce.Suspense,{fallback:s.jsx(Ee,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(Xe,{size:32,className:"animate-spin text-muted-foreground"})})}),children:s.jsx(qs,{})})}),t[1]=n):n=t[1],n}export{Kn as default};
|