decocms 2.283.0 → 2.283.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-CbtT--Ol.js → AlertCircle-B6lKc5r3.js} +1 -1
- package/dist/client/assets/{ArrowNarrowLeft-DWZkNaNO.js → ArrowNarrowLeft-DKpjDF0O.js} +1 -1
- package/dist/client/assets/{CheckCircle-3hn9ZLNf.js → CheckCircle-Cu9gxMoh.js} +1 -1
- package/dist/client/assets/{ChevronDown-DdYtF_pN.js → ChevronDown-CGYRNnVK.js} +1 -1
- package/dist/client/assets/{ChevronRight-e4qgFMIt.js → ChevronRight-Cs_mq2Gb.js} +1 -1
- package/dist/client/assets/{ChevronUp-CGzEbpO7.js → ChevronUp-CNHg8Tvy.js} +1 -1
- package/dist/client/assets/{Container-gkiuXluH.js → Container-CTt4BzRP.js} +1 -1
- package/dist/client/assets/{LinkExternal01-BunxZmQL.js → LinkExternal01-B8RP9b4T.js} +1 -1
- package/dist/client/assets/{Lock01-DvsN0mFQ.js → Lock01-DGN1sRwj.js} +1 -1
- package/dist/client/assets/{Palette-ahL5lOBN.js → Palette-BLl9a_yE.js} +1 -1
- package/dist/client/assets/{Play-Dz2HPAmd.js → Play-YaIPTi2N.js} +1 -1
- package/dist/client/assets/{Plus-Dn-1QbCZ.js → Plus-CI2hG7eT.js} +1 -1
- package/dist/client/assets/{SearchMd-b9tCf66d.js → SearchMd-CJUx5L0X.js} +1 -1
- package/dist/client/assets/{Settings02-Dk076iZH.js → Settings02-CzftfR-P.js} +1 -1
- package/dist/client/assets/{Star01-LL8IcJik.js → Star01-CvBfAtRc.js} +1 -1
- package/dist/client/assets/{Sun-CEKlSeb7.js → Sun-DDl1TbCr.js} +1 -1
- package/dist/client/assets/{Tool01-C58Xtung.js → Tool01-C4G0_dmI.js} +1 -1
- package/dist/client/assets/{Trash01-BvF1rPkz.js → Trash01-DoGU3WEE.js} +1 -1
- package/dist/client/assets/{User01-Cjs4dHzU.js → User01-Cs--OmtK.js} +1 -1
- package/dist/client/assets/{Users03-S9PW2exM.js → Users03-CEDkUueK.js} +1 -1
- package/dist/client/assets/{X-woFr0RM9.js → X-DU4RFoiA.js} +1 -1
- package/dist/client/assets/{XCircle-DcrVc7Ai.js → XCircle-DIbQNdIy.js} +1 -1
- package/dist/client/assets/{Zap-C_TCIuRq.js → Zap-D6T_WrPQ.js} +1 -1
- package/dist/client/assets/{ZapSquare-Cwy3VSGD.js → ZapSquare-Btv7LDve.js} +1 -1
- package/dist/client/assets/{accordion-D_jejMYM.js → accordion-BSHhIZXM.js} +1 -1
- package/dist/client/assets/{agent-icon-YPHh6Pzl.js → agent-icon-Dmd713yi.js} +1 -1
- package/dist/client/assets/{agents-list-DAbe9iK7.js → agents-list-CJAIn9Nw.js} +1 -1
- package/dist/client/assets/ai-providers-D9dwDsov.js +1 -0
- package/dist/client/assets/{alert-dialog-DYUDJvNb.js → alert-dialog-BHsh1K_4.js} +1 -1
- package/dist/client/assets/{auth-catchall-Ch73rCgm.js → auth-catchall-BrZqr7p6.js} +1 -1
- package/dist/client/assets/{automation-list-row-D9xPB2e4.js → automation-list-row-BYsd5_5F.js} +1 -1
- package/dist/client/assets/{automations-DHroobs4.js → automations-CwTGObR_.js} +1 -1
- package/dist/client/assets/{avatar-CHIsPVvw.js → avatar-CiIOC0jm.js} +1 -1
- package/dist/client/assets/{badge-CdwEUsBG.js → badge-4dptbCEq.js} +1 -1
- package/dist/client/assets/{brand-context-9Duu_Raa.js → brand-context-CDJdQAKY.js} +1 -1
- package/dist/client/assets/{card-DtNfmWHu.js → card-EK1eVPf2.js} +1 -1
- package/dist/client/assets/{chat-context-CHNOhZ3c.js → chat-context-BNH6TZ71.js} +1 -1
- package/dist/client/assets/{checkbox-1xh00yHd.js → checkbox-CnUU9-I8.js} +1 -1
- package/dist/client/assets/{collection-detail-W5PzkADS.js → collection-detail-OPcrdjzj.js} +1 -1
- package/dist/client/assets/{collection-display-button-B2KAB3RO.js → collection-display-button-CVMEpIRp.js} +1 -1
- package/dist/client/assets/{collection-search-C8tjeasf.js → collection-search-CAiOUXIV.js} +1 -1
- package/dist/client/assets/{collection-search-DL5AAqlC.js → collection-search-DzQxK0TT.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-DZyJw2Qp.js → collection-table-wrapper-Bod3BRUJ.js} +1 -1
- package/dist/client/assets/{collection-tabs-CsNJTDO3.js → collection-tabs-zQGRYBUF.js} +1 -1
- package/dist/client/assets/{collections-BG8r46pt.js → collections-58NR9gW4.js} +1 -1
- package/dist/client/assets/{command-J9TO9TTk.js → command-Cogobv1L.js} +1 -1
- package/dist/client/assets/{connection-card-DrG7D-XR.js → connection-card-DUG1h-_6.js} +1 -1
- package/dist/client/assets/{connection-detail-BkpJ4eRx.js → connection-detail-COc1z0eq.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-Drl7lItU.js → connection-form-helpers-C3tUUR3v.js} +1 -1
- package/dist/client/assets/{connections-BGLK-FC9.js → connections-BInA1c12.js} +1 -1
- package/dist/client/assets/{constants-D7Xua0Kh.js → constants-B9qhU0c2.js} +1 -1
- package/dist/client/assets/{constants-BpATiyrZ.js → constants-BRrjE7JA.js} +1 -1
- package/dist/client/assets/{dialog-CMTU9wUU.js → dialog-DTc6xcOj.js} +1 -1
- package/dist/client/assets/{drawer-BbnvWPmy.js → drawer-D7fRUj36.js} +1 -1
- package/dist/client/assets/{dropdown-menu-CYaNafcW.js → dropdown-menu-DjMLFgss.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-Bf2K7Aya.js → dynamic-plugin-layout-D5Vx8IAg.js} +1 -1
- package/dist/client/assets/{empty-state-CFQu8hzr.js → empty-state-6q5IDcBd.js} +1 -1
- package/dist/client/assets/{empty-state-Bs5qBWrd.js → empty-state-CyDjcoCn.js} +1 -1
- package/dist/client/assets/{extract-connection-data-D6ONGrG_.js → extract-connection-data-BkBgr0-3.js} +1 -1
- package/dist/client/assets/{features-zixnb23X.js → features-BvFC5Pr0.js} +1 -1
- package/dist/client/assets/{form-QHifiEEX.js → form-KFRk7eRQ.js} +1 -1
- package/dist/client/assets/{general-BC7R0pdu.js → general-BjGaj1GT.js} +1 -1
- package/dist/client/assets/{github-repo-picker-DdJW6OKr.js → github-repo-picker-BSkFdyNg.js} +1 -1
- package/dist/client/assets/{index-Drh4iFTY.js → index-3FTFAFVn.js} +1 -1
- package/dist/client/assets/{index-CF3ZRVOE.js → index-4MgAykWa.js} +28 -28
- package/dist/client/assets/{index-BEGJNYDp.js → index-Baef8J5R.js} +1 -1
- package/dist/client/assets/{index-D2y6LxHu.js → index-BdDTS4hF.js} +1 -1
- package/dist/client/assets/{index-HgyXjm68.js → index-C08HiGeB.js} +1 -1
- package/dist/client/assets/{index-D-OXQ0xl.js → index-C4DjgJGL.js} +1 -1
- package/dist/client/assets/{index-QueWlMPI.js → index-CAASFRGs.js} +1 -1
- package/dist/client/assets/{index-HowXhEKl.js → index-CqJy3Jvl.js} +1 -1
- package/dist/client/assets/{index-BAVpG5PI.js → index-D_cV0HX5.js} +2 -2
- package/dist/client/assets/{index-iAPWq91d.js → index-FOE7YpHv.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-BvUWiP9V.js → infiniteQueryObserver-IJcComZ8.js} +1 -1
- package/dist/client/assets/{input-DnP63xwW.js → input-Cv-Gy5WN.js} +1 -1
- package/dist/client/assets/{integration-icon-DkvnCAKV.js → integration-icon-3xGkh2yb.js} +1 -1
- package/dist/client/assets/{label-DKwfAK9s.js → label-CNlIda5F.js} +1 -1
- package/dist/client/assets/{layout-BbutmLxJ.js → layout-DIXmeN4N.js} +1 -1
- package/dist/client/assets/{login-IRTXwxbm.js → login-BS3FoMPH.js} +1 -1
- package/dist/client/assets/{members-DdHTduhn.js → members-CKfYtWTZ.js} +1 -1
- package/dist/client/assets/{monaco-editor-BHTnNyUV.js → monaco-editor-AFl_PrCF.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-D9y7J0sc.js → monitoring-stats-row-D_JrgB_o.js} +1 -1
- package/dist/client/assets/{oauth-callback-BdKre2-T.js → oauth-callback-BVoerf7r.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-ZqXrzLEl.js → oauth-callback-ai-provider-CwTSAG2N.js} +1 -1
- package/dist/client/assets/{onboarding-D0wk0PoN.js → onboarding-LSX1P2kl.js} +1 -1
- package/dist/client/assets/{org-layout-BBeeqTuI.js → org-layout-LjdMsRi5.js} +1 -1
- package/dist/client/assets/{org-plugin-layout-kfthF_vf.js → org-plugin-layout-BjYMF2Hw.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-CpmLl5g8.js → plugin-empty-state-CNV6Fdky.js} +1 -1
- package/dist/client/assets/{plugin-header---ixO8Yh.js → plugin-header-Qlrhguve.js} +1 -1
- package/dist/client/assets/{plugin-layout-CBPBa-Fw.js → plugin-layout-UrD7dGGv.js} +1 -1
- package/dist/client/assets/{popover-CKtIWvNd.js → popover-BYKaDh8r.js} +1 -1
- package/dist/client/assets/{profile-BKvxvV-E.js → profile-BfMcwqnt.js} +1 -1
- package/dist/client/assets/{project-app-view-ChXGXZSO.js → project-app-view-CFEp8V0n.js} +1 -1
- package/dist/client/assets/registry-CDKXBXcC.js +2 -0
- package/dist/client/assets/{registry-layout-DdZKKnQK.js → registry-layout-C8vYG8EY.js} +1 -1
- package/dist/client/assets/{required-auth-layout-CjwkLMq3.js → required-auth-layout-D8VR7Qn-.js} +1 -1
- package/dist/client/assets/{reset-password-B6HQzDoJ.js → reset-password-_PZQBRj3.js} +1 -1
- package/dist/client/assets/{scroll-area-BSbrzuDv.js → scroll-area-BR90DEv6.js} +1 -1
- package/dist/client/assets/{search-input-DP4LjSem.js → search-input-C1FJdqjU.js} +1 -1
- package/dist/client/assets/{select-BNI7svYN.js → select-_midNVXe.js} +1 -1
- package/dist/client/assets/{select-model-B_-FDNHD.js → select-model-GoqBCq85.js} +1 -1
- package/dist/client/assets/{settings-layout-CMvH3biN.js → settings-layout-BCmCJj0X.js} +1 -1
- package/dist/client/assets/{shell-layout-CvVAcjla.js → shell-layout-FgHTT5It.js} +1 -1
- package/dist/client/assets/{skeleton-bPBtKDik.js → skeleton-Chpxgw5z.js} +1 -1
- package/dist/client/assets/{sso-Cu3uVex6.js → sso-CDhG5sm9.js} +1 -1
- package/dist/client/assets/{store-BlqXx4eb.js → store-B5BBgWDK.js} +1 -1
- package/dist/client/assets/store-registry-CbUNnR6f.js +2 -0
- package/dist/client/assets/{switch-CdXdPsLJ.js → switch-Bb611OnM.js} +1 -1
- package/dist/client/assets/{table-BfrU01FR.js → table-DZCl3DV_.js} +1 -1
- package/dist/client/assets/{tabs-BHhac7yq.js → tabs-CPuI5WWZ.js} +1 -1
- package/dist/client/assets/{task-status-DYiADURg.js → task-status-DaR1MpWK.js} +1 -1
- package/dist/client/assets/{textarea-CCJXdksA.js → textarea-GNMR8OqL.js} +1 -1
- package/dist/client/assets/{toggle-group-DLpy9z7t.js → toggle-group-BR1IpJFy.js} +1 -1
- package/dist/client/assets/{tools-list-DQ9cMQXy.js → tools-list-C2ObxyAj.js} +1 -1
- package/dist/client/assets/{types-BZ0c8uzs.js → types-DTGLm43F.js} +1 -1
- package/dist/client/assets/{use-ai-providers-g7t13ieS.js → use-ai-providers-DZ6DqAM3.js} +1 -1
- package/dist/client/assets/{use-collections-DFXTxuSg.js → use-collections-VlX8lbt0.js} +1 -1
- package/dist/client/assets/{use-connection-WpLI1Z7R.js → use-connection-DnhQK4fq.js} +1 -1
- package/dist/client/assets/{use-copy-BCScHFqH.js → use-copy-Dwf-_7tD.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-D2CVz9Z0.js → use-create-virtual-mcp-Q8Pi_HJm.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-FqeyN-Ts.js → use-decopilot-events-CvkLosTt.js} +1 -1
- package/dist/client/assets/{use-delete-connection-B7VNbah4.js → use-delete-connection-DnO01-yU.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-CLbN6ppD.js → use-infinite-scroll-BbJ5h1l2.js} +1 -1
- package/dist/client/assets/{use-list-state-CetwMWKu.js → use-list-state-RSIRKfu-.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-DXEYm3L2.js → use-mcp-tools-dsvqyXUs.js} +1 -1
- package/dist/client/assets/{use-members-DsQu-Ks-.js → use-members-yA1tHxKc.js} +1 -1
- package/dist/client/assets/{use-mobile-DjZnjqlA.js → use-mobile-BukhR5xc.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-B1eLGU7z.js → use-navigate-to-agent-cye4_ovr.js} +1 -1
- package/dist/client/assets/{use-org-sso-C2qxLZNA.js → use-org-sso-BX-CgWuz.js} +1 -1
- package/dist/client/assets/{use-organization-settings-_mA2wnSC.js → use-organization-settings-AIx1cKKY.js} +1 -1
- package/dist/client/assets/{use-registry-connections-C7mRgRdR.js → use-registry-connections-Ck-c3bU5.js} +1 -1
- package/dist/client/assets/{use-status-sounds-D0-Dwv_-.js → use-status-sounds-DXJvfF2c.js} +1 -1
- package/dist/client/assets/{use-tasks-BMxssOXF.js → use-tasks-B9RSBuk3.js} +1 -1
- package/dist/client/assets/{use-view-mode-WliGdadQ.js → use-view-mode-0huvW_sB.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-OtMHbTvm.js → use-virtual-mcp-CCFi2lST.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-Bs0N88A0.js +1 -0
- package/dist/client/assets/{user-Q3_cYTk2.js → user-R3PETSQv.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-D5xyWdqo.js → view-mode-toggle-T-xER1ZI.js} +1 -1
- package/dist/client/assets/{workflow-BUOyTgce.js → workflow-BblBxdPP.js} +1 -1
- package/dist/client/assets/workflow-detail-CzVmb0o7.js +1 -0
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +1 -1
- 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/ansi-styles/index.d.ts +236 -0
- package/dist/server/node_modules/ansi-styles/index.js +223 -0
- package/dist/server/node_modules/ansi-styles/license +9 -0
- package/dist/server/node_modules/ansi-styles/package.json +54 -0
- package/dist/server/node_modules/ansi-styles/readme.md +173 -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/environment/license +9 -0
- package/dist/server/node_modules/environment/package.json +74 -0
- package/dist/server/node_modules/environment/readme.md +94 -0
- package/dist/server/node_modules/escape-string-regexp/index.d.ts +18 -0
- package/dist/server/node_modules/escape-string-regexp/index.js +11 -0
- package/dist/server/node_modules/escape-string-regexp/license +9 -0
- package/dist/server/node_modules/escape-string-regexp/package.json +43 -0
- package/dist/server/node_modules/escape-string-regexp/readme.md +29 -0
- package/dist/server/node_modules/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/onetime/index.d.ts +64 -0
- package/dist/server/node_modules/onetime/index.js +44 -0
- package/dist/server/node_modules/onetime/license +9 -0
- package/dist/server/node_modules/onetime/package.json +43 -0
- package/dist/server/node_modules/onetime/readme.md +94 -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/split2/LICENSE +13 -0
- package/dist/server/node_modules/split2/README.md +85 -0
- package/dist/server/node_modules/split2/bench.js +27 -0
- package/dist/server/node_modules/split2/index.js +141 -0
- package/dist/server/node_modules/split2/package.json +39 -0
- package/dist/server/node_modules/split2/test.js +409 -0
- package/dist/server/node_modules/xtend/.jshintrc +30 -0
- package/dist/server/node_modules/xtend/LICENSE +20 -0
- package/dist/server/node_modules/xtend/README.md +32 -0
- package/dist/server/node_modules/xtend/immutable.js +19 -0
- package/dist/server/node_modules/xtend/mutable.js +17 -0
- package/dist/server/node_modules/xtend/package.json +55 -0
- package/dist/server/node_modules/xtend/test.js +103 -0
- package/package.json +1 -1
- package/dist/client/assets/ai-providers-BfLDbMLW.js +0 -1
- package/dist/client/assets/registry-DzQaV05R.js +0 -2
- package/dist/client/assets/store-registry-Bmruarg3.js +0 -2
- package/dist/client/assets/useInfiniteQuery-C96YfMla.js +0 -1
- package/dist/client/assets/workflow-detail-Cn5C7Hq2.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/{get-east-asian-width → ansi-regex}/license +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bV as b,e as f,j as c,aB as C,r as d,c as p,aY as j,bW as v,bX as h}from"./index-
|
|
1
|
+
import{bV as b,e as f,j as c,aB as C,r as d,c as p,aY as j,bW as v,bX as h}from"./index-D_cV0HX5.js";import{L as N}from"./label-CNlIda5F.js";const E=b,g=d.createContext({}),M=t=>{const e=f.c(9);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;e[2]!==s.name?(o={name:s.name},e[2]=s.name,e[3]=o):o=e[3];let n;e[4]!==s?(n=c.jsx(C,{...s}),e[4]=s,e[5]=n):n=e[5];let r;return e[6]!==o||e[7]!==n?(r=c.jsx(g.Provider,{value:o,children:n}),e[6]=o,e[7]=n,e[8]=r):r=e[8],r},x=()=>{const t=f.c(13),e=d.useContext(g),s=d.useContext($),{getFieldState:o}=v();let n;t[0]!==e.name?(n={name:e.name},t[0]=e.name,t[1]=n):n=t[1];const r=h(n);let a;t[2]!==e.name||t[3]!==r||t[4]!==o?(a=o(e.name,r),t[2]=e.name,t[3]=r,t[4]=o,t[5]=a):a=t[5];const l=a;if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=s,m=`${i}-form-item`,F=`${i}-form-item-description`,I=`${i}-form-item-message`;let u;return t[6]!==e.name||t[7]!==l||t[8]!==i||t[9]!==m||t[10]!==F||t[11]!==I?(u={id:i,name:e.name,formItemId:m,formDescriptionId:F,formMessageId:I,...l},t[6]=e.name,t[7]=l,t[8]=i,t[9]=m,t[10]=F,t[11]=I,t[12]=u):u=t[12],u},$=d.createContext({});function w(t){const e=f.c(13);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const n=d.useId();let r;e[3]!==n?(r={id:n},e[3]=n,e[4]=r):r=e[4];let a;e[5]!==s?(a=p("grid gap-2",s),e[5]=s,e[6]=a):a=e[6];let l;e[7]!==o||e[8]!==a?(l=c.jsx("div",{"data-slot":"form-item",className:a,...o}),e[7]=o,e[8]=a,e[9]=l):l=e[9];let i;return e[10]!==r||e[11]!==l?(i=c.jsx($.Provider,{value:r,children:l}),e[10]=r,e[11]=l,e[12]=i):i=e[12],i}function L(t){const e=f.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formItemId:r}=x(),a=!!n;let l;e[3]!==s?(l=p("text-foreground data-[error=true]:text-destructive",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==r||e[6]!==o||e[7]!==a||e[8]!==l?(i=c.jsx(N,{"data-slot":"form-label","data-error":a,className:l,htmlFor:r,...o}),e[5]=r,e[6]=o,e[7]=a,e[8]=l,e[9]=i):i=e[9],i}function P(t){const e=f.c(7);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];const{error:o,formItemId:n,formDescriptionId:r,formMessageId:a}=x(),l=o?`${r} ${a}`:`${r}`,i=!!o;let m;return e[2]!==n||e[3]!==s||e[4]!==l||e[5]!==i?(m=c.jsx(j,{"data-slot":"form-control",id:n,"aria-describedby":l,"aria-invalid":i,...s}),e[2]=n,e[3]=s,e[4]=l,e[5]=i,e[6]=m):m=e[6],m}function y(t){const e=f.c(9);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{formDescriptionId:n}=x();let r;e[3]!==s?(r=p("text-muted-foreground text-sm",s),e[3]=s,e[4]=r):r=e[4];let a;return e[5]!==n||e[6]!==o||e[7]!==r?(a=c.jsx("p",{"data-slot":"form-description",id:n,className:r,...o}),e[5]=n,e[6]=o,e[7]=r,e[8]=a):a=e[8],a}function R(t){const e=f.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formMessageId:r}=x(),a=n?String(n?.message??""):o.children;if(!a)return null;let l;e[3]!==s?(l=p("text-destructive text-sm",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==a||e[6]!==r||e[7]!==o||e[8]!==l?(i=c.jsx("p",{"data-slot":"form-message",id:r,className:l,...o,children:a}),e[5]=a,e[6]=r,e[7]=o,e[8]=l,e[9]=i):i=e[9],i}export{E as F,M as a,w as b,L as c,P as d,R as e,y as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as G,r as J,z as T,j as s,B as M,f as pe,s as ce,o as de,x as je,w as be,a as W,t as q,K as Z,b as me,v as ve,y as se,n as Ne,c as ye,aD as Se}from"./index-BAVpG5PI.js";import{P as Q}from"./index-QueWlMPI.js";import{C as Y,b as X,c as ee,a as te,d as ue,e as _e}from"./card-DtNfmWHu.js";import{I as oe}from"./input-DnP63xwW.js";import{L as B}from"./label-DKwfAK9s.js";import{c as Ce}from"./XCircle-DcrVc7Ai.js";import{i as fe}from"./X-woFr0RM9.js";import{u as V}from"./unwrap-tool-result-BYXdCQMg.js";import{S as we,u as ze,W as ie,i as De}from"./constants-D7Xua0Kh.js";import{S as Ae}from"./switch-CdXdPsLJ.js";import{u as Ee,a as le,D as Ie,c as Pe,S as ke,v as Oe,K as Te,P as Fe,d as Re,C as Le,s as Me,b as $e,e as qe}from"./collection-search-C8tjeasf.js";import{u as ge}from"./use-virtual-mcp-OtMHbTvm.js";import{b as Ge,P as Ke,a as Ue}from"./popover-CKtIWvNd.js";import{S as He}from"./skeleton-bPBtKDik.js";import{T as Be}from"./agent-icon-YPHh6Pzl.js";import{s as Je}from"./Plus-Dn-1QbCZ.js";import{a as xe}from"./Users03-S9PW2exM.js";import{I as ae}from"./integration-icon-DkvnCAKV.js";import{u as Qe,c as Ve}from"./use-organization-settings-_mA2wnSC.js";import"./use-mobile-DjZnjqlA.js";import"./SearchMd-b9tCf66d.js";import"./use-collections-DFXTxuSg.js";import"./AlertCircle-CbtT--Ol.js";import"./Tool01-C58Xtung.js";import"./ArrowNarrowLeft-DWZkNaNO.js";import"./ZapSquare-Cwy3VSGD.js";import"./CheckCircle-3hn9ZLNf.js";import"./ChevronDown-DdYtF_pN.js";import"./ChevronRight-e4qgFMIt.js";import"./ChevronUp-CGzEbpO7.js";import"./Container-gkiuXluH.js";import"./Star01-LL8IcJik.js";import"./Palette-ahL5lOBN.js";import"./LinkExternal01-BunxZmQL.js";import"./Lock01-DvsN0mFQ.js";import"./Sun-CEKlSeb7.js";import"./Play-Dz2HPAmd.js";import"./Settings02-Dk076iZH.js";import"./Trash01-BvF1rPkz.js";import"./User01-Cjs4dHzU.js";import"./Zap-C_TCIuRq.js";function We(t){const e=G.c(28),{value:i,onChange:o,name:p,disabled:a}=t,n=J.useRef(null);let C;e[0]!==o?(C=b=>{const w=b.target.files?.[0];if(w){if(w.size>2097152){T.error("Image must be smaller than 2MB");return}const m=new FileReader;m.onerror=()=>{const S=m.error;console.error("FileReader error:",S),T.error(S?.message||"Failed to read image file. Please try again."),n.current&&(n.current.value="")},m.onloadend=()=>{m.readyState===FileReader.DONE&&m.result&&o(m.result),n.current&&(n.current.value="")},m.readAsDataURL(w)}},e[0]=o,e[1]=C):C=e[1];const E=C;let N;e[2]===Symbol.for("react.memo_cache_sentinel")?(N=()=>{n.current?.click()},e[2]=N):N=e[2];const r=N;let f;e[3]!==o?(f=b=>{b.stopPropagation(),o("")},e[3]=o,e[4]=f):f=e[4];const g=f;let d;e[5]!==a||e[6]!==E?(d=s.jsx("input",{type:"file",ref:n,className:"hidden",accept:"image/*",onChange:E,disabled:a}),e[5]=a,e[6]=E,e[7]=d):d=e[7];let c;e[8]!==a||e[9]!==g||e[10]!==p||e[11]!==i?(c=i?s.jsxs("div",{className:"relative group",children:[s.jsx("div",{className:"h-20 w-20 rounded-lg border border-border bg-muted/20 overflow-hidden",children:s.jsx("img",{src:i,alt:p||"Logo",className:"w-full h-full object-cover"})}),s.jsx("button",{type:"button",onClick:g,disabled:a,className:"absolute -top-2 -right-2 h-6 w-6 rounded-full bg-destructive text-destructive-foreground opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:s.jsx(fe,{className:"h-3 w-3"})})]}):s.jsxs("button",{type:"button",onClick:r,disabled:a,className:"h-20 w-20 rounded-lg border-2 border-dashed border-border hover:border-foreground/50 hover:bg-accent/50 transition-colors flex flex-col items-center justify-center gap-1 text-muted-foreground hover:text-foreground disabled:opacity-50 disabled:pointer-events-none",children:[s.jsx(Ce,{className:"h-5 w-5"}),s.jsx("span",{className:"text-xs",children:"Upload"})]}),e[8]=a,e[9]=g,e[10]=p,e[11]=i,e[12]=c):c=e[12];const z=i?"Change Logo":"Upload Logo";let D;e[13]!==a||e[14]!==z?(D=s.jsx(M,{type:"button",variant:"outline",size:"sm",onClick:r,disabled:a,className:"mb-2",children:z}),e[13]=a,e[14]=z,e[15]=D):D=e[15];let x;e[16]!==a||e[17]!==g||e[18]!==i?(x=i&&s.jsx(M,{type:"button",variant:"ghost",size:"sm",onClick:g,disabled:a,className:"ml-2",children:"Remove"}),e[16]=a,e[17]=g,e[18]=i,e[19]=x):x=e[19];let j;e[20]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Recommended: Square image, at least 200x200px. Max 2MB."}),e[20]=j):j=e[20];let h;e[21]!==D||e[22]!==x?(h=s.jsxs("div",{className:"flex-1",children:[D,x,j]}),e[21]=D,e[22]=x,e[23]=h):h=e[23];let y;return e[24]!==h||e[25]!==d||e[26]!==c?(y=s.jsxs("div",{className:"flex items-start gap-4",children:[d,c,h]}),e[24]=h,e[25]=d,e[26]=c,e[27]=y):y=e[27],y}const Ze=ve({name:se().min(1,"Name is required").max(255,"Name is too long"),slug:se().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens"),logo:se().optional()});function Ye(){const t=pe(),{org:e}=ce(),i=de(),[o,p]=J.useState(!1),a=je({resolver:be(Ze),values:{name:e.name??"",slug:e.slug??"",logo:e.logo??""}}),n=W({mutationFn:async r=>{const f={name:r.name,slug:r.slug};r.logo&&(f.logo=r.logo);const g=await me.organization.update({organizationId:e.id,data:f});if(g?.error)throw new Error(g.error.message||"Failed to update organization");return g},onSuccess:r=>{q("organization_settings_updated",{organization_id:e.id,fields:Object.keys(a.formState.dirtyFields)}),i.invalidateQueries({queryKey:Z.organizations()}),i.invalidateQueries({queryKey:Z.activeOrganization(e.slug)}),T.success("Organization settings updated successfully"),r?.data?.slug&&r.data.slug!==e.slug&&t({to:"/$org/settings/general",params:{org:r.data.slug}})},onError:r=>{q("organization_settings_update_failed",{organization_id:e.id,fields:Object.keys(a.formState.dirtyFields),error:r instanceof Error?r.message:String(r)}),T.error(r instanceof Error?r.message:"Failed to update organization")},onSettled:()=>{p(!1)}}),C=r=>{p(!0),n.mutate(r)},E=a.formState.isDirty,N=a.formState.errors;return s.jsx("form",{onSubmit:a.handleSubmit(C),className:"flex flex-col gap-6",children:s.jsxs(Y,{className:"p-6",children:[s.jsx(X,{className:"p-0",children:s.jsx(ee,{className:"text-sm",children:"Overview"})}),s.jsxs(te,{className:"flex flex-col gap-6 p-0",children:[s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(B,{className:"text-xs text-muted-foreground",children:"Logo"}),s.jsx(We,{value:a.watch("logo"),onChange:r=>a.setValue("logo",r??"",{shouldDirty:!0}),name:a.watch("name"),disabled:o}),N.logo&&s.jsx("p",{className:"text-xs text-destructive",children:N.logo.message})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-5",children:[s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(B,{htmlFor:"org-name",className:"text-xs text-muted-foreground",children:"Organization name"}),s.jsx(oe,{id:"org-name",...a.register("name"),placeholder:"Organization name",disabled:o}),N.name&&s.jsx("p",{className:"text-xs text-destructive",children:N.name.message})]}),s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(B,{htmlFor:"org-slug",className:"text-xs text-muted-foreground",children:"Slug"}),s.jsx(oe,{id:"org-slug",...a.register("slug"),placeholder:"my-organization",disabled:o,onChange:r=>{const f=r.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");a.setValue("slug",f,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0})}}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Only lowercase letters, numbers, and hyphens."}),N.slug&&s.jsx("p",{className:"text-xs text-destructive",children:N.slug.message})]})]})]}),E&&s.jsxs(ue,{className:"p-0 pt-2 gap-2",children:[s.jsx(M,{type:"submit",disabled:o,children:o?"Saving…":"Save"}),s.jsx(M,{type:"button",variant:"outline",onClick:()=>a.reset(),disabled:o,children:"Cancel"})]})]})})}function Xe(){const t=G.c(62),{org:e}=ce(),{data:i}=me.useSession(),o=de();let p;t[0]!==e.id?(p={connectionId:we,orgId:e.id},t[0]=e.id,t[1]=p):p=t[1];const a=ze(p);let n;t[2]!==e.id?(n=Z.organizationDomain(e.id),t[2]=e.id,t[3]=n):n=t[3];let C;t[4]!==a?(C=async()=>{const l=await a.callTool({name:"ORGANIZATION_DOMAIN_GET",arguments:{}});return V(l)},t[4]=a,t[5]=C):C=t[5];let E;t[6]!==n||t[7]!==C?(E={queryKey:n,queryFn:C},t[6]=n,t[7]=C,t[8]=E):E=t[8];const{data:N,isPending:r}=Ne(E),f=i?.user?.email??"";let g;t[9]!==f?(g=f.split("@")[1]?.toLowerCase()??"",t[9]=f,t[10]=g):g=t[10];const d=g,c=N?.domain??null,z=N?.autoJoinEnabled??!1,D=d&&d!==c;let x;t[11]!==e.id||t[12]!==o?(x=()=>o.invalidateQueries({queryKey:Z.organizationDomain(e.id)}),t[11]=e.id,t[12]=o,t[13]=x):x=t[13];const j=x;let h;t[14]!==a||t[15]!==d?(h=async()=>{const l=await a.callTool({name:"ORGANIZATION_DOMAIN_SET",arguments:{domain:d,autoJoinEnabled:!1}});return V(l)},t[14]=a,t[15]=d,t[16]=h):h=t[16];let y;t[17]!==j||t[18]!==e.id||t[19]!==d?(y=()=>{q("organization_domain_claimed",{organization_id:e.id,email_domain:d}),j(),T.success("Domain claimed")},t[17]=j,t[18]=e.id,t[19]=d,t[20]=y):y=t[20];let b;t[21]!==e.id||t[22]!==d?(b=l=>{q("organization_domain_claim_failed",{organization_id:e.id,email_domain:d,error:l instanceof Error?l.message:String(l)}),T.error(l instanceof Error?l.message:"Failed to claim domain")},t[21]=e.id,t[22]=d,t[23]=b):b=t[23];let w;t[24]!==h||t[25]!==y||t[26]!==b?(w={mutationFn:h,onSuccess:y,onError:b},t[24]=h,t[25]=y,t[26]=b,t[27]=w):w=t[27];const m=W(w);let S;t[28]!==a?(S=async()=>{const l=await a.callTool({name:"ORGANIZATION_DOMAIN_CLEAR",arguments:{}});return V(l)},t[28]=a,t[29]=S):S=t[29];let v;t[30]!==c||t[31]!==j||t[32]!==e.id?(v=()=>{q("organization_domain_cleared",{organization_id:e.id,email_domain:c}),j(),T.success("Domain removed")},t[30]=c,t[31]=j,t[32]=e.id,t[33]=v):v=t[33];let _;t[34]!==c||t[35]!==e.id?(_=l=>{q("organization_domain_clear_failed",{organization_id:e.id,email_domain:c,error:l instanceof Error?l.message:String(l)}),T.error(l instanceof Error?l.message:"Failed to remove domain")},t[34]=c,t[35]=e.id,t[36]=_):_=t[36];let k;t[37]!==S||t[38]!==v||t[39]!==_?(k={mutationFn:S,onSuccess:v,onError:_},t[37]=S,t[38]=v,t[39]=_,t[40]=k):k=t[40];const P=W(k);let A;t[41]!==a||t[42]!==c||t[43]!==e.id?(A=async l=>{if(!c)return;q("organization_auto_join_toggled",{organization_id:e.id,enabled:l});const L=await a.callTool({name:"ORGANIZATION_DOMAIN_UPDATE",arguments:{autoJoinEnabled:l}});return V(L)},t[41]=a,t[42]=c,t[43]=e.id,t[44]=A):A=t[44];let I;t[45]!==j?(I=()=>{j(),T.success("Auto-join setting updated")},t[45]=j,t[46]=I):I=t[46];let O;t[47]!==e.id?(O=l=>{q("organization_auto_join_toggle_failed",{organization_id:e.id,error:l instanceof Error?l.message:String(l)}),T.error(l instanceof Error?l.message:"Failed to update auto-join")},t[47]=e.id,t[48]=O):O=t[48];let u;t[49]!==A||t[50]!==I||t[51]!==O?(u={mutationFn:A,onSuccess:I,onError:O},t[49]=A,t[50]=I,t[51]=O,t[52]=u):u=t[52];const F=W(u);if(r)return null;let R;t[53]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsxs(X,{className:"p-0",children:[s.jsx(ee,{className:"text-sm",children:"Email Domain"}),s.jsx(_e,{className:"text-xs",children:"Claim your company's email domain so new users with matching emails can automatically join this organization."})]}),t[53]=R):R=t[53];let $;return t[54]!==z||t[55]!==D||t[56]!==P||t[57]!==c||t[58]!==m||t[59]!==F||t[60]!==d?($=s.jsxs(Y,{className:"p-6",children:[R,s.jsx(te,{className:"flex flex-col gap-4 p-0 pt-4",children:c?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx(B,{className:"text-xs text-muted-foreground",children:"Claimed domain"}),s.jsx("p",{className:"text-sm font-medium",children:c})]}),s.jsx(M,{variant:"outline",size:"sm",onClick:()=>P.mutate(),disabled:P.isPending,children:"Remove"})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx(B,{className:"text-xs",children:"Auto-join"}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Users with @",c," emails will automatically join this organization on signup."]})]}),s.jsx(Ae,{checked:z,onCheckedChange:l=>F.mutate(l),disabled:F.isPending})]})]}):D?s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx(B,{className:"text-xs text-muted-foreground",children:"Your domain"}),s.jsx("p",{className:"text-sm font-medium",children:d})]}),s.jsx(M,{size:"sm",onClick:()=>m.mutate(),disabled:m.isPending,children:m.isPending?"Claiming...":"Claim Domain"})]}):s.jsx("p",{className:"text-xs text-muted-foreground",children:"No corporate email domain detected."})})]}),t[54]=z,t[55]=D,t[56]=P,t[57]=c,t[58]=m,t[59]=F,t[60]=d,t[61]=$):$=t[61],$}const re=["site-editor","site-diagnostics","ai-image","ai-research"],ne=8;function et(t,e,i){const o=e.find(a=>a.id===t);if(o)return{id:o.id,title:o.title,icon:o.icon,kind:"template"};const p=i.find(a=>a.id===t);return p?{id:t,title:p.title,icon:p.icon??null,kind:"custom"}:{id:t,title:t,icon:null,kind:"missing"}}function tt(t){const e=G.c(39),{agent:i,onRemove:o}=t;let p;e[0]!==i.id?(p={id:i.id},e[0]=i.id,e[1]=p):p=e[1];const{attributes:a,listeners:n,setNodeRef:C,transform:E,transition:N,isDragging:r}=Re(p);let f;e[2]!==E?(f=Le.Transform.toString(E),e[2]=E,e[3]=f):f=e[3];const g=r?.5:void 0,d=r?100:void 0;let c;e[4]!==f||e[5]!==g||e[6]!==d||e[7]!==N?(c={transform:f,transition:N,opacity:g,zIndex:d},e[4]=f,e[5]=g,e[6]=d,e[7]=N,e[8]=c):c=e[8];const z=c,D=r&&"shadow-lg";let x;e[9]!==D?(x=ye("flex items-center gap-3 px-3 py-2 rounded-lg border border-border bg-background",D),e[9]=D,e[10]=x):x=e[10];const j=`Drag to reorder ${i.title}`;let h;e[11]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(Be,{size:14}),e[11]=h):h=e[11];let y;e[12]!==a||e[13]!==n||e[14]!==j?(y=s.jsx("button",{type:"button",...a,...n,className:"text-muted-foreground hover:text-foreground cursor-grab active:cursor-grabbing","aria-label":j,children:h}),e[12]=a,e[13]=n,e[14]=j,e[15]=y):y=e[15];let b;e[16]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(xe,{size:14}),e[16]=b):b=e[16];let w;e[17]!==i.icon||e[18]!==i.title?(w=s.jsx(ae,{icon:i.icon,name:i.title,size:"xs",fallbackIcon:b}),e[17]=i.icon,e[18]=i.title,e[19]=w):w=e[19];let m;e[20]!==i.title?(m=s.jsx("span",{className:"text-sm text-foreground truncate",children:i.title}),e[20]=i.title,e[21]=m):m=e[21];const S=i.kind==="template"?"Template":i.kind==="custom"?"Custom agent":"Unavailable";let v;e[22]!==S?(v=s.jsx("span",{className:"text-xs text-muted-foreground",children:S}),e[22]=S,e[23]=v):v=e[23];let _;e[24]!==m||e[25]!==v?(_=s.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[m,v]}),e[24]=m,e[25]=v,e[26]=_):_=e[26];const k=`Remove ${i.title}`;let P;e[27]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx(fe,{size:14}),e[27]=P):P=e[27];let A;e[28]!==o||e[29]!==k?(A=s.jsx("button",{type:"button",onClick:o,className:"text-muted-foreground hover:text-foreground p-1 rounded","aria-label":k,children:P}),e[28]=o,e[29]=k,e[30]=A):A=e[30];let I;return e[31]!==C||e[32]!==z||e[33]!==y||e[34]!==w||e[35]!==_||e[36]!==A||e[37]!==x?(I=s.jsxs("div",{ref:C,style:z,className:x,children:[y,w,_,A]}),e[31]=C,e[32]=z,e[33]=y,e[34]=w,e[35]=_,e[36]=A,e[37]=x,e[38]=I):I=e[38],I}function st(t){const e=G.c(48),{selectedIds:i,onAdd:o}=t,[p,a]=J.useState(!1),[n,C]=J.useState(""),E=ge();let N;e[0]!==i?(N=new Set(i),e[0]=i,e[1]=N):N=e[1];const r=N;let f,g,d,c,z,D,x,j,h,y,b,w,m;if(e[2]!==E||e[3]!==o||e[4]!==p||e[5]!==n||e[6]!==r){const P=n.toLowerCase();c=ie.filter(u=>!r.has(u.id)&&(!n||u.title.toLowerCase().includes(P)));let A;e[20]!==r?(A=u=>u.id!==null&&!De(u.id)&&!r.has(u.id),e[20]=r,e[21]=A):A=e[21],d=E.filter(A).filter(u=>!n||u.title.toLowerCase().includes(P));let I;e[22]!==o?(I=u=>{o(u),a(!1),C("")},e[22]=o,e[23]=I):I=e[23];const O=I;g=Ge,w=p,m=a,e[24]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx(Ke,{asChild:!0,children:s.jsxs(M,{type:"button",variant:"outline",size:"sm",children:[s.jsx(Je,{size:14}),"Add agent"]})}),e[24]=z):z=e[24],f=Ue,h="w-[320px] p-0 overflow-hidden",y="start",e[25]!==n?(b=s.jsx(qe,{value:n,onChange:C,placeholder:"Search agents..."}),e[25]=n,e[26]=b):b=e[26],D="max-h-[320px] overflow-y-auto p-2 flex flex-col gap-3",x=c.length>0&&s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground px-1",children:"Templates"}),c.map(u=>s.jsxs("button",{type:"button",onClick:()=>O(u.id),className:"flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-accent text-left",children:[s.jsx(ae,{icon:u.icon,name:u.title,size:"xs"}),s.jsx("span",{className:"text-sm truncate",children:u.title})]},u.id))]}),j=d.length>0&&s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground px-1",children:"Custom agents"}),d.map(u=>s.jsxs("button",{type:"button",onClick:()=>O(u.id),className:"flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-accent text-left",children:[s.jsx(ae,{icon:u.icon,name:u.title,size:"xs",fallbackIcon:s.jsx(xe,{size:14})}),s.jsx("span",{className:"text-sm truncate",children:u.title})]},u.id))]}),e[2]=E,e[3]=o,e[4]=p,e[5]=n,e[6]=r,e[7]=f,e[8]=g,e[9]=d,e[10]=c,e[11]=z,e[12]=D,e[13]=x,e[14]=j,e[15]=h,e[16]=y,e[17]=b,e[18]=w,e[19]=m}else f=e[7],g=e[8],d=e[9],c=e[10],z=e[11],D=e[12],x=e[13],j=e[14],h=e[15],y=e[16],b=e[17],w=e[18],m=e[19];let S;e[27]!==d||e[28]!==c.length||e[29]!==n?(S=c.length===0&&d.length===0&&s.jsx("div",{className:"text-xs text-muted-foreground text-center py-6",children:n?"No agents found":"All agents are already added"}),e[27]=d,e[28]=c.length,e[29]=n,e[30]=S):S=e[30];let v;e[31]!==S||e[32]!==D||e[33]!==x||e[34]!==j?(v=s.jsxs("div",{className:D,children:[x,j,S]}),e[31]=S,e[32]=D,e[33]=x,e[34]=j,e[35]=v):v=e[35];let _;e[36]!==f||e[37]!==v||e[38]!==h||e[39]!==y||e[40]!==b?(_=s.jsxs(f,{className:h,align:y,children:[b,v]}),e[36]=f,e[37]=v,e[38]=h,e[39]=y,e[40]=b,e[41]=_):_=e[41];let k;return e[42]!==g||e[43]!==z||e[44]!==_||e[45]!==w||e[46]!==m?(k=s.jsxs(g,{open:w,onOpenChange:m,children:[z,_]}),e[42]=g,e[43]=z,e[44]=_,e[45]=w,e[46]=m,e[47]=k):k=e[47],k}function nt(){const t=G.c(60),e=Qe(),i=ge(),o=Ve();let p;t[0]!==e?.ids?(p=e?.ids??[...re],t[0]=e?.ids,t[1]=p):p=t[1];const a=p,[n,C]=J.useState(a);let E;t[2]!==n||t[3]!==a?(E=n.length!==a.length||n.some((l,L)=>l!==a[L]),t[2]=n,t[3]=a,t[4]=E):E=t[4];const N=E;let r;t[5]===Symbol.for("react.memo_cache_sentinel")?(r={activationConstraint:{distance:5}},t[5]=r):r=t[5];let f;t[6]===Symbol.for("react.memo_cache_sentinel")?(f={coordinateGetter:Me},t[6]=f):f=t[6];const g=Ee(le(Fe,r),le(Te,f));let d;t[7]!==n?(d=l=>{const{active:L,over:K}=l;if(!K||L.id===K.id)return;const H=n.indexOf(L.id),U=n.indexOf(K.id);H===-1||U===-1||C($e([...n],H,U))},t[7]=n,t[8]=d):d=t[8];const c=d;let z;t[9]!==n?(z=l=>{n.includes(l)||C([...n,l])},t[9]=n,t[10]=z):z=t[10];const D=z;let x;t[11]!==n?(x=l=>{C(n.filter(L=>L!==l))},t[11]=n,t[12]=x):x=t[12];const j=x;let h;t[13]===Symbol.for("react.memo_cache_sentinel")?(h=()=>{C([...re])},t[13]=h):h=t[13];const y=h;let b;t[14]!==n||t[15]!==o?(b=()=>{o.mutate({ids:n},{onSuccess:()=>{q("default_home_agents_updated",{count:n.length,template_count:n.filter(it).length}),T.success("Default home agents updated")},onError:at})},t[14]=n,t[15]=o,t[16]=b):b=t[16];const w=b;let m,S,v,_,k,P,A;if(t[17]!==i||t[18]!==n||t[19]!==c||t[20]!==j||t[21]!==g||t[22]!==o.isPending){let l;t[30]!==i?(l=U=>et(U,ie,i),t[30]=i,t[31]=l):l=t[31];const L=n.map(l);v=Math.max(0,n.length-ne),S=Y,k="p-6";let K;t[32]===Symbol.for("react.memo_cache_sentinel")?(K=s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx(ee,{className:"text-sm",children:"Default home agents"}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Choose which agents appear on the home view for everyone in this organization. Drag to reorder. Up to ",ne," tiles render on the home view."]})]}),t[32]=K):K=t[32];let H;t[33]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx(Se,{size:14}),t[33]=H):H=t[33],t[34]!==o.isPending?(P=s.jsxs(X,{className:"p-0 flex flex-row items-start justify-between gap-3",children:[K,s.jsxs(M,{type:"button",variant:"ghost",size:"sm",onClick:y,disabled:o.isPending,children:[H,"Reset defaults"]})]}),t[34]=o.isPending,t[35]=P):P=t[35],m=te,A="p-0 flex flex-col gap-3",_=L.length===0?s.jsx("div",{className:"rounded-lg border border-dashed border-border p-6 text-center text-xs text-muted-foreground",children:'No agents selected. The home view will only show "Create agent".'}):s.jsx(Ie,{sensors:g,collisionDetection:Pe,onDragEnd:c,children:s.jsx(ke,{items:n,strategy:Oe,children:s.jsx("div",{className:"flex flex-col gap-1.5",children:L.map((U,he)=>s.jsxs("div",{className:"flex flex-col gap-1.5",children:[he===ne&&s.jsxs("div",{className:"flex items-center gap-2 px-1 py-1 text-xs text-muted-foreground",children:[s.jsx("div",{className:"flex-1 h-px bg-border"}),s.jsx("span",{children:"Below this line is hidden on the home view"}),s.jsx("div",{className:"flex-1 h-px bg-border"})]}),s.jsx(tt,{agent:U,onRemove:()=>j(U.id)})]},U.id))})})}),t[17]=i,t[18]=n,t[19]=c,t[20]=j,t[21]=g,t[22]=o.isPending,t[23]=m,t[24]=S,t[25]=v,t[26]=_,t[27]=k,t[28]=P,t[29]=A}else m=t[23],S=t[24],v=t[25],_=t[26],k=t[27],P=t[28],A=t[29];let I;t[36]!==n||t[37]!==D?(I=s.jsx(st,{selectedIds:n,onAdd:D}),t[36]=n,t[37]=D,t[38]=I):I=t[38];let O;t[39]!==v?(O=v>0&&s.jsxs("span",{className:"text-xs text-muted-foreground",children:[v," agent",v===1?"":"s"," won't fit on the home view"]}),t[39]=v,t[40]=O):O=t[40];let u;t[41]!==I||t[42]!==O?(u=s.jsxs("div",{className:"flex items-center justify-between",children:[I,O]}),t[41]=I,t[42]=O,t[43]=u):u=t[43];let F;t[44]!==m||t[45]!==_||t[46]!==u||t[47]!==A?(F=s.jsxs(m,{className:A,children:[_,u]}),t[44]=m,t[45]=_,t[46]=u,t[47]=A,t[48]=F):F=t[48];let R;t[49]!==w||t[50]!==a||t[51]!==N||t[52]!==o.isPending?(R=N&&s.jsxs(ue,{className:"p-0 pt-2 gap-2",children:[s.jsx(M,{type:"button",onClick:w,disabled:o.isPending,children:o.isPending?"Saving…":"Save"}),s.jsx(M,{type:"button",variant:"outline",onClick:()=>C(a),disabled:o.isPending,children:"Cancel"})]}),t[49]=w,t[50]=a,t[51]=N,t[52]=o.isPending,t[53]=R):R=t[53];let $;return t[54]!==S||t[55]!==k||t[56]!==P||t[57]!==F||t[58]!==R?($=s.jsxs(S,{className:k,children:[P,F,R]}),t[54]=S,t[55]=k,t[56]=P,t[57]=F,t[58]=R,t[59]=$):$=t[59],$}function at(t){T.error(t instanceof Error?t.message:"Failed to update default home agents")}function it(t){return ie.some(e=>e.id===t)}function ot(){const t=G.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(X,{className:"p-0",children:s.jsx(ee,{className:"text-sm",children:"Default home agents"})}),t[0]=e):e=t[0];let i;return t[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs(Y,{className:"p-6",children:[e,s.jsx(te,{className:"p-0 flex flex-col gap-2",children:Array.from({length:4}).map(lt)})]}),t[1]=i):i=t[1],i}function lt(t,e){return s.jsx(He,{className:"h-12 w-full rounded-lg"},e)}function rt(){const t=G.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(J.Suspense,{fallback:s.jsx(ot,{}),children:s.jsx(nt,{})}),t[0]=e):e=t[0],e}function ct(){const t=G.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Q,{children:s.jsx(Q.Content,{children:s.jsx(Q.Body,{children:s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsx(Q.Title,{children:"Organization"}),s.jsx(Ye,{}),s.jsx(Xe,{}),s.jsx(rt,{})]})})})}),t[0]=e):e=t[0],e}function Zt(){const t=G.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(ct,{}),t[0]=e):e=t[0],e}export{Zt as default};
|
|
1
|
+
import{e as G,r as J,z as T,j as s,B as M,f as pe,s as ce,o as de,x as je,w as be,a as W,t as q,K as Z,b as me,v as ve,y as se,n as Ne,c as ye,aD as Se}from"./index-D_cV0HX5.js";import{P as Q}from"./index-CAASFRGs.js";import{C as Y,b as X,c as ee,a as te,d as ue,e as _e}from"./card-EK1eVPf2.js";import{I as oe}from"./input-Cv-Gy5WN.js";import{L as B}from"./label-CNlIda5F.js";import{c as Ce}from"./XCircle-DIbQNdIy.js";import{i as fe}from"./X-DU4RFoiA.js";import{u as V}from"./unwrap-tool-result-BYXdCQMg.js";import{S as we,u as ze,W as ie,i as De}from"./constants-B9qhU0c2.js";import{S as Ae}from"./switch-Bb611OnM.js";import{u as Ee,a as le,D as Ie,c as Pe,S as ke,v as Oe,K as Te,P as Fe,d as Re,C as Le,s as Me,b as $e,e as qe}from"./collection-search-CAiOUXIV.js";import{u as ge}from"./use-virtual-mcp-CCFi2lST.js";import{b as Ge,P as Ke,a as Ue}from"./popover-BYKaDh8r.js";import{S as He}from"./skeleton-Chpxgw5z.js";import{T as Be}from"./agent-icon-Dmd713yi.js";import{s as Je}from"./Plus-CI2hG7eT.js";import{a as xe}from"./Users03-CEDkUueK.js";import{I as ae}from"./integration-icon-3xGkh2yb.js";import{u as Qe,c as Ve}from"./use-organization-settings-AIx1cKKY.js";import"./use-mobile-BukhR5xc.js";import"./SearchMd-CJUx5L0X.js";import"./use-collections-VlX8lbt0.js";import"./AlertCircle-B6lKc5r3.js";import"./Tool01-C4G0_dmI.js";import"./ArrowNarrowLeft-DKpjDF0O.js";import"./ZapSquare-Btv7LDve.js";import"./CheckCircle-Cu9gxMoh.js";import"./ChevronDown-CGYRNnVK.js";import"./ChevronRight-Cs_mq2Gb.js";import"./ChevronUp-CNHg8Tvy.js";import"./Container-CTt4BzRP.js";import"./Star01-CvBfAtRc.js";import"./Palette-BLl9a_yE.js";import"./LinkExternal01-B8RP9b4T.js";import"./Lock01-DGN1sRwj.js";import"./Sun-DDl1TbCr.js";import"./Play-YaIPTi2N.js";import"./Settings02-CzftfR-P.js";import"./Trash01-DoGU3WEE.js";import"./User01-Cs--OmtK.js";import"./Zap-D6T_WrPQ.js";function We(t){const e=G.c(28),{value:i,onChange:o,name:p,disabled:a}=t,n=J.useRef(null);let C;e[0]!==o?(C=b=>{const w=b.target.files?.[0];if(w){if(w.size>2097152){T.error("Image must be smaller than 2MB");return}const m=new FileReader;m.onerror=()=>{const S=m.error;console.error("FileReader error:",S),T.error(S?.message||"Failed to read image file. Please try again."),n.current&&(n.current.value="")},m.onloadend=()=>{m.readyState===FileReader.DONE&&m.result&&o(m.result),n.current&&(n.current.value="")},m.readAsDataURL(w)}},e[0]=o,e[1]=C):C=e[1];const E=C;let N;e[2]===Symbol.for("react.memo_cache_sentinel")?(N=()=>{n.current?.click()},e[2]=N):N=e[2];const r=N;let f;e[3]!==o?(f=b=>{b.stopPropagation(),o("")},e[3]=o,e[4]=f):f=e[4];const g=f;let d;e[5]!==a||e[6]!==E?(d=s.jsx("input",{type:"file",ref:n,className:"hidden",accept:"image/*",onChange:E,disabled:a}),e[5]=a,e[6]=E,e[7]=d):d=e[7];let c;e[8]!==a||e[9]!==g||e[10]!==p||e[11]!==i?(c=i?s.jsxs("div",{className:"relative group",children:[s.jsx("div",{className:"h-20 w-20 rounded-lg border border-border bg-muted/20 overflow-hidden",children:s.jsx("img",{src:i,alt:p||"Logo",className:"w-full h-full object-cover"})}),s.jsx("button",{type:"button",onClick:g,disabled:a,className:"absolute -top-2 -right-2 h-6 w-6 rounded-full bg-destructive text-destructive-foreground opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:s.jsx(fe,{className:"h-3 w-3"})})]}):s.jsxs("button",{type:"button",onClick:r,disabled:a,className:"h-20 w-20 rounded-lg border-2 border-dashed border-border hover:border-foreground/50 hover:bg-accent/50 transition-colors flex flex-col items-center justify-center gap-1 text-muted-foreground hover:text-foreground disabled:opacity-50 disabled:pointer-events-none",children:[s.jsx(Ce,{className:"h-5 w-5"}),s.jsx("span",{className:"text-xs",children:"Upload"})]}),e[8]=a,e[9]=g,e[10]=p,e[11]=i,e[12]=c):c=e[12];const z=i?"Change Logo":"Upload Logo";let D;e[13]!==a||e[14]!==z?(D=s.jsx(M,{type:"button",variant:"outline",size:"sm",onClick:r,disabled:a,className:"mb-2",children:z}),e[13]=a,e[14]=z,e[15]=D):D=e[15];let x;e[16]!==a||e[17]!==g||e[18]!==i?(x=i&&s.jsx(M,{type:"button",variant:"ghost",size:"sm",onClick:g,disabled:a,className:"ml-2",children:"Remove"}),e[16]=a,e[17]=g,e[18]=i,e[19]=x):x=e[19];let j;e[20]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Recommended: Square image, at least 200x200px. Max 2MB."}),e[20]=j):j=e[20];let h;e[21]!==D||e[22]!==x?(h=s.jsxs("div",{className:"flex-1",children:[D,x,j]}),e[21]=D,e[22]=x,e[23]=h):h=e[23];let y;return e[24]!==h||e[25]!==d||e[26]!==c?(y=s.jsxs("div",{className:"flex items-start gap-4",children:[d,c,h]}),e[24]=h,e[25]=d,e[26]=c,e[27]=y):y=e[27],y}const Ze=ve({name:se().min(1,"Name is required").max(255,"Name is too long"),slug:se().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens"),logo:se().optional()});function Ye(){const t=pe(),{org:e}=ce(),i=de(),[o,p]=J.useState(!1),a=je({resolver:be(Ze),values:{name:e.name??"",slug:e.slug??"",logo:e.logo??""}}),n=W({mutationFn:async r=>{const f={name:r.name,slug:r.slug};r.logo&&(f.logo=r.logo);const g=await me.organization.update({organizationId:e.id,data:f});if(g?.error)throw new Error(g.error.message||"Failed to update organization");return g},onSuccess:r=>{q("organization_settings_updated",{organization_id:e.id,fields:Object.keys(a.formState.dirtyFields)}),i.invalidateQueries({queryKey:Z.organizations()}),i.invalidateQueries({queryKey:Z.activeOrganization(e.slug)}),T.success("Organization settings updated successfully"),r?.data?.slug&&r.data.slug!==e.slug&&t({to:"/$org/settings/general",params:{org:r.data.slug}})},onError:r=>{q("organization_settings_update_failed",{organization_id:e.id,fields:Object.keys(a.formState.dirtyFields),error:r instanceof Error?r.message:String(r)}),T.error(r instanceof Error?r.message:"Failed to update organization")},onSettled:()=>{p(!1)}}),C=r=>{p(!0),n.mutate(r)},E=a.formState.isDirty,N=a.formState.errors;return s.jsx("form",{onSubmit:a.handleSubmit(C),className:"flex flex-col gap-6",children:s.jsxs(Y,{className:"p-6",children:[s.jsx(X,{className:"p-0",children:s.jsx(ee,{className:"text-sm",children:"Overview"})}),s.jsxs(te,{className:"flex flex-col gap-6 p-0",children:[s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(B,{className:"text-xs text-muted-foreground",children:"Logo"}),s.jsx(We,{value:a.watch("logo"),onChange:r=>a.setValue("logo",r??"",{shouldDirty:!0}),name:a.watch("name"),disabled:o}),N.logo&&s.jsx("p",{className:"text-xs text-destructive",children:N.logo.message})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-5",children:[s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(B,{htmlFor:"org-name",className:"text-xs text-muted-foreground",children:"Organization name"}),s.jsx(oe,{id:"org-name",...a.register("name"),placeholder:"Organization name",disabled:o}),N.name&&s.jsx("p",{className:"text-xs text-destructive",children:N.name.message})]}),s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(B,{htmlFor:"org-slug",className:"text-xs text-muted-foreground",children:"Slug"}),s.jsx(oe,{id:"org-slug",...a.register("slug"),placeholder:"my-organization",disabled:o,onChange:r=>{const f=r.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");a.setValue("slug",f,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0})}}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Only lowercase letters, numbers, and hyphens."}),N.slug&&s.jsx("p",{className:"text-xs text-destructive",children:N.slug.message})]})]})]}),E&&s.jsxs(ue,{className:"p-0 pt-2 gap-2",children:[s.jsx(M,{type:"submit",disabled:o,children:o?"Saving…":"Save"}),s.jsx(M,{type:"button",variant:"outline",onClick:()=>a.reset(),disabled:o,children:"Cancel"})]})]})})}function Xe(){const t=G.c(62),{org:e}=ce(),{data:i}=me.useSession(),o=de();let p;t[0]!==e.id?(p={connectionId:we,orgId:e.id},t[0]=e.id,t[1]=p):p=t[1];const a=ze(p);let n;t[2]!==e.id?(n=Z.organizationDomain(e.id),t[2]=e.id,t[3]=n):n=t[3];let C;t[4]!==a?(C=async()=>{const l=await a.callTool({name:"ORGANIZATION_DOMAIN_GET",arguments:{}});return V(l)},t[4]=a,t[5]=C):C=t[5];let E;t[6]!==n||t[7]!==C?(E={queryKey:n,queryFn:C},t[6]=n,t[7]=C,t[8]=E):E=t[8];const{data:N,isPending:r}=Ne(E),f=i?.user?.email??"";let g;t[9]!==f?(g=f.split("@")[1]?.toLowerCase()??"",t[9]=f,t[10]=g):g=t[10];const d=g,c=N?.domain??null,z=N?.autoJoinEnabled??!1,D=d&&d!==c;let x;t[11]!==e.id||t[12]!==o?(x=()=>o.invalidateQueries({queryKey:Z.organizationDomain(e.id)}),t[11]=e.id,t[12]=o,t[13]=x):x=t[13];const j=x;let h;t[14]!==a||t[15]!==d?(h=async()=>{const l=await a.callTool({name:"ORGANIZATION_DOMAIN_SET",arguments:{domain:d,autoJoinEnabled:!1}});return V(l)},t[14]=a,t[15]=d,t[16]=h):h=t[16];let y;t[17]!==j||t[18]!==e.id||t[19]!==d?(y=()=>{q("organization_domain_claimed",{organization_id:e.id,email_domain:d}),j(),T.success("Domain claimed")},t[17]=j,t[18]=e.id,t[19]=d,t[20]=y):y=t[20];let b;t[21]!==e.id||t[22]!==d?(b=l=>{q("organization_domain_claim_failed",{organization_id:e.id,email_domain:d,error:l instanceof Error?l.message:String(l)}),T.error(l instanceof Error?l.message:"Failed to claim domain")},t[21]=e.id,t[22]=d,t[23]=b):b=t[23];let w;t[24]!==h||t[25]!==y||t[26]!==b?(w={mutationFn:h,onSuccess:y,onError:b},t[24]=h,t[25]=y,t[26]=b,t[27]=w):w=t[27];const m=W(w);let S;t[28]!==a?(S=async()=>{const l=await a.callTool({name:"ORGANIZATION_DOMAIN_CLEAR",arguments:{}});return V(l)},t[28]=a,t[29]=S):S=t[29];let v;t[30]!==c||t[31]!==j||t[32]!==e.id?(v=()=>{q("organization_domain_cleared",{organization_id:e.id,email_domain:c}),j(),T.success("Domain removed")},t[30]=c,t[31]=j,t[32]=e.id,t[33]=v):v=t[33];let _;t[34]!==c||t[35]!==e.id?(_=l=>{q("organization_domain_clear_failed",{organization_id:e.id,email_domain:c,error:l instanceof Error?l.message:String(l)}),T.error(l instanceof Error?l.message:"Failed to remove domain")},t[34]=c,t[35]=e.id,t[36]=_):_=t[36];let k;t[37]!==S||t[38]!==v||t[39]!==_?(k={mutationFn:S,onSuccess:v,onError:_},t[37]=S,t[38]=v,t[39]=_,t[40]=k):k=t[40];const P=W(k);let A;t[41]!==a||t[42]!==c||t[43]!==e.id?(A=async l=>{if(!c)return;q("organization_auto_join_toggled",{organization_id:e.id,enabled:l});const L=await a.callTool({name:"ORGANIZATION_DOMAIN_UPDATE",arguments:{autoJoinEnabled:l}});return V(L)},t[41]=a,t[42]=c,t[43]=e.id,t[44]=A):A=t[44];let I;t[45]!==j?(I=()=>{j(),T.success("Auto-join setting updated")},t[45]=j,t[46]=I):I=t[46];let O;t[47]!==e.id?(O=l=>{q("organization_auto_join_toggle_failed",{organization_id:e.id,error:l instanceof Error?l.message:String(l)}),T.error(l instanceof Error?l.message:"Failed to update auto-join")},t[47]=e.id,t[48]=O):O=t[48];let u;t[49]!==A||t[50]!==I||t[51]!==O?(u={mutationFn:A,onSuccess:I,onError:O},t[49]=A,t[50]=I,t[51]=O,t[52]=u):u=t[52];const F=W(u);if(r)return null;let R;t[53]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsxs(X,{className:"p-0",children:[s.jsx(ee,{className:"text-sm",children:"Email Domain"}),s.jsx(_e,{className:"text-xs",children:"Claim your company's email domain so new users with matching emails can automatically join this organization."})]}),t[53]=R):R=t[53];let $;return t[54]!==z||t[55]!==D||t[56]!==P||t[57]!==c||t[58]!==m||t[59]!==F||t[60]!==d?($=s.jsxs(Y,{className:"p-6",children:[R,s.jsx(te,{className:"flex flex-col gap-4 p-0 pt-4",children:c?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx(B,{className:"text-xs text-muted-foreground",children:"Claimed domain"}),s.jsx("p",{className:"text-sm font-medium",children:c})]}),s.jsx(M,{variant:"outline",size:"sm",onClick:()=>P.mutate(),disabled:P.isPending,children:"Remove"})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx(B,{className:"text-xs",children:"Auto-join"}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Users with @",c," emails will automatically join this organization on signup."]})]}),s.jsx(Ae,{checked:z,onCheckedChange:l=>F.mutate(l),disabled:F.isPending})]})]}):D?s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx(B,{className:"text-xs text-muted-foreground",children:"Your domain"}),s.jsx("p",{className:"text-sm font-medium",children:d})]}),s.jsx(M,{size:"sm",onClick:()=>m.mutate(),disabled:m.isPending,children:m.isPending?"Claiming...":"Claim Domain"})]}):s.jsx("p",{className:"text-xs text-muted-foreground",children:"No corporate email domain detected."})})]}),t[54]=z,t[55]=D,t[56]=P,t[57]=c,t[58]=m,t[59]=F,t[60]=d,t[61]=$):$=t[61],$}const re=["site-editor","site-diagnostics","ai-image","ai-research"],ne=8;function et(t,e,i){const o=e.find(a=>a.id===t);if(o)return{id:o.id,title:o.title,icon:o.icon,kind:"template"};const p=i.find(a=>a.id===t);return p?{id:t,title:p.title,icon:p.icon??null,kind:"custom"}:{id:t,title:t,icon:null,kind:"missing"}}function tt(t){const e=G.c(39),{agent:i,onRemove:o}=t;let p;e[0]!==i.id?(p={id:i.id},e[0]=i.id,e[1]=p):p=e[1];const{attributes:a,listeners:n,setNodeRef:C,transform:E,transition:N,isDragging:r}=Re(p);let f;e[2]!==E?(f=Le.Transform.toString(E),e[2]=E,e[3]=f):f=e[3];const g=r?.5:void 0,d=r?100:void 0;let c;e[4]!==f||e[5]!==g||e[6]!==d||e[7]!==N?(c={transform:f,transition:N,opacity:g,zIndex:d},e[4]=f,e[5]=g,e[6]=d,e[7]=N,e[8]=c):c=e[8];const z=c,D=r&&"shadow-lg";let x;e[9]!==D?(x=ye("flex items-center gap-3 px-3 py-2 rounded-lg border border-border bg-background",D),e[9]=D,e[10]=x):x=e[10];const j=`Drag to reorder ${i.title}`;let h;e[11]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(Be,{size:14}),e[11]=h):h=e[11];let y;e[12]!==a||e[13]!==n||e[14]!==j?(y=s.jsx("button",{type:"button",...a,...n,className:"text-muted-foreground hover:text-foreground cursor-grab active:cursor-grabbing","aria-label":j,children:h}),e[12]=a,e[13]=n,e[14]=j,e[15]=y):y=e[15];let b;e[16]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(xe,{size:14}),e[16]=b):b=e[16];let w;e[17]!==i.icon||e[18]!==i.title?(w=s.jsx(ae,{icon:i.icon,name:i.title,size:"xs",fallbackIcon:b}),e[17]=i.icon,e[18]=i.title,e[19]=w):w=e[19];let m;e[20]!==i.title?(m=s.jsx("span",{className:"text-sm text-foreground truncate",children:i.title}),e[20]=i.title,e[21]=m):m=e[21];const S=i.kind==="template"?"Template":i.kind==="custom"?"Custom agent":"Unavailable";let v;e[22]!==S?(v=s.jsx("span",{className:"text-xs text-muted-foreground",children:S}),e[22]=S,e[23]=v):v=e[23];let _;e[24]!==m||e[25]!==v?(_=s.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[m,v]}),e[24]=m,e[25]=v,e[26]=_):_=e[26];const k=`Remove ${i.title}`;let P;e[27]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx(fe,{size:14}),e[27]=P):P=e[27];let A;e[28]!==o||e[29]!==k?(A=s.jsx("button",{type:"button",onClick:o,className:"text-muted-foreground hover:text-foreground p-1 rounded","aria-label":k,children:P}),e[28]=o,e[29]=k,e[30]=A):A=e[30];let I;return e[31]!==C||e[32]!==z||e[33]!==y||e[34]!==w||e[35]!==_||e[36]!==A||e[37]!==x?(I=s.jsxs("div",{ref:C,style:z,className:x,children:[y,w,_,A]}),e[31]=C,e[32]=z,e[33]=y,e[34]=w,e[35]=_,e[36]=A,e[37]=x,e[38]=I):I=e[38],I}function st(t){const e=G.c(48),{selectedIds:i,onAdd:o}=t,[p,a]=J.useState(!1),[n,C]=J.useState(""),E=ge();let N;e[0]!==i?(N=new Set(i),e[0]=i,e[1]=N):N=e[1];const r=N;let f,g,d,c,z,D,x,j,h,y,b,w,m;if(e[2]!==E||e[3]!==o||e[4]!==p||e[5]!==n||e[6]!==r){const P=n.toLowerCase();c=ie.filter(u=>!r.has(u.id)&&(!n||u.title.toLowerCase().includes(P)));let A;e[20]!==r?(A=u=>u.id!==null&&!De(u.id)&&!r.has(u.id),e[20]=r,e[21]=A):A=e[21],d=E.filter(A).filter(u=>!n||u.title.toLowerCase().includes(P));let I;e[22]!==o?(I=u=>{o(u),a(!1),C("")},e[22]=o,e[23]=I):I=e[23];const O=I;g=Ge,w=p,m=a,e[24]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx(Ke,{asChild:!0,children:s.jsxs(M,{type:"button",variant:"outline",size:"sm",children:[s.jsx(Je,{size:14}),"Add agent"]})}),e[24]=z):z=e[24],f=Ue,h="w-[320px] p-0 overflow-hidden",y="start",e[25]!==n?(b=s.jsx(qe,{value:n,onChange:C,placeholder:"Search agents..."}),e[25]=n,e[26]=b):b=e[26],D="max-h-[320px] overflow-y-auto p-2 flex flex-col gap-3",x=c.length>0&&s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground px-1",children:"Templates"}),c.map(u=>s.jsxs("button",{type:"button",onClick:()=>O(u.id),className:"flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-accent text-left",children:[s.jsx(ae,{icon:u.icon,name:u.title,size:"xs"}),s.jsx("span",{className:"text-sm truncate",children:u.title})]},u.id))]}),j=d.length>0&&s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground px-1",children:"Custom agents"}),d.map(u=>s.jsxs("button",{type:"button",onClick:()=>O(u.id),className:"flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-accent text-left",children:[s.jsx(ae,{icon:u.icon,name:u.title,size:"xs",fallbackIcon:s.jsx(xe,{size:14})}),s.jsx("span",{className:"text-sm truncate",children:u.title})]},u.id))]}),e[2]=E,e[3]=o,e[4]=p,e[5]=n,e[6]=r,e[7]=f,e[8]=g,e[9]=d,e[10]=c,e[11]=z,e[12]=D,e[13]=x,e[14]=j,e[15]=h,e[16]=y,e[17]=b,e[18]=w,e[19]=m}else f=e[7],g=e[8],d=e[9],c=e[10],z=e[11],D=e[12],x=e[13],j=e[14],h=e[15],y=e[16],b=e[17],w=e[18],m=e[19];let S;e[27]!==d||e[28]!==c.length||e[29]!==n?(S=c.length===0&&d.length===0&&s.jsx("div",{className:"text-xs text-muted-foreground text-center py-6",children:n?"No agents found":"All agents are already added"}),e[27]=d,e[28]=c.length,e[29]=n,e[30]=S):S=e[30];let v;e[31]!==S||e[32]!==D||e[33]!==x||e[34]!==j?(v=s.jsxs("div",{className:D,children:[x,j,S]}),e[31]=S,e[32]=D,e[33]=x,e[34]=j,e[35]=v):v=e[35];let _;e[36]!==f||e[37]!==v||e[38]!==h||e[39]!==y||e[40]!==b?(_=s.jsxs(f,{className:h,align:y,children:[b,v]}),e[36]=f,e[37]=v,e[38]=h,e[39]=y,e[40]=b,e[41]=_):_=e[41];let k;return e[42]!==g||e[43]!==z||e[44]!==_||e[45]!==w||e[46]!==m?(k=s.jsxs(g,{open:w,onOpenChange:m,children:[z,_]}),e[42]=g,e[43]=z,e[44]=_,e[45]=w,e[46]=m,e[47]=k):k=e[47],k}function nt(){const t=G.c(60),e=Qe(),i=ge(),o=Ve();let p;t[0]!==e?.ids?(p=e?.ids??[...re],t[0]=e?.ids,t[1]=p):p=t[1];const a=p,[n,C]=J.useState(a);let E;t[2]!==n||t[3]!==a?(E=n.length!==a.length||n.some((l,L)=>l!==a[L]),t[2]=n,t[3]=a,t[4]=E):E=t[4];const N=E;let r;t[5]===Symbol.for("react.memo_cache_sentinel")?(r={activationConstraint:{distance:5}},t[5]=r):r=t[5];let f;t[6]===Symbol.for("react.memo_cache_sentinel")?(f={coordinateGetter:Me},t[6]=f):f=t[6];const g=Ee(le(Fe,r),le(Te,f));let d;t[7]!==n?(d=l=>{const{active:L,over:K}=l;if(!K||L.id===K.id)return;const H=n.indexOf(L.id),U=n.indexOf(K.id);H===-1||U===-1||C($e([...n],H,U))},t[7]=n,t[8]=d):d=t[8];const c=d;let z;t[9]!==n?(z=l=>{n.includes(l)||C([...n,l])},t[9]=n,t[10]=z):z=t[10];const D=z;let x;t[11]!==n?(x=l=>{C(n.filter(L=>L!==l))},t[11]=n,t[12]=x):x=t[12];const j=x;let h;t[13]===Symbol.for("react.memo_cache_sentinel")?(h=()=>{C([...re])},t[13]=h):h=t[13];const y=h;let b;t[14]!==n||t[15]!==o?(b=()=>{o.mutate({ids:n},{onSuccess:()=>{q("default_home_agents_updated",{count:n.length,template_count:n.filter(it).length}),T.success("Default home agents updated")},onError:at})},t[14]=n,t[15]=o,t[16]=b):b=t[16];const w=b;let m,S,v,_,k,P,A;if(t[17]!==i||t[18]!==n||t[19]!==c||t[20]!==j||t[21]!==g||t[22]!==o.isPending){let l;t[30]!==i?(l=U=>et(U,ie,i),t[30]=i,t[31]=l):l=t[31];const L=n.map(l);v=Math.max(0,n.length-ne),S=Y,k="p-6";let K;t[32]===Symbol.for("react.memo_cache_sentinel")?(K=s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx(ee,{className:"text-sm",children:"Default home agents"}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Choose which agents appear on the home view for everyone in this organization. Drag to reorder. Up to ",ne," tiles render on the home view."]})]}),t[32]=K):K=t[32];let H;t[33]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx(Se,{size:14}),t[33]=H):H=t[33],t[34]!==o.isPending?(P=s.jsxs(X,{className:"p-0 flex flex-row items-start justify-between gap-3",children:[K,s.jsxs(M,{type:"button",variant:"ghost",size:"sm",onClick:y,disabled:o.isPending,children:[H,"Reset defaults"]})]}),t[34]=o.isPending,t[35]=P):P=t[35],m=te,A="p-0 flex flex-col gap-3",_=L.length===0?s.jsx("div",{className:"rounded-lg border border-dashed border-border p-6 text-center text-xs text-muted-foreground",children:'No agents selected. The home view will only show "Create agent".'}):s.jsx(Ie,{sensors:g,collisionDetection:Pe,onDragEnd:c,children:s.jsx(ke,{items:n,strategy:Oe,children:s.jsx("div",{className:"flex flex-col gap-1.5",children:L.map((U,he)=>s.jsxs("div",{className:"flex flex-col gap-1.5",children:[he===ne&&s.jsxs("div",{className:"flex items-center gap-2 px-1 py-1 text-xs text-muted-foreground",children:[s.jsx("div",{className:"flex-1 h-px bg-border"}),s.jsx("span",{children:"Below this line is hidden on the home view"}),s.jsx("div",{className:"flex-1 h-px bg-border"})]}),s.jsx(tt,{agent:U,onRemove:()=>j(U.id)})]},U.id))})})}),t[17]=i,t[18]=n,t[19]=c,t[20]=j,t[21]=g,t[22]=o.isPending,t[23]=m,t[24]=S,t[25]=v,t[26]=_,t[27]=k,t[28]=P,t[29]=A}else m=t[23],S=t[24],v=t[25],_=t[26],k=t[27],P=t[28],A=t[29];let I;t[36]!==n||t[37]!==D?(I=s.jsx(st,{selectedIds:n,onAdd:D}),t[36]=n,t[37]=D,t[38]=I):I=t[38];let O;t[39]!==v?(O=v>0&&s.jsxs("span",{className:"text-xs text-muted-foreground",children:[v," agent",v===1?"":"s"," won't fit on the home view"]}),t[39]=v,t[40]=O):O=t[40];let u;t[41]!==I||t[42]!==O?(u=s.jsxs("div",{className:"flex items-center justify-between",children:[I,O]}),t[41]=I,t[42]=O,t[43]=u):u=t[43];let F;t[44]!==m||t[45]!==_||t[46]!==u||t[47]!==A?(F=s.jsxs(m,{className:A,children:[_,u]}),t[44]=m,t[45]=_,t[46]=u,t[47]=A,t[48]=F):F=t[48];let R;t[49]!==w||t[50]!==a||t[51]!==N||t[52]!==o.isPending?(R=N&&s.jsxs(ue,{className:"p-0 pt-2 gap-2",children:[s.jsx(M,{type:"button",onClick:w,disabled:o.isPending,children:o.isPending?"Saving…":"Save"}),s.jsx(M,{type:"button",variant:"outline",onClick:()=>C(a),disabled:o.isPending,children:"Cancel"})]}),t[49]=w,t[50]=a,t[51]=N,t[52]=o.isPending,t[53]=R):R=t[53];let $;return t[54]!==S||t[55]!==k||t[56]!==P||t[57]!==F||t[58]!==R?($=s.jsxs(S,{className:k,children:[P,F,R]}),t[54]=S,t[55]=k,t[56]=P,t[57]=F,t[58]=R,t[59]=$):$=t[59],$}function at(t){T.error(t instanceof Error?t.message:"Failed to update default home agents")}function it(t){return ie.some(e=>e.id===t)}function ot(){const t=G.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(X,{className:"p-0",children:s.jsx(ee,{className:"text-sm",children:"Default home agents"})}),t[0]=e):e=t[0];let i;return t[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs(Y,{className:"p-6",children:[e,s.jsx(te,{className:"p-0 flex flex-col gap-2",children:Array.from({length:4}).map(lt)})]}),t[1]=i):i=t[1],i}function lt(t,e){return s.jsx(He,{className:"h-12 w-full rounded-lg"},e)}function rt(){const t=G.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(J.Suspense,{fallback:s.jsx(ot,{}),children:s.jsx(nt,{})}),t[0]=e):e=t[0],e}function ct(){const t=G.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Q,{children:s.jsx(Q.Content,{children:s.jsx(Q.Body,{children:s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsx(Q.Title,{children:"Organization"}),s.jsx(Ye,{}),s.jsx(Xe,{}),s.jsx(rt,{})]})})})}),t[0]=e):e=t[0],e}function Zt(){const t=G.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(ct,{}),t[0]=e):e=t[0],e}export{Zt as default};
|
package/dist/client/assets/{github-repo-picker-DdJW6OKr.js → github-repo-picker-BSkFdyNg.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{e as M,s as z,o as ve,b as ze,r as O,K as ne,n as He,a as Fe,j as t,c as he,B as oe,t as V,z as ie,f as We,a0 as Je,a1 as Xe,az as je,C as Ze,l as xe,V as et}from"./index-BAVpG5PI.js";import{S as re,u as $,d as we,W as Be,j as ye}from"./constants-D7Xua0Kh.js";import{u as Ne}from"./use-navigate-to-agent-B1eLGU7z.js";import{c as ce,d as le,a as de,D as ue,b as tt}from"./dialog-CMTU9wUU.js";import{i as Ae}from"./SearchMd-b9tCf66d.js";import{C as qe}from"./collection-search-DL5AAqlC.js";import{c as Ee,b as Se,D as Oe,a as Le}from"./drawer-BbnvWPmy.js";import{u as Re}from"./use-mobile-DjZnjqlA.js";import{I as Me}from"./integration-icon-DkvnCAKV.js";import{a as ke,u as nt}from"./use-connection-WpLI1Z7R.js";import{u as st,d as Qe}from"./use-mcp-tools-DXEYm3L2.js";import{b as Ue,u as it}from"./use-virtual-mcp-OtMHbTvm.js";import{C as ot}from"./checkbox-1xh00yHd.js";import{i as at}from"./Lock01-DvsN0mFQ.js";import{I as rt}from"./agent-icon-YPHh6Pzl.js";import{e as ct}from"./extract-connection-data-D6ONGrG_.js";function lt(i){return i.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}async function dt(){const i=await fetch("/api/deco-sites");if(!i.ok){const e=await i.json().catch(()=>({}));throw new Error(e.error??`Failed to load sites (${i.status})`)}return i.json()}function Kt(i){const e=M.c(65),{open:n,onOpenChange:a,onBack:c}=i,{org:s}=z(),l=Ne(),m=ve(),{data:f}=ze.useSession(),[x,h]=O.useState(null),[T,d]=O.useState("");let u;e[0]!==s.id?(u={connectionId:re,orgId:s.id},e[0]=s.id,e[1]=u):u=e[1];const p=$(u);let r;e[2]!==f?.user?.email?(r=ne.decoSites(f?.user?.email),e[2]=f?.user?.email,e[3]=r):r=e[3];const g=n&&!!f?.user?.email;let C;e[4]!==r||e[5]!==g?(C={queryKey:r,queryFn:dt,enabled:g,staleTime:6e4,retry:!1},e[4]=r,e[5]=g,e[6]=C):C=e[6];const{data:_,isLoading:N,error:b}=He(C),I=_?.sites??[];let o;e[7]!==a?(o=w=>{w||(h(null),d("")),a(w)},e[7]=a,e[8]=o):o=e[8];const y=o;let A;e[9]!==T?(A=w=>w.name.toLowerCase().includes(T.toLowerCase())||w.domains?.[0]?.domain.toLowerCase().includes(T.toLowerCase()),e[9]=T,e[10]=A):A=e[10];const v=I.filter(A),E=!x||v.some(w=>w.name===x);let j;e[11]!==p||e[12]!==s.id?(j=async w=>{V("deco_site_import_started",{site_name:w});const G=await fetch("/api/deco-sites/connection",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteName:w,orgId:s.id})}),D=await G.json().catch(ft);if(!G.ok)throw new Error(D.error??`Failed to create connection (${G.status})`);const L=D.connId;if(!L)throw new Error("Server did not return a connection ID");const ge=D.icon??null,te=lt(w),Pe=await p.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:w,description:"Imported from deco.cx",pinned:!0,icon:ge??null,subtype:"project",metadata:{instructions:null,enabled_plugins:[],ui:{banner:null,bannerColor:"#22C55E",icon:ge,themeColor:"#22C55E",slug:te,pinnedViews:[{connectionId:L,toolName:"file_explorer",label:"Preview",icon:null},{connectionId:L,toolName:"fetch_assets",label:"Assets",icon:null},{connectionId:L,toolName:"get_monitor_data",label:"Monitor",icon:null},{connectionId:L,toolName:"list_pull_requests",label:"Pull Requests",icon:null},{connectionId:L,toolName:"list_releases",label:"Releases",icon:null}],layout:{defaultMainView:{type:"ext-apps",id:L,toolName:"file_explorer"}}}},connections:[{connection_id:L}]}}}),Ge=Pe.structuredContent??Pe;return{slug:te,virtualMcpId:Ge.item.id,connId:L,item:Ge.item}},e[11]=p,e[12]=s.id,e[13]=j):j=e[13];let S;e[14]!==p||e[15]!==y||e[16]!==l||e[17]!==s.id||e[18]!==m?(S=w=>{const{slug:G,virtualMcpId:D,item:L}=w;V("deco_site_import_succeeded",{site_name:L.title,virtual_mcp_id:D,slug:G}),m.setQueryData(ne.collectionItem(p,s.id,"","VIRTUAL_MCP",D),{item:L}),m.invalidateQueries({predicate:ge=>{const te=ge.queryKey;return te[1]===s.id&&te[3]==="collection"&&te[4]==="VIRTUAL_MCP"}}),m.invalidateQueries({queryKey:ne.projects(s.id)}),ie.success(`Imported ${G} from deco.cx`),y(!1),localStorage.setItem("mesh:sidebar-open",JSON.stringify(!1)),l(D)},e[14]=p,e[15]=y,e[16]=l,e[17]=s.id,e[18]=m,e[19]=S):S=e[19];let k;e[20]!==j||e[21]!==S?(k={mutationFn:j,onSuccess:S,onError:mt},e[20]=j,e[21]=S,e[22]=k):k=e[22];const U=Fe(k),H=le,se=ce,R="sm:max-w-[900px] p-0 gap-0 overflow-hidden";let P;e[23]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(de,{className:"sr-only",children:t.jsx(ue,{children:"Import from deco.cx"})}),e[23]=P):P=e[23];let F;e[24]!==c?(F=c&&t.jsx("button",{type:"button",onClick:c,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[24]=c,e[25]=F):F=e[25];let me;e[26]===Symbol.for("react.memo_cache_sentinel")?(me=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Import from deco.cx"}),e[26]=me):me=e[26];let B;e[27]!==F?(B=t.jsxs("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3",children:[F,me]}),e[27]=F,e[28]=B):B=e[28];let fe;e[29]===Symbol.for("react.memo_cache_sentinel")?(fe=w=>{w.key==="Escape"&&d("")},e[29]=fe):fe=e[29];let q;e[30]!==T?(q=t.jsx("div",{children:t.jsx(qe,{value:T,onChange:d,placeholder:"Search sites...",onKeyDown:fe})}),e[30]=T,e[31]=q):q=e[31];const Ke="pb-0 min-h-[300px]";let Q;e[32]!==N?(Q=N&&t.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:"Loading sites..."}),e[32]=N,e[33]=Q):Q=e[33];const _e=!N&&!b&&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."}),Ce=!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:[v.length===0&&t.jsxs("p",{className:"col-span-3 text-sm text-muted-foreground text-center py-8",children:["No sites match “",T,"”"]}),v.map(w=>{const G=w.domains?.find(ut)?.domain??w.domains?.[0]?.domain,D=x===w.name;return t.jsxs("button",{type:"button",onClick:()=>h(w.name),className:he("flex flex-col rounded-xl border overflow-hidden text-left transition-all cursor-pointer",D?"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}),G&&t.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:G})]})]},w.name)})]});let Y;e[34]!==Q||e[35]!==_e||e[36]!==Ce?(Y=t.jsxs("div",{className:Ke,children:[Q,_e,Ce]}),e[34]=Q,e[35]=_e,e[36]=Ce,e[37]=Y):Y=e[37];let K;e[38]!==y?(K=()=>y(!1),e[38]=y,e[39]=K):K=e[39];let W;e[40]!==U.isPending||e[41]!==K?(W=t.jsx(oe,{variant:"outline",onClick:K,disabled:U.isPending,children:"Cancel"}),e[40]=U.isPending,e[41]=K,e[42]=W):W=e[42];const Ie=!x||!E||U.isPending||N;let J;e[43]!==U||e[44]!==x?(J=()=>x&&U.mutate(x),e[43]=U,e[44]=x,e[45]=J):J=e[45];const Te=U.isPending?"Importing...":"Import";let X;e[46]!==Ie||e[47]!==J||e[48]!==Te?(X=t.jsx(oe,{disabled:Ie,onClick:J,children:Te}),e[46]=Ie,e[47]=J,e[48]=Te,e[49]=X):X=e[49];let Z;e[50]!==W||e[51]!==X?(Z=t.jsxs(tt,{className:"px-8 py-5 border-t border-border",children:[W,X]}),e[50]=W,e[51]=X,e[52]=Z):Z=e[52];let ee;e[53]!==se||e[54]!==P||e[55]!==B||e[56]!==q||e[57]!==Y||e[58]!==Z?(ee=t.jsxs(se,{className:R,children:[P,B,q,Y,Z]}),e[53]=se,e[54]=P,e[55]=B,e[56]=q,e[57]=Y,e[58]=Z,e[59]=ee):ee=e[59];let pe;return e[60]!==H||e[61]!==y||e[62]!==n||e[63]!==ee?(pe=t.jsx(H,{open:n,onOpenChange:y,children:ee}),e[60]=H,e[61]=y,e[62]=n,e[63]=ee,e[64]=pe):pe=e[64],pe}function ut(i){return i.production}function mt(i){V("deco_site_import_failed",{error:i instanceof Error?i.message:"Unknown error"}),ie.error("Import failed: "+(i instanceof Error?i.message:"Unknown error"))}function ft(){return{}}function Ye(i,e){const n=M.c(11),{org:a}=z();let c;n[0]!==a.id?(c=we.REGISTRY(a.id),n[0]=a.id,n[1]=c):c=n[1];const s=c;let l;n[2]!==a.id||n[3]!==s?(l={connectionId:s,orgId:a.id},n[2]=a.id,n[3]=s,n[4]=l):l=n[4];const m=$(l);let f;n[5]!==i?(f={name:i},n[5]=i,n[6]=f):f=n[6];const x=e?.enabled??!0;let h;return n[7]!==m||n[8]!==f||n[9]!==x?(h={client:m,toolName:"COLLECTION_REGISTRY_APP_GET",toolArguments:f,enabled:x,staleTime:3e5,select:pt},n[7]=m,n[8]=f,n[9]=x,n[10]=h):h=n[10],st(h)}function pt(i){return i.structuredContent?.item??null}const gt=["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 De(i){const e=M.c(7),{onRecruit:n,isRecruiting:a,isLoading:c}=i;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=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]=s):s=e[0];let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("p",{className:"text-sm font-medium text-foreground",children:"Capabilities"}),e[1]=l):l=e[1];let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsxs("div",{className:"space-y-2",children:[l,t.jsx("ul",{className:"space-y-1.5",children:gt.map(ht)})]}),e[2]=m):m=e[2];const f=a||c,x=a?"Setting up...":"Add Site Diagnostics";let h;return e[3]!==n||e[4]!==f||e[5]!==x?(h=t.jsxs("div",{className:"flex flex-col gap-6",children:[s,m,t.jsx(oe,{onClick:n,disabled:f,className:"w-full cursor-pointer",children:x})]}),e[3]=n,e[4]=f,e[5]=x,e[6]=h):h=e[6],h}function ht(i){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:"+"}),i]},i)}function Wt({open:i,onOpenChange:e,existingAgent:n}){const a=Re(),{org:c}=z(),s=Ne(),l=ke(),m=Ue(),f=$({connectionId:re,orgId:c.id}),x=Qe({client:f}),[h,T]=O.useState(!1),d=Be.find(I=>I.id==="site-diagnostics"),{data:u,isLoading:p}=Ye(d.appId,{enabled:i}),r=u?.title||u?.server?.title||u?.server?.name||d.title,g=u?.server?.icons?.[0]?.src??d.icon,C=u?.server?.description??null,_=t.jsx(Me,{icon:g,name:r,size:"sm"}),N=async()=>{if(u){if(n){e(!1),s(n.id);return}T(!0);try{const I=await x.mutateAsync({name:"COLLECTION_CONNECTIONS_LIST",arguments:{where:{field:["app_id"],operator:"eq",value:d.appId},limit:1,offset:0}});let o;const A=I?.structuredContent?.items?.find(E=>E.app_id===d.appId);if(A)o=A.id;else{const E=u.server?.remotes?.[0]?.url;if(!E)throw new Error("Registry item is missing a remote URL for site-diagnostics");o=(await l.create.mutateAsync({title:r,description:C,icon:u.server?.icons?.[0]?.src??d.icon,connection_type:"HTTP",connection_url:E,app_name:u.server?.name??"site-diagnostics",app_id:d.appId,metadata:{type:"site-diagnostics",source:"store",registry_item_id:d.appId,verified:!0}})).id}const v=await m.create.mutateAsync({title:r,description:C,icon:g,status:"active",connections:[{connection_id:o,selected_tools:null,selected_resources:null,selected_prompts:null}],metadata:{type:"site-diagnostics",instructions:null,ui:{pinnedViews:[{connectionId:o,toolName:"diagnose",label:"diagnose",icon:null}],layout:{defaultMainView:{type:"ext-apps",id:o,toolName:"diagnose"}}}}});V("agent_recruit_confirmed",{template_id:"site-diagnostics",agent_id:v.id}),e(!1),s(v.id)}catch(I){V("agent_recruit_failed",{template_id:"site-diagnostics",error:I instanceof Error?I.message:String(I)}),console.error("Failed to create Site Diagnostics agent:",I)}finally{T(!1)}}},b=`Add ${r}`;return a?t.jsx(Ee,{open:i,onOpenChange:e,children:t.jsxs(Se,{className:"h-[70dvh]",children:[t.jsx(Oe,{className:"px-4 pt-4 pb-4 shrink-0",children:t.jsxs("div",{className:"flex items-center gap-3",children:[_,t.jsx(Le,{className:"text-xl font-semibold",children:b})]})}),t.jsx("div",{className:"flex flex-col flex-1 min-h-0 px-4 pb-8",children:t.jsx(De,{onRecruit:N,isRecruiting:h,isLoading:p})})]})}):t.jsx(le,{open:i,onOpenChange:e,children:t.jsxs(ce,{className:"sm:max-w-[500px] p-8",children:[t.jsx(de,{className:"mb-4",children:t.jsxs("div",{className:"flex items-center gap-3",children:[_,t.jsx(ue,{className:"text-xl font-semibold",children:b})]})}),t.jsx(De,{onRecruit:N,isRecruiting:h,isLoading:p})]})})}const xt="https://sites-lean-canva.decocache.com/api/mcp",Nt=["Build and update Lean Canvas business models visually","Interactive grid UI with all 9 canvas sections","Iterative updates — add information as you discover it","Covers: Problem, Solution, Key Metrics, Unique Value Proposition","Covers: Channels, Customer Segments, Cost Structure, Revenue Streams","Unfair Advantage analysis"];function Ve(i){const e=M.c(7),{onRecruit:n,isRecruiting:a}=i;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("p",{className:"text-sm text-muted-foreground",children:"Add a Lean Canvas agent that helps you build and iterate on your business model. Describe your idea and it produces a visual, structured canvas."}),e[0]=c):c=e[0];let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("p",{className:"text-sm font-medium text-foreground",children:"Capabilities"}),e[1]=s):s=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsxs("div",{className:"space-y-2",children:[s,t.jsx("ul",{className:"space-y-1.5",children:Nt.map(_t)})]}),e[2]=l):l=e[2];const m=a?"Setting up...":"Add Lean Canvas";let f;return e[3]!==a||e[4]!==n||e[5]!==m?(f=t.jsxs("div",{className:"flex flex-col gap-6",children:[c,l,t.jsx(oe,{onClick:n,disabled:a,className:"w-full cursor-pointer",children:m})]}),e[3]=a,e[4]=n,e[5]=m,e[6]=f):f=e[6],f}function _t(i){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:"+"}),i]},i)}function Jt({open:i,onOpenChange:e,existingAgent:n}){const a=Re(),{org:c}=z(),s=Ne(),l=ke(),m=Ue(),f=$({connectionId:re,orgId:c.id}),x=Qe({client:f}),[h,T]=O.useState(!1),d=Be.find(g=>g.id==="lean-canvas"),u=t.jsx(Me,{icon:d.icon,name:d.title,size:"sm"}),p=async()=>{if(n){e(!1),s(n.id);return}T(!0);try{const g=await x.mutateAsync({name:"COLLECTION_CONNECTIONS_LIST",arguments:{where:{field:["app_id"],operator:"eq",value:"lean-canvas"},limit:1,offset:0}});let C;const N=g?.structuredContent?.items?.find(o=>o.app_id==="lean-canvas"),b=we.SELF(c.id);N?C=N.id:C=(await l.create.mutateAsync({title:d.title,description:"Lean Canvas business model builder",icon:d.icon,connection_type:"HTTP",connection_url:xt,app_name:"lean-canvas",app_id:"lean-canvas",configuration_state:{OBJECT_STORAGE:{__type:"@deco/object-storage",value:b}},metadata:{type:"lean-canvas",source:"store",verified:!0}})).id;const I=await m.create.mutateAsync({title:d.title,description:"Lean Canvas business model builder",icon:d.icon,status:"active",connections:[{connection_id:C,selected_tools:null,selected_resources:null,selected_prompts:null},{connection_id:b,selected_tools:null,selected_resources:null,selected_prompts:null}],metadata:{type:"lean-canvas",instructions:null,ui:{pinnedViews:[{connectionId:C,toolName:"lean_canvas",label:"lean_canvas",icon:null}],layout:{defaultMainView:{type:"ext-apps",id:C,toolName:"lean_canvas"}}}}});V("agent_recruit_confirmed",{template_id:"lean-canvas",agent_id:I.id}),e(!1),s(I.id)}catch(g){V("agent_recruit_failed",{template_id:"lean-canvas",error:g instanceof Error?g.message:String(g)}),console.error("Failed to create Lean Canvas agent:",g)}finally{T(!1)}},r=`Add ${d.title}`;return a?t.jsx(Ee,{open:i,onOpenChange:e,children:t.jsxs(Se,{className:"h-[70dvh]",children:[t.jsx(Oe,{className:"px-4 pt-4 pb-4 shrink-0",children:t.jsxs("div",{className:"flex items-center gap-3",children:[u,t.jsx(Le,{className:"text-xl font-semibold",children:r})]})}),t.jsx("div",{className:"flex flex-col flex-1 min-h-0 px-4 pb-8",children:t.jsx(Ve,{onRecruit:p,isRecruiting:h})})]})}):t.jsx(le,{open:i,onOpenChange:e,children:t.jsxs(ce,{className:"sm:max-w-[500px] p-8",children:[t.jsx(de,{className:"mb-4",children:t.jsxs("div",{className:"flex items-center gap-3",children:[u,t.jsx(ue,{className:"text-xl font-semibold",children:r})]})}),t.jsx(Ve,{onRecruit:p,isRecruiting:h})]})})}const Ct=`<role>
|
|
1
|
+
import{e as M,s as z,o as ve,b as ze,r as O,K as ne,n as He,a as Fe,j as t,c as he,B as oe,t as V,z as ie,f as We,a0 as Je,a1 as Xe,az as je,C as Ze,l as xe,V as et}from"./index-D_cV0HX5.js";import{S as re,u as $,d as we,W as Be,j as ye}from"./constants-B9qhU0c2.js";import{u as Ne}from"./use-navigate-to-agent-cye4_ovr.js";import{c as ce,d as le,a as de,D as ue,b as tt}from"./dialog-DTc6xcOj.js";import{i as Ae}from"./SearchMd-CJUx5L0X.js";import{C as qe}from"./collection-search-DzQxK0TT.js";import{c as Ee,b as Se,D as Oe,a as Le}from"./drawer-D7fRUj36.js";import{u as Re}from"./use-mobile-BukhR5xc.js";import{I as Me}from"./integration-icon-3xGkh2yb.js";import{a as ke,u as nt}from"./use-connection-DnhQK4fq.js";import{u as st,d as Qe}from"./use-mcp-tools-dsvqyXUs.js";import{b as Ue,u as it}from"./use-virtual-mcp-CCFi2lST.js";import{C as ot}from"./checkbox-CnUU9-I8.js";import{i as at}from"./Lock01-DGN1sRwj.js";import{I as rt}from"./agent-icon-Dmd713yi.js";import{e as ct}from"./extract-connection-data-BkBgr0-3.js";function lt(i){return i.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}async function dt(){const i=await fetch("/api/deco-sites");if(!i.ok){const e=await i.json().catch(()=>({}));throw new Error(e.error??`Failed to load sites (${i.status})`)}return i.json()}function Kt(i){const e=M.c(65),{open:n,onOpenChange:a,onBack:c}=i,{org:s}=z(),l=Ne(),m=ve(),{data:f}=ze.useSession(),[x,h]=O.useState(null),[T,d]=O.useState("");let u;e[0]!==s.id?(u={connectionId:re,orgId:s.id},e[0]=s.id,e[1]=u):u=e[1];const p=$(u);let r;e[2]!==f?.user?.email?(r=ne.decoSites(f?.user?.email),e[2]=f?.user?.email,e[3]=r):r=e[3];const g=n&&!!f?.user?.email;let C;e[4]!==r||e[5]!==g?(C={queryKey:r,queryFn:dt,enabled:g,staleTime:6e4,retry:!1},e[4]=r,e[5]=g,e[6]=C):C=e[6];const{data:_,isLoading:N,error:b}=He(C),I=_?.sites??[];let o;e[7]!==a?(o=w=>{w||(h(null),d("")),a(w)},e[7]=a,e[8]=o):o=e[8];const y=o;let A;e[9]!==T?(A=w=>w.name.toLowerCase().includes(T.toLowerCase())||w.domains?.[0]?.domain.toLowerCase().includes(T.toLowerCase()),e[9]=T,e[10]=A):A=e[10];const v=I.filter(A),E=!x||v.some(w=>w.name===x);let j;e[11]!==p||e[12]!==s.id?(j=async w=>{V("deco_site_import_started",{site_name:w});const G=await fetch("/api/deco-sites/connection",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteName:w,orgId:s.id})}),D=await G.json().catch(ft);if(!G.ok)throw new Error(D.error??`Failed to create connection (${G.status})`);const L=D.connId;if(!L)throw new Error("Server did not return a connection ID");const ge=D.icon??null,te=lt(w),Pe=await p.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:w,description:"Imported from deco.cx",pinned:!0,icon:ge??null,subtype:"project",metadata:{instructions:null,enabled_plugins:[],ui:{banner:null,bannerColor:"#22C55E",icon:ge,themeColor:"#22C55E",slug:te,pinnedViews:[{connectionId:L,toolName:"file_explorer",label:"Preview",icon:null},{connectionId:L,toolName:"fetch_assets",label:"Assets",icon:null},{connectionId:L,toolName:"get_monitor_data",label:"Monitor",icon:null},{connectionId:L,toolName:"list_pull_requests",label:"Pull Requests",icon:null},{connectionId:L,toolName:"list_releases",label:"Releases",icon:null}],layout:{defaultMainView:{type:"ext-apps",id:L,toolName:"file_explorer"}}}},connections:[{connection_id:L}]}}}),Ge=Pe.structuredContent??Pe;return{slug:te,virtualMcpId:Ge.item.id,connId:L,item:Ge.item}},e[11]=p,e[12]=s.id,e[13]=j):j=e[13];let S;e[14]!==p||e[15]!==y||e[16]!==l||e[17]!==s.id||e[18]!==m?(S=w=>{const{slug:G,virtualMcpId:D,item:L}=w;V("deco_site_import_succeeded",{site_name:L.title,virtual_mcp_id:D,slug:G}),m.setQueryData(ne.collectionItem(p,s.id,"","VIRTUAL_MCP",D),{item:L}),m.invalidateQueries({predicate:ge=>{const te=ge.queryKey;return te[1]===s.id&&te[3]==="collection"&&te[4]==="VIRTUAL_MCP"}}),m.invalidateQueries({queryKey:ne.projects(s.id)}),ie.success(`Imported ${G} from deco.cx`),y(!1),localStorage.setItem("mesh:sidebar-open",JSON.stringify(!1)),l(D)},e[14]=p,e[15]=y,e[16]=l,e[17]=s.id,e[18]=m,e[19]=S):S=e[19];let k;e[20]!==j||e[21]!==S?(k={mutationFn:j,onSuccess:S,onError:mt},e[20]=j,e[21]=S,e[22]=k):k=e[22];const U=Fe(k),H=le,se=ce,R="sm:max-w-[900px] p-0 gap-0 overflow-hidden";let P;e[23]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(de,{className:"sr-only",children:t.jsx(ue,{children:"Import from deco.cx"})}),e[23]=P):P=e[23];let F;e[24]!==c?(F=c&&t.jsx("button",{type:"button",onClick:c,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[24]=c,e[25]=F):F=e[25];let me;e[26]===Symbol.for("react.memo_cache_sentinel")?(me=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Import from deco.cx"}),e[26]=me):me=e[26];let B;e[27]!==F?(B=t.jsxs("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3",children:[F,me]}),e[27]=F,e[28]=B):B=e[28];let fe;e[29]===Symbol.for("react.memo_cache_sentinel")?(fe=w=>{w.key==="Escape"&&d("")},e[29]=fe):fe=e[29];let q;e[30]!==T?(q=t.jsx("div",{children:t.jsx(qe,{value:T,onChange:d,placeholder:"Search sites...",onKeyDown:fe})}),e[30]=T,e[31]=q):q=e[31];const Ke="pb-0 min-h-[300px]";let Q;e[32]!==N?(Q=N&&t.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:"Loading sites..."}),e[32]=N,e[33]=Q):Q=e[33];const _e=!N&&!b&&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."}),Ce=!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:[v.length===0&&t.jsxs("p",{className:"col-span-3 text-sm text-muted-foreground text-center py-8",children:["No sites match “",T,"”"]}),v.map(w=>{const G=w.domains?.find(ut)?.domain??w.domains?.[0]?.domain,D=x===w.name;return t.jsxs("button",{type:"button",onClick:()=>h(w.name),className:he("flex flex-col rounded-xl border overflow-hidden text-left transition-all cursor-pointer",D?"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}),G&&t.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:G})]})]},w.name)})]});let Y;e[34]!==Q||e[35]!==_e||e[36]!==Ce?(Y=t.jsxs("div",{className:Ke,children:[Q,_e,Ce]}),e[34]=Q,e[35]=_e,e[36]=Ce,e[37]=Y):Y=e[37];let K;e[38]!==y?(K=()=>y(!1),e[38]=y,e[39]=K):K=e[39];let W;e[40]!==U.isPending||e[41]!==K?(W=t.jsx(oe,{variant:"outline",onClick:K,disabled:U.isPending,children:"Cancel"}),e[40]=U.isPending,e[41]=K,e[42]=W):W=e[42];const Ie=!x||!E||U.isPending||N;let J;e[43]!==U||e[44]!==x?(J=()=>x&&U.mutate(x),e[43]=U,e[44]=x,e[45]=J):J=e[45];const Te=U.isPending?"Importing...":"Import";let X;e[46]!==Ie||e[47]!==J||e[48]!==Te?(X=t.jsx(oe,{disabled:Ie,onClick:J,children:Te}),e[46]=Ie,e[47]=J,e[48]=Te,e[49]=X):X=e[49];let Z;e[50]!==W||e[51]!==X?(Z=t.jsxs(tt,{className:"px-8 py-5 border-t border-border",children:[W,X]}),e[50]=W,e[51]=X,e[52]=Z):Z=e[52];let ee;e[53]!==se||e[54]!==P||e[55]!==B||e[56]!==q||e[57]!==Y||e[58]!==Z?(ee=t.jsxs(se,{className:R,children:[P,B,q,Y,Z]}),e[53]=se,e[54]=P,e[55]=B,e[56]=q,e[57]=Y,e[58]=Z,e[59]=ee):ee=e[59];let pe;return e[60]!==H||e[61]!==y||e[62]!==n||e[63]!==ee?(pe=t.jsx(H,{open:n,onOpenChange:y,children:ee}),e[60]=H,e[61]=y,e[62]=n,e[63]=ee,e[64]=pe):pe=e[64],pe}function ut(i){return i.production}function mt(i){V("deco_site_import_failed",{error:i instanceof Error?i.message:"Unknown error"}),ie.error("Import failed: "+(i instanceof Error?i.message:"Unknown error"))}function ft(){return{}}function Ye(i,e){const n=M.c(11),{org:a}=z();let c;n[0]!==a.id?(c=we.REGISTRY(a.id),n[0]=a.id,n[1]=c):c=n[1];const s=c;let l;n[2]!==a.id||n[3]!==s?(l={connectionId:s,orgId:a.id},n[2]=a.id,n[3]=s,n[4]=l):l=n[4];const m=$(l);let f;n[5]!==i?(f={name:i},n[5]=i,n[6]=f):f=n[6];const x=e?.enabled??!0;let h;return n[7]!==m||n[8]!==f||n[9]!==x?(h={client:m,toolName:"COLLECTION_REGISTRY_APP_GET",toolArguments:f,enabled:x,staleTime:3e5,select:pt},n[7]=m,n[8]=f,n[9]=x,n[10]=h):h=n[10],st(h)}function pt(i){return i.structuredContent?.item??null}const gt=["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 De(i){const e=M.c(7),{onRecruit:n,isRecruiting:a,isLoading:c}=i;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=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]=s):s=e[0];let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("p",{className:"text-sm font-medium text-foreground",children:"Capabilities"}),e[1]=l):l=e[1];let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsxs("div",{className:"space-y-2",children:[l,t.jsx("ul",{className:"space-y-1.5",children:gt.map(ht)})]}),e[2]=m):m=e[2];const f=a||c,x=a?"Setting up...":"Add Site Diagnostics";let h;return e[3]!==n||e[4]!==f||e[5]!==x?(h=t.jsxs("div",{className:"flex flex-col gap-6",children:[s,m,t.jsx(oe,{onClick:n,disabled:f,className:"w-full cursor-pointer",children:x})]}),e[3]=n,e[4]=f,e[5]=x,e[6]=h):h=e[6],h}function ht(i){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:"+"}),i]},i)}function Wt({open:i,onOpenChange:e,existingAgent:n}){const a=Re(),{org:c}=z(),s=Ne(),l=ke(),m=Ue(),f=$({connectionId:re,orgId:c.id}),x=Qe({client:f}),[h,T]=O.useState(!1),d=Be.find(I=>I.id==="site-diagnostics"),{data:u,isLoading:p}=Ye(d.appId,{enabled:i}),r=u?.title||u?.server?.title||u?.server?.name||d.title,g=u?.server?.icons?.[0]?.src??d.icon,C=u?.server?.description??null,_=t.jsx(Me,{icon:g,name:r,size:"sm"}),N=async()=>{if(u){if(n){e(!1),s(n.id);return}T(!0);try{const I=await x.mutateAsync({name:"COLLECTION_CONNECTIONS_LIST",arguments:{where:{field:["app_id"],operator:"eq",value:d.appId},limit:1,offset:0}});let o;const A=I?.structuredContent?.items?.find(E=>E.app_id===d.appId);if(A)o=A.id;else{const E=u.server?.remotes?.[0]?.url;if(!E)throw new Error("Registry item is missing a remote URL for site-diagnostics");o=(await l.create.mutateAsync({title:r,description:C,icon:u.server?.icons?.[0]?.src??d.icon,connection_type:"HTTP",connection_url:E,app_name:u.server?.name??"site-diagnostics",app_id:d.appId,metadata:{type:"site-diagnostics",source:"store",registry_item_id:d.appId,verified:!0}})).id}const v=await m.create.mutateAsync({title:r,description:C,icon:g,status:"active",connections:[{connection_id:o,selected_tools:null,selected_resources:null,selected_prompts:null}],metadata:{type:"site-diagnostics",instructions:null,ui:{pinnedViews:[{connectionId:o,toolName:"diagnose",label:"diagnose",icon:null}],layout:{defaultMainView:{type:"ext-apps",id:o,toolName:"diagnose"}}}}});V("agent_recruit_confirmed",{template_id:"site-diagnostics",agent_id:v.id}),e(!1),s(v.id)}catch(I){V("agent_recruit_failed",{template_id:"site-diagnostics",error:I instanceof Error?I.message:String(I)}),console.error("Failed to create Site Diagnostics agent:",I)}finally{T(!1)}}},b=`Add ${r}`;return a?t.jsx(Ee,{open:i,onOpenChange:e,children:t.jsxs(Se,{className:"h-[70dvh]",children:[t.jsx(Oe,{className:"px-4 pt-4 pb-4 shrink-0",children:t.jsxs("div",{className:"flex items-center gap-3",children:[_,t.jsx(Le,{className:"text-xl font-semibold",children:b})]})}),t.jsx("div",{className:"flex flex-col flex-1 min-h-0 px-4 pb-8",children:t.jsx(De,{onRecruit:N,isRecruiting:h,isLoading:p})})]})}):t.jsx(le,{open:i,onOpenChange:e,children:t.jsxs(ce,{className:"sm:max-w-[500px] p-8",children:[t.jsx(de,{className:"mb-4",children:t.jsxs("div",{className:"flex items-center gap-3",children:[_,t.jsx(ue,{className:"text-xl font-semibold",children:b})]})}),t.jsx(De,{onRecruit:N,isRecruiting:h,isLoading:p})]})})}const xt="https://sites-lean-canva.decocache.com/api/mcp",Nt=["Build and update Lean Canvas business models visually","Interactive grid UI with all 9 canvas sections","Iterative updates — add information as you discover it","Covers: Problem, Solution, Key Metrics, Unique Value Proposition","Covers: Channels, Customer Segments, Cost Structure, Revenue Streams","Unfair Advantage analysis"];function Ve(i){const e=M.c(7),{onRecruit:n,isRecruiting:a}=i;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("p",{className:"text-sm text-muted-foreground",children:"Add a Lean Canvas agent that helps you build and iterate on your business model. Describe your idea and it produces a visual, structured canvas."}),e[0]=c):c=e[0];let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("p",{className:"text-sm font-medium text-foreground",children:"Capabilities"}),e[1]=s):s=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsxs("div",{className:"space-y-2",children:[s,t.jsx("ul",{className:"space-y-1.5",children:Nt.map(_t)})]}),e[2]=l):l=e[2];const m=a?"Setting up...":"Add Lean Canvas";let f;return e[3]!==a||e[4]!==n||e[5]!==m?(f=t.jsxs("div",{className:"flex flex-col gap-6",children:[c,l,t.jsx(oe,{onClick:n,disabled:a,className:"w-full cursor-pointer",children:m})]}),e[3]=a,e[4]=n,e[5]=m,e[6]=f):f=e[6],f}function _t(i){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:"+"}),i]},i)}function Jt({open:i,onOpenChange:e,existingAgent:n}){const a=Re(),{org:c}=z(),s=Ne(),l=ke(),m=Ue(),f=$({connectionId:re,orgId:c.id}),x=Qe({client:f}),[h,T]=O.useState(!1),d=Be.find(g=>g.id==="lean-canvas"),u=t.jsx(Me,{icon:d.icon,name:d.title,size:"sm"}),p=async()=>{if(n){e(!1),s(n.id);return}T(!0);try{const g=await x.mutateAsync({name:"COLLECTION_CONNECTIONS_LIST",arguments:{where:{field:["app_id"],operator:"eq",value:"lean-canvas"},limit:1,offset:0}});let C;const N=g?.structuredContent?.items?.find(o=>o.app_id==="lean-canvas"),b=we.SELF(c.id);N?C=N.id:C=(await l.create.mutateAsync({title:d.title,description:"Lean Canvas business model builder",icon:d.icon,connection_type:"HTTP",connection_url:xt,app_name:"lean-canvas",app_id:"lean-canvas",configuration_state:{OBJECT_STORAGE:{__type:"@deco/object-storage",value:b}},metadata:{type:"lean-canvas",source:"store",verified:!0}})).id;const I=await m.create.mutateAsync({title:d.title,description:"Lean Canvas business model builder",icon:d.icon,status:"active",connections:[{connection_id:C,selected_tools:null,selected_resources:null,selected_prompts:null},{connection_id:b,selected_tools:null,selected_resources:null,selected_prompts:null}],metadata:{type:"lean-canvas",instructions:null,ui:{pinnedViews:[{connectionId:C,toolName:"lean_canvas",label:"lean_canvas",icon:null}],layout:{defaultMainView:{type:"ext-apps",id:C,toolName:"lean_canvas"}}}}});V("agent_recruit_confirmed",{template_id:"lean-canvas",agent_id:I.id}),e(!1),s(I.id)}catch(g){V("agent_recruit_failed",{template_id:"lean-canvas",error:g instanceof Error?g.message:String(g)}),console.error("Failed to create Lean Canvas agent:",g)}finally{T(!1)}},r=`Add ${d.title}`;return a?t.jsx(Ee,{open:i,onOpenChange:e,children:t.jsxs(Se,{className:"h-[70dvh]",children:[t.jsx(Oe,{className:"px-4 pt-4 pb-4 shrink-0",children:t.jsxs("div",{className:"flex items-center gap-3",children:[u,t.jsx(Le,{className:"text-xl font-semibold",children:r})]})}),t.jsx("div",{className:"flex flex-col flex-1 min-h-0 px-4 pb-8",children:t.jsx(Ve,{onRecruit:p,isRecruiting:h})})]})}):t.jsx(le,{open:i,onOpenChange:e,children:t.jsxs(ce,{className:"sm:max-w-[500px] p-8",children:[t.jsx(de,{className:"mb-4",children:t.jsxs("div",{className:"flex items-center gap-3",children:[u,t.jsx(ue,{className:"text-xl font-semibold",children:r})]})}),t.jsx(Ve,{onRecruit:p,isRecruiting:h})]})})}const Ct=`<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{r as n,aU as q,b_ as R,b$ as Ee,c0 as ke,c1 as Se,be as xe,c2 as j}from"./index-BAVpG5PI.js";var de=1,Ie=.9,Ce=.8,Re=.17,Q=.1,Z=.999,Ae=.9999,Me=.99,$e=/[\\\/_+.#"@\[\(\{&]/,De=/[\\\/_+.#"@\[\(\{&]/g,Fe=/[\s-]/,ve=/[\s-]/g;function ee(t,l,r,f,u,c,d){if(c===l.length)return u===t.length?de:Me;var v=`${u},${c}`;if(d[v]!==void 0)return d[v];for(var b=f.charAt(c),i=r.indexOf(b,u),p=0,h,x,E,I;i>=0;)h=ee(t,l,r,f,i+1,c+1,d),h>p&&(i===u?h*=de:$e.test(t.charAt(i-1))?(h*=Ce,E=t.slice(u,i-1).match(De),E&&u>0&&(h*=Math.pow(Z,E.length))):Fe.test(t.charAt(i-1))?(h*=Ie,I=t.slice(u,i-1).match(ve),I&&u>0&&(h*=Math.pow(Z,I.length))):(h*=Re,u>0&&(h*=Math.pow(Z,i-u))),t.charAt(i)!==l.charAt(c)&&(h*=Ae)),(h<Q&&r.charAt(i-1)===f.charAt(c+1)||f.charAt(c+1)===f.charAt(c)&&r.charAt(i-1)!==f.charAt(c))&&(x=ee(t,l,r,f,i+1,c+2,d),x*Q>h&&(h=x*Q)),h>p&&(p=h),i=r.indexOf(b,i+1);return d[v]=p,p}function se(t){return t.toLowerCase().replace(ve," ")}function Ke(t,l,r){return t=r&&r.length>0?`${t+" "+r.join(" ")}`:t,ee(t,l,se(t),se(l),0,0,{})}var V='[cmdk-group=""]',_='[cmdk-group-items=""]',qe='[cmdk-group-heading=""]',me='[cmdk-item=""]',fe=`${me}:not([aria-disabled="true"])`,te="cmdk-item-select",F="data-value",Pe=(t,l,r)=>Ke(t,l,r),pe=n.createContext(void 0),L=()=>n.useContext(pe),he=n.createContext(void 0),re=()=>n.useContext(he),ge=n.createContext(void 0),be=n.forwardRef((t,l)=>{let r=K(()=>{var e,o;return{search:"",value:(o=(e=t.value)!=null?e:t.defaultValue)!=null?o:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),f=K(()=>new Set),u=K(()=>new Map),c=K(()=>new Map),d=K(()=>new Set),v=we(t),{label:b,children:i,value:p,onValueChange:h,filter:x,shouldFilter:E,loop:I,disablePointerSelection:z=!1,vimBindings:A=!0,...O}=t,H=q(),ne=q(),N=q(),M=n.useRef(null),w=We();$(()=>{if(p!==void 0){let e=p.trim();r.current.value=e,k.emit()}},[p]),$(()=>{w(6,ae)},[]);let k=n.useMemo(()=>({subscribe:e=>(d.current.add(e),()=>d.current.delete(e)),snapshot:()=>r.current,setState:(e,o,s)=>{var a,m,g,S;if(!Object.is(r.current[e],o)){if(r.current[e]=o,e==="search")J(),W(),w(1,G);else if(e==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let y=document.getElementById(N);y?y.focus():(a=document.getElementById(H))==null||a.focus()}if(w(7,()=>{var y;r.current.selectedItemId=(y=D())==null?void 0:y.id,k.emit()}),s||w(5,ae),((m=v.current)==null?void 0:m.value)!==void 0){let y=o??"";(S=(g=v.current).onValueChange)==null||S.call(g,y);return}}k.emit()}},emit:()=>{d.current.forEach(e=>e())}}),[]),T=n.useMemo(()=>({value:(e,o,s)=>{var a;o!==((a=c.current.get(e))==null?void 0:a.value)&&(c.current.set(e,{value:o,keywords:s}),r.current.filtered.items.set(e,le(o,s)),w(2,()=>{W(),k.emit()}))},item:(e,o)=>(f.current.add(e),o&&(u.current.has(o)?u.current.get(o).add(e):u.current.set(o,new Set([e]))),w(3,()=>{J(),W(),r.current.value||G(),k.emit()}),()=>{c.current.delete(e),f.current.delete(e),r.current.filtered.items.delete(e);let s=D();w(4,()=>{J(),s?.getAttribute("id")===e&&G(),k.emit()})}),group:e=>(u.current.has(e)||u.current.set(e,new Set),()=>{c.current.delete(e),u.current.delete(e)}),filter:()=>v.current.shouldFilter,label:b||t["aria-label"],getDisablePointerSelection:()=>v.current.disablePointerSelection,listId:H,inputId:N,labelId:ne,listInnerRef:M}),[]);function le(e,o){var s,a;let m=(a=(s=v.current)==null?void 0:s.filter)!=null?a:Pe;return e?m(e,r.current.search,o):0}function W(){if(!r.current.search||v.current.shouldFilter===!1)return;let e=r.current.filtered.items,o=[];r.current.filtered.groups.forEach(a=>{let m=u.current.get(a),g=0;m.forEach(S=>{let y=e.get(S);g=Math.max(y,g)}),o.push([a,g])});let s=M.current;P().sort((a,m)=>{var g,S;let y=a.getAttribute("id"),B=m.getAttribute("id");return((g=e.get(B))!=null?g:0)-((S=e.get(y))!=null?S:0)}).forEach(a=>{let m=a.closest(_);m?m.appendChild(a.parentElement===m?a:a.closest(`${_} > *`)):s.appendChild(a.parentElement===s?a:a.closest(`${_} > *`))}),o.sort((a,m)=>m[1]-a[1]).forEach(a=>{var m;let g=(m=M.current)==null?void 0:m.querySelector(`${V}[${F}="${encodeURIComponent(a[0])}"]`);g?.parentElement.appendChild(g)})}function G(){let e=P().find(s=>s.getAttribute("aria-disabled")!=="true"),o=e?.getAttribute(F);k.setState("value",o||void 0)}function J(){var e,o,s,a;if(!r.current.search||v.current.shouldFilter===!1){r.current.filtered.count=f.current.size;return}r.current.filtered.groups=new Set;let m=0;for(let g of f.current){let S=(o=(e=c.current.get(g))==null?void 0:e.value)!=null?o:"",y=(a=(s=c.current.get(g))==null?void 0:s.keywords)!=null?a:[],B=le(S,y);r.current.filtered.items.set(g,B),B>0&&m++}for(let[g,S]of u.current)for(let y of S)if(r.current.filtered.items.get(y)>0){r.current.filtered.groups.add(g);break}r.current.filtered.count=m}function ae(){var e,o,s;let a=D();a&&(((e=a.parentElement)==null?void 0:e.firstChild)===a&&((s=(o=a.closest(V))==null?void 0:o.querySelector(qe))==null||s.scrollIntoView({block:"nearest"})),a.scrollIntoView({block:"nearest"}))}function D(){var e;return(e=M.current)==null?void 0:e.querySelector(`${me}[aria-selected="true"]`)}function P(){var e;return Array.from(((e=M.current)==null?void 0:e.querySelectorAll(fe))||[])}function X(e){let o=P()[e];o&&k.setState("value",o.getAttribute(F))}function Y(e){var o;let s=D(),a=P(),m=a.findIndex(S=>S===s),g=a[m+e];(o=v.current)!=null&&o.loop&&(g=m+e<0?a[a.length-1]:m+e===a.length?a[0]:a[m+e]),g&&k.setState("value",g.getAttribute(F))}function ue(e){let o=D(),s=o?.closest(V),a;for(;s&&!a;)s=e>0?Ne(s,V):Te(s,V),a=s?.querySelector(fe);a?k.setState("value",a.getAttribute(F)):Y(e)}let ie=()=>X(P().length-1),oe=e=>{e.preventDefault(),e.metaKey?ie():e.altKey?ue(1):Y(1)},ce=e=>{e.preventDefault(),e.metaKey?X(0):e.altKey?ue(-1):Y(-1)};return n.createElement(R.div,{ref:l,tabIndex:-1,...O,"cmdk-root":"",onKeyDown:e=>{var o;(o=O.onKeyDown)==null||o.call(O,e);let s=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||s))switch(e.key){case"n":case"j":{A&&e.ctrlKey&&oe(e);break}case"ArrowDown":{oe(e);break}case"p":case"k":{A&&e.ctrlKey&&ce(e);break}case"ArrowUp":{ce(e);break}case"Home":{e.preventDefault(),X(0);break}case"End":{e.preventDefault(),ie();break}case"Enter":{e.preventDefault();let a=D();if(a){let m=new Event(te);a.dispatchEvent(m)}}}}},n.createElement("label",{"cmdk-label":"",htmlFor:T.inputId,id:T.labelId,style:Je},b),U(t,e=>n.createElement(he.Provider,{value:k},n.createElement(pe.Provider,{value:T},e))))}),Ve=n.forwardRef((t,l)=>{var r,f;let u=q(),c=n.useRef(null),d=n.useContext(ge),v=L(),b=we(t),i=(f=(r=b.current)==null?void 0:r.forceMount)!=null?f:d?.forceMount;$(()=>{if(!i)return v.item(u,d?.id)},[i]);let p=ye(u,c,[t.value,t.children,c],t.keywords),h=re(),x=C(w=>w.value&&w.value===p.current),E=C(w=>i||v.filter()===!1?!0:w.search?w.filtered.items.get(u)>0:!0);n.useEffect(()=>{let w=c.current;if(!(!w||t.disabled))return w.addEventListener(te,I),()=>w.removeEventListener(te,I)},[E,t.onSelect,t.disabled]);function I(){var w,k;z(),(k=(w=b.current).onSelect)==null||k.call(w,p.current)}function z(){h.setState("value",p.current,!0)}if(!E)return null;let{disabled:A,value:O,onSelect:H,forceMount:ne,keywords:N,...M}=t;return n.createElement(R.div,{ref:j(c,l),...M,id:u,"cmdk-item":"",role:"option","aria-disabled":!!A,"aria-selected":!!x,"data-disabled":!!A,"data-selected":!!x,onPointerMove:A||v.getDisablePointerSelection()?void 0:z,onClick:A?void 0:I},t.children)}),je=n.forwardRef((t,l)=>{let{heading:r,children:f,forceMount:u,...c}=t,d=q(),v=n.useRef(null),b=n.useRef(null),i=q(),p=L(),h=C(E=>u||p.filter()===!1?!0:E.search?E.filtered.groups.has(d):!0);$(()=>p.group(d),[]),ye(d,v,[t.value,t.heading,b]);let x=n.useMemo(()=>({id:d,forceMount:u}),[u]);return n.createElement(R.div,{ref:j(v,l),...c,"cmdk-group":"",role:"presentation",hidden:h?void 0:!0},r&&n.createElement("div",{ref:b,"cmdk-group-heading":"","aria-hidden":!0,id:i},r),U(t,E=>n.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?i:void 0},n.createElement(ge.Provider,{value:x},E))))}),Le=n.forwardRef((t,l)=>{let{alwaysRender:r,...f}=t,u=n.useRef(null),c=C(d=>!d.search);return!r&&!c?null:n.createElement(R.div,{ref:j(u,l),...f,"cmdk-separator":"",role:"separator"})}),Oe=n.forwardRef((t,l)=>{let{onValueChange:r,...f}=t,u=t.value!=null,c=re(),d=C(i=>i.search),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{t.value!=null&&c.setState("search",t.value)},[t.value]),n.createElement(R.input,{ref:l,...f,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":b.listId,"aria-labelledby":b.labelId,"aria-activedescendant":v,id:b.inputId,type:"text",value:u?t.value:d,onChange:i=>{u||c.setState("search",i.target.value),r?.(i.target.value)}})}),Be=n.forwardRef((t,l)=>{let{children:r,label:f="Suggestions",...u}=t,c=n.useRef(null),d=n.useRef(null),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{if(d.current&&c.current){let i=d.current,p=c.current,h,x=new ResizeObserver(()=>{h=requestAnimationFrame(()=>{let E=i.offsetHeight;p.style.setProperty("--cmdk-list-height",E.toFixed(1)+"px")})});return x.observe(i),()=>{cancelAnimationFrame(h),x.unobserve(i)}}},[]),n.createElement(R.div,{ref:j(c,l),...u,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":v,"aria-label":f,id:b.listId},U(t,i=>n.createElement("div",{ref:j(d,b.listInnerRef),"cmdk-list-sizer":""},i)))}),Ue=n.forwardRef((t,l)=>{let{open:r,onOpenChange:f,overlayClassName:u,contentClassName:c,container:d,...v}=t;return n.createElement(Ee,{open:r,onOpenChange:f},n.createElement(ke,{container:d},n.createElement(Se,{"cmdk-overlay":"",className:u}),n.createElement(xe,{"aria-label":t.label,"cmdk-dialog":"",className:c},n.createElement(be,{ref:l,...v}))))}),ze=n.forwardRef((t,l)=>C(r=>r.filtered.count===0)?n.createElement(R.div,{ref:l,...t,"cmdk-empty":"",role:"presentation"}):null),He=n.forwardRef((t,l)=>{let{progress:r,children:f,label:u="Loading...",...c}=t;return n.createElement(R.div,{ref:l,...c,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":u},U(t,d=>n.createElement("div",{"aria-hidden":!0},d)))}),Ye=Object.assign(be,{List:Be,Item:Ve,Input:Oe,Group:je,Separator:Le,Dialog:Ue,Empty:ze,Loading:He});function Ne(t,l){let r=t.nextElementSibling;for(;r;){if(r.matches(l))return r;r=r.nextElementSibling}}function Te(t,l){let r=t.previousElementSibling;for(;r;){if(r.matches(l))return r;r=r.previousElementSibling}}function we(t){let l=n.useRef(t);return $(()=>{l.current=t}),l}var $=typeof window>"u"?n.useEffect:n.useLayoutEffect;function K(t){let l=n.useRef();return l.current===void 0&&(l.current=t()),l}function C(t){let l=re(),r=()=>t(l.snapshot());return n.useSyncExternalStore(l.subscribe,r,r)}function ye(t,l,r,f=[]){let u=n.useRef(),c=L();return $(()=>{var d;let v=(()=>{var i;for(let p of r){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(i=p.current.textContent)==null?void 0:i.trim():u.current}})(),b=f.map(i=>i.trim());c.value(t,v,b),(d=l.current)==null||d.setAttribute(F,v),u.current=v}),u}var We=()=>{let[t,l]=n.useState(),r=K(()=>new Map);return $(()=>{r.current.forEach(f=>f()),r.current=new Map},[t]),(f,u)=>{r.current.set(f,u),l({})}};function Ge(t){let l=t.type;return typeof l=="function"?l(t.props):"render"in l?l.render(t.props):t}function U({asChild:t,children:l},r){return t&&n.isValidElement(l)?n.cloneElement(Ge(l),{ref:l.ref},r(l.props.children)):r(l)}var Je={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};export{Ye as _};
|
|
1
|
+
import{r as n,aU as q,b_ as R,b$ as Ee,c0 as ke,c1 as Se,be as xe,c2 as j}from"./index-D_cV0HX5.js";var de=1,Ie=.9,Ce=.8,Re=.17,Q=.1,Z=.999,Ae=.9999,Me=.99,$e=/[\\\/_+.#"@\[\(\{&]/,De=/[\\\/_+.#"@\[\(\{&]/g,Fe=/[\s-]/,ve=/[\s-]/g;function ee(t,l,r,f,u,c,d){if(c===l.length)return u===t.length?de:Me;var v=`${u},${c}`;if(d[v]!==void 0)return d[v];for(var b=f.charAt(c),i=r.indexOf(b,u),p=0,h,x,E,I;i>=0;)h=ee(t,l,r,f,i+1,c+1,d),h>p&&(i===u?h*=de:$e.test(t.charAt(i-1))?(h*=Ce,E=t.slice(u,i-1).match(De),E&&u>0&&(h*=Math.pow(Z,E.length))):Fe.test(t.charAt(i-1))?(h*=Ie,I=t.slice(u,i-1).match(ve),I&&u>0&&(h*=Math.pow(Z,I.length))):(h*=Re,u>0&&(h*=Math.pow(Z,i-u))),t.charAt(i)!==l.charAt(c)&&(h*=Ae)),(h<Q&&r.charAt(i-1)===f.charAt(c+1)||f.charAt(c+1)===f.charAt(c)&&r.charAt(i-1)!==f.charAt(c))&&(x=ee(t,l,r,f,i+1,c+2,d),x*Q>h&&(h=x*Q)),h>p&&(p=h),i=r.indexOf(b,i+1);return d[v]=p,p}function se(t){return t.toLowerCase().replace(ve," ")}function Ke(t,l,r){return t=r&&r.length>0?`${t+" "+r.join(" ")}`:t,ee(t,l,se(t),se(l),0,0,{})}var V='[cmdk-group=""]',_='[cmdk-group-items=""]',qe='[cmdk-group-heading=""]',me='[cmdk-item=""]',fe=`${me}:not([aria-disabled="true"])`,te="cmdk-item-select",F="data-value",Pe=(t,l,r)=>Ke(t,l,r),pe=n.createContext(void 0),L=()=>n.useContext(pe),he=n.createContext(void 0),re=()=>n.useContext(he),ge=n.createContext(void 0),be=n.forwardRef((t,l)=>{let r=K(()=>{var e,o;return{search:"",value:(o=(e=t.value)!=null?e:t.defaultValue)!=null?o:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),f=K(()=>new Set),u=K(()=>new Map),c=K(()=>new Map),d=K(()=>new Set),v=we(t),{label:b,children:i,value:p,onValueChange:h,filter:x,shouldFilter:E,loop:I,disablePointerSelection:z=!1,vimBindings:A=!0,...O}=t,H=q(),ne=q(),N=q(),M=n.useRef(null),w=We();$(()=>{if(p!==void 0){let e=p.trim();r.current.value=e,k.emit()}},[p]),$(()=>{w(6,ae)},[]);let k=n.useMemo(()=>({subscribe:e=>(d.current.add(e),()=>d.current.delete(e)),snapshot:()=>r.current,setState:(e,o,s)=>{var a,m,g,S;if(!Object.is(r.current[e],o)){if(r.current[e]=o,e==="search")J(),W(),w(1,G);else if(e==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let y=document.getElementById(N);y?y.focus():(a=document.getElementById(H))==null||a.focus()}if(w(7,()=>{var y;r.current.selectedItemId=(y=D())==null?void 0:y.id,k.emit()}),s||w(5,ae),((m=v.current)==null?void 0:m.value)!==void 0){let y=o??"";(S=(g=v.current).onValueChange)==null||S.call(g,y);return}}k.emit()}},emit:()=>{d.current.forEach(e=>e())}}),[]),T=n.useMemo(()=>({value:(e,o,s)=>{var a;o!==((a=c.current.get(e))==null?void 0:a.value)&&(c.current.set(e,{value:o,keywords:s}),r.current.filtered.items.set(e,le(o,s)),w(2,()=>{W(),k.emit()}))},item:(e,o)=>(f.current.add(e),o&&(u.current.has(o)?u.current.get(o).add(e):u.current.set(o,new Set([e]))),w(3,()=>{J(),W(),r.current.value||G(),k.emit()}),()=>{c.current.delete(e),f.current.delete(e),r.current.filtered.items.delete(e);let s=D();w(4,()=>{J(),s?.getAttribute("id")===e&&G(),k.emit()})}),group:e=>(u.current.has(e)||u.current.set(e,new Set),()=>{c.current.delete(e),u.current.delete(e)}),filter:()=>v.current.shouldFilter,label:b||t["aria-label"],getDisablePointerSelection:()=>v.current.disablePointerSelection,listId:H,inputId:N,labelId:ne,listInnerRef:M}),[]);function le(e,o){var s,a;let m=(a=(s=v.current)==null?void 0:s.filter)!=null?a:Pe;return e?m(e,r.current.search,o):0}function W(){if(!r.current.search||v.current.shouldFilter===!1)return;let e=r.current.filtered.items,o=[];r.current.filtered.groups.forEach(a=>{let m=u.current.get(a),g=0;m.forEach(S=>{let y=e.get(S);g=Math.max(y,g)}),o.push([a,g])});let s=M.current;P().sort((a,m)=>{var g,S;let y=a.getAttribute("id"),B=m.getAttribute("id");return((g=e.get(B))!=null?g:0)-((S=e.get(y))!=null?S:0)}).forEach(a=>{let m=a.closest(_);m?m.appendChild(a.parentElement===m?a:a.closest(`${_} > *`)):s.appendChild(a.parentElement===s?a:a.closest(`${_} > *`))}),o.sort((a,m)=>m[1]-a[1]).forEach(a=>{var m;let g=(m=M.current)==null?void 0:m.querySelector(`${V}[${F}="${encodeURIComponent(a[0])}"]`);g?.parentElement.appendChild(g)})}function G(){let e=P().find(s=>s.getAttribute("aria-disabled")!=="true"),o=e?.getAttribute(F);k.setState("value",o||void 0)}function J(){var e,o,s,a;if(!r.current.search||v.current.shouldFilter===!1){r.current.filtered.count=f.current.size;return}r.current.filtered.groups=new Set;let m=0;for(let g of f.current){let S=(o=(e=c.current.get(g))==null?void 0:e.value)!=null?o:"",y=(a=(s=c.current.get(g))==null?void 0:s.keywords)!=null?a:[],B=le(S,y);r.current.filtered.items.set(g,B),B>0&&m++}for(let[g,S]of u.current)for(let y of S)if(r.current.filtered.items.get(y)>0){r.current.filtered.groups.add(g);break}r.current.filtered.count=m}function ae(){var e,o,s;let a=D();a&&(((e=a.parentElement)==null?void 0:e.firstChild)===a&&((s=(o=a.closest(V))==null?void 0:o.querySelector(qe))==null||s.scrollIntoView({block:"nearest"})),a.scrollIntoView({block:"nearest"}))}function D(){var e;return(e=M.current)==null?void 0:e.querySelector(`${me}[aria-selected="true"]`)}function P(){var e;return Array.from(((e=M.current)==null?void 0:e.querySelectorAll(fe))||[])}function X(e){let o=P()[e];o&&k.setState("value",o.getAttribute(F))}function Y(e){var o;let s=D(),a=P(),m=a.findIndex(S=>S===s),g=a[m+e];(o=v.current)!=null&&o.loop&&(g=m+e<0?a[a.length-1]:m+e===a.length?a[0]:a[m+e]),g&&k.setState("value",g.getAttribute(F))}function ue(e){let o=D(),s=o?.closest(V),a;for(;s&&!a;)s=e>0?Ne(s,V):Te(s,V),a=s?.querySelector(fe);a?k.setState("value",a.getAttribute(F)):Y(e)}let ie=()=>X(P().length-1),oe=e=>{e.preventDefault(),e.metaKey?ie():e.altKey?ue(1):Y(1)},ce=e=>{e.preventDefault(),e.metaKey?X(0):e.altKey?ue(-1):Y(-1)};return n.createElement(R.div,{ref:l,tabIndex:-1,...O,"cmdk-root":"",onKeyDown:e=>{var o;(o=O.onKeyDown)==null||o.call(O,e);let s=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||s))switch(e.key){case"n":case"j":{A&&e.ctrlKey&&oe(e);break}case"ArrowDown":{oe(e);break}case"p":case"k":{A&&e.ctrlKey&&ce(e);break}case"ArrowUp":{ce(e);break}case"Home":{e.preventDefault(),X(0);break}case"End":{e.preventDefault(),ie();break}case"Enter":{e.preventDefault();let a=D();if(a){let m=new Event(te);a.dispatchEvent(m)}}}}},n.createElement("label",{"cmdk-label":"",htmlFor:T.inputId,id:T.labelId,style:Je},b),U(t,e=>n.createElement(he.Provider,{value:k},n.createElement(pe.Provider,{value:T},e))))}),Ve=n.forwardRef((t,l)=>{var r,f;let u=q(),c=n.useRef(null),d=n.useContext(ge),v=L(),b=we(t),i=(f=(r=b.current)==null?void 0:r.forceMount)!=null?f:d?.forceMount;$(()=>{if(!i)return v.item(u,d?.id)},[i]);let p=ye(u,c,[t.value,t.children,c],t.keywords),h=re(),x=C(w=>w.value&&w.value===p.current),E=C(w=>i||v.filter()===!1?!0:w.search?w.filtered.items.get(u)>0:!0);n.useEffect(()=>{let w=c.current;if(!(!w||t.disabled))return w.addEventListener(te,I),()=>w.removeEventListener(te,I)},[E,t.onSelect,t.disabled]);function I(){var w,k;z(),(k=(w=b.current).onSelect)==null||k.call(w,p.current)}function z(){h.setState("value",p.current,!0)}if(!E)return null;let{disabled:A,value:O,onSelect:H,forceMount:ne,keywords:N,...M}=t;return n.createElement(R.div,{ref:j(c,l),...M,id:u,"cmdk-item":"",role:"option","aria-disabled":!!A,"aria-selected":!!x,"data-disabled":!!A,"data-selected":!!x,onPointerMove:A||v.getDisablePointerSelection()?void 0:z,onClick:A?void 0:I},t.children)}),je=n.forwardRef((t,l)=>{let{heading:r,children:f,forceMount:u,...c}=t,d=q(),v=n.useRef(null),b=n.useRef(null),i=q(),p=L(),h=C(E=>u||p.filter()===!1?!0:E.search?E.filtered.groups.has(d):!0);$(()=>p.group(d),[]),ye(d,v,[t.value,t.heading,b]);let x=n.useMemo(()=>({id:d,forceMount:u}),[u]);return n.createElement(R.div,{ref:j(v,l),...c,"cmdk-group":"",role:"presentation",hidden:h?void 0:!0},r&&n.createElement("div",{ref:b,"cmdk-group-heading":"","aria-hidden":!0,id:i},r),U(t,E=>n.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?i:void 0},n.createElement(ge.Provider,{value:x},E))))}),Le=n.forwardRef((t,l)=>{let{alwaysRender:r,...f}=t,u=n.useRef(null),c=C(d=>!d.search);return!r&&!c?null:n.createElement(R.div,{ref:j(u,l),...f,"cmdk-separator":"",role:"separator"})}),Oe=n.forwardRef((t,l)=>{let{onValueChange:r,...f}=t,u=t.value!=null,c=re(),d=C(i=>i.search),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{t.value!=null&&c.setState("search",t.value)},[t.value]),n.createElement(R.input,{ref:l,...f,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":b.listId,"aria-labelledby":b.labelId,"aria-activedescendant":v,id:b.inputId,type:"text",value:u?t.value:d,onChange:i=>{u||c.setState("search",i.target.value),r?.(i.target.value)}})}),Be=n.forwardRef((t,l)=>{let{children:r,label:f="Suggestions",...u}=t,c=n.useRef(null),d=n.useRef(null),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{if(d.current&&c.current){let i=d.current,p=c.current,h,x=new ResizeObserver(()=>{h=requestAnimationFrame(()=>{let E=i.offsetHeight;p.style.setProperty("--cmdk-list-height",E.toFixed(1)+"px")})});return x.observe(i),()=>{cancelAnimationFrame(h),x.unobserve(i)}}},[]),n.createElement(R.div,{ref:j(c,l),...u,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":v,"aria-label":f,id:b.listId},U(t,i=>n.createElement("div",{ref:j(d,b.listInnerRef),"cmdk-list-sizer":""},i)))}),Ue=n.forwardRef((t,l)=>{let{open:r,onOpenChange:f,overlayClassName:u,contentClassName:c,container:d,...v}=t;return n.createElement(Ee,{open:r,onOpenChange:f},n.createElement(ke,{container:d},n.createElement(Se,{"cmdk-overlay":"",className:u}),n.createElement(xe,{"aria-label":t.label,"cmdk-dialog":"",className:c},n.createElement(be,{ref:l,...v}))))}),ze=n.forwardRef((t,l)=>C(r=>r.filtered.count===0)?n.createElement(R.div,{ref:l,...t,"cmdk-empty":"",role:"presentation"}):null),He=n.forwardRef((t,l)=>{let{progress:r,children:f,label:u="Loading...",...c}=t;return n.createElement(R.div,{ref:l,...c,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":u},U(t,d=>n.createElement("div",{"aria-hidden":!0},d)))}),Ye=Object.assign(be,{List:Be,Item:Ve,Input:Oe,Group:je,Separator:Le,Dialog:Ue,Empty:ze,Loading:He});function Ne(t,l){let r=t.nextElementSibling;for(;r;){if(r.matches(l))return r;r=r.nextElementSibling}}function Te(t,l){let r=t.previousElementSibling;for(;r;){if(r.matches(l))return r;r=r.previousElementSibling}}function we(t){let l=n.useRef(t);return $(()=>{l.current=t}),l}var $=typeof window>"u"?n.useEffect:n.useLayoutEffect;function K(t){let l=n.useRef();return l.current===void 0&&(l.current=t()),l}function C(t){let l=re(),r=()=>t(l.snapshot());return n.useSyncExternalStore(l.subscribe,r,r)}function ye(t,l,r,f=[]){let u=n.useRef(),c=L();return $(()=>{var d;let v=(()=>{var i;for(let p of r){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(i=p.current.textContent)==null?void 0:i.trim():u.current}})(),b=f.map(i=>i.trim());c.value(t,v,b),(d=l.current)==null||d.setAttribute(F,v),u.current=v}),u}var We=()=>{let[t,l]=n.useState(),r=K(()=>new Map);return $(()=>{r.current.forEach(f=>f()),r.current=new Map},[t]),(f,u)=>{r.current.set(f,u),l({})}};function Ge(t){let l=t.type;return typeof l=="function"?l(t.props):"render"in l?l.render(t.props):t}function U({asChild:t,children:l},r){return t&&n.isValidElement(l)?n.cloneElement(Ge(l),{ref:l.ref},r(l.props.children)):r(l)}var Je={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};export{Ye as _};
|