decocms 3.84.0 → 3.84.1
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-D7JULgSW.js → AlertCircle-CmMED3h6.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-BoNegK2J.js → ArrowUpRight-DwILncVx.js} +1 -1
- package/dist/client/assets/{CheckCircle-CubOqkhM.js → CheckCircle-DpKZZDmN.js} +1 -1
- package/dist/client/assets/{ChevronDown-bvcGltsD.js → ChevronDown-BjzwFuai.js} +1 -1
- package/dist/client/assets/{ChevronLeft-CwoAKT1V.js → ChevronLeft-uRkOj5F8.js} +1 -1
- package/dist/client/assets/{ChevronRight-JjxX5FP7.js → ChevronRight-BRGGbOax.js} +1 -1
- package/dist/client/assets/{ChevronUp-BHC7PPdP.js → ChevronUp-CzO_7LvF.js} +1 -1
- package/dist/client/assets/{DotsVertical-lhkCwVyZ.js → DotsVertical-DshGnU_X.js} +1 -1
- package/dist/client/assets/{Eye-DDlQv8dT.js → Eye-BBVg-SSa.js} +1 -1
- package/dist/client/assets/{FilterLines-5NaQCp3e.js → FilterLines-CowTK4HW.js} +1 -1
- package/dist/client/assets/{Globe01-DPxNkWN3.js → Globe01-Cm82tRCS.js} +1 -1
- package/dist/client/assets/{Globe04-CfOFRbjm.js → Globe04-DrE78eQQ.js} +1 -1
- package/dist/client/assets/{HardDrive-Cc6TayZG.js → HardDrive-DsahIXX5.js} +1 -1
- package/dist/client/assets/{Key01-BnvBI-54.js → Key01-CwoTMTFC.js} +1 -1
- package/dist/client/assets/{LayoutLeft-BqPxwhfG.js → LayoutLeft-_ZNcVcNz.js} +1 -1
- package/dist/client/assets/{LinkExternal01-Cuz2KimH.js → LinkExternal01-BeE3-oct.js} +1 -1
- package/dist/client/assets/{Monitor01-Bg2cIqWO.js → Monitor01-Aa4wN2Ct.js} +1 -1
- package/dist/client/assets/{Palette-DqDQ3lBi.js → Palette-DT-obB9z.js} +1 -1
- package/dist/client/assets/{Play-DJY7X3Ac.js → Play-D7fUrl6h.js} +1 -1
- package/dist/client/assets/{Plus-BPXRSHah.js → Plus-CK2CAzo5.js} +1 -1
- package/dist/client/assets/{SearchMd-BzO607jf.js → SearchMd-B3Rw93l5.js} +1 -1
- package/dist/client/assets/{Settings02-B7JvRibZ.js → Settings02-B1ZVVT_e.js} +1 -1
- package/dist/client/assets/{Shield01-CpKySeSn.js → Shield01-BR2mZOZb.js} +1 -1
- package/dist/client/assets/{Star01-Ctay-f61.js → Star01-DBcQByZk.js} +1 -1
- package/dist/client/assets/{Stars01-BvSyxIB7.js → Stars01-aJC5veoy.js} +1 -1
- package/dist/client/assets/{Stars02-0cy3Iac4.js → Stars02-BwRZ8reG.js} +1 -1
- package/dist/client/assets/{Sun-VAruoT-r.js → Sun-BMePDS8S.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-B1Fi_gZm.js → SwitchHorizontal01-B_NmbobE.js} +1 -1
- package/dist/client/assets/{Tool01-BMBmO996.js → Tool01-CZPk8Ney.js} +1 -1
- package/dist/client/assets/{Trash01-bpIqJEin.js → Trash01-SWS-_O9Z.js} +1 -1
- package/dist/client/assets/{Upload01-DRwUypcB.js → Upload01-CoqelT_E.js} +1 -1
- package/dist/client/assets/{User01-CNb4uOQF.js → User01-Do5enW22.js} +1 -1
- package/dist/client/assets/{Users01-Dznayvgx.js → Users01-BmWtNHuf.js} +1 -1
- package/dist/client/assets/{Users03-3hrg8IdJ.js → Users03-B_G71vm-.js} +1 -1
- package/dist/client/assets/{X-BmLEy_4s.js → X-CO9z9Xp0.js} +1 -1
- package/dist/client/assets/{XCircle-lg1atJo8.js → XCircle-BFWoSw7W.js} +1 -1
- package/dist/client/assets/{XClose-DgeTXvEe.js → XClose-BO6FjXoT.js} +1 -1
- package/dist/client/assets/{Zap-yzjfF5fD.js → Zap-Bs_ao0zW.js} +1 -1
- package/dist/client/assets/{ZapSquare-CB80bsBy.js → ZapSquare-CmQdJEdR.js} +1 -1
- package/dist/client/assets/{ZoomOut-Da8en56C.js → ZoomOut-BR28jpI9.js} +1 -1
- package/dist/client/assets/{access-gate-BK8VNoXv.js → access-gate-mrUaShW4.js} +1 -1
- package/dist/client/assets/{add-section-modal-CIpKj9LO.js → add-section-modal-BTy1RUe_.js} +1 -1
- package/dist/client/assets/{agent-icon-_F0cs0c2.js → agent-icon-BB0OI_Zf.js} +1 -1
- package/dist/client/assets/{agents-list-DjjL_a90.js → agents-list-DP438aHv.js} +1 -1
- package/dist/client/assets/{ai-providers-CljQzJuo.js → ai-providers-CHjXy2IX.js} +1 -1
- package/dist/client/assets/{alert-Dj9lc9TR.js → alert-FpAPxAaA.js} +1 -1
- package/dist/client/assets/{alert-dialog-DlpOAGY3.js → alert-dialog-CU4F0Cas.js} +1 -1
- package/dist/client/assets/{app-editor-DTsz2SiG.js → app-editor-DbyBYBd1.js} +1 -1
- package/dist/client/assets/{auth-CX0V_g3E.js → auth-DscXYOeb.js} +1 -1
- package/dist/client/assets/{auth-catchall-Czx8XBA8.js → auth-catchall-BtmfoD1y.js} +1 -1
- package/dist/client/assets/{auth-entry-BlZh1m7O.js → auth-entry-CC1ARBuN.js} +1 -1
- package/dist/client/assets/{auth-split-layout-D8DmmoYv.js → auth-split-layout-Cxddqcmf.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-Bb4qQGZD.js → authenticate-and-persist-oauth-KVWekoHI.js} +1 -1
- package/dist/client/assets/{automation-list-row-DikFLwfj.js → automation-list-row-DdnU0_oJ.js} +1 -1
- package/dist/client/assets/{automation-runs-z2Y1nDjt.js → automation-runs-CxkH2J7y.js} +1 -1
- package/dist/client/assets/{automations-h6AjBdGl.js → automations-CHJDB1Wn.js} +1 -1
- package/dist/client/assets/{avatar-DMMu0sLX.js → avatar-B2rvHJ2u.js} +1 -1
- package/dist/client/assets/{badge-BIOaHIWt.js → badge-Bu3HgcYX.js} +1 -1
- package/dist/client/assets/{block-document-xN8KRLYP.js → block-document-DR69_B0F.js} +1 -1
- package/dist/client/assets/{brand-context-B2j85pK0.js → brand-context-BsVjZN3k.js} +1 -1
- package/dist/client/assets/{buckets-OAl0L0y1.js → buckets-BH1wtZ3x.js} +1 -1
- package/dist/client/assets/{capability-load-error-DRTuvJDl.js → capability-load-error-CmAUMxoM.js} +1 -1
- package/dist/client/assets/{card-CwFHuYuT.js → card-kDiEfTw9.js} +1 -1
- package/dist/client/assets/category-editor-CAYNohGr.js +1 -0
- package/dist/client/assets/{chat-context-dU2BBYFR.js → chat-context-D6S41DOV.js} +1 -1
- package/dist/client/assets/{checkbox-Cbr8t7kQ.js → checkbox-CsCGEg8f.js} +1 -1
- package/dist/client/assets/{cli-auth-success-CVzhF-RY.js → cli-auth-success-B79VcMNm.js} +1 -1
- package/dist/client/assets/{collection-detail-B3A3YP9y.js → collection-detail-BV78giTN.js} +1 -1
- package/dist/client/assets/{collection-display-button-CTjP_ikN.js → collection-display-button-BKfSRcS4.js} +1 -1
- package/dist/client/assets/{collection-search-DUL6ybNZ.js → collection-search-Did_rDKr.js} +1 -1
- package/dist/client/assets/{collection-tabs-D6_rF5iF.js → collection-tabs-BWGqEvBL.js} +1 -1
- package/dist/client/assets/{command-BDSPStF6.js → command-HyE3vuW8.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-DtQQW42S.js → commerce-onboarding-CbmMdla_.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-CN-ahIvP.js → connect-desktop-dialog-DzyRhy80.js} +1 -1
- package/dist/client/assets/{connection-card-Cshe8IMI.js → connection-card-D0jDIFWU.js} +1 -1
- package/dist/client/assets/{connection-detail-BxVpiSkZ.js → connection-detail-CTydjWNJ.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-DNsEuVwo.js → connection-form-helpers-DoxJStk3.js} +1 -1
- package/dist/client/assets/{connections-B6wVut4v.js → connections-BZqNukEV.js} +1 -1
- package/dist/client/assets/{context-menu-BgxmhhXb.js → context-menu-CBHA394l.js} +1 -1
- package/dist/client/assets/{decopilot-CM0ZbqCj.js → decopilot-Cs0sTBvJ.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-DStYMiox.js → decopilot-sse-pool-DCimHDb8.js} +1 -1
- package/dist/client/assets/{dialog-YEMhf2fI.js → dialog-D4-cpiIq.js} +1 -1
- package/dist/client/assets/{domain-settings-Dp98eSJW.js → domain-settings-CpdgF4g-.js} +1 -1
- package/dist/client/assets/{drawer-CbS8-Awm.js → drawer-EynyRy5s.js} +1 -1
- package/dist/client/assets/{dropdown-menu-B5yyPfJy.js → dropdown-menu-DgXWnPV7.js} +1 -1
- package/dist/client/assets/{empty-state-BBWaUmc0.js → empty-state-BqLGg5Qt.js} +1 -1
- package/dist/client/assets/{extract-connection-data-DW6_hSwc.js → extract-connection-data-BrfuWfn9.js} +1 -1
- package/dist/client/assets/{file-explorer-B-BDqfr8.js → file-explorer-l8kW6-_R.js} +1 -1
- package/dist/client/assets/{file-type-icon-CRFnZTrI.js → file-type-icon-vWAzpBPp.js} +1 -1
- package/dist/client/assets/{files-BwRx28HU.js → files-CelzOm7s.js} +1 -1
- package/dist/client/assets/{form-uOBsFqj5.js → form-C0rXEiGF.js} +1 -1
- package/dist/client/assets/{general-C-as289_.js → general-Bcxz5b3F.js} +1 -1
- package/dist/client/assets/{github-repo-picker-CQzVJw3M.js → github-repo-picker-BMm6sNS0.js} +1 -1
- package/dist/client/assets/{hooks-Bsl1fBrR.js → hooks-iTnRVGBT.js} +1 -1
- package/dist/client/assets/{import-from-deco-dialog-CMi4FLQI.js → import-from-deco-dialog-CEwUaYj8.js} +1 -1
- package/dist/client/assets/{index-Cczp3zRq.js → index-7--My7Kk.js} +7 -7
- package/dist/client/assets/{index-CysG6elH.js → index-BHPHIMku.js} +1 -1
- package/dist/client/assets/{index-BVGtxGJp.js → index-BafofCVM.js} +1 -1
- package/dist/client/assets/{index-Bnzp0u27.js → index-BeL2IYvj.js} +1 -1
- package/dist/client/assets/{index-DwYMCCVI.js → index-Bt_ZjPsW.js} +1 -1
- package/dist/client/assets/{index-Da7zBgP3.js → index-C1yj8oW9.js} +3 -3
- package/dist/client/assets/{index-CEhY-HWu.js → index-C6QKjDvm.js} +1 -1
- package/dist/client/assets/{index-B5iWctwe.js → index-C9vgWyOp.js} +1 -1
- package/dist/client/assets/{index-CLUU6mBc.js → index-CChD3seh.js} +1 -1
- package/dist/client/assets/{index-Cl2voHhm.js → index-ChS8eVb4.js} +1 -1
- package/dist/client/assets/{index-BbZOuhzX.js → index-D5MvY5fk.js} +1 -1
- package/dist/client/assets/{index-CCgrVLOE.js → index-D6W1a9Ed.js} +1 -1
- package/dist/client/assets/{index-_O-v3DMq.js → index-DU_rFtey.js} +1 -1
- package/dist/client/assets/{index-DQbPuQyy.js → index-nQQO626p.js} +1 -1
- package/dist/client/assets/{index-redirect-D9E-kRrz.js → index-redirect-ZLqUsySW.js} +1 -1
- package/dist/client/assets/{index-iwyGvJw3.js → index-uuDmStBi.js} +1 -1
- package/dist/client/assets/{input-JrKcP8_P.js → input-CjEjpxdM.js} +1 -1
- package/dist/client/assets/{integration-icon-BefRgu4d.js → integration-icon-CSYS5mut.js} +1 -1
- package/dist/client/assets/{label-DamWvDSp.js → label-B1XS6835.js} +1 -1
- package/dist/client/assets/{login-CsrgI9dD.js → login-BwzmQ6Vl.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DggY1DlO.js → mcp-oauth-RIVS58UD.js} +1 -1
- package/dist/client/assets/{members-DkmZZg6p.js → members-Cv5_M0H8.js} +1 -1
- package/dist/client/assets/{monaco-editor-D7lo6yjy.js → monaco-editor-BhcbAKhi.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-B-0pMNdb.js → monitoring-stats-row-D2hdprzy.js} +1 -1
- package/dist/client/assets/{oauth-callback-BdNMG3d8.js → oauth-callback-Ca8aLtLz.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-DRiOpOG0.js → oauth-callback-ai-provider-nS8-aDg-.js} +1 -1
- package/dist/client/assets/{onboarding-DpiL92Sf.js → onboarding-DokdM2si.js} +1 -1
- package/dist/client/assets/{org-install-BmVHa_cl.js → org-install-CFBQ5UN5.js} +1 -1
- package/dist/client/assets/{org-layout-D5M_L5al.js → org-layout-2xw7J9o1.js} +1 -1
- package/dist/client/assets/{organization-choice-CCRYa54g.js → organization-choice-B7gbF-gx.js} +1 -1
- package/dist/client/assets/{page-seo-form-C28dqfPj.js → page-seo-form-B9gdIgu6.js} +1 -1
- package/dist/client/assets/page-seo-sheet-Dim8a_29.js +1 -0
- package/dist/client/assets/{popover-BWJVGvw4.js → popover-C7DR14Uv.js} +1 -1
- package/dist/client/assets/post-editor-Dwsexwwq.js +1 -0
- package/dist/client/assets/{preview-dialog-EpRi5xxw.js → preview-dialog-D0Xo8R0Y.js} +1 -1
- package/dist/client/assets/{primitives-BMQA8oJA.js → primitives-BGDftBXt.js} +1 -1
- package/dist/client/assets/{profile-Dk2P6dGP.js → profile-Tt594UKC.js} +1 -1
- package/dist/client/assets/project-app-view-BWGayozD.js +1 -0
- package/dist/client/assets/record-editor-Cf-PzES3.js +1 -0
- package/dist/client/assets/registry-Bt-hzkrl.js +2 -0
- package/dist/client/assets/{registry-layout-DrMxvc62.js → registry-layout-CepDP4zO.js} +1 -1
- package/dist/client/assets/{require-capability-DQB_sHm-.js → require-capability-CI6JAqgD.js} +1 -1
- package/dist/client/assets/{required-auth-layout-CEA-lcqq.js → required-auth-layout-Be42uHMA.js} +1 -1
- package/dist/client/assets/{reset-password-CAhEe0y_.js → reset-password-vSV6JpaW.js} +1 -1
- package/dist/client/assets/{roles-DSDcdczA.js → roles-DVimCkc2.js} +1 -1
- package/dist/client/assets/{save-status-ByqPY8sQ.js → save-status-B4LrYjc4.js} +1 -1
- package/dist/client/assets/{scroll-area-CDnhflx8.js → scroll-area-Btbw5x0S.js} +1 -1
- package/dist/client/assets/{search-input-E5lbuSaQ.js → search-input-BJySI9eP.js} +1 -1
- package/dist/client/assets/{secrets-HQJKo8ct.js → secrets-CgCqWHuI.js} +1 -1
- package/dist/client/assets/sections-editor-73TndVEn.js +2 -0
- package/dist/client/assets/{select-BRu_aocD.js → select-Bdte2-mH.js} +1 -1
- package/dist/client/assets/{select-model-D6u-jQT1.js → select-model-Da9fCD4_.js} +1 -1
- package/dist/client/assets/{seo-editor-uydyhvcD.js → seo-editor-oYyGw_6F.js} +1 -1
- package/dist/client/assets/{settings-layout-K84_EKqf.js → settings-layout-CnLgsNWc.js} +1 -1
- package/dist/client/assets/{settings-section-CMKiU6m1.js → settings-section-BIuqqQso.js} +1 -1
- package/dist/client/assets/{sheet-B0e56Uwi.js → sheet-CzR0tmZA.js} +1 -1
- package/dist/client/assets/{shell-controls-iDS_YYSh.js → shell-controls-B_8RFrNm.js} +1 -1
- package/dist/client/assets/{shell-layout-DCRByz-Z.js → shell-layout-DPTryinF.js} +1 -1
- package/dist/client/assets/{shell-route-loading-CnU2JL57.js → shell-route-loading-D5ohEyID.js} +1 -1
- package/dist/client/assets/{sidebar-muO-r9NM.js → sidebar-BLFhVRa1.js} +1 -1
- package/dist/client/assets/{skeleton-D_Y0mVys.js → skeleton-BhIDQEW6.js} +1 -1
- package/dist/client/assets/{sortable.esm-DZfVcKsT.js → sortable.esm-BrVUE0Ot.js} +1 -1
- package/dist/client/assets/{sso-GaI62zkx.js → sso-Dz4ih-D0.js} +1 -1
- package/dist/client/assets/{store-ek5K_sQV.js → store-41qcx4ON.js} +1 -1
- package/dist/client/assets/store-registry-Du1ihhH9.js +2 -0
- package/dist/client/assets/{studio-tools-Cxzj-LYh.js → studio-tools-cTyVqaHA.js} +1 -1
- package/dist/client/assets/{switch-DPUXI2pE.js → switch-DoFOdYGu.js} +1 -1
- package/dist/client/assets/{table-D7DRjfAO.js → table-zRS7Teha.js} +1 -1
- package/dist/client/assets/{tabs-CTiHAHkO.js → tabs-CQOpbrKh.js} +1 -1
- package/dist/client/assets/{task-status-CzPGYn0R.js → task-status-DjLIycFQ.js} +1 -1
- package/dist/client/assets/{textarea-rSIhk1As.js → textarea-Cya3KDiz.js} +1 -1
- package/dist/client/assets/{toggle-group-D0HpOa1A.js → toggle-group-DENfWHtP.js} +1 -1
- package/dist/client/assets/{toolbar-CWstIAgU.js → toolbar-CO9czXOO.js} +1 -1
- package/dist/client/assets/{tooltip-B7dbgru1.js → tooltip-Cvbl_0l0.js} +1 -1
- package/dist/client/assets/{types-DiVU1HF6.js → types-DkLih0NK.js} +1 -1
- package/dist/client/assets/{use-ai-providers-UVcAibrU.js → use-ai-providers-BB_netT8.js} +1 -1
- package/dist/client/assets/{use-automations-DyhWqZVe.js → use-automations-C4-BEJDp.js} +1 -1
- package/dist/client/assets/{use-capability-Dkucj2kh.js → use-capability-DtJSLljk.js} +1 -1
- package/dist/client/assets/{use-clock-tick-C8csRlSk.js → use-clock-tick-Bo_9gN4h.js} +1 -1
- package/dist/client/assets/{use-collections-Ce8iOx08.js → use-collections-C5z5SeL0.js} +1 -1
- package/dist/client/assets/{use-connection-MqRKkZiS.js → use-connection-DYuQNBQ8.js} +1 -1
- package/dist/client/assets/{use-copy-BXiwiMZD.js → use-copy-V2SquoUh.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-EFJS-btq.js → use-create-virtual-mcp-DqGii1ks.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-UYvEWk6q.js → use-debounced-autosave-B5XSTYsz.js} +1 -1
- package/dist/client/assets/{use-delete-connection-tf7cUWDI.js → use-delete-connection-D_b2gPBM.js} +1 -1
- package/dist/client/assets/{use-file-configs-Caz1V2y2.js → use-file-configs-CSX8A1vE.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-D-1sc3vv.js → use-infinite-scroll-BaJGyvxX.js} +1 -1
- package/dist/client/assets/{use-join-requests-jqRgPged.js → use-join-requests-dGis0QYB.js} +1 -1
- package/dist/client/assets/{use-mcp-client-QbDw5Kxr.js → use-mcp-client-90IJIS7G.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-CJoxcvaa.js → use-mcp-prompts-D2ucpusX.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-CwE0F1Fa.js → use-mcp-tools-IJf4yY8f.js} +1 -1
- package/dist/client/assets/{use-members-DqOAFyvD.js → use-members-DSWXPVdi.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-CHwphTrt.js → use-navigate-to-agent-D_hba2ju.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-Cw-eW4eJ.js → use-org-auth-client-Bmz_glRx.js} +1 -1
- package/dist/client/assets/{use-org-sso-DYW-70GB.js → use-org-sso-d8VUjdDF.js} +1 -1
- package/dist/client/assets/{use-organization-roles-C929xbIg.js → use-organization-roles-AnHrNvDP.js} +1 -1
- package/dist/client/assets/{use-organization-settings-B7zELDxl.js → use-organization-settings-B-FYwlct.js} +1 -1
- package/dist/client/assets/{use-registry-connections-DSvlh2CW.js → use-registry-connections-COP2SiNd.js} +1 -1
- package/dist/client/assets/{use-secrets-BGVjiXmA.js → use-secrets-CgpawoY3.js} +1 -1
- package/dist/client/assets/{use-status-sounds-Bwl21Nte.js → use-status-sounds-CO3Rxsnj.js} +1 -1
- package/dist/client/assets/{use-view-mode-DeBJ3OlV.js → use-view-mode-CbF51x_n.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-D3YjjDr2.js → use-virtual-mcp-yUKVcLc_.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-BxIrRxsB.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-DENvoLd9.js +1 -0
- package/dist/client/assets/{variant-calendar-C5R5bfKc.js → variant-calendar-Cjzj9fQr.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-BMm_SU4X.js → view-mode-toggle-D1TNBVMm.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +380 -380
- package/dist/server/server.js +246 -246
- package/package.json +1 -1
- package/dist/client/assets/category-editor-DrrOt_5R.js +0 -1
- package/dist/client/assets/page-seo-sheet-C6YR_NxM.js +0 -1
- package/dist/client/assets/post-editor-BRqcUmQd.js +0 -1
- package/dist/client/assets/project-app-view-TZf9g1ss.js +0 -1
- package/dist/client/assets/record-editor-ChJ6RVXx.js +0 -1
- package/dist/client/assets/registry-HmZZwFRK.js +0 -2
- package/dist/client/assets/sections-editor-LwvHy6hA.js +0 -2
- package/dist/client/assets/store-registry-2fFie2P8.js +0 -2
- package/dist/client/assets/useInfiniteQuery-W7QqfcbQ.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-f7kozjC6.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as y,j as t,B as F,i as X,z as Ge,C as se,E as Pe,r as T,w as ie,G as Qe,l as V,bf as Ye,u as Xe,y as G,t as Ze,e as ae,b1 as ke}from"./index-Da7zBgP3.js";import{E as Ee}from"./empty-state-BBWaUmc0.js";import{u as et,a as Ae}from"./use-collections-Ce8iOx08.js";import{u as ce}from"./use-mcp-client-QbDw5Kxr.js";import{F as ne,a as tt,b as de,d as me}from"./form-uOBsFqj5.js";import{I as ue}from"./input-JrKcP8_P.js";import{T as re}from"./textarea-rSIhk1As.js";import{a as st,b as nt,V as xe,O as ot,M as lt}from"./index-DQbPuQyy.js";import{ag as rt,x as it,a5 as at,ah as ct,a1 as dt,ai as mt,M as be}from"./agent-icon-_F0cs0c2.js";import{g as ut,M as xt,a as Ne}from"./types-DiVU1HF6.js";import{A as pt,a as ft,b as ht}from"./alert-Dj9lc9TR.js";import{f as ve,c as Se,d as ye,e as we,b as oe}from"./select-BRu_aocD.js";import{c as gt,b as Ce,T as Ie,a as $e}from"./tooltip-B7dbgru1.js";import{i as jt}from"./AlertCircle-D7JULgSW.js";import{s as bt}from"./Stars02-0cy3Iac4.js";import{a as Nt}from"./Eye-DDlQv8dT.js";import{i as vt}from"./Play-DJY7X3Ac.js";import{i as St}from"./ChevronRight-JjxX5FP7.js";import{g as yt}from"./connection-slug-eyAPH6o3.js";import{u as wt,T as Ct}from"./index-BVGtxGJp.js";import{a as Oe,u as Re}from"./use-connection-MqRKkZiS.js";import{a as It}from"./use-mcp-tools-CwE0F1Fa.js";import{c as $t}from"./content-blocks-o63cs2vh.js";import{I as Te}from"./integration-icon-BefRgu4d.js";import{f as Tt,h as Pt}from"./chat-context-dU2BBYFR.js";import{b as kt}from"./shell-layout-DCRByz-Z.js";import{M as Et}from"./monaco-editor-D7lo6yjy.js";import{n as At}from"./XCircle-lg1atJo8.js";import"./auth-CX0V_g3E.js";import"./label-DamWvDSp.js";import"./index-DwYMCCVI.js";import"./sidebar-muO-r9NM.js";import"./LayoutLeft-BqPxwhfG.js";import"./sheet-B0e56Uwi.js";import"./X-BmLEy_4s.js";import"./ZoomOut-Da8en56C.js";import"./Key01-BnvBI-54.js";import"./extract-connection-data-DW6_hSwc.js";import"./use-registry-connections-DSvlh2CW.js";import"./use-organization-settings-B7zELDxl.js";import"./studio-tools-Cxzj-LYh.js";import"./Plus-BPXRSHah.js";import"./index-Bnzp0u27.js";import"./index-CEhY-HWu.js";import"./popover-BWJVGvw4.js";import"./use-virtual-mcp-D3YjjDr2.js";import"./ChevronUp-BHC7PPdP.js";import"./SearchMd-BzO607jf.js";import"./Users03-3hrg8IdJ.js";import"./use-create-virtual-mcp-EFJS-btq.js";import"./use-navigate-to-agent-CHwphTrt.js";import"./Tool01-BMBmO996.js";import"./SwitchHorizontal01-B1Fi_gZm.js";import"./Settings02-B7JvRibZ.js";import"./ArrowUpRight-BoNegK2J.js";import"./ZapSquare-CB80bsBy.js";import"./CheckCircle-CubOqkhM.js";import"./ChevronDown-bvcGltsD.js";import"./ChevronLeft-CwoAKT1V.js";import"./DotsVertical-lhkCwVyZ.js";import"./Globe01-DPxNkWN3.js";import"./FilterLines-5NaQCp3e.js";import"./Star01-Ctay-f61.js";import"./Globe04-CfOFRbjm.js";import"./HardDrive-Cc6TayZG.js";import"./LinkExternal01-Cuz2KimH.js";import"./Monitor01-Bg2cIqWO.js";import"./Sun-VAruoT-r.js";import"./Palette-DqDQ3lBi.js";import"./Shield01-CpKySeSn.js";import"./Stars01-BvSyxIB7.js";import"./Trash01-bpIqJEin.js";import"./Upload01-DRwUypcB.js";import"./User01-CNb4uOQF.js";import"./Users01-Dznayvgx.js";import"./XClose-DgeTXvEe.js";import"./Zap-yzjfF5fD.js";import"./index-iwyGvJw3.js";import"./mcp-oauth-DggY1DlO.js";import"./badge-BIOaHIWt.js";import"./hooks-Bsl1fBrR.js";import"./decopilot-sse-pool-DStYMiox.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-UVcAibrU.js";import"./tab-id-BptcWVWa.js";import"./avatar-DMMu0sLX.js";import"./dialog-YEMhf2fI.js";import"./required-auth-layout-CEA-lcqq.js";import"./use-org-sso-DYW-70GB.js";import"./index-BbZOuhzX.js";function Ot(s){const e=y.c(15),{onSave:o,onUndo:n,isDirty:l,isSaving:r,saveLabel:a,undoLabel:c}=s,i=a===void 0?"Save":a,u=c===void 0?"Undo":c;if(!l)return null;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(rt,{size:14}),e[0]=x):x=e[0];let m;e[1]!==r||e[2]!==n||e[3]!==u?(m=t.jsxs(F,{variant:"outline",size:"sm",onClick:n,disabled:r,"aria-label":u,children:[x,u]}),e[1]=r,e[2]=n,e[3]=u,e[4]=m):m=e[4];let p;e[5]!==r?(p=r?t.jsx(X,{size:14,className:"animate-spin"}):t.jsx(it,{size:14}),e[5]=r,e[6]=p):p=e[6];let f;e[7]!==r||e[8]!==o||e[9]!==i||e[10]!==p?(f=t.jsxs(F,{variant:"default",size:"sm",onClick:o,disabled:r,"aria-label":i,children:[p,i]}),e[7]=r,e[8]=o,e[9]=i,e[10]=p,e[11]=f):f=e[11];let g;return e[12]!==m||e[13]!==f?(g=t.jsxs(t.Fragment,{children:[m,f]}),e[12]=m,e[13]=f,e[14]=g):g=e[14],g}Ge({title:se().min(1),description:se().nullable(),body:se()});function le(s){for(const e of s.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function Rt(){const s=window.location.pathname.split("/").filter(Boolean),e=s.findIndex(n=>n==="mcps"),o=e>=0?s[e+1]:void 0;return o?decodeURIComponent(o):void 0}function _t(s){const e=y.c(13),{form:o}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=n):n=e[0];let l;e[1]!==o.control?(l=t.jsxs("div",{className:"flex flex-col gap-4",children:[n,t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsx(ne,{control:o.control,name:"title",render:Dt}),t.jsx(ne,{control:o.control,name:"description",render:zt})]})]}),e[1]=o.control,e[2]=l):l=e[2];let r,a;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),a=t.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=r,e[4]=a):(r=e[3],a=e[4]);let c;e[5]!==o.control?(c=t.jsxs("div",{className:"flex flex-col gap-2",children:[r,a,t.jsx(ne,{control:o.control,name:"body",render:Mt})]}),e[5]=o.control,e[6]=c):c=e[6];let i;e[7]!==l||e[8]!==c?(i=t.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[l,c]}),e[7]=l,e[8]=c,e[9]=i):i=e[9];let u;return e[10]!==o||e[11]!==i?(u=t.jsx(tt,{...o,children:i}),e[10]=o,e[11]=i,e[12]=u):u=e[12],u}function Mt(s){const{field:e}=s;return t.jsx(de,{children:t.jsx(me,{children:t.jsx(re,{...e,value:e.value??"",placeholder:"Write the prompt message…",className:"min-h-[240px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})})}function zt(s){const{field:e}=s;return t.jsxs(de,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),t.jsx(me,{children:t.jsx(ue,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Dt(s){const{field:e}=s;return t.jsxs(de,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),t.jsx(me,{children:t.jsx(ue,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Lt(s){const e=y.c(36),{providerId:o,promptId:n}=s,{org:l}=ie(),r=o||null;let a;e[0]!==l.id||e[1]!==l.slug||e[2]!==r?(a={connectionId:r,orgId:l.id,orgSlug:l.slug},e[0]=l.id,e[1]=l.slug,e[2]=r,e[3]=a):a=e[3];const c=ce(a),i=et(o,"PROMPT",n,c),u=Ae(o,"PROMPT",c),x=u.update.isPending;let m;e[4]!==i?(m=i?{title:i.title,description:i.description??null,body:le(i)}:void 0,e[4]=i,e[5]=m):m=e[5];let p;e[6]!==m?(p={values:m},e[6]=m,e[7]=p):p=e[7];const f=Qe(p);let g;e[8]!==f||e[9]!==i?(g=()=>{i&&f.reset({title:i.title,description:i.description??null,body:le(i)})},e[8]=f,e[9]=i,e[10]=g):g=e[10];const S=g;let I;e[11]!==u.update||e[12]!==f||e[13]!==n?(I=f.handleSubmit(async N=>{const A=await u.update.mutateAsync({id:n,data:{title:N.title,description:N.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:N.body}}]}});f.reset({title:A.title,description:A.description??null,body:le(A)})}),e[11]=u.update,e[12]=f,e[13]=n,e[14]=I):I=e[14];const R=I;if(!i){let N;return e[15]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ee,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[15]=N):N=e[15],N}let $;e[16]!==i.title?($=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:i.title}),e[16]=i.title,e[17]=$):$=e[17];let E;e[18]!==i.description?(E=i.description?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),t.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:i.description})]}):null,e[18]=i.description,e[19]=E):E=e[19];let P;e[20]!==$||e[21]!==E?(P=t.jsx(nt,{children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[$,E]})}),e[20]=$,e[21]=E,e[22]=P):P=e[22];let b;e[23]!==R?(b=()=>{R()},e[23]=R,e[24]=b):b=e[24];let w;e[25]!==f.formState.isDirty||e[26]!==x||e[27]!==S||e[28]!==b?(w=t.jsx(st,{children:t.jsx(Ot,{onSave:b,onUndo:S,isDirty:f.formState.isDirty,isSaving:x})}),e[25]=f.formState.isDirty,e[26]=x,e[27]=S,e[28]=b,e[29]=w):w=e[29];let C;e[30]!==f?(C=t.jsx("div",{className:"h-full",children:t.jsx(_t,{form:f})}),e[30]=f,e[31]=C):C=e[31];let k;return e[32]!==w||e[33]!==C||e[34]!==P?(k=t.jsxs(xe,{children:[P,w,C]}),e[32]=w,e[33]=C,e[34]=P,e[35]=k):k=e[35],k}function Ut(s){const e=y.c(4),{itemId:o}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=Rt(),e[0]=n):n=e[0];const l=n;if(!l){let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ee,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=a):a=e[1],a}let r;return e[2]!==o?(r=t.jsx(Pe,{children:t.jsx(T.Suspense,{fallback:null,children:t.jsx(Lt,{providerId:l,promptId:o})})}),e[2]=o,e[3]=r):r=e[3],r}function _e(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("min-w-0 overflow-hidden",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function Me(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("flex items-center gap-1.5 text-sm sm:gap-2 overflow-hidden",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("ol",{"data-slot":"breadcrumb-list",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function q(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("inline-flex items-center gap-1.5 min-w-0",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("li",{"data-slot":"breadcrumb-item",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function Q(s){const e=y.c(10);let o,n,l;e[0]!==s?({asChild:o,className:n,...l}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=l):(o=e[1],n=e[2],l=e[3]);const r=o?Ye:"a";let a;e[4]!==n?(a=V("hover:text-foreground transition-colors truncate",n),e[4]=n,e[5]=a):a=e[5];let c;return e[6]!==r||e[7]!==l||e[8]!==a?(c=t.jsx(r,{"data-slot":"breadcrumb-link",className:a,...l}),e[6]=r,e[7]=l,e[8]=a,e[9]=c):c=e[9],c}function ze(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("text-foreground font-medium truncate",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function Y(s){const e=y.c(12);let o,n,l;e[0]!==s?({children:o,className:n,...l}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=l):(o=e[1],n=e[2],l=e[3]);let r;e[4]!==n?(r=V("[&>svg]:size-3.5 text-muted-foreground opacity-50 list-none shrink-0",n),e[4]=n,e[5]=r):r=e[5];let a;e[6]!==o?(a=o??t.jsx(St,{}),e[6]=o,e[7]=a):a=e[7];let c;return e[8]!==l||e[9]!==r||e[10]!==a?(c=t.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:r,...l,children:a}),e[8]=l,e[9]=r,e[10]=a,e[11]=c):c=e[11],c}const Bt=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Ft(s){const e=y.c(11),{toolName:o,connectionId:n,siblings:l,onSelectInstance:r,onBack:a}=s;let c;e[0]!==n?(c={connectionId:n},e[0]=n,e[1]=c):c=e[1];const i=wt(c);if(!i.isAuthenticated){let m;return e[2]!==i.supportsOAuth||e[3]!==a?(m=t.jsx("div",{className:"flex h-full items-center justify-center",children:i.supportsOAuth?t.jsx(ot,{onAuthenticate:()=>a(),buttonText:"Go back to authenticate"}):t.jsx(lt,{hasReadme:!1})}),e[2]=i.supportsOAuth,e[3]=a,e[4]=m):m=e[4],m}const u=`${n}:${o}`;let x;return e[5]!==n||e[6]!==r||e[7]!==l||e[8]!==u||e[9]!==o?(x=t.jsx(Vt,{toolName:o,connectionId:n,siblings:l,onSelectInstance:r},u),e[5]=n,e[6]=r,e[7]=l,e[8]=u,e[9]=o,e[10]=x):x=e[10],x}function Vt({toolName:s,connectionId:e,siblings:o,onSelectInstance:n}){const{replayId:l}=Xe({strict:!1}),r=(()=>{if(!l)return null;const d=`replay-${l}`,h=sessionStorage.getItem(d);if(!h)return null;sessionStorage.removeItem(d);try{return JSON.parse(h)}catch{return null}})(),a=(()=>{if(!r)return null;const d={};for(const[h,v]of Object.entries(r))v!==null&&typeof v=="object"?d[h]=JSON.stringify(v,null,2):d[h]=v;return d})(),[c,i]=T.useState(a??{}),[u,x]=T.useState(r?JSON.stringify(r,null,2):"{}"),[m,p]=T.useState(null),[f,g]=T.useState(null),[S,I]=T.useState(null),[R,$]=T.useState(null),[E,P]=T.useState(!1),[b,w]=T.useState(null),{org:C}=ie(),k=Oe(e),N=Tt(),A=Pt(),{setChatOpen:U}=kt(),D=`${e}:${s}`,_=ce({connectionId:e,orgId:C.id,orgSlug:C.slug}),L=It({client:_}),j=L.data?.tools?.find(d=>d.name===s),O=ut(j?._meta),J=d=>{if(!N)return;const h=$t(d.content);h.content.length>0&&(U(!0),N.sendMessage({tiptapDoc:h}))},[M,Z]=T.useState("json"),[De,Le]=T.useState(!1);O&&!De&&(Z("ui"),Le(!0));const pe=j?.inputSchema?.properties,fe=pe?Object.keys(pe):[],H=fe.length>0,K={};if(H&&j?.inputSchema?.properties)for(const d of fe)K[d]=j.inputSchema.required?.includes(d)?"":void 0;const ee=d=>Object.prototype.hasOwnProperty.call(c,d),Ue=async()=>{P(!0),$(null),p(null),g(null),I(null),w(null);const d=performance.now();try{if(!_)throw new Error("MCP client is not available");const h=H?{...K,...c}:(()=>{const z=u.trim();if(!z)return{};const B=JSON.parse(z);if(B&&typeof B=="object")return B;throw new Error("Raw JSON input must be an object.")})();H&&j?.inputSchema?.properties&&Object.entries(j.inputSchema.properties).forEach(([z,B])=>{if((B.type==="object"||B.type==="array")&&typeof h[z]=="string")try{h[z]=JSON.parse(h[z])}catch{}else if((B.type==="number"||B.type==="integer")&&typeof h[z]=="string"&&h[z]!==""){const je=Number(h[z]);Number.isNaN(je)||(h[z]=je)}});const v=await _.callTool({name:s,arguments:h}),W=v.structuredContent??v,He=performance.now(),Ke=Math.round(He-d);p(W),g(v),I(h);const We=JSON.stringify(W),ge=new TextEncoder().encode(We).length;w({duration:`${Ke}ms`,bytes:`${ge} bytes`,tokens:`~${Math.ceil(ge/4)} tokens`,cost:"$0.0000"})}catch(h){const v=h instanceof Error?h.message:String(h);$(v||"Unknown error occurred");const W=performance.now();w({duration:`${Math.round(W-d)}ms`})}finally{P(!1)}},te=(d,h)=>{i(v=>({...v,[d]:h}))},Be=()=>{p(null),g(null),I(null),$(null),w(null)},Fe=j?.name??Bt(s),Ve=t.jsx(_e,{children:t.jsxs(Me,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections",params:{org:C.slug},children:"Connections"})})}),t.jsx(Y,{}),k&&t.jsxs(t.Fragment,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections/$appSlug",params:{org:C.slug,appSlug:yt(k)},search:{tab:"tools"},children:k.title})})}),t.jsx(Y,{})]}),t.jsx(q,{children:t.jsx(ze,{children:Fe})})]})}),he=o.length>1&&t.jsxs(ve,{value:e,onValueChange:n,children:[t.jsx(Se,{className:"h-8 w-auto min-w-[200px]",children:t.jsx(ye,{})}),t.jsx(we,{children:o.map(d=>t.jsx(oe,{value:d.id,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Te,{icon:d.icon,name:d.title,size:"xs",className:"shrink-0"}),d.title]})},d.id))})]}),Je=t.jsxs("div",{className:"flex flex-col p-6 gap-4 overflow-auto",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),j?.inputSchema?.required&&j.inputSchema.required.length>0&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),t.jsx("div",{className:"space-y-4",children:H&&j?.inputSchema?.properties?Object.entries(j.inputSchema.properties).map(([d,h])=>t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[d,j.inputSchema?.required?.includes(d)&&t.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),t.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:h.type})]}),h.description&&t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:h.description}),h.type==="object"||h.type==="array"?t.jsx(re,{className:"font-mono text-xs",value:ee(d)?c[d]??"":K[d]??"",onChange:v=>te(d,v.target.value),placeholder:`Enter ${d} as JSON...`,rows:3}):h.type==="boolean"?t.jsxs(ve,{value:ee(d)?String(c[d]??""):"",onValueChange:v=>te(d,v==="true"),children:[t.jsx(Se,{children:t.jsx(ye,{placeholder:"Select true or false..."})}),t.jsxs(we,{children:[t.jsx(oe,{value:"true",children:"true"}),t.jsx(oe,{value:"false",children:"false"})]})]}):t.jsx(ue,{value:ee(d)?c[d]??"":K[d]??"",onChange:v=>te(d,v.target.value),placeholder:`Enter ${d}...`})]},d)):j?.inputSchema&&!H?t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),t.jsx(re,{className:"font-mono text-xs min-h-[120px]",value:u,onChange:d=>x(d.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):t.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})}),t.jsx("div",{className:"flex items-center gap-2 pt-2",children:E?t.jsxs(F,{size:"sm",variant:"destructive",className:"h-8 gap-2",onClick:Be,children:[t.jsx(at,{className:"h-3.5 w-3.5"}),"Cancel"]}):t.jsxs(F,{size:"sm",variant:"default",className:"h-8 gap-2",onClick:Ue,children:[t.jsx(vt,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})})]}),qe=t.jsxs("div",{className:"flex flex-col @3xl:h-full @3xl:overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-b border-border bg-background",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),t.jsxs("div",{className:"flex items-center gap-3",children:[b&&t.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(bt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.duration})]}),b.tokens&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ct,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.tokens})]}),b.bytes&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(dt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.bytes})]}),b.cost&&t.jsx("div",{className:"flex items-center gap-1.5",children:t.jsx("span",{className:"font-mono text-foreground",children:b.cost})})]}),O&&t.jsx(gt,{children:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(F,{size:"icon",variant:M==="ui"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Z("ui"),children:t.jsx(mt,{size:14})})}),t.jsx($e,{children:"Interactive view"})]}),t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(F,{size:"icon",variant:M==="json"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Z("json"),children:t.jsx(be,{size:14})})}),t.jsx($e,{children:"JSON view"})]})]})})]})]}),R&&t.jsx("div",{className:"px-6 py-4 bg-background",children:t.jsx(pt,{variant:"destructive",children:t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(jt,{className:"h-4 w-4"}),t.jsx(ft,{className:"mb-0",children:"Execution Failed"})]}),t.jsx(ht,{className:"text-xs text-destructive",children:R})]})})}),t.jsx("div",{className:"relative flex-1 min-h-[400px] @3xl:min-h-0 @3xl:overflow-auto bg-muted/50",children:O&&M==="ui"&&_?t.jsx(T.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center h-48",children:t.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[t.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),t.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),children:t.jsx(xt,{resourceURI:O,toolInfo:j?{tool:j}:void 0,toolInput:S??void 0,toolResult:f??void 0,displayMode:"fullscreen",minHeight:Ne.view.minHeight,maxHeight:Ne.view.maxHeight,client:_,onMessage:J,onUpdateModelContext:d=>A?.setAppContext(D,d),onTeardown:()=>A?.clearAppContext(D),className:"h-full"})}):m?t.jsxs(t.Fragment,{children:[t.jsx(Et,{code:JSON.stringify(m,null,2),language:"json",height:"100%",readOnly:!0}),t.jsx(F,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(m,null,2)),Ze.success("Copied to clipboard")},children:t.jsx(Nt,{className:"h-3.5 w-3.5"})})]}):t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[t.jsx(be,{className:"h-12 w-12 mb-3 opacity-40"}),t.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]});return t.jsx(xe,{breadcrumb:Ve,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden @container",children:[t.jsxs("div",{className:"flex flex-col gap-3 py-7 px-8 bg-background border-b border-border shrink-0",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx(Te,{icon:k?.icon||null,name:k?.title||s,size:"xl",className:"shrink-0"}),t.jsx("h1",{className:"text-xl font-semibold tracking-tight text-foreground leading-none truncate",children:s}),t.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit shrink-0",children:[L.isSuccess?t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):L.isLoading?t.jsx(X,{size:10,className:"animate-spin text-yellow-500 shrink-0"}):t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-red-500 shrink-0"}),t.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:L.isSuccess?"ready":L.isLoading?"connecting":"error"})]}),t.jsx(Ct,{annotations:j?.annotations,_meta:j?._meta}),t.jsx("div",{className:"hidden @3xl:flex items-center ml-auto shrink-0",children:he})]}),t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:j?.description||"No description available"})]}),o.length>1&&t.jsxs("div",{className:"flex @3xl:hidden items-center gap-3 px-8 py-3 border-b border-border",children:[t.jsx("span",{className:"text-xs font-medium text-muted-foreground shrink-0",children:"Instance"}),he]}),t.jsx("div",{className:"flex-1 overflow-auto @3xl:overflow-hidden",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-[minmax(0,2fr)_minmax(0,5fr)] @3xl:h-full @3xl:grid-rows-1",children:[t.jsx("div",{className:"@3xl:border-r border-border @3xl:overflow-auto",children:Je}),qe]})})]})})}function Jt(s){const e=y.c(10),{itemId:o,siblings:n,onBack:l}=s,[r,a]=T.useState(n[0]?.id??"");let c;e[0]!==r||e[1]!==n?(c=n.find(p=>p.id===r)?.id??n[0]?.id??"",e[0]=r,e[1]=n,e[2]=c):c=e[2];const i=c;if(!Oe(i||void 0)||!i){let p;return e[3]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[t.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[3]=p):p=e[3],p}let x;e[4]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(X,{size:32,className:"animate-spin text-muted-foreground"})}),e[4]=x):x=e[4];let m;return e[5]!==i||e[6]!==l||e[7]!==n||e[8]!==o?(m=t.jsx(T.Suspense,{fallback:x,children:t.jsx(Ft,{toolName:o,connectionId:i,siblings:n,onSelectInstance:a,onBack:l})}),e[5]=i,e[6]=l,e[7]=n,e[8]=o,e[9]=m):m=e[9],m}function qt(s){const e=y.c(21),{icon:o,illustration:n,title:l,description:r,buttonProps:a,buttonComponent:c,className:i,children:u}=s;let x;e[0]!==i?(x=V("flex flex-col items-center justify-center py-16 text-center",i),e[0]=i,e[1]=x):x=e[1];let m;e[2]!==o||e[3]!==n?(m=n?t.jsx("div",{className:"mb-4 text-muted-foreground/50",children:n}):o?t.jsx("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-muted/50 text-muted-foreground",children:o}):null,e[2]=o,e[3]=n,e[4]=m):m=e[4];let p;e[5]!==l?(p=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:l}),e[5]=l,e[6]=p):p=e[6];let f;e[7]!==r?(f=r&&t.jsx("div",{className:"text-sm text-muted-foreground",children:r}),e[7]=r,e[8]=f):f=e[8];let g;e[9]!==p||e[10]!==f?(g=t.jsxs("div",{className:"flex flex-col items-center gap-1 max-w-sm",children:[p,f]}),e[9]=p,e[10]=f,e[11]=g):g=e[11];let S;e[12]!==c||e[13]!==a?(S=(c??a)&&t.jsx("div",{className:"mt-4",children:c??(a&&t.jsx(F,{size:"sm",className:V(a?.className),...a}))}),e[12]=c,e[13]=a,e[14]=S):S=e[14];let I;return e[15]!==u||e[16]!==x||e[17]!==m||e[18]!==g||e[19]!==S?(I=t.jsxs("div",{className:x,children:[m,g,S,u]}),e[15]=u,e[16]=x,e[17]=m,e[18]=g,e[19]=S,e[20]=I):I=e[20],I}const Ht={prompt:Ut};function Kt(){const s=y.c(9),e=ke();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=o):o=s[0];const n=ae(o),l=decodeURIComponent(n.itemId);let r;s[1]!==n.appSlug?(r={slug:n.appSlug},s[1]=n.appSlug,s[2]=r):r=s[2];const a=Re(r);let c;s[3]!==e.history?(c=()=>{e.history.back()},s[3]=e.history,s[4]=c):c=s[4];const i=c,u=Wt;let x;return s[5]!==i||s[6]!==l||s[7]!==a?(x=t.jsx(Jt,{itemId:l,siblings:a,onBack:i,onUpdate:u}),s[5]=i,s[6]=l,s[7]=a,s[8]=x):x=s[8],x}async function Wt(s){return Promise.resolve()}function Gt(s){return s.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Qt(){const s=y.c(41),e=ke();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=o):o=s[0];const n=ae(o),l=decodeURIComponent(n.collectionName),r=decodeURIComponent(n.itemId);let a;s[1]!==e.history?(a=()=>{e.history.back()},s[1]=e.history,s[2]=a):a=s[2];const c=a,{org:i}=ie();let u;s[3]!==n.appSlug?(u={slug:n.appSlug},s[3]=n.appSlug,s[4]=u):u=s[4];const m=Re(u)[0]??null,p=m?.id??"",f=p||"no-connection",g=p??null;let S;s[5]!==i.id||s[6]!==i.slug||s[7]!==g?(S={connectionId:g,orgId:i.id,orgSlug:i.slug},s[5]=i.id,s[6]=i.slug,s[7]=g,s[8]=S):S=s[8];const I=ce(S),R=Ae(f,l,I);let $;s[9]!==R||s[10]!==r?($=async M=>{r&&await R.update.mutateAsync({id:r,data:M})},s[9]=R,s[10]=r,s[11]=$):$=s[11];const E=$;let P;s[12]!==l?(P=l?.toLowerCase(),s[12]=l,s[13]=P):P=s[13];const b=P,w=b&&Ht[b];let C;s[14]!==l?(C=Gt(l),s[14]=l,s[15]=C):C=s[15];const k=C;let N;s[16]!==i.slug?(N=t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections",params:{org:i.slug},children:"Connections"})})}),s[16]=i.slug,s[17]=N):N=s[17];let A;s[18]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(Y,{}),s[18]=A):A=s[18];let U;s[19]!==l||s[20]!==m||s[21]!==i.slug||s[22]!==n.appSlug?(U=m&&t.jsxs(t.Fragment,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:n.appSlug},search:{tab:l},children:m.title})})}),t.jsx(Y,{})]}),s[19]=l,s[20]=m,s[21]=i.slug,s[22]=n.appSlug,s[23]=U):U=s[23];let D;s[24]!==k?(D=t.jsx(q,{children:t.jsx(ze,{children:k})}),s[24]=k,s[25]=D):D=s[25];let _;s[26]!==U||s[27]!==D||s[28]!==N?(_=t.jsx(_e,{children:t.jsxs(Me,{children:[N,A,U,D]})}),s[26]=U,s[27]=D,s[28]=N,s[29]=_):_=s[29];const L=_;if(w){let M;return s[30]!==w||s[31]!==c||s[32]!==E||s[33]!==r?(M=t.jsx(w,{itemId:r,onBack:c,onUpdate:E}),s[30]=w,s[31]=c,s[32]=E,s[33]=r,s[34]=M):M=s[34],M}let j;s[35]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(At,{size:36,className:"text-muted-foreground"}),s[35]=j):j=s[35];let O;s[36]!==c?(O=t.jsx(qt,{icon:j,title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:c,children:"Go back"}}),s[36]=c,s[37]=O):O=s[37];let J;return s[38]!==L||s[39]!==O?(J=t.jsx(xe,{breadcrumb:L,children:O}),s[38]=L,s[39]=O,s[40]=J):J=s[40],J}function Yt(){const s=y.c(3);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=e):e=s[0];const o=ae(e);if(decodeURIComponent(o.collectionName)==="tools"){let a;return s[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(Kt,{}),s[1]=a):a=s[1],a}let r;return s[2]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Qt,{}),s[2]=r):r=s[2],r}function Mn(){const s=y.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Pe,{children:t.jsx(T.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(X,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Yt,{})})}),s[0]=e):e=s[0],e}export{Mn as default};
|
|
1
|
+
import{c as y,j as t,B as F,i as X,z as Ge,C as se,E as Pe,r as T,w as ie,G as Qe,l as V,bf as Ye,u as Xe,y as G,t as Ze,e as ae,b1 as ke}from"./index-C1yj8oW9.js";import{E as Ee}from"./empty-state-BqLGg5Qt.js";import{u as et,a as Ae}from"./use-collections-C5z5SeL0.js";import{u as ce}from"./use-mcp-client-90IJIS7G.js";import{F as ne,a as tt,b as de,d as me}from"./form-C0rXEiGF.js";import{I as ue}from"./input-CjEjpxdM.js";import{T as re}from"./textarea-Cya3KDiz.js";import{a as st,b as nt,V as xe,O as ot,M as lt}from"./index-nQQO626p.js";import{ag as rt,x as it,a5 as at,ah as ct,a1 as dt,ai as mt,M as be}from"./agent-icon-BB0OI_Zf.js";import{g as ut,M as xt,a as Ne}from"./types-DkLih0NK.js";import{A as pt,a as ft,b as ht}from"./alert-FpAPxAaA.js";import{f as ve,c as Se,d as ye,e as we,b as oe}from"./select-Bdte2-mH.js";import{c as gt,b as Ce,T as Ie,a as $e}from"./tooltip-Cvbl_0l0.js";import{i as jt}from"./AlertCircle-CmMED3h6.js";import{s as bt}from"./Stars02-BwRZ8reG.js";import{a as Nt}from"./Eye-BBVg-SSa.js";import{i as vt}from"./Play-D7fUrl6h.js";import{i as St}from"./ChevronRight-BRGGbOax.js";import{g as yt}from"./connection-slug-eyAPH6o3.js";import{u as wt,T as Ct}from"./index-BafofCVM.js";import{a as Oe,u as Re}from"./use-connection-DYuQNBQ8.js";import{a as It}from"./use-mcp-tools-IJf4yY8f.js";import{c as $t}from"./content-blocks-o63cs2vh.js";import{I as Te}from"./integration-icon-CSYS5mut.js";import{f as Tt,h as Pt}from"./chat-context-D6S41DOV.js";import{b as kt}from"./shell-layout-DPTryinF.js";import{M as Et}from"./monaco-editor-BhcbAKhi.js";import{n as At}from"./XCircle-BFWoSw7W.js";import"./auth-DscXYOeb.js";import"./label-B1XS6835.js";import"./index-Bt_ZjPsW.js";import"./sidebar-BLFhVRa1.js";import"./LayoutLeft-_ZNcVcNz.js";import"./sheet-CzR0tmZA.js";import"./X-CO9z9Xp0.js";import"./ZoomOut-BR28jpI9.js";import"./Key01-CwoTMTFC.js";import"./extract-connection-data-BrfuWfn9.js";import"./use-registry-connections-COP2SiNd.js";import"./use-organization-settings-B-FYwlct.js";import"./studio-tools-cTyVqaHA.js";import"./Plus-CK2CAzo5.js";import"./index-BeL2IYvj.js";import"./index-C6QKjDvm.js";import"./popover-C7DR14Uv.js";import"./use-virtual-mcp-yUKVcLc_.js";import"./ChevronUp-CzO_7LvF.js";import"./SearchMd-B3Rw93l5.js";import"./Users03-B_G71vm-.js";import"./use-create-virtual-mcp-DqGii1ks.js";import"./use-navigate-to-agent-D_hba2ju.js";import"./Tool01-CZPk8Ney.js";import"./SwitchHorizontal01-B_NmbobE.js";import"./Settings02-B1ZVVT_e.js";import"./ArrowUpRight-DwILncVx.js";import"./ZapSquare-CmQdJEdR.js";import"./CheckCircle-DpKZZDmN.js";import"./ChevronDown-BjzwFuai.js";import"./ChevronLeft-uRkOj5F8.js";import"./DotsVertical-DshGnU_X.js";import"./Globe01-Cm82tRCS.js";import"./FilterLines-CowTK4HW.js";import"./Star01-DBcQByZk.js";import"./Globe04-DrE78eQQ.js";import"./HardDrive-DsahIXX5.js";import"./LinkExternal01-BeE3-oct.js";import"./Monitor01-Aa4wN2Ct.js";import"./Sun-BMePDS8S.js";import"./Palette-DT-obB9z.js";import"./Shield01-BR2mZOZb.js";import"./Stars01-aJC5veoy.js";import"./Trash01-SWS-_O9Z.js";import"./Upload01-CoqelT_E.js";import"./User01-Do5enW22.js";import"./Users01-BmWtNHuf.js";import"./XClose-BO6FjXoT.js";import"./Zap-Bs_ao0zW.js";import"./index-uuDmStBi.js";import"./mcp-oauth-RIVS58UD.js";import"./badge-Bu3HgcYX.js";import"./hooks-iTnRVGBT.js";import"./decopilot-sse-pool-DCimHDb8.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-BB_netT8.js";import"./tab-id-BptcWVWa.js";import"./avatar-B2rvHJ2u.js";import"./dialog-D4-cpiIq.js";import"./required-auth-layout-Be42uHMA.js";import"./use-org-sso-d8VUjdDF.js";import"./index-D5MvY5fk.js";function Ot(s){const e=y.c(15),{onSave:o,onUndo:n,isDirty:l,isSaving:r,saveLabel:a,undoLabel:c}=s,i=a===void 0?"Save":a,u=c===void 0?"Undo":c;if(!l)return null;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(rt,{size:14}),e[0]=x):x=e[0];let m;e[1]!==r||e[2]!==n||e[3]!==u?(m=t.jsxs(F,{variant:"outline",size:"sm",onClick:n,disabled:r,"aria-label":u,children:[x,u]}),e[1]=r,e[2]=n,e[3]=u,e[4]=m):m=e[4];let p;e[5]!==r?(p=r?t.jsx(X,{size:14,className:"animate-spin"}):t.jsx(it,{size:14}),e[5]=r,e[6]=p):p=e[6];let f;e[7]!==r||e[8]!==o||e[9]!==i||e[10]!==p?(f=t.jsxs(F,{variant:"default",size:"sm",onClick:o,disabled:r,"aria-label":i,children:[p,i]}),e[7]=r,e[8]=o,e[9]=i,e[10]=p,e[11]=f):f=e[11];let g;return e[12]!==m||e[13]!==f?(g=t.jsxs(t.Fragment,{children:[m,f]}),e[12]=m,e[13]=f,e[14]=g):g=e[14],g}Ge({title:se().min(1),description:se().nullable(),body:se()});function le(s){for(const e of s.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function Rt(){const s=window.location.pathname.split("/").filter(Boolean),e=s.findIndex(n=>n==="mcps"),o=e>=0?s[e+1]:void 0;return o?decodeURIComponent(o):void 0}function _t(s){const e=y.c(13),{form:o}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=n):n=e[0];let l;e[1]!==o.control?(l=t.jsxs("div",{className:"flex flex-col gap-4",children:[n,t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsx(ne,{control:o.control,name:"title",render:Dt}),t.jsx(ne,{control:o.control,name:"description",render:zt})]})]}),e[1]=o.control,e[2]=l):l=e[2];let r,a;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),a=t.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=r,e[4]=a):(r=e[3],a=e[4]);let c;e[5]!==o.control?(c=t.jsxs("div",{className:"flex flex-col gap-2",children:[r,a,t.jsx(ne,{control:o.control,name:"body",render:Mt})]}),e[5]=o.control,e[6]=c):c=e[6];let i;e[7]!==l||e[8]!==c?(i=t.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[l,c]}),e[7]=l,e[8]=c,e[9]=i):i=e[9];let u;return e[10]!==o||e[11]!==i?(u=t.jsx(tt,{...o,children:i}),e[10]=o,e[11]=i,e[12]=u):u=e[12],u}function Mt(s){const{field:e}=s;return t.jsx(de,{children:t.jsx(me,{children:t.jsx(re,{...e,value:e.value??"",placeholder:"Write the prompt message…",className:"min-h-[240px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})})}function zt(s){const{field:e}=s;return t.jsxs(de,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),t.jsx(me,{children:t.jsx(ue,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Dt(s){const{field:e}=s;return t.jsxs(de,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),t.jsx(me,{children:t.jsx(ue,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Lt(s){const e=y.c(36),{providerId:o,promptId:n}=s,{org:l}=ie(),r=o||null;let a;e[0]!==l.id||e[1]!==l.slug||e[2]!==r?(a={connectionId:r,orgId:l.id,orgSlug:l.slug},e[0]=l.id,e[1]=l.slug,e[2]=r,e[3]=a):a=e[3];const c=ce(a),i=et(o,"PROMPT",n,c),u=Ae(o,"PROMPT",c),x=u.update.isPending;let m;e[4]!==i?(m=i?{title:i.title,description:i.description??null,body:le(i)}:void 0,e[4]=i,e[5]=m):m=e[5];let p;e[6]!==m?(p={values:m},e[6]=m,e[7]=p):p=e[7];const f=Qe(p);let g;e[8]!==f||e[9]!==i?(g=()=>{i&&f.reset({title:i.title,description:i.description??null,body:le(i)})},e[8]=f,e[9]=i,e[10]=g):g=e[10];const S=g;let I;e[11]!==u.update||e[12]!==f||e[13]!==n?(I=f.handleSubmit(async N=>{const A=await u.update.mutateAsync({id:n,data:{title:N.title,description:N.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:N.body}}]}});f.reset({title:A.title,description:A.description??null,body:le(A)})}),e[11]=u.update,e[12]=f,e[13]=n,e[14]=I):I=e[14];const R=I;if(!i){let N;return e[15]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ee,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[15]=N):N=e[15],N}let $;e[16]!==i.title?($=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:i.title}),e[16]=i.title,e[17]=$):$=e[17];let E;e[18]!==i.description?(E=i.description?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),t.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:i.description})]}):null,e[18]=i.description,e[19]=E):E=e[19];let P;e[20]!==$||e[21]!==E?(P=t.jsx(nt,{children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[$,E]})}),e[20]=$,e[21]=E,e[22]=P):P=e[22];let b;e[23]!==R?(b=()=>{R()},e[23]=R,e[24]=b):b=e[24];let w;e[25]!==f.formState.isDirty||e[26]!==x||e[27]!==S||e[28]!==b?(w=t.jsx(st,{children:t.jsx(Ot,{onSave:b,onUndo:S,isDirty:f.formState.isDirty,isSaving:x})}),e[25]=f.formState.isDirty,e[26]=x,e[27]=S,e[28]=b,e[29]=w):w=e[29];let C;e[30]!==f?(C=t.jsx("div",{className:"h-full",children:t.jsx(_t,{form:f})}),e[30]=f,e[31]=C):C=e[31];let k;return e[32]!==w||e[33]!==C||e[34]!==P?(k=t.jsxs(xe,{children:[P,w,C]}),e[32]=w,e[33]=C,e[34]=P,e[35]=k):k=e[35],k}function Ut(s){const e=y.c(4),{itemId:o}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=Rt(),e[0]=n):n=e[0];const l=n;if(!l){let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ee,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=a):a=e[1],a}let r;return e[2]!==o?(r=t.jsx(Pe,{children:t.jsx(T.Suspense,{fallback:null,children:t.jsx(Lt,{providerId:l,promptId:o})})}),e[2]=o,e[3]=r):r=e[3],r}function _e(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("min-w-0 overflow-hidden",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function Me(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("flex items-center gap-1.5 text-sm sm:gap-2 overflow-hidden",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("ol",{"data-slot":"breadcrumb-list",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function q(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("inline-flex items-center gap-1.5 min-w-0",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("li",{"data-slot":"breadcrumb-item",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function Q(s){const e=y.c(10);let o,n,l;e[0]!==s?({asChild:o,className:n,...l}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=l):(o=e[1],n=e[2],l=e[3]);const r=o?Ye:"a";let a;e[4]!==n?(a=V("hover:text-foreground transition-colors truncate",n),e[4]=n,e[5]=a):a=e[5];let c;return e[6]!==r||e[7]!==l||e[8]!==a?(c=t.jsx(r,{"data-slot":"breadcrumb-link",className:a,...l}),e[6]=r,e[7]=l,e[8]=a,e[9]=c):c=e[9],c}function ze(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("text-foreground font-medium truncate",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function Y(s){const e=y.c(12);let o,n,l;e[0]!==s?({children:o,className:n,...l}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=l):(o=e[1],n=e[2],l=e[3]);let r;e[4]!==n?(r=V("[&>svg]:size-3.5 text-muted-foreground opacity-50 list-none shrink-0",n),e[4]=n,e[5]=r):r=e[5];let a;e[6]!==o?(a=o??t.jsx(St,{}),e[6]=o,e[7]=a):a=e[7];let c;return e[8]!==l||e[9]!==r||e[10]!==a?(c=t.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:r,...l,children:a}),e[8]=l,e[9]=r,e[10]=a,e[11]=c):c=e[11],c}const Bt=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Ft(s){const e=y.c(11),{toolName:o,connectionId:n,siblings:l,onSelectInstance:r,onBack:a}=s;let c;e[0]!==n?(c={connectionId:n},e[0]=n,e[1]=c):c=e[1];const i=wt(c);if(!i.isAuthenticated){let m;return e[2]!==i.supportsOAuth||e[3]!==a?(m=t.jsx("div",{className:"flex h-full items-center justify-center",children:i.supportsOAuth?t.jsx(ot,{onAuthenticate:()=>a(),buttonText:"Go back to authenticate"}):t.jsx(lt,{hasReadme:!1})}),e[2]=i.supportsOAuth,e[3]=a,e[4]=m):m=e[4],m}const u=`${n}:${o}`;let x;return e[5]!==n||e[6]!==r||e[7]!==l||e[8]!==u||e[9]!==o?(x=t.jsx(Vt,{toolName:o,connectionId:n,siblings:l,onSelectInstance:r},u),e[5]=n,e[6]=r,e[7]=l,e[8]=u,e[9]=o,e[10]=x):x=e[10],x}function Vt({toolName:s,connectionId:e,siblings:o,onSelectInstance:n}){const{replayId:l}=Xe({strict:!1}),r=(()=>{if(!l)return null;const d=`replay-${l}`,h=sessionStorage.getItem(d);if(!h)return null;sessionStorage.removeItem(d);try{return JSON.parse(h)}catch{return null}})(),a=(()=>{if(!r)return null;const d={};for(const[h,v]of Object.entries(r))v!==null&&typeof v=="object"?d[h]=JSON.stringify(v,null,2):d[h]=v;return d})(),[c,i]=T.useState(a??{}),[u,x]=T.useState(r?JSON.stringify(r,null,2):"{}"),[m,p]=T.useState(null),[f,g]=T.useState(null),[S,I]=T.useState(null),[R,$]=T.useState(null),[E,P]=T.useState(!1),[b,w]=T.useState(null),{org:C}=ie(),k=Oe(e),N=Tt(),A=Pt(),{setChatOpen:U}=kt(),D=`${e}:${s}`,_=ce({connectionId:e,orgId:C.id,orgSlug:C.slug}),L=It({client:_}),j=L.data?.tools?.find(d=>d.name===s),O=ut(j?._meta),J=d=>{if(!N)return;const h=$t(d.content);h.content.length>0&&(U(!0),N.sendMessage({tiptapDoc:h}))},[M,Z]=T.useState("json"),[De,Le]=T.useState(!1);O&&!De&&(Z("ui"),Le(!0));const pe=j?.inputSchema?.properties,fe=pe?Object.keys(pe):[],H=fe.length>0,K={};if(H&&j?.inputSchema?.properties)for(const d of fe)K[d]=j.inputSchema.required?.includes(d)?"":void 0;const ee=d=>Object.prototype.hasOwnProperty.call(c,d),Ue=async()=>{P(!0),$(null),p(null),g(null),I(null),w(null);const d=performance.now();try{if(!_)throw new Error("MCP client is not available");const h=H?{...K,...c}:(()=>{const z=u.trim();if(!z)return{};const B=JSON.parse(z);if(B&&typeof B=="object")return B;throw new Error("Raw JSON input must be an object.")})();H&&j?.inputSchema?.properties&&Object.entries(j.inputSchema.properties).forEach(([z,B])=>{if((B.type==="object"||B.type==="array")&&typeof h[z]=="string")try{h[z]=JSON.parse(h[z])}catch{}else if((B.type==="number"||B.type==="integer")&&typeof h[z]=="string"&&h[z]!==""){const je=Number(h[z]);Number.isNaN(je)||(h[z]=je)}});const v=await _.callTool({name:s,arguments:h}),W=v.structuredContent??v,He=performance.now(),Ke=Math.round(He-d);p(W),g(v),I(h);const We=JSON.stringify(W),ge=new TextEncoder().encode(We).length;w({duration:`${Ke}ms`,bytes:`${ge} bytes`,tokens:`~${Math.ceil(ge/4)} tokens`,cost:"$0.0000"})}catch(h){const v=h instanceof Error?h.message:String(h);$(v||"Unknown error occurred");const W=performance.now();w({duration:`${Math.round(W-d)}ms`})}finally{P(!1)}},te=(d,h)=>{i(v=>({...v,[d]:h}))},Be=()=>{p(null),g(null),I(null),$(null),w(null)},Fe=j?.name??Bt(s),Ve=t.jsx(_e,{children:t.jsxs(Me,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections",params:{org:C.slug},children:"Connections"})})}),t.jsx(Y,{}),k&&t.jsxs(t.Fragment,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections/$appSlug",params:{org:C.slug,appSlug:yt(k)},search:{tab:"tools"},children:k.title})})}),t.jsx(Y,{})]}),t.jsx(q,{children:t.jsx(ze,{children:Fe})})]})}),he=o.length>1&&t.jsxs(ve,{value:e,onValueChange:n,children:[t.jsx(Se,{className:"h-8 w-auto min-w-[200px]",children:t.jsx(ye,{})}),t.jsx(we,{children:o.map(d=>t.jsx(oe,{value:d.id,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Te,{icon:d.icon,name:d.title,size:"xs",className:"shrink-0"}),d.title]})},d.id))})]}),Je=t.jsxs("div",{className:"flex flex-col p-6 gap-4 overflow-auto",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),j?.inputSchema?.required&&j.inputSchema.required.length>0&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),t.jsx("div",{className:"space-y-4",children:H&&j?.inputSchema?.properties?Object.entries(j.inputSchema.properties).map(([d,h])=>t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[d,j.inputSchema?.required?.includes(d)&&t.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),t.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:h.type})]}),h.description&&t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:h.description}),h.type==="object"||h.type==="array"?t.jsx(re,{className:"font-mono text-xs",value:ee(d)?c[d]??"":K[d]??"",onChange:v=>te(d,v.target.value),placeholder:`Enter ${d} as JSON...`,rows:3}):h.type==="boolean"?t.jsxs(ve,{value:ee(d)?String(c[d]??""):"",onValueChange:v=>te(d,v==="true"),children:[t.jsx(Se,{children:t.jsx(ye,{placeholder:"Select true or false..."})}),t.jsxs(we,{children:[t.jsx(oe,{value:"true",children:"true"}),t.jsx(oe,{value:"false",children:"false"})]})]}):t.jsx(ue,{value:ee(d)?c[d]??"":K[d]??"",onChange:v=>te(d,v.target.value),placeholder:`Enter ${d}...`})]},d)):j?.inputSchema&&!H?t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),t.jsx(re,{className:"font-mono text-xs min-h-[120px]",value:u,onChange:d=>x(d.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):t.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})}),t.jsx("div",{className:"flex items-center gap-2 pt-2",children:E?t.jsxs(F,{size:"sm",variant:"destructive",className:"h-8 gap-2",onClick:Be,children:[t.jsx(at,{className:"h-3.5 w-3.5"}),"Cancel"]}):t.jsxs(F,{size:"sm",variant:"default",className:"h-8 gap-2",onClick:Ue,children:[t.jsx(vt,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})})]}),qe=t.jsxs("div",{className:"flex flex-col @3xl:h-full @3xl:overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-b border-border bg-background",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),t.jsxs("div",{className:"flex items-center gap-3",children:[b&&t.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(bt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.duration})]}),b.tokens&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ct,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.tokens})]}),b.bytes&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(dt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.bytes})]}),b.cost&&t.jsx("div",{className:"flex items-center gap-1.5",children:t.jsx("span",{className:"font-mono text-foreground",children:b.cost})})]}),O&&t.jsx(gt,{children:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(F,{size:"icon",variant:M==="ui"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Z("ui"),children:t.jsx(mt,{size:14})})}),t.jsx($e,{children:"Interactive view"})]}),t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(F,{size:"icon",variant:M==="json"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Z("json"),children:t.jsx(be,{size:14})})}),t.jsx($e,{children:"JSON view"})]})]})})]})]}),R&&t.jsx("div",{className:"px-6 py-4 bg-background",children:t.jsx(pt,{variant:"destructive",children:t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(jt,{className:"h-4 w-4"}),t.jsx(ft,{className:"mb-0",children:"Execution Failed"})]}),t.jsx(ht,{className:"text-xs text-destructive",children:R})]})})}),t.jsx("div",{className:"relative flex-1 min-h-[400px] @3xl:min-h-0 @3xl:overflow-auto bg-muted/50",children:O&&M==="ui"&&_?t.jsx(T.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center h-48",children:t.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[t.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),t.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),children:t.jsx(xt,{resourceURI:O,toolInfo:j?{tool:j}:void 0,toolInput:S??void 0,toolResult:f??void 0,displayMode:"fullscreen",minHeight:Ne.view.minHeight,maxHeight:Ne.view.maxHeight,client:_,onMessage:J,onUpdateModelContext:d=>A?.setAppContext(D,d),onTeardown:()=>A?.clearAppContext(D),className:"h-full"})}):m?t.jsxs(t.Fragment,{children:[t.jsx(Et,{code:JSON.stringify(m,null,2),language:"json",height:"100%",readOnly:!0}),t.jsx(F,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(m,null,2)),Ze.success("Copied to clipboard")},children:t.jsx(Nt,{className:"h-3.5 w-3.5"})})]}):t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[t.jsx(be,{className:"h-12 w-12 mb-3 opacity-40"}),t.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]});return t.jsx(xe,{breadcrumb:Ve,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden @container",children:[t.jsxs("div",{className:"flex flex-col gap-3 py-7 px-8 bg-background border-b border-border shrink-0",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx(Te,{icon:k?.icon||null,name:k?.title||s,size:"xl",className:"shrink-0"}),t.jsx("h1",{className:"text-xl font-semibold tracking-tight text-foreground leading-none truncate",children:s}),t.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit shrink-0",children:[L.isSuccess?t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):L.isLoading?t.jsx(X,{size:10,className:"animate-spin text-yellow-500 shrink-0"}):t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-red-500 shrink-0"}),t.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:L.isSuccess?"ready":L.isLoading?"connecting":"error"})]}),t.jsx(Ct,{annotations:j?.annotations,_meta:j?._meta}),t.jsx("div",{className:"hidden @3xl:flex items-center ml-auto shrink-0",children:he})]}),t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:j?.description||"No description available"})]}),o.length>1&&t.jsxs("div",{className:"flex @3xl:hidden items-center gap-3 px-8 py-3 border-b border-border",children:[t.jsx("span",{className:"text-xs font-medium text-muted-foreground shrink-0",children:"Instance"}),he]}),t.jsx("div",{className:"flex-1 overflow-auto @3xl:overflow-hidden",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-[minmax(0,2fr)_minmax(0,5fr)] @3xl:h-full @3xl:grid-rows-1",children:[t.jsx("div",{className:"@3xl:border-r border-border @3xl:overflow-auto",children:Je}),qe]})})]})})}function Jt(s){const e=y.c(10),{itemId:o,siblings:n,onBack:l}=s,[r,a]=T.useState(n[0]?.id??"");let c;e[0]!==r||e[1]!==n?(c=n.find(p=>p.id===r)?.id??n[0]?.id??"",e[0]=r,e[1]=n,e[2]=c):c=e[2];const i=c;if(!Oe(i||void 0)||!i){let p;return e[3]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[t.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[3]=p):p=e[3],p}let x;e[4]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(X,{size:32,className:"animate-spin text-muted-foreground"})}),e[4]=x):x=e[4];let m;return e[5]!==i||e[6]!==l||e[7]!==n||e[8]!==o?(m=t.jsx(T.Suspense,{fallback:x,children:t.jsx(Ft,{toolName:o,connectionId:i,siblings:n,onSelectInstance:a,onBack:l})}),e[5]=i,e[6]=l,e[7]=n,e[8]=o,e[9]=m):m=e[9],m}function qt(s){const e=y.c(21),{icon:o,illustration:n,title:l,description:r,buttonProps:a,buttonComponent:c,className:i,children:u}=s;let x;e[0]!==i?(x=V("flex flex-col items-center justify-center py-16 text-center",i),e[0]=i,e[1]=x):x=e[1];let m;e[2]!==o||e[3]!==n?(m=n?t.jsx("div",{className:"mb-4 text-muted-foreground/50",children:n}):o?t.jsx("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-muted/50 text-muted-foreground",children:o}):null,e[2]=o,e[3]=n,e[4]=m):m=e[4];let p;e[5]!==l?(p=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:l}),e[5]=l,e[6]=p):p=e[6];let f;e[7]!==r?(f=r&&t.jsx("div",{className:"text-sm text-muted-foreground",children:r}),e[7]=r,e[8]=f):f=e[8];let g;e[9]!==p||e[10]!==f?(g=t.jsxs("div",{className:"flex flex-col items-center gap-1 max-w-sm",children:[p,f]}),e[9]=p,e[10]=f,e[11]=g):g=e[11];let S;e[12]!==c||e[13]!==a?(S=(c??a)&&t.jsx("div",{className:"mt-4",children:c??(a&&t.jsx(F,{size:"sm",className:V(a?.className),...a}))}),e[12]=c,e[13]=a,e[14]=S):S=e[14];let I;return e[15]!==u||e[16]!==x||e[17]!==m||e[18]!==g||e[19]!==S?(I=t.jsxs("div",{className:x,children:[m,g,S,u]}),e[15]=u,e[16]=x,e[17]=m,e[18]=g,e[19]=S,e[20]=I):I=e[20],I}const Ht={prompt:Ut};function Kt(){const s=y.c(9),e=ke();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=o):o=s[0];const n=ae(o),l=decodeURIComponent(n.itemId);let r;s[1]!==n.appSlug?(r={slug:n.appSlug},s[1]=n.appSlug,s[2]=r):r=s[2];const a=Re(r);let c;s[3]!==e.history?(c=()=>{e.history.back()},s[3]=e.history,s[4]=c):c=s[4];const i=c,u=Wt;let x;return s[5]!==i||s[6]!==l||s[7]!==a?(x=t.jsx(Jt,{itemId:l,siblings:a,onBack:i,onUpdate:u}),s[5]=i,s[6]=l,s[7]=a,s[8]=x):x=s[8],x}async function Wt(s){return Promise.resolve()}function Gt(s){return s.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Qt(){const s=y.c(41),e=ke();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=o):o=s[0];const n=ae(o),l=decodeURIComponent(n.collectionName),r=decodeURIComponent(n.itemId);let a;s[1]!==e.history?(a=()=>{e.history.back()},s[1]=e.history,s[2]=a):a=s[2];const c=a,{org:i}=ie();let u;s[3]!==n.appSlug?(u={slug:n.appSlug},s[3]=n.appSlug,s[4]=u):u=s[4];const m=Re(u)[0]??null,p=m?.id??"",f=p||"no-connection",g=p??null;let S;s[5]!==i.id||s[6]!==i.slug||s[7]!==g?(S={connectionId:g,orgId:i.id,orgSlug:i.slug},s[5]=i.id,s[6]=i.slug,s[7]=g,s[8]=S):S=s[8];const I=ce(S),R=Ae(f,l,I);let $;s[9]!==R||s[10]!==r?($=async M=>{r&&await R.update.mutateAsync({id:r,data:M})},s[9]=R,s[10]=r,s[11]=$):$=s[11];const E=$;let P;s[12]!==l?(P=l?.toLowerCase(),s[12]=l,s[13]=P):P=s[13];const b=P,w=b&&Ht[b];let C;s[14]!==l?(C=Gt(l),s[14]=l,s[15]=C):C=s[15];const k=C;let N;s[16]!==i.slug?(N=t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections",params:{org:i.slug},children:"Connections"})})}),s[16]=i.slug,s[17]=N):N=s[17];let A;s[18]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(Y,{}),s[18]=A):A=s[18];let U;s[19]!==l||s[20]!==m||s[21]!==i.slug||s[22]!==n.appSlug?(U=m&&t.jsxs(t.Fragment,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:n.appSlug},search:{tab:l},children:m.title})})}),t.jsx(Y,{})]}),s[19]=l,s[20]=m,s[21]=i.slug,s[22]=n.appSlug,s[23]=U):U=s[23];let D;s[24]!==k?(D=t.jsx(q,{children:t.jsx(ze,{children:k})}),s[24]=k,s[25]=D):D=s[25];let _;s[26]!==U||s[27]!==D||s[28]!==N?(_=t.jsx(_e,{children:t.jsxs(Me,{children:[N,A,U,D]})}),s[26]=U,s[27]=D,s[28]=N,s[29]=_):_=s[29];const L=_;if(w){let M;return s[30]!==w||s[31]!==c||s[32]!==E||s[33]!==r?(M=t.jsx(w,{itemId:r,onBack:c,onUpdate:E}),s[30]=w,s[31]=c,s[32]=E,s[33]=r,s[34]=M):M=s[34],M}let j;s[35]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(At,{size:36,className:"text-muted-foreground"}),s[35]=j):j=s[35];let O;s[36]!==c?(O=t.jsx(qt,{icon:j,title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:c,children:"Go back"}}),s[36]=c,s[37]=O):O=s[37];let J;return s[38]!==L||s[39]!==O?(J=t.jsx(xe,{breadcrumb:L,children:O}),s[38]=L,s[39]=O,s[40]=J):J=s[40],J}function Yt(){const s=y.c(3);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=e):e=s[0];const o=ae(e);if(decodeURIComponent(o.collectionName)==="tools"){let a;return s[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(Kt,{}),s[1]=a):a=s[1],a}let r;return s[2]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Qt,{}),s[2]=r):r=s[2],r}function Mn(){const s=y.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Pe,{children:t.jsx(T.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(X,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Yt,{})})}),s[0]=e):e=s[0],e}export{Mn as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as B,j as s,l as M,B as V}from"./index-
|
|
1
|
+
import{c as B,j as s,l as M,B as V}from"./index-C1yj8oW9.js";import{c as z,a as _,b as $,D as E}from"./dropdown-menu-DgXWnPV7.js";import{a as L,n as O,d as R,i as A,c as F}from"./SwitchHorizontal01-B_NmbobE.js";import{i as S}from"./ChevronUp-CzO_7LvF.js";import{T as I,a as K,c as P,b as W}from"./tooltip-Cvbl_0l0.js";import{V as q}from"./view-mode-toggle-D1TNBVMm.js";import{B as G}from"./badge-Bu3HgcYX.js";function te(t){const e=B.c(31),{viewMode:r,onViewModeChange:m,sortKey:T,sortDirection:p,onSort:f,sortOptions:u,filters:h}=t;let g;e[0]!==u?(g=u===void 0?[]:u,e[0]=u,e[1]=g):g=e[1];const j=g;let b;e[2]!==h?(b=h===void 0?[]:h,e[2]=h,e[3]=b):b=e[3];const l=b;let v;e[4]!==l?(v=l.filter(J),e[4]=l,e[5]=v):v=e[5];const N=v.length;let w;e[6]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(R,{size:16}),e[6]=w):w=e[6];let i;e[7]!==N?(i=N>0&&s.jsx(G,{variant:"default",className:"absolute -top-1.5 -right-1.5 h-4 min-w-4 px-1 text-[10px] leading-none",children:N}),e[7]=N,e[8]=i):i=e[8];let o;e[9]!==i?(o=s.jsx(I,{asChild:!0,children:s.jsx(_,{asChild:!0,children:s.jsxs(V,{variant:"outline",size:"icon",className:"relative",children:[w,i]})})}),e[9]=i,e[10]=o):o=e[10];let C;e[11]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(K,{children:"Display & filters"}),e[11]=C):C=e[11];let n;e[12]!==o?(n=s.jsx(P,{children:s.jsxs(W,{children:[o,C]})}),e[12]=o,e[13]=n):n=e[13];let a;e[14]!==m||e[15]!==r?(a=m&&r&&s.jsx("div",{className:"p-2 border-b border-border",children:s.jsx(q,{value:r,onValueChange:m,fullWidth:!0,options:[{value:"table",icon:s.jsx(A,{})},{value:"cards",icon:s.jsx(F,{})}]})}),e[14]=m,e[15]=r,e[16]=a):a=e[16];let c;e[17]!==f||e[18]!==p||e[19]!==T||e[20]!==j?(c=j.length>0&&f&&s.jsxs("div",{className:"p-1 flex flex-col gap-0.5 border-b border-border",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Sort by"}),j.map(y=>{const D=T===y.id;return s.jsx(z,{onClick:()=>f(y.id),className:M("h-8 px-2 py-0 cursor-pointer",D&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[D&&s.jsx(S,{size:16,className:"text-foreground shrink-0"}),!D&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:y.label}),D&&p&&(p==="asc"?s.jsx(L,{size:16,className:"text-foreground shrink-0"}):s.jsx(O,{size:16,className:"text-foreground shrink-0"}))]})},y.id)})]}),e[17]=f,e[18]=p,e[19]=T,e[20]=j,e[21]=c):c=e[21];let d;e[22]!==l?(d=l.map(H),e[22]=l,e[23]=d):d=e[23];let x;e[24]!==a||e[25]!==c||e[26]!==d?(x=s.jsxs($,{align:"end",className:"w-[200px] p-0 gap-0",children:[a,c,d]}),e[24]=a,e[25]=c,e[26]=d,e[27]=x):x=e[27];let k;return e[28]!==n||e[29]!==x?(k=s.jsxs(E,{children:[n,x]}),e[28]=n,e[29]=x,e[30]=k):k=e[30],k}function H(t){return s.jsxs("div",{className:"p-1 flex flex-col gap-0.5 border-b border-border last:border-b-0",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:t.label}),t.options.map(e=>{const r=t.value===e.id;return s.jsx(z,{onClick:()=>t.onChange(e.id),className:M("h-8 px-2 py-0 cursor-pointer",r&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[r&&s.jsx(S,{size:16,className:"text-foreground shrink-0"}),!r&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:e.label})]})},e.id)})]},t.label)}function J(t){return t.value!=="ALL"}export{te as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as v,l as b,j as a,i as w}from"./index-
|
|
1
|
+
import{c as v,l as b,j as a,i as w}from"./index-C1yj8oW9.js";import{i as C}from"./SearchMd-B3Rw93l5.js";function S(j){const e=v.c(21),{value:d,onChange:m,placeholder:g,onKeyDown:x,className:u,isSearching:f,disabled:i}=j,p=g===void 0?"Search...":g;let t;e[0]!==u?(t=b("shrink-0 w-full border-b border-border h-12",u),e[0]=u,e[1]=t):t=e[1];const h=i?"cursor-not-allowed opacity-50":"cursor-text";let s;e[2]!==h?(s=b("flex items-center gap-2.5 h-12 px-4",h),e[2]=h,e[3]=s):s=e[3];let l;e[4]!==f?(l=f?a.jsx(w,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):a.jsx(C,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=f,e[5]=l):l=e[5];let r;e[6]!==m?(r=N=>m(N.target.value),e[6]=m,e[7]=r):r=e[7];let o;e[8]!==i||e[9]!==x||e[10]!==p||e[11]!==r||e[12]!==d?(o=a.jsx("input",{type:"text",value:d,onChange:r,onKeyDown:x,placeholder:p,disabled:i,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=i,e[9]=x,e[10]=p,e[11]=r,e[12]=d,e[13]=o):o=e[13];let n;e[14]!==s||e[15]!==l||e[16]!==o?(n=a.jsxs("label",{className:s,children:[l,o]}),e[14]=s,e[15]=l,e[16]=o,e[17]=n):n=e[17];let c;return e[18]!==t||e[19]!==n?(c=a.jsx("div",{className:t,children:n}),e[18]=t,e[19]=n,e[20]=c):c=e[20],c}export{S as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as f,l as u,j as m}from"./index-
|
|
1
|
+
import{c as f,l as u,j as m}from"./index-C1yj8oW9.js";import{B as g}from"./badge-Bu3HgcYX.js";function h(x){const e=f.c(12),{tabs:c,activeTab:n,onTabChange:s,className:a}=x;let t;e[0]!==a?(t=u("flex items-center gap-2 overflow-x-auto no-scrollbar",a),e[0]=a,e[1]=t):t=e[1];let r;if(e[2]!==n||e[3]!==s||e[4]!==c){let l;e[6]!==n||e[7]!==s?(l=o=>{const d=n===o.id;return m.jsxs("button",{type:"button",onClick:()=>s(o.id),className:u("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex gap-1.5 items-center",d&&"bg-accent border-border text-foreground",!d&&"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:[o.label,o.count!==void 0&&m.jsx(g,{variant:"secondary",className:u("h-5 min-w-5 px-1 rounded-full text-[10px] font-mono inline-flex items-center justify-center",d?"bg-background text-foreground":"bg-muted-foreground/10 text-muted-foreground"),children:o.count})]},o.id)},e[6]=n,e[7]=s,e[8]=l):l=e[8],r=c.map(l),e[2]=n,e[3]=s,e[4]=c,e[5]=r}else r=e[5];let i;return e[9]!==t||e[10]!==r?(i=m.jsx("div",{className:t,children:r}),e[9]=t,e[10]=r,e[11]=i):i=e[11],i}export{h as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as d,l as i,j as n}from"./index-
|
|
1
|
+
import{c as d,l as i,j as n}from"./index-C1yj8oW9.js";import{_ as m}from"./index-C6QKjDvm.js";import{d as k,a as N,b as j,D as b,c as w}from"./dialog-D4-cpiIq.js";import{i as y}from"./SearchMd-B3Rw93l5.js";function C(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m,{"data-slot":"command",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function S(a){const e=d.c(24);let t,s,o,l,r;e[0]!==a?({title:l,description:r,children:t,className:s,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=l,e[5]=r):(t=e[1],s=e[2],o=e[3],l=e[4],r=e[5]);const _=l===void 0?"Command Palette":l,v=r===void 0?"Search for a command to run...":r;let c;e[6]!==_?(c=n.jsx(N,{children:_}),e[6]=_,e[7]=c):c=e[7];let p;e[8]!==v?(p=n.jsx(j,{children:v}),e[8]=v,e[9]=p):p=e[9];let u;e[10]!==c||e[11]!==p?(u=n.jsxs(b,{className:"sr-only",children:[c,p]}),e[10]=c,e[11]=p,e[12]=u):u=e[12];let f;e[13]!==s?(f=i("overflow-hidden p-0",s),e[13]=s,e[14]=f):f=e[14];let x;e[15]!==t?(x=n.jsx(C,{className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:t}),e[15]=t,e[16]=x):x=e[16];let g;e[17]!==f||e[18]!==x?(g=n.jsx(w,{className:f,closeButtonClassName:"hidden",children:x}),e[17]=f,e[18]=x,e[19]=g):g=e[19];let h;return e[20]!==o||e[21]!==u||e[22]!==g?(h=n.jsxs(k,{...o,children:[u,g]}),e[20]=o,e[21]=u,e[22]=g,e[23]=h):h=e[23],h}function z(a){const e=d.c(9);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(y,{className:"size-5 shrink-0 text-foreground"}),e[3]=o):o=e[3];let l;e[4]!==t?(l=i("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",t),e[4]=t,e[5]=l):l=e[5];let r;return e[6]!==s||e[7]!==l?(r=n.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-10 items-center gap-2 border-b px-3",children:[o,n.jsx(m.Input,{"data-slot":"command-input",className:l,...s})]}),e[6]=s,e[7]=l,e[8]=r):r=e[8],r}function G(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.List,{"data-slot":"command-list",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function L(a){const e=d.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=n.jsx(m.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...t}),e[2]=t,e[3]=s):s=e[3],s}function R(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.Group,{"data-slot":"command-group",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function B(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("bg-border -mx-1 h-px",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.Separator,{"data-slot":"command-separator",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function H(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_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=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.Item,{"data-slot":"command-item",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}export{L as C,H as a,z as b,G as c,C as d,R as e,S as f,B as g};
|
package/dist/client/assets/{commerce-onboarding-DtQQW42S.js → commerce-onboarding-CbmMdla_.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as w,r as z,l as Te,j as s,m as ke,k as re,d as be,K as D,i as le,B as ie,a as ze,u as Be,b as Ae,n as Qe,o as Le,Q as Ve,E as We,p as Ee,L as Ye}from"./index-Da7zBgP3.js";import{A as Ze}from"./auth-entry-BlZh1m7O.js";import{A as ne}from"./auth-split-layout-D8DmmoYv.js";import{O as we}from"./organization-choice-CCRYa54g.js";import{f as Je}from"./tab-id-BptcWVWa.js";import{I as de}from"./input-JrKcP8_P.js";import{u as ue,S as Se,W as Pe,g as Xe,C as et}from"./use-mcp-client-QbDw5Kxr.js";import{i as Ue}from"./XCircle-lg1atJo8.js";import{I as tt}from"./integration-icon-BefRgu4d.js";import{i as Ne}from"./CheckCircle-CubOqkhM.js";import{g as nt,c as st,e as it}from"./extract-connection-data-DW6_hSwc.js";import{S as ot,a as rt,b as $e,c as De,d as Me,e as Fe,f as Ke}from"./select-BRu_aocD.js";import{a as lt}from"./authenticate-and-persist-oauth-Bb4qQGZD.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./avatar-DMMu0sLX.js";import"./User01-CNb4uOQF.js";import"./auth-CX0V_g3E.js";import"./agent-icon-_F0cs0c2.js";import"./AlertCircle-D7JULgSW.js";import"./Tool01-BMBmO996.js";import"./SwitchHorizontal01-B1Fi_gZm.js";import"./Settings02-B7JvRibZ.js";import"./ArrowUpRight-BoNegK2J.js";import"./ZapSquare-CB80bsBy.js";import"./Users03-3hrg8IdJ.js";import"./ChevronUp-BHC7PPdP.js";import"./ChevronDown-bvcGltsD.js";import"./ChevronLeft-CwoAKT1V.js";import"./ChevronRight-JjxX5FP7.js";import"./DotsVertical-lhkCwVyZ.js";import"./Stars02-0cy3Iac4.js";import"./Eye-DDlQv8dT.js";import"./ZoomOut-Da8en56C.js";import"./Globe01-DPxNkWN3.js";import"./FilterLines-5NaQCp3e.js";import"./Star01-Ctay-f61.js";import"./Globe04-CfOFRbjm.js";import"./HardDrive-Cc6TayZG.js";import"./Key01-BnvBI-54.js";import"./LayoutLeft-BqPxwhfG.js";import"./LinkExternal01-Cuz2KimH.js";import"./Monitor01-Bg2cIqWO.js";import"./Sun-VAruoT-r.js";import"./Palette-DqDQ3lBi.js";import"./Play-DJY7X3Ac.js";import"./Plus-BPXRSHah.js";import"./SearchMd-BzO607jf.js";import"./Shield01-CpKySeSn.js";import"./Stars01-BvSyxIB7.js";import"./Trash01-bpIqJEin.js";import"./Upload01-DRwUypcB.js";import"./Users01-Dznayvgx.js";import"./XClose-DgeTXvEe.js";import"./X-BmLEy_4s.js";import"./Zap-yzjfF5fD.js";import"./index-iwyGvJw3.js";import"./mcp-oauth-DggY1DlO.js";const at=/^[a-zA-Z][a-zA-Z\d+.-]*:/,ct=/^[a-zA-Z][a-zA-Z\d+.-]*:\/\//,dt=/^[^\s/:?#]+\.[^\s/:?#]+:\d+(?:[/?#]|$)/,ut=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/i;function ve(i){const e=i.trim();if(!e)return{ok:!1,error:"Enter a website URL."};const t=at.test(e),n=ct.test(e),o=dt.test(e);if(t&&!n&&!o)return{ok:!1,error:"Use an HTTP or HTTPS website URL."};const a=n?e:`https://${e}`;let l;try{l=new URL(a)}catch{return{ok:!1,error:"Enter a valid website URL."}}if(l.protocol!=="http:"&&l.protocol!=="https:")return{ok:!1,error:"Use an HTTP or HTTPS website URL."};const r=l.hostname.split(".");return r.length<2||r.some(d=>!d||!ut.test(d))?{ok:!1,error:"Enter a valid website URL."}:(l.protocol="https:",{ok:!0,value:l.origin})}function Ce(i){const e=w.c(14),{children:t,className:n,wrapperClassName:o}=i,[a,l]=z.useState(!0);let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=h=>{if(!h)return;const y=()=>{const c=h.scrollHeight-h.scrollTop-h.clientHeight<8;l(c)};y(),h.addEventListener("scroll",y,{passive:!0});const v=new ResizeObserver(y);v.observe(h);for(const c of Array.from(h.children))v.observe(c);return()=>{h.removeEventListener("scroll",y),v.disconnect()}},e[0]=r):r=e[0];const d=r;let m;e[1]!==o?(m=Te("relative",o),e[1]=o,e[2]=m):m=e[2];let g;e[3]!==t||e[4]!==n?(g=s.jsx("div",{ref:d,className:n,children:t}),e[3]=t,e[4]=n,e[5]=g):g=e[5];const f=a?"opacity-0":"opacity-100";let u;e[6]!==f?(u=Te("pointer-events-none absolute inset-x-0 -bottom-px h-[213px]","bg-gradient-to-t from-sidebar from-[6px] to-transparent","backdrop-blur-[2px] [mask-image:linear-gradient(to_top,black_6px,transparent)]","transition-opacity duration-200",f),e[6]=f,e[7]=u):u=e[7];let x;e[8]!==u?(x=s.jsx("div",{"aria-hidden":!0,className:u}),e[8]=u,e[9]=x):x=e[9];let p;return e[10]!==m||e[11]!==g||e[12]!==x?(p=s.jsxs("div",{className:m,children:[g,x]}),e[10]=m,e[11]=g,e[12]=x,e[13]=p):p=e[13],p}function mt(i){const e=i,t=e?.response?.accountSummaries??e?.accountSummaries;if(!Array.isArray(t))return[];const n=[];for(const o of t){const a=o?.propertySummaries;if(!Array.isArray(a))continue;const l=[];for(const r of a)typeof r?.property=="string"&&r.property.length>0&&l.push({value:r.property,label:typeof r.displayName=="string"?r.displayName:r.property});l.length!==0&&n.push({account:typeof o?.displayName=="string"?o.displayName:"Account",options:l})}return n}function ft(i){return i.flatMap(e=>e.options)}function qe(i){const e=i,t=e?.sites??e?.siteEntry;return Array.isArray(t)?t.filter(n=>typeof n?.siteUrl=="string"&&n.siteUrl.length>0).map(n=>({siteUrl:n.siteUrl})):[]}function pt(i){const e=t=>t.replace(/^www\./,"").toLowerCase();if(i.startsWith("sc-domain:"))return e(i.slice(10));try{return e(new URL(i).hostname)}catch{return null}}function gt(i,e){if(!i)return null;const t=i.replace(/^www\./,"").toLowerCase(),n=e.filter(o=>pt(o.siteUrl)===t);return n.length===1?n[0].siteUrl:null}function ht(i,e){const t=i?.[e];return typeof t=="string"?t.length>0:t!=null}function xt(i,e){return{...i??{},...e}}function yt(i){const e=i.properties;if(!e)return[];const t=[];for(const[n,o]of Object.entries(e)){const r=o?.properties?.__type?.const;typeof r=="string"&&r.length>0&&t.push({fieldKey:n,bindingType:r})}return t}function vt(i,e){const t=[];if(i.length&&t.push({field:["id"],operator:"in",value:i}),e.length&&t.push({field:["name"],operator:"in",value:e}),t.length!==0)return t.length===1?t[0]:{operator:"or",conditions:t}}function M(i){const e=i;if(e.isError)throw new Error(e.content?.find(t=>t.text)?.text??"Tool call failed");return e.structuredContent??i}function Ct(i,e,t,n){return{...i??{},[e]:{__type:t,value:n}}}function jt(i,e,t){const n=i.filter(o=>o.app_name===e||!!t&&o.app_id===t);return n.length===0?null:(n.sort((o,a)=>{const l=r=>r.status==="active"?0:1;return l(o)!==l(a)?l(o)-l(a):(a.updated_at??"").localeCompare(o.updated_at??"")}),n[0].id)}function bt(i){return i.server?.icons?.[0]?.src??nt(i.server?.repository)??null}function St(i,e){const t=i._meta?.["mcp.mesh"];return t?.friendlyName||t?.friendly_name||i.title||i.server?.title||i.server?.name||e}function Nt(i){const e=[];for(const t of i.requirements){const n=i.curated[t.bindingType],o=n?i.itemsById[n.registryAppId]:i.itemsByName[t.bindingType];if(!o)continue;const a=i.configurationState?.[t.fieldKey]?.value,l=!!a;e.push({fieldKey:t.fieldKey,bindingType:t.bindingType,registryItem:o,title:St(o,t.bindingType),icon:bt(o),headline:n?.headline??o._meta?.["mcp.mesh"]?.short_description??null,checks:n?.checks??null,bullets:n?.bullets??[],satisfied:l,candidateConnectionId:l?null:jt(i.connections,t.bindingType,n?.registryAppId),linkedConnectionId:a??null})}return e}function _t(i){const e=w.c(79),{entry:t,connectionId:n,orgId:o,orgSlug:a,siteHost:l}=i,r=ke();let d;e[0]!==o||e[1]!==a?(d={connectionId:Se,orgId:o,orgSlug:a},e[0]=o,e[1]=a,e[2]=d):d=e[2];const m=ue(d);let g;e[3]!==n||e[4]!==o||e[5]!==a?(g={connectionId:n,orgId:o,orgSlug:a},e[3]=n,e[4]=o,e[5]=a,e[6]=g):g=e[6];const f=ue(g),[u,x]=z.useState(null),p=z.useRef(!1);let h;e[7]!==n||e[8]!==o?(h=D.commerceDiscoveryCompanionConfig(o,n),e[7]=n,e[8]=o,e[9]=h):h=e[9];let y;e[10]!==n||e[11]!==m?(y=async()=>{const A=await m.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:n}});return M(A)},e[10]=n,e[11]=m,e[12]=y):y=e[12];let v;e[13]!==h||e[14]!==y?(v={queryKey:h,queryFn:y},e[13]=h,e[14]=y,e[15]=v):v=e[15];const c=re(v);let j;e[16]!==c.data?.item?.configuration_state?(j=c.data?.item?.configuration_state??{},e[16]=c.data?.item?.configuration_state,e[17]=j):j=e[17];const C=j;let b;e[18]!==C||e[19]!==t.anchorField?(b=ht(C,t.anchorField),e[18]=C,e[19]=t.anchorField,e[20]=b):b=e[20];const N=b;let _;e[21]!==n||e[22]!==o?(_=D.commerceDiscoveryGaSummaries(o,n),e[21]=n,e[22]=o,e[23]=_):_=e[23];const T=t.bindingType==="google-analytics";let R;e[24]!==f?(R=async()=>{const A=await f.callTool({name:"get-account-summaries",arguments:{}});return mt(M(A))},e[24]=f,e[25]=R):R=e[25];let I;e[26]!==R||e[27]!==_||e[28]!==T?(I={queryKey:_,enabled:T,queryFn:R},e[26]=R,e[27]=_,e[28]=T,e[29]=I):I=e[29];const O=re(I);let S;e[30]!==n||e[31]!==o?(S=D.commerceDiscoveryGscSites(o,n),e[30]=n,e[31]=o,e[32]=S):S=e[32];const P=t.bindingType==="google-search-console";let $;e[33]!==f?($=async()=>{const A=await f.callTool({name:"list_sites",arguments:{}});return qe(M(A))},e[33]=f,e[34]=$):$=e[34];let F;e[35]!==S||e[36]!==P||e[37]!==$?(F={queryKey:S,enabled:P,queryFn:$},e[35]=S,e[36]=P,e[37]=$,e[38]=F):F=e[38];const W=re(F);let G;e[39]!==n||e[40]!==C||e[41]!==m?(G=async A=>{const ee=xt(C,A),te=await m.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:n,data:{configuration_state:ee}}});return M(te)},e[39]=n,e[40]=C,e[41]=m,e[42]=G):G=e[42];let K;e[43]!==n||e[44]!==o||e[45]!==r?(K=async()=>{x(null),await r.invalidateQueries({queryKey:D.commerceDiscoveryCompanionConfig(o,n)})},e[43]=n,e[44]=o,e[45]=r,e[46]=K):K=e[46];let U;e[47]===Symbol.for("react.memo_cache_sentinel")?(U=A=>x(A instanceof Error?A.message:String(A)),e[47]=U):U=e[47];let Y;e[48]!==G||e[49]!==K?(Y={mutationFn:G,onSuccess:K,onError:U},e[48]=G,e[49]=K,e[50]=Y):Y=e[50];const k=be(Y);let Z;e[51]!==k?(Z=async A=>{try{return await k.mutateAsync(A),!0}catch{return!1}},e[51]=k,e[52]=Z):Z=e[52];const B=Z;let J;e[53]!==N||e[54]!==n||e[55]!==f||e[56]!==t||e[57]!==o||e[58]!==a||e[59]!==B||e[60]!==k.isPending||e[61]!==l||e[62]!==c.isPending?(J=A=>{!A||p.current||!t.autoResolve||N||c.isPending||k.isPending||(p.current=!0,t.autoResolve({client:f,ctx:{siteHost:l,connectionId:n,orgId:o,orgSlug:a}}).then(ee=>{ee&&B(ee)}).catch(It))},e[53]=N,e[54]=n,e[55]=f,e[56]=t,e[57]=o,e[58]=a,e[59]=B,e[60]=k.isPending,e[61]=l,e[62]=c.isPending,e[63]=J):J=e[63];const Q=J;let q;e[64]!==O.data?(q=O.data??[],e[64]=O.data,e[65]=q):q=e[65];const X=q,E=!!O.error;let L;e[66]!==W.data?(L=W.data??[],e[66]=W.data,e[67]=L):L=e[67];const oe=L,V=c.isPending||t.bindingType==="google-analytics"&&O.isPending||t.bindingType==="google-search-console"&&W.isPending;let H;return e[68]!==N||e[69]!==C||e[70]!==u||e[71]!==Q||e[72]!==B||e[73]!==k.isPending||e[74]!==X||e[75]!==E||e[76]!==oe||e[77]!==V?(H={configured:N,currentValue:C,gaGroups:X,gaError:E,verifiedSites:oe,saving:k.isPending,error:u,save:B,maybeAutoResolve:Q,isLoading:V},e[68]=N,e[69]=C,e[70]=u,e[71]=Q,e[72]=B,e[73]=k.isPending,e[74]=X,e[75]=E,e[76]=oe,e[77]=V,e[78]=H):H=e[78],H}function It(){}function Tt(i){const e=w.c(22),{entry:t,card:n,orgId:o,orgSlug:a,siteHost:l}=i;let r;e[0]!==n.linkedConnectionId||e[1]!==t||e[2]!==o||e[3]!==a||e[4]!==l?(r={entry:t,connectionId:n.linkedConnectionId,orgId:o,orgSlug:a,siteHost:l},e[0]=n.linkedConnectionId,e[1]=t,e[2]=o,e[3]=a,e[4]=l,e[5]=r):r=e[5];const{configured:d,currentValue:m,gaGroups:g,gaError:f,verifiedSites:u,saving:x,error:p,save:h,maybeAutoResolve:y,isLoading:v}=_t(r),[c,j]=z.useState(!1),{Renderer:C}=t;let b;e[6]!==C||e[7]!==d||e[8]!==m||e[9]!==c||e[10]!==t.anchorField||e[11]!==p||e[12]!==f||e[13]!==g||e[14]!==v||e[15]!==h||e[16]!==x||e[17]!==u?(b=v?s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(le,{size:14,className:"animate-spin"})," Loading setup…"]}):d&&!c?s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ne,{size:14,className:"shrink-0 text-blue-500"}),s.jsx("p",{className:"flex-1 truncate text-sm text-muted-foreground",children:m[t.anchorField]??""}),s.jsx("button",{type:"button",className:"text-sm text-muted-foreground underline underline-offset-2",onClick:()=>j(!0),children:"Edit"})]}):s.jsx(C,{currentValue:m,gaGroups:g,gaError:f,verifiedSites:u,saving:x,error:p,onSave:_=>{h(_).then(T=>{T&&j(!1)})}}),e[6]=C,e[7]=d,e[8]=m,e[9]=c,e[10]=t.anchorField,e[11]=p,e[12]=f,e[13]=g,e[14]=v,e[15]=h,e[16]=x,e[17]=u,e[18]=b):b=e[18];let N;return e[19]!==y||e[20]!==b?(N=s.jsx("div",{ref:y,className:"px-1 pt-1",children:b}),e[19]=y,e[20]=b,e[21]=N):N=e[21],N}function Et(i){const e=w.c(39),{currentValue:t,gaGroups:n,gaError:o,saving:a,error:l,onSave:r}=i,d=t.propertyId??"";let m;e[0]!==n?(m=ft(n),e[0]=n,e[1]=m):m=e[1];const g=m,f=d||(g.length===1?g[0].value:""),[u,x]=z.useState(f);if(o||n.length===0){let _;e[2]===Symbol.for("react.memo_cache_sentinel")?(_=$=>x($.target.value),e[2]=_):_=e[2];let T;e[3]!==u?(T=s.jsx(de,{value:u,onChange:_,placeholder:"properties/1234567",className:"flex-1"}),e[3]=u,e[4]=T):T=e[4];const R=!u;let I;e[5]!==r||e[6]!==u?(I=()=>r({propertyId:u}),e[5]=r,e[6]=u,e[7]=I):I=e[7];let O;e[8]!==a||e[9]!==R||e[10]!==I?(O=s.jsx(Oe,{saving:a,disabled:R,onClick:I}),e[8]=a,e[9]=R,e[10]=I,e[11]=O):O=e[11];let S;e[12]!==T||e[13]!==O?(S=s.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[T,O]}),e[12]=T,e[13]=O,e[14]=S):S=e[14];let P;return e[15]!==l||e[16]!==S?(P=s.jsx(Re,{error:l,children:S}),e[15]=l,e[16]=S,e[17]=P):P=e[17],P}let p;e[18]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(De,{size:"sm",className:"flex-1",children:s.jsx(Me,{placeholder:"Select a property..."})}),e[18]=p):p=e[18];let h;e[19]!==n?(h=n.map(wt),e[19]=n,e[20]=h):h=e[20];let y;e[21]!==h?(y=s.jsx(Fe,{children:h}),e[21]=h,e[22]=y):y=e[22];let v;e[23]!==u||e[24]!==y?(v=s.jsxs(Ke,{value:u,onValueChange:x,children:[p,y]}),e[23]=u,e[24]=y,e[25]=v):v=e[25];const c=!u;let j;e[26]!==r||e[27]!==u?(j=()=>r({propertyId:u}),e[26]=r,e[27]=u,e[28]=j):j=e[28];let C;e[29]!==a||e[30]!==c||e[31]!==j?(C=s.jsx(Oe,{saving:a,disabled:c,onClick:j}),e[29]=a,e[30]=c,e[31]=j,e[32]=C):C=e[32];let b;e[33]!==v||e[34]!==C?(b=s.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[v,C]}),e[33]=v,e[34]=C,e[35]=b):b=e[35];let N;return e[36]!==l||e[37]!==b?(N=s.jsx(Re,{error:l,children:b}),e[36]=l,e[37]=b,e[38]=N):N=e[38],N}function wt(i){return s.jsxs(ot,{children:[s.jsx(rt,{children:i.account}),i.options.map(Rt)]},i.account)}function Rt(i){return s.jsx($e,{value:i.value,children:i.label},i.value)}function Re(i){const e=w.c(5),{children:t,error:n}=i;let o;e[0]!==n?(o=n&&s.jsx("p",{className:"text-xs text-destructive",role:"alert",children:n}),e[0]=n,e[1]=o):o=e[1];let a;return e[2]!==t||e[3]!==o?(a=s.jsxs("div",{className:"flex flex-col gap-1",children:[t,o]}),e[2]=t,e[3]=o,e[4]=a):a=e[4],a}function Oe(i){const e=w.c(6),{saving:t,disabled:n,onClick:o}=i,a=n||t;let l;e[0]!==t?(l=t?s.jsx(le,{size:16,className:"animate-spin"}):"Save",e[0]=t,e[1]=l):l=e[1];let r;return e[2]!==o||e[3]!==a||e[4]!==l?(r=s.jsx(ie,{type:"button",size:"sm",variant:"outline",disabled:a,onClick:o,children:l}),e[2]=o,e[3]=a,e[4]=l,e[5]=r):r=e[5],r}function Ot(i){const e=w.c(20),{currentValue:t,verifiedSites:n,saving:o,error:a,onSave:l}=i,r=t.siteUrl??"",[d,m]=z.useState(r);let g;e[0]!==d||e[1]!==n?(g=n.length>0?s.jsxs(Ke,{value:d,onValueChange:m,children:[s.jsx(De,{size:"sm",className:"flex-1",children:s.jsx(Me,{placeholder:"Select a verified site..."})}),s.jsx(Fe,{children:n.map(kt)})]}):s.jsx(de,{value:d,onChange:c=>m(c.target.value),placeholder:"sc-domain:example.com",className:"flex-1"}),e[0]=d,e[1]=n,e[2]=g):g=e[2];const f=!d||o;let u;e[3]!==l||e[4]!==d?(u=()=>l({siteUrl:d}),e[3]=l,e[4]=d,e[5]=u):u=e[5];let x;e[6]!==o?(x=o?s.jsx(le,{size:16,className:"animate-spin"}):"Save",e[6]=o,e[7]=x):x=e[7];let p;e[8]!==f||e[9]!==u||e[10]!==x?(p=s.jsx(ie,{type:"button",size:"sm",variant:"outline",disabled:f,onClick:u,children:x}),e[8]=f,e[9]=u,e[10]=x,e[11]=p):p=e[11];let h;e[12]!==g||e[13]!==p?(h=s.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[g,p]}),e[12]=g,e[13]=p,e[14]=h):h=e[14];let y;e[15]!==a?(y=a&&s.jsx("p",{className:"text-xs text-destructive",role:"alert",children:a}),e[15]=a,e[16]=y):y=e[16];let v;return e[17]!==h||e[18]!==y?(v=s.jsxs("div",{className:"flex flex-col gap-1",children:[h,y]}),e[17]=h,e[18]=y,e[19]=v):v=e[19],v}function kt(i){return s.jsx($e,{value:i.siteUrl,children:i.siteUrl},i.siteUrl)}function zt(i){const e=w.c(28),{currentValue:t,saving:n,error:o,onSave:a}=i,[l,r]=z.useState(t.accountName??""),[d,m]=z.useState(t.appKey??""),[g,f]=z.useState(t.appToken??"");let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=_=>r(_.target.value),e[0]=u):u=e[0];let x;e[1]!==l?(x=s.jsx(de,{value:l,onChange:u,placeholder:"Account name"}),e[1]=l,e[2]=x):x=e[2];let p;e[3]===Symbol.for("react.memo_cache_sentinel")?(p=_=>m(_.target.value),e[3]=p):p=e[3];let h;e[4]!==d?(h=s.jsx(de,{type:"password",value:d,onChange:p,placeholder:"App key"}),e[4]=d,e[5]=h):h=e[5];let y;e[6]===Symbol.for("react.memo_cache_sentinel")?(y=_=>f(_.target.value),e[6]=y):y=e[6];let v;e[7]!==g?(v=s.jsx(de,{type:"password",value:g,onChange:y,placeholder:"App token"}),e[7]=g,e[8]=v):v=e[8];let c;e[9]!==l||e[10]!==d||e[11]!==g||e[12]!==a?(c=()=>a({accountName:l,appKey:d,appToken:g}),e[9]=l,e[10]=d,e[11]=g,e[12]=a,e[13]=c):c=e[13];let j;e[14]!==n?(j=n?s.jsx(le,{size:16,className:"animate-spin"}):"Save",e[14]=n,e[15]=j):j=e[15];let C;e[16]!==n||e[17]!==c||e[18]!==j?(C=s.jsx("div",{className:"flex items-center justify-end",children:s.jsx(ie,{type:"button",size:"sm",variant:"outline",disabled:n,onClick:c,children:j})}),e[16]=n,e[17]=c,e[18]=j,e[19]=C):C=e[19];let b;e[20]!==o?(b=o&&s.jsx("p",{className:"text-xs text-destructive",role:"alert",children:o}),e[20]=o,e[21]=b):b=e[21];let N;return e[22]!==b||e[23]!==x||e[24]!==h||e[25]!==v||e[26]!==C?(N=s.jsxs("div",{className:"flex flex-col gap-2",children:[x,h,v,C,b]}),e[22]=b,e[23]=x,e[24]=h,e[25]=v,e[26]=C,e[27]=N):N=e[27],N}const At={"google-analytics":{bindingType:"google-analytics",anchorField:"propertyId",Renderer:Et},"google-search-console":{bindingType:"google-search-console",anchorField:"siteUrl",autoResolve:async({client:i,ctx:e})=>{const t=await i.callTool({name:"list_sites",arguments:{}}),{sites:n}=M(t),o=gt(e.siteHost,qe({sites:n}));return o?{siteUrl:o}:null},Renderer:Ot},vtex:{bindingType:"vtex",anchorField:"accountName",Renderer:zt}};function Lt(i){return At[i]}function Pt(){const i=w.c(3);let e;i[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"size-12 shrink-0 animate-pulse rounded-lg bg-muted/60"}),s.jsx("div",{className:"h-4 w-32 animate-pulse rounded bg-muted/60"}),s.jsx("div",{className:"ml-auto h-8 w-20 animate-pulse rounded-lg bg-muted/60"})]}),i[0]=e):e=i[0];let t;i[1]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx("div",{className:"p-1",children:s.jsx("div",{className:"h-5 w-40 animate-pulse rounded bg-muted/60"})}),i[1]=t):t=i[1];let n;return i[2]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"flex flex-col gap-2 rounded-2xl border border-border bg-card p-4",children:[e,s.jsxs("div",{className:"flex flex-col gap-1 px-1 py-2",children:[t,s.jsx("div",{className:"p-1",children:s.jsx("div",{className:"h-5 w-56 animate-pulse rounded bg-muted/60"})})]})]}),i[2]=n):n=i[2],n}function je(i){const e=w.c(3),{children:t}=i;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Ne,{size:14,className:"shrink-0 text-blue-500"}),e[0]=n):n=e[0];let o;return e[1]!==t?(o=s.jsxs("div",{className:"flex items-center gap-2 p-1",children:[n,s.jsx("p",{className:"text-sm text-foreground",children:t})]}),e[1]=t,e[2]=o):o=e[2],o}function Ut(i){const e=w.c(42),{card:t,connecting:n,disabled:o,onConnect:a,orgId:l,orgSlug:r,siteHost:d}=i;let m;e[0]!==t.bindingType?(m=Lt(t.bindingType),e[0]=t.bindingType,e[1]=m):m=e[1];const g=m;let f;e[2]!==t.icon||e[3]!==t.title?(f=s.jsx(tt,{icon:t.icon,name:t.title,size:"md",fit:"contain",className:"p-2"}),e[2]=t.icon,e[3]=t.title,e[4]=f):f=e[4];let u;e[5]!==t.title?(u=s.jsx("p",{className:"flex-1 text-sm text-foreground",children:t.title}),e[5]=t.title,e[6]=u):u=e[6];let x;e[7]!==t.satisfied||e[8]!==t.title||e[9]!==n||e[10]!==o||e[11]!==a?(x=t.satisfied?s.jsxs("div",{className:"flex h-8 items-center gap-2 px-3 text-sm text-muted-foreground",children:[s.jsx(Ne,{size:16})," Connected"]}):s.jsx(ie,{type:"button",variant:"outline",size:"sm",disabled:o||n,onClick:a,"aria-label":`Connect ${t.title}`,children:n?s.jsx(le,{size:16,className:"animate-spin"}):"Connect"}),e[7]=t.satisfied,e[8]=t.title,e[9]=n,e[10]=o,e[11]=a,e[12]=x):x=e[12];let p;e[13]!==f||e[14]!==u||e[15]!==x?(p=s.jsxs("div",{className:"flex items-center gap-2",children:[f,u,x]}),e[13]=f,e[14]=u,e[15]=x,e[16]=p):p=e[16];let h;e[17]!==t.checks?(h=t.checks!==null&&s.jsxs(je,{children:["+ ",t.checks," checks"]}),e[17]=t.checks,e[18]=h):h=e[18];let y;e[19]!==t.headline?(y=t.headline&&s.jsx(je,{children:t.headline}),e[19]=t.headline,e[20]=y):y=e[20];let v;e[21]!==t.bullets?(v=t.bullets.map($t),e[21]=t.bullets,e[22]=v):v=e[22];let c;e[23]!==t.candidateConnectionId||e[24]!==t.satisfied||e[25]!==t.title?(c=!t.satisfied&&t.candidateConnectionId&&s.jsxs("p",{className:"px-1 text-xs text-muted-foreground",children:["Using your existing ",t.title]}),e[23]=t.candidateConnectionId,e[24]=t.satisfied,e[25]=t.title,e[26]=c):c=e[26];let j;e[27]!==h||e[28]!==y||e[29]!==v||e[30]!==c?(j=s.jsxs("div",{className:"flex flex-col gap-1 px-1 py-2",children:[h,y,v,c]}),e[27]=h,e[28]=y,e[29]=v,e[30]=c,e[31]=j):j=e[31];let C;e[32]!==t||e[33]!==g||e[34]!==l||e[35]!==r||e[36]!==d?(C=t.satisfied&&t.linkedConnectionId&&g&&s.jsx(Tt,{entry:g,card:{...t,linkedConnectionId:t.linkedConnectionId},orgId:l,orgSlug:r,siteHost:d}),e[32]=t,e[33]=g,e[34]=l,e[35]=r,e[36]=d,e[37]=C):C=e[37];let b;return e[38]!==j||e[39]!==C||e[40]!==p?(b=s.jsxs("div",{className:"flex flex-col gap-2 rounded-2xl border border-border bg-card p-4",children:[p,j,C]}),e[38]=j,e[39]=C,e[40]=p,e[41]=b):b=e[41],b}function $t(i){return s.jsx(je,{children:i},i)}const _e={vtex:{registryAppId:"deco/vtex",checks:49,headline:"Out-of-stock, thin PDPs & attribute gaps across every SKU"},"google-analytics":{registryAppId:"deco/google-analytics",checks:49,headline:"Where revenue leaks between product view and checkout"},"google-search-console":{registryAppId:"deco/google-search-console",checks:49,headline:"Search visibility & indexing gaps across your catalog"}};function Dt(i){const e=w.c(25),{selfClient:t,org:n,cdConnectionId:o}=i;let a;e[0]!==o||e[1]!==n.id||e[2]!==n.slug?(a={connectionId:o,orgId:n.id,orgSlug:n.slug},e[0]=o,e[1]=n.id,e[2]=n.slug,e[3]=a):a=e[3];const l=ue(a);let r;e[4]!==o||e[5]!==n.id?(r=D.commerceDiscoveryCompanionSchema(n.id,o),e[4]=o,e[5]=n.id,e[6]=r):r=e[6];let d;e[7]!==l?(d=async()=>{const S=await l.callTool({name:"MCP_CONFIGURATION",arguments:{}});return M(S)},e[7]=l,e[8]=d):d=e[8];let m;e[9]!==r||e[10]!==d?(m={queryKey:r,queryFn:d},e[9]=r,e[10]=d,e[11]=m):m=e[11];const g=re(m),f=yt(g.data?.stateSchema??{properties:{}}),u=f.map(Ht),x=f.map(qt).filter(Kt),p=f.filter(Ft).map(Mt),h=[...x,...p].sort().join(",");let y;e[12]!==o||e[13]!==n.id?(y=D.commerceDiscoveryConnection(n.id,o),e[12]=o,e[13]=n.id,e[14]=y):y=e[14];let v;e[15]!==o||e[16]!==t?(v=async()=>{const S=await t.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:o}});return M(S)},e[15]=o,e[16]=t,e[17]=v):v=e[17];let c;e[18]!==y||e[19]!==v?(c={queryKey:y,queryFn:v},e[18]=y,e[19]=v,e[20]=c):c=e[20];const j=re(c),C=re({queryKey:D.commerceDiscoveryCompanionConnections(n.id),enabled:f.length>0,queryFn:async()=>{const S=await t.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{where:{operator:"or",conditions:[{field:["app_name"],operator:"in",value:u},{field:["app_id"],operator:"in",value:x}]},limit:1e3}});return M(S)}}),b=re({queryKey:D.commerceDiscoveryCompanionRegistry(n.id,h),enabled:f.length>0,queryFn:async()=>{const S=vt(x,p),P=await st(Pe.REGISTRY(n.id),n.id,n.slug,"COLLECTION_REGISTRY_APP_LIST",{...S?{where:S}:{},limit:1e3});return M(P)}}),N={},_={};for(const S of b.data?.items??[])N[S.id]=S,S.server?.name&&(_[S.server.name]=S);const T=Nt({requirements:f,itemsById:N,itemsByName:_,connections:C.data?.items??[],configurationState:j.data?.item?.configuration_state??null,curated:_e}),R=g.isPending||j.isPending||f.length>0&&(C.isPending||b.isPending),I=g.error??j.error??C.error??b.error??null;let O;return e[21]!==T||e[22]!==I||e[23]!==R?(O={cards:T,isLoading:R,error:I},e[21]=T,e[22]=I,e[23]=R,e[24]=O):O=e[24],O}function Mt(i){return i.bindingType}function Ft(i){return!_e[i.bindingType]}function Kt(i){return!!i}function qt(i){return _e[i.bindingType]?.registryAppId}function Ht(i){return i.bindingType}function Gt({selfClient:i,org:e,userId:t,cdConnectionId:n}){const o=ke(),[a,l]=z.useState(null),[r,d]=z.useState(null),m=async(f,u)=>{const x=await i.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:f,data:u}});return M(x)};async function g(f){l(f.fieldKey),d(null);try{let u=f.candidateConnectionId;if(!u){const c=it(f.registryItem,e.id,t,{remoteIndex:0}),j=c.connection_type==="STDIO",C=!!c.connection_url,b=j&&c.connection_headers&&typeof c.connection_headers=="object"&&"command"in c.connection_headers;if(!C&&!b){d(`${f.title} cannot be connected: no connection method available`);return}const N=await i.callTool({name:"COLLECTION_CONNECTIONS_CREATE",arguments:{data:c}});u=M(N).item.id}const x=u,p=await lt({connectionId:x,orgId:e.id,orgSlug:e.slug,persistFallback:c=>m(x,{connection_token:c}).then(()=>{})});if(!p.ok){d(`Couldn't sign in to ${f.title}: ${p.error}`);return}const h=await i.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:n}}),y=M(h).item?.configuration_state??null,v=Ct(y,f.fieldKey,f.bindingType,x);await m(n,{configuration_state:v}),await o.invalidateQueries({queryKey:D.commerceDiscoveryConnection(e.id,n)}),await o.invalidateQueries({queryKey:D.commerceDiscoveryCompanionConnections(e.id)})}catch(u){d(u instanceof Error?u.message:String(u))}finally{l(null)}}return{connect:g,connectingFieldKey:a,error:r}}function Bt(i){const e=w.c(33),{org:t,cdConnectionId:n,reportDisabled:o,onOpenReport:a}=i,{data:l}=ze.useSession(),r=l?.user?.id??"",d=Ie();let m;e[0]!==t.id||e[1]!==t.slug?(m={connectionId:Se,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=m):m=e[2];const g=ue(m);let f;e[3]!==n||e[4]!==t||e[5]!==g?(f={selfClient:g,org:t,cdConnectionId:n},e[3]=n,e[4]=t,e[5]=g,e[6]=f):f=e[6];const{cards:u,isLoading:x,error:p}=Dt(f);let h;e[7]!==n||e[8]!==t||e[9]!==g||e[10]!==r?(h={selfClient:g,org:t,userId:r,cdConnectionId:n},e[7]=n,e[8]=t,e[9]=g,e[10]=r,e[11]=h):h=e[11];const{connect:y,connectingFieldKey:v,error:c}=Gt(h);let j;e[12]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Ue,{size:16}),e[12]=j):j=e[12];let C;e[13]!==a||e[14]!==o?(C=s.jsxs(ie,{type:"button",size:"xl",className:"w-full",onClick:a,disabled:o,children:["See full report",j]}),e[13]=a,e[14]=o,e[15]=C):C=e[15];const b=C;if(!x&&!p&&u.length===0){let I;return e[16]!==b?(I=s.jsx("div",{className:"flex min-h-0 flex-1 flex-col justify-end gap-10 md:grid md:flex-none",children:b}),e[16]=b,e[17]=I):I=e[17],I}const N=v!==null;let _;e[18]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsxs("div",{className:"grid gap-1.5",children:[s.jsx("p",{className:"text-2xl font-medium text-foreground",children:"Unlock your full diagnostic"}),s.jsx("p",{className:"text-base text-muted-foreground",children:"Connect your tools to unlock 100+ checks across your funnel."})]}),e[18]=_):_=e[18];let T;e[19]!==N||e[20]!==u||e[21]!==y||e[22]!==c||e[23]!==v||e[24]!==p||e[25]!==x||e[26]!==t.id||e[27]!==t.slug||e[28]!==d?(T=p?s.jsxs("div",{role:"alert",className:"rounded-2xl border border-border bg-card p-4",children:[s.jsx("p",{className:"text-sm text-foreground",children:"Couldn't load companion integrations."}),s.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Reload the page to try again."})]}):x?s.jsx("div",{className:"flex min-h-0 flex-1 flex-col gap-4",children:[0,1,2].map(Qt)}):s.jsx(Ce,{wrapperClassName:"flex min-h-0 flex-1 flex-col md:block",className:"-mx-1 min-h-0 flex-1 overflow-y-auto px-1 md:max-h-[45vh] md:flex-none",children:s.jsxs("div",{className:"grid gap-4",children:[c&&s.jsx("p",{role:"alert",className:"text-sm text-destructive",children:c}),u.map(I=>s.jsx(Ut,{card:I,connecting:v===I.fieldKey,disabled:N&&v!==I.fieldKey,onConnect:()=>{y(I)},orgId:t.id,orgSlug:t.slug,siteHost:d},I.fieldKey))]})}),e[19]=N,e[20]=u,e[21]=y,e[22]=c,e[23]=v,e[24]=p,e[25]=x,e[26]=t.id,e[27]=t.slug,e[28]=d,e[29]=T):T=e[29];let R;return e[30]!==b||e[31]!==T?(R=s.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-6 md:grid md:flex-none",children:[_,T,b]}),e[30]=b,e[31]=T,e[32]=R):R=e[32],R}function Qt(i){return s.jsx(Pt,{},i)}function He(i){const e=w.c(10),{host:t}=i,n=`https://www.google.com/s2/favicons?domain=${t}&sz=128`;let o,a,l;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-7 w-7 dark:hidden"}),a=s.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-7 w-7 hidden dark:block"}),l=s.jsx("div",{className:"h-6 w-px rotate-12 bg-border","aria-hidden":"true"}),e[0]=o,e[1]=a,e[2]=l):(o=e[0],a=e[1],l=e[2]);let r;e[3]!==n?(r=s.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-border bg-white",children:s.jsx("img",{src:n,alt:"",className:"h-5 w-5",loading:"lazy"})}),e[3]=n,e[4]=r):r=e[4];let d;e[5]!==t?(d=s.jsx("span",{className:"text-lg font-medium text-foreground",children:t}),e[5]=t,e[6]=d):d=e[6];let m;return e[7]!==r||e[8]!==d?(m=s.jsxs("div",{className:"flex items-center gap-3",children:[o,a,l,r,d]}),e[7]=r,e[8]=d,e[9]=m):m=e[9],m}function ds(){const i=w.c(1);let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Wt,{}),i[0]=e):e=i[0],e}const Ge=z.createContext(null),Ie=()=>z.useContext(Ge);function Vt(i){if(!i)return null;const e=ve(i);return e.ok?new URL(e.value).hostname:null}function Wt(){const i=w.c(9);let e;i[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/commerce-onboarding"},i[0]=e):e=i[0];const t=Be(e),{org:n,siteUrl:o}=t;let a;i[1]!==o?(a=Vt(o),i[1]=o,i[2]=a):a=i[2];const l=a;let r;i[3]!==n||i[4]!==o?(r=s.jsx(Yt,{requestedOrgSlug:n,siteUrl:o}),i[3]=n,i[4]=o,i[5]=r):r=i[5];let d;return i[6]!==l||i[7]!==r?(d=s.jsx(Ge.Provider,{value:l,children:r}),i[6]=l,i[7]=r,i[8]=d):d=i[8],d}function Yt(i){const e=w.c(8),{requestedOrgSlug:t,siteUrl:n}=i,{data:o,isPending:a}=ze.useSession(),l=Ie();if(a){let d;return e[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(ne,{children:s.jsx(me,{label:"Preparing commerce onboarding..."})}),e[0]=d):d=e[0],d}if(!o){const d=typeof window>"u"?"/commerce-onboarding":`${window.location.pathname}${window.location.search}`;let m;e[1]!==l?(m=l?s.jsx(He,{host:l}):void 0,e[1]=l,e[2]=m):m=e[2];let g;return e[3]!==m?(g=s.jsx(ne,{children:s.jsx(Ze,{callbackUrl:d,allowAutoLogin:!1,title:"Unlock your full diagnostic",subtitle:null,brand:m})}),e[3]=m,e[4]=g):g=e[4],g}let r;return e[5]!==t||e[6]!==n?(r=s.jsx(Zt,{requestedOrgSlug:t,siteUrl:n}),e[5]=t,e[6]=n,e[7]=r):r=e[7],r}function Zt(i){const e=w.c(40),{requestedOrgSlug:t,siteUrl:n}=i,o=Ae(),a=Qe(),[l,r]=z.useState(null),[d,m]=z.useState(null),g=a.data?.map(Xt)??[];let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f={mutationFn:Jt,retry:!1,onSuccess:c=>{m(c)}},e[0]=f):f=e[0];const u=be(f);if(a.isPending){let c;return e[1]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(ne,{children:s.jsx(me,{label:"Preparing commerce onboarding..."})}),e[1]=c):c=e[1],c}if(a.error){let c;return e[2]!==a?(c=s.jsx(ge,{title:"We could not load your organizations",description:"Retry to continue commerce setup from this page.",actionLabel:"Retry",onRetry:()=>a.refetch()}),e[2]=a,e[3]=c):c=e[3],c}const x=t?g.find(c=>c.slug===t):null;if(x){let c;return e[4]!==x||e[5]!==n?(c=s.jsx(pe,{org:x,initialSiteUrl:n}),e[4]=x,e[5]=n,e[6]=c):c=e[6],c}if(t){let c;return e[7]!==a?(c=s.jsx(ge,{title:"Organization not found",description:"We could not find that organization for your account.",actionLabel:"Retry",onRetry:()=>a.refetch()}),e[7]=a,e[8]=c):c=e[8],c}if(l){let c;return e[9]!==l||e[10]!==n?(c=s.jsx(pe,{org:l,initialSiteUrl:n}),e[9]=l,e[10]=n,e[11]=c):c=e[11],c}if(g.length===1&&g[0]){let c;return e[12]!==g[0]||e[13]!==n?(c=s.jsx(pe,{org:g[0],initialSiteUrl:n}),e[12]=g[0],e[13]=n,e[14]=c):c=e[14],c}if(g.length>1){let c;e[15]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(se,{title:"Choose an organization",description:"Select where commerce diagnostics should continue."}),e[15]=c):c=e[15];let j;e[16]===Symbol.for("react.memo_cache_sentinel")?(j=b=>r(b),e[16]=j):j=e[16];let C;return e[17]!==g?(C=s.jsx(ne,{children:s.jsxs("div",{className:"grid gap-10",children:[c,s.jsx(Ce,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:s.jsx(we,{organizations:g,selectLabel:"Continue",onSelected:j})})]})}),e[17]=g,e[18]=C):C=e[18],C}if(!d){let c;e[19]!==u?(c=()=>{u.reset(),u.mutate()},e[19]=u,e[20]=c):c=e[20];let j;return e[21]!==u||e[22]!==c?(j=s.jsx(en,{mutation:u,onRetry:c}),e[21]=u,e[22]=c,e[23]=j):j=e[23],j}const p=d;if(p?.success&&(p.status==="created"||p.status==="joined"||p.status==="already_has_organization")&&p.organization){let c;return e[24]!==p.organization||e[25]!==n?(c=s.jsx(pe,{org:p.organization,initialSiteUrl:n}),e[24]=p.organization,e[25]=n,e[26]=c):c=e[26],c}if(p?.status==="ambiguous"&&p.organizations&&p.organizations.length>0){let c;e[27]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(se,{title:"Choose an organization",description:"Your email can access more than one organization. Choose where commerce setup should continue."}),e[27]=c):c=e[27];const j=p.domain??void 0;let C;e[28]!==o||e[29]!==n?(C=(N,_)=>{Le(),r({...N,slug:_}),o({to:"/commerce-onboarding",search:{org:_,siteUrl:n}})},e[28]=o,e[29]=n,e[30]=C):C=e[30];let b;return e[31]!==p.organizations||e[32]!==j||e[33]!==C?(b=s.jsx(ne,{children:s.jsxs("div",{className:"grid gap-10",children:[c,s.jsx(Ce,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:s.jsx(we,{organizations:p.organizations,domain:j,onJoined:C})})]})}),e[31]=p.organizations,e[32]=j,e[33]=C,e[34]=b):b=e[34],b}const h=p?.error??"We could not determine a commerce organization for this account.";let y;e[35]!==u?(y=()=>{m(null),u.reset()},e[35]=u,e[36]=y):y=e[36];let v;return e[37]!==h||e[38]!==y?(v=s.jsx(ge,{title:"Commerce onboarding needs support",description:h,actionLabel:"Try again",onRetry:y}),e[37]=h,e[38]=y,e[39]=v):v=e[39],v}async function Jt(){const e=await(await fetch("/api/auth/custom/ensure-organization",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"}})).json();return e.success&&(e.status==="created"||e.status==="joined"||e.status==="already_has_organization")&&e.organization&&Le(),e}function Xt(i){return{id:i.id,name:i.name,slug:i.slug,logo:i.logo??null}}function en(i){const e=w.c(7),{mutation:t,onRetry:n}=i,o=z.useRef(!1);let a;e[0]!==t?(a=m=>{!m||o.current||(o.current=!0,t.mutate())},e[0]=t,e[1]=a):a=e[1];const l=a;if(t.error){let m;return e[2]!==n?(m=s.jsx(ge,{title:"Commerce onboarding is unavailable",description:"We could not prepare an organization for commerce setup. Retry from this page or contact support.",actionLabel:"Retry",onRetry:n}),e[2]=n,e[3]=m):m=e[3],m}let r;e[4]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(me,{label:"Preparing your commerce workspace..."}),e[4]=r):r=e[4];let d;return e[5]!==l?(d=s.jsx(ne,{children:s.jsx("div",{ref:l,children:r})}),e[5]=l,e[6]=d):d=e[6],d}function se(i){const e=w.c(8),{title:t,description:n}=i,o=Ie();let a;e[0]!==o?(a=o?s.jsx(He,{host:o}):s.jsxs("div",{children:[s.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),s.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),e[0]=o,e[1]=a):a=e[1];let l;e[2]!==n||e[3]!==t?(l=(t||n)&&s.jsxs("div",{className:"space-y-2",children:[t&&s.jsx("h1",{className:"text-2xl font-medium leading-8",children:t}),n&&s.jsx("p",{className:"text-base text-muted-foreground leading-6",children:n})]}),e[2]=n,e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==a||e[6]!==l?(r=s.jsxs("div",{className:"grid gap-10",children:[a,l]}),e[5]=a,e[6]=l,e[7]=r):r=e[7],r}function me(i){const e=w.c(3),{label:t}=i;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(le,{size:14,className:"animate-spin text-muted-foreground"}),e[0]=n):n=e[0];let o;return e[1]!==t?(o=s.jsxs("div",{className:"flex items-center gap-2 py-4",role:"status","aria-live":"polite",children:[n,s.jsx("span",{className:"text-sm text-muted-foreground",children:t})]}),e[1]=t,e[2]=o):o=e[2],o}function ge(i){const e=w.c(9),{title:t,description:n,actionLabel:o,onRetry:a}=i;let l;e[0]!==n||e[1]!==t?(l=s.jsx(se,{title:t,description:n}),e[0]=n,e[1]=t,e[2]=l):l=e[2];let r;e[3]!==o||e[4]!==a?(r=s.jsx(ie,{type:"button",size:"xl",className:"w-full",onClick:a,children:o}),e[3]=o,e[4]=a,e[5]=r):r=e[5];let d;return e[6]!==l||e[7]!==r?(d=s.jsx(ne,{children:s.jsxs("div",{className:"grid gap-10",children:[l,r]})}),e[6]=l,e[7]=r,e[8]=d):d=e[8],d}function tn(i){return i.content?.find(e=>e.text)?.text??"Commerce Discovery setup failed."}function xe(i){const e=i;if(e.isError)throw new Error(tn(e));return e.structuredContent??i}function pe(i){const e=w.c(3),{org:t,initialSiteUrl:n}=i;let o;return e[0]!==n||e[1]!==t?(o=s.jsx(ne,{children:s.jsx(Ve,{children:a=>{const{reset:l}=a;return s.jsx(We,{fallback:r=>{const{error:d,resetError:m}=r;return s.jsx(nn,{orgName:t.name,message:d instanceof Error?d.message:"We could not check Commerce Discovery setup.",onRetry:()=>{l(),m()}})},children:s.jsx(z.Suspense,{fallback:s.jsx(me,{label:"Connecting workspace..."}),children:s.jsx(sn,{org:t,initialSiteUrl:n},`${t.id}:${n??""}`)})})}})}),e[0]=n,e[1]=t,e[2]=o):o=e[2],o}function nn(i){const e=w.c(10),{orgName:t,message:n,onRetry:o}=i,a=`Commerce setup will continue for ${t}.`;let l;e[0]!==a?(l=s.jsx(se,{title:"Commerce diagnostics",description:a}),e[0]=a,e[1]=l):l=e[1];let r;e[2]!==n?(r=s.jsx(he,{message:n}),e[2]=n,e[3]=r):r=e[3];let d;e[4]!==o?(d=s.jsx(ie,{type:"button",size:"xl",className:"w-full",onClick:o,children:"Retry"}),e[4]=o,e[5]=d):d=e[5];let m;return e[6]!==l||e[7]!==r||e[8]!==d?(m=s.jsxs("div",{className:"grid gap-10",children:[l,r,d]}),e[6]=l,e[7]=r,e[8]=d,e[9]=m):m=e[9],m}function sn(i){const e=w.c(83),{org:t,initialSiteUrl:n}=i,o=Ae();let a;e[0]!==t.id||e[1]!==t.slug?(a={connectionId:Se,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=a):a=e[2];const l=ue(a),[r,d]=z.useState(n??""),[m,g]=z.useState(null),[f,u]=z.useState(null),x=z.useRef(!1),p=Pe.COMMERCE_DISCOVERY(t.id),h=Xe(t.id),y=D.commerceDiscoveryConnection(t.id,p);let v;e[3]!==p||e[4]!==l?(v=async()=>{const E=await l.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:p}});return xe(E)},e[3]=p,e[4]=l,e[5]=v):v=e[5];let c;e[6]!==y||e[7]!==v?(c={queryKey:y,queryFn:v,retry:!1},e[6]=y,e[7]=v,e[8]=c):c=e[8];const j=Ee(c),C=D.commerceDiscoveryVirtualMcp(t.id,h);let b;e[9]!==l||e[10]!==h?(b=async()=>{const E=await l.callTool({name:"COLLECTION_VIRTUAL_MCP_GET",arguments:{id:h}});return xe(E)},e[9]=l,e[10]=h,e[11]=b):b=e[11];let N;e[12]!==C||e[13]!==b?(N={queryKey:C,queryFn:b,retry:!1},e[12]=C,e[13]=b,e[14]=N):N=e[14];const _=Ee(N);let T;e[15]!==l?(T=async E=>{const L=await l.callTool({name:"COMMERCE_DISCOVERY_SETUP",arguments:{siteUrl:E}});return xe(L)},e[15]=l,e[16]=T):T=e[16];let R;e[17]!==j||e[18]!==_?(R=E=>{g(E),u(null),j.refetch(),_.refetch()},e[17]=j,e[18]=_,e[19]=R):R=e[19];let I;e[20]===Symbol.for("react.memo_cache_sentinel")?(I=E=>{u(E instanceof Error?E.message:"Commerce Discovery setup failed.")},e[20]=I):I=e[20];let O;e[21]!==T||e[22]!==R?(O={mutationFn:T,retry:!1,onSuccess:R,onError:I},e[21]=T,e[22]=R,e[23]=O):O=e[23];const S=be(O),P=!!j.data.item&&!!_.data.item;let $;e[24]!==S?($=E=>{const L=ve(E);if(!L.ok){u(L.error);return}u(null),S.mutate(L.value)},e[24]=S,e[25]=$):$=e[25];const F=$;let W;e[26]!==n||e[27]!==F||e[28]!==P?(W=E=>{!E||x.current||P||!n||(x.current=!0,F(n))},e[26]=n,e[27]=F,e[28]=P,e[29]=W):W=e[29];const G=W;let K;e[30]!==F||e[31]!==r?(K=E=>{E.preventDefault(),F(r)},e[30]=F,e[31]=r,e[32]=K):K=e[32];const U=K;let Y;e[33]!==p||e[34]!==m?.reportApp||e[35]!==h?(Y=m?.reportApp??{connectionId:p,virtualMcpId:h,toolName:et},e[33]=p,e[34]=m?.reportApp,e[35]=h,e[36]=Y):Y=e[36];const k=Y;let Z;e[37]!==o||e[38]!==t.slug||e[39]!==k.connectionId||e[40]!==k.toolName||e[41]!==k.virtualMcpId?(Z=()=>{localStorage.setItem(Ye.sidebarOpen(),JSON.stringify(!1)),o({to:"/$org/$taskId",params:{org:t.slug,taskId:crypto.randomUUID()},search:{virtualmcpid:k.virtualMcpId,main:Je(k.connectionId,k.toolName),chat:0}})},e[37]=o,e[38]=t.slug,e[39]=k.connectionId,e[40]=k.toolName,e[41]=k.virtualMcpId,e[42]=Z):Z=e[42];const B=Z;if(P){let E;return e[43]!==B||e[44]!==t||e[45]!==k?(E=s.jsx(on,{org:t,reportApp:k,onOpenReport:B}),e[43]=B,e[44]=t,e[45]=k,e[46]=E):E=e[46],E}if(n){let E;e[47]!==n?(E=ve(n),e[47]=n,e[48]=E):E=e[48];const L=E;if(!L.ok){const ee=`Commerce setup will continue for ${t.name}.`;let te;e[49]!==ee?(te=s.jsx(se,{title:"Commerce diagnostics",description:ee}),e[49]=ee,e[50]=te):te=e[50];let ae;e[51]!==L.error?(ae=s.jsx(he,{message:L.error}),e[51]=L.error,e[52]=ae):ae=e[52];let ce;e[53]!==U||e[54]!==f||e[55]!==S.isPending||e[56]!==r?(ce=s.jsx(ye,{siteUrl:r,error:f,isSubmitting:S.isPending,onSiteUrlChange:d,onSubmit:U}),e[53]=U,e[54]=f,e[55]=S.isPending,e[56]=r,e[57]=ce):ce=e[57];let fe;return e[58]!==te||e[59]!==ae||e[60]!==ce?(fe=s.jsxs("div",{className:"grid gap-10",children:[te,ae,ce]}),e[58]=te,e[59]=ae,e[60]=ce,e[61]=fe):fe=e[61],fe}const oe=`Commerce Discovery is being prepared for ${L.value}.`;let V;e[62]!==oe?(V=s.jsx(se,{title:"Commerce diagnostics",description:oe}),e[62]=oe,e[63]=V):V=e[63];let H;e[64]!==U||e[65]!==f||e[66]!==S||e[67]!==r?(H=f?s.jsxs(s.Fragment,{children:[s.jsx(he,{message:f}),s.jsx(ye,{siteUrl:r,error:null,isSubmitting:S.isPending,onSiteUrlChange:d,onSubmit:U})]}):s.jsx(me,{label:"Setting up Commerce Discovery..."}),e[64]=U,e[65]=f,e[66]=S,e[67]=r,e[68]=H):H=e[68];let A;return e[69]!==V||e[70]!==H||e[71]!==G?(A=s.jsxs("div",{ref:G,className:"grid gap-10",children:[V,H]}),e[69]=V,e[70]=H,e[71]=G,e[72]=A):A=e[72],A}const J=`Commerce setup will continue for ${t.name}.`;let Q;e[73]!==J?(Q=s.jsx(se,{title:"Commerce diagnostics",description:J}),e[73]=J,e[74]=Q):Q=e[74];let q;e[75]!==U||e[76]!==f||e[77]!==S.isPending||e[78]!==r?(q=s.jsx(ye,{siteUrl:r,error:f,isSubmitting:S.isPending,onSiteUrlChange:d,onSubmit:U}),e[75]=U,e[76]=f,e[77]=S.isPending,e[78]=r,e[79]=q):q=e[79];let X;return e[80]!==Q||e[81]!==q?(X=s.jsxs("div",{className:"grid gap-10",children:[Q,q]}),e[80]=Q,e[81]=q,e[82]=X):X=e[82],X}function ye(i){const e=w.c(22),{siteUrl:t,error:n,isSubmitting:o,onSiteUrlChange:a,onSubmit:l}=i;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("label",{className:"text-sm font-medium",htmlFor:"commerce-site-url",children:"Website URL"}),e[0]=r):r=e[0];let d;e[1]!==a?(d=y=>a(y.target.value),e[1]=a,e[2]=d):d=e[2];const m=!!n;let g;e[3]!==o||e[4]!==t||e[5]!==d||e[6]!==m?(g=s.jsx(de,{id:"commerce-site-url",type:"text",inputMode:"url",value:t,onChange:d,placeholder:"https://example.com","aria-invalid":m,disabled:o}),e[3]=o,e[4]=t,e[5]=d,e[6]=m,e[7]=g):g=e[7];let f;e[8]!==n?(f=n?s.jsx(he,{message:n}):null,e[8]=n,e[9]=f):f=e[9];let u;e[10]!==g||e[11]!==f?(u=s.jsxs("div",{className:"grid gap-2",children:[r,g,f]}),e[10]=g,e[11]=f,e[12]=u):u=e[12];let x;e[13]!==o?(x=o?s.jsxs(s.Fragment,{children:[s.jsx(le,{size:14,className:"animate-spin"}),"Setting up"]}):s.jsxs(s.Fragment,{children:["Continue",s.jsx(Ue,{size:16})]}),e[13]=o,e[14]=x):x=e[14];let p;e[15]!==o||e[16]!==x?(p=s.jsx(ie,{type:"submit",size:"xl",className:"w-full",disabled:o,children:x}),e[15]=o,e[16]=x,e[17]=p):p=e[17];let h;return e[18]!==l||e[19]!==u||e[20]!==p?(h=s.jsxs("form",{className:"grid gap-4",onSubmit:l,children:[u,p]}),e[18]=l,e[19]=u,e[20]=p,e[21]=h):h=e[21],h}function on(i){const e=w.c(6),{org:t,reportApp:n,onOpenReport:o}=i;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(se,{}),e[0]=a):a=e[0];const l=!n.virtualMcpId;let r;return e[1]!==o||e[2]!==t||e[3]!==n.connectionId||e[4]!==l?(r=s.jsxs("div",{className:"flex h-[calc(100dvh-3rem)] flex-col gap-10 md:grid md:h-auto",children:[a,s.jsx(Bt,{org:t,cdConnectionId:n.connectionId,reportDisabled:l,onOpenReport:o})]}),e[1]=o,e[2]=t,e[3]=n.connectionId,e[4]=l,e[5]=r):r=e[5],r}function he(i){const e=w.c(2),{message:t}=i;let n;return e[0]!==t?(n=s.jsx("p",{className:"text-sm leading-5 text-destructive",role:"alert",children:t}),e[0]=t,e[1]=n):n=e[1],n}export{ds as default,Ie as useCommerceSiteHost};
|
|
1
|
+
import{c as w,r as z,l as Te,j as s,m as ke,k as re,d as be,K as D,i as le,B as ie,a as ze,u as Be,b as Ae,n as Qe,o as Le,Q as Ve,E as We,p as Ee,L as Ye}from"./index-C1yj8oW9.js";import{A as Ze}from"./auth-entry-CC1ARBuN.js";import{A as ne}from"./auth-split-layout-Cxddqcmf.js";import{O as we}from"./organization-choice-B7gbF-gx.js";import{f as Je}from"./tab-id-BptcWVWa.js";import{I as de}from"./input-CjEjpxdM.js";import{u as ue,S as Se,W as Pe,g as Xe,C as et}from"./use-mcp-client-90IJIS7G.js";import{i as Ue}from"./XCircle-BFWoSw7W.js";import{I as tt}from"./integration-icon-CSYS5mut.js";import{i as Ne}from"./CheckCircle-DpKZZDmN.js";import{g as nt,c as st,e as it}from"./extract-connection-data-BrfuWfn9.js";import{S as ot,a as rt,b as $e,c as De,d as Me,e as Fe,f as Ke}from"./select-Bdte2-mH.js";import{a as lt}from"./authenticate-and-persist-oauth-KVWekoHI.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./avatar-B2rvHJ2u.js";import"./User01-Do5enW22.js";import"./auth-DscXYOeb.js";import"./agent-icon-BB0OI_Zf.js";import"./AlertCircle-CmMED3h6.js";import"./Tool01-CZPk8Ney.js";import"./SwitchHorizontal01-B_NmbobE.js";import"./Settings02-B1ZVVT_e.js";import"./ArrowUpRight-DwILncVx.js";import"./ZapSquare-CmQdJEdR.js";import"./Users03-B_G71vm-.js";import"./ChevronUp-CzO_7LvF.js";import"./ChevronDown-BjzwFuai.js";import"./ChevronLeft-uRkOj5F8.js";import"./ChevronRight-BRGGbOax.js";import"./DotsVertical-DshGnU_X.js";import"./Stars02-BwRZ8reG.js";import"./Eye-BBVg-SSa.js";import"./ZoomOut-BR28jpI9.js";import"./Globe01-Cm82tRCS.js";import"./FilterLines-CowTK4HW.js";import"./Star01-DBcQByZk.js";import"./Globe04-DrE78eQQ.js";import"./HardDrive-DsahIXX5.js";import"./Key01-CwoTMTFC.js";import"./LayoutLeft-_ZNcVcNz.js";import"./LinkExternal01-BeE3-oct.js";import"./Monitor01-Aa4wN2Ct.js";import"./Sun-BMePDS8S.js";import"./Palette-DT-obB9z.js";import"./Play-D7fUrl6h.js";import"./Plus-CK2CAzo5.js";import"./SearchMd-B3Rw93l5.js";import"./Shield01-BR2mZOZb.js";import"./Stars01-aJC5veoy.js";import"./Trash01-SWS-_O9Z.js";import"./Upload01-CoqelT_E.js";import"./Users01-BmWtNHuf.js";import"./XClose-BO6FjXoT.js";import"./X-CO9z9Xp0.js";import"./Zap-Bs_ao0zW.js";import"./index-uuDmStBi.js";import"./mcp-oauth-RIVS58UD.js";const at=/^[a-zA-Z][a-zA-Z\d+.-]*:/,ct=/^[a-zA-Z][a-zA-Z\d+.-]*:\/\//,dt=/^[^\s/:?#]+\.[^\s/:?#]+:\d+(?:[/?#]|$)/,ut=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/i;function ve(i){const e=i.trim();if(!e)return{ok:!1,error:"Enter a website URL."};const t=at.test(e),n=ct.test(e),o=dt.test(e);if(t&&!n&&!o)return{ok:!1,error:"Use an HTTP or HTTPS website URL."};const a=n?e:`https://${e}`;let l;try{l=new URL(a)}catch{return{ok:!1,error:"Enter a valid website URL."}}if(l.protocol!=="http:"&&l.protocol!=="https:")return{ok:!1,error:"Use an HTTP or HTTPS website URL."};const r=l.hostname.split(".");return r.length<2||r.some(d=>!d||!ut.test(d))?{ok:!1,error:"Enter a valid website URL."}:(l.protocol="https:",{ok:!0,value:l.origin})}function Ce(i){const e=w.c(14),{children:t,className:n,wrapperClassName:o}=i,[a,l]=z.useState(!0);let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=h=>{if(!h)return;const y=()=>{const c=h.scrollHeight-h.scrollTop-h.clientHeight<8;l(c)};y(),h.addEventListener("scroll",y,{passive:!0});const v=new ResizeObserver(y);v.observe(h);for(const c of Array.from(h.children))v.observe(c);return()=>{h.removeEventListener("scroll",y),v.disconnect()}},e[0]=r):r=e[0];const d=r;let m;e[1]!==o?(m=Te("relative",o),e[1]=o,e[2]=m):m=e[2];let g;e[3]!==t||e[4]!==n?(g=s.jsx("div",{ref:d,className:n,children:t}),e[3]=t,e[4]=n,e[5]=g):g=e[5];const f=a?"opacity-0":"opacity-100";let u;e[6]!==f?(u=Te("pointer-events-none absolute inset-x-0 -bottom-px h-[213px]","bg-gradient-to-t from-sidebar from-[6px] to-transparent","backdrop-blur-[2px] [mask-image:linear-gradient(to_top,black_6px,transparent)]","transition-opacity duration-200",f),e[6]=f,e[7]=u):u=e[7];let x;e[8]!==u?(x=s.jsx("div",{"aria-hidden":!0,className:u}),e[8]=u,e[9]=x):x=e[9];let p;return e[10]!==m||e[11]!==g||e[12]!==x?(p=s.jsxs("div",{className:m,children:[g,x]}),e[10]=m,e[11]=g,e[12]=x,e[13]=p):p=e[13],p}function mt(i){const e=i,t=e?.response?.accountSummaries??e?.accountSummaries;if(!Array.isArray(t))return[];const n=[];for(const o of t){const a=o?.propertySummaries;if(!Array.isArray(a))continue;const l=[];for(const r of a)typeof r?.property=="string"&&r.property.length>0&&l.push({value:r.property,label:typeof r.displayName=="string"?r.displayName:r.property});l.length!==0&&n.push({account:typeof o?.displayName=="string"?o.displayName:"Account",options:l})}return n}function ft(i){return i.flatMap(e=>e.options)}function qe(i){const e=i,t=e?.sites??e?.siteEntry;return Array.isArray(t)?t.filter(n=>typeof n?.siteUrl=="string"&&n.siteUrl.length>0).map(n=>({siteUrl:n.siteUrl})):[]}function pt(i){const e=t=>t.replace(/^www\./,"").toLowerCase();if(i.startsWith("sc-domain:"))return e(i.slice(10));try{return e(new URL(i).hostname)}catch{return null}}function gt(i,e){if(!i)return null;const t=i.replace(/^www\./,"").toLowerCase(),n=e.filter(o=>pt(o.siteUrl)===t);return n.length===1?n[0].siteUrl:null}function ht(i,e){const t=i?.[e];return typeof t=="string"?t.length>0:t!=null}function xt(i,e){return{...i??{},...e}}function yt(i){const e=i.properties;if(!e)return[];const t=[];for(const[n,o]of Object.entries(e)){const r=o?.properties?.__type?.const;typeof r=="string"&&r.length>0&&t.push({fieldKey:n,bindingType:r})}return t}function vt(i,e){const t=[];if(i.length&&t.push({field:["id"],operator:"in",value:i}),e.length&&t.push({field:["name"],operator:"in",value:e}),t.length!==0)return t.length===1?t[0]:{operator:"or",conditions:t}}function M(i){const e=i;if(e.isError)throw new Error(e.content?.find(t=>t.text)?.text??"Tool call failed");return e.structuredContent??i}function Ct(i,e,t,n){return{...i??{},[e]:{__type:t,value:n}}}function jt(i,e,t){const n=i.filter(o=>o.app_name===e||!!t&&o.app_id===t);return n.length===0?null:(n.sort((o,a)=>{const l=r=>r.status==="active"?0:1;return l(o)!==l(a)?l(o)-l(a):(a.updated_at??"").localeCompare(o.updated_at??"")}),n[0].id)}function bt(i){return i.server?.icons?.[0]?.src??nt(i.server?.repository)??null}function St(i,e){const t=i._meta?.["mcp.mesh"];return t?.friendlyName||t?.friendly_name||i.title||i.server?.title||i.server?.name||e}function Nt(i){const e=[];for(const t of i.requirements){const n=i.curated[t.bindingType],o=n?i.itemsById[n.registryAppId]:i.itemsByName[t.bindingType];if(!o)continue;const a=i.configurationState?.[t.fieldKey]?.value,l=!!a;e.push({fieldKey:t.fieldKey,bindingType:t.bindingType,registryItem:o,title:St(o,t.bindingType),icon:bt(o),headline:n?.headline??o._meta?.["mcp.mesh"]?.short_description??null,checks:n?.checks??null,bullets:n?.bullets??[],satisfied:l,candidateConnectionId:l?null:jt(i.connections,t.bindingType,n?.registryAppId),linkedConnectionId:a??null})}return e}function _t(i){const e=w.c(79),{entry:t,connectionId:n,orgId:o,orgSlug:a,siteHost:l}=i,r=ke();let d;e[0]!==o||e[1]!==a?(d={connectionId:Se,orgId:o,orgSlug:a},e[0]=o,e[1]=a,e[2]=d):d=e[2];const m=ue(d);let g;e[3]!==n||e[4]!==o||e[5]!==a?(g={connectionId:n,orgId:o,orgSlug:a},e[3]=n,e[4]=o,e[5]=a,e[6]=g):g=e[6];const f=ue(g),[u,x]=z.useState(null),p=z.useRef(!1);let h;e[7]!==n||e[8]!==o?(h=D.commerceDiscoveryCompanionConfig(o,n),e[7]=n,e[8]=o,e[9]=h):h=e[9];let y;e[10]!==n||e[11]!==m?(y=async()=>{const A=await m.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:n}});return M(A)},e[10]=n,e[11]=m,e[12]=y):y=e[12];let v;e[13]!==h||e[14]!==y?(v={queryKey:h,queryFn:y},e[13]=h,e[14]=y,e[15]=v):v=e[15];const c=re(v);let j;e[16]!==c.data?.item?.configuration_state?(j=c.data?.item?.configuration_state??{},e[16]=c.data?.item?.configuration_state,e[17]=j):j=e[17];const C=j;let b;e[18]!==C||e[19]!==t.anchorField?(b=ht(C,t.anchorField),e[18]=C,e[19]=t.anchorField,e[20]=b):b=e[20];const N=b;let _;e[21]!==n||e[22]!==o?(_=D.commerceDiscoveryGaSummaries(o,n),e[21]=n,e[22]=o,e[23]=_):_=e[23];const T=t.bindingType==="google-analytics";let R;e[24]!==f?(R=async()=>{const A=await f.callTool({name:"get-account-summaries",arguments:{}});return mt(M(A))},e[24]=f,e[25]=R):R=e[25];let I;e[26]!==R||e[27]!==_||e[28]!==T?(I={queryKey:_,enabled:T,queryFn:R},e[26]=R,e[27]=_,e[28]=T,e[29]=I):I=e[29];const O=re(I);let S;e[30]!==n||e[31]!==o?(S=D.commerceDiscoveryGscSites(o,n),e[30]=n,e[31]=o,e[32]=S):S=e[32];const P=t.bindingType==="google-search-console";let $;e[33]!==f?($=async()=>{const A=await f.callTool({name:"list_sites",arguments:{}});return qe(M(A))},e[33]=f,e[34]=$):$=e[34];let F;e[35]!==S||e[36]!==P||e[37]!==$?(F={queryKey:S,enabled:P,queryFn:$},e[35]=S,e[36]=P,e[37]=$,e[38]=F):F=e[38];const W=re(F);let G;e[39]!==n||e[40]!==C||e[41]!==m?(G=async A=>{const ee=xt(C,A),te=await m.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:n,data:{configuration_state:ee}}});return M(te)},e[39]=n,e[40]=C,e[41]=m,e[42]=G):G=e[42];let K;e[43]!==n||e[44]!==o||e[45]!==r?(K=async()=>{x(null),await r.invalidateQueries({queryKey:D.commerceDiscoveryCompanionConfig(o,n)})},e[43]=n,e[44]=o,e[45]=r,e[46]=K):K=e[46];let U;e[47]===Symbol.for("react.memo_cache_sentinel")?(U=A=>x(A instanceof Error?A.message:String(A)),e[47]=U):U=e[47];let Y;e[48]!==G||e[49]!==K?(Y={mutationFn:G,onSuccess:K,onError:U},e[48]=G,e[49]=K,e[50]=Y):Y=e[50];const k=be(Y);let Z;e[51]!==k?(Z=async A=>{try{return await k.mutateAsync(A),!0}catch{return!1}},e[51]=k,e[52]=Z):Z=e[52];const B=Z;let J;e[53]!==N||e[54]!==n||e[55]!==f||e[56]!==t||e[57]!==o||e[58]!==a||e[59]!==B||e[60]!==k.isPending||e[61]!==l||e[62]!==c.isPending?(J=A=>{!A||p.current||!t.autoResolve||N||c.isPending||k.isPending||(p.current=!0,t.autoResolve({client:f,ctx:{siteHost:l,connectionId:n,orgId:o,orgSlug:a}}).then(ee=>{ee&&B(ee)}).catch(It))},e[53]=N,e[54]=n,e[55]=f,e[56]=t,e[57]=o,e[58]=a,e[59]=B,e[60]=k.isPending,e[61]=l,e[62]=c.isPending,e[63]=J):J=e[63];const Q=J;let q;e[64]!==O.data?(q=O.data??[],e[64]=O.data,e[65]=q):q=e[65];const X=q,E=!!O.error;let L;e[66]!==W.data?(L=W.data??[],e[66]=W.data,e[67]=L):L=e[67];const oe=L,V=c.isPending||t.bindingType==="google-analytics"&&O.isPending||t.bindingType==="google-search-console"&&W.isPending;let H;return e[68]!==N||e[69]!==C||e[70]!==u||e[71]!==Q||e[72]!==B||e[73]!==k.isPending||e[74]!==X||e[75]!==E||e[76]!==oe||e[77]!==V?(H={configured:N,currentValue:C,gaGroups:X,gaError:E,verifiedSites:oe,saving:k.isPending,error:u,save:B,maybeAutoResolve:Q,isLoading:V},e[68]=N,e[69]=C,e[70]=u,e[71]=Q,e[72]=B,e[73]=k.isPending,e[74]=X,e[75]=E,e[76]=oe,e[77]=V,e[78]=H):H=e[78],H}function It(){}function Tt(i){const e=w.c(22),{entry:t,card:n,orgId:o,orgSlug:a,siteHost:l}=i;let r;e[0]!==n.linkedConnectionId||e[1]!==t||e[2]!==o||e[3]!==a||e[4]!==l?(r={entry:t,connectionId:n.linkedConnectionId,orgId:o,orgSlug:a,siteHost:l},e[0]=n.linkedConnectionId,e[1]=t,e[2]=o,e[3]=a,e[4]=l,e[5]=r):r=e[5];const{configured:d,currentValue:m,gaGroups:g,gaError:f,verifiedSites:u,saving:x,error:p,save:h,maybeAutoResolve:y,isLoading:v}=_t(r),[c,j]=z.useState(!1),{Renderer:C}=t;let b;e[6]!==C||e[7]!==d||e[8]!==m||e[9]!==c||e[10]!==t.anchorField||e[11]!==p||e[12]!==f||e[13]!==g||e[14]!==v||e[15]!==h||e[16]!==x||e[17]!==u?(b=v?s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(le,{size:14,className:"animate-spin"})," Loading setup…"]}):d&&!c?s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ne,{size:14,className:"shrink-0 text-blue-500"}),s.jsx("p",{className:"flex-1 truncate text-sm text-muted-foreground",children:m[t.anchorField]??""}),s.jsx("button",{type:"button",className:"text-sm text-muted-foreground underline underline-offset-2",onClick:()=>j(!0),children:"Edit"})]}):s.jsx(C,{currentValue:m,gaGroups:g,gaError:f,verifiedSites:u,saving:x,error:p,onSave:_=>{h(_).then(T=>{T&&j(!1)})}}),e[6]=C,e[7]=d,e[8]=m,e[9]=c,e[10]=t.anchorField,e[11]=p,e[12]=f,e[13]=g,e[14]=v,e[15]=h,e[16]=x,e[17]=u,e[18]=b):b=e[18];let N;return e[19]!==y||e[20]!==b?(N=s.jsx("div",{ref:y,className:"px-1 pt-1",children:b}),e[19]=y,e[20]=b,e[21]=N):N=e[21],N}function Et(i){const e=w.c(39),{currentValue:t,gaGroups:n,gaError:o,saving:a,error:l,onSave:r}=i,d=t.propertyId??"";let m;e[0]!==n?(m=ft(n),e[0]=n,e[1]=m):m=e[1];const g=m,f=d||(g.length===1?g[0].value:""),[u,x]=z.useState(f);if(o||n.length===0){let _;e[2]===Symbol.for("react.memo_cache_sentinel")?(_=$=>x($.target.value),e[2]=_):_=e[2];let T;e[3]!==u?(T=s.jsx(de,{value:u,onChange:_,placeholder:"properties/1234567",className:"flex-1"}),e[3]=u,e[4]=T):T=e[4];const R=!u;let I;e[5]!==r||e[6]!==u?(I=()=>r({propertyId:u}),e[5]=r,e[6]=u,e[7]=I):I=e[7];let O;e[8]!==a||e[9]!==R||e[10]!==I?(O=s.jsx(Oe,{saving:a,disabled:R,onClick:I}),e[8]=a,e[9]=R,e[10]=I,e[11]=O):O=e[11];let S;e[12]!==T||e[13]!==O?(S=s.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[T,O]}),e[12]=T,e[13]=O,e[14]=S):S=e[14];let P;return e[15]!==l||e[16]!==S?(P=s.jsx(Re,{error:l,children:S}),e[15]=l,e[16]=S,e[17]=P):P=e[17],P}let p;e[18]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(De,{size:"sm",className:"flex-1",children:s.jsx(Me,{placeholder:"Select a property..."})}),e[18]=p):p=e[18];let h;e[19]!==n?(h=n.map(wt),e[19]=n,e[20]=h):h=e[20];let y;e[21]!==h?(y=s.jsx(Fe,{children:h}),e[21]=h,e[22]=y):y=e[22];let v;e[23]!==u||e[24]!==y?(v=s.jsxs(Ke,{value:u,onValueChange:x,children:[p,y]}),e[23]=u,e[24]=y,e[25]=v):v=e[25];const c=!u;let j;e[26]!==r||e[27]!==u?(j=()=>r({propertyId:u}),e[26]=r,e[27]=u,e[28]=j):j=e[28];let C;e[29]!==a||e[30]!==c||e[31]!==j?(C=s.jsx(Oe,{saving:a,disabled:c,onClick:j}),e[29]=a,e[30]=c,e[31]=j,e[32]=C):C=e[32];let b;e[33]!==v||e[34]!==C?(b=s.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[v,C]}),e[33]=v,e[34]=C,e[35]=b):b=e[35];let N;return e[36]!==l||e[37]!==b?(N=s.jsx(Re,{error:l,children:b}),e[36]=l,e[37]=b,e[38]=N):N=e[38],N}function wt(i){return s.jsxs(ot,{children:[s.jsx(rt,{children:i.account}),i.options.map(Rt)]},i.account)}function Rt(i){return s.jsx($e,{value:i.value,children:i.label},i.value)}function Re(i){const e=w.c(5),{children:t,error:n}=i;let o;e[0]!==n?(o=n&&s.jsx("p",{className:"text-xs text-destructive",role:"alert",children:n}),e[0]=n,e[1]=o):o=e[1];let a;return e[2]!==t||e[3]!==o?(a=s.jsxs("div",{className:"flex flex-col gap-1",children:[t,o]}),e[2]=t,e[3]=o,e[4]=a):a=e[4],a}function Oe(i){const e=w.c(6),{saving:t,disabled:n,onClick:o}=i,a=n||t;let l;e[0]!==t?(l=t?s.jsx(le,{size:16,className:"animate-spin"}):"Save",e[0]=t,e[1]=l):l=e[1];let r;return e[2]!==o||e[3]!==a||e[4]!==l?(r=s.jsx(ie,{type:"button",size:"sm",variant:"outline",disabled:a,onClick:o,children:l}),e[2]=o,e[3]=a,e[4]=l,e[5]=r):r=e[5],r}function Ot(i){const e=w.c(20),{currentValue:t,verifiedSites:n,saving:o,error:a,onSave:l}=i,r=t.siteUrl??"",[d,m]=z.useState(r);let g;e[0]!==d||e[1]!==n?(g=n.length>0?s.jsxs(Ke,{value:d,onValueChange:m,children:[s.jsx(De,{size:"sm",className:"flex-1",children:s.jsx(Me,{placeholder:"Select a verified site..."})}),s.jsx(Fe,{children:n.map(kt)})]}):s.jsx(de,{value:d,onChange:c=>m(c.target.value),placeholder:"sc-domain:example.com",className:"flex-1"}),e[0]=d,e[1]=n,e[2]=g):g=e[2];const f=!d||o;let u;e[3]!==l||e[4]!==d?(u=()=>l({siteUrl:d}),e[3]=l,e[4]=d,e[5]=u):u=e[5];let x;e[6]!==o?(x=o?s.jsx(le,{size:16,className:"animate-spin"}):"Save",e[6]=o,e[7]=x):x=e[7];let p;e[8]!==f||e[9]!==u||e[10]!==x?(p=s.jsx(ie,{type:"button",size:"sm",variant:"outline",disabled:f,onClick:u,children:x}),e[8]=f,e[9]=u,e[10]=x,e[11]=p):p=e[11];let h;e[12]!==g||e[13]!==p?(h=s.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[g,p]}),e[12]=g,e[13]=p,e[14]=h):h=e[14];let y;e[15]!==a?(y=a&&s.jsx("p",{className:"text-xs text-destructive",role:"alert",children:a}),e[15]=a,e[16]=y):y=e[16];let v;return e[17]!==h||e[18]!==y?(v=s.jsxs("div",{className:"flex flex-col gap-1",children:[h,y]}),e[17]=h,e[18]=y,e[19]=v):v=e[19],v}function kt(i){return s.jsx($e,{value:i.siteUrl,children:i.siteUrl},i.siteUrl)}function zt(i){const e=w.c(28),{currentValue:t,saving:n,error:o,onSave:a}=i,[l,r]=z.useState(t.accountName??""),[d,m]=z.useState(t.appKey??""),[g,f]=z.useState(t.appToken??"");let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=_=>r(_.target.value),e[0]=u):u=e[0];let x;e[1]!==l?(x=s.jsx(de,{value:l,onChange:u,placeholder:"Account name"}),e[1]=l,e[2]=x):x=e[2];let p;e[3]===Symbol.for("react.memo_cache_sentinel")?(p=_=>m(_.target.value),e[3]=p):p=e[3];let h;e[4]!==d?(h=s.jsx(de,{type:"password",value:d,onChange:p,placeholder:"App key"}),e[4]=d,e[5]=h):h=e[5];let y;e[6]===Symbol.for("react.memo_cache_sentinel")?(y=_=>f(_.target.value),e[6]=y):y=e[6];let v;e[7]!==g?(v=s.jsx(de,{type:"password",value:g,onChange:y,placeholder:"App token"}),e[7]=g,e[8]=v):v=e[8];let c;e[9]!==l||e[10]!==d||e[11]!==g||e[12]!==a?(c=()=>a({accountName:l,appKey:d,appToken:g}),e[9]=l,e[10]=d,e[11]=g,e[12]=a,e[13]=c):c=e[13];let j;e[14]!==n?(j=n?s.jsx(le,{size:16,className:"animate-spin"}):"Save",e[14]=n,e[15]=j):j=e[15];let C;e[16]!==n||e[17]!==c||e[18]!==j?(C=s.jsx("div",{className:"flex items-center justify-end",children:s.jsx(ie,{type:"button",size:"sm",variant:"outline",disabled:n,onClick:c,children:j})}),e[16]=n,e[17]=c,e[18]=j,e[19]=C):C=e[19];let b;e[20]!==o?(b=o&&s.jsx("p",{className:"text-xs text-destructive",role:"alert",children:o}),e[20]=o,e[21]=b):b=e[21];let N;return e[22]!==b||e[23]!==x||e[24]!==h||e[25]!==v||e[26]!==C?(N=s.jsxs("div",{className:"flex flex-col gap-2",children:[x,h,v,C,b]}),e[22]=b,e[23]=x,e[24]=h,e[25]=v,e[26]=C,e[27]=N):N=e[27],N}const At={"google-analytics":{bindingType:"google-analytics",anchorField:"propertyId",Renderer:Et},"google-search-console":{bindingType:"google-search-console",anchorField:"siteUrl",autoResolve:async({client:i,ctx:e})=>{const t=await i.callTool({name:"list_sites",arguments:{}}),{sites:n}=M(t),o=gt(e.siteHost,qe({sites:n}));return o?{siteUrl:o}:null},Renderer:Ot},vtex:{bindingType:"vtex",anchorField:"accountName",Renderer:zt}};function Lt(i){return At[i]}function Pt(){const i=w.c(3);let e;i[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"size-12 shrink-0 animate-pulse rounded-lg bg-muted/60"}),s.jsx("div",{className:"h-4 w-32 animate-pulse rounded bg-muted/60"}),s.jsx("div",{className:"ml-auto h-8 w-20 animate-pulse rounded-lg bg-muted/60"})]}),i[0]=e):e=i[0];let t;i[1]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx("div",{className:"p-1",children:s.jsx("div",{className:"h-5 w-40 animate-pulse rounded bg-muted/60"})}),i[1]=t):t=i[1];let n;return i[2]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"flex flex-col gap-2 rounded-2xl border border-border bg-card p-4",children:[e,s.jsxs("div",{className:"flex flex-col gap-1 px-1 py-2",children:[t,s.jsx("div",{className:"p-1",children:s.jsx("div",{className:"h-5 w-56 animate-pulse rounded bg-muted/60"})})]})]}),i[2]=n):n=i[2],n}function je(i){const e=w.c(3),{children:t}=i;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Ne,{size:14,className:"shrink-0 text-blue-500"}),e[0]=n):n=e[0];let o;return e[1]!==t?(o=s.jsxs("div",{className:"flex items-center gap-2 p-1",children:[n,s.jsx("p",{className:"text-sm text-foreground",children:t})]}),e[1]=t,e[2]=o):o=e[2],o}function Ut(i){const e=w.c(42),{card:t,connecting:n,disabled:o,onConnect:a,orgId:l,orgSlug:r,siteHost:d}=i;let m;e[0]!==t.bindingType?(m=Lt(t.bindingType),e[0]=t.bindingType,e[1]=m):m=e[1];const g=m;let f;e[2]!==t.icon||e[3]!==t.title?(f=s.jsx(tt,{icon:t.icon,name:t.title,size:"md",fit:"contain",className:"p-2"}),e[2]=t.icon,e[3]=t.title,e[4]=f):f=e[4];let u;e[5]!==t.title?(u=s.jsx("p",{className:"flex-1 text-sm text-foreground",children:t.title}),e[5]=t.title,e[6]=u):u=e[6];let x;e[7]!==t.satisfied||e[8]!==t.title||e[9]!==n||e[10]!==o||e[11]!==a?(x=t.satisfied?s.jsxs("div",{className:"flex h-8 items-center gap-2 px-3 text-sm text-muted-foreground",children:[s.jsx(Ne,{size:16})," Connected"]}):s.jsx(ie,{type:"button",variant:"outline",size:"sm",disabled:o||n,onClick:a,"aria-label":`Connect ${t.title}`,children:n?s.jsx(le,{size:16,className:"animate-spin"}):"Connect"}),e[7]=t.satisfied,e[8]=t.title,e[9]=n,e[10]=o,e[11]=a,e[12]=x):x=e[12];let p;e[13]!==f||e[14]!==u||e[15]!==x?(p=s.jsxs("div",{className:"flex items-center gap-2",children:[f,u,x]}),e[13]=f,e[14]=u,e[15]=x,e[16]=p):p=e[16];let h;e[17]!==t.checks?(h=t.checks!==null&&s.jsxs(je,{children:["+ ",t.checks," checks"]}),e[17]=t.checks,e[18]=h):h=e[18];let y;e[19]!==t.headline?(y=t.headline&&s.jsx(je,{children:t.headline}),e[19]=t.headline,e[20]=y):y=e[20];let v;e[21]!==t.bullets?(v=t.bullets.map($t),e[21]=t.bullets,e[22]=v):v=e[22];let c;e[23]!==t.candidateConnectionId||e[24]!==t.satisfied||e[25]!==t.title?(c=!t.satisfied&&t.candidateConnectionId&&s.jsxs("p",{className:"px-1 text-xs text-muted-foreground",children:["Using your existing ",t.title]}),e[23]=t.candidateConnectionId,e[24]=t.satisfied,e[25]=t.title,e[26]=c):c=e[26];let j;e[27]!==h||e[28]!==y||e[29]!==v||e[30]!==c?(j=s.jsxs("div",{className:"flex flex-col gap-1 px-1 py-2",children:[h,y,v,c]}),e[27]=h,e[28]=y,e[29]=v,e[30]=c,e[31]=j):j=e[31];let C;e[32]!==t||e[33]!==g||e[34]!==l||e[35]!==r||e[36]!==d?(C=t.satisfied&&t.linkedConnectionId&&g&&s.jsx(Tt,{entry:g,card:{...t,linkedConnectionId:t.linkedConnectionId},orgId:l,orgSlug:r,siteHost:d}),e[32]=t,e[33]=g,e[34]=l,e[35]=r,e[36]=d,e[37]=C):C=e[37];let b;return e[38]!==j||e[39]!==C||e[40]!==p?(b=s.jsxs("div",{className:"flex flex-col gap-2 rounded-2xl border border-border bg-card p-4",children:[p,j,C]}),e[38]=j,e[39]=C,e[40]=p,e[41]=b):b=e[41],b}function $t(i){return s.jsx(je,{children:i},i)}const _e={vtex:{registryAppId:"deco/vtex",checks:49,headline:"Out-of-stock, thin PDPs & attribute gaps across every SKU"},"google-analytics":{registryAppId:"deco/google-analytics",checks:49,headline:"Where revenue leaks between product view and checkout"},"google-search-console":{registryAppId:"deco/google-search-console",checks:49,headline:"Search visibility & indexing gaps across your catalog"}};function Dt(i){const e=w.c(25),{selfClient:t,org:n,cdConnectionId:o}=i;let a;e[0]!==o||e[1]!==n.id||e[2]!==n.slug?(a={connectionId:o,orgId:n.id,orgSlug:n.slug},e[0]=o,e[1]=n.id,e[2]=n.slug,e[3]=a):a=e[3];const l=ue(a);let r;e[4]!==o||e[5]!==n.id?(r=D.commerceDiscoveryCompanionSchema(n.id,o),e[4]=o,e[5]=n.id,e[6]=r):r=e[6];let d;e[7]!==l?(d=async()=>{const S=await l.callTool({name:"MCP_CONFIGURATION",arguments:{}});return M(S)},e[7]=l,e[8]=d):d=e[8];let m;e[9]!==r||e[10]!==d?(m={queryKey:r,queryFn:d},e[9]=r,e[10]=d,e[11]=m):m=e[11];const g=re(m),f=yt(g.data?.stateSchema??{properties:{}}),u=f.map(Ht),x=f.map(qt).filter(Kt),p=f.filter(Ft).map(Mt),h=[...x,...p].sort().join(",");let y;e[12]!==o||e[13]!==n.id?(y=D.commerceDiscoveryConnection(n.id,o),e[12]=o,e[13]=n.id,e[14]=y):y=e[14];let v;e[15]!==o||e[16]!==t?(v=async()=>{const S=await t.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:o}});return M(S)},e[15]=o,e[16]=t,e[17]=v):v=e[17];let c;e[18]!==y||e[19]!==v?(c={queryKey:y,queryFn:v},e[18]=y,e[19]=v,e[20]=c):c=e[20];const j=re(c),C=re({queryKey:D.commerceDiscoveryCompanionConnections(n.id),enabled:f.length>0,queryFn:async()=>{const S=await t.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{where:{operator:"or",conditions:[{field:["app_name"],operator:"in",value:u},{field:["app_id"],operator:"in",value:x}]},limit:1e3}});return M(S)}}),b=re({queryKey:D.commerceDiscoveryCompanionRegistry(n.id,h),enabled:f.length>0,queryFn:async()=>{const S=vt(x,p),P=await st(Pe.REGISTRY(n.id),n.id,n.slug,"COLLECTION_REGISTRY_APP_LIST",{...S?{where:S}:{},limit:1e3});return M(P)}}),N={},_={};for(const S of b.data?.items??[])N[S.id]=S,S.server?.name&&(_[S.server.name]=S);const T=Nt({requirements:f,itemsById:N,itemsByName:_,connections:C.data?.items??[],configurationState:j.data?.item?.configuration_state??null,curated:_e}),R=g.isPending||j.isPending||f.length>0&&(C.isPending||b.isPending),I=g.error??j.error??C.error??b.error??null;let O;return e[21]!==T||e[22]!==I||e[23]!==R?(O={cards:T,isLoading:R,error:I},e[21]=T,e[22]=I,e[23]=R,e[24]=O):O=e[24],O}function Mt(i){return i.bindingType}function Ft(i){return!_e[i.bindingType]}function Kt(i){return!!i}function qt(i){return _e[i.bindingType]?.registryAppId}function Ht(i){return i.bindingType}function Gt({selfClient:i,org:e,userId:t,cdConnectionId:n}){const o=ke(),[a,l]=z.useState(null),[r,d]=z.useState(null),m=async(f,u)=>{const x=await i.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:f,data:u}});return M(x)};async function g(f){l(f.fieldKey),d(null);try{let u=f.candidateConnectionId;if(!u){const c=it(f.registryItem,e.id,t,{remoteIndex:0}),j=c.connection_type==="STDIO",C=!!c.connection_url,b=j&&c.connection_headers&&typeof c.connection_headers=="object"&&"command"in c.connection_headers;if(!C&&!b){d(`${f.title} cannot be connected: no connection method available`);return}const N=await i.callTool({name:"COLLECTION_CONNECTIONS_CREATE",arguments:{data:c}});u=M(N).item.id}const x=u,p=await lt({connectionId:x,orgId:e.id,orgSlug:e.slug,persistFallback:c=>m(x,{connection_token:c}).then(()=>{})});if(!p.ok){d(`Couldn't sign in to ${f.title}: ${p.error}`);return}const h=await i.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:n}}),y=M(h).item?.configuration_state??null,v=Ct(y,f.fieldKey,f.bindingType,x);await m(n,{configuration_state:v}),await o.invalidateQueries({queryKey:D.commerceDiscoveryConnection(e.id,n)}),await o.invalidateQueries({queryKey:D.commerceDiscoveryCompanionConnections(e.id)})}catch(u){d(u instanceof Error?u.message:String(u))}finally{l(null)}}return{connect:g,connectingFieldKey:a,error:r}}function Bt(i){const e=w.c(33),{org:t,cdConnectionId:n,reportDisabled:o,onOpenReport:a}=i,{data:l}=ze.useSession(),r=l?.user?.id??"",d=Ie();let m;e[0]!==t.id||e[1]!==t.slug?(m={connectionId:Se,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=m):m=e[2];const g=ue(m);let f;e[3]!==n||e[4]!==t||e[5]!==g?(f={selfClient:g,org:t,cdConnectionId:n},e[3]=n,e[4]=t,e[5]=g,e[6]=f):f=e[6];const{cards:u,isLoading:x,error:p}=Dt(f);let h;e[7]!==n||e[8]!==t||e[9]!==g||e[10]!==r?(h={selfClient:g,org:t,userId:r,cdConnectionId:n},e[7]=n,e[8]=t,e[9]=g,e[10]=r,e[11]=h):h=e[11];const{connect:y,connectingFieldKey:v,error:c}=Gt(h);let j;e[12]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Ue,{size:16}),e[12]=j):j=e[12];let C;e[13]!==a||e[14]!==o?(C=s.jsxs(ie,{type:"button",size:"xl",className:"w-full",onClick:a,disabled:o,children:["See full report",j]}),e[13]=a,e[14]=o,e[15]=C):C=e[15];const b=C;if(!x&&!p&&u.length===0){let I;return e[16]!==b?(I=s.jsx("div",{className:"flex min-h-0 flex-1 flex-col justify-end gap-10 md:grid md:flex-none",children:b}),e[16]=b,e[17]=I):I=e[17],I}const N=v!==null;let _;e[18]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsxs("div",{className:"grid gap-1.5",children:[s.jsx("p",{className:"text-2xl font-medium text-foreground",children:"Unlock your full diagnostic"}),s.jsx("p",{className:"text-base text-muted-foreground",children:"Connect your tools to unlock 100+ checks across your funnel."})]}),e[18]=_):_=e[18];let T;e[19]!==N||e[20]!==u||e[21]!==y||e[22]!==c||e[23]!==v||e[24]!==p||e[25]!==x||e[26]!==t.id||e[27]!==t.slug||e[28]!==d?(T=p?s.jsxs("div",{role:"alert",className:"rounded-2xl border border-border bg-card p-4",children:[s.jsx("p",{className:"text-sm text-foreground",children:"Couldn't load companion integrations."}),s.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Reload the page to try again."})]}):x?s.jsx("div",{className:"flex min-h-0 flex-1 flex-col gap-4",children:[0,1,2].map(Qt)}):s.jsx(Ce,{wrapperClassName:"flex min-h-0 flex-1 flex-col md:block",className:"-mx-1 min-h-0 flex-1 overflow-y-auto px-1 md:max-h-[45vh] md:flex-none",children:s.jsxs("div",{className:"grid gap-4",children:[c&&s.jsx("p",{role:"alert",className:"text-sm text-destructive",children:c}),u.map(I=>s.jsx(Ut,{card:I,connecting:v===I.fieldKey,disabled:N&&v!==I.fieldKey,onConnect:()=>{y(I)},orgId:t.id,orgSlug:t.slug,siteHost:d},I.fieldKey))]})}),e[19]=N,e[20]=u,e[21]=y,e[22]=c,e[23]=v,e[24]=p,e[25]=x,e[26]=t.id,e[27]=t.slug,e[28]=d,e[29]=T):T=e[29];let R;return e[30]!==b||e[31]!==T?(R=s.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-6 md:grid md:flex-none",children:[_,T,b]}),e[30]=b,e[31]=T,e[32]=R):R=e[32],R}function Qt(i){return s.jsx(Pt,{},i)}function He(i){const e=w.c(10),{host:t}=i,n=`https://www.google.com/s2/favicons?domain=${t}&sz=128`;let o,a,l;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-7 w-7 dark:hidden"}),a=s.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-7 w-7 hidden dark:block"}),l=s.jsx("div",{className:"h-6 w-px rotate-12 bg-border","aria-hidden":"true"}),e[0]=o,e[1]=a,e[2]=l):(o=e[0],a=e[1],l=e[2]);let r;e[3]!==n?(r=s.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-border bg-white",children:s.jsx("img",{src:n,alt:"",className:"h-5 w-5",loading:"lazy"})}),e[3]=n,e[4]=r):r=e[4];let d;e[5]!==t?(d=s.jsx("span",{className:"text-lg font-medium text-foreground",children:t}),e[5]=t,e[6]=d):d=e[6];let m;return e[7]!==r||e[8]!==d?(m=s.jsxs("div",{className:"flex items-center gap-3",children:[o,a,l,r,d]}),e[7]=r,e[8]=d,e[9]=m):m=e[9],m}function ds(){const i=w.c(1);let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Wt,{}),i[0]=e):e=i[0],e}const Ge=z.createContext(null),Ie=()=>z.useContext(Ge);function Vt(i){if(!i)return null;const e=ve(i);return e.ok?new URL(e.value).hostname:null}function Wt(){const i=w.c(9);let e;i[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/commerce-onboarding"},i[0]=e):e=i[0];const t=Be(e),{org:n,siteUrl:o}=t;let a;i[1]!==o?(a=Vt(o),i[1]=o,i[2]=a):a=i[2];const l=a;let r;i[3]!==n||i[4]!==o?(r=s.jsx(Yt,{requestedOrgSlug:n,siteUrl:o}),i[3]=n,i[4]=o,i[5]=r):r=i[5];let d;return i[6]!==l||i[7]!==r?(d=s.jsx(Ge.Provider,{value:l,children:r}),i[6]=l,i[7]=r,i[8]=d):d=i[8],d}function Yt(i){const e=w.c(8),{requestedOrgSlug:t,siteUrl:n}=i,{data:o,isPending:a}=ze.useSession(),l=Ie();if(a){let d;return e[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(ne,{children:s.jsx(me,{label:"Preparing commerce onboarding..."})}),e[0]=d):d=e[0],d}if(!o){const d=typeof window>"u"?"/commerce-onboarding":`${window.location.pathname}${window.location.search}`;let m;e[1]!==l?(m=l?s.jsx(He,{host:l}):void 0,e[1]=l,e[2]=m):m=e[2];let g;return e[3]!==m?(g=s.jsx(ne,{children:s.jsx(Ze,{callbackUrl:d,allowAutoLogin:!1,title:"Unlock your full diagnostic",subtitle:null,brand:m})}),e[3]=m,e[4]=g):g=e[4],g}let r;return e[5]!==t||e[6]!==n?(r=s.jsx(Zt,{requestedOrgSlug:t,siteUrl:n}),e[5]=t,e[6]=n,e[7]=r):r=e[7],r}function Zt(i){const e=w.c(40),{requestedOrgSlug:t,siteUrl:n}=i,o=Ae(),a=Qe(),[l,r]=z.useState(null),[d,m]=z.useState(null),g=a.data?.map(Xt)??[];let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f={mutationFn:Jt,retry:!1,onSuccess:c=>{m(c)}},e[0]=f):f=e[0];const u=be(f);if(a.isPending){let c;return e[1]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(ne,{children:s.jsx(me,{label:"Preparing commerce onboarding..."})}),e[1]=c):c=e[1],c}if(a.error){let c;return e[2]!==a?(c=s.jsx(ge,{title:"We could not load your organizations",description:"Retry to continue commerce setup from this page.",actionLabel:"Retry",onRetry:()=>a.refetch()}),e[2]=a,e[3]=c):c=e[3],c}const x=t?g.find(c=>c.slug===t):null;if(x){let c;return e[4]!==x||e[5]!==n?(c=s.jsx(pe,{org:x,initialSiteUrl:n}),e[4]=x,e[5]=n,e[6]=c):c=e[6],c}if(t){let c;return e[7]!==a?(c=s.jsx(ge,{title:"Organization not found",description:"We could not find that organization for your account.",actionLabel:"Retry",onRetry:()=>a.refetch()}),e[7]=a,e[8]=c):c=e[8],c}if(l){let c;return e[9]!==l||e[10]!==n?(c=s.jsx(pe,{org:l,initialSiteUrl:n}),e[9]=l,e[10]=n,e[11]=c):c=e[11],c}if(g.length===1&&g[0]){let c;return e[12]!==g[0]||e[13]!==n?(c=s.jsx(pe,{org:g[0],initialSiteUrl:n}),e[12]=g[0],e[13]=n,e[14]=c):c=e[14],c}if(g.length>1){let c;e[15]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(se,{title:"Choose an organization",description:"Select where commerce diagnostics should continue."}),e[15]=c):c=e[15];let j;e[16]===Symbol.for("react.memo_cache_sentinel")?(j=b=>r(b),e[16]=j):j=e[16];let C;return e[17]!==g?(C=s.jsx(ne,{children:s.jsxs("div",{className:"grid gap-10",children:[c,s.jsx(Ce,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:s.jsx(we,{organizations:g,selectLabel:"Continue",onSelected:j})})]})}),e[17]=g,e[18]=C):C=e[18],C}if(!d){let c;e[19]!==u?(c=()=>{u.reset(),u.mutate()},e[19]=u,e[20]=c):c=e[20];let j;return e[21]!==u||e[22]!==c?(j=s.jsx(en,{mutation:u,onRetry:c}),e[21]=u,e[22]=c,e[23]=j):j=e[23],j}const p=d;if(p?.success&&(p.status==="created"||p.status==="joined"||p.status==="already_has_organization")&&p.organization){let c;return e[24]!==p.organization||e[25]!==n?(c=s.jsx(pe,{org:p.organization,initialSiteUrl:n}),e[24]=p.organization,e[25]=n,e[26]=c):c=e[26],c}if(p?.status==="ambiguous"&&p.organizations&&p.organizations.length>0){let c;e[27]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(se,{title:"Choose an organization",description:"Your email can access more than one organization. Choose where commerce setup should continue."}),e[27]=c):c=e[27];const j=p.domain??void 0;let C;e[28]!==o||e[29]!==n?(C=(N,_)=>{Le(),r({...N,slug:_}),o({to:"/commerce-onboarding",search:{org:_,siteUrl:n}})},e[28]=o,e[29]=n,e[30]=C):C=e[30];let b;return e[31]!==p.organizations||e[32]!==j||e[33]!==C?(b=s.jsx(ne,{children:s.jsxs("div",{className:"grid gap-10",children:[c,s.jsx(Ce,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:s.jsx(we,{organizations:p.organizations,domain:j,onJoined:C})})]})}),e[31]=p.organizations,e[32]=j,e[33]=C,e[34]=b):b=e[34],b}const h=p?.error??"We could not determine a commerce organization for this account.";let y;e[35]!==u?(y=()=>{m(null),u.reset()},e[35]=u,e[36]=y):y=e[36];let v;return e[37]!==h||e[38]!==y?(v=s.jsx(ge,{title:"Commerce onboarding needs support",description:h,actionLabel:"Try again",onRetry:y}),e[37]=h,e[38]=y,e[39]=v):v=e[39],v}async function Jt(){const e=await(await fetch("/api/auth/custom/ensure-organization",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"}})).json();return e.success&&(e.status==="created"||e.status==="joined"||e.status==="already_has_organization")&&e.organization&&Le(),e}function Xt(i){return{id:i.id,name:i.name,slug:i.slug,logo:i.logo??null}}function en(i){const e=w.c(7),{mutation:t,onRetry:n}=i,o=z.useRef(!1);let a;e[0]!==t?(a=m=>{!m||o.current||(o.current=!0,t.mutate())},e[0]=t,e[1]=a):a=e[1];const l=a;if(t.error){let m;return e[2]!==n?(m=s.jsx(ge,{title:"Commerce onboarding is unavailable",description:"We could not prepare an organization for commerce setup. Retry from this page or contact support.",actionLabel:"Retry",onRetry:n}),e[2]=n,e[3]=m):m=e[3],m}let r;e[4]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(me,{label:"Preparing your commerce workspace..."}),e[4]=r):r=e[4];let d;return e[5]!==l?(d=s.jsx(ne,{children:s.jsx("div",{ref:l,children:r})}),e[5]=l,e[6]=d):d=e[6],d}function se(i){const e=w.c(8),{title:t,description:n}=i,o=Ie();let a;e[0]!==o?(a=o?s.jsx(He,{host:o}):s.jsxs("div",{children:[s.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),s.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),e[0]=o,e[1]=a):a=e[1];let l;e[2]!==n||e[3]!==t?(l=(t||n)&&s.jsxs("div",{className:"space-y-2",children:[t&&s.jsx("h1",{className:"text-2xl font-medium leading-8",children:t}),n&&s.jsx("p",{className:"text-base text-muted-foreground leading-6",children:n})]}),e[2]=n,e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==a||e[6]!==l?(r=s.jsxs("div",{className:"grid gap-10",children:[a,l]}),e[5]=a,e[6]=l,e[7]=r):r=e[7],r}function me(i){const e=w.c(3),{label:t}=i;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(le,{size:14,className:"animate-spin text-muted-foreground"}),e[0]=n):n=e[0];let o;return e[1]!==t?(o=s.jsxs("div",{className:"flex items-center gap-2 py-4",role:"status","aria-live":"polite",children:[n,s.jsx("span",{className:"text-sm text-muted-foreground",children:t})]}),e[1]=t,e[2]=o):o=e[2],o}function ge(i){const e=w.c(9),{title:t,description:n,actionLabel:o,onRetry:a}=i;let l;e[0]!==n||e[1]!==t?(l=s.jsx(se,{title:t,description:n}),e[0]=n,e[1]=t,e[2]=l):l=e[2];let r;e[3]!==o||e[4]!==a?(r=s.jsx(ie,{type:"button",size:"xl",className:"w-full",onClick:a,children:o}),e[3]=o,e[4]=a,e[5]=r):r=e[5];let d;return e[6]!==l||e[7]!==r?(d=s.jsx(ne,{children:s.jsxs("div",{className:"grid gap-10",children:[l,r]})}),e[6]=l,e[7]=r,e[8]=d):d=e[8],d}function tn(i){return i.content?.find(e=>e.text)?.text??"Commerce Discovery setup failed."}function xe(i){const e=i;if(e.isError)throw new Error(tn(e));return e.structuredContent??i}function pe(i){const e=w.c(3),{org:t,initialSiteUrl:n}=i;let o;return e[0]!==n||e[1]!==t?(o=s.jsx(ne,{children:s.jsx(Ve,{children:a=>{const{reset:l}=a;return s.jsx(We,{fallback:r=>{const{error:d,resetError:m}=r;return s.jsx(nn,{orgName:t.name,message:d instanceof Error?d.message:"We could not check Commerce Discovery setup.",onRetry:()=>{l(),m()}})},children:s.jsx(z.Suspense,{fallback:s.jsx(me,{label:"Connecting workspace..."}),children:s.jsx(sn,{org:t,initialSiteUrl:n},`${t.id}:${n??""}`)})})}})}),e[0]=n,e[1]=t,e[2]=o):o=e[2],o}function nn(i){const e=w.c(10),{orgName:t,message:n,onRetry:o}=i,a=`Commerce setup will continue for ${t}.`;let l;e[0]!==a?(l=s.jsx(se,{title:"Commerce diagnostics",description:a}),e[0]=a,e[1]=l):l=e[1];let r;e[2]!==n?(r=s.jsx(he,{message:n}),e[2]=n,e[3]=r):r=e[3];let d;e[4]!==o?(d=s.jsx(ie,{type:"button",size:"xl",className:"w-full",onClick:o,children:"Retry"}),e[4]=o,e[5]=d):d=e[5];let m;return e[6]!==l||e[7]!==r||e[8]!==d?(m=s.jsxs("div",{className:"grid gap-10",children:[l,r,d]}),e[6]=l,e[7]=r,e[8]=d,e[9]=m):m=e[9],m}function sn(i){const e=w.c(83),{org:t,initialSiteUrl:n}=i,o=Ae();let a;e[0]!==t.id||e[1]!==t.slug?(a={connectionId:Se,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=a):a=e[2];const l=ue(a),[r,d]=z.useState(n??""),[m,g]=z.useState(null),[f,u]=z.useState(null),x=z.useRef(!1),p=Pe.COMMERCE_DISCOVERY(t.id),h=Xe(t.id),y=D.commerceDiscoveryConnection(t.id,p);let v;e[3]!==p||e[4]!==l?(v=async()=>{const E=await l.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:p}});return xe(E)},e[3]=p,e[4]=l,e[5]=v):v=e[5];let c;e[6]!==y||e[7]!==v?(c={queryKey:y,queryFn:v,retry:!1},e[6]=y,e[7]=v,e[8]=c):c=e[8];const j=Ee(c),C=D.commerceDiscoveryVirtualMcp(t.id,h);let b;e[9]!==l||e[10]!==h?(b=async()=>{const E=await l.callTool({name:"COLLECTION_VIRTUAL_MCP_GET",arguments:{id:h}});return xe(E)},e[9]=l,e[10]=h,e[11]=b):b=e[11];let N;e[12]!==C||e[13]!==b?(N={queryKey:C,queryFn:b,retry:!1},e[12]=C,e[13]=b,e[14]=N):N=e[14];const _=Ee(N);let T;e[15]!==l?(T=async E=>{const L=await l.callTool({name:"COMMERCE_DISCOVERY_SETUP",arguments:{siteUrl:E}});return xe(L)},e[15]=l,e[16]=T):T=e[16];let R;e[17]!==j||e[18]!==_?(R=E=>{g(E),u(null),j.refetch(),_.refetch()},e[17]=j,e[18]=_,e[19]=R):R=e[19];let I;e[20]===Symbol.for("react.memo_cache_sentinel")?(I=E=>{u(E instanceof Error?E.message:"Commerce Discovery setup failed.")},e[20]=I):I=e[20];let O;e[21]!==T||e[22]!==R?(O={mutationFn:T,retry:!1,onSuccess:R,onError:I},e[21]=T,e[22]=R,e[23]=O):O=e[23];const S=be(O),P=!!j.data.item&&!!_.data.item;let $;e[24]!==S?($=E=>{const L=ve(E);if(!L.ok){u(L.error);return}u(null),S.mutate(L.value)},e[24]=S,e[25]=$):$=e[25];const F=$;let W;e[26]!==n||e[27]!==F||e[28]!==P?(W=E=>{!E||x.current||P||!n||(x.current=!0,F(n))},e[26]=n,e[27]=F,e[28]=P,e[29]=W):W=e[29];const G=W;let K;e[30]!==F||e[31]!==r?(K=E=>{E.preventDefault(),F(r)},e[30]=F,e[31]=r,e[32]=K):K=e[32];const U=K;let Y;e[33]!==p||e[34]!==m?.reportApp||e[35]!==h?(Y=m?.reportApp??{connectionId:p,virtualMcpId:h,toolName:et},e[33]=p,e[34]=m?.reportApp,e[35]=h,e[36]=Y):Y=e[36];const k=Y;let Z;e[37]!==o||e[38]!==t.slug||e[39]!==k.connectionId||e[40]!==k.toolName||e[41]!==k.virtualMcpId?(Z=()=>{localStorage.setItem(Ye.sidebarOpen(),JSON.stringify(!1)),o({to:"/$org/$taskId",params:{org:t.slug,taskId:crypto.randomUUID()},search:{virtualmcpid:k.virtualMcpId,main:Je(k.connectionId,k.toolName),chat:0}})},e[37]=o,e[38]=t.slug,e[39]=k.connectionId,e[40]=k.toolName,e[41]=k.virtualMcpId,e[42]=Z):Z=e[42];const B=Z;if(P){let E;return e[43]!==B||e[44]!==t||e[45]!==k?(E=s.jsx(on,{org:t,reportApp:k,onOpenReport:B}),e[43]=B,e[44]=t,e[45]=k,e[46]=E):E=e[46],E}if(n){let E;e[47]!==n?(E=ve(n),e[47]=n,e[48]=E):E=e[48];const L=E;if(!L.ok){const ee=`Commerce setup will continue for ${t.name}.`;let te;e[49]!==ee?(te=s.jsx(se,{title:"Commerce diagnostics",description:ee}),e[49]=ee,e[50]=te):te=e[50];let ae;e[51]!==L.error?(ae=s.jsx(he,{message:L.error}),e[51]=L.error,e[52]=ae):ae=e[52];let ce;e[53]!==U||e[54]!==f||e[55]!==S.isPending||e[56]!==r?(ce=s.jsx(ye,{siteUrl:r,error:f,isSubmitting:S.isPending,onSiteUrlChange:d,onSubmit:U}),e[53]=U,e[54]=f,e[55]=S.isPending,e[56]=r,e[57]=ce):ce=e[57];let fe;return e[58]!==te||e[59]!==ae||e[60]!==ce?(fe=s.jsxs("div",{className:"grid gap-10",children:[te,ae,ce]}),e[58]=te,e[59]=ae,e[60]=ce,e[61]=fe):fe=e[61],fe}const oe=`Commerce Discovery is being prepared for ${L.value}.`;let V;e[62]!==oe?(V=s.jsx(se,{title:"Commerce diagnostics",description:oe}),e[62]=oe,e[63]=V):V=e[63];let H;e[64]!==U||e[65]!==f||e[66]!==S||e[67]!==r?(H=f?s.jsxs(s.Fragment,{children:[s.jsx(he,{message:f}),s.jsx(ye,{siteUrl:r,error:null,isSubmitting:S.isPending,onSiteUrlChange:d,onSubmit:U})]}):s.jsx(me,{label:"Setting up Commerce Discovery..."}),e[64]=U,e[65]=f,e[66]=S,e[67]=r,e[68]=H):H=e[68];let A;return e[69]!==V||e[70]!==H||e[71]!==G?(A=s.jsxs("div",{ref:G,className:"grid gap-10",children:[V,H]}),e[69]=V,e[70]=H,e[71]=G,e[72]=A):A=e[72],A}const J=`Commerce setup will continue for ${t.name}.`;let Q;e[73]!==J?(Q=s.jsx(se,{title:"Commerce diagnostics",description:J}),e[73]=J,e[74]=Q):Q=e[74];let q;e[75]!==U||e[76]!==f||e[77]!==S.isPending||e[78]!==r?(q=s.jsx(ye,{siteUrl:r,error:f,isSubmitting:S.isPending,onSiteUrlChange:d,onSubmit:U}),e[75]=U,e[76]=f,e[77]=S.isPending,e[78]=r,e[79]=q):q=e[79];let X;return e[80]!==Q||e[81]!==q?(X=s.jsxs("div",{className:"grid gap-10",children:[Q,q]}),e[80]=Q,e[81]=q,e[82]=X):X=e[82],X}function ye(i){const e=w.c(22),{siteUrl:t,error:n,isSubmitting:o,onSiteUrlChange:a,onSubmit:l}=i;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("label",{className:"text-sm font-medium",htmlFor:"commerce-site-url",children:"Website URL"}),e[0]=r):r=e[0];let d;e[1]!==a?(d=y=>a(y.target.value),e[1]=a,e[2]=d):d=e[2];const m=!!n;let g;e[3]!==o||e[4]!==t||e[5]!==d||e[6]!==m?(g=s.jsx(de,{id:"commerce-site-url",type:"text",inputMode:"url",value:t,onChange:d,placeholder:"https://example.com","aria-invalid":m,disabled:o}),e[3]=o,e[4]=t,e[5]=d,e[6]=m,e[7]=g):g=e[7];let f;e[8]!==n?(f=n?s.jsx(he,{message:n}):null,e[8]=n,e[9]=f):f=e[9];let u;e[10]!==g||e[11]!==f?(u=s.jsxs("div",{className:"grid gap-2",children:[r,g,f]}),e[10]=g,e[11]=f,e[12]=u):u=e[12];let x;e[13]!==o?(x=o?s.jsxs(s.Fragment,{children:[s.jsx(le,{size:14,className:"animate-spin"}),"Setting up"]}):s.jsxs(s.Fragment,{children:["Continue",s.jsx(Ue,{size:16})]}),e[13]=o,e[14]=x):x=e[14];let p;e[15]!==o||e[16]!==x?(p=s.jsx(ie,{type:"submit",size:"xl",className:"w-full",disabled:o,children:x}),e[15]=o,e[16]=x,e[17]=p):p=e[17];let h;return e[18]!==l||e[19]!==u||e[20]!==p?(h=s.jsxs("form",{className:"grid gap-4",onSubmit:l,children:[u,p]}),e[18]=l,e[19]=u,e[20]=p,e[21]=h):h=e[21],h}function on(i){const e=w.c(6),{org:t,reportApp:n,onOpenReport:o}=i;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(se,{}),e[0]=a):a=e[0];const l=!n.virtualMcpId;let r;return e[1]!==o||e[2]!==t||e[3]!==n.connectionId||e[4]!==l?(r=s.jsxs("div",{className:"flex h-[calc(100dvh-3rem)] flex-col gap-10 md:grid md:h-auto",children:[a,s.jsx(Bt,{org:t,cdConnectionId:n.connectionId,reportDisabled:l,onOpenReport:o})]}),e[1]=o,e[2]=t,e[3]=n.connectionId,e[4]=l,e[5]=r):r=e[5],r}function he(i){const e=w.c(2),{message:t}=i;let n;return e[0]!==t?(n=s.jsx("p",{className:"text-sm leading-5 text-destructive",role:"alert",children:t}),e[0]=t,e[1]=n):n=e[1],n}export{ds as default,Ie as useCommerceSiteHost};
|
package/dist/client/assets/{connect-desktop-dialog-CN-ahIvP.js → connect-desktop-dialog-DzyRhy80.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as b,w as N,K as k,k as z,j as s,r as M,B as T,l as v}from"./index-
|
|
1
|
+
import{c as b,w as N,K as k,k as z,j as s,r as M,B as T,l as v}from"./index-C1yj8oW9.js";import{a as I,b as S,D,c as E,d as R}from"./dialog-D4-cpiIq.js";import{S as _}from"./chat-context-D6S41DOV.js";import{i as $}from"./ChevronUp-CzO_7LvF.js";import{a as A}from"./Eye-BBVg-SSa.js";import{u as B}from"./studio-tools-cTyVqaHA.js";const L={online:!1,capabilities:[],ready:!1};function F(){const i=b.c(7),{org:e}=N(),l=B();let o;i[0]!==e.id?(o=k.currentLink(e.id),i[0]=e.id,i[1]=o):o=i[1];let t;i[2]!==l?(t=async()=>{const f=await l.call("LINK_CURRENT_GET",{});return f?{...f,ready:!0}:{...L,ready:!0}},i[2]=l,i[3]=t):t=i[3];let n;i[4]!==o||i[5]!==t?(n={queryKey:o,queryFn:t,staleTime:4e3,refetchInterval:5e3,refetchOnWindowFocus:!0},i[4]=o,i[5]=t,i[6]=n):n=i[6];const{data:p}=z(n);return p??L}function K(i){const e=b.c(3),{size:l}=i,o=l===void 0?16:l;let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx("path",{d:"M13 12L18.5 5M7.63965 3L12.5 12L13.6865 3M4.48381 6.71679L11.9872 12M3 12L11.9872 12.473M12.2244 13.177L7 20M4.84194 16.8682L11.2824 12.9758M11.5 21L12.665 13.177M21 14L13.1846 12.668M21 10.5788L13 12.3223M16.779 19.646L12.8876 13.3772M19.3566 18.207L13.313 12.9893"}),e[0]=t):t=e[0];let n;return e[1]!==o?(n=s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:o,height:o,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:t}),e[1]=o,e[2]=n):n=e[2],n}function O(i){const e=b.c(3),{size:l}=i,o=l===void 0?16:l;let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx("path",{clipRule:"evenodd",d:"M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z"}),e[0]=t):t=e[0];let n;return e[1]!==o?(n=s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:o,height:o,fill:"currentColor",fillRule:"evenodd","aria-hidden":"true",children:t}),e[1]=o,e[2]=n):n=e[2],n}const y="bunx decocms@latest link",w=[{capability:"claude-code",label:"Claude Code",description:"Runs through the Claude Code CLI",icon:s.jsx(K,{size:18})},{capability:"codex",label:"Codex",description:"Runs through the Codex CLI",icon:s.jsx(O,{size:18})}];function Q(i){return w.filter(e=>i.includes(e.capability)).map(e=>e.label)}function U(i){const e=b.c(21),{open:l,onOpenChange:o}=i,t=F(),[n,p]=M.useState(!1),f=t.hostname??t.machineId??"Your desktop",j=t.online?`Connected to ${f}`:"Connect your desktop";let a;e[0]!==j?(a=s.jsx(I,{children:j}),e[0]=j,e[1]=a):a=e[1];const C=t.online?"This machine provides the following local agents.":"Run this command in your desktop terminal. The dialog will close once your desktop is online.";let r;e[2]!==C?(r=s.jsx(S,{children:C}),e[2]=C,e[3]=r):r=e[3];let c;e[4]!==a||e[5]!==r?(c=s.jsxs(D,{children:[a,r]}),e[4]=a,e[5]=r,e[6]=c):c=e[6];let d;e[7]!==n||e[8]!==t.online?(d=!t.online&&s.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-muted px-3 py-2 font-mono text-sm",children:[s.jsx("span",{className:"flex-1",children:y}),s.jsx(T,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>{navigator.clipboard.writeText(y),p(!0),setTimeout(()=>p(!1),1500)},children:n?s.jsx($,{size:14}):s.jsx(A,{size:14})})]}),e[7]=n,e[8]=t.online,e[9]=d):d=e[9];let u;e[10]!==t.capabilities||e[11]!==t.online?(u=t.online?s.jsx("div",{className:"flex flex-col gap-3 text-sm",children:s.jsx("div",{className:"flex flex-col gap-2",children:w.map(x=>{const g=t.capabilities.includes(x.capability);return s.jsxs("div",{className:v("flex items-center gap-3 rounded-md border px-3 py-2",g?"border-border bg-background text-foreground":"border-border/60 bg-muted/40 text-muted-foreground"),children:[s.jsx("div",{className:v("flex size-6 items-center justify-center",g?"text-foreground":"text-muted-foreground"),children:x.icon}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"font-medium",children:x.label}),s.jsx("p",{className:"text-xs text-muted-foreground",children:g?x.description:"Not detected"})]}),s.jsx("span",{className:v("size-2 rounded-full",g?"bg-success":"bg-muted-foreground/30")})]},x.capability)})})}):s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(_,{size:"sm"}),"Waiting for desktop…"]}),e[10]=t.capabilities,e[11]=t.online,e[12]=u):u=e[12];let m;e[13]!==c||e[14]!==d||e[15]!==u?(m=s.jsxs(E,{className:"sm:max-w-md",children:[c,d,u]}),e[13]=c,e[14]=d,e[15]=u,e[16]=m):m=e[16];let h;return e[17]!==o||e[18]!==l||e[19]!==m?(h=s.jsx(R,{open:l,onOpenChange:o,children:m}),e[17]=o,e[18]=l,e[19]=m,e[20]=h):h=e[20],h}export{U as C,K as a,O as b,F as u,Q as v};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as _}from"./connection-slug-eyAPH6o3.js";import{c as R,w as $,b0 as k,K as D,l as w,j as x}from"./index-
|
|
1
|
+
import{g as _}from"./connection-slug-eyAPH6o3.js";import{c as R,w as $,b0 as k,K as D,l as w,j as x}from"./index-C1yj8oW9.js";import{u as K}from"./use-registry-connections-COP2SiNd.js";import{b as Q}from"./use-organization-settings-B-FYwlct.js";import{S as E,e as F}from"./use-mcp-client-90IJIS7G.js";import{u as H}from"./useInfiniteQuery-BxIrRxsB.js";import{i as q,f as G}from"./extract-connection-data-BrfuWfn9.js";import{C as U}from"./card-kDiEfTw9.js";import{I as V}from"./integration-icon-CSYS5mut.js";function ae(s){const e=new Map;for(const o of s){const l=_(o),r=e.get(l);r?r.push(o):e.set(l,[o])}const t=[],u=new Set;for(const o of s){const l=_(o);if(u.has(l))continue;u.add(l);const r=e.get(l),m=r[0];r.length===1?t.push({type:"single",connection:m}):t.push({type:"group",key:l,icon:m.icon,title:m.app_name?m.title.replace(/\s*\(\d+\)\s*$/,""):m.title,connections:r})}return t}function ce(){const s=R.c(6),e=K(),t=Q(),u=$().project.enabledPlugins??[];let o;if(s[0]!==u||s[1]!==t||s[2]!==e){let l;s[4]!==t?(l=r=>t(r.id),s[4]=t,s[5]=l):l=s[5],o=e.filter(l).map(X),u.includes("private-registry")&&t(E)&&o.push({id:E,title:"Private Registry",icon:null}),s[0]=u,s[1]=t,s[2]=e,s[3]=o}else o=s[3];return o}function X(s){return{id:s.id,title:s.title,icon:s.icon}}const Y=24,S=3;function A(s){return s.id.includes("community-registry")}function z(s){const e=s?.trim();if(e)return{operator:"or",conditions:[{field:["title"],operator:"contains",value:e},{field:["description"],operator:"contains",value:e},{field:["name"],operator:"contains",value:e},{field:["server","title"],operator:"contains",value:e}]}}function T(s,e,t,u,o){const l=s.map(c=>c.id).sort().join(","),r=z(o),{data:m,fetchNextPage:d,hasNextPage:f,isFetchingNextPage:p,isLoading:b}=H({queryKey:D.storeDiscovery(e,`${l}:${o??""}`),queryFn:async({pageParam:c})=>{const n=c??{};return await Promise.all(s.map(async i=>{const y=n[i.id];if(y==="EXHAUSTED")return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]};const j=q(i.id,e);let h;for(let v=0;v<S;v++){let C=null;try{C=await F({connectionId:i.id,orgId:e,orgSlug:t});const I={limit:Y};y&&(I.cursor=y),r&&(I.where=r);const P=await C.callTool({name:j,arguments:I}),N=P.structuredContent??P,M=N.nextCursor||N.cursor||void 0,L=G(N?[N]:[]);return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:L,nextCursor:M}}catch(I){h=I}finally{await C?.close().catch(()=>{})}}return console.warn(`[useMergedStoreDiscovery] Registry "${i.title}" (${i.id}) failed after ${S} attempts:`,h),{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]}}))},initialPageParam:{},getNextPageParam:c=>{const n={};let a=!1;for(const i of c)i.registryId&&(i.nextCursor?(n[i.registryId]=i.nextCursor,a=!0):n[i.registryId]="EXHAUSTED");return a?n:void 0},staleTime:3600*1e3,placeholderData:k,retry:!1,enabled:s.length>0}),g=[];if(m?.pages)for(const c of m.pages)for(const n of c)for(const a of n.items)g.push({...a,_sourceName:a._sourceName??n.registryTitle,_sourceIcon:a._sourceIcon??n.registryIcon,_registryId:a._registryId??n.registryId});return{items:g,hasMore:f??!1,isLoadingMore:p,isInitialLoading:b,fetchNextPage:()=>{f&&!p&&d()}}}function ue(s,e){const t=R.c(16),{org:u}=$();let o;t[0]!==s?(o=s.filter(Z),t[0]=s,t[1]=o):o=t[1];const l=o;let r;t[2]!==s?(r=s.filter(W),t[2]=s,t[3]=r):r=t[3];const m=r,d=T(l,u.id,u.slug,!0,e),f=T(m,u.id,u.slug,!0,e);let p;if(t[4]!==f.items||t[5]!==d.items){const y=new Set;p=[];const j=[...d.items,...f.items];for(const h of j){const v=`${h._registryId}:${h.id}`;y.has(v)||(y.add(v),p.push(h))}t[4]=f.items,t[5]=d.items,t[6]=p}else p=t[6];const b=d.isInitialLoading||f.isInitialLoading,g=d.isLoadingMore||f.isLoadingMore,c=d.hasMore||f.hasMore;let n;t[7]!==f||t[8]!==d?(n=()=>{d.hasMore&&d.fetchNextPage(),f.hasMore&&f.fetchNextPage()},t[7]=f,t[8]=d,t[9]=n):n=t[9];const a=n;let i;return t[10]!==c||t[11]!==b||t[12]!==g||t[13]!==p||t[14]!==a?(i={items:p,hasMore:c,isLoadingMore:g,isInitialLoading:b,loadMore:a},t[10]=c,t[11]=b,t[12]=g,t[13]=p,t[14]=a,t[15]=i):i=t[15],i}function W(s){return A(s)}function Z(s){return!A(s)}function fe(s){const e=R.c(37),{connection:t,onClick:u,headerActions:o,headerActionsAlwaysVisible:l,body:r,footer:m,className:d,fallbackIcon:f}=s,p=l===void 0?!1:l,b=u&&"hover:bg-muted/50";let g;e[0]!==d||e[1]!==b?(g=w("cursor-pointer transition-colors group overflow-hidden flex flex-col h-full",b,d),e[0]=d,e[1]=b,e[2]=g):g=e[2];let c;e[3]!==t.icon||e[4]!==t.title||e[5]!==f?(c=x.jsx(V,{icon:t.icon,name:t.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:f}),e[3]=t.icon,e[4]=t.title,e[5]=f,e[6]=c):c=e[6];let n;e[7]!==o||e[8]!==p?(n=o&&x.jsx("div",{className:w("transition-opacity",!p&&"sm:opacity-0 sm:group-hover:opacity-100"),onClick:J,children:o}),e[7]=o,e[8]=p,e[9]=n):n=e[9];let a;e[10]!==n?(a=x.jsx("div",{className:"relative",children:n}),e[10]=n,e[11]=a):a=e[11];let i;e[12]!==c||e[13]!==a?(i=x.jsxs("div",{className:"flex items-start justify-between",children:[c,a]}),e[12]=c,e[13]=a,e[14]=i):i=e[14];let y;e[15]!==t.title?(y=x.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:t.title}),e[15]=t.title,e[16]=y):y=e[16];const j=t.description||"No description";let h;e[17]!==j?(h=x.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:j}),e[17]=j,e[18]=h):h=e[18];let v;e[19]!==h||e[20]!==y?(v=x.jsxs("div",{className:"flex flex-col gap-1",children:[y,h]}),e[19]=h,e[20]=y,e[21]=v):v=e[21];let C;e[22]!==r?(C=r&&x.jsx("div",{children:r}),e[22]=r,e[23]=C):C=e[23];let I;e[24]!==v||e[25]!==C||e[26]!==i?(I=x.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[i,v,C]}),e[24]=v,e[25]=C,e[26]=i,e[27]=I):I=e[27];let P;e[28]!==m?(P=m&&x.jsx("div",{className:"border-t border-border mt-auto",children:x.jsx("div",{className:"h-14 flex items-center p-4.5",onClick:B,children:m})}),e[28]=m,e[29]=P):P=e[29];let N;e[30]!==I||e[31]!==P?(N=x.jsxs("div",{className:"flex flex-col flex-1",children:[I,P]}),e[30]=I,e[31]=P,e[32]=N):N=e[32];let M;return e[33]!==u||e[34]!==N||e[35]!==g?(M=x.jsx(U,{className:g,onClick:u,children:N}),e[33]=u,e[34]=N,e[35]=g,e[36]=M):M=e[36],M}function B(s){return s.stopPropagation()}function J(s){return s.stopPropagation()}export{fe as C,ue as a,ae as g,ce as u};
|