decocms 4.72.3 → 4.74.0
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-CX23NCuO.js → AlertCircle-BaauQIwC.js} +1 -1
- package/dist/client/assets/{AreaChart-CRvFGO5O.js → AreaChart-5GoV9SRg.js} +1 -1
- package/dist/client/assets/{ArrowUp-ChoUWc1b.js → ArrowUp-C814v0pE.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-Bq-zX9ha.js → ArrowUpRight-BLP3DLju.js} +1 -1
- package/dist/client/assets/{Check-BbAbdPfp.js → Check-DYPRi7NO.js} +1 -1
- package/dist/client/assets/{CheckCircle-Day5nLHt.js → CheckCircle-D_t3rWUI.js} +1 -1
- package/dist/client/assets/{ChevronDown-BsEi-r9q.js → ChevronDown-wHLuFr3i.js} +1 -1
- package/dist/client/assets/{ChevronRight-B9mybD1s.js → ChevronRight-BARfL9-W.js} +1 -1
- package/dist/client/assets/{ChevronUp-BWoVqFrM.js → ChevronUp-CRmxYAjE.js} +1 -1
- package/dist/client/assets/{Circle-Bj_xS3WU.js → Circle-DuelqjM2.js} +1 -1
- package/dist/client/assets/Copy01-BwtpNAKR.js +1 -0
- package/dist/client/assets/{DotsVertical-BQRa2EB9.js → DotsVertical-B_jKX962.js} +1 -1
- package/dist/client/assets/Eye-CM4SfxEo.js +1 -0
- package/dist/client/assets/{FilterLines-C5i4i3WB.js → FilterLines-CwEBxGZP.js} +1 -1
- package/dist/client/assets/{Flag01-C7YxvVFh.js → Flag01-RtD7xNTJ.js} +1 -1
- package/dist/client/assets/{Globe01-CC0A4U7g.js → Globe01-B-4z45oj.js} +1 -1
- package/dist/client/assets/{Globe04-BV89vsfi.js → Globe04-D7ZgONc6.js} +1 -1
- package/dist/client/assets/{HardDrive-CA9cG4ej.js → HardDrive-DNueik1y.js} +1 -1
- package/dist/client/assets/{Key01-Y2tTMtA8.js → Key01-DrwX5nx2.js} +1 -1
- package/dist/client/assets/{LayoutLeft-C6uN3ryJ.js → LayoutLeft-CHLKhLgL.js} +1 -1
- package/dist/client/assets/{LinkExternal01-CbW1jJhi.js → LinkExternal01-022iaJNF.js} +1 -1
- package/dist/client/assets/{List-MOccGrJp.js → List-jObuFUL_.js} +1 -1
- package/dist/client/assets/{Monitor01-DBUBWT-e.js → Monitor01-BkHN4rM2.js} +1 -1
- package/dist/client/assets/{Package-BL3B6ONo.js → Package-DYdmCLl6.js} +1 -1
- package/dist/client/assets/{Palette-B0oAitOJ.js → Palette-BWa7ee-4.js} +1 -1
- package/dist/client/assets/{Play-zjQOd6w0.js → Play-DYP9-OJo.js} +1 -1
- package/dist/client/assets/{Plus-DATZ4-ND.js → Plus-DKATXnIq.js} +1 -1
- package/dist/client/assets/{SearchLg-B4W4xrFH.js → SearchLg-crE3yQZJ.js} +1 -1
- package/dist/client/assets/{SearchMd-CKL74aOj.js → SearchMd-CbytZ1-S.js} +1 -1
- package/dist/client/assets/{Settings02-DAAnVZLO.js → Settings02-1LTNhTXj.js} +1 -1
- package/dist/client/assets/{Shield01-IlYcL8Fi.js → Shield01-CULBCC4Z.js} +1 -1
- package/dist/client/assets/{Star01-Bb61R21H.js → Star01-CtWX4nA3.js} +1 -1
- package/dist/client/assets/{Stars01-Bnuoinbt.js → Stars01-COE1U6xi.js} +1 -1
- package/dist/client/assets/{Stars02-B9xmjTkg.js → Stars02-BzQc7fZz.js} +1 -1
- package/dist/client/assets/{Sun-wOtTFTOd.js → Sun-CyoL1WFK.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-C90B2Auk.js → SwitchHorizontal01-QNGjYcml.js} +1 -1
- package/dist/client/assets/{Tool01-BT4kICfE.js → Tool01-BWGVYfev.js} +1 -1
- package/dist/client/assets/{Tool02-vM8N2pYB.js → Tool02-DkTMVP4f.js} +1 -1
- package/dist/client/assets/{Trash01-CrwbV8c_.js → Trash01-iPP4w9gK.js} +1 -1
- package/dist/client/assets/TrendUp01-C3q3M7MG.js +1 -0
- package/dist/client/assets/{Upload01-Lp0wJMYr.js → Upload01-CoVAXfWg.js} +1 -1
- package/dist/client/assets/{User01-CQV6kRtR.js → User01-2QspS0s6.js} +1 -1
- package/dist/client/assets/{UserPlus01-13KHecKW.js → UserPlus01-DoBolndD.js} +1 -1
- package/dist/client/assets/{Users01-CDDfUziK.js → Users01-C3FOprDj.js} +1 -1
- package/dist/client/assets/{Users03-ZlQye2vY.js → Users03-BYqJADve.js} +1 -1
- package/dist/client/assets/{X-CNdIeej8.js → X-Bqs01fCh.js} +1 -1
- package/dist/client/assets/{XCircle-C9sRiEE0.js → XCircle-DHCvZwgH.js} +1 -1
- package/dist/client/assets/{XClose-4pjmwtT4.js → XClose-P0NM9uUE.js} +1 -1
- package/dist/client/assets/{Zap-DHGChPV2.js → Zap-CI5WhuKJ.js} +1 -1
- package/dist/client/assets/{ZapSquare-BV8kr37_.js → ZapSquare-BhWmmFEB.js} +1 -1
- package/dist/client/assets/{ZoomOut-7nLppLEs.js → ZoomOut-C7W-ZWAB.js} +1 -1
- package/dist/client/assets/{access-gate-BAwcBNbs.js → access-gate-BK7GcTMo.js} +1 -1
- package/dist/client/assets/{add-section-modal-lhtrhXMg.js → add-section-modal-CfvYLCg2.js} +1 -1
- package/dist/client/assets/agent-icon-5pSyq_FH.js +1 -0
- package/dist/client/assets/agents-list-pNinhUjp.js +1 -0
- package/dist/client/assets/ai-providers-CRHCw5VF.js +1 -0
- package/dist/client/assets/{alert-BhYIEI2X.js → alert-D4ttbBAt.js} +1 -1
- package/dist/client/assets/{alert-dialog-IVNf28U9.js → alert-dialog-GCrUNzbs.js} +1 -1
- package/dist/client/assets/app-editor-DqcvDhID.js +1 -0
- package/dist/client/assets/{auth-DIzgjm9h.js → auth-Cf4In3Ce.js} +1 -1
- package/dist/client/assets/{auth-catchall-CwgiOIdP.js → auth-catchall-CL7qcaW-.js} +1 -1
- package/dist/client/assets/{auth-entry-DhEOJXIL.js → auth-entry-BBn3Oy3I.js} +1 -1
- package/dist/client/assets/{auth-split-layout-B-Ji1dsx.js → auth-split-layout-ClDCjxcR.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-Bb5P11Gd.js → authenticate-and-persist-oauth-DeTua2ma.js} +1 -1
- package/dist/client/assets/{automation-list-row-BrrHJBg_.js → automation-list-row-bCHP9GaB.js} +1 -1
- package/dist/client/assets/{automation-runs-_xFJy_Wv.js → automation-runs-K5fQtR3Q.js} +10 -10
- package/dist/client/assets/automations-BchD7Vmn.js +1 -0
- package/dist/client/assets/{autosend-BX8nQnW3.js → autosend-CnfmH4zE.js} +1 -1
- package/dist/client/assets/{avatar-CfHetrJ0.js → avatar-BB1BJsL_.js} +1 -1
- package/dist/client/assets/{badge-BR8ZoQPH.js → badge-miK_gWS7.js} +1 -1
- package/dist/client/assets/{block-document-BeMgCoP0.js → block-document-BnBi9DlX.js} +1 -1
- package/dist/client/assets/{brand-context-Dfa00_kA.js → brand-context-Bwk8h-AT.js} +1 -1
- package/dist/client/assets/{buckets-BJ3UCF_c.js → buckets-BVny45s4.js} +1 -1
- package/dist/client/assets/bulk-category-panel-CI-tBRB_.js +1 -0
- package/dist/client/assets/{calendar-D9BWcxij.js → calendar-i7Bgz_TN.js} +1 -1
- package/dist/client/assets/{capability-load-error-CWaH-_Bd.js → capability-load-error-ykEHLKnb.js} +1 -1
- package/dist/client/assets/{card-1ZIM8JYb.js → card-BjD2_XuX.js} +1 -1
- package/dist/client/assets/category-editor-CSZtSGt6.js +1 -0
- package/dist/client/assets/{chat-context-BhPkOl45.js → chat-context-De0V13yX.js} +1 -1
- package/dist/client/assets/{checkbox-YuHG4ViR.js → checkbox-DnsQEgvs.js} +1 -1
- package/dist/client/assets/{cli-auth-success-CP82qKpR.js → cli-auth-success-DlpvQRp0.js} +1 -1
- package/dist/client/assets/collection-detail-HRLTqsYR.js +1 -0
- package/dist/client/assets/{collection-display-button-CbTgXJt9.js → collection-display-button-CNmqBrih.js} +1 -1
- package/dist/client/assets/{collection-search-D4kzf4BZ.js → collection-search-MTrnV0Y_.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-Cyqk04aC.js → collection-table-wrapper-CZMGnyXO.js} +1 -1
- package/dist/client/assets/{collection-tabs-CwblhJGY.js → collection-tabs-Dvz33uvw.js} +1 -1
- package/dist/client/assets/{command-DRUw9pTQ.js → command-DpdcRmV-.js} +1 -1
- package/dist/client/assets/commerce-onboarding-QSGTn2pK.js +1 -0
- package/dist/client/assets/{companions-core-CrqiPrVn.js → companions-core-CgTHLTTN.js} +1 -1
- package/dist/client/assets/connect-desktop-dialog-BASAvtSw.js +1 -0
- package/dist/client/assets/{connection-card-BddaDWk3.js → connection-card-DQ8XLP8C.js} +1 -1
- package/dist/client/assets/connection-detail-CwpaZMQ9.js +1 -0
- package/dist/client/assets/{connection-form-helpers-B3t0vd0x.js → connection-form-helpers-B4Lj6wNN.js} +1 -1
- package/dist/client/assets/connections-C4IOF63g.js +1 -0
- package/dist/client/assets/{decopilot-sse-pool-B1izZBf2.js → decopilot-sse-pool-_LHJFrBF.js} +1 -1
- package/dist/client/assets/{dialog-DfnhzCwv.js → dialog-CUb_uQeJ.js} +1 -1
- package/dist/client/assets/{domain-settings-Dw-3NGKK.js → domain-settings-Cj1WoInJ.js} +1 -1
- package/dist/client/assets/{drawer-Cu1H6Zpl.js → drawer-BSFvVMvA.js} +1 -1
- package/dist/client/assets/{dropdown-menu-BlorfjU6.js → dropdown-menu-D-nlMdm5.js} +1 -1
- package/dist/client/assets/{empty-state-D0Yjh42T.js → empty-state-C_IbZdBr.js} +1 -1
- package/dist/client/assets/{extract-connection-data-DkYKg47U.js → extract-connection-data-BIadZZgr.js} +1 -1
- package/dist/client/assets/file-explorer-BWAl04Ll.js +2 -0
- package/dist/client/assets/{file-type-icon-CyQSc8WD.js → file-type-icon-mrfxFHRk.js} +1 -1
- package/dist/client/assets/{files-C98dPcEM.js → files-B6sMQ0N9.js} +1 -1
- package/dist/client/assets/{form-ZPjO3One.js → form-CEO5VtKG.js} +1 -1
- package/dist/client/assets/{general-mC0-nMIz.js → general-CpcExAES.js} +1 -1
- package/dist/client/assets/{github-repo-picker-DneVvY3I.js → github-repo-picker-CH-zkM68.js} +1 -1
- package/dist/client/assets/{hooks-DsQUp7L9.js → hooks-G1nBJ-F3.js} +1 -1
- package/dist/client/assets/{index-BOaCGG-5.js → index-B3_jWN9S.js} +1 -1
- package/dist/client/assets/index-B7Kp0gmf.css +1 -0
- package/dist/client/assets/index-B8fJFfFf.js +1 -0
- package/dist/client/assets/{index-BeTttHS9.js → index-BW23Hqv6.js} +4 -4
- package/dist/client/assets/{index-PCoZIk-M.js → index-BZjBKD1m.js} +23 -23
- package/dist/client/assets/{index-B8Idfh3P.js → index-B_nVJPYO.js} +1 -1
- package/dist/client/assets/{index-CtT9oMhI.js → index-BlItCfDb.js} +1 -1
- package/dist/client/assets/index-C7cs-gci.js +2 -0
- package/dist/client/assets/{index-1xWIMGUU.js → index-C9P6Y57L.js} +1 -1
- package/dist/client/assets/{index-DZp5yHGX.js → index-CTpTvSxb.js} +1 -1
- package/dist/client/assets/{index-emjsrsD0.js → index-DAFjHwsT.js} +1 -1
- package/dist/client/assets/{index-BHjtHKuw.js → index-DFuynMdy.js} +1 -1
- package/dist/client/assets/{index-CrWfdotU.js → index-DQVI41jj.js} +2 -2
- package/dist/client/assets/{index-76rFpqug.js → index-DxwLi9-g.js} +1 -1
- package/dist/client/assets/{index-C5JCmVQ0.js → index-lRedQ_8t.js} +3 -3
- package/dist/client/assets/{index-redirect-Dog_XssD.js → index-redirect-Mh7_3AcS.js} +1 -1
- package/dist/client/assets/{input-DWv95vY4.js → input-DOZlS9i9.js} +1 -1
- package/dist/client/assets/{integration-icon-D74EpYgv.js → integration-icon-CN9OtiIm.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-DGmwAQAA.js → invite-member-dialog-LDdBeQZc.js} +1 -1
- package/dist/client/assets/{label-CjR-YPrA.js → label-u5PrAFB7.js} +1 -1
- package/dist/client/assets/{layout-BvMp9WH9.js → layout-46QoqgX4.js} +1 -1
- package/dist/client/assets/{login-C4VBhHZf.js → login-BdT0h30g.js} +1 -1
- package/dist/client/assets/{mcp-oauth-CDqgI2Xn.js → mcp-oauth-DHDPNOkD.js} +1 -1
- package/dist/client/assets/{members-NXDCco5L.js → members-RcOcNeXi.js} +1 -1
- package/dist/client/assets/{monaco-editor-DYdw6m6P.js → monaco-editor-D2naC6ph.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-D0csDfCQ.js → monitoring-stats-row-CztePoJD.js} +1 -1
- package/dist/client/assets/{oauth-callback-D-qdOpL-.js → oauth-callback-BSA-GLPM.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-CKZ-Ikk0.js → oauth-callback-ai-provider-DgPoj4r4.js} +1 -1
- package/dist/client/assets/{onboarding-0XZpcTRa.js → onboarding-Br3afGr-.js} +1 -1
- package/dist/client/assets/{org-install-BHAQ5v4F.js → org-install-C190-hBM.js} +1 -1
- package/dist/client/assets/{org-layout-x9tM7YJ0.js → org-layout-cPdojne_.js} +1 -1
- package/dist/client/assets/{organization-choice-CRDRv9IH.js → organization-choice-Csr-kPrj.js} +1 -1
- package/dist/client/assets/{orgs-B4dQ6uWB.js → orgs-WjQsKIGK.js} +1 -1
- package/dist/client/assets/{page-seo-form-BoV5cy5K.js → page-seo-form-BocKaLGp.js} +1 -1
- package/dist/client/assets/page-seo-sheet-BTjq4xGR.js +1 -0
- package/dist/client/assets/{popover-DL95paTt.js → popover-BlN-L-7w.js} +1 -1
- package/dist/client/assets/post-editor-DD6k2jq_.js +1 -0
- package/dist/client/assets/{primitives-CnjPXZBb.js → primitives-C1zKVkUs.js} +1 -1
- package/dist/client/assets/{profile-CCbdBUdo.js → profile-B1TQAd_m.js} +1 -1
- package/dist/client/assets/project-app-view-DlsPCtAC.js +1 -0
- package/dist/client/assets/record-editor-CE1EwunZ.js +1 -0
- package/dist/client/assets/redirect-editor-OokObJNP.js +1 -0
- package/dist/client/assets/registry-OH_DROyn.js +2 -0
- package/dist/client/assets/{registry-layout-C2G4koz9.js → registry-layout-BjGbzV73.js} +2 -2
- package/dist/client/assets/reports-BWI6IDQq.css +1 -0
- package/dist/client/assets/reports-DEwGwzSI.js +43 -0
- package/dist/client/assets/{require-capability-Coot4cTo.js → require-capability-B_dSH45y.js} +1 -1
- package/dist/client/assets/{required-auth-layout-BLRuxjNn.js → required-auth-layout-czUUgGrX.js} +1 -1
- package/dist/client/assets/{reset-password-BHfCVVq_.js → reset-password-Md6XPqI1.js} +1 -1
- package/dist/client/assets/roles-jjnXT7oA.js +1 -0
- package/dist/client/assets/{search-input-B9lRxCGI.js → search-input-BQOeLOTi.js} +1 -1
- package/dist/client/assets/{secrets-C7tLxfHf.js → secrets-CWkoKQMY.js} +1 -1
- package/dist/client/assets/{sections-editor-CEVFpdKw.js → sections-editor-DJYtpXox.js} +2 -2
- package/dist/client/assets/{select-D59HzWyb.js → select-CxRcXiYy.js} +1 -1
- package/dist/client/assets/{select-model-D8LB7zlx.js → select-model-CJ1n8oWC.js} +1 -1
- package/dist/client/assets/self-tool-result-BCQjUWN7.js +1 -0
- package/dist/client/assets/seo-editor-DYp9hHSY.js +1 -0
- package/dist/client/assets/{settings-layout-LbxIWaT0.js → settings-layout-BXO3VMKS.js} +1 -1
- package/dist/client/assets/{settings-section-CHSsdIIo.js → settings-section-Bs1JjdR4.js} +1 -1
- package/dist/client/assets/{shell-controls-C3TSKK-x.js → shell-controls-BoSvKLlP.js} +1 -1
- package/dist/client/assets/{shell-layout-TAILJ-da.js → shell-layout-DamsdnEZ.js} +1 -1
- package/dist/client/assets/{sidebar-i7yNFNs9.js → sidebar-joQ3ZQPE.js} +1 -1
- package/dist/client/assets/{skeleton-D824Y8b-.js → skeleton-BxJ_vH4t.js} +1 -1
- package/dist/client/assets/{sso-BzsdnWCZ.js → sso-CoEL8qOV.js} +1 -1
- package/dist/client/assets/{store-BNZtOJXh.js → store-mvrTZUgb.js} +1 -1
- package/dist/client/assets/store-registry-C-81qMOw.js +2 -0
- package/dist/client/assets/{studio-tools--pllMpfK.js → studio-tools-BMyTPyPy.js} +1 -1
- package/dist/client/assets/{switch-DLw5svpB.js → switch-C6-Jkvpv.js} +1 -1
- package/dist/client/assets/{table-B8kPpHAC.js → table-BBmNComr.js} +1 -1
- package/dist/client/assets/{tabs-C19FaLXY.js → tabs-kApe5O6i.js} +1 -1
- package/dist/client/assets/{textarea-DGICe7Jx.js → textarea-C5puqxj1.js} +1 -1
- package/dist/client/assets/{toggle-group-SYBG9bZR.js → toggle-group-DScHdpkW.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-DapYdi-A.js → toolbar-icon-button-D3Y1-YHW.js} +1 -1
- package/dist/client/assets/{toolbar-V6M48IQV.js → toolbar-zpMjKMlc.js} +1 -1
- package/dist/client/assets/{tools-list-CvZ2H4zV.js → tools-list-BOMB05RR.js} +1 -1
- package/dist/client/assets/{tooltip-DjWNMg5T.js → tooltip-REPIyd2Z.js} +1 -1
- package/dist/client/assets/{use-ai-providers-CQmOOELp.js → use-ai-providers-Bo4wIQxq.js} +1 -1
- package/dist/client/assets/{use-automations-kY9mTa0N.js → use-automations-DA7j42Hg.js} +1 -1
- package/dist/client/assets/{use-autosave-DhXH8ptD.js → use-autosave-DBERSs2x.js} +1 -1
- package/dist/client/assets/{use-capability-BtQYj-6N.js → use-capability-CCJ-X1mC.js} +1 -1
- package/dist/client/assets/{use-clock-tick-BNpEZMto.js → use-clock-tick-MLdLuh40.js} +1 -1
- package/dist/client/assets/{use-collections-Kwxr6RPv.js → use-collections-D-OJag2e.js} +1 -1
- package/dist/client/assets/{use-connection-DhRKlWkl.js → use-connection-DmUK9JRy.js} +1 -1
- package/dist/client/assets/{use-copy-C62zVzDi.js → use-copy-DzWDd5On.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-B-2yNc1r.js → use-create-virtual-mcp-BqyRJeCT.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-Cumlh74L.js → use-debounced-autosave-JbhBBkyc.js} +1 -1
- package/dist/client/assets/{use-debounced-value-DEfVi-aN.js → use-debounced-value-DxBZ974h.js} +1 -1
- package/dist/client/assets/{use-deco-credits-rxapxW2c.js → use-deco-credits-DR4kDN3B.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-Cww7ZCTK.js → use-decopilot-events-BhVWtKJy.js} +1 -1
- package/dist/client/assets/{use-delete-connection-DehUW7zF.js → use-delete-connection-Ds3puvR-.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-DI6Yo_2O.js → use-deployment-admin-C5hKFITD.js} +1 -1
- package/dist/client/assets/{use-file-configs-BaRnwcsF.js → use-file-configs-t6weWLBN.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-WwPPe2Wp.js → use-infinite-scroll-B4v-_NDY.js} +1 -1
- package/dist/client/assets/{use-join-requests-B29gIAVf.js → use-join-requests-nORXzBkG.js} +1 -1
- package/dist/client/assets/{use-mcp-client-DlCO79GA.js → use-mcp-client-D6H50Mmm.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-PUeX7iQD.js → use-mcp-tools-Cs2tX1fK.js} +1 -1
- package/dist/client/assets/{use-members-CP1GrgsV.js → use-members-Bz6iBsM4.js} +1 -1
- package/dist/client/assets/{use-mobile-vXwkCjTm.js → use-mobile-RU-Nn_Un.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-DZwula5s.js → use-navigate-to-agent-DYPKcx_j.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-BeUafwOm.js → use-org-auth-client-DrmuxI_m.js} +1 -1
- package/dist/client/assets/{use-org-sso-CpksLDM-.js → use-org-sso-BLc80T83.js} +1 -1
- package/dist/client/assets/{use-organization-roles-BGu4f7lA.js → use-organization-roles-DU1BIeXK.js} +1 -1
- package/dist/client/assets/use-organization-settings-CHx_I7VH.js +1 -0
- package/dist/client/assets/{use-registry-connections-ml5ez91l.js → use-registry-connections-C9dbuMZN.js} +1 -1
- package/dist/client/assets/{use-secrets-DXp4vVpG.js → use-secrets-Cs1UIn3n.js} +1 -1
- package/dist/client/assets/{use-status-sounds-DUjqcw9j.js → use-status-sounds-C3Efc5TW.js} +1 -1
- package/dist/client/assets/{use-view-mode-CJMBEHOJ.js → use-view-mode-y0S1o9OD.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-KZlYJNMn.js → use-virtual-mcp-D9inM-9h.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-XeUdT1mI.js +1 -0
- package/dist/client/assets/{useRouterState-ClIV-prS.js → useRouterState-DB6AEQYy.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DnwWEYgY.js +1 -0
- package/dist/client/assets/{users-CliPNaM4.js → users-DV3bsEcg.js} +1 -1
- package/dist/client/assets/variant-calendar-B7qy61Jb.js +1 -0
- package/dist/client/assets/{view-mode-toggle-BVGFEj0-.js → view-mode-toggle-BIom5MzH.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/Eye-CyP9kYwn.js +0 -1
- package/dist/client/assets/TrendUp01-CBDxjtVg.js +0 -1
- package/dist/client/assets/agent-icon-DMtjBPX3.js +0 -1
- package/dist/client/assets/agents-list-BUXICXib.js +0 -1
- package/dist/client/assets/ai-providers-DCgzVaX6.js +0 -1
- package/dist/client/assets/app-editor-D59Q_5eI.js +0 -1
- package/dist/client/assets/automations-BaGIRfvu.js +0 -1
- package/dist/client/assets/bulk-category-panel-DYbnXnND.js +0 -1
- package/dist/client/assets/category-editor-DzbcKPof.js +0 -1
- package/dist/client/assets/collection-detail-DIz6zskG.js +0 -1
- package/dist/client/assets/commerce-onboarding-e-v-lCWx.js +0 -1
- package/dist/client/assets/connect-desktop-dialog-BSEnA0YE.js +0 -1
- package/dist/client/assets/connection-detail-B8oW9DNb.js +0 -1
- package/dist/client/assets/connections-DXcLr2b7.js +0 -1
- package/dist/client/assets/file-explorer-C3OUWmFe.js +0 -2
- package/dist/client/assets/index-BO2t38sV.css +0 -1
- package/dist/client/assets/index-ByObdePs.js +0 -1
- package/dist/client/assets/index-D-JmKBPU.js +0 -2
- package/dist/client/assets/page-seo-sheet-BgE0-fxQ.js +0 -1
- package/dist/client/assets/post-editor-Byy_Ap7S.js +0 -1
- package/dist/client/assets/project-app-view-3TNqVL2p.js +0 -1
- package/dist/client/assets/record-editor-TOFRK4bb.js +0 -1
- package/dist/client/assets/redirect-editor-luJZRzL9.js +0 -1
- package/dist/client/assets/registry-B_upSRSY.js +0 -2
- package/dist/client/assets/reports-CPxel0Tp.js +0 -43
- package/dist/client/assets/reports-UJeN0SPp.css +0 -1
- package/dist/client/assets/roles-Cbr82vAy.js +0 -1
- package/dist/client/assets/self-tool-result-BPaV8G2-.js +0 -1
- package/dist/client/assets/seo-editor-Dtca_H4G.js +0 -1
- package/dist/client/assets/store-registry-DzS8hV6Q.js +0 -2
- package/dist/client/assets/use-organization-settings-BFGZ9YuD.js +0 -1
- package/dist/client/assets/useInfiniteQuery-D-yVKxn2.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-QFUkmQtZ.js +0 -1
- package/dist/client/assets/variant-calendar-DsUFadYs.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@font-face{font-family:Switzer;font-style:normal;font-weight:100 900;font-display:swap;src:url(/assets/Switzer-Variable-7Oa6q7Y4.woff2) format("woff2")}@keyframes reportIndeterminate{0%{transform:translate(-105%)}to{transform:translate(255%)}}.animate-indeterminate{animation:reportIndeterminate 1.5s cubic-bezier(.4,0,.2,1) infinite}.deck-eyebrow{font-size:11px;font-weight:500;letter-spacing:.04em;text-transform:uppercase;color:#8caa25}@media(min-width:640px){.deck-eyebrow{font-size:12px}}.reveal{opacity:0;transform:translateY(12px);transition:opacity .48s cubic-bezier(.215,.61,.355,1),transform .48s cubic-bezier(.215,.61,.355,1);will-change:transform,opacity}.reveal[data-show=true]{opacity:1;transform:none}@media(prefers-reduced-motion:reduce){.reveal,.reveal[data-show=true]{opacity:1;transform:none;transition:none}.animate-indeterminate{animation:none;transform:translate(0)}}@keyframes logoCycleEnter{0%{transform:translateY(30%);opacity:0;filter:grayscale(1) blur(5px)}to{transform:translateY(0);opacity:.38;filter:grayscale(1) blur(0px)}}.logo-carousel-enter{animation:logoCycleEnter .5s cubic-bezier(.25,1,.5,1) forwards}.unlock-rays,.unlock-halo{opacity:0}[data-play=true] .unlock-rays{animation:unlockRays .95s cubic-bezier(.19,1,.22,1) .96s both}[data-play=true] .unlock-halo{animation:unlockHalo .9s cubic-bezier(.19,1,.22,1) 1.01s both}@keyframes unlockRays{0%{opacity:0;transform:translate(-50%) scale(.55) rotate(-8deg)}22%{opacity:.85}to{opacity:0;transform:translate(-50%) scale(1.9) rotate(20deg)}}@keyframes unlockHalo{0%{opacity:0;transform:translate(-50%) scale(.5)}45%{opacity:.8}to{opacity:.32;transform:translate(-50%) scale(1)}}.unlock-box,.unlock-box-glow,.unlock-box-icon,.unlock-box-sources{opacity:0}[data-play=true] .unlock-box{animation:unlockBoxEnter .36s cubic-bezier(.34,1.56,.64,1) .8s both}[data-play=true] .unlock-box-sources{animation:unlockBoxEnter .36s cubic-bezier(.34,1.56,.64,1) .9s both}[data-play=true] .unlock-box-lid-face{animation:unlockBoxLidOpen .44s cubic-bezier(.34,1.1,.64,1) .98s both}[data-play=true] .unlock-box-glow{animation:unlockBoxGlow .5s ease-out 1.06s both}[data-play=true] .unlock-box-icon{animation:unlockBoxIcon .46s cubic-bezier(.34,1.45,.64,1) both}@keyframes unlockBoxEnter{0%{opacity:0;transform:translateY(10px) scale(.85)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes unlockBoxLidOpen{0%{transform:rotateX(0)}72%{transform:rotateX(138deg)}to{transform:rotateX(130deg)}}@keyframes unlockBoxGlow{0%{opacity:0}40%{opacity:1}to{opacity:.6}}@keyframes unlockBoxIcon{0%{opacity:0;transform:translateY(56px) translate(0) scale(.5)}28%{opacity:1}62%{opacity:1;transform:translateY(-10px) translate(var(--icon-dx, 0px)) scale(1.07)}to{opacity:1;transform:translateY(0) translate(var(--icon-dx, 0px)) scale(1)}}@media(prefers-reduced-motion:reduce){[data-play=true] .unlock-halo,[data-play=true] .unlock-box,[data-play=true] .unlock-box-icon,[data-play=true] .unlock-box-glow,[data-play=true] .unlock-box-sources{animation:none;opacity:1;transform:none}[data-play=true] .unlock-rays,[data-play=true] .unlock-box-lid-face{animation:none;opacity:0}}.holo-stage{perspective:1050px}.holo-tilt{--holo: repeating-linear-gradient( 125deg, rgba(255, 119, 115, .6) 0%, rgba(255, 223, 110, .6) 8%, rgba(158, 255, 120, .6) 16%, rgba(120, 255, 244, .6) 24%, rgba(120, 158, 255, .6) 32%, rgba(216, 117, 255, .6) 40%, rgba(255, 119, 115, .6) 48% );--mx: 50%;--my: 50%;--posx: 50%;--posy: 50%;--active: 0;transform-style:preserve-3d;transform:rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));transition:box-shadow .26s ease;background:linear-gradient(145deg,#efe9e0,#fff 16%,#cfc9bf 40%,#fff 54%,#d7d1c7 74%,#fff 88%,#e6e1d8),var(--holo);background-blend-mode:overlay;background-size:100% 100%,300% 300%;background-position:0 0,var(--posx) var(--posy);box-shadow:0 40px 80px -28px #0d09066b,0 12px 30px -14px #0d090638,0 2px 5px #0d090612;will-change:transform}.holo-foil{background-image:var(--holo);background-size:260% 260%;background-position:var(--posx) var(--posy);mix-blend-mode:overlay;opacity:calc(.35 + var(--active) * .5);-webkit-mask-image:radial-gradient(circle at var(--mx) var(--my),#000 0%,rgba(0,0,0,.35) 30%,transparent 58%);mask-image:radial-gradient(circle at var(--mx) var(--my),#000 0%,rgba(0,0,0,.35) 30%,transparent 58%);transition:opacity .32s ease}.holo-lines{background-image:repeating-linear-gradient(100deg,transparent 0px,transparent 3px,rgba(255,255,255,.5) 3px,rgba(255,255,255,.5) 4px);background-size:200% 100%;background-position:var(--posx) 0;mix-blend-mode:overlay;opacity:calc(var(--active) * .28);transition:opacity .32s ease}.holo-glare{background:radial-gradient(circle at var(--mx) var(--my),rgba(255,255,255,.75),rgba(255,255,255,0) 42%);mix-blend-mode:soft-light;opacity:calc(var(--active) * .9);transition:opacity .32s ease}.holo-art-base{background:linear-gradient(135deg,#ffd0e2,#e3d4ff,#cfe0ff,#ccf4e7,#fff1cc 72%,#ffd6c9 88%,#ffd0e2);background-size:200% 200%;background-position:var(--posx) var(--posy);transition:background-position .32s ease}@media(hover:none){.holo-art-base{animation:decoFoilIdle 7s ease-in-out infinite}}.holo-artfoil{background-image:var(--holo);background-size:220% 220%;background-position:var(--posx) var(--posy);mix-blend-mode:color-dodge;opacity:calc(.16 + var(--active) * .5);border-radius:inherit;transition:opacity .32s ease}.holo-sparkle{background-image:radial-gradient(circle at 20% 35%,#fffffff2 0,#fff0 .8px),radial-gradient(circle at 68% 12%,#bee6ffe6 0,#fff0 .8px),radial-gradient(circle at 82% 74%,#ffebbee6 0,#fff0 .8px);background-size:47px 61px,71px 53px,59px 79px;background-position:var(--posx) var(--posy),calc(100% - var(--posx)) var(--posy),var(--posx) calc(100% - var(--posy));mix-blend-mode:color-dodge;opacity:calc(var(--active) * .85);border-radius:inherit;transition:opacity .32s ease}@media(hover:none){.holo-sparkle{opacity:.3;animation:decoFoilIdle 7s ease-in-out infinite}}.holo-artglare{background:radial-gradient(circle at var(--mx) var(--my),rgba(255,255,255,.55),rgba(255,255,255,0) 45%);mix-blend-mode:overlay;opacity:calc(var(--active) * .9);border-radius:inherit;transition:opacity .32s ease}.holo-findings{scrollbar-width:thin;scrollbar-color:rgba(13,9,6,.18) transparent;-webkit-mask-image:linear-gradient(to bottom,#000 calc(100% - 20px),transparent 100%);mask-image:linear-gradient(to bottom,#000 calc(100% - 20px),transparent 100%)}.holo-findings::-webkit-scrollbar{width:6px}.holo-findings::-webkit-scrollbar-thumb{background:#0d090629;border-radius:6px}.holo-card{opacity:0;transform-style:preserve-3d;backface-visibility:hidden;will-change:transform,opacity}.holo-card[data-enter=true]{animation:decoCardIn .82s cubic-bezier(.25,.65,.3,1.07) both}@media(min-width:1024px){.holo-card[data-enter=true]{animation-duration:.62s}}@keyframes decoCardIn{0%{opacity:0;transform:translateY(72px) scale(.9) rotateY(-82deg)}to{opacity:1;transform:translateY(0) scale(1) rotateY(0)}}.holo-sweep-bar{position:absolute;inset:-20% -40%;background:linear-gradient(100deg,transparent 30%,rgba(255,255,255,.65) 48%,rgba(255,255,255,.9) 50%,rgba(255,255,255,.65) 52%,transparent 70%);mix-blend-mode:overlay;opacity:0;transform:translate(-120%)}.holo-card[data-enter=true] .holo-sweep-bar{animation:decoSweep .9s ease-out .46s both}@keyframes decoSweep{0%{opacity:0;transform:translate(-120%) skew(-14deg)}35%{opacity:.85}to{opacity:0;transform:translate(120%) skew(-14deg)}}@media(hover:none){.holo-foil{opacity:.22;animation:decoFoilIdle 7s ease-in-out infinite}.holo-artfoil{opacity:.42;animation:decoFoilIdle 7s ease-in-out infinite}.holo-lines{opacity:.12;animation:decoLinesIdle 7s ease-in-out infinite}}@keyframes decoFoilIdle{0%,to{background-position:18% 30%}50%{background-position:82% 74%}}@keyframes decoLinesIdle{0%,to{background-position:0 0}50%{background-position:100% 0}}@media(prefers-reduced-motion:reduce){.holo-card,.holo-card[data-enter=true]{opacity:1;animation:none}.holo-tilt{transition:none}.holo-card[data-enter=true] .holo-sweep-bar{animation:none;opacity:0}.holo-foil,.holo-artfoil,.holo-lines{animation:none}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as $,C as Se,K as re,b4 as dt,m as Re,j as s,l as K,i as fe,B as ne,c as H,H as Pe,ac as Ie,I as se,ae as De,af as ke,n as $e,M as mt,J as ut,d as Fe,t as he,p as Oe,w as Ke,x as ft,E as ht,b as gt,u as xt}from"./index-C5JCmVQ0.js";import{u as pt}from"./use-organization-roles-BGu4f7lA.js";import{u as je}from"./use-org-auth-client-BeUafwOm.js";import{B as ge}from"./badge-BR8ZoQPH.js";import{f as Qe,a as He,b as qe,c as Ze,d as Je,A as Xe,e as We,g as et}from"./alert-dialog-IVNf28U9.js";import{D as bt,a as Tt,c as Et,d as _t}from"./dropdown-menu-BlorfjU6.js";import{i as It}from"./DotsVertical-BQRa2EB9.js";import{s as Ae}from"./Plus-DATZ4-ND.js";import{s as St}from"./Trash01-CrwbV8c_.js";import{C as Nt}from"./collection-table-wrapper-Cyqk04aC.js";import{P as te}from"./index-1xWIMGUU.js";import{E as Ge}from"./empty-state-D0Yjh42T.js";import{S as ve}from"./search-input-B9lRxCGI.js";import{P as tt,D as st}from"./ai-providers-logos-DD3qZ33J.js";import{I as ye}from"./integration-icon-D74EpYgv.js";import{u as Ct}from"./use-infinite-scroll-WwPPe2Wp.js";import{C as Me}from"./checkbox-YuHG4ViR.js";import{b as At}from"./Settings02-DAAnVZLO.js";import{u as Rt}from"./useSuspenseInfiniteQuery-QFUkmQtZ.js";import{u as Ot}from"./use-mcp-client-DlCO79GA.js";import{S as jt}from"./constants-D_FQAPnt.js";import{C as vt}from"./collection-search-D4kzf4BZ.js";import{u as nt}from"./use-members-CP1GrgsV.js";import{g as lt}from"./get-initials-D-f_fDFw.js";import{u as yt}from"./use-connection-DhRKlWkl.js";import{u as Mt,c as wt}from"./use-ai-providers-CQmOOELp.js";import{A as ot}from"./avatar-CfHetrJ0.js";import{S as xe}from"./switch-DLw5svpB.js";import{c as pe,b as be,T as Te,a as Ee}from"./tooltip-DjWNMg5T.js";import{S as Ue,a as Be,b as Ve}from"./settings-section-CHSsdIIo.js";import{t as Lt}from"./ChevronDown-BsEi-r9q.js";import{i as Pt}from"./ChevronRight-B9mybD1s.js";import{i as ze}from"./X-CNdIeej8.js";import{a as Dt}from"./use-capability-BtQYj-6N.js";import{A as kt}from"./access-gate-BAwcBNbs.js";import"./Check-BbAbdPfp.js";import"./Circle-Bj_xS3WU.js";import"./table-B8kPpHAC.js";import"./ArrowUp-ChoUWc1b.js";import"./sidebar-i7yNFNs9.js";import"./LayoutLeft-C6uN3ryJ.js";import"./use-mobile-vXwkCjTm.js";import"./SearchMd-CKL74aOj.js";import"./Tool02-vM8N2pYB.js";import"./agent-icon-DMtjBPX3.js";import"./AlertCircle-CX23NCuO.js";import"./UserPlus01-13KHecKW.js";import"./Tool01-BT4kICfE.js";import"./XCircle-C9sRiEE0.js";import"./ArrowUpRight-Bq-zX9ha.js";import"./TrendUp01-CBDxjtVg.js";import"./ZapSquare-BV8kr37_.js";import"./Users03-ZlQye2vY.js";import"./CheckCircle-Day5nLHt.js";import"./ChevronUp-BWoVqFrM.js";import"./Stars02-B9xmjTkg.js";import"./Eye-CyP9kYwn.js";import"./ZoomOut-7nLppLEs.js";import"./Globe01-CC0A4U7g.js";import"./FilterLines-C5i4i3WB.js";import"./Flag01-C7YxvVFh.js";import"./Star01-Bb61R21H.js";import"./Globe04-BV89vsfi.js";import"./SwitchHorizontal01-C90B2Auk.js";import"./HardDrive-CA9cG4ej.js";import"./Key01-Y2tTMtA8.js";import"./LinkExternal01-CbW1jJhi.js";import"./List-MOccGrJp.js";import"./Monitor01-DBUBWT-e.js";import"./Sun-wOtTFTOd.js";import"./Package-BL3B6ONo.js";import"./Palette-B0oAitOJ.js";import"./Play-zjQOd6w0.js";import"./SearchLg-B4W4xrFH.js";import"./Shield01-IlYcL8Fi.js";import"./Stars01-Bnuoinbt.js";import"./Upload01-Lp0wJMYr.js";import"./User01-CQV6kRtR.js";import"./Users01-CDDfUziK.js";import"./XClose-4pjmwtT4.js";import"./Zap-DHGChPV2.js";import"./auth-DIzgjm9h.js";import"./use-collections-Kwxr6RPv.js";import"./studio-tools--pllMpfK.js";import"./card-1ZIM8JYb.js";import"./capability-load-error-CWaH-_Bd.js";const we="basic-usage",Le=[{id:we,label:"Basic Usage",description:"Tools all org members can access by default",section:"Basic Usage",tools:["COLLECTION_CONNECTIONS_LIST","COLLECTION_CONNECTIONS_GET","CONNECTION_TEST","COLLECTION_VIRTUAL_MCP_LIST","COLLECTION_VIRTUAL_MCP_GET","VIRTUAL_MCP_PLUGIN_CONFIG_GET","VIRTUAL_MCP_LAST_USED_LIST","AUTOMATION_GET","AUTOMATION_LIST","AUTOMATION_RUN_STATS","AI_PROVIDERS_LIST","AI_PROVIDERS_LIST_MODELS","AI_PROVIDERS_ACTIVE","AI_PROVIDER_KEY_LIST","AI_PROVIDER_CREDITS","AI_PROVIDER_TOPUP_URL","LIST_OBJECTS","GET_OBJECT_METADATA","GET_PRESIGNED_URL","PUT_PRESIGNED_URL","FILE_OBJECTS_LIST","SANDBOX_START","SANDBOX_DELETE","GLOBAL_SEARCH","ORGANIZATION_SETTINGS_GET","USER_GET","LINK_CURRENT_GET","LINK_DISCONNECT","BRAND_CONTEXT_LIST","COLLECTION_THREADS_CREATE","COLLECTION_THREADS_LIST","COLLECTION_THREADS_GET","COLLECTION_THREADS_UPDATE","COLLECTION_THREADS_DELETE","COLLECTION_THREAD_MESSAGES_LIST","THREAD_BACKGROUND_TOOL_START","THREAD_SUBTASK_DELIVER","TASK_BOARD_ITEM_CREATE","TASK_BOARD_ITEM_LIST","TASK_BOARD_ITEM_UPDATE","TASK_BOARD_ITEM_DELETE","TASK_BOARD_ITEM_PRS_GET"]},{id:"org:manage",label:"Manage organization",description:"Edit organization settings, brand context, and domain configuration",section:"Organization",tools:["ORGANIZATION_GET","ORGANIZATION_LIST","ORGANIZATION_UPDATE","ORGANIZATION_SETTINGS_GET","ORGANIZATION_SETTINGS_UPDATE","BRAND_CONTEXT_LIST","BRAND_CONTEXT_GET","BRAND_CONTEXT_CREATE","BRAND_CONTEXT_UPDATE","BRAND_CONTEXT_DELETE","BRAND_CONTEXT_EXTRACT","BRAND_GET","BRAND_LIST","ORGANIZATION_DOMAIN_LIST","ORGANIZATION_DOMAIN_ADD","ORGANIZATION_DOMAIN_UPDATE","ORGANIZATION_DOMAIN_VERIFY","ORGANIZATION_DOMAIN_REMOVE"]},{id:"members:manage",label:"Manage members",description:"Invite members, remove them, and change their roles",section:"Organization",tools:["ORGANIZATION_MEMBER_LIST","ORGANIZATION_MEMBER_ADD","ORGANIZATION_MEMBER_REMOVE","ORGANIZATION_MEMBER_UPDATE_ROLE","ORGANIZATION_JOIN_REQUEST_LIST","ORGANIZATION_JOIN_REQUEST_APPROVE","ORGANIZATION_JOIN_REQUEST_DENY"],dangerous:!0},{id:"connections:manage",label:"Manage connections",description:"Create, update, and delete connections",section:"Connections & Agents",tools:["COLLECTION_CONNECTIONS_CREATE","COLLECTION_CONNECTIONS_UPDATE","COLLECTION_CONNECTIONS_DELETE","COMMERCE_DISCOVERY_SETUP","COMMERCE_DISCOVERY_RUN","COMMERCE_DISCOVERY_BIND","COMMERCE_DISCOVERY_CONNECTION_STATUS"],dangerous:!0},{id:"agents:manage",label:"Manage agents",description:"Create, configure, and delete agents",section:"Connections & Agents",tools:["COLLECTION_VIRTUAL_MCP_CREATE","COLLECTION_VIRTUAL_MCP_UPDATE","COLLECTION_VIRTUAL_MCP_DELETE","VIRTUAL_MCP_PLUGIN_CONFIG_UPDATE","VIRTUAL_MCP_PINNED_VIEWS_UPDATE"],dangerous:!0},{id:"automations:manage",label:"Manage automations",description:"Create, update, run, and delete automations",section:"Automations",tools:["AUTOMATION_CREATE","AUTOMATION_UPDATE","AUTOMATION_DELETE","AUTOMATION_TRIGGER_ADD","AUTOMATION_TRIGGER_REMOVE","AUTOMATION_TRIGGER_ROTATE_TOKEN","AUTOMATION_RUN"],dangerous:!0},{id:"monitoring:view",label:"View monitoring",description:"Access logs and usage statistics",section:"Monitoring",tools:["MONITORING_LOG_GET","MONITORING_LOGS_LIST","MONITORING_STATS","MONITORING_THREAD_USAGE"]},{id:"secrets:manage",label:"Manage secrets",description:"Create and list secrets stored in the credential vault",section:"Organization",tools:["SECRET_CREATE","SECRET_LIST"]},{id:"file-configs:manage",label:"Manage file configs",description:"Create, list, update and delete S3 bucket configurations",section:"Organization",tools:["FILE_CONFIG_CREATE","FILE_CONFIG_LIST","FILE_CONFIG_UPDATE","FILE_CONFIG_DELETE","FILE_OBJECTS_LIST"]},{id:"ai-providers:manage",label:"Manage AI providers",description:"Add or remove API keys and provision provider credentials",section:"AI Providers",tools:["AI_PROVIDER_KEY_CREATE","AI_PROVIDER_KEY_LIST","AI_PROVIDER_KEY_DELETE","AI_PROVIDER_KEY_UPDATE","AI_PROVIDER_KEY_PREVIEW","AI_PROVIDER_OAUTH_URL","AI_PROVIDER_OAUTH_EXCHANGE","AI_PROVIDER_PROVISION_KEY","AI_PROVIDER_TOPUP_URL","AI_PROVIDER_CREDITS"]},{id:"tags:manage",label:"Manage tags",description:"Create, assign, and delete organization tags",section:"Organization",tools:["TAGS_LIST","TAGS_CREATE","TAGS_DELETE","MEMBER_TAGS_GET","MEMBER_TAGS_SET"]},{id:"registry:manage",label:"Manage registry",description:"Browse, publish, and manage items in the registry",section:"Store & Registry",tools:["COLLECTION_REGISTRY_APP_LIST","COLLECTION_REGISTRY_APP_GET","COLLECTION_REGISTRY_APP_VERSIONS","COLLECTION_REGISTRY_APP_FILTERS","REGISTRY_ITEM_LIST","REGISTRY_ITEM_SEARCH","REGISTRY_ITEM_GET","REGISTRY_ITEM_VERSIONS","REGISTRY_ITEM_FILTERS","REGISTRY_DISCOVER_TOOLS","REGISTRY_ITEM_CREATE","REGISTRY_ITEM_BULK_CREATE","REGISTRY_ITEM_UPDATE","REGISTRY_ITEM_DELETE","REGISTRY_AI_GENERATE","REGISTRY_PUBLISH_REQUEST_LIST","REGISTRY_PUBLISH_REQUEST_REVIEW","REGISTRY_PUBLISH_REQUEST_COUNT","REGISTRY_PUBLISH_REQUEST_DELETE","REGISTRY_PUBLISH_API_KEY_GENERATE","REGISTRY_PUBLISH_API_KEY_LIST","REGISTRY_PUBLISH_API_KEY_REVOKE"],dangerous:!0},{id:"registry:monitor",label:"Monitor registry health",description:"Run health checks on registry connections and view results",section:"Store & Registry",tools:["REGISTRY_MONITOR_RUN_START","REGISTRY_MONITOR_RUN_LIST","REGISTRY_MONITOR_RUN_GET","REGISTRY_MONITOR_RUN_CANCEL","REGISTRY_MONITOR_RESULT_LIST","REGISTRY_MONITOR_CONNECTION_LIST","REGISTRY_MONITOR_CONNECTION_SYNC","REGISTRY_MONITOR_CONNECTION_UPDATE_AUTH"]},{id:"api-keys:manage",label:"Manage API keys",description:"Create, update, and revoke API keys",section:"Developer",tools:["API_KEY_CREATE","API_KEY_LIST","API_KEY_UPDATE","API_KEY_DELETE"]},{id:"storage:delete",label:"Delete from storage",description:"Permanently delete files from object storage",section:"Developer",tools:["DELETE_OBJECT","DELETE_OBJECTS"],dangerous:!0},{id:"connections:sql",label:"Run SQL queries",description:"Execute raw SQL against connected databases",section:"Developer",tools:["DATABASES_RUN_SQL"],dangerous:!0}];[...Le.find(t=>t.id===we)?.tools??[]];const Gt=["agents:manage","connections:manage"];new Set(Le.filter(t=>Gt.includes(t.id)).flatMap(t=>t.tools));function Ut(){const t=new Map;for(const e of Le){if(e.id===we)continue;const n=t.get(e.section)??[];n.push(e),t.set(e.section,n)}return Array.from(t.entries()).map(([e,n])=>({section:e,capabilities:n}))}function Bt(t,e,n){return n?!0:t.tools.every(l=>e.includes(l))}function Vt(t,e,n){if(n){const i=new Set(e);for(const r of t.tools)i.add(r);return Array.from(i)}const l=new Set(e);for(const i of t.tools)l.delete(i);return Array.from(l)}function zt(t){const e=H.c(21),{connection:n,isSelected:l,hasToolsEnabled:i,activeToolsCount:r,totalToolsCount:d,onSelect:h,onToggle:c}=t,g=l?"bg-accent/50":"hover:bg-muted/50";let f;e[0]!==g?(f=K("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",g),e[0]=g,e[1]=f):f=e[1];let a;e[2]!==n.icon||e[3]!==n.title?(a=s.jsx(ye,{icon:n.icon,name:n.title,size:"xs"}),e[2]=n.icon,e[3]=n.title,e[4]=a):a=e[4];let x;e[5]!==n.title?(x=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:n.title})}),e[5]=n.title,e[6]=x):x=e[6];let o;e[7]!==h||e[8]!==a||e[9]!==x?(o=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:h,children:[a,x]}),e[7]=h,e[8]=a,e[9]=x,e[10]=o):o=e[10];let m;e[11]!==r||e[12]!==n.tools||e[13]!==i||e[14]!==c||e[15]!==d?(m=n.tools&&n.tools.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[r,"/",d]}),s.jsx(Me,{checked:i,onCheckedChange:c,onClick:Yt})]}),e[11]=r,e[12]=n.tools,e[13]=i,e[14]=c,e[15]=d,e[16]=m):m=e[16];let S;return e[17]!==f||e[18]!==o||e[19]!==m?(S=s.jsxs("div",{className:f,children:[o,m]}),e[17]=f,e[18]=o,e[19]=m,e[20]=S):S=e[20],S}function Yt(t){return t.stopPropagation()}function $t(t){const e=H.c(18),{connectionId:n,tool:l,isSelected:i,onToggle:r}=t,d=`tool-${n}-${l.name}`,h=i?"text-foreground":"text-muted-foreground";let c;e[0]!==h?(c=K("text-sm font-medium",h),e[0]=h,e[1]=c):c=e[1];let g;e[2]!==c||e[3]!==l.name?(g=s.jsx("div",{className:"flex items-center gap-2 mb-1",children:s.jsx("span",{className:c,children:l.name})}),e[2]=c,e[3]=l.name,e[4]=g):g=e[4];let f;e[5]!==l.description?(f=l.description&&s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:l.description}),e[5]=l.description,e[6]=f):f=e[6];let a;e[7]!==g||e[8]!==f?(a=s.jsxs("div",{className:"flex-1 min-w-0",children:[g,f]}),e[7]=g,e[8]=f,e[9]=a):a=e[9];const x=`tool-${n}-${l.name}`;let o;e[10]!==i||e[11]!==r||e[12]!==x?(o=s.jsx("div",{className:"flex items-center shrink-0",children:s.jsx(Me,{id:x,checked:i,onCheckedChange:r,onClick:Ft})}),e[10]=i,e[11]=r,e[12]=x,e[13]=o):o=e[13];let m;return e[14]!==d||e[15]!==a||e[16]!==o?(m=s.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:d,children:[a,o]}),e[14]=d,e[15]=a,e[16]=o,e[17]=m):m=e[17],m}function Ft(t){return t.stopPropagation()}function Kt({toolSet:t,onToolSetChange:e,excludeVirtualMcpId:n,searchQuery:l}){const[i,r]=$.useState(""),d=l!==void 0?l:i,h=$.useDeferredValue(d),[c,g]=$.useState("all"),[f,a]=$.useState(!1),x=$.useRef(new Set(Object.keys(t))),{org:o}=Se(),m=Ot({connectionId:jt,orgId:o.id,orgSlug:o.slug}),S=100,E=h.trim(),T=E?{operator:"or",conditions:[{field:["title"],operator:"contains",value:E},{field:["description"],operator:"contains",value:E}]}:void 0,N=!!n,C={...T&&{where:T},orderBy:[{field:["updated_at"],direction:"asc"}],limit:S,offset:0,...N&&{include_virtual:!0}},v=JSON.stringify(C),{data:_,fetchNextPage:R,hasNextPage:p,isFetchingNextPage:O}=Rt({queryKey:re.collectionListInfinite(m,o.id,"","CONNECTIONS",v),queryFn:async({pageParam:b=0})=>(await m.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...T&&{where:T},orderBy:[{field:["updated_at"],direction:"asc"}],limit:S,offset:b,...N&&{include_virtual:!0}}})).structuredContent,initialPageParam:0,getNextPageParam:(b,D)=>{if(b?.hasMore)return D.reduce((Q,q)=>Q+(q?.items?.length??0),0)},staleTime:3e4}),I=_?.pages.flatMap(b=>b?.items??[])??[],j=Ct(R,p??!1,O),u=n?I.filter(b=>b.connection_type!=="VIRTUAL"?!0:dt(b.connection_url)!==n):I,M=x.current,A=[...M.values()].map(b=>u.find(D=>D.id===b)).filter(b=>b!==void 0),k=u.filter(b=>!M.has(b.id)),G=[...A,...k],U=b=>{const D=t[b];return D!==void 0&&D.length>0},B=G.filter(b=>{if(c==="all")return!0;const D=U(b.id);return c==="selected"?D:c==="unselected"?!D:!0}),[w,z]=$.useState(G[0]?.id??null),y=w?G.find(b=>b.id===w)??null:null,{data:L,isFetching:Y}=Re({queryKey:re.collectionItem(m,o.id,"","CONNECTIONS",w??""),queryFn:async()=>w?(await m.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:w}})).structuredContent?.item??null:null,enabled:!!w,staleTime:3e4}),F=L?.tools??[],J=(b,D)=>t[b]?.includes(D)??!1,X=(b,D)=>{const Q=t[b]??[],q=Q.includes(D),W={...t};if(q){const Z=Q.filter(ee=>ee!==D);Z.length===0?delete W[b]:W[b]=Z}else W[b]=[...Q,D];e(W)},le=b=>{const D=b===w?F:[];if(!D.length)return;const Q=t[b]??[],q=D.map(ee=>ee.name),W=Q.length>0&&q.every(ee=>Q.includes(ee)),Z={...t};W?delete Z[b]:(Z[b]=q,z(b)),e(Z)},oe=b=>{z(b),a(!0)},ie=()=>{a(!1)};return s.jsxs("div",{className:"flex h-full",children:[s.jsxs("div",{className:K("w-full md:w-80 border-r border-border flex flex-col",f&&"hidden md:flex"),children:[l===void 0&&s.jsx(vt,{value:i,onChange:r,placeholder:"Search MCP Servers..."}),s.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[s.jsx("button",{onClick:()=>g("all"),className:K("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",c==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"All"}),s.jsx("button",{onClick:()=>g("selected"),className:K("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",c==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Selected"}),s.jsx("button",{onClick:()=>g("unselected"),className:K("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",c==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Unselected"})]}),s.jsx("div",{className:"flex-1 overflow-auto",children:B.length===0?s.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:d?"No connections found":c==="selected"?"No servers selected":c==="unselected"?"No unselected servers":"No connections available"}):s.jsxs("div",{className:"p-2 space-y-1",children:[B.map(b=>{const D=w===b.id,Q=D?F.length:0,q=t[b.id]?.length??0;return s.jsx(zt,{connection:{...b,tools:D?F:b.tools},isSelected:D,hasToolsEnabled:U(b.id),activeToolsCount:q,totalToolsCount:Q,onSelect:()=>oe(b.id),onToggle:()=>le(b.id)},b.id)}),s.jsx("div",{ref:j,className:"h-4"}),O&&s.jsx("div",{className:"flex justify-center py-3",children:s.jsx(fe,{size:18,className:"animate-spin text-muted-foreground"})})]})})]}),s.jsx("div",{className:K("flex-1 flex-col",f?"flex":"hidden md:flex"),children:y?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"md:hidden border-b border-border p-4 flex items-center gap-3",children:[s.jsx(ne,{variant:"ghost",size:"sm",onClick:ie,className:"h-8 w-8 p-0 shrink-0",children:s.jsx(At,{size:20})}),s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[s.jsx(ye,{icon:y.icon,name:y.title,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:y.title}),y.description&&s.jsx("p",{className:"text-sm text-muted-foreground truncate",children:y.description})]})]})]}),s.jsx("div",{className:"flex-1 overflow-auto p-4",children:Y?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(fe,{size:18,className:"animate-spin text-muted-foreground"})}):F.length===0?s.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:"This connection has no tools available"}):s.jsx("div",{className:"space-y-2",children:F.map(b=>s.jsx($t,{connectionId:y.id,tool:b,isSelected:J(y.id,b.name),onToggle:()=>X(y.id,b.name)},b.name))})})]}):s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx("div",{className:"text-sm text-muted-foreground text-center",children:"Select a connection to view its tools"})})})]})}const Ne=["bg-red-500","bg-orange-500","bg-amber-500","bg-yellow-500","bg-lime-500","bg-green-500","bg-emerald-500","bg-teal-500","bg-cyan-500","bg-sky-500","bg-blue-500","bg-indigo-500","bg-violet-500","bg-purple-500","bg-fuchsia-500","bg-pink-500","bg-rose-500"],Qt={owner:"bg-red-500",admin:"bg-blue-500",user:"bg-green-500"};function Ht(t){if(!t)return"bg-neutral-400";let e=0;for(let l=0;l<t.length;l++){const i=t.charCodeAt(l);e=(e<<5)-e+i,e=e&e}const n=Math.abs(e)%Ne.length;return Ne[n]??Ne[0]}function qt(t,e){return Qt[t]??"bg-neutral-400"}const Zt=Pe({role:Pe({id:se().optional(),slug:se().optional(),label:se()}),allowAllStaticPermissions:ke(),staticPermissions:Ie(se()),toolSet:De(se(),Ie(se())),allowAllModels:ke(),modelSet:De(se(),Ie(se())),memberIds:Ie(se())});function Ye(t,e,n){const l=s.jsx(xe,{checked:t,disabled:e,onCheckedChange:n});return e?s.jsx(pe,{children:s.jsxs(be,{children:[s.jsx(Te,{asChild:!0,children:s.jsx("div",{children:l})}),s.jsx(Ee,{children:s.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):l}function Jt(t){const e=H.c(28),{allowAllStaticPermissions:n,staticPermissions:l,onAllowAllChange:i,onPermissionsChange:r,readOnly:d,searchQuery:h}=t,c=d===void 0?!1:d;let g;e[0]!==h?(g=h.trim().toLowerCase(),e[0]=h,e[1]=g):g=e[1];const f=$.useDeferredValue(g);let a;if(e[2]!==n||e[3]!==f||e[4]!==i||e[5]!==r||e[6]!==c||e[7]!==h||e[8]!==l){const x=Ut(),o=(v,_)=>{if(!c){if(n&&_){const R=x.flatMap(es).flatMap(Wt);i(!1),r(R.filter(p=>!v.tools.includes(p)));return}n||r(Vt(v,l,!_))}};let m;e[10]!==f?(m=v=>{const{section:_,capabilities:R}=v;return{section:_,capabilities:R.filter(p=>!f||p.label.toLowerCase().includes(f)||p.description.toLowerCase().includes(f))}},e[10]=f,e[11]=m):m=e[11];const S=x.map(m).filter(Xt);let E;e[12]!==n||e[13]!==i||e[14]!==r?(E=()=>{i(!n),r([])},e[12]=n,e[13]=i,e[14]=r,e[15]=E):E=e[15];let T;e[16]!==n||e[17]!==c||e[18]!==E?(T=Ye(n,c,E),e[16]=n,e[17]=c,e[18]=E,e[19]=T):T=e[19];let N;e[20]!==n||e[21]!==i||e[22]!==r||e[23]!==c?(N=c?void 0:()=>{i(!n),r([])},e[20]=n,e[21]=i,e[22]=r,e[23]=c,e[24]=N):N=e[24];let C;e[25]!==T||e[26]!==N?(C=s.jsx(Ue,{title:"General",children:s.jsx(Be,{children:s.jsx(Ve,{title:"All organization permissions",description:"Grant full access to all features below",action:T,onClick:N})})}),e[25]=T,e[26]=N,e[27]=C):C=e[27],a=s.jsx("div",{children:s.jsxs("div",{className:"flex flex-col gap-10 py-4",children:[C,S.length===0&&f?s.jsxs("p",{className:"text-sm text-muted-foreground py-4",children:["No permissions match “",h,"”"]}):S.map(v=>{const{section:_,capabilities:R}=v;return s.jsx(Ue,{title:_,children:s.jsx(Be,{children:R.map(p=>{const O=Bt(p,l,n);return s.jsx(Ve,{title:s.jsxs("span",{className:"flex items-center gap-1.5",children:[p.label,p.dangerous&&s.jsx(ft,{size:12,className:"text-amber-500 shrink-0"})]}),description:p.description,action:Ye(O,c,()=>o(p,O)),onClick:c?void 0:()=>o(p,O)},p.id)})})},_)})]})}),e[2]=n,e[3]=f,e[4]=i,e[5]=r,e[6]=c,e[7]=h,e[8]=l,e[9]=a}else a=e[9];return a}function Xt(t){return t.capabilities.length>0}function Wt(t){return t.tools}function es(t){return t.capabilities}const it={anthropic:"Anthropic",openrouter:"OpenRouter"},ts={openai:"OpenAI",anthropic:"Anthropic",google:"Google","meta-llama":"Meta",mistralai:"Mistral","x-ai":"xAI",deepseek:"DeepSeek",qwen:"Qwen",moonshotai:"MoonshotAI",nvidia:"NVIDIA",perplexity:"Perplexity",cohere:"Cohere",amazon:"Amazon",microsoft:"Microsoft","z-ai":"Z.ai","ibm-granite":"IBM Granite",alibaba:"Alibaba",baidu:"Baidu",bytedance:"ByteDance",tencent:"Tencent",minimax:"MiniMax",nousresearch:"Nous Research",allenai:"Allen AI",inception:"Inception"};function ss(t,e){const n=t.indexOf("/"),l=n>0?t.slice(0,n):e;return l.startsWith("~")?l.slice(1):l}function ns(t){return ts[t]??it[t]??t}function ls(t){const e=t.indexOf(": ");return e>0&&e<32?t.slice(e+2):t}const rt=30;function os(t){const e=H.c(44),{connectionId:n,subProviderId:l,subProviderName:i,groupLogo:r,models:d,allConnectionModelIds:h,selectedModels:c,allowAllModels:g,allConnectionModelsSelected:f,onToggleModel:a,onExitAllowAll:x,readOnly:o,defaultExpanded:m}=t,[S,E]=$.useState(m),T=m||S,N=E,[C,v]=$.useState(rt);let _;e[0]!==f||e[1]!==g||e[2]!==c?(_=j=>g||f||c.includes("*")||c.includes(j),e[0]=f,e[1]=g,e[2]=c,e[3]=_):_=e[3];const R=_;let p;if(e[4]!==R||e[5]!==d){let j;e[7]!==R?(j=u=>R(u.id),e[7]=R,e[8]=j):j=e[8],p=d.filter(j),e[4]=R,e[5]=d,e[6]=p}else p=e[6];const O=p.length;let I;if(e[9]!==h||e[10]!==g||e[11]!==n||e[12]!==O||e[13]!==T||e[14]!==r||e[15]!==R||e[16]!==d||e[17]!==x||e[18]!==a||e[19]!==o||e[20]!==l||e[21]!==i||e[22]!==C){const j=d.slice(0,C),u=d.length>C;let M;e[24]===Symbol.for("react.memo_cache_sentinel")?(M=()=>N(cs),e[24]=M):M=e[24];const A=r??tt[l]??st;let k;e[25]!==i||e[26]!==A?(k=s.jsx(ye,{icon:A,name:i,size:"sm"}),e[25]=i,e[26]=A,e[27]=k):k=e[27];let G;e[28]!==i?(G=s.jsx("span",{className:"text-sm font-medium truncate",children:i}),e[28]=i,e[29]=G):G=e[29];let U;e[30]!==k||e[31]!==G?(U=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[k,G]}),e[30]=k,e[31]=G,e[32]=U):U=e[32];let B;e[33]!==O||e[34]!==d.length?(B=s.jsxs(ge,{variant:"secondary",className:"text-xs text-muted-foreground",children:[O,"/",d.length," enabled"]}),e[33]=O,e[34]=d.length,e[35]=B):B=e[35];let w;e[36]!==T?(w=T?s.jsx(Lt,{size:16,className:"text-muted-foreground shrink-0"}):s.jsx(Pt,{size:16,className:"text-muted-foreground shrink-0"}),e[36]=T,e[37]=w):w=e[37];let z;e[38]!==w||e[39]!==B?(z=s.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[B,w]}),e[38]=w,e[39]=B,e[40]=z):z=e[40];let y;e[41]!==z||e[42]!==U?(y=s.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3 hover:bg-muted/50 cursor-pointer",onClick:M,children:[U,z]}),e[41]=z,e[42]=U,e[43]=y):y=e[43],I=s.jsxs("div",{className:"border border-border rounded-lg overflow-hidden bg-card",children:[y,T&&s.jsxs("div",{className:"border-t border-border bg-muted/20",children:[j.map(L=>{const Y=R(L.id),F=()=>{if(!o){if(g){x(n,h,L.id);return}a(n,L.id)}};return s.jsxs("div",{className:K("flex items-center justify-between gap-3 px-4 py-3 border-b border-border last:border-b-0",!o&&"hover:bg-muted/50 cursor-pointer"),onClick:F,children:[s.jsx("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:s.jsx("span",{className:"text-sm truncate",children:L.title})}),s.jsx("div",{onClick:as,children:o?s.jsx(pe,{children:s.jsxs(be,{children:[s.jsx(Te,{asChild:!0,children:s.jsx("div",{children:s.jsx(xe,{checked:Y,disabled:!0,onCheckedChange:rs})})}),s.jsx(Ee,{children:s.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):s.jsx(xe,{checked:Y,onCheckedChange:F})})]},L.id)}),u&&s.jsxs("button",{type:"button",className:"w-full px-4 py-2 text-xs text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors",onClick:()=>v(is),children:["Show more (",d.length-C," remaining)"]})]})]}),e[9]=h,e[10]=g,e[11]=n,e[12]=O,e[13]=T,e[14]=r,e[15]=R,e[16]=d,e[17]=x,e[18]=a,e[19]=o,e[20]=l,e[21]=i,e[22]=C,e[23]=I}else I=e[23];return I}function is(t){return t+rt}function rs(){}function as(t){return t.stopPropagation()}function cs(t){return!t}function ds(t){const e=H.c(33),{connection:n,selectedModels:l,allowAllModels:i,onToggleModel:r,onExitAllowAll:d,allConnectionModelsSelected:h,searchQuery:c,readOnly:g}=t,f=wt(n.id);let a,x,o,m,S;if(e[0]!==h||e[1]!==i||e[2]!==n.id||e[3]!==n.label||e[4]!==n.providerId||e[5]!==d||e[6]!==r||e[7]!==f||e[8]!==g||e[9]!==c||e[10]!==l){S=Symbol.for("react.early_return_sentinel");e:{let N;e[16]!==n.label?(N=A=>({...A,id:A.modelId,provider:n.label}),e[16]=n.label,e[17]=N):N=e[17];const C=f.filter(hs).map(N),v=c.trim().toLowerCase(),_=v?C.filter(A=>A.title.toLowerCase().includes(v)||A.id.toLowerCase().includes(v)||A.provider?.toLowerCase().includes(v)):C;if(_.length===0){S=null;break e}const R=new Map;for(const A of _){const k=ss(A.id,n.providerId),G=R.get(k)??{models:[],logo:null};G.models.push({id:A.id,title:ls(A.title),logo:A.logo}),!G.logo&&A.logo&&(G.logo=A.logo),R.set(k,G)}const p=Array.from(R.entries()).map(fs).sort(us),O=p.length===1||v.length>0;o="flex flex-col gap-3";const I=tt[n.providerId]??st;let j;e[18]!==n.providerId||e[19]!==I?(j=s.jsx("img",{src:I,alt:n.providerId,className:"w-4 h-4 rounded-sm dark:bg-white dark:rounded-sm dark:p-px"}),e[18]=n.providerId,e[19]=I,e[20]=j):j=e[20];const u=it[n.providerId]??n.providerId;let M;e[21]!==u?(M=s.jsx("h4",{className:"text-sm font-medium",children:u}),e[21]=u,e[22]=M):M=e[22],e[23]!==M||e[24]!==j?(m=s.jsxs("div",{className:"flex items-center gap-2",children:[j,M]}),e[23]=M,e[24]=j,e[25]=m):m=e[25],a="flex flex-col gap-3",x=p.map(A=>s.jsx(os,{connectionId:n.id,subProviderId:A.id,subProviderName:A.name,groupLogo:A.logo,models:A.models,allConnectionModelIds:C.map(ms),selectedModels:l,allowAllModels:i,allConnectionModelsSelected:h,onToggleModel:r,onExitAllowAll:d,readOnly:g,defaultExpanded:O},A.id))}e[0]=h,e[1]=i,e[2]=n.id,e[3]=n.label,e[4]=n.providerId,e[5]=d,e[6]=r,e[7]=f,e[8]=g,e[9]=c,e[10]=l,e[11]=a,e[12]=x,e[13]=o,e[14]=m,e[15]=S}else a=e[11],x=e[12],o=e[13],m=e[14],S=e[15];if(S!==Symbol.for("react.early_return_sentinel"))return S;let E;e[26]!==a||e[27]!==x?(E=s.jsx("div",{className:a,children:x}),e[26]=a,e[27]=x,e[28]=E):E=e[28];let T;return e[29]!==o||e[30]!==m||e[31]!==E?(T=s.jsxs("div",{className:o,children:[m,E]}),e[29]=o,e[30]=m,e[31]=E,e[32]=T):T=e[32],T}function ms(t){return t.id}function us(t,e){return t.name.localeCompare(e.name)}function fs(t){const[e,n]=t;return{id:e,name:ns(e),logo:n.logo,models:n.models}}function hs(t,e,n){return n.findIndex(l=>l.modelId===t.modelId)===e}function gs(t){const e=H.c(35),{allowAllModels:n,modelSet:l,onAllowAllChange:i,onModelSetChange:r,readOnly:d,searchQuery:h}=t,c=d===void 0?!1:d,g=$.useDeferredValue(h),f=Mt();let a;e[0]!==l||e[1]!==r?(a=(p,O)=>{const I=l[p]??[],j={...l};if(I.includes(O)){const u=I.filter(M=>M!==O);u.length===0?delete j[p]:j[p]=u}else j[p]=[...I,O];r(j)},e[0]=l,e[1]=r,e[2]=a):a=e[2];const x=a;let o;e[3]!==l||e[4]!==i||e[5]!==r?(o=(p,O,I)=>{i(!1),r({...l,[p]:O.filter(j=>j!==I)})},e[3]=l,e[4]=i,e[5]=r,e[6]=o):o=e[6];const m=o,S=!c&&"hover:bg-muted/50 cursor-pointer";let E;e[7]!==S?(E=K("flex items-center justify-between px-4 py-3 rounded-lg border border-border bg-card",S),e[7]=S,e[8]=E):E=e[8];let T;e[9]!==n||e[10]!==i||e[11]!==r||e[12]!==c?(T=()=>{if(c)return;const p=!n;i(p),p&&r({})},e[9]=n,e[10]=i,e[11]=r,e[12]=c,e[13]=T):T=e[13];let N;e[14]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx("span",{className:"text-sm font-medium",children:"All models"}),e[14]=N):N=e[14];let C;e[15]!==n||e[16]!==i||e[17]!==r||e[18]!==c?(C=s.jsx("div",{onClick:ps,children:c?s.jsx(pe,{children:s.jsxs(be,{children:[s.jsx(Te,{asChild:!0,children:s.jsx("div",{children:s.jsx(xe,{checked:n,disabled:!0,onCheckedChange:xs})})}),s.jsx(Ee,{children:s.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):s.jsx(xe,{checked:n,onCheckedChange:p=>{i(p),p&&r({})}})}),e[15]=n,e[16]=i,e[17]=r,e[18]=c,e[19]=C):C=e[19];let v;e[20]!==E||e[21]!==T||e[22]!==C?(v=s.jsxs("div",{className:E,onClick:T,children:[N,C]}),e[20]=E,e[21]=T,e[22]=C,e[23]=v):v=e[23];let _;e[24]!==f||e[25]!==n||e[26]!==g||e[27]!==m||e[28]!==l||e[29]!==c||e[30]!==x?(_=f.length===0?s.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"No LLM connections configured"}):f.map(p=>s.jsx($.Suspense,{fallback:s.jsxs("div",{className:"px-4 py-3 flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(fe,{className:"size-4 animate-spin"}),"Loading models..."]}),children:s.jsx(ds,{connection:p,selectedModels:l[p.id]??[],allowAllModels:n,onToggleModel:x,onExitAllowAll:m,allConnectionModelsSelected:(l[p.id]??[]).includes("*"),searchQuery:g,readOnly:c})},p.id)),e[24]=f,e[25]=n,e[26]=g,e[27]=m,e[28]=l,e[29]=c,e[30]=x,e[31]=_):_=e[31];let R;return e[32]!==_||e[33]!==v?(R=s.jsxs("div",{className:"flex flex-col h-full overflow-auto gap-6 pb-6",children:[v,_]}),e[32]=_,e[33]=v,e[34]=R):R=e[34],R}function xs(){}function ps(t){return t.stopPropagation()}function bs(t){const e=H.c(52),{open:n,onOpenChange:l,selectedMemberIds:i,onAddMembers:r}=t,[d,h]=$.useState(""),c=$.useDeferredValue(d);let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=[],e[0]=g):g=e[0];const[f,a]=$.useState(g),{data:x}=nt();let o,m,S,E,T,N,C,v,_,R,p;if(e[1]!==x?.data?.members||e[2]!==c||e[3]!==r||e[4]!==l||e[5]!==n||e[6]!==f||e[7]!==d||e[8]!==i){const U=x?.data?.members??[];let B;e[20]!==c?(B=y=>{const L=c.toLowerCase();return y.user?.name?.toLowerCase().includes(L)||y.user?.email?.toLowerCase().includes(L)},e[20]=c,e[21]=B):B=e[21];const w=U.filter(B);let z;e[22]!==r||e[23]!==l||e[24]!==f?(z=()=>{r(f),a([]),l(!1)},e[22]=r,e[23]=l,e[24]=f,e[25]=z):z=e[25],S=z,m=Qe,R=n,p=l,o=He,v="sm:max-w-md p-0",e[26]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsxs(qe,{className:"px-6 pt-6",children:[s.jsx(Ze,{children:"Add Members to Role"}),s.jsx(Je,{children:"Select members to add to this role."})]}),e[26]=_):_=e[26],N="flex flex-col h-80",e[27]!==d?(C=s.jsx("div",{className:"border-b border-border px-4 py-3",children:s.jsx(ve,{value:d,onChange:h,placeholder:"Search members...",className:"w-full"})}),e[27]=d,e[28]=C):C=e[28],E="flex-1 overflow-auto",T=w.length===0?s.jsx("div",{className:"flex items-center justify-center h-full px-6",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:d?"No members found":"No members available"})}):s.jsx("div",{className:"px-6 py-2 space-y-1",children:w.map(y=>{const L=y.role!=="owner",Y=i.includes(y.id),F=f.includes(y.id);return s.jsxs("label",{className:K("flex items-center gap-3 p-2 rounded-lg",!L||Y?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-muted/50"),children:[s.jsx(Me,{checked:F||Y,onCheckedChange:()=>{!L||Y||a(J=>J.includes(y.id)?J.filter(X=>X!==y.id):[...J,y.id])},disabled:!L||Y}),s.jsx(ot,{url:y.user?.image??void 0,fallback:lt(y.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:y.user?.name||"Unknown"}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:y.user?.email})]}),!L&&s.jsx(ge,{variant:"secondary",className:"shrink-0",children:"Owner"}),Y&&L&&s.jsx(ge,{variant:"outline",className:"shrink-0",children:"Added"})]},y.id)})}),e[1]=x?.data?.members,e[2]=c,e[3]=r,e[4]=l,e[5]=n,e[6]=f,e[7]=d,e[8]=i,e[9]=o,e[10]=m,e[11]=S,e[12]=E,e[13]=T,e[14]=N,e[15]=C,e[16]=v,e[17]=_,e[18]=R,e[19]=p}else o=e[9],m=e[10],S=e[11],E=e[12],T=e[13],N=e[14],C=e[15],v=e[16],_=e[17],R=e[18],p=e[19];let O;e[29]!==E||e[30]!==T?(O=s.jsx("div",{className:E,children:T}),e[29]=E,e[30]=T,e[31]=O):O=e[31];let I;e[32]!==O||e[33]!==N||e[34]!==C?(I=s.jsxs("div",{className:N,children:[C,O]}),e[32]=O,e[33]=N,e[34]=C,e[35]=I):I=e[35];let j;e[36]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Xe,{children:"Cancel"}),e[36]=j):j=e[36];const u=f.length===0,M=f.length>0&&`(${f.length})`;let A;e[37]!==S||e[38]!==u||e[39]!==M?(A=s.jsxs(We,{className:"px-6 pb-6",children:[j,s.jsxs(et,{onClick:S,disabled:u,children:["Add ",M]})]}),e[37]=S,e[38]=u,e[39]=M,e[40]=A):A=e[40];let k;e[41]!==o||e[42]!==I||e[43]!==A||e[44]!==v||e[45]!==_?(k=s.jsxs(o,{className:v,children:[_,I,A]}),e[41]=o,e[42]=I,e[43]=A,e[44]=v,e[45]=_,e[46]=k):k=e[46];let G;return e[47]!==m||e[48]!==k||e[49]!==R||e[50]!==p?(G=s.jsx(m,{open:R,onOpenChange:p,children:k}),e[47]=m,e[48]=k,e[49]=R,e[50]=p,e[51]=G):G=e[51],G}function Ts(t){const e=H.c(29),{memberIds:n,onMemberIdsChange:l,readOnly:i,readOnlyMessage:r,searchQuery:d,addMemberDialogOpen:h,onAddMemberDialogOpenChange:c}=t,g=i===void 0?!1:i,f=r===void 0?"Owner membership cannot be changed":r,a=$.useDeferredValue(d),{data:x}=nt();let o,m,S;if(e[0]!==x?.data?.members||e[1]!==a||e[2]!==n||e[3]!==l||e[4]!==g||e[5]!==f||e[6]!==d){const v=x?.data?.members??[];let _;e[10]!==n?(_=I=>n.includes(I.id),e[10]=n,e[11]=_):_=e[11];const R=v.filter(_);let p;e[12]!==a?(p=I=>{const j=a.toLowerCase();return I.user?.name?.toLowerCase().includes(j)||I.user?.email?.toLowerCase().includes(j)},e[12]=a,e[13]=p):p=e[13];const O=R.filter(p);S="flex flex-col h-full",o="flex-1 overflow-auto",m=R.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsxs("div",{className:"text-center",children:[s.jsx("h3",{className:"text-base font-medium mb-1",children:"No members"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Add members to grant them the configured permissions."})]})}):O.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsxs("p",{className:"text-sm text-muted-foreground",children:['No members match "',d,'"']})}):s.jsx("div",{className:"p-4 space-y-2",children:O.map(I=>s.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-muted/30",children:[s.jsx(ot,{url:I.user?.image??void 0,fallback:lt(I.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:I.user?.name||"Unknown"}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:I.user?.email})]}),g?s.jsx(pe,{children:s.jsxs(be,{children:[s.jsx(Te,{asChild:!0,children:s.jsx("div",{children:s.jsx(ne,{variant:"ghost",size:"sm",disabled:!0,children:s.jsx(ze,{size:16})})})}),s.jsx(Ee,{children:s.jsx("p",{children:f})})]})}):s.jsx(ne,{variant:"ghost",size:"sm",onClick:()=>l(n.filter(j=>j!==I.id)),children:s.jsx(ze,{size:16})})]},I.id))}),e[0]=x?.data?.members,e[1]=a,e[2]=n,e[3]=l,e[4]=g,e[5]=f,e[6]=d,e[7]=o,e[8]=m,e[9]=S}else o=e[7],m=e[8],S=e[9];let E;e[14]!==o||e[15]!==m?(E=s.jsx("div",{className:o,children:m}),e[14]=o,e[15]=m,e[16]=E):E=e[16];let T;e[17]!==n||e[18]!==l?(T=v=>l([...n,...v]),e[17]=n,e[18]=l,e[19]=T):T=e[19];let N;e[20]!==h||e[21]!==n||e[22]!==c||e[23]!==T?(N=s.jsx(bs,{open:h,onOpenChange:c,selectedMemberIds:n,onAddMembers:T}),e[20]=h,e[21]=n,e[22]=c,e[23]=T,e[24]=N):N=e[24];let C;return e[25]!==S||e[26]!==E||e[27]!==N?(C=s.jsxs("div",{className:S,children:[E,N]}),e[25]=S,e[26]=E,e[27]=N,e[28]=C):C=e[28],C}function Es(t){const e=H.c(3);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(fe,{size:24,className:"animate-spin text-muted-foreground"})}),e[0]=n):n=e[0];let l;return e[1]!==t?(l=s.jsx($.Suspense,{fallback:n,children:s.jsx(Ts,{...t})}),e[1]=t,e[2]=l):l=e[2],l}const _s={owner:[],admin:[],user:[]};function Is(t,e,n,l){const i=t==="owner"||t==="admin";return{role:{id:n?.id,slug:t,label:t.charAt(0).toUpperCase()+t.slice(1)},allowAllStaticPermissions:i,staticPermissions:_s[t],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:e.filter(r=>r.role===t).map(r=>r.id)}}function Ss(t,e,n){const l=t.permission||{},i=l.self||[],r=i.includes("*"),d=r?[]:i.filter(a=>a!=="*"),h={};for(const[a,x]of Object.entries(l))if(!(a==="self"||a==="models"))if(a==="*")for(const o of n)h[o.id]=x.includes("*")?o.tools?.map(m=>m.name)??[]:x;else{const o=n.find(m=>m.id===a);o&&(h[a]=x.includes("*")?o.tools?.map(m=>m.name)??[]:x)}const c=l.models||[],g=c.length===0||c.includes("*:*"),f={};if(!g)for(const a of c){const x=a.indexOf(":");if(x===-1)continue;const o=a.slice(0,x),m=a.slice(x+1);f[o]||(f[o]=[]),f[o].push(m)}return{role:{id:t.id,slug:t.role,label:t.label},allowAllStaticPermissions:r,staticPermissions:d,toolSet:h,allowAllModels:g,modelSet:f,memberIds:e.filter(a=>a.role===t.role).map(a=>a.id)}}function Ns(t,e){const n={};t.allowAllStaticPermissions?n.self=["*"]:t.staticPermissions.length>0&&(n.self=t.staticPermissions);for(const[l,i]of Object.entries(t.toolSet))if(i.length>0){const d=e.find(h=>h.id===l)?.tools?.map(h=>h.name)??[];n[l]=d.length>0&&d.every(h=>i.includes(h))?["*"]:i}if(t.allowAllModels)n.models=["*:*"];else{const l=[];for(const[i,r]of Object.entries(t.modelSet))for(const d of r)l.push(`${i}:${d}`);l.length>0&&(n.models=l)}return n}function Cs(t,e,n){return t.kind==="builtin"?Is(t.role,e,void 0):t.kind==="custom"?Ss(t.role,e,n):{role:{id:void 0,slug:void 0,label:""},allowAllStaticPermissions:!1,staticPermissions:[],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:[]}}function As(t){const e=H.c(6),{readOnly:n,readOnlyMessage:l,onOpen:i}=t,r=l===void 0?"Owner membership cannot be changed":l;if(n){let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Te,{asChild:!0,children:s.jsx("div",{children:s.jsxs(ne,{variant:"outline",size:"sm",disabled:!0,children:[s.jsx(Ae,{size:16}),"Add Member"]})})}),e[0]=c):c=e[0];let g;return e[1]!==r?(g=s.jsx(pe,{children:s.jsxs(be,{children:[c,s.jsx(Ee,{children:s.jsx("p",{children:r})})]})}),e[1]=r,e[2]=g):g=e[2],g}let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Ae,{size:16}),e[3]=d):d=e[3];let h;return e[4]!==i?(h=s.jsxs(ne,{variant:"outline",size:"sm",onClick:i,children:[d,"Add Member"]}),e[4]=i,e[5]=h):h=e[5],h}function Rs(t){const e=H.c(14),{locator:n}=Se(),l=je(),i=yt();let r;e[0]!==n?(r=re.members(n),e[0]=n,e[1]=r):r=e[1];let d;e[2]!==l?(d=()=>l.organization.listMembers(),e[2]=l,e[3]=d):d=e[3];let h;e[4]!==r||e[5]!==d?(h={queryKey:r,queryFn:d},e[4]=r,e[5]=d,e[6]=h):h=e[6];const{data:c,isPending:g}=Re(h);if(g||!i){let o;return e[7]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(te,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(fe,{size:32,className:"animate-spin text-muted-foreground"})})}),e[7]=o):o=e[7],o}let f;e[8]!==c?.data?.members?(f=c?.data?.members??[],e[8]=c?.data?.members,e[9]=f):f=e[9];const a=f;let x;return e[10]!==i||e[11]!==a||e[12]!==t?(x=s.jsx(Os,{...t,members:a,connections:i}),e[10]=i,e[11]=a,e[12]=t,e[13]=x):x=e[13],x}function Os({target:t,onBack:e,onSaved:n,members:l,connections:i}){const{locator:r}=Se(),d=je(),h=$e(),c=t.kind==="builtin",g=t.kind==="builtin"&&t.role==="owner",f=t.kind==="new",[a,x]=$.useState(c?"org":"mcp"),o=mt({resolver:ut(Zt),defaultValues:Cs(t,l,i)}),m=o.formState.isValid,S=o.formState.isDirty,E=Fe({mutationFn:async u=>{const M=Ns(u,i),A=u.role.slug||u.role.label.toLowerCase().replace(/\s+/g,"-"),k=(u.role.slug==="owner"||u.role.slug==="admin"||u.role.slug==="user")&&!u.role.id,G=async(U,B)=>{const w=l.filter(L=>L.role===(B??U)).map(L=>L.id),z=u.memberIds.filter(L=>!w.includes(L)),y=w.filter(L=>!u.memberIds.includes(L));for(const L of z){const Y=await d.organization.updateMemberRole({memberId:L,role:[U]});if(Y?.error)throw new Error(Y.error.message??"Something went wrong")}for(const L of y){const Y=await d.organization.updateMemberRole({memberId:L,role:["user"]});if(Y?.error)throw new Error(Y.error.message??"Something went wrong")}};if(k)return await G(u.role.slug),u;if(u.role.id){const U=u.role.label.toLowerCase().replace(/\s+/g,"-"),B=u.role.slug,w=U!==B,z=await d.organization.updateRole({roleId:u.role.id,data:{permission:M,...w?{roleName:U}:{}}});if(z?.error)throw new Error(z.error.message??"Something went wrong");return await G(w?U:B,w?B:void 0),w?{...u,role:{...u.role,slug:U}}:u}else{const U=await d.organization.createRole({role:A,permission:M});if(U?.error)throw new Error(U.error.message??"Something went wrong");for(const B of u.memberIds){const w=await d.organization.updateMemberRole({memberId:B,role:[A]});if(w?.error)throw new Error(w.error.message)}return{...u,role:{...u.role,id:U.data?.roleData?.id,slug:A}}}},onSuccess:(u,M)=>{h.invalidateQueries({queryKey:re.members(r)}),h.invalidateQueries({queryKey:re.organizationRoles(r)});const A=!M.role.id&&!M.role.slug,k=M.role.slug==="owner"&&!M.role.id;Oe(k?"role_members_updated":A?"role_created":"role_updated",{role_slug:M.role.slug??null}),he.success(k?"Members updated successfully!":A?"Role created successfully!":"Role updated successfully!"),o.reset(u),n(u.role.id)},onError:u=>{he.error(u instanceof Error?u.message:"Failed to save role")}}),T=o.handleSubmit(u=>{if(!u.role.label.trim()){he.error("Role name is required"),o.setFocus("role.label");return}E.mutate(u)}),N=!g,C=t.kind==="builtin"?t.role.charAt(0).toUpperCase()+t.role.slice(1):t.kind==="custom"?t.role.label:"",v=[...g?[]:[{id:"mcp",label:"MCP Permissions"}],{id:"org",label:"Organization Permissions"},{id:"models",label:"Models"},{id:"members",label:"Members"}],[_,R]=$.useState(""),[p,O]=$.useState(!1),I=u=>{x(u),R("")},j={mcp:"Search MCP servers...",org:"Search permissions...",models:"Search models...",members:"Search members..."};return s.jsx(te,{children:s.jsxs(te.Content,{className:K("flex flex-col",a!=="org"&&"overflow-hidden"),children:[s.jsx("div",{className:"shrink-0 mx-auto w-full max-w-[1200px] px-4 md:px-10 pt-8 md:pt-12 pb-4",children:s.jsxs("div",{className:"flex flex-col gap-5",children:[s.jsx(te.Title,{actions:N&&s.jsxs(s.Fragment,{children:[s.jsx(ne,{variant:"outline",size:"sm",onClick:e,disabled:E.isPending,children:"Cancel"}),s.jsx(ne,{size:"sm",onClick:T,disabled:E.isPending||!m||!S,children:E.isPending?"Saving...":f?"Create Role":"Save Changes"})]}),children:s.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[s.jsx("div",{className:K("size-2.5 rounded-full shrink-0",t.kind==="builtin"?qt(t.role):Ht(o.watch("role.label")))}),g&&s.jsx(Ke,{size:16,className:"text-muted-foreground shrink-0"}),f||t.kind==="custom"?s.jsx("input",{...o.register("role.label"),placeholder:"Role name",className:"leading-tight text-foreground bg-transparent border-none outline-none px-1 -mx-1 rounded hover:bg-input/25 focus:bg-input/25 transition-colors w-64 placeholder:text-muted-foreground/50",autoFocus:f}):s.jsx("span",{className:"truncate",children:C})]})}),s.jsx("div",{className:"flex items-center gap-2",children:v.map(u=>s.jsx("button",{type:"button",onClick:()=>I(u.id),className:K("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex items-center",a===u.id?"bg-accent border-border text-foreground":"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:u.label},u.id))}),s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsx(ve,{value:_,onChange:R,placeholder:j[a]??"Search...",className:"w-full md:w-[375px]"}),a==="members"&&s.jsx(As,{readOnly:t.kind==="builtin"&&t.role==="owner",onOpen:()=>O(!0)})]})]})}),s.jsx("div",{className:K("mx-auto w-full max-w-[1200px] px-4 md:px-10 pb-6",a!=="org"&&"flex-1 min-h-0"),children:s.jsxs("div",{className:K(a!=="org"&&"h-full overflow-hidden",a!=="models"&&a!=="org"&&"border border-border rounded-xl bg-card"),children:[a==="mcp"&&!g&&s.jsx(Kt,{toolSet:o.watch("toolSet"),onToolSetChange:u=>o.setValue("toolSet",u,{shouldDirty:!0}),searchQuery:_}),a==="org"&&s.jsx(Jt,{allowAllStaticPermissions:o.watch("allowAllStaticPermissions"),staticPermissions:o.watch("staticPermissions"),onAllowAllChange:u=>o.setValue("allowAllStaticPermissions",u,{shouldDirty:!0}),onPermissionsChange:u=>o.setValue("staticPermissions",u,{shouldDirty:!0}),readOnly:g,searchQuery:_}),a==="models"&&s.jsx(gs,{allowAllModels:o.watch("allowAllModels"),modelSet:o.watch("modelSet"),onAllowAllChange:u=>o.setValue("allowAllModels",u,{shouldDirty:!0}),onModelSetChange:u=>o.setValue("modelSet",u,{shouldDirty:!0}),readOnly:g,searchQuery:_}),a==="members"&&s.jsx(Es,{memberIds:o.watch("memberIds"),onMemberIdsChange:u=>o.setValue("memberIds",u,{shouldDirty:!0}),readOnly:t.kind==="builtin"&&(t.role==="owner"||t.role==="user"),readOnlyMessage:t.kind==="builtin"&&t.role==="user"?"User is the default role — members can't be removed from it; assign another role to change their access":"Owner membership cannot be changed",searchQuery:_,addMemberDialogOpen:p,onAddMemberDialogOpenChange:O})]})})]})})}function js(t){return t.kind==="builtin"?`builtin-${t.role}`:t.kind==="custom"?`custom-${t.role.id}`:"new"}function vs(t){const e=H.c(6),{area:n,children:l}=t,{isPrivileged:i,loading:r,error:d}=Dt();let h;return e[0]!==n||e[1]!==l||e[2]!==d||e[3]!==i||e[4]!==r?(h=s.jsx(kt,{granted:i,loading:r,error:d,area:n,children:l}),e[0]=n,e[1]=l,e[2]=d,e[3]=i,e[4]=r,e[5]=h):h=e[5],h}const ys=[{role:"owner",label:"Owner",color:"bg-red-500"},{role:"admin",label:"Admin",color:"bg-blue-500"},{role:"user",label:"User",color:"bg-green-500"}],Ce=["bg-red-500","bg-orange-500","bg-amber-500","bg-yellow-500","bg-lime-500","bg-green-500","bg-emerald-500","bg-teal-500","bg-cyan-500","bg-sky-500","bg-blue-500","bg-indigo-500","bg-violet-500","bg-purple-500","bg-fuchsia-500","bg-pink-500","bg-rose-500"];function Ms(t){if(!t)return"bg-neutral-400";let e=0;for(let l=0;l<t.length;l++){const i=t.charCodeAt(l);e=(e<<5)-e+i,e=e&e}const n=Math.abs(e)%Ce.length;return Ce[n]??Ce[0]}const ws={owner:"bg-red-500",admin:"bg-blue-500",user:"bg-green-500"};function Ls(t,e){return e?ws[t]??"bg-neutral-400":Ms(t)}function Ps(){const t=H.c(77),[e,n]=$.useState(""),[l,i]=$.useState(null),r=gt();let d;t[0]===Symbol.for("react.memo_cache_sentinel")?(d={strict:!1},t[0]=d):d=t[0];const{role:h}=xt(d),{locator:c}=Se(),g=je(),f=$e(),{customRoles:a,refetch:x}=pt();let o;t[1]!==r?(o=P=>r({to:".",search:V=>({...V,role:P})}),t[1]=r,t[2]=o):o=t[2];const m=o;let S;e:{if(!h){S=null;break e}if(h==="new"){S={kind:"new"};break e}if(h.startsWith("builtin-")){S={kind:"builtin",role:h.slice(8)};break e}let P;t[3]!==h?(P=ae=>ae.id===h,t[3]=h,t[4]=P):P=t[4];const V=a.find(P);S=V?{kind:"custom",role:V}:null}const E=S;let T;t[5]!==c?(T=re.members(c),t[5]=c,t[6]=T):T=t[6];let N;t[7]!==g?(N=()=>g.organization.listMembers(),t[7]=g,t[8]=N):N=t[8];let C;t[9]!==T||t[10]!==N?(C={queryKey:T,queryFn:N},t[9]=T,t[10]=N,t[11]=C):C=t[11];const{data:v}=Re(C);let _;t[12]!==v?.data?.members?(_=v?.data?.members??[],t[12]=v?.data?.members,t[13]=_):_=t[13];const R=_;let p;t[14]!==R?(p=P=>R.filter(V=>V.role===P).length,t[14]=R,t[15]=p):p=t[15];const O=p;let I;if(t[16]!==a||t[17]!==O||t[18]!==e){let P;t[20]!==O?(P=ce=>({kind:"builtin",role:{...ce,memberCount:O(ce.role)}}),t[20]=O,t[21]=P):P=t[21];const V=ys.map(P);let ae;t[22]!==O?(ae=ce=>({kind:"custom",role:{...ce,memberCount:O(ce.role)}}),t[22]=O,t[23]=ae):ae=t[23];const at=a.map(ae);if(I=[...V,...at],e){const ce=e.toLowerCase();I=I.filter(ct=>ct.role.label.toLowerCase().includes(ce))}t[16]=a,t[17]=O,t[18]=e,t[19]=I}else I=t[19];let j;t[24]!==g?(j=async P=>{const V=await g.organization.deleteRole({roleId:P});if(V?.error)throw new Error(V.error.message);return V?.data},t[24]=g,t[25]=j):j=t[25];const u=Fe({mutationFn:j,onSuccess:(P,V)=>{Oe("role_deleted",{role_id:V}),f.invalidateQueries({queryKey:re.members(c)}),f.invalidateQueries({queryKey:re.organizationRoles(c)}),he.success("Role deleted successfully!"),x(),E?.kind==="custom"&&E.role.id===V&&m(void 0)},onError:zs});let M,A,k,G;t[26]===Symbol.for("react.memo_cache_sentinel")?(G={id:"role",header:"Role",render:Vs,cellClassName:"flex-1 min-w-0",sortable:!0},M={id:"type",header:"Type",render:Bs,cellClassName:"w-28 shrink-0"},A={id:"permissions",header:"Permissions",render:Us,cellClassName:"flex-1 min-w-0"},k={id:"members",header:"Members",render:Gs,cellClassName:"w-24 shrink-0"},t[26]=M,t[27]=A,t[28]=k,t[29]=G):(M=t[26],A=t[27],k=t[28],G=t[29]);let U;t[30]===Symbol.for("react.memo_cache_sentinel")?(U=[G,M,A,k,{id:"actions",header:"",render:P=>P.kind==="builtin"?null:s.jsxs(bt,{children:[s.jsx(Tt,{asChild:!0,children:s.jsx(ne,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:ks,children:s.jsx(It,{size:16})})}),s.jsx(Et,{align:"end",onClick:Ds,children:s.jsxs(_t,{variant:"destructive",onClick:()=>{const V=P.role;V.id&&i({id:V.id,label:V.label})},children:[s.jsx(St,{size:16}),"Delete"]})})]}),cellClassName:"w-12 shrink-0"}],t[30]=U):U=t[30];const B=U;let w;t[31]!==m?(w=P=>{if(P.kind==="builtin")m(`builtin-${P.role.role}`);else{const V=P.role;m(V.id)}},t[31]=m,t[32]=w):w=t[32];const z=w;if(E){let P;t[33]!==m?(P=()=>m(void 0),t[33]=m,t[34]=P):P=t[34];let V;return t[35]!==x||t[36]!==m?(V=()=>{x(),m(void 0)},t[35]=x,t[36]=m,t[37]=V):V=t[37],s.jsx(Rs,{target:E,onBack:P,onSaved:V},js(E))}let y;t[38]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(te.Title,{children:"Roles"}),t[38]=y):y=t[38];let L;t[39]===Symbol.for("react.memo_cache_sentinel")?(L=P=>{P.key==="Escape"&&(n(""),P.target.blur())},t[39]=L):L=t[39];let Y;t[40]!==e?(Y=s.jsx(ve,{value:e,onChange:n,placeholder:"Search roles...",className:"w-full md:w-[375px]",onKeyDown:L}),t[40]=e,t[41]=Y):Y=t[41];let F;t[42]!==m?(F=()=>m("new"),t[42]=m,t[43]=F):F=t[43];let J;t[44]===Symbol.for("react.memo_cache_sentinel")?(J=s.jsx(Ae,{size:16}),t[44]=J):J=t[44];let X;t[45]!==F?(X=s.jsxs(ne,{onClick:F,children:[J,"Create Role"]}),t[45]=F,t[46]=X):X=t[46];let le;t[47]!==Y||t[48]!==X?(le=s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[Y,X]}),t[47]=Y,t[48]=X,t[49]=le):le=t[49];let oe;t[50]!==e?(oe=e?s.jsx(Ge,{title:"No roles found",description:`No roles match "${e}"`}):s.jsx(Ge,{title:"No roles",description:"Create a role to get started."}),t[50]=e,t[51]=oe):oe=t[51];let ie;t[52]!==I||t[53]!==B||t[54]!==z||t[55]!==oe?(ie=s.jsx(Nt,{columns:B,data:I,isLoading:!1,onRowClick:z,emptyState:oe}),t[52]=I,t[53]=B,t[54]=z,t[55]=oe,t[56]=ie):ie=t[56];let b;t[57]!==le||t[58]!==ie?(b=s.jsx(te.Content,{children:s.jsx(te.Body,{children:s.jsxs("div",{className:"flex flex-col gap-6",children:[y,le,ie]})})}),t[57]=le,t[58]=ie,t[59]=b):b=t[59];const D=l!==null;let Q;t[60]===Symbol.for("react.memo_cache_sentinel")?(Q=P=>!P&&i(null),t[60]=Q):Q=t[60];let q;t[61]===Symbol.for("react.memo_cache_sentinel")?(q=s.jsx(Ze,{children:"Delete Role"}),t[61]=q):q=t[61];const W=l?.label;let Z;t[62]!==W?(Z=s.jsxs(qe,{children:[q,s.jsxs(Je,{children:['Are you sure you want to delete the "',W,'" role? This action cannot be undone.']})]}),t[62]=W,t[63]=Z):Z=t[63];let ee;t[64]===Symbol.for("react.memo_cache_sentinel")?(ee=s.jsx(Xe,{children:"Cancel"}),t[64]=ee):ee=t[64];let de;t[65]!==u||t[66]!==l?(de=s.jsxs(We,{children:[ee,s.jsx(et,{onClick:()=>{l?.id&&u.mutate(l.id),i(null)},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[65]=u,t[66]=l,t[67]=de):de=t[67];let me;t[68]!==Z||t[69]!==de?(me=s.jsxs(He,{children:[Z,de]}),t[68]=Z,t[69]=de,t[70]=me):me=t[70];let ue;t[71]!==D||t[72]!==me?(ue=s.jsx(Qe,{open:D,onOpenChange:Q,children:me}),t[71]=D,t[72]=me,t[73]=ue):ue=t[73];let _e;return t[74]!==b||t[75]!==ue?(_e=s.jsxs(te,{children:[b,ue]}),t[74]=b,t[75]=ue,t[76]=_e):_e=t[76],_e}function Ds(t){return t.stopPropagation()}function ks(t){return t.stopPropagation()}function Gs(t){return s.jsx("span",{className:"text-sm text-foreground",children:t.role.memberCount})}function Us(t){if(t.kind==="builtin")return t.role.role==="owner"||t.role.role==="admin"?s.jsx("span",{className:"text-sm text-muted-foreground",children:"Full access"}):s.jsx("span",{className:"text-sm text-muted-foreground",children:"Basic access"});const e=t.role,n=[];return e.allowsAllStaticPermissions?n.push("Full org access"):e.staticPermissionCount&&e.staticPermissionCount>0&&n.push(`${e.staticPermissionCount} org perm${e.staticPermissionCount!==1?"s":""}`),e.allowsAllConnections?n.push("All connections"):e.connectionCount&&e.connectionCount>0&&n.push(`${e.connectionCount} connection${e.connectionCount!==1?"s":""}`),s.jsx("span",{className:"text-sm text-muted-foreground truncate",children:n.length>0?n.join(", "):"No permissions"})}function Bs(t){return t.kind==="builtin"?s.jsx(ge,{variant:"secondary",className:"text-xs",children:"Built-in"}):s.jsx(ge,{variant:"outline",className:"text-xs",children:"Custom"})}function Vs(t){return s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:K("size-2.5 rounded-full shrink-0",Ls(t.role.role,t.kind==="builtin"))}),s.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:t.role.label}),t.kind==="builtin"&&s.jsx(Ke,{size:12,className:"text-muted-foreground shrink-0"})]})}function zs(t,e){Oe("role_delete_failed",{role_id:e,error:t instanceof Error?t.message:String(t)}),he.error(t instanceof Error?t.message:"Failed to delete role")}function Ys(){const t=H.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(te,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-sm text-muted-foreground",children:"Failed to load roles"})})}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(ht,{fallback:e,children:s.jsx($.Suspense,{fallback:s.jsx(te,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(fe,{size:32,className:"animate-spin text-muted-foreground"})})}),children:s.jsx(Ps,{})})}),t[1]=n):n=t[1],n}function Sl(){const t=H.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(vs,{area:"roles",children:s.jsx(Ys,{})}),t[0]=e):e=t[0],e}export{Sl as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Z as rt,_ as Ie,$ as at,a0 as lt,a1 as He,n as he,a2 as ct,a3 as dt,r as Q,a4 as ut,a5 as mt,a6 as ft,a7 as pt,a8 as Me,a9 as ht,aa as gt,ab as xt,c as H,l as ie,j as t,B as V,d as we,K as W,H as xe,I as re,J as ye,M as be,i as _e,m as me,t as Ee,v as Te,p as oe,Q as yt,E as bt,a as vt}from"./index-C5JCmVQ0.js";import{u as Oe}from"./use-mcp-client-DlCO79GA.js";import{W as Be,S as Ct}from"./constants-D_FQAPnt.js";import{I as ke}from"./integration-icon-D74EpYgv.js";import{c as fe,a as Ve,h as We,D as Ye,d as Ze,e as Xe}from"./dialog-DfnhzCwv.js";import{b as Re,T as Ae,a as De}from"./tooltip-DjWNMg5T.js";import{i as Pe}from"./CheckCircle-Day5nLHt.js";import{d as Je,f as jt,g as et}from"./agent-icon-DMtjBPX3.js";import{u as se,t as St,m as _t,s as Nt,g as wt,p as Et,F as Tt,b as It,a as Ot,c as kt}from"./companions-core-CrqiPrVn.js";import{F as ae,a as ve,b as le,c as Se,d as ce,f as de,e as Rt}from"./form-ZPjO3One.js";import{I as Ce}from"./input-DWv95vY4.js";import{i as At}from"./Check-BbAbdPfp.js";import{s as Dt,a as tt}from"./Eye-CyP9kYwn.js";import{i as Pt}from"./Settings02-DAAnVZLO.js";import{u as Lt}from"./use-debounced-value-DEfVi-aN.js";import{f as $t}from"./github-installations-ChFezl8I.js";import{c as zt,e as qt}from"./extract-connection-data-DkYKg47U.js";import{a as Ft}from"./authenticate-and-persist-oauth-Bb5P11Gd.js";import{i as st}from"./ArrowUpRight-Bq-zX9ha.js";function Qe(o,e){const s=new Set(e);return o.filter(n=>!s.has(n))}function Kt(o,e,s){const n=o.slice(0);return n[e]=s,n}var Ut=class extends rt{#o;#e;#i;#n;#t;#s;#r;#a;#l;#c=[];constructor(o,e,s){super(),this.#o=o,this.#n=s,this.#i=[],this.#t=[],this.#e=[],this.setQueries(e)}onSubscribe(){this.listeners.size===1&&this.#t.forEach(o=>{o.subscribe(e=>{this.#f(o,e)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#t.forEach(o=>{o.destroy()})}setQueries(o,e){this.#i=o,this.#n=e,Ie.batch(()=>{const s=this.#t,n=this.#m(this.#i);n.forEach(r=>r.observer.setOptions(r.defaultedQueryOptions));const i=n.map(r=>r.observer),a=i.map(r=>r.getCurrentResult()),l=s.length!==i.length,c=i.some((r,f)=>r!==s[f]),u=l||c,p=u?!0:a.some((r,f)=>{const m=this.#e[f];return!m||!at(r,m)});!u&&!p||(u&&(this.#c=n,this.#t=i),this.#e=a,this.hasListeners()&&(u&&(Qe(s,i).forEach(r=>{r.destroy()}),Qe(i,s).forEach(r=>{r.subscribe(f=>{this.#f(r,f)})})),this.#p()))})}getCurrentResult(){return this.#e}getQueries(){return this.#t.map(o=>o.getCurrentQuery())}getObservers(){return this.#t}getOptimisticResult(o,e){const s=this.#m(o),n=s.map(a=>a.observer.getOptimisticResult(a.defaultedQueryOptions)),i=s.map(a=>a.defaultedQueryOptions.queryHash);return[n,a=>this.#u(a??n,e,i),()=>this.#d(n,s)]}#d(o,e){return e.map((s,n)=>{const i=o[n];return s.defaultedQueryOptions.notifyOnChangeProps?i:s.observer.trackResult(i,a=>{e.forEach(l=>{l.observer.trackProp(a)})})})}#u(o,e,s){if(e){const n=this.#l,i=s!==void 0&&n!==void 0&&(n.length!==s.length||s.some((a,l)=>a!==n[l]));return(!this.#s||this.#e!==this.#a||i||e!==this.#r)&&(this.#r=e,this.#a=this.#e,s!==void 0&&(this.#l=s),this.#s=lt(this.#s,e(o))),this.#s}return o}#h(){return this.#n?.combine!==void 0&&this.#t.some((o,e)=>o.options.suspense&&this.#e[e]?.data===void 0)}#m(o){const e=new Map;this.#t.forEach(n=>{const i=n.options.queryHash;if(!i)return;const a=e.get(i);a?a.push(n):e.set(i,[n])});const s=[];return o.forEach(n=>{const i=this.#o.defaultQueryOptions(n),l=e.get(i.queryHash)?.shift()??new He(this.#o,i);s.push({defaultedQueryOptions:i,observer:l})}),s}#f(o,e){const s=this.#t.indexOf(o);s!==-1&&(this.#e=Kt(this.#e,s,e),this.#p())}#p(){if(this.hasListeners()){const o=this.#d(this.#e,this.#c),e=this.#h(),s=this.#s,n=e?s:this.#u(o,this.#n?.combine);(e||s!==n)&&Ie.batch(()=>{this.listeners.forEach(i=>{i(this.#e)})})}}};function Mt({queries:o,...e},s){const n=he(s),i=ct(),a=dt(),l=Q.useMemo(()=>o.map(v=>{const g=n.defaultQueryOptions(v);return g._optimisticResults=i?"isRestoring":"optimistic",g}),[o,n,i]);l.forEach(v=>{ut(v);const g=n.getQueryCache().get(v.queryHash);mt(v,a,g)}),ft(a);const[c]=Q.useState(()=>new Ut(n,l,e)),[u,p,r]=c.getOptimisticResult(l,e.combine),f=!i&&e.subscribed!==!1;Q.useSyncExternalStore(Q.useCallback(v=>f?c.subscribe(Ie.batchCalls(v)):pt,[c,f]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),Q.useEffect(()=>{c.setQueries(l,e)},[l,e,c]);const h=u.some((v,g)=>Me(l[g],v))?u.flatMap((v,g)=>{const d=l[g];if(d&&Me(d,v)){const y=new He(n,d);return ht(d,y,a)}return[]}):[];if(h.length>0)throw Promise.all(h);const S=u.find((v,g)=>{const d=l[g];return d&>({result:v,errorResetBoundary:a,throwOnError:d.throwOnError,query:n.getQueryCache().get(d.queryHash),suspense:d.suspense})});if(S?.error)throw S.error;return p(r())}function Qt(o,e){return Mt({...o,queries:o.queries.map(s=>({...s,suspense:!0,throwOnError:xt,enabled:!0,placeholderData:void 0}))},e)}const Gt=/^[a-zA-Z][a-zA-Z\d+.-]*:/,Ht=/^[a-zA-Z][a-zA-Z\d+.-]*:\/\//,Bt=/^[^\s/:?#]+\.[^\s/:?#]+:\d+(?:[/?#]|$)/,Vt=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/i;function Ne(o){const e=o.trim();if(!e)return{ok:!1,error:"Enter a website URL."};const s=Gt.test(e),n=Ht.test(e),i=Bt.test(e);if(s&&!n&&!i)return{ok:!1,error:"Use an HTTP or HTTPS website URL."};const a=n?e:`https://${e}`;let l;try{l=new URL(a)}catch{return{ok:!1,error:"Enter a valid website URL."}}if(l.protocol!=="http:"&&l.protocol!=="https:")return{ok:!1,error:"Use an HTTP or HTTPS website URL."};const c=l.hostname.split(".");return c.length<2||c.some(u=>!u||!Vt.test(u))?{ok:!1,error:"Enter a valid website URL."}:(l.protocol="https:",{ok:!0,value:l.origin})}function xn(o,e){if(!o.trim())return!0;const s=Ne(o);if(!s.ok||!e)return!1;const n=Ne(e);return n.ok&&n.value===s.value}function yn(o){if(!o)return null;const e=Ne(o);return e.ok?new URL(e.value).hostname:null}function Wt(o){const e=H.c(14),{children:s,className:n,wrapperClassName:i}=o,[a,l]=Q.useState(!0);let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=v=>{if(!v)return;const g=()=>{const y=v.scrollHeight-v.scrollTop-v.clientHeight<8;l(y)};g(),v.addEventListener("scroll",g,{passive:!0});const d=new ResizeObserver(g);d.observe(v);for(const y of Array.from(v.children))d.observe(y);return()=>{v.removeEventListener("scroll",g),d.disconnect()}},e[0]=c):c=e[0];const u=c;let p;e[1]!==i?(p=ie("relative",i),e[1]=i,e[2]=p):p=e[2];let r;e[3]!==s||e[4]!==n?(r=t.jsx("div",{ref:u,className:n,children:s}),e[3]=s,e[4]=n,e[5]=r):r=e[5];const f=a?"opacity-0":"opacity-100";let m;e[6]!==f?(m=ie("pointer-events-none absolute inset-x-0 -bottom-px h-[72px]","bg-gradient-to-t from-sidebar from-[6px] to-transparent","backdrop-blur-[1px] [mask-image:linear-gradient(to_top,black_6px,transparent)]","transition-opacity duration-200",f),e[6]=f,e[7]=m):m=e[7];let h;e[8]!==m?(h=t.jsx("div",{"aria-hidden":!0,className:m}),e[8]=m,e[9]=h):h=e[9];let S;return e[10]!==p||e[11]!==r||e[12]!==h?(S=t.jsxs("div",{className:p,children:[r,h]}),e[10]=p,e[11]=r,e[12]=h,e[13]=S):S=e[13],S}function Ge(o){const e=H.c(38);let s,n,i,a,l;e[0]!==o?({value:l,onChange:n,placeholder:i,className:s,...a}=o,e[0]=o,e[1]=s,e[2]=n,e[3]=i,e[4]=a,e[5]=l):(s=e[1],n=e[2],i=e[3],a=e[4],l=e[5]);const[c,u]=Q.useState(!1),[p,r]=Q.useState(!1);let f;e[6]!==l?(f=async()=>{if(l)try{await navigator.clipboard.writeText(l),r(!0),setTimeout(()=>r(!1),2e3)}catch(k){console.error("Failed to copy text: ",k)}},e[6]=l,e[7]=f):f=e[7];const m=f;let h;e[8]!==c?(h=()=>{u(!c)},e[8]=c,e[9]=h):h=e[9];const S=h,v=c?"text":"password";let g;e[10]!==s?(g=ie("pr-20",s),e[10]=s,e[11]=g):g=e[11];let d;e[12]!==n||e[13]!==i||e[14]!==a||e[15]!==v||e[16]!==g||e[17]!==l?(d=t.jsx(Ce,{type:v,value:l,onChange:n,placeholder:i,className:g,...a}),e[12]=n,e[13]=i,e[14]=a,e[15]=v,e[16]=g,e[17]=l,e[18]=d):d=e[18];const y=c?"Hide password":"Show password";let C;e[19]!==c?(C=c?t.jsx(Pt,{size:16}):t.jsx(Dt,{size:16}),e[19]=c,e[20]=C):C=e[20];let x;e[21]!==y||e[22]!==C||e[23]!==S?(x=t.jsx(V,{type:"button",variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:S,title:y,children:C}),e[21]=y,e[22]=C,e[23]=S,e[24]=x):x=e[24];const E=!l,_=p?"Copied!":"Copy token";let j;e[25]!==p?(j=p?t.jsx(At,{size:16}):t.jsx(tt,{size:16}),e[25]=p,e[26]=j):j=e[26];let b;e[27]!==m||e[28]!==_||e[29]!==j||e[30]!==E?(b=t.jsx(V,{type:"button",variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:m,disabled:E,title:_,children:j}),e[27]=m,e[28]=_,e[29]=j,e[30]=E,e[31]=b):b=e[31];let N;e[32]!==b||e[33]!==x?(N=t.jsxs("div",{className:"absolute right-1 top-1 flex items-center gap-1 h-8",children:[x,b]}),e[32]=b,e[33]=x,e[34]=N):N=e[34];let O;return e[35]!==N||e[36]!==d?(O=t.jsxs("div",{className:"relative",children:[d,N]}),e[35]=N,e[36]=d,e[37]=O):O=e[37],O}function Le(o){const e=H.c(19),{card:s,selfClient:n,org:i,onDone:a,onError:l}=o,c=he();let u;e[0]!==s||e[1]!==n?(u=async g=>{const d={...s.configurationState??{},...g};await n.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:s.linkedConnectionId||s.candidateConnectionId,data:{configuration_state:d}}})},e[0]=s,e[1]=n,e[2]=u):u=e[2];let p;e[3]!==a||e[4]!==i||e[5]!==c?(p=async()=>{await c.invalidateQueries({queryKey:W.commerceDiscoveryCompanionConnectionsPrefix(i.id)}),a()},e[3]=a,e[4]=i,e[5]=c,e[6]=p):p=e[6];let r;e[7]!==l?(r=g=>{l?.(g)},e[7]=l,e[8]=r):r=e[8];let f;e[9]!==u||e[10]!==p||e[11]!==r?(f={mutationFn:u,onSuccess:p,onError:r},e[9]=u,e[10]=p,e[11]=r,e[12]=f):f=e[12];const m=we(f);let h;e[13]!==m?(h=g=>m.mutate(g),e[13]=m,e[14]=h):h=e[14];const S=h;let v;return e[15]!==m.error||e[16]!==m.isPending||e[17]!==S?(v={save:S,isPending:m.isPending,error:m.error},e[15]=m.error,e[16]=m.isPending,e[17]=S,e[18]=v):v=e[18],v}const Yt=xe({accountName:re().min(1,"Informe o nome da conta"),appKey:re().optional(),appToken:re().optional()});function Zt(o){const e=H.c(63),{card:s,selfClient:n,org:i,onDone:a,onIsPendingChange:l}=o;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=ye(Yt),e[0]=c):c=e[0];const u=s.configurationState?.accountName||"",p=s.configurationState?.appKey||"",r=s.configurationState?.appToken||"";let f;e[1]!==u||e[2]!==p||e[3]!==r?(f={resolver:c,defaultValues:{accountName:u,appKey:p,appToken:r}},e[1]=u,e[2]=p,e[3]=r,e[4]=f):f=e[4];const m=be(f);let h;e[5]!==s.configurationState?.accountName||e[6]!==s.configurationState?.appKey||e[7]!==s.configurationState?.appToken||e[8]!==m?(h=()=>{m.reset({accountName:s.configurationState?.accountName||"",appKey:s.configurationState?.appKey||"",appToken:s.configurationState?.appToken||""})},e[5]=s.configurationState?.accountName,e[6]=s.configurationState?.appKey,e[7]=s.configurationState?.appToken,e[8]=m,e[9]=h):h=e[9];let S;e[10]!==s.configurationState||e[11]!==m?(S=[s.configurationState,m],e[10]=s.configurationState,e[11]=m,e[12]=S):S=e[12],Q.useEffect(h,S);let v;e[13]!==s||e[14]!==a||e[15]!==i||e[16]!==n?(v={card:s,selfClient:n,org:i,onDone:a},e[13]=s,e[14]=a,e[15]=i,e[16]=n,e[17]=v):v=e[17];const{save:g,isPending:d,error:y}=Le(v);let C,x;e[18]!==d||e[19]!==l?(x=()=>{l?.(d)},C=[d,l],e[18]=d,e[19]=l,e[20]=C,e[21]=x):(C=e[20],x=e[21]),Q.useEffect(x,C);let E;if(e[22]!==m||e[23]!==g){let P;e[25]!==g?(P=async F=>{g(F)},e[25]=g,e[26]=P):P=e[26],E=m.handleSubmit(P),e[22]=m,e[23]=g,e[24]=E}else E=e[24];const _=E;let j;e[27]!==d?(j=P=>{const{field:F}=P;return t.jsxs(le,{children:[t.jsx(Se,{children:"Nome da conta"}),t.jsx(ce,{children:t.jsx(Ce,{placeholder:"Nome da sua conta VTEX",...F,disabled:d})}),t.jsx(de,{})]})},e[27]=d,e[28]=j):j=e[28];let b;e[29]!==m.control||e[30]!==j?(b=t.jsx(ae,{control:m.control,name:"accountName",render:j}),e[29]=m.control,e[30]=j,e[31]=b):b=e[31];let N;e[32]!==d?(N=P=>{const{field:F}=P;return t.jsxs(le,{children:[t.jsx(Se,{children:"App Key (opcional)"}),t.jsx(ce,{children:t.jsx(Ge,{placeholder:"App Key da VTEX",...F,disabled:d})}),t.jsx(de,{})]})},e[32]=d,e[33]=N):N=e[33];let O;e[34]!==m.control||e[35]!==N?(O=t.jsx(ae,{control:m.control,name:"appKey",render:N}),e[34]=m.control,e[35]=N,e[36]=O):O=e[36];let k;e[37]!==d?(k=P=>{const{field:F}=P;return t.jsxs(le,{children:[t.jsx(Se,{children:"App Token (opcional)"}),t.jsx(ce,{children:t.jsx(Ge,{placeholder:"App Token da VTEX",...F,disabled:d})}),t.jsx(de,{})]})},e[37]=d,e[38]=k):k=e[38];let w;e[39]!==m.control||e[40]!==k?(w=t.jsx(ae,{control:m.control,name:"appToken",render:k}),e[39]=m.control,e[40]=k,e[41]=w):w=e[41];let I;e[42]!==m||e[43]!==b||e[44]!==O||e[45]!==w?(I=t.jsxs(ve,{...m,children:[b,O,w]}),e[42]=m,e[43]=b,e[44]=O,e[45]=w,e[46]=I):I=e[46];let D;e[47]!==y?(D=y&&t.jsx("p",{role:"alert",className:"text-sm text-destructive",children:y instanceof Error?y.message:"Não foi possível salvar a configuração"}),e[47]=y,e[48]=D):D=e[48];let L;e[49]!==d||e[50]!==a?(L=t.jsx(V,{type:"button",variant:"outline",onClick:a,disabled:d,children:"Cancelar"}),e[49]=d,e[50]=a,e[51]=L):L=e[51];const K=d?"Salvando...":"Salvar";let $;e[52]!==d||e[53]!==K?($=t.jsx(V,{type:"submit",disabled:d,children:K}),e[52]=d,e[53]=K,e[54]=$):$=e[54];let q;e[55]!==L||e[56]!==$?(q=t.jsxs(fe,{className:"pt-4",children:[L,$]}),e[55]=L,e[56]=$,e[57]=q):q=e[57];let M;return e[58]!==_||e[59]!==I||e[60]!==D||e[61]!==q?(M=t.jsxs("form",{onSubmit:_,className:"space-y-4",children:[I,D,q]}),e[58]=_,e[59]=I,e[60]=D,e[61]=q,e[62]=M):M=e[62],M}function $e(o){const e=H.c(29),{options:s,value:n,onChange:i,disabled:a,ariaLabel:l,searchPlaceholder:c,hideSearch:u}=o,p=c===void 0?"Buscar...":c,r=u===void 0?!1:u,[f,m]=Q.useState("");let h,S,v;if(e[0]!==s||e[1]!==f||e[2]!==n){const j=f.trim().toLowerCase();h=j?s.filter(b=>b.label.toLowerCase().includes(j)):s,S=h.map(Xt),v=S.includes(n)?n:S[0]??"",e[0]=s,e[1]=f,e[2]=n,e[3]=h,e[4]=S,e[5]=v}else h=e[3],S=e[4],v=e[5];const g=v;let d;e[6]!==a||e[7]!==S||e[8]!==i?(d=function(b){if(a||!["ArrowDown","ArrowRight","ArrowUp","ArrowLeft","Home","End"].includes(b.key))return;b.preventDefault();const O=b.currentTarget.dataset.value,k=S.indexOf(O),w=S.length;if(w===0)return;let I;b.key==="ArrowDown"||b.key==="ArrowRight"?I=(k+1)%w:b.key==="ArrowUp"||b.key==="ArrowLeft"?I=(k-1+w)%w:b.key==="Home"?I=0:I=w-1;const D=S[I];i(D),b.currentTarget.closest('[role="radiogroup"]')?.querySelector(`[data-value="${CSS.escape(D)}"]`)?.focus()},e[6]=a,e[7]=S,e[8]=i,e[9]=d):d=e[9];const y=d;let C;e[10]!==l||e[11]!==a||e[12]!==r||e[13]!==f||e[14]!==p?(C=r?null:t.jsxs("div",{className:"relative",children:[t.jsx(Je,{size:16,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),t.jsx(Ce,{type:"text",value:f,onChange:j=>m(j.target.value),disabled:a,placeholder:p,"aria-label":`Buscar ${l}`,className:"h-8 pl-8"})]}),e[10]=l,e[11]=a,e[12]=r,e[13]=f,e[14]=p,e[15]=C):C=e[15];let x;e[16]!==a||e[17]!==h||e[18]!==y||e[19]!==i||e[20]!==g||e[21]!==n?(x=h.length===0?t.jsx("div",{className:"px-2 py-2 text-sm text-muted-foreground",children:"Nenhum resultado"}):h.map(j=>{const b=j.value===n;return t.jsxs("button",{type:"button",role:"radio","aria-checked":b,disabled:a,"data-value":j.value,tabIndex:j.value===g?0:-1,onClick:()=>i(j.value),onKeyDown:y,className:ie("flex w-full items-center justify-between gap-2 rounded-sm px-2 py-2 text-left text-sm","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","disabled:pointer-events-none disabled:opacity-50",b?"bg-muted font-medium text-foreground":"text-foreground hover:bg-muted/50"),children:[t.jsx("span",{className:"truncate",children:j.label}),b?t.jsx(Pe,{size:16,className:"shrink-0 text-primary"}):null]},j.value)}),e[16]=a,e[17]=h,e[18]=y,e[19]=i,e[20]=g,e[21]=n,e[22]=x):x=e[22];let E;e[23]!==l||e[24]!==x?(E=t.jsx("div",{role:"radiogroup","aria-label":l,className:"max-h-[280px] overflow-y-auto",children:x}),e[23]=l,e[24]=x,e[25]=E):E=e[25];let _;return e[26]!==C||e[27]!==E?(_=t.jsxs("div",{className:"space-y-2",children:[C,E]}),e[26]=C,e[27]=E,e[28]=_):_=e[28],_}function Xt(o){return o.value}function ze(o){const e=H.c(16),{label:s,iconSize:n,className:i,iconClassName:a,labelClassName:l}=o,c=n===void 0?14:n;let u;e[0]!==i?(u=ie("inline-flex items-center gap-2",i),e[0]=i,e[1]=u):u=e[1];let p;e[2]!==a?(p=ie("shrink-0 animate-spin",a),e[2]=a,e[3]=p):p=e[3];let r;e[4]!==c||e[5]!==p?(r=t.jsx(_e,{size:c,className:p}),e[4]=c,e[5]=p,e[6]=r):r=e[6];let f;e[7]!==l?(f=ie("text-sm",l),e[7]=l,e[8]=f):f=e[8];let m;e[9]!==s||e[10]!==f?(m=t.jsx("span",{className:f,children:s}),e[9]=s,e[10]=f,e[11]=m):m=e[11];let h;return e[12]!==u||e[13]!==r||e[14]!==m?(h=t.jsxs("span",{className:u,children:[r,m]}),e[12]=u,e[13]=r,e[14]=m,e[15]=h):h=e[15],h}const Jt=xe({propertyId:re().min(1,"Selecione uma propriedade")});function es(o){const e=H.c(68),{card:s,connectionId:n,companionClient:i,selfClient:a,org:l,onDone:c,onDisconnect:u,onIsPendingChange:p}=o;let r;e[0]!==n||e[1]!==l.id?(r=W.commerceDiscoveryCompanionGaProperties(l.id,n),e[0]=n,e[1]=l.id,e[2]=r):r=e[2];let f;e[3]!==i?(f=async()=>{const R=await i.callTool({name:"get-account-summaries",arguments:{}}),T=se(R);return St(T)},e[3]=i,e[4]=f):f=e[4];let m;e[5]!==r||e[6]!==f?(m={queryKey:r,queryFn:f},e[5]=r,e[6]=f,e[7]=m):m=e[7];const h=me(m);let S;e[8]===Symbol.for("react.memo_cache_sentinel")?(S=ye(Jt),e[8]=S):S=e[8];const v=s.configurationState?.propertyId||"";let g;e[9]!==v?(g={resolver:S,defaultValues:{propertyId:v}},e[9]=v,e[10]=g):g=e[10];const d=be(g);let y;e[11]!==s||e[12]!==c||e[13]!==l||e[14]!==a?(y={card:s,selfClient:a,org:l,onDone:c},e[11]=s,e[12]=c,e[13]=l,e[14]=a,e[15]=y):y=e[15];const{save:C,isPending:x,error:E}=Le(y);let _,j;e[16]!==x||e[17]!==p?(_=()=>{p?.(x)},j=[x,p],e[16]=x,e[17]=p,e[18]=_,e[19]=j):(_=e[18],j=e[19]),Q.useEffect(_,j);let b;if(e[20]!==d||e[21]!==C){let R;e[23]!==C?(R=async T=>{C(T)},e[23]=C,e[24]=R):R=e[24],b=d.handleSubmit(R),e[20]=d,e[21]=C,e[22]=b}else b=e[22];const N=b;if(h.isLoading){let R;return e[25]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsx("div",{className:"flex min-h-[200px] items-center justify-center",children:t.jsx(ze,{label:"Carregando propriedades..."})}),e[25]=R):R=e[25],R}if(h.isError){let R;return e[26]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsx("div",{className:"space-y-4",children:t.jsx("p",{className:"text-sm text-destructive",children:"Não foi possível carregar as propriedades do Google Analytics."})}),e[26]=R):R=e[26],R}let O;e[27]!==h.data?(O=h.data||[],e[27]=h.data,e[28]=O):O=e[28];const k=O;if(k.flatMap(ss).length===0){let R;e[29]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsx("p",{className:"text-sm text-muted-foreground",children:"Nenhuma propriedade do Google Analytics foi encontrada. Conecte uma conta do Google Analytics com propriedades."}),e[29]=R):R=e[29];let T;e[30]!==u?(T=u?t.jsx("button",{type:"button",onClick:u,className:"text-xs text-muted-foreground underline underline-offset-2 hover:text-destructive",children:"Desconectar conta"}):t.jsx("span",{}),e[30]=u,e[31]=T):T=e[31];let G;e[32]!==c?(G=t.jsx(V,{type:"button",variant:"outline",onClick:c,children:"Fechar"}),e[32]=c,e[33]=G):G=e[33];let Y;return e[34]!==T||e[35]!==G?(Y=t.jsxs("div",{className:"space-y-4",children:[R,t.jsxs(fe,{className:"flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[T,G]})]}),e[34]=T,e[35]=G,e[36]=Y):Y=e[36],Y}let I;e[37]!==x||e[38]!==k?(I=R=>{const{field:T}=R;return t.jsxs(le,{children:[t.jsx(ce,{children:t.jsx($e,{options:k.flatMap(ts),value:T.value,onChange:T.onChange,disabled:x,ariaLabel:"Propriedade do Google Analytics"})}),t.jsx(de,{})]})},e[37]=x,e[38]=k,e[39]=I):I=e[39];let D;e[40]!==d.control||e[41]!==I?(D=t.jsx(ae,{control:d.control,name:"propertyId",render:I}),e[40]=d.control,e[41]=I,e[42]=D):D=e[42];let L;e[43]!==d||e[44]!==D?(L=t.jsx(ve,{...d,children:D}),e[43]=d,e[44]=D,e[45]=L):L=e[45];let K;e[46]!==E?(K=E&&t.jsx("p",{role:"alert",className:"text-sm text-destructive",children:E instanceof Error?E.message:"Não foi possível salvar a configuração"}),e[46]=E,e[47]=K):K=e[47];let $;e[48]!==x||e[49]!==u?($=u?t.jsx("button",{type:"button",onClick:u,disabled:x,className:"text-xs text-muted-foreground underline underline-offset-2 hover:text-destructive disabled:opacity-50",children:"Desconectar conta"}):t.jsx("span",{}),e[48]=x,e[49]=u,e[50]=$):$=e[50];let q;e[51]!==x||e[52]!==c?(q=t.jsx(V,{type:"button",variant:"outline",onClick:c,disabled:x,children:"Cancelar"}),e[51]=x,e[52]=c,e[53]=q):q=e[53];const M=x?"Salvando...":"Salvar";let P;e[54]!==x||e[55]!==M?(P=t.jsx(V,{type:"submit",disabled:x,children:M}),e[54]=x,e[55]=M,e[56]=P):P=e[56];let F;e[57]!==q||e[58]!==P?(F=t.jsxs("div",{className:"flex gap-2",children:[q,P]}),e[57]=q,e[58]=P,e[59]=F):F=e[59];let z;e[60]!==$||e[61]!==F?(z=t.jsxs(fe,{className:"flex-col gap-2 pt-4 sm:flex-row sm:items-center sm:justify-between",children:[$,F]}),e[60]=$,e[61]=F,e[62]=z):z=e[62];let U;return e[63]!==N||e[64]!==L||e[65]!==K||e[66]!==z?(U=t.jsxs("form",{onSubmit:N,className:"space-y-4",children:[L,K,z]}),e[63]=N,e[64]=L,e[65]=K,e[66]=z,e[67]=U):U=e[67],U}function ts(o){return o.options}function ss(o){return o.options}const ns=xe({siteUrl:re().min(1,"Selecione um site")});function os(o){const e=H.c(62),{card:s,connectionId:n,companionClient:i,selfClient:a,org:l,contextSiteUrl:c,onDone:u,onIsPendingChange:p}=o;let r;e[0]!==n||e[1]!==l.id?(r=W.commerceDiscoveryCompanionGscSites(l.id,n),e[0]=n,e[1]=l.id,e[2]=r):r=e[2];let f;e[3]!==i?(f=async()=>{const T=await i.callTool({name:"list_sites",arguments:{}});return se(T).sites||[]},e[3]=i,e[4]=f):f=e[4];let m;e[5]!==r||e[6]!==f?(m={queryKey:r,queryFn:f},e[5]=r,e[6]=f,e[7]=m):m=e[7];const h=me(m);let S;e[8]===Symbol.for("react.memo_cache_sentinel")?(S=ye(ns),e[8]=S):S=e[8];const v=s.configurationState?.siteUrl||"";let g;e[9]!==v?(g={resolver:S,defaultValues:{siteUrl:v}},e[9]=v,e[10]=g):g=e[10];const d=be(g);let y;e[11]!==s||e[12]!==u||e[13]!==l||e[14]!==a?(y={card:s,selfClient:a,org:l,onDone:u},e[11]=s,e[12]=u,e[13]=l,e[14]=a,e[15]=y):y=e[15];const{save:C,isPending:x,error:E}=Le(y),_=Q.useRef(!1),j=s.configurationState?.siteUrl;let b,N;e[16]!==x||e[17]!==p?(b=()=>{p?.(x)},N=[x,p],e[16]=x,e[17]=p,e[18]=b,e[19]=N):(b=e[18],N=e[19]),Q.useEffect(b,N);let O,k;e[20]!==c||e[21]!==d||e[22]!==j||e[23]!==h.data||e[24]!==h.isSuccess?(O=()=>{if(!(_.current||!h.isSuccess)){if(_.current=!0,j){d.getValues("siteUrl")!==j&&d.setValue("siteUrl",j);return}if(!d.getValues("siteUrl")){const T=_t(c,h.data??[]);T&&d.setValue("siteUrl",T)}}},k=[h.isSuccess,h.data,j,c,d],e[20]=c,e[21]=d,e[22]=j,e[23]=h.data,e[24]=h.isSuccess,e[25]=O,e[26]=k):(O=e[25],k=e[26]),Q.useEffect(O,k);let w;if(e[27]!==d||e[28]!==C){let T;e[30]!==C?(T=async G=>{C(G)},e[30]=C,e[31]=T):T=e[31],w=d.handleSubmit(T),e[27]=d,e[28]=C,e[29]=w}else w=e[29];const I=w;if(h.isLoading){let T;return e[32]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx("div",{className:"flex min-h-[200px] items-center justify-center",children:t.jsx(ze,{label:"Carregando sites..."})}),e[32]=T):T=e[32],T}if(h.isError){let T;return e[33]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx("div",{className:"space-y-4",children:t.jsx("p",{className:"text-sm text-destructive",children:"Não foi possível carregar os sites do Google Search Console."})}),e[33]=T):T=e[33],T}let D;e[34]!==h.data?(D=h.data||[],e[34]=h.data,e[35]=D):D=e[35];const L=D;if(L.length===0){let T;return e[36]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx("div",{className:"space-y-4",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"Nenhum site verificado foi encontrado. Verifique um site no Google Search Console."})}),e[36]=T):T=e[36],T}let K;e[37]!==x||e[38]!==L?(K=T=>{const{field:G}=T;return t.jsxs(le,{children:[t.jsx(ce,{children:t.jsx($e,{options:L.map(is),value:G.value,onChange:G.onChange,disabled:x,ariaLabel:"Site verificado"})}),t.jsx(de,{})]})},e[37]=x,e[38]=L,e[39]=K):K=e[39];let $;e[40]!==d.control||e[41]!==K?($=t.jsx(ae,{control:d.control,name:"siteUrl",render:K}),e[40]=d.control,e[41]=K,e[42]=$):$=e[42];let q;e[43]!==d||e[44]!==$?(q=t.jsx(ve,{...d,children:$}),e[43]=d,e[44]=$,e[45]=q):q=e[45];let M;e[46]!==E?(M=E&&t.jsx("p",{role:"alert",className:"text-sm text-destructive",children:E instanceof Error?E.message:"Não foi possível salvar a configuração"}),e[46]=E,e[47]=M):M=e[47];let P;e[48]!==x||e[49]!==u?(P=t.jsx(V,{type:"button",variant:"outline",onClick:u,disabled:x,children:"Cancelar"}),e[48]=x,e[49]=u,e[50]=P):P=e[50];const F=x?"Salvando...":"Salvar";let z;e[51]!==x||e[52]!==F?(z=t.jsx(V,{type:"submit",disabled:x,children:F}),e[51]=x,e[52]=F,e[53]=z):z=e[53];let U;e[54]!==P||e[55]!==z?(U=t.jsxs(fe,{className:"pt-4",children:[P,z]}),e[54]=P,e[55]=z,e[56]=U):U=e[56];let R;return e[57]!==I||e[58]!==q||e[59]!==M||e[60]!==U?(R=t.jsxs("form",{onSubmit:I,className:"space-y-4",children:[q,M,U]}),e[57]=I,e[58]=q,e[59]=M,e[60]=U,e[61]=R):R=e[61],R}function is(o){return{value:o.siteUrl,label:o.siteUrl}}const rs=xe({githubRepo:re().min(1,"Selecione um repositório")}),as=15e3,ls=/^[\w.-]+\/[\w.-]+$/;async function cs(o,e,s,n){const{installations:i}=await $t(o,s),a=n.trim(),l=await Promise.allSettled(i.map(async r=>{const f=r.type==="User"?"user":"org",m=a?`${f}:${r.login} ${a} in:name`:`${f}:${r.login}`,S=await e.callTool({name:"search_repositories",arguments:{query:m,page:1,perPage:50}},void 0,{signal:AbortSignal.timeout(as)}),v=S.content?.[0]?.text;if(S.isError)throw new Error(v??"search_repositories failed");if(!v)throw new Error("empty search_repositories response");return JSON.parse(v).items??[]})),c=new Map;let u=0;for(const r of l){if(r.status==="rejected"){u+=1;continue}for(const f of r.value)f.full_name&&!c.has(f.full_name)&&c.set(f.full_name,f)}return{repos:Array.from(c.values()).sort((r,f)=>(f.updated_at??"").localeCompare(r.updated_at??"")).map(r=>r.full_name),failed:u,total:i.length}}function ds(o){const e=H.c(85),{connectionId:s,companionClient:n,selfClient:i,org:a,onDone:l,onIsPendingChange:c}=o,u=he();let p;e[0]!==a.id?(p=Be.COMMERCE_DISCOVERY(a.id),e[0]=a.id,e[1]=p):p=e[1];const r=p,[f,m]=Q.useState(""),h=Lt(f,300),S=Q.useRef(!1);let v;e[2]!==s||e[3]!==a.id?(v=W.commerceDiscoveryCompanionGithubSelected(a.id,s),e[2]=s,e[3]=a.id,e[4]=v):v=e[4];let g;e[5]!==r||e[6]!==i?(g=async()=>{const X=await i.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:r}}),te=se(X).item?.configuration_state??null;return typeof te?.github_repo=="string"?te.github_repo:""},e[5]=r,e[6]=i,e[7]=g):g=e[7];let d;e[8]!==v||e[9]!==g?(d={queryKey:v,queryFn:g},e[8]=v,e[9]=g,e[10]=d):d=e[10];const y=me(d);let C;e[11]!==s||e[12]!==h||e[13]!==a.id?(C=W.commerceDiscoveryCompanionGithubRepos(a.id,s,h.trim()),e[11]=s,e[12]=h,e[13]=a.id,e[14]=C):C=e[14];let x;e[15]!==n||e[16]!==s||e[17]!==h||e[18]!==i?(x=()=>cs(X=>i.callTool(X),n,s,h),e[15]=n,e[16]=s,e[17]=h,e[18]=i,e[19]=x):x=e[19];let E;e[20]!==C||e[21]!==x?(E={queryKey:C,queryFn:x},e[20]=C,e[21]=x,e[22]=E):E=e[22];const _=me(E);let j;e[23]===Symbol.for("react.memo_cache_sentinel")?(j={resolver:ye(rs),defaultValues:{githubRepo:""}},e[23]=j):j=e[23];const b=be(j);let N;e[24]!==r||e[25]!==i?(N=async X=>{const te=await i.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:r}}),it={...se(te).item?.configuration_state??null??{},github_repo:X};await i.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:r,data:{configuration_state:it}}})},e[24]=r,e[25]=i,e[26]=N):N=e[26];let O;e[27]!==r||e[28]!==l||e[29]!==a.id||e[30]!==u?(O=async()=>{await u.invalidateQueries({queryKey:W.commerceDiscoveryConnection(a.id,r)}),await u.invalidateQueries({queryKey:W.commerceDiscoveryCompanionConnectionsPrefix(a.id)}),l()},e[27]=r,e[28]=l,e[29]=a.id,e[30]=u,e[31]=O):O=e[31];let k;e[32]!==O||e[33]!==N?(k={mutationFn:N,onSuccess:O},e[32]=O,e[33]=N,e[34]=k):k=e[34];const w=we(k),I=w.isPending;let D,L;e[35]!==I||e[36]!==c?(D=()=>{c?.(I)},L=[I,c],e[35]=I,e[36]=c,e[37]=D,e[38]=L):(D=e[37],L=e[38]),Q.useEffect(D,L);const K=y.data??"";let $,q;e[39]!==b||e[40]!==y.data||e[41]!==y.isSuccess?($=()=>{!y.isSuccess||S.current||(S.current=!0,y.data&&b.setValue("githubRepo",y.data))},q=[y.isSuccess,y.data,b],e[39]=b,e[40]=y.data,e[41]=y.isSuccess,e[42]=$,e[43]=q):($=e[42],q=e[43]),Q.useEffect($,q);let M;if(e[44]!==b||e[45]!==w){let X;e[47]!==w?(X=async te=>{w.mutate(te.githubRepo)},e[47]=w,e[48]=X):X=e[48],M=b.handleSubmit(X),e[44]=b,e[45]=w,e[46]=M}else M=e[46];const P=M;let F,z,U;if(e[49]!==h||e[50]!==_.data?.failed||e[51]!==_.data?.repos||e[52]!==_.data?.total||e[53]!==K){const X=_.data?.repos??[];F=_.data?.failed??0,U=_.data?.total??0;const te=h.trim();z=[...X],te&&ls.test(te)&&!z.includes(te)&&z.unshift(te),K&&!z.includes(K)&&z.push(K),e[49]=h,e[50]=_.data?.failed,e[51]=_.data?.repos,e[52]=_.data?.total,e[53]=K,e[54]=F,e[55]=z,e[56]=U}else F=e[54],z=e[55],U=e[56];const R=U>0&&F===U,T=_.isError||R?"Não foi possível buscar os repositórios (erro ou tempo esgotado). Tente novamente ou digite o repositório no formato owner/nome.":F>0?"Parte da busca falhou — alguns repositórios podem não ter aparecido. Tente novamente ou digite owner/nome.":null;let G;e[57]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsx(Je,{size:16,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),e[57]=G):G=e[57];let Y;e[58]===Symbol.for("react.memo_cache_sentinel")?(Y=X=>m(X.target.value),e[58]=Y):Y=e[58];let Z;e[59]!==I||e[60]!==f?(Z=t.jsxs("div",{className:"relative",children:[G,t.jsx(Ce,{type:"text",value:f,onChange:Y,disabled:I,placeholder:"Buscar repositório","aria-label":"Buscar repositório",className:"h-8 pl-8"})]}),e[59]=I,e[60]=f,e[61]=Z):Z=e[61];let J;e[62]!==b||e[63]!==I||e[64]!==z||e[65]!==_.isLoading||e[66]!==T?(J=_.isLoading?t.jsx("div",{className:"flex min-h-[160px] items-center justify-center",children:t.jsx(ze,{label:"Carregando repositórios..."})}):t.jsxs(t.Fragment,{children:[T&&t.jsx("p",{role:"alert",className:"text-sm text-destructive",children:T}),z.length===0?!T&&t.jsx("p",{className:"text-sm text-muted-foreground",children:"Nenhum repositório encontrado. Digite o nome do repositório (owner/nome) para buscar."}):t.jsx(ve,{...b,children:t.jsx(ae,{control:b.control,name:"githubRepo",render:X=>{const{field:te}=X;return t.jsxs(le,{children:[t.jsx(ce,{children:t.jsx($e,{options:z.map(us),value:te.value,onChange:te.onChange,disabled:I,ariaLabel:"Repositório",hideSearch:!0})}),t.jsx(de,{})]})}})})]}),e[62]=b,e[63]=I,e[64]=z,e[65]=_.isLoading,e[66]=T,e[67]=J):J=e[67];let B;e[68]!==w.error?(B=w.error&&t.jsx("p",{role:"alert",className:"text-sm text-destructive",children:w.error instanceof Error?w.error.message:"Não foi possível salvar a configuração"}),e[68]=w.error,e[69]=B):B=e[69];let A;e[70]!==I||e[71]!==l?(A=t.jsx(V,{type:"button",variant:"outline",onClick:l,disabled:I,children:"Cancelar"}),e[70]=I,e[71]=l,e[72]=A):A=e[72];const ee=I?"Salvando...":"Salvar";let ne;e[73]!==I||e[74]!==ee?(ne=t.jsx(V,{type:"submit",disabled:I,children:ee}),e[73]=I,e[74]=ee,e[75]=ne):ne=e[75];let ue;e[76]!==A||e[77]!==ne?(ue=t.jsxs(fe,{className:"pt-4",children:[A,ne]}),e[76]=A,e[77]=ne,e[78]=ue):ue=e[78];let je;return e[79]!==P||e[80]!==Z||e[81]!==J||e[82]!==B||e[83]!==ue?(je=t.jsxs("form",{onSubmit:P,className:"space-y-4",children:[Z,J,B,ue]}),e[79]=P,e[80]=Z,e[81]=J,e[82]=B,e[83]=ue,e[84]=je):je=e[84],je}function us(o){return{value:o,label:o}}const ms={vtex:Zt,"google-analytics":es,"google-search-console":os,github:ds},pe="deco-reader@decocms.iam.gserviceaccount.com",nt={"google-analytics":"ga4","google-search-console":"gsc"},ot={ga4:{label:"Google Analytics",resourceLabel:"ID da propriedade",resourcePlaceholder:"ex: 123456789",resourceHint:"No GA4: Admin → Detalhes da propriedade → ID da propriedade (só números).",connectSteps:["Abra o Google Analytics (GA4) da sua loja.","Vá em Admin → Acesso à propriedade (Gerenciamento de acesso).",`Clique em + → Adicionar usuários, cole ${pe} e conceda o papel Leitor.`,"Copie o ID da propriedade (Admin → Detalhes da propriedade) e cole abaixo."]},gsc:{label:"Google Search Console",resourceLabel:"Site / propriedade",resourcePlaceholder:"ex: sc-domain:sualoja.com.br",resourceHint:"Use o mesmo formato que aparece no Search Console: sc-domain:sualoja.com.br ou https://www.sualoja.com.br/.",connectSteps:["Abra o Google Search Console da sua loja.","Vá em Configurações → Usuários e permissões.",`Clique em Adicionar usuário, cole ${pe} e escolha permissão Completa.`,"Copie o endereço do site como aparece no seletor de propriedades e cole abaixo."]}};function fs(o,e){const s=ot[o].label;switch(e){case"no-access":return{title:`Ainda não conseguimos acessar este recurso no ${s}.`,steps:o==="ga4"?[`Confirme que ${pe} foi adicionado em Admin → Acesso à propriedade com o papel Leitor.`,"Confira se o ID da propriedade está correto (só números, sem o prefixo 'properties/').","A concessão de acesso pode levar alguns segundos — tente novamente."]:[`Confirme que ${pe} foi adicionado em Configurações → Usuários e permissões.`,"A permissão precisa ser Completa ou Restrita — 'Não verificado' não funciona.","Confira se o endereço do site está exatamente como aparece no Search Console."]};case"no-web-stream":return{title:"Esta propriedade do GA4 não tem um fluxo de dados da Web (site) configurado.",steps:["No GA4, vá em Admin → Fluxos de dados.","Clique em Adicionar fluxo → Web.","Informe a URL do site da sua loja e salve o fluxo.","Volte aqui e tente vincular de novo. (Propriedades só de app precisam de vínculo manual — fale com o suporte.)"]};case"no-match":return{title:"O recurso informado não corresponde ao domínio desta loja.",steps:o==="ga4"?["Verifique se digitou o ID da propriedade certa — provavelmente é de outro site.","No GA4, o site medido aparece em Admin → Fluxos de dados → (seu fluxo Web) → URL do stream."]:["Verifique se selecionou a propriedade do Search Console referente a esta loja.","O endereço precisa cobrir o mesmo domínio do diagnóstico."]};case"resource_already_bound":return{title:"Este recurso já está vinculado a outra loja.",steps:["Se este recurso é realmente desta loja, fale com o suporte para uma revisão manual.","Caso tenha digitado o id errado, confira e tente novamente."]};default:return{title:"Não foi possível verificar o acesso a este recurso.",steps:["Revise os passos de acesso acima e tente novamente.","Se persistir, fale com o suporte."]}}}function ps(o){const e=H.c(76),{provider:s,siteUrl:n,selfClient:i,org:a,initialResourceId:l,onDone:c,onIsPendingChange:u,onOAuthInstead:p}=o,r=ot[s],f=he(),[m,h]=Q.useState(null);let S,v;if(e[0]!==r.resourceLabel){const B=xe({resourceId:re().trim().min(1,`Informe o ${r.resourceLabel.toLowerCase()}`)});v=be,S=ye(B),e[0]=r.resourceLabel,e[1]=S,e[2]=v}else S=e[1],v=e[2];const g=l??"";let d;e[3]!==g?(d={resourceId:g},e[3]=g,e[4]=d):d=e[4];let y;e[5]!==S||e[6]!==d?(y={resolver:S,defaultValues:d},e[5]=S,e[6]=d,e[7]=y):y=e[7];const C=v(y);let x;e[8]!==s||e[9]!==i||e[10]!==n?(x=async B=>{if(!n)throw new Error("URL da loja indisponível — recarregue a página.");const A=await i.callTool({name:"COMMERCE_DISCOVERY_BIND",arguments:{siteUrl:n,provider:s,resourceId:B.resourceId}});return se(A)},e[8]=s,e[9]=i,e[10]=n,e[11]=x):x=e[11];let E,_;e[12]!==u?(E=()=>u?.(!0),_=()=>u?.(!1),e[12]=u,e[13]=E,e[14]=_):(E=e[13],_=e[14]);let j;e[15]!==r.label||e[16]!==c||e[17]!==a||e[18]!==s||e[19]!==f||e[20]!==n?(j=async B=>{if(B.ok){h(null),Ee.success(`${r.label} conectado`),n&&await f.invalidateQueries({queryKey:W.commerceDiscoveryConnectionStatus(a.id,n)}),c();return}h({...fs(s,B.reason??"unknown"),detail:B.detail})},e[15]=r.label,e[16]=c,e[17]=a,e[18]=s,e[19]=f,e[20]=n,e[21]=j):j=e[21];let b;e[22]!==x||e[23]!==E||e[24]!==_||e[25]!==j?(b={mutationFn:x,onMutate:E,onSettled:_,onSuccess:j},e[22]=x,e[23]=E,e[24]=_,e[25]=j,e[26]=b):b=e[26];const N=we(b);let O;if(e[27]!==C||e[28]!==N){let B;e[30]!==N?(B=A=>N.mutate(A),e[30]=N,e[31]=B):B=e[31],O=C.handleSubmit(B),e[27]=C,e[28]=N,e[29]=O}else O=e[29];const k=O,w=N.isPending,I=xs;let D;e[32]!==r.connectSteps?(D=r.connectSteps.map(gs),e[32]=r.connectSteps,e[33]=D):D=e[33];let L;e[34]!==D?(L=t.jsx("ol",{className:"space-y-2 text-sm text-muted-foreground",children:D}),e[34]=D,e[35]=L):L=e[35];let K;e[36]===Symbol.for("react.memo_cache_sentinel")?(K=t.jsx("code",{className:"min-w-0 flex-1 truncate text-xs text-foreground",children:pe}),e[36]=K):K=e[36];let $;e[37]===Symbol.for("react.memo_cache_sentinel")?($=t.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-border bg-muted/40 p-2",children:[K,t.jsx(V,{type:"button",variant:"ghost",size:"icon-sm",onClick:I,"aria-label":"Copiar e-mail do service account",children:t.jsx(tt,{size:16})})]}),e[37]=$):$=e[37];let q;e[38]!==r.resourceHint||e[39]!==r.resourceLabel||e[40]!==r.resourcePlaceholder||e[41]!==w?(q=B=>{const{field:A}=B;return t.jsxs(le,{children:[t.jsx(Se,{children:r.resourceLabel}),t.jsx(ce,{children:t.jsx(Ce,{...A,placeholder:r.resourcePlaceholder,disabled:w,autoComplete:"off"})}),t.jsx(Rt,{children:r.resourceHint}),t.jsx(de,{})]})},e[38]=r.resourceHint,e[39]=r.resourceLabel,e[40]=r.resourcePlaceholder,e[41]=w,e[42]=q):q=e[42];let M;e[43]!==C.control||e[44]!==q?(M=t.jsx(ae,{control:C.control,name:"resourceId",render:q}),e[43]=C.control,e[44]=q,e[45]=M):M=e[45];let P;e[46]!==C||e[47]!==M?(P=t.jsx(ve,{...C,children:M}),e[46]=C,e[47]=M,e[48]=P):P=e[48];let F;e[49]!==m?(F=m&&t.jsxs("div",{role:"alert",className:"space-y-2 rounded-lg border border-destructive/40 bg-destructive/5 p-3",children:[t.jsx("p",{className:"text-sm font-medium text-foreground",children:m.title}),t.jsx("ol",{className:"space-y-1 text-sm text-muted-foreground",children:m.steps.map(hs)})]}),e[49]=m,e[50]=F):F=e[50];let z;e[51]!==N.error||e[52]!==N.isError?(z=N.isError&&t.jsx("p",{role:"alert",className:"text-sm text-destructive",children:N.error instanceof Error?N.error.message:"Não foi possível vincular."}),e[51]=N.error,e[52]=N.isError,e[53]=z):z=e[53];let U;e[54]!==w||e[55]!==p?(U=p?t.jsx("button",{type:"button",onClick:p,disabled:w,className:"text-xs text-muted-foreground underline underline-offset-2 hover:text-foreground disabled:opacity-50",children:"autorizar via login do Google"}):t.jsx("span",{}),e[54]=w,e[55]=p,e[56]=U):U=e[56];let R;e[57]!==w||e[58]!==c?(R=t.jsx(V,{type:"button",variant:"outline",onClick:c,disabled:w,children:"Cancelar"}),e[57]=w,e[58]=c,e[59]=R):R=e[59];const T=w?"Verificando...":"Vincular";let G;e[60]!==w||e[61]!==T?(G=t.jsx(V,{type:"submit",disabled:w,children:T}),e[60]=w,e[61]=T,e[62]=G):G=e[62];let Y;e[63]!==R||e[64]!==G?(Y=t.jsxs("div",{className:"flex gap-2",children:[R,G]}),e[63]=R,e[64]=G,e[65]=Y):Y=e[65];let Z;e[66]!==U||e[67]!==Y?(Z=t.jsxs(fe,{className:"flex-col gap-2 pt-2 sm:flex-row sm:items-center sm:justify-between",children:[U,Y]}),e[66]=U,e[67]=Y,e[68]=Z):Z=e[68];let J;return e[69]!==k||e[70]!==L||e[71]!==P||e[72]!==F||e[73]!==z||e[74]!==Z?(J=t.jsxs("form",{onSubmit:k,className:"space-y-4",children:[L,$,P,F,z,Z]}),e[69]=k,e[70]=L,e[71]=P,e[72]=F,e[73]=z,e[74]=Z,e[75]=J):J=e[75],J}function hs(o){return t.jsxs("li",{className:"flex gap-2",children:[t.jsx("span",{"aria-hidden":!0,children:"•"}),t.jsx("span",{children:o})]},o)}function gs(o,e){return t.jsxs("li",{className:"flex gap-2",children:[t.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center rounded-full bg-muted text-xs font-medium text-foreground",children:e+1}),t.jsx("span",{children:o})]},o)}function xs(){navigator.clipboard?.writeText(pe),Ee.success("E-mail copiado")}function ys(){const o=H.c(2);let e;o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"size-9 shrink-0 animate-pulse rounded-lg bg-muted/60"}),o[0]=e):e=o[0];let s;return o[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsxs("div",{className:"flex items-center gap-3 rounded-2xl border border-border bg-card p-3 sm:h-full sm:flex-col sm:items-stretch sm:p-4",children:[e,t.jsxs("div",{className:"min-w-0 flex-1 space-y-2",children:[t.jsx("div",{className:"h-4 w-24 animate-pulse rounded bg-muted/60"}),t.jsx("div",{className:"hidden h-3 w-full animate-pulse rounded bg-muted/60 sm:block"})]}),t.jsx("div",{className:"h-8 w-20 shrink-0 animate-pulse rounded-lg bg-muted/60 sm:mt-auto sm:w-full"})]}),o[1]=s):s=o[1],s}const bs="rounded-full bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground";function vs(o){const e=H.c(36),{card:s,connecting:n,disconnecting:i,disabled:a,onConnect:l,onDisconnect:c,org:u,selfClient:p,siteUrl:r,autoOpenConfigFieldKey:f,onAutoOpenConfigHandled:m}=o,h=s.linkedConnectionId,S=nt[s.bindingType],v=!!S&&s.boundVia!=="oauth";let g;e[0]!==f||e[1]!==s||e[2]!==n||e[3]!==a||e[4]!==i||e[5]!==h||e[6]!==m||e[7]!==l||e[8]!==c||e[9]!==u||e[10]!==S||e[11]!==p||e[12]!==r||e[13]!==v?(g=v&&S?t.jsx(Cs,{card:s,provider:S,org:u,selfClient:p,siteUrl:r,onOAuthInstead:l,disabled:a,connecting:n}):s.satisfied&&h?t.jsxs("div",{className:"flex items-center justify-end gap-1 sm:justify-start",children:[t.jsxs("span",{className:"flex items-center gap-1.5 text-sm text-muted-foreground",children:[t.jsx(Pe,{size:16,className:"text-success"})," Conectado"]}),t.jsx(Q.Suspense,{fallback:t.jsx(js,{}),children:t.jsx(Ss,{card:s,org:u,selfClient:p,connectionId:h,contextSiteUrl:r,autoOpen:Nt({autoOpenFieldKey:f,card:s}),onAutoOpenHandled:m})}),t.jsxs(Re,{children:[t.jsx(Ae,{asChild:!0,children:t.jsx(V,{type:"button",variant:"ghost",size:"icon-sm",className:"shrink-0 text-muted-foreground hover:text-destructive",disabled:a||i,onClick:c,"aria-label":`Desconectar ${s.title}`,children:i?t.jsx(_e,{size:16,className:"animate-spin"}):t.jsx(jt,{size:16})})}),t.jsx(De,{children:"Desconectar"})]})]}):t.jsx(V,{type:"button",variant:"outline",size:"sm",className:"sm:w-full",disabled:a||n,onClick:l,"aria-label":`Conectar ${s.title}`,children:n?t.jsx(_e,{size:16,className:"animate-spin"}):"Conectar"}),e[0]=f,e[1]=s,e[2]=n,e[3]=a,e[4]=i,e[5]=h,e[6]=m,e[7]=l,e[8]=c,e[9]=u,e[10]=S,e[11]=p,e[12]=r,e[13]=v,e[14]=g):g=e[14];const d=g;let y;e[15]!==s.icon||e[16]!==s.title?(y=t.jsx(ke,{icon:s.icon,name:s.title,size:"sm",fit:"contain",className:"shrink-0 p-1.5"}),e[15]=s.icon,e[16]=s.title,e[17]=y):y=e[17];let C;e[18]!==s.area?(C=s.area&&t.jsx("span",{className:ie("hidden sm:inline-block",bs),children:s.area}),e[18]=s.area,e[19]=C):C=e[19];let x;e[20]!==y||e[21]!==C?(x=t.jsxs("div",{className:"shrink-0 sm:flex sm:w-full sm:items-center sm:justify-between sm:gap-2",children:[y,C]}),e[20]=y,e[21]=C,e[22]=x):x=e[22];let E;e[23]!==s.title?(E=t.jsx("p",{className:"text-sm font-medium text-foreground",children:s.title}),e[23]=s.title,e[24]=E):E=e[24];let _;e[25]!==s.headline?(_=s.headline&&t.jsx("p",{className:"hidden text-sm leading-5 text-muted-foreground sm:mt-0.5 sm:line-clamp-2 sm:block",children:s.headline}),e[25]=s.headline,e[26]=_):_=e[26];let j;e[27]!==E||e[28]!==_?(j=t.jsxs("div",{className:"min-w-0 flex-1",children:[E,_]}),e[27]=E,e[28]=_,e[29]=j):j=e[29];let b;e[30]!==d?(b=t.jsx("div",{className:"shrink-0 sm:mt-auto sm:w-full sm:pt-1",children:d}),e[30]=d,e[31]=b):b=e[31];let N;return e[32]!==x||e[33]!==j||e[34]!==b?(N=t.jsxs("div",{className:"flex items-center gap-3 rounded-2xl border border-border bg-card p-3 sm:h-full sm:flex-col sm:items-stretch sm:p-4",children:[x,j,b]}),e[32]=x,e[33]=j,e[34]=b,e[35]=N):N=e[35],N}function Cs(o){const e=H.c(39),{card:s,provider:n,org:i,selfClient:a,siteUrl:l,onOAuthInstead:c,disabled:u,connecting:p}=o,[r,f]=Q.useState(!1),[m,h]=Q.useState(!1);let S;e[0]!==m?(S=I=>{!I&&m||f(I)},e[0]=m,e[1]=S):S=e[1];const v=S;let g;e[2]!==s.satisfied||e[3]!==s.title||e[4]!==p||e[5]!==u?(g=s.satisfied?t.jsxs("div",{className:"flex items-center justify-end gap-1 sm:justify-start",children:[t.jsxs("span",{className:"flex items-center gap-1.5 text-sm text-muted-foreground",children:[t.jsx(Pe,{size:16,className:"text-success"})," Conectado"]}),t.jsxs(Re,{children:[t.jsx(Ae,{asChild:!0,children:t.jsx(V,{type:"button",variant:"ghost",size:"icon-sm",className:"shrink-0",onClick:()=>f(!0),"aria-label":`Configurar ${s.title}`,children:t.jsx(et,{size:16})})}),t.jsx(De,{children:"Editar configuração"})]})]}):t.jsx(V,{type:"button",variant:"outline",size:"sm",className:"sm:w-full",disabled:u||p,onClick:()=>f(!0),"aria-label":`Conectar ${s.title}`,children:p?t.jsx(_e,{size:16,className:"animate-spin"}):"Conectar"}),e[2]=s.satisfied,e[3]=s.title,e[4]=p,e[5]=u,e[6]=g):g=e[6];let d;e[7]!==s.icon||e[8]!==s.title?(d=t.jsx(ke,{icon:s.icon,name:s.title,size:"md",fit:"contain",className:"p-1.5"}),e[7]=s.icon,e[8]=s.title,e[9]=d):d=e[9];let y;e[10]!==s.title?(y=t.jsx(Ve,{children:s.title}),e[10]=s.title,e[11]=y):y=e[11];let C;e[12]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(We,{children:"Conceda acesso ao nosso leitor e informe o identificador"}),e[12]=C):C=e[12];let x;e[13]!==y?(x=t.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[y,C]}),e[13]=y,e[14]=x):x=e[14];let E;e[15]!==d||e[16]!==x?(E=t.jsxs(Ye,{className:"flex-row items-center gap-3 space-y-0 text-left",children:[d,x]}),e[15]=d,e[16]=x,e[17]=E):E=e[17];const _=s.boundResource??void 0;let j;e[18]===Symbol.for("react.memo_cache_sentinel")?(j=()=>f(!1),e[18]=j):j=e[18];let b;e[19]!==s.satisfied||e[20]!==c?(b=s.satisfied?void 0:()=>{f(!1),c()},e[19]=s.satisfied,e[20]=c,e[21]=b):b=e[21];let N;e[22]!==i||e[23]!==n||e[24]!==a||e[25]!==l||e[26]!==b||e[27]!==_?(N=t.jsx(ps,{provider:n,siteUrl:l,selfClient:a,org:i,initialResourceId:_,onDone:j,onIsPendingChange:h,onOAuthInstead:b}),e[22]=i,e[23]=n,e[24]=a,e[25]=l,e[26]=b,e[27]=_,e[28]=N):N=e[28];let O;e[29]!==N||e[30]!==E?(O=t.jsxs(Ze,{className:"sm:max-w-lg",children:[E,N]}),e[29]=N,e[30]=E,e[31]=O):O=e[31];let k;e[32]!==v||e[33]!==r||e[34]!==O?(k=t.jsx(Xe,{open:r,onOpenChange:v,children:O}),e[32]=v,e[33]=r,e[34]=O,e[35]=k):k=e[35];let w;return e[36]!==k||e[37]!==g?(w=t.jsxs(t.Fragment,{children:[g,k]}),e[36]=k,e[37]=g,e[38]=w):w=e[38],w}function js(){const o=H.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"size-8 shrink-0 animate-pulse rounded-lg bg-muted/60"}),o[0]=e):e=o[0],e}function Ss(o){const e=H.c(60),{card:s,org:n,selfClient:i,connectionId:a,contextSiteUrl:l,autoOpen:c,onAutoOpenHandled:u}=o;let p;e[0]!==a||e[1]!==n.id||e[2]!==n.slug?(p={connectionId:a,orgId:n.id,orgSlug:n.slug},e[0]=a,e[1]=n.id,e[2]=n.slug,e[3]=p):p=e[3];const r=Oe(p),[f,m]=Q.useState(c),[h,S]=Q.useState(!1),v=he(),g=ms[s.bindingType],d=wt(s.configurationState);let y;e[4]!==c||e[5]!==u?(y=()=>{m(!1),c&&u()},e[4]=c,e[5]=u,e[6]=y):y=e[6];const C=y;let x;e[7]!==C||e[8]!==h?(x=T=>{if(!(!T&&h)){if(!T){C();return}m(!0)}},e[7]=C,e[8]=h,e[9]=x):x=e[9];const E=x;let _;e[10]!==a||e[11]!==i?(_=async()=>{await i.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:a,force:!0}})},e[10]=a,e[11]=i,e[12]=_):_=e[12];let j;e[13]!==s.title||e[14]!==C||e[15]!==n.id||e[16]!==v?(j=async()=>{await v.invalidateQueries({queryKey:W.commerceDiscoveryCompanionConnectionsPrefix(n.id)}),Ee.success(`${s.title} desconectado`),C()},e[13]=s.title,e[14]=C,e[15]=n.id,e[16]=v,e[17]=j):j=e[17];let b;e[18]!==_||e[19]!==j?(b={mutationFn:_,onSuccess:j,onError:_s},e[18]=_,e[19]=j,e[20]=b):b=e[20];const N=we(b);if(!g)return null;let O;e[21]===Symbol.for("react.memo_cache_sentinel")?(O=()=>m(!0),e[21]=O):O=e[21];const k=`Configurar ${s.title}`;let w;e[22]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(et,{size:16}),e[22]=w):w=e[22];let I;e[23]!==k?(I=t.jsx(Ae,{asChild:!0,children:t.jsx(V,{type:"button",variant:"ghost",size:"icon-sm",className:"shrink-0",onClick:O,"aria-label":k,children:w})}),e[23]=k,e[24]=I):I=e[24];const D=d.length>0?"Editar configuração":"Configurar";let L;e[25]!==D?(L=t.jsx(De,{children:D}),e[25]=D,e[26]=L):L=e[26];let K;e[27]!==I||e[28]!==L?(K=t.jsxs(Re,{children:[I,L]}),e[27]=I,e[28]=L,e[29]=K):K=e[29];let $;e[30]!==s.icon||e[31]!==s.title?($=t.jsx(ke,{icon:s.icon,name:s.title,size:"md",fit:"contain",className:"p-1.5"}),e[30]=s.icon,e[31]=s.title,e[32]=$):$=e[32];let q;e[33]!==s.title?(q=t.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[t.jsx(Ve,{children:s.title}),t.jsxs(We,{children:["Configure o ",s.title," para enriquecer os dados"]})]}),e[33]=s.title,e[34]=q):q=e[34];let M;e[35]!==$||e[36]!==q?(M=t.jsxs(Ye,{className:"flex-row items-center gap-3 space-y-0 text-left",children:[$,q]}),e[35]=$,e[36]=q,e[37]=M):M=e[37];let P;e[38]!==N?(P=()=>N.mutate(),e[38]=N,e[39]=P):P=e[39];let F;e[40]!==g||e[41]!==s||e[42]!==C||e[43]!==r||e[44]!==a||e[45]!==l||e[46]!==n||e[47]!==i||e[48]!==P?(F=t.jsx(g,{card:s,connectionId:a,companionClient:r,selfClient:i,org:n,contextSiteUrl:l,onDone:C,onDisconnect:P,onIsPendingChange:S}),e[40]=g,e[41]=s,e[42]=C,e[43]=r,e[44]=a,e[45]=l,e[46]=n,e[47]=i,e[48]=P,e[49]=F):F=e[49];let z;e[50]!==M||e[51]!==F?(z=t.jsxs(Ze,{className:"sm:max-w-lg",children:[M,F]}),e[50]=M,e[51]=F,e[52]=z):z=e[52];let U;e[53]!==f||e[54]!==E||e[55]!==z?(U=t.jsx(Xe,{open:f,onOpenChange:E,children:z}),e[53]=f,e[54]=E,e[55]=z,e[56]=U):U=e[56];let R;return e[57]!==K||e[58]!==U?(R=t.jsxs(t.Fragment,{children:[K,U]}),e[57]=K,e[58]=U,e[59]=R):R=e[59],R}function _s(){Ee.error("Não foi possível desconectar. Tente novamente.")}const qe={vtex:{registryAppId:"deco/vtex",area:"Catálogo",headline:"Rupturas e PDPs que travam suas vendas."},"google-analytics":{registryAppId:"deco/google-analytics",area:"Funil",headline:"Onde a receita vaza no seu funil."},"google-search-console":{registryAppId:"deco/google-search-console",area:"Busca",headline:"O tráfego de busca que você deixa na mesa."},github:{registryAppId:"deco/mcp-github",area:"Engenharia",headline:"A saúde da entrega de código por trás da sua loja."}};function Ns(o){const e=H.c(40),{selfClient:s,org:n,cdConnectionId:i,siteUrl:a}=o;let l;e[0]!==i||e[1]!==n.id||e[2]!==n.slug?(l={connectionId:i,orgId:n.id,orgSlug:n.slug},e[0]=i,e[1]=n.id,e[2]=n.slug,e[3]=l):l=e[3];const c=Oe(l);let u;e[4]!==i||e[5]!==n.id?(u=W.commerceDiscoveryCompanionSchema(n.id,i),e[4]=i,e[5]=n.id,e[6]=u):u=e[6];let p;e[7]!==c?(p=async()=>{const A=await c.callTool({name:"MCP_CONFIGURATION",arguments:{}});return se(A)},e[7]=c,e[8]=p):p=e[8];let r;e[9]!==u||e[10]!==p?(r={queryKey:u,queryFn:p,retry:!1},e[9]=u,e[10]=p,e[11]=r):r=e[11];const f=me(r),m=f.data?.stateSchema?Et(f.data.stateSchema):null,h=m&&m.length>0?m:Tt,S=h.map(Ps),v=h.map(Ds).filter(As),g=h.filter(Rs).map(ks),d=[...v,...g].sort().join(",");let y;e[12]!==i||e[13]!==n.id?(y=W.commerceDiscoveryConnection(n.id,i),e[12]=i,e[13]=n.id,e[14]=y):y=e[14];let C;e[15]!==i||e[16]!==s?(C=async()=>{const A=await s.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:i}});return se(A)},e[15]=i,e[16]=s,e[17]=C):C=e[17];let x;e[18]!==y||e[19]!==C?(x={queryKey:y,queryFn:C},e[18]=y,e[19]=C,e[20]=x):x=e[20];const _=Te(x).data?.item?.configuration_state??null;let j;e[21]!==_?(j=A=>_?.[A.fieldKey]?.value,e[21]=_,e[22]=j):j=e[22];const b=h.map(j).filter(Os),N=[...S.map(Is),...v.map(Ts),...b.map(Es)].sort().join(","),k=Te({queryKey:W.commerceDiscoveryCompanionConnections(n.id,N),queryFn:async()=>{if(h.length===0)return{items:[]};const A=[{field:["app_name"],operator:"in",value:S},{field:["app_id"],operator:"in",value:v}];b.length>0&&A.push({field:["id"],operator:"in",value:b});const ee=await s.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{where:{operator:"or",conditions:A},limit:1e3}});return se(ee)}}).data?.items??[],w=new Set(b),I=k.filter(A=>w.has(A.id)),D=I.filter(ws);let L;e[23]!==n.id||e[24]!==n.slug?(L=A=>({queryKey:W.commerceDiscoveryCompanionOAuthStatus(n.id,A.id),queryFn:async()=>{try{const ee=await fetch(`/api/${encodeURIComponent(n.slug)}/connections/${encodeURIComponent(A.id)}/oauth-token/status`,{credentials:"include"});return ee.ok?{hasToken:(await ee.json()).hasToken===!0}:{hasToken:!1}}catch{return{hasToken:!1}}},retry:!1}),e[23]=n.id,e[24]=n.slug,e[25]=L):L=e[25];const K=Qt({queries:D.map(L)});let $;e[26]!==K?($=(A,ee)=>[A.id,K[ee]?.data?.hasToken===!0],e[26]=K,e[27]=$):$=e[27];const q=new Map(D.map($)),M={};for(const A of I)M[A.id]=!A.oauth_config||!!A.connection_token||q.get(A.id)===!0;const P=Te({queryKey:W.commerceDiscoveryCompanionRegistry(n.id,d),queryFn:async()=>{if(h.length===0)return{items:[]};const A=It(v,g),ee=await zt(Be.REGISTRY(n.id),n.id,n.slug,"COLLECTION_REGISTRY_APP_LIST",{...A?{where:A}:{},limit:1e3});return se(ee)}}),F={},z={};for(const A of P.data?.items??[])F[A.id]=A,A.server?.name&&(z[A.server.name]=A);let U;e[28]!==n.id||e[29]!==a?(U=W.commerceDiscoveryConnectionStatus(n.id,a??""),e[28]=n.id,e[29]=a,e[30]=U):U=e[30];const R=!!a;let T;e[31]!==s||e[32]!==a?(T=async()=>{const A=await s.callTool({name:"COMMERCE_DISCOVERY_CONNECTION_STATUS",arguments:{siteUrl:a}});return se(A)},e[31]=s,e[32]=a,e[33]=T):T=e[33];let G;e[34]!==U||e[35]!==R||e[36]!==T?(G={queryKey:U,enabled:R,queryFn:T},e[34]=U,e[35]=R,e[36]=T,e[37]=G):G=e[37];const Y=me(G),Z={};for(const[A,ee]of Object.entries(nt)){const ne=Y.data?.providers?.[ee];ne?.connected&&ne.via==="sa"&&(Z[A]={resource:ne.resource??null})}const J=Ot({requirements:h,itemsById:F,itemsByName:z,connections:k,connectionReadiness:M,configurationState:_,curated:qe,saBindings:Z});let B;return e[38]!==J?(B={cards:J},e[38]=J,e[39]=B):B=e[39],B}function ws(o){return o.oauth_config&&!o.connection_token}function Es(o){return`linked:${o}`}function Ts(o){return`app:${o}`}function Is(o){return`binding:${o}`}function Os(o){return typeof o=="string"&&o.length>0}function ks(o){return o.bindingType}function Rs(o){return!qe[o.bindingType]}function As(o){return!!o}function Ds(o){return qe[o.bindingType]?.registryAppId}function Ps(o){return o.bindingType}function Ls({selfClient:o,org:e,userId:s,cdConnectionId:n,domain:i,siteUrl:a}){const l=he(),[c,u]=Q.useState(null),[p,r]=Q.useState(null),[f,m]=Q.useState(null),h=async(g,d)=>{const y=await o.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:g,data:d}});return se(y)};async function S(g){u(g.fieldKey),m(null);const d={app_name:g.title,field_key:g.fieldKey,organization_id:e.id,domain:i,site_url:a};oe("commerce_onboarding_companion_connect_clicked",d);try{let y=g.candidateConnectionId;if(!y){const b=qt(g.registryItem,e.id,s,{remoteIndex:0}),N=b.connection_type==="STDIO",O=!!b.connection_url,k=N&&b.connection_headers&&typeof b.connection_headers=="object"&&"command"in b.connection_headers;if(!O&&!k)return oe("commerce_onboarding_companion_connect_failed",{...d,error:"no_connection_method"}),m(`${g.title} cannot be connected: no connection method available`),!1;const w=await o.callTool({name:"COLLECTION_CONNECTIONS_CREATE",arguments:{data:b}});y=se(w).item.id}const C=y,x=await Ft({connectionId:C,orgId:e.id,orgSlug:e.slug,persistFallback:b=>h(C,{connection_token:b}).then(()=>{})});if(!x.ok)return oe("commerce_onboarding_companion_connect_failed",{...d,error:x.error}),m(`Couldn't sign in to ${g.title}: ${x.error}`),!1;const E=await o.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:n}}),_=se(E).item?.configuration_state??null,j=kt(_,g.fieldKey,g.bindingType,C);return g.bindingType==="github"&&delete j.github_repo,await h(n,{configuration_state:j}),await l.invalidateQueries({queryKey:W.commerceDiscoveryConnection(e.id,n)}),await l.invalidateQueries({queryKey:W.commerceDiscoveryCompanionConnectionsPrefix(e.id)}),oe("commerce_onboarding_companion_connected",d),!0}catch(y){return oe("commerce_onboarding_companion_connect_failed",{...d,error:y instanceof Error?y.message:String(y)}),m(y instanceof Error?y.message:String(y)),!1}finally{u(null)}}async function v(g){r(g.fieldKey),m(null);const d={app_name:g.title,field_key:g.fieldKey,organization_id:e.id,domain:i,site_url:a};oe("commerce_onboarding_companion_disconnect_clicked",d);try{const y=await o.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:n}}),x={...se(y).item?.configuration_state??null??{}};return delete x[g.fieldKey],g.bindingType==="github"&&delete x.github_repo,await h(n,{configuration_state:x}),await l.invalidateQueries({queryKey:W.commerceDiscoveryConnection(e.id,n)}),await l.invalidateQueries({queryKey:W.commerceDiscoveryCompanionConnectionsPrefix(e.id)}),oe("commerce_onboarding_companion_disconnected",d),!0}catch(y){return oe("commerce_onboarding_companion_disconnect_failed",{...d,error:y instanceof Error?y.message:String(y)}),m(y instanceof Error?y.message:String(y)),!1}finally{r(null)}}return{connect:S,connectingFieldKey:c,disconnect:v,disconnectingFieldKey:p,error:f}}const Fe="flex min-h-0 flex-1 flex-col gap-4 md:grid md:flex-none md:gap-4";function Ke(){const o=H.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("h1",{className:"text-lg font-medium leading-6 text-foreground lg:text-2xl lg:leading-8",children:"Conecte suas ferramentas para ver o diagnóstico completo"}),o[0]=e):e=o[0],e}function $s(){const o=H.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[0,1,2,3].map(zs)}),o[0]=e):e=o[0],e}function zs(o){return t.jsx(ys,{},o)}function qs(){const o=H.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{className:Fe,children:[t.jsx(Ke,{}),t.jsx($s,{})]}),o[0]=e):e=o[0],e}function Fs(o){const e=H.c(5),{onRetry:s}=o;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(Ke,{}),e[0]=n):n=e[0];let i,a;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("p",{className:"text-sm text-foreground",children:"Não foi possível carregar as integrações complementares."}),a=t.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Algo deu errado ao carregar suas integrações."}),e[1]=i,e[2]=a):(i=e[1],a=e[2]);let l;return e[3]!==s?(l=t.jsxs("div",{className:Fe,children:[n,t.jsxs("div",{role:"alert",className:"rounded-2xl border border-border bg-card p-4",children:[i,a,t.jsx(V,{type:"button",variant:"outline",size:"sm",className:"mt-3",onClick:s,children:"Tentar novamente"})]})]}),e[3]=s,e[4]=l):l=e[4],l}function bn(o){const e=H.c(2);let s;return e[0]!==o?(s=t.jsx(yt,{children:n=>{const{reset:i}=n;return t.jsx(bt,{fallback:a=>{const{resetError:l}=a;return t.jsx(Fs,{onRetry:()=>{i(),l()}})},children:t.jsx(Q.Suspense,{fallback:t.jsx(qs,{}),children:t.jsx(Ks,{...o})})})}}),e[0]=o,e[1]=s):s=e[1],s}function Ks(o){const e=H.c(46),{org:s,cdConnectionId:n,siteUrl:i,onReadinessChange:a}=o,{data:l}=vt.useSession(),c=l?.user?.id??"";let u;if(e[0]!==i){const k=i?Ne(i):null;if(k?.ok)try{u=new URL(k.value).hostname}catch{u=void 0}e[0]=i,e[1]=u}else u=e[1];let p;e[2]!==s.id||e[3]!==s.slug?(p={connectionId:Ct,orgId:s.id,orgSlug:s.slug},e[2]=s.id,e[3]=s.slug,e[4]=p):p=e[4];const r=Oe(p);let f;e[5]!==n||e[6]!==s||e[7]!==r||e[8]!==i?(f={selfClient:r,org:s,cdConnectionId:n,siteUrl:i},e[5]=n,e[6]=s,e[7]=r,e[8]=i,e[9]=f):f=e[9];const{cards:m}=Ns(f);let h;e[10]!==n||e[11]!==s||e[12]!==r||e[13]!==u||e[14]!==i||e[15]!==c?(h={selfClient:r,org:s,userId:c,cdConnectionId:n,domain:u,siteUrl:i},e[10]=n,e[11]=s,e[12]=r,e[13]=u,e[14]=i,e[15]=c,e[16]=h):h=e[16];const{connect:S,connectingFieldKey:v,disconnect:g,disconnectingFieldKey:d,error:y}=Ls(h),[C,x]=Q.useState(null);if(a?.(m.length===0||m.some(Us)),m.length===0)return null;const E=v!==null||d!==null;let _;e[17]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(Ke,{}),e[17]=_):_=e[17];let j;e[18]!==y?(j=y&&t.jsx("p",{role:"alert",className:"mb-3 text-sm text-destructive",children:y}),e[18]=y,e[19]=j):j=e[19];let b;if(e[20]!==C||e[21]!==E||e[22]!==m||e[23]!==S||e[24]!==v||e[25]!==g||e[26]!==d||e[27]!==s||e[28]!==r||e[29]!==i){let k;e[31]!==C||e[32]!==E||e[33]!==S||e[34]!==v||e[35]!==g||e[36]!==d||e[37]!==s||e[38]!==r||e[39]!==i?(k=w=>{const I=async()=>{await S(w)&&x(w.fieldKey)};return t.jsx(vs,{card:w,connecting:v===w.fieldKey,disconnecting:d===w.fieldKey,disabled:E&&v!==w.fieldKey&&d!==w.fieldKey,org:s,selfClient:r,siteUrl:i,autoOpenConfigFieldKey:C,onAutoOpenConfigHandled:()=>x(D=>D===w.fieldKey?null:D),onConnect:()=>{I()},onDisconnect:()=>{g(w)}},w.fieldKey)},e[31]=C,e[32]=E,e[33]=S,e[34]=v,e[35]=g,e[36]=d,e[37]=s,e[38]=r,e[39]=i,e[40]=k):k=e[40],b=m.map(k),e[20]=C,e[21]=E,e[22]=m,e[23]=S,e[24]=v,e[25]=g,e[26]=d,e[27]=s,e[28]=r,e[29]=i,e[30]=b}else b=e[30];let N;e[41]!==b?(N=t.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:b}),e[41]=b,e[42]=N):N=e[42];let O;return e[43]!==j||e[44]!==N?(O=t.jsxs("div",{className:Fe,children:[_,t.jsxs(Wt,{wrapperClassName:"flex min-h-0 flex-1 flex-col md:block",className:"-mx-1 min-h-0 flex-1 overflow-y-auto px-1 md:max-h-[min(60vh,calc(100dvh-330px))] md:flex-none",children:[j,N]})]}),e[43]=j,e[44]=N,e[45]=O):O=e[45],O}function Us(o){return o.satisfied}const Ue="https://decocms.com/agendar",Ms="Precisa de ajuda? Fale conosco",Qs="Agende uma chamada e ajudamos você a conectar suas ferramentas.",ge=[{photo:"https://decoims.com/image?src=decocms%2Fb07a1c19-0cd6-49c8-b326-86055ee78605%2Fauthor-1763423987973-baby.jpeg&quality=original&fit=cover&width=200&height=200",alt:"Especialista da deco"},{photo:"https://decoims.com/decocms/07c2daf4-a3c2-485e-a1a8-341585a06e3b/cecilia.png",alt:"Especialista da deco"},{photo:"https://decoims.com/decocms/48013ca2-3277-464b-b0f1-dd5f1f08d986/tavano.png",alt:"Especialista da deco"}],Gs="var(--brand-green-dark)";function vn({siteUrl:o,email:e}){const s=new URL(Ue);return o&&s.searchParams.set("siteUrl",o),e&&s.searchParams.set("email",e),s.toString()}function Hs(o){const e=H.c(12),{href:s,size:n,className:i,orgId:a}=o,l=s===void 0?Ue:s,c=n===void 0?"lg":n;let u;e[0]!==i?(u=ie("w-full",i),e[0]=i,e[1]=u):u=e[1];let p;e[2]!==a?(p=()=>oe("commerce_onboarding_meeting_cta_clicked",{placement:"visual_card",organization_id:a}),e[2]=a,e[3]=p):p=e[3];let r;e[4]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(st,{size:16}),e[4]=r):r=e[4];let f;e[5]!==l||e[6]!==p?(f=t.jsxs("a",{href:l,target:"_blank",rel:"noreferrer",onClick:p,children:["Agendar uma reunião",r]}),e[5]=l,e[6]=p,e[7]=f):f=e[7];let m;return e[8]!==c||e[9]!==u||e[10]!==f?(m=t.jsx(V,{asChild:!0,variant:"outline",size:c,className:u,children:f}),e[8]=c,e[9]=u,e[10]=f,e[11]=m):m=e[11],m}function Bs(o){const e=H.c(10),{size:s}=o,n=s===void 0?72:s;let i;e[0]!==n?(i=Math.round(n*.3),e[0]=n,e[1]=i):i=e[1];const a=i;let l;e[2]!==n?(l={height:n},e[2]=n,e[3]=l):l=e[3];let c;e[4]!==a||e[5]!==n?(c=ge.map((p,r)=>t.jsxs("div",{className:"relative shrink-0",style:{width:n,height:n,marginLeft:r===0?0:-a,zIndex:ge.length-r},children:[t.jsx("div",{className:"h-full w-full overflow-hidden rounded-full border-4 border-card bg-muted",children:t.jsx("img",{src:p.photo,alt:p.alt,className:"h-full w-full object-cover",loading:"lazy"})}),r===0&&t.jsxs("span",{className:"absolute bottom-1.5 right-1.5 flex h-3.5 w-3.5",children:[t.jsx("span",{className:"absolute inline-flex h-full w-full rounded-full bg-success opacity-60 motion-safe:animate-ping","aria-hidden":!0}),t.jsx("span",{className:"relative inline-flex h-3.5 w-3.5 rounded-full border-2 border-card bg-success"})]})]},p.photo)),e[4]=a,e[5]=n,e[6]=c):c=e[6];let u;return e[7]!==l||e[8]!==c?(u=t.jsx("div",{className:"flex items-end",style:l,children:c}),e[7]=l,e[8]=c,e[9]=u):u=e[9],u}function Cn(o){const e=H.c(6),{href:s,orgId:n}=o;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("div",{className:"h-20",style:{backgroundColor:Gs}}),e[0]=i):i=e[0];let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"-mt-9 mb-4",children:t.jsx(Bs,{})}),e[1]=a):a=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx("h2",{className:"text-lg font-medium leading-6 text-foreground",children:Ms}),t.jsx("p",{className:"text-sm leading-5 text-muted-foreground",children:Qs})]}),e[2]=l):l=e[2];let c;return e[3]!==s||e[4]!==n?(c=t.jsx("div",{className:"relative flex h-full w-full items-center justify-center p-10",children:t.jsxs("div",{className:"w-full max-w-[440px] overflow-hidden rounded-3xl border border-border bg-card card-shadow",children:[i,t.jsxs("div",{className:"px-8 pb-8",children:[a,l,t.jsx(Hs,{href:s,size:"lg",className:"mt-6",orgId:n})]})]})}),e[3]=s,e[4]=n,e[5]=c):c=e[5],c}function jn(o){const e=H.c(13),{className:s,href:n,orgId:i}=o,a=n===void 0?Ue:n;let l;e[0]!==i?(l=()=>oe("commerce_onboarding_meeting_cta_clicked",{placement:"mobile_banner",organization_id:i}),e[0]=i,e[1]=l):l=e[1];let c;e[2]!==s?(c=ie("flex items-center gap-3 rounded-xl border border-border bg-card p-3 card-shadow transition-colors hover:bg-accent",s),e[2]=s,e[3]=c):c=e[3];let u,p;e[4]===Symbol.for("react.memo_cache_sentinel")?(u={height:32,width:32+2*Math.round(22.4)},p=ge.map(Vs),e[4]=u,e[5]=p):(u=e[4],p=e[5]);let r,f,m;e[6]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsxs("span",{className:"relative flex shrink-0 items-center",style:u,children:[p,t.jsx("span",{className:"absolute -right-0.5 -top-0.5 h-2.5 w-2.5 rounded-full border-2 border-card bg-success","aria-hidden":!0,style:{zIndex:ge.length+1}})]}),f=t.jsx("span",{className:"flex-1 text-sm font-medium leading-tight text-foreground",children:"Precisa de ajuda? Fale conosco"}),m=t.jsx(st,{size:16,className:"shrink-0 text-muted-foreground"}),e[6]=r,e[7]=f,e[8]=m):(r=e[6],f=e[7],m=e[8]);let h;return e[9]!==a||e[10]!==l||e[11]!==c?(h=t.jsxs("a",{href:a,target:"_blank",rel:"noreferrer",onClick:l,className:c,children:[r,f,m]}),e[9]=a,e[10]=l,e[11]=c,e[12]=h):h=e[12],h}function Vs(o,e){return t.jsx("span",{className:"absolute block h-8 w-8 overflow-hidden rounded-full border-2 border-card",style:{left:e*Math.round(22.4),zIndex:ge.length-e},children:t.jsx("img",{src:o.photo,alt:o.alt,className:"h-full w-full object-cover",loading:"lazy"})},o.photo)}function Sn(o){const e=H.c(10),{host:s}=o,n=`https://www.google.com/s2/favicons?domain=${s}&sz=128`;let i,a,l;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-7 w-7 dark:hidden"}),a=t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-7 w-7 hidden dark:block"}),l=t.jsx("div",{className:"h-6 w-px rotate-12 bg-border","aria-hidden":"true"}),e[0]=i,e[1]=a,e[2]=l):(i=e[0],a=e[1],l=e[2]);let c;e[3]!==n?(c=t.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-border bg-white",children:t.jsx("img",{src:n,alt:"",className:"h-5 w-5",loading:"lazy"})}),e[3]=n,e[4]=c):c=e[4];let u;e[5]!==s?(u=t.jsx("span",{className:"text-lg font-medium text-foreground",children:s}),e[5]=s,e[6]=u):u=e[6];let p;return e[7]!==c||e[8]!==u?(p=t.jsxs("div",{className:"flex items-center gap-3",children:[i,a,l,c,u]}),e[7]=c,e[8]=u,e[9]=p):p=e[9],p}function Ws(o){return o.content?.find(e=>e.text)?.text??"A configuração do Commerce Discovery falhou."}function _n(o){const e=o;if(e.isError)throw new Error(Ws(e));return e.structuredContent??o}export{qs as C,ze as L,Sn as S,Wt as a,vn as b,Cn as c,bn as d,jn as e,xn as i,Ne as n,_n as p,yn as s};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as T,j as t,r as J,B as je,i as be}from"./index-C5JCmVQ0.js";import{i as Se}from"./ChevronRight-B9mybD1s.js";import{V as fe}from"./agent-icon-DMtjBPX3.js";import{A as ue}from"./automation-runs-_xFJy_Wv.js";import{r as Ne,u as ke,a as _e,b as we,i as Ce,d as Te,f as Fe,P as Re,S as Ee}from"./page-seo-form-BoV5cy5K.js";import{Z as xe,r as ze}from"./index-PCoZIk-M.js";import{a as ge}from"./Tool01-BT4kICfE.js";import"./AlertCircle-CX23NCuO.js";import"./UserPlus01-13KHecKW.js";import"./ArrowUp-ChoUWc1b.js";import"./Settings02-DAAnVZLO.js";import"./Tool02-vM8N2pYB.js";import"./XCircle-C9sRiEE0.js";import"./ArrowUpRight-Bq-zX9ha.js";import"./TrendUp01-CBDxjtVg.js";import"./ZapSquare-BV8kr37_.js";import"./Users03-ZlQye2vY.js";import"./CheckCircle-Day5nLHt.js";import"./Check-BbAbdPfp.js";import"./ChevronDown-BsEi-r9q.js";import"./ChevronUp-BWoVqFrM.js";import"./Circle-Bj_xS3WU.js";import"./Stars02-B9xmjTkg.js";import"./Eye-CyP9kYwn.js";import"./ZoomOut-7nLppLEs.js";import"./DotsVertical-BQRa2EB9.js";import"./Globe01-CC0A4U7g.js";import"./FilterLines-C5i4i3WB.js";import"./Flag01-C7YxvVFh.js";import"./Star01-Bb61R21H.js";import"./Globe04-BV89vsfi.js";import"./SwitchHorizontal01-C90B2Auk.js";import"./HardDrive-CA9cG4ej.js";import"./Key01-Y2tTMtA8.js";import"./LayoutLeft-C6uN3ryJ.js";import"./LinkExternal01-CbW1jJhi.js";import"./List-MOccGrJp.js";import"./Monitor01-DBUBWT-e.js";import"./Sun-wOtTFTOd.js";import"./Package-BL3B6ONo.js";import"./Palette-B0oAitOJ.js";import"./Play-zjQOd6w0.js";import"./Plus-DATZ4-ND.js";import"./SearchLg-B4W4xrFH.js";import"./SearchMd-CKL74aOj.js";import"./Shield01-IlYcL8Fi.js";import"./Stars01-Bnuoinbt.js";import"./Trash01-CrwbV8c_.js";import"./Upload01-Lp0wJMYr.js";import"./User01-CQV6kRtR.js";import"./Users01-CDDfUziK.js";import"./XClose-4pjmwtT4.js";import"./X-CNdIeej8.js";import"./Zap-DHGChPV2.js";import"./select-D59HzWyb.js";import"./tooltip-DjWNMg5T.js";import"./useInfiniteQuery-D-yVKxn2.js";import"./use-infinite-scroll-WwPPe2Wp.js";import"./use-connection-DhRKlWkl.js";import"./use-collections-Kwxr6RPv.js";import"./use-mcp-client-DlCO79GA.js";import"./constants-D_FQAPnt.js";import"./auth-DIzgjm9h.js";import"./use-virtual-mcp-KZlYJNMn.js";import"./card-1ZIM8JYb.js";import"./sidebar-i7yNFNs9.js";import"./use-mobile-vXwkCjTm.js";import"./table-B8kPpHAC.js";import"./empty-state-D0Yjh42T.js";import"./use-members-CP1GrgsV.js";import"./use-org-auth-client-BeUafwOm.js";import"./use-clock-tick-BNpEZMto.js";import"./use-automations-kY9mTa0N.js";import"./studio-tools--pllMpfK.js";import"./useSuspenseInfiniteQuery-QFUkmQtZ.js";import"./badge-BR8ZoQPH.js";import"./checkbox-YuHG4ViR.js";import"./command-DRUw9pTQ.js";import"./index-BOaCGG-5.js";import"./dialog-DfnhzCwv.js";import"./popover-DL95paTt.js";import"./avatar-CfHetrJ0.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-C62zVzDi.js";import"./file-type-icon-CyQSc8WD.js";import"./tab-id-BijBBRwE.js";import"./monaco-editor-DYdw6m6P.js";import"./index-B8Idfh3P.js";import"./chat-context-BhPkOl45.js";import"./autosend-BX8nQnW3.js";import"./hooks-DsQUp7L9.js";import"./decopilot-sse-pool-B1izZBf2.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-CQmOOELp.js";import"./use-decopilot-events-Cww7ZCTK.js";import"./use-organization-settings-BFGZ9YuD.js";import"./index-emjsrsD0.js";import"./shell-layout-TAILJ-da.js";import"./alert-dialog-IVNf28U9.js";import"./required-auth-layout-BLRuxjNn.js";import"./use-org-sso-CpksLDM-.js";import"./integration-icon-D74EpYgv.js";import"./use-navigate-to-agent-DZwula5s.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-CRvFGO5O.js";import"./form-ZPjO3One.js";import"./label-CjR-YPrA.js";import"./input-DWv95vY4.js";import"./switch-DLw5svpB.js";import"./drawer-Cu1H6Zpl.js";import"./collection-search-D4kzf4BZ.js";import"./tabs-C19FaLXY.js";import"./toggle-group-SYBG9bZR.js";import"./use-deco-credits-rxapxW2c.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-BddaDWk3.js";import"./use-registry-connections-ml5ez91l.js";import"./extract-connection-data-DkYKg47U.js";import"./collection-tabs-CwblhJGY.js";import"./textarea-DGICe7Jx.js";import"./connection-form-helpers-B3t0vd0x.js";import"./authenticate-and-persist-oauth-Bb5P11Gd.js";import"./mcp-oauth-CDqgI2Xn.js";import"./connect-desktop-dialog-BSEnA0YE.js";import"./select-model-D8LB7zlx.js";import"./skeleton-D824Y8b-.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-CHSsdIIo.js";import"./dropdown-menu-BlorfjU6.js";import"./index-BeTttHS9.js";import"./toolbar-V6M48IQV.js";import"./use-debounced-value-DEfVi-aN.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-DUjqcw9j.js";import"./use-mcp-tools-PUeX7iQD.js";import"./use-capability-BtQYj-6N.js";import"./tools-list-CvZ2H4zV.js";import"./use-debounced-autosave-Cumlh74L.js";import"./index-1xWIMGUU.js";import"./search-input-B9lRxCGI.js";import"./github-repo-picker-DneVvY3I.js";import"./github-installations-ChFezl8I.js";import"./use-secrets-DXp4vVpG.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./companions-core-CrqiPrVn.js";import"./index-D-JmKBPU.js";import"./get-initials-D-f_fDFw.js";import"./calendar-D9BWcxij.js";import"./toolbar-icon-button-DapYdi-A.js";import"./use-file-configs-BaRnwcsF.js";import"./automation-list-row-BrrHJBg_.js";function U(n){return typeof n=="string"&&n.trim()?n:void 0}function he(n,e){if(n){if(e)try{const i=new URL(n,e).href;return xe(i)}catch{return}return xe(n)}}function Pe(n){if(!n)return{};const e=U(n.title),i=U(n.titleTemplate);return{title:e&&i?.includes("%s")?i.replace(/%s/g,e):e,description:U(n.description),image:U(n.image),favicon:U(n.favicon)}}function Oe(n){if(!n)return"example.com";try{return new URL(n).host}catch{return"example.com"}}const Q="Your page title",ee="Your meta description will appear here.",Le=[{id:"google",label:"Google",color:"#4285F4",layout:"search"},{id:"facebook",label:"Facebook",color:"#1877F2",layout:"card"},{id:"twitter",label:"X (Twitter)",color:"#0f1419",layout:"card"},{id:"linkedin",label:"LinkedIn",color:"#0A66C2",layout:"card"},{id:"whatsapp",label:"WhatsApp",color:"#25D366",layout:"chat"},{id:"telegram",label:"Telegram",color:"#229ED9",layout:"chat"},{id:"slack",label:"Slack",color:"#611f69",layout:"attachment"},{id:"discord",label:"Discord",color:"#5865F2",layout:"attachment"}];function pe(n){const e=T.c(10),{src:i,className:r,iconSize:h}=n,a=h===void 0?20:h;if(i){let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={objectFit:"cover"},e[0]=m):m=e[0];let p;return e[1]!==r||e[2]!==i?(p=t.jsx("img",{src:i,alt:"",referrerPolicy:"no-referrer",className:r,style:m}),e[1]=r,e[2]=i,e[3]=p):p=e[3],p}let s;e[4]===Symbol.for("react.memo_cache_sentinel")?(s={display:"flex",alignItems:"center",justifyContent:"center",background:"#e5e7eb",color:"#9ca3af"},e[4]=s):s=e[4];let o;e[5]!==a?(o=t.jsx(ge,{size:a}),e[5]=a,e[6]=o):o=e[6];let l;return e[7]!==r||e[8]!==o?(l=t.jsx("div",{className:r,style:s,children:o}),e[7]=r,e[8]=o,e[9]=l):l=e[9],l}function $e(n){const e=T.c(27),{seo:i,host:r,path:h}=n;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={background:"#fff",border:"1px solid #dadce0"},e[0]=a):a=e[0];let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s={background:"#f1f3f4"},e[1]=s):s=e[1];let o;e[2]!==i.favicon?(o=t.jsx("div",{className:"flex size-6 shrink-0 items-center justify-center overflow-hidden rounded-full",style:s,children:i.favicon?t.jsx("img",{src:i.favicon,alt:"",className:"size-full object-cover"}):t.jsx(ge,{size:12,color:"#9aa0a6"})}),e[2]=i.favicon,e[3]=o):o=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l={color:"#202124"},e[4]=l):l=e[4];let m;e[5]!==r?(m=t.jsx("div",{className:"truncate text-[13px] leading-tight",style:l,children:r}),e[5]=r,e[6]=m):m=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p={color:"#4d5156"},e[7]=p):p=e[7];let d;e[8]!==r||e[9]!==h?(d=t.jsxs("div",{className:"truncate text-[12px] leading-tight",style:p,children:[r,h]}),e[8]=r,e[9]=h,e[10]=d):d=e[10];let c;e[11]!==m||e[12]!==d?(c=t.jsxs("div",{className:"min-w-0",children:[m,d]}),e[11]=m,e[12]=d,e[13]=c):c=e[13];let g;e[14]!==o||e[15]!==c?(g=t.jsxs("div",{className:"flex items-center gap-2",children:[o,c]}),e[14]=o,e[15]=c,e[16]=g):g=e[16];let f;e[17]===Symbol.for("react.memo_cache_sentinel")?(f={color:"#1a0dab"},e[17]=f):f=e[17];const x=i.title??Q;let u;e[18]!==x?(u=t.jsx("div",{className:"mt-1.5 truncate text-[18px] leading-snug",style:f,children:x}),e[18]=x,e[19]=u):u=e[19];let j;e[20]===Symbol.for("react.memo_cache_sentinel")?(j={color:"#4d5156"},e[20]=j):j=e[20];const v=i.description??ee;let y;e[21]!==v?(y=t.jsx("div",{className:"mt-0.5 line-clamp-2 text-[13px] leading-snug",style:j,children:v}),e[21]=v,e[22]=y):y=e[22];let b;return e[23]!==u||e[24]!==y||e[25]!==g?(b=t.jsxs("div",{className:"rounded-lg p-3 text-left",style:a,children:[g,u,y]}),e[23]=u,e[24]=y,e[25]=g,e[26]=b):b=e[26],b}function De(n){const e=T.c(20),{seo:i,host:r}=n;let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={background:"#fff",border:"1px solid #e2e8f0"},e[0]=h):h=e[0];let a;e[1]!==i.image?(a=t.jsx(pe,{src:i.image,className:"h-40 w-full"}),e[1]=i.image,e[2]=a):a=e[2];let s;e[3]===Symbol.for("react.memo_cache_sentinel")?(s={borderTop:"1px solid #e2e8f0"},e[3]=s):s=e[3];let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o={color:"#8a9099"},e[4]=o):o=e[4];let l;e[5]!==r?(l=t.jsx("div",{className:"truncate text-[11px]",style:o,children:r}),e[5]=r,e[6]=l):l=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m={color:"#1c2024"},e[7]=m):m=e[7];const p=i.title??Q;let d;e[8]!==p?(d=t.jsx("div",{className:"line-clamp-1 text-[14px] font-semibold",style:m,children:p}),e[8]=p,e[9]=d):d=e[9];let c;e[10]===Symbol.for("react.memo_cache_sentinel")?(c={color:"#60666c"},e[10]=c):c=e[10];const g=i.description??ee;let f;e[11]!==g?(f=t.jsx("div",{className:"line-clamp-2 text-[12px]",style:c,children:g}),e[11]=g,e[12]=f):f=e[12];let x;e[13]!==f||e[14]!==l||e[15]!==d?(x=t.jsxs("div",{className:"px-3 py-2",style:s,children:[l,d,f]}),e[13]=f,e[14]=l,e[15]=d,e[16]=x):x=e[16];let u;return e[17]!==x||e[18]!==a?(u=t.jsxs("div",{className:"overflow-hidden rounded-lg text-left",style:h,children:[a,x]}),e[17]=x,e[18]=a,e[19]=u):u=e[19],u}function Ie(n){const e=T.c(23),{seo:i,host:r,accent:h}=n;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={background:"#f0f2f5"},e[0]=a):a=e[0];let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("p",{className:"px-1 pb-1.5 text-[12px]",style:{color:"#3b4045"},children:"Here's a post you might write with the link of your website:"}),e[1]=s):s=e[1];const o=`3px solid ${h}`;let l;e[2]!==o?(l={background:"#fff",borderLeft:o},e[2]=o,e[3]=l):l=e[3];let m;e[4]!==i.image?(m=t.jsx(pe,{src:i.image,className:"h-28 w-full",iconSize:18}),e[4]=i.image,e[5]=m):m=e[5];let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p={color:"#1c2024"},e[6]=p):p=e[6];const d=i.title??Q;let c;e[7]!==d?(c=t.jsx("div",{className:"line-clamp-1 text-[12px] font-semibold",style:p,children:d}),e[7]=d,e[8]=c):c=e[8];let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g={color:"#60666c"},e[9]=g):g=e[9];const f=i.description??ee;let x;e[10]!==f?(x=t.jsx("div",{className:"line-clamp-2 text-[11px]",style:g,children:f}),e[10]=f,e[11]=x):x=e[11];let u;e[12]===Symbol.for("react.memo_cache_sentinel")?(u={color:"#8a9099"},e[12]=u):u=e[12];let j;e[13]!==r?(j=t.jsx("div",{className:"mt-0.5 text-[10px]",style:u,children:r}),e[13]=r,e[14]=j):j=e[14];let v;e[15]!==x||e[16]!==j||e[17]!==c?(v=t.jsxs("div",{className:"px-2.5 py-1.5",children:[c,x,j]}),e[15]=x,e[16]=j,e[17]=c,e[18]=v):v=e[18];let y;return e[19]!==v||e[20]!==l||e[21]!==m?(y=t.jsxs("div",{className:"rounded-lg p-2 text-left",style:a,children:[s,t.jsxs("div",{className:"overflow-hidden rounded-md",style:l,children:[m,v]})]}),e[19]=v,e[20]=l,e[21]=m,e[22]=y):y=e[22],y}function Ae(n){const e=T.c(33),{seo:i,host:r,accent:h,dark:a}=n,s=a?"#2b2d31":"#fff",o=a?"#00a8fc":"#1264a3",l=a?"#dbdee1":"#3b4045",m=a?"#949ba4":"#8a9099",p=a?"none":"1px solid #e2e8f0";let d;e[0]!==s||e[1]!==p?(d={background:s,border:p},e[0]=s,e[1]=p,e[2]=d):d=e[2];const c=`3px solid ${h}`;let g;e[3]!==c?(g={borderLeft:c,borderRadius:2},e[3]=c,e[4]=g):g=e[4];let f;e[5]!==m?(f={color:m},e[5]=m,e[6]=f):f=e[6];let x;e[7]!==r||e[8]!==f?(x=t.jsx("div",{className:"text-[10px]",style:f,children:r}),e[7]=r,e[8]=f,e[9]=x):x=e[9];let u;e[10]!==o?(u={color:o},e[10]=o,e[11]=u):u=e[11];const j=i.title??Q;let v;e[12]!==u||e[13]!==j?(v=t.jsx("div",{className:"line-clamp-1 text-[13px] font-semibold",style:u,children:j}),e[12]=u,e[13]=j,e[14]=v):v=e[14];let y;e[15]!==l?(y={color:l},e[15]=l,e[16]=y):y=e[16];const b=i.description??ee;let _;e[17]!==y||e[18]!==b?(_=t.jsx("div",{className:"line-clamp-2 text-[12px]",style:y,children:b}),e[17]=y,e[18]=b,e[19]=_):_=e[19];let N;e[20]!==_||e[21]!==x||e[22]!==v?(N=t.jsxs("div",{className:"min-w-0 flex-1",children:[x,v,_]}),e[20]=_,e[21]=x,e[22]=v,e[23]=N):N=e[23];let S;e[24]!==i.image?(S=t.jsx(pe,{src:i.image,className:"size-14 shrink-0 rounded",iconSize:16}),e[24]=i.image,e[25]=S):S=e[25];let k;e[26]!==N||e[27]!==S||e[28]!==g?(k=t.jsxs("div",{className:"flex gap-2.5 pl-2.5",style:g,children:[N,S]}),e[26]=N,e[27]=S,e[28]=g,e[29]=k):k=e[29];let C;return e[30]!==k||e[31]!==d?(C=t.jsx("div",{className:"rounded-lg p-2.5 text-left",style:d,children:k}),e[30]=k,e[31]=d,e[32]=C):C=e[32],C}function Be(n){const e=T.c(17),{platform:i,seo:r,host:h,path:a}=n;let s;e[0]!==h||e[1]!==a||e[2]!==i.color||e[3]!==i.id||e[4]!==i.layout||e[5]!==r?(s=i.layout==="search"?t.jsx($e,{seo:r,host:h,path:a}):i.layout==="card"?t.jsx(De,{seo:r,host:h,path:a}):i.layout==="chat"?t.jsx(Ie,{seo:r,host:h,path:a,accent:i.color}):t.jsx(Ae,{seo:r,host:h,path:a,accent:i.color,dark:i.id==="discord"}),e[0]=h,e[1]=a,e[2]=i.color,e[3]=i.id,e[4]=i.layout,e[5]=r,e[6]=s):s=e[6];const o=s;let l;e[7]!==i.color?(l=t.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{background:i.color}}),e[7]=i.color,e[8]=l):l=e[8];let m;e[9]!==i.label?(m=t.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:i.label}),e[9]=i.label,e[10]=m):m=e[10];let p;e[11]!==l||e[12]!==m?(p=t.jsxs("div",{className:"mb-1.5 flex items-center gap-1.5",children:[l,m]}),e[11]=l,e[12]=m,e[13]=p):p=e[13];let d;return e[14]!==o||e[15]!==p?(d=t.jsxs("div",{children:[p,o]}),e[14]=o,e[15]=p,e[16]=d):d=e[16],d}function Ue(n){const e=T.c(17),{seo:i,url:r,path:h}=n,a=h===void 0?"/":h;let s,o,l;if(e[0]!==i||e[1]!==r){const u=Pe(i);s=u,o=he(u.image,r),l=he(u.favicon,r),e[0]=i,e[1]=r,e[2]=s,e[3]=o,e[4]=l}else s=e[2],o=e[3],l=e[4];let m;e[5]!==s||e[6]!==o||e[7]!==l?(m={...s,image:o,favicon:l},e[5]=s,e[6]=o,e[7]=l,e[8]=m):m=e[8];const p=m;let d;e[9]!==r?(d=Oe(r),e[9]=r,e[10]=d):d=e[10];const c=d,g=a==="/"?"":a;let f;e[11]!==g||e[12]!==c||e[13]!==p?(f=Le.map(u=>t.jsx(Be,{platform:u,seo:p,host:c,path:g},u.id)),e[11]=g,e[12]=c,e[13]=p,e[14]=f):f=e[14];let x;return e[15]!==f?(x=t.jsx("div",{className:"grid grid-cols-1 gap-4 @2xl:grid-cols-2",children:f}),e[15]=f,e[16]=x):x=e[16],x}function Ii(n){const e=T.c(63),{orgSlug:i,virtualMcpId:r,branch:h,decofile:a,meta:s,target:o,previewBaseUrl:l,onSaved:m,onEditDefaultSeo:p,onBack:d}=n,c=Ne(a,o,s),g=c?.seoData,f=o.kind==="site"?"site":o.pageKey,[x,u]=J.useState(f),[j,v]=J.useState(null),[y,b]=J.useState(0),[_,N]=J.useState(void 0);x!==f&&(u(f),v(null),N(void 0),b(Me));const{persistSeo:S,persistRawSeo:k,flush:C,isPending:te}=ke({orgSlug:i,virtualMcpId:r,branch:h,target:o,resolved:c,onSaved:m}),K=o.kind==="page",ve=K?c?.rawSeoData:void 0,B=_!==void 0?_:ve,ye=K?_e(B)??void 0:void 0,w=j??ye??g??{},F=c?we(w,c):null,z=F&&(!K||Ce(B))?ze(F,s):null;let M;e[0]!==s?(M=Te(s),e[0]=s,e[1]=M):M=e[1];const oe=M;let R,V;e[2]!==a||e[3]!==w||e[4]!==s||e[5]!==o.kind?(R=o.kind==="page"?Fe(a,s)?.seoData??{}:{},V=o.kind==="page"?Ge(R,w):w,e[2]=a,e[3]=w,e[4]=s,e[5]=o.kind,e[6]=R,e[7]=V):(R=e[6],V=e[7]);const ie=V;let G;e[8]!==S||e[9]!==c||e[10]!==v?(G=E=>{if(!c)return;const de=E;v(de),S(de)},e[8]=S,e[9]=c,e[10]=v,e[11]=G):G=e[11];const se=G;let Y;e[12]!==v?(Y=()=>v(null),e[12]=v,e[13]=Y):Y=e[13];const le=Y;let H;e[14]!==b?(H=()=>b(Ke),e[14]=b,e[15]=H):H=e[15];const re=H;let W;e[16]!==C||e[17]!==d?(W=()=>{C(),d?.()},e[16]=C,e[17]=d,e[18]=W):W=e[18];const ae=W,P=o.kind==="page"?o.path:"/";let X;e[19]!==P||e[20]!==l||e[21]!==o.kind?(X=o.kind==="page"&&l?Ve(P,l):l??null,e[19]=P,e[20]=l,e[21]=o.kind,e[22]=X):X=e[22];const ne=X,ce=o.kind==="site"?"No site-level SEO block found.":c?"SEO schema not found for this page.":"Could not load page SEO.",Z=K&&c,me=o.kind==="site"&&c&&z;let O;e[23]!==ae||e[24]!==o.kind||e[25]!==o.pageName?(O=o.kind==="page"?t.jsxs("nav",{className:"flex min-w-0 items-center gap-1 text-sm",children:[t.jsx("button",{type:"button",onClick:ae,title:o.pageName,className:"min-w-0 truncate rounded-md px-1 py-0.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",children:o.pageName}),t.jsx(Se,{className:"size-3 shrink-0 text-muted-foreground/60"}),t.jsx("span",{className:"px-1 py-0.5 font-medium text-foreground",children:"SEO"})]}):t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx(fe,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsx("span",{className:"text-sm font-medium",children:"Default SEO"}),t.jsx("span",{className:"hidden truncate text-xs text-muted-foreground sm:inline",children:"· applied to every page unless overridden"})]}),e[23]=ae,e[24]=o.kind,e[25]=o.pageName,e[26]=O):O=e[26];let L;e[27]!==te?(L=te&&t.jsx(be,{size:14,className:"animate-spin text-muted-foreground"}),e[27]=te,e[28]=L):L=e[28];let $;e[29]!==p||e[30]!==o.kind?($=o.kind==="page"&&p&&t.jsxs(je,{type:"button",variant:"outline",size:"sm",onClick:p,children:[t.jsx(fe,{size:14}),"Edit default SEO"]}),e[29]=p,e[30]=o.kind,e[31]=$):$=e[31];let D;e[32]!==$||e[33]!==L?(D=t.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:[L,$]}),e[32]=$,e[33]=L,e[34]=D):D=e[34];let I;e[35]!==D||e[36]!==O?(I=t.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-2 border-b px-4",children:[O,D]}),e[35]=D,e[36]=O,e[37]=I):I=e[37];let A;e[38]!==F||e[39]!==re||e[40]!==le||e[41]!==oe||e[42]!==B||e[43]!==w||e[44]!==ce||e[45]!==y||e[46]!==se||e[47]!==P||e[48]!==k||e[49]!==S||e[50]!==ie||e[51]!==ne||e[52]!==c||e[53]!==z||e[54]!==v||e[55]!==N||e[56]!==Z||e[57]!==me||e[58]!==R?(A=!c||!Z&&!me?t.jsx("div",{className:"flex flex-1 items-center justify-center px-6 text-center text-sm text-muted-foreground",children:ce}):t.jsxs("div",{className:"flex min-h-0 flex-1",children:[t.jsx(ue,{className:"w-full max-w-md shrink-0 border-r [&_[data-slot=scroll-area-viewport]>div]:!block",children:t.jsx("div",{className:"px-5 py-4",children:Z?t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"mb-3 text-xs text-muted-foreground",children:"Empty fields inherit the default SEO. The preview shows the resolved result."}),t.jsx(Re,{rawSeo:B,innerSeo:w,defaultResolveType:oe,seoSchema:z,activeResolveType:F,seoTypeOptions:c.seoTypeOptions,formResetKey:y,siteDefaultSeo:R,onPersistRaw:E=>{N(E),k(E)},onInnerChange:E=>{v(E),S(E)},onClearForm:le,onBumpFormKey:re})]}):z&&F&&t.jsx(Ee,{schema:z,resolveType:F,value:w,formResetKey:y,onChange:se})})}),t.jsx(ue,{className:"min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:t.jsx("div",{className:"@container px-5 py-4",children:t.jsx(Ue,{seo:ie,url:ne,path:P})})})]}),e[38]=F,e[39]=re,e[40]=le,e[41]=oe,e[42]=B,e[43]=w,e[44]=ce,e[45]=y,e[46]=se,e[47]=P,e[48]=k,e[49]=S,e[50]=ie,e[51]=ne,e[52]=c,e[53]=z,e[54]=v,e[55]=N,e[56]=Z,e[57]=me,e[58]=R,e[59]=A):A=e[59];let q;return e[60]!==I||e[61]!==A?(q=t.jsxs("div",{className:"flex h-full w-full flex-col",children:[I,A]}),e[60]=I,e[61]=A,e[62]=q):q=e[62],q}function Ke(n){return n+1}function Me(n){return n+1}function Ve(n,e){try{return new URL(n,e).href}catch{return e}}function Ge(n,e){const i=e.__resolveType,r=n.__resolveType;if(typeof i=="string"&&typeof r=="string"&&i!==r)return{...e};const h={...n};for(const[a,s]of Object.entries(e))a!=="__resolveType"&&s!=null&&(typeof s=="string"&&s.trim()===""||(h[a]=s));return h}export{Ii as SeoEditor};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/registry-layout-C2G4koz9.js","assets/index-C5JCmVQ0.js","assets/index-BO2t38sV.css","assets/Tool02-vM8N2pYB.js","assets/CheckCircle-Day5nLHt.js","assets/Settings02-DAAnVZLO.js","assets/use-mcp-client-DlCO79GA.js","assets/constants-D_FQAPnt.js","assets/auth-DIzgjm9h.js","assets/useInfiniteQuery-D-yVKxn2.js","assets/use-infinite-scroll-WwPPe2Wp.js","assets/studio-tools--pllMpfK.js","assets/badge-BR8ZoQPH.js","assets/input-DWv95vY4.js","assets/dropdown-menu-BlorfjU6.js","assets/Check-BbAbdPfp.js","assets/ChevronRight-B9mybD1s.js","assets/Circle-Bj_xS3WU.js","assets/table-B8kPpHAC.js","assets/toggle-group-SYBG9bZR.js","assets/use-view-mode-CJMBEHOJ.js","assets/use-mobile-vXwkCjTm.js","assets/DotsVertical-BQRa2EB9.js","assets/FilterLines-C5i4i3WB.js","assets/Globe01-CC0A4U7g.js","assets/SearchMd-CKL74aOj.js","assets/dialog-DfnhzCwv.js","assets/X-CNdIeej8.js","assets/AlertCircle-CX23NCuO.js","assets/Upload01-Lp0wJMYr.js","assets/alert-dialog-IVNf28U9.js","assets/card-1ZIM8JYb.js","assets/Trash01-CrwbV8c_.js","assets/label-CjR-YPrA.js","assets/select-D59HzWyb.js","assets/tooltip-DjWNMg5T.js","assets/ChevronDown-BsEi-r9q.js","assets/ChevronUp-BWoVqFrM.js","assets/switch-DLw5svpB.js","assets/textarea-DGICe7Jx.js","assets/XCircle-C9sRiEE0.js","assets/checkbox-YuHG4ViR.js","assets/Eye-CyP9kYwn.js","assets/LinkExternal01-CbW1jJhi.js","assets/use-copy-C62zVzDi.js","assets/Key01-Y2tTMtA8.js","assets/Plus-DATZ4-ND.js","assets/mcp-oauth-CDqgI2Xn.js","assets/Play-zjQOd6w0.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{c as m,b as n,e as c,j as t,i as p,r as l,aX as f}from"./index-C5JCmVQ0.js";import{R as u}from"./require-capability-Coot4cTo.js";import"./use-capability-BtQYj-6N.js";import"./access-gate-BAwcBNbs.js";import"./capability-load-error-CWaH-_Bd.js";const g=l.lazy(()=>f(()=>import("./registry-layout-C2G4koz9.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48])));function j(){const e=m.c(5),i=n();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org"},e[0]=s):s=e[0];const{org:o}=c(s);let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"h-full flex items-center justify-center",children:t.jsx(p,{size:20,className:"animate-spin text-muted-foreground"})}),e[1]=r):r=e[1];let a;return e[2]!==i||e[3]!==o?(a=t.jsx(u,{capability:"registry:manage",area:"the registry",children:t.jsx(l.Suspense,{fallback:r,children:t.jsx(g,{onBack:()=>i({to:"/$org/settings/store",params:{org:o}})})})}),e[2]=i,e[3]=o,e[4]=a):a=e[4],a}export{j as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as l,C as g,m as b,K as _,n as E,d as z,r as R}from"./index-C5JCmVQ0.js";import{W as D}from"./constants-D_FQAPnt.js";import{c as C,u as G}from"./studio-tools--pllMpfK.js";const I={organizationId:"",sidebar_items:null,enabled_plugins:null,registry_config:null,simple_mode:null,default_home_agents:null,reports_only:null,task_board_enabled:!1},O={tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}};function N(t,e){return{queryKey:_.organizationSettings(e),queryFn:async()=>{try{return await C(t,"ORGANIZATION_SETTINGS_GET",{})}catch{return{...I,organizationId:e}}},staleTime:6e4}}function f(t){const e=l.c(6),{org:s}=g();let n;e[0]!==s.id||e[1]!==s.slug?(n=N(s.slug,s.id),e[0]=s.id,e[1]=s.slug,e[2]=n):n=e[2];const a=t;let r;return e[3]!==n||e[4]!==a?(r={...n,select:a},e[3]=n,e[4]=a,e[5]=r):r=e[5],b(r)}function Z(t,e){const s=l.c(3);let n;s[0]!==t||s[1]!==e?(n=N(e,t),s[0]=t,s[1]=e,s[2]=n):n=s[2];const{data:a}=b(n);return a??null}function y(){const t=l.c(9),{org:e}=g(),s=G(),n=E();let a;t[0]!==e||t[1]!==s?(a=async o=>{const u=await s.call("ORGANIZATION_SETTINGS_UPDATE",{organizationId:e.id,...o});if(!u)throw new Error("ORGANIZATION_SETTINGS_UPDATE returned no payload");return u},t[0]=e,t[1]=s,t[2]=a):a=t[2];let r;t[3]!==e||t[4]!==n?(r=o=>{n.setQueryData(_.organizationSettings(e.id),u=>({...u??I,...o}))},t[3]=e,t[4]=n,t[5]=r):r=t[5];let i;return t[6]!==a||t[7]!==r?(i={mutationFn:a,onSuccess:r},t[6]=a,t[7]=r,t[8]=i):i=t[8],z(i)}function M(t){return t?.tiers?{tiers:{fast:t.tiers.fast??null,smart:t.tiers.smart??null,thinking:t.tiers.thinking??null,image:t.tiers.image??null,web_search:t.tiers.web_search??null,deep_research:t.tiers.deep_research??null}}:O}function j(){const{data:t}=f(Q);return t??O}function Q(t){return M(t.simple_mode)}function F(){const t=l.c(7),e=y();let s,n;t[0]!==e?(s=(r,i)=>e.mutate({simple_mode:r},i),n=(r,i)=>e.mutateAsync({simple_mode:r},i),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let a;return t[3]!==e||t[4]!==s||t[5]!==n?(a={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=a):a=t[6],a}function L(){const{data:t}=f($);return t??!1}function $(t){return t.reports_only??!1}function v(){const{data:t}=f(P);return t??!1}function P(t){return t.task_board_enabled??!1}function J(){const t=l.c(7),e=y();let s,n;t[0]!==e?(s=(r,i)=>e.mutate({task_board_enabled:r},i),n=(r,i)=>e.mutateAsync({task_board_enabled:r},i),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let a;return t[3]!==e||t[4]!==s||t[5]!==n?(a={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=a):a=t[6],a}function U(){const{data:t}=f(x);return t??null}function x(t){return t.registry_config}function V(){const t=l.c(7),e=y();let s,n;t[0]!==e?(s=(r,i)=>e.mutate({registry_config:r},i),n=(r,i)=>e.mutateAsync({registry_config:r},i),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let a;return t[3]!==e||t[4]!==s||t[5]!==n?(a={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=a):a=t[6],a}function X(){const{data:t}=f(q);return t??null}function q(t){return t.default_home_agents}function K(){const t=l.c(7),e=y();let s,n;t[0]!==e?(s=(r,i)=>e.mutate({default_home_agents:r},i),n=(r,i)=>e.mutateAsync({default_home_agents:r},i),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let a;return t[3]!==e||t[4]!==s||t[5]!==n?(a={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=a):a=t[6],a}function tt(){const t=l.c(14),{org:e}=g(),s=K(),n=E();let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=Promise.resolve(),t[0]=a):a=t[0];const r=R.useRef(a);let i;t[1]!==e.id?(i=_.organizationSettings(e.id),t[1]=e.id,t[2]=i):i=t[2];const o=i;let u;t[3]!==o||t[4]!==n?(u=()=>n.getQueryData(o)?.default_home_agents?.ids??[],t[3]=o,t[4]=n,t[5]=u):u=t[5];const p=u;let m;t[6]!==o||t[7]!==e.slug||t[8]!==n||t[9]!==s?(m=k=>{const T=r.current.then(async()=>{const A=n.getQueryData(o),S=k(A?.default_home_agents?.ids??[]);if(S!==null){n.setQueryData(o,c=>c&&{...c,default_home_agents:{ids:S}});try{await s.mutateAsync({ids:S}),await n.refetchQueries({queryKey:_.homeNextActions(e.slug),type:"active"})}catch(c){const w=c;throw n.setQueryData(o,A),w}}});return r.current=T.catch(Y),T},t[6]=o,t[7]=e.slug,t[8]=n,t[9]=s,t[10]=m):m=t[10];const h=m;let d;return t[11]!==h||t[12]!==p?(d={currentIds:p,apply:h},t[11]=h,t[12]=p,t[13]=d):d=t[13],d}function Y(){}function et(){const t=l.c(5),{org:e}=g(),s=U();let n;t[0]!==e.id?(n=D.REGISTRY(e.id),t[0]=e.id,t[1]=n):n=t[1];const a=n;let r;return t[2]!==a||t[3]!==s?(r=i=>{if(!s)return i===a;const o=s.registries[i];return o?o.enabled:i===a},t[2]=a,t[3]=s,t[4]=r):r=t[4],r}export{X as a,tt as b,v as c,et as d,Z as e,J as f,j as g,F as h,U as i,V as j,L as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{I as u}from"./use-infinite-scroll-WwPPe2Wp.js";import{dK as i}from"./index-C5JCmVQ0.js";function t(e,r){return i(e,u,r)}export{t as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{I as s}from"./use-infinite-scroll-WwPPe2Wp.js";import{dK as u,ab as n}from"./index-C5JCmVQ0.js";function a(r,e){return u({...r,enabled:!0,suspense:!0,throwOnError:n},s,e)}export{a as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as V,r as U,j as s,l as J,B as Y}from"./index-C5JCmVQ0.js";import{e as ct}from"./agent-icon-DMtjBPX3.js";import{n as mt,a as et}from"./UserPlus01-13KHecKW.js";import{i as pt}from"./ChevronRight-B9mybD1s.js";import{L as dt}from"./label-CjR-YPrA.js";import{A as rt}from"./automation-runs-_xFJy_Wv.js";import{S as ft}from"./switch-DLw5svpB.js";import{T as ut,b as ht,a as gt}from"./tooltip-DjWNMg5T.js";import{V as xt}from"./view-mode-toggle-BVGFEj0-.js";import"./AlertCircle-CX23NCuO.js";import"./Tool01-BT4kICfE.js";import"./ArrowUp-ChoUWc1b.js";import"./Settings02-DAAnVZLO.js";import"./Tool02-vM8N2pYB.js";import"./XCircle-C9sRiEE0.js";import"./ArrowUpRight-Bq-zX9ha.js";import"./TrendUp01-CBDxjtVg.js";import"./ZapSquare-BV8kr37_.js";import"./Users03-ZlQye2vY.js";import"./CheckCircle-Day5nLHt.js";import"./Check-BbAbdPfp.js";import"./ChevronDown-BsEi-r9q.js";import"./ChevronUp-BWoVqFrM.js";import"./Circle-Bj_xS3WU.js";import"./Stars02-B9xmjTkg.js";import"./Eye-CyP9kYwn.js";import"./ZoomOut-7nLppLEs.js";import"./DotsVertical-BQRa2EB9.js";import"./Globe01-CC0A4U7g.js";import"./FilterLines-C5i4i3WB.js";import"./Flag01-C7YxvVFh.js";import"./Star01-Bb61R21H.js";import"./Globe04-BV89vsfi.js";import"./SwitchHorizontal01-C90B2Auk.js";import"./HardDrive-CA9cG4ej.js";import"./Key01-Y2tTMtA8.js";import"./LayoutLeft-C6uN3ryJ.js";import"./LinkExternal01-CbW1jJhi.js";import"./List-MOccGrJp.js";import"./Monitor01-DBUBWT-e.js";import"./Sun-wOtTFTOd.js";import"./Package-BL3B6ONo.js";import"./Palette-B0oAitOJ.js";import"./Play-zjQOd6w0.js";import"./Plus-DATZ4-ND.js";import"./SearchLg-B4W4xrFH.js";import"./SearchMd-CKL74aOj.js";import"./Shield01-IlYcL8Fi.js";import"./Stars01-Bnuoinbt.js";import"./Trash01-CrwbV8c_.js";import"./Upload01-Lp0wJMYr.js";import"./User01-CQV6kRtR.js";import"./Users01-CDDfUziK.js";import"./XClose-4pjmwtT4.js";import"./X-CNdIeej8.js";import"./Zap-DHGChPV2.js";import"./select-D59HzWyb.js";import"./useInfiniteQuery-D-yVKxn2.js";import"./use-infinite-scroll-WwPPe2Wp.js";import"./use-connection-DhRKlWkl.js";import"./use-collections-Kwxr6RPv.js";import"./use-mcp-client-DlCO79GA.js";import"./constants-D_FQAPnt.js";import"./auth-DIzgjm9h.js";import"./use-virtual-mcp-KZlYJNMn.js";import"./card-1ZIM8JYb.js";import"./sidebar-i7yNFNs9.js";import"./use-mobile-vXwkCjTm.js";import"./table-B8kPpHAC.js";import"./empty-state-D0Yjh42T.js";import"./use-members-CP1GrgsV.js";import"./use-org-auth-client-BeUafwOm.js";import"./use-clock-tick-BNpEZMto.js";import"./use-automations-kY9mTa0N.js";import"./studio-tools--pllMpfK.js";import"./useSuspenseInfiniteQuery-QFUkmQtZ.js";import"./badge-BR8ZoQPH.js";import"./checkbox-YuHG4ViR.js";import"./command-DRUw9pTQ.js";import"./index-BOaCGG-5.js";import"./dialog-DfnhzCwv.js";import"./popover-DL95paTt.js";import"./avatar-CfHetrJ0.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-C62zVzDi.js";import"./file-type-icon-CyQSc8WD.js";import"./tab-id-BijBBRwE.js";import"./monaco-editor-DYdw6m6P.js";import"./index-B8Idfh3P.js";import"./chat-context-BhPkOl45.js";import"./autosend-BX8nQnW3.js";import"./hooks-DsQUp7L9.js";import"./decopilot-sse-pool-B1izZBf2.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-CQmOOELp.js";import"./use-decopilot-events-Cww7ZCTK.js";import"./use-organization-settings-BFGZ9YuD.js";import"./index-emjsrsD0.js";import"./shell-layout-TAILJ-da.js";import"./alert-dialog-IVNf28U9.js";import"./required-auth-layout-BLRuxjNn.js";import"./use-org-sso-CpksLDM-.js";import"./integration-icon-D74EpYgv.js";import"./use-navigate-to-agent-DZwula5s.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-CRvFGO5O.js";import"./form-ZPjO3One.js";import"./input-DWv95vY4.js";const bt=new Set(["website/matchers/date.ts","$live/matchers/MatchDate.ts"]),yt=new Set(["website/matchers/multi.ts","$live/matchers/MatchMulti.ts"]),Tt=new Date(-864e13),vt=new Date(864e13),jt=/\/flags\/multivariate(?:\/[^/]+)?\.ts$/,Nt=/\/flags\/multivariate\.ts$/;function wt(e){let t=e;t.startsWith("pages-")&&(t=t.slice(6).replace(/-\d+$/,""));try{t=decodeURIComponent(t)}catch{}return t}function kt(e){if(!e||typeof e!="object")return null;const{start:t,end:r}=e,n=typeof t=="string",l=typeof r=="string";if(!n&&!l)return null;const o=n?new Date(t):Tt,m=l?new Date(r):vt;return Number.isNaN(o.getTime())||Number.isNaN(m.getTime())||n&&l&&m.getTime()<=o.getTime()?null:{start:o,end:m,openStart:!n,openEnd:!l}}function nt(e,t){if(!e||typeof e!="object")return;const r=e.__resolveType;if(typeof r=="string"){if(bt.has(r)){const n=kt(e);n&&t.push(n);return}if(yt.has(r)){const n=e.matchers;if(Array.isArray(n))for(const l of n)nt(l,t)}}}function _t(e){if(!e||typeof e!="object")return!1;const t=e.__resolveType;if(typeof t!="string"||!jt.test(t))return!1;const r=e.variants;return Array.isArray(r)}function Mt(e){if(typeof e=="string"){const a=e.trim();if(a.length===0)return null;try{const i=new URL(a).pathname.split("/").filter(Boolean),p=i[i.length-1];if(p)return decodeURIComponent(p)}catch{}return a.length>80?`${a.slice(0,77)}…`:a}if(!e||typeof e!="object")return null;const t=e,r=t.config,l=t.desktop?.media,o=[t.title,t.name,t.label,t.alt,r?.title,r?.name,r?.typeAlert?.message,l?.alt,Array.isArray(t.matcher)?t.matcher[0]:void 0];for(const a of o)if(typeof a=="string"&&a.trim().length>0)return a.trim();const m=t.__resolveType;if(typeof m=="string"){const c=(m.split("/").pop()??m).replace(/\.(tsx?|jsx?)$/i,"");if(c.length>0)return c}return null}function Et(e){const t=[];for(let r=0;r<e.length;r++){const n=e[r];typeof n=="number"?t.length>0?t[t.length-1]+=`[${n}]`:t.push(`[${n}]`):t.push(n)}return t.join(" · ")}function W(e,t,r,n,l){if(_t(e)){const o=e.variants,m=e.__resolveType,a=Nt.test(m)?"":Et(n);o.forEach((c,i)=>{if(!c||typeof c!="object")return;const p=c,d=[];if(nt(p.rule,d),d.length===0)return;const x=Mt(p.value)??(a||r);for(const h of d)l.push({blockKey:t,blockLabel:r,innerPath:a,variantIndex:i,start:h.start,end:h.end,openStart:h.openStart,openEnd:h.openEnd,label:x,flagResolveType:m})});for(let c=0;c<o.length;c++){const i=o[c];i&&typeof i=="object"&&W(i.value,t,r,[...n,"variants",c,"value"],l)}return}if(Array.isArray(e)){for(let o=0;o<e.length;o++)W(e[o],t,r,[...n,o],l);return}if(e&&typeof e=="object")for(const[o,m]of Object.entries(e))o!=="__resolveType"&&W(m,t,r,[...n,o],l)}function St(e){if(!e)return[];const t=[];for(const[r,n]of Object.entries(e))W(n,r,wt(r),[],t);return t.sort((r,n)=>r.start.getTime()-n.start.getTime())}function At(e){const t=[...new Set(e)].sort(),r=new Map;return t.forEach((n,l)=>{const o=l*137.508%360;r.set(n,{bg:`oklch(0.62 0.14 ${o})`,text:"white",border:`oklch(0.50 0.14 ${o})`})}),r}const Dt={bg:"oklch(0.62 0.14 0)",text:"white",border:"oklch(0.50 0.14 0)"};function ot(e,t){return e.get(t)??Dt}const $t=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],st=["January","February","March","April","May","June","July","August","September","October","November","December"],it=1440*60*1e3;function P(e){const t=new Date(e);return t.setHours(0,0,0,0),t}function at(e){return new Date(e.getFullYear(),e.getMonth(),1)}function F(e,t){return new Date(e.getFullYear(),e.getMonth()+t,1)}function z(e,t){const r=new Date(e);return r.setDate(r.getDate()+t),r}function K(e,t){return Math.round((P(e).getTime()-P(t).getTime())/it)}function Ct(e){const t=(e.getTime()-P(e).getTime())/it;return Math.min(Math.max(t,0),1)}function q(e,t){return K(e,t)+Ct(e)}function Rt(e){const t=z(e,-e.getDay()),r=[];for(let n=0;n<6;n++){const l=[];for(let o=0;o<7;o++)l.push(z(t,n*7+o));r.push(l)}for(;r.length>0&&r[r.length-1].every(n=>n.getMonth()!==e.getMonth());)r.pop();return r}function Lt(e,t){const r=P(e[0]),n=z(r,7),l=r.getTime(),o=n.getTime(),m=[];for(const i of t){const p=P(i.start),d=P(i.end);if(d.getTime()<r.getTime()||p.getTime()>=n.getTime())continue;const u=p.getTime()<r.getTime()?r:p,x=d.getTime()>=n.getTime()?z(n,-1):d,h=K(u,r),g=K(x,u)+1;if(g<=0)continue;const b=Math.max(i.start.getTime(),l),y=Math.min(i.end.getTime(),o),T=q(new Date(b),r),f=Math.max(q(new Date(y),r)-T,0);f<=0||m.push({variant:i,startCol:h,span:g,leftUnits:T,widthUnits:f})}m.sort((i,p)=>i.startCol-p.startCol||p.span-i.span||i.variant.blockKey.localeCompare(p.variant.blockKey));const a=[],c=[];for(const i of m){let p=a.findIndex(d=>d<=i.startCol);p===-1&&(p=a.length,a.push(0)),a[p]=i.startCol+i.span,c.push({...i,lane:p})}return c}const Q=new Intl.DateTimeFormat("en",{dateStyle:"medium",timeStyle:"short"});function Ot(e){const t=e.openStart?"Always":Q.format(e.start),r=e.openEnd?"Ongoing":Q.format(e.end);return`${t} → ${r}`}function Pt(e){const t=V.c(17),{variant:r}=e;let n;t[0]!==r.blockLabel?(n=s.jsx("div",{className:"font-semibold",children:r.blockLabel}),t[0]=r.blockLabel,t[1]=n):n=t[1];let l;t[2]!==r.innerPath?(l=r.innerPath&&s.jsx("div",{className:"text-muted-foreground",children:r.innerPath}),t[2]=r.innerPath,t[3]=l):l=t[3];let o;t[4]!==r.blockLabel||t[5]!==r.innerPath||t[6]!==r.label?(o=r.label!==r.blockLabel&&r.label!==r.innerPath&&s.jsx("div",{className:"text-muted-foreground",children:r.label}),t[4]=r.blockLabel,t[5]=r.innerPath,t[6]=r.label,t[7]=o):o=t[7];let m;t[8]!==r?(m=Ot(r),t[8]=r,t[9]=m):m=t[9];let a;t[10]!==m?(a=s.jsx("div",{className:"mt-1",children:m}),t[10]=m,t[11]=a):a=t[11];let c;return t[12]!==n||t[13]!==l||t[14]!==o||t[15]!==a?(c=s.jsx(gt,{children:s.jsxs("div",{className:"text-xs",children:[n,l,o,a]})}),t[12]=n,t[13]=l,t[14]=o,t[15]=a,t[16]=c):c=t[16],c}const X=16;function It(e,t){const r=e?"transparent":"#000 0",n=t?"transparent":"#000 100%";if(!(!e&&!t))return`linear-gradient(to right, ${r}, #000 ${X}px, #000 calc(100% - ${X}px), ${n})`}function lt(e){const t=V.c(26),{variant:r,color:n,style:l,children:o,fadeStart:m,fadeEnd:a}=e,c=m===void 0?!1:m,i=a===void 0?!1:a;let p;t[0]!==i||t[1]!==c?(p=It(c,i),t[0]=i,t[1]=c,t[2]=p):p=t[2];const d=p;let u;t[3]!==c?(u=c&&{borderTopLeftRadius:0,borderBottomLeftRadius:0},t[3]=c,t[4]=u):u=t[4];let x;t[5]!==i?(x=i&&{borderTopRightRadius:0,borderBottomRightRadius:0},t[5]=i,t[6]=x):x=t[6];let h;t[7]!==d?(h=d&&{maskImage:d,WebkitMaskImage:d},t[7]=d,t[8]=h):h=t[8];let g;t[9]!==n.bg||t[10]!==n.text||t[11]!==l||t[12]!==u||t[13]!==x||t[14]!==h?(g={background:n.bg,color:n.text,borderRadius:4,...u,...x,...h,...l},t[9]=n.bg,t[10]=n.text,t[11]=l,t[12]=u,t[13]=x,t[14]=h,t[15]=g):g=t[15];let b;t[16]!==o?(b=s.jsx("span",{className:"truncate",children:o}),t[16]=o,t[17]=b):b=t[17];let y;t[18]!==g||t[19]!==b?(y=s.jsx(ut,{asChild:!0,children:s.jsx("div",{className:"absolute flex items-center px-2 text-[11px] font-medium truncate cursor-default",style:g,children:b})}),t[18]=g,t[19]=b,t[20]=y):y=t[20];let T;t[21]!==r?(T=s.jsx(Pt,{variant:r}),t[21]=r,t[22]=T):T=t[22];let f;return t[23]!==T||t[24]!==y?(f=s.jsxs(ht,{children:[y,T]}),t[23]=T,t[24]=y,t[25]=f):f=t[25],f}function en(e){const t=V.c(49),{decofile:r}=e,[n,l]=U.useState("calendar"),[o,m]=U.useState(Bt),[a,c]=U.useState(!1);let i,p,d;if(t[0]!==r||t[1]!==a){const S=St(r);i=S.filter(Ht).length,d=a?S:S.filter(Vt),p=At(d.map(Ft)),t[0]=r,t[1]=a,t[2]=i,t[3]=p,t[4]=d}else i=t[2],p=t[3],d=t[4];const u=p;let x;t[5]===Symbol.for("react.memo_cache_sentinel")?(x=()=>m(at(new Date)),t[5]=x):x=t[5];const h=x;let g;t[6]!==n?(g=()=>m(S=>n==="calendar"?F(S,-1):F(S,-3)),t[6]=n,t[7]=g):g=t[7];const b=g;let y;t[8]!==n?(y=()=>m(S=>n==="calendar"?F(S,1):F(S,3)),t[8]=n,t[9]=y):y=t[9];const T=y;let f;t[10]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(Y,{variant:"outline",size:"sm",onClick:h,children:"Today"}),t[10]=f):f=t[10];let w;t[11]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(mt,{size:16}),t[11]=w):w=t[11];let k;t[12]!==b?(k=s.jsx(Y,{variant:"ghost",size:"icon",className:"size-8",onClick:b,"aria-label":"Previous",children:w}),t[12]=b,t[13]=k):k=t[13];let _;t[14]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(pt,{size:16}),t[14]=_):_=t[14];let M;t[15]!==T?(M=s.jsx(Y,{variant:"ghost",size:"icon",className:"size-8",onClick:T,"aria-label":"Next",children:_}),t[15]=T,t[16]=M):M=t[16];const A=st[o.getMonth()];let E;t[17]!==o?(E=o.getFullYear(),t[17]=o,t[18]=E):E=t[18];let v;t[19]!==A||t[20]!==E?(v=s.jsxs("h2",{className:"ml-2 text-base font-semibold",children:[A," ",E]}),t[19]=A,t[20]=E,t[21]=v):v=t[21];let j;t[22]!==v||t[23]!==k||t[24]!==M?(j=s.jsxs("div",{className:"flex items-center gap-2",children:[f,k,M,v]}),t[22]=v,t[23]=k,t[24]=M,t[25]=j):j=t[25];let D;t[26]!==i||t[27]!==a?(D=i>0&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ft,{id:"show-ongoing",checked:a,onCheckedChange:c}),s.jsxs(dt,{htmlFor:"show-ongoing",className:"text-xs text-muted-foreground cursor-pointer",children:["Show ongoing (",i,")"]})]}),t[26]=i,t[27]=a,t[28]=D):D=t[28];let L;t[29]===Symbol.for("react.memo_cache_sentinel")?(L={value:"calendar",icon:s.jsx(et,{}),label:"Calendar"},t[29]=L):L=t[29];let I;t[30]===Symbol.for("react.memo_cache_sentinel")?(I=[L,{value:"timeline",icon:s.jsx(ct,{}),label:"Timeline"}],t[30]=I):I=t[30];let N;t[31]!==n?(N=s.jsx(xt,{value:n,onValueChange:l,options:I}),t[31]=n,t[32]=N):N=t[32];let R;t[33]!==D||t[34]!==N?(R=s.jsxs("div",{className:"flex items-center gap-4",children:[D,N]}),t[33]=D,t[34]=N,t[35]=R):R=t[35];let $;t[36]!==j||t[37]!==R?($=s.jsxs("div",{className:"flex items-center justify-between px-4 h-12 border-b shrink-0",children:[j,R]}),t[36]=j,t[37]=R,t[38]=$):$=t[38];let C;t[39]!==u||t[40]!==o||t[41]!==i||t[42]!==a||t[43]!==d||t[44]!==n?(C=d.length===0?s.jsx(Wt,{hiddenOngoing:a?0:i}):n==="calendar"?s.jsx(Ut,{monthStart:o,variants:d,colorMap:u}):s.jsx(Jt,{monthStart:o,variants:d,colorMap:u}),t[39]=u,t[40]=o,t[41]=i,t[42]=a,t[43]=d,t[44]=n,t[45]=C):C=t[45];let O;return t[46]!==$||t[47]!==C?(O=s.jsxs("div",{className:"flex h-full w-full flex-col",children:[$,C]}),t[46]=$,t[47]=C,t[48]=O):O=t[48],O}function Ft(e){return e.blockKey}function Vt(e){return!e.openEnd}function Ht(e){return e.openEnd}function Bt(){return at(new Date)}function Wt(e){const t=V.c(3),{hiddenOngoing:r}=e,n=r===void 0?0:r;let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(et,{size:24,className:"text-muted-foreground/60"}),t[0]=l):l=t[0];let o;return t[1]!==n?(o=s.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-2 text-center text-sm text-muted-foreground p-6",children:[l,n>0?s.jsxs(s.Fragment,{children:[s.jsx("div",{children:"No dated variants in view."}),s.jsxs("div",{className:"text-xs text-muted-foreground/80",children:[n," ongoing"," ",n===1?"variant is":"variants are"," hidden — enable “Show ongoing” to view."]})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{children:"No scheduled variants."}),s.jsx("div",{className:"text-xs text-muted-foreground/80",children:"Variants gated by a date matcher appear here."})]})]}),t[1]=n,t[2]=o):o=t[2],o}const G=20,Z=2,tt=28,zt=6;function Ut(e){const t=V.c(17),{monthStart:r,variants:n,colorMap:l}=e;let o,m,a,c,i;if(t[0]!==l||t[1]!==r||t[2]!==n){const u=Rt(r),x=P(new Date);o=rt,i="flex-1 min-h-0",m="min-w-[840px]",t[8]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{className:"grid grid-cols-7 border-b text-xs text-muted-foreground sticky top-0 bg-background z-10",children:$t.map(Gt)}),t[8]=a):a=t[8],c=u.map((h,g)=>{const b=Lt(h,n),y=b.reduce(Yt,0),T=tt+y*(G+Z)+8;return s.jsxs("div",{className:"grid grid-cols-7 relative border-b",style:{height:T},children:[h.map((f,w)=>{const k=f.getMonth()===r.getMonth(),_=f.getTime()===x.getTime();return s.jsx("div",{className:J("border-r last:border-r-0 px-2 pt-1.5 text-xs",k?"bg-background":"bg-muted/30 text-muted-foreground"),children:s.jsx("span",{className:J("inline-flex h-5 min-w-5 items-center justify-center rounded-full px-1",_&&"bg-primary text-primary-foreground font-semibold"),children:f.getDate()})},w)}),b.map((f,w)=>{const k=ot(l,f.variant.blockKey),_=tt+f.lane*(G+Z),M=f.leftUnits/7*100,A=f.widthUnits/7*100,E=f.variant.openStart&&g===0,v=f.variant.openEnd&&g===u.length-1;return s.jsxs(lt,{variant:f.variant,color:k,fadeStart:E,fadeEnd:v,style:{top:_,left:`calc(${M}% + 2px)`,width:`calc(${A}% - 4px)`,minWidth:zt,height:G},children:[f.variant.blockLabel,f.variant.label!==f.variant.blockLabel&&s.jsxs("span",{className:"opacity-70",children:[" · ",f.variant.label]})]},`${g}-${w}`)})]},g)}),t[0]=l,t[1]=r,t[2]=n,t[3]=o,t[4]=m,t[5]=a,t[6]=c,t[7]=i}else o=t[3],m=t[4],a=t[5],c=t[6],i=t[7];let p;t[9]!==m||t[10]!==a||t[11]!==c?(p=s.jsxs("div",{className:m,children:[a,c]}),t[9]=m,t[10]=a,t[11]=c,t[12]=p):p=t[12];let d;return t[13]!==o||t[14]!==i||t[15]!==p?(d=s.jsx(o,{className:i,children:p}),t[13]=o,t[14]=i,t[15]=p,t[16]=d):d=t[16],d}function Yt(e,t){return Math.max(e,t.lane+1)}function Gt(e){return s.jsx("div",{className:"px-2 py-2 text-center uppercase tracking-wide",children:e},e)}const B=4,Kt=32,H=240;function Jt(e){const t=V.c(27),{monthStart:r,variants:n,colorMap:l}=e,o=r;let m,a,c,i,p,d;if(t[0]!==l||t[1]!==r||t[2]!==o||t[3]!==n){const h=F(r,B),g=new Date,b=new Map;for(const v of n){const j=b.get(v.blockKey)??[];j.push(v),b.set(v.blockKey,j)}const y=Array.from(b.entries()).sort(Xt),T=h.getTime()-o.getTime(),f=v=>(Math.max(o.getTime(),Math.min(h.getTime(),v.getTime()))-o.getTime())/T*100;let w;t[10]!==o?(w=(v,j)=>F(o,j),t[10]=o,t[11]=w):w=t[11];const k=Array.from({length:B},w),_=g.getTime()>=o.getTime()&&g.getTime()<=h.getTime()?f(g):null;m=rt,d="flex-1 min-h-0",a="min-w-[900px] relative";let M;t[12]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsx("div",{className:"shrink-0 px-3 py-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground border-r",style:{width:H},children:"Variant / Block"}),t[12]=M):M=t[12];let A;t[13]===Symbol.for("react.memo_cache_sentinel")?(A={gridTemplateColumns:`repeat(${B}, minmax(0, 1fr))`},t[13]=A):A=t[13];const E=k.map(Qt);t[14]!==E?(c=s.jsxs("div",{className:"flex border-b sticky top-0 bg-background z-10",children:[M,s.jsx("div",{className:"flex-1 grid",style:A,children:E})]}),t[14]=E,t[15]=c):c=t[15],t[16]!==_?(i=_!==null&&s.jsx("div",{className:"pointer-events-none absolute top-0 bottom-0 w-px bg-primary/70 z-[5]",style:{left:`calc(${H}px + (100% - ${H}px) * ${_} / 100)`},children:s.jsx("span",{className:"absolute -top-0.5 -translate-x-1/2 rounded-sm bg-primary px-1.5 py-px text-[10px] font-medium text-primary-foreground",children:"Today"})}),t[16]=_,t[17]=i):i=t[17],p=y.map(v=>{const[j,D]=v,L=ot(l,j),I=D[0]?.blockLabel??j;return s.jsxs("div",{children:[s.jsx("div",{className:"flex items-center bg-muted/40 border-b text-xs font-semibold uppercase tracking-wide text-muted-foreground",style:{height:28},children:s.jsx("div",{className:"px-3 truncate",style:{width:H},children:I})}),D.map((N,R)=>s.jsxs("div",{className:"flex border-b items-center",style:{height:Kt},children:[s.jsxs("div",{className:"flex items-center gap-2 px-3 text-sm border-r shrink-0",style:{width:H},children:[s.jsx("span",{className:"inline-block h-2 w-2 rounded-full shrink-0",style:{background:L.bg}}),s.jsx("span",{className:"truncate text-foreground/80",children:N.label})]}),s.jsxs("div",{className:"relative flex-1 h-full",children:[s.jsx("div",{className:"absolute inset-0 grid",style:{gridTemplateColumns:`repeat(${B}, minmax(0, 1fr))`},children:k.map(qt)}),(()=>{const $=Math.max(N.start.getTime(),o.getTime()),C=Math.min(N.end.getTime(),h.getTime());if(C<=$)return null;const O=f(new Date($)),S=f(new Date(C))-O;return s.jsx(lt,{variant:N,color:L,fadeStart:N.openStart,fadeEnd:N.openEnd,style:{top:"50%",transform:"translateY(-50%)",left:`${O}%`,width:`calc(${S}% - 2px)`,height:22},children:N.label})})()]})]},R))]},j)}),t[0]=l,t[1]=r,t[2]=o,t[3]=n,t[4]=m,t[5]=a,t[6]=c,t[7]=i,t[8]=p,t[9]=d}else m=t[4],a=t[5],c=t[6],i=t[7],p=t[8],d=t[9];let u;t[18]!==a||t[19]!==c||t[20]!==i||t[21]!==p?(u=s.jsxs("div",{className:a,children:[c,i,p]}),t[18]=a,t[19]=c,t[20]=i,t[21]=p,t[22]=u):u=t[22];let x;return t[23]!==m||t[24]!==d||t[25]!==u?(x=s.jsx(m,{className:d,children:u}),t[23]=m,t[24]=d,t[25]=u,t[26]=x):x=t[26],x}function qt(e,t){return s.jsx("div",{className:"border-r last:border-r-0 border-border/40"},t)}function Qt(e,t){return s.jsxs("div",{className:"px-2 py-2 text-xs uppercase tracking-wide text-muted-foreground border-r last:border-r-0",children:[st[e.getMonth()]?.slice(0,3)," ",e.getFullYear()]},t)}function Xt(e,t){return e[0].localeCompare(t[0])}export{en as VariantCalendar};
|