decocms 2.306.4 → 2.306.6
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-BVeHzXW5.js → AlertCircle-4Fij-rVg.js} +1 -1
- package/dist/client/assets/{ArrowNarrowLeft-C2P2KRPF.js → ArrowNarrowLeft-CxNzupMt.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-CK9uu0-D.js → ArrowUpRight-B9s_0HcJ.js} +1 -1
- package/dist/client/assets/{Check-Bn17wiie.js → Check-DC_iCN8Z.js} +1 -1
- package/dist/client/assets/{CheckCircle-K_j4V2mi.js → CheckCircle-ROoANe3f.js} +1 -1
- package/dist/client/assets/{ChevronDown-CCx3l_zh.js → ChevronDown-CnUhTqwX.js} +1 -1
- package/dist/client/assets/{ChevronRight-BFX3SRVD.js → ChevronRight-X2lm_E9M.js} +1 -1
- package/dist/client/assets/{ChevronUp-ClgBv1-5.js → ChevronUp-CgOfWCZA.js} +1 -1
- package/dist/client/assets/{Container-hEu0LbRx.js → Container-BrskPoE3.js} +1 -1
- package/dist/client/assets/{DotsVertical-lhZhn-05.js → DotsVertical-C2-ev8jy.js} +1 -1
- package/dist/client/assets/{LinkExternal01-DnFFYVv0.js → LinkExternal01-Bhhv-wHj.js} +1 -1
- package/dist/client/assets/{Lock01-B2ZDxQ2O.js → Lock01-KbqVCyA7.js} +1 -1
- package/dist/client/assets/{Palette-JDIBaFVX.js → Palette-CmZGtCez.js} +1 -1
- package/dist/client/assets/{Play-DgV9fPBn.js → Play-EPgISV5B.js} +1 -1
- package/dist/client/assets/{Plus-CC-cb8af.js → Plus-BYimMcAW.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-Dtm565ax.js → RefreshCcw01-DIY3NFBI.js} +1 -1
- package/dist/client/assets/{SearchMd-DhuTOkMM.js → SearchMd-DzMVdOJP.js} +1 -1
- package/dist/client/assets/{Settings02-U10Pi2U6.js → Settings02-BxmxMTOA.js} +1 -1
- package/dist/client/assets/{Shield01-BIPlYgtf.js → Shield01-B9vNkAc4.js} +1 -1
- package/dist/client/assets/{Star01-BQbW3c7S.js → Star01-iULH34rV.js} +1 -1
- package/dist/client/assets/{Sun-DejP2-9n.js → Sun-Dc78AQrj.js} +1 -1
- package/dist/client/assets/{Tool01-BJ2-pI1A.js → Tool01-DVcjHQGB.js} +1 -1
- package/dist/client/assets/{Trash01-Diaa7rgk.js → Trash01-CaZrP0UV.js} +1 -1
- package/dist/client/assets/{User01-D16UA2Si.js → User01-7U7nAEDg.js} +1 -1
- package/dist/client/assets/{Users03-CNLT4iFx.js → Users03-CIZBy7k3.js} +1 -1
- package/dist/client/assets/{X-CcpHqq2x.js → X-QdBx5oCM.js} +1 -1
- package/dist/client/assets/{XCircle-cbWH1EQO.js → XCircle-DokNvYvs.js} +1 -1
- package/dist/client/assets/{XClose-CY2dTc5U.js → XClose-BdbZPqCd.js} +1 -1
- package/dist/client/assets/{Zap-vGQbOM1l.js → Zap-DH1KrJ0w.js} +1 -1
- package/dist/client/assets/{ZapSquare-csc63uU1.js → ZapSquare-CnxL4Bs1.js} +1 -1
- package/dist/client/assets/{accordion-CDZyqEhI.js → accordion-81SrnINF.js} +1 -1
- package/dist/client/assets/{agent-icon-CKJvbkVv.js → agent-icon-C2zAhw3X.js} +1 -1
- package/dist/client/assets/{agents-list-1iolV9zJ.js → agents-list-CH2sTwpj.js} +1 -1
- package/dist/client/assets/ai-providers-BxrN55-q.js +1 -0
- package/dist/client/assets/{alert-dialog-ZtmnRyl1.js → alert-dialog-BytOwrWo.js} +1 -1
- package/dist/client/assets/{auth-catchall-DQe9zsv6.js → auth-catchall-BcUDEqD5.js} +1 -1
- package/dist/client/assets/{automation-list-row-BSwjOToq.js → automation-list-row-etrXhG1_.js} +1 -1
- package/dist/client/assets/{automations-9u7mZ4QZ.js → automations-DFRPWAOO.js} +1 -1
- package/dist/client/assets/{avatar-zFo-RihM.js → avatar-D0sdobqD.js} +1 -1
- package/dist/client/assets/{badge-e7cq4wYv.js → badge-tvsCFCHP.js} +1 -1
- package/dist/client/assets/{brand-context-CLbcMKjn.js → brand-context-Cy-kcB0m.js} +1 -1
- package/dist/client/assets/{card-DWnlPW06.js → card-BGZ5LqAO.js} +1 -1
- package/dist/client/assets/{chat-context-BBJWCKaD.js → chat-context-iq-Q-O9L.js} +1 -1
- package/dist/client/assets/{checkbox-DoVlL246.js → checkbox-IEnuEqAm.js} +1 -1
- package/dist/client/assets/{collection-detail-BOHQu3-F.js → collection-detail-BnoKU_uS.js} +1 -1
- package/dist/client/assets/{collection-display-button-CNNaQLXZ.js → collection-display-button-tJsvfx8o.js} +1 -1
- package/dist/client/assets/{collection-search-DQFkaere.js → collection-search-O8QAretn.js} +1 -1
- package/dist/client/assets/{collection-search-Dz8EwXQZ.js → collection-search-bjPRZI3g.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-CcEDyR1b.js → collection-table-wrapper-CcyIZki9.js} +1 -1
- package/dist/client/assets/{collection-tabs-9Pju8JPc.js → collection-tabs-CqINIlN4.js} +1 -1
- package/dist/client/assets/{collections-yePzr7Vo.js → collections-DKW_jlNs.js} +1 -1
- package/dist/client/assets/{command-BCic1xjY.js → command-Cbi8R9Tg.js} +1 -1
- package/dist/client/assets/{connection-card-B0dNH0iV.js → connection-card-Aj-8CWhX.js} +1 -1
- package/dist/client/assets/{connection-detail-BJNTgOwZ.js → connection-detail-G5l6bgwi.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-BbVz-xaK.js → connection-form-helpers-hlnQqQXV.js} +1 -1
- package/dist/client/assets/{connections-BYasVx0l.js → connections-CrOLesap.js} +1 -1
- package/dist/client/assets/{constants-Bx4zZlUX.js → constants-CWAA475A.js} +1 -1
- package/dist/client/assets/{constants-BnMb7TNK.js → constants-Dm1wnwL3.js} +1 -1
- package/dist/client/assets/{dialog-DlCT-WoK.js → dialog-0SvGB_9G.js} +1 -1
- package/dist/client/assets/{domain-settings-DfWm-jri.js → domain-settings-CckaLtjm.js} +1 -1
- package/dist/client/assets/{drawer-BcjhGJPV.js → drawer-CyXE-C5x.js} +1 -1
- package/dist/client/assets/{dropdown-menu-CqMcZJzJ.js → dropdown-menu-BkrpBFy3.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-BHmC-i3E.js → dynamic-plugin-layout-DAf8nhzs.js} +1 -1
- package/dist/client/assets/{empty-state-ZdvVUypD.js → empty-state-Crsog8CF.js} +1 -1
- package/dist/client/assets/{empty-state-g7JZH7nI.js → empty-state-CxZybw5m.js} +1 -1
- package/dist/client/assets/{extract-connection-data-V6uho3MU.js → extract-connection-data-CnUKkwJT.js} +1 -1
- package/dist/client/assets/{features-HK9-kqo_.js → features-Ddtjf7i2.js} +1 -1
- package/dist/client/assets/{form-Bz8GUOy4.js → form-BMjsxf1O.js} +1 -1
- package/dist/client/assets/{general-CzhgQzmN.js → general-CVe1Krdt.js} +1 -1
- package/dist/client/assets/{index-C8d4iNkJ.js → index-AqmdpH5c.js} +1 -1
- package/dist/client/assets/{index-DfBYDDUd.js → index-B8A_ReFj.js} +1 -1
- package/dist/client/assets/{index-BiwSMF-y.js → index-BV4BlnS9.js} +2 -2
- package/dist/client/assets/index-Bhv1nOmU.js +1 -0
- package/dist/client/assets/{index-BfMLUnDV.js → index-CEyiW6G-.js} +1 -1
- package/dist/client/assets/{index-BJyj20OY.js → index-CPDZUQ3g.js} +1 -1
- package/dist/client/assets/{index-BLcDLcVA.js → index-CYY5hWbm.js} +1 -1
- package/dist/client/assets/{index-C52EJPiC.js → index-CZ5qFDIg.js} +1 -1
- package/dist/client/assets/{index-Cge-ppRk.js → index-CyJ-TyKU.js} +1 -1
- package/dist/client/assets/{index-DmUuSwi5.js → index-D85QLvNR.js} +1 -1
- package/dist/client/assets/{index-qPq642HU.js → index-DYUyKEVO.js} +1 -1
- package/dist/client/assets/{index-DIfp1lEQ.js → index-DusASzPG.js} +4 -4
- package/dist/client/assets/{index-CFIHNl5s.js → index-DvCRkopi.js} +1 -1
- package/dist/client/assets/{index-IQKcn_Q9.js → index-WBXV3t9A.js} +1 -1
- package/dist/client/assets/{index-CA9kxx2H.js → index-hSAfwkZQ.js} +1 -1
- package/dist/client/assets/{index-mh337hn4.js → index-tIIHK8_r.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-DjjliL3G.js → infiniteQueryObserver-DmPvCV47.js} +1 -1
- package/dist/client/assets/{input-OXmAT-db.js → input-Bs7mkNsF.js} +1 -1
- package/dist/client/assets/{integration-icon-R4Bf_BtR.js → integration-icon-DgJZ63kl.js} +1 -1
- package/dist/client/assets/{label-u11WxqKS.js → label-CB1YxmGr.js} +1 -1
- package/dist/client/assets/{layout-BBQfzLrY.js → layout-GReGu88m.js} +1 -1
- package/dist/client/assets/{lean-canvas-recruit-modal-CNAftz7l.js → lean-canvas-recruit-modal-BkH3ZJD2.js} +1 -1
- package/dist/client/assets/{login-D89hffSU.js → login-JiD1cfP5.js} +1 -1
- package/dist/client/assets/{members-BtnGYesQ.js → members-B72381x1.js} +1 -1
- package/dist/client/assets/{monaco-editor-CbHwzfZK.js → monaco-editor-_r7N6eV-.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-DL-xrM3g.js → monitoring-stats-row-IV0nDqiB.js} +1 -1
- package/dist/client/assets/{oauth-callback-Cd1gXNOv.js → oauth-callback-CkFjLbE_.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-DIh7l460.js → oauth-callback-ai-provider-By5VSIqz.js} +1 -1
- package/dist/client/assets/{onboarding-DTh2AOHR.js → onboarding-CCZiORGK.js} +1 -1
- package/dist/client/assets/{org-layout-HNPVlgjL.js → org-layout-DF3EY572.js} +1 -1
- package/dist/client/assets/{org-plugin-layout-CsuWyjoh.js → org-plugin-layout-C4CnG2ku.js} +1 -1
- package/dist/client/assets/{pair-DH2MBWb8.js → pair-Hj9vutgK.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-6oVaErxP.js → plugin-empty-state-DtiwhoNI.js} +1 -1
- package/dist/client/assets/{plugin-header-6NaCrPJJ.js → plugin-header-CjcXnInr.js} +1 -1
- package/dist/client/assets/{plugin-layout-joz6qwbQ.js → plugin-layout-BJ0qU511.js} +1 -1
- package/dist/client/assets/{popover-BnBY-ecH.js → popover-9-i1guS1.js} +1 -1
- package/dist/client/assets/{profile-CtmYFgP6.js → profile-C0pKX75D.js} +1 -1
- package/dist/client/assets/{project-app-view-B09jGIHR.js → project-app-view-Btui0VFM.js} +1 -1
- package/dist/client/assets/registry-Bhz5Jlkf.js +2 -0
- package/dist/client/assets/{registry-layout-BkbzhpWl.js → registry-layout-Cvjuv72f.js} +1 -1
- package/dist/client/assets/{required-auth-layout-f-OWQyso.js → required-auth-layout-Cm0GjYeR.js} +1 -1
- package/dist/client/assets/{reset-password-FDUiQSjd.js → reset-password-DHyMDEUg.js} +1 -1
- package/dist/client/assets/{roles-AXX2LOzG.js → roles-BRZ0jwUp.js} +1 -1
- package/dist/client/assets/{scroll-area-PF9KCzsE.js → scroll-area-Dal58SLb.js} +1 -1
- package/dist/client/assets/{search-input-uAtFXE8w.js → search-input-BSfMPrXv.js} +1 -1
- package/dist/client/assets/{select-BuVZhDrk.js → select-DQy3AX-J.js} +1 -1
- package/dist/client/assets/{select-model-D4DeKOfs.js → select-model-BjvpQUyU.js} +1 -1
- package/dist/client/assets/{settings-layout-EeX5xzLc.js → settings-layout-Hke-qhRP.js} +1 -1
- package/dist/client/assets/{settings-section-CQDWNPzr.js → settings-section-DJf4hau9.js} +1 -1
- package/dist/client/assets/{shell-layout-D17mMuCF.js → shell-layout-BcsYrOTT.js} +1 -1
- package/dist/client/assets/{skeleton-C-txqNNd.js → skeleton-DLT024S3.js} +1 -1
- package/dist/client/assets/{sso-hmmbmdqG.js → sso-BuTvljxJ.js} +1 -1
- package/dist/client/assets/{store-Lj2GUth4.js → store-Iw0YIysI.js} +1 -1
- package/dist/client/assets/store-registry-Df9fj_hE.js +2 -0
- package/dist/client/assets/{switch-Brhcq0DC.js → switch-ChOgiOZl.js} +1 -1
- package/dist/client/assets/{table-DLzmgIsQ.js → table-B48Xy50A.js} +1 -1
- package/dist/client/assets/{tabs-C5IW3J1n.js → tabs-y647ki3a.js} +1 -1
- package/dist/client/assets/{task-status-BmzVznbV.js → task-status-IiU7o7it.js} +1 -1
- package/dist/client/assets/{textarea-95EjEE1J.js → textarea-CT4UCcWE.js} +1 -1
- package/dist/client/assets/{toggle-group-DHQ9rH2_.js → toggle-group-CgDVnjbj.js} +1 -1
- package/dist/client/assets/{tools-list-BzU5CsfJ.js → tools-list-Dl1EqLq_.js} +1 -1
- package/dist/client/assets/{tooltip-DFWLC8HI.js → tooltip-DZT-1bal.js} +1 -1
- package/dist/client/assets/{types-7ra6QiRz.js → types-DA7k1cs0.js} +1 -1
- package/dist/client/assets/{use-ai-providers-Br4G2Pkq.js → use-ai-providers-Bv-kgplO.js} +1 -1
- package/dist/client/assets/{use-collections-CKusz5eG.js → use-collections-ASqcb463.js} +1 -1
- package/dist/client/assets/{use-connection-Bv5BZ_xw.js → use-connection-Ck4brnCx.js} +1 -1
- package/dist/client/assets/{use-copy-CK5UVkzb.js → use-copy-qtJD_4jj.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-CaBr-o8K.js → use-create-virtual-mcp-CTxthd0a.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-eWigQGND.js → use-debounced-autosave-BliXkuEQ.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-BriMHUkB.js → use-decopilot-events-tgKj5crX.js} +1 -1
- package/dist/client/assets/{use-delete-connection-BRkDKb4C.js → use-delete-connection-DM_4FfQI.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-Cnzq4lxC.js → use-infinite-scroll-De_3UNjO.js} +1 -1
- package/dist/client/assets/{use-list-state-D_lZ7Las.js → use-list-state-SVk88wog.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-D2vgr_Sh.js → use-mcp-tools-rNZ6JWxz.js} +1 -1
- package/dist/client/assets/{use-members-Dzj5dzc5.js → use-members-Bk-c46d0.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-C33-q43R.js → use-navigate-to-agent-CwcBoswU.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-DV3Be7SP.js → use-org-auth-client-Hwc_S6Fw.js} +1 -1
- package/dist/client/assets/{use-org-sso-BqE4d3Cy.js → use-org-sso-Cj1DBVz0.js} +1 -1
- package/dist/client/assets/{use-organization-roles-eC7wUBMu.js → use-organization-roles--8BRYJrg.js} +1 -1
- package/dist/client/assets/{use-organization-settings--hTe5DrU.js → use-organization-settings-gFwljgrZ.js} +1 -1
- package/dist/client/assets/{use-registry-connections-C4d-mohe.js → use-registry-connections-Dgb2TDlG.js} +1 -1
- package/dist/client/assets/{use-status-sounds-Bzvn75VV.js → use-status-sounds-Cn3fBsPH.js} +1 -1
- package/dist/client/assets/{use-tasks-EGX2u9Ho.js → use-tasks-DqNLNkkM.js} +1 -1
- package/dist/client/assets/{use-view-mode-DHIMRupW.js → use-view-mode-D9kCRFMC.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-B3LT7MVT.js → use-virtual-mcp-BR6mzHHD.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-C_BkERX4.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-DFnwwxGS.js +1 -0
- package/dist/client/assets/{user-Jrd4wxvT.js → user-BVu9y1Y7.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-BovL7cZv.js → view-mode-toggle-ZI-MN1pO.js} +1 -1
- package/dist/client/assets/{workflow-1BB3erFr.js → workflow-D5sDlQLV.js} +1 -1
- package/dist/client/assets/workflow-detail-BKMBH1Ij.js +1 -0
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +51 -39
- package/dist/server/node_modules/ansi-styles/index.d.ts +236 -0
- package/dist/server/node_modules/ansi-styles/index.js +223 -0
- package/dist/server/node_modules/{ansi-regex → ansi-styles}/package.json +13 -20
- package/dist/server/node_modules/ansi-styles/readme.md +173 -0
- package/dist/server/node_modules/environment/index.d.ts +74 -0
- package/dist/server/node_modules/environment/index.js +47 -0
- package/dist/server/node_modules/environment/package.json +74 -0
- package/dist/server/node_modules/environment/readme.md +94 -0
- package/dist/server/node_modules/escape-string-regexp/index.d.ts +18 -0
- package/dist/server/node_modules/escape-string-regexp/index.js +11 -0
- package/dist/server/node_modules/escape-string-regexp/license +9 -0
- package/dist/server/node_modules/escape-string-regexp/package.json +43 -0
- package/dist/server/node_modules/escape-string-regexp/readme.md +29 -0
- package/dist/server/node_modules/get-east-asian-width/index.d.ts +60 -0
- package/dist/server/node_modules/get-east-asian-width/index.js +30 -0
- package/dist/server/node_modules/get-east-asian-width/license +9 -0
- package/dist/server/node_modules/get-east-asian-width/lookup-data.js +18 -0
- package/dist/server/node_modules/get-east-asian-width/lookup.js +135 -0
- package/dist/server/node_modules/get-east-asian-width/package.json +71 -0
- package/dist/server/node_modules/get-east-asian-width/readme.md +65 -0
- package/dist/server/node_modules/get-east-asian-width/utilities.js +24 -0
- package/dist/server/node_modules/is-fullwidth-code-point/index.d.ts +17 -0
- package/dist/server/node_modules/is-fullwidth-code-point/index.js +12 -0
- package/dist/server/node_modules/is-fullwidth-code-point/license +9 -0
- package/dist/server/node_modules/is-fullwidth-code-point/package.json +53 -0
- package/dist/server/node_modules/is-fullwidth-code-point/readme.md +31 -0
- package/dist/server/node_modules/is-unicode-supported/index.d.ts +12 -0
- package/dist/server/node_modules/is-unicode-supported/index.js +21 -0
- package/dist/server/node_modules/is-unicode-supported/license +9 -0
- package/dist/server/node_modules/is-unicode-supported/package.json +47 -0
- package/dist/server/node_modules/is-unicode-supported/readme.md +35 -0
- package/dist/server/node_modules/pg/LICENSE +21 -0
- package/dist/server/node_modules/pg/README.md +95 -0
- package/dist/server/node_modules/pg/esm/index.mjs +20 -0
- package/dist/server/node_modules/pg/lib/client.js +743 -0
- package/dist/server/node_modules/pg/lib/connection-parameters.js +171 -0
- package/dist/server/node_modules/pg/lib/connection.js +221 -0
- package/dist/server/node_modules/pg/lib/crypto/cert-signatures.js +122 -0
- package/dist/server/node_modules/pg/lib/crypto/sasl.js +212 -0
- package/dist/server/node_modules/pg/lib/crypto/utils-legacy.js +43 -0
- package/dist/server/node_modules/pg/lib/crypto/utils-webcrypto.js +89 -0
- package/dist/server/node_modules/pg/lib/crypto/utils.js +9 -0
- package/dist/server/node_modules/pg/lib/defaults.js +91 -0
- package/dist/server/node_modules/pg/lib/index.js +73 -0
- package/dist/server/node_modules/pg/lib/native/client.js +323 -0
- package/dist/server/node_modules/pg/lib/native/index.js +2 -0
- package/dist/server/node_modules/pg/lib/native/query.js +165 -0
- package/dist/server/node_modules/pg/lib/query.js +252 -0
- package/dist/server/node_modules/pg/lib/result.js +109 -0
- package/dist/server/node_modules/pg/lib/stream.js +83 -0
- package/dist/server/node_modules/pg/lib/type-overrides.js +35 -0
- package/dist/server/node_modules/pg/lib/utils.js +217 -0
- package/dist/server/node_modules/pg/package.json +76 -0
- package/dist/server/node_modules/restore-cursor/index.d.ts +11 -0
- package/dist/server/node_modules/restore-cursor/index.js +11 -0
- package/dist/server/node_modules/restore-cursor/license +9 -0
- package/dist/server/node_modules/restore-cursor/package.json +55 -0
- package/dist/server/node_modules/restore-cursor/readme.md +31 -0
- package/dist/server/node_modules/string-width/index.d.ts +39 -0
- package/dist/server/node_modules/string-width/index.js +82 -0
- package/dist/server/node_modules/string-width/license +9 -0
- package/dist/server/node_modules/string-width/package.json +64 -0
- package/dist/server/node_modules/string-width/readme.md +66 -0
- package/dist/server/node_modules/xtend/.jshintrc +30 -0
- package/dist/server/node_modules/xtend/LICENSE +20 -0
- package/dist/server/node_modules/xtend/README.md +32 -0
- package/dist/server/node_modules/xtend/immutable.js +19 -0
- package/dist/server/node_modules/xtend/mutable.js +17 -0
- package/dist/server/node_modules/xtend/package.json +55 -0
- package/dist/server/node_modules/xtend/test.js +103 -0
- package/dist/server/server.js +50 -38
- package/package.json +1 -1
- package/dist/client/assets/ai-providers-CLVIn9On.js +0 -1
- package/dist/client/assets/index-Cq41MHaG.js +0 -1
- package/dist/client/assets/registry-DLerPaT8.js +0 -2
- package/dist/client/assets/store-registry-DfccLKYW.js +0 -2
- package/dist/client/assets/useInfiniteQuery-DMvdj92C.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DvuEMs0T.js +0 -1
- package/dist/client/assets/workflow-detail-S6LXEKGk.js +0 -1
- package/dist/server/node_modules/ansi-regex/index.d.ts +0 -33
- package/dist/server/node_modules/ansi-regex/index.js +0 -14
- package/dist/server/node_modules/ansi-regex/readme.md +0 -66
- package/dist/server/node_modules/emoji-regex/LICENSE-MIT.txt +0 -20
- package/dist/server/node_modules/emoji-regex/README.md +0 -107
- package/dist/server/node_modules/emoji-regex/index.d.ts +0 -3
- package/dist/server/node_modules/emoji-regex/index.js +0 -4
- package/dist/server/node_modules/emoji-regex/index.mjs +0 -4
- package/dist/server/node_modules/emoji-regex/package.json +0 -45
- package/dist/server/node_modules/onetime/index.d.ts +0 -64
- package/dist/server/node_modules/onetime/index.js +0 -44
- package/dist/server/node_modules/onetime/package.json +0 -43
- package/dist/server/node_modules/onetime/readme.md +0 -94
- /package/dist/server/node_modules/{ansi-regex → ansi-styles}/license +0 -0
- /package/dist/server/node_modules/{onetime → environment}/license +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as C,s as pe,f as ve,U as It,g as We,d as qe,W as ys,X as _s,Y as Ss,j as n,Z as Cs,c as J,t as se,r as b,$ as Mt,a0 as $t,H as Ns,J as ks,C as ws,z as Is,a as Ms,B as et,b as Se,a1 as $s,P as Tt,x as je,a2 as Ts,a3 as As,o as Re,a4 as Ps,a5 as Os,a6 as zs,a7 as Rs,a8 as Oe,a9 as Es,aa as Ds,ab as Ls,ac as Fs,ad as At,ae as Us,af as Gs,ag as Bs,ah as Hs,ai as Vs,aj as Ks,ak as Ws,al as qs,am as Qs,an as Ys,ao as Ee,L as Xs,E as it,K as Pt}from"./index-BiwSMF-y.js";import{p as Js,g as Zs,C as en,D as mt,E as ft,F as tn,G as xt,H as sn,A as Pe,I as nn,k as on,J as rn,K as ln}from"./agent-icon-CKJvbkVv.js";import{i as an,f as De,g as Le,h as ge,u as Qe,j as he,k as ie,l as Ot,m as zt,n as cn,o as Rt,p as Et}from"./index-C8d4iNkJ.js";import{u as Dt,r as Lt}from"./shell-layout-D17mMuCF.js";import{f as dn,g as un,h as mn}from"./pair-DH2MBWb8.js";import{S as Ve}from"./skeleton-C-txqNNd.js";import{b as lt,P as at,a as ct}from"./popover-BnBY-ecH.js";import{b as Ft,a as Ut,D as Gt}from"./drawer-BcjhGJPV.js";import{A as pt}from"./avatar-zFo-RihM.js";import{u as Bt,a as tt,b as st,c as ht,T as nt}from"./tooltip-DFWLC8HI.js";import{i as Ht}from"./Check-Bn17wiie.js";import{c as gt,a as fn,e as xn}from"./XCircle-cbWH1EQO.js";import{i as pn,b as hn,n as gn}from"./ZapSquare-csc63uU1.js";import{n as bn,a as jn,i as vn}from"./Sun-DejP2-9n.js";import{s as Ke}from"./Plus-CC-cb8af.js";import{a as Ye}from"./Settings02-U10Pi2U6.js";import{i as yn}from"./Shield01-BIPlYgtf.js";import{a as Vt}from"./Users03-CNLT4iFx.js";import{f as _n,a as Sn,b as Cn,c as Nn,d as kn,e as wn,A as In}from"./alert-dialog-ZtmnRyl1.js";import{F as Mn,a as $n,b as Tn,c as An,d as Pn,e as On,f as zn}from"./form-Bz8GUOy4.js";import{I as Rn}from"./input-OXmAT-db.js";import{S as En}from"./index-DfBYDDUd.js";import"./index-BfMLUnDV.js";import{s as Dn}from"./XClose-CY2dTc5U.js";import{S as Kt,u as Wt,W as ze,i as Ln,b as Fn}from"./constants-BnMb7TNK.js";import{u as Un}from"./use-mcp-tools-D2vgr_Sh.js";import{u as Gn}from"./use-ai-providers-Br4G2Pkq.js";import{A as Bn,b as Hn,S as Vn,c as Kn,d as Wn,C as qn}from"./index-DmUuSwi5.js";import{u as Qn,a as bt,K as Yn,P as Xn,S as Jn,v as Zn,D as eo,c as to,s as so,b as no,d as oo,C as ro,e as io}from"./collection-search-Dz8EwXQZ.js";import{i as jt}from"./X-CcpHqq2x.js";import{b as qt,u as Qt}from"./use-virtual-mcp-B3LT7MVT.js";import{u as Yt,a as lo}from"./use-navigate-to-agent-C33-q43R.js";import{u as ao}from"./use-create-virtual-mcp-CaBr-o8K.js";import{I as co,a as uo,S as mo,L as fo,b as xo,G as po}from"./lean-canvas-recruit-modal-CNAftz7l.js";import{u as Xt}from"./use-tasks-EGX2u9Ho.js";import{e as ot,f as ho}from"./chat-context-BBJWCKaD.js";import{i as go}from"./ChevronRight-BFX3SRVD.js";import{E as bo}from"./empty-state-ZdvVUypD.js";import{u as jo}from"./use-decopilot-events-BriMHUkB.js";import{g as Jt,a as vt,b as yt,h as _t,D as St}from"./dropdown-menu-CqMcZJzJ.js";import{i as vo}from"./Zap-vGQbOM1l.js";import{g as yo}from"./task-status-BmzVznbV.js";function Zt(){const t=C.c(77),{org:e}=pe(),s=ve(),o=It(),{setTasksOpen:r,openTab:i}=Dt(),l=e.slug,a=pe().project;let c;t[0]===Symbol.for("react.memo_cache_sentinel")?(c={strict:!1},t[0]=c):c=t[0];const u=We(c);let d;t[1]===Symbol.for("react.memo_cache_sentinel")?(d={strict:!1},t[1]=d):d=t[1];const m=qe(d),f=o.location.pathname;let x;t[2]!==a.enabledPlugins?(x=a.enabledPlugins??[],t[2]=a.enabledPlugins,t[3]=x):x=t[3];const p=x;let j;t[4]!==a.ui?(j=a.ui?.pinnedViews??[],t[4]=a.ui,t[5]=j):j=t[5];const I=j;let g,k,h,S;if(t[6]!==a.id||t[7]!==p||t[8]!==s||t[9]!==l||t[10]!==u.pluginId||t[11]!==u.taskId||t[12]!==m.virtualmcpid){let N;t[17]!==p?(N=X=>p.includes(X.pluginId),t[17]=p,t[18]=N):N=t[18];const K=ys.filter(N),W=m.virtualmcpid??a.id;k=!!m.virtualmcpid;const G=u.taskId??"",Y=u.pluginId;let ee;t[19]!==Y?(ee=X=>Y===X,t[19]=Y,t[20]=ee):ee=t[20],g=ee;let Z;t[21]!==G||t[22]!==s||t[23]!==l||t[24]!==W?(Z=X=>{const oe=G||crypto.randomUUID();s({to:"/$org/$taskId/$pluginId",params:{org:l,taskId:oe,pluginId:X},search:ae=>({...ae,virtualmcpid:W})})},t[21]=G,t[22]=s,t[23]=l,t[24]=W,t[25]=Z):Z=t[25],h=Z;let ne;t[26]!==g||t[27]!==h?(ne=X=>({key:X.pluginId,label:X.label,icon:X.icon,isActive:g(X.pluginId),onClick:()=>h(X.pluginId)}),t[26]=g,t[27]=h,t[28]=ne):ne=t[28],S=K.map(ne),t[6]=a.id,t[7]=p,t[8]=s,t[9]=l,t[10]=u.pluginId,t[11]=u.taskId,t[12]=m.virtualmcpid,t[13]=g,t[14]=k,t[15]=h,t[16]=S}else g=t[13],k=t[14],h=t[15],S=t[16];const y=S;let v;if(t[29]!==p||t[30]!==g||t[31]!==h){let N;t[33]!==p?(N=G=>p.includes(G.pluginId),t[33]=p,t[34]=N):N=t[34];const K=_s.filter(N);let W;t[35]!==g||t[36]!==h?(W=G=>({type:"group",group:{id:`${G.pluginId}-${G.id}`,label:G.label,items:G.items.map((Y,ee)=>({key:`${G.pluginId}-${G.id}-${ee}`,label:Y.label,icon:Y.icon,isActive:g(G.pluginId),onClick:()=>h(G.pluginId)})),defaultExpanded:G.defaultExpanded??!0}}),t[35]=g,t[36]=h,t[37]=W):W=t[37],v=K.map(W),t[29]=p,t[30]=g,t[31]=h,t[32]=v}else v=t[32];const _=v;let M;if(t[38]!==i||t[39]!==I){let N;t[41]!==i?(N=K=>{const W=Js(K.icon),G=W.type==="icon"?Zs(W.name):null;return{key:`app-${K.connectionId}-${K.toolName}`,label:K.label||K.toolName,icon:G?n.jsx(G,{size:16,className:"text-muted-foreground"}):W.type==="url"?n.jsx("img",{src:W.url,alt:"",className:"size-4 rounded"}):n.jsx(an,{size:16,className:"text-muted-foreground"}),isActive:!1,onClick:()=>i(dn(K.connectionId,K.toolName))}},t[41]=i,t[42]=N):N=t[42],M=I.map(N),t[38]=i,t[39]=I,t[40]=M}else M=t[40];const D=M;let w;t[43]!==D?(w=D.length>0?{type:"group",group:{id:"apps",label:"Apps",items:D,defaultExpanded:!0}}:null,t[43]=D,t[44]=w):w=t[44];const $=w;let O;t[45]===Symbol.for("react.memo_cache_sentinel")?(O=n.jsx(en,{className:"size-4!"}),t[45]=O):O=t[45];const T=f===`/${l}`||f===`/${l}/`;let A;t[46]!==s||t[47]!==l||t[48]!==r?(A=()=>{r(!1),s({to:"/$org",params:{org:l}})},t[46]=s,t[47]=l,t[48]=r,t[49]=A):A=t[49];let P;t[50]!==A||t[51]!==T?(P={key:"home",label:"Home",icon:O,isActive:T,onClick:A},t[50]=A,t[51]=T,t[52]=P):P=t[52];const z=P;let L;t[53]!==p?(L=p.includes(Ss),t[53]=p,t[54]=L):L=t[54];const R=L;let B;t[55]===Symbol.for("react.memo_cache_sentinel")?(B=n.jsx(Cs,{className:"size-4!"}),t[55]=B):B=t[55];let U;t[56]!==l||t[57]!==f?(U=f.startsWith(`/${l}/settings/workflows`),t[56]=l,t[57]=f,t[58]=U):U=t[58];let F;t[59]!==s||t[60]!==l?(F=()=>s({to:"/$org/settings/workflows",params:{org:l}}),t[59]=s,t[60]=l,t[61]=F):F=t[61];let H;t[62]!==U||t[63]!==F?(H={key:"workflows",label:"Workflows",icon:B,isActive:U,onClick:F},t[62]=U,t[63]=F,t[64]=H):H=t[64];const V=H;let q;if(t[65]!==z||t[66]!==k||t[67]!==R||t[68]!==V){const N=[z];k&&R&&N.push(V),q={type:"items",items:N},t[65]=z,t[66]=k,t[67]=R,t[68]=V,t[69]=q}else q=t[69];let Q;if(t[70]!==$||t[71]!==_||t[72]!==y||t[73]!==q){if(Q=[q],y.length>0){let N;t[75]!==y?(N={type:"items",items:y},t[75]=y,t[76]=N):N=t[76],Q.push(N)}_.length>0&&Q.push(..._),$&&Q.push($),t[70]=$,t[71]=_,t[72]=y,t[73]=q,t[74]=Q}else Q=t[74];return Q}function es(t){const e=C.c(3),{children:s}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx("div",{className:"flex h-6 items-center",children:n.jsx("div",{className:"h-0.5 w-16 rounded-full bg-sidebar-foreground/15"})}),e[0]=o):o=e[0];let r;return e[1]!==s?(r=n.jsxs(De,{className:"pt-0 pr-0 pb-2 pl-0 mt-2",children:[o,n.jsx(Le,{children:n.jsx(ge,{className:"gap-0.5",children:s})})]}),e[1]=s,e[2]=r):r=e[2],r}function _o(){const t=C.c(7),s=Mt().logo??$t,o=typeof s=="string"?s:s.light,r=typeof s=="string"?s:s.dark;let i;t[0]!==o?(i=n.jsx("img",{src:o,alt:"Logo",className:"size-6 object-contain dark:hidden"}),t[0]=o,t[1]=i):i=t[1];let l;t[2]!==r?(l=n.jsx("img",{src:r,alt:"Logo",className:"size-6 object-contain hidden dark:block"}),t[2]=r,t[3]=l):l=t[3];let a;return t[4]!==i||t[5]!==l?(a=n.jsx(Rt,{className:"flex items-center justify-center shrink-0 px-2 pb-0",children:n.jsxs("div",{className:"flex w-full aspect-square items-center justify-center",children:[i,l]})}),t[4]=i,t[5]=l,t[6]=a):a=t[6],a}function ts(t){const e=C.c(15),{item:s}=t,{isMobile:o,setOpenMobile:r}=Qe();let i;e[0]!==o||e[1]!==s||e[2]!==r?(i=()=>{se("nav_item_clicked",{nav_key:s.key,nav_label:s.label,is_active:!!s.isActive,is_mobile:o}),s.onClick?.(),o&&r(!1)},e[0]=o,e[1]=s,e[2]=r,e[3]=i):i=e[3];const l=i,a=s.key,c=s.isActive&&"z-10";let u;e[4]!==c?(u=J(c),e[4]=c,e[5]=u):u=e[5];let d;e[6]!==l||e[7]!==s.icon||e[8]!==s.isActive||e[9]!==s.label?(d=n.jsx(he,{onClick:l,isActive:s.isActive,tooltip:s.label,className:"bg-muted/75",children:s.icon}),e[6]=l,e[7]=s.icon,e[8]=s.isActive,e[9]=s.label,e[10]=d):d=e[10];let m;return e[11]!==s.key||e[12]!==u||e[13]!==d?(m=n.jsx(ie,{className:u,children:d},a),e[11]=s.key,e[12]=u,e[13]=d,e[14]=m):m=e[14],m}function So(t){const e=C.c(12),{section:s}=t;switch(s.type){case"divider":{let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(Ot,{className:"my-2"}),e[0]=o):o=e[0],o}case"spacer":{let o;return e[1]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx("div",{className:"flex-1"}),e[1]=o):o=e[1],o}case"group":{const o=s.group.label,r=s.group.defaultExpanded;let i;e[2]!==s.group.items?(i=s.group.items.map(No),e[2]=s.group.items,e[3]=i):i=e[3];let l;return e[4]!==s.group.defaultExpanded||e[5]!==s.group.label||e[6]!==i?(l=n.jsx(es,{label:o,defaultExpanded:r,children:i}),e[4]=s.group.defaultExpanded,e[5]=s.group.label,e[6]=i,e[7]=l):l=e[7],l}case"items":{let o;e[8]!==s.items?(o=s.items.map(Co),e[8]=s.items,e[9]=o):o=e[9];let r;return e[10]!==o?(r=n.jsx(De,{className:"pt-0 pr-0 pb-0 pl-0",children:n.jsx(Le,{children:n.jsx(ge,{className:"gap-1.5",children:o})})}),e[10]=o,e[11]=r):r=e[11],r}}}function Co(t){return n.jsx(ts,{item:t},t.key)}function No(t){return n.jsx(ts,{item:t},t.key)}function ko(t){const e=C.c(14),{sections:s,header:o,footer:r,additionalContent:i,variant:l,contentClassName:a}=t,c=l===void 0?"sidebar":l;let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(b.Suspense,{fallback:n.jsx("div",{className:"h-10 shrink-0"}),children:n.jsx(_o,{})}),e[0]=u):u=e[0];let d;e[1]!==a?(d=J("flex flex-col flex-1 px-2 py-2 gap-0",a),e[1]=a,e[2]=d):d=e[2];let m;e[3]!==s?(m=s.map(wo),e[3]=s,e[4]=m):m=e[4];let f;e[5]!==i||e[6]!==d||e[7]!==m?(f=n.jsxs(zt,{className:d,children:[m,i]}),e[5]=i,e[6]=d,e[7]=m,e[8]=f):f=e[8];let x;return e[9]!==r||e[10]!==o||e[11]!==f||e[12]!==c?(x=n.jsxs(cn,{variant:c,children:[u,o,f,r]}),e[9]=r,e[10]=o,e[11]=f,e[12]=c,e[13]=x):x=e[13],x}function wo(t,e){return n.jsx(So,{section:t},e)}function ss(t){const e=C.c(2);let s;return e[0]!==t?(s=n.jsx(ko,{...t}),e[0]=t,e[1]=s):s=e[1],s}ss.Skeleton=function(){return n.jsx("div",{className:"flex flex-col gap-0.5",children:Array.from({length:8}).map((e,s)=>n.jsx("div",{className:"w-full h-8",children:n.jsx(Ve,{className:"h-full bg-sidebar-accent rounded-md"})},s))})};function Io(){const t=C.c(7),s=Mt().logo??$t,o=typeof s=="string"?s:s.light,r=typeof s=="string"?s:s.dark;let i;t[0]!==o?(i=n.jsx("img",{src:o,alt:"Logo",className:"size-6 object-contain dark:hidden"}),t[0]=o,t[1]=i):i=t[1];let l;t[2]!==r?(l=n.jsx("img",{src:r,alt:"Logo",className:"size-6 object-contain hidden dark:block"}),t[2]=r,t[3]=l):l=t[3];let a;return t[4]!==i||t[5]!==l?(a=n.jsx(Rt,{className:"flex items-center justify-center shrink-0 px-2 pb-0",children:n.jsxs("div",{className:"flex w-full aspect-square items-center justify-center",children:[i,l]})}),t[4]=i,t[5]=l,t[6]=a):a=t[6],a}function Ct(t){const e=C.c(15),{item:s,onClose:o}=t,r=s.isActive&&"z-10";let i;e[0]!==r?(i=J(r),e[0]=r,e[1]=i):i=e[1];let l;e[2]!==s||e[3]!==o?(l=()=>{s.onClick?.(),o()},e[2]=s,e[3]=o,e[4]=l):l=e[4];let a;e[5]!==s.icon?(a=n.jsx("span",{className:"[&>svg]:size-8",children:s.icon}),e[5]=s.icon,e[6]=a):a=e[6];let c;e[7]!==s.isActive||e[8]!==s.label||e[9]!==l||e[10]!==a?(c=n.jsx(he,{onClick:l,isActive:s.isActive,tooltip:s.label,className:"bg-muted/75",children:a}),e[7]=s.isActive,e[8]=s.label,e[9]=l,e[10]=a,e[11]=c):c=e[11];let u;return e[12]!==i||e[13]!==c?(u=n.jsx(ie,{className:i,children:c}),e[12]=i,e[13]=c,e[14]=u):u=e[14],u}function Mo(t){const e=C.c(18),{section:s,onClose:o}=t;switch(s.type){case"divider":{let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(Ot,{className:"my-2"}),e[0]=r):r=e[0],r}case"spacer":{let r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx("div",{className:"flex-1"}),e[1]=r):r=e[1],r}case"group":{const r=s.group.label,i=s.group.defaultExpanded;let l;if(e[2]!==o||e[3]!==s.group.items){let c;e[5]!==o?(c=u=>n.jsx(Ct,{item:u,onClose:o},u.key),e[5]=o,e[6]=c):c=e[6],l=s.group.items.map(c),e[2]=o,e[3]=s.group.items,e[4]=l}else l=e[4];let a;return e[7]!==s.group.defaultExpanded||e[8]!==s.group.label||e[9]!==l?(a=n.jsx(es,{label:r,defaultExpanded:i,children:l}),e[7]=s.group.defaultExpanded,e[8]=s.group.label,e[9]=l,e[10]=a):a=e[10],a}case"items":{let r;if(e[11]!==o||e[12]!==s.items){let l;e[14]!==o?(l=a=>n.jsx(Ct,{item:a,onClose:o},a.key),e[14]=o,e[15]=l):l=e[15],r=s.items.map(l),e[11]=o,e[12]=s.items,e[13]=r}else r=e[13];let i;return e[16]!==r?(i=n.jsx(De,{className:"pt-0 pr-0 pb-0 pl-0",children:n.jsx(Le,{children:n.jsx(ge,{className:"gap-1.5",children:r})})}),e[16]=r,e[17]=i):i=e[17],i}}}function $o(t){const e=C.c(12),{sections:s,onClose:o,footer:r,additionalContent:i}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(b.Suspense,{fallback:n.jsx("div",{className:"h-10 shrink-0"}),children:n.jsx(Io,{})}),e[0]=l):l=e[0];let a;if(e[1]!==o||e[2]!==s){let d;e[4]!==o?(d=(m,f)=>n.jsx(Mo,{section:m,onClose:o},f),e[4]=o,e[5]=d):d=e[5],a=s.map(d),e[1]=o,e[2]=s,e[3]=a}else a=e[3];let c;e[6]!==i||e[7]!==a?(c=n.jsxs(zt,{className:"flex flex-col flex-1 px-2 py-2 gap-0",children:[a,i]}),e[6]=i,e[7]=a,e[8]=c):c=e[8];let u;return e[9]!==r||e[10]!==c?(u=n.jsxs("div",{className:"bg-sidebar flex h-full w-full flex-col","data-sidebar":"sidebar",children:[l,c,r]}),e[9]=r,e[10]=c,e[11]=u):u=e[11],u}function ns(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const To=Ns({name:ks().min(2,"Organization name is required")});function Ao(t){const e=C.c(41),{open:s,onOpenChange:o}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={resolver:ws(To),defaultValues:{name:""}},e[0]=r):r=e[0];const i=Is(r);let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l={mutationFn:Oo,onSuccess:Po},e[1]=l):l=e[1];const a=Ms(l),c=a.error instanceof Error?a.error.message:a.error?"Failed to create organization.":null;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsxs(Cn,{children:[n.jsx(Nn,{children:"Create a new organization"}),n.jsx(kn,{children:"Set up a new organization to collaborate with others."})]}),e[2]=u):u=e[2];let d;if(e[3]!==a||e[4]!==i){let _;e[6]!==a?(_=M=>a.mutateAsync(M),e[6]=a,e[7]=_):_=e[7],d=i.handleSubmit(_),e[3]=a,e[4]=i,e[5]=d}else d=e[5];let m;e[8]!==i.formState.isSubmitting?(m=_=>{const{field:M}=_;return n.jsxs(Tn,{children:[n.jsx(An,{children:"Organization Name"}),n.jsx(Pn,{children:n.jsx(Rn,{...M,placeholder:"Acme Inc.",disabled:i.formState.isSubmitting})}),n.jsx(On,{children:"The name of your company or organization"}),M.value&&n.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",n.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",ns(M.value)]})]}),n.jsx(zn,{})]})},e[8]=i.formState.isSubmitting,e[9]=m):m=e[9];let f;e[10]!==i.control||e[11]!==m?(f=n.jsx(Mn,{control:i.control,name:"name",render:m}),e[10]=i.control,e[11]=m,e[12]=f):f=e[12];let x;e[13]!==c?(x=c&&n.jsx("div",{className:"text-destructive text-sm mt-2",children:c}),e[13]=c,e[14]=x):x=e[14];let p;e[15]!==a||e[16]!==i?(p=()=>{a.reset(),i.reset()},e[15]=a,e[16]=i,e[17]=p):p=e[17];let j;e[18]!==i.formState.isSubmitting||e[19]!==p?(j=n.jsx(_n,{disabled:i.formState.isSubmitting,onClick:p,children:"Cancel"}),e[18]=i.formState.isSubmitting,e[19]=p,e[20]=j):j=e[20];const I=!i.formState.isValid||i.formState.isSubmitting;let g;e[21]!==i.formState.isSubmitting?(g=i.formState.isSubmitting?n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(En,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=i.formState.isSubmitting,e[22]=g):g=e[22];let k;e[23]!==I||e[24]!==g?(k=n.jsx(et,{type:"submit",variant:"default",disabled:I,children:g}),e[23]=I,e[24]=g,e[25]=k):k=e[25];let h;e[26]!==k||e[27]!==j?(h=n.jsxs(wn,{children:[j,k]}),e[26]=k,e[27]=j,e[28]=h):h=e[28];let S;e[29]!==h||e[30]!==d||e[31]!==f||e[32]!==x?(S=n.jsxs("form",{className:"space-y-6",onSubmit:d,autoComplete:"off",children:[f,x,h]}),e[29]=h,e[30]=d,e[31]=f,e[32]=x,e[33]=S):S=e[33];let y;e[34]!==i||e[35]!==S?(y=n.jsxs(Sn,{children:[u,n.jsx($n,{...i,children:S})]}),e[34]=i,e[35]=S,e[36]=y):y=e[36];let v;return e[37]!==o||e[38]!==s||e[39]!==y?(v=n.jsx(In,{open:s,onOpenChange:o,children:y}),e[37]=o,e[38]=s,e[39]=y,e[40]=v):v=e[40],v}function Po(t){const{orgSlug:e}=t;window.location.href=`/${e}`}async function Oo(t){const e=ns(t.name);if(!e)throw new Error("Organization slug is invalid");const s=await Se.organization.create({name:t.name,slug:e});if(s?.error)throw new Error(s.error.message||"Failed to create organization");const o=s?.data?.slug??e;if(!o)throw new Error("Failed to create organization");return{orgSlug:o}}function rt(t){let e=0;for(let o=0;o<t.length;o++)e=t.charCodeAt(o)+((e<<5)-e);const s=Math.abs(e)%360;return{backgroundColor:`hsl(${s} 55% 70%)`,color:`hsl(${s} 55% 20%)`}}function zo(t){const e=C.c(13),{org:s,size:o}=t,r=o===void 0?"sm":o,i=r==="xs"?"size-5":"size-6",l=r==="xs"?"text-[9px]":"text-xs";let a;e[0]!==i?(a=J(i,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=i,e[1]=a):a=e[1];let c;e[2]!==s.logo||e[3]!==s.name?(c=s.logo?void 0:rt(s.name),e[2]=s.logo,e[3]=s.name,e[4]=c):c=e[4];let u;e[5]!==s.logo||e[6]!==s.name||e[7]!==l?(u=s.logo?n.jsx("img",{src:s.logo,alt:"",className:"size-full object-cover"}):n.jsx("span",{className:J("font-semibold leading-none",l),children:s.name.slice(0,2).toUpperCase()}),e[5]=s.logo,e[6]=s.name,e[7]=l,e[8]=u):u=e[8];let d;return e[9]!==a||e[10]!==c||e[11]!==u?(d=n.jsx("div",{className:a,style:c,children:u}),e[9]=a,e[10]=c,e[11]=u,e[12]=d):d=e[12],d}function Be(t){const e=C.c(22),{item:s,onClose:o}=t;if(s.href){const c=s.external?"_blank":void 0,u=s.external?"noopener noreferrer":void 0;let d;e[0]!==s.icon?(d=n.jsx("span",{className:"shrink-0 text-muted-foreground",children:s.icon}),e[0]=s.icon,e[1]=d):d=e[1];let m;e[2]!==s.label?(m=n.jsx("span",{className:"flex-1",children:s.label}),e[2]=s.label,e[3]=m):m=e[3];let f;return e[4]!==s.href||e[5]!==o||e[6]!==c||e[7]!==u||e[8]!==d||e[9]!==m?(f=n.jsxs("a",{href:s.href,target:c,rel:u,className:"flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",onClick:o,children:[d,m]}),e[4]=s.href,e[5]=o,e[6]=c,e[7]=u,e[8]=d,e[9]=m,e[10]=f):f=e[10],f}let r;e[11]!==s||e[12]!==o?(r=()=>{s.onClick?.(),o()},e[11]=s,e[12]=o,e[13]=r):r=e[13];let i;e[14]!==s.icon?(i=n.jsx("span",{className:"shrink-0 text-muted-foreground",children:s.icon}),e[14]=s.icon,e[15]=i):i=e[15];let l;e[16]!==s.label?(l=n.jsx("span",{className:"flex-1",children:s.label}),e[16]=s.label,e[17]=l):l=e[17];let a;return e[18]!==r||e[19]!==i||e[20]!==l?(a=n.jsxs("button",{type:"button",onClick:r,className:"flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",children:[i,l]}),e[18]=r,e[19]=i,e[20]=l,e[21]=a):a=e[21],a}function Nt(t){const e=C.c(16),{sortedOrgs:s,orgParam:o,onSelectOrg:r,onCreateOrg:i}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx("span",{className:"text-sm font-medium text-muted-foreground/60",children:"Your Organizations"}),e[0]=l):l=e[0];let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Ke,{size:16}),e[1]=a):a=e[1];let c;e[2]!==i?(c=n.jsxs("div",{className:"flex items-center justify-between px-4 py-3",children:[l,n.jsx("button",{type:"button",onClick:i,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:a})]}),e[2]=i,e[3]=c):c=e[3];let u;if(e[4]!==r||e[5]!==o||e[6]!==s){let f;e[8]!==r||e[9]!==o?(f=x=>n.jsxs("button",{type:"button",onClick:()=>r(x.slug),className:J("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",x.slug===o?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[n.jsx(zo,{org:x,size:"sm"}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("p",{className:"text-sm font-medium truncate",children:x.name}),n.jsx("p",{className:"text-xs text-muted-foreground truncate",children:x.slug})]}),x.slug===o&&n.jsx(Ht,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},x.id),e[8]=r,e[9]=o,e[10]=f):f=e[10],u=s.map(f),e[4]=r,e[5]=o,e[6]=s,e[7]=u}else u=e[7];let d;e[11]!==u?(d=n.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1",children:u}),e[11]=u,e[12]=d):d=e[12];let m;return e[13]!==c||e[14]!==d?(m=n.jsxs(n.Fragment,{children:[c,d]}),e[13]=c,e[14]=d,e[15]=m):m=e[15],m}function kt(t){const e=C.c(142),{user:s,userImage:o,menuItems:r,signOutItem:i,themeOptions:l,preferences:a,setPreferences:c,sortedOrgs:u,orgParam:d,onSelectOrg:m,onCreateOrg:f,close:x,isMobile:p}=t;if(p){const G=s?.name??"U";let Y;e[0]!==G||e[1]!==o?(Y=n.jsx(pt,{url:o,fallback:G,shape:"circle",size:"sm",className:"shrink-0"}),e[0]=G,e[1]=o,e[2]=Y):Y=e[2];const ee=s?.name??"User";let Z;e[3]!==ee?(Z=n.jsx("p",{className:"text-sm font-medium truncate",children:ee}),e[3]=ee,e[4]=Z):Z=e[4];const ne=s?.email;let X;e[5]!==ne?(X=n.jsx("p",{className:"text-xs text-muted-foreground truncate",children:ne}),e[5]=ne,e[6]=X):X=e[6];let oe;e[7]!==Z||e[8]!==X?(oe=n.jsxs("div",{className:"flex-1 min-w-0",children:[Z,X]}),e[7]=Z,e[8]=X,e[9]=oe):oe=e[9];let ae;e[10]!==s?(ae=()=>{s?.id&&navigator.clipboard.writeText(s.id).then(Lo)},e[10]=s,e[11]=ae):ae=e[11];let Ne;e[12]===Symbol.for("react.memo_cache_sentinel")?(Ne=n.jsx(gt,{size:14}),e[12]=Ne):Ne=e[12];let ce;e[13]!==ae?(ce=n.jsx(tt,{asChild:!0,children:n.jsx("button",{type:"button",tabIndex:-1,onClick:ae,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:Ne})}),e[13]=ae,e[14]=ce):ce=e[14];let ye;e[15]===Symbol.for("react.memo_cache_sentinel")?(ye=n.jsx(st,{side:"right",children:n.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[15]=ye):ye=e[15];let _e;e[16]!==ce?(_e=n.jsx(ht,{delayDuration:300,children:n.jsxs(nt,{children:[ce,ye]})}),e[16]=ce,e[17]=_e):_e=e[17];let re;e[18]!==_e||e[19]!==Y||e[20]!==oe?(re=n.jsxs("div",{className:"flex items-center gap-3 px-4 py-4 border-b border-border",children:[Y,oe,_e]}),e[18]=_e,e[19]=Y,e[20]=oe,e[21]=re):re=e[21];let de;e[22]!==f||e[23]!==m||e[24]!==d||e[25]!==u?(de=n.jsx("div",{className:"border-b border-border pb-2",children:n.jsx(Nt,{sortedOrgs:u,orgParam:d,onSelectOrg:m,onCreateOrg:f})}),e[22]=f,e[23]=m,e[24]=d,e[25]=u,e[26]=de):de=e[26];let ue;if(e[27]!==x||e[28]!==r){let be;e[30]!==x?(be=Ge=>n.jsx(Be,{item:Ge,onClose:x},Ge.key),e[30]=x,e[31]=be):be=e[31],ue=r.map(be),e[27]=x,e[28]=r,e[29]=ue}else ue=e[29];let me;e[32]!==x||e[33]!==i?(me=n.jsx(Be,{item:i,onClose:x}),e[32]=x,e[33]=i,e[34]=me):me=e[34];let fe;e[35]!==ue||e[36]!==me?(fe=n.jsxs("nav",{className:"flex flex-col px-2 pt-2 pb-2 gap-0.5",children:[ue,me]}),e[35]=ue,e[36]=me,e[37]=fe):fe=e[37];let xe;e[38]!==de||e[39]!==fe?(xe=n.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[de,fe]}),e[38]=de,e[39]=fe,e[40]=xe):xe=e[40];let E;if(e[41]!==a.theme||e[42]!==c||e[43]!==l){let be;e[45]!==a.theme||e[46]!==c?(be=Ge=>{const{value:Ze,icon:bs,label:js}=Ge;return n.jsx("button",{type:"button","aria-label":js,onClick:()=>c(vs=>({...vs,theme:Ze})),className:J("size-8 rounded-md flex items-center justify-center transition-colors",a.theme===Ze?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:bs},Ze)},e[45]=a.theme,e[46]=c,e[47]=be):be=e[47],E=l.map(be),e[41]=a.theme,e[42]=c,e[43]=l,e[44]=E}else E=e[44];let ke;e[48]!==E?(ke=n.jsx("div",{className:"flex items-center gap-0.5",children:E}),e[48]=E,e[49]=ke):ke=e[49];const Xe=a.enableSounds?"Disable sounds":"Enable sounds";let we;e[50]!==c?(we=()=>c(Do),e[50]=c,e[51]=we):we=e[51];const Je=a.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let Ie;e[52]!==Je?(Ie=J("size-8 rounded-md flex items-center justify-center transition-colors",Je),e[52]=Je,e[53]=Ie):Ie=e[53];let Me;e[54]!==a.enableSounds?(Me=a.enableSounds?n.jsx(mt,{size:14}):n.jsx(ft,{size:14}),e[54]=a.enableSounds,e[55]=Me):Me=e[55];let $e;e[56]!==Xe||e[57]!==we||e[58]!==Ie||e[59]!==Me?($e=n.jsx("button",{type:"button","aria-label":Xe,onClick:we,className:Ie,children:Me}),e[56]=Xe,e[57]=we,e[58]=Ie,e[59]=Me,e[60]=$e):$e=e[60];let Fe;e[61]===Symbol.for("react.memo_cache_sentinel")?(Fe=n.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","2.306.4"]}),e[61]=Fe):Fe=e[61];let Te;e[62]!==$e?(Te=n.jsxs("div",{className:"flex items-center gap-2",children:[$e,Fe]}),e[62]=$e,e[63]=Te):Te=e[63];let Ae;e[64]!==ke||e[65]!==Te?(Ae=n.jsxs("div",{className:"flex items-center justify-between px-3 py-3 border-t border-border/50",children:[ke,Te]}),e[64]=ke,e[65]=Te,e[66]=Ae):Ae=e[66];let Ue;return e[67]!==re||e[68]!==xe||e[69]!==Ae?(Ue=n.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[re,xe,Ae]}),e[67]=re,e[68]=xe,e[69]=Ae,e[70]=Ue):Ue=e[70],Ue}const j=s?.name??"U";let I;e[71]!==j||e[72]!==o?(I=n.jsx(pt,{url:o,fallback:j,shape:"circle",size:"sm",className:"shrink-0"}),e[71]=j,e[72]=o,e[73]=I):I=e[73];const g=s?.name??"User";let k;e[74]!==g?(k=n.jsx("p",{className:"text-sm font-medium truncate",children:g}),e[74]=g,e[75]=k):k=e[75];const h=s?.email;let S;e[76]!==h?(S=n.jsx("p",{className:"text-xs text-muted-foreground truncate",children:h}),e[76]=h,e[77]=S):S=e[77];let y;e[78]!==k||e[79]!==S?(y=n.jsxs("div",{className:"flex-1 min-w-0",children:[k,S]}),e[78]=k,e[79]=S,e[80]=y):y=e[80];let v;e[81]!==s?(v=()=>{s?.id&&navigator.clipboard.writeText(s.id).then(Eo)},e[81]=s,e[82]=v):v=e[82];let _;e[83]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsx(gt,{size:14}),e[83]=_):_=e[83];let M;e[84]!==v?(M=n.jsx(tt,{asChild:!0,children:n.jsx("button",{type:"button",tabIndex:-1,onClick:v,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:_})}),e[84]=v,e[85]=M):M=e[85];let D;e[86]===Symbol.for("react.memo_cache_sentinel")?(D=n.jsx(st,{side:"right",children:n.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[86]=D):D=e[86];let w;e[87]!==M?(w=n.jsx(ht,{delayDuration:300,children:n.jsxs(nt,{children:[M,D]})}),e[87]=M,e[88]=w):w=e[88];let $;e[89]!==w||e[90]!==I||e[91]!==y?($=n.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 mx-1 mt-1",children:[I,y,w]}),e[89]=w,e[90]=I,e[91]=y,e[92]=$):$=e[92];let O;if(e[93]!==x||e[94]!==r){let G;e[96]!==x?(G=Y=>n.jsx(Be,{item:Y,onClose:x},Y.key),e[96]=x,e[97]=G):G=e[97],O=r.map(G),e[93]=x,e[94]=r,e[95]=O}else O=e[95];let T;e[98]!==x||e[99]!==i?(T=n.jsx(Be,{item:i,onClose:x}),e[98]=x,e[99]=i,e[100]=T):T=e[100];let A;e[101]!==O||e[102]!==T?(A=n.jsxs("nav",{className:"flex-1 flex flex-col px-2 pt-1 overflow-y-auto",children:[O,T]}),e[101]=O,e[102]=T,e[103]=A):A=e[103];let P;if(e[104]!==a.theme||e[105]!==c||e[106]!==l){let G;e[108]!==a.theme||e[109]!==c?(G=Y=>{const{value:ee,icon:Z,label:ne}=Y;return n.jsx("button",{type:"button","aria-label":ne,onClick:()=>c(X=>({...X,theme:ee})),className:J("size-7 rounded-md flex items-center justify-center transition-colors",a.theme===ee?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:Z},ee)},e[108]=a.theme,e[109]=c,e[110]=G):G=e[110],P=l.map(G),e[104]=a.theme,e[105]=c,e[106]=l,e[107]=P}else P=e[107];let z;e[111]!==P?(z=n.jsx("div",{className:"flex items-center gap-0.5",children:P}),e[111]=P,e[112]=z):z=e[112];const L=a.enableSounds?"Disable sounds":"Enable sounds";let R;e[113]!==c?(R=()=>c(Ro),e[113]=c,e[114]=R):R=e[114];const B=a.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let U;e[115]!==B?(U=J("size-7 rounded-md flex items-center justify-center transition-colors",B),e[115]=B,e[116]=U):U=e[116];let F;e[117]!==a.enableSounds?(F=a.enableSounds?n.jsx(mt,{size:14}):n.jsx(ft,{size:14}),e[117]=a.enableSounds,e[118]=F):F=e[118];let H;e[119]!==L||e[120]!==R||e[121]!==U||e[122]!==F?(H=n.jsx("button",{type:"button","aria-label":L,onClick:R,className:U,children:F}),e[119]=L,e[120]=R,e[121]=U,e[122]=F,e[123]=H):H=e[123];let V;e[124]===Symbol.for("react.memo_cache_sentinel")?(V=n.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","2.306.4"]}),e[124]=V):V=e[124];let q;e[125]!==H?(q=n.jsxs("div",{className:"flex items-center gap-2",children:[H,V]}),e[125]=H,e[126]=q):q=e[126];let Q;e[127]!==z||e[128]!==q?(Q=n.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 border-t border-border/50",children:[z,q]}),e[127]=z,e[128]=q,e[129]=Q):Q=e[129];let N;e[130]!==$||e[131]!==A||e[132]!==Q?(N=n.jsxs("div",{className:"w-60 shrink-0 flex flex-col border-r border-border bg-sidebar/75",children:[$,A,Q]}),e[130]=$,e[131]=A,e[132]=Q,e[133]=N):N=e[133];let K;e[134]!==f||e[135]!==m||e[136]!==d||e[137]!==u?(K=n.jsx("div",{className:"flex-1 flex flex-col min-w-0 min-h-0 overflow-hidden",children:n.jsx(Nt,{sortedOrgs:u,orgParam:d,onSelectOrg:m,onCreateOrg:f})}),e[134]=f,e[135]=m,e[136]=d,e[137]=u,e[138]=K):K=e[138];let W;return e[139]!==N||e[140]!==K?(W=n.jsxs("div",{className:"flex min-h-[380px] w-full overflow-hidden",children:[N,K]}),e[139]=N,e[140]=K,e[141]=W):W=e[141],W}function Ro(t){return{...t,enableSounds:!t.enableSounds}}function Eo(){je.success("User ID copied")}function Do(t){return{...t,enableSounds:!t.enableSounds}}function Lo(){je.success("User ID copied")}function os(){const t=C.c(50),{data:e}=Se.useSession(),{data:s}=Se.useListOrganizations(),o=ve();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org",shouldThrow:!1},t[0]=r):r=t[0];const l=$s(r)?.params.org,[a,c]=Tt(),u=Bt(),[d,m]=b.useState(!1),[f,x]=b.useState(!1),p=e?.user,j=p?.image;let I;if(t[1]!==u||t[2]!==o||t[3]!==d||t[4]!==l||t[5]!==s||t[6]!==a||t[7]!==c||t[8]!==p||t[9]!==j){const h=s?.find(W=>W.slug===l);let S;if(t[11]!==l||t[12]!==s){let W;t[14]!==l?(W=(G,Y)=>G.slug===l?-1:Y.slug===l?1:G.name.localeCompare(Y.name),t[14]=l,t[15]=W):W=t[15],S=[...s??[]].sort(W),t[11]=l,t[12]=s,t[13]=S}else S=t[13];const y=S;let v;t[16]!==o?(v=W=>{m(!1),o({to:"/$org",params:{org:W}})},t[16]=o,t[17]=v):v=t[17];const _=v;let M;t[18]===Symbol.for("react.memo_cache_sentinel")?(M=()=>m(!1),t[18]=M):M=t[18];const D=M;let w;t[19]===Symbol.for("react.memo_cache_sentinel")?(w=n.jsx(Ye,{size:16}),t[19]=w):w=t[19];let $;t[20]!==o||t[21]!==l?($={key:"preferences",label:"Preferences",icon:w,onClick:()=>{o({to:"/$org/settings/profile",params:{org:l??""}})}},t[20]=o,t[21]=l,t[22]=$):$=t[22];let O;t[23]===Symbol.for("react.memo_cache_sentinel")?(O={key:"terms",label:"Terms of Use",icon:n.jsx(tn,{size:16}),href:"https://www.decocms.com/terms-of-use",external:!0},t[23]=O):O=t[23];let T;t[24]===Symbol.for("react.memo_cache_sentinel")?(T={key:"privacy",label:"Privacy Policy",icon:n.jsx(yn,{size:16}),href:"https://www.decocms.com/privacy-policy",external:!0},t[24]=T):T=t[24];let A;t[25]===Symbol.for("react.memo_cache_sentinel")?(A={key:"github",label:"decocms/studio",icon:n.jsx(Ts,{className:"w-4 h-4"}),href:"https://github.com/decocms/studio",external:!0},t[25]=A):A=t[25];let P;t[26]===Symbol.for("react.memo_cache_sentinel")?(P={key:"community",label:"Community",icon:n.jsx(Vt,{size:16}),href:"https://decocms.com/discord",external:!0},t[26]=P):P=t[26];let z;t[27]===Symbol.for("react.memo_cache_sentinel")?(z={key:"homepage",label:"Homepage",icon:n.jsx(fn,{size:16}),href:"https://decocms.com",external:!0},t[27]=z):z=t[27];let L;t[28]!==$?(L=[$,O,T,A,P,z],t[28]=$,t[29]=L):L=t[29];const R=L;let B;t[30]===Symbol.for("react.memo_cache_sentinel")?(B={key:"logout",label:"Sign out",icon:n.jsx(pn,{size:16}),onClick:Uo},t[30]=B):B=t[30];const U=B;let F;t[31]===Symbol.for("react.memo_cache_sentinel")?(F={value:"light",icon:n.jsx(bn,{size:14}),label:"Light theme"},t[31]=F):F=t[31];let H;t[32]===Symbol.for("react.memo_cache_sentinel")?(H={value:"dark",icon:n.jsx(jn,{size:14}),label:"Dark theme"},t[32]=H):H=t[32];let V;t[33]===Symbol.for("react.memo_cache_sentinel")?(V=[F,H,{value:"system",icon:n.jsx(vn,{size:14}),label:"System theme"}],t[33]=V):V=t[33];const q=V;let Q;t[34]===Symbol.for("react.memo_cache_sentinel")?(Q=()=>{m(!1),x(!0)},t[34]=Q):Q=t[34];let N;t[35]!==_||t[36]!==u||t[37]!==R||t[38]!==l||t[39]!==a||t[40]!==c||t[41]!==y||t[42]!==p||t[43]!==j?(N={user:p,userImage:j,menuItems:R,signOutItem:U,themeOptions:q,preferences:a,setPreferences:c,sortedOrgs:y,orgParam:l,onSelectOrg:_,onCreateOrg:Q,close:D,isMobile:u},t[35]=_,t[36]=u,t[37]=R,t[38]=l,t[39]=a,t[40]=c,t[41]=y,t[42]=p,t[43]=j,t[44]=N):N=t[44];const K=N;I=u?n.jsxs(Ft,{open:d,onOpenChange:m,direction:"bottom",children:[n.jsxs("button",{type:"button",onClick:()=>m(!0),className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground",children:[n.jsx("div",{className:"shrink-0 size-5 rounded-md flex items-center justify-center border border-border/50 overflow-hidden",style:h?.logo?void 0:rt(h?.name??""),children:h?.logo?n.jsx("img",{src:h.logo,alt:"",className:"size-full object-cover"}):n.jsx("span",{className:"font-semibold leading-none text-[8px]",children:(h?.name??"?").slice(0,2).toUpperCase()})}),n.jsx("span",{className:"truncate",children:h?.name??"Account"})]}),n.jsxs(Ut,{className:"h-[80dvh] p-0",children:[n.jsx(Gt,{className:"sr-only",children:"Account"}),n.jsx(kt,{...K})]})]}):n.jsxs(lt,{open:d,onOpenChange:m,children:[n.jsx(at,{asChild:!0,children:n.jsx(he,{tooltip:h?.name??"Account",className:"rounded-md",children:n.jsx("div",{className:"shrink-0 size-6 rounded-md flex items-center justify-center border border-border/50 overflow-hidden",style:h?.logo?void 0:rt(h?.name??""),children:h?.logo?n.jsx("img",{src:h.logo,alt:"",className:"size-full object-cover"}):n.jsx("span",{className:"font-semibold leading-none text-[9px]",children:(h?.name??"?").slice(0,2).toUpperCase()})})})}),n.jsx(ct,{side:"right",align:"end",sideOffset:18,collisionPadding:16,className:"w-[520px] p-0 flex max-h-[520px]",onCloseAutoFocus:Fo,children:n.jsx(kt,{...K})})]}),t[1]=u,t[2]=o,t[3]=d,t[4]=l,t[5]=s,t[6]=a,t[7]=c,t[8]=p,t[9]=j,t[10]=I}else I=t[10];let g;t[45]!==f?(g=n.jsx(Ao,{open:f,onOpenChange:x}),t[45]=f,t[46]=g):g=t[46];let k;return t[47]!==I||t[48]!==g?(k=n.jsxs(n.Fragment,{children:[I,g]}),t[47]=I,t[48]=g,t[49]=k):k=t[49],k}function Fo(t){return t.preventDefault()}function Uo(){se("signed_out",{source:"account_popover"}),Se.signOut()}function Go({invitation:t}){const[e,s]=b.useState(!1),[o,r]=b.useState(!1),i=Re(),l=async()=>{s(!0);try{const c=await Se.organization.acceptInvitation({invitationId:t.id});if(c.error)je.error(c.error.message),s(!1);else{const u=await Se.organization.getFullOrganization({query:{organizationId:t.organizationId}});je.success("Invitation accepted!");const d=u?.data?.slug;window.location.href=d?`/${d}`:"/"}}catch{je.error("Failed to accept invitation"),s(!1)}},a=async()=>{r(!0);try{const c=await Se.organization.rejectInvitation({invitationId:t.id});c.error?(je.error(c.error.message),r(!1)):(je.success("Invitation declined"),i.invalidateQueries())}catch{je.error("Failed to decline invitation"),r(!1)}};return n.jsxs("div",{className:"flex items-center gap-3 px-5 py-4 border-b border-border last:border-0 hover:bg-muted/25 transition-colors",children:[n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("p",{className:"text-xs text-muted-foreground",children:"You've been invited to join"}),n.jsx("p",{className:"text-sm font-medium truncate",children:t.organizationName??"Unknown organization"})]}),n.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[n.jsx(et,{size:"icon",variant:"ghost",className:"size-7 text-green-600 hover:text-green-700 hover:bg-green-50 dark:hover:bg-green-950",onClick:l,disabled:e||o,"aria-label":"Accept invitation",children:n.jsx(Ht,{size:14})}),n.jsx(et,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground hover:text-destructive hover:bg-destructive/10",onClick:a,disabled:e||o,"aria-label":"Decline invitation",children:n.jsx(Dn,{size:14})})]})]})}function Bo(){const t=b.useContext(As),{data:e}=t.hooks.useListUserInvitations();return(e??[]).filter(o=>o.status==="pending"&&new Date(o.expiresAt)>new Date)}class Ho extends b.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,s){}render(){return this.state.hasError?null:this.props.children}}function Vo(t){return t<=1?"text-destructive":t<=5?"text-amber-500 dark:text-amber-400":"text-foreground/70"}function Ko(){const t=C.c(20),e=ve(),{org:s}=pe();let o;t[0]!==s.id||t[1]!==s.slug?(o={connectionId:Kt,orgId:s.id,orgSlug:s.slug},t[0]=s.id,t[1]=s.slug,t[2]=o):o=t[2];const r=Wt(o);let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i={providerId:"deco"},t[3]=i):i=t[3];let l;t[4]!==r?(l={client:r,toolName:"AI_PROVIDER_CREDITS",toolArguments:i,staleTime:6e4,select:Wo},t[4]=r,t[5]=l):l=t[5];const{data:a,isPending:c,isError:u}=Un(l),d=a?.balanceCents!=null?a.balanceCents/100:null;let m;t[6]!==d||t[7]!==u||t[8]!==c?(m=c||u||d==null?"Credits":`Credits: $${d.toFixed(2)}`,t[6]=d,t[7]=u,t[8]=c,t[9]=m):m=t[9];const f=m;let x;t[10]!==d?(x=J(d!=null&&Vo(d)),t[10]=d,t[11]=x):x=t[11];let p;t[12]!==e||t[13]!==s.slug?(p=()=>e({to:"/$org/settings/ai-providers",params:{org:s.slug}}),t[12]=e,t[13]=s.slug,t[14]=p):p=t[14];let j;t[15]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(sn,{size:24}),t[15]=j):j=t[15];let I;return t[16]!==x||t[17]!==p||t[18]!==f?(I=n.jsx(ge,{children:n.jsx(ie,{children:n.jsx(he,{tooltip:f,className:x,onClick:p,children:j})})}),t[16]=x,t[17]=p,t[18]=f,t[19]=I):I=t[19],I}function Wo(t){return t.structuredContent}function qo(){const t=C.c(1);if(!Gn().some(Qo))return null;let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(Ko,{}),t[0]=o):o=t[0],o}function Qo(t){return t.providerId==="deco"}function Yo(){const t=C.c(3),[e,s]=b.useState(!1);let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(ge,{children:n.jsx(ie,{children:n.jsx(he,{tooltip:"Connections",onClick:()=>{se("connections_dialog_opened",{source:"sidebar_footer",mode:"browse"}),s(!0)},children:n.jsx(hn,{size:24})})})}),t[0]=o):o=t[0];let r;return t[1]!==e?(r=n.jsxs(n.Fragment,{children:[o,n.jsx(Bn,{mode:"browse",open:e,onOpenChange:s,defaultTab:"all"})]}),t[1]=e,t[2]=r):r=t[2],r}function Xo(){const t=C.c(11),e=Bo();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(xt,{size:24}),t[0]=s):s=t[0];let o;t[1]!==e.length?(o=e.length>0&&n.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-red-500 pointer-events-none"}),t[1]=e.length,t[2]=o):o=t[2];let r;t[3]!==o?(r=n.jsx(ge,{children:n.jsx(ie,{children:n.jsx(at,{asChild:!0,children:n.jsxs(he,{tooltip:"Inbox",className:"relative",children:[s,o]})})})}),t[3]=o,t[4]=r):r=t[4];let i;t[5]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx("div",{className:"px-4 py-3 border-b border-border shrink-0",children:n.jsx("h3",{className:"text-sm font-medium",children:"Inbox"})}),t[5]=i):i=t[5];let l;t[6]!==e?(l=n.jsxs(ct,{side:"right",align:"start",sideOffset:16,collisionPadding:16,className:"w-[min(400px,calc(100vw-2rem))] p-0 h-[min(650px,calc(100dvh-4rem))] flex flex-col",children:[i,e.length===0?n.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 px-6 text-center",children:[n.jsx(xt,{size:24,className:"text-muted-foreground/50"}),n.jsx("p",{className:"text-sm font-medium text-foreground",children:"No invites pending"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Organization invitations will appear here"})]}):n.jsx("div",{className:"overflow-y-auto flex-1",children:e.map(Jo)})]}),t[6]=e,t[7]=l):l=t[7];let a;return t[8]!==r||t[9]!==l?(a=n.jsxs(lt,{children:[r,l]}),t[8]=r,t[9]=l,t[10]=a):a=t[10],a}function Jo(t){return n.jsx(Go,{invitation:t},t.id)}function Zo(){const t=C.c(6),e=ve(),{org:s}=pe();let o;t[0]!==e||t[1]!==s.slug?(o=()=>e({to:"/$org/settings",params:{org:s.slug}}),t[0]=e,t[1]=s.slug,t[2]=o):o=t[2];let r;t[3]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(Ye,{size:24}),t[3]=r):r=t[3];let i;return t[4]!==o?(i=n.jsx(ge,{children:n.jsx(ie,{children:n.jsx(he,{tooltip:"Settings",onClick:o,children:r})})}),t[4]=o,t[5]=i):i=t[5],i}function er(){const t=C.c(5);let e,s,o,r;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(Ho,{children:n.jsx(b.Suspense,{fallback:null,children:n.jsx(qo,{})})}),s=n.jsx(Yo,{}),o=n.jsx(Xo,{}),r=n.jsx(Zo,{}),t[0]=e,t[1]=s,t[2]=o,t[3]=r):(e=t[0],s=t[1],o=t[2],r=t[3]);let i;return t[4]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsxs(Et,{className:"px-2 pb-3 gap-1",children:[e,s,o,r,n.jsx(ge,{children:n.jsx(ie,{children:n.jsx(os,{})})})]}),t[4]=i):i=t[4],i}function tr(){const t=C.c(10),e=ve(),{org:s}=pe(),{setOpenMobile:o}=Qe();let r;t[0]!==e||t[1]!==s.slug||t[2]!==o?(r=()=>{e({to:"/$org/settings",params:{org:s.slug}}),o(!1)},t[0]=e,t[1]=s.slug,t[2]=o,t[3]=r):r=t[3];let i;t[4]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(Ye,{}),t[4]=i):i=t[4];let l;t[5]!==r?(l=n.jsx(ie,{children:n.jsx(he,{tooltip:"Settings",onClick:r,children:i})}),t[5]=r,t[6]=l):l=t[6];let a;t[7]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(ie,{children:n.jsx(os,{})}),t[7]=a):a=t[7];let c;return t[8]!==l?(c=n.jsx(Et,{children:n.jsxs(ge,{children:[l,a]})}),t[8]=l,t[9]=c):c=t[9],c}var dt="ContextMenu",[sr]=Us(dt,[At]),te=At(),[nr,rs]=sr(dt),is=t=>{const{__scopeContextMenu:e,children:s,onOpenChange:o,dir:r,modal:i=!0}=t,[l,a]=b.useState(!1),c=te(e),u=Ps(o),d=b.useCallback(m=>{a(m),u(m)},[u]);return n.jsx(nr,{scope:e,open:l,onOpenChange:d,modal:i,children:n.jsx(Os,{...c,dir:r,open:l,onOpenChange:d,modal:i,children:s})})};is.displayName=dt;var ls="ContextMenuTrigger",as=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,disabled:o=!1,...r}=t,i=rs(ls,s),l=te(s),a=b.useRef({x:0,y:0}),c=b.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...a.current})}),u=b.useRef(0),d=b.useCallback(()=>window.clearTimeout(u.current),[]),m=f=>{a.current={x:f.clientX,y:f.clientY},i.onOpenChange(!0)};return b.useEffect(()=>d,[d]),b.useEffect(()=>{o&&d()},[o,d]),n.jsxs(n.Fragment,{children:[n.jsx(zs,{...l,virtualRef:c}),n.jsx(Rs.span,{"data-state":i.open?"open":"closed","data-disabled":o?"":void 0,...r,ref:e,style:{WebkitTouchCallout:"none",...t.style},onContextMenu:o?t.onContextMenu:Oe(t.onContextMenu,f=>{d(),m(f),f.preventDefault()}),onPointerDown:o?t.onPointerDown:Oe(t.onPointerDown,He(f=>{d(),u.current=window.setTimeout(()=>m(f),700)})),onPointerMove:o?t.onPointerMove:Oe(t.onPointerMove,He(d)),onPointerCancel:o?t.onPointerCancel:Oe(t.onPointerCancel,He(d)),onPointerUp:o?t.onPointerUp:Oe(t.onPointerUp,He(d))})]})});as.displayName=ls;var or="ContextMenuPortal",cs=t=>{const{__scopeContextMenu:e,...s}=t,o=te(e);return n.jsx(Es,{...o,...s})};cs.displayName=or;var ds="ContextMenuContent",us=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,...o}=t,r=rs(ds,s),i=te(s),l=b.useRef(!1);return n.jsx(Ds,{...i,...o,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:a=>{t.onCloseAutoFocus?.(a),!a.defaultPrevented&&l.current&&a.preventDefault(),l.current=!1},onInteractOutside:a=>{t.onInteractOutside?.(a),!a.defaultPrevented&&!r.modal&&(l.current=!0)},style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});us.displayName=ds;var rr="ContextMenuGroup",ir=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,...o}=t,r=te(s);return n.jsx(Gs,{...r,...o,ref:e})});ir.displayName=rr;var lr="ContextMenuLabel",ar=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,...o}=t,r=te(s);return n.jsx(Bs,{...r,...o,ref:e})});ar.displayName=lr;var cr="ContextMenuItem",ms=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,...o}=t,r=te(s);return n.jsx(Ls,{...r,...o,ref:e})});ms.displayName=cr;var dr="ContextMenuCheckboxItem",ur=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,...o}=t,r=te(s);return n.jsx(Hs,{...r,...o,ref:e})});ur.displayName=dr;var mr="ContextMenuRadioGroup",fr=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,...o}=t,r=te(s);return n.jsx(Vs,{...r,...o,ref:e})});fr.displayName=mr;var xr="ContextMenuRadioItem",pr=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,...o}=t,r=te(s);return n.jsx(Ks,{...r,...o,ref:e})});pr.displayName=xr;var hr="ContextMenuItemIndicator",gr=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,...o}=t,r=te(s);return n.jsx(Ws,{...r,...o,ref:e})});gr.displayName=hr;var br="ContextMenuSeparator",fs=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,...o}=t,r=te(s);return n.jsx(Fs,{...r,...o,ref:e})});fs.displayName=br;var jr="ContextMenuArrow",vr=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,...o}=t,r=te(s);return n.jsx(qs,{...r,...o,ref:e})});vr.displayName=jr;var yr="ContextMenuSubTrigger",_r=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,...o}=t,r=te(s);return n.jsx(Qs,{...r,...o,ref:e})});_r.displayName=yr;var Sr="ContextMenuSubContent",Cr=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,...o}=t,r=te(s);return n.jsx(Ys,{...r,...o,ref:e,style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Cr.displayName=Sr;function He(t){return e=>e.pointerType!=="mouse"?t(e):void 0}var Nr=is,kr=as,wr=cs,Ir=us,Mr=ms,$r=fs;function Tr(t){const e=C.c(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;return e[2]!==s?(o=n.jsx(Nr,{"data-slot":"context-menu",...s}),e[2]=s,e[3]=o):o=e[3],o}function Ar(t){const e=C.c(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;return e[2]!==s?(o=n.jsx(kr,{"data-slot":"context-menu-trigger",...s}),e[2]=s,e[3]=o):o=e[3],o}function Pr(t){const e=C.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let r;e[3]!==s?(r=J("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",s),e[3]=s,e[4]=r):r=e[4];let i;return e[5]!==o||e[6]!==r?(i=n.jsx(wr,{children:n.jsx(Ir,{"data-slot":"context-menu-content",className:r,...o})}),e[5]=o,e[6]=r,e[7]=i):i=e[7],i}function wt(t){const e=C.c(12);let s,o,r,i;e[0]!==t?({className:s,inset:o,variant:i,...r}=t,e[0]=t,e[1]=s,e[2]=o,e[3]=r,e[4]=i):(s=e[1],o=e[2],r=e[3],i=e[4]);const l=i===void 0?"default":i;let a;e[5]!==s?(a=J("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),e[5]=s,e[6]=a):a=e[6];let c;return e[7]!==o||e[8]!==r||e[9]!==a||e[10]!==l?(c=n.jsx(Mr,{"data-slot":"context-menu-item","data-inset":o,"data-variant":l,className:a,...r}),e[7]=o,e[8]=r,e[9]=a,e[10]=l,e[11]=c):c=e[11],c}function Or(t){const e=C.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let r;e[3]!==s?(r=J("bg-border -mx-1 my-1 h-px",s),e[3]=s,e[4]=r):r=e[4];let i;return e[5]!==o||e[6]!==r?(i=n.jsx($r,{"data-slot":"context-menu-separator",className:r,...o}),e[5]=o,e[6]=r,e[7]=i):i=e[7],i}function zr(t){const e=ve(),s=Re(),o=Xt(),{locator:r}=pe(),i=We({strict:!1}),l=qe({strict:!1});return async a=>{const c=crypto.randomUUID(),u=a===l.virtualmcpid?Lt(s,r,i.taskId??""):null;try{await o.create.mutateAsync({id:c,virtual_mcp_id:a,...u?{branch:u}:{}})}catch{}e({to:"/$org/$taskId",params:{org:t,taskId:c},search:{virtualmcpid:a}})}}function Rr({agent:t,org:e,onUnpin:s,isDragging:o}){const r=ve(),{isMobile:i,setOpenMobile:l}=Qe(),a=Hn(e),u=It({select:h=>h.location.pathname}).startsWith(`/${e}/${t.id}`),[d,m]=b.useState(null),f=b.useRef(null),x=b.useRef(null),p=b.useRef(!1);p.current=!!o,o&&(d||x.current)&&(x.current&&(clearTimeout(x.current),x.current=null),d&&m(null));const j=h=>{if(p.current)return;const S=h.currentTarget.getBoundingClientRect();x.current=setTimeout(()=>{p.current||m(S)},550)},I=h=>{x.current&&(clearTimeout(x.current),x.current=null),!(f.current&&h.relatedTarget instanceof Node&&f.current.contains(h.relatedTarget))&&m(null)},g=d?Math.round(d.height*.9):0,k=d?d.width+g:0;return n.jsx(Tr,{children:n.jsxs(ie,{className:J(d&&"z-[55]"),children:[n.jsx(Ar,{asChild:!0,children:n.jsx(he,{tooltip:d?void 0:t.title,isActive:u,onClick:async()=>{i&&l(!1);const{resumed:h}=await a(t.id);se("sidebar_agent_pin_clicked",{agent_id:t.id,agent_title:t.title,resumed:h})},onMouseEnter:j,onMouseLeave:I,children:n.jsx(Pe,{icon:t.icon,name:t.title,size:"xs",className:"w-full h-full [&_svg]:w-1/2 [&_svg]:h-1/2"})})}),n.jsxs(Pr,{children:[n.jsxs(wt,{onClick:()=>{const h=crypto.randomUUID();r({to:"/$org/$taskId",params:{org:e,taskId:h},search:{virtualmcpid:t.id}})},children:[n.jsx(Ye,{size:14}),"Settings"]}),n.jsx(Or,{}),n.jsxs(wt,{onClick:()=>{s(),u&&r({to:"/$org",params:{org:e}})},className:"",children:[n.jsx(jt,{size:14}),"Unpin"]})]}),d&&Ee.createPortal(n.jsx("button",{ref:f,type:"button",onMouseLeave:()=>m(null),onClick:h=>{h.stopPropagation(),m(null),s(),r({to:"/$org",params:{org:e}})},className:J("flex items-center justify-center","bg-sidebar-accent text-muted-foreground","rounded-xl cursor-pointer","animate-in fade-in-0 slide-in-from-right-2","duration-150 [animation-timing-function:cubic-bezier(0.165,0.84,0.44,1)]","hover:text-foreground transition-colors"),style:{position:"fixed",top:d.top,left:d.left,height:d.height,width:k,paddingLeft:d.width,zIndex:50,boxShadow:"inset 0 0 0.5px 1px hsla(0, 0%, 100%, 0.075), 0 0 0 0.5px hsla(0, 0%, 0%, 0.12)"},children:n.jsx(jt,{size:14})}),document.body)]})})}function Er(t){const e=C.c(18);let s;e[0]!==t.agent.id?(s={id:t.agent.id},e[0]=t.agent.id,e[1]=s):s=e[1];const{attributes:o,listeners:r,setNodeRef:i,transform:l,transition:a,isDragging:c}=oo(s);let u;e[2]!==l?(u=ro.Transform.toString(l?{...l,x:0}:null),e[2]=l,e[3]=u):u=e[3];const d=c?.5:void 0,m=c?100:void 0;let f;e[4]!==u||e[5]!==d||e[6]!==m||e[7]!==a?(f={transform:u,transition:a,opacity:d,zIndex:m},e[4]=u,e[5]=d,e[6]=m,e[7]=a,e[8]=f):f=e[8];const x=f;let p;e[9]!==c||e[10]!==t?(p=n.jsx(Rr,{...t,isDragging:c}),e[9]=c,e[10]=t,e[11]=p):p=e[11];let j;return e[12]!==o||e[13]!==r||e[14]!==i||e[15]!==x||e[16]!==p?(j=n.jsx("div",{ref:i,style:x,...o,...r,tabIndex:-1,className:"w-full",children:p}),e[12]=o,e[13]=r,e[14]=i,e[15]=x,e[16]=p,e[17]=j):j=e[17],j}function Dr(t){const e=C.c(9),{agent:s,onClick:o}=t;let r;e[0]!==s.icon||e[1]!==s.title?(r=n.jsx(Pe,{icon:s.icon,name:s.title,size:"md",className:"transition-transform group-hover:scale-105"}),e[0]=s.icon,e[1]=s.title,e[2]=r):r=e[2];let i;e[3]!==s.title?(i=n.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground line-clamp-2 w-full",children:s.title}),e[3]=s.title,e[4]=i):i=e[4];let l;return e[5]!==o||e[6]!==r||e[7]!==i?(l=n.jsxs("button",{type:"button",onClick:o,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[r,i]}),e[5]=o,e[6]=r,e[7]=i,e[8]=l):l=e[8],l}function Lr(t){const e=C.c(80),{onClose:s,onOpenImportDeco:o,onOpenGithubImport:r,onOpenSelfHealing:i,onOpenDiagnosticsModal:l,onOpenLeanCanvasModal:a,onOpenStudioPackModal:c,onOpenAiImageModal:u,onOpenAiResearchModal:d}=t,[m,f]=b.useState(""),x=qt(),{org:p}=pe();let j;e[0]!==x?(j=x.filter(Wr).map(Kr),e[0]=x,e[1]=j):j=e[1];const I=j,{pin:g,isPinned:k}=Yt(p.id,I);let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h={navigateOnCreate:!0},e[2]=h):h=e[2];const{createVirtualMCP:S,isCreating:y}=ao(h),[v]=Tt(),_=zr(p.slug),M=lo();let D,w,$,O,T,A,P,z;if(e[3]!==x||e[4]!==S||e[5]!==y||e[6]!==k||e[7]!==M||e[8]!==_||e[9]!==s||e[10]!==u||e[11]!==d||e[12]!==l||e[13]!==r||e[14]!==o||e[15]!==a||e[16]!==i||e[17]!==c||e[18]!==g||e[19]!==v.experimental_vibecode||e[20]!==m){const V=m.toLowerCase();z=x.filter(Vr).filter(E=>!m||E.title.toLowerCase().includes(V));let q;e[29]!==x?(q=x.some(Hr),e[29]=x,e[30]=q):q=e[30];const Q=q;D=ze.filter(E=>(!m||E.title.toLowerCase().includes(V))&&!(E.id==="studio-pack"&&Q)&&!(E.id==="self-healing-storefront"&&!v.experimental_vibecode));let N;e[31]===Symbol.for("react.memo_cache_sentinel")?(N=ze.find(Br),e[31]=N):N=e[31];const K=N,W=K?x.find(E=>E.metadata?.type===K.id):void 0;let G;e[32]===Symbol.for("react.memo_cache_sentinel")?(G=ze.find(Gr),e[32]=G):G=e[32];const Y=G,ee=Y?x.find(E=>E.metadata?.type===Y.id):void 0;let Z;e[33]===Symbol.for("react.memo_cache_sentinel")?(Z=ze.find(Ur),e[33]=Z):Z=e[33];const ne=Z,X=ne?x.find(E=>E.metadata?.type===ne.id):void 0;let oe;e[34]===Symbol.for("react.memo_cache_sentinel")?(oe=ze.find(Fr),e[34]=oe):oe=e[34];const ae=oe,Ne=ae?x.find(E=>E.metadata?.type===ae.id):void 0;let ce;e[35]!==k||e[36]!==_||e[37]!==s||e[38]!==g?(ce=E=>{k(E.id)||g(E.id),s(),f(""),_(E.id)},e[35]=k,e[36]=_,e[37]=s,e[38]=g,e[39]=ce):ce=e[39];const ye=ce,_e=E=>{s(),f(""),E==="self-healing-storefront"?i():E==="site-editor"?o():E==="site-diagnostics"?W?M(W.id):l():E==="lean-canvas"?ee?M(ee.id):a():E==="ai-image"?X?M(X.id):u():E==="ai-research"?Ne?M(Ne.id):d():E==="studio-pack"?c():_(E)};A="flex flex-col max-h-[min(640px,80dvh)]",e[40]!==m?(P=n.jsx(io,{value:m,onChange:f,placeholder:"Search agents..."}),e[40]=m,e[41]=P):P=e[41],w="overflow-y-auto flex-1 min-h-0 px-3 pb-3",e[42]===Symbol.for("react.memo_cache_sentinel")?($=n.jsx("div",{className:"px-1 pt-3 pb-2",children:n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Agents"})}),e[42]=$):$=e[42];let re;e[43]!==S||e[44]!==s?(re=async()=>{se("agent_create_new_clicked",{source:"browse_popover"}),await S(),s()},e[43]=S,e[44]=s,e[45]=re):re=e[45];let de,ue;e[46]===Symbol.for("react.memo_cache_sentinel")?(de=n.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-dashed border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:n.jsx(Ke,{size:16,className:"text-muted-foreground"})}),ue=n.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Create new"}),e[46]=de,e[47]=ue):(de=e[46],ue=e[47]);let me;e[48]!==y||e[49]!==re?(me=n.jsxs("button",{type:"button",disabled:y,onClick:re,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group disabled:opacity-50 disabled:cursor-not-allowed",children:[de,ue]}),e[48]=y,e[49]=re,e[50]=me):me=e[50];let fe;e[51]!==s||e[52]!==r||e[53]!==v.experimental_vibecode?(fe=v.experimental_vibecode&&n.jsxs("button",{type:"button",onClick:()=>{se("agent_import_clicked",{source:"github"}),r(),s()},className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[n.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:n.jsx(po,{className:"size-5 text-muted-foreground"})}),n.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Import GitHub"})]}),e[51]=s,e[52]=r,e[53]=v.experimental_vibecode,e[54]=fe):fe=e[54];let xe;e[55]!==ye?(xe=E=>n.jsx(Dr,{agent:E,onClick:()=>ye(E)},E.id),e[55]=ye,e[56]=xe):xe=e[56],O=n.jsxs("div",{className:"grid grid-cols-3 gap-1",children:[me,fe,z.map(xe)]}),T=D.length>0&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"px-1 pt-4 pb-2",children:n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Agent templates"})}),n.jsx("div",{className:"grid grid-cols-3 gap-1",children:D.map(E=>n.jsxs("button",{type:"button",onClick:()=>{se("agent_template_clicked",{template_id:E.id,template_title:E.title}),_e(E.id)},className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group disabled:opacity-50 disabled:cursor-not-allowed",children:[n.jsx(Pe,{icon:E.icon,name:E.title,size:"md",className:"transition-transform group-hover:scale-105"}),n.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground line-clamp-2 w-full",children:E.title})]},E.id))})]}),e[3]=x,e[4]=S,e[5]=y,e[6]=k,e[7]=M,e[8]=_,e[9]=s,e[10]=u,e[11]=d,e[12]=l,e[13]=r,e[14]=o,e[15]=a,e[16]=i,e[17]=c,e[18]=g,e[19]=v.experimental_vibecode,e[20]=m,e[21]=D,e[22]=w,e[23]=$,e[24]=O,e[25]=T,e[26]=A,e[27]=P,e[28]=z}else D=e[21],w=e[22],$=e[23],O=e[24],T=e[25],A=e[26],P=e[27],z=e[28];let L;e[57]!==D||e[58]!==y||e[59]!==m||e[60]!==z.length?(L=z.length===0&&D.length===0&&!y&&n.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:m?"No agents found":"No agents yet"}),e[57]=D,e[58]=y,e[59]=m,e[60]=z.length,e[61]=L):L=e[61];let R;e[62]!==w||e[63]!==$||e[64]!==O||e[65]!==T||e[66]!==L?(R=n.jsxs("div",{className:w,children:[$,O,T,L]}),e[62]=w,e[63]=$,e[64]=O,e[65]=T,e[66]=L,e[67]=R):R=e[67];let B;e[68]!==p.slug?(B={org:p.slug},e[68]=p.slug,e[69]=B):B=e[69];let U;e[70]!==s?(U=()=>s(),e[70]=s,e[71]=U):U=e[71];let F;e[72]!==B||e[73]!==U?(F=n.jsx("div",{className:"border-t border-border px-3 py-2.5",children:n.jsx(Xs,{to:"/$org/settings/agents",params:B,onClick:U,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:"See all agents"})}),e[72]=B,e[73]=U,e[74]=F):F=e[74];let H;return e[75]!==R||e[76]!==F||e[77]!==A||e[78]!==P?(H=n.jsxs("div",{className:A,children:[P,R,F]}),e[75]=R,e[76]=F,e[77]=A,e[78]=P,e[79]=H):H=e[79],H}function Fr(t){return t.id==="ai-research"}function Ur(t){return t.id==="ai-image"}function Gr(t){return t.id==="lean-canvas"}function Br(t){return t.id==="site-diagnostics"}function Hr(t){return Fn(t.id)}function Vr(t){return!Ln(t.id)}function Kr(t){return t.id}function Wr(t){return t.pinned}function qr(){const t=C.c(36),[e,s]=b.useState(!1),[o,r]=b.useState(!1),[i,l]=b.useState(!1),[a,c]=b.useState(!1),[u,d]=b.useState(!1),[m,f]=b.useState(!1),[x,p]=b.useState(!1),[j,I]=b.useState(!1),[g,k]=b.useState(!1),h=Bt(),{setOpenMobile:S}=Qe();let y;t[0]!==h||t[1]!==S?(y=()=>{s(!1),h&&S(!1)},t[0]=h,t[1]=S,t[2]=y):y=t[2];const v=y;let _;t[3]!==v||t[4]!==e?(_=e&&n.jsx(b.Suspense,{fallback:n.jsx("div",{className:"flex items-center justify-center py-8",children:n.jsx(Ve,{className:"h-4 w-24"})}),children:n.jsx(Lr,{onClose:v,onOpenImportDeco:()=>r(!0),onOpenGithubImport:()=>{l(!0),v()},onOpenSelfHealing:()=>{c(!0),v()},onOpenDiagnosticsModal:()=>d(!0),onOpenLeanCanvasModal:()=>f(!0),onOpenStudioPackModal:()=>p(!0),onOpenAiImageModal:()=>I(!0),onOpenAiResearchModal:()=>k(!0)})}),t[3]=v,t[4]=e,t[5]=_):_=t[5];const M=_;let D;t[6]!==h||t[7]!==e||t[8]!==M?(D=h?n.jsxs(n.Fragment,{children:[n.jsx(ie,{children:n.jsx(he,{tooltip:"Browse agents",className:"bg-muted/75 hover:bg-sidebar-accent",onClick:()=>{se("agent_browser_opened",{surface:"mobile_drawer"}),s(!0)},children:n.jsx(Ke,{className:"!opacity-100"})})}),n.jsx(Ft,{open:e,onOpenChange:s,direction:"bottom",children:n.jsxs(Ut,{className:"max-h-[85dvh] p-0",children:[n.jsx(Gt,{className:"sr-only",children:"Browse agents"}),M]})})]}):n.jsxs(lt,{open:e,onOpenChange:B=>{B&&!e&&se("agent_browser_opened",{surface:"desktop_popover"}),s(B)},children:[n.jsx(ie,{children:n.jsx(at,{asChild:!0,children:n.jsx(he,{tooltip:"Browse agents",className:"bg-muted/75 hover:bg-sidebar-accent",children:n.jsx(Ke,{className:"!opacity-100"})})})}),n.jsx(ct,{className:"w-[380px] p-0 overflow-hidden",side:"right",align:"start",children:M})]}),t[6]=h,t[7]=e,t[8]=M,t[9]=D):D=t[9];let w;t[10]!==o?(w=n.jsx(co,{open:o,onOpenChange:r}),t[10]=o,t[11]=w):w=t[11];let $;t[12]!==i?($=n.jsx(uo,{open:i,onOpenChange:l}),t[12]=i,t[13]=$):$=t[13];let O;t[14]!==a?(O=n.jsx(Vn,{open:a,onOpenChange:c}),t[14]=a,t[15]=O):O=t[15];let T;t[16]!==u?(T=n.jsx(mo,{open:u,onOpenChange:d}),t[16]=u,t[17]=T):T=t[17];let A;t[18]!==m?(A=n.jsx(fo,{open:m,onOpenChange:f}),t[18]=m,t[19]=A):A=t[19];let P;t[20]!==x?(P=n.jsx(xo,{open:x,onOpenChange:p}),t[20]=x,t[21]=P):P=t[21];let z;t[22]!==j?(z=n.jsx(Kn,{open:j,onOpenChange:I}),t[22]=j,t[23]=z):z=t[23];let L;t[24]!==g?(L=n.jsx(Wn,{open:g,onOpenChange:k}),t[24]=g,t[25]=L):L=t[25];let R;return t[26]!==L||t[27]!==D||t[28]!==w||t[29]!==$||t[30]!==O||t[31]!==T||t[32]!==A||t[33]!==P||t[34]!==z?(R=n.jsxs(n.Fragment,{children:[D,w,$,O,T,A,P,z,L]}),t[26]=L,t[27]=D,t[28]=w,t[29]=$,t[30]=O,t[31]=T,t[32]=A,t[33]=P,t[34]=z,t[35]=R):R=t[35],R}function Qr(){const t=C.c(34),e=qt(),{org:s}=pe();let o;t[0]!==e?(o=e.filter(Zr).map(Jr),t[0]=e,t[1]=o):o=t[1];const r=o,{pinnedIds:i,unpin:l,reorder:a}=Yt(s.id,r),c=new Map(e.map(Xr)),u=i.map(R=>c.get(R)).filter(Yr);let d;t[2]===Symbol.for("react.memo_cache_sentinel")?(d={activationConstraint:{distance:5}},t[2]=d):d=t[2];let m;t[3]===Symbol.for("react.memo_cache_sentinel")?(m={coordinateGetter:so},t[3]=m):m=t[3];const f=Qn(bt(Xn,d),bt(Yn,m));let x;t[4]!==i||t[5]!==a?(x=R=>{const{active:B,over:U}=R;if(!U||B.id===U.id)return;const F=i.indexOf(B.id),H=i.indexOf(U.id);F===-1||H===-1||a(no([...i],F,H))},t[4]=i,t[5]=a,t[6]=x):x=t[6];const p=x,j=De,I="py-0 px-0 mt-2 flex-1 min-h-0";let g;t[7]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx("div",{className:"h-px bg-border mx-2 mb-2"}),t[7]=g):g=t[7];const k=Le,h="flex flex-1 min-h-0 flex-col overflow-y-auto [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",S=ge,y="gap-2";let v;t[8]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(qr,{}),t[8]=v):v=t[8];const _=eo,M=to,D=Jn,w=Zn;let $;t[9]!==s.slug||t[10]!==l?($=R=>n.jsx(Er,{agent:R,org:s.slug,onUnpin:()=>l(R.id)},R.id),t[9]=s.slug,t[10]=l,t[11]=$):$=t[11];const O=u.map($);let T;t[12]!==D||t[13]!==i||t[14]!==w||t[15]!==O?(T=n.jsx(D,{items:i,strategy:w,children:O}),t[12]=D,t[13]=i,t[14]=w,t[15]=O,t[16]=T):T=t[16];let A;t[17]!==_||t[18]!==p||t[19]!==f||t[20]!==T||t[21]!==M?(A=n.jsx(_,{sensors:f,collisionDetection:M,onDragEnd:p,children:T}),t[17]=_,t[18]=p,t[19]=f,t[20]=T,t[21]=M,t[22]=A):A=t[22];let P;t[23]!==S||t[24]!==A||t[25]!==v?(P=n.jsxs(S,{className:y,children:[v,A]}),t[23]=S,t[24]=A,t[25]=v,t[26]=P):P=t[26];let z;t[27]!==k||t[28]!==P?(z=n.jsx(k,{className:h,children:P}),t[27]=k,t[28]=P,t[29]=z):z=t[29];let L;return t[30]!==j||t[31]!==z||t[32]!==g?(L=n.jsxs(j,{className:I,children:[g,z]}),t[30]=j,t[31]=z,t[32]=g,t[33]=L):L=t[33],L}function Yr(t){return!!t}function Xr(t){return[t.id,t]}function Jr(t){return t.id}function Zr(t){return t.pinned}function xs(){const t=C.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(b.Suspense,{fallback:n.jsx(De,{className:"py-0 px-0",children:n.jsx(Le,{children:n.jsx(ge,{className:"gap-2",children:n.jsx(ie,{children:n.jsxs("div",{className:"flex items-center gap-2 px-2 py-2",children:[n.jsx(Ve,{className:"h-4 w-4 rounded"}),n.jsx(Ve,{className:"h-4 flex-1"})]})})})})}),children:n.jsx(Qr,{})}),t[0]=e):e=t[0],e}function yl(){const t=C.c(4),e=Zt();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(er,{}),t[0]=s):s=t[0];let o;t[1]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(it,{children:n.jsx(b.Suspense,{fallback:null,children:n.jsx(xs,{})})}),t[1]=o):o=t[1];let r;return t[2]!==e?(r=n.jsx(ss,{sections:e,footer:s,additionalContent:o}),t[2]=e,t[3]=r):r=t[3],r}function _l(t){const e=C.c(5),{onClose:s}=t,o=Zt();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(tr,{}),e[0]=r):r=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(it,{children:n.jsx(b.Suspense,{fallback:null,children:n.jsx(xs,{})})}),e[1]=i):i=e[1];let l;return e[2]!==s||e[3]!==o?(l=n.jsx($o,{sections:o,onClose:s,footer:r,additionalContent:i}),e[2]=s,e[3]=o,e[4]=l):l=e[4],l}function ei(t,e){return t===1?!0:t===0?!1:e}function ti(t){const e=t.entityMetadata?.defaultMainView??null,s=e==null||e.type==="chat",o=t.mainParamPresent?t.mainParamValue!=="0":!s,r=s?!0:t.entityMetadata?.chatDefaultOpen??!1;return{mainOpen:o,chatOpen:r}}function Sl(t,e){return t&&e?{chat:45,main:55}:t&&!e?{chat:100,main:0}:!t&&e?{chat:0,main:100}:{chat:0,main:0}}function si(t,e){return t===1?!0:t===0?!1:e}function Cl(t,e){const s=ve(),o=qe({strict:!1}),r=We({strict:!1}),i=Re(),l=Xt(),{locator:a}=pe(),{virtualMcpId:c,orgSlug:u,isAgentRoute:d}=e,m=ti({entityMetadata:t,mainParamPresent:o.main!==void 0,mainParamValue:o.main}),f=si(o.chat,m.chatOpen),x=m.mainOpen,p=b.useRef(crypto.randomUUID()),j=r.taskId??p.current,I="/$org/$taskId",g=w=>({org:u,taskId:w}),k=d?{virtualmcpid:c}:{},h=(w,$)=>{s({to:I,params:g(j),search:O=>({...O,...w}),replace:$?.replace??!1})},S=(w,$)=>{s({to:I,params:g(w),search:O=>{const T={};return $?T.virtualmcpid=$:d&&(T.virtualmcpid=c),O.tasks&&(T.tasks=O.tasks),T}})},y=()=>{x?h({main:"0"},{replace:!0}):h({main:un(t)},{replace:!0})},v=()=>{h({chat:f?0:1},{replace:!0})},_=()=>{f||h({chat:1},{replace:!0})},M=async()=>{const w=crypto.randomUUID(),$=Lt(i,a,j);try{await l.create.mutateAsync({id:w,virtual_mcp_id:c,...$?{branch:$}:{}})}catch{}s({to:I,params:g(w),search:O=>{const T={...k,chat:1};return O.tasks&&(T.tasks=O.tasks),T}})},D=w=>{h({main:w},{replace:!0})};return{taskId:j,mainOpen:x,chatOpen:f,mainParam:o.main,setTaskId:S,toggleMain:y,toggleChat:v,openChat:_,createNewTask:M,openTab:D}}const ut=b.createContext(null);function Nl(t){const e=C.c(15),{children:s}=t,o=ve();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},e[0]=r):r=e[0];const i=qe(r);let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l={owner:"all",status:"open"},e[1]=l):l=e[1];const{tasks:a}=ot(l);let c;e[2]!==i.tasks||e[3]!==a.length?(c=()=>ei(i.tasks,a.length>0),e[2]=i.tasks,e[3]=a.length,e[4]=c):c=e[4];const[u,d]=b.useState(c);let m,f;e[5]!==o||e[6]!==u?(m=()=>{o({search:(g=>({...g,tasks:u?1:0})),replace:!0})},f=[u,o],e[5]=o,e[6]=u,e[7]=m,e[8]=f):(m=e[7],f=e[8]),b.useEffect(m,f);let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=()=>d(ni),e[9]=x):x=e[9];const p=x;let j;e[10]!==u?(j={tasksOpen:u,toggleTasks:p},e[10]=u,e[11]=j):j=e[11];let I;return e[12]!==s||e[13]!==j?(I=n.jsx(ut.Provider,{value:j,children:s}),e[12]=s,e[13]=j,e[14]=I):I=e[14],I}function ni(t){return!t}function kl(){const t=b.useContext(ut);if(!t)throw new Error("useTasksPanelState must be used inside <TasksPanelStateProvider>");return t}function wl(){return b.useContext(ut)}const ps=b.createContext(null);function Ce(){const t=b.use(ps);if(!t)throw new Error("Toolbar.* must be used inside <Toolbar>");return t}function le(t){const e=C.c(10),{children:s}=t,[o,r]=b.useState(null),[i,l]=b.useState(null),[a,c]=b.useState(null),[u,d]=b.useState(null);let m;e[0]!==a||e[1]!==u||e[2]!==i||e[3]!==o?(m={togglesEl:o,setTogglesEl:r,tabsEl:i,setTabsEl:l,centerEl:a,setCenterEl:c,rightEl:u,setRightEl:d},e[0]=a,e[1]=u,e[2]=i,e[3]=o,e[4]=m):m=e[4];let f;e[5]!==s?(f=n.jsx("div",{className:"flex flex-col h-full min-h-0",children:s}),e[5]=s,e[6]=f):f=e[6];let x;return e[7]!==m||e[8]!==f?(x=n.jsx(ps,{value:m,children:f}),e[7]=m,e[8]=f,e[9]=x):x=e[9],x}function oi(t){const e=C.c(2),{children:s}=t;let o;return e[0]!==s?(o=n.jsx("div",{className:"shrink-0 grid grid-cols-3 items-center pl-1 pr-2 pt-0.25 h-12",children:s}),e[0]=s,e[1]=o):o=e[1],o}function ri(t){const e=C.c(2),{children:s}=t;let o;return e[0]!==s?(o=n.jsx("div",{className:"flex items-center gap-0.5 min-w-0 justify-self-start",children:s}),e[0]=s,e[1]=o):o=e[1],o}function ii(t){const e=C.c(2),{children:s}=t;let o;return e[0]!==s?(o=n.jsx("div",{className:"flex items-center justify-end gap-0.5 min-w-0 justify-self-end",children:s}),e[0]=s,e[1]=o):o=e[1],o}function li(){const t=C.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("button",{type:"button",onClick:ci,className:"flex size-7 shrink-0 items-center justify-center rounded-md text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Go back",children:n.jsx(gn,{size:16})}),t[0]=e):e=t[0];let s;return t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsxs(n.Fragment,{children:[e,n.jsx("button",{type:"button",onClick:ai,className:"flex size-7 shrink-0 items-center justify-center rounded-md text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Go forward",children:n.jsx(go,{size:16})})]}),t[1]=s):s=t[1],s}function ai(){return window.history.forward()}function ci(){return window.history.back()}function di(){const t=C.c(2),{setCenterEl:e}=Ce();let s;return t[0]!==e?(s=n.jsx("div",{ref:e,className:"min-w-0 flex items-center justify-center gap-2"}),t[0]=e,t[1]=s):s=t[1],s}function ui(t){const e=C.c(3),{children:s}=t,{centerEl:o}=Ce();if(!o)return null;let r;return e[0]!==o||e[1]!==s?(r=Ee.createPortal(s,o),e[0]=o,e[1]=s,e[2]=r):r=e[2],r}function mi(){const t=C.c(2),{setTabsEl:e}=Ce();let s;return t[0]!==e?(s=n.jsx("div",{ref:e,className:"shrink-0 flex items-center"}),t[0]=e,t[1]=s):s=t[1],s}function fi(t){const e=C.c(3),{children:s}=t,{tabsEl:o}=Ce();if(!o)return null;let r;return e[0]!==s||e[1]!==o?(r=Ee.createPortal(s,o),e[0]=s,e[1]=o,e[2]=r):r=e[2],r}function xi(){const t=C.c(2),{setTogglesEl:e}=Ce();let s;return t[0]!==e?(s=n.jsx("div",{ref:e,className:"flex items-center gap-0.5 shrink-0 ml-0.5"}),t[0]=e,t[1]=s):s=t[1],s}function pi(t){const e=C.c(3),{children:s}=t,{togglesEl:o}=Ce();if(!o)return null;let r;return e[0]!==s||e[1]!==o?(r=Ee.createPortal(s,o),e[0]=s,e[1]=o,e[2]=r):r=e[2],r}function hi(){const t=C.c(2),{setRightEl:e}=Ce();let s;return t[0]!==e?(s=n.jsx("div",{ref:e,className:"flex items-center justify-end gap-0.5 shrink-0"}),t[0]=e,t[1]=s):s=t[1],s}function gi(t){const e=C.c(3),{children:s}=t,{rightEl:o}=Ce();if(!o)return null;let r;return e[0]!==s||e[1]!==o?(r=Ee.createPortal(s,o),e[0]=s,e[1]=o,e[2]=r):r=e[2],r}le.Header=oi;le.LeftColumn=ri;le.RightColumn=ii;le.Nav=li;le.CenterSlot=di;le.Center=ui;le.TabsSlot=mi;le.Tabs=fi;le.TogglesSlot=xi;le.Toggles=pi;le.RightSlot=hi;le.Right=gi;function bi(){const t=C.c(6),{org:e,locator:s}=pe(),o=Re();let r;t[0]!==s||t[1]!==o?(r=()=>{o.invalidateQueries({queryKey:Pt.tasksPrefix(s)})},t[0]=s,t[1]=o,t[2]=r):r=t[2];let i;t[3]!==e.slug||t[4]!==r?(i={orgSlug:e.slug,onTaskStatus:r},t[3]=e.slug,t[4]=r,t[5]=i):i=t[5],jo(i)}function ji(t){const e=C.c(8),{virtualMcpId:s,size:o,showAutomationBadge:r}=t,i=o===void 0?"sm":o;let l;e[0]!==i||e[1]!==s?(l=s?n.jsx(vi,{virtualMcpId:s,size:i}):n.jsx(Pe,{icon:null,name:"?",size:i}),e[0]=i,e[1]=s,e[2]=l):l=e[2];let a;e[3]!==r?(a=r&&n.jsx("span",{"aria-label":"Automation-triggered",className:"absolute -bottom-0.5 -right-0.5 flex size-4 items-center justify-center rounded-full bg-blue-500 border border-blue-600 text-white",children:n.jsx(vo,{size:10,className:"text-white"})}),e[3]=r,e[4]=a):a=e[4];let c;return e[5]!==l||e[6]!==a?(c=n.jsxs("div",{className:"relative shrink-0",children:[l,a]}),e[5]=l,e[6]=a,e[7]=c):c=e[7],c}function vi(t){const e=C.c(6),{virtualMcpId:s,size:o}=t,r=Qt(s);if(!r){let a;return e[0]!==o?(a=n.jsx(Pe,{icon:null,name:"?",size:o}),e[0]=o,e[1]=a):a=e[1],a}const i=r.icon??null;let l;return e[2]!==r.title||e[3]!==o||e[4]!==i?(l=n.jsx(Pe,{icon:i,name:r.title,size:o}),e[2]=r.title,e[3]=o,e[4]=i,e[5]=l):l=e[5],l}function yi(t){const e=t?.metadata?.githubRepo;return e?.connectionId&&t?.connections?.some(o=>o.connection_id===e.connectionId)?e:null}function _i(t){const e=C.c(47),{task:s,isActive:o,onClick:r,onArchive:i,showAutomationBadge:l}=t,a=yo(s.status),c=a.icon,u=Qt(s.virtual_mcp_id);let d;e[0]!==u?(d=yi(u),e[0]=u,e[1]=d):d=e[1];const m=d,f=b.useRef(null);let x;e[2]!==o?(x=()=>{if(!o)return;const V=f.current;V&&(V.focus({preventScroll:!0}),V.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"}))},e[2]=o,e[3]=x):x=e[3];let p;e[4]!==o||e[5]!==s.id?(p=[o,s.id],e[4]=o,e[5]=s.id,e[6]=p):p=e[6],b.useEffect(x,p);const j="button",I=0;let g;e[7]!==r?(g=V=>{V.target===V.currentTarget&&(V.key==="Enter"||V.key===" ")&&(V.preventDefault(),r())},e[7]=r,e[8]=g):g=e[8];const k=o?"bg-accent":"hover:bg-accent/60";let h;e[9]!==k?(h=J("group/row flex items-center gap-3 px-2 py-1.5 rounded-md cursor-pointer transition-colors","focus-visible:outline-none focus-visible:inset-ring-2 focus-visible:inset-ring-ring/50",k),e[9]=k,e[10]=h):h=e[10];let S;e[11]!==l||e[12]!==s.virtual_mcp_id?(S=n.jsx(ji,{virtualMcpId:s.virtual_mcp_id,size:"xs",showAutomationBadge:l}),e[11]=l,e[12]=s.virtual_mcp_id,e[13]=S):S=e[13];const y=s.title||"Untitled task";let v;e[14]!==y?(v=n.jsx("div",{className:"text-sm text-foreground truncate",children:y}),e[14]=y,e[15]=v):v=e[15];let _;e[16]!==m||e[17]!==s.branch||e[18]!==s.updated_at?(_=s.updated_at&&n.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground min-w-0",children:[s.branch?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"truncate font-mono",children:s.branch}),n.jsx("span",{className:"shrink-0",children:"·"})]}):m?n.jsxs(n.Fragment,{children:[n.jsxs("span",{className:"truncate",children:[m.owner,"/",m.name]}),n.jsx("span",{className:"shrink-0",children:"·"})]}):null,n.jsx("span",{className:"shrink-0",children:mn(new Date(s.updated_at))})]}),e[16]=m,e[17]=s.branch,e[18]=s.updated_at,e[19]=_):_=e[19];let M;e[20]!==v||e[21]!==_?(M=n.jsxs("div",{className:"flex-1 min-w-0",children:[v,_]}),e[20]=v,e[21]=_,e[22]=M):M=e[22];const D="shrink-0 grid [grid-template-areas:'slot'] items-center justify-items-center",w="[grid-area:slot] flex size-7 items-center justify-center group-hover/row:invisible",$=a.label,O=14,T=J(a.iconClassName,s.status==="in_progress"&&"animate-spin");let A;e[23]!==c||e[24]!==T?(A=n.jsx(c,{size:O,className:T}),e[23]=c,e[24]=T,e[25]=A):A=e[25];let P;e[26]!==a||e[27]!==A?(P=n.jsx("span",{className:w,"aria-label":$,children:A}),e[26]=a,e[27]=A,e[28]=P):P=e[28];let z;e[29]!==i?(z=V=>{V.stopPropagation(),i()},e[29]=i,e[30]=z):z=e[30];let L;e[31]===Symbol.for("react.memo_cache_sentinel")?(L=n.jsx(nn,{size:14}),e[31]=L):L=e[31];let R;e[32]!==z?(R=n.jsx(tt,{asChild:!0,children:n.jsx("button",{type:"button","aria-label":"Archive task",onClick:z,className:"[grid-area:slot] invisible group-hover/row:visible flex size-7 items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-muted",children:L})}),e[32]=z,e[33]=R):R=e[33];let B;e[34]===Symbol.for("react.memo_cache_sentinel")?(B=n.jsx(st,{side:"right",children:"Archive"}),e[34]=B):B=e[34];let U;e[35]!==R?(U=n.jsxs(nt,{children:[R,B]}),e[35]=R,e[36]=U):U=e[36];let F;e[37]!==P||e[38]!==U?(F=n.jsxs("div",{className:D,children:[P,U]}),e[37]=P,e[38]=U,e[39]=F):F=e[39];let H;return e[40]!==r||e[41]!==M||e[42]!==F||e[43]!==g||e[44]!==h||e[45]!==S?(H=n.jsxs("div",{ref:f,role:j,tabIndex:I,onClick:r,onKeyDown:g,className:h,children:[S,M,F]}),e[40]=r,e[41]=M,e[42]=F,e[43]=g,e[44]=h,e[45]=S,e[46]=H):H=e[46],H}const hs={all:"All tasks",manual:"Chats",automation:"Automation"},gs={all:"All members",mine:"Mine only"};function Si(t){const e=C.c(59),{title:s,tasks:o,activeTaskId:r,onSelect:i,onArchive:l,onNew:a,showNewButton:c,showAutomationBadge:u,emptyLabel:d,currentUserId:m}=t,[f,x]=b.useState("all"),[p,j]=b.useState("mine");let I;e[0]!==m||e[1]!==p||e[2]!==o?(I=p==="mine"&&m?o.filter(N=>N.created_by===m):o,e[0]=m,e[1]=p,e[2]=o,e[3]=I):I=e[3];const g=I;let k;e[4]!==f||e[5]!==g?(k=f==="automation"?g.filter(wi):f==="manual"?g.filter(ki):g,e[4]=f,e[5]=g,e[6]=k):k=e[6];const h=k;let S;e[7]!==s?(S=n.jsx("span",{children:s}),e[7]=s,e[8]=S):S=e[8];let y;e[9]!==p?(y=n.jsx(vt,{asChild:!0,children:n.jsx("button",{type:"button","aria-label":"Filter by member",className:"flex size-8 items-center justify-center rounded-md hover:bg-muted hover:text-foreground",children:p==="mine"?n.jsx(rn,{size:16}):n.jsx(Vt,{size:16})})}),e[9]=p,e[10]=y):y=e[10];let v;e[11]!==p?(v=N=>{const K=N;K!==p&&se("tasks_panel_member_filter_changed",{to_value:K}),j(K)},e[11]=p,e[12]=v):v=e[12];let _;e[13]===Symbol.for("react.memo_cache_sentinel")?(_=Object.keys(gs),e[13]=_):_=e[13];let M;e[14]===Symbol.for("react.memo_cache_sentinel")?(M=_.map(Ni),e[14]=M):M=e[14];let D;e[15]!==p||e[16]!==v?(D=n.jsx(yt,{align:"end",children:n.jsx(_t,{value:p,onValueChange:v,children:M})}),e[15]=p,e[16]=v,e[17]=D):D=e[17];let w;e[18]!==y||e[19]!==D?(w=n.jsxs(St,{children:[y,D]}),e[18]=y,e[19]=D,e[20]=w):w=e[20];const $=f!=="all"&&"text-purple-500";let O;e[21]!==$?(O=J("flex size-8 items-center justify-center rounded-md hover:bg-muted hover:text-foreground",$),e[21]=$,e[22]=O):O=e[22];let T;e[23]===Symbol.for("react.memo_cache_sentinel")?(T=n.jsx(xn,{size:16}),e[23]=T):T=e[23];let A;e[24]!==O?(A=n.jsx(vt,{asChild:!0,children:n.jsx("button",{type:"button","aria-label":"Filter tasks",className:O,children:T})}),e[24]=O,e[25]=A):A=e[25];let P;e[26]!==f?(P=N=>{const K=N;K!==f&&se("tasks_panel_filter_changed",{to_value:K}),x(K)},e[26]=f,e[27]=P):P=e[27];let z;e[28]===Symbol.for("react.memo_cache_sentinel")?(z=Object.keys(hs),e[28]=z):z=e[28];let L;e[29]===Symbol.for("react.memo_cache_sentinel")?(L=z.map(Ci),e[29]=L):L=e[29];let R;e[30]!==f||e[31]!==P?(R=n.jsx(yt,{align:"end",children:n.jsx(_t,{value:f,onValueChange:P,children:L})}),e[30]=f,e[31]=P,e[32]=R):R=e[32];let B;e[33]!==A||e[34]!==R?(B=n.jsxs(St,{children:[A,R]}),e[33]=A,e[34]=R,e[35]=B):B=e[35];let U;e[36]!==a||e[37]!==c||e[38]!==s?(U=c&&a&&n.jsx("button",{type:"button",onClick:()=>{se("tasks_panel_new_clicked"),a()},"aria-label":`New ${s.toLowerCase()}`,className:"flex size-8 items-center justify-center rounded-md hover:bg-muted hover:text-foreground",children:n.jsx(on,{size:16})}),e[36]=a,e[37]=c,e[38]=s,e[39]=U):U=e[39];let F;e[40]!==B||e[41]!==U||e[42]!==w?(F=n.jsxs("div",{className:"flex items-center gap-0.5",children:[w,B,U]}),e[40]=B,e[41]=U,e[42]=w,e[43]=F):F=e[43];let H;e[44]!==F||e[45]!==S?(H=n.jsxs("div",{className:"shrink-0 pl-2 pr-1.5 h-7 flex items-center justify-between text-xs font-medium text-muted-foreground mb-1",children:[S,F]}),e[44]=F,e[45]=S,e[46]=H):H=e[46];let V;e[47]!==r||e[48]!==d||e[49]!==l||e[50]!==i||e[51]!==u||e[52]!==h?(V=h.length===0&&d?n.jsx("div",{className:"px-2 py-1.5 text-xs text-muted-foreground/70",children:d}):h.map(N=>n.jsx(_i,{task:N,isActive:r===N.id,onClick:()=>{r!==N.id&&se("tasks_panel_task_clicked",{thread_id:N.id,virtual_mcp_id:N.virtual_mcp_id??null,from_automation:!!N.fromAutomation}),i(N)},onArchive:()=>{se("tasks_panel_task_archived",{thread_id:N.id,virtual_mcp_id:N.virtual_mcp_id??null}),l(N)},showAutomationBadge:u||N.fromAutomation},N.id)),e[47]=r,e[48]=d,e[49]=l,e[50]=i,e[51]=u,e[52]=h,e[53]=V):V=e[53];let q;e[54]!==V?(q=n.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto flex flex-col gap-0.5",children:V}),e[54]=V,e[55]=q):q=e[55];let Q;return e[56]!==H||e[57]!==q?(Q=n.jsxs("div",{className:"flex flex-col h-full min-h-0 mt-1",children:[H,q]}),e[56]=H,e[57]=q,e[58]=Q):Q=e[58],Q}function Ci(t){return n.jsx(Jt,{value:t,children:hs[t]},t)}function Ni(t){return n.jsx(Jt,{value:t,children:gs[t]},t)}function ki(t){return!t.fromAutomation}function wi(t){return t.fromAutomation}function Ii(){const t=C.c(23);bi();const{data:e}=Se.useSession(),s=e?.user?.id;let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={owner:"me",status:"open",hasTrigger:!1},t[0]=o):o=t[0];const{tasks:r}=ot(o);let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i={owner:"all",status:"open",hasTrigger:!0},t[1]=i):i=t[1];const{tasks:l}=ot(i),{setTaskId:a,createNewTask:c}=Dt();let u;t[2]===Symbol.for("react.memo_cache_sentinel")?(u={strict:!1},t[2]=u):u=t[2];const d=We(u),{locator:m,org:f}=pe(),x=Re();let p;t[3]!==f.id||t[4]!==f.slug?(p={connectionId:Kt,orgId:f.id,orgSlug:f.slug},t[3]=f.id,t[4]=f.slug,t[5]=p):p=t[5];const j=Wt(p),I=d.taskId??null;let g;t[6]!==l||t[7]!==r?(g=[...r,...l.map($i)].sort(Mi),t[6]=l,t[7]=r,t[8]=g):g=t[8];const k=g;let h;t[9]!==j||t[10]!==m||t[11]!==x?(h=async _=>{try{await ho(j,_.id,{hidden:!0}),x.invalidateQueries({queryKey:Pt.tasksPrefix(m)})}catch(M){const w=M;je.error(`Failed to archive task: ${w.message}`)}},t[9]=j,t[10]=m,t[11]=x,t[12]=h):h=t[12];const S=h;if(k.length===0){let _;return t[13]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsx("div",{className:"h-full flex items-center justify-center p-4",children:n.jsx(bo,{image:n.jsx(ln,{size:48,className:"text-muted-foreground"}),title:"No tasks yet",description:"Start a conversation to create your first task."})}),t[13]=_):_=t[13],_}let y;t[14]!==a?(y=_=>a(_.id,_.virtual_mcp_id),t[14]=a,t[15]=y):y=t[15];let v;return t[16]!==I||t[17]!==k||t[18]!==c||t[19]!==s||t[20]!==S||t[21]!==y?(v=n.jsx("div",{className:"flex flex-col h-full min-h-0 p-2 gap-3",children:n.jsx(Si,{title:"Tasks",tasks:k,activeTaskId:I,onSelect:y,onArchive:S,onNew:c,showNewButton:!0,currentUserId:s})}),t[16]=I,t[17]=k,t[18]=c,t[19]=s,t[20]=S,t[21]=y,t[22]=v):v=t[22],v}function Mi(t,e){return(e.updated_at??"").localeCompare(t.updated_at??"")}function $i(t){return{...t,fromAutomation:!0}}function Ti(){const t=C.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"flex flex-col h-full p-2 gap-1.5",children:Array.from({length:6}).map(Ai)}),t[0]=e):e=t[0],e}function Ai(t,e){return n.jsx("div",{className:"h-10 rounded-md bg-muted/60 animate-pulse"},e)}function Il(){const t=C.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(qn.Skeleton,{}),t[0]=e):e=t[0];let s;return t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(it,{fallback:e,children:n.jsx(b.Suspense,{fallback:n.jsx(Ti,{}),children:n.jsx(Ii,{})})}),t[1]=s):s=t[1],s}export{yl as S,Il as T,Nl as a,le as b,Sl as c,wl as d,Cl as e,_l as f,yi as g,kl as u};
|
|
1
|
+
import{e as C,s as pe,f as ve,U as It,g as We,d as qe,W as ys,X as _s,Y as Ss,j as n,Z as Cs,c as J,t as se,r as b,$ as Mt,a0 as $t,H as Ns,J as ks,C as ws,z as Is,a as Ms,B as et,b as Se,a1 as $s,P as Tt,x as je,a2 as Ts,a3 as As,o as Re,a4 as Ps,a5 as Os,a6 as zs,a7 as Rs,a8 as Oe,a9 as Es,aa as Ds,ab as Ls,ac as Fs,ad as At,ae as Us,af as Gs,ag as Bs,ah as Hs,ai as Vs,aj as Ks,ak as Ws,al as qs,am as Qs,an as Ys,ao as Ee,L as Xs,E as it,K as Pt}from"./index-BV4BlnS9.js";import{p as Js,g as Zs,C as en,D as mt,E as ft,F as tn,G as xt,H as sn,A as Pe,I as nn,k as on,J as rn,K as ln}from"./agent-icon-C2zAhw3X.js";import{i as an,f as De,g as Le,h as ge,u as Qe,j as he,k as ie,l as Ot,m as zt,n as cn,o as Rt,p as Et}from"./index-AqmdpH5c.js";import{u as Dt,r as Lt}from"./shell-layout-BcsYrOTT.js";import{f as dn,g as un,h as mn}from"./pair-Hj9vutgK.js";import{S as Ve}from"./skeleton-DLT024S3.js";import{b as lt,P as at,a as ct}from"./popover-9-i1guS1.js";import{b as Ft,a as Ut,D as Gt}from"./drawer-CyXE-C5x.js";import{A as pt}from"./avatar-D0sdobqD.js";import{u as Bt,a as tt,b as st,c as ht,T as nt}from"./tooltip-DZT-1bal.js";import{i as Ht}from"./Check-DC_iCN8Z.js";import{c as gt,a as fn,e as xn}from"./XCircle-DokNvYvs.js";import{i as pn,b as hn,n as gn}from"./ZapSquare-CnxL4Bs1.js";import{n as bn,a as jn,i as vn}from"./Sun-Dc78AQrj.js";import{s as Ke}from"./Plus-BYimMcAW.js";import{a as Ye}from"./Settings02-BxmxMTOA.js";import{i as yn}from"./Shield01-B9vNkAc4.js";import{a as Vt}from"./Users03-CIZBy7k3.js";import{f as _n,a as Sn,b as Cn,c as Nn,d as kn,e as wn,A as In}from"./alert-dialog-BytOwrWo.js";import{F as Mn,a as $n,b as Tn,c as An,d as Pn,e as On,f as zn}from"./form-BMjsxf1O.js";import{I as Rn}from"./input-Bs7mkNsF.js";import{S as En}from"./index-B8A_ReFj.js";import"./index-CEyiW6G-.js";import{s as Dn}from"./XClose-BdbZPqCd.js";import{S as Kt,u as Wt,W as ze,i as Ln,b as Fn}from"./constants-Dm1wnwL3.js";import{u as Un}from"./use-mcp-tools-rNZ6JWxz.js";import{u as Gn}from"./use-ai-providers-Bv-kgplO.js";import{A as Bn,b as Hn,S as Vn,c as Kn,d as Wn,C as qn}from"./index-D85QLvNR.js";import{u as Qn,a as bt,K as Yn,P as Xn,S as Jn,v as Zn,D as eo,c as to,s as so,b as no,d as oo,C as ro,e as io}from"./collection-search-bjPRZI3g.js";import{i as jt}from"./X-QdBx5oCM.js";import{b as qt,u as Qt}from"./use-virtual-mcp-BR6mzHHD.js";import{u as Yt,a as lo}from"./use-navigate-to-agent-CwcBoswU.js";import{u as ao}from"./use-create-virtual-mcp-CTxthd0a.js";import{I as co,a as uo,S as mo,L as fo,b as xo,G as po}from"./lean-canvas-recruit-modal-BkH3ZJD2.js";import{u as Xt}from"./use-tasks-DqNLNkkM.js";import{e as ot,f as ho}from"./chat-context-iq-Q-O9L.js";import{i as go}from"./ChevronRight-X2lm_E9M.js";import{E as bo}from"./empty-state-Crsog8CF.js";import{u as jo}from"./use-decopilot-events-tgKj5crX.js";import{g as Jt,a as vt,b as yt,h as _t,D as St}from"./dropdown-menu-BkrpBFy3.js";import{i as vo}from"./Zap-DH1KrJ0w.js";import{g as yo}from"./task-status-IiU7o7it.js";function Zt(){const t=C.c(77),{org:e}=pe(),s=ve(),o=It(),{setTasksOpen:r,openTab:i}=Dt(),l=e.slug,a=pe().project;let c;t[0]===Symbol.for("react.memo_cache_sentinel")?(c={strict:!1},t[0]=c):c=t[0];const u=We(c);let d;t[1]===Symbol.for("react.memo_cache_sentinel")?(d={strict:!1},t[1]=d):d=t[1];const m=qe(d),f=o.location.pathname;let x;t[2]!==a.enabledPlugins?(x=a.enabledPlugins??[],t[2]=a.enabledPlugins,t[3]=x):x=t[3];const p=x;let j;t[4]!==a.ui?(j=a.ui?.pinnedViews??[],t[4]=a.ui,t[5]=j):j=t[5];const I=j;let g,k,h,S;if(t[6]!==a.id||t[7]!==p||t[8]!==s||t[9]!==l||t[10]!==u.pluginId||t[11]!==u.taskId||t[12]!==m.virtualmcpid){let N;t[17]!==p?(N=X=>p.includes(X.pluginId),t[17]=p,t[18]=N):N=t[18];const K=ys.filter(N),W=m.virtualmcpid??a.id;k=!!m.virtualmcpid;const G=u.taskId??"",Y=u.pluginId;let ee;t[19]!==Y?(ee=X=>Y===X,t[19]=Y,t[20]=ee):ee=t[20],g=ee;let Z;t[21]!==G||t[22]!==s||t[23]!==l||t[24]!==W?(Z=X=>{const oe=G||crypto.randomUUID();s({to:"/$org/$taskId/$pluginId",params:{org:l,taskId:oe,pluginId:X},search:ae=>({...ae,virtualmcpid:W})})},t[21]=G,t[22]=s,t[23]=l,t[24]=W,t[25]=Z):Z=t[25],h=Z;let ne;t[26]!==g||t[27]!==h?(ne=X=>({key:X.pluginId,label:X.label,icon:X.icon,isActive:g(X.pluginId),onClick:()=>h(X.pluginId)}),t[26]=g,t[27]=h,t[28]=ne):ne=t[28],S=K.map(ne),t[6]=a.id,t[7]=p,t[8]=s,t[9]=l,t[10]=u.pluginId,t[11]=u.taskId,t[12]=m.virtualmcpid,t[13]=g,t[14]=k,t[15]=h,t[16]=S}else g=t[13],k=t[14],h=t[15],S=t[16];const y=S;let v;if(t[29]!==p||t[30]!==g||t[31]!==h){let N;t[33]!==p?(N=G=>p.includes(G.pluginId),t[33]=p,t[34]=N):N=t[34];const K=_s.filter(N);let W;t[35]!==g||t[36]!==h?(W=G=>({type:"group",group:{id:`${G.pluginId}-${G.id}`,label:G.label,items:G.items.map((Y,ee)=>({key:`${G.pluginId}-${G.id}-${ee}`,label:Y.label,icon:Y.icon,isActive:g(G.pluginId),onClick:()=>h(G.pluginId)})),defaultExpanded:G.defaultExpanded??!0}}),t[35]=g,t[36]=h,t[37]=W):W=t[37],v=K.map(W),t[29]=p,t[30]=g,t[31]=h,t[32]=v}else v=t[32];const _=v;let M;if(t[38]!==i||t[39]!==I){let N;t[41]!==i?(N=K=>{const W=Js(K.icon),G=W.type==="icon"?Zs(W.name):null;return{key:`app-${K.connectionId}-${K.toolName}`,label:K.label||K.toolName,icon:G?n.jsx(G,{size:16,className:"text-muted-foreground"}):W.type==="url"?n.jsx("img",{src:W.url,alt:"",className:"size-4 rounded"}):n.jsx(an,{size:16,className:"text-muted-foreground"}),isActive:!1,onClick:()=>i(dn(K.connectionId,K.toolName))}},t[41]=i,t[42]=N):N=t[42],M=I.map(N),t[38]=i,t[39]=I,t[40]=M}else M=t[40];const D=M;let w;t[43]!==D?(w=D.length>0?{type:"group",group:{id:"apps",label:"Apps",items:D,defaultExpanded:!0}}:null,t[43]=D,t[44]=w):w=t[44];const $=w;let O;t[45]===Symbol.for("react.memo_cache_sentinel")?(O=n.jsx(en,{className:"size-4!"}),t[45]=O):O=t[45];const T=f===`/${l}`||f===`/${l}/`;let A;t[46]!==s||t[47]!==l||t[48]!==r?(A=()=>{r(!1),s({to:"/$org",params:{org:l}})},t[46]=s,t[47]=l,t[48]=r,t[49]=A):A=t[49];let P;t[50]!==A||t[51]!==T?(P={key:"home",label:"Home",icon:O,isActive:T,onClick:A},t[50]=A,t[51]=T,t[52]=P):P=t[52];const z=P;let L;t[53]!==p?(L=p.includes(Ss),t[53]=p,t[54]=L):L=t[54];const R=L;let B;t[55]===Symbol.for("react.memo_cache_sentinel")?(B=n.jsx(Cs,{className:"size-4!"}),t[55]=B):B=t[55];let U;t[56]!==l||t[57]!==f?(U=f.startsWith(`/${l}/settings/workflows`),t[56]=l,t[57]=f,t[58]=U):U=t[58];let F;t[59]!==s||t[60]!==l?(F=()=>s({to:"/$org/settings/workflows",params:{org:l}}),t[59]=s,t[60]=l,t[61]=F):F=t[61];let H;t[62]!==U||t[63]!==F?(H={key:"workflows",label:"Workflows",icon:B,isActive:U,onClick:F},t[62]=U,t[63]=F,t[64]=H):H=t[64];const V=H;let q;if(t[65]!==z||t[66]!==k||t[67]!==R||t[68]!==V){const N=[z];k&&R&&N.push(V),q={type:"items",items:N},t[65]=z,t[66]=k,t[67]=R,t[68]=V,t[69]=q}else q=t[69];let Q;if(t[70]!==$||t[71]!==_||t[72]!==y||t[73]!==q){if(Q=[q],y.length>0){let N;t[75]!==y?(N={type:"items",items:y},t[75]=y,t[76]=N):N=t[76],Q.push(N)}_.length>0&&Q.push(..._),$&&Q.push($),t[70]=$,t[71]=_,t[72]=y,t[73]=q,t[74]=Q}else Q=t[74];return Q}function es(t){const e=C.c(3),{children:s}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx("div",{className:"flex h-6 items-center",children:n.jsx("div",{className:"h-0.5 w-16 rounded-full bg-sidebar-foreground/15"})}),e[0]=o):o=e[0];let r;return e[1]!==s?(r=n.jsxs(De,{className:"pt-0 pr-0 pb-2 pl-0 mt-2",children:[o,n.jsx(Le,{children:n.jsx(ge,{className:"gap-0.5",children:s})})]}),e[1]=s,e[2]=r):r=e[2],r}function _o(){const t=C.c(7),s=Mt().logo??$t,o=typeof s=="string"?s:s.light,r=typeof s=="string"?s:s.dark;let i;t[0]!==o?(i=n.jsx("img",{src:o,alt:"Logo",className:"size-6 object-contain dark:hidden"}),t[0]=o,t[1]=i):i=t[1];let l;t[2]!==r?(l=n.jsx("img",{src:r,alt:"Logo",className:"size-6 object-contain hidden dark:block"}),t[2]=r,t[3]=l):l=t[3];let a;return t[4]!==i||t[5]!==l?(a=n.jsx(Rt,{className:"flex items-center justify-center shrink-0 px-2 pb-0",children:n.jsxs("div",{className:"flex w-full aspect-square items-center justify-center",children:[i,l]})}),t[4]=i,t[5]=l,t[6]=a):a=t[6],a}function ts(t){const e=C.c(15),{item:s}=t,{isMobile:o,setOpenMobile:r}=Qe();let i;e[0]!==o||e[1]!==s||e[2]!==r?(i=()=>{se("nav_item_clicked",{nav_key:s.key,nav_label:s.label,is_active:!!s.isActive,is_mobile:o}),s.onClick?.(),o&&r(!1)},e[0]=o,e[1]=s,e[2]=r,e[3]=i):i=e[3];const l=i,a=s.key,c=s.isActive&&"z-10";let u;e[4]!==c?(u=J(c),e[4]=c,e[5]=u):u=e[5];let d;e[6]!==l||e[7]!==s.icon||e[8]!==s.isActive||e[9]!==s.label?(d=n.jsx(he,{onClick:l,isActive:s.isActive,tooltip:s.label,className:"bg-muted/75",children:s.icon}),e[6]=l,e[7]=s.icon,e[8]=s.isActive,e[9]=s.label,e[10]=d):d=e[10];let m;return e[11]!==s.key||e[12]!==u||e[13]!==d?(m=n.jsx(ie,{className:u,children:d},a),e[11]=s.key,e[12]=u,e[13]=d,e[14]=m):m=e[14],m}function So(t){const e=C.c(12),{section:s}=t;switch(s.type){case"divider":{let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(Ot,{className:"my-2"}),e[0]=o):o=e[0],o}case"spacer":{let o;return e[1]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx("div",{className:"flex-1"}),e[1]=o):o=e[1],o}case"group":{const o=s.group.label,r=s.group.defaultExpanded;let i;e[2]!==s.group.items?(i=s.group.items.map(No),e[2]=s.group.items,e[3]=i):i=e[3];let l;return e[4]!==s.group.defaultExpanded||e[5]!==s.group.label||e[6]!==i?(l=n.jsx(es,{label:o,defaultExpanded:r,children:i}),e[4]=s.group.defaultExpanded,e[5]=s.group.label,e[6]=i,e[7]=l):l=e[7],l}case"items":{let o;e[8]!==s.items?(o=s.items.map(Co),e[8]=s.items,e[9]=o):o=e[9];let r;return e[10]!==o?(r=n.jsx(De,{className:"pt-0 pr-0 pb-0 pl-0",children:n.jsx(Le,{children:n.jsx(ge,{className:"gap-1.5",children:o})})}),e[10]=o,e[11]=r):r=e[11],r}}}function Co(t){return n.jsx(ts,{item:t},t.key)}function No(t){return n.jsx(ts,{item:t},t.key)}function ko(t){const e=C.c(14),{sections:s,header:o,footer:r,additionalContent:i,variant:l,contentClassName:a}=t,c=l===void 0?"sidebar":l;let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(b.Suspense,{fallback:n.jsx("div",{className:"h-10 shrink-0"}),children:n.jsx(_o,{})}),e[0]=u):u=e[0];let d;e[1]!==a?(d=J("flex flex-col flex-1 px-2 py-2 gap-0",a),e[1]=a,e[2]=d):d=e[2];let m;e[3]!==s?(m=s.map(wo),e[3]=s,e[4]=m):m=e[4];let f;e[5]!==i||e[6]!==d||e[7]!==m?(f=n.jsxs(zt,{className:d,children:[m,i]}),e[5]=i,e[6]=d,e[7]=m,e[8]=f):f=e[8];let x;return e[9]!==r||e[10]!==o||e[11]!==f||e[12]!==c?(x=n.jsxs(cn,{variant:c,children:[u,o,f,r]}),e[9]=r,e[10]=o,e[11]=f,e[12]=c,e[13]=x):x=e[13],x}function wo(t,e){return n.jsx(So,{section:t},e)}function ss(t){const e=C.c(2);let s;return e[0]!==t?(s=n.jsx(ko,{...t}),e[0]=t,e[1]=s):s=e[1],s}ss.Skeleton=function(){return n.jsx("div",{className:"flex flex-col gap-0.5",children:Array.from({length:8}).map((e,s)=>n.jsx("div",{className:"w-full h-8",children:n.jsx(Ve,{className:"h-full bg-sidebar-accent rounded-md"})},s))})};function Io(){const t=C.c(7),s=Mt().logo??$t,o=typeof s=="string"?s:s.light,r=typeof s=="string"?s:s.dark;let i;t[0]!==o?(i=n.jsx("img",{src:o,alt:"Logo",className:"size-6 object-contain dark:hidden"}),t[0]=o,t[1]=i):i=t[1];let l;t[2]!==r?(l=n.jsx("img",{src:r,alt:"Logo",className:"size-6 object-contain hidden dark:block"}),t[2]=r,t[3]=l):l=t[3];let a;return t[4]!==i||t[5]!==l?(a=n.jsx(Rt,{className:"flex items-center justify-center shrink-0 px-2 pb-0",children:n.jsxs("div",{className:"flex w-full aspect-square items-center justify-center",children:[i,l]})}),t[4]=i,t[5]=l,t[6]=a):a=t[6],a}function Ct(t){const e=C.c(15),{item:s,onClose:o}=t,r=s.isActive&&"z-10";let i;e[0]!==r?(i=J(r),e[0]=r,e[1]=i):i=e[1];let l;e[2]!==s||e[3]!==o?(l=()=>{s.onClick?.(),o()},e[2]=s,e[3]=o,e[4]=l):l=e[4];let a;e[5]!==s.icon?(a=n.jsx("span",{className:"[&>svg]:size-8",children:s.icon}),e[5]=s.icon,e[6]=a):a=e[6];let c;e[7]!==s.isActive||e[8]!==s.label||e[9]!==l||e[10]!==a?(c=n.jsx(he,{onClick:l,isActive:s.isActive,tooltip:s.label,className:"bg-muted/75",children:a}),e[7]=s.isActive,e[8]=s.label,e[9]=l,e[10]=a,e[11]=c):c=e[11];let u;return e[12]!==i||e[13]!==c?(u=n.jsx(ie,{className:i,children:c}),e[12]=i,e[13]=c,e[14]=u):u=e[14],u}function Mo(t){const e=C.c(18),{section:s,onClose:o}=t;switch(s.type){case"divider":{let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(Ot,{className:"my-2"}),e[0]=r):r=e[0],r}case"spacer":{let r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx("div",{className:"flex-1"}),e[1]=r):r=e[1],r}case"group":{const r=s.group.label,i=s.group.defaultExpanded;let l;if(e[2]!==o||e[3]!==s.group.items){let c;e[5]!==o?(c=u=>n.jsx(Ct,{item:u,onClose:o},u.key),e[5]=o,e[6]=c):c=e[6],l=s.group.items.map(c),e[2]=o,e[3]=s.group.items,e[4]=l}else l=e[4];let a;return e[7]!==s.group.defaultExpanded||e[8]!==s.group.label||e[9]!==l?(a=n.jsx(es,{label:r,defaultExpanded:i,children:l}),e[7]=s.group.defaultExpanded,e[8]=s.group.label,e[9]=l,e[10]=a):a=e[10],a}case"items":{let r;if(e[11]!==o||e[12]!==s.items){let l;e[14]!==o?(l=a=>n.jsx(Ct,{item:a,onClose:o},a.key),e[14]=o,e[15]=l):l=e[15],r=s.items.map(l),e[11]=o,e[12]=s.items,e[13]=r}else r=e[13];let i;return e[16]!==r?(i=n.jsx(De,{className:"pt-0 pr-0 pb-0 pl-0",children:n.jsx(Le,{children:n.jsx(ge,{className:"gap-1.5",children:r})})}),e[16]=r,e[17]=i):i=e[17],i}}}function $o(t){const e=C.c(12),{sections:s,onClose:o,footer:r,additionalContent:i}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(b.Suspense,{fallback:n.jsx("div",{className:"h-10 shrink-0"}),children:n.jsx(Io,{})}),e[0]=l):l=e[0];let a;if(e[1]!==o||e[2]!==s){let d;e[4]!==o?(d=(m,f)=>n.jsx(Mo,{section:m,onClose:o},f),e[4]=o,e[5]=d):d=e[5],a=s.map(d),e[1]=o,e[2]=s,e[3]=a}else a=e[3];let c;e[6]!==i||e[7]!==a?(c=n.jsxs(zt,{className:"flex flex-col flex-1 px-2 py-2 gap-0",children:[a,i]}),e[6]=i,e[7]=a,e[8]=c):c=e[8];let u;return e[9]!==r||e[10]!==c?(u=n.jsxs("div",{className:"bg-sidebar flex h-full w-full flex-col","data-sidebar":"sidebar",children:[l,c,r]}),e[9]=r,e[10]=c,e[11]=u):u=e[11],u}function ns(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const To=Ns({name:ks().min(2,"Organization name is required")});function Ao(t){const e=C.c(41),{open:s,onOpenChange:o}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={resolver:ws(To),defaultValues:{name:""}},e[0]=r):r=e[0];const i=Is(r);let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l={mutationFn:Oo,onSuccess:Po},e[1]=l):l=e[1];const a=Ms(l),c=a.error instanceof Error?a.error.message:a.error?"Failed to create organization.":null;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsxs(Cn,{children:[n.jsx(Nn,{children:"Create a new organization"}),n.jsx(kn,{children:"Set up a new organization to collaborate with others."})]}),e[2]=u):u=e[2];let d;if(e[3]!==a||e[4]!==i){let _;e[6]!==a?(_=M=>a.mutateAsync(M),e[6]=a,e[7]=_):_=e[7],d=i.handleSubmit(_),e[3]=a,e[4]=i,e[5]=d}else d=e[5];let m;e[8]!==i.formState.isSubmitting?(m=_=>{const{field:M}=_;return n.jsxs(Tn,{children:[n.jsx(An,{children:"Organization Name"}),n.jsx(Pn,{children:n.jsx(Rn,{...M,placeholder:"Acme Inc.",disabled:i.formState.isSubmitting})}),n.jsx(On,{children:"The name of your company or organization"}),M.value&&n.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",n.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",ns(M.value)]})]}),n.jsx(zn,{})]})},e[8]=i.formState.isSubmitting,e[9]=m):m=e[9];let f;e[10]!==i.control||e[11]!==m?(f=n.jsx(Mn,{control:i.control,name:"name",render:m}),e[10]=i.control,e[11]=m,e[12]=f):f=e[12];let x;e[13]!==c?(x=c&&n.jsx("div",{className:"text-destructive text-sm mt-2",children:c}),e[13]=c,e[14]=x):x=e[14];let p;e[15]!==a||e[16]!==i?(p=()=>{a.reset(),i.reset()},e[15]=a,e[16]=i,e[17]=p):p=e[17];let j;e[18]!==i.formState.isSubmitting||e[19]!==p?(j=n.jsx(_n,{disabled:i.formState.isSubmitting,onClick:p,children:"Cancel"}),e[18]=i.formState.isSubmitting,e[19]=p,e[20]=j):j=e[20];const I=!i.formState.isValid||i.formState.isSubmitting;let g;e[21]!==i.formState.isSubmitting?(g=i.formState.isSubmitting?n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(En,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=i.formState.isSubmitting,e[22]=g):g=e[22];let k;e[23]!==I||e[24]!==g?(k=n.jsx(et,{type:"submit",variant:"default",disabled:I,children:g}),e[23]=I,e[24]=g,e[25]=k):k=e[25];let h;e[26]!==k||e[27]!==j?(h=n.jsxs(wn,{children:[j,k]}),e[26]=k,e[27]=j,e[28]=h):h=e[28];let S;e[29]!==h||e[30]!==d||e[31]!==f||e[32]!==x?(S=n.jsxs("form",{className:"space-y-6",onSubmit:d,autoComplete:"off",children:[f,x,h]}),e[29]=h,e[30]=d,e[31]=f,e[32]=x,e[33]=S):S=e[33];let y;e[34]!==i||e[35]!==S?(y=n.jsxs(Sn,{children:[u,n.jsx($n,{...i,children:S})]}),e[34]=i,e[35]=S,e[36]=y):y=e[36];let v;return e[37]!==o||e[38]!==s||e[39]!==y?(v=n.jsx(In,{open:s,onOpenChange:o,children:y}),e[37]=o,e[38]=s,e[39]=y,e[40]=v):v=e[40],v}function Po(t){const{orgSlug:e}=t;window.location.href=`/${e}`}async function Oo(t){const e=ns(t.name);if(!e)throw new Error("Organization slug is invalid");const s=await Se.organization.create({name:t.name,slug:e});if(s?.error)throw new Error(s.error.message||"Failed to create organization");const o=s?.data?.slug??e;if(!o)throw new Error("Failed to create organization");return{orgSlug:o}}function rt(t){let e=0;for(let o=0;o<t.length;o++)e=t.charCodeAt(o)+((e<<5)-e);const s=Math.abs(e)%360;return{backgroundColor:`hsl(${s} 55% 70%)`,color:`hsl(${s} 55% 20%)`}}function zo(t){const e=C.c(13),{org:s,size:o}=t,r=o===void 0?"sm":o,i=r==="xs"?"size-5":"size-6",l=r==="xs"?"text-[9px]":"text-xs";let a;e[0]!==i?(a=J(i,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=i,e[1]=a):a=e[1];let c;e[2]!==s.logo||e[3]!==s.name?(c=s.logo?void 0:rt(s.name),e[2]=s.logo,e[3]=s.name,e[4]=c):c=e[4];let u;e[5]!==s.logo||e[6]!==s.name||e[7]!==l?(u=s.logo?n.jsx("img",{src:s.logo,alt:"",className:"size-full object-cover"}):n.jsx("span",{className:J("font-semibold leading-none",l),children:s.name.slice(0,2).toUpperCase()}),e[5]=s.logo,e[6]=s.name,e[7]=l,e[8]=u):u=e[8];let d;return e[9]!==a||e[10]!==c||e[11]!==u?(d=n.jsx("div",{className:a,style:c,children:u}),e[9]=a,e[10]=c,e[11]=u,e[12]=d):d=e[12],d}function Be(t){const e=C.c(22),{item:s,onClose:o}=t;if(s.href){const c=s.external?"_blank":void 0,u=s.external?"noopener noreferrer":void 0;let d;e[0]!==s.icon?(d=n.jsx("span",{className:"shrink-0 text-muted-foreground",children:s.icon}),e[0]=s.icon,e[1]=d):d=e[1];let m;e[2]!==s.label?(m=n.jsx("span",{className:"flex-1",children:s.label}),e[2]=s.label,e[3]=m):m=e[3];let f;return e[4]!==s.href||e[5]!==o||e[6]!==c||e[7]!==u||e[8]!==d||e[9]!==m?(f=n.jsxs("a",{href:s.href,target:c,rel:u,className:"flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",onClick:o,children:[d,m]}),e[4]=s.href,e[5]=o,e[6]=c,e[7]=u,e[8]=d,e[9]=m,e[10]=f):f=e[10],f}let r;e[11]!==s||e[12]!==o?(r=()=>{s.onClick?.(),o()},e[11]=s,e[12]=o,e[13]=r):r=e[13];let i;e[14]!==s.icon?(i=n.jsx("span",{className:"shrink-0 text-muted-foreground",children:s.icon}),e[14]=s.icon,e[15]=i):i=e[15];let l;e[16]!==s.label?(l=n.jsx("span",{className:"flex-1",children:s.label}),e[16]=s.label,e[17]=l):l=e[17];let a;return e[18]!==r||e[19]!==i||e[20]!==l?(a=n.jsxs("button",{type:"button",onClick:r,className:"flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",children:[i,l]}),e[18]=r,e[19]=i,e[20]=l,e[21]=a):a=e[21],a}function Nt(t){const e=C.c(16),{sortedOrgs:s,orgParam:o,onSelectOrg:r,onCreateOrg:i}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx("span",{className:"text-sm font-medium text-muted-foreground/60",children:"Your Organizations"}),e[0]=l):l=e[0];let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Ke,{size:16}),e[1]=a):a=e[1];let c;e[2]!==i?(c=n.jsxs("div",{className:"flex items-center justify-between px-4 py-3",children:[l,n.jsx("button",{type:"button",onClick:i,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:a})]}),e[2]=i,e[3]=c):c=e[3];let u;if(e[4]!==r||e[5]!==o||e[6]!==s){let f;e[8]!==r||e[9]!==o?(f=x=>n.jsxs("button",{type:"button",onClick:()=>r(x.slug),className:J("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",x.slug===o?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[n.jsx(zo,{org:x,size:"sm"}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("p",{className:"text-sm font-medium truncate",children:x.name}),n.jsx("p",{className:"text-xs text-muted-foreground truncate",children:x.slug})]}),x.slug===o&&n.jsx(Ht,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},x.id),e[8]=r,e[9]=o,e[10]=f):f=e[10],u=s.map(f),e[4]=r,e[5]=o,e[6]=s,e[7]=u}else u=e[7];let d;e[11]!==u?(d=n.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1",children:u}),e[11]=u,e[12]=d):d=e[12];let m;return e[13]!==c||e[14]!==d?(m=n.jsxs(n.Fragment,{children:[c,d]}),e[13]=c,e[14]=d,e[15]=m):m=e[15],m}function kt(t){const e=C.c(142),{user:s,userImage:o,menuItems:r,signOutItem:i,themeOptions:l,preferences:a,setPreferences:c,sortedOrgs:u,orgParam:d,onSelectOrg:m,onCreateOrg:f,close:x,isMobile:p}=t;if(p){const G=s?.name??"U";let Y;e[0]!==G||e[1]!==o?(Y=n.jsx(pt,{url:o,fallback:G,shape:"circle",size:"sm",className:"shrink-0"}),e[0]=G,e[1]=o,e[2]=Y):Y=e[2];const ee=s?.name??"User";let Z;e[3]!==ee?(Z=n.jsx("p",{className:"text-sm font-medium truncate",children:ee}),e[3]=ee,e[4]=Z):Z=e[4];const ne=s?.email;let X;e[5]!==ne?(X=n.jsx("p",{className:"text-xs text-muted-foreground truncate",children:ne}),e[5]=ne,e[6]=X):X=e[6];let oe;e[7]!==Z||e[8]!==X?(oe=n.jsxs("div",{className:"flex-1 min-w-0",children:[Z,X]}),e[7]=Z,e[8]=X,e[9]=oe):oe=e[9];let ae;e[10]!==s?(ae=()=>{s?.id&&navigator.clipboard.writeText(s.id).then(Lo)},e[10]=s,e[11]=ae):ae=e[11];let Ne;e[12]===Symbol.for("react.memo_cache_sentinel")?(Ne=n.jsx(gt,{size:14}),e[12]=Ne):Ne=e[12];let ce;e[13]!==ae?(ce=n.jsx(tt,{asChild:!0,children:n.jsx("button",{type:"button",tabIndex:-1,onClick:ae,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:Ne})}),e[13]=ae,e[14]=ce):ce=e[14];let ye;e[15]===Symbol.for("react.memo_cache_sentinel")?(ye=n.jsx(st,{side:"right",children:n.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[15]=ye):ye=e[15];let _e;e[16]!==ce?(_e=n.jsx(ht,{delayDuration:300,children:n.jsxs(nt,{children:[ce,ye]})}),e[16]=ce,e[17]=_e):_e=e[17];let re;e[18]!==_e||e[19]!==Y||e[20]!==oe?(re=n.jsxs("div",{className:"flex items-center gap-3 px-4 py-4 border-b border-border",children:[Y,oe,_e]}),e[18]=_e,e[19]=Y,e[20]=oe,e[21]=re):re=e[21];let de;e[22]!==f||e[23]!==m||e[24]!==d||e[25]!==u?(de=n.jsx("div",{className:"border-b border-border pb-2",children:n.jsx(Nt,{sortedOrgs:u,orgParam:d,onSelectOrg:m,onCreateOrg:f})}),e[22]=f,e[23]=m,e[24]=d,e[25]=u,e[26]=de):de=e[26];let ue;if(e[27]!==x||e[28]!==r){let be;e[30]!==x?(be=Ge=>n.jsx(Be,{item:Ge,onClose:x},Ge.key),e[30]=x,e[31]=be):be=e[31],ue=r.map(be),e[27]=x,e[28]=r,e[29]=ue}else ue=e[29];let me;e[32]!==x||e[33]!==i?(me=n.jsx(Be,{item:i,onClose:x}),e[32]=x,e[33]=i,e[34]=me):me=e[34];let fe;e[35]!==ue||e[36]!==me?(fe=n.jsxs("nav",{className:"flex flex-col px-2 pt-2 pb-2 gap-0.5",children:[ue,me]}),e[35]=ue,e[36]=me,e[37]=fe):fe=e[37];let xe;e[38]!==de||e[39]!==fe?(xe=n.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[de,fe]}),e[38]=de,e[39]=fe,e[40]=xe):xe=e[40];let E;if(e[41]!==a.theme||e[42]!==c||e[43]!==l){let be;e[45]!==a.theme||e[46]!==c?(be=Ge=>{const{value:Ze,icon:bs,label:js}=Ge;return n.jsx("button",{type:"button","aria-label":js,onClick:()=>c(vs=>({...vs,theme:Ze})),className:J("size-8 rounded-md flex items-center justify-center transition-colors",a.theme===Ze?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:bs},Ze)},e[45]=a.theme,e[46]=c,e[47]=be):be=e[47],E=l.map(be),e[41]=a.theme,e[42]=c,e[43]=l,e[44]=E}else E=e[44];let ke;e[48]!==E?(ke=n.jsx("div",{className:"flex items-center gap-0.5",children:E}),e[48]=E,e[49]=ke):ke=e[49];const Xe=a.enableSounds?"Disable sounds":"Enable sounds";let we;e[50]!==c?(we=()=>c(Do),e[50]=c,e[51]=we):we=e[51];const Je=a.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let Ie;e[52]!==Je?(Ie=J("size-8 rounded-md flex items-center justify-center transition-colors",Je),e[52]=Je,e[53]=Ie):Ie=e[53];let Me;e[54]!==a.enableSounds?(Me=a.enableSounds?n.jsx(mt,{size:14}):n.jsx(ft,{size:14}),e[54]=a.enableSounds,e[55]=Me):Me=e[55];let $e;e[56]!==Xe||e[57]!==we||e[58]!==Ie||e[59]!==Me?($e=n.jsx("button",{type:"button","aria-label":Xe,onClick:we,className:Ie,children:Me}),e[56]=Xe,e[57]=we,e[58]=Ie,e[59]=Me,e[60]=$e):$e=e[60];let Fe;e[61]===Symbol.for("react.memo_cache_sentinel")?(Fe=n.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","2.306.6"]}),e[61]=Fe):Fe=e[61];let Te;e[62]!==$e?(Te=n.jsxs("div",{className:"flex items-center gap-2",children:[$e,Fe]}),e[62]=$e,e[63]=Te):Te=e[63];let Ae;e[64]!==ke||e[65]!==Te?(Ae=n.jsxs("div",{className:"flex items-center justify-between px-3 py-3 border-t border-border/50",children:[ke,Te]}),e[64]=ke,e[65]=Te,e[66]=Ae):Ae=e[66];let Ue;return e[67]!==re||e[68]!==xe||e[69]!==Ae?(Ue=n.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[re,xe,Ae]}),e[67]=re,e[68]=xe,e[69]=Ae,e[70]=Ue):Ue=e[70],Ue}const j=s?.name??"U";let I;e[71]!==j||e[72]!==o?(I=n.jsx(pt,{url:o,fallback:j,shape:"circle",size:"sm",className:"shrink-0"}),e[71]=j,e[72]=o,e[73]=I):I=e[73];const g=s?.name??"User";let k;e[74]!==g?(k=n.jsx("p",{className:"text-sm font-medium truncate",children:g}),e[74]=g,e[75]=k):k=e[75];const h=s?.email;let S;e[76]!==h?(S=n.jsx("p",{className:"text-xs text-muted-foreground truncate",children:h}),e[76]=h,e[77]=S):S=e[77];let y;e[78]!==k||e[79]!==S?(y=n.jsxs("div",{className:"flex-1 min-w-0",children:[k,S]}),e[78]=k,e[79]=S,e[80]=y):y=e[80];let v;e[81]!==s?(v=()=>{s?.id&&navigator.clipboard.writeText(s.id).then(Eo)},e[81]=s,e[82]=v):v=e[82];let _;e[83]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsx(gt,{size:14}),e[83]=_):_=e[83];let M;e[84]!==v?(M=n.jsx(tt,{asChild:!0,children:n.jsx("button",{type:"button",tabIndex:-1,onClick:v,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:_})}),e[84]=v,e[85]=M):M=e[85];let D;e[86]===Symbol.for("react.memo_cache_sentinel")?(D=n.jsx(st,{side:"right",children:n.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[86]=D):D=e[86];let w;e[87]!==M?(w=n.jsx(ht,{delayDuration:300,children:n.jsxs(nt,{children:[M,D]})}),e[87]=M,e[88]=w):w=e[88];let $;e[89]!==w||e[90]!==I||e[91]!==y?($=n.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 mx-1 mt-1",children:[I,y,w]}),e[89]=w,e[90]=I,e[91]=y,e[92]=$):$=e[92];let O;if(e[93]!==x||e[94]!==r){let G;e[96]!==x?(G=Y=>n.jsx(Be,{item:Y,onClose:x},Y.key),e[96]=x,e[97]=G):G=e[97],O=r.map(G),e[93]=x,e[94]=r,e[95]=O}else O=e[95];let T;e[98]!==x||e[99]!==i?(T=n.jsx(Be,{item:i,onClose:x}),e[98]=x,e[99]=i,e[100]=T):T=e[100];let A;e[101]!==O||e[102]!==T?(A=n.jsxs("nav",{className:"flex-1 flex flex-col px-2 pt-1 overflow-y-auto",children:[O,T]}),e[101]=O,e[102]=T,e[103]=A):A=e[103];let P;if(e[104]!==a.theme||e[105]!==c||e[106]!==l){let G;e[108]!==a.theme||e[109]!==c?(G=Y=>{const{value:ee,icon:Z,label:ne}=Y;return n.jsx("button",{type:"button","aria-label":ne,onClick:()=>c(X=>({...X,theme:ee})),className:J("size-7 rounded-md flex items-center justify-center transition-colors",a.theme===ee?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:Z},ee)},e[108]=a.theme,e[109]=c,e[110]=G):G=e[110],P=l.map(G),e[104]=a.theme,e[105]=c,e[106]=l,e[107]=P}else P=e[107];let z;e[111]!==P?(z=n.jsx("div",{className:"flex items-center gap-0.5",children:P}),e[111]=P,e[112]=z):z=e[112];const L=a.enableSounds?"Disable sounds":"Enable sounds";let R;e[113]!==c?(R=()=>c(Ro),e[113]=c,e[114]=R):R=e[114];const B=a.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let U;e[115]!==B?(U=J("size-7 rounded-md flex items-center justify-center transition-colors",B),e[115]=B,e[116]=U):U=e[116];let F;e[117]!==a.enableSounds?(F=a.enableSounds?n.jsx(mt,{size:14}):n.jsx(ft,{size:14}),e[117]=a.enableSounds,e[118]=F):F=e[118];let H;e[119]!==L||e[120]!==R||e[121]!==U||e[122]!==F?(H=n.jsx("button",{type:"button","aria-label":L,onClick:R,className:U,children:F}),e[119]=L,e[120]=R,e[121]=U,e[122]=F,e[123]=H):H=e[123];let V;e[124]===Symbol.for("react.memo_cache_sentinel")?(V=n.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","2.306.6"]}),e[124]=V):V=e[124];let q;e[125]!==H?(q=n.jsxs("div",{className:"flex items-center gap-2",children:[H,V]}),e[125]=H,e[126]=q):q=e[126];let Q;e[127]!==z||e[128]!==q?(Q=n.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 border-t border-border/50",children:[z,q]}),e[127]=z,e[128]=q,e[129]=Q):Q=e[129];let N;e[130]!==$||e[131]!==A||e[132]!==Q?(N=n.jsxs("div",{className:"w-60 shrink-0 flex flex-col border-r border-border bg-sidebar/75",children:[$,A,Q]}),e[130]=$,e[131]=A,e[132]=Q,e[133]=N):N=e[133];let K;e[134]!==f||e[135]!==m||e[136]!==d||e[137]!==u?(K=n.jsx("div",{className:"flex-1 flex flex-col min-w-0 min-h-0 overflow-hidden",children:n.jsx(Nt,{sortedOrgs:u,orgParam:d,onSelectOrg:m,onCreateOrg:f})}),e[134]=f,e[135]=m,e[136]=d,e[137]=u,e[138]=K):K=e[138];let W;return e[139]!==N||e[140]!==K?(W=n.jsxs("div",{className:"flex min-h-[380px] w-full overflow-hidden",children:[N,K]}),e[139]=N,e[140]=K,e[141]=W):W=e[141],W}function Ro(t){return{...t,enableSounds:!t.enableSounds}}function Eo(){je.success("User ID copied")}function Do(t){return{...t,enableSounds:!t.enableSounds}}function Lo(){je.success("User ID copied")}function os(){const t=C.c(50),{data:e}=Se.useSession(),{data:s}=Se.useListOrganizations(),o=ve();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org",shouldThrow:!1},t[0]=r):r=t[0];const l=$s(r)?.params.org,[a,c]=Tt(),u=Bt(),[d,m]=b.useState(!1),[f,x]=b.useState(!1),p=e?.user,j=p?.image;let I;if(t[1]!==u||t[2]!==o||t[3]!==d||t[4]!==l||t[5]!==s||t[6]!==a||t[7]!==c||t[8]!==p||t[9]!==j){const h=s?.find(W=>W.slug===l);let S;if(t[11]!==l||t[12]!==s){let W;t[14]!==l?(W=(G,Y)=>G.slug===l?-1:Y.slug===l?1:G.name.localeCompare(Y.name),t[14]=l,t[15]=W):W=t[15],S=[...s??[]].sort(W),t[11]=l,t[12]=s,t[13]=S}else S=t[13];const y=S;let v;t[16]!==o?(v=W=>{m(!1),o({to:"/$org",params:{org:W}})},t[16]=o,t[17]=v):v=t[17];const _=v;let M;t[18]===Symbol.for("react.memo_cache_sentinel")?(M=()=>m(!1),t[18]=M):M=t[18];const D=M;let w;t[19]===Symbol.for("react.memo_cache_sentinel")?(w=n.jsx(Ye,{size:16}),t[19]=w):w=t[19];let $;t[20]!==o||t[21]!==l?($={key:"preferences",label:"Preferences",icon:w,onClick:()=>{o({to:"/$org/settings/profile",params:{org:l??""}})}},t[20]=o,t[21]=l,t[22]=$):$=t[22];let O;t[23]===Symbol.for("react.memo_cache_sentinel")?(O={key:"terms",label:"Terms of Use",icon:n.jsx(tn,{size:16}),href:"https://www.decocms.com/terms-of-use",external:!0},t[23]=O):O=t[23];let T;t[24]===Symbol.for("react.memo_cache_sentinel")?(T={key:"privacy",label:"Privacy Policy",icon:n.jsx(yn,{size:16}),href:"https://www.decocms.com/privacy-policy",external:!0},t[24]=T):T=t[24];let A;t[25]===Symbol.for("react.memo_cache_sentinel")?(A={key:"github",label:"decocms/studio",icon:n.jsx(Ts,{className:"w-4 h-4"}),href:"https://github.com/decocms/studio",external:!0},t[25]=A):A=t[25];let P;t[26]===Symbol.for("react.memo_cache_sentinel")?(P={key:"community",label:"Community",icon:n.jsx(Vt,{size:16}),href:"https://decocms.com/discord",external:!0},t[26]=P):P=t[26];let z;t[27]===Symbol.for("react.memo_cache_sentinel")?(z={key:"homepage",label:"Homepage",icon:n.jsx(fn,{size:16}),href:"https://decocms.com",external:!0},t[27]=z):z=t[27];let L;t[28]!==$?(L=[$,O,T,A,P,z],t[28]=$,t[29]=L):L=t[29];const R=L;let B;t[30]===Symbol.for("react.memo_cache_sentinel")?(B={key:"logout",label:"Sign out",icon:n.jsx(pn,{size:16}),onClick:Uo},t[30]=B):B=t[30];const U=B;let F;t[31]===Symbol.for("react.memo_cache_sentinel")?(F={value:"light",icon:n.jsx(bn,{size:14}),label:"Light theme"},t[31]=F):F=t[31];let H;t[32]===Symbol.for("react.memo_cache_sentinel")?(H={value:"dark",icon:n.jsx(jn,{size:14}),label:"Dark theme"},t[32]=H):H=t[32];let V;t[33]===Symbol.for("react.memo_cache_sentinel")?(V=[F,H,{value:"system",icon:n.jsx(vn,{size:14}),label:"System theme"}],t[33]=V):V=t[33];const q=V;let Q;t[34]===Symbol.for("react.memo_cache_sentinel")?(Q=()=>{m(!1),x(!0)},t[34]=Q):Q=t[34];let N;t[35]!==_||t[36]!==u||t[37]!==R||t[38]!==l||t[39]!==a||t[40]!==c||t[41]!==y||t[42]!==p||t[43]!==j?(N={user:p,userImage:j,menuItems:R,signOutItem:U,themeOptions:q,preferences:a,setPreferences:c,sortedOrgs:y,orgParam:l,onSelectOrg:_,onCreateOrg:Q,close:D,isMobile:u},t[35]=_,t[36]=u,t[37]=R,t[38]=l,t[39]=a,t[40]=c,t[41]=y,t[42]=p,t[43]=j,t[44]=N):N=t[44];const K=N;I=u?n.jsxs(Ft,{open:d,onOpenChange:m,direction:"bottom",children:[n.jsxs("button",{type:"button",onClick:()=>m(!0),className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground",children:[n.jsx("div",{className:"shrink-0 size-5 rounded-md flex items-center justify-center border border-border/50 overflow-hidden",style:h?.logo?void 0:rt(h?.name??""),children:h?.logo?n.jsx("img",{src:h.logo,alt:"",className:"size-full object-cover"}):n.jsx("span",{className:"font-semibold leading-none text-[8px]",children:(h?.name??"?").slice(0,2).toUpperCase()})}),n.jsx("span",{className:"truncate",children:h?.name??"Account"})]}),n.jsxs(Ut,{className:"h-[80dvh] p-0",children:[n.jsx(Gt,{className:"sr-only",children:"Account"}),n.jsx(kt,{...K})]})]}):n.jsxs(lt,{open:d,onOpenChange:m,children:[n.jsx(at,{asChild:!0,children:n.jsx(he,{tooltip:h?.name??"Account",className:"rounded-md",children:n.jsx("div",{className:"shrink-0 size-6 rounded-md flex items-center justify-center border border-border/50 overflow-hidden",style:h?.logo?void 0:rt(h?.name??""),children:h?.logo?n.jsx("img",{src:h.logo,alt:"",className:"size-full object-cover"}):n.jsx("span",{className:"font-semibold leading-none text-[9px]",children:(h?.name??"?").slice(0,2).toUpperCase()})})})}),n.jsx(ct,{side:"right",align:"end",sideOffset:18,collisionPadding:16,className:"w-[520px] p-0 flex max-h-[520px]",onCloseAutoFocus:Fo,children:n.jsx(kt,{...K})})]}),t[1]=u,t[2]=o,t[3]=d,t[4]=l,t[5]=s,t[6]=a,t[7]=c,t[8]=p,t[9]=j,t[10]=I}else I=t[10];let g;t[45]!==f?(g=n.jsx(Ao,{open:f,onOpenChange:x}),t[45]=f,t[46]=g):g=t[46];let k;return t[47]!==I||t[48]!==g?(k=n.jsxs(n.Fragment,{children:[I,g]}),t[47]=I,t[48]=g,t[49]=k):k=t[49],k}function Fo(t){return t.preventDefault()}function Uo(){se("signed_out",{source:"account_popover"}),Se.signOut()}function Go({invitation:t}){const[e,s]=b.useState(!1),[o,r]=b.useState(!1),i=Re(),l=async()=>{s(!0);try{const c=await Se.organization.acceptInvitation({invitationId:t.id});if(c.error)je.error(c.error.message),s(!1);else{const u=await Se.organization.getFullOrganization({query:{organizationId:t.organizationId}});je.success("Invitation accepted!");const d=u?.data?.slug;window.location.href=d?`/${d}`:"/"}}catch{je.error("Failed to accept invitation"),s(!1)}},a=async()=>{r(!0);try{const c=await Se.organization.rejectInvitation({invitationId:t.id});c.error?(je.error(c.error.message),r(!1)):(je.success("Invitation declined"),i.invalidateQueries())}catch{je.error("Failed to decline invitation"),r(!1)}};return n.jsxs("div",{className:"flex items-center gap-3 px-5 py-4 border-b border-border last:border-0 hover:bg-muted/25 transition-colors",children:[n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("p",{className:"text-xs text-muted-foreground",children:"You've been invited to join"}),n.jsx("p",{className:"text-sm font-medium truncate",children:t.organizationName??"Unknown organization"})]}),n.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[n.jsx(et,{size:"icon",variant:"ghost",className:"size-7 text-green-600 hover:text-green-700 hover:bg-green-50 dark:hover:bg-green-950",onClick:l,disabled:e||o,"aria-label":"Accept invitation",children:n.jsx(Ht,{size:14})}),n.jsx(et,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground hover:text-destructive hover:bg-destructive/10",onClick:a,disabled:e||o,"aria-label":"Decline invitation",children:n.jsx(Dn,{size:14})})]})]})}function Bo(){const t=b.useContext(As),{data:e}=t.hooks.useListUserInvitations();return(e??[]).filter(o=>o.status==="pending"&&new Date(o.expiresAt)>new Date)}class Ho extends b.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,s){}render(){return this.state.hasError?null:this.props.children}}function Vo(t){return t<=1?"text-destructive":t<=5?"text-amber-500 dark:text-amber-400":"text-foreground/70"}function Ko(){const t=C.c(20),e=ve(),{org:s}=pe();let o;t[0]!==s.id||t[1]!==s.slug?(o={connectionId:Kt,orgId:s.id,orgSlug:s.slug},t[0]=s.id,t[1]=s.slug,t[2]=o):o=t[2];const r=Wt(o);let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i={providerId:"deco"},t[3]=i):i=t[3];let l;t[4]!==r?(l={client:r,toolName:"AI_PROVIDER_CREDITS",toolArguments:i,staleTime:6e4,select:Wo},t[4]=r,t[5]=l):l=t[5];const{data:a,isPending:c,isError:u}=Un(l),d=a?.balanceCents!=null?a.balanceCents/100:null;let m;t[6]!==d||t[7]!==u||t[8]!==c?(m=c||u||d==null?"Credits":`Credits: $${d.toFixed(2)}`,t[6]=d,t[7]=u,t[8]=c,t[9]=m):m=t[9];const f=m;let x;t[10]!==d?(x=J(d!=null&&Vo(d)),t[10]=d,t[11]=x):x=t[11];let p;t[12]!==e||t[13]!==s.slug?(p=()=>e({to:"/$org/settings/ai-providers",params:{org:s.slug}}),t[12]=e,t[13]=s.slug,t[14]=p):p=t[14];let j;t[15]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(sn,{size:24}),t[15]=j):j=t[15];let I;return t[16]!==x||t[17]!==p||t[18]!==f?(I=n.jsx(ge,{children:n.jsx(ie,{children:n.jsx(he,{tooltip:f,className:x,onClick:p,children:j})})}),t[16]=x,t[17]=p,t[18]=f,t[19]=I):I=t[19],I}function Wo(t){return t.structuredContent}function qo(){const t=C.c(1);if(!Gn().some(Qo))return null;let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(Ko,{}),t[0]=o):o=t[0],o}function Qo(t){return t.providerId==="deco"}function Yo(){const t=C.c(3),[e,s]=b.useState(!1);let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(ge,{children:n.jsx(ie,{children:n.jsx(he,{tooltip:"Connections",onClick:()=>{se("connections_dialog_opened",{source:"sidebar_footer",mode:"browse"}),s(!0)},children:n.jsx(hn,{size:24})})})}),t[0]=o):o=t[0];let r;return t[1]!==e?(r=n.jsxs(n.Fragment,{children:[o,n.jsx(Bn,{mode:"browse",open:e,onOpenChange:s,defaultTab:"all"})]}),t[1]=e,t[2]=r):r=t[2],r}function Xo(){const t=C.c(11),e=Bo();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(xt,{size:24}),t[0]=s):s=t[0];let o;t[1]!==e.length?(o=e.length>0&&n.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-red-500 pointer-events-none"}),t[1]=e.length,t[2]=o):o=t[2];let r;t[3]!==o?(r=n.jsx(ge,{children:n.jsx(ie,{children:n.jsx(at,{asChild:!0,children:n.jsxs(he,{tooltip:"Inbox",className:"relative",children:[s,o]})})})}),t[3]=o,t[4]=r):r=t[4];let i;t[5]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx("div",{className:"px-4 py-3 border-b border-border shrink-0",children:n.jsx("h3",{className:"text-sm font-medium",children:"Inbox"})}),t[5]=i):i=t[5];let l;t[6]!==e?(l=n.jsxs(ct,{side:"right",align:"start",sideOffset:16,collisionPadding:16,className:"w-[min(400px,calc(100vw-2rem))] p-0 h-[min(650px,calc(100dvh-4rem))] flex flex-col",children:[i,e.length===0?n.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 px-6 text-center",children:[n.jsx(xt,{size:24,className:"text-muted-foreground/50"}),n.jsx("p",{className:"text-sm font-medium text-foreground",children:"No invites pending"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Organization invitations will appear here"})]}):n.jsx("div",{className:"overflow-y-auto flex-1",children:e.map(Jo)})]}),t[6]=e,t[7]=l):l=t[7];let a;return t[8]!==r||t[9]!==l?(a=n.jsxs(lt,{children:[r,l]}),t[8]=r,t[9]=l,t[10]=a):a=t[10],a}function Jo(t){return n.jsx(Go,{invitation:t},t.id)}function Zo(){const t=C.c(6),e=ve(),{org:s}=pe();let o;t[0]!==e||t[1]!==s.slug?(o=()=>e({to:"/$org/settings",params:{org:s.slug}}),t[0]=e,t[1]=s.slug,t[2]=o):o=t[2];let r;t[3]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(Ye,{size:24}),t[3]=r):r=t[3];let i;return t[4]!==o?(i=n.jsx(ge,{children:n.jsx(ie,{children:n.jsx(he,{tooltip:"Settings",onClick:o,children:r})})}),t[4]=o,t[5]=i):i=t[5],i}function er(){const t=C.c(5);let e,s,o,r;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(Ho,{children:n.jsx(b.Suspense,{fallback:null,children:n.jsx(qo,{})})}),s=n.jsx(Yo,{}),o=n.jsx(Xo,{}),r=n.jsx(Zo,{}),t[0]=e,t[1]=s,t[2]=o,t[3]=r):(e=t[0],s=t[1],o=t[2],r=t[3]);let i;return t[4]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsxs(Et,{className:"px-2 pb-3 gap-1",children:[e,s,o,r,n.jsx(ge,{children:n.jsx(ie,{children:n.jsx(os,{})})})]}),t[4]=i):i=t[4],i}function tr(){const t=C.c(10),e=ve(),{org:s}=pe(),{setOpenMobile:o}=Qe();let r;t[0]!==e||t[1]!==s.slug||t[2]!==o?(r=()=>{e({to:"/$org/settings",params:{org:s.slug}}),o(!1)},t[0]=e,t[1]=s.slug,t[2]=o,t[3]=r):r=t[3];let i;t[4]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(Ye,{}),t[4]=i):i=t[4];let l;t[5]!==r?(l=n.jsx(ie,{children:n.jsx(he,{tooltip:"Settings",onClick:r,children:i})}),t[5]=r,t[6]=l):l=t[6];let a;t[7]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(ie,{children:n.jsx(os,{})}),t[7]=a):a=t[7];let c;return t[8]!==l?(c=n.jsx(Et,{children:n.jsxs(ge,{children:[l,a]})}),t[8]=l,t[9]=c):c=t[9],c}var dt="ContextMenu",[sr]=Us(dt,[At]),te=At(),[nr,rs]=sr(dt),is=t=>{const{__scopeContextMenu:e,children:s,onOpenChange:o,dir:r,modal:i=!0}=t,[l,a]=b.useState(!1),c=te(e),u=Ps(o),d=b.useCallback(m=>{a(m),u(m)},[u]);return n.jsx(nr,{scope:e,open:l,onOpenChange:d,modal:i,children:n.jsx(Os,{...c,dir:r,open:l,onOpenChange:d,modal:i,children:s})})};is.displayName=dt;var ls="ContextMenuTrigger",as=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,disabled:o=!1,...r}=t,i=rs(ls,s),l=te(s),a=b.useRef({x:0,y:0}),c=b.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...a.current})}),u=b.useRef(0),d=b.useCallback(()=>window.clearTimeout(u.current),[]),m=f=>{a.current={x:f.clientX,y:f.clientY},i.onOpenChange(!0)};return b.useEffect(()=>d,[d]),b.useEffect(()=>{o&&d()},[o,d]),n.jsxs(n.Fragment,{children:[n.jsx(zs,{...l,virtualRef:c}),n.jsx(Rs.span,{"data-state":i.open?"open":"closed","data-disabled":o?"":void 0,...r,ref:e,style:{WebkitTouchCallout:"none",...t.style},onContextMenu:o?t.onContextMenu:Oe(t.onContextMenu,f=>{d(),m(f),f.preventDefault()}),onPointerDown:o?t.onPointerDown:Oe(t.onPointerDown,He(f=>{d(),u.current=window.setTimeout(()=>m(f),700)})),onPointerMove:o?t.onPointerMove:Oe(t.onPointerMove,He(d)),onPointerCancel:o?t.onPointerCancel:Oe(t.onPointerCancel,He(d)),onPointerUp:o?t.onPointerUp:Oe(t.onPointerUp,He(d))})]})});as.displayName=ls;var or="ContextMenuPortal",cs=t=>{const{__scopeContextMenu:e,...s}=t,o=te(e);return n.jsx(Es,{...o,...s})};cs.displayName=or;var ds="ContextMenuContent",us=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,...o}=t,r=rs(ds,s),i=te(s),l=b.useRef(!1);return n.jsx(Ds,{...i,...o,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:a=>{t.onCloseAutoFocus?.(a),!a.defaultPrevented&&l.current&&a.preventDefault(),l.current=!1},onInteractOutside:a=>{t.onInteractOutside?.(a),!a.defaultPrevented&&!r.modal&&(l.current=!0)},style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});us.displayName=ds;var rr="ContextMenuGroup",ir=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,...o}=t,r=te(s);return n.jsx(Gs,{...r,...o,ref:e})});ir.displayName=rr;var lr="ContextMenuLabel",ar=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,...o}=t,r=te(s);return n.jsx(Bs,{...r,...o,ref:e})});ar.displayName=lr;var cr="ContextMenuItem",ms=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,...o}=t,r=te(s);return n.jsx(Ls,{...r,...o,ref:e})});ms.displayName=cr;var dr="ContextMenuCheckboxItem",ur=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,...o}=t,r=te(s);return n.jsx(Hs,{...r,...o,ref:e})});ur.displayName=dr;var mr="ContextMenuRadioGroup",fr=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,...o}=t,r=te(s);return n.jsx(Vs,{...r,...o,ref:e})});fr.displayName=mr;var xr="ContextMenuRadioItem",pr=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,...o}=t,r=te(s);return n.jsx(Ks,{...r,...o,ref:e})});pr.displayName=xr;var hr="ContextMenuItemIndicator",gr=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,...o}=t,r=te(s);return n.jsx(Ws,{...r,...o,ref:e})});gr.displayName=hr;var br="ContextMenuSeparator",fs=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,...o}=t,r=te(s);return n.jsx(Fs,{...r,...o,ref:e})});fs.displayName=br;var jr="ContextMenuArrow",vr=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,...o}=t,r=te(s);return n.jsx(qs,{...r,...o,ref:e})});vr.displayName=jr;var yr="ContextMenuSubTrigger",_r=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,...o}=t,r=te(s);return n.jsx(Qs,{...r,...o,ref:e})});_r.displayName=yr;var Sr="ContextMenuSubContent",Cr=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,...o}=t,r=te(s);return n.jsx(Ys,{...r,...o,ref:e,style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Cr.displayName=Sr;function He(t){return e=>e.pointerType!=="mouse"?t(e):void 0}var Nr=is,kr=as,wr=cs,Ir=us,Mr=ms,$r=fs;function Tr(t){const e=C.c(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;return e[2]!==s?(o=n.jsx(Nr,{"data-slot":"context-menu",...s}),e[2]=s,e[3]=o):o=e[3],o}function Ar(t){const e=C.c(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;return e[2]!==s?(o=n.jsx(kr,{"data-slot":"context-menu-trigger",...s}),e[2]=s,e[3]=o):o=e[3],o}function Pr(t){const e=C.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let r;e[3]!==s?(r=J("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",s),e[3]=s,e[4]=r):r=e[4];let i;return e[5]!==o||e[6]!==r?(i=n.jsx(wr,{children:n.jsx(Ir,{"data-slot":"context-menu-content",className:r,...o})}),e[5]=o,e[6]=r,e[7]=i):i=e[7],i}function wt(t){const e=C.c(12);let s,o,r,i;e[0]!==t?({className:s,inset:o,variant:i,...r}=t,e[0]=t,e[1]=s,e[2]=o,e[3]=r,e[4]=i):(s=e[1],o=e[2],r=e[3],i=e[4]);const l=i===void 0?"default":i;let a;e[5]!==s?(a=J("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),e[5]=s,e[6]=a):a=e[6];let c;return e[7]!==o||e[8]!==r||e[9]!==a||e[10]!==l?(c=n.jsx(Mr,{"data-slot":"context-menu-item","data-inset":o,"data-variant":l,className:a,...r}),e[7]=o,e[8]=r,e[9]=a,e[10]=l,e[11]=c):c=e[11],c}function Or(t){const e=C.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let r;e[3]!==s?(r=J("bg-border -mx-1 my-1 h-px",s),e[3]=s,e[4]=r):r=e[4];let i;return e[5]!==o||e[6]!==r?(i=n.jsx($r,{"data-slot":"context-menu-separator",className:r,...o}),e[5]=o,e[6]=r,e[7]=i):i=e[7],i}function zr(t){const e=ve(),s=Re(),o=Xt(),{locator:r}=pe(),i=We({strict:!1}),l=qe({strict:!1});return async a=>{const c=crypto.randomUUID(),u=a===l.virtualmcpid?Lt(s,r,i.taskId??""):null;try{await o.create.mutateAsync({id:c,virtual_mcp_id:a,...u?{branch:u}:{}})}catch{}e({to:"/$org/$taskId",params:{org:t,taskId:c},search:{virtualmcpid:a}})}}function Rr({agent:t,org:e,onUnpin:s,isDragging:o}){const r=ve(),{isMobile:i,setOpenMobile:l}=Qe(),a=Hn(e),u=It({select:h=>h.location.pathname}).startsWith(`/${e}/${t.id}`),[d,m]=b.useState(null),f=b.useRef(null),x=b.useRef(null),p=b.useRef(!1);p.current=!!o,o&&(d||x.current)&&(x.current&&(clearTimeout(x.current),x.current=null),d&&m(null));const j=h=>{if(p.current)return;const S=h.currentTarget.getBoundingClientRect();x.current=setTimeout(()=>{p.current||m(S)},550)},I=h=>{x.current&&(clearTimeout(x.current),x.current=null),!(f.current&&h.relatedTarget instanceof Node&&f.current.contains(h.relatedTarget))&&m(null)},g=d?Math.round(d.height*.9):0,k=d?d.width+g:0;return n.jsx(Tr,{children:n.jsxs(ie,{className:J(d&&"z-[55]"),children:[n.jsx(Ar,{asChild:!0,children:n.jsx(he,{tooltip:d?void 0:t.title,isActive:u,onClick:async()=>{i&&l(!1);const{resumed:h}=await a(t.id);se("sidebar_agent_pin_clicked",{agent_id:t.id,agent_title:t.title,resumed:h})},onMouseEnter:j,onMouseLeave:I,children:n.jsx(Pe,{icon:t.icon,name:t.title,size:"xs",className:"w-full h-full [&_svg]:w-1/2 [&_svg]:h-1/2"})})}),n.jsxs(Pr,{children:[n.jsxs(wt,{onClick:()=>{const h=crypto.randomUUID();r({to:"/$org/$taskId",params:{org:e,taskId:h},search:{virtualmcpid:t.id}})},children:[n.jsx(Ye,{size:14}),"Settings"]}),n.jsx(Or,{}),n.jsxs(wt,{onClick:()=>{s(),u&&r({to:"/$org",params:{org:e}})},className:"",children:[n.jsx(jt,{size:14}),"Unpin"]})]}),d&&Ee.createPortal(n.jsx("button",{ref:f,type:"button",onMouseLeave:()=>m(null),onClick:h=>{h.stopPropagation(),m(null),s(),r({to:"/$org",params:{org:e}})},className:J("flex items-center justify-center","bg-sidebar-accent text-muted-foreground","rounded-xl cursor-pointer","animate-in fade-in-0 slide-in-from-right-2","duration-150 [animation-timing-function:cubic-bezier(0.165,0.84,0.44,1)]","hover:text-foreground transition-colors"),style:{position:"fixed",top:d.top,left:d.left,height:d.height,width:k,paddingLeft:d.width,zIndex:50,boxShadow:"inset 0 0 0.5px 1px hsla(0, 0%, 100%, 0.075), 0 0 0 0.5px hsla(0, 0%, 0%, 0.12)"},children:n.jsx(jt,{size:14})}),document.body)]})})}function Er(t){const e=C.c(18);let s;e[0]!==t.agent.id?(s={id:t.agent.id},e[0]=t.agent.id,e[1]=s):s=e[1];const{attributes:o,listeners:r,setNodeRef:i,transform:l,transition:a,isDragging:c}=oo(s);let u;e[2]!==l?(u=ro.Transform.toString(l?{...l,x:0}:null),e[2]=l,e[3]=u):u=e[3];const d=c?.5:void 0,m=c?100:void 0;let f;e[4]!==u||e[5]!==d||e[6]!==m||e[7]!==a?(f={transform:u,transition:a,opacity:d,zIndex:m},e[4]=u,e[5]=d,e[6]=m,e[7]=a,e[8]=f):f=e[8];const x=f;let p;e[9]!==c||e[10]!==t?(p=n.jsx(Rr,{...t,isDragging:c}),e[9]=c,e[10]=t,e[11]=p):p=e[11];let j;return e[12]!==o||e[13]!==r||e[14]!==i||e[15]!==x||e[16]!==p?(j=n.jsx("div",{ref:i,style:x,...o,...r,tabIndex:-1,className:"w-full",children:p}),e[12]=o,e[13]=r,e[14]=i,e[15]=x,e[16]=p,e[17]=j):j=e[17],j}function Dr(t){const e=C.c(9),{agent:s,onClick:o}=t;let r;e[0]!==s.icon||e[1]!==s.title?(r=n.jsx(Pe,{icon:s.icon,name:s.title,size:"md",className:"transition-transform group-hover:scale-105"}),e[0]=s.icon,e[1]=s.title,e[2]=r):r=e[2];let i;e[3]!==s.title?(i=n.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground line-clamp-2 w-full",children:s.title}),e[3]=s.title,e[4]=i):i=e[4];let l;return e[5]!==o||e[6]!==r||e[7]!==i?(l=n.jsxs("button",{type:"button",onClick:o,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[r,i]}),e[5]=o,e[6]=r,e[7]=i,e[8]=l):l=e[8],l}function Lr(t){const e=C.c(80),{onClose:s,onOpenImportDeco:o,onOpenGithubImport:r,onOpenSelfHealing:i,onOpenDiagnosticsModal:l,onOpenLeanCanvasModal:a,onOpenStudioPackModal:c,onOpenAiImageModal:u,onOpenAiResearchModal:d}=t,[m,f]=b.useState(""),x=qt(),{org:p}=pe();let j;e[0]!==x?(j=x.filter(Wr).map(Kr),e[0]=x,e[1]=j):j=e[1];const I=j,{pin:g,isPinned:k}=Yt(p.id,I);let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h={navigateOnCreate:!0},e[2]=h):h=e[2];const{createVirtualMCP:S,isCreating:y}=ao(h),[v]=Tt(),_=zr(p.slug),M=lo();let D,w,$,O,T,A,P,z;if(e[3]!==x||e[4]!==S||e[5]!==y||e[6]!==k||e[7]!==M||e[8]!==_||e[9]!==s||e[10]!==u||e[11]!==d||e[12]!==l||e[13]!==r||e[14]!==o||e[15]!==a||e[16]!==i||e[17]!==c||e[18]!==g||e[19]!==v.experimental_vibecode||e[20]!==m){const V=m.toLowerCase();z=x.filter(Vr).filter(E=>!m||E.title.toLowerCase().includes(V));let q;e[29]!==x?(q=x.some(Hr),e[29]=x,e[30]=q):q=e[30];const Q=q;D=ze.filter(E=>(!m||E.title.toLowerCase().includes(V))&&!(E.id==="studio-pack"&&Q)&&!(E.id==="self-healing-storefront"&&!v.experimental_vibecode));let N;e[31]===Symbol.for("react.memo_cache_sentinel")?(N=ze.find(Br),e[31]=N):N=e[31];const K=N,W=K?x.find(E=>E.metadata?.type===K.id):void 0;let G;e[32]===Symbol.for("react.memo_cache_sentinel")?(G=ze.find(Gr),e[32]=G):G=e[32];const Y=G,ee=Y?x.find(E=>E.metadata?.type===Y.id):void 0;let Z;e[33]===Symbol.for("react.memo_cache_sentinel")?(Z=ze.find(Ur),e[33]=Z):Z=e[33];const ne=Z,X=ne?x.find(E=>E.metadata?.type===ne.id):void 0;let oe;e[34]===Symbol.for("react.memo_cache_sentinel")?(oe=ze.find(Fr),e[34]=oe):oe=e[34];const ae=oe,Ne=ae?x.find(E=>E.metadata?.type===ae.id):void 0;let ce;e[35]!==k||e[36]!==_||e[37]!==s||e[38]!==g?(ce=E=>{k(E.id)||g(E.id),s(),f(""),_(E.id)},e[35]=k,e[36]=_,e[37]=s,e[38]=g,e[39]=ce):ce=e[39];const ye=ce,_e=E=>{s(),f(""),E==="self-healing-storefront"?i():E==="site-editor"?o():E==="site-diagnostics"?W?M(W.id):l():E==="lean-canvas"?ee?M(ee.id):a():E==="ai-image"?X?M(X.id):u():E==="ai-research"?Ne?M(Ne.id):d():E==="studio-pack"?c():_(E)};A="flex flex-col max-h-[min(640px,80dvh)]",e[40]!==m?(P=n.jsx(io,{value:m,onChange:f,placeholder:"Search agents..."}),e[40]=m,e[41]=P):P=e[41],w="overflow-y-auto flex-1 min-h-0 px-3 pb-3",e[42]===Symbol.for("react.memo_cache_sentinel")?($=n.jsx("div",{className:"px-1 pt-3 pb-2",children:n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Agents"})}),e[42]=$):$=e[42];let re;e[43]!==S||e[44]!==s?(re=async()=>{se("agent_create_new_clicked",{source:"browse_popover"}),await S(),s()},e[43]=S,e[44]=s,e[45]=re):re=e[45];let de,ue;e[46]===Symbol.for("react.memo_cache_sentinel")?(de=n.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-dashed border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:n.jsx(Ke,{size:16,className:"text-muted-foreground"})}),ue=n.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Create new"}),e[46]=de,e[47]=ue):(de=e[46],ue=e[47]);let me;e[48]!==y||e[49]!==re?(me=n.jsxs("button",{type:"button",disabled:y,onClick:re,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group disabled:opacity-50 disabled:cursor-not-allowed",children:[de,ue]}),e[48]=y,e[49]=re,e[50]=me):me=e[50];let fe;e[51]!==s||e[52]!==r||e[53]!==v.experimental_vibecode?(fe=v.experimental_vibecode&&n.jsxs("button",{type:"button",onClick:()=>{se("agent_import_clicked",{source:"github"}),r(),s()},className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[n.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:n.jsx(po,{className:"size-5 text-muted-foreground"})}),n.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Import GitHub"})]}),e[51]=s,e[52]=r,e[53]=v.experimental_vibecode,e[54]=fe):fe=e[54];let xe;e[55]!==ye?(xe=E=>n.jsx(Dr,{agent:E,onClick:()=>ye(E)},E.id),e[55]=ye,e[56]=xe):xe=e[56],O=n.jsxs("div",{className:"grid grid-cols-3 gap-1",children:[me,fe,z.map(xe)]}),T=D.length>0&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"px-1 pt-4 pb-2",children:n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Agent templates"})}),n.jsx("div",{className:"grid grid-cols-3 gap-1",children:D.map(E=>n.jsxs("button",{type:"button",onClick:()=>{se("agent_template_clicked",{template_id:E.id,template_title:E.title}),_e(E.id)},className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group disabled:opacity-50 disabled:cursor-not-allowed",children:[n.jsx(Pe,{icon:E.icon,name:E.title,size:"md",className:"transition-transform group-hover:scale-105"}),n.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground line-clamp-2 w-full",children:E.title})]},E.id))})]}),e[3]=x,e[4]=S,e[5]=y,e[6]=k,e[7]=M,e[8]=_,e[9]=s,e[10]=u,e[11]=d,e[12]=l,e[13]=r,e[14]=o,e[15]=a,e[16]=i,e[17]=c,e[18]=g,e[19]=v.experimental_vibecode,e[20]=m,e[21]=D,e[22]=w,e[23]=$,e[24]=O,e[25]=T,e[26]=A,e[27]=P,e[28]=z}else D=e[21],w=e[22],$=e[23],O=e[24],T=e[25],A=e[26],P=e[27],z=e[28];let L;e[57]!==D||e[58]!==y||e[59]!==m||e[60]!==z.length?(L=z.length===0&&D.length===0&&!y&&n.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:m?"No agents found":"No agents yet"}),e[57]=D,e[58]=y,e[59]=m,e[60]=z.length,e[61]=L):L=e[61];let R;e[62]!==w||e[63]!==$||e[64]!==O||e[65]!==T||e[66]!==L?(R=n.jsxs("div",{className:w,children:[$,O,T,L]}),e[62]=w,e[63]=$,e[64]=O,e[65]=T,e[66]=L,e[67]=R):R=e[67];let B;e[68]!==p.slug?(B={org:p.slug},e[68]=p.slug,e[69]=B):B=e[69];let U;e[70]!==s?(U=()=>s(),e[70]=s,e[71]=U):U=e[71];let F;e[72]!==B||e[73]!==U?(F=n.jsx("div",{className:"border-t border-border px-3 py-2.5",children:n.jsx(Xs,{to:"/$org/settings/agents",params:B,onClick:U,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:"See all agents"})}),e[72]=B,e[73]=U,e[74]=F):F=e[74];let H;return e[75]!==R||e[76]!==F||e[77]!==A||e[78]!==P?(H=n.jsxs("div",{className:A,children:[P,R,F]}),e[75]=R,e[76]=F,e[77]=A,e[78]=P,e[79]=H):H=e[79],H}function Fr(t){return t.id==="ai-research"}function Ur(t){return t.id==="ai-image"}function Gr(t){return t.id==="lean-canvas"}function Br(t){return t.id==="site-diagnostics"}function Hr(t){return Fn(t.id)}function Vr(t){return!Ln(t.id)}function Kr(t){return t.id}function Wr(t){return t.pinned}function qr(){const t=C.c(36),[e,s]=b.useState(!1),[o,r]=b.useState(!1),[i,l]=b.useState(!1),[a,c]=b.useState(!1),[u,d]=b.useState(!1),[m,f]=b.useState(!1),[x,p]=b.useState(!1),[j,I]=b.useState(!1),[g,k]=b.useState(!1),h=Bt(),{setOpenMobile:S}=Qe();let y;t[0]!==h||t[1]!==S?(y=()=>{s(!1),h&&S(!1)},t[0]=h,t[1]=S,t[2]=y):y=t[2];const v=y;let _;t[3]!==v||t[4]!==e?(_=e&&n.jsx(b.Suspense,{fallback:n.jsx("div",{className:"flex items-center justify-center py-8",children:n.jsx(Ve,{className:"h-4 w-24"})}),children:n.jsx(Lr,{onClose:v,onOpenImportDeco:()=>r(!0),onOpenGithubImport:()=>{l(!0),v()},onOpenSelfHealing:()=>{c(!0),v()},onOpenDiagnosticsModal:()=>d(!0),onOpenLeanCanvasModal:()=>f(!0),onOpenStudioPackModal:()=>p(!0),onOpenAiImageModal:()=>I(!0),onOpenAiResearchModal:()=>k(!0)})}),t[3]=v,t[4]=e,t[5]=_):_=t[5];const M=_;let D;t[6]!==h||t[7]!==e||t[8]!==M?(D=h?n.jsxs(n.Fragment,{children:[n.jsx(ie,{children:n.jsx(he,{tooltip:"Browse agents",className:"bg-muted/75 hover:bg-sidebar-accent",onClick:()=>{se("agent_browser_opened",{surface:"mobile_drawer"}),s(!0)},children:n.jsx(Ke,{className:"!opacity-100"})})}),n.jsx(Ft,{open:e,onOpenChange:s,direction:"bottom",children:n.jsxs(Ut,{className:"max-h-[85dvh] p-0",children:[n.jsx(Gt,{className:"sr-only",children:"Browse agents"}),M]})})]}):n.jsxs(lt,{open:e,onOpenChange:B=>{B&&!e&&se("agent_browser_opened",{surface:"desktop_popover"}),s(B)},children:[n.jsx(ie,{children:n.jsx(at,{asChild:!0,children:n.jsx(he,{tooltip:"Browse agents",className:"bg-muted/75 hover:bg-sidebar-accent",children:n.jsx(Ke,{className:"!opacity-100"})})})}),n.jsx(ct,{className:"w-[380px] p-0 overflow-hidden",side:"right",align:"start",children:M})]}),t[6]=h,t[7]=e,t[8]=M,t[9]=D):D=t[9];let w;t[10]!==o?(w=n.jsx(co,{open:o,onOpenChange:r}),t[10]=o,t[11]=w):w=t[11];let $;t[12]!==i?($=n.jsx(uo,{open:i,onOpenChange:l}),t[12]=i,t[13]=$):$=t[13];let O;t[14]!==a?(O=n.jsx(Vn,{open:a,onOpenChange:c}),t[14]=a,t[15]=O):O=t[15];let T;t[16]!==u?(T=n.jsx(mo,{open:u,onOpenChange:d}),t[16]=u,t[17]=T):T=t[17];let A;t[18]!==m?(A=n.jsx(fo,{open:m,onOpenChange:f}),t[18]=m,t[19]=A):A=t[19];let P;t[20]!==x?(P=n.jsx(xo,{open:x,onOpenChange:p}),t[20]=x,t[21]=P):P=t[21];let z;t[22]!==j?(z=n.jsx(Kn,{open:j,onOpenChange:I}),t[22]=j,t[23]=z):z=t[23];let L;t[24]!==g?(L=n.jsx(Wn,{open:g,onOpenChange:k}),t[24]=g,t[25]=L):L=t[25];let R;return t[26]!==L||t[27]!==D||t[28]!==w||t[29]!==$||t[30]!==O||t[31]!==T||t[32]!==A||t[33]!==P||t[34]!==z?(R=n.jsxs(n.Fragment,{children:[D,w,$,O,T,A,P,z,L]}),t[26]=L,t[27]=D,t[28]=w,t[29]=$,t[30]=O,t[31]=T,t[32]=A,t[33]=P,t[34]=z,t[35]=R):R=t[35],R}function Qr(){const t=C.c(34),e=qt(),{org:s}=pe();let o;t[0]!==e?(o=e.filter(Zr).map(Jr),t[0]=e,t[1]=o):o=t[1];const r=o,{pinnedIds:i,unpin:l,reorder:a}=Yt(s.id,r),c=new Map(e.map(Xr)),u=i.map(R=>c.get(R)).filter(Yr);let d;t[2]===Symbol.for("react.memo_cache_sentinel")?(d={activationConstraint:{distance:5}},t[2]=d):d=t[2];let m;t[3]===Symbol.for("react.memo_cache_sentinel")?(m={coordinateGetter:so},t[3]=m):m=t[3];const f=Qn(bt(Xn,d),bt(Yn,m));let x;t[4]!==i||t[5]!==a?(x=R=>{const{active:B,over:U}=R;if(!U||B.id===U.id)return;const F=i.indexOf(B.id),H=i.indexOf(U.id);F===-1||H===-1||a(no([...i],F,H))},t[4]=i,t[5]=a,t[6]=x):x=t[6];const p=x,j=De,I="py-0 px-0 mt-2 flex-1 min-h-0";let g;t[7]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx("div",{className:"h-px bg-border mx-2 mb-2"}),t[7]=g):g=t[7];const k=Le,h="flex flex-1 min-h-0 flex-col overflow-y-auto [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",S=ge,y="gap-2";let v;t[8]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(qr,{}),t[8]=v):v=t[8];const _=eo,M=to,D=Jn,w=Zn;let $;t[9]!==s.slug||t[10]!==l?($=R=>n.jsx(Er,{agent:R,org:s.slug,onUnpin:()=>l(R.id)},R.id),t[9]=s.slug,t[10]=l,t[11]=$):$=t[11];const O=u.map($);let T;t[12]!==D||t[13]!==i||t[14]!==w||t[15]!==O?(T=n.jsx(D,{items:i,strategy:w,children:O}),t[12]=D,t[13]=i,t[14]=w,t[15]=O,t[16]=T):T=t[16];let A;t[17]!==_||t[18]!==p||t[19]!==f||t[20]!==T||t[21]!==M?(A=n.jsx(_,{sensors:f,collisionDetection:M,onDragEnd:p,children:T}),t[17]=_,t[18]=p,t[19]=f,t[20]=T,t[21]=M,t[22]=A):A=t[22];let P;t[23]!==S||t[24]!==A||t[25]!==v?(P=n.jsxs(S,{className:y,children:[v,A]}),t[23]=S,t[24]=A,t[25]=v,t[26]=P):P=t[26];let z;t[27]!==k||t[28]!==P?(z=n.jsx(k,{className:h,children:P}),t[27]=k,t[28]=P,t[29]=z):z=t[29];let L;return t[30]!==j||t[31]!==z||t[32]!==g?(L=n.jsxs(j,{className:I,children:[g,z]}),t[30]=j,t[31]=z,t[32]=g,t[33]=L):L=t[33],L}function Yr(t){return!!t}function Xr(t){return[t.id,t]}function Jr(t){return t.id}function Zr(t){return t.pinned}function xs(){const t=C.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(b.Suspense,{fallback:n.jsx(De,{className:"py-0 px-0",children:n.jsx(Le,{children:n.jsx(ge,{className:"gap-2",children:n.jsx(ie,{children:n.jsxs("div",{className:"flex items-center gap-2 px-2 py-2",children:[n.jsx(Ve,{className:"h-4 w-4 rounded"}),n.jsx(Ve,{className:"h-4 flex-1"})]})})})})}),children:n.jsx(Qr,{})}),t[0]=e):e=t[0],e}function yl(){const t=C.c(4),e=Zt();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(er,{}),t[0]=s):s=t[0];let o;t[1]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(it,{children:n.jsx(b.Suspense,{fallback:null,children:n.jsx(xs,{})})}),t[1]=o):o=t[1];let r;return t[2]!==e?(r=n.jsx(ss,{sections:e,footer:s,additionalContent:o}),t[2]=e,t[3]=r):r=t[3],r}function _l(t){const e=C.c(5),{onClose:s}=t,o=Zt();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(tr,{}),e[0]=r):r=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(it,{children:n.jsx(b.Suspense,{fallback:null,children:n.jsx(xs,{})})}),e[1]=i):i=e[1];let l;return e[2]!==s||e[3]!==o?(l=n.jsx($o,{sections:o,onClose:s,footer:r,additionalContent:i}),e[2]=s,e[3]=o,e[4]=l):l=e[4],l}function ei(t,e){return t===1?!0:t===0?!1:e}function ti(t){const e=t.entityMetadata?.defaultMainView??null,s=e==null||e.type==="chat",o=t.mainParamPresent?t.mainParamValue!=="0":!s,r=s?!0:t.entityMetadata?.chatDefaultOpen??!1;return{mainOpen:o,chatOpen:r}}function Sl(t,e){return t&&e?{chat:45,main:55}:t&&!e?{chat:100,main:0}:!t&&e?{chat:0,main:100}:{chat:0,main:0}}function si(t,e){return t===1?!0:t===0?!1:e}function Cl(t,e){const s=ve(),o=qe({strict:!1}),r=We({strict:!1}),i=Re(),l=Xt(),{locator:a}=pe(),{virtualMcpId:c,orgSlug:u,isAgentRoute:d}=e,m=ti({entityMetadata:t,mainParamPresent:o.main!==void 0,mainParamValue:o.main}),f=si(o.chat,m.chatOpen),x=m.mainOpen,p=b.useRef(crypto.randomUUID()),j=r.taskId??p.current,I="/$org/$taskId",g=w=>({org:u,taskId:w}),k=d?{virtualmcpid:c}:{},h=(w,$)=>{s({to:I,params:g(j),search:O=>({...O,...w}),replace:$?.replace??!1})},S=(w,$)=>{s({to:I,params:g(w),search:O=>{const T={};return $?T.virtualmcpid=$:d&&(T.virtualmcpid=c),O.tasks&&(T.tasks=O.tasks),T}})},y=()=>{x?h({main:"0"},{replace:!0}):h({main:un(t)},{replace:!0})},v=()=>{h({chat:f?0:1},{replace:!0})},_=()=>{f||h({chat:1},{replace:!0})},M=async()=>{const w=crypto.randomUUID(),$=Lt(i,a,j);try{await l.create.mutateAsync({id:w,virtual_mcp_id:c,...$?{branch:$}:{}})}catch{}s({to:I,params:g(w),search:O=>{const T={...k,chat:1};return O.tasks&&(T.tasks=O.tasks),T}})},D=w=>{h({main:w},{replace:!0})};return{taskId:j,mainOpen:x,chatOpen:f,mainParam:o.main,setTaskId:S,toggleMain:y,toggleChat:v,openChat:_,createNewTask:M,openTab:D}}const ut=b.createContext(null);function Nl(t){const e=C.c(15),{children:s}=t,o=ve();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},e[0]=r):r=e[0];const i=qe(r);let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l={owner:"all",status:"open"},e[1]=l):l=e[1];const{tasks:a}=ot(l);let c;e[2]!==i.tasks||e[3]!==a.length?(c=()=>ei(i.tasks,a.length>0),e[2]=i.tasks,e[3]=a.length,e[4]=c):c=e[4];const[u,d]=b.useState(c);let m,f;e[5]!==o||e[6]!==u?(m=()=>{o({search:(g=>({...g,tasks:u?1:0})),replace:!0})},f=[u,o],e[5]=o,e[6]=u,e[7]=m,e[8]=f):(m=e[7],f=e[8]),b.useEffect(m,f);let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=()=>d(ni),e[9]=x):x=e[9];const p=x;let j;e[10]!==u?(j={tasksOpen:u,toggleTasks:p},e[10]=u,e[11]=j):j=e[11];let I;return e[12]!==s||e[13]!==j?(I=n.jsx(ut.Provider,{value:j,children:s}),e[12]=s,e[13]=j,e[14]=I):I=e[14],I}function ni(t){return!t}function kl(){const t=b.useContext(ut);if(!t)throw new Error("useTasksPanelState must be used inside <TasksPanelStateProvider>");return t}function wl(){return b.useContext(ut)}const ps=b.createContext(null);function Ce(){const t=b.use(ps);if(!t)throw new Error("Toolbar.* must be used inside <Toolbar>");return t}function le(t){const e=C.c(10),{children:s}=t,[o,r]=b.useState(null),[i,l]=b.useState(null),[a,c]=b.useState(null),[u,d]=b.useState(null);let m;e[0]!==a||e[1]!==u||e[2]!==i||e[3]!==o?(m={togglesEl:o,setTogglesEl:r,tabsEl:i,setTabsEl:l,centerEl:a,setCenterEl:c,rightEl:u,setRightEl:d},e[0]=a,e[1]=u,e[2]=i,e[3]=o,e[4]=m):m=e[4];let f;e[5]!==s?(f=n.jsx("div",{className:"flex flex-col h-full min-h-0",children:s}),e[5]=s,e[6]=f):f=e[6];let x;return e[7]!==m||e[8]!==f?(x=n.jsx(ps,{value:m,children:f}),e[7]=m,e[8]=f,e[9]=x):x=e[9],x}function oi(t){const e=C.c(2),{children:s}=t;let o;return e[0]!==s?(o=n.jsx("div",{className:"shrink-0 grid grid-cols-3 items-center pl-1 pr-2 pt-0.25 h-12",children:s}),e[0]=s,e[1]=o):o=e[1],o}function ri(t){const e=C.c(2),{children:s}=t;let o;return e[0]!==s?(o=n.jsx("div",{className:"flex items-center gap-0.5 min-w-0 justify-self-start",children:s}),e[0]=s,e[1]=o):o=e[1],o}function ii(t){const e=C.c(2),{children:s}=t;let o;return e[0]!==s?(o=n.jsx("div",{className:"flex items-center justify-end gap-0.5 min-w-0 justify-self-end",children:s}),e[0]=s,e[1]=o):o=e[1],o}function li(){const t=C.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("button",{type:"button",onClick:ci,className:"flex size-7 shrink-0 items-center justify-center rounded-md text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Go back",children:n.jsx(gn,{size:16})}),t[0]=e):e=t[0];let s;return t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsxs(n.Fragment,{children:[e,n.jsx("button",{type:"button",onClick:ai,className:"flex size-7 shrink-0 items-center justify-center rounded-md text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Go forward",children:n.jsx(go,{size:16})})]}),t[1]=s):s=t[1],s}function ai(){return window.history.forward()}function ci(){return window.history.back()}function di(){const t=C.c(2),{setCenterEl:e}=Ce();let s;return t[0]!==e?(s=n.jsx("div",{ref:e,className:"min-w-0 flex items-center justify-center gap-2"}),t[0]=e,t[1]=s):s=t[1],s}function ui(t){const e=C.c(3),{children:s}=t,{centerEl:o}=Ce();if(!o)return null;let r;return e[0]!==o||e[1]!==s?(r=Ee.createPortal(s,o),e[0]=o,e[1]=s,e[2]=r):r=e[2],r}function mi(){const t=C.c(2),{setTabsEl:e}=Ce();let s;return t[0]!==e?(s=n.jsx("div",{ref:e,className:"shrink-0 flex items-center"}),t[0]=e,t[1]=s):s=t[1],s}function fi(t){const e=C.c(3),{children:s}=t,{tabsEl:o}=Ce();if(!o)return null;let r;return e[0]!==s||e[1]!==o?(r=Ee.createPortal(s,o),e[0]=s,e[1]=o,e[2]=r):r=e[2],r}function xi(){const t=C.c(2),{setTogglesEl:e}=Ce();let s;return t[0]!==e?(s=n.jsx("div",{ref:e,className:"flex items-center gap-0.5 shrink-0 ml-0.5"}),t[0]=e,t[1]=s):s=t[1],s}function pi(t){const e=C.c(3),{children:s}=t,{togglesEl:o}=Ce();if(!o)return null;let r;return e[0]!==s||e[1]!==o?(r=Ee.createPortal(s,o),e[0]=s,e[1]=o,e[2]=r):r=e[2],r}function hi(){const t=C.c(2),{setRightEl:e}=Ce();let s;return t[0]!==e?(s=n.jsx("div",{ref:e,className:"flex items-center justify-end gap-0.5 shrink-0"}),t[0]=e,t[1]=s):s=t[1],s}function gi(t){const e=C.c(3),{children:s}=t,{rightEl:o}=Ce();if(!o)return null;let r;return e[0]!==s||e[1]!==o?(r=Ee.createPortal(s,o),e[0]=s,e[1]=o,e[2]=r):r=e[2],r}le.Header=oi;le.LeftColumn=ri;le.RightColumn=ii;le.Nav=li;le.CenterSlot=di;le.Center=ui;le.TabsSlot=mi;le.Tabs=fi;le.TogglesSlot=xi;le.Toggles=pi;le.RightSlot=hi;le.Right=gi;function bi(){const t=C.c(6),{org:e,locator:s}=pe(),o=Re();let r;t[0]!==s||t[1]!==o?(r=()=>{o.invalidateQueries({queryKey:Pt.tasksPrefix(s)})},t[0]=s,t[1]=o,t[2]=r):r=t[2];let i;t[3]!==e.slug||t[4]!==r?(i={orgSlug:e.slug,onTaskStatus:r},t[3]=e.slug,t[4]=r,t[5]=i):i=t[5],jo(i)}function ji(t){const e=C.c(8),{virtualMcpId:s,size:o,showAutomationBadge:r}=t,i=o===void 0?"sm":o;let l;e[0]!==i||e[1]!==s?(l=s?n.jsx(vi,{virtualMcpId:s,size:i}):n.jsx(Pe,{icon:null,name:"?",size:i}),e[0]=i,e[1]=s,e[2]=l):l=e[2];let a;e[3]!==r?(a=r&&n.jsx("span",{"aria-label":"Automation-triggered",className:"absolute -bottom-0.5 -right-0.5 flex size-4 items-center justify-center rounded-full bg-blue-500 border border-blue-600 text-white",children:n.jsx(vo,{size:10,className:"text-white"})}),e[3]=r,e[4]=a):a=e[4];let c;return e[5]!==l||e[6]!==a?(c=n.jsxs("div",{className:"relative shrink-0",children:[l,a]}),e[5]=l,e[6]=a,e[7]=c):c=e[7],c}function vi(t){const e=C.c(6),{virtualMcpId:s,size:o}=t,r=Qt(s);if(!r){let a;return e[0]!==o?(a=n.jsx(Pe,{icon:null,name:"?",size:o}),e[0]=o,e[1]=a):a=e[1],a}const i=r.icon??null;let l;return e[2]!==r.title||e[3]!==o||e[4]!==i?(l=n.jsx(Pe,{icon:i,name:r.title,size:o}),e[2]=r.title,e[3]=o,e[4]=i,e[5]=l):l=e[5],l}function yi(t){const e=t?.metadata?.githubRepo;return e?.connectionId&&t?.connections?.some(o=>o.connection_id===e.connectionId)?e:null}function _i(t){const e=C.c(47),{task:s,isActive:o,onClick:r,onArchive:i,showAutomationBadge:l}=t,a=yo(s.status),c=a.icon,u=Qt(s.virtual_mcp_id);let d;e[0]!==u?(d=yi(u),e[0]=u,e[1]=d):d=e[1];const m=d,f=b.useRef(null);let x;e[2]!==o?(x=()=>{if(!o)return;const V=f.current;V&&(V.focus({preventScroll:!0}),V.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"}))},e[2]=o,e[3]=x):x=e[3];let p;e[4]!==o||e[5]!==s.id?(p=[o,s.id],e[4]=o,e[5]=s.id,e[6]=p):p=e[6],b.useEffect(x,p);const j="button",I=0;let g;e[7]!==r?(g=V=>{V.target===V.currentTarget&&(V.key==="Enter"||V.key===" ")&&(V.preventDefault(),r())},e[7]=r,e[8]=g):g=e[8];const k=o?"bg-accent":"hover:bg-accent/60";let h;e[9]!==k?(h=J("group/row flex items-center gap-3 px-2 py-1.5 rounded-md cursor-pointer transition-colors","focus-visible:outline-none focus-visible:inset-ring-2 focus-visible:inset-ring-ring/50",k),e[9]=k,e[10]=h):h=e[10];let S;e[11]!==l||e[12]!==s.virtual_mcp_id?(S=n.jsx(ji,{virtualMcpId:s.virtual_mcp_id,size:"xs",showAutomationBadge:l}),e[11]=l,e[12]=s.virtual_mcp_id,e[13]=S):S=e[13];const y=s.title||"Untitled task";let v;e[14]!==y?(v=n.jsx("div",{className:"text-sm text-foreground truncate",children:y}),e[14]=y,e[15]=v):v=e[15];let _;e[16]!==m||e[17]!==s.branch||e[18]!==s.updated_at?(_=s.updated_at&&n.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground min-w-0",children:[s.branch?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"truncate font-mono",children:s.branch}),n.jsx("span",{className:"shrink-0",children:"·"})]}):m?n.jsxs(n.Fragment,{children:[n.jsxs("span",{className:"truncate",children:[m.owner,"/",m.name]}),n.jsx("span",{className:"shrink-0",children:"·"})]}):null,n.jsx("span",{className:"shrink-0",children:mn(new Date(s.updated_at))})]}),e[16]=m,e[17]=s.branch,e[18]=s.updated_at,e[19]=_):_=e[19];let M;e[20]!==v||e[21]!==_?(M=n.jsxs("div",{className:"flex-1 min-w-0",children:[v,_]}),e[20]=v,e[21]=_,e[22]=M):M=e[22];const D="shrink-0 grid [grid-template-areas:'slot'] items-center justify-items-center",w="[grid-area:slot] flex size-7 items-center justify-center group-hover/row:invisible",$=a.label,O=14,T=J(a.iconClassName,s.status==="in_progress"&&"animate-spin");let A;e[23]!==c||e[24]!==T?(A=n.jsx(c,{size:O,className:T}),e[23]=c,e[24]=T,e[25]=A):A=e[25];let P;e[26]!==a||e[27]!==A?(P=n.jsx("span",{className:w,"aria-label":$,children:A}),e[26]=a,e[27]=A,e[28]=P):P=e[28];let z;e[29]!==i?(z=V=>{V.stopPropagation(),i()},e[29]=i,e[30]=z):z=e[30];let L;e[31]===Symbol.for("react.memo_cache_sentinel")?(L=n.jsx(nn,{size:14}),e[31]=L):L=e[31];let R;e[32]!==z?(R=n.jsx(tt,{asChild:!0,children:n.jsx("button",{type:"button","aria-label":"Archive task",onClick:z,className:"[grid-area:slot] invisible group-hover/row:visible flex size-7 items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-muted",children:L})}),e[32]=z,e[33]=R):R=e[33];let B;e[34]===Symbol.for("react.memo_cache_sentinel")?(B=n.jsx(st,{side:"right",children:"Archive"}),e[34]=B):B=e[34];let U;e[35]!==R?(U=n.jsxs(nt,{children:[R,B]}),e[35]=R,e[36]=U):U=e[36];let F;e[37]!==P||e[38]!==U?(F=n.jsxs("div",{className:D,children:[P,U]}),e[37]=P,e[38]=U,e[39]=F):F=e[39];let H;return e[40]!==r||e[41]!==M||e[42]!==F||e[43]!==g||e[44]!==h||e[45]!==S?(H=n.jsxs("div",{ref:f,role:j,tabIndex:I,onClick:r,onKeyDown:g,className:h,children:[S,M,F]}),e[40]=r,e[41]=M,e[42]=F,e[43]=g,e[44]=h,e[45]=S,e[46]=H):H=e[46],H}const hs={all:"All tasks",manual:"Chats",automation:"Automation"},gs={all:"All members",mine:"Mine only"};function Si(t){const e=C.c(59),{title:s,tasks:o,activeTaskId:r,onSelect:i,onArchive:l,onNew:a,showNewButton:c,showAutomationBadge:u,emptyLabel:d,currentUserId:m}=t,[f,x]=b.useState("all"),[p,j]=b.useState("mine");let I;e[0]!==m||e[1]!==p||e[2]!==o?(I=p==="mine"&&m?o.filter(N=>N.created_by===m):o,e[0]=m,e[1]=p,e[2]=o,e[3]=I):I=e[3];const g=I;let k;e[4]!==f||e[5]!==g?(k=f==="automation"?g.filter(wi):f==="manual"?g.filter(ki):g,e[4]=f,e[5]=g,e[6]=k):k=e[6];const h=k;let S;e[7]!==s?(S=n.jsx("span",{children:s}),e[7]=s,e[8]=S):S=e[8];let y;e[9]!==p?(y=n.jsx(vt,{asChild:!0,children:n.jsx("button",{type:"button","aria-label":"Filter by member",className:"flex size-8 items-center justify-center rounded-md hover:bg-muted hover:text-foreground",children:p==="mine"?n.jsx(rn,{size:16}):n.jsx(Vt,{size:16})})}),e[9]=p,e[10]=y):y=e[10];let v;e[11]!==p?(v=N=>{const K=N;K!==p&&se("tasks_panel_member_filter_changed",{to_value:K}),j(K)},e[11]=p,e[12]=v):v=e[12];let _;e[13]===Symbol.for("react.memo_cache_sentinel")?(_=Object.keys(gs),e[13]=_):_=e[13];let M;e[14]===Symbol.for("react.memo_cache_sentinel")?(M=_.map(Ni),e[14]=M):M=e[14];let D;e[15]!==p||e[16]!==v?(D=n.jsx(yt,{align:"end",children:n.jsx(_t,{value:p,onValueChange:v,children:M})}),e[15]=p,e[16]=v,e[17]=D):D=e[17];let w;e[18]!==y||e[19]!==D?(w=n.jsxs(St,{children:[y,D]}),e[18]=y,e[19]=D,e[20]=w):w=e[20];const $=f!=="all"&&"text-purple-500";let O;e[21]!==$?(O=J("flex size-8 items-center justify-center rounded-md hover:bg-muted hover:text-foreground",$),e[21]=$,e[22]=O):O=e[22];let T;e[23]===Symbol.for("react.memo_cache_sentinel")?(T=n.jsx(xn,{size:16}),e[23]=T):T=e[23];let A;e[24]!==O?(A=n.jsx(vt,{asChild:!0,children:n.jsx("button",{type:"button","aria-label":"Filter tasks",className:O,children:T})}),e[24]=O,e[25]=A):A=e[25];let P;e[26]!==f?(P=N=>{const K=N;K!==f&&se("tasks_panel_filter_changed",{to_value:K}),x(K)},e[26]=f,e[27]=P):P=e[27];let z;e[28]===Symbol.for("react.memo_cache_sentinel")?(z=Object.keys(hs),e[28]=z):z=e[28];let L;e[29]===Symbol.for("react.memo_cache_sentinel")?(L=z.map(Ci),e[29]=L):L=e[29];let R;e[30]!==f||e[31]!==P?(R=n.jsx(yt,{align:"end",children:n.jsx(_t,{value:f,onValueChange:P,children:L})}),e[30]=f,e[31]=P,e[32]=R):R=e[32];let B;e[33]!==A||e[34]!==R?(B=n.jsxs(St,{children:[A,R]}),e[33]=A,e[34]=R,e[35]=B):B=e[35];let U;e[36]!==a||e[37]!==c||e[38]!==s?(U=c&&a&&n.jsx("button",{type:"button",onClick:()=>{se("tasks_panel_new_clicked"),a()},"aria-label":`New ${s.toLowerCase()}`,className:"flex size-8 items-center justify-center rounded-md hover:bg-muted hover:text-foreground",children:n.jsx(on,{size:16})}),e[36]=a,e[37]=c,e[38]=s,e[39]=U):U=e[39];let F;e[40]!==B||e[41]!==U||e[42]!==w?(F=n.jsxs("div",{className:"flex items-center gap-0.5",children:[w,B,U]}),e[40]=B,e[41]=U,e[42]=w,e[43]=F):F=e[43];let H;e[44]!==F||e[45]!==S?(H=n.jsxs("div",{className:"shrink-0 pl-2 pr-1.5 h-7 flex items-center justify-between text-xs font-medium text-muted-foreground mb-1",children:[S,F]}),e[44]=F,e[45]=S,e[46]=H):H=e[46];let V;e[47]!==r||e[48]!==d||e[49]!==l||e[50]!==i||e[51]!==u||e[52]!==h?(V=h.length===0&&d?n.jsx("div",{className:"px-2 py-1.5 text-xs text-muted-foreground/70",children:d}):h.map(N=>n.jsx(_i,{task:N,isActive:r===N.id,onClick:()=>{r!==N.id&&se("tasks_panel_task_clicked",{thread_id:N.id,virtual_mcp_id:N.virtual_mcp_id??null,from_automation:!!N.fromAutomation}),i(N)},onArchive:()=>{se("tasks_panel_task_archived",{thread_id:N.id,virtual_mcp_id:N.virtual_mcp_id??null}),l(N)},showAutomationBadge:u||N.fromAutomation},N.id)),e[47]=r,e[48]=d,e[49]=l,e[50]=i,e[51]=u,e[52]=h,e[53]=V):V=e[53];let q;e[54]!==V?(q=n.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto flex flex-col gap-0.5",children:V}),e[54]=V,e[55]=q):q=e[55];let Q;return e[56]!==H||e[57]!==q?(Q=n.jsxs("div",{className:"flex flex-col h-full min-h-0 mt-1",children:[H,q]}),e[56]=H,e[57]=q,e[58]=Q):Q=e[58],Q}function Ci(t){return n.jsx(Jt,{value:t,children:hs[t]},t)}function Ni(t){return n.jsx(Jt,{value:t,children:gs[t]},t)}function ki(t){return!t.fromAutomation}function wi(t){return t.fromAutomation}function Ii(){const t=C.c(23);bi();const{data:e}=Se.useSession(),s=e?.user?.id;let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={owner:"me",status:"open",hasTrigger:!1},t[0]=o):o=t[0];const{tasks:r}=ot(o);let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i={owner:"all",status:"open",hasTrigger:!0},t[1]=i):i=t[1];const{tasks:l}=ot(i),{setTaskId:a,createNewTask:c}=Dt();let u;t[2]===Symbol.for("react.memo_cache_sentinel")?(u={strict:!1},t[2]=u):u=t[2];const d=We(u),{locator:m,org:f}=pe(),x=Re();let p;t[3]!==f.id||t[4]!==f.slug?(p={connectionId:Kt,orgId:f.id,orgSlug:f.slug},t[3]=f.id,t[4]=f.slug,t[5]=p):p=t[5];const j=Wt(p),I=d.taskId??null;let g;t[6]!==l||t[7]!==r?(g=[...r,...l.map($i)].sort(Mi),t[6]=l,t[7]=r,t[8]=g):g=t[8];const k=g;let h;t[9]!==j||t[10]!==m||t[11]!==x?(h=async _=>{try{await ho(j,_.id,{hidden:!0}),x.invalidateQueries({queryKey:Pt.tasksPrefix(m)})}catch(M){const w=M;je.error(`Failed to archive task: ${w.message}`)}},t[9]=j,t[10]=m,t[11]=x,t[12]=h):h=t[12];const S=h;if(k.length===0){let _;return t[13]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsx("div",{className:"h-full flex items-center justify-center p-4",children:n.jsx(bo,{image:n.jsx(ln,{size:48,className:"text-muted-foreground"}),title:"No tasks yet",description:"Start a conversation to create your first task."})}),t[13]=_):_=t[13],_}let y;t[14]!==a?(y=_=>a(_.id,_.virtual_mcp_id),t[14]=a,t[15]=y):y=t[15];let v;return t[16]!==I||t[17]!==k||t[18]!==c||t[19]!==s||t[20]!==S||t[21]!==y?(v=n.jsx("div",{className:"flex flex-col h-full min-h-0 p-2 gap-3",children:n.jsx(Si,{title:"Tasks",tasks:k,activeTaskId:I,onSelect:y,onArchive:S,onNew:c,showNewButton:!0,currentUserId:s})}),t[16]=I,t[17]=k,t[18]=c,t[19]=s,t[20]=S,t[21]=y,t[22]=v):v=t[22],v}function Mi(t,e){return(e.updated_at??"").localeCompare(t.updated_at??"")}function $i(t){return{...t,fromAutomation:!0}}function Ti(){const t=C.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"flex flex-col h-full p-2 gap-1.5",children:Array.from({length:6}).map(Ai)}),t[0]=e):e=t[0],e}function Ai(t,e){return n.jsx("div",{className:"h-10 rounded-md bg-muted/60 animate-pulse"},e)}function Il(){const t=C.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(qn.Skeleton,{}),t[0]=e):e=t[0];let s;return t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(it,{fallback:e,children:n.jsx(b.Suspense,{fallback:n.jsx(Ti,{}),children:n.jsx(Ii,{})})}),t[1]=s):s=t[1],s}export{yl as S,Il as T,Nl as a,le as b,Sl as c,wl as d,Cl as e,_l as f,yi as g,kl as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bb as _}from"./index-
|
|
1
|
+
import{bb as _}from"./index-BV4BlnS9.js";var b={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"),S;S=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===S||e.getModuleId!==void 0)},r.typeOf=t,r}var v;function C(){return v||(v=1,b.exports=I()),b.exports}var g=C();const h=_(g);export{h as R,g as r};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{cj as ne,e as _,j as o,B as te,l as ln,bc as ze,ck as ms,r as T,s as oe,c as O,g as ps,o as cn,c5 as xs,a7 as hs,a8 as fe,aW as an,c6 as gs,aT as bs,c4 as Ss,c7 as un,b6 as js,cd as ys,ce as vs,ae as ws,cf as Ns,cl as $t,cm as dn,x as ks,y as _s,cn as Cs,co as Is}from"./index-BiwSMF-y.js";import{D as Ts,F as Es,B as $s}from"./index-Cge-ppRk.js";import{e as Fe,i as Os,u as ae}from"./constants-BnMb7TNK.js";import{b as fn}from"./use-virtual-mcp-B3LT7MVT.js";import{M as Re}from"./monaco-editor-CbHwzfZK.js";import{A as Rs,c as Ms,a as Ls,b as Ps,e as As,R as Ut,d as zs}from"./accordion-CDZyqEhI.js";import{B as le}from"./badge-e7cq4wYv.js";import{c as vt,S as wt,d as nt,b as Nt,a as kt}from"./select-BuVZhDrk.js";import{N as Ws,h as Ds,j as Fs,m as Be,P as Hs,i as Vs,R as Us,c as qs,k as Ks,e as qt,d as Bs,S as st}from"./index-DfBYDDUd.js";import{V as Xs}from"./view-mode-toggle-BovL7cZv.js";import{a9 as Js,aa as Gs,i as Qs,a1 as mn,ab as Ys,P as Zs,r as eo,ac as pn,Y as to,U as xn,ad as no,ae as so,S as bt,af as oo}from"./agent-icon-CKJvbkVv.js";import{i as hn}from"./Play-DgV9fPBn.js";import{b as ro,a as io,V as Qe}from"./layout-BBQfzLrY.js";import{c as gn,T as bn,a as Sn,b as jn}from"./tooltip-DFWLC8HI.js";import{u as lo,a as co}from"./use-connection-Bv5BZ_xw.js";import{u as Ot,d as Rt,b as yn}from"./use-mcp-tools-D2vgr_Sh.js";import{c as ao,d as uo,e as fo,D as mo,a as po,b as xo}from"./dialog-DlCT-WoK.js";import"./index-IQKcn_Q9.js";import{S as ho}from"./index-qPq642HU.js";import{D as vn,a as wn,b as Nn,c as Ye}from"./dropdown-menu-CqMcZJzJ.js";import{s as go}from"./Plus-CC-cb8af.js";import{b as kn}from"./Tool01-BJ2-pI1A.js";import{i as He}from"./Check-Bn17wiie.js";import{s as Mt}from"./XClose-CY2dTc5U.js";import{I as Lt}from"./integration-icon-R4Bf_BtR.js";import{a as bo,S as So}from"./scroll-area-PF9KCzsE.js";import"./index-BfMLUnDV.js";import{i as _n}from"./X-CcpHqq2x.js";import{u as Cn,a as jo}from"./use-collections-CKusz5eG.js";import{E as In}from"./empty-state-g7JZH7nI.js";import{c as yo}from"./create-sse-subscription-CxkOgzKf.js";import{I as Kt}from"./input-OXmAT-db.js";const Tn=ne("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);const En=ne("Braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);const ot=ne("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const rt=ne("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const vo=ne("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const $n=ne("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const wo=ne("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const On=ne("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const Rn=ne("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);const Mn=ne("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);const No=ne("OctagonAlert",[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]]);const Ln=ne("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const Pn=ne("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const ko=ne("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const An=ne("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);function _o(t){const e=_.c(15),{onSave:n,onUndo:s,isDirty:i,isSaving:r,saveLabel:l,undoLabel:c}=t,a=l===void 0?"Save":l,u=c===void 0?"Undo":c;if(!i)return null;let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsx(Js,{size:14}),e[0]=d):d=e[0];let f;e[1]!==r||e[2]!==s||e[3]!==u?(f=o.jsxs(te,{variant:"outline",size:"sm",onClick:s,disabled:r,"aria-label":u,children:[d,u]}),e[1]=r,e[2]=s,e[3]=u,e[4]=f):f=e[4];let m;e[5]!==r?(m=r?o.jsx(ln,{size:14,className:"animate-spin"}):o.jsx(Gs,{size:14}),e[5]=r,e[6]=m):m=e[6];let x;e[7]!==r||e[8]!==n||e[9]!==a||e[10]!==m?(x=o.jsxs(te,{variant:"default",size:"sm",onClick:n,disabled:r,"aria-label":a,children:[m,a]}),e[7]=r,e[8]=n,e[9]=a,e[10]=m,e[11]=x):x=e[11];let p;return e[12]!==f||e[13]!==x?(p=o.jsxs(o.Fragment,{children:[f,x]}),e[12]=f,e[13]=x,e[14]=p):p=e[14],p}const Bt=t=>{let e;const n=new Set,s=(u,d)=>{const f=typeof u=="function"?u(e):u;if(!Object.is(f,e)){const m=e;e=d??(typeof f!="object"||f===null)?f:Object.assign({},e,f),n.forEach(x=>x(e,m))}},i=()=>e,c={setState:s,getState:i,getInitialState:()=>a,subscribe:u=>(n.add(u),()=>n.delete(u))},a=e=t(s,i,c);return c},Pt=(t=>t?Bt(t):Bt),Co=t=>t;function _t(t,e=Co){const n=ze.useSyncExternalStore(t.subscribe,ze.useCallback(()=>e(t.getState()),[t,e]),ze.useCallback(()=>e(t.getInitialState()),[t,e]));return ze.useDebugValue(n),n}const Io=t=>{const e=Pt(t),n=s=>_t(e,s);return Object.assign(n,e),n},To=(t=>Io);function zn(t,e){let n;try{n=t()}catch{return}return{getItem:i=>{var r;const l=a=>a===null?null:JSON.parse(a,void 0),c=(r=n.getItem(i))!=null?r:null;return c instanceof Promise?c.then(l):l(c)},setItem:(i,r)=>n.setItem(i,JSON.stringify(r,void 0)),removeItem:i=>n.removeItem(i)}}const Ct=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(s){return Ct(s)(n)},catch(s){return this}}}catch(n){return{then(s){return this},catch(s){return Ct(s)(n)}}}},Eo=(t,e)=>(n,s,i)=>{let r={storage:zn(()=>window.localStorage),partialize:g=>g,version:0,merge:(g,b)=>({...b,...g}),...e},l=!1,c=0;const a=new Set,u=new Set;let d=r.storage;if(!d)return t((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${r.name}', the given storage is currently unavailable.`),n(...g)},s,i);const f=()=>{const g=r.partialize({...s()});return d.setItem(r.name,{state:g,version:r.version})},m=i.setState;i.setState=(g,b)=>(m(g,b),f());const x=t((...g)=>(n(...g),f()),s,i);i.getInitialState=()=>x;let p;const h=()=>{var g,b;if(!d)return;const j=++c;l=!1,a.forEach(y=>{var S;return y((S=s())!=null?S:x)});const v=((b=r.onRehydrateStorage)==null?void 0:b.call(r,(g=s())!=null?g:x))||void 0;return Ct(d.getItem.bind(d))(r.name).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==r.version){if(r.migrate){const S=r.migrate(y.state,y.version);return S instanceof Promise?S.then(w=>[!0,w]):[!0,S]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,y.state];return[!1,void 0]}).then(y=>{var S;if(j!==c)return;const[w,N]=y;if(p=r.merge(N,(S=s())!=null?S:x),n(p,!0),w)return f()}).then(()=>{j===c&&(v?.(s(),void 0),p=s(),l=!0,u.forEach(y=>y(p)))}).catch(y=>{j===c&&v?.(void 0,y)})};return i.persist={setOptions:g=>{r={...r,...g},g.storage&&(d=g.storage)},clearStorage:()=>{d?.removeItem(r.name)},getOptions:()=>r,rehydrate:()=>h(),hasHydrated:()=>l,onHydrate:g=>(a.add(g),()=>{a.delete(g)}),onFinishHydration:g=>(u.add(g),()=>{u.delete(g)})},r.skipHydration||h(),p||x},Wn=Eo,{useSyncExternalStoreWithSelector:$o}=ms,Oo=t=>t;function Ro(t,e=Oo,n){const s=$o(t.subscribe,t.getState,t.getInitialState,e,n);return ze.useDebugValue(s),s}const Xt=t=>Symbol.iterator in t,Jt=t=>"entries"in t,Gt=(t,e)=>{const n=t instanceof Map?t:new Map(t.entries()),s=e instanceof Map?e:new Map(e.entries());if(n.size!==s.size)return!1;for(const[i,r]of n)if(!s.has(i)||!Object.is(r,s.get(i)))return!1;return!0},Mo=(t,e)=>{const n=t[Symbol.iterator](),s=e[Symbol.iterator]();let i=n.next(),r=s.next();for(;!i.done&&!r.done;){if(!Object.is(i.value,r.value))return!1;i=n.next(),r=s.next()}return!!i.done&&!!r.done};function Lo(t,e){return Object.is(t,e)?!0:typeof t!="object"||t===null||typeof e!="object"||e===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?!1:Xt(t)&&Xt(e)?Jt(t)&&Jt(e)?Gt(t,e):Mo(t,e):Gt({entries:()=>Object.entries(t)},{entries:()=>Object.entries(e)})}function Dn(t,e="Output"){if(!t)return`interface ${e} {}`;function n(r){if(!r||typeof r!="object")return"unknown";const l=r.type;if(Array.isArray(l))return l.map(c=>s(c)).join(" | ");switch(l){case"string":return r.enum?r.enum.map(c=>`"${c}"`).join(" | "):"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";case"array":{const c=r.items;return c?`${n(c)}[]`:"unknown[]"}case"object":return i(r);default:return r.anyOf?r.anyOf.map(n).join(" | "):r.oneOf?r.oneOf.map(n).join(" | "):r.allOf?r.allOf.map(n).join(" & "):"unknown"}}function s(r){switch(r){case"string":return"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";default:return"unknown"}}function i(r){const l=r.properties;if(!l)return"Record<string, unknown>";const c=new Set(r.required||[]);return`{
|
|
1
|
+
import{cj as ne,e as _,j as o,B as te,l as ln,bc as ze,ck as ms,r as T,s as oe,c as O,g as ps,o as cn,c5 as xs,a7 as hs,a8 as fe,aW as an,c6 as gs,aT as bs,c4 as Ss,c7 as un,b6 as js,cd as ys,ce as vs,ae as ws,cf as Ns,cl as $t,cm as dn,x as ks,y as _s,cn as Cs,co as Is}from"./index-BV4BlnS9.js";import{D as Ts,F as Es,B as $s}from"./index-CyJ-TyKU.js";import{e as Fe,i as Os,u as ae}from"./constants-Dm1wnwL3.js";import{b as fn}from"./use-virtual-mcp-BR6mzHHD.js";import{M as Re}from"./monaco-editor-_r7N6eV-.js";import{A as Rs,c as Ms,a as Ls,b as Ps,e as As,R as Ut,d as zs}from"./accordion-81SrnINF.js";import{B as le}from"./badge-tvsCFCHP.js";import{c as vt,S as wt,d as nt,b as Nt,a as kt}from"./select-DQy3AX-J.js";import{N as Ws,h as Ds,j as Fs,m as Be,P as Hs,i as Vs,R as Us,c as qs,k as Ks,e as qt,d as Bs,S as st}from"./index-B8A_ReFj.js";import{V as Xs}from"./view-mode-toggle-ZI-MN1pO.js";import{a9 as Js,aa as Gs,i as Qs,a1 as mn,ab as Ys,P as Zs,r as eo,ac as pn,Y as to,U as xn,ad as no,ae as so,S as bt,af as oo}from"./agent-icon-C2zAhw3X.js";import{i as hn}from"./Play-EPgISV5B.js";import{b as ro,a as io,V as Qe}from"./layout-GReGu88m.js";import{c as gn,T as bn,a as Sn,b as jn}from"./tooltip-DZT-1bal.js";import{u as lo,a as co}from"./use-connection-Ck4brnCx.js";import{u as Ot,d as Rt,b as yn}from"./use-mcp-tools-rNZ6JWxz.js";import{c as ao,d as uo,e as fo,D as mo,a as po,b as xo}from"./dialog-0SvGB_9G.js";import"./index-WBXV3t9A.js";import{S as ho}from"./index-DYUyKEVO.js";import{D as vn,a as wn,b as Nn,c as Ye}from"./dropdown-menu-BkrpBFy3.js";import{s as go}from"./Plus-BYimMcAW.js";import{b as kn}from"./Tool01-DVcjHQGB.js";import{i as He}from"./Check-DC_iCN8Z.js";import{s as Mt}from"./XClose-BdbZPqCd.js";import{I as Lt}from"./integration-icon-DgJZ63kl.js";import{a as bo,S as So}from"./scroll-area-Dal58SLb.js";import"./index-CEyiW6G-.js";import{i as _n}from"./X-QdBx5oCM.js";import{u as Cn,a as jo}from"./use-collections-ASqcb463.js";import{E as In}from"./empty-state-CxZybw5m.js";import{c as yo}from"./create-sse-subscription-CxkOgzKf.js";import{I as Kt}from"./input-Bs7mkNsF.js";const Tn=ne("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);const En=ne("Braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);const ot=ne("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const rt=ne("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const vo=ne("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const $n=ne("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const wo=ne("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const On=ne("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const Rn=ne("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);const Mn=ne("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);const No=ne("OctagonAlert",[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]]);const Ln=ne("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const Pn=ne("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const ko=ne("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const An=ne("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);function _o(t){const e=_.c(15),{onSave:n,onUndo:s,isDirty:i,isSaving:r,saveLabel:l,undoLabel:c}=t,a=l===void 0?"Save":l,u=c===void 0?"Undo":c;if(!i)return null;let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsx(Js,{size:14}),e[0]=d):d=e[0];let f;e[1]!==r||e[2]!==s||e[3]!==u?(f=o.jsxs(te,{variant:"outline",size:"sm",onClick:s,disabled:r,"aria-label":u,children:[d,u]}),e[1]=r,e[2]=s,e[3]=u,e[4]=f):f=e[4];let m;e[5]!==r?(m=r?o.jsx(ln,{size:14,className:"animate-spin"}):o.jsx(Gs,{size:14}),e[5]=r,e[6]=m):m=e[6];let x;e[7]!==r||e[8]!==n||e[9]!==a||e[10]!==m?(x=o.jsxs(te,{variant:"default",size:"sm",onClick:n,disabled:r,"aria-label":a,children:[m,a]}),e[7]=r,e[8]=n,e[9]=a,e[10]=m,e[11]=x):x=e[11];let p;return e[12]!==f||e[13]!==x?(p=o.jsxs(o.Fragment,{children:[f,x]}),e[12]=f,e[13]=x,e[14]=p):p=e[14],p}const Bt=t=>{let e;const n=new Set,s=(u,d)=>{const f=typeof u=="function"?u(e):u;if(!Object.is(f,e)){const m=e;e=d??(typeof f!="object"||f===null)?f:Object.assign({},e,f),n.forEach(x=>x(e,m))}},i=()=>e,c={setState:s,getState:i,getInitialState:()=>a,subscribe:u=>(n.add(u),()=>n.delete(u))},a=e=t(s,i,c);return c},Pt=(t=>t?Bt(t):Bt),Co=t=>t;function _t(t,e=Co){const n=ze.useSyncExternalStore(t.subscribe,ze.useCallback(()=>e(t.getState()),[t,e]),ze.useCallback(()=>e(t.getInitialState()),[t,e]));return ze.useDebugValue(n),n}const Io=t=>{const e=Pt(t),n=s=>_t(e,s);return Object.assign(n,e),n},To=(t=>Io);function zn(t,e){let n;try{n=t()}catch{return}return{getItem:i=>{var r;const l=a=>a===null?null:JSON.parse(a,void 0),c=(r=n.getItem(i))!=null?r:null;return c instanceof Promise?c.then(l):l(c)},setItem:(i,r)=>n.setItem(i,JSON.stringify(r,void 0)),removeItem:i=>n.removeItem(i)}}const Ct=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(s){return Ct(s)(n)},catch(s){return this}}}catch(n){return{then(s){return this},catch(s){return Ct(s)(n)}}}},Eo=(t,e)=>(n,s,i)=>{let r={storage:zn(()=>window.localStorage),partialize:g=>g,version:0,merge:(g,b)=>({...b,...g}),...e},l=!1,c=0;const a=new Set,u=new Set;let d=r.storage;if(!d)return t((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${r.name}', the given storage is currently unavailable.`),n(...g)},s,i);const f=()=>{const g=r.partialize({...s()});return d.setItem(r.name,{state:g,version:r.version})},m=i.setState;i.setState=(g,b)=>(m(g,b),f());const x=t((...g)=>(n(...g),f()),s,i);i.getInitialState=()=>x;let p;const h=()=>{var g,b;if(!d)return;const j=++c;l=!1,a.forEach(y=>{var S;return y((S=s())!=null?S:x)});const v=((b=r.onRehydrateStorage)==null?void 0:b.call(r,(g=s())!=null?g:x))||void 0;return Ct(d.getItem.bind(d))(r.name).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==r.version){if(r.migrate){const S=r.migrate(y.state,y.version);return S instanceof Promise?S.then(w=>[!0,w]):[!0,S]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,y.state];return[!1,void 0]}).then(y=>{var S;if(j!==c)return;const[w,N]=y;if(p=r.merge(N,(S=s())!=null?S:x),n(p,!0),w)return f()}).then(()=>{j===c&&(v?.(s(),void 0),p=s(),l=!0,u.forEach(y=>y(p)))}).catch(y=>{j===c&&v?.(void 0,y)})};return i.persist={setOptions:g=>{r={...r,...g},g.storage&&(d=g.storage)},clearStorage:()=>{d?.removeItem(r.name)},getOptions:()=>r,rehydrate:()=>h(),hasHydrated:()=>l,onHydrate:g=>(a.add(g),()=>{a.delete(g)}),onFinishHydration:g=>(u.add(g),()=>{u.delete(g)})},r.skipHydration||h(),p||x},Wn=Eo,{useSyncExternalStoreWithSelector:$o}=ms,Oo=t=>t;function Ro(t,e=Oo,n){const s=$o(t.subscribe,t.getState,t.getInitialState,e,n);return ze.useDebugValue(s),s}const Xt=t=>Symbol.iterator in t,Jt=t=>"entries"in t,Gt=(t,e)=>{const n=t instanceof Map?t:new Map(t.entries()),s=e instanceof Map?e:new Map(e.entries());if(n.size!==s.size)return!1;for(const[i,r]of n)if(!s.has(i)||!Object.is(r,s.get(i)))return!1;return!0},Mo=(t,e)=>{const n=t[Symbol.iterator](),s=e[Symbol.iterator]();let i=n.next(),r=s.next();for(;!i.done&&!r.done;){if(!Object.is(i.value,r.value))return!1;i=n.next(),r=s.next()}return!!i.done&&!!r.done};function Lo(t,e){return Object.is(t,e)?!0:typeof t!="object"||t===null||typeof e!="object"||e===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?!1:Xt(t)&&Xt(e)?Jt(t)&&Jt(e)?Gt(t,e):Mo(t,e):Gt({entries:()=>Object.entries(t)},{entries:()=>Object.entries(e)})}function Dn(t,e="Output"){if(!t)return`interface ${e} {}`;function n(r){if(!r||typeof r!="object")return"unknown";const l=r.type;if(Array.isArray(l))return l.map(c=>s(c)).join(" | ");switch(l){case"string":return r.enum?r.enum.map(c=>`"${c}"`).join(" | "):"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";case"array":{const c=r.items;return c?`${n(c)}[]`:"unknown[]"}case"object":return i(r);default:return r.anyOf?r.anyOf.map(n).join(" | "):r.oneOf?r.oneOf.map(n).join(" | "):r.allOf?r.allOf.map(n).join(" & "):"unknown"}}function s(r){switch(r){case"string":return"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";default:return"unknown"}}function i(r){const l=r.properties;if(!l)return"Record<string, unknown>";const c=new Set(r.required||[]);return`{
|
|
2
2
|
${Object.entries(l).map(([u,d])=>{const f=c.has(u)?"":"?";return`${d.description?` /** ${d.description} */
|
|
3
3
|
`:""} ${u}${f}: ${n(d)};`}).join(`
|
|
4
4
|
`)}
|