decocms 4.579.0 → 4.579.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-GXBIxFcm.js → AlertCircle-CTbjWy6O.js} +1 -1
- package/dist/client/assets/{AreaChart-BliO7z1O.js → AreaChart-DwuVDkrD.js} +1 -1
- package/dist/client/assets/{ArrowLeft-BbqwGy0e.js → ArrowLeft-XFXQyKrg.js} +1 -1
- package/dist/client/assets/{ArrowUp-DBkhb8Yz.js → ArrowUp-BGhmN6Zx.js} +1 -1
- package/dist/client/assets/{BookOpen01-1fjc61Mm.js → BookOpen01-BPEekJOY.js} +1 -1
- package/dist/client/assets/{CartesianChart-D_ikhSur.js → CartesianChart-CyLm4xQH.js} +1 -1
- package/dist/client/assets/{CategoricalChart-DFr--lUX.js → CategoricalChart-BaZiYgxE.js} +1 -1
- package/dist/client/assets/{CheckCircle-B_eEhqJR.js → CheckCircle-D_eKfCyb.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-D-7E5GYT.js → ChevronSelectorVertical-B8yNz6I1.js} +1 -1
- package/dist/client/assets/{ChevronUp-FDrusEQ7.js → ChevronUp-DJytO9gL.js} +1 -1
- package/dist/client/assets/{CreditCard01-KjySk-5G.js → CreditCard01-D8vcOfs6.js} +1 -1
- package/dist/client/assets/{Globe04-CYg8V2eL.js → Globe04-B6PnEpLB.js} +1 -1
- package/dist/client/assets/{Key01-DY2gyLvd.js → Key01-CqlMd8Tp.js} +1 -1
- package/dist/client/assets/{LinkBroken01-CzDrAWsX.js → LinkBroken01-BrTHjhI6.js} +1 -1
- package/dist/client/assets/{Minus-CMxaDSgl.js → Minus-O-Diijsb.js} +1 -1
- package/dist/client/assets/{Monitor01-3IwLMf0Q.js → Monitor01-CNesz7Zi.js} +1 -1
- package/dist/client/assets/{Play-BOARoASB.js → Play-DLBGORyf.js} +1 -1
- package/dist/client/assets/{Plus-D452i-ki.js → Plus-D93afoay.js} +1 -1
- package/dist/client/assets/{ReferenceLine-BCPouREj.js → ReferenceLine-DP5lPOEm.js} +1 -1
- package/dist/client/assets/{SearchMd-D9VvymBK.js → SearchMd-BMSOzTwj.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-DrNjYHL1.js → ShoppingBag01-BjOh6InC.js} +1 -1
- package/dist/client/assets/{Sun-BvPiksd_.js → Sun-Dwiv3SBK.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-BzX5npS9.js → SwitchHorizontal01-TvywMML0.js} +1 -1
- package/dist/client/assets/{Tool01-DoE3EsIZ.js → Tool01-BR0iTy6Z.js} +1 -1
- package/dist/client/assets/{Tooltip-z7WiBKoc.js → Tooltip-CMzIdphO.js} +1 -1
- package/dist/client/assets/{Trash01-_1ewPMOO.js → Trash01-DcgAZcrm.js} +1 -1
- package/dist/client/assets/{Upload01-D11ZXRKj.js → Upload01-C4wCuUx0.js} +1 -1
- package/dist/client/assets/{UserSquare-DHrzs2xN.js → UserSquare-dl1oayK_.js} +1 -1
- package/dist/client/assets/{Users01-DdipP4E2.js → Users01-Bfq6gAwi.js} +1 -1
- package/dist/client/assets/{XClose-CR92HpkN.js → XClose-DN30jgS9.js} +1 -1
- package/dist/client/assets/{Zap-D5X_AlHR.js → Zap-C1Evk-yy.js} +1 -1
- package/dist/client/assets/{access-gate-CpF5setC.js → access-gate-pZVUht52.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-DB2eDzSO.js → add-connection-dialog-Z992qi1w.js} +1 -1
- package/dist/client/assets/agent-app-DzDciOTO.js +1 -0
- package/dist/client/assets/{agent-assets-CynthE6_.js → agent-assets-CFZFbPFI.js} +1 -1
- package/dist/client/assets/{agent-automation-1MlsXRHC.js → agent-automation-CK-VV9xP.js} +1 -1
- package/dist/client/assets/{agent-automations-Dol9sHiV.js → agent-automations-csn7BO9I.js} +1 -1
- package/dist/client/assets/{agent-blog-Db3MOHTb.js → agent-blog-DPGRYnCY.js} +2 -2
- package/dist/client/assets/{agent-blog-post-BWxagJWC.js → agent-blog-post-Cx_KL21T.js} +2 -2
- package/dist/client/assets/{agent-calendar-DgGhw5pC.js → agent-calendar-DHfOCkRQ.js} +1 -1
- package/dist/client/assets/{agent-capabilities-CtbwhlqH.js → agent-capabilities-4_vEEVov.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-ByKpOl5Z.js → agent-connect-sources-HdEFSoEU.js} +1 -1
- package/dist/client/assets/agent-deck-BXpuyyHV.js +1 -0
- package/dist/client/assets/{agent-e2e-CmmnhpPI.js → agent-e2e-D3d1Qsqd.js} +1 -1
- package/dist/client/assets/agent-experiments-BL62SJmo.js +1 -0
- package/dist/client/assets/{agent-file-BwXd7p-8.js → agent-file-SpdJvvC2.js} +1 -1
- package/dist/client/assets/{agent-hosting-FxuGCE-9.js → agent-hosting-BZxtmZl8.js} +1 -1
- package/dist/client/assets/{agent-icon-DPgCnEV1.js → agent-icon-BLhMgLPf.js} +1 -1
- package/dist/client/assets/agent-library-BFYPXgq1.js +1 -0
- package/dist/client/assets/agent-library-file-DKeb8aqf.js +1 -0
- package/dist/client/assets/agent-overview-D5jCjQVj.js +1 -0
- package/dist/client/assets/{agent-releases-CkbrqRyS.js → agent-releases-DL4F9_VB.js} +1 -1
- package/dist/client/assets/agent-settings-ESG9192X.js +1 -0
- package/dist/client/assets/{agent-site-editor-ClFcVY3S.js → agent-site-editor-CqV30Rul.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-BQnTQU7w.js +2 -0
- package/dist/client/assets/agent-site-editor-content-qd-na2CD.js +1 -0
- package/dist/client/assets/agent-site-editor-preview-BXjMAtak.js +1 -0
- package/dist/client/assets/agent-view-BLgY0MfR.js +1 -0
- package/dist/client/assets/{agent-view-guard-BCiwIORn.js → agent-view-guard-DZvQvKvl.js} +1 -1
- package/dist/client/assets/{ai-providers-bDAV58Mn.js → ai-providers-RlxMy215.js} +1 -1
- package/dist/client/assets/{alert-DXhGyLVy.js → alert-B5Ykyt3T.js} +1 -1
- package/dist/client/assets/{analytics-sections-DBGqAepm.js → analytics-sections-CrpfbEYH.js} +1 -1
- package/dist/client/assets/{api-keys-BNfyNQ7I.js → api-keys-CSc7sP_x.js} +1 -1
- package/dist/client/assets/api-keys-vIp11w3k.js +1 -0
- package/dist/client/assets/{app-editor-BiIR6cEw.js → app-editor-DghRfIjT.js} +1 -1
- package/dist/client/assets/{asset-utils-C4P9UMw5.js → asset-utils-BmMj5wge.js} +1 -1
- package/dist/client/assets/{auth-DET1t4rk.js → auth-U9K5aFal.js} +1 -1
- package/dist/client/assets/{auth-catchall-Ds0jCVCs.js → auth-catchall-D48r6PhG.js} +1 -1
- package/dist/client/assets/{auth-entry-CcoroHhc.js → auth-entry-C6mHpqQT.js} +1 -1
- package/dist/client/assets/{auth-split-layout-DyPur8S6.js → auth-split-layout-DZ8IOzfV.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-BcQblp8z.js → authenticate-and-persist-oauth-DX8Wh7d9.js} +1 -1
- package/dist/client/assets/{automation-list-row-CUs_NzLP.js → automation-list-row-DFyb04uK.js} +1 -1
- package/dist/client/assets/{automation-runs-CwfQCxx5.js → automation-runs-Bq3l9enC.js} +1 -1
- package/dist/client/assets/{automations-aHGSwKcI.js → automations-B2SGyI95.js} +1 -1
- package/dist/client/assets/{badge-CPdAi539.js → badge-C5mneqKN.js} +1 -1
- package/dist/client/assets/{block-document-Bbw2FP3P.js → block-document-DtjqDxVH.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-CZpRdqcZ.js → blocks-preview-workspace-context-BddxrpRg.js} +1 -1
- package/dist/client/assets/blocks-tab-states-BJKt49qf.js +1 -0
- package/dist/client/assets/{blog-preview-url-D9nceA8-.js → blog-preview-url-DPwtQPzJ.js} +1 -1
- package/dist/client/assets/{blog-schema-CxC8Q-yf.js → blog-schema-CMQLhziN.js} +1 -1
- package/dist/client/assets/{blog-source-gate-SOnwSY-u.js → blog-source-gate-WyoFGgE-.js} +1 -1
- package/dist/client/assets/{blog-view-gate-CbpRy_w3.js → blog-view-gate-CS668Ila.js} +1 -1
- package/dist/client/assets/{buckets-sxg53sM-.js → buckets-DeXHPgox.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-D_rPYtI9.js → build-improve-prompt-doc-DnDGx5OC.js} +1 -1
- package/dist/client/assets/{calendar-HFJ5axO1.js → calendar-DbxCxf92.js} +1 -1
- package/dist/client/assets/{capability-load-error-BCoAaz36.js → capability-load-error-DCozEloC.js} +1 -1
- package/dist/client/assets/{category-editor-BIsXNtK9.js → category-editor-BmGhOvZr.js} +1 -1
- package/dist/client/assets/{category-tree-BwBGBNEZ.js → category-tree-5dEhPnK2.js} +1 -1
- package/dist/client/assets/{chart-_XV_ZGbS.js → chart-Cy7LFFBX.js} +1 -1
- package/dist/client/assets/{chat-context-DmIaWG0i.js → chat-context-BOjsomdh.js} +1 -1
- package/dist/client/assets/{chat-draft-D5guZJ-Z.js → chat-draft-CYhwlCHc.js} +1 -1
- package/dist/client/assets/{checkbox-C6L9-jtU.js → checkbox-Bv8PV_aY.js} +1 -1
- package/dist/client/assets/{choose-editor-D-ClYTuz.js → choose-editor-DoyVAhj6.js} +1 -1
- package/dist/client/assets/{cli-auth-success-CMqt_C6d.js → cli-auth-success-DaytSyrs.js} +1 -1
- package/dist/client/assets/{client-icons-BrNyP8bx.js → client-icons-CiAKjxAC.js} +1 -1
- package/dist/client/assets/{cms-settings-editor-Cm7lJgYR.js → cms-settings-editor-Cuu4FHx1.js} +1 -1
- package/dist/client/assets/{cms-store-drafts-CTNFCbln.js → cms-store-drafts-B9MSaBY6.js} +1 -1
- package/dist/client/assets/{collapsible-SBMmc8E3.js → collapsible-DdHbUgH7.js} +1 -1
- package/dist/client/assets/{collection-detail-VM7vyobJ.js → collection-detail-DyddcB5w.js} +1 -1
- package/dist/client/assets/{collection-display-button-DNT54OXz.js → collection-display-button-DVJBx_vT.js} +1 -1
- package/dist/client/assets/{collection-search-DXnQxUGL.js → collection-search-CwqvBBm4.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-BtWWhOUa.js → collection-table-wrapper-DRrebKp3.js} +1 -1
- package/dist/client/assets/{collection-tabs-BPEGrrum.js → collection-tabs-81bsUeqm.js} +1 -1
- package/dist/client/assets/{combobox-B8oSfLQg.js → combobox-BrOkSbhh.js} +1 -1
- package/dist/client/assets/{command-ARXYIBtk.js → command-woRMyGZF.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-CrDXFS6p.js → companion-mcps-section-B5-NAK1i.js} +1 -1
- package/dist/client/assets/{config-FNjB2KQg.js → config-CuCmBQuJ.js} +1 -1
- package/dist/client/assets/{connect-D7SeHA4r.js → connect-HLDiwDO_.js} +1 -1
- package/dist/client/assets/{connect-layout-ByVGILi-.js → connect-layout-CWZCwH8X.js} +1 -1
- package/dist/client/assets/{connect-source-dialog-Di53RqvY.js → connect-source-dialog-CBKuqqHC.js} +1 -1
- package/dist/client/assets/{connection-BTlRsp1B.js → connection-BIE1Vidl.js} +1 -1
- package/dist/client/assets/{connection-card-DFMJTK3o.js → connection-card-gYm1H9XQ.js} +1 -1
- package/dist/client/assets/{connection-detail-C-BChkKr.js → connection-detail-QqFuUNuZ.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-B9Yi82ri.js → connection-form-helpers-DA9irt8S.js} +1 -1
- package/dist/client/assets/{connection-slug-COimMHkq.js → connection-slug-B8jXAB0J.js} +1 -1
- package/dist/client/assets/{connections-fJDsaPLw.js → connections-JyCHdBZv.js} +1 -1
- package/dist/client/assets/{content-tab-BV39A4DC.js → content-tab-DRXqlCUR.js} +3 -3
- package/dist/client/assets/{context-DHTHUOqh.js → context-C-ghWKlt.js} +1 -1
- package/dist/client/assets/{context-menu-B-hlKiE1.js → context-menu-DZcVKhkc.js} +1 -1
- package/dist/client/assets/{context-shell-BGKkeMCB.js → context-shell-Bemo51hp.js} +3 -3
- package/dist/client/assets/{core.esm-Hiw5xlkT.js → core.esm-Z0qYqKj9.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-EtzNyw9E.js → create-organization-dialog-D0g-fdvV.js} +1 -1
- package/dist/client/assets/{delete-copy-Bt51Emir.js → delete-copy-DJ_GOWB2.js} +1 -1
- package/dist/client/assets/{device-hint-DcULIlAN.js → device-hint-DfKyeTjV.js} +1 -1
- package/dist/client/assets/{discover-B7EzX3Z4.js → discover-D7XfOvTK.js} +1 -1
- package/dist/client/assets/{domain-settings-CYdry1vA.js → domain-settings-DLWYAbIO.js} +1 -1
- package/dist/client/assets/{drawer-BUu3Urhv.js → drawer-BBqyYfPx.js} +1 -1
- package/dist/client/assets/{editor-Dc6skLlO.js → editor-D97Qyzcp.js} +1 -1
- package/dist/client/assets/{editor-classes-BRb8pzNp.js → editor-classes-szltcTWs.js} +1 -1
- package/dist/client/assets/{empty-message-uyJw_GDm.js → empty-message-DEKaeblB.js} +1 -1
- package/dist/client/assets/{empty-state-CQ-naxDO.js → empty-state-DpGHzg8-.js} +1 -1
- package/dist/client/assets/{empty-state-yinauESn.js → empty-state-wwy36dTA.js} +1 -1
- package/dist/client/assets/{experiments-tab-choice-n7UpEKSe.js → experiments-tab-choice-CbqEz4gO.js} +1 -1
- package/dist/client/assets/{extract-connection-data-UTX_3j8w.js → extract-connection-data-CXg3fi8w.js} +1 -1
- package/dist/client/assets/{feature-gate-Caiq88-a.js → feature-gate-CveHfcPr.js} +1 -1
- package/dist/client/assets/{feature-paywall-CgY8XcJe.js → feature-paywall-DFIdKSLH.js} +1 -1
- package/dist/client/assets/{file-explorer-Dt28l_Zt.js → file-explorer-OW5FLgme.js} +1 -1
- package/dist/client/assets/{file-preview-B_OweD07.js → file-preview-BFUDJsk9.js} +1 -1
- package/dist/client/assets/{file-share-button-GtMerxGo.js → file-share-button-E0fcfsBv.js} +1 -1
- package/dist/client/assets/{file-type-icon-5sEsvuio.js → file-type-icon-hPTLm32j.js} +1 -1
- package/dist/client/assets/{folder-icon-BkVkbSXN.js → folder-icon-DxENQi9B.js} +1 -1
- package/dist/client/assets/{form-DQshgY6C.js → form-Bz_uprQc.js} +1 -1
- package/dist/client/assets/{frame-navigation-DCO55Sf7.js → frame-navigation-EV-98oaL.js} +1 -1
- package/dist/client/assets/{general-BaBNqFUU.js → general-DmOZe5tS.js} +1 -1
- package/dist/client/assets/{github-icon-CsOyvsM3.js → github-icon-CR8sfoo5.js} +1 -1
- package/dist/client/assets/{held-block-view-CZDHkd7I.js → held-block-view-DW-NjX-S.js} +1 -1
- package/dist/client/assets/{home-Csg3jJI1.js → home-C-1mJg3e.js} +1 -1
- package/dist/client/assets/{home-overview-BWPQ5B3f.js → home-overview-DZ5M4FB8.js} +1 -1
- package/dist/client/assets/{hosted-reconcile-BVY_PuHB.js → hosted-reconcile-JJSMDis4.js} +1 -1
- package/dist/client/assets/{icon-button-DTP_l7w5.js → icon-button-DqWSrNSZ.js} +1 -1
- package/dist/client/assets/{index-Chdoy1DO.js → index-2LsnM_Ir.js} +1 -1
- package/dist/client/assets/{index-BUzNTivf.js → index-7-4YhBZz.js} +1 -1
- package/dist/client/assets/{index-PfzOl7J6.js → index-B0kMZVmC.js} +5 -5
- package/dist/client/assets/{index-D9OoYQHh.js → index-B2FeU0Zw.js} +1 -1
- package/dist/client/assets/{index-TayDSkqp.js → index-BdtGqzV_.js} +1 -1
- package/dist/client/assets/{index-B_-7lo18.js → index-BlRhFO8i.js} +1 -1
- package/dist/client/assets/{index-CoDU2Q4W.js → index-CUuWKDNH.js} +1 -1
- package/dist/client/assets/{index-DThhcUFE.js → index-CeHQIaZQ.js} +1 -1
- package/dist/client/assets/{index-xX6vrZ6Z.js → index-CfMRfSbP.js} +1 -1
- package/dist/client/assets/{index-DpynbW7T.js → index-CguuJrFu.js} +1 -1
- package/dist/client/assets/{index-BxZUC_i-.js → index-CyzY-fLE.js} +1 -1
- package/dist/client/assets/{index-D8htcGU7.js → index-D3FgkNbL.js} +1 -1
- package/dist/client/assets/{index-Cwblfb1K.js → index-DE9SDic3.js} +1 -1
- package/dist/client/assets/{index-BtBKqC_9.js → index-DJq5XMUI.js} +1 -1
- package/dist/client/assets/{index-COp-j3NW.js → index-Dpqgfi8_.js} +1 -1
- package/dist/client/assets/{index-yk7iwtzd.js → index-aeiz-c5N.js} +1 -1
- package/dist/client/assets/{index--NX8xaba.js → index-lrnn1LFo.js} +1 -1
- package/dist/client/assets/{index-redirect-BkFuXXfk.js → index-redirect-Tqe_ugUp.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-BSITs4kU.js → infiniteQueryObserver-Bpp7Nde9.js} +1 -1
- package/dist/client/assets/{infra-billing-BoDxU99n.js → infra-billing-BVZxcUBX.js} +1 -1
- package/dist/client/assets/{input-CHXvb5rt.js → input-ClzrEMuy.js} +3 -3
- package/dist/client/assets/{input-D81euCkI.js → input-D3CQKUJv.js} +1 -1
- package/dist/client/assets/{integration-icon-Cypf7ART.js → integration-icon-BNTOj8TI.js} +1 -1
- package/dist/client/assets/{item-actions-8EnEtcgh.js → item-actions-DT1aQMAA.js} +1 -1
- package/dist/client/assets/{jira-icon-QIwPAzLK.js → jira-icon-CUdm8f26.js} +1 -1
- package/dist/client/assets/{label-C3bFtEDk.js → label-C8wqUUzx.js} +1 -1
- package/dist/client/assets/{layout-BQNYAbQM.js → layout-BrcEe09L.js} +1 -1
- package/dist/client/assets/{legacy-admin-welcome-dialog-BndvejSa.js → legacy-admin-welcome-dialog-5GoRU8S5.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-Dl3vADCo.js → legacy-agents-deep-Bf1vCfoJ.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-ChiwiSS2.js → legacy-main-redirect-Bh63rUhQ.js} +1 -1
- package/dist/client/assets/library-CdyTGa2g.js +1 -0
- package/dist/client/assets/{library-tab-CrYnUaco.js → library-tab-BVzgC-sN.js} +1 -1
- package/dist/client/assets/{login-rcDgqa7Z.js → login-DppNfiAq.js} +1 -1
- package/dist/client/assets/{markdown-sfCsYKJ3.js → markdown-ChQfidu_.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-D149puyc.js → mcp-app-renderer-Cqipo_fr.js} +1 -1
- package/dist/client/assets/{mcp-oauth-jwlMSPw2.js → mcp-oauth-BW9RlFd8.js} +1 -1
- package/dist/client/assets/{mcp-oauth-CSBTsyXo.js → mcp-oauth-C3I9E6hK.js} +1 -1
- package/dist/client/assets/{members-CelJ91W8.js → members-BPvSGNqH.js} +1 -1
- package/dist/client/assets/{memory-78oDfUbY.js → memory-CQAa3mHm.js} +1 -1
- package/dist/client/assets/{mock-board-1wwE7bgl.js → mock-board-BMaXmonr.js} +3 -3
- package/dist/client/assets/{monaco-editor-CdzTj7u7.js → monaco-editor-GCVIle1A.js} +1 -1
- package/dist/client/assets/{monitoring-CMxjfhWD.js → monitoring-RTFaXjle.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-DQq79-Av.js → monitoring-stats-row-h4pC7kD6.js} +1 -1
- package/dist/client/assets/{multi-select-DuhSvGkq.js → multi-select-sZG2voKq.js} +1 -1
- package/dist/client/assets/{mustache-7iPTegv4.js → mustache-BXaNyEgZ.js} +1 -1
- package/dist/client/assets/{named-rule-step-osjl7ntJ.js → named-rule-step-EI_qv23D.js} +1 -1
- package/dist/client/assets/{named-rule-view-BLodRfDS.js → named-rule-view-DcHqSDt-.js} +1 -1
- package/dist/client/assets/{new-project-dialog-ddGWO7oU.js → new-project-dialog-B8ntXRJU.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-lqjcXm4x.js → oauth-callback-ai-provider-of2OYrpv.js} +1 -1
- package/dist/client/assets/{oauth-callback-O0HaoPhW.js → oauth-callback-p3ywWjTz.js} +1 -1
- package/dist/client/assets/{oauth-consent-N41ISlqj.js → oauth-consent-DpXLchYG.js} +1 -1
- package/dist/client/assets/{onboarding-5wyvG1ND.js → onboarding-DKqNWZqa.js} +1 -1
- package/dist/client/assets/{openai-conversation-CHwDAykX.js → openai-conversation-CFoe4Qa0.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-1aPoGedf.js → optimistic-project-sidebar-views-B5MpSmQi.js} +1 -1
- package/dist/client/assets/{order-monitor-day-BETRE7hY.js → order-monitor-day-DEpjybnZ.js} +1 -1
- package/dist/client/assets/{organization-choice-xEY1ZwIn.js → organization-choice-DP7th0jj.js} +1 -1
- package/dist/client/assets/{orgs-BV4-A9Pr.js → orgs-DPHlMXcd.js} +1 -1
- package/dist/client/assets/{own-accounts-section-DY9RNK5U.js → own-accounts-section-DwQLTK3b.js} +1 -1
- package/dist/client/assets/{pair-4_jIXzEz.js → pair-BXQ1AL58.js} +1 -1
- package/dist/client/assets/{parse-sections-Crm8e-1O.js → parse-sections-CW6TmrTp.js} +2 -2
- package/dist/client/assets/{plan-TSt9lDnY.js → plan-DzDjgwtt.js} +1 -1
- package/dist/client/assets/{plan-ladder-6lanq0kZ.js → plan-ladder-B0kBPdzm.js} +1 -1
- package/dist/client/assets/{plan-usage-card-qPS6Eqeb.js → plan-usage-card-hmzG52qo.js} +1 -1
- package/dist/client/assets/{popover-BBhzRgR6.js → popover-CLUI-WCq.js} +1 -1
- package/dist/client/assets/{post-calendar-XeIGYeqg.js → post-calendar-DGbwtgLH.js} +1 -1
- package/dist/client/assets/{post-editor-Cuw86g74.js → post-editor-Cb57gZLf.js} +1 -1
- package/dist/client/assets/{preview-content-CdaarV-M.js → preview-content-YsDfk6M3.js} +1 -1
- package/dist/client/assets/{preview-dialog-eUjd7KAO.js → preview-dialog-Bz6A7RNp.js} +1 -1
- package/dist/client/assets/{preview-panel-DOASEmB8.js → preview-panel-4Ms4IncO.js} +1 -1
- package/dist/client/assets/{preview-tab-DHUmCnt8.js → preview-tab-DEm7tkhA.js} +3 -3
- package/dist/client/assets/{product-picker-dialog-z_7jLJp3.js → product-picker-dialog-CNlHID1U.js} +1 -1
- package/dist/client/assets/{profile-Q_Uil_2O.js → profile-Bt00wkq5.js} +1 -1
- package/dist/client/assets/{project-app-view-B_pnPMK9.js → project-app-view-BTWft0P3.js} +1 -1
- package/dist/client/assets/{project-apps-DOmYqPIW.js → project-apps-XmfSXScr.js} +1 -1
- package/dist/client/assets/{project-icon-DdcX-1Cu.js → project-icon-BkeJc-xp.js} +1 -1
- package/dist/client/assets/{project-index-CvnWioTG.js → project-index-C3tTBxDV.js} +1 -1
- package/dist/client/assets/project-reports-CWeaaEZO.js +1 -0
- package/dist/client/assets/project-tasks-jNfpaaGU.js +1 -0
- package/dist/client/assets/{projects-BnupWVNC.js → projects-D_tybxDG.js} +1 -1
- package/dist/client/assets/{projects-empty-state-BBAZx24q.js → projects-empty-state-BN5sLjWv.js} +1 -1
- package/dist/client/assets/{prompts-CtCcnkuf.js → prompts-CBKakZB5.js} +1 -1
- package/dist/client/assets/{record-editor-kAlyd6wn.js → record-editor-DF0JyxbJ.js} +1 -1
- package/dist/client/assets/{redirect-editor-G5HzKFY7.js → redirect-editor-DCz9NXOZ.js} +1 -1
- package/dist/client/assets/reports-CffaUFeU.js +1 -0
- package/dist/client/assets/{reports-CCeLAtH1.js → reports-Df9PLvuX.js} +1 -1
- package/dist/client/assets/{reports-onboarding-CihuSs_4.js → reports-onboarding-DCAmw-bq.js} +1 -1
- package/dist/client/assets/{reports-tab-CxCo6ljz.js → reports-tab-RfuGKaQ3.js} +2 -2
- package/dist/client/assets/{repositories-Cr0Vmqsy.js → repositories-B40Xay0b.js} +1 -1
- package/dist/client/assets/repositories-B_3cIxMq.js +1 -0
- package/dist/client/assets/{repository-binding-BjyWZpYn.js → repository-binding-DqsJn1Sb.js} +1 -1
- package/dist/client/assets/{repository-picker-BQKFq3La.js → repository-picker-DjmqKxQp.js} +1 -1
- package/dist/client/assets/{require-capability-Ca04y4iT.js → require-capability-11VEza5N.js} +1 -1
- package/dist/client/assets/{required-auth-layout-rj346c5-.js → required-auth-layout-CnCT_9Qk.js} +1 -1
- package/dist/client/assets/{reset-password-CJ8Ib39J.js → reset-password-DhGtg5RA.js} +1 -1
- package/dist/client/assets/{resizable-BWGQtKDK.js → resizable-DqI16h9r.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon--gm9VDQf.js → resolve-tab-icon-SqRc32_W.js} +1 -1
- package/dist/client/assets/{review-settings-DKHV4WWw.js → review-settings-DsCgah9j.js} +1 -1
- package/dist/client/assets/{role-color-h7pbmUj8.js → role-color-Bsnv2ruh.js} +1 -1
- package/dist/client/assets/{roles-33JtztJp.js → roles-CfgNfQ5D.js} +1 -1
- package/dist/client/assets/{route-esSEnbHB.js → route-CF7rRyVo.js} +1 -1
- package/dist/client/assets/route-DJv7Nx6V.js +1 -0
- package/dist/client/assets/{route-B2mhSQ66.js → route-YS6zinDQ.js} +1 -1
- package/dist/client/assets/{sandbox-lifecycle-context-ciVvS_mf.js → sandbox-lifecycle-context-Cm_5q5SF.js} +1 -1
- package/dist/client/assets/{save-status-YxsSW2Rs.js → save-status-DQIuewYI.js} +1 -1
- package/dist/client/assets/{schema-CWJkmqKK.js → schema-BtSfTK7H.js} +1 -1
- package/dist/client/assets/{schema-MF7uKk3F.js → schema-CMu2qDHJ.js} +1 -1
- package/dist/client/assets/{scroll-area-D0b5TYGa.js → scroll-area-CNyj4Q1_.js} +1 -1
- package/dist/client/assets/{search-input-CfjxHAmm.js → search-input-DfFZA2x_.js} +1 -1
- package/dist/client/assets/{search-toggle-CvrrivM1.js → search-toggle-BMP-t51j.js} +1 -1
- package/dist/client/assets/{secret-picker-Bh-9Okys.js → secret-picker-Cia0fA6k.js} +1 -1
- package/dist/client/assets/{secrets-BpaSArcv.js → secrets-Db72b1dr.js} +1 -1
- package/dist/client/assets/{section-array-field-YpT7n9vG.js → section-array-field-CItEGXFU.js} +1 -1
- package/dist/client/assets/{sections-BDOnV4mD.js → sections-BnvGhIDh.js} +1 -1
- package/dist/client/assets/{sections-editor-e-APM9PR.js → sections-editor-8kOnY41Y.js} +1 -1
- package/dist/client/assets/{select-DbxUTGle.js → select-B-QXEyVH.js} +1 -1
- package/dist/client/assets/{select-model-B_SYZDlx.js → select-model-BM57OK8a.js} +1 -1
- package/dist/client/assets/{seo-editor-BAb4_SVN.js → seo-editor-DUVQDKfJ.js} +1 -1
- package/dist/client/assets/{separator-C0AfeS3O.js → separator-CZVEZSKr.js} +1 -1
- package/dist/client/assets/settings-tab-B9XpN8jX.js +1 -0
- package/dist/client/assets/{sheet-BeOc3FAs.js → sheet-DFpCUkzK.js} +1 -1
- package/dist/client/assets/{shell-layout-QlUCYlok.js → shell-layout-3tQDWFJU.js} +1 -1
- package/dist/client/assets/{site-draft-actions-BsBc3-Kf.js → site-draft-actions-BT56hEH5.js} +1 -1
- package/dist/client/assets/{site-draft-view-B2Uxv1of.js → site-draft-view-DaVZ51CU.js} +1 -1
- package/dist/client/assets/site-editor-DhUm8vlF.js +1 -0
- package/dist/client/assets/{site-editor-toast-Bw0qMl-K.js → site-editor-toast-DrPEsDU7.js} +1 -1
- package/dist/client/assets/{skills-DK12dTU3.js → skills-Bh8g9zPx.js} +1 -1
- package/dist/client/assets/{slider-DWOCTsGO.js → slider-D5-tjvxC.js} +1 -1
- package/dist/client/assets/{sortable.esm-Bcfqg7Xt.js → sortable.esm-CD7Wn3a-.js} +1 -1
- package/dist/client/assets/{sso-BK-CwpIa.js → sso-CgVuMvqq.js} +1 -1
- package/dist/client/assets/{suggestion-DpDJqics.js → suggestion-BjK1ijWQ.js} +1 -1
- package/dist/client/assets/{super-agent-icon-DSWf_C0v.js → super-agent-icon-D1UApnZ8.js} +1 -1
- package/dist/client/assets/{switch-CdoFqihq.js → switch-YFmb691t.js} +1 -1
- package/dist/client/assets/{synced-repos-BBp6YhqW.js → synced-repos-QaqG0EO3.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-BA-Ya2gQ.js → tab-icon-glyph-CjjddmUR.js} +1 -1
- package/dist/client/assets/{table-DBeLX30i.js → table-EoWRqCf0.js} +1 -1
- package/dist/client/assets/{tabs-BwIUi1Ro.js → tabs-BPfd6mHK.js} +1 -1
- package/dist/client/assets/{task-board-Dt94BxWj.js → task-board-CjAeUa_m.js} +1 -1
- package/dist/client/assets/{task-route-BLTj-Kt_.js → task-route-Br2Lpz0h.js} +1 -1
- package/dist/client/assets/{task-status-COZT_U35.js → task-status-e2bwwrq0.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-DTwKCUBR.js → taskboard-analytics-Dz_bNdVa.js} +1 -1
- package/dist/client/assets/{tasks-BSIA3XNt.js → tasks-B4uBSKBg.js} +1 -1
- package/dist/client/assets/tasks-CwupKgpp.js +1 -0
- package/dist/client/assets/{textarea-0zeG6rdh.js → textarea-BDeCVCG_.js} +1 -1
- package/dist/client/assets/{thread-analytics-e-DAlOc7.js → thread-analytics-DhaZl6TQ.js} +1 -1
- package/dist/client/assets/{thread-intent-k_EWWvIp.js → thread-intent-oRL32U-K.js} +1 -1
- package/dist/client/assets/{thread-route-bIv-22ov.js → thread-route-Be5LHqPZ.js} +1 -1
- package/dist/client/assets/{thread-route-T4ycKium.js → thread-route-tkHuy51W.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-D5ENmZN2.js → thread-sheet-body-De3nDIYw.js} +1 -1
- package/dist/client/assets/{time-range-picker-l-A1yfsB.js → time-range-picker-RqJkhR4f.js} +1 -1
- package/dist/client/assets/{toggle-group-BR3YjLpg.js → toggle-group-Dyg7Y_bS.js} +1 -1
- package/dist/client/assets/{tool-namespace-nlvRAMHv.js → tool-namespace-pd4DYce0.js} +1 -1
- package/dist/client/assets/{tool-set-selector-iLTKI2dh.js → tool-set-selector-BxflvD5s.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-C1sAn-5j.js → toolbar-icon-button-T_NjCrYE.js} +1 -1
- package/dist/client/assets/{tooltip-7oUFzrc9.js → tooltip-BTKQq4Sy.js} +1 -1
- package/dist/client/assets/{tooltipContext-BnluVbPZ.js → tooltipContext-B3whzr3K.js} +1 -1
- package/dist/client/assets/{track-ClTfqB2h.js → track-hg2uNpQa.js} +1 -1
- package/dist/client/assets/{types-CT2b_f_n.js → types-DD9MvS2H.js} +1 -1
- package/dist/client/assets/{url-slug-DlwXWMoY.js → url-slug-CAaHyqrT.js} +1 -1
- package/dist/client/assets/{usage-stats-DXQh2ym6.js → usage-stats-LrxjpMvT.js} +1 -1
- package/dist/client/assets/{use-ai-providers-BV-M-wTR.js → use-ai-providers-BnCLnm6i.js} +1 -1
- package/dist/client/assets/{use-apply-named-rule-DVA8503u.js → use-apply-named-rule-CQGJ9Q6I.js} +1 -1
- package/dist/client/assets/use-ask-in-chat-Bn7rwpYM.js +1 -0
- package/dist/client/assets/{use-automations-CkOHisGI.js → use-automations-CRCU5rUU.js} +1 -1
- package/dist/client/assets/{use-autosave-CMjKQ8gr.js → use-autosave-HJouXCY9.js} +1 -1
- package/dist/client/assets/use-blocks-v8-project-Dd6JSEDd.js +1 -0
- package/dist/client/assets/{use-chat-layout-state-DYxnWGXI.js → use-chat-layout-state-DZgmLot0.js} +1 -1
- package/dist/client/assets/{use-cms-publish-actions-BRuQD-xn.js → use-cms-publish-actions-CQn8AjkF.js} +1 -1
- package/dist/client/assets/{use-connect-companion-Bz03TbqD.js → use-connect-companion-DgTOfpzN.js} +1 -1
- package/dist/client/assets/{use-connection-b1ZFdIKu.js → use-connection-jMnM0Hiq.js} +1 -1
- package/dist/client/assets/{use-content-sync-J1DOMeIV.js → use-content-sync-DvjyB8U-.js} +1 -1
- package/dist/client/assets/{use-copy-MGOjhapZ.js → use-copy-B36-QB7R.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-Db1-0fqy.js → use-date-fns-locale-CVz_yaSt.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-0ckPn95E.js → use-debounced-autosave-BCwvmx_C.js} +1 -1
- package/dist/client/assets/{use-debounced-value-L8Mvr3Qf.js → use-debounced-value-Be2K3Tgl.js} +1 -1
- package/dist/client/assets/{use-deco-credits-CXHEdY4g.js → use-deco-credits-B5uE_Z9G.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-CExfz_YN.js → use-decopilot-events-144aPqKs.js} +1 -1
- package/dist/client/assets/{use-delete-block-C4Fd-0fO.js → use-delete-block-BSTpS7wO.js} +1 -1
- package/dist/client/assets/{use-delete-connection-CiHyt6_e.js → use-delete-connection-BIASpF84.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-D6ysmdql.js → use-deployment-admin-CK9MBH_P.js} +1 -1
- package/dist/client/assets/{use-entitlements-DKzKnO7t.js → use-entitlements-D0Sb8QlP.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-Rhzecu_l.js → use-fast-preview-draft-url-D9g7iX8I.js} +1 -1
- package/dist/client/assets/{use-file-configs-FzJwNbFB.js → use-file-configs-Tkt_AHql.js} +1 -1
- package/dist/client/assets/{use-id-selection-DV-7Zfn_.js → use-id-selection-Cpsai2fK.js} +1 -1
- package/dist/client/assets/{use-inbox-feed-P-dmKrll.js → use-inbox-feed-CUpQJBQD.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-D4cD1T3_.js → use-infinite-scroll-C-wdmvlm.js} +1 -1
- package/dist/client/assets/{use-join-requests-BZyMQ0xJ.js → use-join-requests-D6nkHBhc.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-DTyQot8D.js → use-main-panel-tabs-DTIYfLGl.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-BzTNOh9a.js → use-mcp-auth-status-C3bL-6Ja.js} +1 -1
- package/dist/client/assets/{use-mcp-client-CVGnTbnR.js → use-mcp-client-Cp7itm-S.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-C72FS5ih.js → use-mcp-prompts-CF2bE4L8.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-DQ6qPp-q.js → use-mcp-tools-DqfH77AW.js} +1 -1
- package/dist/client/assets/{use-mobile-Box5tF93.js → use-mobile-CMr55W3O.js} +1 -1
- package/dist/client/assets/{use-move-blocks-D_Vs6N9H.js → use-move-blocks-vAC3BNbO.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-BFXAaVqR.js → use-navigate-to-agent-Bc47TXuM.js} +1 -1
- package/dist/client/assets/{use-never-published-D5jr8ByQ.js → use-never-published-622FRxP4.js} +1 -1
- package/dist/client/assets/{use-org-fs-DhEmmAqR.js → use-org-fs-CnKWtsx6.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-D4_eFcdp.js → use-org-repo-syncs-CWan9UEi.js} +1 -1
- package/dist/client/assets/{use-org-sso-PK2UdKUD.js → use-org-sso-Dx6waIv3.js} +1 -1
- package/dist/client/assets/{use-organization-settings-1gniuS7P.js → use-organization-settings-C44OxrrF.js} +1 -1
- package/dist/client/assets/{use-project-native-view-presence-CWUPdvlx.js → use-project-native-view-presence-BOiBdd4j.js} +1 -1
- package/dist/client/assets/{use-project-scope-RvpHL0s_.js → use-project-scope-BpnU42cL.js} +1 -1
- package/dist/client/assets/{use-recent-apps-B7zKTjxf.js → use-recent-apps-DIc0b7h6.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-Df9ZgP2V.js → use-reports-diagnostic-l8XSuOVG.js} +1 -1
- package/dist/client/assets/{use-sandbox-events-BV2Y1Vu8.js → use-sandbox-events-BTC_EPGc.js} +1 -1
- package/dist/client/assets/{use-secrets-DE7J5I_l.js → use-secrets-CFtisZrp.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-BJE9UobB.js → use-section-preview-base-C9SoEJn0.js} +1 -1
- package/dist/client/assets/{use-sidebar-collapsed-BFQg4qhu.js → use-sidebar-collapsed-V5_gd1MI.js} +1 -1
- package/dist/client/assets/{use-tags-CV-rF5OD.js → use-tags-Cxhud9Xt.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-BFgtA0eR.js → use-task-board-analytics-CpAa6pHW.js} +1 -1
- package/dist/client/assets/{use-task-board-events-DMey0obH.js → use-task-board-events-DspRxQsF.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-B52UpU_u.js → use-task-board-item-prs-CZVWQT5i.js} +1 -1
- package/dist/client/assets/{use-task-board-items-BxTPwb-L.js → use-task-board-items-CzVlUMOO.js} +1 -1
- package/dist/client/assets/{use-task-board-prompts-BRQWf9Pf.js → use-task-board-prompts-ngKSI_fY.js} +1 -1
- package/dist/client/assets/{use-task-metadata-CX5mjd3k.js → use-task-metadata-DiPyoyq1.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-NzO2uf9T.js → use-thread-outputs-BT9YWT4X.js} +1 -1
- package/dist/client/assets/{use-view-draft-kind-Czb3VJ2z.js → use-view-draft-kind-BTxfGo3P.js} +1 -1
- package/dist/client/assets/{use-voice-input-CJwxrnH4.js → use-voice-input-D66t9nvu.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-BLIxG3uZ.js +1 -0
- package/dist/client/assets/{useQueries-BTKHF006.js → useQueries-M4myONOE.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BJmR9zYx.js +1 -0
- package/dist/client/assets/{users-C1cmyiHr.js → users-BRGauFES.js} +1 -1
- package/dist/client/assets/{utils-dLgjLO-5.js → utils-CZf0WW3u.js} +1 -1
- package/dist/client/assets/{variant-calendar-BFvdqyOs.js → variant-calendar-MTIN2TYC.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-uOKZ9bIk.js → variant-matcher-override-yvSV8zF4.js} +1 -1
- package/dist/client/assets/{view-header-g_I-xUvY.js → view-header-D_yXL60l.js} +1 -1
- package/dist/client/assets/{virtual-mcp-CIFm7Ktp.js → virtual-mcp-D2YHeobd.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-Cs81gduQ.js → watch-sse-pool-DDOa1h_t.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/agent-app-FoPCQlJh.js +0 -1
- package/dist/client/assets/agent-deck-CYqAnEDO.js +0 -1
- package/dist/client/assets/agent-experiments-C0HV4Igp.js +0 -1
- package/dist/client/assets/agent-library-CZViQovH.js +0 -1
- package/dist/client/assets/agent-library-file-DC-34Ulj.js +0 -1
- package/dist/client/assets/agent-overview-DIMIEsnS.js +0 -1
- package/dist/client/assets/agent-settings-Ct-2qeci.js +0 -1
- package/dist/client/assets/agent-site-editor-code-B_iiio_B.js +0 -2
- package/dist/client/assets/agent-site-editor-content-XnR2gN3f.js +0 -1
- package/dist/client/assets/agent-site-editor-preview-DuB0qtlm.js +0 -1
- package/dist/client/assets/agent-view-B8ACan0R.js +0 -1
- package/dist/client/assets/api-keys-BHoBmIeA.js +0 -1
- package/dist/client/assets/blocks-tab-states-B3rnTo7L.js +0 -1
- package/dist/client/assets/library-BRiige9x.js +0 -1
- package/dist/client/assets/project-reports-CjkBj3OZ.js +0 -1
- package/dist/client/assets/project-tasks-BR7DB76X.js +0 -1
- package/dist/client/assets/reports-BZMzVdGj.js +0 -1
- package/dist/client/assets/repositories-xVxXVGUl.js +0 -1
- package/dist/client/assets/route-L9WJSo8Z.js +0 -1
- package/dist/client/assets/settings-tab-BdJ07iEH.js +0 -1
- package/dist/client/assets/site-editor-CkLwv4jN.js +0 -1
- package/dist/client/assets/tasks-CbzokKrd.js +0 -1
- package/dist/client/assets/use-ask-in-chat-BNelLcsB.js +0 -1
- package/dist/client/assets/use-blocks-v8-project-DwFetary.js +0 -1
- package/dist/client/assets/useInfiniteQuery-BVraOGoC.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-Ta5X_y4e.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as I,a4 as A,aS as le,m as R,j as r,R as ae,r as L,b as $,t as z,h as H,w as U,x as V,v as Q,D as W,d as X,E as G,aT as ne,B as Y}from"./index-PfzOl7J6.js";import{n as oe}from"./ArrowUp-DBkhb8Yz.js";import{d as ie,b as Z,f as ce,u as de,T as me,A as ue,n as fe,o as pe,c as xe,p as he,q as ge,t as be,L as je}from"./chat-context-DmIaWG0i.js";import{s as ye,g as J,d as ve}from"./tool-namespace-nlvRAMHv.js";import{b as F,T as we,a as Ne,c as Ce}from"./tooltip-7oUFzrc9.js";import{e as Se,b as Te,a as Pe,D as ke}from"./drawer-BUu3Urhv.js";import{C as Ee}from"./collection-search-DXnQxUGL.js";import{u as De}from"./use-mobile-Box5tF93.js";import{u as Me}from"./use-mcp-client-CVGnTbnR.js";import{u as _e,g as Be}from"./use-mcp-prompts-C72FS5ih.js";import{h as Ie,P as Le}from"./usage-stats-DXQh2ym6.js";import{T as Re,c as Oe,b as $e,d as Ae,H as Fe}from"./input-CHXvb5rt.js";import{u as ze,a as He,S as Ge,M as q}from"./pair-4_jIXzEz.js";import{u as qe,i as Ke}from"./thread-intent-k_EWWvIp.js";import{b as Ue}from"./use-view-draft-kind-Czb3VJ2z.js";import{N as Ve}from"./index-D9OoYQHh.js";import{i as Qe}from"./LinkBroken01-CzDrAWsX.js";import{f as ee}from"./agent-icon-DPgCnEV1.js";import{d as We}from"./use-entitlements-DKzKnO7t.js";import{u as Xe}from"./use-deco-credits-CXHEdY4g.js";import{F as Ye}from"./feature-paywall-CgY8XcJe.js";import{i as Ze}from"./AlertCircle-GXBIxFcm.js";const K=3,te="inline-flex items-center gap-2 px-5 py-2.5 rounded-full bg-muted text-muted-foreground text-sm font-medium transition-colors cursor-pointer",Je="flex flex-col gap-1.5 p-4 rounded-xl bg-accent/40 text-sm leading-snug transition-colors cursor-pointer text-left";function se(t){const e=I.c(46),{item:l,onSelect:a,isLoading:s,isDisabled:n,variant:m}=t,o=m===void 0?"pill":m,{prompt:i}=l;let d;if(e[0]!==i._meta||e[1]!==i.name||e[2]!==i.title){const P=J(i._meta);d=i.title??ve(i.name,P),e[0]=i._meta,e[1]=i.name,e[2]=i.title,e[3]=d}else d=e[3];const c=d,f=i.description||null;if(o==="card"){let P;e[4]!==a||e[5]!==i?(P=()=>a(i),e[4]=a,e[5]=i,e[6]=P):P=e[6];const M=n||s,_=s&&"bg-accent/40",k=(n||s)&&"cursor-not-allowed opacity-50";let E;e[7]!==_||e[8]!==k?(E=R(Je,"hover:bg-accent text-foreground",_,k),e[7]=_,e[8]=k,e[9]=E):E=e[9];let h;e[10]!==c?(h=r.jsx("span",{className:"font-medium truncate capitalize",children:c}),e[10]=c,e[11]=h):h=e[11];let N;e[12]!==s?(N=s&&r.jsx(H,{size:"xs"}),e[12]=s,e[13]=N):N=e[13];let x;e[14]!==h||e[15]!==N?(x=r.jsxs("div",{className:"flex items-center justify-between gap-2",children:[h,N]}),e[14]=h,e[15]=N,e[16]=x):x=e[16];let D;e[17]!==f?(D=f&&r.jsx("span",{className:"text-xs text-muted-foreground line-clamp-2",children:f}),e[17]=f,e[18]=D):D=e[18];let B;return e[19]!==x||e[20]!==D||e[21]!==P||e[22]!==M||e[23]!==E?(B=r.jsxs("button",{type:"button",onClick:P,disabled:M,className:E,children:[x,D]}),e[19]=x,e[20]=D,e[21]=P,e[22]=M,e[23]=E,e[24]=B):B=e[24],B}let u;e[25]!==a||e[26]!==i?(u=()=>a(i),e[25]=a,e[26]=i,e[27]=u):u=e[27];const g=n||s,p=s&&"bg-muted/50",w=(n||s)&&"cursor-not-allowed opacity-50";let b;e[28]!==p||e[29]!==w?(b=R(te,"hover:bg-accent hover:text-foreground",p,w),e[28]=p,e[29]=w,e[30]=b):b=e[30];let y;e[31]!==c?(y=r.jsx("span",{className:"capitalize",children:c}),e[31]=c,e[32]=y):y=e[32];let C;e[33]!==s?(C=s&&r.jsx(H,{size:"xs"}),e[33]=s,e[34]=C):C=e[34];let v;e[35]!==u||e[36]!==g||e[37]!==b||e[38]!==y||e[39]!==C?(v=r.jsx(we,{asChild:!0,children:r.jsxs("button",{type:"button",onClick:u,disabled:g,className:b,children:[y,C]})}),e[35]=u,e[36]=g,e[37]=b,e[38]=y,e[39]=C,e[40]=v):v=e[40];const S=f??c;let j;e[41]!==S?(j=r.jsx(Ne,{side:"top",className:"max-w-xs",children:r.jsx("p",{className:"text-xs",children:S})}),e[41]=S,e[42]=j):j=e[42];let T;return e[43]!==v||e[44]!==j?(T=r.jsxs(Ce,{delayDuration:400,children:[v,j]}),e[43]=v,e[44]=j,e[45]=T):T=e[45],T}function et(t){const e=I.c(61),{items:l,open:a,onOpenChange:s,onSelect:n,loadingPrompt:m}=t,o=$(),[i,d]=L.useState(""),c=!!m;let f;e[0]!==l||e[1]!==i?(f=i.trim()?l.filter(h=>{const N=i.toLowerCase();return h.prompt.name.toLowerCase().includes(N)||(h.prompt.title??"").toLowerCase().includes(N)||(h.prompt.description??"").toLowerCase().includes(N)}):l,e[0]=l,e[1]=i,e[2]=f):f=e[2];const u=f,g=De();let p;e[3]!==u.length||e[4]!==i||e[5]!==o?(p=u.length===0&&r.jsx("p",{className:"col-span-4 text-sm text-muted-foreground text-center py-8",children:o("chat.iceBreakers.noPromptsMatch",{search:i})}),e[3]=u.length,e[4]=i,e[5]=o,e[6]=p):p=e[6];let w;if(e[7]!==u||e[8]!==c||e[9]!==m?.name||e[10]!==s||e[11]!==n){let h;e[13]!==c||e[14]!==m?.name||e[15]!==s||e[16]!==n?(h=N=>r.jsx(se,{item:N,variant:"card",onSelect:x=>{s(!1),n(x)},isLoading:m?.name===N.prompt.name,isDisabled:c&&m?.name!==N.prompt.name},N.prompt.name),e[13]=c,e[14]=m?.name,e[15]=s,e[16]=n,e[17]=h):h=e[17],w=u.map(h),e[7]=u,e[8]=c,e[9]=m?.name,e[10]=s,e[11]=n,e[12]=w}else w=e[12];let b;e[18]!==p||e[19]!==w?(b=r.jsx("div",{className:"flex-1 overflow-y-auto [scrollbar-gutter:stable]",children:r.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3 p-5",children:[p,w]})}),e[18]=p,e[19]=w,e[20]=b):b=e[20];const y=b;let C;e[21]!==o?(C=o("chat.iceBreakers.searchPromptsPlaceholder"),e[21]=o,e[22]=C):C=e[22];let v;e[23]===Symbol.for("react.memo_cache_sentinel")?(v=h=>{h.key==="Escape"&&d("")},e[23]=v):v=e[23];let S;e[24]!==i||e[25]!==C?(S=r.jsx(Ee,{value:i,onChange:d,placeholder:C,onKeyDown:v}),e[24]=i,e[25]=C,e[26]=S):S=e[26];const j=S;if(g){let h;e[27]!==o?(h=o("chat.iceBreakers.allPromptsTitle"),e[27]=o,e[28]=h):h=e[28];let N;e[29]!==h?(N=r.jsx(Se,{className:"sr-only",children:r.jsx(Te,{children:h})}),e[29]=h,e[30]=N):N=e[30];let x;e[31]!==o?(x=o("chat.iceBreakers.promptsLabel"),e[31]=o,e[32]=x):x=e[32];let D;e[33]!==x?(D=r.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 shrink-0",children:r.jsx("span",{className:"text-sm font-medium text-foreground",children:x})}),e[33]=x,e[34]=D):D=e[34];let B;e[35]!==y||e[36]!==j||e[37]!==D||e[38]!==N?(B=r.jsxs(Pe,{className:"h-[85vh] flex flex-col p-0 gap-0",children:[N,D,j,y]}),e[35]=y,e[36]=j,e[37]=D,e[38]=N,e[39]=B):B=e[39];let O;return e[40]!==s||e[41]!==a||e[42]!==B?(O=r.jsx(F,{delayDuration:400,children:r.jsx(ke,{open:a,onOpenChange:s,children:B})}),e[40]=s,e[41]=a,e[42]=B,e[43]=O):O=e[43],O}let T;e[44]!==o?(T=o("chat.iceBreakers.allPromptsTitle"),e[44]=o,e[45]=T):T=e[45];let P;e[46]!==T?(P=r.jsx(U,{className:"sr-only",children:r.jsx(V,{children:T})}),e[46]=T,e[47]=P):P=e[47];let M;e[48]!==o?(M=o("chat.iceBreakers.promptsLabel"),e[48]=o,e[49]=M):M=e[49];let _;e[50]!==M?(_=r.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 shrink-0",children:r.jsx("span",{className:"text-sm font-medium text-foreground",children:M})}),e[50]=M,e[51]=_):_=e[51];let k;e[52]!==y||e[53]!==j||e[54]!==_||e[55]!==P?(k=r.jsxs(Q,{className:"sm:max-w-[1100px] h-[680px] p-0 gap-0 overflow-hidden flex flex-col",children:[P,_,j,y]}),e[52]=y,e[53]=j,e[54]=_,e[55]=P,e[56]=k):k=e[56];let E;return e[57]!==s||e[58]!==a||e[59]!==k?(E=r.jsx(F,{delayDuration:400,children:r.jsx(W,{open:a,onOpenChange:s,children:k})}),e[57]=s,e[58]=a,e[59]=k,e[60]=E):E=e[60],E}function tt(t){const e=I.c(30),{items:l,onSelect:a,loadingPrompt:s,className:n}=t,m=$(),[o,i]=L.useState(!1);if(l.length===0)return null;let d,c,f,u,g;if(e[0]!==n||e[1]!==l||e[2]!==s||e[3]!==a||e[4]!==m){const y=l.slice(0,K),C=l.slice(K),v=!!s;let S;e[10]!==v||e[11]!==s?.name||e[12]!==a?(S=T=>r.jsx(se,{item:T,onSelect:a,isLoading:s?.name===T.prompt.name,isDisabled:v&&s?.name!==T.prompt.name},T.prompt.name),e[10]=v,e[11]=s?.name,e[12]=a,e[13]=S):S=e[13];const j=y.map(S);d=F,g=400,e[14]!==n?(c=R("w-full flex flex-wrap gap-2 justify-center",n),e[14]=n,e[15]=c):c=e[15],f=j,u=C.length>0&&r.jsx("button",{type:"button",disabled:v,onClick:()=>i(!0),className:R(te,"hover:bg-accent hover:text-foreground",v&&"opacity-50 cursor-not-allowed"),children:m("chat.iceBreakers.moreButton",{count:C.length})}),e[0]=n,e[1]=l,e[2]=s,e[3]=a,e[4]=m,e[5]=d,e[6]=c,e[7]=f,e[8]=u,e[9]=g}else d=e[5],c=e[6],f=e[7],u=e[8],g=e[9];let p;e[16]!==c||e[17]!==f||e[18]!==u?(p=r.jsxs("div",{className:c,children:[f,u]}),e[16]=c,e[17]=f,e[18]=u,e[19]=p):p=e[19];let w;e[20]!==l||e[21]!==s||e[22]!==o||e[23]!==a?(w=r.jsx(et,{items:l,open:o,onOpenChange:i,onSelect:a,loadingPrompt:s}),e[20]=l,e[21]=s,e[22]=o,e[23]=a,e[24]=w):w=e[24];let b;return e[25]!==d||e[26]!==g||e[27]!==p||e[28]!==w?(b=r.jsxs(d,{delayDuration:g,children:[p,w]}),e[25]=d,e[26]=g,e[27]=p,e[28]=w,e[29]=b):b=e[29],b}function st(){return null}function rt(t,e){switch(e.type){case"SELECT_PROMPT":return!e.prompt.arguments||e.prompt.arguments.length===0?{stage:"loading",prompt:e.prompt}:{stage:"idle"};case"START_LOADING":return{stage:"loading",prompt:e.prompt,arguments:e.arguments};case"RESET":return{stage:"idle"};default:return t}}function lt(t){const e=I.c(31),{connectionId:l}=t,a=$(),{sendMessage:s}=Z(),{org:n}=A();let m;e[0]!==l||e[1]!==n.id||e[2]!==n.slug?(m={connectionId:l,orgId:n.id,orgSlug:n.slug},e[0]=l,e[1]=n.id,e[2]=n.slug,e[3]=m):m=e[3];const o=Me(m);let i;e[4]!==o?(i={client:o,staleTime:6e4},e[4]=o,e[5]=i):i=e[5];const{data:d}=_e(i);let c;e[6]!==d?.prompts?(c=d?.prompts??[],e[6]=d?.prompts,e[7]=c):c=e[7];const f=c;let u;e[8]!==f?(u=f.map(at),e[8]=f,e[9]=u):u=e[9];const g=u;let p;e[10]===Symbol.for("react.memo_cache_sentinel")?(p={stage:"idle"},e[10]=p):p=e[10];const[w,b]=L.useReducer(rt,p),[y,C]=L.useState(null);let v;e[11]!==o||e[12]!==s||e[13]!==a?(v=async(x,D)=>{if(!o){z.error(a("chat.iceBreakers.mcpClientNotAvailable")),b({type:"RESET"});return}try{const B=await Be(o,x.name,D);b({type:"RESET"});const O={type:"doc",content:[{type:"paragraph",content:[Ie({id:x.name,name:ye(x.name,J(x._meta)),metadata:B.messages,char:"/",kind:"prompt",args:D}),{type:"text",text:" "}]}]};await s(O)}catch(B){console.error("[ice-breakers] Failed to fetch prompt:",B),z.error(a("chat.iceBreakers.failedToLoadPrompt")),b({type:"RESET"})}},e[11]=o,e[12]=s,e[13]=a,e[14]=v):v=e[14];const S=v;let j;e[15]!==S?(j=async x=>{if(x.arguments&&x.arguments.length>0){b({type:"SELECT_PROMPT",prompt:x}),C(x);return}b({type:"START_LOADING",prompt:x}),await S(x)},e[15]=S,e[16]=j):j=e[16];const T=j;let P;e[17]!==y||e[18]!==S?(P=async x=>{y&&(b({type:"START_LOADING",prompt:y,arguments:x}),C(null),await S(y,x))},e[17]=y,e[18]=S,e[19]=P):P=e[19];const M=P;if(g.length===0)return null;const _=w.stage==="loading"?w.prompt:null;let k;e[20]!==T||e[21]!==g||e[22]!==_?(k=r.jsx(tt,{items:g,onSelect:T,loadingPrompt:_}),e[20]=T,e[21]=g,e[22]=_,e[23]=k):k=e[23];let E;e[24]===Symbol.for("react.memo_cache_sentinel")?(E=()=>{C(null),b({type:"RESET"})},e[24]=E):E=e[24];let h;e[25]!==y||e[26]!==M?(h=r.jsx(Le,{prompt:y,setPrompt:E,onSubmit:M}),e[25]=y,e[26]=M,e[27]=h):h=e[27];let N;return e[28]!==k||e[29]!==h?(N=r.jsxs(r.Fragment,{children:[k,h]}),e[28]=k,e[29]=h,e[30]=N):N=e[30],N}function at(t){return{prompt:t}}function nt(t){const e=I.c(13),{className:l}=t,{selectedVirtualMcp:a}=ie(),{org:s}=A();let n;e[0]!==s.id?(n=le(s.id),e[0]=s.id,e[1]=n):n=e[1];const m=n.id,o=a?.id??m;let i;e[2]!==l?(i=R("w-full @container",l),e[2]=l,e[3]=i):i=e[3];const d=o??"default";let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=r.jsx(st,{}),e[4]=c):c=e[4];let f;e[5]!==o?(f=r.jsx(lt,{connectionId:o}),e[5]=o,e[6]=f):f=e[6];let u;e[7]!==d||e[8]!==f?(u=r.jsx(ae,{fallback:null,children:r.jsx(L.Suspense,{fallback:c,children:f},d)}),e[7]=d,e[8]=f,e[9]=u):u=e[9];let g;return e[10]!==i||e[11]!==u?(g=r.jsx("div",{className:i,children:u}),e[10]=i,e[11]=u,e[12]=g):g=e[12],g}function ot(t){let e=0;for(const l of t)for(const a of l.parts??[]){const s=a;s.type==="tool-load_repo"&&s.state==="output-available"&&s.output?.success===!0&&e++}return e}function it(){const t=I.c(11),{openPanel:e}=Ue(),l=qe(),a=ce()?.messages??[],s=de(),n=s?.taskId??null,m=s?.currentBranch;let o;t[0]!==m?(o=Ke(m),t[0]=m,t[1]=o):o=t[1];const i=o;let d;t[2]!==a?(d=ot(a),t[2]=a,t[3]=d):d=t[3];const c=d,f=L.useRef(null),u=L.useRef(null);let g,p;t[4]!==i||t[5]!==c||t[6]!==l||t[7]!==e||t[8]!==n?(g=()=>{if(!c||!n)return;const w=`${n}:${c}`;u.current!==w&&(u.current=w,l?.refreshThreadMetadata(n)),f.current!==n&&(f.current=n,i||e("site-editor"))},p=[c,n,e,l,i],t[4]=i,t[5]=c,t[6]=l,t[7]=e,t[8]=n,t[9]=g,t[10]=p):(g=t[9],p=t[10]),L.useEffect(g,p)}function re(t){return`deco-credits-empty-dismissed:${t}`}function zt(t){try{return localStorage.getItem(re(t))==="1"}catch{return!1}}function ct(){const t=I.c(56),e=$(),{org:l}=A(),a=We("credits"),s=X(),{decoKeyId:n}=Xe(),[m,o]=L.useState(!0);let i;t[0]!==l.id?(i=()=>{G("credits_empty_state_dismissed",{organization_id:l.id}),o(!1);try{localStorage.setItem(re(l.id),"1")}catch{}},t[0]=l.id,t[1]=i):i=t[1];const d=i;let c,f;if(t[2]!==m||t[3]!==l.id?(c=()=>{m&&G("credits_empty_state_shown",{organization_id:l.id})},f=[m,l.id],t[2]=m,t[3]=l.id,t[4]=c,t[5]=f):(c=t[4],f=t[5]),L.useEffect(c,f),!m)return null;if(!a){let x;t[6]!==e?(x=e("chat.input.allowanceExhaustedTitle"),t[6]=e,t[7]=x):x=t[7];let D;t[8]!==x?(D={title:x},t[8]=x,t[9]=D):D=t[9];let B;return t[10]!==d||t[11]!==D?(B=r.jsx(Ye,{feature:"chat",copy:D,onDismiss:d}),t[10]=d,t[11]=D,t[12]=B):B=t[12],B}let u;t[13]!==d?(u=x=>!x&&d(),t[13]=d,t[14]=u):u=t[14];let g;t[15]===Symbol.for("react.memo_cache_sentinel")?(g=r.jsx("div",{className:"absolute inset-x-0 top-0 h-24 bg-gradient-to-b from-warning/8 to-transparent pointer-events-none rounded-t-lg"}),t[15]=g):g=t[15];let p;t[16]===Symbol.for("react.memo_cache_sentinel")?(p=r.jsx("div",{className:"flex items-center justify-center size-11 rounded-full bg-warning/10 border border-warning/20 mx-auto",children:r.jsx(ee,{size:20,className:"text-warning"})}),t[16]=p):p=t[16];let w;t[17]!==e?(w=e("chat.creditsEmptyState.title"),t[17]=e,t[18]=w):w=t[18];let b;t[19]!==w?(b=r.jsx(V,{className:"text-lg font-semibold",children:w}),t[19]=w,t[20]=b):b=t[20];let y;t[21]!==e?(y=e("chat.creditsEmptyState.description"),t[21]=e,t[22]=y):y=t[22];let C;t[23]!==y?(C=r.jsx(ne,{className:"mt-2 text-sm leading-relaxed max-w-[320px] mx-auto",children:y}),t[23]=y,t[24]=C):C=t[24];let v;t[25]!==b||t[26]!==C?(v=r.jsxs("div",{className:"relative px-6 pt-7 pb-5",children:[g,r.jsxs(U,{className:"relative gap-3",children:[p,r.jsxs("div",{className:"text-center",children:[b,C]})]})]}),t[25]=b,t[26]=C,t[27]=v):v=t[27];let S;t[28]!==n||t[29]!==d?(S=n&&r.jsx("div",{className:"px-6 pb-5",children:r.jsx(Re,{source:"empty_state",onDone:d})}),t[28]=n,t[29]=d,t[30]=S):S=t[30];let j;t[31]!==d||t[32]!==s||t[33]!==l.slug?(j=()=>{s({to:"/$org/settings/ai-providers",params:{org:l.slug}}),d()},t[31]=d,t[32]=s,t[33]=l.slug,t[34]=j):j=t[34];let T;t[35]!==e?(T=e("chat.creditsEmptyState.useYourOwnProvider"),t[35]=e,t[36]=T):T=t[36];let P;t[37]===Symbol.for("react.memo_cache_sentinel")?(P=r.jsx(Qe,{size:12,className:"transition-transform duration-150 group-hover:translate-x-0.5"}),t[37]=P):P=t[37];let M;t[38]!==j||t[39]!==T?(M=r.jsxs("button",{type:"button",className:"group flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:j,children:[T,P]}),t[38]=j,t[39]=T,t[40]=M):M=t[40];let _;t[41]!==e?(_=e("chat.creditsEmptyState.skipForNow"),t[41]=e,t[42]=_):_=t[42];let k;t[43]!==d||t[44]!==_?(k=r.jsx(Y,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground",onClick:d,children:_}),t[43]=d,t[44]=_,t[45]=k):k=t[45];let E;t[46]!==M||t[47]!==k?(E=r.jsxs("div",{className:"px-6 py-3.5 border-t border-border bg-muted/30 flex items-center justify-between",children:[M,k]}),t[46]=M,t[47]=k,t[48]=E):E=t[48];let h;t[49]!==v||t[50]!==S||t[51]!==E?(h=r.jsxs(Q,{className:"sm:max-w-[500px] gap-0 p-0 overflow-hidden",onOpenAutoFocus:dt,children:[v,S,E]}),t[49]=v,t[50]=S,t[51]=E,t[52]=h):h=t[52];let N;return t[53]!==h||t[54]!==u?(N=r.jsx(W,{open:!0,onOpenChange:u,children:h}),t[53]=h,t[54]=u,t[55]=N):N=t[55],N}function dt(t){return t.preventDefault()}function mt(t){const e=I.c(6),{balanceDollars:l}=t;let a;e[0]!==l?(a=l.toFixed(2),e[0]=l,e[1]=a):a=e[1];const s=a;let n,m;e[2]===Symbol.for("react.memo_cache_sentinel")?(n=R("inline-flex items-center gap-1.5 px-3 py-1 rounded-full","bg-success/10 border border-success/20","animate-in fade-in-0 slide-in-from-bottom-2 duration-300"),m=r.jsx(ee,{size:13,className:"text-success"}),e[2]=n,e[3]=m):(n=e[2],m=e[3]);let o;return e[4]!==s?(o=r.jsxs("div",{className:n,children:[m,r.jsxs("span",{className:"text-xs font-medium text-success tabular-nums",children:["$",s," in credits to get started"]})]}),e[4]=s,e[5]=o):o=e[5],o}function ut(){const t=I.c(8),{org:e}=A(),l=X();let a;t[0]!==l||t[1]!==e.slug?(a=()=>l({to:"/$org/settings/ai-providers",params:{org:e.slug}}),t[0]=l,t[1]=e.slug,t[2]=a):a=t[2];let s,n,m;t[3]===Symbol.for("react.memo_cache_sentinel")?(s=R("inline-flex items-center gap-1.5 px-3 py-1 rounded-lg cursor-pointer","bg-warning/10 border border-warning/20","hover:bg-warning/15","transition-colors duration-150","animate-in fade-in-0 slide-in-from-bottom-2 duration-300"),n=r.jsx(Ze,{size:13,className:"text-warning"}),m=r.jsx("span",{className:"text-xs font-medium text-warning",children:"No credits remaining · Add more"}),t[3]=s,t[4]=n,t[5]=m):(s=t[3],n=t[4],m=t[5]);let o;return t[6]!==a?(o=r.jsxs("button",{type:"button",onClick:a,className:s,children:[n,m]}),t[6]=a,t[7]=o):o=t[7],o}function ft(t){const e=I.c(7),{scrollRef:l,sentinelRef:a,hasMoreOlder:s,isFetchingOlder:n,fetchOlderMessages:m}=t;let o,i;e[0]!==m||e[1]!==s||e[2]!==n||e[3]!==l||e[4]!==a?(o=()=>{const d=a.current,c=l.current;if(!d||!c||!s)return;const f=new IntersectionObserver(async u=>{if(!u[0]?.isIntersecting||n||!s)return;const p=c.scrollHeight,w=c.scrollTop;await m(),requestAnimationFrame(()=>{const b=c.scrollHeight;c.scrollTop=w+(b-p)})},{root:c,rootMargin:"200px 0px 0px 0px"});return f.observe(d),()=>f.disconnect()},i=[l,a,s,n,m],e[0]=m,e[1]=s,e[2]=n,e[3]=l,e[4]=a,e[5]=o,e[6]=i):(o=e[5],i=e[6]),L.useEffect(o,i)}function pt(t){const e=I.c(5),{className:l,children:a}=t;let s;e[0]!==l?(s=R("flex flex-col h-full w-full bg-background transform-[translateZ(0)]",l),e[0]=l,e[1]=s):s=e[1];let n;return e[2]!==a||e[3]!==s?(n=r.jsx("div",{className:s,children:a}),e[2]=a,e[3]=s,e[4]=n):n=e[4],n}function xt(t){const e=I.c(5),{children:l,className:a}=t;let s;e[0]!==a?(s=R("flex-1 min-h-0 overflow-y-auto isolate",a),e[0]=a,e[1]=s):s=e[1];let n;return e[2]!==l||e[3]!==s?(n=r.jsx("div",{className:s,children:l}),e[2]=l,e[3]=s,e[4]=n):n=e[4],n}function ht(t){const e=I.c(2),{children:l}=t;let a;return e[0]!==l?(a=r.jsx("div",{className:"min-h-full shrink-0 w-full flex items-center justify-center max-w-2xl mx-auto py-10",children:l}),e[0]=l,e[1]=a):a=e[1],a}function gt(){const t=$(),{messages:e,status:l,hasMoreOlder:a,isFetchingOlder:s,fetchOlderMessages:n,isRunInProgress:m}=Z(),{taskId:o}=xe();it();const i=he(o??""),d=ge(i),c=d.size===0?e:e.filter(j=>!d.has(j.id)),f=be(c,l==="submitted"||l==="streaming"||m),u=f.visible,g=ze(u),p=g.at(-1),b=Ae()*Fe+16,y=L.useRef(null),C=L.useRef(null);ft({scrollRef:y,sentinelRef:C,hasMoreOlder:a,isFetchingOlder:s,fetchOlderMessages:n});const v=He({initial:!1}),S=j=>{y.current=j,v.scrollRef(j)};return r.jsx(je.Provider,{value:f,children:r.jsx(Ge,{messages:e,children:r.jsxs("div",{className:"relative h-full w-full min-w-0",children:[r.jsx("div",{ref:S,"data-chat-scroller":!0,className:"w-full min-w-0 max-w-full overflow-y-auto h-full [container-type:size]",style:{paddingBottom:b},children:r.jsxs("div",{ref:v.contentRef,className:"overflow-x-clip",children:[r.jsxs("div",{className:"flex flex-col min-w-0 max-w-2xl mx-auto w-full",children:[r.jsx("div",{ref:C,"aria-hidden":!0,className:"h-px"}),s&&r.jsx("div",{className:"flex items-center justify-center py-3 text-xs text-muted-foreground",children:t("chat.chat.loadingOlderMessages")}),g.slice(0,-1).map((j,T)=>r.jsx(q,{pair:j,isLastPair:!1,status:T===g.length-1?l:void 0},`pair-${j.user?.id??j.assistant?.id}`))]}),p&&r.jsx("div",{className:"min-h-[100cqh] min-w-0 max-w-2xl mx-auto w-full",children:r.jsx(q,{pair:p,isLastPair:!0,status:l},`pair-${p.user?.id??p.assistant?.id}`)})]})}),!v.isAtBottom&&r.jsx(Y,{type:"button",variant:"outline",size:"icon-sm","aria-label":t("chat.chat.jumpToLatest"),className:"absolute left-1/2 z-50 -translate-x-1/2 shadow-soft animate-in fade-in duration-200 dark:bg-background dark:hover:bg-accent",style:{bottom:b+8},onClick:()=>{v.scrollToBottom()},children:r.jsx(oe,{size:14})})]})})})}function bt(t){const e=I.c(5),{children:l,className:a}=t;let s;e[0]!==a?(s=R("flex-none w-full mx-auto p-2 pt-0","max-w-2xl min-w-0",a),e[0]=a,e[1]=s):s=e[1];let n;return e[2]!==l||e[3]!==s?(n=r.jsx("div",{className:s,children:l}),e[2]=l,e[3]=s,e[4]=n):n=e[4],n}const Ht=Object.assign(pt,{Main:xt,Messages:gt,EmptyState:ht,Footer:bt,Input:$e,Provider:pe,StreamHost:fe,ActiveTaskStreamSource:ue,ThreadlessStreamSource:me,IceBreakers:nt,NoAiProviderEmptyState:Ve,CreditsEmptyState:ct,CreditsEyebrow:mt,NoCreditsEyebrow:ut,CreditsExhaustedBanner:Oe});export{Ht as C,zt as w};
|
|
1
|
+
import{c as I,a4 as A,aS as le,m as R,j as r,R as ae,r as L,b as $,t as z,h as H,w as U,x as V,v as Q,D as W,d as X,E as G,aT as ne,B as Y}from"./index-B0kMZVmC.js";import{n as oe}from"./ArrowUp-BGhmN6Zx.js";import{d as ie,b as Z,f as ce,u as de,T as me,A as ue,n as fe,o as pe,c as xe,p as he,q as ge,t as be,L as je}from"./chat-context-BOjsomdh.js";import{s as ye,g as J,d as ve}from"./tool-namespace-pd4DYce0.js";import{b as F,T as we,a as Ne,c as Ce}from"./tooltip-BTKQq4Sy.js";import{e as Se,b as Te,a as Pe,D as ke}from"./drawer-BBqyYfPx.js";import{C as Ee}from"./collection-search-CwqvBBm4.js";import{u as De}from"./use-mobile-CMr55W3O.js";import{u as Me}from"./use-mcp-client-Cp7itm-S.js";import{u as _e,g as Be}from"./use-mcp-prompts-CF2bE4L8.js";import{h as Ie,P as Le}from"./usage-stats-LrxjpMvT.js";import{T as Re,c as Oe,b as $e,d as Ae,H as Fe}from"./input-ClzrEMuy.js";import{u as ze,a as He,S as Ge,M as q}from"./pair-BXQ1AL58.js";import{u as qe,i as Ke}from"./thread-intent-oRL32U-K.js";import{b as Ue}from"./use-view-draft-kind-BTxfGo3P.js";import{N as Ve}from"./index-B2FeU0Zw.js";import{i as Qe}from"./LinkBroken01-BrTHjhI6.js";import{f as ee}from"./agent-icon-BLhMgLPf.js";import{d as We}from"./use-entitlements-D0Sb8QlP.js";import{u as Xe}from"./use-deco-credits-B5uE_Z9G.js";import{F as Ye}from"./feature-paywall-DFIdKSLH.js";import{i as Ze}from"./AlertCircle-CTbjWy6O.js";const K=3,te="inline-flex items-center gap-2 px-5 py-2.5 rounded-full bg-muted text-muted-foreground text-sm font-medium transition-colors cursor-pointer",Je="flex flex-col gap-1.5 p-4 rounded-xl bg-accent/40 text-sm leading-snug transition-colors cursor-pointer text-left";function se(t){const e=I.c(46),{item:l,onSelect:a,isLoading:s,isDisabled:n,variant:m}=t,o=m===void 0?"pill":m,{prompt:i}=l;let d;if(e[0]!==i._meta||e[1]!==i.name||e[2]!==i.title){const P=J(i._meta);d=i.title??ve(i.name,P),e[0]=i._meta,e[1]=i.name,e[2]=i.title,e[3]=d}else d=e[3];const c=d,f=i.description||null;if(o==="card"){let P;e[4]!==a||e[5]!==i?(P=()=>a(i),e[4]=a,e[5]=i,e[6]=P):P=e[6];const M=n||s,_=s&&"bg-accent/40",k=(n||s)&&"cursor-not-allowed opacity-50";let E;e[7]!==_||e[8]!==k?(E=R(Je,"hover:bg-accent text-foreground",_,k),e[7]=_,e[8]=k,e[9]=E):E=e[9];let h;e[10]!==c?(h=r.jsx("span",{className:"font-medium truncate capitalize",children:c}),e[10]=c,e[11]=h):h=e[11];let N;e[12]!==s?(N=s&&r.jsx(H,{size:"xs"}),e[12]=s,e[13]=N):N=e[13];let x;e[14]!==h||e[15]!==N?(x=r.jsxs("div",{className:"flex items-center justify-between gap-2",children:[h,N]}),e[14]=h,e[15]=N,e[16]=x):x=e[16];let D;e[17]!==f?(D=f&&r.jsx("span",{className:"text-xs text-muted-foreground line-clamp-2",children:f}),e[17]=f,e[18]=D):D=e[18];let B;return e[19]!==x||e[20]!==D||e[21]!==P||e[22]!==M||e[23]!==E?(B=r.jsxs("button",{type:"button",onClick:P,disabled:M,className:E,children:[x,D]}),e[19]=x,e[20]=D,e[21]=P,e[22]=M,e[23]=E,e[24]=B):B=e[24],B}let u;e[25]!==a||e[26]!==i?(u=()=>a(i),e[25]=a,e[26]=i,e[27]=u):u=e[27];const g=n||s,p=s&&"bg-muted/50",w=(n||s)&&"cursor-not-allowed opacity-50";let b;e[28]!==p||e[29]!==w?(b=R(te,"hover:bg-accent hover:text-foreground",p,w),e[28]=p,e[29]=w,e[30]=b):b=e[30];let y;e[31]!==c?(y=r.jsx("span",{className:"capitalize",children:c}),e[31]=c,e[32]=y):y=e[32];let C;e[33]!==s?(C=s&&r.jsx(H,{size:"xs"}),e[33]=s,e[34]=C):C=e[34];let v;e[35]!==u||e[36]!==g||e[37]!==b||e[38]!==y||e[39]!==C?(v=r.jsx(we,{asChild:!0,children:r.jsxs("button",{type:"button",onClick:u,disabled:g,className:b,children:[y,C]})}),e[35]=u,e[36]=g,e[37]=b,e[38]=y,e[39]=C,e[40]=v):v=e[40];const S=f??c;let j;e[41]!==S?(j=r.jsx(Ne,{side:"top",className:"max-w-xs",children:r.jsx("p",{className:"text-xs",children:S})}),e[41]=S,e[42]=j):j=e[42];let T;return e[43]!==v||e[44]!==j?(T=r.jsxs(Ce,{delayDuration:400,children:[v,j]}),e[43]=v,e[44]=j,e[45]=T):T=e[45],T}function et(t){const e=I.c(61),{items:l,open:a,onOpenChange:s,onSelect:n,loadingPrompt:m}=t,o=$(),[i,d]=L.useState(""),c=!!m;let f;e[0]!==l||e[1]!==i?(f=i.trim()?l.filter(h=>{const N=i.toLowerCase();return h.prompt.name.toLowerCase().includes(N)||(h.prompt.title??"").toLowerCase().includes(N)||(h.prompt.description??"").toLowerCase().includes(N)}):l,e[0]=l,e[1]=i,e[2]=f):f=e[2];const u=f,g=De();let p;e[3]!==u.length||e[4]!==i||e[5]!==o?(p=u.length===0&&r.jsx("p",{className:"col-span-4 text-sm text-muted-foreground text-center py-8",children:o("chat.iceBreakers.noPromptsMatch",{search:i})}),e[3]=u.length,e[4]=i,e[5]=o,e[6]=p):p=e[6];let w;if(e[7]!==u||e[8]!==c||e[9]!==m?.name||e[10]!==s||e[11]!==n){let h;e[13]!==c||e[14]!==m?.name||e[15]!==s||e[16]!==n?(h=N=>r.jsx(se,{item:N,variant:"card",onSelect:x=>{s(!1),n(x)},isLoading:m?.name===N.prompt.name,isDisabled:c&&m?.name!==N.prompt.name},N.prompt.name),e[13]=c,e[14]=m?.name,e[15]=s,e[16]=n,e[17]=h):h=e[17],w=u.map(h),e[7]=u,e[8]=c,e[9]=m?.name,e[10]=s,e[11]=n,e[12]=w}else w=e[12];let b;e[18]!==p||e[19]!==w?(b=r.jsx("div",{className:"flex-1 overflow-y-auto [scrollbar-gutter:stable]",children:r.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3 p-5",children:[p,w]})}),e[18]=p,e[19]=w,e[20]=b):b=e[20];const y=b;let C;e[21]!==o?(C=o("chat.iceBreakers.searchPromptsPlaceholder"),e[21]=o,e[22]=C):C=e[22];let v;e[23]===Symbol.for("react.memo_cache_sentinel")?(v=h=>{h.key==="Escape"&&d("")},e[23]=v):v=e[23];let S;e[24]!==i||e[25]!==C?(S=r.jsx(Ee,{value:i,onChange:d,placeholder:C,onKeyDown:v}),e[24]=i,e[25]=C,e[26]=S):S=e[26];const j=S;if(g){let h;e[27]!==o?(h=o("chat.iceBreakers.allPromptsTitle"),e[27]=o,e[28]=h):h=e[28];let N;e[29]!==h?(N=r.jsx(Se,{className:"sr-only",children:r.jsx(Te,{children:h})}),e[29]=h,e[30]=N):N=e[30];let x;e[31]!==o?(x=o("chat.iceBreakers.promptsLabel"),e[31]=o,e[32]=x):x=e[32];let D;e[33]!==x?(D=r.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 shrink-0",children:r.jsx("span",{className:"text-sm font-medium text-foreground",children:x})}),e[33]=x,e[34]=D):D=e[34];let B;e[35]!==y||e[36]!==j||e[37]!==D||e[38]!==N?(B=r.jsxs(Pe,{className:"h-[85vh] flex flex-col p-0 gap-0",children:[N,D,j,y]}),e[35]=y,e[36]=j,e[37]=D,e[38]=N,e[39]=B):B=e[39];let O;return e[40]!==s||e[41]!==a||e[42]!==B?(O=r.jsx(F,{delayDuration:400,children:r.jsx(ke,{open:a,onOpenChange:s,children:B})}),e[40]=s,e[41]=a,e[42]=B,e[43]=O):O=e[43],O}let T;e[44]!==o?(T=o("chat.iceBreakers.allPromptsTitle"),e[44]=o,e[45]=T):T=e[45];let P;e[46]!==T?(P=r.jsx(U,{className:"sr-only",children:r.jsx(V,{children:T})}),e[46]=T,e[47]=P):P=e[47];let M;e[48]!==o?(M=o("chat.iceBreakers.promptsLabel"),e[48]=o,e[49]=M):M=e[49];let _;e[50]!==M?(_=r.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 shrink-0",children:r.jsx("span",{className:"text-sm font-medium text-foreground",children:M})}),e[50]=M,e[51]=_):_=e[51];let k;e[52]!==y||e[53]!==j||e[54]!==_||e[55]!==P?(k=r.jsxs(Q,{className:"sm:max-w-[1100px] h-[680px] p-0 gap-0 overflow-hidden flex flex-col",children:[P,_,j,y]}),e[52]=y,e[53]=j,e[54]=_,e[55]=P,e[56]=k):k=e[56];let E;return e[57]!==s||e[58]!==a||e[59]!==k?(E=r.jsx(F,{delayDuration:400,children:r.jsx(W,{open:a,onOpenChange:s,children:k})}),e[57]=s,e[58]=a,e[59]=k,e[60]=E):E=e[60],E}function tt(t){const e=I.c(30),{items:l,onSelect:a,loadingPrompt:s,className:n}=t,m=$(),[o,i]=L.useState(!1);if(l.length===0)return null;let d,c,f,u,g;if(e[0]!==n||e[1]!==l||e[2]!==s||e[3]!==a||e[4]!==m){const y=l.slice(0,K),C=l.slice(K),v=!!s;let S;e[10]!==v||e[11]!==s?.name||e[12]!==a?(S=T=>r.jsx(se,{item:T,onSelect:a,isLoading:s?.name===T.prompt.name,isDisabled:v&&s?.name!==T.prompt.name},T.prompt.name),e[10]=v,e[11]=s?.name,e[12]=a,e[13]=S):S=e[13];const j=y.map(S);d=F,g=400,e[14]!==n?(c=R("w-full flex flex-wrap gap-2 justify-center",n),e[14]=n,e[15]=c):c=e[15],f=j,u=C.length>0&&r.jsx("button",{type:"button",disabled:v,onClick:()=>i(!0),className:R(te,"hover:bg-accent hover:text-foreground",v&&"opacity-50 cursor-not-allowed"),children:m("chat.iceBreakers.moreButton",{count:C.length})}),e[0]=n,e[1]=l,e[2]=s,e[3]=a,e[4]=m,e[5]=d,e[6]=c,e[7]=f,e[8]=u,e[9]=g}else d=e[5],c=e[6],f=e[7],u=e[8],g=e[9];let p;e[16]!==c||e[17]!==f||e[18]!==u?(p=r.jsxs("div",{className:c,children:[f,u]}),e[16]=c,e[17]=f,e[18]=u,e[19]=p):p=e[19];let w;e[20]!==l||e[21]!==s||e[22]!==o||e[23]!==a?(w=r.jsx(et,{items:l,open:o,onOpenChange:i,onSelect:a,loadingPrompt:s}),e[20]=l,e[21]=s,e[22]=o,e[23]=a,e[24]=w):w=e[24];let b;return e[25]!==d||e[26]!==g||e[27]!==p||e[28]!==w?(b=r.jsxs(d,{delayDuration:g,children:[p,w]}),e[25]=d,e[26]=g,e[27]=p,e[28]=w,e[29]=b):b=e[29],b}function st(){return null}function rt(t,e){switch(e.type){case"SELECT_PROMPT":return!e.prompt.arguments||e.prompt.arguments.length===0?{stage:"loading",prompt:e.prompt}:{stage:"idle"};case"START_LOADING":return{stage:"loading",prompt:e.prompt,arguments:e.arguments};case"RESET":return{stage:"idle"};default:return t}}function lt(t){const e=I.c(31),{connectionId:l}=t,a=$(),{sendMessage:s}=Z(),{org:n}=A();let m;e[0]!==l||e[1]!==n.id||e[2]!==n.slug?(m={connectionId:l,orgId:n.id,orgSlug:n.slug},e[0]=l,e[1]=n.id,e[2]=n.slug,e[3]=m):m=e[3];const o=Me(m);let i;e[4]!==o?(i={client:o,staleTime:6e4},e[4]=o,e[5]=i):i=e[5];const{data:d}=_e(i);let c;e[6]!==d?.prompts?(c=d?.prompts??[],e[6]=d?.prompts,e[7]=c):c=e[7];const f=c;let u;e[8]!==f?(u=f.map(at),e[8]=f,e[9]=u):u=e[9];const g=u;let p;e[10]===Symbol.for("react.memo_cache_sentinel")?(p={stage:"idle"},e[10]=p):p=e[10];const[w,b]=L.useReducer(rt,p),[y,C]=L.useState(null);let v;e[11]!==o||e[12]!==s||e[13]!==a?(v=async(x,D)=>{if(!o){z.error(a("chat.iceBreakers.mcpClientNotAvailable")),b({type:"RESET"});return}try{const B=await Be(o,x.name,D);b({type:"RESET"});const O={type:"doc",content:[{type:"paragraph",content:[Ie({id:x.name,name:ye(x.name,J(x._meta)),metadata:B.messages,char:"/",kind:"prompt",args:D}),{type:"text",text:" "}]}]};await s(O)}catch(B){console.error("[ice-breakers] Failed to fetch prompt:",B),z.error(a("chat.iceBreakers.failedToLoadPrompt")),b({type:"RESET"})}},e[11]=o,e[12]=s,e[13]=a,e[14]=v):v=e[14];const S=v;let j;e[15]!==S?(j=async x=>{if(x.arguments&&x.arguments.length>0){b({type:"SELECT_PROMPT",prompt:x}),C(x);return}b({type:"START_LOADING",prompt:x}),await S(x)},e[15]=S,e[16]=j):j=e[16];const T=j;let P;e[17]!==y||e[18]!==S?(P=async x=>{y&&(b({type:"START_LOADING",prompt:y,arguments:x}),C(null),await S(y,x))},e[17]=y,e[18]=S,e[19]=P):P=e[19];const M=P;if(g.length===0)return null;const _=w.stage==="loading"?w.prompt:null;let k;e[20]!==T||e[21]!==g||e[22]!==_?(k=r.jsx(tt,{items:g,onSelect:T,loadingPrompt:_}),e[20]=T,e[21]=g,e[22]=_,e[23]=k):k=e[23];let E;e[24]===Symbol.for("react.memo_cache_sentinel")?(E=()=>{C(null),b({type:"RESET"})},e[24]=E):E=e[24];let h;e[25]!==y||e[26]!==M?(h=r.jsx(Le,{prompt:y,setPrompt:E,onSubmit:M}),e[25]=y,e[26]=M,e[27]=h):h=e[27];let N;return e[28]!==k||e[29]!==h?(N=r.jsxs(r.Fragment,{children:[k,h]}),e[28]=k,e[29]=h,e[30]=N):N=e[30],N}function at(t){return{prompt:t}}function nt(t){const e=I.c(13),{className:l}=t,{selectedVirtualMcp:a}=ie(),{org:s}=A();let n;e[0]!==s.id?(n=le(s.id),e[0]=s.id,e[1]=n):n=e[1];const m=n.id,o=a?.id??m;let i;e[2]!==l?(i=R("w-full @container",l),e[2]=l,e[3]=i):i=e[3];const d=o??"default";let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=r.jsx(st,{}),e[4]=c):c=e[4];let f;e[5]!==o?(f=r.jsx(lt,{connectionId:o}),e[5]=o,e[6]=f):f=e[6];let u;e[7]!==d||e[8]!==f?(u=r.jsx(ae,{fallback:null,children:r.jsx(L.Suspense,{fallback:c,children:f},d)}),e[7]=d,e[8]=f,e[9]=u):u=e[9];let g;return e[10]!==i||e[11]!==u?(g=r.jsx("div",{className:i,children:u}),e[10]=i,e[11]=u,e[12]=g):g=e[12],g}function ot(t){let e=0;for(const l of t)for(const a of l.parts??[]){const s=a;s.type==="tool-load_repo"&&s.state==="output-available"&&s.output?.success===!0&&e++}return e}function it(){const t=I.c(11),{openPanel:e}=Ue(),l=qe(),a=ce()?.messages??[],s=de(),n=s?.taskId??null,m=s?.currentBranch;let o;t[0]!==m?(o=Ke(m),t[0]=m,t[1]=o):o=t[1];const i=o;let d;t[2]!==a?(d=ot(a),t[2]=a,t[3]=d):d=t[3];const c=d,f=L.useRef(null),u=L.useRef(null);let g,p;t[4]!==i||t[5]!==c||t[6]!==l||t[7]!==e||t[8]!==n?(g=()=>{if(!c||!n)return;const w=`${n}:${c}`;u.current!==w&&(u.current=w,l?.refreshThreadMetadata(n)),f.current!==n&&(f.current=n,i||e("site-editor"))},p=[c,n,e,l,i],t[4]=i,t[5]=c,t[6]=l,t[7]=e,t[8]=n,t[9]=g,t[10]=p):(g=t[9],p=t[10]),L.useEffect(g,p)}function re(t){return`deco-credits-empty-dismissed:${t}`}function zt(t){try{return localStorage.getItem(re(t))==="1"}catch{return!1}}function ct(){const t=I.c(56),e=$(),{org:l}=A(),a=We("credits"),s=X(),{decoKeyId:n}=Xe(),[m,o]=L.useState(!0);let i;t[0]!==l.id?(i=()=>{G("credits_empty_state_dismissed",{organization_id:l.id}),o(!1);try{localStorage.setItem(re(l.id),"1")}catch{}},t[0]=l.id,t[1]=i):i=t[1];const d=i;let c,f;if(t[2]!==m||t[3]!==l.id?(c=()=>{m&&G("credits_empty_state_shown",{organization_id:l.id})},f=[m,l.id],t[2]=m,t[3]=l.id,t[4]=c,t[5]=f):(c=t[4],f=t[5]),L.useEffect(c,f),!m)return null;if(!a){let x;t[6]!==e?(x=e("chat.input.allowanceExhaustedTitle"),t[6]=e,t[7]=x):x=t[7];let D;t[8]!==x?(D={title:x},t[8]=x,t[9]=D):D=t[9];let B;return t[10]!==d||t[11]!==D?(B=r.jsx(Ye,{feature:"chat",copy:D,onDismiss:d}),t[10]=d,t[11]=D,t[12]=B):B=t[12],B}let u;t[13]!==d?(u=x=>!x&&d(),t[13]=d,t[14]=u):u=t[14];let g;t[15]===Symbol.for("react.memo_cache_sentinel")?(g=r.jsx("div",{className:"absolute inset-x-0 top-0 h-24 bg-gradient-to-b from-warning/8 to-transparent pointer-events-none rounded-t-lg"}),t[15]=g):g=t[15];let p;t[16]===Symbol.for("react.memo_cache_sentinel")?(p=r.jsx("div",{className:"flex items-center justify-center size-11 rounded-full bg-warning/10 border border-warning/20 mx-auto",children:r.jsx(ee,{size:20,className:"text-warning"})}),t[16]=p):p=t[16];let w;t[17]!==e?(w=e("chat.creditsEmptyState.title"),t[17]=e,t[18]=w):w=t[18];let b;t[19]!==w?(b=r.jsx(V,{className:"text-lg font-semibold",children:w}),t[19]=w,t[20]=b):b=t[20];let y;t[21]!==e?(y=e("chat.creditsEmptyState.description"),t[21]=e,t[22]=y):y=t[22];let C;t[23]!==y?(C=r.jsx(ne,{className:"mt-2 text-sm leading-relaxed max-w-[320px] mx-auto",children:y}),t[23]=y,t[24]=C):C=t[24];let v;t[25]!==b||t[26]!==C?(v=r.jsxs("div",{className:"relative px-6 pt-7 pb-5",children:[g,r.jsxs(U,{className:"relative gap-3",children:[p,r.jsxs("div",{className:"text-center",children:[b,C]})]})]}),t[25]=b,t[26]=C,t[27]=v):v=t[27];let S;t[28]!==n||t[29]!==d?(S=n&&r.jsx("div",{className:"px-6 pb-5",children:r.jsx(Re,{source:"empty_state",onDone:d})}),t[28]=n,t[29]=d,t[30]=S):S=t[30];let j;t[31]!==d||t[32]!==s||t[33]!==l.slug?(j=()=>{s({to:"/$org/settings/ai-providers",params:{org:l.slug}}),d()},t[31]=d,t[32]=s,t[33]=l.slug,t[34]=j):j=t[34];let T;t[35]!==e?(T=e("chat.creditsEmptyState.useYourOwnProvider"),t[35]=e,t[36]=T):T=t[36];let P;t[37]===Symbol.for("react.memo_cache_sentinel")?(P=r.jsx(Qe,{size:12,className:"transition-transform duration-150 group-hover:translate-x-0.5"}),t[37]=P):P=t[37];let M;t[38]!==j||t[39]!==T?(M=r.jsxs("button",{type:"button",className:"group flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:j,children:[T,P]}),t[38]=j,t[39]=T,t[40]=M):M=t[40];let _;t[41]!==e?(_=e("chat.creditsEmptyState.skipForNow"),t[41]=e,t[42]=_):_=t[42];let k;t[43]!==d||t[44]!==_?(k=r.jsx(Y,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground",onClick:d,children:_}),t[43]=d,t[44]=_,t[45]=k):k=t[45];let E;t[46]!==M||t[47]!==k?(E=r.jsxs("div",{className:"px-6 py-3.5 border-t border-border bg-muted/30 flex items-center justify-between",children:[M,k]}),t[46]=M,t[47]=k,t[48]=E):E=t[48];let h;t[49]!==v||t[50]!==S||t[51]!==E?(h=r.jsxs(Q,{className:"sm:max-w-[500px] gap-0 p-0 overflow-hidden",onOpenAutoFocus:dt,children:[v,S,E]}),t[49]=v,t[50]=S,t[51]=E,t[52]=h):h=t[52];let N;return t[53]!==h||t[54]!==u?(N=r.jsx(W,{open:!0,onOpenChange:u,children:h}),t[53]=h,t[54]=u,t[55]=N):N=t[55],N}function dt(t){return t.preventDefault()}function mt(t){const e=I.c(6),{balanceDollars:l}=t;let a;e[0]!==l?(a=l.toFixed(2),e[0]=l,e[1]=a):a=e[1];const s=a;let n,m;e[2]===Symbol.for("react.memo_cache_sentinel")?(n=R("inline-flex items-center gap-1.5 px-3 py-1 rounded-full","bg-success/10 border border-success/20","animate-in fade-in-0 slide-in-from-bottom-2 duration-300"),m=r.jsx(ee,{size:13,className:"text-success"}),e[2]=n,e[3]=m):(n=e[2],m=e[3]);let o;return e[4]!==s?(o=r.jsxs("div",{className:n,children:[m,r.jsxs("span",{className:"text-xs font-medium text-success tabular-nums",children:["$",s," in credits to get started"]})]}),e[4]=s,e[5]=o):o=e[5],o}function ut(){const t=I.c(8),{org:e}=A(),l=X();let a;t[0]!==l||t[1]!==e.slug?(a=()=>l({to:"/$org/settings/ai-providers",params:{org:e.slug}}),t[0]=l,t[1]=e.slug,t[2]=a):a=t[2];let s,n,m;t[3]===Symbol.for("react.memo_cache_sentinel")?(s=R("inline-flex items-center gap-1.5 px-3 py-1 rounded-lg cursor-pointer","bg-warning/10 border border-warning/20","hover:bg-warning/15","transition-colors duration-150","animate-in fade-in-0 slide-in-from-bottom-2 duration-300"),n=r.jsx(Ze,{size:13,className:"text-warning"}),m=r.jsx("span",{className:"text-xs font-medium text-warning",children:"No credits remaining · Add more"}),t[3]=s,t[4]=n,t[5]=m):(s=t[3],n=t[4],m=t[5]);let o;return t[6]!==a?(o=r.jsxs("button",{type:"button",onClick:a,className:s,children:[n,m]}),t[6]=a,t[7]=o):o=t[7],o}function ft(t){const e=I.c(7),{scrollRef:l,sentinelRef:a,hasMoreOlder:s,isFetchingOlder:n,fetchOlderMessages:m}=t;let o,i;e[0]!==m||e[1]!==s||e[2]!==n||e[3]!==l||e[4]!==a?(o=()=>{const d=a.current,c=l.current;if(!d||!c||!s)return;const f=new IntersectionObserver(async u=>{if(!u[0]?.isIntersecting||n||!s)return;const p=c.scrollHeight,w=c.scrollTop;await m(),requestAnimationFrame(()=>{const b=c.scrollHeight;c.scrollTop=w+(b-p)})},{root:c,rootMargin:"200px 0px 0px 0px"});return f.observe(d),()=>f.disconnect()},i=[l,a,s,n,m],e[0]=m,e[1]=s,e[2]=n,e[3]=l,e[4]=a,e[5]=o,e[6]=i):(o=e[5],i=e[6]),L.useEffect(o,i)}function pt(t){const e=I.c(5),{className:l,children:a}=t;let s;e[0]!==l?(s=R("flex flex-col h-full w-full bg-background transform-[translateZ(0)]",l),e[0]=l,e[1]=s):s=e[1];let n;return e[2]!==a||e[3]!==s?(n=r.jsx("div",{className:s,children:a}),e[2]=a,e[3]=s,e[4]=n):n=e[4],n}function xt(t){const e=I.c(5),{children:l,className:a}=t;let s;e[0]!==a?(s=R("flex-1 min-h-0 overflow-y-auto isolate",a),e[0]=a,e[1]=s):s=e[1];let n;return e[2]!==l||e[3]!==s?(n=r.jsx("div",{className:s,children:l}),e[2]=l,e[3]=s,e[4]=n):n=e[4],n}function ht(t){const e=I.c(2),{children:l}=t;let a;return e[0]!==l?(a=r.jsx("div",{className:"min-h-full shrink-0 w-full flex items-center justify-center max-w-2xl mx-auto py-10",children:l}),e[0]=l,e[1]=a):a=e[1],a}function gt(){const t=$(),{messages:e,status:l,hasMoreOlder:a,isFetchingOlder:s,fetchOlderMessages:n,isRunInProgress:m}=Z(),{taskId:o}=xe();it();const i=he(o??""),d=ge(i),c=d.size===0?e:e.filter(j=>!d.has(j.id)),f=be(c,l==="submitted"||l==="streaming"||m),u=f.visible,g=ze(u),p=g.at(-1),b=Ae()*Fe+16,y=L.useRef(null),C=L.useRef(null);ft({scrollRef:y,sentinelRef:C,hasMoreOlder:a,isFetchingOlder:s,fetchOlderMessages:n});const v=He({initial:!1}),S=j=>{y.current=j,v.scrollRef(j)};return r.jsx(je.Provider,{value:f,children:r.jsx(Ge,{messages:e,children:r.jsxs("div",{className:"relative h-full w-full min-w-0",children:[r.jsx("div",{ref:S,"data-chat-scroller":!0,className:"w-full min-w-0 max-w-full overflow-y-auto h-full [container-type:size]",style:{paddingBottom:b},children:r.jsxs("div",{ref:v.contentRef,className:"overflow-x-clip",children:[r.jsxs("div",{className:"flex flex-col min-w-0 max-w-2xl mx-auto w-full",children:[r.jsx("div",{ref:C,"aria-hidden":!0,className:"h-px"}),s&&r.jsx("div",{className:"flex items-center justify-center py-3 text-xs text-muted-foreground",children:t("chat.chat.loadingOlderMessages")}),g.slice(0,-1).map((j,T)=>r.jsx(q,{pair:j,isLastPair:!1,status:T===g.length-1?l:void 0},`pair-${j.user?.id??j.assistant?.id}`))]}),p&&r.jsx("div",{className:"min-h-[100cqh] min-w-0 max-w-2xl mx-auto w-full",children:r.jsx(q,{pair:p,isLastPair:!0,status:l},`pair-${p.user?.id??p.assistant?.id}`)})]})}),!v.isAtBottom&&r.jsx(Y,{type:"button",variant:"outline",size:"icon-sm","aria-label":t("chat.chat.jumpToLatest"),className:"absolute left-1/2 z-50 -translate-x-1/2 shadow-soft animate-in fade-in duration-200 dark:bg-background dark:hover:bg-accent",style:{bottom:b+8},onClick:()=>{v.scrollToBottom()},children:r.jsx(oe,{size:14})})]})})})}function bt(t){const e=I.c(5),{children:l,className:a}=t;let s;e[0]!==a?(s=R("flex-none w-full mx-auto p-2 pt-0","max-w-2xl min-w-0",a),e[0]=a,e[1]=s):s=e[1];let n;return e[2]!==l||e[3]!==s?(n=r.jsx("div",{className:s,children:l}),e[2]=l,e[3]=s,e[4]=n):n=e[4],n}const Ht=Object.assign(pt,{Main:xt,Messages:gt,EmptyState:ht,Footer:bt,Input:$e,Provider:pe,StreamHost:fe,ActiveTaskStreamSource:ue,ThreadlessStreamSource:me,IceBreakers:nt,NoAiProviderEmptyState:Ve,CreditsEmptyState:ct,CreditsEyebrow:mt,NoCreditsEyebrow:ut,CreditsExhaustedBanner:Oe});export{Ht as C,zt as w};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d4 as _}from"./index-
|
|
1
|
+
import{d4 as _}from"./index-B0kMZVmC.js";var S={exports:{}},r={};var $;function I(){if($)return r;$=1;var m=Symbol.for("react.element"),y=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),f=Symbol.for("react.context"),x=Symbol.for("react.server_context"),u=Symbol.for("react.forward_ref"),i=Symbol.for("react.suspense"),l=Symbol.for("react.suspense_list"),a=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),R=Symbol.for("react.offscreen"),b;b=Symbol.for("react.module.reference");function t(e){if(typeof e=="object"&&e!==null){var d=e.$$typeof;switch(d){case m:switch(e=e.type,e){case o:case s:case n:case i:case l:return e;default:switch(e=e&&e.$$typeof,e){case x:case f:case u:case p:case a:case c:return e;default:return d}}case y:return d}}}return r.ContextConsumer=f,r.ContextProvider=c,r.Element=m,r.ForwardRef=u,r.Fragment=o,r.Lazy=p,r.Memo=a,r.Portal=y,r.Profiler=s,r.StrictMode=n,r.Suspense=i,r.SuspenseList=l,r.isAsyncMode=function(){return!1},r.isConcurrentMode=function(){return!1},r.isContextConsumer=function(e){return t(e)===f},r.isContextProvider=function(e){return t(e)===c},r.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===m},r.isForwardRef=function(e){return t(e)===u},r.isFragment=function(e){return t(e)===o},r.isLazy=function(e){return t(e)===p},r.isMemo=function(e){return t(e)===a},r.isPortal=function(e){return t(e)===y},r.isProfiler=function(e){return t(e)===s},r.isStrictMode=function(e){return t(e)===n},r.isSuspense=function(e){return t(e)===i},r.isSuspenseList=function(e){return t(e)===l},r.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===o||e===s||e===n||e===i||e===l||e===R||typeof e=="object"&&e!==null&&(e.$$typeof===p||e.$$typeof===a||e.$$typeof===c||e.$$typeof===f||e.$$typeof===u||e.$$typeof===b||e.getModuleId!==void 0)},r.typeOf=t,r}var v;function C(){return v||(v=1,S.exports=I()),S.exports}var g=C();const h=_(g);export{h as R,g as r};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{N as P,q as De,c as k,R as Ie,r as Pe,t as se,v as E,w as Oe,T as H,x as je,y as M,z as L,A as ve,D as Q,B as Z,C as Fe,G as _e,H as Ve,I as Ke,J as q,f as Xe}from"./usage-stats-DXQh2ym6.js";const qe=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,Ue=P.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:e}){return["img",k(this.options.HTMLAttributes,e)]},parseMarkdown:(e,t)=>t.createNode("image",{src:e.href,title:e.title,alt:e.text}),renderMarkdown:e=>{var t,n,o,l,r,s;const c=(t=(n=e.attrs)===null||n===void 0?void 0:n.src)!==null&&t!==void 0?t:"",i=(o=(l=e.attrs)===null||l===void 0?void 0:l.alt)!==null&&o!==void 0?o:"",a=(r=(s=e.attrs)===null||s===void 0?void 0:s.title)!==null&&r!==void 0?r:"";return a?``:``},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>"u")return null;const{directions:e,minWidth:t,minHeight:n,alwaysPreserveAspectRatio:o}=this.options.resize,l=new Set(["src","width","height"]);return({node:r,getPos:s,HTMLAttributes:c,editor:i})=>{const a=document.createElement("img");a.draggable=!1;const d=k(this.options.HTMLAttributes,c);Object.entries(d).forEach(([w,S])=>{if(S!=null)switch(w){case"src":case"width":case"height":break;default:a.setAttribute(w,S)}}),d.src!==null&&(a.src=d.src);let u={...c};const f=w=>{if(typeof w=="string"&&w!==""){a.getAttribute("src")!==w&&(a.src=w);return}a.hasAttribute("src")&&a.removeAttribute("src"),a.src!==""&&(a.src="")};f(c.src);const p=w=>{if(w.type!==r.type)return!1;const S=i.extensionManager.attributes.filter(A=>A.type===w.type.name),y=Pe(w,S);return Object.keys(u).forEach(A=>{!l.has(A)&&!(A in y)&&a.removeAttribute(A)}),Object.entries(y).forEach(([A,R])=>{l.has(A)||(R!=null?a.setAttribute(A,R):a.removeAttribute(A))}),f(y.src),u=y,!0},h=new Ie({element:a,editor:i,node:r,getPos:s,onResize:(w,S)=>{a.style.width=`${w}px`,a.style.height=`${S}px`},onCommit:(w,S)=>{const y=s();y!==void 0&&this.editor.chain().setNodeSelection(y).updateAttributes(this.name,{width:w,height:S}).run()},onUpdate:p,options:{directions:e,min:{width:t,height:n},preserveAspectRatio:o===!0}}),g=h.dom,m=()=>{g.style.visibility="",g.style.pointerEvents=""};return g.style.visibility="hidden",g.style.pointerEvents="none",a.complete&&a.naturalWidth>0?m():(a.onload=m,a.onerror=m),h}},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[De({find:qe,type:this.type,getAttributes:e=>{const[,,t,n,o]=e;return{src:n,alt:t,title:o}}})]}});var un=Ue;let ee,te;if(typeof WeakMap<"u"){let e=new WeakMap;ee=t=>e.get(t),te=(t,n)=>(e.set(t,n),n)}else{const e=[];let n=0;ee=o=>{for(let l=0;l<e.length;l+=2)if(e[l]==o)return e[l+1]},te=(o,l)=>(n==10&&(n=0),e[n++]=o,e[n++]=l)}var C=class{constructor(e,t,n,o){this.width=e,this.height=t,this.map=n,this.problems=o}findCell(e){for(let t=0;t<this.map.length;t++){const n=this.map[t];if(n!=e)continue;const o=t%this.width,l=t/this.width|0;let r=o+1,s=l+1;for(let c=1;r<this.width&&this.map[t+c]==n;c++)r++;for(let c=1;s<this.height&&this.map[t+this.width*c]==n;c++)s++;return{left:o,top:l,right:r,bottom:s}}throw new RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw new RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){const{left:o,right:l,top:r,bottom:s}=this.findCell(e);return t=="horiz"?(n<0?o==0:l==this.width)?null:this.map[r*this.width+(n<0?o-1:l)]:(n<0?r==0:s==this.height)?null:this.map[o+this.width*(n<0?r-1:s)]}rectBetween(e,t){const{left:n,right:o,top:l,bottom:r}=this.findCell(e),{left:s,right:c,top:i,bottom:a}=this.findCell(t);return{left:Math.min(n,s),top:Math.min(l,i),right:Math.max(o,c),bottom:Math.max(r,a)}}cellsInRect(e){const t=[],n={};for(let o=e.top;o<e.bottom;o++)for(let l=e.left;l<e.right;l++){const r=o*this.width+l,s=this.map[r];n[s]||(n[s]=!0,!(l==e.left&&l&&this.map[r-1]==s||o==e.top&&o&&this.map[r-this.width]==s)&&t.push(s))}return t}positionAt(e,t,n){for(let o=0,l=0;;o++){const r=l+n.child(o).nodeSize;if(o==e){let s=t+e*this.width;const c=(e+1)*this.width;for(;s<c&&this.map[s]<l;)s++;return s==c?r-1:this.map[s]}l=r}}static get(e){return ee(e)||te(e,Je(e))}};function Je(e){if(e.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+e.type.name);const t=Ge(e),n=e.childCount,o=[];let l=0,r=null;const s=[];for(let a=0,d=t*n;a<d;a++)o[a]=0;for(let a=0,d=0;a<n;a++){const u=e.child(a);d++;for(let h=0;;h++){for(;l<o.length&&o[l]!=0;)l++;if(h==u.childCount)break;const g=u.child(h),{colspan:m,rowspan:w,colwidth:S}=g.attrs;for(let y=0;y<w;y++){if(y+a>=n){(r||(r=[])).push({type:"overlong_rowspan",pos:d,n:w-y});break}const A=l+y*t;for(let R=0;R<m;R++){o[A+R]==0?o[A+R]=d:(r||(r=[])).push({type:"collision",row:a,pos:d,n:m-R});const O=S&&S[R];if(O){const D=(A+R)%t*2,G=s[D];G==null||G!=O&&s[D+1]==1?(s[D]=O,s[D+1]=1):G==O&&s[D+1]++}}}l+=m,d+=g.nodeSize}const f=(a+1)*t;let p=0;for(;l<f;)o[l++]==0&&p++;p&&(r||(r=[])).push({type:"missing",row:a,n:p}),d++}(t===0||n===0)&&(r||(r=[])).push({type:"zero_sized"});const c=new C(t,n,o,r);let i=!1;for(let a=0;!i&&a<s.length;a+=2)s[a]!=null&&s[a+1]<n&&(i=!0);return i&&Ye(c,s,e),c}function Ge(e){let t=-1,n=!1;for(let o=0;o<e.childCount;o++){const l=e.child(o);let r=0;if(n)for(let s=0;s<o;s++){const c=e.child(s);for(let i=0;i<c.childCount;i++){const a=c.child(i);s+a.attrs.rowspan>o&&(r+=a.attrs.colspan)}}for(let s=0;s<l.childCount;s++){const c=l.child(s);r+=c.attrs.colspan,c.attrs.rowspan>1&&(n=!0)}t==-1?t=r:t!=r&&(t=Math.max(t,r))}return t}function Ye(e,t,n){e.problems||(e.problems=[]);const o={};for(let l=0;l<e.map.length;l++){const r=e.map[l];if(o[r])continue;o[r]=!0;const s=n.nodeAt(r);if(!s)throw new RangeError(`No cell with offset ${r} found`);let c=null;const i=s.attrs;for(let a=0;a<i.colspan;a++){const d=t[(l+a)%e.width*2];d!=null&&(!i.colwidth||i.colwidth[a]!=d)&&((c||(c=Qe(i)))[a]=d)}c&&e.problems.unshift({type:"colwidth mismatch",pos:r,colwidth:c})}}function Qe(e){if(e.colwidth)return e.colwidth.slice();const t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function v(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(const n in e.nodes){const o=e.nodes[n],l=o.spec.tableRole;l&&(t[l]=o)}}return t}const $=new se("selectingCells");function W(e){for(let t=e.depth-1;t>0;t--)if(e.node(t).type.spec.tableRole=="row")return e.node(0).resolve(e.before(t+1));return null}function Ze(e){for(let t=e.depth;t>0;t--){const n=e.node(t).type.spec.tableRole;if(n==="cell"||n==="header_cell")return e.node(t)}return null}function T(e){const t=e.selection.$head;for(let n=t.depth;n>0;n--)if(t.node(n).type.spec.tableRole=="row")return!0;return!1}function J(e){const t=e.selection;if("$anchorCell"in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if("node"in t&&t.node&&t.node.type.spec.tableRole=="cell")return t.$anchor;const n=W(t.$head)||et(t.$head);if(n)return n;throw new RangeError(`No cell found around position ${t.head}`)}function et(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){const o=t.type.spec.tableRole;if(o=="cell"||o=="header_cell")return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){const o=t.type.spec.tableRole;if(o=="cell"||o=="header_cell")return e.doc.resolve(n-t.nodeSize)}}function ne(e){return e.parent.type.spec.tableRole=="row"&&!!e.nodeAfter}function tt(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function ie(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function Re(e,t,n){const o=e.node(-1),l=C.get(o),r=e.start(-1),s=l.nextCell(e.pos-r,t,n);return s==null?null:e.node(0).resolve(r+s)}function B(e,t,n=1){const o={...e,colspan:e.colspan-n};return o.colwidth&&(o.colwidth=o.colwidth.slice(),o.colwidth.splice(t,n),o.colwidth.some(l=>l>0)||(o.colwidth=null)),o}function xe(e,t,n=1){const o={...e,colspan:e.colspan+n};if(o.colwidth){o.colwidth=o.colwidth.slice();for(let l=0;l<n;l++)o.colwidth.splice(t,0,0)}return o}function nt(e,t,n){const o=v(t.type.schema).header_cell;for(let l=0;l<e.height;l++)if(t.nodeAt(e.map[n+l*e.width]).type!=o)return!1;return!0}var b=class N extends E{constructor(t,n=t){const o=t.node(-1),l=C.get(o),r=t.start(-1),s=l.rectBetween(t.pos-r,n.pos-r),c=t.node(0),i=l.cellsInRect(s).filter(d=>d!=n.pos-r);i.unshift(n.pos-r);const a=i.map(d=>{const u=o.nodeAt(d);if(!u)throw new RangeError(`No cell with offset ${d} found`);const f=r+d+1;return new je(c.resolve(f),c.resolve(f+u.content.size))});super(a[0].$from,a[0].$to,a),this.$anchorCell=t,this.$headCell=n}map(t,n){const o=t.resolve(n.map(this.$anchorCell.pos)),l=t.resolve(n.map(this.$headCell.pos));if(ne(o)&&ne(l)&&ie(o,l)){const r=this.$anchorCell.node(-1)!=o.node(-1);return r&&this.isRowSelection()?N.rowSelection(o,l):r&&this.isColSelection()?N.colSelection(o,l):new N(o,l)}return H.between(o,l)}content(){const t=this.$anchorCell.node(-1),n=C.get(t),o=this.$anchorCell.start(-1),l=n.rectBetween(this.$anchorCell.pos-o,this.$headCell.pos-o),r={},s=[];for(let i=l.top;i<l.bottom;i++){const a=[];for(let d=i*n.width+l.left,u=l.left;u<l.right;u++,d++){const f=n.map[d];if(r[f])continue;r[f]=!0;const p=n.findCell(f);let h=t.nodeAt(f);if(!h)throw new RangeError(`No cell with offset ${f} found`);const g=l.left-p.left,m=p.right-l.right;if(g>0||m>0){let w=h.attrs;if(g>0&&(w=B(w,0,g)),m>0&&(w=B(w,w.colspan-m,m)),p.left<l.left){if(h=h.type.createAndFill(w),!h)throw new RangeError(`Could not create cell with attrs ${JSON.stringify(w)}`)}else h=h.type.create(w,h.content)}if(p.top<l.top||p.bottom>l.bottom){const w={...h.attrs,rowspan:Math.min(p.bottom,l.bottom)-Math.max(p.top,l.top)};p.top<l.top?h=h.type.createAndFill(w):h=h.type.create(w,h.content)}a.push(h)}s.push(t.child(i).copy(M.from(a)))}const c=this.isColSelection()&&this.isRowSelection()?t:s;return new L(M.from(c),1,1)}replace(t,n=L.empty){const o=t.steps.length,l=this.ranges;for(let s=0;s<l.length;s++){const{$from:c,$to:i}=l[s],a=t.mapping.slice(o);t.replace(a.map(c.pos),a.map(i.pos),s?L.empty:n)}const r=E.findFrom(t.doc.resolve(t.mapping.slice(o).map(this.to)),-1);r&&t.setSelection(r)}replaceWith(t,n){this.replace(t,new L(M.from(n),0,0))}forEachCell(t){const n=this.$anchorCell.node(-1),o=C.get(n),l=this.$anchorCell.start(-1),r=o.cellsInRect(o.rectBetween(this.$anchorCell.pos-l,this.$headCell.pos-l));for(let s=0;s<r.length;s++)t(n.nodeAt(r[s]),l+r[s])}isColSelection(){const t=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(t,n)>0)return!1;const o=t+this.$anchorCell.nodeAfter.attrs.rowspan,l=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(o,l)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){const o=t.node(-1),l=C.get(o),r=t.start(-1),s=l.findCell(t.pos-r),c=l.findCell(n.pos-r),i=t.node(0);return s.top<=c.top?(s.top>0&&(t=i.resolve(r+l.map[s.left])),c.bottom<l.height&&(n=i.resolve(r+l.map[l.width*(l.height-1)+c.right-1]))):(c.top>0&&(n=i.resolve(r+l.map[c.left])),s.bottom<l.height&&(t=i.resolve(r+l.map[l.width*(l.height-1)+s.right-1]))),new N(t,n)}isRowSelection(){const t=this.$anchorCell.node(-1),n=C.get(t),o=this.$anchorCell.start(-1),l=n.colCount(this.$anchorCell.pos-o),r=n.colCount(this.$headCell.pos-o);if(Math.min(l,r)>0)return!1;const s=l+this.$anchorCell.nodeAfter.attrs.colspan,c=r+this.$headCell.nodeAfter.attrs.colspan;return Math.max(s,c)==n.width}eq(t){return t instanceof N&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){const o=t.node(-1),l=C.get(o),r=t.start(-1),s=l.findCell(t.pos-r),c=l.findCell(n.pos-r),i=t.node(0);return s.left<=c.left?(s.left>0&&(t=i.resolve(r+l.map[s.top*l.width])),c.right<l.width&&(n=i.resolve(r+l.map[l.width*(c.top+1)-1]))):(c.left>0&&(n=i.resolve(r+l.map[c.top*l.width])),s.right<l.width&&(t=i.resolve(r+l.map[l.width*(s.top+1)-1]))),new N(t,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new N(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,o=n){return new N(t.resolve(n),t.resolve(o))}getBookmark(){return new ot(this.$anchorCell.pos,this.$headCell.pos)}};b.prototype.visible=!1;E.jsonID("cell",b);var ot=class Te{constructor(t,n){this.anchor=t,this.head=n}map(t){return new Te(t.map(this.anchor),t.map(this.head))}resolve(t){const n=t.resolve(this.anchor),o=t.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&o.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&o.index()<o.parent.childCount&&ie(n,o)?new b(n,o):E.near(o,1)}};function lt(e){if(!(e.selection instanceof b))return null;const t=[];return e.selection.forEachCell((n,o)=>{t.push(Z.node(o,o+n.nodeSize,{class:"selectedCell"}))}),Q.create(e.doc,t)}function rt({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,o=t.pos,l=e.depth;for(;l>=0&&!(e.after(l+1)<e.end(l));l--,n++);for(let r=t.depth;r>=0&&!(t.before(r+1)>t.start(r));r--,o--);return n==o&&/row|table/.test(e.node(l).type.spec.tableRole)}function st({$from:e,$to:t}){let n,o;for(let l=e.depth;l>0;l--){const r=e.node(l);if(r.type.spec.tableRole==="cell"||r.type.spec.tableRole==="header_cell"){n=r;break}}for(let l=t.depth;l>0;l--){const r=t.node(l);if(r.type.spec.tableRole==="cell"||r.type.spec.tableRole==="header_cell"){o=r;break}}return n!==o&&t.parentOffset===0}function it(e,t,n){const o=(t||e).selection,l=(t||e).doc;let r,s;if(o instanceof Fe&&(s=o.node.type.spec.tableRole)){if(s=="cell"||s=="header_cell")r=b.create(l,o.from);else if(s=="row"){const c=l.resolve(o.from+1);r=b.rowSelection(c,c)}else if(!n){const c=C.get(o.node),i=o.from+1,a=i+c.map[c.width*c.height-1];r=b.create(l,i+1,a)}}else o instanceof H&&rt(o)?r=H.create(l,o.from):o instanceof H&&st(o)&&(r=H.create(l,o.$from.start(),o.$from.end()));return r&&(t||(t=e.tr)).setSelection(r),t}const ct=new se("fix-tables");function Me(e,t,n,o){const l=e.childCount,r=t.childCount;e:for(let s=0,c=0;s<r;s++){const i=t.child(s);for(let a=c,d=Math.min(l,s+3);a<d;a++)if(e.child(a)==i){c=a+1,n+=i.nodeSize;continue e}o(i,n),c<l&&e.child(c).sameMarkup(i)?Me(e.child(c),i,n+1,o):i.nodesBetween(0,i.content.size,o,n+1),n+=i.nodeSize}}function ze(e,t){let n;const o=(l,r)=>{l.type.spec.tableRole=="table"&&(n=at(e,l,r,n))};return t?t.doc!=e.doc&&Me(t.doc,e.doc,0,o):e.doc.descendants(o),n}function at(e,t,n,o){const l=C.get(t);if(!l.problems)return o;o||(o=e.tr);const r=[];for(let i=0;i<l.height;i++)r.push(0);for(let i=0;i<l.problems.length;i++){const a=l.problems[i];if(a.type=="collision"){const d=t.nodeAt(a.pos);if(!d)continue;const u=d.attrs;for(let f=0;f<u.rowspan;f++)r[a.row+f]+=a.n;o.setNodeMarkup(o.mapping.map(n+1+a.pos),null,B(u,u.colspan-a.n,a.n))}else if(a.type=="missing")r[a.row]+=a.n;else if(a.type=="overlong_rowspan"){const d=t.nodeAt(a.pos);if(!d)continue;o.setNodeMarkup(o.mapping.map(n+1+a.pos),null,{...d.attrs,rowspan:d.attrs.rowspan-a.n})}else if(a.type=="colwidth mismatch"){const d=t.nodeAt(a.pos);if(!d)continue;o.setNodeMarkup(o.mapping.map(n+1+a.pos),null,{...d.attrs,colwidth:a.colwidth})}else if(a.type=="zero_sized"){const d=o.mapping.map(n);o.delete(d,d+t.nodeSize)}}let s,c;for(let i=0;i<r.length;i++)r[i]&&(s==null&&(s=i),c=i);for(let i=0,a=n+1;i<l.height;i++){const d=t.child(i),u=a+d.nodeSize,f=r[i];if(f>0){let p="cell";d.firstChild&&(p=d.firstChild.type.spec.tableRole);const h=[];for(let m=0;m<f;m++){const w=v(e.schema)[p].createAndFill();w&&h.push(w)}const g=(i==0||s==i-1)&&c==i?a+1:u-1;o.insert(o.mapping.map(g),h)}a=u}return o.setMeta(ct,{fixTables:!0})}function z(e){const t=e.selection,n=J(e),o=n.node(-1),l=n.start(-1),r=C.get(o);return{...t instanceof b?r.rectBetween(t.$anchorCell.pos-l,t.$headCell.pos-l):r.findCell(n.pos-l),tableStart:l,map:r,table:o}}function Ne(e,{map:t,tableStart:n,table:o},l){let r=l>0?-1:0;nt(t,o,l+r)&&(r=l==0||l==t.width?null:0);for(let s=0;s<t.height;s++){const c=s*t.width+l;if(l>0&&l<t.width&&t.map[c-1]==t.map[c]){const i=t.map[c],a=o.nodeAt(i);e.setNodeMarkup(e.mapping.map(n+i),null,xe(a.attrs,l-t.colCount(i))),s+=a.attrs.rowspan-1}else{const i=r==null?v(o.type.schema).cell:o.nodeAt(t.map[c+r]).type,a=t.positionAt(s,l,o);e.insert(e.mapping.map(n+a),i.createAndFill())}}return e}function dt(e,t){if(!T(e))return!1;if(t){const n=z(e);t(Ne(e.tr,n,n.left))}return!0}function ut(e,t){if(!T(e))return!1;if(t){const n=z(e);t(Ne(e.tr,n,n.right))}return!0}function ft(e,{map:t,table:n,tableStart:o},l){const r=e.mapping.maps.length;for(let s=0;s<t.height;){const c=s*t.width+l,i=t.map[c],a=n.nodeAt(i),d=a.attrs;if(l>0&&t.map[c-1]==i||l<t.width-1&&t.map[c+1]==i)e.setNodeMarkup(e.mapping.slice(r).map(o+i),null,B(d,l-t.colCount(i)));else{const u=e.mapping.slice(r).map(o+i);e.delete(u,u+a.nodeSize)}s+=d.rowspan}}function ht(e,t){if(!T(e))return!1;if(t){const n=z(e),o=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let l=n.right-1;ft(o,n,l),l!=n.left;l--){const r=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc;if(!r)throw new RangeError("No table found");n.table=r,n.map=C.get(r)}t(o)}return!0}function pt(e,t,n){var o;const l=v(t.type.schema).header_cell;for(let r=0;r<e.width;r++)if(((o=t.nodeAt(e.map[r+n*e.width]))===null||o===void 0?void 0:o.type)!=l)return!1;return!0}function Ee(e,{map:t,tableStart:n,table:o},l){let r=n;for(let a=0;a<l;a++)r+=o.child(a).nodeSize;const s=[];let c=l>0?-1:0;pt(t,o,l+c)&&(c=l==0||l==t.height?null:0);for(let a=0,d=t.width*l;a<t.width;a++,d++)if(l>0&&l<t.height&&t.map[d]==t.map[d-t.width]){const u=t.map[d],f=o.nodeAt(u).attrs;e.setNodeMarkup(n+u,null,{...f,rowspan:f.rowspan+1}),a+=f.colspan-1}else{var i;const u=c==null?v(o.type.schema).cell:(i=o.nodeAt(t.map[d+c*t.width]))===null||i===void 0?void 0:i.type,f=u?.createAndFill();f&&s.push(f)}return e.insert(r,v(o.type.schema).row.create(null,s)),e}function mt(e,t){if(!T(e))return!1;if(t){const n=z(e);t(Ee(e.tr,n,n.top))}return!0}function gt(e,t){if(!T(e))return!1;if(t){const n=z(e);t(Ee(e.tr,n,n.bottom))}return!0}function wt(e,{map:t,table:n,tableStart:o},l){let r=0;for(let a=0;a<l;a++)r+=n.child(a).nodeSize;const s=r+n.child(l).nodeSize,c=e.mapping.maps.length;e.delete(r+o,s+o);const i=new Set;for(let a=0,d=l*t.width;a<t.width;a++,d++){const u=t.map[d];if(!i.has(u)){if(i.add(u),l>0&&u==t.map[d-t.width]){const f=n.nodeAt(u).attrs;e.setNodeMarkup(e.mapping.slice(c).map(u+o),null,{...f,rowspan:f.rowspan-1}),a+=f.colspan-1}else if(l<t.height&&u==t.map[d+t.width]){const f=n.nodeAt(u),p=f.attrs,h=f.type.create({...p,rowspan:f.attrs.rowspan-1},f.content),g=t.positionAt(l+1,a,n);e.insert(e.mapping.slice(c).map(o+g),h),a+=p.colspan-1}}}}function bt(e,t){if(!T(e))return!1;if(t){const n=z(e),o=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let l=n.bottom-1;wt(o,n,l),l!=n.top;l--){const r=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc;if(!r)throw new RangeError("No table found");n.table=r,n.map=C.get(n.table)}t(o)}return!0}function ce(e){const t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function Ct({width:e,height:t,map:n},o){let l=o.top*e+o.left,r=l,s=(o.bottom-1)*e+o.left,c=l+(o.right-o.left-1);for(let i=o.top;i<o.bottom;i++){if(o.left>0&&n[r]==n[r-1]||o.right<e&&n[c]==n[c+1])return!0;r+=e,c+=e}for(let i=o.left;i<o.right;i++){if(o.top>0&&n[l]==n[l-e]||o.bottom<t&&n[s]==n[s+e])return!0;l++,s++}return!1}function ae(e,t){const n=e.selection;if(!(n instanceof b)||n.$anchorCell.pos==n.$headCell.pos)return!1;const o=z(e),{map:l}=o;if(Ct(l,o))return!1;if(t){const r=e.tr,s={};let c=M.empty,i,a;for(let d=o.top;d<o.bottom;d++)for(let u=o.left;u<o.right;u++){const f=l.map[d*l.width+u],p=o.table.nodeAt(f);if(!(s[f]||!p))if(s[f]=!0,i==null)i=f,a=p;else{ce(p)||(c=c.append(p.content));const h=r.mapping.map(f+o.tableStart);r.delete(h,h+p.nodeSize)}}if(i==null||a==null)return!0;if(r.setNodeMarkup(i+o.tableStart,null,{...xe(a.attrs,a.attrs.colspan,o.right-o.left-a.attrs.colspan),rowspan:o.bottom-o.top}),c.size>0){const d=i+1+a.content.size,u=ce(a)?i+1:d;r.replaceWith(u+o.tableStart,d+o.tableStart,c)}r.setSelection(new b(r.doc.resolve(i+o.tableStart))),t(r)}return!0}function de(e,t){const n=v(e.schema);return yt(({node:o})=>n[o.type.spec.tableRole])(e,t)}function yt(e){return(t,n)=>{const o=t.selection;let l,r;if(o instanceof b){if(o.$anchorCell.pos!=o.$headCell.pos)return!1;l=o.$anchorCell.nodeAfter,r=o.$anchorCell.pos}else{var s;if(l=Ze(o.$from),!l)return!1;r=(s=W(o.$from))===null||s===void 0?void 0:s.pos}if(l==null||r==null||l.attrs.colspan==1&&l.attrs.rowspan==1)return!1;if(n){let c=l.attrs;const i=[],a=c.colwidth;c.rowspan>1&&(c={...c,rowspan:1}),c.colspan>1&&(c={...c,colspan:1});const d=z(t),u=t.tr;for(let p=0;p<d.right-d.left;p++)i.push(a?{...c,colwidth:a&&a[p]?[a[p]]:null}:c);let f;for(let p=d.top;p<d.bottom;p++){let h=d.map.positionAt(p,d.left,d.table);p==d.top&&(h+=l.nodeSize);for(let g=d.left,m=0;g<d.right;g++,m++)g==d.left&&p==d.top||u.insert(f=u.mapping.map(h+d.tableStart,1),e({node:l,row:p,col:g}).createAndFill(i[m]))}u.setNodeMarkup(r,e({node:l,row:d.top,col:d.left}),i[0]),o instanceof b&&u.setSelection(new b(u.doc.resolve(o.$anchorCell.pos),f?u.doc.resolve(f):void 0)),n(u)}return!0}}function At(e,t){return function(n,o){if(!T(n))return!1;const l=J(n);if(l.nodeAfter.attrs[e]===t)return!1;if(o){const r=n.tr;n.selection instanceof b?n.selection.forEachCell((s,c)=>{s.attrs[e]!==t&&r.setNodeMarkup(c,null,{...s.attrs,[e]:t})}):r.setNodeMarkup(l.pos,null,{...l.nodeAfter.attrs,[e]:t}),o(r)}return!0}}function St(e){return function(t,n){if(!T(t))return!1;if(n){const o=v(t.schema),l=z(t),r=t.tr,s=l.map.cellsInRect(e=="column"?{left:l.left,top:0,right:l.right,bottom:l.map.height}:e=="row"?{left:0,top:l.top,right:l.map.width,bottom:l.bottom}:l),c=s.map(i=>l.table.nodeAt(i));for(let i=0;i<s.length;i++)c[i].type==o.header_cell&&r.setNodeMarkup(l.tableStart+s[i],o.cell,c[i].attrs);if(r.steps.length===0)for(let i=0;i<s.length;i++)r.setNodeMarkup(l.tableStart+s[i],o.header_cell,c[i].attrs);n(r)}return!0}}function ue(e,t,n){const o=t.map.cellsInRect({left:0,top:0,right:e=="row"?t.map.width:1,bottom:e=="column"?t.map.height:1});for(let l=0;l<o.length;l++){const r=t.table.nodeAt(o[l]);if(r&&r.type!==n.header_cell)return!1}return!0}function I(e,t){return t=t||{useDeprecatedLogic:!1},t.useDeprecatedLogic?St(e):function(n,o){if(!T(n))return!1;if(o){const l=v(n.schema),r=z(n),s=n.tr,c=ue("row",r,l),i=ue("column",r,l),a=(e==="column"?c:e==="row"&&i)?1:0,d=e=="column"?{left:0,top:a,right:1,bottom:r.map.height}:e=="row"?{left:a,top:0,right:r.map.width,bottom:1}:r,u=e=="column"?i?l.cell:l.header_cell:e=="row"?c?l.cell:l.header_cell:l.cell;r.map.cellsInRect(d).forEach(f=>{const p=f+r.tableStart,h=s.doc.nodeAt(p);h&&s.setNodeMarkup(p,u,h.attrs)}),o(s)}return!0}}I("row",{useDeprecatedLogic:!0});I("column",{useDeprecatedLogic:!0});const vt=I("cell",{useDeprecatedLogic:!0});function Rt(e,t){if(t<0){const n=e.nodeBefore;if(n)return e.pos-n.nodeSize;for(let o=e.index(-1)-1,l=e.before();o>=0;o--){const r=e.node(-1).child(o),s=r.lastChild;if(s)return l-1-s.nodeSize;l-=r.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;const n=e.node(-1);for(let o=e.indexAfter(-1),l=e.after();o<n.childCount;o++){const r=n.child(o);if(r.childCount)return l+1;l+=r.nodeSize}}return null}function fe(e){return function(t,n){if(!T(t))return!1;const o=Rt(J(t),e);if(o==null)return!1;if(n){const l=t.doc.resolve(o);n(t.tr.setSelection(H.between(l,tt(l))).scrollIntoView())}return!0}}function xt(e,t){const n=e.selection.$anchor;for(let o=n.depth;o>0;o--)if(n.node(o).type.spec.tableRole=="table")return t&&t(e.tr.delete(n.before(o),n.after(o)).scrollIntoView()),!0;return!1}function j(e,t){const n=e.selection;if(!(n instanceof b))return!1;if(t){const o=e.tr,l=v(e.schema).cell.createAndFill().content;n.forEachCell((r,s)=>{r.content.eq(l)||o.replace(o.mapping.map(s+1),o.mapping.map(s+r.nodeSize-1),new L(l,0,0))}),o.docChanged&&t(o)}return!0}function Tt(e){if(e.size===0)return null;let{content:t,openStart:n,openEnd:o}=e;for(;t.childCount==1&&(n>0&&o>0||t.child(0).type.spec.tableRole=="table");)n--,o--,t=t.child(0).content;const l=t.child(0),r=l.type.spec.tableRole,s=l.type.schema,c=[];if(r=="row")for(let i=0;i<t.childCount;i++){let a=t.child(i).content;const d=i?0:Math.max(0,n-1),u=i<t.childCount-1?0:Math.max(0,o-1);(d||u)&&(a=oe(v(s).row,new L(a,d,u)).content),c.push(a)}else if(r=="cell"||r=="header_cell")c.push(n||o?oe(v(s).row,new L(t,n,o)).content:t);else return null;return Mt(s,c)}function Mt(e,t){const n=[];for(let l=0;l<t.length;l++){const r=t[l];for(let s=r.childCount-1;s>=0;s--){const{rowspan:c,colspan:i}=r.child(s).attrs;for(let a=l;a<l+c;a++)n[a]=(n[a]||0)+i}}let o=0;for(let l=0;l<n.length;l++)o=Math.max(o,n[l]);for(let l=0;l<n.length;l++)if(l>=t.length&&t.push(M.empty),n[l]<o){const r=v(e).cell.createAndFill(),s=[];for(let c=n[l];c<o;c++)s.push(r);t[l]=t[l].append(M.from(s))}return{height:t.length,width:o,rows:t}}function oe(e,t){const n=e.createAndFill();return new _e(n).replace(0,n.content.size,t).doc}function zt({width:e,height:t,rows:n},o,l){if(e!=o){const r=[],s=[];for(let c=0;c<n.length;c++){const i=n[c],a=[];for(let d=r[c]||0,u=0;d<o;u++){let f=i.child(u%i.childCount);d+f.attrs.colspan>o&&(f=f.type.createChecked(B(f.attrs,f.attrs.colspan,d+f.attrs.colspan-o),f.content)),a.push(f),d+=f.attrs.colspan;for(let p=1;p<f.attrs.rowspan;p++)r[c+p]=(r[c+p]||0)+f.attrs.colspan}s.push(M.from(a))}n=s,e=o}if(t!=l){const r=[];for(let s=0,c=0;s<l;s++,c++){const i=[],a=n[c%t];for(let d=0;d<a.childCount;d++){let u=a.child(d);s+u.attrs.rowspan>l&&(u=u.type.create({...u.attrs,rowspan:Math.max(1,l-u.attrs.rowspan)},u.content)),i.push(u)}r.push(M.from(i))}n=r,t=l}return{width:e,height:t,rows:n}}function Nt(e,t,n,o,l,r,s){const c=e.doc.type.schema,i=v(c);let a,d;if(l>t.width)for(let u=0,f=0;u<t.height;u++){const p=n.child(u);f+=p.nodeSize;const h=[];let g;p.lastChild==null||p.lastChild.type==i.cell?g=a||(a=i.cell.createAndFill()):g=d||(d=i.header_cell.createAndFill());for(let m=t.width;m<l;m++)h.push(g);e.insert(e.mapping.slice(s).map(f-1+o),h)}if(r>t.height){const u=[];for(let h=0,g=(t.height-1)*t.width;h<Math.max(t.width,l);h++){const m=h>=t.width?!1:n.nodeAt(t.map[g+h]).type==i.header_cell;u.push(m?d||(d=i.header_cell.createAndFill()):a||(a=i.cell.createAndFill()))}const f=i.row.create(null,M.from(u)),p=[];for(let h=t.height;h<r;h++)p.push(f);e.insert(e.mapping.slice(s).map(o+n.nodeSize-2),p)}return!!(a||d)}function he(e,t,n,o,l,r,s,c){if(s==0||s==t.height)return!1;let i=!1;for(let a=l;a<r;a++){const d=s*t.width+a,u=t.map[d];if(t.map[d-t.width]==u){i=!0;const f=n.nodeAt(u),{top:p,left:h}=t.findCell(u);e.setNodeMarkup(e.mapping.slice(c).map(u+o),null,{...f.attrs,rowspan:s-p}),e.insert(e.mapping.slice(c).map(t.positionAt(s,h,n)),f.type.createAndFill({...f.attrs,rowspan:p+f.attrs.rowspan-s})),a+=f.attrs.colspan-1}}return i}function pe(e,t,n,o,l,r,s,c){if(s==0||s==t.width)return!1;let i=!1;for(let a=l;a<r;a++){const d=a*t.width+s,u=t.map[d];if(t.map[d-1]==u){i=!0;const f=n.nodeAt(u),p=t.colCount(u),h=e.mapping.slice(c).map(u+o);e.setNodeMarkup(h,null,B(f.attrs,s-p,f.attrs.colspan-(s-p))),e.insert(h+f.nodeSize,f.type.createAndFill(B(f.attrs,0,s-p))),a+=f.attrs.rowspan-1}}return i}function me(e,t,n,o,l){let r=n?e.doc.nodeAt(n-1):e.doc;if(!r)throw new Error("No table found");let s=C.get(r);const{top:c,left:i}=o,a=i+l.width,d=c+l.height,u=e.tr;let f=0;function p(){if(r=n?u.doc.nodeAt(n-1):u.doc,!r)throw new Error("No table found");s=C.get(r),f=u.mapping.maps.length}Nt(u,s,r,n,a,d,f)&&p(),he(u,s,r,n,i,a,c,f)&&p(),he(u,s,r,n,i,a,d,f)&&p(),pe(u,s,r,n,c,d,i,f)&&p(),pe(u,s,r,n,c,d,a,f)&&p();for(let h=c;h<d;h++){const g=s.positionAt(h,i,r),m=s.positionAt(h,a,r);u.replace(u.mapping.slice(f).map(g+n),u.mapping.slice(f).map(m+n),new L(l.rows[h-c],0,0))}p(),u.setSelection(new b(u.doc.resolve(n+s.positionAt(c,i,r)),u.doc.resolve(n+s.positionAt(d-1,a-1,r)))),t(u)}const Et=Oe({ArrowLeft:F("horiz",-1),ArrowRight:F("horiz",1),ArrowUp:F("vert",-1),ArrowDown:F("vert",1),"Shift-ArrowLeft":_("horiz",-1),"Shift-ArrowRight":_("horiz",1),"Shift-ArrowUp":_("vert",-1),"Shift-ArrowDown":_("vert",1),Backspace:j,"Mod-Backspace":j,Delete:j,"Mod-Delete":j});function K(e,t,n){return n.eq(e.selection)?!1:(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function F(e,t){return(n,o,l)=>{if(!l)return!1;const r=n.selection;if(r instanceof b)return K(n,o,E.near(r.$headCell,t));if(e!="horiz"&&!r.empty)return!1;const s=He(l,e,t);if(s==null)return!1;if(e=="horiz")return K(n,o,E.near(n.doc.resolve(r.head+t),t));{const c=n.doc.resolve(s),i=Re(c,e,t);let a;return i?a=E.near(i,1):t<0?a=E.near(n.doc.resolve(c.before(-1)),-1):a=E.near(n.doc.resolve(c.after(-1)),1),K(n,o,a)}}}function _(e,t){return(n,o,l)=>{if(!l)return!1;const r=n.selection;let s;if(r instanceof b)s=r;else{const i=He(l,e,t);if(i==null)return!1;s=new b(n.doc.resolve(i))}const c=Re(s.$headCell,e,t);return c?K(n,o,new b(s.$anchorCell,c)):!1}}function Ht(e,t){const n=e.state.doc,o=W(n.resolve(t));return o?(e.dispatch(e.state.tr.setSelection(new b(o))),!0):!1}function $t(e,t,n){if(!T(e.state))return!1;let o=Tt(n);const l=e.state.selection;if(l instanceof b){o||(o={width:1,height:1,rows:[M.from(oe(v(e.state.schema).cell,n))]});const r=l.$anchorCell.node(-1),s=l.$anchorCell.start(-1),c=C.get(r).rectBetween(l.$anchorCell.pos-s,l.$headCell.pos-s);return o=zt(o,c.right-c.left,c.bottom-c.top),me(e.state,e.dispatch,s,c,o),!0}else if(o){const r=J(e.state),s=r.start(-1);return me(e.state,e.dispatch,s,C.get(r.node(-1)).findCell(r.pos-s),o),!0}else return!1}function Lt(e,t){var n;if(t.button!=0||t.ctrlKey||t.metaKey)return;const o=ge(e,t.target);let l;if(t.shiftKey&&e.state.selection instanceof b)r(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&o&&(l=W(e.state.selection.$anchor))!=null&&((n=Y(e,t))===null||n===void 0?void 0:n.pos)!=l.pos)r(l,t),t.preventDefault();else if(!o)return;function r(i,a){let d=Y(e,a);const u=$.getState(e.state)==null;if(!d||!ie(i,d))if(u)d=i;else return;const f=new b(i,d);if(u||!e.state.selection.eq(f)){const p=e.state.tr.setSelection(f);u&&p.setMeta($,i.pos),e.dispatch(p)}}function s(){e.root.removeEventListener("mouseup",s),e.root.removeEventListener("dragstart",s),e.root.removeEventListener("mousemove",c),$.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta($,-1))}function c(i){const a=i,d=$.getState(e.state);let u;if(d!=null)u=e.state.doc.resolve(d);else if(ge(e,a.target)!=o&&(u=Y(e,t),!u))return s();u&&r(u,a)}e.root.addEventListener("mouseup",s),e.root.addEventListener("dragstart",s),e.root.addEventListener("mousemove",c)}function He(e,t,n){if(!(e.state.selection instanceof H))return null;const{$head:o}=e.state.selection;for(let l=o.depth-1;l>=0;l--){const r=o.node(l);if((n<0?o.index(l):o.indexAfter(l))!=(n<0?0:r.childCount))return null;if(r.type.spec.tableRole=="cell"||r.type.spec.tableRole=="header_cell"){const s=o.before(l),c=t=="vert"?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(c)?s:null}}return null}function ge(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName=="TD"||t.nodeName=="TH")return t;return null}function Y(e,t){const n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:o,pos:l}=n;return o>=0&&W(e.state.doc.resolve(o))||W(e.state.doc.resolve(l))}var kt=class{constructor(t,n){this.node=t,this.defaultCellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${n}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),le(t,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!=this.node.type?!1:(this.node=t,le(t,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(t){return t.type=="attributes"&&(t.target==this.table||this.colgroup.contains(t.target))}};function le(e,t,n,o,l,r){let s=0,c=!0,i=t.firstChild;const a=e.firstChild;if(a){for(let u=0,f=0;u<a.childCount;u++){const{colspan:p,colwidth:h}=a.child(u).attrs;for(let g=0;g<p;g++,f++){const m=l==f?r:h&&h[g],w=m?m+"px":"";if(s+=m||o,m||(c=!1),i)i.style.width!=w&&(i.style.width=w),i=i.nextSibling;else{const S=document.createElement("col");S.style.width=w,t.appendChild(S)}}}for(;i;){var d;const u=i.nextSibling;(d=i.parentNode)===null||d===void 0||d.removeChild(i),i=u}c?(n.style.width=s+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=s+"px")}}const x=new se("tableColumnResizing");function Wt({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:o=kt,lastColumnResizable:l=!0}={}){const r=new ve({key:x,state:{init(s,c){var i;const a=(i=r.spec)===null||i===void 0||(i=i.props)===null||i===void 0?void 0:i.nodeViews,d=v(c.schema).table.name;return o&&a&&(a[d]=(u,f)=>new o(u,n,f)),new Bt(-1,!1)},apply(s,c){return c.apply(s)}},props:{attributes:s=>{const c=x.getState(s);return c&&c.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(s,c)=>{Dt(s,c,e,l)},mouseleave:s=>{It(s)},mousedown:(s,c)=>{Pt(s,c,t,n)}},decorations:s=>{const c=x.getState(s);if(c&&c.activeHandle>-1)return Vt(s,c.activeHandle)},nodeViews:{}}});return r}var Bt=class X{constructor(t,n){this.activeHandle=t,this.dragging=n}apply(t){const n=this,o=t.getMeta(x);if(o&&o.setHandle!=null)return new X(o.setHandle,!1);if(o&&o.setDragging!==void 0)return new X(n.activeHandle,o.setDragging);if(n.activeHandle>-1&&t.docChanged){let l=t.mapping.map(n.activeHandle,-1);return ne(t.doc.resolve(l))||(l=-1),new X(l,n.dragging)}return n}};function Dt(e,t,n,o){if(!e.editable)return;const l=x.getState(e.state);if(l&&!l.dragging){const r=jt(t.target);let s=-1;if(r){const{left:c,right:i}=r.getBoundingClientRect();t.clientX-c<=n?s=we(e,t,"left",n):i-t.clientX<=n&&(s=we(e,t,"right",n))}if(s!=l.activeHandle){if(!o&&s!==-1){const c=e.state.doc.resolve(s),i=c.node(-1),a=C.get(i),d=c.start(-1);if(a.colCount(c.pos-d)+c.nodeAfter.attrs.colspan-1==a.width-1)return}$e(e,s)}}}function It(e){if(!e.editable)return;const t=x.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&$e(e,-1)}function Pt(e,t,n,o){var l;if(!e.editable)return!1;const r=(l=e.dom.ownerDocument.defaultView)!==null&&l!==void 0?l:window,s=x.getState(e.state);if(!s||s.activeHandle==-1||s.dragging)return!1;const c=e.state.doc.nodeAt(s.activeHandle),i=Ot(e,s.activeHandle,c.attrs);e.dispatch(e.state.tr.setMeta(x,{setDragging:{startX:t.clientX,startWidth:i}}));function a(u){r.removeEventListener("mouseup",a),r.removeEventListener("mousemove",d);const f=x.getState(e.state);f?.dragging&&(Ft(e,f.activeHandle,be(f.dragging,u,n)),e.dispatch(e.state.tr.setMeta(x,{setDragging:null})))}function d(u){if(!u.which)return a(u);const f=x.getState(e.state);if(f&&f.dragging){const p=be(f.dragging,u,n);Ce(e,f.activeHandle,p,o)}}return Ce(e,s.activeHandle,i,o),r.addEventListener("mouseup",a),r.addEventListener("mousemove",d),t.preventDefault(),!0}function Ot(e,t,{colspan:n,colwidth:o}){const l=o&&o[o.length-1];if(l)return l;const r=e.domAtPos(t);let s=r.node.childNodes[r.offset].offsetWidth,c=n;if(o)for(let i=0;i<n;i++)o[i]&&(s-=o[i],c--);return s/c}function jt(e){for(;e&&e.nodeName!="TD"&&e.nodeName!="TH";)e=e.classList&&e.classList.contains("ProseMirror")?null:e.parentNode;return e}function we(e,t,n,o){const l=n=="right"?-o:o,r=e.posAtCoords({left:t.clientX+l,top:t.clientY});if(!r)return-1;const{pos:s}=r,c=W(e.state.doc.resolve(s));if(!c)return-1;if(n=="right")return c.pos;const i=C.get(c.node(-1)),a=c.start(-1),d=i.map.indexOf(c.pos-a);return d%i.width==0?-1:a+i.map[d-1]}function be(e,t,n){const o=t.clientX-e.startX;return Math.max(n,e.startWidth+o)}function $e(e,t){e.dispatch(e.state.tr.setMeta(x,{setHandle:t}))}function Ft(e,t,n){const o=e.state.doc.resolve(t),l=o.node(-1),r=C.get(l),s=o.start(-1),c=r.colCount(o.pos-s)+o.nodeAfter.attrs.colspan-1,i=e.state.tr;for(let a=0;a<r.height;a++){const d=a*r.width+c;if(a&&r.map[d]==r.map[d-r.width])continue;const u=r.map[d],f=l.nodeAt(u).attrs,p=f.colspan==1?0:c-r.colCount(u);if(f.colwidth&&f.colwidth[p]==n)continue;const h=f.colwidth?f.colwidth.slice():_t(f.colspan);h[p]=n,i.setNodeMarkup(s+u,null,{...f,colwidth:h})}i.docChanged&&e.dispatch(i)}function Ce(e,t,n,o){const l=e.state.doc.resolve(t),r=l.node(-1),s=l.start(-1),c=C.get(r).colCount(l.pos-s)+l.nodeAfter.attrs.colspan-1;let i=e.domAtPos(l.start(-1)).node;for(;i&&i.nodeName!="TABLE";)i=i.parentNode;i&&le(r,i.firstChild,i,o,c,n)}function _t(e){return Array(e).fill(0)}function Vt(e,t){const n=[],o=e.doc.resolve(t),l=o.node(-1);if(!l)return Q.empty;const r=C.get(l),s=o.start(-1),c=r.colCount(o.pos-s)+o.nodeAfter.attrs.colspan-1;for(let a=0;a<r.height;a++){const d=c+a*r.width;if((c==r.width-1||r.map[d]!=r.map[d+1])&&(a==0||r.map[d]!=r.map[d-r.width])){var i;const u=r.map[d],f=s+u+l.nodeAt(u).nodeSize-1,p=document.createElement("div");p.className="column-resize-handle",!((i=x.getState(e))===null||i===void 0)&&i.dragging&&n.push(Z.node(s+u,s+u+l.nodeAt(u).nodeSize,{class:"column-resize-dragging"})),n.push(Z.widget(f,p))}}return Q.create(e.doc,n)}function Kt({allowTableNodeSelection:e=!1}={}){return new ve({key:$,state:{init(){return null},apply(t,n){const o=t.getMeta($);if(o!=null)return o==-1?null:o;if(n==null||!t.docChanged)return n;const{deleted:l,pos:r}=t.mapping.mapResult(n);return l?null:r}},props:{decorations:lt,handleDOMEvents:{mousedown:Lt},createSelectionBetween(t){return $.getState(t.state)!=null?t.state.selection:null},handleTripleClick:Ht,handleKeyDown:Et,handlePaste:$t},appendTransaction(t,n,o){return it(o,ze(o,n),e)}})}function U(e){return e==="left"||e==="right"||e==="center"?e:null}function Xt(e){const t=(e.style.textAlign||"").trim().toLowerCase(),n=(e.getAttribute("align")||"").trim().toLowerCase();return U(t||n)}function qt(e){return U(e?.align)}function Le(){return{default:null,parseHTML:e=>Xt(e),renderHTML:e=>e.align?{style:`text-align: ${e.align}`}:{}}}function Ut(e){var t;const n=e.parentElement,o=e.closest("table");if(!n||!o)return null;const l=Array.from(n.children).indexOf(e),r=(t=o.querySelectorAll("colgroup > col")[l])===null||t===void 0?void 0:t.getAttribute("width");return r?[parseInt(r,10)]:null}function ke(e){const t=e.getAttribute("colwidth");return t?t.split(",").map(n=>parseInt(n,10)):Ut(e)}const Jt=/[ \t\r\n\f]+/g;function We(e){var t;return e.children.length>0?!1:((t=e.textContent)!==null&&t!==void 0?t:"").replace(Jt,"")===""}function Be(e){const t=e.createAndFill();if(!t)throw new Error(`[tiptap error]: "${e.name}" has no default content to backfill.`);return t.content}const Gt=P.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:ke},align:Le()}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td",getAttrs:e=>We(e)?{}:!1,getContent:(e,t)=>Be(t.nodes[this.name])},{tag:"td"}]},renderHTML({HTMLAttributes:e}){return["td",k(this.options.HTMLAttributes,e),0]}}),Yt=P.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:ke},align:Le()}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th",getAttrs:e=>We(e)?{}:!1,getContent:(e,t)=>Be(t.nodes[this.name])},{tag:"th"}]},renderHTML({HTMLAttributes:e}){return["th",k(this.options.HTMLAttributes,e),0]}}),Qt=P.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:e}){return["tr",k(this.options.HTMLAttributes,e),0]}});function re(e,t){return t?["width",`${Math.max(t,e)}px`]:["min-width",`${e}px`]}function ye(e,t,n,o,l,r){let s=0,c=!0,i=t.firstChild;const a=e.firstChild;if(a!==null)for(let f=0,p=0;f<a.childCount;f+=1){const{colspan:h,colwidth:g}=a.child(f).attrs;for(let m=0;m<h;m+=1,p+=1){const w=l===p?r:g&&g[m],S=w?`${w}px`:"";if(s+=w||o,w||(c=!1),i){if(i.style.width!==S){const[y,A]=re(o,w);i.style.setProperty(y,A)}i=i.nextSibling}else{const y=document.createElement("col"),[A,R]=re(o,w);y.style.setProperty(A,R),t.appendChild(y)}}}for(;i;){var d;const f=i.nextSibling;(d=i.parentNode)===null||d===void 0||d.removeChild(i),i=f}const u=e.attrs.style&&typeof e.attrs.style=="string"&&/\bwidth\s*:/i.test(e.attrs.style);c&&!u?(n.style.width=`${s}px`,n.style.minWidth=""):(n.style.width="",n.style.minWidth=`${s}px`)}var Zt=class{constructor(e,t,n,o={}){this.node=e,this.cellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table"));for(const[l,r]of Object.entries(o))r!=null&&(l==="style"?this.table.style.cssText=String(r):this.table.setAttribute(l,String(r)));e.attrs.style&&(this.table.style.cssText=e.attrs.style),this.colgroup=this.table.appendChild(document.createElement("colgroup")),ye(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!==this.node.type?!1:(this.node=e,ye(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){const t=e.target,n=this.dom.contains(t),o=this.contentDOM.contains(t);return!!(n&&!o&&(e.type==="attributes"||e.type==="childList"||e.type==="characterData"))}};function en(e,t,n,o){let l=0,r=!0;const s=[],c=e.firstChild;if(!c)return{};for(let d=0,u=0;d<c.childCount;d+=1){const{colspan:f,colwidth:p}=c.child(d).attrs;for(let h=0;h<f;h+=1,u+=1){const g=n===u?o:p&&p[h];l+=g||t,g||(r=!1);const[m,w]=re(t,g);s.push(["col",{style:`${m}: ${w}`}])}}const i=r?`${l}px`:"",a=r?"":`${l}px`;return{colgroup:["colgroup",{},...s],tableWidth:i,tableMinWidth:a}}function Ae(e,t){return e.createAndFill()}function tn(e){if(e.cached.tableNodeTypes)return e.cached.tableNodeTypes;const t={};return Object.keys(e.nodes).forEach(n=>{const o=e.nodes[n];o.spec.tableRole&&(t[o.spec.tableRole]=o)}),e.cached.tableNodeTypes=t,t}function nn(e,t,n,o,l){const r=tn(e),s=[],c=[];for(let a=0;a<n;a+=1){const d=Ae(r.cell);if(d&&c.push(d),o){const u=Ae(r.header_cell);u&&s.push(u)}}const i=[];for(let a=0;a<t;a+=1)i.push(r.row.createChecked(null,o&&a===0?s:c));return r.table.createChecked(null,i)}function on(e){return e instanceof b}const V=({editor:e})=>{const{selection:t}=e.state;if(!on(t))return!1;let n=0;const o=q(t.ranges[0].$from,l=>l.type.name==="table");return o?.node.descendants(l=>{if(l.type.name==="table")return!1;["tableCell","tableHeader"].includes(l.type.name)&&(n+=1)}),n!==t.ranges.length?!1:(e.commands.deleteTable(),!0)};function Se(e,t){const n=e.mapping.map(t),o=q(e.selection.$from,s=>s.type.name==="table");if(o?.pos===n)return;const l=e.doc.nodeAt(n);if(!l)return;const r=n+l.nodeSize-1;e.setSelection(H.near(e.doc.resolve(r),-1))}function ln(e){let t="",n=0;for(;n<e.length;){if(e[n]==="\\"&&n+1<e.length){t+=e[n]+e[n+1],n+=2;continue}if(e[n]!=="`"){t+=e[n++];continue}let o=0;for(;n+o<e.length&&e[n+o]==="`";)o+=1;let l=n+o,r=!1;for(;l<e.length;){if(e[l]!=="`"){l+=1;continue}let s=0;for(;l+s<e.length&&e[l+s]==="`";)s+=1;if(s===o){const c=e.slice(n+o,l);t+=e.slice(n,n+o)+c.replace(/\\\||\|/g,i=>i==="|"?"\\|":i)+e.slice(l,l+o),n=l+o,r=!0;break}l+=s}r||(t+=e.slice(n,n+o),n+=o)}return t}function rn(e){return e.split(`
|
|
1
|
+
import{N as P,q as De,c as k,R as Ie,r as Pe,t as se,v as E,w as Oe,T as H,x as je,y as M,z as L,A as ve,D as Q,B as Z,C as Fe,G as _e,H as Ve,I as Ke,J as q,f as Xe}from"./usage-stats-LrxjpMvT.js";const qe=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,Ue=P.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:e}){return["img",k(this.options.HTMLAttributes,e)]},parseMarkdown:(e,t)=>t.createNode("image",{src:e.href,title:e.title,alt:e.text}),renderMarkdown:e=>{var t,n,o,l,r,s;const c=(t=(n=e.attrs)===null||n===void 0?void 0:n.src)!==null&&t!==void 0?t:"",i=(o=(l=e.attrs)===null||l===void 0?void 0:l.alt)!==null&&o!==void 0?o:"",a=(r=(s=e.attrs)===null||s===void 0?void 0:s.title)!==null&&r!==void 0?r:"";return a?``:``},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>"u")return null;const{directions:e,minWidth:t,minHeight:n,alwaysPreserveAspectRatio:o}=this.options.resize,l=new Set(["src","width","height"]);return({node:r,getPos:s,HTMLAttributes:c,editor:i})=>{const a=document.createElement("img");a.draggable=!1;const d=k(this.options.HTMLAttributes,c);Object.entries(d).forEach(([w,S])=>{if(S!=null)switch(w){case"src":case"width":case"height":break;default:a.setAttribute(w,S)}}),d.src!==null&&(a.src=d.src);let u={...c};const f=w=>{if(typeof w=="string"&&w!==""){a.getAttribute("src")!==w&&(a.src=w);return}a.hasAttribute("src")&&a.removeAttribute("src"),a.src!==""&&(a.src="")};f(c.src);const p=w=>{if(w.type!==r.type)return!1;const S=i.extensionManager.attributes.filter(A=>A.type===w.type.name),y=Pe(w,S);return Object.keys(u).forEach(A=>{!l.has(A)&&!(A in y)&&a.removeAttribute(A)}),Object.entries(y).forEach(([A,R])=>{l.has(A)||(R!=null?a.setAttribute(A,R):a.removeAttribute(A))}),f(y.src),u=y,!0},h=new Ie({element:a,editor:i,node:r,getPos:s,onResize:(w,S)=>{a.style.width=`${w}px`,a.style.height=`${S}px`},onCommit:(w,S)=>{const y=s();y!==void 0&&this.editor.chain().setNodeSelection(y).updateAttributes(this.name,{width:w,height:S}).run()},onUpdate:p,options:{directions:e,min:{width:t,height:n},preserveAspectRatio:o===!0}}),g=h.dom,m=()=>{g.style.visibility="",g.style.pointerEvents=""};return g.style.visibility="hidden",g.style.pointerEvents="none",a.complete&&a.naturalWidth>0?m():(a.onload=m,a.onerror=m),h}},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[De({find:qe,type:this.type,getAttributes:e=>{const[,,t,n,o]=e;return{src:n,alt:t,title:o}}})]}});var un=Ue;let ee,te;if(typeof WeakMap<"u"){let e=new WeakMap;ee=t=>e.get(t),te=(t,n)=>(e.set(t,n),n)}else{const e=[];let n=0;ee=o=>{for(let l=0;l<e.length;l+=2)if(e[l]==o)return e[l+1]},te=(o,l)=>(n==10&&(n=0),e[n++]=o,e[n++]=l)}var C=class{constructor(e,t,n,o){this.width=e,this.height=t,this.map=n,this.problems=o}findCell(e){for(let t=0;t<this.map.length;t++){const n=this.map[t];if(n!=e)continue;const o=t%this.width,l=t/this.width|0;let r=o+1,s=l+1;for(let c=1;r<this.width&&this.map[t+c]==n;c++)r++;for(let c=1;s<this.height&&this.map[t+this.width*c]==n;c++)s++;return{left:o,top:l,right:r,bottom:s}}throw new RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw new RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){const{left:o,right:l,top:r,bottom:s}=this.findCell(e);return t=="horiz"?(n<0?o==0:l==this.width)?null:this.map[r*this.width+(n<0?o-1:l)]:(n<0?r==0:s==this.height)?null:this.map[o+this.width*(n<0?r-1:s)]}rectBetween(e,t){const{left:n,right:o,top:l,bottom:r}=this.findCell(e),{left:s,right:c,top:i,bottom:a}=this.findCell(t);return{left:Math.min(n,s),top:Math.min(l,i),right:Math.max(o,c),bottom:Math.max(r,a)}}cellsInRect(e){const t=[],n={};for(let o=e.top;o<e.bottom;o++)for(let l=e.left;l<e.right;l++){const r=o*this.width+l,s=this.map[r];n[s]||(n[s]=!0,!(l==e.left&&l&&this.map[r-1]==s||o==e.top&&o&&this.map[r-this.width]==s)&&t.push(s))}return t}positionAt(e,t,n){for(let o=0,l=0;;o++){const r=l+n.child(o).nodeSize;if(o==e){let s=t+e*this.width;const c=(e+1)*this.width;for(;s<c&&this.map[s]<l;)s++;return s==c?r-1:this.map[s]}l=r}}static get(e){return ee(e)||te(e,Je(e))}};function Je(e){if(e.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+e.type.name);const t=Ge(e),n=e.childCount,o=[];let l=0,r=null;const s=[];for(let a=0,d=t*n;a<d;a++)o[a]=0;for(let a=0,d=0;a<n;a++){const u=e.child(a);d++;for(let h=0;;h++){for(;l<o.length&&o[l]!=0;)l++;if(h==u.childCount)break;const g=u.child(h),{colspan:m,rowspan:w,colwidth:S}=g.attrs;for(let y=0;y<w;y++){if(y+a>=n){(r||(r=[])).push({type:"overlong_rowspan",pos:d,n:w-y});break}const A=l+y*t;for(let R=0;R<m;R++){o[A+R]==0?o[A+R]=d:(r||(r=[])).push({type:"collision",row:a,pos:d,n:m-R});const O=S&&S[R];if(O){const D=(A+R)%t*2,G=s[D];G==null||G!=O&&s[D+1]==1?(s[D]=O,s[D+1]=1):G==O&&s[D+1]++}}}l+=m,d+=g.nodeSize}const f=(a+1)*t;let p=0;for(;l<f;)o[l++]==0&&p++;p&&(r||(r=[])).push({type:"missing",row:a,n:p}),d++}(t===0||n===0)&&(r||(r=[])).push({type:"zero_sized"});const c=new C(t,n,o,r);let i=!1;for(let a=0;!i&&a<s.length;a+=2)s[a]!=null&&s[a+1]<n&&(i=!0);return i&&Ye(c,s,e),c}function Ge(e){let t=-1,n=!1;for(let o=0;o<e.childCount;o++){const l=e.child(o);let r=0;if(n)for(let s=0;s<o;s++){const c=e.child(s);for(let i=0;i<c.childCount;i++){const a=c.child(i);s+a.attrs.rowspan>o&&(r+=a.attrs.colspan)}}for(let s=0;s<l.childCount;s++){const c=l.child(s);r+=c.attrs.colspan,c.attrs.rowspan>1&&(n=!0)}t==-1?t=r:t!=r&&(t=Math.max(t,r))}return t}function Ye(e,t,n){e.problems||(e.problems=[]);const o={};for(let l=0;l<e.map.length;l++){const r=e.map[l];if(o[r])continue;o[r]=!0;const s=n.nodeAt(r);if(!s)throw new RangeError(`No cell with offset ${r} found`);let c=null;const i=s.attrs;for(let a=0;a<i.colspan;a++){const d=t[(l+a)%e.width*2];d!=null&&(!i.colwidth||i.colwidth[a]!=d)&&((c||(c=Qe(i)))[a]=d)}c&&e.problems.unshift({type:"colwidth mismatch",pos:r,colwidth:c})}}function Qe(e){if(e.colwidth)return e.colwidth.slice();const t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function v(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(const n in e.nodes){const o=e.nodes[n],l=o.spec.tableRole;l&&(t[l]=o)}}return t}const $=new se("selectingCells");function W(e){for(let t=e.depth-1;t>0;t--)if(e.node(t).type.spec.tableRole=="row")return e.node(0).resolve(e.before(t+1));return null}function Ze(e){for(let t=e.depth;t>0;t--){const n=e.node(t).type.spec.tableRole;if(n==="cell"||n==="header_cell")return e.node(t)}return null}function T(e){const t=e.selection.$head;for(let n=t.depth;n>0;n--)if(t.node(n).type.spec.tableRole=="row")return!0;return!1}function J(e){const t=e.selection;if("$anchorCell"in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if("node"in t&&t.node&&t.node.type.spec.tableRole=="cell")return t.$anchor;const n=W(t.$head)||et(t.$head);if(n)return n;throw new RangeError(`No cell found around position ${t.head}`)}function et(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){const o=t.type.spec.tableRole;if(o=="cell"||o=="header_cell")return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){const o=t.type.spec.tableRole;if(o=="cell"||o=="header_cell")return e.doc.resolve(n-t.nodeSize)}}function ne(e){return e.parent.type.spec.tableRole=="row"&&!!e.nodeAfter}function tt(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function ie(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function Re(e,t,n){const o=e.node(-1),l=C.get(o),r=e.start(-1),s=l.nextCell(e.pos-r,t,n);return s==null?null:e.node(0).resolve(r+s)}function B(e,t,n=1){const o={...e,colspan:e.colspan-n};return o.colwidth&&(o.colwidth=o.colwidth.slice(),o.colwidth.splice(t,n),o.colwidth.some(l=>l>0)||(o.colwidth=null)),o}function xe(e,t,n=1){const o={...e,colspan:e.colspan+n};if(o.colwidth){o.colwidth=o.colwidth.slice();for(let l=0;l<n;l++)o.colwidth.splice(t,0,0)}return o}function nt(e,t,n){const o=v(t.type.schema).header_cell;for(let l=0;l<e.height;l++)if(t.nodeAt(e.map[n+l*e.width]).type!=o)return!1;return!0}var b=class N extends E{constructor(t,n=t){const o=t.node(-1),l=C.get(o),r=t.start(-1),s=l.rectBetween(t.pos-r,n.pos-r),c=t.node(0),i=l.cellsInRect(s).filter(d=>d!=n.pos-r);i.unshift(n.pos-r);const a=i.map(d=>{const u=o.nodeAt(d);if(!u)throw new RangeError(`No cell with offset ${d} found`);const f=r+d+1;return new je(c.resolve(f),c.resolve(f+u.content.size))});super(a[0].$from,a[0].$to,a),this.$anchorCell=t,this.$headCell=n}map(t,n){const o=t.resolve(n.map(this.$anchorCell.pos)),l=t.resolve(n.map(this.$headCell.pos));if(ne(o)&&ne(l)&&ie(o,l)){const r=this.$anchorCell.node(-1)!=o.node(-1);return r&&this.isRowSelection()?N.rowSelection(o,l):r&&this.isColSelection()?N.colSelection(o,l):new N(o,l)}return H.between(o,l)}content(){const t=this.$anchorCell.node(-1),n=C.get(t),o=this.$anchorCell.start(-1),l=n.rectBetween(this.$anchorCell.pos-o,this.$headCell.pos-o),r={},s=[];for(let i=l.top;i<l.bottom;i++){const a=[];for(let d=i*n.width+l.left,u=l.left;u<l.right;u++,d++){const f=n.map[d];if(r[f])continue;r[f]=!0;const p=n.findCell(f);let h=t.nodeAt(f);if(!h)throw new RangeError(`No cell with offset ${f} found`);const g=l.left-p.left,m=p.right-l.right;if(g>0||m>0){let w=h.attrs;if(g>0&&(w=B(w,0,g)),m>0&&(w=B(w,w.colspan-m,m)),p.left<l.left){if(h=h.type.createAndFill(w),!h)throw new RangeError(`Could not create cell with attrs ${JSON.stringify(w)}`)}else h=h.type.create(w,h.content)}if(p.top<l.top||p.bottom>l.bottom){const w={...h.attrs,rowspan:Math.min(p.bottom,l.bottom)-Math.max(p.top,l.top)};p.top<l.top?h=h.type.createAndFill(w):h=h.type.create(w,h.content)}a.push(h)}s.push(t.child(i).copy(M.from(a)))}const c=this.isColSelection()&&this.isRowSelection()?t:s;return new L(M.from(c),1,1)}replace(t,n=L.empty){const o=t.steps.length,l=this.ranges;for(let s=0;s<l.length;s++){const{$from:c,$to:i}=l[s],a=t.mapping.slice(o);t.replace(a.map(c.pos),a.map(i.pos),s?L.empty:n)}const r=E.findFrom(t.doc.resolve(t.mapping.slice(o).map(this.to)),-1);r&&t.setSelection(r)}replaceWith(t,n){this.replace(t,new L(M.from(n),0,0))}forEachCell(t){const n=this.$anchorCell.node(-1),o=C.get(n),l=this.$anchorCell.start(-1),r=o.cellsInRect(o.rectBetween(this.$anchorCell.pos-l,this.$headCell.pos-l));for(let s=0;s<r.length;s++)t(n.nodeAt(r[s]),l+r[s])}isColSelection(){const t=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(t,n)>0)return!1;const o=t+this.$anchorCell.nodeAfter.attrs.rowspan,l=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(o,l)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){const o=t.node(-1),l=C.get(o),r=t.start(-1),s=l.findCell(t.pos-r),c=l.findCell(n.pos-r),i=t.node(0);return s.top<=c.top?(s.top>0&&(t=i.resolve(r+l.map[s.left])),c.bottom<l.height&&(n=i.resolve(r+l.map[l.width*(l.height-1)+c.right-1]))):(c.top>0&&(n=i.resolve(r+l.map[c.left])),s.bottom<l.height&&(t=i.resolve(r+l.map[l.width*(l.height-1)+s.right-1]))),new N(t,n)}isRowSelection(){const t=this.$anchorCell.node(-1),n=C.get(t),o=this.$anchorCell.start(-1),l=n.colCount(this.$anchorCell.pos-o),r=n.colCount(this.$headCell.pos-o);if(Math.min(l,r)>0)return!1;const s=l+this.$anchorCell.nodeAfter.attrs.colspan,c=r+this.$headCell.nodeAfter.attrs.colspan;return Math.max(s,c)==n.width}eq(t){return t instanceof N&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){const o=t.node(-1),l=C.get(o),r=t.start(-1),s=l.findCell(t.pos-r),c=l.findCell(n.pos-r),i=t.node(0);return s.left<=c.left?(s.left>0&&(t=i.resolve(r+l.map[s.top*l.width])),c.right<l.width&&(n=i.resolve(r+l.map[l.width*(c.top+1)-1]))):(c.left>0&&(n=i.resolve(r+l.map[c.top*l.width])),s.right<l.width&&(t=i.resolve(r+l.map[l.width*(s.top+1)-1]))),new N(t,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new N(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,o=n){return new N(t.resolve(n),t.resolve(o))}getBookmark(){return new ot(this.$anchorCell.pos,this.$headCell.pos)}};b.prototype.visible=!1;E.jsonID("cell",b);var ot=class Te{constructor(t,n){this.anchor=t,this.head=n}map(t){return new Te(t.map(this.anchor),t.map(this.head))}resolve(t){const n=t.resolve(this.anchor),o=t.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&o.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&o.index()<o.parent.childCount&&ie(n,o)?new b(n,o):E.near(o,1)}};function lt(e){if(!(e.selection instanceof b))return null;const t=[];return e.selection.forEachCell((n,o)=>{t.push(Z.node(o,o+n.nodeSize,{class:"selectedCell"}))}),Q.create(e.doc,t)}function rt({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,o=t.pos,l=e.depth;for(;l>=0&&!(e.after(l+1)<e.end(l));l--,n++);for(let r=t.depth;r>=0&&!(t.before(r+1)>t.start(r));r--,o--);return n==o&&/row|table/.test(e.node(l).type.spec.tableRole)}function st({$from:e,$to:t}){let n,o;for(let l=e.depth;l>0;l--){const r=e.node(l);if(r.type.spec.tableRole==="cell"||r.type.spec.tableRole==="header_cell"){n=r;break}}for(let l=t.depth;l>0;l--){const r=t.node(l);if(r.type.spec.tableRole==="cell"||r.type.spec.tableRole==="header_cell"){o=r;break}}return n!==o&&t.parentOffset===0}function it(e,t,n){const o=(t||e).selection,l=(t||e).doc;let r,s;if(o instanceof Fe&&(s=o.node.type.spec.tableRole)){if(s=="cell"||s=="header_cell")r=b.create(l,o.from);else if(s=="row"){const c=l.resolve(o.from+1);r=b.rowSelection(c,c)}else if(!n){const c=C.get(o.node),i=o.from+1,a=i+c.map[c.width*c.height-1];r=b.create(l,i+1,a)}}else o instanceof H&&rt(o)?r=H.create(l,o.from):o instanceof H&&st(o)&&(r=H.create(l,o.$from.start(),o.$from.end()));return r&&(t||(t=e.tr)).setSelection(r),t}const ct=new se("fix-tables");function Me(e,t,n,o){const l=e.childCount,r=t.childCount;e:for(let s=0,c=0;s<r;s++){const i=t.child(s);for(let a=c,d=Math.min(l,s+3);a<d;a++)if(e.child(a)==i){c=a+1,n+=i.nodeSize;continue e}o(i,n),c<l&&e.child(c).sameMarkup(i)?Me(e.child(c),i,n+1,o):i.nodesBetween(0,i.content.size,o,n+1),n+=i.nodeSize}}function ze(e,t){let n;const o=(l,r)=>{l.type.spec.tableRole=="table"&&(n=at(e,l,r,n))};return t?t.doc!=e.doc&&Me(t.doc,e.doc,0,o):e.doc.descendants(o),n}function at(e,t,n,o){const l=C.get(t);if(!l.problems)return o;o||(o=e.tr);const r=[];for(let i=0;i<l.height;i++)r.push(0);for(let i=0;i<l.problems.length;i++){const a=l.problems[i];if(a.type=="collision"){const d=t.nodeAt(a.pos);if(!d)continue;const u=d.attrs;for(let f=0;f<u.rowspan;f++)r[a.row+f]+=a.n;o.setNodeMarkup(o.mapping.map(n+1+a.pos),null,B(u,u.colspan-a.n,a.n))}else if(a.type=="missing")r[a.row]+=a.n;else if(a.type=="overlong_rowspan"){const d=t.nodeAt(a.pos);if(!d)continue;o.setNodeMarkup(o.mapping.map(n+1+a.pos),null,{...d.attrs,rowspan:d.attrs.rowspan-a.n})}else if(a.type=="colwidth mismatch"){const d=t.nodeAt(a.pos);if(!d)continue;o.setNodeMarkup(o.mapping.map(n+1+a.pos),null,{...d.attrs,colwidth:a.colwidth})}else if(a.type=="zero_sized"){const d=o.mapping.map(n);o.delete(d,d+t.nodeSize)}}let s,c;for(let i=0;i<r.length;i++)r[i]&&(s==null&&(s=i),c=i);for(let i=0,a=n+1;i<l.height;i++){const d=t.child(i),u=a+d.nodeSize,f=r[i];if(f>0){let p="cell";d.firstChild&&(p=d.firstChild.type.spec.tableRole);const h=[];for(let m=0;m<f;m++){const w=v(e.schema)[p].createAndFill();w&&h.push(w)}const g=(i==0||s==i-1)&&c==i?a+1:u-1;o.insert(o.mapping.map(g),h)}a=u}return o.setMeta(ct,{fixTables:!0})}function z(e){const t=e.selection,n=J(e),o=n.node(-1),l=n.start(-1),r=C.get(o);return{...t instanceof b?r.rectBetween(t.$anchorCell.pos-l,t.$headCell.pos-l):r.findCell(n.pos-l),tableStart:l,map:r,table:o}}function Ne(e,{map:t,tableStart:n,table:o},l){let r=l>0?-1:0;nt(t,o,l+r)&&(r=l==0||l==t.width?null:0);for(let s=0;s<t.height;s++){const c=s*t.width+l;if(l>0&&l<t.width&&t.map[c-1]==t.map[c]){const i=t.map[c],a=o.nodeAt(i);e.setNodeMarkup(e.mapping.map(n+i),null,xe(a.attrs,l-t.colCount(i))),s+=a.attrs.rowspan-1}else{const i=r==null?v(o.type.schema).cell:o.nodeAt(t.map[c+r]).type,a=t.positionAt(s,l,o);e.insert(e.mapping.map(n+a),i.createAndFill())}}return e}function dt(e,t){if(!T(e))return!1;if(t){const n=z(e);t(Ne(e.tr,n,n.left))}return!0}function ut(e,t){if(!T(e))return!1;if(t){const n=z(e);t(Ne(e.tr,n,n.right))}return!0}function ft(e,{map:t,table:n,tableStart:o},l){const r=e.mapping.maps.length;for(let s=0;s<t.height;){const c=s*t.width+l,i=t.map[c],a=n.nodeAt(i),d=a.attrs;if(l>0&&t.map[c-1]==i||l<t.width-1&&t.map[c+1]==i)e.setNodeMarkup(e.mapping.slice(r).map(o+i),null,B(d,l-t.colCount(i)));else{const u=e.mapping.slice(r).map(o+i);e.delete(u,u+a.nodeSize)}s+=d.rowspan}}function ht(e,t){if(!T(e))return!1;if(t){const n=z(e),o=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let l=n.right-1;ft(o,n,l),l!=n.left;l--){const r=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc;if(!r)throw new RangeError("No table found");n.table=r,n.map=C.get(r)}t(o)}return!0}function pt(e,t,n){var o;const l=v(t.type.schema).header_cell;for(let r=0;r<e.width;r++)if(((o=t.nodeAt(e.map[r+n*e.width]))===null||o===void 0?void 0:o.type)!=l)return!1;return!0}function Ee(e,{map:t,tableStart:n,table:o},l){let r=n;for(let a=0;a<l;a++)r+=o.child(a).nodeSize;const s=[];let c=l>0?-1:0;pt(t,o,l+c)&&(c=l==0||l==t.height?null:0);for(let a=0,d=t.width*l;a<t.width;a++,d++)if(l>0&&l<t.height&&t.map[d]==t.map[d-t.width]){const u=t.map[d],f=o.nodeAt(u).attrs;e.setNodeMarkup(n+u,null,{...f,rowspan:f.rowspan+1}),a+=f.colspan-1}else{var i;const u=c==null?v(o.type.schema).cell:(i=o.nodeAt(t.map[d+c*t.width]))===null||i===void 0?void 0:i.type,f=u?.createAndFill();f&&s.push(f)}return e.insert(r,v(o.type.schema).row.create(null,s)),e}function mt(e,t){if(!T(e))return!1;if(t){const n=z(e);t(Ee(e.tr,n,n.top))}return!0}function gt(e,t){if(!T(e))return!1;if(t){const n=z(e);t(Ee(e.tr,n,n.bottom))}return!0}function wt(e,{map:t,table:n,tableStart:o},l){let r=0;for(let a=0;a<l;a++)r+=n.child(a).nodeSize;const s=r+n.child(l).nodeSize,c=e.mapping.maps.length;e.delete(r+o,s+o);const i=new Set;for(let a=0,d=l*t.width;a<t.width;a++,d++){const u=t.map[d];if(!i.has(u)){if(i.add(u),l>0&&u==t.map[d-t.width]){const f=n.nodeAt(u).attrs;e.setNodeMarkup(e.mapping.slice(c).map(u+o),null,{...f,rowspan:f.rowspan-1}),a+=f.colspan-1}else if(l<t.height&&u==t.map[d+t.width]){const f=n.nodeAt(u),p=f.attrs,h=f.type.create({...p,rowspan:f.attrs.rowspan-1},f.content),g=t.positionAt(l+1,a,n);e.insert(e.mapping.slice(c).map(o+g),h),a+=p.colspan-1}}}}function bt(e,t){if(!T(e))return!1;if(t){const n=z(e),o=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let l=n.bottom-1;wt(o,n,l),l!=n.top;l--){const r=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc;if(!r)throw new RangeError("No table found");n.table=r,n.map=C.get(n.table)}t(o)}return!0}function ce(e){const t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function Ct({width:e,height:t,map:n},o){let l=o.top*e+o.left,r=l,s=(o.bottom-1)*e+o.left,c=l+(o.right-o.left-1);for(let i=o.top;i<o.bottom;i++){if(o.left>0&&n[r]==n[r-1]||o.right<e&&n[c]==n[c+1])return!0;r+=e,c+=e}for(let i=o.left;i<o.right;i++){if(o.top>0&&n[l]==n[l-e]||o.bottom<t&&n[s]==n[s+e])return!0;l++,s++}return!1}function ae(e,t){const n=e.selection;if(!(n instanceof b)||n.$anchorCell.pos==n.$headCell.pos)return!1;const o=z(e),{map:l}=o;if(Ct(l,o))return!1;if(t){const r=e.tr,s={};let c=M.empty,i,a;for(let d=o.top;d<o.bottom;d++)for(let u=o.left;u<o.right;u++){const f=l.map[d*l.width+u],p=o.table.nodeAt(f);if(!(s[f]||!p))if(s[f]=!0,i==null)i=f,a=p;else{ce(p)||(c=c.append(p.content));const h=r.mapping.map(f+o.tableStart);r.delete(h,h+p.nodeSize)}}if(i==null||a==null)return!0;if(r.setNodeMarkup(i+o.tableStart,null,{...xe(a.attrs,a.attrs.colspan,o.right-o.left-a.attrs.colspan),rowspan:o.bottom-o.top}),c.size>0){const d=i+1+a.content.size,u=ce(a)?i+1:d;r.replaceWith(u+o.tableStart,d+o.tableStart,c)}r.setSelection(new b(r.doc.resolve(i+o.tableStart))),t(r)}return!0}function de(e,t){const n=v(e.schema);return yt(({node:o})=>n[o.type.spec.tableRole])(e,t)}function yt(e){return(t,n)=>{const o=t.selection;let l,r;if(o instanceof b){if(o.$anchorCell.pos!=o.$headCell.pos)return!1;l=o.$anchorCell.nodeAfter,r=o.$anchorCell.pos}else{var s;if(l=Ze(o.$from),!l)return!1;r=(s=W(o.$from))===null||s===void 0?void 0:s.pos}if(l==null||r==null||l.attrs.colspan==1&&l.attrs.rowspan==1)return!1;if(n){let c=l.attrs;const i=[],a=c.colwidth;c.rowspan>1&&(c={...c,rowspan:1}),c.colspan>1&&(c={...c,colspan:1});const d=z(t),u=t.tr;for(let p=0;p<d.right-d.left;p++)i.push(a?{...c,colwidth:a&&a[p]?[a[p]]:null}:c);let f;for(let p=d.top;p<d.bottom;p++){let h=d.map.positionAt(p,d.left,d.table);p==d.top&&(h+=l.nodeSize);for(let g=d.left,m=0;g<d.right;g++,m++)g==d.left&&p==d.top||u.insert(f=u.mapping.map(h+d.tableStart,1),e({node:l,row:p,col:g}).createAndFill(i[m]))}u.setNodeMarkup(r,e({node:l,row:d.top,col:d.left}),i[0]),o instanceof b&&u.setSelection(new b(u.doc.resolve(o.$anchorCell.pos),f?u.doc.resolve(f):void 0)),n(u)}return!0}}function At(e,t){return function(n,o){if(!T(n))return!1;const l=J(n);if(l.nodeAfter.attrs[e]===t)return!1;if(o){const r=n.tr;n.selection instanceof b?n.selection.forEachCell((s,c)=>{s.attrs[e]!==t&&r.setNodeMarkup(c,null,{...s.attrs,[e]:t})}):r.setNodeMarkup(l.pos,null,{...l.nodeAfter.attrs,[e]:t}),o(r)}return!0}}function St(e){return function(t,n){if(!T(t))return!1;if(n){const o=v(t.schema),l=z(t),r=t.tr,s=l.map.cellsInRect(e=="column"?{left:l.left,top:0,right:l.right,bottom:l.map.height}:e=="row"?{left:0,top:l.top,right:l.map.width,bottom:l.bottom}:l),c=s.map(i=>l.table.nodeAt(i));for(let i=0;i<s.length;i++)c[i].type==o.header_cell&&r.setNodeMarkup(l.tableStart+s[i],o.cell,c[i].attrs);if(r.steps.length===0)for(let i=0;i<s.length;i++)r.setNodeMarkup(l.tableStart+s[i],o.header_cell,c[i].attrs);n(r)}return!0}}function ue(e,t,n){const o=t.map.cellsInRect({left:0,top:0,right:e=="row"?t.map.width:1,bottom:e=="column"?t.map.height:1});for(let l=0;l<o.length;l++){const r=t.table.nodeAt(o[l]);if(r&&r.type!==n.header_cell)return!1}return!0}function I(e,t){return t=t||{useDeprecatedLogic:!1},t.useDeprecatedLogic?St(e):function(n,o){if(!T(n))return!1;if(o){const l=v(n.schema),r=z(n),s=n.tr,c=ue("row",r,l),i=ue("column",r,l),a=(e==="column"?c:e==="row"&&i)?1:0,d=e=="column"?{left:0,top:a,right:1,bottom:r.map.height}:e=="row"?{left:a,top:0,right:r.map.width,bottom:1}:r,u=e=="column"?i?l.cell:l.header_cell:e=="row"?c?l.cell:l.header_cell:l.cell;r.map.cellsInRect(d).forEach(f=>{const p=f+r.tableStart,h=s.doc.nodeAt(p);h&&s.setNodeMarkup(p,u,h.attrs)}),o(s)}return!0}}I("row",{useDeprecatedLogic:!0});I("column",{useDeprecatedLogic:!0});const vt=I("cell",{useDeprecatedLogic:!0});function Rt(e,t){if(t<0){const n=e.nodeBefore;if(n)return e.pos-n.nodeSize;for(let o=e.index(-1)-1,l=e.before();o>=0;o--){const r=e.node(-1).child(o),s=r.lastChild;if(s)return l-1-s.nodeSize;l-=r.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;const n=e.node(-1);for(let o=e.indexAfter(-1),l=e.after();o<n.childCount;o++){const r=n.child(o);if(r.childCount)return l+1;l+=r.nodeSize}}return null}function fe(e){return function(t,n){if(!T(t))return!1;const o=Rt(J(t),e);if(o==null)return!1;if(n){const l=t.doc.resolve(o);n(t.tr.setSelection(H.between(l,tt(l))).scrollIntoView())}return!0}}function xt(e,t){const n=e.selection.$anchor;for(let o=n.depth;o>0;o--)if(n.node(o).type.spec.tableRole=="table")return t&&t(e.tr.delete(n.before(o),n.after(o)).scrollIntoView()),!0;return!1}function j(e,t){const n=e.selection;if(!(n instanceof b))return!1;if(t){const o=e.tr,l=v(e.schema).cell.createAndFill().content;n.forEachCell((r,s)=>{r.content.eq(l)||o.replace(o.mapping.map(s+1),o.mapping.map(s+r.nodeSize-1),new L(l,0,0))}),o.docChanged&&t(o)}return!0}function Tt(e){if(e.size===0)return null;let{content:t,openStart:n,openEnd:o}=e;for(;t.childCount==1&&(n>0&&o>0||t.child(0).type.spec.tableRole=="table");)n--,o--,t=t.child(0).content;const l=t.child(0),r=l.type.spec.tableRole,s=l.type.schema,c=[];if(r=="row")for(let i=0;i<t.childCount;i++){let a=t.child(i).content;const d=i?0:Math.max(0,n-1),u=i<t.childCount-1?0:Math.max(0,o-1);(d||u)&&(a=oe(v(s).row,new L(a,d,u)).content),c.push(a)}else if(r=="cell"||r=="header_cell")c.push(n||o?oe(v(s).row,new L(t,n,o)).content:t);else return null;return Mt(s,c)}function Mt(e,t){const n=[];for(let l=0;l<t.length;l++){const r=t[l];for(let s=r.childCount-1;s>=0;s--){const{rowspan:c,colspan:i}=r.child(s).attrs;for(let a=l;a<l+c;a++)n[a]=(n[a]||0)+i}}let o=0;for(let l=0;l<n.length;l++)o=Math.max(o,n[l]);for(let l=0;l<n.length;l++)if(l>=t.length&&t.push(M.empty),n[l]<o){const r=v(e).cell.createAndFill(),s=[];for(let c=n[l];c<o;c++)s.push(r);t[l]=t[l].append(M.from(s))}return{height:t.length,width:o,rows:t}}function oe(e,t){const n=e.createAndFill();return new _e(n).replace(0,n.content.size,t).doc}function zt({width:e,height:t,rows:n},o,l){if(e!=o){const r=[],s=[];for(let c=0;c<n.length;c++){const i=n[c],a=[];for(let d=r[c]||0,u=0;d<o;u++){let f=i.child(u%i.childCount);d+f.attrs.colspan>o&&(f=f.type.createChecked(B(f.attrs,f.attrs.colspan,d+f.attrs.colspan-o),f.content)),a.push(f),d+=f.attrs.colspan;for(let p=1;p<f.attrs.rowspan;p++)r[c+p]=(r[c+p]||0)+f.attrs.colspan}s.push(M.from(a))}n=s,e=o}if(t!=l){const r=[];for(let s=0,c=0;s<l;s++,c++){const i=[],a=n[c%t];for(let d=0;d<a.childCount;d++){let u=a.child(d);s+u.attrs.rowspan>l&&(u=u.type.create({...u.attrs,rowspan:Math.max(1,l-u.attrs.rowspan)},u.content)),i.push(u)}r.push(M.from(i))}n=r,t=l}return{width:e,height:t,rows:n}}function Nt(e,t,n,o,l,r,s){const c=e.doc.type.schema,i=v(c);let a,d;if(l>t.width)for(let u=0,f=0;u<t.height;u++){const p=n.child(u);f+=p.nodeSize;const h=[];let g;p.lastChild==null||p.lastChild.type==i.cell?g=a||(a=i.cell.createAndFill()):g=d||(d=i.header_cell.createAndFill());for(let m=t.width;m<l;m++)h.push(g);e.insert(e.mapping.slice(s).map(f-1+o),h)}if(r>t.height){const u=[];for(let h=0,g=(t.height-1)*t.width;h<Math.max(t.width,l);h++){const m=h>=t.width?!1:n.nodeAt(t.map[g+h]).type==i.header_cell;u.push(m?d||(d=i.header_cell.createAndFill()):a||(a=i.cell.createAndFill()))}const f=i.row.create(null,M.from(u)),p=[];for(let h=t.height;h<r;h++)p.push(f);e.insert(e.mapping.slice(s).map(o+n.nodeSize-2),p)}return!!(a||d)}function he(e,t,n,o,l,r,s,c){if(s==0||s==t.height)return!1;let i=!1;for(let a=l;a<r;a++){const d=s*t.width+a,u=t.map[d];if(t.map[d-t.width]==u){i=!0;const f=n.nodeAt(u),{top:p,left:h}=t.findCell(u);e.setNodeMarkup(e.mapping.slice(c).map(u+o),null,{...f.attrs,rowspan:s-p}),e.insert(e.mapping.slice(c).map(t.positionAt(s,h,n)),f.type.createAndFill({...f.attrs,rowspan:p+f.attrs.rowspan-s})),a+=f.attrs.colspan-1}}return i}function pe(e,t,n,o,l,r,s,c){if(s==0||s==t.width)return!1;let i=!1;for(let a=l;a<r;a++){const d=a*t.width+s,u=t.map[d];if(t.map[d-1]==u){i=!0;const f=n.nodeAt(u),p=t.colCount(u),h=e.mapping.slice(c).map(u+o);e.setNodeMarkup(h,null,B(f.attrs,s-p,f.attrs.colspan-(s-p))),e.insert(h+f.nodeSize,f.type.createAndFill(B(f.attrs,0,s-p))),a+=f.attrs.rowspan-1}}return i}function me(e,t,n,o,l){let r=n?e.doc.nodeAt(n-1):e.doc;if(!r)throw new Error("No table found");let s=C.get(r);const{top:c,left:i}=o,a=i+l.width,d=c+l.height,u=e.tr;let f=0;function p(){if(r=n?u.doc.nodeAt(n-1):u.doc,!r)throw new Error("No table found");s=C.get(r),f=u.mapping.maps.length}Nt(u,s,r,n,a,d,f)&&p(),he(u,s,r,n,i,a,c,f)&&p(),he(u,s,r,n,i,a,d,f)&&p(),pe(u,s,r,n,c,d,i,f)&&p(),pe(u,s,r,n,c,d,a,f)&&p();for(let h=c;h<d;h++){const g=s.positionAt(h,i,r),m=s.positionAt(h,a,r);u.replace(u.mapping.slice(f).map(g+n),u.mapping.slice(f).map(m+n),new L(l.rows[h-c],0,0))}p(),u.setSelection(new b(u.doc.resolve(n+s.positionAt(c,i,r)),u.doc.resolve(n+s.positionAt(d-1,a-1,r)))),t(u)}const Et=Oe({ArrowLeft:F("horiz",-1),ArrowRight:F("horiz",1),ArrowUp:F("vert",-1),ArrowDown:F("vert",1),"Shift-ArrowLeft":_("horiz",-1),"Shift-ArrowRight":_("horiz",1),"Shift-ArrowUp":_("vert",-1),"Shift-ArrowDown":_("vert",1),Backspace:j,"Mod-Backspace":j,Delete:j,"Mod-Delete":j});function K(e,t,n){return n.eq(e.selection)?!1:(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function F(e,t){return(n,o,l)=>{if(!l)return!1;const r=n.selection;if(r instanceof b)return K(n,o,E.near(r.$headCell,t));if(e!="horiz"&&!r.empty)return!1;const s=He(l,e,t);if(s==null)return!1;if(e=="horiz")return K(n,o,E.near(n.doc.resolve(r.head+t),t));{const c=n.doc.resolve(s),i=Re(c,e,t);let a;return i?a=E.near(i,1):t<0?a=E.near(n.doc.resolve(c.before(-1)),-1):a=E.near(n.doc.resolve(c.after(-1)),1),K(n,o,a)}}}function _(e,t){return(n,o,l)=>{if(!l)return!1;const r=n.selection;let s;if(r instanceof b)s=r;else{const i=He(l,e,t);if(i==null)return!1;s=new b(n.doc.resolve(i))}const c=Re(s.$headCell,e,t);return c?K(n,o,new b(s.$anchorCell,c)):!1}}function Ht(e,t){const n=e.state.doc,o=W(n.resolve(t));return o?(e.dispatch(e.state.tr.setSelection(new b(o))),!0):!1}function $t(e,t,n){if(!T(e.state))return!1;let o=Tt(n);const l=e.state.selection;if(l instanceof b){o||(o={width:1,height:1,rows:[M.from(oe(v(e.state.schema).cell,n))]});const r=l.$anchorCell.node(-1),s=l.$anchorCell.start(-1),c=C.get(r).rectBetween(l.$anchorCell.pos-s,l.$headCell.pos-s);return o=zt(o,c.right-c.left,c.bottom-c.top),me(e.state,e.dispatch,s,c,o),!0}else if(o){const r=J(e.state),s=r.start(-1);return me(e.state,e.dispatch,s,C.get(r.node(-1)).findCell(r.pos-s),o),!0}else return!1}function Lt(e,t){var n;if(t.button!=0||t.ctrlKey||t.metaKey)return;const o=ge(e,t.target);let l;if(t.shiftKey&&e.state.selection instanceof b)r(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&o&&(l=W(e.state.selection.$anchor))!=null&&((n=Y(e,t))===null||n===void 0?void 0:n.pos)!=l.pos)r(l,t),t.preventDefault();else if(!o)return;function r(i,a){let d=Y(e,a);const u=$.getState(e.state)==null;if(!d||!ie(i,d))if(u)d=i;else return;const f=new b(i,d);if(u||!e.state.selection.eq(f)){const p=e.state.tr.setSelection(f);u&&p.setMeta($,i.pos),e.dispatch(p)}}function s(){e.root.removeEventListener("mouseup",s),e.root.removeEventListener("dragstart",s),e.root.removeEventListener("mousemove",c),$.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta($,-1))}function c(i){const a=i,d=$.getState(e.state);let u;if(d!=null)u=e.state.doc.resolve(d);else if(ge(e,a.target)!=o&&(u=Y(e,t),!u))return s();u&&r(u,a)}e.root.addEventListener("mouseup",s),e.root.addEventListener("dragstart",s),e.root.addEventListener("mousemove",c)}function He(e,t,n){if(!(e.state.selection instanceof H))return null;const{$head:o}=e.state.selection;for(let l=o.depth-1;l>=0;l--){const r=o.node(l);if((n<0?o.index(l):o.indexAfter(l))!=(n<0?0:r.childCount))return null;if(r.type.spec.tableRole=="cell"||r.type.spec.tableRole=="header_cell"){const s=o.before(l),c=t=="vert"?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(c)?s:null}}return null}function ge(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName=="TD"||t.nodeName=="TH")return t;return null}function Y(e,t){const n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:o,pos:l}=n;return o>=0&&W(e.state.doc.resolve(o))||W(e.state.doc.resolve(l))}var kt=class{constructor(t,n){this.node=t,this.defaultCellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${n}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),le(t,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!=this.node.type?!1:(this.node=t,le(t,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(t){return t.type=="attributes"&&(t.target==this.table||this.colgroup.contains(t.target))}};function le(e,t,n,o,l,r){let s=0,c=!0,i=t.firstChild;const a=e.firstChild;if(a){for(let u=0,f=0;u<a.childCount;u++){const{colspan:p,colwidth:h}=a.child(u).attrs;for(let g=0;g<p;g++,f++){const m=l==f?r:h&&h[g],w=m?m+"px":"";if(s+=m||o,m||(c=!1),i)i.style.width!=w&&(i.style.width=w),i=i.nextSibling;else{const S=document.createElement("col");S.style.width=w,t.appendChild(S)}}}for(;i;){var d;const u=i.nextSibling;(d=i.parentNode)===null||d===void 0||d.removeChild(i),i=u}c?(n.style.width=s+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=s+"px")}}const x=new se("tableColumnResizing");function Wt({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:o=kt,lastColumnResizable:l=!0}={}){const r=new ve({key:x,state:{init(s,c){var i;const a=(i=r.spec)===null||i===void 0||(i=i.props)===null||i===void 0?void 0:i.nodeViews,d=v(c.schema).table.name;return o&&a&&(a[d]=(u,f)=>new o(u,n,f)),new Bt(-1,!1)},apply(s,c){return c.apply(s)}},props:{attributes:s=>{const c=x.getState(s);return c&&c.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(s,c)=>{Dt(s,c,e,l)},mouseleave:s=>{It(s)},mousedown:(s,c)=>{Pt(s,c,t,n)}},decorations:s=>{const c=x.getState(s);if(c&&c.activeHandle>-1)return Vt(s,c.activeHandle)},nodeViews:{}}});return r}var Bt=class X{constructor(t,n){this.activeHandle=t,this.dragging=n}apply(t){const n=this,o=t.getMeta(x);if(o&&o.setHandle!=null)return new X(o.setHandle,!1);if(o&&o.setDragging!==void 0)return new X(n.activeHandle,o.setDragging);if(n.activeHandle>-1&&t.docChanged){let l=t.mapping.map(n.activeHandle,-1);return ne(t.doc.resolve(l))||(l=-1),new X(l,n.dragging)}return n}};function Dt(e,t,n,o){if(!e.editable)return;const l=x.getState(e.state);if(l&&!l.dragging){const r=jt(t.target);let s=-1;if(r){const{left:c,right:i}=r.getBoundingClientRect();t.clientX-c<=n?s=we(e,t,"left",n):i-t.clientX<=n&&(s=we(e,t,"right",n))}if(s!=l.activeHandle){if(!o&&s!==-1){const c=e.state.doc.resolve(s),i=c.node(-1),a=C.get(i),d=c.start(-1);if(a.colCount(c.pos-d)+c.nodeAfter.attrs.colspan-1==a.width-1)return}$e(e,s)}}}function It(e){if(!e.editable)return;const t=x.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&$e(e,-1)}function Pt(e,t,n,o){var l;if(!e.editable)return!1;const r=(l=e.dom.ownerDocument.defaultView)!==null&&l!==void 0?l:window,s=x.getState(e.state);if(!s||s.activeHandle==-1||s.dragging)return!1;const c=e.state.doc.nodeAt(s.activeHandle),i=Ot(e,s.activeHandle,c.attrs);e.dispatch(e.state.tr.setMeta(x,{setDragging:{startX:t.clientX,startWidth:i}}));function a(u){r.removeEventListener("mouseup",a),r.removeEventListener("mousemove",d);const f=x.getState(e.state);f?.dragging&&(Ft(e,f.activeHandle,be(f.dragging,u,n)),e.dispatch(e.state.tr.setMeta(x,{setDragging:null})))}function d(u){if(!u.which)return a(u);const f=x.getState(e.state);if(f&&f.dragging){const p=be(f.dragging,u,n);Ce(e,f.activeHandle,p,o)}}return Ce(e,s.activeHandle,i,o),r.addEventListener("mouseup",a),r.addEventListener("mousemove",d),t.preventDefault(),!0}function Ot(e,t,{colspan:n,colwidth:o}){const l=o&&o[o.length-1];if(l)return l;const r=e.domAtPos(t);let s=r.node.childNodes[r.offset].offsetWidth,c=n;if(o)for(let i=0;i<n;i++)o[i]&&(s-=o[i],c--);return s/c}function jt(e){for(;e&&e.nodeName!="TD"&&e.nodeName!="TH";)e=e.classList&&e.classList.contains("ProseMirror")?null:e.parentNode;return e}function we(e,t,n,o){const l=n=="right"?-o:o,r=e.posAtCoords({left:t.clientX+l,top:t.clientY});if(!r)return-1;const{pos:s}=r,c=W(e.state.doc.resolve(s));if(!c)return-1;if(n=="right")return c.pos;const i=C.get(c.node(-1)),a=c.start(-1),d=i.map.indexOf(c.pos-a);return d%i.width==0?-1:a+i.map[d-1]}function be(e,t,n){const o=t.clientX-e.startX;return Math.max(n,e.startWidth+o)}function $e(e,t){e.dispatch(e.state.tr.setMeta(x,{setHandle:t}))}function Ft(e,t,n){const o=e.state.doc.resolve(t),l=o.node(-1),r=C.get(l),s=o.start(-1),c=r.colCount(o.pos-s)+o.nodeAfter.attrs.colspan-1,i=e.state.tr;for(let a=0;a<r.height;a++){const d=a*r.width+c;if(a&&r.map[d]==r.map[d-r.width])continue;const u=r.map[d],f=l.nodeAt(u).attrs,p=f.colspan==1?0:c-r.colCount(u);if(f.colwidth&&f.colwidth[p]==n)continue;const h=f.colwidth?f.colwidth.slice():_t(f.colspan);h[p]=n,i.setNodeMarkup(s+u,null,{...f,colwidth:h})}i.docChanged&&e.dispatch(i)}function Ce(e,t,n,o){const l=e.state.doc.resolve(t),r=l.node(-1),s=l.start(-1),c=C.get(r).colCount(l.pos-s)+l.nodeAfter.attrs.colspan-1;let i=e.domAtPos(l.start(-1)).node;for(;i&&i.nodeName!="TABLE";)i=i.parentNode;i&&le(r,i.firstChild,i,o,c,n)}function _t(e){return Array(e).fill(0)}function Vt(e,t){const n=[],o=e.doc.resolve(t),l=o.node(-1);if(!l)return Q.empty;const r=C.get(l),s=o.start(-1),c=r.colCount(o.pos-s)+o.nodeAfter.attrs.colspan-1;for(let a=0;a<r.height;a++){const d=c+a*r.width;if((c==r.width-1||r.map[d]!=r.map[d+1])&&(a==0||r.map[d]!=r.map[d-r.width])){var i;const u=r.map[d],f=s+u+l.nodeAt(u).nodeSize-1,p=document.createElement("div");p.className="column-resize-handle",!((i=x.getState(e))===null||i===void 0)&&i.dragging&&n.push(Z.node(s+u,s+u+l.nodeAt(u).nodeSize,{class:"column-resize-dragging"})),n.push(Z.widget(f,p))}}return Q.create(e.doc,n)}function Kt({allowTableNodeSelection:e=!1}={}){return new ve({key:$,state:{init(){return null},apply(t,n){const o=t.getMeta($);if(o!=null)return o==-1?null:o;if(n==null||!t.docChanged)return n;const{deleted:l,pos:r}=t.mapping.mapResult(n);return l?null:r}},props:{decorations:lt,handleDOMEvents:{mousedown:Lt},createSelectionBetween(t){return $.getState(t.state)!=null?t.state.selection:null},handleTripleClick:Ht,handleKeyDown:Et,handlePaste:$t},appendTransaction(t,n,o){return it(o,ze(o,n),e)}})}function U(e){return e==="left"||e==="right"||e==="center"?e:null}function Xt(e){const t=(e.style.textAlign||"").trim().toLowerCase(),n=(e.getAttribute("align")||"").trim().toLowerCase();return U(t||n)}function qt(e){return U(e?.align)}function Le(){return{default:null,parseHTML:e=>Xt(e),renderHTML:e=>e.align?{style:`text-align: ${e.align}`}:{}}}function Ut(e){var t;const n=e.parentElement,o=e.closest("table");if(!n||!o)return null;const l=Array.from(n.children).indexOf(e),r=(t=o.querySelectorAll("colgroup > col")[l])===null||t===void 0?void 0:t.getAttribute("width");return r?[parseInt(r,10)]:null}function ke(e){const t=e.getAttribute("colwidth");return t?t.split(",").map(n=>parseInt(n,10)):Ut(e)}const Jt=/[ \t\r\n\f]+/g;function We(e){var t;return e.children.length>0?!1:((t=e.textContent)!==null&&t!==void 0?t:"").replace(Jt,"")===""}function Be(e){const t=e.createAndFill();if(!t)throw new Error(`[tiptap error]: "${e.name}" has no default content to backfill.`);return t.content}const Gt=P.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:ke},align:Le()}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td",getAttrs:e=>We(e)?{}:!1,getContent:(e,t)=>Be(t.nodes[this.name])},{tag:"td"}]},renderHTML({HTMLAttributes:e}){return["td",k(this.options.HTMLAttributes,e),0]}}),Yt=P.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:ke},align:Le()}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th",getAttrs:e=>We(e)?{}:!1,getContent:(e,t)=>Be(t.nodes[this.name])},{tag:"th"}]},renderHTML({HTMLAttributes:e}){return["th",k(this.options.HTMLAttributes,e),0]}}),Qt=P.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:e}){return["tr",k(this.options.HTMLAttributes,e),0]}});function re(e,t){return t?["width",`${Math.max(t,e)}px`]:["min-width",`${e}px`]}function ye(e,t,n,o,l,r){let s=0,c=!0,i=t.firstChild;const a=e.firstChild;if(a!==null)for(let f=0,p=0;f<a.childCount;f+=1){const{colspan:h,colwidth:g}=a.child(f).attrs;for(let m=0;m<h;m+=1,p+=1){const w=l===p?r:g&&g[m],S=w?`${w}px`:"";if(s+=w||o,w||(c=!1),i){if(i.style.width!==S){const[y,A]=re(o,w);i.style.setProperty(y,A)}i=i.nextSibling}else{const y=document.createElement("col"),[A,R]=re(o,w);y.style.setProperty(A,R),t.appendChild(y)}}}for(;i;){var d;const f=i.nextSibling;(d=i.parentNode)===null||d===void 0||d.removeChild(i),i=f}const u=e.attrs.style&&typeof e.attrs.style=="string"&&/\bwidth\s*:/i.test(e.attrs.style);c&&!u?(n.style.width=`${s}px`,n.style.minWidth=""):(n.style.width="",n.style.minWidth=`${s}px`)}var Zt=class{constructor(e,t,n,o={}){this.node=e,this.cellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table"));for(const[l,r]of Object.entries(o))r!=null&&(l==="style"?this.table.style.cssText=String(r):this.table.setAttribute(l,String(r)));e.attrs.style&&(this.table.style.cssText=e.attrs.style),this.colgroup=this.table.appendChild(document.createElement("colgroup")),ye(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!==this.node.type?!1:(this.node=e,ye(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){const t=e.target,n=this.dom.contains(t),o=this.contentDOM.contains(t);return!!(n&&!o&&(e.type==="attributes"||e.type==="childList"||e.type==="characterData"))}};function en(e,t,n,o){let l=0,r=!0;const s=[],c=e.firstChild;if(!c)return{};for(let d=0,u=0;d<c.childCount;d+=1){const{colspan:f,colwidth:p}=c.child(d).attrs;for(let h=0;h<f;h+=1,u+=1){const g=n===u?o:p&&p[h];l+=g||t,g||(r=!1);const[m,w]=re(t,g);s.push(["col",{style:`${m}: ${w}`}])}}const i=r?`${l}px`:"",a=r?"":`${l}px`;return{colgroup:["colgroup",{},...s],tableWidth:i,tableMinWidth:a}}function Ae(e,t){return e.createAndFill()}function tn(e){if(e.cached.tableNodeTypes)return e.cached.tableNodeTypes;const t={};return Object.keys(e.nodes).forEach(n=>{const o=e.nodes[n];o.spec.tableRole&&(t[o.spec.tableRole]=o)}),e.cached.tableNodeTypes=t,t}function nn(e,t,n,o,l){const r=tn(e),s=[],c=[];for(let a=0;a<n;a+=1){const d=Ae(r.cell);if(d&&c.push(d),o){const u=Ae(r.header_cell);u&&s.push(u)}}const i=[];for(let a=0;a<t;a+=1)i.push(r.row.createChecked(null,o&&a===0?s:c));return r.table.createChecked(null,i)}function on(e){return e instanceof b}const V=({editor:e})=>{const{selection:t}=e.state;if(!on(t))return!1;let n=0;const o=q(t.ranges[0].$from,l=>l.type.name==="table");return o?.node.descendants(l=>{if(l.type.name==="table")return!1;["tableCell","tableHeader"].includes(l.type.name)&&(n+=1)}),n!==t.ranges.length?!1:(e.commands.deleteTable(),!0)};function Se(e,t){const n=e.mapping.map(t),o=q(e.selection.$from,s=>s.type.name==="table");if(o?.pos===n)return;const l=e.doc.nodeAt(n);if(!l)return;const r=n+l.nodeSize-1;e.setSelection(H.near(e.doc.resolve(r),-1))}function ln(e){let t="",n=0;for(;n<e.length;){if(e[n]==="\\"&&n+1<e.length){t+=e[n]+e[n+1],n+=2;continue}if(e[n]!=="`"){t+=e[n++];continue}let o=0;for(;n+o<e.length&&e[n+o]==="`";)o+=1;let l=n+o,r=!1;for(;l<e.length;){if(e[l]!=="`"){l+=1;continue}let s=0;for(;l+s<e.length&&e[l+s]==="`";)s+=1;if(s===o){const c=e.slice(n+o,l);t+=e.slice(n,n+o)+c.replace(/\\\||\|/g,i=>i==="|"?"\\|":i)+e.slice(l,l+o),n=l+o,r=!0;break}l+=s}r||(t+=e.slice(n,n+o),n+=o)}return t}function rn(e){return e.split(`
|
|
2
2
|
`).map(t=>!t.includes("|")||!t.includes("`")?t:ln(t)).join(`
|
|
3
3
|
`)}function sn(e){return(e||"").replace(/\s+/g," ").trim()}function cn(e,t,n={}){var o;const l=(o=n.cellLineSeparator)!==null&&o!==void 0?o:"";if(!e||!e.content||e.content.length===0)return"";const r=[];e.content.forEach(h=>{const g=[];h.content&&h.content.forEach(m=>{let w="";m.content&&Array.isArray(m.content)&&m.content.length>1?w=m.content.map(R=>t.renderChildren(R)).join(l):w=m.content?t.renderChildren(m.content):"";const S=sn(w.split(l).join(`
|
|
4
4
|
`).replace(/[ \t]*\r?\n[ \t]*/g,"<br>")),y=m.type==="tableHeader",A=qt(m.attrs);g.push({text:S,isHeader:y,align:A})}),r.push(g)});const s=r.reduce((h,g)=>Math.max(h,g.length),0);if(s===0)return"";const c=Array.from({length:s}).fill(0);r.forEach(h=>{for(let m=0;m<s;m+=1){var g;const w=(((g=h[m])===null||g===void 0?void 0:g.text)||"").length;w>c[m]&&(c[m]=w),c[m]<3&&(c[m]=3)}});const i=(h,g)=>h+" ".repeat(Math.max(0,g-h.length)),a=r[0],d=a.some(h=>h.isHeader),u=Array.from({length:s}).fill(null);r.forEach(h=>{for(let m=0;m<s;m+=1){var g;!u[m]&&(!((g=h[m])===null||g===void 0)&&g.align)&&(u[m]=h[m].align)}});let f=`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s,bZ as L,b_ as B,j as c,fZ as q,c3 as x,c1 as E,fY as K,c4 as C,f_ as I,dZ as T,ch as w,ca as U,cl as V}from"./index-
|
|
1
|
+
import{r as s,bZ as L,b_ as B,j as c,fZ as q,c3 as x,c1 as E,fY as K,c4 as C,f_ as I,dZ as T,ch as w,ca as U,cl as V}from"./index-B0kMZVmC.js";var _="Radio",[Z,P]=w(_),[z,H]=Z(_),k=s.forwardRef((t,d)=>{const{__scopeRadio:o,name:n,checked:e=!1,required:r,disabled:a,value:l="on",onCheck:f,form:R,...v}=t,[p,m]=s.useState(null),i=E(d,b=>m(b)),u=s.useRef(!1),h=p?R||!!p.closest("form"):!0;return c.jsxs(z,{scope:o,checked:e,disabled:a,children:[c.jsx(x.button,{type:"button",role:"radio","aria-checked":e,"data-state":A(e),"data-disabled":a?"":void 0,disabled:a,value:l,...v,ref:i,onClick:C(t.onClick,b=>{e||f?.(),h&&(u.current=b.isPropagationStopped(),u.current||b.stopPropagation())})}),h&&c.jsx(S,{control:p,bubbles:!u.current,name:n,value:l,checked:e,required:r,disabled:a,form:R,style:{transform:"translateX(-100%)"}})]})});k.displayName=_;var g="RadioIndicator",G=s.forwardRef((t,d)=>{const{__scopeRadio:o,forceMount:n,...e}=t,r=H(g,o);return c.jsx(T,{present:n||r.checked,children:c.jsx(x.span,{"data-state":A(r.checked),"data-disabled":r.disabled?"":void 0,...e,ref:d})})});G.displayName=g;var Y="RadioBubbleInput",S=s.forwardRef(({__scopeRadio:t,control:d,checked:o,bubbles:n=!0,...e},r)=>{const a=s.useRef(null),l=E(a,r),f=U(o),R=V(d);return s.useEffect(()=>{const v=a.current;if(!v)return;const p=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(p,"checked").set;if(f!==o&&i){const u=new Event("click",{bubbles:n});i.call(v,o),v.dispatchEvent(u)}},[f,o,n]),c.jsx(x.input,{type:"radio","aria-hidden":!0,defaultChecked:o,...e,tabIndex:-1,ref:l,style:{...e.style,...R,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});S.displayName=Y;function A(t){return t?"checked":"unchecked"}var W=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],y="RadioGroup",[X]=w(y,[I,P]),j=I(),N=P(),[J,Q]=X(y),D=s.forwardRef((t,d)=>{const{__scopeRadioGroup:o,name:n,defaultValue:e,value:r,required:a=!1,disabled:l=!1,orientation:f,dir:R,loop:v=!0,onValueChange:p,...m}=t,i=j(o),u=L(R),[h,b]=B({prop:r,defaultProp:e??null,onChange:p,caller:y});return c.jsx(J,{scope:o,name:n,required:a,disabled:l,value:h,onValueChange:b,children:c.jsx(q,{asChild:!0,...i,orientation:f,dir:u,loop:v,children:c.jsx(x.div,{role:"radiogroup","aria-required":a,"aria-orientation":f,"data-disabled":l?"":void 0,dir:u,...m,ref:d})})})});D.displayName=y;var M="RadioGroupItem",O=s.forwardRef((t,d)=>{const{__scopeRadioGroup:o,disabled:n,...e}=t,r=Q(M,o),a=r.disabled||n,l=j(o),f=N(o),R=s.useRef(null),v=E(d,R),p=r.value===e.value,m=s.useRef(!1);return s.useEffect(()=>{const i=h=>{W.includes(h.key)&&(m.current=!0)},u=()=>m.current=!1;return document.addEventListener("keydown",i),document.addEventListener("keyup",u),()=>{document.removeEventListener("keydown",i),document.removeEventListener("keyup",u)}},[]),c.jsx(K,{asChild:!0,...l,focusable:!a,active:p,children:c.jsx(k,{disabled:a,required:r.required,checked:p,...f,...e,name:r.name,ref:v,onCheck:()=>r.onValueChange(e.value),onKeyDown:C(i=>{i.key==="Enter"&&i.preventDefault()}),onFocus:C(e.onFocus,()=>{m.current&&R.current?.click()})})})});O.displayName=M;var $="RadioGroupIndicator",F=s.forwardRef((t,d)=>{const{__scopeRadioGroup:o,...n}=t,e=N(o);return c.jsx(G,{...e,...n,ref:d})});F.displayName=$;var oe=D,re=O,te=F;export{re as I,oe as R,te as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as n,c0 as V,dT as R,dU as Ee,dV as ke,dW as Se,aQ as xe,dX as j}from"./index-PfzOl7J6.js";var de=1,Ie=.9,Ce=.8,Re=.17,Y=.1,Z=.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(Z,E.length))):Fe.test(t.charAt(i-1))?(h*=Ie,I=t.slice(u,i-1).match(ve),I&&u>0&&(h*=Math.pow(Z,I.length))):(h*=Re,u>0&&(h*=Math.pow(Z,i-u))),t.charAt(i)!==l.charAt(c)&&(h*=Ae)),(h<Y&&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*Y>h&&(h=x*Y)),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 P='[cmdk-group=""]',_='[cmdk-group-items=""]',Ve='[cmdk-group-heading=""]',me='[cmdk-item=""]',fe=`${me}:not([aria-disabled="true"])`,te="cmdk-item-select",F="data-value",qe=(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:z=!1,vimBindings:A=!0,...O}=t,T=V(),ne=V(),W=V(),M=n.useRef(null),w=Ne();$(()=>{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(),N(),w(1,X);else if(e==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let y=document.getElementById(W);y?y.focus():(a=document.getElementById(T))==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())}}),[]),H=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,()=>{N(),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(),N(),r.current.value||X(),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&&X(),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:T,inputId:W,labelId:ne,listInnerRef:M}),[]);function le(e,o){var s,a;let m=(a=(s=v.current)==null?void 0:s.filter)!=null?a:qe;return e?m(e,r.current.search,o):0}function N(){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;q().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(`${P}[${F}="${encodeURIComponent(a[0])}"]`);g?.parentElement.appendChild(g)})}function X(){let e=q().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(P))==null?void 0:o.querySelector(Ve))==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 q(){var e;return Array.from(((e=M.current)==null?void 0:e.querySelectorAll(fe))||[])}function J(e){let o=q()[e];o&&k.setState("value",o.getAttribute(F))}function Q(e){var o;let s=D(),a=q(),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(P),a;for(;s&&!a;)s=e>0?We(s,P):He(s,P),a=s?.querySelector(fe);a?k.setState("value",a.getAttribute(F)):Q(e)}let ie=()=>J(q().length-1),oe=e=>{e.preventDefault(),e.metaKey?ie():e.altKey?ue(1):Q(1)},ce=e=>{e.preventDefault(),e.metaKey?J(0):e.altKey?ue(-1):Q(-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:H.inputId,id:H.labelId,style:Ge},b),U(t,e=>n.createElement(he.Provider,{value:k},n.createElement(pe.Provider,{value:H},e))))}),Pe=n.forwardRef((t,l)=>{var r,f;let u=V(),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;z(),(k=(w=b.current).onSelect)==null||k.call(w,p.current)}function z(){h.setState("value",p.current,!0)}if(!E)return null;let{disabled:A,value:O,onSelect:T,forceMount:ne,keywords:W,...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:z,onClick:A?void 0:I},t.children)}),je=n.forwardRef((t,l)=>{let{heading:r,children:f,forceMount:u,...c}=t,d=V(),v=n.useRef(null),b=n.useRef(null),i=V(),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),U(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},U(t,i=>n.createElement("div",{ref:j(d,b.listInnerRef),"cmdk-list-sizer":""},i)))}),Ue=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}))))}),ze=n.forwardRef((t,l)=>C(r=>r.filtered.count===0)?n.createElement(R.div,{ref:l,...t,"cmdk-empty":"",role:"presentation"}):null),Te=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},U(t,d=>n.createElement("div",{"aria-hidden":!0},d)))}),Qe=Object.assign(be,{List:Be,Item:Pe,Input:Oe,Group:je,Separator:Le,Dialog:Ue,Empty:ze,Loading:Te});function We(t,l){let r=t.nextElementSibling;for(;r;){if(r.matches(l))return r;r=r.nextElementSibling}}function He(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 Ne=()=>{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 Xe(t){let l=t.type;return typeof l=="function"?l(t.props):"render"in l?l.render(t.props):t}function U({asChild:t,children:l},r){return t&&n.isValidElement(l)?n.cloneElement(Xe(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{Qe as _};
|
|
1
|
+
import{r as n,c0 as V,dT as R,dU as Ee,dV as ke,dW as Se,aQ as xe,dX as j}from"./index-B0kMZVmC.js";var de=1,Ie=.9,Ce=.8,Re=.17,Y=.1,Z=.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(Z,E.length))):Fe.test(t.charAt(i-1))?(h*=Ie,I=t.slice(u,i-1).match(ve),I&&u>0&&(h*=Math.pow(Z,I.length))):(h*=Re,u>0&&(h*=Math.pow(Z,i-u))),t.charAt(i)!==l.charAt(c)&&(h*=Ae)),(h<Y&&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*Y>h&&(h=x*Y)),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 P='[cmdk-group=""]',_='[cmdk-group-items=""]',Ve='[cmdk-group-heading=""]',me='[cmdk-item=""]',fe=`${me}:not([aria-disabled="true"])`,te="cmdk-item-select",F="data-value",qe=(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:z=!1,vimBindings:A=!0,...O}=t,T=V(),ne=V(),W=V(),M=n.useRef(null),w=Ne();$(()=>{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(),N(),w(1,X);else if(e==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let y=document.getElementById(W);y?y.focus():(a=document.getElementById(T))==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())}}),[]),H=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,()=>{N(),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(),N(),r.current.value||X(),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&&X(),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:T,inputId:W,labelId:ne,listInnerRef:M}),[]);function le(e,o){var s,a;let m=(a=(s=v.current)==null?void 0:s.filter)!=null?a:qe;return e?m(e,r.current.search,o):0}function N(){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;q().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(`${P}[${F}="${encodeURIComponent(a[0])}"]`);g?.parentElement.appendChild(g)})}function X(){let e=q().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(P))==null?void 0:o.querySelector(Ve))==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 q(){var e;return Array.from(((e=M.current)==null?void 0:e.querySelectorAll(fe))||[])}function J(e){let o=q()[e];o&&k.setState("value",o.getAttribute(F))}function Q(e){var o;let s=D(),a=q(),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(P),a;for(;s&&!a;)s=e>0?We(s,P):He(s,P),a=s?.querySelector(fe);a?k.setState("value",a.getAttribute(F)):Q(e)}let ie=()=>J(q().length-1),oe=e=>{e.preventDefault(),e.metaKey?ie():e.altKey?ue(1):Q(1)},ce=e=>{e.preventDefault(),e.metaKey?J(0):e.altKey?ue(-1):Q(-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:H.inputId,id:H.labelId,style:Ge},b),U(t,e=>n.createElement(he.Provider,{value:k},n.createElement(pe.Provider,{value:H},e))))}),Pe=n.forwardRef((t,l)=>{var r,f;let u=V(),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;z(),(k=(w=b.current).onSelect)==null||k.call(w,p.current)}function z(){h.setState("value",p.current,!0)}if(!E)return null;let{disabled:A,value:O,onSelect:T,forceMount:ne,keywords:W,...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:z,onClick:A?void 0:I},t.children)}),je=n.forwardRef((t,l)=>{let{heading:r,children:f,forceMount:u,...c}=t,d=V(),v=n.useRef(null),b=n.useRef(null),i=V(),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),U(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},U(t,i=>n.createElement("div",{ref:j(d,b.listInnerRef),"cmdk-list-sizer":""},i)))}),Ue=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}))))}),ze=n.forwardRef((t,l)=>C(r=>r.filtered.count===0)?n.createElement(R.div,{ref:l,...t,"cmdk-empty":"",role:"presentation"}):null),Te=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},U(t,d=>n.createElement("div",{"aria-hidden":!0},d)))}),Qe=Object.assign(be,{List:Be,Item:Pe,Input:Oe,Group:je,Separator:Le,Dialog:Ue,Empty:ze,Loading:Te});function We(t,l){let r=t.nextElementSibling;for(;r;){if(r.matches(l))return r;r=r.nextElementSibling}}function He(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 Ne=()=>{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 Xe(t){let l=t.type;return typeof l=="function"?l(t.props):"render"in l?l.render(t.props):t}function U({asChild:t,children:l},r){return t&&n.isValidElement(l)?n.cloneElement(Xe(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{Qe as _};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as w,ar as le,at as re,b as se,a4 as ce,l as de,j as s,m as ue,n as ae,r as D,d as he,aR as Z,R as J,P as z,aZ as fe,B as me}from"./index-PfzOl7J6.js";import{u as pe}from"./use-mobile-Box5tF93.js";import{h as ge,c as be,u as xe,m as ye}from"./use-sidebar-collapsed-BFQg4qhu.js";import{a as ie,R as je,b as Se}from"./resizable-BWGQtKDK.js";import{c as ve,r as Ce,m as Te}from"./use-chat-layout-state-DYxnWGXI.js";import{M as Le,o as Ne}from"./agent-icon-DPgCnEV1.js";import{c as Q,T as X,a as ee}from"./tooltip-7oUFzrc9.js";import{T as te}from"./toolbar-icon-button-C1sAn-5j.js";import{u as we}from"./use-project-scope-RvpHL0s_.js";import{b as Pe}from"./repository-binding-BjyWZpYn.js";function ne(l,e){const a=typeof l=="number"?l:Number(l);return!Number.isFinite(a)||a<=0||a>=100?e:a}function ze(l,e){const a=w.c(8);let o;a[0]!==e?(o=c=>ne(c,e),a[0]=e,a[1]=o):o=a[1];const[t,i]=le(l,o);let n;a[2]!==e||a[3]!==t?(n=ne(t,e),a[2]=e,a[3]=t,a[4]=n):n=a[4];let u;return a[5]!==i||a[6]!==n?(u=[n,i],a[5]=i,a[6]=n,a[7]=u):u=a[7],u}const _e=33;function Oe(){const l=w.c(1);let e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=re.sidePanelWidth(),l[0]=e):e=l[0],ze(e,_e)}function Ee(l){const e=w.c(64),{actions:a,navigation:o}=l,t=se(),{org:i}=ce(),n=we(),u=Pe(n),c=ge(),{toggleSidebar:d}=be(),h=xe(),r=oe();let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f={select:Me},e[0]=f):f=e[0];const m=de(f),b=m?.mainView==="overview";let x;e[1]!==u?.title||e[2]!==t?(x=u?.title??t("common.loading"),e[1]=u?.title,e[2]=t,e[3]=x):x=e[3];const y=x;let j;e[4]!==b||e[5]!==m?.mainView||e[6]!==m?.pageTitle||e[7]!==y||e[8]!==n||e[9]!==t?(j=b?n?y:t("sidebar.navDestinations.home"):m?.mainView==="files"?t("sidebar.navDestinations.context"):t(m?.pageTitle??"page.view"),e[4]=b,e[5]=m?.mainView,e[6]=m?.pageTitle,e[7]=y,e[8]=n,e[9]=t,e[10]=j):j=e[10];const S=j,C=n??"";let T;e[11]!==i.slug||e[12]!==C?(T={to:"/$org/projects/$agentId",params:{org:i.slug,agentId:C}},e[11]=i.slug,e[12]=C,e[13]=T):T=e[13];const p=T;let g;if(e[14]!==c||e[15]!==b||e[16]!==i.slug||e[17]!==p||e[18]!==y||e[19]!==n||e[20]!==t||e[21]!==S){if(g=[],c){let v;e[23]!==t?(v=t("sidebar.navDestinations.settings"),e[23]=t,e[24]=v):v=e[24];let B;e[25]!==i.slug?(B={to:"/$org/settings/general",params:{org:i.slug}},e[25]=i.slug,e[26]=B):B=e[26];let K;e[27]!==v||e[28]!==B?(K={key:"settings",label:v,link:B},e[27]=v,e[28]=B,e[29]=K):K=e[29],g.push(K)}else if(n&&!b){let v;e[30]!==p||e[31]!==y?(v={key:"project",label:y,link:p},e[30]=p,e[31]=y,e[32]=v):v=e[32],g.push(v)}let V;e[33]!==S?(V={key:"page",label:S},e[33]=S,e[34]=V):V=e[34],g.push(V),e[14]=c,e[15]=b,e[16]=i.slug,e[17]=p,e[18]=y,e[19]=n,e[20]=t,e[21]=S,e[22]=g}else g=e[22];const L=h,N=!!r&&!r.threadless&&r.threadOpen;let P;e[35]!==r||e[36]!==L||e[37]!==t?(P=L&&r&&!r.threadless&&s.jsxs(Q,{children:[s.jsx(X,{asChild:!0,children:s.jsx(te,{"aria-label":t(r.threadOpen?"page.closeThread":"page.openThread"),"aria-pressed":r.threadOpen,active:r.threadOpen,onClick:r.toggleThread,children:s.jsx(Le,{size:16})})}),s.jsx(ee,{side:"bottom",children:t(r.threadOpen?"page.closeThread":"page.openThread")})]}),e[35]=r,e[36]=L,e[37]=t,e[38]=P):P=e[38];const W=P,q=(!L||N)&&"md:hidden";let _;e[39]!==q?(_=ue(q),e[39]=q,e[40]=_):_=e[40];let O;e[41]!==t?(O=t("page.expandSidebar"),e[41]=t,e[42]=O):O=e[42];let A;e[43]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(Ne,{size:16}),e[43]=A):A=e[43];let E;e[44]!==_||e[45]!==O||e[46]!==d?(E=s.jsx(X,{asChild:!0,children:s.jsx(te,{className:_,onClick:d,"aria-label":O,children:A})}),e[44]=_,e[45]=O,e[46]=d,e[47]=E):E=e[47];let M;e[48]!==t?(M=t("page.expandSidebar"),e[48]=t,e[49]=M):M=e[49];let R;e[50]!==M?(R=s.jsx(ee,{side:"bottom",children:M}),e[50]=M,e[51]=R):R=e[51];let k;e[52]!==E||e[53]!==R?(k=s.jsxs(Q,{children:[E,R]}),e[52]=E,e[53]=R,e[54]=k):k=e[54];let I;e[55]!==W||e[56]!==k?(I=s.jsxs(s.Fragment,{children:[k,W]}),e[55]=W,e[56]=k,e[57]=I):I=e[57];let H;return e[58]!==a||e[59]!==g||e[60]!==o||e[61]!==i.name||e[62]!==I?(H=s.jsx(ae.Header,{leading:I,breadcrumbs:g,scope:i.name,actions:a,navigation:o}),e[58]=a,e[59]=g,e[60]=o,e[61]=i.name,e[62]=I,e[63]=H):H=e[63],H}function Me(l){return l.matches.findLast(Re)?.staticData}function Re(l){return l.staticData.pageTitle}const $="chat-layout-thread",F="chat-layout-content",G=D.createContext(null);function ke(){return U()}function oe(){return D.use(G)}function U(){const l=D.use(G);if(!l)throw new Error("ChatLayout regions require a ChatLayout");return l}function Ie(l){const e=w.c(23),{children:a,...o}=l,t=pe(),i=he(),n=D.useRef(null),[u,c]=Oe(),{threadOpen:d,contentOpen:h}=o,r=ve(o),f=d&&h?u:r.side,m=100-f,b=p=>{const g=p.getLayout(),L=g[$],N=g[F];typeof L!="number"||typeof N!="number"||Math.abs(L-f)<.001&&Math.abs(N-m)<.001||p.setLayout({[$]:f,[F]:m})},x=Ce({visibility:o,threadVisibilityExplicit:o.threadVisibilityExplicit});let y;e[0]!==t||e[1]!==o||e[2]!==x?(y={...o,isMobile:t,mobileSurface:x},e[0]=t,e[1]=o,e[2]=x,e[3]=y):y=e[3];const j=y;let S;e[4]!==t||e[5]!==o||e[6]!==i||e[7]!==d||e[8]!==j?(S=!o.threadless&&s.jsx(ye,{open:t?j.mobileSurface==="chat":d,onToggle:()=>{t?i({to:".",search:p=>({...p,...Te(j.mobileSurface==="chat"?"main":"chat")}),replace:!0}):o.toggleThread()}}),e[4]=t,e[5]=o,e[6]=i,e[7]=d,e[8]=j,e[9]=S):S=e[9];let C;e[10]!==a||e[11]!==h||e[12]!==m||e[13]!==t||e[14]!==c||e[15]!==b||e[16]!==d||e[17]!==f?(C=t?s.jsx("div",{"data-slot":"chat-layout",className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-background",children:a}):s.jsx(je,{ref:p=>{if(n.current=p,!p)return;let g=!0;return queueMicrotask(()=>{g&&b(p)}),()=>{g=!1,n.current===p&&(n.current=null)}},defaultLayout:{[$]:f,[F]:m},orientation:"horizontal","data-slot":"chat-layout",className:"flex-1 min-h-0 pt-1 pb-1 pr-1 pl-0 [&>[data-chat-layout-panel-open]]:!min-w-[320px]",style:{overflow:"visible"},onLayoutChanged:(p,g)=>{const{isUserInteraction:L}=g;if(!L){const P=n.current;P&&b(P);return}const N=p[$];d&&h&&typeof N=="number"&&N>0&&N<100&&c(N)},children:a}),e[10]=a,e[11]=h,e[12]=m,e[13]=t,e[14]=c,e[15]=b,e[16]=d,e[17]=f,e[18]=C):C=e[18];let T;return e[19]!==S||e[20]!==C||e[21]!==j?(T=s.jsxs(G,{value:j,children:[S,C]}),e[19]=S,e[20]=C,e[21]=j,e[22]=T):T=e[22],T}function Be(l){const e=w.c(16),{children:a,topbar:o}=l,t=U();if(t.isMobile){let r;return e[0]!==a||e[1]!==t.mobileSurface||e[2]!==o?(r=t.mobileSurface==="chat"?s.jsxs(z,{variant:"plain","data-slot":"chat-layout-thread",children:[o,s.jsx(z.Content,{"data-testid":"chat-panel",children:a})]}):null,e[0]=a,e[1]=t.mobileSurface,e[2]=o,e[3]=r):r=e[3],r}const i=t.threadOpen?"":void 0;let n;e[4]!==a||e[5]!==t.threadOpen||e[6]!==o?(n=t.threadOpen&&s.jsxs(s.Fragment,{children:[o,s.jsx(z.Content,{"data-testid":"chat-panel",children:a})]}),e[4]=a,e[5]=t.threadOpen,e[6]=o,e[7]=n):n=e[7];let u;e[8]!==n?(u=s.jsx("div",{className:"h-full min-h-0 p-0.5",children:s.jsx(z,{"data-testid":"side-panel",children:n})}),e[8]=n,e[9]=u):u=e[9];let c;e[10]!==i||e[11]!==u?(c=s.jsx(ie,{id:$,defaultSize:"33%",minSize:"20%",collapsible:!0,collapsedSize:"0%","data-chat-layout-panel-open":i,className:"min-w-0 overflow-hidden bg-sidebar",children:u}),e[10]=i,e[11]=u,e[12]=c):c=e[12];let d;e[13]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Se,{className:"bg-sidebar"}),e[13]=d):d=e[13];let h;return e[14]!==c?(h=s.jsxs(s.Fragment,{children:[c,d]}),e[14]=c,e[15]=h):h=e[15],h}function $e({children:l,routeId:e}){return l}function Y(l){const e=w.c(23),{children:a,actions:o,drawer:t,aside:i}=l,n=U();if(n.isMobile&&n.mobileSurface!=="main")return null;const u=n.isMobile?"plain":"card";let c;e[0]!==o||e[1]!==n.contentNavigation?(c=s.jsx(Ee,{navigation:n.contentNavigation,actions:o}),e[0]=o,e[1]=n.contentNavigation,e[2]=c):c=e[2];let d;e[3]!==a||e[4]!==n.contentKey?(d=s.jsx(Z,{children:s.jsx($e,{routeId:n.contentKey,children:a})}),e[3]=a,e[4]=n.contentKey,e[5]=d):d=e[5];let h;e[6]!==n.contentKey||e[7]!==d?(h=s.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:s.jsx(J,{children:d},n.contentKey)}),e[6]=n.contentKey,e[7]=d,e[8]=h):h=e[8];let r;e[9]!==t||e[10]!==h?(r=s.jsxs(z.Content,{children:[h,t]}),e[9]=t,e[10]=h,e[11]=r):r=e[11];let f;e[12]!==c||e[13]!==r?(f=s.jsxs(ae.Breadcrumbs.Provider,{children:[c,r]}),e[12]=c,e[13]=r,e[14]=f):f=e[14];let m;e[15]!==u||e[16]!==f?(m=s.jsx(z,{"data-testid":"main-panel",variant:u,children:f}),e[15]=u,e[16]=f,e[17]=m):m=e[17];const b=m;let x;return e[18]!==i||e[19]!==n.contentOpen||e[20]!==n.isMobile||e[21]!==b?(x=n.isMobile?b:s.jsx(ie,{id:F,defaultSize:"67%",minSize:"20%",collapsible:!0,collapsedSize:"0%","data-chat-layout-panel-open":n.contentOpen?"":void 0,className:"min-w-0 overflow-hidden bg-sidebar",children:s.jsxs("div",{className:"flex h-full min-h-0",children:[s.jsx("div",{className:"h-full min-h-0 min-w-0 flex-1 p-0.5",children:b}),i&&s.jsx("div",{className:"h-full min-h-0 w-[42%] min-w-80 shrink-0 p-0.5",children:s.jsx(z,{"data-testid":"aside-panel",children:s.jsx(J,{children:s.jsx(Z,{children:i})},D.isValidElement(i)?i.key??void 0:void 0)})})]})}),e[18]=i,e[19]=n.contentOpen,e[20]=n.isMobile,e[21]=b,e[22]=x):x=e[22],x}function De(){const l=w.c(1);let e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Y,{children:s.jsx(fe,{})}),l[0]=e):e=l[0],e}function Ae(l){const e=w.c(18),{error:a,reset:o}=l,t=se();let i;e[0]!==t?(i=t("common.errorBoundary.somethingWentWrong"),e[0]=t,e[1]=i):i=e[1];let n;e[2]!==i?(n=s.jsx("h2",{className:"text-lg font-medium",children:i}),e[2]=i,e[3]=n):n=e[3];let u;e[4]!==a.message||e[5]!==t?(u=a.message||t("common.errorBoundary.unexpectedError"),e[4]=a.message,e[5]=t,e[6]=u):u=e[6];let c;e[7]!==u?(c=s.jsx("p",{className:"max-w-lg whitespace-pre-wrap text-sm text-muted-foreground",children:u}),e[7]=u,e[8]=c):c=e[8];let d;e[9]!==t?(d=t("common.errorBoundary.tryAgain"),e[9]=t,e[10]=d):d=e[10];let h;e[11]!==o||e[12]!==d?(h=s.jsx(me,{variant:"outline",onClick:o,children:d}),e[11]=o,e[12]=d,e[13]=h):h=e[13];let r;return e[14]!==n||e[15]!==c||e[16]!==h?(r=s.jsx(Y,{children:s.jsxs("div",{role:"alert",className:"flex h-full flex-col items-center justify-center gap-4 p-6 text-center",children:[n,c,h]})}),e[14]=n,e[15]=c,e[16]=h,e[17]=r):r=e[17],r}const He=Object.assign(Ie,{Thread:Be,Content:Y}),Qe=Object.freeze(Object.defineProperty({__proto__:null,ChatLayout:He,ChatLayoutError:Ae,ChatLayoutPending:De,useChatLayout:ke,useOptionalChatLayout:oe},Symbol.toStringTag,{value:"Module"}));export{He as C,Ee as R,Qe as i,ke as u};
|
|
1
|
+
import{c as w,ar as le,at as re,b as se,a4 as ce,l as de,j as s,m as ue,n as ae,r as D,d as he,aR as Z,R as J,P as z,aZ as fe,B as me}from"./index-B0kMZVmC.js";import{u as pe}from"./use-mobile-CMr55W3O.js";import{h as ge,c as be,u as xe,m as ye}from"./use-sidebar-collapsed-V5_gd1MI.js";import{a as ie,R as je,b as Se}from"./resizable-DqI16h9r.js";import{c as ve,r as Ce,m as Te}from"./use-chat-layout-state-DZgmLot0.js";import{M as Le,o as Ne}from"./agent-icon-BLhMgLPf.js";import{c as Q,T as X,a as ee}from"./tooltip-BTKQq4Sy.js";import{T as te}from"./toolbar-icon-button-T_NjCrYE.js";import{u as we}from"./use-project-scope-BpnU42cL.js";import{b as Pe}from"./repository-binding-DqsJn1Sb.js";function ne(l,e){const a=typeof l=="number"?l:Number(l);return!Number.isFinite(a)||a<=0||a>=100?e:a}function ze(l,e){const a=w.c(8);let o;a[0]!==e?(o=c=>ne(c,e),a[0]=e,a[1]=o):o=a[1];const[t,i]=le(l,o);let n;a[2]!==e||a[3]!==t?(n=ne(t,e),a[2]=e,a[3]=t,a[4]=n):n=a[4];let u;return a[5]!==i||a[6]!==n?(u=[n,i],a[5]=i,a[6]=n,a[7]=u):u=a[7],u}const _e=33;function Oe(){const l=w.c(1);let e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=re.sidePanelWidth(),l[0]=e):e=l[0],ze(e,_e)}function Ee(l){const e=w.c(64),{actions:a,navigation:o}=l,t=se(),{org:i}=ce(),n=we(),u=Pe(n),c=ge(),{toggleSidebar:d}=be(),h=xe(),r=oe();let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f={select:Me},e[0]=f):f=e[0];const m=de(f),b=m?.mainView==="overview";let x;e[1]!==u?.title||e[2]!==t?(x=u?.title??t("common.loading"),e[1]=u?.title,e[2]=t,e[3]=x):x=e[3];const y=x;let j;e[4]!==b||e[5]!==m?.mainView||e[6]!==m?.pageTitle||e[7]!==y||e[8]!==n||e[9]!==t?(j=b?n?y:t("sidebar.navDestinations.home"):m?.mainView==="files"?t("sidebar.navDestinations.context"):t(m?.pageTitle??"page.view"),e[4]=b,e[5]=m?.mainView,e[6]=m?.pageTitle,e[7]=y,e[8]=n,e[9]=t,e[10]=j):j=e[10];const S=j,C=n??"";let T;e[11]!==i.slug||e[12]!==C?(T={to:"/$org/projects/$agentId",params:{org:i.slug,agentId:C}},e[11]=i.slug,e[12]=C,e[13]=T):T=e[13];const p=T;let g;if(e[14]!==c||e[15]!==b||e[16]!==i.slug||e[17]!==p||e[18]!==y||e[19]!==n||e[20]!==t||e[21]!==S){if(g=[],c){let v;e[23]!==t?(v=t("sidebar.navDestinations.settings"),e[23]=t,e[24]=v):v=e[24];let B;e[25]!==i.slug?(B={to:"/$org/settings/general",params:{org:i.slug}},e[25]=i.slug,e[26]=B):B=e[26];let K;e[27]!==v||e[28]!==B?(K={key:"settings",label:v,link:B},e[27]=v,e[28]=B,e[29]=K):K=e[29],g.push(K)}else if(n&&!b){let v;e[30]!==p||e[31]!==y?(v={key:"project",label:y,link:p},e[30]=p,e[31]=y,e[32]=v):v=e[32],g.push(v)}let V;e[33]!==S?(V={key:"page",label:S},e[33]=S,e[34]=V):V=e[34],g.push(V),e[14]=c,e[15]=b,e[16]=i.slug,e[17]=p,e[18]=y,e[19]=n,e[20]=t,e[21]=S,e[22]=g}else g=e[22];const L=h,N=!!r&&!r.threadless&&r.threadOpen;let P;e[35]!==r||e[36]!==L||e[37]!==t?(P=L&&r&&!r.threadless&&s.jsxs(Q,{children:[s.jsx(X,{asChild:!0,children:s.jsx(te,{"aria-label":t(r.threadOpen?"page.closeThread":"page.openThread"),"aria-pressed":r.threadOpen,active:r.threadOpen,onClick:r.toggleThread,children:s.jsx(Le,{size:16})})}),s.jsx(ee,{side:"bottom",children:t(r.threadOpen?"page.closeThread":"page.openThread")})]}),e[35]=r,e[36]=L,e[37]=t,e[38]=P):P=e[38];const W=P,q=(!L||N)&&"md:hidden";let _;e[39]!==q?(_=ue(q),e[39]=q,e[40]=_):_=e[40];let O;e[41]!==t?(O=t("page.expandSidebar"),e[41]=t,e[42]=O):O=e[42];let A;e[43]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(Ne,{size:16}),e[43]=A):A=e[43];let E;e[44]!==_||e[45]!==O||e[46]!==d?(E=s.jsx(X,{asChild:!0,children:s.jsx(te,{className:_,onClick:d,"aria-label":O,children:A})}),e[44]=_,e[45]=O,e[46]=d,e[47]=E):E=e[47];let M;e[48]!==t?(M=t("page.expandSidebar"),e[48]=t,e[49]=M):M=e[49];let R;e[50]!==M?(R=s.jsx(ee,{side:"bottom",children:M}),e[50]=M,e[51]=R):R=e[51];let k;e[52]!==E||e[53]!==R?(k=s.jsxs(Q,{children:[E,R]}),e[52]=E,e[53]=R,e[54]=k):k=e[54];let I;e[55]!==W||e[56]!==k?(I=s.jsxs(s.Fragment,{children:[k,W]}),e[55]=W,e[56]=k,e[57]=I):I=e[57];let H;return e[58]!==a||e[59]!==g||e[60]!==o||e[61]!==i.name||e[62]!==I?(H=s.jsx(ae.Header,{leading:I,breadcrumbs:g,scope:i.name,actions:a,navigation:o}),e[58]=a,e[59]=g,e[60]=o,e[61]=i.name,e[62]=I,e[63]=H):H=e[63],H}function Me(l){return l.matches.findLast(Re)?.staticData}function Re(l){return l.staticData.pageTitle}const $="chat-layout-thread",F="chat-layout-content",G=D.createContext(null);function ke(){return U()}function oe(){return D.use(G)}function U(){const l=D.use(G);if(!l)throw new Error("ChatLayout regions require a ChatLayout");return l}function Ie(l){const e=w.c(23),{children:a,...o}=l,t=pe(),i=he(),n=D.useRef(null),[u,c]=Oe(),{threadOpen:d,contentOpen:h}=o,r=ve(o),f=d&&h?u:r.side,m=100-f,b=p=>{const g=p.getLayout(),L=g[$],N=g[F];typeof L!="number"||typeof N!="number"||Math.abs(L-f)<.001&&Math.abs(N-m)<.001||p.setLayout({[$]:f,[F]:m})},x=Ce({visibility:o,threadVisibilityExplicit:o.threadVisibilityExplicit});let y;e[0]!==t||e[1]!==o||e[2]!==x?(y={...o,isMobile:t,mobileSurface:x},e[0]=t,e[1]=o,e[2]=x,e[3]=y):y=e[3];const j=y;let S;e[4]!==t||e[5]!==o||e[6]!==i||e[7]!==d||e[8]!==j?(S=!o.threadless&&s.jsx(ye,{open:t?j.mobileSurface==="chat":d,onToggle:()=>{t?i({to:".",search:p=>({...p,...Te(j.mobileSurface==="chat"?"main":"chat")}),replace:!0}):o.toggleThread()}}),e[4]=t,e[5]=o,e[6]=i,e[7]=d,e[8]=j,e[9]=S):S=e[9];let C;e[10]!==a||e[11]!==h||e[12]!==m||e[13]!==t||e[14]!==c||e[15]!==b||e[16]!==d||e[17]!==f?(C=t?s.jsx("div",{"data-slot":"chat-layout",className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-background",children:a}):s.jsx(je,{ref:p=>{if(n.current=p,!p)return;let g=!0;return queueMicrotask(()=>{g&&b(p)}),()=>{g=!1,n.current===p&&(n.current=null)}},defaultLayout:{[$]:f,[F]:m},orientation:"horizontal","data-slot":"chat-layout",className:"flex-1 min-h-0 pt-1 pb-1 pr-1 pl-0 [&>[data-chat-layout-panel-open]]:!min-w-[320px]",style:{overflow:"visible"},onLayoutChanged:(p,g)=>{const{isUserInteraction:L}=g;if(!L){const P=n.current;P&&b(P);return}const N=p[$];d&&h&&typeof N=="number"&&N>0&&N<100&&c(N)},children:a}),e[10]=a,e[11]=h,e[12]=m,e[13]=t,e[14]=c,e[15]=b,e[16]=d,e[17]=f,e[18]=C):C=e[18];let T;return e[19]!==S||e[20]!==C||e[21]!==j?(T=s.jsxs(G,{value:j,children:[S,C]}),e[19]=S,e[20]=C,e[21]=j,e[22]=T):T=e[22],T}function Be(l){const e=w.c(16),{children:a,topbar:o}=l,t=U();if(t.isMobile){let r;return e[0]!==a||e[1]!==t.mobileSurface||e[2]!==o?(r=t.mobileSurface==="chat"?s.jsxs(z,{variant:"plain","data-slot":"chat-layout-thread",children:[o,s.jsx(z.Content,{"data-testid":"chat-panel",children:a})]}):null,e[0]=a,e[1]=t.mobileSurface,e[2]=o,e[3]=r):r=e[3],r}const i=t.threadOpen?"":void 0;let n;e[4]!==a||e[5]!==t.threadOpen||e[6]!==o?(n=t.threadOpen&&s.jsxs(s.Fragment,{children:[o,s.jsx(z.Content,{"data-testid":"chat-panel",children:a})]}),e[4]=a,e[5]=t.threadOpen,e[6]=o,e[7]=n):n=e[7];let u;e[8]!==n?(u=s.jsx("div",{className:"h-full min-h-0 p-0.5",children:s.jsx(z,{"data-testid":"side-panel",children:n})}),e[8]=n,e[9]=u):u=e[9];let c;e[10]!==i||e[11]!==u?(c=s.jsx(ie,{id:$,defaultSize:"33%",minSize:"20%",collapsible:!0,collapsedSize:"0%","data-chat-layout-panel-open":i,className:"min-w-0 overflow-hidden bg-sidebar",children:u}),e[10]=i,e[11]=u,e[12]=c):c=e[12];let d;e[13]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Se,{className:"bg-sidebar"}),e[13]=d):d=e[13];let h;return e[14]!==c?(h=s.jsxs(s.Fragment,{children:[c,d]}),e[14]=c,e[15]=h):h=e[15],h}function $e({children:l,routeId:e}){return l}function Y(l){const e=w.c(23),{children:a,actions:o,drawer:t,aside:i}=l,n=U();if(n.isMobile&&n.mobileSurface!=="main")return null;const u=n.isMobile?"plain":"card";let c;e[0]!==o||e[1]!==n.contentNavigation?(c=s.jsx(Ee,{navigation:n.contentNavigation,actions:o}),e[0]=o,e[1]=n.contentNavigation,e[2]=c):c=e[2];let d;e[3]!==a||e[4]!==n.contentKey?(d=s.jsx(Z,{children:s.jsx($e,{routeId:n.contentKey,children:a})}),e[3]=a,e[4]=n.contentKey,e[5]=d):d=e[5];let h;e[6]!==n.contentKey||e[7]!==d?(h=s.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:s.jsx(J,{children:d},n.contentKey)}),e[6]=n.contentKey,e[7]=d,e[8]=h):h=e[8];let r;e[9]!==t||e[10]!==h?(r=s.jsxs(z.Content,{children:[h,t]}),e[9]=t,e[10]=h,e[11]=r):r=e[11];let f;e[12]!==c||e[13]!==r?(f=s.jsxs(ae.Breadcrumbs.Provider,{children:[c,r]}),e[12]=c,e[13]=r,e[14]=f):f=e[14];let m;e[15]!==u||e[16]!==f?(m=s.jsx(z,{"data-testid":"main-panel",variant:u,children:f}),e[15]=u,e[16]=f,e[17]=m):m=e[17];const b=m;let x;return e[18]!==i||e[19]!==n.contentOpen||e[20]!==n.isMobile||e[21]!==b?(x=n.isMobile?b:s.jsx(ie,{id:F,defaultSize:"67%",minSize:"20%",collapsible:!0,collapsedSize:"0%","data-chat-layout-panel-open":n.contentOpen?"":void 0,className:"min-w-0 overflow-hidden bg-sidebar",children:s.jsxs("div",{className:"flex h-full min-h-0",children:[s.jsx("div",{className:"h-full min-h-0 min-w-0 flex-1 p-0.5",children:b}),i&&s.jsx("div",{className:"h-full min-h-0 w-[42%] min-w-80 shrink-0 p-0.5",children:s.jsx(z,{"data-testid":"aside-panel",children:s.jsx(J,{children:s.jsx(Z,{children:i})},D.isValidElement(i)?i.key??void 0:void 0)})})]})}),e[18]=i,e[19]=n.contentOpen,e[20]=n.isMobile,e[21]=b,e[22]=x):x=e[22],x}function De(){const l=w.c(1);let e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Y,{children:s.jsx(fe,{})}),l[0]=e):e=l[0],e}function Ae(l){const e=w.c(18),{error:a,reset:o}=l,t=se();let i;e[0]!==t?(i=t("common.errorBoundary.somethingWentWrong"),e[0]=t,e[1]=i):i=e[1];let n;e[2]!==i?(n=s.jsx("h2",{className:"text-lg font-medium",children:i}),e[2]=i,e[3]=n):n=e[3];let u;e[4]!==a.message||e[5]!==t?(u=a.message||t("common.errorBoundary.unexpectedError"),e[4]=a.message,e[5]=t,e[6]=u):u=e[6];let c;e[7]!==u?(c=s.jsx("p",{className:"max-w-lg whitespace-pre-wrap text-sm text-muted-foreground",children:u}),e[7]=u,e[8]=c):c=e[8];let d;e[9]!==t?(d=t("common.errorBoundary.tryAgain"),e[9]=t,e[10]=d):d=e[10];let h;e[11]!==o||e[12]!==d?(h=s.jsx(me,{variant:"outline",onClick:o,children:d}),e[11]=o,e[12]=d,e[13]=h):h=e[13];let r;return e[14]!==n||e[15]!==c||e[16]!==h?(r=s.jsx(Y,{children:s.jsxs("div",{role:"alert",className:"flex h-full flex-col items-center justify-center gap-4 p-6 text-center",children:[n,c,h]})}),e[14]=n,e[15]=c,e[16]=h,e[17]=r):r=e[17],r}const He=Object.assign(Ie,{Thread:Be,Content:Y}),Qe=Object.freeze(Object.defineProperty({__proto__:null,ChatLayout:He,ChatLayoutError:Ae,ChatLayoutPending:De,useChatLayout:ke,useOptionalChatLayout:oe},Symbol.toStringTag,{value:"Module"}));export{He as C,Ee as R,Qe as i,ke as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as ue,r as xe,d as ns,a4 as ht,b as Pe,j as t,B as je,t as dt,bu as Yt,ak as as,K as bt,i as Et,a5 as As,m as ot,gD as _s,o as cs,h as Ks,dY as Us,ab as Vs,L as qs,u as Hs,n as _t,E as Wt,R as Bs,dS as Js,hd as Gs,T as Qs,W as Ys,I as Xt}from"./index-
|
|
1
|
+
import{c as ue,r as xe,d as ns,a4 as ht,b as Pe,j as t,B as je,t as dt,bu as Yt,ak as as,K as bt,i as Et,a5 as As,m as ot,gD as _s,o as cs,h as Ks,dY as Us,ab as Vs,L as qs,u as Hs,n as _t,E as Wt,R as Bs,dS as Js,hd as Gs,T as Qs,W as Ys,I as Xt}from"./index-B0kMZVmC.js";import{S as Ws}from"./search-input-DfFZA2x_.js";import{E as Ht}from"./empty-state-DpGHzg8-.js";import{R as Xs}from"./require-capability-11VEza5N.js";import{f as js}from"./pair-BXQ1AL58.js";import{b as ts}from"./use-connection-jMnM0Hiq.js";import{g as Ps}from"./connection-slug-B8jXAB0J.js";import{B as Lt}from"./badge-C5mneqKN.js";import{P as ds,a as ms,b as us}from"./popover-CLUI-WCq.js";import{c as Pt,T as Dt,a as Rt,b as Zs}from"./tooltip-BTKQq4Sy.js";import{G as fs,e as Ut,bX as el,aO as Ns,a0 as tl}from"./agent-icon-BLhMgLPf.js";import{i as sl}from"./Key01-CqlMd8Tp.js";import{i as ll}from"./Play-DLBGORyf.js";import{MonacoCodeEditor as bs}from"./monaco-editor-GCVIle1A.js";import{u as rl}from"./use-mcp-client-Cp7itm-S.js";import{a as il}from"./repository-binding-DqsJn1Sb.js";import{n as Ot}from"./LinkBroken01-BrTHjhI6.js";import{c as ol}from"./SwitchHorizontal01-TvywMML0.js";import{s as nl}from"./Plus-D93afoay.js";import{s as al}from"./Trash01-DcgAZcrm.js";import{M as zt}from"./multi-select-sZG2voKq.js";import{b as yt,a as wt,c as ze,d as St,S as Ct}from"./select-B-QXEyVH.js";import{e as ys,T as cl}from"./time-range-picker-RqJkhR4f.js";import{T as dl}from"./textarea-BDeCVCG_.js";import{C as Ds}from"./collection-tabs-81bsUeqm.js";import{S as ml}from"./switch-YFmb691t.js";import{L as ul}from"./label-C8wqUUzx.js";import{I as It}from"./integration-icon-BNTOj8TI.js";import{A as fl,a as xl,b as pl}from"./alert-B5Ykyt3T.js";import{K as gt}from"./monitoring-stats-row-h4pC7kD6.js";import{b as Bt}from"./use-entitlements-D0Sb8QlP.js";import{g as gl,b as ws,f as Nt,c as Zt,d as hl,e as Ss,a as xs,h as vl,i as ps,T as jl,j as Nl,r as bl,k as yl}from"./thread-sheet-body-De3nDIYw.js";import{u as wl}from"./useSuspenseInfiniteQuery-BJmR9zYx.js";import{c as Sl,S as Cl,b as Rs,a as Ls}from"./sheet-DFpCUkzK.js";import{c as _e,b as vt,d as Jt,e as Gt,T as ge,a as Qt}from"./table-EoWRqCf0.js";import{n as ss,t as ls}from"./ChevronUp-DJytO9gL.js";import{u as Os}from"./use-id-selection-Cpsai2fK.js";import{u as Fs}from"./use-infinite-scroll-C-wdmvlm.js";import{u as Il}from"./useInfiniteQuery-BLIxG3uZ.js";import{g as Tl}from"./task-status-e2bwwrq0.js";import{u as kl,d as Ml}from"./use-automations-CRCU5rUU.js";import{A as _l}from"./automation-runs-Bq3l9enC.js";import{i as Pl}from"./ArrowLeft-XFXQyKrg.js";import{E as Cs}from"./empty-state-wwy36dTA.js";import{O as $s}from"./watch-sse-pool-DDOa1h_t.js";import{t as Dl}from"./task-key-BCHdFiOO.js";import{b as Rl,r as Ll,O as Ol,e as Fl}from"./order-monitor-day-DEpjybnZ.js";import{F as $l}from"./feature-gate-CveHfcPr.js";import"./SearchMd-BMSOzTwj.js";import"./access-gate-pZVUht52.js";import"./capability-load-error-DCozEloC.js";import"./Tool01-BR0iTy6Z.js";import"./collapsible-DdHbUgH7.js";import"./use-copy-B36-QB7R.js";import"./usage-stats-LrxjpMvT.js";import"./tool-namespace-pd4DYce0.js";import"./form-Bz_uprQc.js";import"./utils-CVEq3hMx.js";import"./markdown-ChQfidu_.js";import"./chat-context-BOjsomdh.js";import"./use-view-draft-kind-BTxfGo3P.js";import"./thread-route-tkHuy51W.js";import"./use-project-scope-BpnU42cL.js";import"./use-organization-settings-C44OxrrF.js";import"./schema-CMu2qDHJ.js";import"./task-board-CjAeUa_m.js";import"./thread-intent-oRL32U-K.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./use-ai-providers-BnCLnm6i.js";import"./use-decopilot-events-144aPqKs.js";import"./use-mobile-CMr55W3O.js";import"./shell-layout-3tQDWFJU.js";import"./Globe04-B6PnEpLB.js";import"./UserSquare-dl1oayK_.js";import"./use-deployment-admin-CK9MBH_P.js";import"./admin-fetch-BhTJlAsX.js";import"./XClose-DN30jgS9.js";import"./CheckCircle-D_eKfCyb.js";import"./Monitor01-CNesz7Zi.js";import"./Zap-C1Evk-yy.js";import"./command-woRMyGZF.js";import"./index-DE9SDic3.js";import"./project-icon-BkeJc-xp.js";import"./use-navigate-to-agent-Bc47TXuM.js";import"./use-debounced-value-Be2K3Tgl.js";import"./new-project-dialog-B8ntXRJU.js";import"./repository-picker-DjmqKxQp.js";import"./github-icon-CR8sfoo5.js";import"./collection-search-CwqvBBm4.js";import"./BookOpen01-BPEekJOY.js";import"./ShoppingBag01-BjOh6InC.js";import"./legacy-admin-welcome-dialog-5GoRU8S5.js";import"./drawer-BBqyYfPx.js";import"./required-auth-layout-CnCT_9Qk.js";import"./use-org-sso-Dx6waIv3.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-Cqipo_fr.js";import"./types-DD9MvS2H.js";import"./omit-server-managed-metadata-L5IhjRZB.js";import"./AlertCircle-CTbjWy6O.js";import"./use-mcp-prompts-CF2bE4L8.js";import"./use-thread-outputs-BT9YWT4X.js";import"./file-type-icon-hPTLm32j.js";import"./index-2LsnM_Ir.js";import"./ArrowUp-BGhmN6Zx.js";import"./ChevronSelectorVertical-B8yNz6I1.js";import"./CreditCard01-D8vcOfs6.js";import"./Minus-O-Diijsb.js";import"./Sun-Dwiv3SBK.js";import"./Upload01-C4wCuUx0.js";import"./Users01-Bfq6gAwi.js";import"./editor-D97Qyzcp.js";import"./auth-U9K5aFal.js";import"./checkbox-Bv8PV_aY.js";import"./index-BdQq_4o_.js";import"./scroll-area-CNyj4Q1_.js";import"./calendar-DbxCxf92.js";import"./chart-Cy7LFFBX.js";import"./CategoricalChart-BaZiYgxE.js";import"./index-CguuJrFu.js";import"./tooltipContext-B3whzr3K.js";import"./CartesianChart-CyLm4xQH.js";import"./AreaChart-DwuVDkrD.js";import"./infiniteQueryObserver-Bpp7Nde9.js";import"./useQueries-M4myONOE.js";import"./ReferenceLine-DP5lPOEm.js";import"./feature-paywall-DFIdKSLH.js";import"./plan-ladder-B0kBPdzm.js";const rs={maxJsonRenderSize:5e4,pageSize:50,streamingRefetchInterval:3e3},zl=["eq","contains","exists","in"];function El(s){return zl.includes(s)}function jt(s){return s.filter(e=>e.key.trim()).map(e=>{const l=encodeURIComponent(e.key.trim()),i=encodeURIComponent(e.value||"");return`${l}:${e.operator}:${i}`}).join(",")}function Al(s){return!s||typeof s!="string"?[]:s.split(",").map(e=>{if(!e)return;const[l,i,...m]=e.split(":"),n=l?decodeURIComponent(l):"";if(n.trim())return{key:n,operator:i&&El(i)?i:"eq",value:decodeURIComponent(m.join(":")||"")}}).filter(e=>e!==void 0)}function Vt(s){return s.filter(e=>e.key.trim()).map(e=>{switch(e.operator){case"eq":return`${e.key}=${e.value}`;case"contains":return`${e.key}~${e.value}`;case"exists":return`${e.key}?`;case"in":return`${e.key}@${e.value}`}}).join(`
|
|
2
2
|
`)}function Is(s){return s.trim()?s.split(`
|
|
3
3
|
`).map(e=>e.trim()).filter(e=>e.length>0).map(e=>{if(e.endsWith("?"))return{key:e.slice(0,-1),operator:"exists",value:""};if(e.includes("=")){const[l,...i]=e.split("=");return{key:l||"",operator:"eq",value:i.join("=")}}if(e.includes("~")){const[l,...i]=e.split("~");return{key:l||"",operator:"contains",value:i.join("~")}}if(e.includes("@")){const[l,...i]=e.split("@");return{key:l||"",operator:"in",value:i.join("@")}}return{key:e,operator:"exists",value:""}}):[]}function Kl(s){const e={},l={},i=[],m={};for(const n of s)if(n.key.trim())switch(n.operator){case"eq":n.value&&(e[n.key]=n.value);break;case"contains":n.value&&(l[n.key]=`%${n.value}%`);break;case"exists":i.push(n.key);break;case"in":n.value&&(m[n.key]=n.value);break}return{properties:Object.keys(e).length>0?e:void 0,propertyPatterns:Object.keys(l).length>0?l:void 0,propertyKeys:i.length>0?i:void 0,propertyInValues:Object.keys(m).length>0?m:void 0}}function Ts(s){if(!s)return{content:"null",isTruncated:!1,originalSize:4};const e=s._decocms_truncated;if(typeof e=="string"&&e.length>0)return{content:e,isTruncated:!0,originalSize:e.length};let l;try{l=JSON.stringify(s,null,2)}catch{return{content:"[Unable to serialize JSON]",isTruncated:!1,originalSize:0}}const i=l.length;return i<=rs.maxJsonRenderSize?{content:l,isTruncated:!1,originalSize:i}:{content:l.slice(0,rs.maxJsonRenderSize)+`
|
|
4
4
|
|