decocms 2.302.0 → 2.302.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-Ckdo-RmI.js → AlertCircle-BFJK99tM.js} +1 -1
- package/dist/client/assets/{ArrowNarrowLeft-Di3ykEwz.js → ArrowNarrowLeft-DCbP5K-g.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-DMSP1Bv9.js → ArrowUpRight-BvzWf0q7.js} +1 -1
- package/dist/client/assets/{CheckCircle-C208sPuy.js → CheckCircle-qqOIolWc.js} +1 -1
- package/dist/client/assets/{ChevronDown-BrUt0Alw.js → ChevronDown-BMTA9_Ap.js} +1 -1
- package/dist/client/assets/{ChevronRight-CGM8153k.js → ChevronRight-QeeRSp8z.js} +1 -1
- package/dist/client/assets/{ChevronUp-CaGbgeVw.js → ChevronUp-BHiGg6ZY.js} +1 -1
- package/dist/client/assets/{Container-4Wg94L7I.js → Container-CIDvyJX8.js} +1 -1
- package/dist/client/assets/{DotsVertical-DvRrSQFB.js → DotsVertical-Bd2_5HYZ.js} +1 -1
- package/dist/client/assets/{LinkExternal01-Y0gD7h2D.js → LinkExternal01-DCnMv_g7.js} +1 -1
- package/dist/client/assets/{Lock01-Dch0eKvp.js → Lock01-Ds-YEZnN.js} +1 -1
- package/dist/client/assets/{Palette-CgqIrvg1.js → Palette-DescRwe0.js} +1 -1
- package/dist/client/assets/{Play-CtLPh-DP.js → Play-Ch3KWC7Z.js} +1 -1
- package/dist/client/assets/{Plus-Bz8pOCrF.js → Plus-gLdNtuBE.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-KEgE6miP.js → RefreshCcw01-DKf5Q7r6.js} +1 -1
- package/dist/client/assets/{SearchMd-CVG2gI0e.js → SearchMd-BI1BY0Xc.js} +1 -1
- package/dist/client/assets/{Settings02-BaHlQiS7.js → Settings02-D0o0GA4h.js} +1 -1
- package/dist/client/assets/{Shield01-CCtHgQuh.js → Shield01-btPXI3TS.js} +1 -1
- package/dist/client/assets/{Star01-C90LkDZI.js → Star01-DInOTW7T.js} +1 -1
- package/dist/client/assets/{Sun-BxF03d45.js → Sun-DLagUbKM.js} +1 -1
- package/dist/client/assets/{Tool01-DA28S3sH.js → Tool01-D1xeep7h.js} +1 -1
- package/dist/client/assets/{Trash01-DR27iFf1.js → Trash01-OgQVP2St.js} +1 -1
- package/dist/client/assets/{User01-BujZcMbB.js → User01-Cr_qCqW_.js} +1 -1
- package/dist/client/assets/{Users03-CDTGNBm2.js → Users03-DVwMLxYo.js} +1 -1
- package/dist/client/assets/{X-DoHhdWpr.js → X-fvjwb2RC.js} +1 -1
- package/dist/client/assets/{XCircle-Ds5a6kuE.js → XCircle-CVED_3Ss.js} +1 -1
- package/dist/client/assets/{XClose-C9Qfd8kZ.js → XClose-C1T9ODT_.js} +1 -1
- package/dist/client/assets/{Zap-BtQ-TzwR.js → Zap-u543Wk9m.js} +1 -1
- package/dist/client/assets/{ZapSquare-DKBv2Oh1.js → ZapSquare-B03aoE62.js} +1 -1
- package/dist/client/assets/{accordion-isIiC_Tx.js → accordion-zoDibAHc.js} +1 -1
- package/dist/client/assets/{agent-icon-DyZrsMHV.js → agent-icon-B5EEcofO.js} +1 -1
- package/dist/client/assets/{agents-list-BsLb9TAC.js → agents-list-KuDCGevU.js} +1 -1
- package/dist/client/assets/ai-providers-3jYxMl4T.js +1 -0
- package/dist/client/assets/{alert-dialog-Cm675fIp.js → alert-dialog-B6JtF6Oy.js} +1 -1
- package/dist/client/assets/{auth-catchall-CS4MwL4l.js → auth-catchall-CnOfYh4q.js} +1 -1
- package/dist/client/assets/{automation-list-row-BZZkY79g.js → automation-list-row-Ce2nqVRS.js} +1 -1
- package/dist/client/assets/{automations-EJo_cmjx.js → automations-3wicI9sJ.js} +1 -1
- package/dist/client/assets/{avatar-ejiIeuvT.js → avatar-B5CcOSaZ.js} +1 -1
- package/dist/client/assets/{badge-BCkY0osU.js → badge-Vn5olYFX.js} +1 -1
- package/dist/client/assets/{brand-context-B-WDg8W9.js → brand-context-JEzNXnYS.js} +1 -1
- package/dist/client/assets/{card-KrDyjT9B.js → card-DHIGW2Gm.js} +1 -1
- package/dist/client/assets/{chat-context-D2ImJV4_.js → chat-context-DZ4ItXeY.js} +1 -1
- package/dist/client/assets/{checkbox-DdEbgSXy.js → checkbox-DBBm6J90.js} +1 -1
- package/dist/client/assets/{collection-detail-C1_S4Wby.js → collection-detail-CYmy41EW.js} +1 -1
- package/dist/client/assets/{collection-display-button-E32kWSQs.js → collection-display-button-DifdWxZd.js} +1 -1
- package/dist/client/assets/{collection-search-CjRFx7RJ.js → collection-search-EJTdRq0l.js} +1 -1
- package/dist/client/assets/{collection-search-CZ45K7il.js → collection-search-dr2VH0_A.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-D1SV8oPy.js → collection-table-wrapper-BNTrWb5l.js} +1 -1
- package/dist/client/assets/{collection-tabs-Ds23HSH3.js → collection-tabs-BhSzOngN.js} +1 -1
- package/dist/client/assets/{collections-ClBK8Wc7.js → collections-x4R34QWs.js} +1 -1
- package/dist/client/assets/{command-s8ocnxUp.js → command-dTUEruN1.js} +1 -1
- package/dist/client/assets/{connection-card-BOvFz0Xe.js → connection-card-DHMMRnIO.js} +1 -1
- package/dist/client/assets/{connection-detail-C9dHwvHg.js → connection-detail-B_69g2MY.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-CaMgKEzX.js → connection-form-helpers-CSnwVczG.js} +1 -1
- package/dist/client/assets/{connections-D4jzt08s.js → connections-DL-vzzoi.js} +1 -1
- package/dist/client/assets/{constants-CVSLlYnf.js → constants-BVU634u9.js} +1 -1
- package/dist/client/assets/{constants-Bj37EyXz.js → constants-DhipgDPU.js} +1 -1
- package/dist/client/assets/{dialog-B9mCJ9u4.js → dialog-Cc5-s5cq.js} +1 -1
- package/dist/client/assets/{domain-settings-E-eT2C2j.js → domain-settings-Ddgt5zKc.js} +1 -1
- package/dist/client/assets/{drawer-ChRbi3da.js → drawer-CYKJkhyy.js} +1 -1
- package/dist/client/assets/{dropdown-menu-BACFhEWG.js → dropdown-menu-BdezCavF.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-3-VjJB_9.js → dynamic-plugin-layout-BPGpVId2.js} +1 -1
- package/dist/client/assets/{empty-state-Cd5nlZi8.js → empty-state-B-SDOSco.js} +1 -1
- package/dist/client/assets/{empty-state-CZHe0KuE.js → empty-state-CGM_VDGy.js} +1 -1
- package/dist/client/assets/{extract-connection-data-DWwyWigS.js → extract-connection-data-CGFCZBB1.js} +1 -1
- package/dist/client/assets/{features-CeatQ7gW.js → features-D36LrRkp.js} +1 -1
- package/dist/client/assets/{form-Ouizhyq3.js → form-BlgCJwww.js} +1 -1
- package/dist/client/assets/{general-DzoGsnH3.js → general-ByIyj3-X.js} +1 -1
- package/dist/client/assets/{index-RbRZk6ng.js → index-BEdZpL1a.js} +3 -3
- package/dist/client/assets/{index-RBXYZ0o1.js → index-BGvMfUr2.js} +2 -2
- package/dist/client/assets/{index-fNW0SHRb.js → index-BizlRsAk.js} +1 -1
- package/dist/client/assets/{index-D2mful5a.js → index-C-49LFOm.js} +1 -1
- package/dist/client/assets/{index-BSVWgf11.js → index-C4B8wMiM.js} +1 -1
- package/dist/client/assets/{index-6mSFDvZg.js → index-CQbT2-AO.js} +1 -1
- package/dist/client/assets/index-CSOTvYaA.js +1 -0
- package/dist/client/assets/{index-CAaoqFy7.js → index-Ce3V05Jd.js} +1 -1
- package/dist/client/assets/{index-By6SCvFJ.js → index-CxcuSo6g.js} +1 -1
- package/dist/client/assets/{index-2Scfn4rN.js → index-DL3V_XAA.js} +1 -1
- package/dist/client/assets/{index-D-Rzrt74.js → index-DRSFVCQG.js} +1 -1
- package/dist/client/assets/{index-af7Ms30x.js → index-DWnDHmtK.js} +1 -1
- package/dist/client/assets/{index-Dax7JqXc.js → index-DcnDvcwB.js} +1 -1
- package/dist/client/assets/{index-D_jFKVK5.js → index-QpbQL5yY.js} +1 -1
- package/dist/client/assets/{index-BS2wRqRL.js → index-gtAbs0Sc.js} +1 -1
- package/dist/client/assets/{index-Da_yXMmn.js → index-iJW-G2eC.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver--3YinOmX.js → infiniteQueryObserver-B9_hQDN4.js} +1 -1
- package/dist/client/assets/{input-CbOPFA2Y.js → input-r-FVR1hH.js} +1 -1
- package/dist/client/assets/{integration-icon-BUk_AQZb.js → integration-icon-Btl0P6Zi.js} +1 -1
- package/dist/client/assets/{label-BSzDqn8Z.js → label-CDE7or5s.js} +1 -1
- package/dist/client/assets/{layout-Cbq9XvLR.js → layout-DtEpOSua.js} +1 -1
- package/dist/client/assets/{lean-canvas-recruit-modal-C1G1_2au.js → lean-canvas-recruit-modal-70F-bJzI.js} +1 -1
- package/dist/client/assets/{login-DCSomhku.js → login-D6mlZnBr.js} +1 -1
- package/dist/client/assets/{members-DCjU7uUX.js → members-B44F43x3.js} +1 -1
- package/dist/client/assets/{monaco-editor-9MzrlDzJ.js → monaco-editor-D9GcAVz1.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-DLYFByVX.js → monitoring-stats-row-9xBJedBt.js} +1 -1
- package/dist/client/assets/{oauth-callback-CRR_q1-_.js → oauth-callback-BzeoI5mr.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-BcbJ_xLj.js → oauth-callback-ai-provider-B7fEhkFp.js} +1 -1
- package/dist/client/assets/{onboarding-CSHiENj3.js → onboarding-C_yRTGs2.js} +1 -1
- package/dist/client/assets/{org-layout-BQC1siIb.js → org-layout-xgtHVrWJ.js} +1 -1
- package/dist/client/assets/{org-plugin-layout-Cq_aAA1I.js → org-plugin-layout-DjYWXXLz.js} +1 -1
- package/dist/client/assets/{pair-C1Euf0mI.js → pair-TlV_Y8fY.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-DXXmUyFw.js → plugin-empty-state-wcs5uyqa.js} +1 -1
- package/dist/client/assets/{plugin-header-C-jLY3z-.js → plugin-header-D00boOwo.js} +1 -1
- package/dist/client/assets/{plugin-layout-oOgBG5IP.js → plugin-layout-kZMGzqtV.js} +1 -1
- package/dist/client/assets/{popover-DC-xnLvX.js → popover-CENSHA5K.js} +1 -1
- package/dist/client/assets/{profile-DDufPRp2.js → profile-CmCDElOt.js} +1 -1
- package/dist/client/assets/{project-app-view-CFJH3_Mb.js → project-app-view-CXSUfW9V.js} +1 -1
- package/dist/client/assets/registry-M9hpVTeC.js +2 -0
- package/dist/client/assets/{registry-layout-Bt8B6WZA.js → registry-layout-jKwqcMMI.js} +1 -1
- package/dist/client/assets/{required-auth-layout-DxzQFSub.js → required-auth-layout-ByW838Wg.js} +1 -1
- package/dist/client/assets/{reset-password-MIshTkTR.js → reset-password-Cn2aTTGW.js} +1 -1
- package/dist/client/assets/{roles-Cvj_YJQC.js → roles-BOss14ty.js} +1 -1
- package/dist/client/assets/{scroll-area-DwYUYaC4.js → scroll-area-KyXayDS_.js} +1 -1
- package/dist/client/assets/{search-input-CDHPjad4.js → search-input-LdRGRYga.js} +1 -1
- package/dist/client/assets/{select-8rqyX4yY.js → select-CKhnD_dJ.js} +1 -1
- package/dist/client/assets/{select-model-D8dh5nJb.js → select-model-DSERjqbn.js} +1 -1
- package/dist/client/assets/{settings-layout-BgvnZybr.js → settings-layout-DmMGjApo.js} +1 -1
- package/dist/client/assets/{settings-section-HtqNxJHw.js → settings-section-BSfLZRSf.js} +1 -1
- package/dist/client/assets/{shell-layout-A5EcvKv7.js → shell-layout-BTN4hGpk.js} +1 -1
- package/dist/client/assets/{skeleton-DMH6jOOd.js → skeleton-PrntJAKB.js} +1 -1
- package/dist/client/assets/{sso-DNkuSn5z.js → sso-Dt9Y-guZ.js} +1 -1
- package/dist/client/assets/{store-CLctbbGQ.js → store-lsrePhQV.js} +1 -1
- package/dist/client/assets/store-registry-BiQl34xL.js +2 -0
- package/dist/client/assets/{switch-ClAJkK47.js → switch-DIPW9oSx.js} +1 -1
- package/dist/client/assets/{table-Cwoyxo1t.js → table-CyZKmPMu.js} +1 -1
- package/dist/client/assets/{tabs-Bw1wvZLY.js → tabs-Cnic4mBc.js} +1 -1
- package/dist/client/assets/{task-status-BwNSpCPo.js → task-status-B4S1zCuU.js} +1 -1
- package/dist/client/assets/{textarea-grS6dvzw.js → textarea-DWnLf30W.js} +1 -1
- package/dist/client/assets/{toggle-group-CrcMNw0M.js → toggle-group-Bw-pO6dq.js} +1 -1
- package/dist/client/assets/{tools-list-B0HLMLQ4.js → tools-list-Ddp6jSMU.js} +1 -1
- package/dist/client/assets/{tooltip-l5gvSkP4.js → tooltip-8sj0FPxK.js} +1 -1
- package/dist/client/assets/{types-sSi2ZBaJ.js → types-CPAcvDGA.js} +1 -1
- package/dist/client/assets/{use-ai-providers-NGnYqkjZ.js → use-ai-providers-TD5f5keD.js} +1 -1
- package/dist/client/assets/{use-collections-XPoz4bQ4.js → use-collections-DbJUoPI1.js} +1 -1
- package/dist/client/assets/{use-connection-KIdOMYYB.js → use-connection-EBpfvjCE.js} +1 -1
- package/dist/client/assets/{use-copy-BEHVkdeL.js → use-copy-DNbmGYTy.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-B7_E4z0n.js → use-create-virtual-mcp-oePzdlSN.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-BB7Ade2O.js → use-decopilot-events-CTJPtEAG.js} +1 -1
- package/dist/client/assets/{use-delete-connection-ClDFtLys.js → use-delete-connection-DeDsXAxU.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-BDQxIw_a.js → use-infinite-scroll-Blb-Zkmq.js} +1 -1
- package/dist/client/assets/{use-list-state-C-KeL9mx.js → use-list-state-Bt40g0pF.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-CvCxJUq7.js → use-mcp-tools-yGAchpt7.js} +1 -1
- package/dist/client/assets/{use-members-CkSy6C1r.js → use-members-elTW2IMS.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-h3H44Uqx.js → use-navigate-to-agent-XL440g7Q.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-C4jj13SA.js → use-org-auth-client-kuXtTIo4.js} +1 -1
- package/dist/client/assets/{use-org-sso-CzzIybhJ.js → use-org-sso-DzmlEuU4.js} +1 -1
- package/dist/client/assets/{use-organization-roles-BFtXNMrL.js → use-organization-roles-B18S9BiQ.js} +1 -1
- package/dist/client/assets/{use-organization-settings-DQaAYRBc.js → use-organization-settings-vi5z2D5l.js} +1 -1
- package/dist/client/assets/{use-registry-connections-Bw9vDyMz.js → use-registry-connections-vdam_2jo.js} +1 -1
- package/dist/client/assets/{use-status-sounds-Cb3X5ULl.js → use-status-sounds-DVkOG6QZ.js} +1 -1
- package/dist/client/assets/{use-tasks-CU4nRSG8.js → use-tasks-BSCdum36.js} +1 -1
- package/dist/client/assets/{use-view-mode-dkizD-HG.js → use-view-mode-IRjBIGSa.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-D1lThWcu.js → use-virtual-mcp-BOr32Cw9.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-D6CYdRiz.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-hnE5tAGb.js +1 -0
- package/dist/client/assets/{user-BuZ7YF8y.js → user-Cr4eZetj.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-CV8uckCG.js → view-mode-toggle-DqaIt4c7.js} +1 -1
- package/dist/client/assets/workflow-detail-CHEOWOns.js +1 -0
- package/dist/client/assets/{workflow-YqAcYHT8.js → workflow-f-0F4vKd.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +4 -4
- package/dist/server/node_modules/ansi-regex/index.d.ts +33 -0
- package/dist/server/node_modules/ansi-regex/index.js +14 -0
- package/dist/server/node_modules/ansi-regex/package.json +61 -0
- package/dist/server/node_modules/ansi-regex/readme.md +66 -0
- package/dist/server/node_modules/emoji-regex/LICENSE-MIT.txt +20 -0
- package/dist/server/node_modules/emoji-regex/README.md +107 -0
- package/dist/server/node_modules/emoji-regex/index.d.ts +3 -0
- package/dist/server/node_modules/emoji-regex/index.js +4 -0
- package/dist/server/node_modules/emoji-regex/index.mjs +4 -0
- package/dist/server/node_modules/emoji-regex/package.json +45 -0
- package/dist/server/node_modules/environment/index.d.ts +74 -0
- package/dist/server/node_modules/environment/index.js +47 -0
- package/dist/server/node_modules/{slice-ansi → environment}/license +0 -1
- package/dist/server/node_modules/environment/package.json +74 -0
- package/dist/server/node_modules/environment/readme.md +94 -0
- package/dist/server/node_modules/escape-string-regexp/index.d.ts +18 -0
- package/dist/server/node_modules/escape-string-regexp/index.js +11 -0
- package/dist/server/node_modules/escape-string-regexp/license +9 -0
- package/dist/server/node_modules/escape-string-regexp/package.json +43 -0
- package/dist/server/node_modules/escape-string-regexp/readme.md +29 -0
- package/dist/server/node_modules/is-fullwidth-code-point/index.d.ts +17 -0
- package/dist/server/node_modules/is-fullwidth-code-point/index.js +12 -0
- package/dist/server/node_modules/is-fullwidth-code-point/license +9 -0
- package/dist/server/node_modules/is-fullwidth-code-point/package.json +53 -0
- package/dist/server/node_modules/is-fullwidth-code-point/readme.md +31 -0
- package/dist/server/node_modules/is-unicode-supported/index.d.ts +12 -0
- package/dist/server/node_modules/is-unicode-supported/index.js +21 -0
- package/dist/server/node_modules/is-unicode-supported/license +9 -0
- package/dist/server/node_modules/is-unicode-supported/package.json +47 -0
- package/dist/server/node_modules/is-unicode-supported/readme.md +35 -0
- package/dist/server/node_modules/pg-int8/LICENSE +13 -0
- package/dist/server/node_modules/pg-int8/README.md +16 -0
- package/dist/server/node_modules/pg-int8/index.js +100 -0
- package/dist/server/node_modules/pg-int8/package.json +24 -0
- package/dist/server/node_modules/postgres-interval/index.d.ts +20 -0
- package/dist/server/node_modules/postgres-interval/index.js +125 -0
- package/dist/server/node_modules/postgres-interval/license +21 -0
- package/dist/server/node_modules/postgres-interval/package.json +36 -0
- package/dist/server/node_modules/postgres-interval/readme.md +48 -0
- package/dist/server/node_modules/restore-cursor/index.d.ts +11 -0
- package/dist/server/node_modules/restore-cursor/index.js +11 -0
- package/dist/server/node_modules/restore-cursor/license +9 -0
- package/dist/server/node_modules/restore-cursor/package.json +55 -0
- package/dist/server/node_modules/restore-cursor/readme.md +31 -0
- package/dist/server/node_modules/string-width/index.d.ts +39 -0
- package/dist/server/node_modules/string-width/index.js +82 -0
- package/dist/server/node_modules/string-width/license +9 -0
- package/dist/server/node_modules/string-width/package.json +64 -0
- package/dist/server/node_modules/string-width/readme.md +66 -0
- package/dist/server/server.js +3 -3
- package/package.json +1 -1
- package/dist/client/assets/ai-providers-kn1jtlDC.js +0 -1
- package/dist/client/assets/index-YEyIkTha.js +0 -1
- package/dist/client/assets/registry-DtbT4EGB.js +0 -2
- package/dist/client/assets/store-registry-9hOokAwZ.js +0 -2
- package/dist/client/assets/useInfiniteQuery-PRD417UA.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-j6nsOPAl.js +0 -1
- package/dist/client/assets/workflow-detail-BNKITpZa.js +0 -1
- package/dist/server/node_modules/get-east-asian-width/index.d.ts +0 -60
- package/dist/server/node_modules/get-east-asian-width/index.js +0 -30
- package/dist/server/node_modules/get-east-asian-width/lookup-data.js +0 -18
- package/dist/server/node_modules/get-east-asian-width/lookup.js +0 -135
- package/dist/server/node_modules/get-east-asian-width/package.json +0 -71
- package/dist/server/node_modules/get-east-asian-width/readme.md +0 -65
- package/dist/server/node_modules/get-east-asian-width/utilities.js +0 -24
- package/dist/server/node_modules/slice-ansi/index.d.ts +0 -19
- package/dist/server/node_modules/slice-ansi/index.js +0 -260
- package/dist/server/node_modules/slice-ansi/package.json +0 -59
- package/dist/server/node_modules/slice-ansi/readme.md +0 -54
- package/dist/server/node_modules/slice-ansi/tokenize-ansi.js +0 -752
- /package/dist/server/node_modules/{get-east-asian-width → ansi-regex}/license +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as R,j as i,r as P,s as ae,P as Ne,f as ke,c as ce,t as me,b as be,K as Ce,n as we}from"./index-RBXYZ0o1.js";import{I as je}from"./integration-icon-BUk_AQZb.js";import{S as ue}from"./skeleton-DMH6jOOd.js";import{W as F,i as _e}from"./constants-CVSLlYnf.js";import{b as Ie}from"./use-virtual-mcp-D1lThWcu.js";import{u as Se}from"./use-organization-settings-DQaAYRBc.js";import{i as Ae}from"./ChevronRight-CGM8153k.js";import{s as Oe}from"./Plus-Bz8pOCrF.js";import{a as De}from"./Users03-CDTGNBm2.js";import{I as oe,S as Ee,L as Me,b as Re}from"./lean-canvas-recruit-modal-C1G1_2au.js";import{b as Te,c as $e,d as Pe,S as Le,u as ze,C as G}from"./index-6mSFDvZg.js";import{u as Be}from"./use-create-virtual-mcp-B7_E4z0n.js";import{u as Fe}from"./tooltip-l5gvSkP4.js";import{d as He}from"./XCircle-Ds5a6kuE.js";import"./Container-4Wg94L7I.js";import"./agent-icon-DyZrsMHV.js";import"./AlertCircle-Ckdo-RmI.js";import"./Tool01-DA28S3sH.js";import"./XClose-C9Qfd8kZ.js";import"./RefreshCcw01-KEgE6miP.js";import"./ArrowNarrowLeft-Di3ykEwz.js";import"./ArrowUpRight-DMSP1Bv9.js";import"./ZapSquare-DKBv2Oh1.js";import"./CheckCircle-C208sPuy.js";import"./ChevronDown-BrUt0Alw.js";import"./ChevronUp-CaGbgeVw.js";import"./DotsVertical-DvRrSQFB.js";import"./Star01-C90LkDZI.js";import"./Palette-CgqIrvg1.js";import"./SearchMd-CVG2gI0e.js";import"./index-D2mful5a.js";import"./X-DoHhdWpr.js";import"./LinkExternal01-Y0gD7h2D.js";import"./Lock01-Dch0eKvp.js";import"./Sun-BxF03d45.js";import"./Play-CtLPh-DP.js";import"./Settings02-BaHlQiS7.js";import"./Shield01-CCtHgQuh.js";import"./Trash01-DR27iFf1.js";import"./User01-BujZcMbB.js";import"./Zap-BtQ-TzwR.js";import"./use-collections-XPoz4bQ4.js";import"./use-navigate-to-agent-h3H44Uqx.js";import"./dialog-B9mCJ9u4.js";import"./collection-search-CZ45K7il.js";import"./checkbox-DdEbgSXy.js";import"./use-connection-KIdOMYYB.js";import"./extract-connection-data-DWwyWigS.js";import"./constants-Bj37EyXz.js";import"./collections-ClBK8Wc7.js";import"./drawer-ChRbi3da.js";import"./use-mcp-tools-CvCxJUq7.js";import"./switch-ClAJkK47.js";import"./input-CbOPFA2Y.js";import"./chat-context-D2ImJV4_.js";import"./use-ai-providers-NGnYqkjZ.js";import"./use-decopilot-events-BB7Ade2O.js";import"./create-sse-subscription-CxkOgzKf.js";import"./use-tasks-CU4nRSG8.js";import"./shell-layout-A5EcvKv7.js";import"./required-auth-layout-DxzQFSub.js";import"./use-org-sso-CzzIybhJ.js";import"./pair-C1Euf0mI.js";import"./index-fNW0SHRb.js";import"./use-copy-BEHVkdeL.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./content-blocks-o63cs2vh.js";import"./types-sSi2ZBaJ.js";import"./tabs-Bw1wvZLY.js";import"./form-Ouizhyq3.js";import"./label-BSzDqn8Z.js";import"./dropdown-menu-BACFhEWG.js";import"./select-8rqyX4yY.js";import"./toggle-group-CrcMNw0M.js";import"./select-model-D8dh5nJb.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-HtqNxJHw.js";import"./card-KrDyjT9B.js";import"./avatar-ejiIeuvT.js";import"./alert-dialog-Cm675fIp.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./index-af7Ms30x.js";import"./question-004-sINsf4GQ.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-BOvFz0Xe.js";import"./use-registry-connections-Bw9vDyMz.js";import"./useInfiniteQuery-PRD417UA.js";import"./infiniteQueryObserver--3YinOmX.js";import"./collection-tabs-Ds23HSH3.js";import"./badge-BCkY0osU.js";import"./textarea-grS6dvzw.js";import"./connection-form-helpers-CaMgKEzX.js";import"./use-infinite-scroll-BDQxIw_a.js";import"./useSuspenseInfiniteQuery-j6nsOPAl.js";function Ue(e){try{const t=localStorage.getItem(`mesh:chat:recent-agents:${e}`);return t?JSON.parse(t):[]}catch{return[]}}const We=8;function xe(e){const t=R.c(21),{agent:s,onSpecialClick:r,tracking:n}=e,{org:o}=ae(),c=ke();let a;t[0]!==s.id||t[1]!==s.title||t[2]!==c||t[3]!==r||t[4]!==o||t[5]!==n.action||t[6]!==n.template_id||t[7]!==n.tile_kind?(a=()=>{if(me("home_agent_tile_clicked",{template_id:n.template_id,agent_id:s.id,agent_title:s.title,tile_kind:n.tile_kind,action:n.action}),r)r();else{const I=crypto.randomUUID();c({to:"/$org/$taskId",params:{org:o.slug,taskId:I},search:{virtualmcpid:s.id}})}},t[0]=s.id,t[1]=s.title,t[2]=c,t[3]=r,t[4]=o,t[5]=n.action,t[6]=n.template_id,t[7]=n.tile_kind,t[8]=a):a=t[8];const m=a;let u;t[9]===Symbol.for("react.memo_cache_sentinel")?(u=ce("flex flex-col items-center gap-3 p-2 rounded-lg","transition-colors","cursor-pointer","w-[100px] shrink-0","group"),t[9]=u):u=t[9];const L=`Select agent ${s.title}`;let b;t[10]===Symbol.for("react.memo_cache_sentinel")?(b=i.jsx(De,{size:24}),t[10]=b):b=t[10];let x;t[11]!==s.icon||t[12]!==s.title?(x=i.jsx(je,{icon:s.icon,name:s.title,size:"md",fallbackIcon:b,className:"transition-transform group-hover:scale-110"}),t[11]=s.icon,t[12]=s.title,t[13]=x):x=t[13];let d;t[14]!==s.title?(d=i.jsx("p",{className:"text-xs sm:text-sm text-foreground text-center leading-tight line-clamp-2 break-words w-full",children:s.title}),t[14]=s.title,t[15]=d):d=t[15];let k;return t[16]!==m||t[17]!==L||t[18]!==x||t[19]!==d?(k=i.jsxs("button",{type:"button",onClick:m,className:u,"aria-label":L,children:[x,d]}),t[16]=m,t[17]=L,t[18]=x,t[19]=d,t[20]=k):k=t[20],k}function Ke(){const e=R.c(8),t=ke(),{org:s}=ae();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=ce("flex flex-col items-center gap-3 p-2 rounded-lg","transition-colors","cursor-pointer","w-[100px] shrink-0","group"),e[0]=r):r=e[0];let n;e[1]!==t||e[2]!==s.slug?(n=()=>{me("home_see_all_agents_clicked"),t({to:"/$org/settings/agents",params:{org:s.slug}})},e[1]=t,e[2]=s.slug,e[3]=n):n=e[3];let o,c;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx("div",{className:"size-12 rounded-xl bg-accent flex items-center justify-center shrink-0 transition-transform group-hover:scale-110",children:i.jsx(Ae,{size:20,className:"text-foreground"})}),c=i.jsx("p",{className:"text-xs sm:text-sm text-foreground text-center leading-tight",children:"See all"}),e[4]=o,e[5]=c):(o=e[4],c=e[5]);let a;return e[6]!==n?(a=i.jsxs("button",{type:"button",className:r,"aria-label":"See all agents",onClick:n,children:[o,c]}),e[6]=n,e[7]=a):a=e[7],a}function Ve(){const e=R.c(9);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={navigateOnCreate:!0},e[0]=t):t=e[0];const{createVirtualMCP:s,isCreating:r}=Be(t);let n;e[1]!==s?(n=()=>{me("home_create_agent_clicked"),s()},e[1]=s,e[2]=n):n=e[2];let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=ce("flex flex-col items-center gap-3 p-2 rounded-lg","transition-colors","cursor-pointer","w-[100px] shrink-0","group","disabled:opacity-50 disabled:cursor-not-allowed"),e[3]=o):o=e[3];let c,a;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx("div",{className:"size-12 rounded-xl bg-background border-2 border-dashed border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-110",children:i.jsx(Oe,{size:20,className:"text-muted-foreground"})}),a=i.jsx("p",{className:"text-xs sm:text-sm text-foreground text-center leading-tight",children:"Create agent"}),e[4]=c,e[5]=a):(c=e[4],a=e[5]);let m;return e[6]!==r||e[7]!==n?(m=i.jsxs("button",{type:"button",onClick:n,disabled:r,className:o,"aria-label":"Create agent",children:[c,a]}),e[6]=r,e[7]=n,e[8]=m):m=e[8],m}function ie(e,t,s){return e.find(r=>r.id!==null&&(r.metadata?.type===t||r.title===s))}function qe(){const e=R.c(52),t=Ie(),{locator:s,org:r}=ae(),n=Se(),[o,c]=P.useState(!1),[a,m]=P.useState(!1),[u,L]=P.useState(!1),[b,x]=P.useState(!1),[d,k]=P.useState(!1),[I,T]=P.useState(!1),[M,$]=P.useState(!1),[z]=Ne(),S=Te(r.slug);let h,p,f,g,j,A,_,v;if(e[0]!==s||e[1]!==S||e[2]!==n||e[3]!==z||e[4]!==t){const se=F.find(rt),Y=F.find(nt),J=F.find(st),Q=F.find(it),Z=F.find(tt),de=F.find(et),ne=F.find(Ze);f=ie(t,Y.id,Y.title),h=ie(t,J.id,J.title),p=ie(t,Q.id,Q.title),g=ie(t,Z.id,Z.title);const pe=l=>{if(l===se.id)return{key:l,kind:"template-recruit",templateId:"site-editor",agent:se,onClick:"import-deco"};if(l===Y.id)return f?{key:f.id,kind:"existing",templateId:"site-diagnostics",agent:f}:{key:l,kind:"template-recruit",templateId:"site-diagnostics",agent:Y,onClick:"diagnostics"};if(l===J.id)return h?{key:h.id,kind:"existing",templateId:"ai-image",agent:h}:{key:l,kind:"template-recruit",templateId:"ai-image",agent:J,onClick:"ai-image"};if(l===Z.id)return g?{key:g.id,kind:"existing",templateId:"lean-canvas",agent:g}:{key:l,kind:"template-recruit",templateId:"lean-canvas",agent:Z,onClick:"lean-canvas"};if(l===de.id)return{key:l,kind:"template-recruit",templateId:"studio-pack",agent:de,onClick:"studio-pack"};if(l===ne.id)return z.experimental_vibecode?{key:l,kind:"template-recruit",templateId:"self-healing-storefront",agent:ne,onClick:"self-healing"}:null;if(l===Q.id)return p?{key:p.id,kind:"existing",templateId:"ai-research",agent:p}:{key:l,kind:"template-recruit",templateId:"ai-research",agent:Q,onClick:"ai-research"};const B=t.find(V=>V.id!==null&&V.id===l&&!_e(V.id));return B?{key:B.id,kind:"existing",templateId:null,agent:B}:null};let ee;if(n?.ids)ee=n.ids.map(pe).filter(Xe).slice(0,We);else{const B=[se.id,ne.id,Y.id,J.id,Q.id].map(pe).filter(Qe),V=Ue(s),ye=t.filter(Je).filter(q=>q.id!==f?.id&&q.id!==h?.id&&q.id!==p?.id).sort((q,fe)=>{const re=V.indexOf(q.id),le=V.indexOf(fe.id);return re!==-1&&le!==-1?re-le:re!==-1?-1:le!==-1?1:new Date(fe.updated_at).getTime()-new Date(q.updated_at).getTime()}).slice(0,4).map(Ye);ee=[...B,...ye]}j=ee.some(Ge);let te;e[13]!==S?(te=l=>{if(l.kind==="template-recruit"){const B={"import-deco":()=>c(!0),diagnostics:()=>m(!0),"ai-image":()=>L(!0),"ai-research":()=>x(!0),"lean-canvas":()=>k(!0),"studio-pack":()=>T(!0),"self-healing":()=>$(!0)}[l.onClick];return i.jsx(xe,{agent:l.agent,onSpecialClick:B,tracking:{template_id:l.templateId,tile_kind:"template",action:"open_modal"}},l.key)}return i.jsx(xe,{agent:l.agent,onSpecialClick:()=>S(l.agent.id),tracking:{template_id:l.templateId,tile_kind:l.templateId?"existing":"recent",action:"navigate"}},l.key)},e[13]=S,e[14]=te):te=e[14];const ve=te;v="w-full max-md:overflow-x-auto max-md:[scrollbar-width:none] max-md:[&::-webkit-scrollbar]:hidden",A="flex flex-wrap justify-center gap-1.5 max-md:flex-nowrap max-md:justify-start md:max-h-52 md:overflow-hidden",_=ee.map(ve),e[0]=s,e[1]=S,e[2]=n,e[3]=z,e[4]=t,e[5]=h,e[6]=p,e[7]=f,e[8]=g,e[9]=j,e[10]=A,e[11]=_,e[12]=v}else h=e[5],p=e[6],f=e[7],g=e[8],j=e[9],A=e[10],_=e[11],v=e[12];let O;e[15]===Symbol.for("react.memo_cache_sentinel")?(O=i.jsx(Ve,{}),e[15]=O):O=e[15];let y;e[16]!==j?(y=j&&i.jsx(Ke,{}),e[16]=j,e[17]=y):y=e[17];let D;e[18]!==A||e[19]!==_||e[20]!==y?(D=i.jsxs("div",{className:A,children:[_,O,y]}),e[18]=A,e[19]=_,e[20]=y,e[21]=D):D=e[21];let N;e[22]!==v||e[23]!==D?(N=i.jsx("div",{className:v,children:D}),e[22]=v,e[23]=D,e[24]=N):N=e[24];let C;e[25]!==o?(C=i.jsx(oe,{open:o,onOpenChange:c}),e[25]=o,e[26]=C):C=e[26];let w;e[27]!==a||e[28]!==f?(w=i.jsx(Ee,{open:a,onOpenChange:m,existingAgent:f}),e[27]=a,e[28]=f,e[29]=w):w=e[29];let E;e[30]!==u||e[31]!==h?(E=i.jsx($e,{open:u,onOpenChange:L,existingAgent:h}),e[30]=u,e[31]=h,e[32]=E):E=e[32];let H;e[33]!==b||e[34]!==p?(H=i.jsx(Pe,{open:b,onOpenChange:x,existingAgent:p}),e[33]=b,e[34]=p,e[35]=H):H=e[35];let U;e[36]!==g||e[37]!==d?(U=i.jsx(Me,{open:d,onOpenChange:k,existingAgent:g}),e[36]=g,e[37]=d,e[38]=U):U=e[38];let W;e[39]!==I?(W=i.jsx(Re,{open:I,onOpenChange:T}),e[39]=I,e[40]=W):W=e[40];let K;e[41]!==M?(K=i.jsx(Le,{open:M,onOpenChange:$}),e[41]=M,e[42]=K):K=e[42];let X;return e[43]!==H||e[44]!==U||e[45]!==W||e[46]!==K||e[47]!==N||e[48]!==C||e[49]!==w||e[50]!==E?(X=i.jsxs(i.Fragment,{children:[N,C,w,E,H,U,W,K]}),e[43]=H,e[44]=U,e[45]=W,e[46]=K,e[47]=N,e[48]=C,e[49]=w,e[50]=E,e[51]=X):X=e[51],X}function Ge(e){return e.kind==="existing"&&e.templateId===null}function Ye(e){return{key:e.id,kind:"existing",templateId:null,agent:e}}function Je(e){return e.id!==null&&!_e(e.id)}function Qe(e){return e!==null}function Xe(e){return e!==null}function Ze(e){return e.id==="self-healing-storefront"}function et(e){return e.id==="studio-pack"}function tt(e){return e.id==="lean-canvas"}function it(e){return e.id==="ai-research"}function st(e){return e.id==="ai-image"}function nt(e){return e.id==="site-diagnostics"}function rt(e){return e.id==="site-editor"}function lt(){const e=R.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx("div",{className:"w-full max-md:overflow-x-auto max-md:[scrollbar-width:none] max-md:[&::-webkit-scrollbar]:hidden",children:i.jsx("div",{className:"flex flex-wrap justify-center gap-1.5 max-md:flex-nowrap max-md:justify-start md:max-h-52 md:overflow-hidden",children:Array.from({length:7}).map(ot)})}),e[0]=t):t=e[0],t}function ot(e,t){return i.jsxs("div",{className:"flex flex-col items-center gap-3 p-2 w-[100px] shrink-0",children:[i.jsx(ue,{className:"size-12 rounded-xl shrink-0"}),i.jsx(ue,{className:"h-3 sm:h-4 w-full"})]},t)}function ge(){const e=R.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx(P.Suspense,{fallback:i.jsx(lt,{}),children:i.jsx(qe,{})}),e[0]=t):t=e[0],t}const at=["radial-gradient(ellipse 25% 220% at -5% 120%, rgba(165,149,255,0.35) 0%, transparent 100%)","radial-gradient(ellipse 25% 220% at 105% -20%, rgba(208,236,26,0.32) 0%, transparent 100%)"].join(", "),ct="/decotexture.svg";function he(e){const t=R.c(7),{onClick:s}=e;let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={backgroundImage:at},t[0]=r):r=t[0];let n,o;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsx("div",{className:"relative shrink-0 p-1.5 bg-[var(--brand-green-light)] rounded-lg border border-border",children:i.jsx(je,{icon:"/logos/deco%20logo.svg",name:"deco.cx",size:"xs",className:"border-0 rounded-none bg-transparent"})}),o=i.jsx("p",{className:"flex-1 relative text-sm font-medium text-foreground leading-none whitespace-nowrap",children:"Import your deco.cx site"}),t[1]=n,t[2]=o):(n=t[1],o=t[2]);let c;t[3]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx("img",{src:ct,alt:"","aria-hidden":!0,className:"absolute pointer-events-none",style:{width:"274.5px",height:"272.25px",left:"calc(50% + 145.5px)",top:"calc(50% + 40px)",transform:"translate(-50%, -50%)"}}),t[3]=c):c=t[3];let a;t[4]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx("div",{className:"relative bg-background flex items-center justify-center size-8 rounded-md shrink-0",children:i.jsx(He,{size:16,className:"text-foreground transition-transform group-hover:translate-x-0.5"})}),t[4]=a):a=t[4];let m;return t[5]!==s?(m=i.jsxs("button",{type:"button",onClick:s,className:"w-full relative flex items-center gap-4 px-4 py-4 rounded-lg border border-border bg-background overflow-hidden transition-colors text-left cursor-pointer group",style:r,children:[n,o,c,a]}),t[5]=s,t[6]=m):m=t[6],m}function mt(){const e=R.c(5),{data:t}=be.useSession();let s;e[0]!==t?.user?.email?(s=Ce.decoProfile(t?.user?.email),e[0]=t?.user?.email,e[1]=s):s=e[1];const r=!!t?.user?.email;let n;e[2]!==s||e[3]!==r?(n={queryKey:s,queryFn:dt,enabled:r,staleTime:3e5},e[2]=s,e[3]=r,e[4]=n):n=e[4];const{data:o}=we(n);return o?.isDecoUser??!1}async function dt(){const e=await fetch("/api/deco-sites/profile");return e.ok?e.json():{isDecoUser:!1}}function pt(){const e=R.c(51),{data:t}=be.useSession(),[s,r]=P.useState(!1),n=mt(),o=Fe(),{hasDecoKey:c,isZeroBalance:a,isInitialFreeCredit:m,balanceDollars:u,hasOnlyDecoProvider:L}=ze();let b;e[0]!==t?.user?.name?(b=t?.user?.name?.split(" ")[0]||"there",e[0]=t?.user?.name,e[1]=b):b=e[1];const x=b,d=c&&m&&u!=null,k=c&&a&&L;if(o){let _;e[2]!==u||e[3]!==d?(_=d&&i.jsx("div",{className:"mb-4",children:i.jsx(G.CreditsEyebrow,{balanceDollars:u})}),e[2]=u,e[3]=d,e[4]=_):_=e[4];let v;e[5]!==k?(v=k&&i.jsx("div",{className:"mb-4",children:i.jsx(G.NoCreditsEyebrow,{})}),e[5]=k,e[6]=v):v=e[6];let O;e[7]!==x?(O=i.jsxs("p",{className:"text-3xl font-medium text-foreground text-center max-w-[280px]",children:["What's on your mind, ",x,"?"]}),e[7]=x,e[8]=O):O=e[8];let y;e[9]!==_||e[10]!==v||e[11]!==O?(y=i.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center w-full",children:[_,v,O]}),e[9]=_,e[10]=v,e[11]=O,e[12]=y):y=e[12];let D;e[13]===Symbol.for("react.memo_cache_sentinel")?(D=i.jsxs("div",{className:"w-full flex flex-col gap-4 pb-4",children:[i.jsx(ge,{}),i.jsx(G.Input,{showConnectionsBanner:!0})]}),e[13]=D):D=e[13];let N;e[14]!==n?(N=n&&i.jsx("div",{className:"w-full",children:i.jsx(he,{onClick:()=>r(!0)})}),e[14]=n,e[15]=N):N=e[15];let C;e[16]!==y||e[17]!==N?(C=i.jsxs("div",{className:"flex-1 relative flex flex-col items-center px-4",children:[y,D,N]}),e[16]=y,e[17]=N,e[18]=C):C=e[18];let w;e[19]!==s?(w=i.jsx(oe,{open:s,onOpenChange:r}),e[19]=s,e[20]=w):w=e[20];let E;return e[21]!==C||e[22]!==w?(E=i.jsxs(i.Fragment,{children:[C,w]}),e[21]=C,e[22]=w,e[23]=E):E=e[23],E}let I;e[24]!==u||e[25]!==d?(I=d&&i.jsx("div",{className:"mb-4",children:i.jsx(G.CreditsEyebrow,{balanceDollars:u})}),e[24]=u,e[25]=d,e[26]=I):I=e[26];let T;e[27]!==k?(T=k&&i.jsx("div",{className:"mb-4",children:i.jsx(G.NoCreditsEyebrow,{})}),e[27]=k,e[28]=T):T=e[28];let M;e[29]!==x?(M=i.jsxs("p",{className:"text-3xl font-medium text-foreground",children:["What's on your mind, ",x,"?"]}),e[29]=x,e[30]=M):M=e[30];let $;e[31]!==I||e[32]!==T||e[33]!==M?($=i.jsxs("div",{className:"text-center mb-10",children:[I,T,M]}),e[31]=I,e[32]=T,e[33]=M,e[34]=$):$=e[34];let z;e[35]===Symbol.for("react.memo_cache_sentinel")?(z=i.jsx("div",{className:"w-full",children:i.jsx(G.Input,{showConnectionsBanner:!0})}),e[35]=z):z=e[35];let S;e[36]!==$?(S=i.jsxs("div",{className:"flex flex-col items-center w-full max-w-[672px]",children:[$,z]}),e[36]=$,e[37]=S):S=e[37];let h;e[38]===Symbol.for("react.memo_cache_sentinel")?(h=i.jsx("div",{className:"w-full mt-10 mx-auto",children:i.jsx(ge,{})}),e[38]=h):h=e[38];let p;e[39]!==S?(p=i.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center w-full",children:[S,h]}),e[39]=S,e[40]=p):p=e[40];let f;e[41]!==n?(f=n&&i.jsx("div",{className:"absolute bottom-6 left-0 right-0 px-10",children:i.jsx("div",{className:"w-full max-w-[500px] mx-auto",children:i.jsx(he,{onClick:()=>r(!0)})})}),e[41]=n,e[42]=f):f=e[42];let g;e[43]!==p||e[44]!==f?(g=i.jsxs("div",{className:"flex-1 relative flex flex-col items-center px-10",children:[p,f]}),e[43]=p,e[44]=f,e[45]=g):g=e[45];let j;e[46]!==s?(j=i.jsx(oe,{open:s,onOpenChange:r}),e[46]=s,e[47]=j):j=e[47];let A;return e[48]!==g||e[49]!==j?(A=i.jsxs(i.Fragment,{children:[g,j]}),e[48]=g,e[49]=j,e[50]=A):A=e[50],A}function es(){const e=R.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx("div",{className:"flex-1 min-h-0 p-1.5 overflow-hidden",children:i.jsx("div",{className:"flex h-full flex-col bg-background overflow-hidden card-shadow rounded-[0.75rem]",children:i.jsx(pt,{})})}),e[0]=t):t=e[0],t}export{es as default};
|
|
1
|
+
import{e as R,j as i,r as P,s as ae,P as Ne,f as ke,c as ce,t as me,b as be,K as Ce,n as we}from"./index-BGvMfUr2.js";import{I as je}from"./integration-icon-Btl0P6Zi.js";import{S as ue}from"./skeleton-PrntJAKB.js";import{W as F,i as _e}from"./constants-BVU634u9.js";import{b as Ie}from"./use-virtual-mcp-BOr32Cw9.js";import{u as Se}from"./use-organization-settings-vi5z2D5l.js";import{i as Ae}from"./ChevronRight-QeeRSp8z.js";import{s as Oe}from"./Plus-gLdNtuBE.js";import{a as De}from"./Users03-DVwMLxYo.js";import{I as oe,S as Ee,L as Me,b as Re}from"./lean-canvas-recruit-modal-70F-bJzI.js";import{b as Te,c as $e,d as Pe,S as Le,u as ze,C as G}from"./index-CQbT2-AO.js";import{u as Be}from"./use-create-virtual-mcp-oePzdlSN.js";import{u as Fe}from"./tooltip-8sj0FPxK.js";import{d as He}from"./XCircle-CVED_3Ss.js";import"./Container-CIDvyJX8.js";import"./agent-icon-B5EEcofO.js";import"./AlertCircle-BFJK99tM.js";import"./Tool01-D1xeep7h.js";import"./XClose-C1T9ODT_.js";import"./RefreshCcw01-DKf5Q7r6.js";import"./ArrowNarrowLeft-DCbP5K-g.js";import"./ArrowUpRight-BvzWf0q7.js";import"./ZapSquare-B03aoE62.js";import"./CheckCircle-qqOIolWc.js";import"./ChevronDown-BMTA9_Ap.js";import"./ChevronUp-BHiGg6ZY.js";import"./DotsVertical-Bd2_5HYZ.js";import"./Star01-DInOTW7T.js";import"./Palette-DescRwe0.js";import"./SearchMd-BI1BY0Xc.js";import"./index-C-49LFOm.js";import"./X-fvjwb2RC.js";import"./LinkExternal01-DCnMv_g7.js";import"./Lock01-Ds-YEZnN.js";import"./Sun-DLagUbKM.js";import"./Play-Ch3KWC7Z.js";import"./Settings02-D0o0GA4h.js";import"./Shield01-btPXI3TS.js";import"./Trash01-OgQVP2St.js";import"./User01-Cr_qCqW_.js";import"./Zap-u543Wk9m.js";import"./use-collections-DbJUoPI1.js";import"./use-navigate-to-agent-XL440g7Q.js";import"./dialog-Cc5-s5cq.js";import"./collection-search-dr2VH0_A.js";import"./checkbox-DBBm6J90.js";import"./use-connection-EBpfvjCE.js";import"./extract-connection-data-CGFCZBB1.js";import"./constants-DhipgDPU.js";import"./collections-x4R34QWs.js";import"./drawer-CYKJkhyy.js";import"./use-mcp-tools-yGAchpt7.js";import"./switch-DIPW9oSx.js";import"./input-r-FVR1hH.js";import"./chat-context-DZ4ItXeY.js";import"./use-ai-providers-TD5f5keD.js";import"./use-decopilot-events-CTJPtEAG.js";import"./create-sse-subscription-CxkOgzKf.js";import"./use-tasks-BSCdum36.js";import"./shell-layout-BTN4hGpk.js";import"./required-auth-layout-ByW838Wg.js";import"./use-org-sso-DzmlEuU4.js";import"./pair-TlV_Y8fY.js";import"./index-BizlRsAk.js";import"./use-copy-DNbmGYTy.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./content-blocks-o63cs2vh.js";import"./types-CPAcvDGA.js";import"./tabs-Cnic4mBc.js";import"./form-BlgCJwww.js";import"./label-CDE7or5s.js";import"./dropdown-menu-BdezCavF.js";import"./select-CKhnD_dJ.js";import"./toggle-group-Bw-pO6dq.js";import"./select-model-DSERjqbn.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-BSfLZRSf.js";import"./card-DHIGW2Gm.js";import"./avatar-B5CcOSaZ.js";import"./alert-dialog-B6JtF6Oy.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./index-DWnDHmtK.js";import"./question-004-sINsf4GQ.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-DHMMRnIO.js";import"./use-registry-connections-vdam_2jo.js";import"./useInfiniteQuery-D6CYdRiz.js";import"./infiniteQueryObserver-B9_hQDN4.js";import"./collection-tabs-BhSzOngN.js";import"./badge-Vn5olYFX.js";import"./textarea-DWnLf30W.js";import"./connection-form-helpers-CSnwVczG.js";import"./use-infinite-scroll-Blb-Zkmq.js";import"./useSuspenseInfiniteQuery-hnE5tAGb.js";function Ue(e){try{const t=localStorage.getItem(`mesh:chat:recent-agents:${e}`);return t?JSON.parse(t):[]}catch{return[]}}const We=8;function xe(e){const t=R.c(21),{agent:s,onSpecialClick:r,tracking:n}=e,{org:o}=ae(),c=ke();let a;t[0]!==s.id||t[1]!==s.title||t[2]!==c||t[3]!==r||t[4]!==o||t[5]!==n.action||t[6]!==n.template_id||t[7]!==n.tile_kind?(a=()=>{if(me("home_agent_tile_clicked",{template_id:n.template_id,agent_id:s.id,agent_title:s.title,tile_kind:n.tile_kind,action:n.action}),r)r();else{const I=crypto.randomUUID();c({to:"/$org/$taskId",params:{org:o.slug,taskId:I},search:{virtualmcpid:s.id}})}},t[0]=s.id,t[1]=s.title,t[2]=c,t[3]=r,t[4]=o,t[5]=n.action,t[6]=n.template_id,t[7]=n.tile_kind,t[8]=a):a=t[8];const m=a;let u;t[9]===Symbol.for("react.memo_cache_sentinel")?(u=ce("flex flex-col items-center gap-3 p-2 rounded-lg","transition-colors","cursor-pointer","w-[100px] shrink-0","group"),t[9]=u):u=t[9];const L=`Select agent ${s.title}`;let b;t[10]===Symbol.for("react.memo_cache_sentinel")?(b=i.jsx(De,{size:24}),t[10]=b):b=t[10];let x;t[11]!==s.icon||t[12]!==s.title?(x=i.jsx(je,{icon:s.icon,name:s.title,size:"md",fallbackIcon:b,className:"transition-transform group-hover:scale-110"}),t[11]=s.icon,t[12]=s.title,t[13]=x):x=t[13];let d;t[14]!==s.title?(d=i.jsx("p",{className:"text-xs sm:text-sm text-foreground text-center leading-tight line-clamp-2 break-words w-full",children:s.title}),t[14]=s.title,t[15]=d):d=t[15];let k;return t[16]!==m||t[17]!==L||t[18]!==x||t[19]!==d?(k=i.jsxs("button",{type:"button",onClick:m,className:u,"aria-label":L,children:[x,d]}),t[16]=m,t[17]=L,t[18]=x,t[19]=d,t[20]=k):k=t[20],k}function Ke(){const e=R.c(8),t=ke(),{org:s}=ae();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=ce("flex flex-col items-center gap-3 p-2 rounded-lg","transition-colors","cursor-pointer","w-[100px] shrink-0","group"),e[0]=r):r=e[0];let n;e[1]!==t||e[2]!==s.slug?(n=()=>{me("home_see_all_agents_clicked"),t({to:"/$org/settings/agents",params:{org:s.slug}})},e[1]=t,e[2]=s.slug,e[3]=n):n=e[3];let o,c;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx("div",{className:"size-12 rounded-xl bg-accent flex items-center justify-center shrink-0 transition-transform group-hover:scale-110",children:i.jsx(Ae,{size:20,className:"text-foreground"})}),c=i.jsx("p",{className:"text-xs sm:text-sm text-foreground text-center leading-tight",children:"See all"}),e[4]=o,e[5]=c):(o=e[4],c=e[5]);let a;return e[6]!==n?(a=i.jsxs("button",{type:"button",className:r,"aria-label":"See all agents",onClick:n,children:[o,c]}),e[6]=n,e[7]=a):a=e[7],a}function Ve(){const e=R.c(9);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={navigateOnCreate:!0},e[0]=t):t=e[0];const{createVirtualMCP:s,isCreating:r}=Be(t);let n;e[1]!==s?(n=()=>{me("home_create_agent_clicked"),s()},e[1]=s,e[2]=n):n=e[2];let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=ce("flex flex-col items-center gap-3 p-2 rounded-lg","transition-colors","cursor-pointer","w-[100px] shrink-0","group","disabled:opacity-50 disabled:cursor-not-allowed"),e[3]=o):o=e[3];let c,a;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx("div",{className:"size-12 rounded-xl bg-background border-2 border-dashed border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-110",children:i.jsx(Oe,{size:20,className:"text-muted-foreground"})}),a=i.jsx("p",{className:"text-xs sm:text-sm text-foreground text-center leading-tight",children:"Create agent"}),e[4]=c,e[5]=a):(c=e[4],a=e[5]);let m;return e[6]!==r||e[7]!==n?(m=i.jsxs("button",{type:"button",onClick:n,disabled:r,className:o,"aria-label":"Create agent",children:[c,a]}),e[6]=r,e[7]=n,e[8]=m):m=e[8],m}function ie(e,t,s){return e.find(r=>r.id!==null&&(r.metadata?.type===t||r.title===s))}function qe(){const e=R.c(52),t=Ie(),{locator:s,org:r}=ae(),n=Se(),[o,c]=P.useState(!1),[a,m]=P.useState(!1),[u,L]=P.useState(!1),[b,x]=P.useState(!1),[d,k]=P.useState(!1),[I,T]=P.useState(!1),[M,$]=P.useState(!1),[z]=Ne(),S=Te(r.slug);let h,p,f,g,j,A,_,v;if(e[0]!==s||e[1]!==S||e[2]!==n||e[3]!==z||e[4]!==t){const se=F.find(rt),Y=F.find(nt),J=F.find(st),Q=F.find(it),Z=F.find(tt),de=F.find(et),ne=F.find(Ze);f=ie(t,Y.id,Y.title),h=ie(t,J.id,J.title),p=ie(t,Q.id,Q.title),g=ie(t,Z.id,Z.title);const pe=l=>{if(l===se.id)return{key:l,kind:"template-recruit",templateId:"site-editor",agent:se,onClick:"import-deco"};if(l===Y.id)return f?{key:f.id,kind:"existing",templateId:"site-diagnostics",agent:f}:{key:l,kind:"template-recruit",templateId:"site-diagnostics",agent:Y,onClick:"diagnostics"};if(l===J.id)return h?{key:h.id,kind:"existing",templateId:"ai-image",agent:h}:{key:l,kind:"template-recruit",templateId:"ai-image",agent:J,onClick:"ai-image"};if(l===Z.id)return g?{key:g.id,kind:"existing",templateId:"lean-canvas",agent:g}:{key:l,kind:"template-recruit",templateId:"lean-canvas",agent:Z,onClick:"lean-canvas"};if(l===de.id)return{key:l,kind:"template-recruit",templateId:"studio-pack",agent:de,onClick:"studio-pack"};if(l===ne.id)return z.experimental_vibecode?{key:l,kind:"template-recruit",templateId:"self-healing-storefront",agent:ne,onClick:"self-healing"}:null;if(l===Q.id)return p?{key:p.id,kind:"existing",templateId:"ai-research",agent:p}:{key:l,kind:"template-recruit",templateId:"ai-research",agent:Q,onClick:"ai-research"};const B=t.find(V=>V.id!==null&&V.id===l&&!_e(V.id));return B?{key:B.id,kind:"existing",templateId:null,agent:B}:null};let ee;if(n?.ids)ee=n.ids.map(pe).filter(Xe).slice(0,We);else{const B=[se.id,ne.id,Y.id,J.id,Q.id].map(pe).filter(Qe),V=Ue(s),ye=t.filter(Je).filter(q=>q.id!==f?.id&&q.id!==h?.id&&q.id!==p?.id).sort((q,fe)=>{const re=V.indexOf(q.id),le=V.indexOf(fe.id);return re!==-1&&le!==-1?re-le:re!==-1?-1:le!==-1?1:new Date(fe.updated_at).getTime()-new Date(q.updated_at).getTime()}).slice(0,4).map(Ye);ee=[...B,...ye]}j=ee.some(Ge);let te;e[13]!==S?(te=l=>{if(l.kind==="template-recruit"){const B={"import-deco":()=>c(!0),diagnostics:()=>m(!0),"ai-image":()=>L(!0),"ai-research":()=>x(!0),"lean-canvas":()=>k(!0),"studio-pack":()=>T(!0),"self-healing":()=>$(!0)}[l.onClick];return i.jsx(xe,{agent:l.agent,onSpecialClick:B,tracking:{template_id:l.templateId,tile_kind:"template",action:"open_modal"}},l.key)}return i.jsx(xe,{agent:l.agent,onSpecialClick:()=>S(l.agent.id),tracking:{template_id:l.templateId,tile_kind:l.templateId?"existing":"recent",action:"navigate"}},l.key)},e[13]=S,e[14]=te):te=e[14];const ve=te;v="w-full max-md:overflow-x-auto max-md:[scrollbar-width:none] max-md:[&::-webkit-scrollbar]:hidden",A="flex flex-wrap justify-center gap-1.5 max-md:flex-nowrap max-md:justify-start md:max-h-52 md:overflow-hidden",_=ee.map(ve),e[0]=s,e[1]=S,e[2]=n,e[3]=z,e[4]=t,e[5]=h,e[6]=p,e[7]=f,e[8]=g,e[9]=j,e[10]=A,e[11]=_,e[12]=v}else h=e[5],p=e[6],f=e[7],g=e[8],j=e[9],A=e[10],_=e[11],v=e[12];let O;e[15]===Symbol.for("react.memo_cache_sentinel")?(O=i.jsx(Ve,{}),e[15]=O):O=e[15];let y;e[16]!==j?(y=j&&i.jsx(Ke,{}),e[16]=j,e[17]=y):y=e[17];let D;e[18]!==A||e[19]!==_||e[20]!==y?(D=i.jsxs("div",{className:A,children:[_,O,y]}),e[18]=A,e[19]=_,e[20]=y,e[21]=D):D=e[21];let N;e[22]!==v||e[23]!==D?(N=i.jsx("div",{className:v,children:D}),e[22]=v,e[23]=D,e[24]=N):N=e[24];let C;e[25]!==o?(C=i.jsx(oe,{open:o,onOpenChange:c}),e[25]=o,e[26]=C):C=e[26];let w;e[27]!==a||e[28]!==f?(w=i.jsx(Ee,{open:a,onOpenChange:m,existingAgent:f}),e[27]=a,e[28]=f,e[29]=w):w=e[29];let E;e[30]!==u||e[31]!==h?(E=i.jsx($e,{open:u,onOpenChange:L,existingAgent:h}),e[30]=u,e[31]=h,e[32]=E):E=e[32];let H;e[33]!==b||e[34]!==p?(H=i.jsx(Pe,{open:b,onOpenChange:x,existingAgent:p}),e[33]=b,e[34]=p,e[35]=H):H=e[35];let U;e[36]!==g||e[37]!==d?(U=i.jsx(Me,{open:d,onOpenChange:k,existingAgent:g}),e[36]=g,e[37]=d,e[38]=U):U=e[38];let W;e[39]!==I?(W=i.jsx(Re,{open:I,onOpenChange:T}),e[39]=I,e[40]=W):W=e[40];let K;e[41]!==M?(K=i.jsx(Le,{open:M,onOpenChange:$}),e[41]=M,e[42]=K):K=e[42];let X;return e[43]!==H||e[44]!==U||e[45]!==W||e[46]!==K||e[47]!==N||e[48]!==C||e[49]!==w||e[50]!==E?(X=i.jsxs(i.Fragment,{children:[N,C,w,E,H,U,W,K]}),e[43]=H,e[44]=U,e[45]=W,e[46]=K,e[47]=N,e[48]=C,e[49]=w,e[50]=E,e[51]=X):X=e[51],X}function Ge(e){return e.kind==="existing"&&e.templateId===null}function Ye(e){return{key:e.id,kind:"existing",templateId:null,agent:e}}function Je(e){return e.id!==null&&!_e(e.id)}function Qe(e){return e!==null}function Xe(e){return e!==null}function Ze(e){return e.id==="self-healing-storefront"}function et(e){return e.id==="studio-pack"}function tt(e){return e.id==="lean-canvas"}function it(e){return e.id==="ai-research"}function st(e){return e.id==="ai-image"}function nt(e){return e.id==="site-diagnostics"}function rt(e){return e.id==="site-editor"}function lt(){const e=R.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx("div",{className:"w-full max-md:overflow-x-auto max-md:[scrollbar-width:none] max-md:[&::-webkit-scrollbar]:hidden",children:i.jsx("div",{className:"flex flex-wrap justify-center gap-1.5 max-md:flex-nowrap max-md:justify-start md:max-h-52 md:overflow-hidden",children:Array.from({length:7}).map(ot)})}),e[0]=t):t=e[0],t}function ot(e,t){return i.jsxs("div",{className:"flex flex-col items-center gap-3 p-2 w-[100px] shrink-0",children:[i.jsx(ue,{className:"size-12 rounded-xl shrink-0"}),i.jsx(ue,{className:"h-3 sm:h-4 w-full"})]},t)}function ge(){const e=R.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx(P.Suspense,{fallback:i.jsx(lt,{}),children:i.jsx(qe,{})}),e[0]=t):t=e[0],t}const at=["radial-gradient(ellipse 25% 220% at -5% 120%, rgba(165,149,255,0.35) 0%, transparent 100%)","radial-gradient(ellipse 25% 220% at 105% -20%, rgba(208,236,26,0.32) 0%, transparent 100%)"].join(", "),ct="/decotexture.svg";function he(e){const t=R.c(7),{onClick:s}=e;let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={backgroundImage:at},t[0]=r):r=t[0];let n,o;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsx("div",{className:"relative shrink-0 p-1.5 bg-[var(--brand-green-light)] rounded-lg border border-border",children:i.jsx(je,{icon:"/logos/deco%20logo.svg",name:"deco.cx",size:"xs",className:"border-0 rounded-none bg-transparent"})}),o=i.jsx("p",{className:"flex-1 relative text-sm font-medium text-foreground leading-none whitespace-nowrap",children:"Import your deco.cx site"}),t[1]=n,t[2]=o):(n=t[1],o=t[2]);let c;t[3]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx("img",{src:ct,alt:"","aria-hidden":!0,className:"absolute pointer-events-none",style:{width:"274.5px",height:"272.25px",left:"calc(50% + 145.5px)",top:"calc(50% + 40px)",transform:"translate(-50%, -50%)"}}),t[3]=c):c=t[3];let a;t[4]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx("div",{className:"relative bg-background flex items-center justify-center size-8 rounded-md shrink-0",children:i.jsx(He,{size:16,className:"text-foreground transition-transform group-hover:translate-x-0.5"})}),t[4]=a):a=t[4];let m;return t[5]!==s?(m=i.jsxs("button",{type:"button",onClick:s,className:"w-full relative flex items-center gap-4 px-4 py-4 rounded-lg border border-border bg-background overflow-hidden transition-colors text-left cursor-pointer group",style:r,children:[n,o,c,a]}),t[5]=s,t[6]=m):m=t[6],m}function mt(){const e=R.c(5),{data:t}=be.useSession();let s;e[0]!==t?.user?.email?(s=Ce.decoProfile(t?.user?.email),e[0]=t?.user?.email,e[1]=s):s=e[1];const r=!!t?.user?.email;let n;e[2]!==s||e[3]!==r?(n={queryKey:s,queryFn:dt,enabled:r,staleTime:3e5},e[2]=s,e[3]=r,e[4]=n):n=e[4];const{data:o}=we(n);return o?.isDecoUser??!1}async function dt(){const e=await fetch("/api/deco-sites/profile");return e.ok?e.json():{isDecoUser:!1}}function pt(){const e=R.c(51),{data:t}=be.useSession(),[s,r]=P.useState(!1),n=mt(),o=Fe(),{hasDecoKey:c,isZeroBalance:a,isInitialFreeCredit:m,balanceDollars:u,hasOnlyDecoProvider:L}=ze();let b;e[0]!==t?.user?.name?(b=t?.user?.name?.split(" ")[0]||"there",e[0]=t?.user?.name,e[1]=b):b=e[1];const x=b,d=c&&m&&u!=null,k=c&&a&&L;if(o){let _;e[2]!==u||e[3]!==d?(_=d&&i.jsx("div",{className:"mb-4",children:i.jsx(G.CreditsEyebrow,{balanceDollars:u})}),e[2]=u,e[3]=d,e[4]=_):_=e[4];let v;e[5]!==k?(v=k&&i.jsx("div",{className:"mb-4",children:i.jsx(G.NoCreditsEyebrow,{})}),e[5]=k,e[6]=v):v=e[6];let O;e[7]!==x?(O=i.jsxs("p",{className:"text-3xl font-medium text-foreground text-center max-w-[280px]",children:["What's on your mind, ",x,"?"]}),e[7]=x,e[8]=O):O=e[8];let y;e[9]!==_||e[10]!==v||e[11]!==O?(y=i.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center w-full",children:[_,v,O]}),e[9]=_,e[10]=v,e[11]=O,e[12]=y):y=e[12];let D;e[13]===Symbol.for("react.memo_cache_sentinel")?(D=i.jsxs("div",{className:"w-full flex flex-col gap-4 pb-4",children:[i.jsx(ge,{}),i.jsx(G.Input,{showConnectionsBanner:!0})]}),e[13]=D):D=e[13];let N;e[14]!==n?(N=n&&i.jsx("div",{className:"w-full",children:i.jsx(he,{onClick:()=>r(!0)})}),e[14]=n,e[15]=N):N=e[15];let C;e[16]!==y||e[17]!==N?(C=i.jsxs("div",{className:"flex-1 relative flex flex-col items-center px-4",children:[y,D,N]}),e[16]=y,e[17]=N,e[18]=C):C=e[18];let w;e[19]!==s?(w=i.jsx(oe,{open:s,onOpenChange:r}),e[19]=s,e[20]=w):w=e[20];let E;return e[21]!==C||e[22]!==w?(E=i.jsxs(i.Fragment,{children:[C,w]}),e[21]=C,e[22]=w,e[23]=E):E=e[23],E}let I;e[24]!==u||e[25]!==d?(I=d&&i.jsx("div",{className:"mb-4",children:i.jsx(G.CreditsEyebrow,{balanceDollars:u})}),e[24]=u,e[25]=d,e[26]=I):I=e[26];let T;e[27]!==k?(T=k&&i.jsx("div",{className:"mb-4",children:i.jsx(G.NoCreditsEyebrow,{})}),e[27]=k,e[28]=T):T=e[28];let M;e[29]!==x?(M=i.jsxs("p",{className:"text-3xl font-medium text-foreground",children:["What's on your mind, ",x,"?"]}),e[29]=x,e[30]=M):M=e[30];let $;e[31]!==I||e[32]!==T||e[33]!==M?($=i.jsxs("div",{className:"text-center mb-10",children:[I,T,M]}),e[31]=I,e[32]=T,e[33]=M,e[34]=$):$=e[34];let z;e[35]===Symbol.for("react.memo_cache_sentinel")?(z=i.jsx("div",{className:"w-full",children:i.jsx(G.Input,{showConnectionsBanner:!0})}),e[35]=z):z=e[35];let S;e[36]!==$?(S=i.jsxs("div",{className:"flex flex-col items-center w-full max-w-[672px]",children:[$,z]}),e[36]=$,e[37]=S):S=e[37];let h;e[38]===Symbol.for("react.memo_cache_sentinel")?(h=i.jsx("div",{className:"w-full mt-10 mx-auto",children:i.jsx(ge,{})}),e[38]=h):h=e[38];let p;e[39]!==S?(p=i.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center w-full",children:[S,h]}),e[39]=S,e[40]=p):p=e[40];let f;e[41]!==n?(f=n&&i.jsx("div",{className:"absolute bottom-6 left-0 right-0 px-10",children:i.jsx("div",{className:"w-full max-w-[500px] mx-auto",children:i.jsx(he,{onClick:()=>r(!0)})})}),e[41]=n,e[42]=f):f=e[42];let g;e[43]!==p||e[44]!==f?(g=i.jsxs("div",{className:"flex-1 relative flex flex-col items-center px-10",children:[p,f]}),e[43]=p,e[44]=f,e[45]=g):g=e[45];let j;e[46]!==s?(j=i.jsx(oe,{open:s,onOpenChange:r}),e[46]=s,e[47]=j):j=e[47];let A;return e[48]!==g||e[49]!==j?(A=i.jsxs(i.Fragment,{children:[g,j]}),e[48]=g,e[49]=j,e[50]=A):A=e[50],A}function es(){const e=R.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx("div",{className:"flex-1 min-h-0 p-1.5 overflow-hidden",children:i.jsx("div",{className:"flex h-full flex-col bg-background overflow-hidden card-shadow rounded-[0.75rem]",children:i.jsx(pt,{})})}),e[0]=t):t=e[0],t}export{es as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{cj as ne,e as _,j as o,B as te,l as ln,bc as ze,ck as ms,r as T,s as oe,c as O,g as ps,o as cn,c5 as xs,a7 as hs,a8 as fe,aW as an,c6 as gs,aT as bs,c4 as Ss,c7 as un,b6 as js,cd as ys,ce as vs,ae as ws,cf as Ns,cl as $t,cm as dn,x as ks,y as _s,cn as Cs,co as Is}from"./index-RBXYZ0o1.js";import{D as Ts,F as Es,B as $s}from"./index-D_jFKVK5.js";import{a as Fe,i as Os,u as ae}from"./constants-CVSLlYnf.js";import{b as fn}from"./use-virtual-mcp-D1lThWcu.js";import{M as Re}from"./monaco-editor-9MzrlDzJ.js";import{A as Rs,c as Ms,a as Ls,b as Ps,e as As,R as Ut,d as zs}from"./accordion-isIiC_Tx.js";import{B as le}from"./badge-BCkY0osU.js";import{c as vt,S as wt,d as nt,b as Nt,a as kt}from"./select-8rqyX4yY.js";import{N as Ws,h as Ds,j as Fs,m as Be,P as Hs,i as Vs,R as Us,c as qs,k as Ks,e as qt,d as Bs,S as st}from"./index-fNW0SHRb.js";import{V as Xs}from"./view-mode-toggle-CV8uckCG.js";import{aa as Js,ab as Gs,i as Qs,a2 as mn,ac as Ys,Q as Zs,r as eo,ad as pn,Z as to,V as xn,ae as no,af as so,T as bt,ag as oo}from"./agent-icon-DyZrsMHV.js";import{i as hn}from"./Play-CtLPh-DP.js";import{b as ro,a as io,V as Qe}from"./layout-Cbq9XvLR.js";import{c as gn,T as bn,a as Sn,b as jn}from"./tooltip-l5gvSkP4.js";import{u as lo,a as co}from"./use-connection-KIdOMYYB.js";import{u as Ot,d as Rt,b as yn}from"./use-mcp-tools-CvCxJUq7.js";import{c as ao,d as uo,e as fo,D as mo,a as po,b as xo}from"./dialog-B9mCJ9u4.js";import"./index-By6SCvFJ.js";import{S as ho}from"./index-af7Ms30x.js";import{D as vn,a as wn,b as Nn,c as Ye}from"./dropdown-menu-BACFhEWG.js";import{s as go}from"./Plus-Bz8pOCrF.js";import{b as kn}from"./Tool01-DA28S3sH.js";import{i as He}from"./ChevronDown-BrUt0Alw.js";import{s as Mt}from"./XClose-C9Qfd8kZ.js";import{I as Lt}from"./integration-icon-BUk_AQZb.js";import{a as bo,S as So}from"./scroll-area-DwYUYaC4.js";import"./index-D-Rzrt74.js";import{i as _n}from"./X-DoHhdWpr.js";import{u as Cn,a as jo}from"./use-collections-XPoz4bQ4.js";import{E as In}from"./empty-state-Cd5nlZi8.js";import{c as yo}from"./create-sse-subscription-CxkOgzKf.js";import{I as Kt}from"./input-CbOPFA2Y.js";const Tn=ne("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);const En=ne("Braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);const ot=ne("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const rt=ne("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const vo=ne("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const $n=ne("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const wo=ne("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const On=ne("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const Rn=ne("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);const Mn=ne("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);const No=ne("OctagonAlert",[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]]);const Ln=ne("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const Pn=ne("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const ko=ne("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const An=ne("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);function _o(t){const e=_.c(15),{onSave:n,onUndo:s,isDirty:i,isSaving:r,saveLabel:l,undoLabel:c}=t,a=l===void 0?"Save":l,u=c===void 0?"Undo":c;if(!i)return null;let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsx(Js,{size:14}),e[0]=d):d=e[0];let f;e[1]!==r||e[2]!==s||e[3]!==u?(f=o.jsxs(te,{variant:"outline",size:"sm",onClick:s,disabled:r,"aria-label":u,children:[d,u]}),e[1]=r,e[2]=s,e[3]=u,e[4]=f):f=e[4];let m;e[5]!==r?(m=r?o.jsx(ln,{size:14,className:"animate-spin"}):o.jsx(Gs,{size:14}),e[5]=r,e[6]=m):m=e[6];let x;e[7]!==r||e[8]!==n||e[9]!==a||e[10]!==m?(x=o.jsxs(te,{variant:"default",size:"sm",onClick:n,disabled:r,"aria-label":a,children:[m,a]}),e[7]=r,e[8]=n,e[9]=a,e[10]=m,e[11]=x):x=e[11];let p;return e[12]!==f||e[13]!==x?(p=o.jsxs(o.Fragment,{children:[f,x]}),e[12]=f,e[13]=x,e[14]=p):p=e[14],p}const Bt=t=>{let e;const n=new Set,s=(u,d)=>{const f=typeof u=="function"?u(e):u;if(!Object.is(f,e)){const m=e;e=d??(typeof f!="object"||f===null)?f:Object.assign({},e,f),n.forEach(x=>x(e,m))}},i=()=>e,c={setState:s,getState:i,getInitialState:()=>a,subscribe:u=>(n.add(u),()=>n.delete(u))},a=e=t(s,i,c);return c},Pt=(t=>t?Bt(t):Bt),Co=t=>t;function _t(t,e=Co){const n=ze.useSyncExternalStore(t.subscribe,ze.useCallback(()=>e(t.getState()),[t,e]),ze.useCallback(()=>e(t.getInitialState()),[t,e]));return ze.useDebugValue(n),n}const Io=t=>{const e=Pt(t),n=s=>_t(e,s);return Object.assign(n,e),n},To=(t=>Io);function zn(t,e){let n;try{n=t()}catch{return}return{getItem:i=>{var r;const l=a=>a===null?null:JSON.parse(a,void 0),c=(r=n.getItem(i))!=null?r:null;return c instanceof Promise?c.then(l):l(c)},setItem:(i,r)=>n.setItem(i,JSON.stringify(r,void 0)),removeItem:i=>n.removeItem(i)}}const Ct=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(s){return Ct(s)(n)},catch(s){return this}}}catch(n){return{then(s){return this},catch(s){return Ct(s)(n)}}}},Eo=(t,e)=>(n,s,i)=>{let r={storage:zn(()=>window.localStorage),partialize:g=>g,version:0,merge:(g,b)=>({...b,...g}),...e},l=!1,c=0;const a=new Set,u=new Set;let d=r.storage;if(!d)return t((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${r.name}', the given storage is currently unavailable.`),n(...g)},s,i);const f=()=>{const g=r.partialize({...s()});return d.setItem(r.name,{state:g,version:r.version})},m=i.setState;i.setState=(g,b)=>(m(g,b),f());const x=t((...g)=>(n(...g),f()),s,i);i.getInitialState=()=>x;let p;const h=()=>{var g,b;if(!d)return;const j=++c;l=!1,a.forEach(y=>{var S;return y((S=s())!=null?S:x)});const v=((b=r.onRehydrateStorage)==null?void 0:b.call(r,(g=s())!=null?g:x))||void 0;return Ct(d.getItem.bind(d))(r.name).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==r.version){if(r.migrate){const S=r.migrate(y.state,y.version);return S instanceof Promise?S.then(w=>[!0,w]):[!0,S]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,y.state];return[!1,void 0]}).then(y=>{var S;if(j!==c)return;const[w,N]=y;if(p=r.merge(N,(S=s())!=null?S:x),n(p,!0),w)return f()}).then(()=>{j===c&&(v?.(s(),void 0),p=s(),l=!0,u.forEach(y=>y(p)))}).catch(y=>{j===c&&v?.(void 0,y)})};return i.persist={setOptions:g=>{r={...r,...g},g.storage&&(d=g.storage)},clearStorage:()=>{d?.removeItem(r.name)},getOptions:()=>r,rehydrate:()=>h(),hasHydrated:()=>l,onHydrate:g=>(a.add(g),()=>{a.delete(g)}),onFinishHydration:g=>(u.add(g),()=>{u.delete(g)})},r.skipHydration||h(),p||x},Wn=Eo,{useSyncExternalStoreWithSelector:$o}=ms,Oo=t=>t;function Ro(t,e=Oo,n){const s=$o(t.subscribe,t.getState,t.getInitialState,e,n);return ze.useDebugValue(s),s}const Xt=t=>Symbol.iterator in t,Jt=t=>"entries"in t,Gt=(t,e)=>{const n=t instanceof Map?t:new Map(t.entries()),s=e instanceof Map?e:new Map(e.entries());if(n.size!==s.size)return!1;for(const[i,r]of n)if(!s.has(i)||!Object.is(r,s.get(i)))return!1;return!0},Mo=(t,e)=>{const n=t[Symbol.iterator](),s=e[Symbol.iterator]();let i=n.next(),r=s.next();for(;!i.done&&!r.done;){if(!Object.is(i.value,r.value))return!1;i=n.next(),r=s.next()}return!!i.done&&!!r.done};function Lo(t,e){return Object.is(t,e)?!0:typeof t!="object"||t===null||typeof e!="object"||e===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?!1:Xt(t)&&Xt(e)?Jt(t)&&Jt(e)?Gt(t,e):Mo(t,e):Gt({entries:()=>Object.entries(t)},{entries:()=>Object.entries(e)})}function Dn(t,e="Output"){if(!t)return`interface ${e} {}`;function n(r){if(!r||typeof r!="object")return"unknown";const l=r.type;if(Array.isArray(l))return l.map(c=>s(c)).join(" | ");switch(l){case"string":return r.enum?r.enum.map(c=>`"${c}"`).join(" | "):"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";case"array":{const c=r.items;return c?`${n(c)}[]`:"unknown[]"}case"object":return i(r);default:return r.anyOf?r.anyOf.map(n).join(" | "):r.oneOf?r.oneOf.map(n).join(" | "):r.allOf?r.allOf.map(n).join(" & "):"unknown"}}function s(r){switch(r){case"string":return"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";default:return"unknown"}}function i(r){const l=r.properties;if(!l)return"Record<string, unknown>";const c=new Set(r.required||[]);return`{
|
|
1
|
+
import{cj as ne,e as _,j as o,B as te,l as ln,bc as ze,ck as ms,r as T,s as oe,c as O,g as ps,o as cn,c5 as xs,a7 as hs,a8 as fe,aW as an,c6 as gs,aT as bs,c4 as Ss,c7 as un,b6 as js,cd as ys,ce as vs,ae as ws,cf as Ns,cl as $t,cm as dn,x as ks,y as _s,cn as Cs,co as Is}from"./index-BGvMfUr2.js";import{D as Ts,F as Es,B as $s}from"./index-QpbQL5yY.js";import{a as Fe,i as Os,u as ae}from"./constants-BVU634u9.js";import{b as fn}from"./use-virtual-mcp-BOr32Cw9.js";import{M as Re}from"./monaco-editor-D9GcAVz1.js";import{A as Rs,c as Ms,a as Ls,b as Ps,e as As,R as Ut,d as zs}from"./accordion-zoDibAHc.js";import{B as le}from"./badge-Vn5olYFX.js";import{c as vt,S as wt,d as nt,b as Nt,a as kt}from"./select-CKhnD_dJ.js";import{N as Ws,h as Ds,j as Fs,m as Be,P as Hs,i as Vs,R as Us,c as qs,k as Ks,e as qt,d as Bs,S as st}from"./index-BizlRsAk.js";import{V as Xs}from"./view-mode-toggle-DqaIt4c7.js";import{aa as Js,ab as Gs,i as Qs,a2 as mn,ac as Ys,Q as Zs,r as eo,ad as pn,Z as to,V as xn,ae as no,af as so,T as bt,ag as oo}from"./agent-icon-B5EEcofO.js";import{i as hn}from"./Play-Ch3KWC7Z.js";import{b as ro,a as io,V as Qe}from"./layout-DtEpOSua.js";import{c as gn,T as bn,a as Sn,b as jn}from"./tooltip-8sj0FPxK.js";import{u as lo,a as co}from"./use-connection-EBpfvjCE.js";import{u as Ot,d as Rt,b as yn}from"./use-mcp-tools-yGAchpt7.js";import{c as ao,d as uo,e as fo,D as mo,a as po,b as xo}from"./dialog-Cc5-s5cq.js";import"./index-CxcuSo6g.js";import{S as ho}from"./index-DWnDHmtK.js";import{D as vn,a as wn,b as Nn,c as Ye}from"./dropdown-menu-BdezCavF.js";import{s as go}from"./Plus-gLdNtuBE.js";import{b as kn}from"./Tool01-D1xeep7h.js";import{i as He}from"./ChevronDown-BMTA9_Ap.js";import{s as Mt}from"./XClose-C1T9ODT_.js";import{I as Lt}from"./integration-icon-Btl0P6Zi.js";import{a as bo,S as So}from"./scroll-area-KyXayDS_.js";import"./index-DRSFVCQG.js";import{i as _n}from"./X-fvjwb2RC.js";import{u as Cn,a as jo}from"./use-collections-DbJUoPI1.js";import{E as In}from"./empty-state-B-SDOSco.js";import{c as yo}from"./create-sse-subscription-CxkOgzKf.js";import{I as Kt}from"./input-r-FVR1hH.js";const Tn=ne("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);const En=ne("Braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);const ot=ne("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const rt=ne("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const vo=ne("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const $n=ne("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const wo=ne("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const On=ne("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const Rn=ne("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);const Mn=ne("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);const No=ne("OctagonAlert",[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]]);const Ln=ne("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const Pn=ne("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const ko=ne("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const An=ne("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);function _o(t){const e=_.c(15),{onSave:n,onUndo:s,isDirty:i,isSaving:r,saveLabel:l,undoLabel:c}=t,a=l===void 0?"Save":l,u=c===void 0?"Undo":c;if(!i)return null;let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsx(Js,{size:14}),e[0]=d):d=e[0];let f;e[1]!==r||e[2]!==s||e[3]!==u?(f=o.jsxs(te,{variant:"outline",size:"sm",onClick:s,disabled:r,"aria-label":u,children:[d,u]}),e[1]=r,e[2]=s,e[3]=u,e[4]=f):f=e[4];let m;e[5]!==r?(m=r?o.jsx(ln,{size:14,className:"animate-spin"}):o.jsx(Gs,{size:14}),e[5]=r,e[6]=m):m=e[6];let x;e[7]!==r||e[8]!==n||e[9]!==a||e[10]!==m?(x=o.jsxs(te,{variant:"default",size:"sm",onClick:n,disabled:r,"aria-label":a,children:[m,a]}),e[7]=r,e[8]=n,e[9]=a,e[10]=m,e[11]=x):x=e[11];let p;return e[12]!==f||e[13]!==x?(p=o.jsxs(o.Fragment,{children:[f,x]}),e[12]=f,e[13]=x,e[14]=p):p=e[14],p}const Bt=t=>{let e;const n=new Set,s=(u,d)=>{const f=typeof u=="function"?u(e):u;if(!Object.is(f,e)){const m=e;e=d??(typeof f!="object"||f===null)?f:Object.assign({},e,f),n.forEach(x=>x(e,m))}},i=()=>e,c={setState:s,getState:i,getInitialState:()=>a,subscribe:u=>(n.add(u),()=>n.delete(u))},a=e=t(s,i,c);return c},Pt=(t=>t?Bt(t):Bt),Co=t=>t;function _t(t,e=Co){const n=ze.useSyncExternalStore(t.subscribe,ze.useCallback(()=>e(t.getState()),[t,e]),ze.useCallback(()=>e(t.getInitialState()),[t,e]));return ze.useDebugValue(n),n}const Io=t=>{const e=Pt(t),n=s=>_t(e,s);return Object.assign(n,e),n},To=(t=>Io);function zn(t,e){let n;try{n=t()}catch{return}return{getItem:i=>{var r;const l=a=>a===null?null:JSON.parse(a,void 0),c=(r=n.getItem(i))!=null?r:null;return c instanceof Promise?c.then(l):l(c)},setItem:(i,r)=>n.setItem(i,JSON.stringify(r,void 0)),removeItem:i=>n.removeItem(i)}}const Ct=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(s){return Ct(s)(n)},catch(s){return this}}}catch(n){return{then(s){return this},catch(s){return Ct(s)(n)}}}},Eo=(t,e)=>(n,s,i)=>{let r={storage:zn(()=>window.localStorage),partialize:g=>g,version:0,merge:(g,b)=>({...b,...g}),...e},l=!1,c=0;const a=new Set,u=new Set;let d=r.storage;if(!d)return t((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${r.name}', the given storage is currently unavailable.`),n(...g)},s,i);const f=()=>{const g=r.partialize({...s()});return d.setItem(r.name,{state:g,version:r.version})},m=i.setState;i.setState=(g,b)=>(m(g,b),f());const x=t((...g)=>(n(...g),f()),s,i);i.getInitialState=()=>x;let p;const h=()=>{var g,b;if(!d)return;const j=++c;l=!1,a.forEach(y=>{var S;return y((S=s())!=null?S:x)});const v=((b=r.onRehydrateStorage)==null?void 0:b.call(r,(g=s())!=null?g:x))||void 0;return Ct(d.getItem.bind(d))(r.name).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==r.version){if(r.migrate){const S=r.migrate(y.state,y.version);return S instanceof Promise?S.then(w=>[!0,w]):[!0,S]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,y.state];return[!1,void 0]}).then(y=>{var S;if(j!==c)return;const[w,N]=y;if(p=r.merge(N,(S=s())!=null?S:x),n(p,!0),w)return f()}).then(()=>{j===c&&(v?.(s(),void 0),p=s(),l=!0,u.forEach(y=>y(p)))}).catch(y=>{j===c&&v?.(void 0,y)})};return i.persist={setOptions:g=>{r={...r,...g},g.storage&&(d=g.storage)},clearStorage:()=>{d?.removeItem(r.name)},getOptions:()=>r,rehydrate:()=>h(),hasHydrated:()=>l,onHydrate:g=>(a.add(g),()=>{a.delete(g)}),onFinishHydration:g=>(u.add(g),()=>{u.delete(g)})},r.skipHydration||h(),p||x},Wn=Eo,{useSyncExternalStoreWithSelector:$o}=ms,Oo=t=>t;function Ro(t,e=Oo,n){const s=$o(t.subscribe,t.getState,t.getInitialState,e,n);return ze.useDebugValue(s),s}const Xt=t=>Symbol.iterator in t,Jt=t=>"entries"in t,Gt=(t,e)=>{const n=t instanceof Map?t:new Map(t.entries()),s=e instanceof Map?e:new Map(e.entries());if(n.size!==s.size)return!1;for(const[i,r]of n)if(!s.has(i)||!Object.is(r,s.get(i)))return!1;return!0},Mo=(t,e)=>{const n=t[Symbol.iterator](),s=e[Symbol.iterator]();let i=n.next(),r=s.next();for(;!i.done&&!r.done;){if(!Object.is(i.value,r.value))return!1;i=n.next(),r=s.next()}return!!i.done&&!!r.done};function Lo(t,e){return Object.is(t,e)?!0:typeof t!="object"||t===null||typeof e!="object"||e===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?!1:Xt(t)&&Xt(e)?Jt(t)&&Jt(e)?Gt(t,e):Mo(t,e):Gt({entries:()=>Object.entries(t)},{entries:()=>Object.entries(e)})}function Dn(t,e="Output"){if(!t)return`interface ${e} {}`;function n(r){if(!r||typeof r!="object")return"unknown";const l=r.type;if(Array.isArray(l))return l.map(c=>s(c)).join(" | ");switch(l){case"string":return r.enum?r.enum.map(c=>`"${c}"`).join(" | "):"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";case"array":{const c=r.items;return c?`${n(c)}[]`:"unknown[]"}case"object":return i(r);default:return r.anyOf?r.anyOf.map(n).join(" | "):r.oneOf?r.oneOf.map(n).join(" | "):r.allOf?r.allOf.map(n).join(" & "):"unknown"}}function s(r){switch(r){case"string":return"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";default:return"unknown"}}function i(r){const l=r.properties;if(!l)return"Record<string, unknown>";const c=new Set(r.required||[]);return`{
|
|
2
2
|
${Object.entries(l).map(([u,d])=>{const f=c.has(u)?"":"?";return`${d.description?` /** ${d.description} */
|
|
3
3
|
`:""} ${u}${f}: ${n(d)};`}).join(`
|
|
4
4
|
`)}
|
package/dist/client/assets/{infiniteQueryObserver--3YinOmX.js → infiniteQueryObserver-B9_hQDN4.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{dw as d,dx as f,dy as v,dz as x}from"./index-
|
|
1
|
+
import{dw as d,dx as f,dy as v,dz as x}from"./index-BGvMfUr2.js";var N=class extends d{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){super.setOptions({...e,behavior:f()})}getOptimisticResult(e){return e.behavior=f(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:s}=e,i=super.createResult(e,t),{isFetching:a,isRefetching:P,isError:c,isRefetchError:g}=i,r=s.fetchMeta?.fetchMore?.direction,h=c&&r==="forward",o=a&&r==="forward",n=c&&r==="backward",u=a&&r==="backward";return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:x(t,s.data),hasPreviousPage:v(t,s.data),isFetchNextPageError:h,isFetchingNextPage:o,isFetchPreviousPageError:n,isFetchingPreviousPage:u,isRefetchError:g&&!h&&!n,isRefetching:P&&!o&&!u}}};export{N as I};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as s,c as a,j as d}from"./index-
|
|
1
|
+
import{e as s,c as a,j as d}from"./index-BGvMfUr2.js";function f(l){const e=s.c(10);let i,t,r;e[0]!==l?({className:i,type:r,...t}=l,e[0]=l,e[1]=i,e[2]=t,e[3]=r):(i=e[1],t=e[2],r=e[3]);let n;e[4]!==i?(n=a("file:text-foreground text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground flex h-9 w-full min-w-0 rounded-lg bg-background dark:bg-input/30 px-3 py-1 text-sm transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:opacity-50 card-shadow","focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:ring-[2px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",i),e[4]=i,e[5]=n):n=e[5];let o;return e[6]!==t||e[7]!==n||e[8]!==r?(o=d.jsx("input",{type:r,"data-slot":"input",className:n,...t}),e[6]=t,e[7]=n,e[8]=r,e[9]=o):o=e[9],o}export{f as I};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as A,j as h,r as z,c as _}from"./index-
|
|
1
|
+
import{e as A,j as h,r as z,c as _}from"./index-BGvMfUr2.js";import{n as L}from"./Container-CIDvyJX8.js";import{A as k}from"./agent-icon-B5EEcofO.js";const C={"2xs":"h-4 w-4",xs:"h-6 w-6",sm:"h-9 w-9",md:"h-12 w-12",lg:"h-16 w-16",xl:"h-14 w-14"},Z={"2xs":"min-w-4",xs:"min-w-6",sm:"min-w-9",md:"min-w-12",lg:"min-w-16",xl:"min-w-14"},y={"2xs":8,xs:12,sm:16,md:24,lg:32,xl:28},M={"2xs":"xs",xs:"xs",sm:"sm",md:"md",lg:"lg",xl:"lg"};function q(E){const e=A.c(12),{icon:t,name:s,size:w,className:o,fallbackIcon:c}=E,n=w===void 0?"md":w;if(t?.startsWith("icon://")||t?.includes("#agentcolor=")){const r=M[n];let l;return e[0]!==o||e[1]!==t||e[2]!==s||e[3]!==r?(l=h.jsx(k,{icon:t,name:s,size:r,className:o}),e[0]=o,e[1]=t,e[2]=s,e[3]=r,e[4]=l):l=e[4],l}const g=t??"no-icon";let i;return e[5]!==o||e[6]!==c||e[7]!==t||e[8]!==s||e[9]!==n||e[10]!==g?(i=h.jsx(R,{icon:t,name:s,size:n,className:o,fallbackIcon:c},g),e[5]=o,e[6]=c,e[7]=t,e[8]=s,e[9]=n,e[10]=g,e[11]=i):i=e[11],i}function R(E){const e=A.c(24),{icon:t,name:s,size:w,className:o,fallbackIcon:c}=E,n=w===void 0?"md":w,[g,i]=z.useState(!1),r=!!t&&g,l=C[n],b=Z[n];let a;e[0]!==o||e[1]!==l||e[2]!==b?(a=_("rounded-lg border border-border shrink-0 overflow-hidden aspect-square bg-white",l,b,o),e[0]=o,e[1]=l,e[2]=b,e[3]=a):a=e[3];const p=t||void 0,N=!r&&"hidden";let m;e[4]!==N?(m=_("h-full w-full object-cover",N),e[4]=N,e[5]=m):m=e[5];let I,S;e[6]===Symbol.for("react.memo_cache_sentinel")?(I=()=>i(!1),S=()=>i(!0),e[6]=I,e[7]=S):(I=e[6],S=e[7]);let d;e[8]!==s||e[9]!==p||e[10]!==m?(d=h.jsx("img",{src:p,alt:s,className:m,onError:I,onLoad:S}),e[8]=s,e[9]=p,e[10]=m,e[11]=d):d=e[11];const v=r&&"hidden";let f;e[12]!==v?(f=_("h-full w-full flex items-center justify-center bg-muted/20",v),e[12]=v,e[13]=f):f=e[13];let x;e[14]!==c||e[15]!==n?(x=c??h.jsx(L,{size:y[n],className:"text-muted-foreground"}),e[14]=c,e[15]=n,e[16]=x):x=e[16];let u;e[17]!==f||e[18]!==x?(u=h.jsx("div",{className:f,children:x}),e[17]=f,e[18]=x,e[19]=u):u=e[19];let j;return e[20]!==d||e[21]!==u||e[22]!==a?(j=h.jsxs("div",{className:a,children:[d,u]}),e[20]=d,e[21]=u,e[22]=a,e[23]=j):j=e[23],j}export{q as I};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as n,c as r,j as i,b5 as p}from"./index-
|
|
1
|
+
import{e as n,c as r,j as i,b5 as p}from"./index-BGvMfUr2.js";function c(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=r("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(p,{"data-slot":"label",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{c as L};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as C,r as i,c as A,j as a,ao as V}from"./index-
|
|
1
|
+
import{e as C,r as i,c as A,j as a,ao as V}from"./index-BGvMfUr2.js";import{P as E}from"./index-C-49LFOm.js";const H=i.createContext(null);function z(x){const e=C.c(3),{children:l}=x,s=i.useContext(H);if(!s?.tabsEl)return null;let c;return e[0]!==l||e[1]!==s.tabsEl?(c=V.createPortal(l,s.tabsEl),e[0]=l,e[1]=s.tabsEl,e[2]=c):c=e[2],c}function D(x){const e=C.c(3),{children:l}=x,s=i.useContext(H);if(!s?.actionsEl)return null;let c;return e[0]!==l||e[1]!==s.actionsEl?(c=V.createPortal(l,s.actionsEl),e[0]=l,e[1]=s.actionsEl,e[2]=c):c=e[2],c}const B=D;function F(x){const e=C.c(21),{children:l,breadcrumb:s,hideHeader:c}=x;let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b={leftEl:null,tabsEl:null,actionsEl:null},e[0]=b):b=e[0];const[w,g]=i.useState(b),N=i.useRef(null),P=i.useRef(null),L=i.useRef(null);let h;e[1]===Symbol.for("react.memo_cache_sentinel")?(h=t=>{N.current=t,t&&g(n=>n.leftEl===t?n:{...n,leftEl:t})},e[1]=h):h=e[1];const $=h;let R;e[2]===Symbol.for("react.memo_cache_sentinel")?(R=t=>{P.current=t,t&&g(n=>n.tabsEl===t?n:{...n,tabsEl:t})},e[2]=R):R=e[2];const _=R;let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=t=>{L.current=t,t&&g(n=>n.actionsEl===t?n:{...n,actionsEl:t})},e[3]=d):d=e[3];const k=d,p=c&&"hidden";let o;e[4]!==p?(o=A(p),e[4]=p,e[5]=o):o=e[5];let j;e[6]===Symbol.for("react.memo_cache_sentinel")?(j=a.jsx("div",{ref:$,className:"flex items-center gap-2 min-w-0"}),e[6]=j):j=e[6];let r;e[7]!==s?(r=a.jsxs(E.Header.Left,{children:[s,j]}),e[7]=s,e[8]=r):r=e[8];let y;e[9]===Symbol.for("react.memo_cache_sentinel")?(y=a.jsxs(E.Header.Right,{children:[a.jsx("div",{ref:_,className:"flex items-center gap-2 overflow-x-auto min-w-0"}),a.jsx("div",{ref:k,className:"flex items-center gap-2 shrink-0"})]}),e[9]=y):y=e[9];let f;e[10]!==o||e[11]!==r?(f=a.jsxs(E.Header,{className:o,children:[r,y]}),e[10]=o,e[11]=r,e[12]=f):f=e[12];let m;e[13]!==l?(m=a.jsx(E.Content,{children:l}),e[13]=l,e[14]=m):m=e[14];let u;e[15]!==f||e[16]!==m?(u=a.jsxs(E,{children:[f,m]}),e[15]=f,e[16]=m,e[17]=u):u=e[17];let S;return e[18]!==w||e[19]!==u?(S=a.jsx(H,{value:w,children:u}),e[18]=w,e[19]=u,e[20]=S):S=e[20],S}export{F as V,B as a,z as b};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{e as U,j as t,s as V,o as we,b as Fe,r as O,K as ne,n as He,a as Be,c as xe,B as ae,t as D,x as oe,G as Je,F as Xe,v as je,P as Ze,l as Ne,w as et,f as tt}from"./index-RBXYZ0o1.js";import{S as ce,u as $,d as Se,W as qe,j as be}from"./constants-CVSLlYnf.js";import{a as _e}from"./use-navigate-to-agent-h3H44Uqx.js";import{a as le,b as de,c as ue,d as me,D as nt}from"./dialog-B9mCJ9u4.js";import{i as Ae}from"./RefreshCcw01-KEgE6miP.js";import{C as Qe}from"./collection-search-CZ45K7il.js";import{C as st}from"./checkbox-DdEbgSXy.js";import{b as Ee,u as it}from"./use-connection-KIdOMYYB.js";import{i as ot}from"./Lock01-Dch0eKvp.js";import{n as at}from"./agent-icon-DyZrsMHV.js";import{e as rt}from"./extract-connection-data-DWwyWigS.js";import{b as Oe,a as Le,c as Re,D as Me}from"./drawer-ChRbi3da.js";import{u as ke}from"./tooltip-l5gvSkP4.js";import{I as Ue}from"./integration-icon-BUk_AQZb.js";import{u as ct,d as Ye}from"./use-mcp-tools-CvCxJUq7.js";import{a as Pe,b as lt}from"./use-virtual-mcp-D1lThWcu.js";function re(a){const e=U.c(4),{size:s,className:o}=a;let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0016 8c0-4.42-3.58-8-8-8z"}),e[0]=d):d=e[0];let n;return e[1]!==o||e[2]!==s?(n=t.jsx("svg",{width:s,height:s,viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",className:o,children:d}),e[1]=o,e[2]=s,e[3]=n):n=e[3],n}function dt(a){return a.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}async function ut(a){const e=await fetch(`/api/${a}/deco-sites`);if(!e.ok){const s=await e.json().catch(()=>({}));throw new Error(s.error??`Failed to load sites (${e.status})`)}return e.json()}function Wt(a){const e=U.c(70),{open:s,onOpenChange:o,onBack:d}=a,{org:n}=V(),c=_e(),u=we(),{data:l}=Fe.useSession(),[_,p]=O.useState(null),[C,g]=O.useState("");let m;e[0]!==n.id||e[1]!==n.slug?(m={connectionId:ce,orgId:n.id,orgSlug:n.slug},e[0]=n.id,e[1]=n.slug,e[2]=m):m=e[2];const f=$(m);let r;e[3]!==l?.user?.email?(r=ne.decoSites(l?.user?.email),e[3]=l?.user?.email,e[4]=r):r=e[4];let h;e[5]!==n.slug?(h=()=>ut(n.slug),e[5]=n.slug,e[6]=h):h=e[6];const x=s&&!!l?.user?.email;let T;e[7]!==r||e[8]!==h||e[9]!==x?(T={queryKey:r,queryFn:h,enabled:x,staleTime:6e4,retry:!1},e[7]=r,e[8]=h,e[9]=x,e[10]=T):T=e[10];const{data:b,isLoading:N,error:y}=He(T),i=b?.sites??[];let I;e[11]!==o?(I=w=>{w||(p(null),g("")),o(w)},e[11]=o,e[12]=I):I=e[12];const v=I;let j;e[13]!==C?(j=w=>w.name.toLowerCase().includes(C.toLowerCase())||w.domains?.[0]?.domain.toLowerCase().includes(C.toLowerCase()),e[13]=C,e[14]=j):j=e[14];const S=i.filter(j),A=!_||S.some(w=>w.name===_);let E;e[15]!==f||e[16]!==n.id||e[17]!==n.slug?(E=async w=>{D("deco_site_import_started",{site_name:w});const P=await fetch(`/api/${n.slug}/deco-sites/connection`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteName:w,orgId:n.id})}),G=await P.json().catch(gt);if(!P.ok)throw new Error(G.error??`Failed to create connection (${P.status})`);const M=G.connId;if(!M)throw new Error("Server did not return a connection ID");const he=G.icon??null,te=dt(w),Ge=await f.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:w,description:"Imported from deco.cx",pinned:!0,icon:he??null,subtype:"project",metadata:{instructions:null,enabled_plugins:[],ui:{banner:null,bannerColor:"#22C55E",icon:he,themeColor:"#22C55E",slug:te,pinnedViews:[{connectionId:M,toolName:"file_explorer",label:"Preview",icon:null},{connectionId:M,toolName:"fetch_assets",label:"Assets",icon:null},{connectionId:M,toolName:"get_monitor_data",label:"Monitor",icon:null},{connectionId:M,toolName:"list_pull_requests",label:"Pull Requests",icon:null},{connectionId:M,toolName:"list_releases",label:"Releases",icon:null}],layout:{defaultMainView:{type:"ext-apps",id:M,toolName:"file_explorer"}}}},connections:[{connection_id:M}]}}}),De=Ge.structuredContent??Ge;return{slug:te,virtualMcpId:De.item.id,connId:M,item:De.item}},e[15]=f,e[16]=n.id,e[17]=n.slug,e[18]=E):E=e[18];let R;e[19]!==f||e[20]!==v||e[21]!==c||e[22]!==n.id||e[23]!==u?(R=w=>{const{slug:P,virtualMcpId:G,item:M}=w;D("deco_site_import_succeeded",{site_name:M.title,virtual_mcp_id:G,slug:P}),u.setQueryData(ne.collectionItem(f,n.id,"","VIRTUAL_MCP",G),{item:M}),u.invalidateQueries({predicate:he=>{const te=he.queryKey;return te[1]===n.id&&te[3]==="collection"&&te[4]==="VIRTUAL_MCP"}}),u.invalidateQueries({queryKey:ne.projects(n.id)}),oe.success(`Imported ${P} from deco.cx`),v(!1),localStorage.setItem("mesh:sidebar-open",JSON.stringify(!1)),c(G)},e[19]=f,e[20]=v,e[21]=c,e[22]=n.id,e[23]=u,e[24]=R):R=e[24];let z;e[25]!==E||e[26]!==R?(z={mutationFn:E,onSuccess:R,onError:ft},e[25]=E,e[26]=R,e[27]=z):z=e[27];const k=Be(z),se=de,L=le,ie="sm:max-w-[900px] p-0 gap-0 overflow-hidden";let F;e[28]===Symbol.for("react.memo_cache_sentinel")?(F=t.jsx(ue,{className:"sr-only",children:t.jsx(me,{children:"Import from deco.cx"})}),e[28]=F):F=e[28];let H;e[29]!==d?(H=d&&t.jsx("button",{type:"button",onClick:d,className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors","aria-label":"Go back",children:t.jsx(Ae,{size:18})}),e[29]=d,e[30]=H):H=e[30];let fe;e[31]===Symbol.for("react.memo_cache_sentinel")?(fe=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Import from deco.cx"}),e[31]=fe):fe=e[31];let B;e[32]!==H?(B=t.jsxs("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3",children:[H,fe]}),e[32]=H,e[33]=B):B=e[33];let ge;e[34]===Symbol.for("react.memo_cache_sentinel")?(ge=w=>{w.key==="Escape"&&g("")},e[34]=ge):ge=e[34];let q;e[35]!==C?(q=t.jsx("div",{children:t.jsx(Qe,{value:C,onChange:g,placeholder:"Search sites...",onKeyDown:ge})}),e[35]=C,e[36]=q):q=e[36];const We="pb-0 min-h-[300px]";let Q;e[37]!==N?(Q=N&&t.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:"Loading sites..."}),e[37]=N,e[38]=Q):Q=e[38];const Ce=!N&&!y&&i.length===0&&t.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:"No sites found for this account."}),Ie=!N&&i.length>0&&t.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4 max-h-[420px] overflow-y-auto py-4 px-8 [scrollbar-gutter:stable]",children:[S.length===0&&t.jsxs("p",{className:"col-span-3 text-sm text-muted-foreground text-center py-8",children:["No sites match “",C,"”"]}),S.map(w=>{const P=w.domains?.find(mt)?.domain??w.domains?.[0]?.domain,G=_===w.name;return t.jsxs("button",{type:"button",onClick:()=>p(w.name),className:xe("flex flex-col rounded-xl border overflow-hidden text-left transition-all cursor-pointer",G?"border-primary ring-1 ring-primary":"border-border hover:border-muted-foreground/40"),children:[t.jsx("div",{className:"w-full aspect-video bg-muted overflow-hidden",children:w.thumb_url?t.jsx("img",{src:w.thumb_url,alt:w.name,className:"w-full h-full object-cover",loading:"lazy"}):t.jsx("div",{className:"w-full h-full bg-muted"})}),t.jsxs("div",{className:"px-4 py-3",children:[t.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:w.name}),P&&t.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:P})]})]},w.name)})]});let Y;e[39]!==Q||e[40]!==Ce||e[41]!==Ie?(Y=t.jsxs("div",{className:We,children:[Q,Ce,Ie]}),e[39]=Q,e[40]=Ce,e[41]=Ie,e[42]=Y):Y=e[42];let K;e[43]!==v?(K=()=>v(!1),e[43]=v,e[44]=K):K=e[44];let W;e[45]!==k.isPending||e[46]!==K?(W=t.jsx(ae,{variant:"outline",onClick:K,disabled:k.isPending,children:"Cancel"}),e[45]=k.isPending,e[46]=K,e[47]=W):W=e[47];const Te=!_||!A||k.isPending||N;let J;e[48]!==k||e[49]!==_?(J=()=>_&&k.mutate(_),e[48]=k,e[49]=_,e[50]=J):J=e[50];const ye=k.isPending?"Importing...":"Import";let X;e[51]!==Te||e[52]!==J||e[53]!==ye?(X=t.jsx(ae,{disabled:Te,onClick:J,children:ye}),e[51]=Te,e[52]=J,e[53]=ye,e[54]=X):X=e[54];let Z;e[55]!==W||e[56]!==X?(Z=t.jsxs(nt,{className:"px-8 py-5 border-t border-border",children:[W,X]}),e[55]=W,e[56]=X,e[57]=Z):Z=e[57];let ee;e[58]!==L||e[59]!==F||e[60]!==B||e[61]!==q||e[62]!==Y||e[63]!==Z?(ee=t.jsxs(L,{className:ie,children:[F,B,q,Y,Z]}),e[58]=L,e[59]=F,e[60]=B,e[61]=q,e[62]=Y,e[63]=Z,e[64]=ee):ee=e[64];let pe;return e[65]!==se||e[66]!==v||e[67]!==s||e[68]!==ee?(pe=t.jsx(se,{open:s,onOpenChange:v,children:ee}),e[65]=se,e[66]=v,e[67]=s,e[68]=ee,e[69]=pe):pe=e[69],pe}function mt(a){return a.production}function ft(a){D("deco_site_import_failed",{error:a instanceof Error?a.message:"Unknown error"}),oe.error("Import failed: "+(a instanceof Error?a.message:"Unknown error"))}function gt(){return{}}function Ke(a,e){const s=U.c(12),{org:o}=V();let d;s[0]!==o.id?(d=Se.REGISTRY(o.id),s[0]=o.id,s[1]=d):d=s[1];const n=d;let c;s[2]!==o.id||s[3]!==o.slug||s[4]!==n?(c={connectionId:n,orgId:o.id,orgSlug:o.slug},s[2]=o.id,s[3]=o.slug,s[4]=n,s[5]=c):c=s[5];const u=$(c);let l;s[6]!==a?(l={name:a},s[6]=a,s[7]=l):l=s[7];const _=e?.enabled??!0;let p;return s[8]!==u||s[9]!==l||s[10]!==_?(p={client:u,toolName:"COLLECTION_REGISTRY_APP_GET",toolArguments:l,enabled:_,staleTime:3e5,select:pt},s[8]=u,s[9]=l,s[10]=_,s[11]=p):p=s[11],ct(p)}function pt(a){return a.structuredContent?.item??null}const ht="deco/mcp-github";function xt(a){const{org:e}=V(),{data:s}=Fe.useSession(),o=Ee(),d=we(),[n,c]=O.useState("idle"),[u,l]=O.useState(null),[_,p]=O.useState(null),{data:C,isLoading:g}=Ke(ht,{enabled:a.enabled}),m=O.useRef(!1);a.enabled&&C&&!g&&!m.current&&s?.user?.id&&n==="idle"&&(m.current=!0,f());async function f(){if(!(!C||!s?.user?.id||!e))try{c("installing"),l(null);const h=rt(C,e.id,s.user.id,{remoteIndex:0});if(!h.connection_url)throw new Error("Registry item is missing a remote URL for mcp-github");const{id:T}=await o.create.mutateAsync(h);c("authenticating");const b=new URL(`/api/${e.slug}/mcp/${T}`,window.location.origin),N=await Je({url:b.href,token:null,orgId:e.id});if(N.supportsOAuth&&!N.isAuthenticated){const{token:y,tokenInfo:i,error:I}=await Xe({connectionId:T,orgSlug:e.slug,scope:"offline_access"});if(I||!y){try{await o.delete.mutateAsync(T)}catch{}throw new Error(I??"No token received from GitHub")}if(i)try{(await fetch(`/api/${e.slug}/connections/${T}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:i.accessToken,refreshToken:i.refreshToken,expiresIn:i.expiresIn,scope:i.scope,clientId:i.clientId,clientSecret:i.clientSecret,tokenEndpoint:i.tokenEndpoint})})).ok||await o.update.mutateAsync({id:T,data:{connection_token:y}})}catch{await o.update.mutateAsync({id:T,data:{connection_token:y}})}}je(d,e.id),p(h),c("ready")}catch(h){l(h instanceof Error?h.message:String(h)),c("error")}}function r(){c("idle"),l(null),p(null),m.current=!1}return a.enabled&&g&&n==="idle"?{status:"installing",error:null,connection:null,retry:r}:{status:n,error:u,connection:_,retry:r}}function Jt(a){const e=U.c(21),{open:s,onOpenChange:o,title:d,hideAutoRespondCheckbox:n,onImportComplete:c}=a,u=d===void 0?"Import from GitHub":d,l=n===void 0?!1:n,[_]=Ze(),[p,C]=O.useState(null);if(!_.experimental_vibecode)return null;let g;e[0]!==u?(g=t.jsx(ue,{className:"sr-only",children:t.jsx(me,{children:u})}),e[0]=u,e[1]=g):g=e[1];let m;e[2]!==p||e[3]!==u?(m=t.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3 shrink-0",children:p?t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>C(null),className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors shrink-0","aria-label":"Back to accounts",children:t.jsx(Ae,{size:16})}),t.jsx("img",{src:p.avatarUrl,alt:p.login,className:"size-5 rounded-full ring-1 ring-border shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:p.login})]}):t.jsxs(t.Fragment,{children:[t.jsx(re,{className:"size-4 text-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:u})]})}),e[2]=p,e[3]=u,e[4]=m):m=e[4];let f;e[5]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Ne,{size:18,className:"animate-spin text-muted-foreground"})}),e[5]=f):f=e[5];let r;e[6]!==o?(r=()=>o(!1),e[6]=o,e[7]=r):r=e[7];let h;e[8]!==l||e[9]!==c||e[10]!==p||e[11]!==r?(h=t.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-w-0",children:t.jsx(O.Suspense,{fallback:f,children:t.jsx(Nt,{onComplete:r,selectedInstallation:p,onSelectInstallation:C,hideAutoRespondCheckbox:l,onImportComplete:c})})}),e[8]=l,e[9]=c,e[10]=p,e[11]=r,e[12]=h):h=e[12];let x;e[13]!==g||e[14]!==m||e[15]!==h?(x=t.jsxs(le,{className:"sm:max-w-[560px] h-[85svh] sm:h-[520px] p-0 gap-0 overflow-hidden flex flex-col",children:[g,m,h]}),e[13]=g,e[14]=m,e[15]=h,e[16]=x):x=e[16];let T;return e[17]!==o||e[18]!==s||e[19]!==x?(T=t.jsx(de,{open:s,onOpenChange:o,children:x}),e[17]=o,e[18]=s,e[19]=x,e[20]=T):T=e[20],T}function Nt({onComplete:a,selectedInstallation:e,onSelectInstallation:s,hideAutoRespondCheckbox:o,onImportComplete:d}){const{org:n}=V(),c=we(),u=_e(),[l,_]=O.useState(null),[p,C]=O.useState(!0),g=o?!0:p,m=it({slug:"mcp-github"}),f=xt({enabled:m.length===0}),r=m.length===1?m[0]??null:l,h=$({connectionId:r?.id??"",orgId:n.id,orgSlug:n.slug}),x=$({connectionId:ce,orgId:n.id,orgSlug:n.slug}),T=async(i,I)=>{try{const j=await h.callTool({name:"get_file_contents",arguments:{owner:i.owner,repo:i.name,path:I}});if(j.isError)return null;const A=j.content?.find(E=>E.type==="resource")?.resource?.text;if(!A)return null;try{const E=JSON.parse(A);return typeof E=="string"?E:JSON.stringify(E)}catch{return A}}catch{return null}},b=(i,I)=>{Promise.all([T(I,"AGENTS.md"),T(I,"CLAUDE.md")]).then(async([v,j])=>{const S=v??j??null;S&&(await x.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:i,data:{metadata:{instructions:S}}}}),je(c,n.id))}).catch(v=>{console.error("GitHub instructions fetch failed:",v)})},N=async({virtualMcpId:i,repo:I,connectionId:v})=>{const j=await h.callTool({name:"TRIGGER_LIST",arguments:{}}),S=j.structuredContent??j,A=S.triggers?.find(L=>L.type==="github.issues.opened")??S.triggers?.find(L=>{const ie=L.type.toLowerCase();return/\bissues?\./.test(ie)&&(ie.endsWith(".opened")||ie.endsWith(".created"))});if(!A)throw new Error("No issue-created trigger exposed by GitHub connection");const E=new Set;if(Array.isArray(A.params))for(const L of A.params)E.add(L.name);else if(A.params&&typeof A.params=="object")for(const L of Object.keys(A.params))E.add(L);if(A.paramsSchema)for(const L of Object.keys(A.paramsSchema))E.add(L);const R={};E.has("repo")?R.repo=`${I.owner}/${I.name}`:(E.has("owner")&&(R.owner=I.owner),E.has("name")&&(R.name=I.name),E.has("repository")&&(R.repository=`${I.owner}/${I.name}`));const z=`A new GitHub issue has been opened in ${I.owner}/${I.name}. Read the issue details, explore the relevant code in the repository, create a new branch, implement the fix or feature requested, and open a pull request that resolves the issue. Reference the issue number in the PR description.`,k=await x.callTool({name:"AUTOMATION_CREATE",arguments:{name:`${I.name}: auto-respond to issues`,virtual_mcp_id:i,agent:{id:i},messages:z,active:!0}}),se=k.structuredContent??k;await x.callTool({name:"AUTOMATION_TRIGGER_ADD",arguments:{automation_id:se.id,type:"event",connection_id:v,event_type:A.type,params:R}})},y=Be({mutationFn:async i=>{if(!r||!e)throw new Error("No GitHub connection or installation");const I=r.id,v=await x.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:i.name,description:i.description||"Imported from GitHub",pinned:!0,icon:null,metadata:{githubRepo:{owner:i.owner,name:i.name,url:i.url,installationId:e.installationId,connectionId:I},instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"preview"}}}},connections:[{connection_id:I}]}}}),j=v.structuredContent??v,S=j.item.id;return g&&await N({virtualMcpId:S,repo:i,connectionId:I}).catch(A=>{console.error("Failed to set up issue automation:",A),oe.warning("Imported repo, but failed to set up issue auto-response. You can add the trigger manually from the automations view.")}),{virtualMcpId:S,repo:i,connectionId:I,item:j.item}},onSuccess:({virtualMcpId:i,repo:I,connectionId:v,item:j})=>{if(c.setQueryData(ne.collectionItem(x,n.id,"","VIRTUAL_MCP",i),{item:j}),je(c,n.id),b(i,I),d){d({virtualMcpId:i,repo:I,connectionId:v});return}oe.success(`Imported ${I.name} from GitHub`),a(),localStorage.setItem("mesh:sidebar-open",JSON.stringify(!1)),u(i)},onError:i=>{oe.error("Failed to import repo: "+(i instanceof Error?i.message:"Unknown error"))}});return f.status==="installing"||f.status==="authenticating"?t.jsx(ve,{status:f.status,error:null,retry:f.retry}):f.status==="error"?t.jsx(ve,{status:"error",error:f.error,retry:f.retry}):m.length===0&&f.status==="idle"?t.jsx(ve,{status:"installing",error:null,retry:f.retry}):m.length>1&&!r?t.jsxs("div",{className:"flex flex-col py-2",children:[t.jsx("div",{className:"px-4 py-2",children:t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Select a connection"})}),m.map(i=>t.jsxs("button",{type:"button",onClick:()=>_(i),className:"flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left",children:[i.icon?t.jsx("img",{src:i.icon,alt:i.title,className:"size-7 rounded-full shrink-0"}):t.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:t.jsx(re,{className:"size-3.5 text-muted-foreground"})}),t.jsx("span",{className:"text-sm font-medium",children:i.title})]},i.id))]}):r?e?t.jsx(Ct,{connectionId:r.id,orgId:n.id,orgSlug:n.slug,installation:e,onSelectRepo:i=>y.mutate(i),isSaving:y.isPending,autoRespondToIssues:p,onAutoRespondChange:C,hideAutoRespondCheckbox:o}):t.jsx(_t,{connectionId:r.id,orgId:n.id,orgSlug:n.slug,onSelect:s,showBackButton:m.length>1,onBack:()=>_(null)}):null}function _t(a){const e=U.c(31),{connectionId:s,orgId:o,orgSlug:d,onSelect:n,showBackButton:c,onBack:u}=a;let l;e[0]!==o||e[1]!==d?(l={connectionId:ce,orgId:o,orgSlug:d},e[0]=o,e[1]=d,e[2]=l):l=e[2];const _=$(l);let p;e[3]!==s||e[4]!==o?(p=ne.githubUserOrgs(o,s),e[3]=s,e[4]=o,e[5]=p):p=e[5];let C;e[6]!==s||e[7]!==_?(C=async()=>{const I=(await _.callTool({name:"GITHUB_LIST_USER_ORGS",arguments:{connectionId:s}})).content?.[0]?.text;if(!I)throw new Error("No response from GITHUB_LIST_USER_ORGS");return JSON.parse(I)},e[6]=s,e[7]=_,e[8]=C):C=e[8];let g;e[9]!==p||e[10]!==C?(g={queryKey:p,queryFn:C},e[9]=p,e[10]=C,e[11]=g):g=e[11];const m=He(g);if(m.isLoading){let i;return e[12]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Ne,{size:18,className:"animate-spin text-muted-foreground"})}),e[12]=i):i=e[12],i}if(m.isError){let i;return e[13]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-destructive",children:"Failed to load GitHub accounts"})}),e[13]=i):i=e[13],i}const f=m.data;if(!f)return null;let r;e[14]!==u||e[15]!==c?(r=c&&t.jsx("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1 shrink-0",children:t.jsxs("button",{type:"button",onClick:u,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(Ae,{size:12}),"Change connection"]})}),e[14]=u,e[15]=c,e[16]=r):r=e[16];let h;if(e[17]!==f.installations||e[18]!==n){let i;e[20]!==n?(i=I=>t.jsxs("button",{type:"button",onClick:()=>n(I),className:"w-full flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left group",children:[t.jsx("img",{src:I.avatarUrl,alt:I.login,className:"size-7 rounded-full shrink-0 ring-1 ring-border"}),t.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[t.jsx("span",{className:"text-sm font-medium leading-none",children:I.login}),I.type==="User"&&t.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"Personal account"})]}),t.jsx("span",{className:"text-xs text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:"Select →"})]},I.installationId),e[20]=n,e[21]=i):i=e[21],h=f.installations.map(i),e[17]=f.installations,e[18]=n,e[19]=h}else h=e[19];let x;e[22]!==h?(x=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden [scrollbar-gutter:stable]",children:h}),e[22]=h,e[23]=x):x=e[23];const T=f.appSlug?`https://github.com/apps/${f.appSlug}/installations/new`:"https://github.com/settings/installations";let b;e[24]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("span",{className:"underline underline-offset-2",children:"Install the GitHub App"}),e[24]=b):b=e[24];let N;e[25]!==T?(N=t.jsx("div",{className:"px-4 py-3 border-t border-border shrink-0",children:t.jsxs("a",{href:T,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:["Account not listed?"," ",b]})}),e[25]=T,e[26]=N):N=e[26];let y;return e[27]!==N||e[28]!==r||e[29]!==x?(y=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[r,x,N]}),e[27]=N,e[28]=r,e[29]=x,e[30]=y):y=e[30],y}function Ct(a){const e=U.c(25),{connectionId:s,orgId:o,orgSlug:d,installation:n,onSelectRepo:c,isSaving:u,autoRespondToIssues:l,onAutoRespondChange:_,hideAutoRespondCheckbox:p}=a,[C,g]=O.useState(""),m=O.useDeferredValue(C),f=C!==m;let r;e[0]!==f||e[1]!==C?(r=t.jsx(Qe,{placeholder:"Search repositories...",value:C,onChange:g,isSearching:f}),e[0]=f,e[1]=C,e[2]=r):r=e[2];const h=f?"opacity-40":"opacity-100";let x;e[3]!==h?(x=xe("flex-1 overflow-hidden flex flex-col transition-opacity duration-150",h),e[3]=h,e[4]=x):x=e[4];let T;e[5]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Ne,{size:18,className:"animate-spin text-muted-foreground"})}),e[5]=T):T=e[5];let b;e[6]!==s||e[7]!==m||e[8]!==n||e[9]!==u||e[10]!==c||e[11]!==o||e[12]!==d?(b=t.jsx(O.Suspense,{fallback:T,children:t.jsx(It,{connectionId:s,orgId:o,orgSlug:d,installation:n,query:m,onSelectRepo:c,isSaving:u})}),e[6]=s,e[7]=m,e[8]=n,e[9]=u,e[10]=c,e[11]=o,e[12]=d,e[13]=b):b=e[13];let N;e[14]!==x||e[15]!==b?(N=t.jsx("div",{className:x,children:b}),e[14]=x,e[15]=b,e[16]=N):N=e[16];let y;e[17]!==l||e[18]!==p||e[19]!==_?(y=!p&&t.jsxs("label",{className:"flex items-center gap-2 px-4 py-3 border-t border-border shrink-0 cursor-pointer select-none",children:[t.jsx(st,{checked:l,onCheckedChange:I=>_(I===!0)}),t.jsx("span",{className:"text-xs text-foreground",children:"Auto-respond to new issues with a PR"})]}),e[17]=l,e[18]=p,e[19]=_,e[20]=y):y=e[20];let i;return e[21]!==r||e[22]!==N||e[23]!==y?(i=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[r,N,y]}),e[21]=r,e[22]=N,e[23]=y,e[24]=i):i=e[24],i}function It(a){const e=U.c(29),{connectionId:s,orgId:o,orgSlug:d,installation:n,query:c,onSelectRepo:u,isSaving:l}=a;let _;e[0]!==s||e[1]!==o||e[2]!==d?(_={connectionId:s,orgId:o,orgSlug:d},e[0]=s,e[1]=o,e[2]=d,e[3]=_):_=e[3];const p=$(_),C=n.type==="User"?"user":"org",g=c?`${C}:${n.login} ${c} in:name`:`${C}:${n.login}`;let m;e[4]!==s||e[5]!==n.login||e[6]!==o||e[7]!==c?(m=ne.githubOrgRepos(o,s,n.login,c),e[4]=s,e[5]=n.login,e[6]=o,e[7]=c,e[8]=m):m=e[8];let f;e[9]!==p||e[10]!==g?(f=async()=>{const N=(await p.callTool({name:"search_repositories",arguments:{query:g,page:1,perPage:30}})).content?.[0]?.text;if(!N)throw new Error("No response from search_repositories");return(JSON.parse(N).items??[]).map(Tt)},e[9]=p,e[10]=g,e[11]=f):f=e[11];let r;e[12]!==m||e[13]!==f?(r={queryKey:m,queryFn:f},e[12]=m,e[13]=f,e[14]=r):r=e[14];const{data:h}=et(r);if(h.length===0){let b;e[15]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("p",{className:"text-sm text-muted-foreground",children:"No repositories found"}),e[15]=b):b=e[15];let N;e[16]!==c?(N=c&&t.jsx("p",{className:"text-xs text-muted-foreground/60",children:"Try a different search term"}),e[16]=c,e[17]=N):N=e[17];let y;return e[18]!==N?(y=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-1",children:[b,N]}),e[18]=N,e[19]=y):y=e[19],y}let x;if(e[20]!==l||e[21]!==u||e[22]!==h){let b;e[24]!==l||e[25]!==u?(b=N=>t.jsxs("button",{type:"button",onClick:()=>u(N),disabled:l,className:"flex items-start gap-3 px-4 py-3 hover:bg-accent transition-colors text-left disabled:opacity-50 disabled:cursor-not-allowed",children:[t.jsx(re,{className:"size-4 text-muted-foreground mt-0.5 shrink-0"}),t.jsx("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:t.jsx("span",{className:"text-sm font-medium truncate",children:N.name})}),t.jsxs("span",{className:"flex items-center gap-1 text-xs font-medium text-muted-foreground border border-border rounded px-1.5 py-0.5 shrink-0 leading-none",children:[N.private?t.jsx(ot,{size:10}):t.jsx(at,{size:10}),N.private?"Private":"Public"]})]},N.fullName),e[24]=l,e[25]=u,e[26]=b):b=e[26],x=h.map(b),e[20]=l,e[21]=u,e[22]=h,e[23]=x}else x=e[23];let T;return e[27]!==x?(T=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden flex flex-col [scrollbar-gutter:stable]",children:x}),e[27]=x,e[28]=T):T=e[28],T}function Tt(a){return{name:a.name,fullName:a.full_name,owner:a.full_name.split("/")[0]??"",url:a.html_url,private:a.private,description:a.description,updatedAt:a.updated_at}}function ve(a){const e=U.c(33),{status:s,error:o,retry:d}=a;if(s==="error"){let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("div",{className:"size-10 rounded-full bg-destructive/10 flex items-center justify-center",children:t.jsx(re,{className:"size-5 text-destructive"})}),e[0]=i):i=e[0];let I;e[1]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx("p",{className:"text-sm font-medium",children:"Connection failed"}),e[1]=I):I=e[1];const v=o??"Something went wrong while connecting to GitHub.";let j;e[2]!==v?(j=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[I,t.jsx("p",{className:"text-xs text-muted-foreground max-w-[260px] leading-relaxed",children:v})]}),e[2]=v,e[3]=j):j=e[3];let S;e[4]!==d?(S=t.jsx("button",{type:"button",onClick:d,className:"text-xs font-medium text-foreground border border-border rounded-md px-3 py-1.5 hover:bg-accent transition-colors",children:"Try again"}),e[4]=d,e[5]=S):S=e[5];let A;return e[6]!==j||e[7]!==S?(A=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[i,j,S]}),e[6]=j,e[7]=S,e[8]=A):A=e[8],A}const n=s==="authenticating";let c;e[9]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"size-10 rounded-full bg-muted flex items-center justify-center",children:t.jsx(re,{className:"size-5 text-foreground"})}),e[9]=c):c=e[9];let u;e[10]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsxs("div",{className:"relative size-10",children:[c,t.jsx("div",{className:"absolute -bottom-0.5 -right-0.5 size-4 rounded-full bg-background flex items-center justify-center",children:t.jsx(Ne,{size:12,className:"animate-spin text-muted-foreground"})})]}),e[10]=u):u=e[10];const l=n?"Authenticating with GitHub":"Setting up GitHub";let _;e[11]!==l?(_=t.jsx("p",{className:"text-sm font-medium",children:l}),e[11]=l,e[12]=_):_=e[12];const p=n?"Complete the OAuth flow in your browser":"Installing the GitHub connection...";let C;e[13]!==p?(C=t.jsx("p",{className:"text-xs text-muted-foreground",children:p}),e[13]=p,e[14]=C):C=e[14];let g;e[15]!==_||e[16]!==C?(g=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[_,C]}),e[15]=_,e[16]=C,e[17]=g):g=e[17];const m=n?"bg-muted-foreground/30":"bg-foreground animate-pulse";let f;e[18]!==m?(f=xe("size-1.5 rounded-full",m),e[18]=m,e[19]=f):f=e[19];let r;e[20]!==f?(r=t.jsx("span",{className:f}),e[20]=f,e[21]=r):r=e[21];const h=n?"bg-foreground animate-pulse":"bg-muted-foreground/30";let x;e[22]!==h?(x=xe("size-1.5 rounded-full",h),e[22]=h,e[23]=x):x=e[23];let T;e[24]!==x?(T=t.jsx("span",{className:x}),e[24]=x,e[25]=T):T=e[25];let b;e[26]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("span",{className:"size-1.5 rounded-full bg-muted-foreground/30"}),e[26]=b):b=e[26];let N;e[27]!==r||e[28]!==T?(N=t.jsxs("div",{className:"flex items-center gap-1.5",children:[r,T,b]}),e[27]=r,e[28]=T,e[29]=N):N=e[29];let y;return e[30]!==N||e[31]!==g?(y=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[u,g,N]}),e[30]=N,e[31]=g,e[32]=y):y=e[32],y}const yt=["Full HAR capture with cache, TTFB, and request analysis","Screenshot capture for visual inspection","Page discovery via sitemap, navigation, and link crawling","SEO audit — meta tags, structured data, robots.txt","Third-party script inventory and size analysis","Dead link detection across the entire site","Deco-specific diagnostics (?__d debug mode)"];function $e(a){const e=U.c(7),{onRecruit:s,isRecruiting:o,isLoading:d}=a;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("p",{className:"text-sm text-muted-foreground",children:"Add a blackbox diagnostics agent that tests your storefront from the outside — no internal access needed. Give it a URL and it produces a detailed performance and health report."}),e[0]=n):n=e[0];let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("p",{className:"text-sm font-medium text-foreground",children:"Capabilities"}),e[1]=c):c=e[1];let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsxs("div",{className:"space-y-2",children:[c,t.jsx("ul",{className:"space-y-1.5",children:yt.map(bt)})]}),e[2]=u):u=e[2];const l=o||d,_=o?"Setting up...":"Add Site Diagnostics";let p;return e[3]!==s||e[4]!==l||e[5]!==_?(p=t.jsxs("div",{className:"flex flex-col gap-6",children:[n,u,t.jsx(ae,{onClick:s,disabled:l,className:"w-full cursor-pointer",children:_})]}),e[3]=s,e[4]=l,e[5]=_,e[6]=p):p=e[6],p}function bt(a){return t.jsxs("li",{className:"text-sm text-muted-foreground flex items-start gap-2",children:[t.jsx("span",{className:"text-emerald-500 mt-0.5 shrink-0",children:"+"}),a]},a)}function Xt({open:a,onOpenChange:e,existingAgent:s}){const o=ke(),{org:d}=V(),n=_e(),c=Ee(),u=Pe(),l=$({connectionId:ce,orgId:d.id,orgSlug:d.slug}),_=Ye({client:l}),[p,C]=O.useState(!1),g=qe.find(y=>y.id==="site-diagnostics"),{data:m,isLoading:f}=Ke(g.appId,{enabled:a}),r=m?.title||m?.server?.title||m?.server?.name||g.title,h=m?.server?.icons?.[0]?.src??g.icon,x=m?.server?.description??null,T=t.jsx(Ue,{icon:h,name:r,size:"sm"}),b=async()=>{if(m){if(s){e(!1),n(s.id);return}C(!0);try{const y=await _.mutateAsync({name:"COLLECTION_CONNECTIONS_LIST",arguments:{where:{field:["app_id"],operator:"eq",value:g.appId},limit:1,offset:0}});let i;const v=y?.structuredContent?.items?.find(S=>S.app_id===g.appId);if(v)i=v.id;else{const S=m.server?.remotes?.[0]?.url;if(!S)throw new Error("Registry item is missing a remote URL for site-diagnostics");i=(await c.create.mutateAsync({title:r,description:x,icon:m.server?.icons?.[0]?.src??g.icon,connection_type:"HTTP",connection_url:S,app_name:m.server?.name??"site-diagnostics",app_id:g.appId,metadata:{type:"site-diagnostics",source:"store",registry_item_id:g.appId,verified:!0}})).id}const j=await u.create.mutateAsync({title:r,description:x,icon:h,status:"active",connections:[{connection_id:i,selected_tools:null,selected_resources:null,selected_prompts:null}],metadata:{type:"site-diagnostics",instructions:null,ui:{pinnedViews:[{connectionId:i,toolName:"diagnose",label:"diagnose",icon:null}],layout:{defaultMainView:{type:"ext-apps",id:i,toolName:"diagnose"}}}}});D("agent_recruit_confirmed",{template_id:"site-diagnostics",agent_id:j.id}),e(!1),n(j.id)}catch(y){D("agent_recruit_failed",{template_id:"site-diagnostics",error:y instanceof Error?y.message:String(y)}),console.error("Failed to create Site Diagnostics agent:",y)}finally{C(!1)}}},N=`Add ${r}`;return o?t.jsx(Oe,{open:a,onOpenChange:e,children:t.jsxs(Le,{className:"h-[70dvh]",children:[t.jsx(Re,{className:"px-4 pt-4 pb-4 shrink-0",children:t.jsxs("div",{className:"flex items-center gap-3",children:[T,t.jsx(Me,{className:"text-xl font-semibold",children:N})]})}),t.jsx("div",{className:"flex flex-col flex-1 min-h-0 px-4 pb-8",children:t.jsx($e,{onRecruit:b,isRecruiting:p,isLoading:f})})]})}):t.jsx(de,{open:a,onOpenChange:e,children:t.jsxs(le,{className:"sm:max-w-[500px] p-8",children:[t.jsx(ue,{className:"mb-4",children:t.jsxs("div",{className:"flex items-center gap-3",children:[T,t.jsx(me,{className:"text-xl font-semibold",children:N})]})}),t.jsx($e,{onRecruit:b,isRecruiting:p,isLoading:f})]})})}const vt=`<role>
|
|
1
|
+
import{e as U,j as t,s as V,o as we,b as Fe,r as O,K as ne,n as He,a as Be,c as xe,B as ae,t as D,x as oe,G as Je,F as Xe,v as je,P as Ze,l as Ne,w as et,f as tt}from"./index-BGvMfUr2.js";import{S as ce,u as $,d as Se,W as qe,j as be}from"./constants-BVU634u9.js";import{a as _e}from"./use-navigate-to-agent-XL440g7Q.js";import{a as le,b as de,c as ue,d as me,D as nt}from"./dialog-Cc5-s5cq.js";import{i as Ae}from"./RefreshCcw01-DKf5Q7r6.js";import{C as Qe}from"./collection-search-dr2VH0_A.js";import{C as st}from"./checkbox-DBBm6J90.js";import{b as Ee,u as it}from"./use-connection-EBpfvjCE.js";import{i as ot}from"./Lock01-Ds-YEZnN.js";import{n as at}from"./agent-icon-B5EEcofO.js";import{e as rt}from"./extract-connection-data-CGFCZBB1.js";import{b as Oe,a as Le,c as Re,D as Me}from"./drawer-CYKJkhyy.js";import{u as ke}from"./tooltip-8sj0FPxK.js";import{I as Ue}from"./integration-icon-Btl0P6Zi.js";import{u as ct,d as Ye}from"./use-mcp-tools-yGAchpt7.js";import{a as Pe,b as lt}from"./use-virtual-mcp-BOr32Cw9.js";function re(a){const e=U.c(4),{size:s,className:o}=a;let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0016 8c0-4.42-3.58-8-8-8z"}),e[0]=d):d=e[0];let n;return e[1]!==o||e[2]!==s?(n=t.jsx("svg",{width:s,height:s,viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",className:o,children:d}),e[1]=o,e[2]=s,e[3]=n):n=e[3],n}function dt(a){return a.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}async function ut(a){const e=await fetch(`/api/${a}/deco-sites`);if(!e.ok){const s=await e.json().catch(()=>({}));throw new Error(s.error??`Failed to load sites (${e.status})`)}return e.json()}function Wt(a){const e=U.c(70),{open:s,onOpenChange:o,onBack:d}=a,{org:n}=V(),c=_e(),u=we(),{data:l}=Fe.useSession(),[_,p]=O.useState(null),[C,g]=O.useState("");let m;e[0]!==n.id||e[1]!==n.slug?(m={connectionId:ce,orgId:n.id,orgSlug:n.slug},e[0]=n.id,e[1]=n.slug,e[2]=m):m=e[2];const f=$(m);let r;e[3]!==l?.user?.email?(r=ne.decoSites(l?.user?.email),e[3]=l?.user?.email,e[4]=r):r=e[4];let h;e[5]!==n.slug?(h=()=>ut(n.slug),e[5]=n.slug,e[6]=h):h=e[6];const x=s&&!!l?.user?.email;let T;e[7]!==r||e[8]!==h||e[9]!==x?(T={queryKey:r,queryFn:h,enabled:x,staleTime:6e4,retry:!1},e[7]=r,e[8]=h,e[9]=x,e[10]=T):T=e[10];const{data:b,isLoading:N,error:y}=He(T),i=b?.sites??[];let I;e[11]!==o?(I=w=>{w||(p(null),g("")),o(w)},e[11]=o,e[12]=I):I=e[12];const v=I;let j;e[13]!==C?(j=w=>w.name.toLowerCase().includes(C.toLowerCase())||w.domains?.[0]?.domain.toLowerCase().includes(C.toLowerCase()),e[13]=C,e[14]=j):j=e[14];const S=i.filter(j),A=!_||S.some(w=>w.name===_);let E;e[15]!==f||e[16]!==n.id||e[17]!==n.slug?(E=async w=>{D("deco_site_import_started",{site_name:w});const P=await fetch(`/api/${n.slug}/deco-sites/connection`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteName:w,orgId:n.id})}),G=await P.json().catch(gt);if(!P.ok)throw new Error(G.error??`Failed to create connection (${P.status})`);const M=G.connId;if(!M)throw new Error("Server did not return a connection ID");const he=G.icon??null,te=dt(w),Ge=await f.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:w,description:"Imported from deco.cx",pinned:!0,icon:he??null,subtype:"project",metadata:{instructions:null,enabled_plugins:[],ui:{banner:null,bannerColor:"#22C55E",icon:he,themeColor:"#22C55E",slug:te,pinnedViews:[{connectionId:M,toolName:"file_explorer",label:"Preview",icon:null},{connectionId:M,toolName:"fetch_assets",label:"Assets",icon:null},{connectionId:M,toolName:"get_monitor_data",label:"Monitor",icon:null},{connectionId:M,toolName:"list_pull_requests",label:"Pull Requests",icon:null},{connectionId:M,toolName:"list_releases",label:"Releases",icon:null}],layout:{defaultMainView:{type:"ext-apps",id:M,toolName:"file_explorer"}}}},connections:[{connection_id:M}]}}}),De=Ge.structuredContent??Ge;return{slug:te,virtualMcpId:De.item.id,connId:M,item:De.item}},e[15]=f,e[16]=n.id,e[17]=n.slug,e[18]=E):E=e[18];let R;e[19]!==f||e[20]!==v||e[21]!==c||e[22]!==n.id||e[23]!==u?(R=w=>{const{slug:P,virtualMcpId:G,item:M}=w;D("deco_site_import_succeeded",{site_name:M.title,virtual_mcp_id:G,slug:P}),u.setQueryData(ne.collectionItem(f,n.id,"","VIRTUAL_MCP",G),{item:M}),u.invalidateQueries({predicate:he=>{const te=he.queryKey;return te[1]===n.id&&te[3]==="collection"&&te[4]==="VIRTUAL_MCP"}}),u.invalidateQueries({queryKey:ne.projects(n.id)}),oe.success(`Imported ${P} from deco.cx`),v(!1),localStorage.setItem("mesh:sidebar-open",JSON.stringify(!1)),c(G)},e[19]=f,e[20]=v,e[21]=c,e[22]=n.id,e[23]=u,e[24]=R):R=e[24];let z;e[25]!==E||e[26]!==R?(z={mutationFn:E,onSuccess:R,onError:ft},e[25]=E,e[26]=R,e[27]=z):z=e[27];const k=Be(z),se=de,L=le,ie="sm:max-w-[900px] p-0 gap-0 overflow-hidden";let F;e[28]===Symbol.for("react.memo_cache_sentinel")?(F=t.jsx(ue,{className:"sr-only",children:t.jsx(me,{children:"Import from deco.cx"})}),e[28]=F):F=e[28];let H;e[29]!==d?(H=d&&t.jsx("button",{type:"button",onClick:d,className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors","aria-label":"Go back",children:t.jsx(Ae,{size:18})}),e[29]=d,e[30]=H):H=e[30];let fe;e[31]===Symbol.for("react.memo_cache_sentinel")?(fe=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Import from deco.cx"}),e[31]=fe):fe=e[31];let B;e[32]!==H?(B=t.jsxs("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3",children:[H,fe]}),e[32]=H,e[33]=B):B=e[33];let ge;e[34]===Symbol.for("react.memo_cache_sentinel")?(ge=w=>{w.key==="Escape"&&g("")},e[34]=ge):ge=e[34];let q;e[35]!==C?(q=t.jsx("div",{children:t.jsx(Qe,{value:C,onChange:g,placeholder:"Search sites...",onKeyDown:ge})}),e[35]=C,e[36]=q):q=e[36];const We="pb-0 min-h-[300px]";let Q;e[37]!==N?(Q=N&&t.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:"Loading sites..."}),e[37]=N,e[38]=Q):Q=e[38];const Ce=!N&&!y&&i.length===0&&t.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:"No sites found for this account."}),Ie=!N&&i.length>0&&t.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4 max-h-[420px] overflow-y-auto py-4 px-8 [scrollbar-gutter:stable]",children:[S.length===0&&t.jsxs("p",{className:"col-span-3 text-sm text-muted-foreground text-center py-8",children:["No sites match “",C,"”"]}),S.map(w=>{const P=w.domains?.find(mt)?.domain??w.domains?.[0]?.domain,G=_===w.name;return t.jsxs("button",{type:"button",onClick:()=>p(w.name),className:xe("flex flex-col rounded-xl border overflow-hidden text-left transition-all cursor-pointer",G?"border-primary ring-1 ring-primary":"border-border hover:border-muted-foreground/40"),children:[t.jsx("div",{className:"w-full aspect-video bg-muted overflow-hidden",children:w.thumb_url?t.jsx("img",{src:w.thumb_url,alt:w.name,className:"w-full h-full object-cover",loading:"lazy"}):t.jsx("div",{className:"w-full h-full bg-muted"})}),t.jsxs("div",{className:"px-4 py-3",children:[t.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:w.name}),P&&t.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:P})]})]},w.name)})]});let Y;e[39]!==Q||e[40]!==Ce||e[41]!==Ie?(Y=t.jsxs("div",{className:We,children:[Q,Ce,Ie]}),e[39]=Q,e[40]=Ce,e[41]=Ie,e[42]=Y):Y=e[42];let K;e[43]!==v?(K=()=>v(!1),e[43]=v,e[44]=K):K=e[44];let W;e[45]!==k.isPending||e[46]!==K?(W=t.jsx(ae,{variant:"outline",onClick:K,disabled:k.isPending,children:"Cancel"}),e[45]=k.isPending,e[46]=K,e[47]=W):W=e[47];const Te=!_||!A||k.isPending||N;let J;e[48]!==k||e[49]!==_?(J=()=>_&&k.mutate(_),e[48]=k,e[49]=_,e[50]=J):J=e[50];const ye=k.isPending?"Importing...":"Import";let X;e[51]!==Te||e[52]!==J||e[53]!==ye?(X=t.jsx(ae,{disabled:Te,onClick:J,children:ye}),e[51]=Te,e[52]=J,e[53]=ye,e[54]=X):X=e[54];let Z;e[55]!==W||e[56]!==X?(Z=t.jsxs(nt,{className:"px-8 py-5 border-t border-border",children:[W,X]}),e[55]=W,e[56]=X,e[57]=Z):Z=e[57];let ee;e[58]!==L||e[59]!==F||e[60]!==B||e[61]!==q||e[62]!==Y||e[63]!==Z?(ee=t.jsxs(L,{className:ie,children:[F,B,q,Y,Z]}),e[58]=L,e[59]=F,e[60]=B,e[61]=q,e[62]=Y,e[63]=Z,e[64]=ee):ee=e[64];let pe;return e[65]!==se||e[66]!==v||e[67]!==s||e[68]!==ee?(pe=t.jsx(se,{open:s,onOpenChange:v,children:ee}),e[65]=se,e[66]=v,e[67]=s,e[68]=ee,e[69]=pe):pe=e[69],pe}function mt(a){return a.production}function ft(a){D("deco_site_import_failed",{error:a instanceof Error?a.message:"Unknown error"}),oe.error("Import failed: "+(a instanceof Error?a.message:"Unknown error"))}function gt(){return{}}function Ke(a,e){const s=U.c(12),{org:o}=V();let d;s[0]!==o.id?(d=Se.REGISTRY(o.id),s[0]=o.id,s[1]=d):d=s[1];const n=d;let c;s[2]!==o.id||s[3]!==o.slug||s[4]!==n?(c={connectionId:n,orgId:o.id,orgSlug:o.slug},s[2]=o.id,s[3]=o.slug,s[4]=n,s[5]=c):c=s[5];const u=$(c);let l;s[6]!==a?(l={name:a},s[6]=a,s[7]=l):l=s[7];const _=e?.enabled??!0;let p;return s[8]!==u||s[9]!==l||s[10]!==_?(p={client:u,toolName:"COLLECTION_REGISTRY_APP_GET",toolArguments:l,enabled:_,staleTime:3e5,select:pt},s[8]=u,s[9]=l,s[10]=_,s[11]=p):p=s[11],ct(p)}function pt(a){return a.structuredContent?.item??null}const ht="deco/mcp-github";function xt(a){const{org:e}=V(),{data:s}=Fe.useSession(),o=Ee(),d=we(),[n,c]=O.useState("idle"),[u,l]=O.useState(null),[_,p]=O.useState(null),{data:C,isLoading:g}=Ke(ht,{enabled:a.enabled}),m=O.useRef(!1);a.enabled&&C&&!g&&!m.current&&s?.user?.id&&n==="idle"&&(m.current=!0,f());async function f(){if(!(!C||!s?.user?.id||!e))try{c("installing"),l(null);const h=rt(C,e.id,s.user.id,{remoteIndex:0});if(!h.connection_url)throw new Error("Registry item is missing a remote URL for mcp-github");const{id:T}=await o.create.mutateAsync(h);c("authenticating");const b=new URL(`/api/${e.slug}/mcp/${T}`,window.location.origin),N=await Je({url:b.href,token:null,orgId:e.id});if(N.supportsOAuth&&!N.isAuthenticated){const{token:y,tokenInfo:i,error:I}=await Xe({connectionId:T,orgSlug:e.slug,scope:"offline_access"});if(I||!y){try{await o.delete.mutateAsync(T)}catch{}throw new Error(I??"No token received from GitHub")}if(i)try{(await fetch(`/api/${e.slug}/connections/${T}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:i.accessToken,refreshToken:i.refreshToken,expiresIn:i.expiresIn,scope:i.scope,clientId:i.clientId,clientSecret:i.clientSecret,tokenEndpoint:i.tokenEndpoint})})).ok||await o.update.mutateAsync({id:T,data:{connection_token:y}})}catch{await o.update.mutateAsync({id:T,data:{connection_token:y}})}}je(d,e.id),p(h),c("ready")}catch(h){l(h instanceof Error?h.message:String(h)),c("error")}}function r(){c("idle"),l(null),p(null),m.current=!1}return a.enabled&&g&&n==="idle"?{status:"installing",error:null,connection:null,retry:r}:{status:n,error:u,connection:_,retry:r}}function Jt(a){const e=U.c(21),{open:s,onOpenChange:o,title:d,hideAutoRespondCheckbox:n,onImportComplete:c}=a,u=d===void 0?"Import from GitHub":d,l=n===void 0?!1:n,[_]=Ze(),[p,C]=O.useState(null);if(!_.experimental_vibecode)return null;let g;e[0]!==u?(g=t.jsx(ue,{className:"sr-only",children:t.jsx(me,{children:u})}),e[0]=u,e[1]=g):g=e[1];let m;e[2]!==p||e[3]!==u?(m=t.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3 shrink-0",children:p?t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>C(null),className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors shrink-0","aria-label":"Back to accounts",children:t.jsx(Ae,{size:16})}),t.jsx("img",{src:p.avatarUrl,alt:p.login,className:"size-5 rounded-full ring-1 ring-border shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:p.login})]}):t.jsxs(t.Fragment,{children:[t.jsx(re,{className:"size-4 text-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:u})]})}),e[2]=p,e[3]=u,e[4]=m):m=e[4];let f;e[5]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Ne,{size:18,className:"animate-spin text-muted-foreground"})}),e[5]=f):f=e[5];let r;e[6]!==o?(r=()=>o(!1),e[6]=o,e[7]=r):r=e[7];let h;e[8]!==l||e[9]!==c||e[10]!==p||e[11]!==r?(h=t.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-w-0",children:t.jsx(O.Suspense,{fallback:f,children:t.jsx(Nt,{onComplete:r,selectedInstallation:p,onSelectInstallation:C,hideAutoRespondCheckbox:l,onImportComplete:c})})}),e[8]=l,e[9]=c,e[10]=p,e[11]=r,e[12]=h):h=e[12];let x;e[13]!==g||e[14]!==m||e[15]!==h?(x=t.jsxs(le,{className:"sm:max-w-[560px] h-[85svh] sm:h-[520px] p-0 gap-0 overflow-hidden flex flex-col",children:[g,m,h]}),e[13]=g,e[14]=m,e[15]=h,e[16]=x):x=e[16];let T;return e[17]!==o||e[18]!==s||e[19]!==x?(T=t.jsx(de,{open:s,onOpenChange:o,children:x}),e[17]=o,e[18]=s,e[19]=x,e[20]=T):T=e[20],T}function Nt({onComplete:a,selectedInstallation:e,onSelectInstallation:s,hideAutoRespondCheckbox:o,onImportComplete:d}){const{org:n}=V(),c=we(),u=_e(),[l,_]=O.useState(null),[p,C]=O.useState(!0),g=o?!0:p,m=it({slug:"mcp-github"}),f=xt({enabled:m.length===0}),r=m.length===1?m[0]??null:l,h=$({connectionId:r?.id??"",orgId:n.id,orgSlug:n.slug}),x=$({connectionId:ce,orgId:n.id,orgSlug:n.slug}),T=async(i,I)=>{try{const j=await h.callTool({name:"get_file_contents",arguments:{owner:i.owner,repo:i.name,path:I}});if(j.isError)return null;const A=j.content?.find(E=>E.type==="resource")?.resource?.text;if(!A)return null;try{const E=JSON.parse(A);return typeof E=="string"?E:JSON.stringify(E)}catch{return A}}catch{return null}},b=(i,I)=>{Promise.all([T(I,"AGENTS.md"),T(I,"CLAUDE.md")]).then(async([v,j])=>{const S=v??j??null;S&&(await x.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:i,data:{metadata:{instructions:S}}}}),je(c,n.id))}).catch(v=>{console.error("GitHub instructions fetch failed:",v)})},N=async({virtualMcpId:i,repo:I,connectionId:v})=>{const j=await h.callTool({name:"TRIGGER_LIST",arguments:{}}),S=j.structuredContent??j,A=S.triggers?.find(L=>L.type==="github.issues.opened")??S.triggers?.find(L=>{const ie=L.type.toLowerCase();return/\bissues?\./.test(ie)&&(ie.endsWith(".opened")||ie.endsWith(".created"))});if(!A)throw new Error("No issue-created trigger exposed by GitHub connection");const E=new Set;if(Array.isArray(A.params))for(const L of A.params)E.add(L.name);else if(A.params&&typeof A.params=="object")for(const L of Object.keys(A.params))E.add(L);if(A.paramsSchema)for(const L of Object.keys(A.paramsSchema))E.add(L);const R={};E.has("repo")?R.repo=`${I.owner}/${I.name}`:(E.has("owner")&&(R.owner=I.owner),E.has("name")&&(R.name=I.name),E.has("repository")&&(R.repository=`${I.owner}/${I.name}`));const z=`A new GitHub issue has been opened in ${I.owner}/${I.name}. Read the issue details, explore the relevant code in the repository, create a new branch, implement the fix or feature requested, and open a pull request that resolves the issue. Reference the issue number in the PR description.`,k=await x.callTool({name:"AUTOMATION_CREATE",arguments:{name:`${I.name}: auto-respond to issues`,virtual_mcp_id:i,agent:{id:i},messages:z,active:!0}}),se=k.structuredContent??k;await x.callTool({name:"AUTOMATION_TRIGGER_ADD",arguments:{automation_id:se.id,type:"event",connection_id:v,event_type:A.type,params:R}})},y=Be({mutationFn:async i=>{if(!r||!e)throw new Error("No GitHub connection or installation");const I=r.id,v=await x.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:i.name,description:i.description||"Imported from GitHub",pinned:!0,icon:null,metadata:{githubRepo:{owner:i.owner,name:i.name,url:i.url,installationId:e.installationId,connectionId:I},instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"preview"}}}},connections:[{connection_id:I}]}}}),j=v.structuredContent??v,S=j.item.id;return g&&await N({virtualMcpId:S,repo:i,connectionId:I}).catch(A=>{console.error("Failed to set up issue automation:",A),oe.warning("Imported repo, but failed to set up issue auto-response. You can add the trigger manually from the automations view.")}),{virtualMcpId:S,repo:i,connectionId:I,item:j.item}},onSuccess:({virtualMcpId:i,repo:I,connectionId:v,item:j})=>{if(c.setQueryData(ne.collectionItem(x,n.id,"","VIRTUAL_MCP",i),{item:j}),je(c,n.id),b(i,I),d){d({virtualMcpId:i,repo:I,connectionId:v});return}oe.success(`Imported ${I.name} from GitHub`),a(),localStorage.setItem("mesh:sidebar-open",JSON.stringify(!1)),u(i)},onError:i=>{oe.error("Failed to import repo: "+(i instanceof Error?i.message:"Unknown error"))}});return f.status==="installing"||f.status==="authenticating"?t.jsx(ve,{status:f.status,error:null,retry:f.retry}):f.status==="error"?t.jsx(ve,{status:"error",error:f.error,retry:f.retry}):m.length===0&&f.status==="idle"?t.jsx(ve,{status:"installing",error:null,retry:f.retry}):m.length>1&&!r?t.jsxs("div",{className:"flex flex-col py-2",children:[t.jsx("div",{className:"px-4 py-2",children:t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Select a connection"})}),m.map(i=>t.jsxs("button",{type:"button",onClick:()=>_(i),className:"flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left",children:[i.icon?t.jsx("img",{src:i.icon,alt:i.title,className:"size-7 rounded-full shrink-0"}):t.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:t.jsx(re,{className:"size-3.5 text-muted-foreground"})}),t.jsx("span",{className:"text-sm font-medium",children:i.title})]},i.id))]}):r?e?t.jsx(Ct,{connectionId:r.id,orgId:n.id,orgSlug:n.slug,installation:e,onSelectRepo:i=>y.mutate(i),isSaving:y.isPending,autoRespondToIssues:p,onAutoRespondChange:C,hideAutoRespondCheckbox:o}):t.jsx(_t,{connectionId:r.id,orgId:n.id,orgSlug:n.slug,onSelect:s,showBackButton:m.length>1,onBack:()=>_(null)}):null}function _t(a){const e=U.c(31),{connectionId:s,orgId:o,orgSlug:d,onSelect:n,showBackButton:c,onBack:u}=a;let l;e[0]!==o||e[1]!==d?(l={connectionId:ce,orgId:o,orgSlug:d},e[0]=o,e[1]=d,e[2]=l):l=e[2];const _=$(l);let p;e[3]!==s||e[4]!==o?(p=ne.githubUserOrgs(o,s),e[3]=s,e[4]=o,e[5]=p):p=e[5];let C;e[6]!==s||e[7]!==_?(C=async()=>{const I=(await _.callTool({name:"GITHUB_LIST_USER_ORGS",arguments:{connectionId:s}})).content?.[0]?.text;if(!I)throw new Error("No response from GITHUB_LIST_USER_ORGS");return JSON.parse(I)},e[6]=s,e[7]=_,e[8]=C):C=e[8];let g;e[9]!==p||e[10]!==C?(g={queryKey:p,queryFn:C},e[9]=p,e[10]=C,e[11]=g):g=e[11];const m=He(g);if(m.isLoading){let i;return e[12]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Ne,{size:18,className:"animate-spin text-muted-foreground"})}),e[12]=i):i=e[12],i}if(m.isError){let i;return e[13]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-destructive",children:"Failed to load GitHub accounts"})}),e[13]=i):i=e[13],i}const f=m.data;if(!f)return null;let r;e[14]!==u||e[15]!==c?(r=c&&t.jsx("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1 shrink-0",children:t.jsxs("button",{type:"button",onClick:u,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(Ae,{size:12}),"Change connection"]})}),e[14]=u,e[15]=c,e[16]=r):r=e[16];let h;if(e[17]!==f.installations||e[18]!==n){let i;e[20]!==n?(i=I=>t.jsxs("button",{type:"button",onClick:()=>n(I),className:"w-full flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left group",children:[t.jsx("img",{src:I.avatarUrl,alt:I.login,className:"size-7 rounded-full shrink-0 ring-1 ring-border"}),t.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[t.jsx("span",{className:"text-sm font-medium leading-none",children:I.login}),I.type==="User"&&t.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"Personal account"})]}),t.jsx("span",{className:"text-xs text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:"Select →"})]},I.installationId),e[20]=n,e[21]=i):i=e[21],h=f.installations.map(i),e[17]=f.installations,e[18]=n,e[19]=h}else h=e[19];let x;e[22]!==h?(x=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden [scrollbar-gutter:stable]",children:h}),e[22]=h,e[23]=x):x=e[23];const T=f.appSlug?`https://github.com/apps/${f.appSlug}/installations/new`:"https://github.com/settings/installations";let b;e[24]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("span",{className:"underline underline-offset-2",children:"Install the GitHub App"}),e[24]=b):b=e[24];let N;e[25]!==T?(N=t.jsx("div",{className:"px-4 py-3 border-t border-border shrink-0",children:t.jsxs("a",{href:T,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:["Account not listed?"," ",b]})}),e[25]=T,e[26]=N):N=e[26];let y;return e[27]!==N||e[28]!==r||e[29]!==x?(y=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[r,x,N]}),e[27]=N,e[28]=r,e[29]=x,e[30]=y):y=e[30],y}function Ct(a){const e=U.c(25),{connectionId:s,orgId:o,orgSlug:d,installation:n,onSelectRepo:c,isSaving:u,autoRespondToIssues:l,onAutoRespondChange:_,hideAutoRespondCheckbox:p}=a,[C,g]=O.useState(""),m=O.useDeferredValue(C),f=C!==m;let r;e[0]!==f||e[1]!==C?(r=t.jsx(Qe,{placeholder:"Search repositories...",value:C,onChange:g,isSearching:f}),e[0]=f,e[1]=C,e[2]=r):r=e[2];const h=f?"opacity-40":"opacity-100";let x;e[3]!==h?(x=xe("flex-1 overflow-hidden flex flex-col transition-opacity duration-150",h),e[3]=h,e[4]=x):x=e[4];let T;e[5]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Ne,{size:18,className:"animate-spin text-muted-foreground"})}),e[5]=T):T=e[5];let b;e[6]!==s||e[7]!==m||e[8]!==n||e[9]!==u||e[10]!==c||e[11]!==o||e[12]!==d?(b=t.jsx(O.Suspense,{fallback:T,children:t.jsx(It,{connectionId:s,orgId:o,orgSlug:d,installation:n,query:m,onSelectRepo:c,isSaving:u})}),e[6]=s,e[7]=m,e[8]=n,e[9]=u,e[10]=c,e[11]=o,e[12]=d,e[13]=b):b=e[13];let N;e[14]!==x||e[15]!==b?(N=t.jsx("div",{className:x,children:b}),e[14]=x,e[15]=b,e[16]=N):N=e[16];let y;e[17]!==l||e[18]!==p||e[19]!==_?(y=!p&&t.jsxs("label",{className:"flex items-center gap-2 px-4 py-3 border-t border-border shrink-0 cursor-pointer select-none",children:[t.jsx(st,{checked:l,onCheckedChange:I=>_(I===!0)}),t.jsx("span",{className:"text-xs text-foreground",children:"Auto-respond to new issues with a PR"})]}),e[17]=l,e[18]=p,e[19]=_,e[20]=y):y=e[20];let i;return e[21]!==r||e[22]!==N||e[23]!==y?(i=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[r,N,y]}),e[21]=r,e[22]=N,e[23]=y,e[24]=i):i=e[24],i}function It(a){const e=U.c(29),{connectionId:s,orgId:o,orgSlug:d,installation:n,query:c,onSelectRepo:u,isSaving:l}=a;let _;e[0]!==s||e[1]!==o||e[2]!==d?(_={connectionId:s,orgId:o,orgSlug:d},e[0]=s,e[1]=o,e[2]=d,e[3]=_):_=e[3];const p=$(_),C=n.type==="User"?"user":"org",g=c?`${C}:${n.login} ${c} in:name`:`${C}:${n.login}`;let m;e[4]!==s||e[5]!==n.login||e[6]!==o||e[7]!==c?(m=ne.githubOrgRepos(o,s,n.login,c),e[4]=s,e[5]=n.login,e[6]=o,e[7]=c,e[8]=m):m=e[8];let f;e[9]!==p||e[10]!==g?(f=async()=>{const N=(await p.callTool({name:"search_repositories",arguments:{query:g,page:1,perPage:30}})).content?.[0]?.text;if(!N)throw new Error("No response from search_repositories");return(JSON.parse(N).items??[]).map(Tt)},e[9]=p,e[10]=g,e[11]=f):f=e[11];let r;e[12]!==m||e[13]!==f?(r={queryKey:m,queryFn:f},e[12]=m,e[13]=f,e[14]=r):r=e[14];const{data:h}=et(r);if(h.length===0){let b;e[15]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("p",{className:"text-sm text-muted-foreground",children:"No repositories found"}),e[15]=b):b=e[15];let N;e[16]!==c?(N=c&&t.jsx("p",{className:"text-xs text-muted-foreground/60",children:"Try a different search term"}),e[16]=c,e[17]=N):N=e[17];let y;return e[18]!==N?(y=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-1",children:[b,N]}),e[18]=N,e[19]=y):y=e[19],y}let x;if(e[20]!==l||e[21]!==u||e[22]!==h){let b;e[24]!==l||e[25]!==u?(b=N=>t.jsxs("button",{type:"button",onClick:()=>u(N),disabled:l,className:"flex items-start gap-3 px-4 py-3 hover:bg-accent transition-colors text-left disabled:opacity-50 disabled:cursor-not-allowed",children:[t.jsx(re,{className:"size-4 text-muted-foreground mt-0.5 shrink-0"}),t.jsx("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:t.jsx("span",{className:"text-sm font-medium truncate",children:N.name})}),t.jsxs("span",{className:"flex items-center gap-1 text-xs font-medium text-muted-foreground border border-border rounded px-1.5 py-0.5 shrink-0 leading-none",children:[N.private?t.jsx(ot,{size:10}):t.jsx(at,{size:10}),N.private?"Private":"Public"]})]},N.fullName),e[24]=l,e[25]=u,e[26]=b):b=e[26],x=h.map(b),e[20]=l,e[21]=u,e[22]=h,e[23]=x}else x=e[23];let T;return e[27]!==x?(T=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden flex flex-col [scrollbar-gutter:stable]",children:x}),e[27]=x,e[28]=T):T=e[28],T}function Tt(a){return{name:a.name,fullName:a.full_name,owner:a.full_name.split("/")[0]??"",url:a.html_url,private:a.private,description:a.description,updatedAt:a.updated_at}}function ve(a){const e=U.c(33),{status:s,error:o,retry:d}=a;if(s==="error"){let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("div",{className:"size-10 rounded-full bg-destructive/10 flex items-center justify-center",children:t.jsx(re,{className:"size-5 text-destructive"})}),e[0]=i):i=e[0];let I;e[1]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx("p",{className:"text-sm font-medium",children:"Connection failed"}),e[1]=I):I=e[1];const v=o??"Something went wrong while connecting to GitHub.";let j;e[2]!==v?(j=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[I,t.jsx("p",{className:"text-xs text-muted-foreground max-w-[260px] leading-relaxed",children:v})]}),e[2]=v,e[3]=j):j=e[3];let S;e[4]!==d?(S=t.jsx("button",{type:"button",onClick:d,className:"text-xs font-medium text-foreground border border-border rounded-md px-3 py-1.5 hover:bg-accent transition-colors",children:"Try again"}),e[4]=d,e[5]=S):S=e[5];let A;return e[6]!==j||e[7]!==S?(A=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[i,j,S]}),e[6]=j,e[7]=S,e[8]=A):A=e[8],A}const n=s==="authenticating";let c;e[9]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"size-10 rounded-full bg-muted flex items-center justify-center",children:t.jsx(re,{className:"size-5 text-foreground"})}),e[9]=c):c=e[9];let u;e[10]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsxs("div",{className:"relative size-10",children:[c,t.jsx("div",{className:"absolute -bottom-0.5 -right-0.5 size-4 rounded-full bg-background flex items-center justify-center",children:t.jsx(Ne,{size:12,className:"animate-spin text-muted-foreground"})})]}),e[10]=u):u=e[10];const l=n?"Authenticating with GitHub":"Setting up GitHub";let _;e[11]!==l?(_=t.jsx("p",{className:"text-sm font-medium",children:l}),e[11]=l,e[12]=_):_=e[12];const p=n?"Complete the OAuth flow in your browser":"Installing the GitHub connection...";let C;e[13]!==p?(C=t.jsx("p",{className:"text-xs text-muted-foreground",children:p}),e[13]=p,e[14]=C):C=e[14];let g;e[15]!==_||e[16]!==C?(g=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[_,C]}),e[15]=_,e[16]=C,e[17]=g):g=e[17];const m=n?"bg-muted-foreground/30":"bg-foreground animate-pulse";let f;e[18]!==m?(f=xe("size-1.5 rounded-full",m),e[18]=m,e[19]=f):f=e[19];let r;e[20]!==f?(r=t.jsx("span",{className:f}),e[20]=f,e[21]=r):r=e[21];const h=n?"bg-foreground animate-pulse":"bg-muted-foreground/30";let x;e[22]!==h?(x=xe("size-1.5 rounded-full",h),e[22]=h,e[23]=x):x=e[23];let T;e[24]!==x?(T=t.jsx("span",{className:x}),e[24]=x,e[25]=T):T=e[25];let b;e[26]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("span",{className:"size-1.5 rounded-full bg-muted-foreground/30"}),e[26]=b):b=e[26];let N;e[27]!==r||e[28]!==T?(N=t.jsxs("div",{className:"flex items-center gap-1.5",children:[r,T,b]}),e[27]=r,e[28]=T,e[29]=N):N=e[29];let y;return e[30]!==N||e[31]!==g?(y=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[u,g,N]}),e[30]=N,e[31]=g,e[32]=y):y=e[32],y}const yt=["Full HAR capture with cache, TTFB, and request analysis","Screenshot capture for visual inspection","Page discovery via sitemap, navigation, and link crawling","SEO audit — meta tags, structured data, robots.txt","Third-party script inventory and size analysis","Dead link detection across the entire site","Deco-specific diagnostics (?__d debug mode)"];function $e(a){const e=U.c(7),{onRecruit:s,isRecruiting:o,isLoading:d}=a;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("p",{className:"text-sm text-muted-foreground",children:"Add a blackbox diagnostics agent that tests your storefront from the outside — no internal access needed. Give it a URL and it produces a detailed performance and health report."}),e[0]=n):n=e[0];let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("p",{className:"text-sm font-medium text-foreground",children:"Capabilities"}),e[1]=c):c=e[1];let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsxs("div",{className:"space-y-2",children:[c,t.jsx("ul",{className:"space-y-1.5",children:yt.map(bt)})]}),e[2]=u):u=e[2];const l=o||d,_=o?"Setting up...":"Add Site Diagnostics";let p;return e[3]!==s||e[4]!==l||e[5]!==_?(p=t.jsxs("div",{className:"flex flex-col gap-6",children:[n,u,t.jsx(ae,{onClick:s,disabled:l,className:"w-full cursor-pointer",children:_})]}),e[3]=s,e[4]=l,e[5]=_,e[6]=p):p=e[6],p}function bt(a){return t.jsxs("li",{className:"text-sm text-muted-foreground flex items-start gap-2",children:[t.jsx("span",{className:"text-emerald-500 mt-0.5 shrink-0",children:"+"}),a]},a)}function Xt({open:a,onOpenChange:e,existingAgent:s}){const o=ke(),{org:d}=V(),n=_e(),c=Ee(),u=Pe(),l=$({connectionId:ce,orgId:d.id,orgSlug:d.slug}),_=Ye({client:l}),[p,C]=O.useState(!1),g=qe.find(y=>y.id==="site-diagnostics"),{data:m,isLoading:f}=Ke(g.appId,{enabled:a}),r=m?.title||m?.server?.title||m?.server?.name||g.title,h=m?.server?.icons?.[0]?.src??g.icon,x=m?.server?.description??null,T=t.jsx(Ue,{icon:h,name:r,size:"sm"}),b=async()=>{if(m){if(s){e(!1),n(s.id);return}C(!0);try{const y=await _.mutateAsync({name:"COLLECTION_CONNECTIONS_LIST",arguments:{where:{field:["app_id"],operator:"eq",value:g.appId},limit:1,offset:0}});let i;const v=y?.structuredContent?.items?.find(S=>S.app_id===g.appId);if(v)i=v.id;else{const S=m.server?.remotes?.[0]?.url;if(!S)throw new Error("Registry item is missing a remote URL for site-diagnostics");i=(await c.create.mutateAsync({title:r,description:x,icon:m.server?.icons?.[0]?.src??g.icon,connection_type:"HTTP",connection_url:S,app_name:m.server?.name??"site-diagnostics",app_id:g.appId,metadata:{type:"site-diagnostics",source:"store",registry_item_id:g.appId,verified:!0}})).id}const j=await u.create.mutateAsync({title:r,description:x,icon:h,status:"active",connections:[{connection_id:i,selected_tools:null,selected_resources:null,selected_prompts:null}],metadata:{type:"site-diagnostics",instructions:null,ui:{pinnedViews:[{connectionId:i,toolName:"diagnose",label:"diagnose",icon:null}],layout:{defaultMainView:{type:"ext-apps",id:i,toolName:"diagnose"}}}}});D("agent_recruit_confirmed",{template_id:"site-diagnostics",agent_id:j.id}),e(!1),n(j.id)}catch(y){D("agent_recruit_failed",{template_id:"site-diagnostics",error:y instanceof Error?y.message:String(y)}),console.error("Failed to create Site Diagnostics agent:",y)}finally{C(!1)}}},N=`Add ${r}`;return o?t.jsx(Oe,{open:a,onOpenChange:e,children:t.jsxs(Le,{className:"h-[70dvh]",children:[t.jsx(Re,{className:"px-4 pt-4 pb-4 shrink-0",children:t.jsxs("div",{className:"flex items-center gap-3",children:[T,t.jsx(Me,{className:"text-xl font-semibold",children:N})]})}),t.jsx("div",{className:"flex flex-col flex-1 min-h-0 px-4 pb-8",children:t.jsx($e,{onRecruit:b,isRecruiting:p,isLoading:f})})]})}):t.jsx(de,{open:a,onOpenChange:e,children:t.jsxs(le,{className:"sm:max-w-[500px] p-8",children:[t.jsx(ue,{className:"mb-4",children:t.jsxs("div",{className:"flex items-center gap-3",children:[T,t.jsx(me,{className:"text-xl font-semibold",children:N})]})}),t.jsx($e,{onRecruit:b,isRecruiting:p,isLoading:f})]})})}const vt=`<role>
|
|
2
2
|
You are the Agent Manager. You create, configure, and maintain agents (Virtual MCPs) in this workspace.
|
|
3
3
|
</role>
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as X,r as x,a as V,t as P,b as p,j as e,B as f,c as T,d as ae,S as $,N as ie,e as oe}from"./index-RBXYZ0o1.js";import{I}from"./input-CbOPFA2Y.js";function le({redirectUrl:s,callbackUrl:r="/"}){const{emailAndPassword:l,resetPassword:u,emailOtp:i,socialProviders:d}=X(),[n,j]=x.useState(""),[y,D]=x.useState(""),[b,C]=x.useState(""),[O,A]=x.useState(""),[L,R]=x.useState(!1),[z,N]=x.useState(()=>!l.enabled&&i.enabled?"emailOtp":globalThis.localStorage?.getItem("hasLoggedIn")!=="true"?"signUp":"signIn"),[c,S]=x.useState(""),[Y,G]=x.useState(!1),m=z==="signUp",h=z==="forgotPassword",w=z==="emailOtp",F=V({mutationFn:async({email:t,password:a,name:q})=>{try{if(m){const g=await p.signUp.email({email:t,password:a,name:q||""});if(g.error)throw new Error(g.error.message||"Sign up failed");return g}else{const g=await p.signIn.email({email:t,password:a});if(g.error)throw new Error(g.error.message||"Sign in failed");return g}}catch(g){throw g instanceof Error?g:new Error("Authentication failed")}},onSuccess:()=>{globalThis.localStorage?.setItem("hasLoggedIn","true"),window.location.href=s??r},onError:t=>{P(m?"user_signup_failed":"user_signin_failed",{error:t instanceof Error?t.message:String(t)})}}),U=V({mutationFn:async({email:t})=>{const a=await p.requestPasswordReset({email:t,redirectTo:"/reset-password"});if(a.error)throw new Error(a.error.message||"Failed to send reset email");return a},onSuccess:()=>{P("password_reset_requested"),G(!0)},onError:t=>{P("password_reset_request_failed",{error:t instanceof Error?t.message:String(t)})}}),E=V({mutationFn:async({email:t})=>{const a=await p.emailOtp.sendVerificationOtp({email:t,type:"sign-in"});if(a.error)throw new Error(a.error.message||"Failed to send code");return a},onSuccess:()=>{P("email_otp_sent"),R(!0)},onError:t=>{P("email_otp_send_failed",{error:t instanceof Error?t.message:String(t)})}}),_=V({mutationFn:async({email:t,otp:a})=>{const q=await p.signIn.emailOtp({email:t,otp:a});if(q.error)throw new Error(q.error.message||"Invalid code");return q},onSuccess:()=>{globalThis.localStorage?.setItem("hasLoggedIn","true"),window.location.href=s??r},onError:t=>{P("email_otp_verify_failed",{error:t instanceof Error?t.message:String(t)})}}),B=t=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t),W=()=>{n.trim()&&!B(n)&&S("Invalid email address")},Z=t=>{if(t.preventDefault(),!B(n)){S("Invalid email address");return}F.mutate({email:n,password:y,name:b})},ee=t=>{if(t.preventDefault(),!B(n)){S("Invalid email address");return}U.mutate({email:n})},te=t=>{if(t.preventDefault(),!B(n)){S("Invalid email address");return}E.mutate({email:n})},se=t=>{t.preventDefault(),_.mutate({email:n,otp:O})},k=t=>a=>{t(a.target.value),H&&F.reset(),J&&U.reset(),K&&(E.reset(),_.reset()),t===j&&c&&S("")},M=t=>{N(t),C(""),A(""),R(!1),S(""),G(!1),F.reset(),U.reset(),E.reset(),_.reset()},o=F.isPending||U.isPending||E.isPending||_.isPending,H=F.error,J=U.error,K=E.error||_.error,v=m?n.trim()&&y.trim()&&b.trim():h?n.trim():w?L?O.trim():n.trim():n.trim()&&y.trim(),re=t=>{if(!t)return null;const a=t.message.toLowerCase();return a.includes("unauthorized")||a.includes("401")?"Invalid email or password. Please try again.":a.includes("already exists")||a.includes("409")?"An account with this email already exists. Try signing in instead.":a.includes("network")||a.includes("fetch")?"Network error. Please check your connection and try again.":a.includes("rate limit")||a.includes("429")?"Too many attempts. Please wait a moment and try again.":a.includes("invalid")&&a.includes("otp")?"Invalid or expired code. Please try again.":t.message||"An error occurred. Please try again."},Q=H||J||K,ne=h?"Reset your password":w?L?"Enter verification code":"Sign in with email code":m?"Create your account":"Login or signup below";return e.jsxs("div",{className:"mx-auto w-full min-h-full md:min-h-0 md:min-w-[400px] max-w-md grid gap-6 content-center bg-card p-6 md:p-10 border border-primary-foreground/20",children:[e.jsx("div",{className:"flex justify-center",children:e.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12"})}),e.jsx("div",{className:"text-center space-y-1",children:e.jsx("p",{className:"text-sm text-foreground/70",children:ne})}),Q&&e.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:re(Q)}),Y&&e.jsx("div",{className:"rounded-xl bg-emerald-500/10 p-3 text-sm text-emerald-600 dark:text-emerald-400 text-center",children:"Check your email for a password reset link."}),!h&&d.enabled&&e.jsx("div",{className:"grid gap-3",children:d.providers.map(t=>e.jsxs(f,{type:"button",variant:"outline",size:"lg",className:"w-full font-medium",disabled:o,onClick:()=>{p.signIn.social({provider:t.name,callbackURL:s??r})},children:[t.icon&&e.jsx("img",{src:t.icon,alt:"",className:"h-5 w-5","aria-hidden":"true"}),"Continue with"," ",t.name.charAt(0).toUpperCase()+t.name.slice(1)]},t.name))}),!h&&d.enabled&&(l.enabled||i.enabled)&&e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"h-px flex-1 bg-border"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"or"}),e.jsx("div",{className:"h-px flex-1 bg-border"})]}),w&&i.enabled&&e.jsx(e.Fragment,{children:L?e.jsxs("form",{onSubmit:se,className:"grid gap-4",children:[e.jsxs("div",{className:"rounded-xl bg-muted/50 p-3 text-sm text-muted-foreground text-center",children:["Code sent to ",n]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Verification code"}),e.jsx(I,{type:"text",placeholder:"Enter code",value:O,onChange:k(A),required:!0,disabled:o,autoFocus:!0,inputMode:"numeric",autoComplete:"one-time-code"})]}),e.jsx(f,{type:"submit",disabled:o||!v,className:"w-full font-semibold",size:"lg",children:o?"Verifying...":"Verify"}),e.jsx(f,{type:"button",variant:"ghost",onClick:()=>{R(!1),A(""),E.reset(),_.reset()},disabled:o,className:"text-sm text-muted-foreground hover:text-foreground",children:"Use a different email"})]}):e.jsxs("form",{onSubmit:te,className:"grid gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Email"}),e.jsx(I,{type:"email",placeholder:"you@example.com",value:n,onChange:k(j),onBlur:W,required:!0,disabled:o,"aria-invalid":!!c}),c&&e.jsx("p",{className:"text-xs text-destructive mt-1.5",children:c})]}),e.jsx(f,{type:"submit",disabled:o||!v,className:"w-full font-semibold",size:"lg",children:o?"Sending...":"Send code"})]})}),h&&l.enabled&&!Y&&e.jsxs("form",{onSubmit:ee,className:"grid gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Email"}),e.jsx(I,{type:"email",placeholder:"you@example.com",value:n,onChange:k(j),onBlur:W,required:!0,disabled:o,"aria-invalid":!!c}),c&&e.jsx("p",{className:"text-xs text-destructive mt-1.5",children:c})]}),e.jsx(f,{type:"submit",disabled:o||!v,className:"w-full font-semibold",size:"lg",children:o?"Sending...":"Send reset link"})]}),!h&&!w&&l.enabled&&e.jsxs("form",{onSubmit:Z,className:"grid gap-4",children:[e.jsx("div",{className:T("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",m?"max-h-[200px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:e.jsxs("div",{className:T("p-1",!m&&"pointer-events-none"),children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Name"}),e.jsx(I,{type:"text",placeholder:"Your name",value:b,onChange:k(C),required:!0,disabled:o||!m,"aria-hidden":!m})]})}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Email"}),e.jsx(I,{type:"email",placeholder:"you@example.com",value:n,onChange:k(j),onBlur:W,required:!0,disabled:o,"aria-invalid":!!c}),c&&e.jsx("p",{className:"text-xs text-destructive mt-1.5",children:c})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("label",{className:"block text-sm font-medium text-foreground",children:"Password"}),!m&&u.enabled&&e.jsx("button",{type:"button",onClick:()=>M("forgotPassword"),className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:"Forgot password?"})]}),e.jsx(I,{type:"password",placeholder:"••••••••",value:y,onChange:k(D),required:!0,disabled:o})]}),e.jsx("div",{className:T("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",v?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:e.jsx("div",{className:T("p-1",!v&&"pointer-events-none"),children:e.jsx(f,{type:"submit",disabled:o||!v,className:T("w-full font-semibold"),size:"lg","aria-hidden":!v,children:o?m?"Creating account...":"Signing in...":"Continue"})})})]}),!h&&i.enabled&&l.enabled&&!w&&e.jsx("div",{className:"text-center",children:e.jsx(f,{type:"button",variant:"link",onClick:()=>M("emailOtp"),disabled:o,className:"text-sm text-muted-foreground hover:text-foreground",children:"Sign in with email code instead"})}),w&&l.enabled&&e.jsx("div",{className:"text-center",children:e.jsx(f,{type:"button",variant:"link",onClick:()=>M("signIn"),disabled:o,className:"text-sm text-muted-foreground hover:text-foreground",children:"Sign in with password instead"})}),e.jsx("div",{className:"text-center",children:h?e.jsx(f,{type:"button",variant:"link",onClick:()=>M("signIn"),disabled:o,className:"text-sm text-muted-foreground hover:text-foreground",children:"Back to sign in"}):!w&&l.enabled?e.jsx(f,{type:"button",variant:"link",onClick:()=>M(m?"signIn":"signUp"),disabled:o,className:"text-sm text-muted-foreground hover:text-foreground",children:m?"Already have an account? Sign in":"Don't have an account? Sign up"}):null}),e.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground pt-4",children:[e.jsx("a",{href:"https://www.decocms.com/terms-of-use",target:"_blank",rel:"noopener noreferrer",className:"hover:text-foreground transition-colors",children:"Terms of Service"}),e.jsx("a",{href:"https://www.decocms.com/privacy-policy",target:"_blank",rel:"noopener noreferrer",className:"hover:text-foreground transition-colors",children:"Privacy Policy"})]})]})}function de({redirectTo:s}){const[r,l]=x.useState(null);return x.useEffect(()=>{let u=!1;return(async()=>{try{let i;for(let d=0;d<5&&(i=await fetch("/api/auth/custom/local-session",{method:"POST",credentials:"include"}),!(i.ok||i.status<500));d++)await new Promise(n=>setTimeout(n,Math.min(1e3*2**d,1e4)));if(!i?.ok){const d=await i?.json().catch(()=>({}));throw new Error(d?.error||"Auto-login failed")}if(!u){const d=s.startsWith("/")&&!s.startsWith("//")?s:"/";window.location.href=d}}catch(i){u||l(i instanceof Error?i.message:"Auto-login failed")}})(),()=>{u=!0}},[s]),r?e.jsx("div",{className:"flex min-h-screen items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsxs("p",{className:"text-destructive mb-2",children:["Auto-login failed: ",r]}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Try restarting the server."})]})}):e.jsx($,{})}function ce(s){if(!s.client_id||s.response_type!=="code")return null;const r=new URLSearchParams;return s.client_id&&r.set("client_id",s.client_id),s.redirect_uri&&r.set("redirect_uri",s.redirect_uri),s.response_type&&r.set("response_type",s.response_type),s.state&&r.set("state",s.state),s.scope&&r.set("scope",s.scope),s.code_challenge&&r.set("code_challenge",s.code_challenge),s.code_challenge_method&&r.set("code_challenge_method",s.code_challenge_method),`/api/auth/mcp/authorize?${r.toString()}`}function ue(s){const r=oe.c(5),{callbackURL:l,providerId:u}=s;let i,d;r[0]!==l||r[1]!==u?(i=()=>{(async()=>await p.signIn.sso({providerId:u,callbackURL:l}))()},d=[u,l],r[0]=l,r[1]=u,r[2]=i,r[3]=d):(i=r[2],d=r[3]),x.useEffect(i,d);let n;return r[4]===Symbol.for("react.memo_cache_sentinel")?(n=e.jsx($,{}),r[4]=n):n=r[4],n}function ge(){const s=p.useSession(),r=ae({from:"/login"}),{next:l="/",client_id:u,redirect_uri:i,response_type:d,state:n,scope:j,code_challenge:y,code_challenge_method:D}=r,b=l.startsWith("/")&&!l.startsWith("//")?l:"/",{sso:C,emailAndPassword:O,magicLink:A,emailOtp:L,socialProviders:R,localMode:z}=X(),N=ce({client_id:u,redirect_uri:i,response_type:d,state:n,scope:j,code_challenge:y,code_challenge_method:D}),c=N||b;return s.data?N?(window.location.href=N,e.jsx($,{})):e.jsx(ie,{to:b}):z?e.jsx(de,{redirectTo:c}):C.enabled?e.jsx(ue,{callbackURL:c,providerId:C.providerId}):O.enabled||A.enabled||L.enabled||R.enabled?e.jsxs("main",{className:"relative flex min-h-screen items-stretch md:items-center justify-center bg-gradient-to-br from-brand to-brand/75 p-1 md:p-4",children:[e.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(circle, var(--brand-foreground) 1px, transparent 1px)",backgroundSize:"16px 16px",opacity:.15}}),e.jsxs("div",{className:"relative z-10 w-full md:w-auto",children:[e.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-screen h-px bg-brand-foreground/15"}),e.jsx("div",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 w-screen h-px bg-brand-foreground/15"}),e.jsx("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-px h-screen bg-brand-foreground/15"}),e.jsx("div",{className:"absolute right-0 top-1/2 -translate-y-1/2 w-px h-screen bg-brand-foreground/15"}),e.jsx(le,{redirectUrl:N,callbackUrl:b})]})]}):e.jsx("div",{children:"No login options available"})}export{ge as default};
|
|
1
|
+
import{u as X,r as x,a as V,t as P,b as p,j as e,B as f,c as T,d as ae,S as $,N as ie,e as oe}from"./index-BGvMfUr2.js";import{I}from"./input-r-FVR1hH.js";function le({redirectUrl:s,callbackUrl:r="/"}){const{emailAndPassword:l,resetPassword:u,emailOtp:i,socialProviders:d}=X(),[n,j]=x.useState(""),[y,D]=x.useState(""),[b,C]=x.useState(""),[O,A]=x.useState(""),[L,R]=x.useState(!1),[z,N]=x.useState(()=>!l.enabled&&i.enabled?"emailOtp":globalThis.localStorage?.getItem("hasLoggedIn")!=="true"?"signUp":"signIn"),[c,S]=x.useState(""),[Y,G]=x.useState(!1),m=z==="signUp",h=z==="forgotPassword",w=z==="emailOtp",F=V({mutationFn:async({email:t,password:a,name:q})=>{try{if(m){const g=await p.signUp.email({email:t,password:a,name:q||""});if(g.error)throw new Error(g.error.message||"Sign up failed");return g}else{const g=await p.signIn.email({email:t,password:a});if(g.error)throw new Error(g.error.message||"Sign in failed");return g}}catch(g){throw g instanceof Error?g:new Error("Authentication failed")}},onSuccess:()=>{globalThis.localStorage?.setItem("hasLoggedIn","true"),window.location.href=s??r},onError:t=>{P(m?"user_signup_failed":"user_signin_failed",{error:t instanceof Error?t.message:String(t)})}}),U=V({mutationFn:async({email:t})=>{const a=await p.requestPasswordReset({email:t,redirectTo:"/reset-password"});if(a.error)throw new Error(a.error.message||"Failed to send reset email");return a},onSuccess:()=>{P("password_reset_requested"),G(!0)},onError:t=>{P("password_reset_request_failed",{error:t instanceof Error?t.message:String(t)})}}),E=V({mutationFn:async({email:t})=>{const a=await p.emailOtp.sendVerificationOtp({email:t,type:"sign-in"});if(a.error)throw new Error(a.error.message||"Failed to send code");return a},onSuccess:()=>{P("email_otp_sent"),R(!0)},onError:t=>{P("email_otp_send_failed",{error:t instanceof Error?t.message:String(t)})}}),_=V({mutationFn:async({email:t,otp:a})=>{const q=await p.signIn.emailOtp({email:t,otp:a});if(q.error)throw new Error(q.error.message||"Invalid code");return q},onSuccess:()=>{globalThis.localStorage?.setItem("hasLoggedIn","true"),window.location.href=s??r},onError:t=>{P("email_otp_verify_failed",{error:t instanceof Error?t.message:String(t)})}}),B=t=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t),W=()=>{n.trim()&&!B(n)&&S("Invalid email address")},Z=t=>{if(t.preventDefault(),!B(n)){S("Invalid email address");return}F.mutate({email:n,password:y,name:b})},ee=t=>{if(t.preventDefault(),!B(n)){S("Invalid email address");return}U.mutate({email:n})},te=t=>{if(t.preventDefault(),!B(n)){S("Invalid email address");return}E.mutate({email:n})},se=t=>{t.preventDefault(),_.mutate({email:n,otp:O})},k=t=>a=>{t(a.target.value),H&&F.reset(),J&&U.reset(),K&&(E.reset(),_.reset()),t===j&&c&&S("")},M=t=>{N(t),C(""),A(""),R(!1),S(""),G(!1),F.reset(),U.reset(),E.reset(),_.reset()},o=F.isPending||U.isPending||E.isPending||_.isPending,H=F.error,J=U.error,K=E.error||_.error,v=m?n.trim()&&y.trim()&&b.trim():h?n.trim():w?L?O.trim():n.trim():n.trim()&&y.trim(),re=t=>{if(!t)return null;const a=t.message.toLowerCase();return a.includes("unauthorized")||a.includes("401")?"Invalid email or password. Please try again.":a.includes("already exists")||a.includes("409")?"An account with this email already exists. Try signing in instead.":a.includes("network")||a.includes("fetch")?"Network error. Please check your connection and try again.":a.includes("rate limit")||a.includes("429")?"Too many attempts. Please wait a moment and try again.":a.includes("invalid")&&a.includes("otp")?"Invalid or expired code. Please try again.":t.message||"An error occurred. Please try again."},Q=H||J||K,ne=h?"Reset your password":w?L?"Enter verification code":"Sign in with email code":m?"Create your account":"Login or signup below";return e.jsxs("div",{className:"mx-auto w-full min-h-full md:min-h-0 md:min-w-[400px] max-w-md grid gap-6 content-center bg-card p-6 md:p-10 border border-primary-foreground/20",children:[e.jsx("div",{className:"flex justify-center",children:e.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12"})}),e.jsx("div",{className:"text-center space-y-1",children:e.jsx("p",{className:"text-sm text-foreground/70",children:ne})}),Q&&e.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:re(Q)}),Y&&e.jsx("div",{className:"rounded-xl bg-emerald-500/10 p-3 text-sm text-emerald-600 dark:text-emerald-400 text-center",children:"Check your email for a password reset link."}),!h&&d.enabled&&e.jsx("div",{className:"grid gap-3",children:d.providers.map(t=>e.jsxs(f,{type:"button",variant:"outline",size:"lg",className:"w-full font-medium",disabled:o,onClick:()=>{p.signIn.social({provider:t.name,callbackURL:s??r})},children:[t.icon&&e.jsx("img",{src:t.icon,alt:"",className:"h-5 w-5","aria-hidden":"true"}),"Continue with"," ",t.name.charAt(0).toUpperCase()+t.name.slice(1)]},t.name))}),!h&&d.enabled&&(l.enabled||i.enabled)&&e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"h-px flex-1 bg-border"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"or"}),e.jsx("div",{className:"h-px flex-1 bg-border"})]}),w&&i.enabled&&e.jsx(e.Fragment,{children:L?e.jsxs("form",{onSubmit:se,className:"grid gap-4",children:[e.jsxs("div",{className:"rounded-xl bg-muted/50 p-3 text-sm text-muted-foreground text-center",children:["Code sent to ",n]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Verification code"}),e.jsx(I,{type:"text",placeholder:"Enter code",value:O,onChange:k(A),required:!0,disabled:o,autoFocus:!0,inputMode:"numeric",autoComplete:"one-time-code"})]}),e.jsx(f,{type:"submit",disabled:o||!v,className:"w-full font-semibold",size:"lg",children:o?"Verifying...":"Verify"}),e.jsx(f,{type:"button",variant:"ghost",onClick:()=>{R(!1),A(""),E.reset(),_.reset()},disabled:o,className:"text-sm text-muted-foreground hover:text-foreground",children:"Use a different email"})]}):e.jsxs("form",{onSubmit:te,className:"grid gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Email"}),e.jsx(I,{type:"email",placeholder:"you@example.com",value:n,onChange:k(j),onBlur:W,required:!0,disabled:o,"aria-invalid":!!c}),c&&e.jsx("p",{className:"text-xs text-destructive mt-1.5",children:c})]}),e.jsx(f,{type:"submit",disabled:o||!v,className:"w-full font-semibold",size:"lg",children:o?"Sending...":"Send code"})]})}),h&&l.enabled&&!Y&&e.jsxs("form",{onSubmit:ee,className:"grid gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Email"}),e.jsx(I,{type:"email",placeholder:"you@example.com",value:n,onChange:k(j),onBlur:W,required:!0,disabled:o,"aria-invalid":!!c}),c&&e.jsx("p",{className:"text-xs text-destructive mt-1.5",children:c})]}),e.jsx(f,{type:"submit",disabled:o||!v,className:"w-full font-semibold",size:"lg",children:o?"Sending...":"Send reset link"})]}),!h&&!w&&l.enabled&&e.jsxs("form",{onSubmit:Z,className:"grid gap-4",children:[e.jsx("div",{className:T("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",m?"max-h-[200px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:e.jsxs("div",{className:T("p-1",!m&&"pointer-events-none"),children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Name"}),e.jsx(I,{type:"text",placeholder:"Your name",value:b,onChange:k(C),required:!0,disabled:o||!m,"aria-hidden":!m})]})}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Email"}),e.jsx(I,{type:"email",placeholder:"you@example.com",value:n,onChange:k(j),onBlur:W,required:!0,disabled:o,"aria-invalid":!!c}),c&&e.jsx("p",{className:"text-xs text-destructive mt-1.5",children:c})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("label",{className:"block text-sm font-medium text-foreground",children:"Password"}),!m&&u.enabled&&e.jsx("button",{type:"button",onClick:()=>M("forgotPassword"),className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:"Forgot password?"})]}),e.jsx(I,{type:"password",placeholder:"••••••••",value:y,onChange:k(D),required:!0,disabled:o})]}),e.jsx("div",{className:T("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",v?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:e.jsx("div",{className:T("p-1",!v&&"pointer-events-none"),children:e.jsx(f,{type:"submit",disabled:o||!v,className:T("w-full font-semibold"),size:"lg","aria-hidden":!v,children:o?m?"Creating account...":"Signing in...":"Continue"})})})]}),!h&&i.enabled&&l.enabled&&!w&&e.jsx("div",{className:"text-center",children:e.jsx(f,{type:"button",variant:"link",onClick:()=>M("emailOtp"),disabled:o,className:"text-sm text-muted-foreground hover:text-foreground",children:"Sign in with email code instead"})}),w&&l.enabled&&e.jsx("div",{className:"text-center",children:e.jsx(f,{type:"button",variant:"link",onClick:()=>M("signIn"),disabled:o,className:"text-sm text-muted-foreground hover:text-foreground",children:"Sign in with password instead"})}),e.jsx("div",{className:"text-center",children:h?e.jsx(f,{type:"button",variant:"link",onClick:()=>M("signIn"),disabled:o,className:"text-sm text-muted-foreground hover:text-foreground",children:"Back to sign in"}):!w&&l.enabled?e.jsx(f,{type:"button",variant:"link",onClick:()=>M(m?"signIn":"signUp"),disabled:o,className:"text-sm text-muted-foreground hover:text-foreground",children:m?"Already have an account? Sign in":"Don't have an account? Sign up"}):null}),e.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground pt-4",children:[e.jsx("a",{href:"https://www.decocms.com/terms-of-use",target:"_blank",rel:"noopener noreferrer",className:"hover:text-foreground transition-colors",children:"Terms of Service"}),e.jsx("a",{href:"https://www.decocms.com/privacy-policy",target:"_blank",rel:"noopener noreferrer",className:"hover:text-foreground transition-colors",children:"Privacy Policy"})]})]})}function de({redirectTo:s}){const[r,l]=x.useState(null);return x.useEffect(()=>{let u=!1;return(async()=>{try{let i;for(let d=0;d<5&&(i=await fetch("/api/auth/custom/local-session",{method:"POST",credentials:"include"}),!(i.ok||i.status<500));d++)await new Promise(n=>setTimeout(n,Math.min(1e3*2**d,1e4)));if(!i?.ok){const d=await i?.json().catch(()=>({}));throw new Error(d?.error||"Auto-login failed")}if(!u){const d=s.startsWith("/")&&!s.startsWith("//")?s:"/";window.location.href=d}}catch(i){u||l(i instanceof Error?i.message:"Auto-login failed")}})(),()=>{u=!0}},[s]),r?e.jsx("div",{className:"flex min-h-screen items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsxs("p",{className:"text-destructive mb-2",children:["Auto-login failed: ",r]}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Try restarting the server."})]})}):e.jsx($,{})}function ce(s){if(!s.client_id||s.response_type!=="code")return null;const r=new URLSearchParams;return s.client_id&&r.set("client_id",s.client_id),s.redirect_uri&&r.set("redirect_uri",s.redirect_uri),s.response_type&&r.set("response_type",s.response_type),s.state&&r.set("state",s.state),s.scope&&r.set("scope",s.scope),s.code_challenge&&r.set("code_challenge",s.code_challenge),s.code_challenge_method&&r.set("code_challenge_method",s.code_challenge_method),`/api/auth/mcp/authorize?${r.toString()}`}function ue(s){const r=oe.c(5),{callbackURL:l,providerId:u}=s;let i,d;r[0]!==l||r[1]!==u?(i=()=>{(async()=>await p.signIn.sso({providerId:u,callbackURL:l}))()},d=[u,l],r[0]=l,r[1]=u,r[2]=i,r[3]=d):(i=r[2],d=r[3]),x.useEffect(i,d);let n;return r[4]===Symbol.for("react.memo_cache_sentinel")?(n=e.jsx($,{}),r[4]=n):n=r[4],n}function ge(){const s=p.useSession(),r=ae({from:"/login"}),{next:l="/",client_id:u,redirect_uri:i,response_type:d,state:n,scope:j,code_challenge:y,code_challenge_method:D}=r,b=l.startsWith("/")&&!l.startsWith("//")?l:"/",{sso:C,emailAndPassword:O,magicLink:A,emailOtp:L,socialProviders:R,localMode:z}=X(),N=ce({client_id:u,redirect_uri:i,response_type:d,state:n,scope:j,code_challenge:y,code_challenge_method:D}),c=N||b;return s.data?N?(window.location.href=N,e.jsx($,{})):e.jsx(ie,{to:b}):z?e.jsx(de,{redirectTo:c}):C.enabled?e.jsx(ue,{callbackURL:c,providerId:C.providerId}):O.enabled||A.enabled||L.enabled||R.enabled?e.jsxs("main",{className:"relative flex min-h-screen items-stretch md:items-center justify-center bg-gradient-to-br from-brand to-brand/75 p-1 md:p-4",children:[e.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(circle, var(--brand-foreground) 1px, transparent 1px)",backgroundSize:"16px 16px",opacity:.15}}),e.jsxs("div",{className:"relative z-10 w-full md:w-auto",children:[e.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-screen h-px bg-brand-foreground/15"}),e.jsx("div",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 w-screen h-px bg-brand-foreground/15"}),e.jsx("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-px h-screen bg-brand-foreground/15"}),e.jsx("div",{className:"absolute right-0 top-1/2 -translate-y-1/2 w-px h-screen bg-brand-foreground/15"}),e.jsx(le,{redirectUrl:N,callbackUrl:b})]})]}):e.jsx("div",{children:"No login options available"})}export{ge as default};
|