decocms 4.82.12 → 4.82.14
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-lFskF6YY.js → AlertCircle-DvPByT3s.js} +1 -1
- package/dist/client/assets/{AreaChart-CEQ7SfFQ.js → AreaChart-BtYig8Ye.js} +1 -1
- package/dist/client/assets/{ArrowUp-ygdMVrQH.js → ArrowUp-Dh74oxmM.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-D-YvHLwD.js → ArrowUpRight-DC6Yb9Jn.js} +1 -1
- package/dist/client/assets/{CheckCircle-8vSEu8DC.js → CheckCircle-Be2POQuF.js} +1 -1
- package/dist/client/assets/{ChevronDown-B1YuVRBJ.js → ChevronDown-BE7JvSpD.js} +1 -1
- package/dist/client/assets/{ChevronRight-BJB9_FhX.js → ChevronRight-4-DNv2jL.js} +1 -1
- package/dist/client/assets/ChevronUp-Bwx_DvAp.js +1 -0
- package/dist/client/assets/{Copy01-DEGDYVwN.js → Copy01-CaaZXEMR.js} +1 -1
- package/dist/client/assets/DotsVertical-hH1ie9LK.js +1 -0
- package/dist/client/assets/{Eye-DeQrUDT5.js → Eye-s3MCo34O.js} +1 -1
- package/dist/client/assets/{FilterLines-DjDwh0th.js → FilterLines-B8M_kRrg.js} +1 -1
- package/dist/client/assets/{Globe01-CT3--ij5.js → Globe01-BNvAFZ7t.js} +1 -1
- package/dist/client/assets/{Globe04-ChKR_KFt.js → Globe04-B8fLlHyp.js} +1 -1
- package/dist/client/assets/{HardDrive-BU215eSg.js → HardDrive-DDRUuRUd.js} +1 -1
- package/dist/client/assets/{Image01-CPXRt0hE.js → Image01-DxLV4xvs.js} +1 -1
- package/dist/client/assets/{Key01-BCu952rc.js → Key01-Cq8uChmI.js} +1 -1
- package/dist/client/assets/{LayoutLeft-CVRYZq32.js → LayoutLeft-riUBpORF.js} +1 -1
- package/dist/client/assets/{LinkExternal01-CdOt02SY.js → LinkExternal01-DU3CPyqq.js} +1 -1
- package/dist/client/assets/{Monitor01-BcfLMfxc.js → Monitor01-0ngeB4wd.js} +1 -1
- package/dist/client/assets/{Package-BL0jdV3W.js → Package-BrNfAbz_.js} +1 -1
- package/dist/client/assets/{Palette-CCdAyeGI.js → Palette-CtgW-PAY.js} +1 -1
- package/dist/client/assets/{Play-DGFyqrSw.js → Play-CdZJWvJx.js} +1 -1
- package/dist/client/assets/{Plus-By3V7_aY.js → Plus-Ca4hMAKt.js} +1 -1
- package/dist/client/assets/{SearchLg-WE6yBjyb.js → SearchLg-BGyV5Bz4.js} +1 -1
- package/dist/client/assets/{SearchMd-fYsPzheL.js → SearchMd-CFTyyPmA.js} +1 -1
- package/dist/client/assets/{Settings02-9vuwfVDi.js → Settings02-BIuCsH3l.js} +1 -1
- package/dist/client/assets/{Shield01-Cjl9SB9n.js → Shield01-DdJSxLoT.js} +1 -1
- package/dist/client/assets/{Star01-Dy0cf-WL.js → Star01-Dg6BZrlI.js} +1 -1
- package/dist/client/assets/{Stars01-yBNtNGKk.js → Stars01-wVvTShj4.js} +1 -1
- package/dist/client/assets/{Stars02-1ZRp_s0O.js → Stars02-BF8YOJhr.js} +1 -1
- package/dist/client/assets/{Sun-YaAUXtgz.js → Sun-Cd6pfpZ3.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-BIESqUhz.js → SwitchHorizontal01-T7cYMNoP.js} +1 -1
- package/dist/client/assets/{Tool01-Dy5hyOiW.js → Tool01-BDwVCBnM.js} +1 -1
- package/dist/client/assets/{Tool02-XJPr8Y_R.js → Tool02-DjIBln53.js} +1 -1
- package/dist/client/assets/{Trash01-B38J7mB_.js → Trash01-CxvmthNE.js} +1 -1
- package/dist/client/assets/TrendUp01-DdL0oR_B.js +1 -0
- package/dist/client/assets/{Upload01-C3Qt0frN.js → Upload01-w4HjmReL.js} +1 -1
- package/dist/client/assets/{User01-80dWa4Cm.js → User01-0Zd0134v.js} +1 -1
- package/dist/client/assets/{Users01-CmHqRWr9.js → Users01-j-t-q-sR.js} +1 -1
- package/dist/client/assets/{Users03-fvOQBJ4F.js → Users03-BpRSYTYN.js} +1 -1
- package/dist/client/assets/{X-Bhz5GImQ.js → X--0kJVtau.js} +1 -1
- package/dist/client/assets/{XCircle-BSeVixi7.js → XCircle-CWZBOndb.js} +1 -1
- package/dist/client/assets/{XClose-BVJ-MEjc.js → XClose-CFj_hbve.js} +1 -1
- package/dist/client/assets/{Zap-D-Ze3svs.js → Zap-BfGgAuT1.js} +1 -1
- package/dist/client/assets/{ZapSquare-CoYWWwWK.js → ZapSquare-CS1YImRf.js} +1 -1
- package/dist/client/assets/{ZoomOut-Viuq6Pl_.js → ZoomOut-DBunTdui.js} +1 -1
- package/dist/client/assets/{access-gate-CUbrXOy3.js → access-gate-C3Jf69ZD.js} +1 -1
- package/dist/client/assets/{add-section-modal-BC6Naxrw.js → add-section-modal-Ca2kfOel.js} +1 -1
- package/dist/client/assets/agent-icon-BdMdPyH8.js +1 -0
- package/dist/client/assets/agents-list-s5b3COYS.js +1 -0
- package/dist/client/assets/ai-providers-DAXq9GNP.js +1 -0
- package/dist/client/assets/{alert-dialog-CJpw8NP1.js → alert-dialog-BjP2s6Nc.js} +1 -1
- package/dist/client/assets/{alert-B8jwQOkd.js → alert-sYi6c8L0.js} +1 -1
- package/dist/client/assets/app-editor-lqTV057s.js +1 -0
- package/dist/client/assets/{auth-QfoVG72I.js → auth-DWUY37QO.js} +1 -1
- package/dist/client/assets/{auth-catchall-C7fj2moX.js → auth-catchall-4BdHIsfs.js} +1 -1
- package/dist/client/assets/{auth-entry-7B1H1wVA.js → auth-entry-CbO-WTGZ.js} +1 -1
- package/dist/client/assets/{auth-split-layout-CRZG0msy.js → auth-split-layout-Cunbbv7Y.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-D-sBYsRy.js → authenticate-and-persist-oauth-tVxGkZPI.js} +1 -1
- package/dist/client/assets/{automation-list-row-DyujL0A9.js → automation-list-row-Bx2czjnJ.js} +1 -1
- package/dist/client/assets/automation-runs-CvOQZBIo.js +87 -0
- package/dist/client/assets/automations-ZGK89zV_.js +1 -0
- package/dist/client/assets/{autosend-BUw740M6.js → autosend-BLRimjZ_.js} +1 -1
- package/dist/client/assets/{avatar-D5c6HQA-.js → avatar-BVfPlbpm.js} +1 -1
- package/dist/client/assets/{badge-Cq-ZVkxw.js → badge-DNxr1fi7.js} +1 -1
- package/dist/client/assets/{block-document-Cb6JPZ7O.js → block-document-z1ZnryZ2.js} +2 -2
- package/dist/client/assets/{brand-context-OfY65fzl.js → brand-context-CLHvlJV7.js} +1 -1
- package/dist/client/assets/buckets-BTIuBcJT.js +1 -0
- package/dist/client/assets/bulk-category-panel-BgK98tsF.js +1 -0
- package/dist/client/assets/calendar-VVDY0smi.js +102 -0
- package/dist/client/assets/{capability-load-error-B419nly_.js → capability-load-error-2OJTaAO-.js} +1 -1
- package/dist/client/assets/{card-BwSLlExQ.js → card-CRilZAuB.js} +1 -1
- package/dist/client/assets/category-editor-D_whkLw0.js +1 -0
- package/dist/client/assets/{chat-context-D4QrlA70.js → chat-context-BI8_Nmou.js} +13 -11
- package/dist/client/assets/checkbox-CcBhppQn.js +1 -0
- package/dist/client/assets/{cli-auth-success-piIWwo9X.js → cli-auth-success-DEIP-V25.js} +1 -1
- package/dist/client/assets/collection-detail-1c1ACTcR.js +1 -0
- package/dist/client/assets/collection-display-button-DXJEmTV8.js +1 -0
- package/dist/client/assets/{collection-search-D-f_rjVH.js → collection-search-COKgSE9f.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-oGhY7uPR.js → collection-table-wrapper-Bkw9b8hk.js} +1 -1
- package/dist/client/assets/{collection-tabs-JWPRYdFI.js → collection-tabs-ttDF8X2o.js} +1 -1
- package/dist/client/assets/{command-DhR1pFgj.js → command-vkOcTid-.js} +1 -1
- package/dist/client/assets/commerce-onboarding-bjzg6F_h.js +1 -0
- package/dist/client/assets/{companions-core-nxOBF2bU.js → companions-core-B9YYDQ4A.js} +1 -1
- package/dist/client/assets/connect-desktop-dialog-D7YkwfUU.js +1 -0
- package/dist/client/assets/{connection-card-B8wGpyDx.js → connection-card-DU81gKdu.js} +1 -1
- package/dist/client/assets/connection-detail-DABVCpPE.js +1 -0
- package/dist/client/assets/{connection-form-helpers-Bpz9M-Z0.js → connection-form-helpers-Dyl58fX0.js} +1 -1
- package/dist/client/assets/connections-bXxskjsO.js +1 -0
- package/dist/client/assets/{decopilot-sse-pool-pQTikeGF.js → decopilot-sse-pool-B7Q1Pjne.js} +1 -1
- package/dist/client/assets/{dialog-CSPNf1M2.js → dialog-B1V0iUXV.js} +1 -1
- package/dist/client/assets/{domain-settings-DzMUWaKc.js → domain-settings-B1ZyfdYW.js} +1 -1
- package/dist/client/assets/{drawer-DRDSpHGN.js → drawer-9Bvsh1k7.js} +1 -1
- package/dist/client/assets/dropdown-menu-Bel6DI3v.js +1 -0
- package/dist/client/assets/{empty-state-C9ZZeV5U.js → empty-state-BHQtYUSO.js} +1 -1
- package/dist/client/assets/{extract-connection-data-NqYjy1W6.js → extract-connection-data-BZuABMOr.js} +1 -1
- package/dist/client/assets/file-explorer-PgVeGy2E.js +2 -0
- package/dist/client/assets/{file-type-icon-Dw0tI5nk.js → file-type-icon-CGkU8X5K.js} +1 -1
- package/dist/client/assets/{files-BHQLcfGJ.js → files-DZ3SJjR-.js} +1 -1
- package/dist/client/assets/{form-DZWEEJcU.js → form-C9jBxN8G.js} +1 -1
- package/dist/client/assets/general-CuHItqTO.js +1 -0
- package/dist/client/assets/{github-repo-picker-B0mUI5QG.js → github-repo-picker-DPwCOiEB.js} +1 -1
- package/dist/client/assets/{hooks-Cruglddo.js → hooks-DtDviOax.js} +1 -1
- package/dist/client/assets/index-B3GkLwEh.js +2 -0
- package/dist/client/assets/{index-DiHEyi6k.js → index-BRH7yHcF.js} +1 -1
- package/dist/client/assets/{index-C9GQcuKY.js → index-BcgykEG5.js} +1 -1
- package/dist/client/assets/{index-CfNxgwf7.js → index-CHJYXQSS.js} +1 -1
- package/dist/client/assets/{index-CcnDuzQF.js → index-CMuj1duV.js} +3 -3
- package/dist/client/assets/{index-D3KBvlZc.js → index-Clopj9KU.js} +1 -1
- package/dist/client/assets/{index-DSYxxNrJ.js → index-CwggL_PJ.js} +1 -1
- package/dist/client/assets/{index-CJEtdv0a.js → index-DVJqB6A6.js} +1 -1
- package/dist/client/assets/{index-CibvydUy.js → index-Df10o6gn.js} +3 -3
- package/dist/client/assets/index-Dj5WILcq.css +1 -0
- package/dist/client/assets/{index-itkS_lok.js → index-Dp8SB-ud.js} +29 -29
- package/dist/client/assets/index-DxeK__BQ.js +1 -0
- package/dist/client/assets/{index-B5kPsZvB.js → index-gAU-Arvb.js} +4 -4
- package/dist/client/assets/{index-SICUCD_4.js → index-jm5YycYM.js} +1 -1
- package/dist/client/assets/{index-redirect-B1LDuNZO.js → index-redirect-CecfnhiM.js} +1 -1
- package/dist/client/assets/{index-mgOD8SuS.js → index-z2UBv_6H.js} +1 -1
- package/dist/client/assets/{input-C9C08vUS.js → input-qdMTAJH4.js} +1 -1
- package/dist/client/assets/{integration-icon-CgQTPrq8.js → integration-icon-ByqyfRpT.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-QD3qgyv2.js → invite-member-dialog-cnQXBieX.js} +1 -1
- package/dist/client/assets/{label-CXarTOxH.js → label-CnEhHuVP.js} +1 -1
- package/dist/client/assets/{layout-M9Hpr15h.js → layout-ofNqb8rV.js} +1 -1
- package/dist/client/assets/{login-51wkaP9S.js → login-knndhvVF.js} +1 -1
- package/dist/client/assets/{mcp-oauth-qMEpITxW.js → mcp-oauth-CAUkOKji.js} +1 -1
- package/dist/client/assets/members-Bb6cqv3N.js +1 -0
- package/dist/client/assets/{monaco-editor-GgZXnppw.js → monaco-editor-4EWxCivt.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-CJkCOxCR.js → monitoring-stats-row-CYRhMPF6.js} +1 -1
- package/dist/client/assets/{multi-select-CRMh3RVw.js → multi-select-DGg7VcY7.js} +1 -1
- package/dist/client/assets/{oauth-callback-ZsvogHg4.js → oauth-callback-Txh_HZU1.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-Vgofjjek.js → oauth-callback-ai-provider-gZcF7GFt.js} +1 -1
- package/dist/client/assets/{onboarding-BySYrc0L.js → onboarding-BNd98v9F.js} +1 -1
- package/dist/client/assets/{org-install-LZAIdgyh.js → org-install-s29fSk6T.js} +1 -1
- package/dist/client/assets/{org-layout-BRWWUIEc.js → org-layout-pC6WuH2d.js} +1 -1
- package/dist/client/assets/{organization-choice-B4uceYON.js → organization-choice-Cvpg9cyR.js} +1 -1
- package/dist/client/assets/orgs-BH4zqSW4.js +1 -0
- package/dist/client/assets/{page-seo-form-8TDfaInh.js → page-seo-form-DpJbL5qC.js} +1 -1
- package/dist/client/assets/page-seo-sheet-BViE3vmf.js +1 -0
- package/dist/client/assets/{popover-ChNVRGUA.js → popover-BXXrlEXA.js} +1 -1
- package/dist/client/assets/post-editor-DgVq5HAq.js +1 -0
- package/dist/client/assets/{primitives-6DngFEjS.js → primitives-C0YiE9Dl.js} +1 -1
- package/dist/client/assets/profile-CdQoqyRv.js +1 -0
- package/dist/client/assets/project-app-view-DORLMZaj.js +1 -0
- package/dist/client/assets/record-editor-D2PAFmR-.js +1 -0
- package/dist/client/assets/redirect-editor-ClaSMwyP.js +1 -0
- package/dist/client/assets/registry-DqKNpXHC.js +2 -0
- package/dist/client/assets/{registry-layout-6DaHeWLa.js → registry-layout-CFETb4kQ.js} +2 -2
- package/dist/client/assets/{reports-Bjrcy4vK.js → reports-Bd4Konjf.js} +2 -2
- package/dist/client/assets/{require-capability-3UqoOdNg.js → require-capability-D0uXhAfv.js} +1 -1
- package/dist/client/assets/{required-auth-layout-Ct9RjuO1.js → required-auth-layout-uUQ9Dfyr.js} +1 -1
- package/dist/client/assets/{reset-password-CT1vcdNv.js → reset-password-InhP_QJS.js} +1 -1
- package/dist/client/assets/roles-C8MjshKP.js +1 -0
- package/dist/client/assets/{search-input-BNLePuM-.js → search-input-Bhg65axQ.js} +1 -1
- package/dist/client/assets/secrets-CoTCTnY9.js +1 -0
- package/dist/client/assets/sections-editor-P9NnL9uS.js +2 -0
- package/dist/client/assets/select-Bhj7LCuD.js +1 -0
- package/dist/client/assets/{select-model-ClAJFfDX.js → select-model-BkLoUhWB.js} +1 -1
- package/dist/client/assets/self-tool-result-DdS1heyV.js +1 -0
- package/dist/client/assets/seo-editor-5nf9jCaQ.js +1 -0
- package/dist/client/assets/{settings-layout-DUaSpFxQ.js → settings-layout-Ct-vBxnm.js} +1 -1
- package/dist/client/assets/{settings-section-FaO6W2dI.js → settings-section-D-A3Bfgf.js} +1 -1
- package/dist/client/assets/{shell-controls-Ak1EXHTc.js → shell-controls-DCy9Peje.js} +1 -1
- package/dist/client/assets/{shell-layout-BdhBs9fD.js → shell-layout-DDCV5qM0.js} +1 -1
- package/dist/client/assets/{sidebar-QaWFVWqc.js → sidebar-DeWKCtxp.js} +1 -1
- package/dist/client/assets/{skeleton-BihPrDsJ.js → skeleton-BbGF1H7-.js} +1 -1
- package/dist/client/assets/sso-D7TxlrMn.js +1 -0
- package/dist/client/assets/{store-BTbwPFt3.js → store-0pluQIHD.js} +1 -1
- package/dist/client/assets/store-registry-CO9GrEkA.js +2 -0
- package/dist/client/assets/{studio-tools-CenRUFIk.js → studio-tools-CE7lpCkl.js} +1 -1
- package/dist/client/assets/{switch-RPHbuzW8.js → switch-BNLG1jmU.js} +1 -1
- package/dist/client/assets/{table-BqgRZyFk.js → table-ByQcTCqP.js} +1 -1
- package/dist/client/assets/{tabs-BXBrXjFm.js → tabs-CXMTix3U.js} +1 -1
- package/dist/client/assets/{textarea-CeAKw7uR.js → textarea-BPWk2Ywn.js} +1 -1
- package/dist/client/assets/{toggle-group-wS8Ypese.js → toggle-group-DPBmxHrX.js} +1 -1
- package/dist/client/assets/{toolbar-2t2LWIlp.js → toolbar-CpK88Wot.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-D0GDL8yO.js → toolbar-icon-button--NaDqMEF.js} +1 -1
- package/dist/client/assets/{tooltip-2I_b-6X7.js → tooltip-B8wnTm17.js} +1 -1
- package/dist/client/assets/{use-ai-providers-BfZ-rcXF.js → use-ai-providers-BO2D28v4.js} +1 -1
- package/dist/client/assets/{use-automations-fHz136Fu.js → use-automations-CvhBPwX5.js} +1 -1
- package/dist/client/assets/{use-autosave-D6GeRajc.js → use-autosave-DUdpa8zB.js} +1 -1
- package/dist/client/assets/{use-capability-BF6nPm2s.js → use-capability-B2zRKwHf.js} +1 -1
- package/dist/client/assets/use-clock-tick-BfNa5AcO.js +1 -0
- package/dist/client/assets/{use-collections-XYRpJlwJ.js → use-collections-tP6FM68N.js} +1 -1
- package/dist/client/assets/{use-connection-W4m2UAAR.js → use-connection-Bubfkk8k.js} +1 -1
- package/dist/client/assets/{use-copy-D1NDEQwd.js → use-copy-3Mpuxl0p.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-D02EVrEb.js → use-create-virtual-mcp-BhfqxX9Z.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-BeR_XDOQ.js → use-debounced-autosave-B1u8xEPK.js} +1 -1
- package/dist/client/assets/{use-debounced-value-DdzAq6K1.js → use-debounced-value-ToigCZRD.js} +1 -1
- package/dist/client/assets/use-deco-credits-We_pqPUY.js +1 -0
- package/dist/client/assets/{use-decopilot-events-CXPYfBME.js → use-decopilot-events-DDSe_K7D.js} +1 -1
- package/dist/client/assets/{use-delete-connection-DVTGZR2K.js → use-delete-connection-veOzeP_-.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-CBOsP6fA.js → use-deployment-admin-uwYQkYfr.js} +1 -1
- package/dist/client/assets/{use-file-configs-BtGcN1Ob.js → use-file-configs-DxQ_uwCG.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-xSLFTpsv.js → use-infinite-scroll-0uWHf52y.js} +1 -1
- package/dist/client/assets/{use-join-requests-BQitIGPN.js → use-join-requests-FGCBDSYD.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-C424940c.js → use-mcp-auth-status-CFgkpOhb.js} +1 -1
- package/dist/client/assets/{use-mcp-client-DNLhxapG.js → use-mcp-client-D2BCR1MH.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-BToM4-zh.js → use-mcp-tools-DadUkegG.js} +1 -1
- package/dist/client/assets/{use-members-MzPIs59g.js → use-members-X6Ssb-cK.js} +1 -1
- package/dist/client/assets/{use-mobile-BBzH2hXY.js → use-mobile-Cd6_A-wv.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-B0FPvEI2.js → use-navigate-to-agent-rb-KJLb8.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-8TBxSh-W.js → use-org-auth-client-Bw3VIyYp.js} +1 -1
- package/dist/client/assets/{use-org-sso-CEo2DhxC.js → use-org-sso-DBoYR181.js} +1 -1
- package/dist/client/assets/{use-organization-roles-BgF0Y7mR.js → use-organization-roles-B2nz6Y2V.js} +1 -1
- package/dist/client/assets/{use-organization-settings-Bd9PTvWZ.js → use-organization-settings-B7BUH-ed.js} +1 -1
- package/dist/client/assets/{use-registry-app-BTOjr2tZ.js → use-registry-app-DnzAi61_.js} +1 -1
- package/dist/client/assets/{use-registry-connections-Dht86cFk.js → use-registry-connections-dW2A6Cn6.js} +1 -1
- package/dist/client/assets/{use-secrets-ClB5h_LI.js → use-secrets-BDm4jx5-.js} +1 -1
- package/dist/client/assets/{use-status-sounds-3EdF-Lof.js → use-status-sounds-Bf8VuMQs.js} +1 -1
- package/dist/client/assets/{use-view-mode-CLbJOwJV.js → use-view-mode-Rpx9lr2S.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-D0buNzsY.js → use-virtual-mcp-BIj51zng.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-B2tGgvl5.js +1 -0
- package/dist/client/assets/{useRouterState-BqzjXFwT.js → useRouterState-DPwhq9G0.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BYVVsI1f.js +1 -0
- package/dist/client/assets/{users-C6P3G4Ft.js → users-DAp0zXfL.js} +1 -1
- package/dist/client/assets/variant-calendar-ByIjiAPe.js +1 -0
- package/dist/client/assets/{view-mode-toggle-CegDtWkk.js → view-mode-toggle-BbtMRSS5.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/Check-BH0H5-aR.js +0 -1
- package/dist/client/assets/ChevronUp-DGgV5Zh7.js +0 -1
- package/dist/client/assets/Circle-2BJQT-zG.js +0 -1
- package/dist/client/assets/DotsVertical-DlHU-amx.js +0 -1
- package/dist/client/assets/Flag01-BwPR9oyI.js +0 -1
- package/dist/client/assets/List-yL6XInvz.js +0 -1
- package/dist/client/assets/TrendUp01-Dr8DqK3L.js +0 -1
- package/dist/client/assets/UserPlus01-CqBsiM1H.js +0 -1
- package/dist/client/assets/agent-icon-CwIj7ip2.js +0 -1
- package/dist/client/assets/agents-list-C6Gx-99L.js +0 -1
- package/dist/client/assets/ai-providers-Bu9T0GHQ.js +0 -1
- package/dist/client/assets/app-editor-gyj2l8-T.js +0 -1
- package/dist/client/assets/automation-runs-CkDldPBm.js +0 -188
- package/dist/client/assets/automations-ClJbkf52.js +0 -1
- package/dist/client/assets/buckets-DT062urL.js +0 -1
- package/dist/client/assets/bulk-category-panel-B5Uj4kcA.js +0 -1
- package/dist/client/assets/calendar-DYgC6cUR.js +0 -1
- package/dist/client/assets/category-editor-Bw6sl3yA.js +0 -1
- package/dist/client/assets/checkbox-UrgW9h_w.js +0 -1
- package/dist/client/assets/collection-detail-BvC1S61F.js +0 -1
- package/dist/client/assets/collection-display-button-C8bwkr7u.js +0 -1
- package/dist/client/assets/commerce-onboarding-Br84LbEt.js +0 -1
- package/dist/client/assets/connect-desktop-dialog-DzsxaBBr.js +0 -1
- package/dist/client/assets/connection-detail-DQll5PtB.js +0 -1
- package/dist/client/assets/connections-gi0LZmKy.js +0 -1
- package/dist/client/assets/dropdown-menu-Dm6yHfCA.js +0 -1
- package/dist/client/assets/file-explorer-ChW8LmTd.js +0 -2
- package/dist/client/assets/general-CUnQsEqw.js +0 -1
- package/dist/client/assets/index-BahxSVn6.js +0 -1
- package/dist/client/assets/index-CWbQSt4G.js +0 -4
- package/dist/client/assets/index-DpLPq5a_.css +0 -1
- package/dist/client/assets/members-UAmZRteC.js +0 -1
- package/dist/client/assets/orgs-C1bct_UJ.js +0 -1
- package/dist/client/assets/page-seo-sheet-CLDiiWiE.js +0 -1
- package/dist/client/assets/post-editor-DYr-WHbv.js +0 -1
- package/dist/client/assets/profile-BLFbeHRX.js +0 -1
- package/dist/client/assets/project-app-view-BX2s5PfE.js +0 -1
- package/dist/client/assets/record-editor-Di6d3JmV.js +0 -1
- package/dist/client/assets/redirect-editor-Dbg9Pfi2.js +0 -1
- package/dist/client/assets/registry-DKWNk3NO.js +0 -2
- package/dist/client/assets/roles-U0VSD77O.js +0 -1
- package/dist/client/assets/secrets-BFrGqdMF.js +0 -1
- package/dist/client/assets/sections-editor-CiMH53nx.js +0 -2
- package/dist/client/assets/select-BlgNnINX.js +0 -1
- package/dist/client/assets/self-tool-result-DTGVgWPr.js +0 -1
- package/dist/client/assets/seo-editor-D1TefRfo.js +0 -1
- package/dist/client/assets/sso-37XoctE1.js +0 -1
- package/dist/client/assets/store-registry-t1FZ1iXa.js +0 -2
- package/dist/client/assets/use-clock-tick-DxUHNNfQ.js +0 -1
- package/dist/client/assets/use-deco-credits-B_UNdLb6.js +0 -1
- package/dist/client/assets/useInfiniteQuery-Dvpyv_Ki.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CYG1CE5G.js +0 -1
- package/dist/client/assets/variant-calendar-uvKCgD7E.js +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as He,r as w,l as Ee,j as n,B as We,i as Hn,n as Ss,t as G,K as xs}from"./index-CcnDuzQF.js";import{X as bs,Y as ys,Z as _s,K as Un,L as zt,M as Gn,P as Wn,i as qn,_ as js,F as Yn,H as Jn,$ as ks,G as ws,a0 as Rs,N as Qn,O as Rt,T as Xn,U as Zn,Q as ea,R as ta,a1 as na,a2 as Ns,a3 as Nt,a4 as Ds,S as aa,a5 as tt,a6 as Cs,a7 as Vs,a8 as Ts,e as Ps,k as As,a9 as Ms,aa as Es,ab as Ks,ac as $s,r as Ot,ad as Bt,ae as Os,af as ut,ag as jt,ah as Bs,ai as Ls,aj as Je,ak as Vn,al as Fs,am as Tn,an as kt,ao as Lt,ap as Is,aq as sn,ar as zs,as as xt,at as Hs,au as Us,av as Gs,aw as Ws,ax as qs,ay as dt,az as Ys,aA as Js,aB as Qs,aC as Pn,aD as wt,m as Xs,aE as Zs,aF as er,aG as tr,aH as nr,aI as rn,aJ as An,aK as Mn,aL as bt,aM as Ft,aN as En,aO as ar,aP as sr,aQ as on,aR as rr,aS as or,aT as Kn,aU as ir}from"./index-itkS_lok.js";import{t as lr}from"./ChevronDown-B1YuVRBJ.js";import{b as sa,n as ra}from"./UserPlus01-CqBsiM1H.js";import{i as oa}from"./ChevronRight-BJB9_FhX.js";import{n as cr}from"./ChevronUp-DGgV5Zh7.js";import{R as cn,x as ur,S as dr,T as mr}from"./agent-icon-CwIj7ip2.js";import{i as fr}from"./Globe01-CT3--ij5.js";import{A as It}from"./automation-runs-CkDldPBm.js";import{b as mt,T as ft,a as pt}from"./tooltip-2I_b-6X7.js";import{a as pr,D as hr,h as gr,c as vr,d as Sr,e as xr}from"./dialog-CSPNf1M2.js";import{I as br}from"./input-C9C08vUS.js";import{a as ia}from"./Copy01-DEGDYVwN.js";import{b as yr}from"./ZoomOut-Viuq6Pl_.js";import{i as _r}from"./Settings02-9vuwfVDi.js";import{s as jr}from"./Eye-DeQrUDT5.js";import{s as la}from"./Flag01-BwPR9oyI.js";import{s as un}from"./Plus-By3V7_aY.js";import{s as ca}from"./Trash01-B38J7mB_.js";import{i as kr}from"./Zap-D-Ze3svs.js";import{d as it,a as ua,D as da,c as ma,j as wr}from"./dropdown-menu-Dm6yHfCA.js";import{S as Rr,r as $n,a as Nr,d as Dr,b as Cr,i as Vr,f as Tr,P as Pr,c as Ar}from"./page-seo-form-8TDfaInh.js";import{b as Mr}from"./Tool01-Dy5hyOiW.js";import{A as Er}from"./add-section-modal-BC6Naxrw.js";import"./ArrowUp-ygdMVrQH.js";import"./chat-context-D4QrlA70.js";import"./autosend-BUw740M6.js";import"./hooks-Cruglddo.js";import"./use-mcp-client-DNLhxapG.js";import"./constants-BHDe7bIw.js";import"./auth-QfoVG72I.js";import"./decopilot-sse-pool-pQTikeGF.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./studio-tools-CenRUFIk.js";import"./use-virtual-mcp-D0buNzsY.js";import"./use-collections-XYRpJlwJ.js";import"./use-ai-providers-BfZ-rcXF.js";import"./location-BpLtHjTZ.js";import"./tab-id-BijBBRwE.js";import"./use-decopilot-events-CXPYfBME.js";import"./use-organization-settings-Bd9PTvWZ.js";import"./drawer-DRDSpHGN.js";import"./collection-search-D-f_rjVH.js";import"./SearchMd-fYsPzheL.js";import"./use-mobile-BBzH2hXY.js";import"./AreaChart-CEQ7SfFQ.js";import"./index-SICUCD_4.js";import"./X-Bhz5GImQ.js";import"./shell-layout-BdhBs9fD.js";import"./avatar-D5c6HQA-.js";import"./User01-80dWa4Cm.js";import"./Users03-fvOQBJ4F.js";import"./SearchLg-WE6yBjyb.js";import"./Stars02-1ZRp_s0O.js";import"./XClose-BVJ-MEjc.js";import"./CheckCircle-8vSEu8DC.js";import"./FilterLines-DjDwh0th.js";import"./required-auth-layout-Ct9RjuO1.js";import"./use-org-sso-CEo2DhxC.js";import"./ZapSquare-CoYWWwWK.js";import"./Check-BH0H5-aR.js";import"./Star01-Dy0cf-WL.js";import"./Image01-CPXRt0hE.js";import"./Upload01-C3Qt0frN.js";import"./AlertCircle-lFskF6YY.js";import"./form-DZWEEJcU.js";import"./label-CXarTOxH.js";import"./select-BlgNnINX.js";import"./XCircle-BSeVixi7.js";import"./tabs-BXBrXjFm.js";import"./Tool02-XJPr8Y_R.js";import"./toggle-group-wS8Ypese.js";import"./use-deco-credits-B_UNdLb6.js";import"./extract-connection-data-NqYjy1W6.js";import"./connection-card-B8wGpyDx.js";import"./use-registry-connections-Dht86cFk.js";import"./use-connection-W4m2UAAR.js";import"./useInfiniteQuery-Dvpyv_Ki.js";import"./use-infinite-scroll-xSLFTpsv.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./card-BwSLlExQ.js";import"./integration-icon-CgQTPrq8.js";import"./textarea-CeAKw7uR.js";import"./connection-form-helpers-Bpz9M-Z0.js";import"./authenticate-and-persist-oauth-D-sBYsRy.js";import"./mcp-oauth-qMEpITxW.js";import"./collection-tabs-JWPRYdFI.js";import"./badge-Cq-ZVkxw.js";import"./useSuspenseInfiniteQuery-CYG1CE5G.js";import"./Monitor01-BcfLMfxc.js";import"./connect-desktop-dialog-DzsxaBBr.js";import"./select-model-ClAJFfDX.js";import"./checkbox-UrgW9h_w.js";import"./skeleton-BihPrDsJ.js";import"./Key01-BCu952rc.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-FaO6W2dI.js";import"./ArrowUpRight-D-YvHLwD.js";import"./Stars01-yBNtNGKk.js";import"./command-DhR1pFgj.js";import"./index-DSYxxNrJ.js";import"./popover-ChNVRGUA.js";import"./index-B5kPsZvB.js";import"./Palette-CCdAyeGI.js";import"./alert-dialog-CJpw8NP1.js";import"./file-type-icon-Dw0tI5nk.js";import"./toolbar-2t2LWIlp.js";import"./Package-BL0jdV3W.js";import"./use-debounced-value-DdzAq6K1.js";import"./LinkExternal01-CdOt02SY.js";import"./index-DiHEyi6k.js";import"./LayoutLeft-CVRYZq32.js";import"./DotsVertical-DlHU-amx.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-3EdF-Lof.js";import"./empty-state-C9ZZeV5U.js";import"./use-mcp-tools-BToM4-zh.js";import"./use-capability-BF6nPm2s.js";import"./toolbar-icon-button-D0GDL8yO.js";import"./Play-DGFyqrSw.js";import"./use-debounced-autosave-BeR_XDOQ.js";import"./index-CJEtdv0a.js";import"./sidebar-QaWFVWqc.js";import"./search-input-BNLePuM-.js";import"./use-mcp-auth-status-C424940c.js";import"./switch-RPHbuzW8.js";import"./use-registry-app-BTOjr2tZ.js";import"./github-repo-picker-B0mUI5QG.js";import"./use-navigate-to-agent-B0FPvEI2.js";import"./reusable-new-chat-CouMjkYR.js";import"./provision-repo-scoped-github-connection-2iDn-wQ1.js";import"./github-repo-scope-DjMZbiKa.js";import"./Users01-CmHqRWr9.js";import"./use-secrets-ClB5h_LI.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./companions-core-nxOBF2bU.js";import"./format-time-BnbuEtat.js";import"./TrendUp01-Dr8DqK3L.js";import"./index-CWbQSt4G.js";import"./get-initials-D-f_fDFw.js";import"./List-yL6XInvz.js";import"./use-members-MzPIs59g.js";import"./use-org-auth-client-8TBxSh-W.js";import"./Circle-2BJQT-zG.js";import"./calendar-DYgC6cUR.js";import"./use-copy-D1NDEQwd.js";import"./SwitchHorizontal01-BIESqUhz.js";import"./monaco-editor-GgZXnppw.js";import"./use-file-configs-BtGcN1Ob.js";import"./use-automations-fHz136Fu.js";import"./automation-list-row-DyujL0A9.js";import"./Globe04-ChKR_KFt.js";import"./HardDrive-BU215eSg.js";import"./Sun-YaAUXtgz.js";import"./Shield01-Cjl9SB9n.js";import"./table-BqgRZyFk.js";import"./use-clock-tick-DxUHNNfQ.js";function Kr(m){return m.schema?.definitions??m.schema?.$defs??{}}function $r(m,e){const r=Kr(e),c=r[btoa(m)];if(!c)return;let d=typeof c.image=="string"?c.image:void 0;if(!d&&Array.isArray(c.allOf)){const h=c.allOf.find(S=>typeof S.$ref=="string")?.$ref;if(typeof h=="string"){const S=h.replace("#/definitions/",""),p=r[S];d=typeof p?.image=="string"?p.image:void 0}}if(d?.includes("{{{"))return d}function Or(m,e){if(!e)return;const r=bs(m);if(!r)return;const c=$r(r.resolveType,e);if(!c)return;const d=ys(c,r.data);if(d)return _s(d)}const Br="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",Lr="text-global-section-fg focus:bg-global-section/12 focus:text-global-section-fg dark:text-global-section-fg-dark dark:focus:bg-global-section/15 dark:focus:text-global-section-fg-dark [&_svg]:!text-global-section";function On(m){return Array.from({length:m},(e,r)=>({id:crypto.randomUUID(),index:r}))}function fa(m){return m.map((e,r)=>({...e,index:r}))}function Fr(m,e){if(e===m.length)return m;if(e<m.length)return fa(m.slice(0,e));const r=Array.from({length:e-m.length},(c,d)=>({id:crypto.randomUUID(),index:m.length+d}));return[...m,...r]}function pa(m){const e=He.c(20),{section:r,raw:c,meta:d}=m,h=r.isSavedBlock===!0,S=r.isMultivariate===!0;let p;e[0]!==d||e[1]!==c?(p=c&&d?Or(c,d):void 0,e[0]=d,e[1]=c,e[2]=p):p=e[2];const v=p;let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(yr,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[3]=g):g=e[3];let y;e[4]!==v?(y=v&&n.jsx("img",{src:v,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[4]=v,e[5]=y):y=e[5];let V;e[6]!==S||e[7]!==h?(V=h?{color:ws}:S?{color:"oklch(0.65 0.15 160)"}:void 0,e[6]=S,e[7]=h,e[8]=V):V=e[8];let R;e[9]!==V?(R=n.jsx(cn,{className:"h-4 w-4 shrink-0",style:V}),e[9]=V,e[10]=R):R=e[10];const _=r.isHidden&&"line-through opacity-50";let k;e[11]!==_?(k=Ee("min-w-0 flex-1 truncate text-sm font-medium",_),e[11]=_,e[12]=k):k=e[12];let o;e[13]!==r.label||e[14]!==k?(o=n.jsx("span",{className:k,children:r.label}),e[13]=r.label,e[14]=k,e[15]=o):o=e[15];let N;return e[16]!==y||e[17]!==R||e[18]!==o?(N=n.jsxs(n.Fragment,{children:[g,y,R,o]}),e[16]=y,e[17]=R,e[18]=o,e[19]=N):N=e[19],N}function ha(m,e){const r=m.isSavedBlock===!0,c=m.isMultivariate===!0;return Ee("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":r?Br:c?"text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]":"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function Ir(m){const e=He.c(64),{section:r,raw:c,meta:d,sortableId:h,selected:S,onSelect:p,onDelete:v,onDuplicate:g,onMakeReusable:y,onToggleHidden:V,onToggleLazy:R,onAddVariant:_,onDetach:k}=m,o=c?qn(c.__resolveType??""):!1;let N;e[0]!==r?(N=js(r),e[0]=r,e[1]=N):N=e[1];const l=N;let J;e[2]!==h?(J={id:h,animateLayoutChanges:Wr},e[2]=h,e[3]=J):J=e[3];const{attributes:H,listeners:K,setNodeRef:u,transform:T,isDragging:se}=Yn(J);let P;e[4]!==T?(P=Jn.Transform.toString(T?{...T,x:0}:null),e[4]=T,e[5]=P):P=e[5];const pe=se?0:void 0;let D;e[6]!==P||e[7]!==pe?(D={transform:P,opacity:pe},e[6]=P,e[7]=pe,e[8]=D):D=e[8];const ce=D;let B;e[9]!==r?(B=ks(r),e[9]=r,e[10]=B):B=e[10];const te=B,oe="button",Ve=0;let E;e[11]!==p?(E=$=>{($.key==="Enter"||$.key===" ")&&($.preventDefault(),p())},e[11]=p,e[12]=E):E=e[12];const ue=se?"cursor-grabbing":"cursor-pointer";let ie;e[13]!==r||e[14]!==S||e[15]!==ue?(ie=Ee("touch-none transition-colors",ue,ha(r,S)),e[13]=r,e[14]=S,e[15]=ue,e[16]=ie):ie=e[16];let je;e[17]!==d||e[18]!==c||e[19]!==r?(je=n.jsx(pa,{section:r,raw:c,meta:d}),e[17]=d,e[18]=c,e[19]=r,e[20]=je):je=e[20];const M=!r.isMultivariate&&n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx(We,{type:"button",variant:"ghost",size:"icon","aria-label":o?"Disable async render":"Enable async render",className:Ee("h-7 w-7 shrink-0",o?"":"opacity-0 group-hover:opacity-100"),onClick:$=>{$.stopPropagation(),R()},onPointerDown:Gr,children:n.jsx(kr,{className:Ee("h-3.5 w-3.5",o&&"text-yellow-500")})})}),n.jsx(pt,{side:"bottom",children:o?"Disable async render":"Enable async render"})]});let Ae;e[21]!==V||e[22]!==r.isHidden||e[23]!==r.isMultivariate?(Ae=!r.isMultivariate&&n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx(We,{type:"button",variant:"ghost",size:"icon","aria-label":r.isHidden?"Show section":"Hide section",className:Ee("h-7 w-7 shrink-0",r.isHidden?"opacity-100":"opacity-0 group-hover:opacity-100"),onClick:$=>{$.stopPropagation(),V()},onPointerDown:Ur,children:r.isHidden?n.jsx(_r,{className:"h-3.5 w-3.5"}):n.jsx(jr,{className:"h-3.5 w-3.5"})})}),n.jsx(pt,{side:"bottom",children:r.isHidden?"Show section":"Hide section"})]}),e[21]=V,e[22]=r.isHidden,e[23]=r.isMultivariate,e[24]=Ae):Ae=e[24];let X;e[25]===Symbol.for("react.memo_cache_sentinel")?(X=n.jsx(ua,{asChild:!0,children:n.jsx(We,{type:"button",variant:"ghost",size:"icon","aria-label":"Section actions",className:"h-7 w-7 shrink-0 opacity-0 group-hover:opacity-100",onClick:Hr,onPointerDown:zr,children:n.jsx(sa,{className:"h-3.5 w-3.5"})})}),e[25]=X):X=e[25];let De;e[26]!==g?(De=$=>{$.stopPropagation(),g()},e[26]=g,e[27]=De):De=e[27];let ve;e[28]===Symbol.for("react.memo_cache_sentinel")?(ve=n.jsx(ia,{className:"h-4 w-4"}),e[28]=ve):ve=e[28];let re;e[29]!==De?(re=n.jsxs(it,{onClick:De,children:[ve,"Duplicate"]}),e[29]=De,e[30]=re):re=e[30];let W;e[31]!==l||e[32]!==_?(W=l&&n.jsxs(it,{className:Rs,onClick:$=>{$.stopPropagation(),_()},children:[n.jsx(la,{className:"h-4 w-4"}),"Add variant"]}),e[31]=l,e[32]=_,e[33]=W):W=e[33];let q;e[34]!==te||e[35]!==y?(q=te&&n.jsxs(it,{className:Lr,onClick:$=>{$.stopPropagation(),y()},children:[n.jsx(cn,{className:"h-4 w-4"}),"Make reusable"]}),e[34]=te,e[35]=y,e[36]=q):q=e[36];let ne;e[37]!==k||e[38]!==r.isMultivariate||e[39]!==r.isSavedBlock?(ne=r.isSavedBlock===!0&&!r.isMultivariate&&n.jsxs(it,{onClick:$=>{$.stopPropagation(),k()},children:[n.jsx(cn,{className:"h-4 w-4"}),"Detach"]}),e[37]=k,e[38]=r.isMultivariate,e[39]=r.isSavedBlock,e[40]=ne):ne=e[40];let le;e[41]!==v?(le=$=>{$.stopPropagation(),v()},e[41]=v,e[42]=le):le=e[42];let ke;e[43]===Symbol.for("react.memo_cache_sentinel")?(ke=n.jsx(ca,{className:"h-4 w-4"}),e[43]=ke):ke=e[43];let Se;e[44]!==le?(Se=n.jsxs(it,{className:"text-destructive focus:text-destructive",onClick:le,children:[ke,"Delete"]}),e[44]=le,e[45]=Se):Se=e[45];let de;e[46]!==re||e[47]!==W||e[48]!==q||e[49]!==ne||e[50]!==Se?(de=n.jsxs(da,{children:[X,n.jsxs(ma,{align:"end",className:"w-44",children:[re,W,q,ne,Se]})]}),e[46]=re,e[47]=W,e[48]=q,e[49]=ne,e[50]=Se,e[51]=de):de=e[51];let ye;return e[52]!==H||e[53]!==K||e[54]!==p||e[55]!==u||e[56]!==ce||e[57]!==ie||e[58]!==je||e[59]!==M||e[60]!==Ae||e[61]!==de||e[62]!==E?(ye=n.jsxs("div",{ref:u,style:ce,...H,...K,role:oe,tabIndex:Ve,onClick:p,onKeyDown:E,className:ie,children:[je,M,Ae,de]}),e[52]=H,e[53]=K,e[54]=p,e[55]=u,e[56]=ce,e[57]=ie,e[58]=je,e[59]=M,e[60]=Ae,e[61]=de,e[62]=E,e[63]=ye):ye=e[63],ye}function zr(m){return m.stopPropagation()}function Hr(m){return m.stopPropagation()}function Ur(m){return m.stopPropagation()}function Gr(m){return m.stopPropagation()}function Wr(){return!1}function qr(m){const e=He.c(90),{listKey:r,rawSections:c,sections:d,meta:h,selectedIndex:S,onSelect:p,onReorder:v,onDelete:g,onDuplicate:y,onMakeReusable:V,onToggleHidden:R,onToggleLazy:_,onAddVariant:k,onDetach:o,onAddSection:N,canAddSection:l}=m,J=l===void 0?!0:l;let H;e[0]!==d.length?(H=()=>On(d.length),e[0]=d.length,e[1]=H):H=e[1];const[K,u]=w.useState(H),[T,se]=w.useState(null),[P,pe]=w.useState(r),[D,ce]=w.useState(d.length),B=w.useRef(!1);P!==r?(pe(r),ce(d.length),u(On(d.length))):D!==d.length&&(ce(d.length),u(L=>Fr(L,d.length)));let te;e[2]===Symbol.for("react.memo_cache_sentinel")?(te={activationConstraint:{distance:8}},e[2]=te):te=e[2];let oe;e[3]===Symbol.for("react.memo_cache_sentinel")?(oe={coordinateGetter:Qn},e[3]=oe):oe=e[3];const Ve=Un(zt(Wn,te),zt(Gn,oe));let E;e[4]!==K?(E=K.map(Yr),e[4]=K,e[5]=E):E=e[5];const ue=E;let ie;e[6]===Symbol.for("react.memo_cache_sentinel")?(ie=L=>{se(String(L.active.id))},e[6]=ie):ie=e[6];const je=ie;let M;e[7]!==ue||e[8]!==v?(M=L=>{se(null);const{active:ae,over:Q}=L;if(!Q||ae.id===Q.id)return;const Ie=ue.indexOf(String(ae.id)),he=ue.indexOf(String(Q.id));Ie===-1||he===-1||(u(Qe=>fa(Rt([...Qe],Ie,he))),B.current=!0,requestAnimationFrame(()=>{B.current=!1}),v?.(Ie,he))},e[7]=ue,e[8]=v,e[9]=M):M=e[9];const Ae=M;let X;e[10]===Symbol.for("react.memo_cache_sentinel")?(X=()=>{se(null)},e[10]=X):X=e[10];const De=X;let ve,re,W,q,ne,le,ke,Se,de,ye,$,Z,we,Ke,$e;if(e[11]!==T||e[12]!==J||e[13]!==K||e[14]!==ue||e[15]!==Ae||e[16]!==h||e[17]!==N||e[18]!==k||e[19]!==g||e[20]!==o||e[21]!==y||e[22]!==V||e[23]!==p||e[24]!==R||e[25]!==_||e[26]!==c||e[27]!==d||e[28]!==S||e[29]!==Ve){Ke=Symbol.for("react.early_return_sentinel");e:{const L=ae=>{B.current||p(ae)};if(e[45]!==T||e[46]!==J||e[47]!==K||e[48]!==N||e[49]!==c||e[50]!==d){const ae=T?K.find(Q=>Q.id===T):null;if(q=ae!=null?d[ae.index]:null,W=ae!=null?c[ae.index]:void 0,K.length===0){let Q;e[54]===Symbol.for("react.memo_cache_sentinel")?(Q=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:"No sections in this page."}),e[54]=Q):Q=e[54];const Ie=!J;let he;e[55]===Symbol.for("react.memo_cache_sentinel")?(he=n.jsx(un,{size:14}),e[55]=he):he=e[55];let Qe;e[56]!==N||e[57]!==Ie?(Qe=n.jsxs("div",{className:"space-y-2",children:[Q,n.jsxs(We,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:Ie,onClick:N,children:[he,"Add section"]})]}),e[56]=N,e[57]=Ie,e[58]=Qe):Qe=e[58],Ke=Qe;break e}we=Ee(ae&&"cursor-grabbing"),e[45]=T,e[46]=J,e[47]=K,e[48]=N,e[49]=c,e[50]=d,e[51]=W,e[52]=q,e[53]=we}else W=e[51],q=e[52],we=e[53];re=Xn,Se=Ve,de=Zn,ye=je,$=Ae,Z=De,ve=ea,le=ue,ke=ta,$e="space-y-1",ne=K.map(ae=>{const Q=d[ae.index];return Q?n.jsx(Ir,{sortableId:ae.id,section:Q,raw:c[ae.index],meta:h,selected:S===ae.index,onSelect:()=>L(ae.index),onDelete:()=>g(ae.index),onDuplicate:()=>y(ae.index),onMakeReusable:()=>V(ae.index),onToggleHidden:()=>R(ae.index),onToggleLazy:()=>_(ae.index),onAddVariant:()=>k(ae.index),onDetach:()=>o(ae.index)},ae.id):null})}e[11]=T,e[12]=J,e[13]=K,e[14]=ue,e[15]=Ae,e[16]=h,e[17]=N,e[18]=k,e[19]=g,e[20]=o,e[21]=y,e[22]=V,e[23]=p,e[24]=R,e[25]=_,e[26]=c,e[27]=d,e[28]=S,e[29]=Ve,e[30]=ve,e[31]=re,e[32]=W,e[33]=q,e[34]=ne,e[35]=le,e[36]=ke,e[37]=Se,e[38]=de,e[39]=ye,e[40]=$,e[41]=Z,e[42]=we,e[43]=Ke,e[44]=$e}else ve=e[30],re=e[31],W=e[32],q=e[33],ne=e[34],le=e[35],ke=e[36],Se=e[37],de=e[38],ye=e[39],$=e[40],Z=e[41],we=e[42],Ke=e[43],$e=e[44];if(Ke!==Symbol.for("react.early_return_sentinel"))return Ke;let Le;e[59]!==ne||e[60]!==$e?(Le=n.jsx("div",{className:$e,children:ne}),e[59]=ne,e[60]=$e,e[61]=Le):Le=e[61];let Te;e[62]!==ve||e[63]!==le||e[64]!==ke||e[65]!==Le?(Te=n.jsx(ve,{items:le,strategy:ke,children:Le}),e[62]=ve,e[63]=le,e[64]=ke,e[65]=Le,e[66]=Te):Te=e[66];let Oe;e[67]!==W||e[68]!==q||e[69]!==h?(Oe=q?n.jsx("div",{className:Ee("cursor-grabbing shadow-lg ring-1 ring-border/60",ha(q,!1)),children:n.jsx(pa,{section:q,raw:W,meta:h})}):null,e[67]=W,e[68]=q,e[69]=h,e[70]=Oe):Oe=e[70];let Fe;e[71]!==Oe?(Fe=n.jsx(na,{dropAnimation:null,children:Oe}),e[71]=Oe,e[72]=Fe):Fe=e[72];let Me;e[73]!==re||e[74]!==Se||e[75]!==de||e[76]!==ye||e[77]!==$||e[78]!==Z||e[79]!==Te||e[80]!==Fe?(Me=n.jsxs(re,{sensors:Se,collisionDetection:de,onDragStart:ye,onDragEnd:$,onDragCancel:Z,children:[Te,Fe]}),e[73]=re,e[74]=Se,e[75]=de,e[76]=ye,e[77]=$,e[78]=Z,e[79]=Te,e[80]=Fe,e[81]=Me):Me=e[81];const xe=!J;let Re;e[82]===Symbol.for("react.memo_cache_sentinel")?(Re=n.jsx(un,{size:14}),e[82]=Re):Re=e[82];let me;e[83]!==N||e[84]!==xe?(me=n.jsxs(We,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:xe,onClick:N,children:[Re,"Add section"]}),e[83]=N,e[84]=xe,e[85]=me):me=e[85];let ee;return e[86]!==we||e[87]!==Me||e[88]!==me?(ee=n.jsxs("div",{className:we,children:[Me,me]}),e[86]=we,e[87]=Me,e[88]=me,e[89]=ee):ee=e[89],ee}function Yr(m){return m.id}function Bn(m){const e=He.c(38),{open:r,initialName:c,autoLabel:d,isPending:h,onSubmit:S,onOpenChange:p}=m,v=h===void 0?!1:h,[g,y]=w.useState(c),[V,R]=w.useState(r);r!==V&&(R(r),r&&y(c));let _;e[0]!==v||e[1]!==p?(_=oe=>{!oe&&!v&&p(!1)},e[0]=v,e[1]=p,e[2]=_):_=e[2];const k=_;let o;e[3]!==v||e[4]!==g||e[5]!==S?(o=async oe=>{oe.preventDefault(),!v&&await S(g.trim())},e[3]=v,e[4]=g,e[5]=S,e[6]=o):o=e[6];const N=o;let l;e[7]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(pr,{children:"Rename variant"}),e[7]=l):l=e[7];const J=d||"the rule";let H;e[8]!==J?(H=n.jsxs(hr,{children:[l,n.jsxs(gr,{children:["Save this matcher as a global block with a custom label. Leave empty to inline the matcher again and fall back to"," ",n.jsx("span",{className:"font-medium",children:J}),"."]})]}),e[8]=J,e[9]=H):H=e[9];let K;e[10]===Symbol.for("react.memo_cache_sentinel")?(K=n.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[10]=K):K=e[10];let u;e[11]===Symbol.for("react.memo_cache_sentinel")?(u=oe=>y(oe.target.value),e[11]=u):u=e[11];let T;e[12]!==d||e[13]!==v||e[14]!==g?(T=n.jsxs("div",{className:"space-y-1.5 py-4",children:[K,n.jsx(br,{id:"variant-rename-name",value:g,onChange:u,placeholder:d,autoFocus:!0,disabled:v})]}),e[12]=d,e[13]=v,e[14]=g,e[15]=T):T=e[15];let se;e[16]!==p?(se=()=>p(!1),e[16]=p,e[17]=se):se=e[17];let P;e[18]!==v||e[19]!==se?(P=n.jsx(We,{type:"button",variant:"outline",onClick:se,disabled:v,children:"Cancel"}),e[18]=v,e[19]=se,e[20]=P):P=e[20];let pe;e[21]!==v?(pe=v?n.jsxs(n.Fragment,{children:[n.jsx(Hn,{size:14,className:"animate-spin"}),"Saving…"]}):"Save",e[21]=v,e[22]=pe):pe=e[22];let D;e[23]!==v||e[24]!==pe?(D=n.jsx(We,{type:"submit",disabled:v,children:pe}),e[23]=v,e[24]=pe,e[25]=D):D=e[25];let ce;e[26]!==P||e[27]!==D?(ce=n.jsxs(vr,{children:[P,D]}),e[26]=P,e[27]=D,e[28]=ce):ce=e[28];let B;e[29]!==N||e[30]!==ce||e[31]!==H||e[32]!==T?(B=n.jsx(Sr,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:N,children:[H,T,ce]})}),e[29]=N,e[30]=ce,e[31]=H,e[32]=T,e[33]=B):B=e[33];let te;return e[34]!==k||e[35]!==r||e[36]!==B?(te=n.jsx(xr,{open:r,onOpenChange:k,children:B}),e[34]=k,e[35]=r,e[36]=B,e[37]=te):te=e[37],te}const Jr="text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]",ga="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.2)]";function va(m){const e=He.c(5),{rule:r,matchers:c}=m,d=r?.__resolveType??"";let h;if(e[0]!==c||e[1]!==d){const g=c.find(y=>y.resolveType===d)?.iconName??Ns(d);h=ur(g),e[0]=c,e[1]=d,e[2]=h}else h=e[2];const S=h;if(!S)return null;let p;return e[3]!==S?(p=n.jsx(S,{size:14,className:"shrink-0"}),e[3]=S,e[4]=p):p=e[4],p}function Ln(m){return m.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
|
|
2
|
-
`)}function ln(m){return m.map((e,r)=>({id:crypto.randomUUID(),index:r,variant:e}))}function Qr(m){return m.map((e,r)=>({...e,index:r}))}function Sa(m){const e=He.c(16),{label:r,effectiveRule:c,matchers:d,canDelete:h,dragging:S,onRename:p,onDuplicate:v,onDelete:g}=m;let y;e[0]!==c||e[1]!==d?(y=n.jsx(va,{rule:c,matchers:d}),e[0]=c,e[1]=d,e[2]=y):y=e[2];let V;e[3]!==r?(V=n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:r}),e[3]=r,e[4]=V):V=e[4];let R;e[5]!==h||e[6]!==S||e[7]!==r||e[8]!==g||e[9]!==v||e[10]!==p?(R=!S&&n.jsxs(da,{children:[n.jsx(ua,{asChild:!0,children:n.jsx(We,{type:"button",variant:"ghost",size:"icon","aria-label":`Actions for ${r}`,className:"size-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100",onClick:Zr,onPointerDown:Xr,children:n.jsx(sa,{size:14})})}),n.jsxs(ma,{align:"end",className:"w-36",children:[n.jsxs(it,{onClick:k=>{k.stopPropagation(),p?.()},children:[n.jsx(Mr,{size:14}),"Rename"]}),n.jsxs(it,{onClick:k=>{k.stopPropagation(),v?.()},children:[n.jsx(ia,{size:14}),"Duplicate"]}),n.jsx(wr,{}),n.jsxs(it,{variant:"destructive",disabled:!h,onClick:k=>{k.stopPropagation(),g?.()},children:[n.jsx(ca,{size:14}),"Delete"]})]})]}),e[5]=h,e[6]=S,e[7]=r,e[8]=g,e[9]=v,e[10]=p,e[11]=R):R=e[11];let _;return e[12]!==y||e[13]!==V||e[14]!==R?(_=n.jsxs(n.Fragment,{children:[y,V,R]}),e[12]=y,e[13]=V,e[14]=R,e[15]=_):_=e[15],_}function Xr(m){return m.stopPropagation()}function Zr(m){return m.stopPropagation()}function eo(m){const e=He.c(33),{entry:r,sortableId:c,isActive:d,canDelete:h,decofile:S,meta:p,matchers:v,onSelect:g,onRename:y,onDuplicate:V,onDelete:R}=m;let _;e[0]!==c?(_={id:c,animateLayoutChanges:to},e[0]=c,e[1]=_):_=e[1];const{attributes:k,listeners:o,setNodeRef:N,transform:l,isDragging:J}=Yn(_);let H;e[2]!==l?(H=Jn.Transform.toString(l?{...l,x:0}:null),e[2]=l,e[3]=H):H=e[3];const K=J?0:void 0;let u;e[4]!==H||e[5]!==K?(u={transform:H,opacity:K},e[4]=H,e[5]=K,e[6]=u):u=e[6];const T=u,se=p??void 0;let P;e[7]!==S||e[8]!==r.variant.rule||e[9]!==se?(P=Nt(r.variant.rule,S,se),e[7]=S,e[8]=r.variant.rule,e[9]=se,e[10]=P):P=e[10];const pe=P;let D;e[11]!==g?(D=E=>{E.target===E.currentTarget&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),g())},e[11]=g,e[12]=D):D=e[12];const ce=J?"cursor-grabbing":"cursor-pointer active:cursor-grabbing",B=d?ga:Jr;let te;e[13]!==ce||e[14]!==B?(te=Ee("group flex select-none items-center gap-2 rounded-md px-2 py-2.5 transition-colors touch-none",ce,B),e[13]=ce,e[14]=B,e[15]=te):te=e[15];let oe;e[16]!==h||e[17]!==pe||e[18]!==r.variant.label||e[19]!==v||e[20]!==R||e[21]!==V||e[22]!==y?(oe=n.jsx(Sa,{label:r.variant.label,effectiveRule:pe,matchers:v,canDelete:h,onRename:y,onDuplicate:V,onDelete:R}),e[16]=h,e[17]=pe,e[18]=r.variant.label,e[19]=v,e[20]=R,e[21]=V,e[22]=y,e[23]=oe):oe=e[23];let Ve;return e[24]!==k||e[25]!==o||e[26]!==g||e[27]!==N||e[28]!==T||e[29]!==te||e[30]!==oe||e[31]!==D?(Ve=n.jsx("div",{ref:N,style:T,...k,...o,onClick:g,onKeyDown:D,className:te,children:oe}),e[24]=k,e[25]=o,e[26]=g,e[27]=N,e[28]=T,e[29]=te,e[30]=oe,e[31]=D,e[32]=Ve):Ve=e[32],Ve}function to(){return!1}function no(m){const e=He.c(9),{variant:r,decofile:c,meta:d,matchers:h}=m,S=d??void 0;let p;e[0]!==c||e[1]!==S||e[2]!==r.rule?(p=Nt(r.rule,c,S),e[0]=c,e[1]=S,e[2]=r.rule,e[3]=p):p=e[3];const v=p;let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=Ee("flex items-center gap-2 rounded-md px-2 py-2.5 shadow-lg ring-1 ring-border/60 cursor-grabbing",ga),e[4]=g):g=e[4];let y;return e[5]!==v||e[6]!==h||e[7]!==r.label?(y=n.jsx("div",{className:g,children:n.jsx(Sa,{label:r.label,effectiveRule:v,matchers:h,canDelete:!1,dragging:!0})}),e[5]=v,e[6]=h,e[7]=r.label,e[8]=y):y=e[8],y}function ao(m){const e=He.c(77),{listKey:r,variants:c,activeIndex:d,decofile:h,meta:S,matchers:p,onSelect:v,onReorder:g,onRename:y,onDuplicate:V,onDelete:R,onAdd:_}=m;let k;e[0]!==c?(k=()=>ln(c),e[0]=c,e[1]=k):k=e[1];const[o,N]=w.useState(k),[l,J]=w.useState(null),[H,K]=w.useState(r),[u,T]=w.useState(c.length);let se;e[2]!==c?(se=()=>Ln(c),e[2]=c,e[3]=se):se=e[3];const[P,pe]=w.useState(se),D=w.useRef(!1),ce=Ln(c);H!==r?(K(r),T(c.length),pe(ce),N(ln(c))):u!==c.length?(T(c.length),pe(ce),N(ln(c))):P!==ce&&(pe(ce),N(Me=>c.map((xe,Re)=>({id:Me[Re]?.id??crypto.randomUUID(),index:Re,variant:xe}))));let B;e[4]===Symbol.for("react.memo_cache_sentinel")?(B={activationConstraint:{distance:8}},e[4]=B):B=e[4];let te;e[5]===Symbol.for("react.memo_cache_sentinel")?(te={coordinateGetter:Qn},e[5]=te):te=e[5];const oe=Un(zt(Wn,B),zt(Gn,te));let Ve;e[6]!==o?(Ve=o.map(so),e[6]=o,e[7]=Ve):Ve=e[7];const E=Ve,ue=c.length>1;let ie;e[8]!==o?(ie=Me=>{const xe=String(Me.active.id);J(o.find(Re=>Re.id===xe)??null)},e[8]=o,e[9]=ie):ie=e[9];const je=ie;let M;e[10]!==E||e[11]!==g?(M=Me=>{J(null);const{active:xe,over:Re}=Me;if(!Re||xe.id===Re.id)return;const me=E.indexOf(String(xe.id)),ee=E.indexOf(String(Re.id));me===-1||ee===-1||(N(L=>Qr(Rt([...L],me,ee))),D.current=!0,requestAnimationFrame(()=>{D.current=!1}),g(me,ee))},e[10]=E,e[11]=g,e[12]=M):M=e[12];const Ae=M;let X;e[13]===Symbol.for("react.memo_cache_sentinel")?(X=()=>{J(null)},e[13]=X):X=e[13];const De=X;let ve,re,W,q,ne,le,ke,Se,de,ye,$,Z,we;if(e[14]!==d||e[15]!==ue||e[16]!==h||e[17]!==o||e[18]!==E||e[19]!==Ae||e[20]!==je||e[21]!==p||e[22]!==S||e[23]!==_||e[24]!==R||e[25]!==V||e[26]!==y||e[27]!==v||e[28]!==oe){const Me=L=>{D.current||v(L)};$="space-y-1 border-b p-2";let xe;e[42]===Symbol.for("react.memo_cache_sentinel")?(xe=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variants"}),e[42]=xe):xe=e[42];let Re;e[43]===Symbol.for("react.memo_cache_sentinel")?(Re=n.jsx(un,{size:14}),e[43]=Re):Re=e[43];let me;e[44]!==_?(me=n.jsx(ft,{asChild:!0,children:n.jsx(We,{type:"button",variant:"ghost",size:"icon","aria-label":"Add variant",className:"size-6",onClick:_,children:Re})}),e[44]=_,e[45]=me):me=e[45];let ee;e[46]===Symbol.for("react.memo_cache_sentinel")?(ee=n.jsx(pt,{children:"Add variant"}),e[46]=ee):ee=e[46],e[47]!==me?(Z=n.jsxs("div",{className:"flex items-center justify-between",children:[xe,n.jsxs(mt,{children:[me,ee]})]}),e[47]=me,e[48]=Z):Z=e[48],re=Xn,le=oe,ke=Zn,Se=je,de=Ae,ye=De,ve=ea,q=E,ne=ta,we="space-y-0.5",W=o.map(L=>n.jsx(eo,{sortableId:L.id,entry:L,isActive:L.index===d,canDelete:ue,decofile:h,meta:S,matchers:p,onSelect:()=>Me(L.index),onRename:()=>y(L.index),onDuplicate:()=>V(L.index),onDelete:()=>R(L.index)},L.id)),e[14]=d,e[15]=ue,e[16]=h,e[17]=o,e[18]=E,e[19]=Ae,e[20]=je,e[21]=p,e[22]=S,e[23]=_,e[24]=R,e[25]=V,e[26]=y,e[27]=v,e[28]=oe,e[29]=ve,e[30]=re,e[31]=W,e[32]=q,e[33]=ne,e[34]=le,e[35]=ke,e[36]=Se,e[37]=de,e[38]=ye,e[39]=$,e[40]=Z,e[41]=we}else ve=e[29],re=e[30],W=e[31],q=e[32],ne=e[33],le=e[34],ke=e[35],Se=e[36],de=e[37],ye=e[38],$=e[39],Z=e[40],we=e[41];let Ke;e[49]!==W||e[50]!==we?(Ke=n.jsx("div",{className:we,children:W}),e[49]=W,e[50]=we,e[51]=Ke):Ke=e[51];let $e;e[52]!==ve||e[53]!==q||e[54]!==ne||e[55]!==Ke?($e=n.jsx(ve,{items:q,strategy:ne,children:Ke}),e[52]=ve,e[53]=q,e[54]=ne,e[55]=Ke,e[56]=$e):$e=e[56];let Le;e[57]!==l||e[58]!==h||e[59]!==p||e[60]!==S?(Le=l?n.jsx(no,{variant:l.variant,decofile:h,meta:S,matchers:p}):null,e[57]=l,e[58]=h,e[59]=p,e[60]=S,e[61]=Le):Le=e[61];let Te;e[62]!==Le?(Te=n.jsx(na,{dropAnimation:null,children:Le}),e[62]=Le,e[63]=Te):Te=e[63];let Oe;e[64]!==re||e[65]!==le||e[66]!==ke||e[67]!==Se||e[68]!==de||e[69]!==ye||e[70]!==$e||e[71]!==Te?(Oe=n.jsxs(re,{sensors:le,collisionDetection:ke,onDragStart:Se,onDragEnd:de,onDragCancel:ye,children:[$e,Te]}),e[64]=re,e[65]=le,e[66]=ke,e[67]=Se,e[68]=de,e[69]=ye,e[70]=$e,e[71]=Te,e[72]=Oe):Oe=e[72];let Fe;return e[73]!==$||e[74]!==Z||e[75]!==Oe?(Fe=n.jsxs("div",{className:$,children:[Z,Oe]}),e[73]=$,e[74]=Z,e[75]=Oe,e[76]=Fe):Fe=e[76],Fe}function so(m){return m.id}function Fn(m){const e=He.c(15),{schema:r,value:c,onChange:d,meta:h,decofile:S,onSaveReferencedBlock:p,sandbox:v}=m;let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=[],e[0]=g):g=e[0];const[y,V]=w.useState(g);let R;e[1]!==y?(R=y.length>0&&n.jsxs("nav",{"aria-label":"Variant rule breadcrumb",className:"flex min-w-0 items-center gap-1 overflow-hidden text-xs",children:[n.jsx("button",{type:"button",onClick:()=>V([]),className:"flex shrink-0 items-center gap-0.5 rounded-md px-1 py-0.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",title:"Back to rule",children:n.jsx(ra,{className:"size-3.5"})}),y.map((o,N)=>{const l=N===y.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[N>0&&n.jsx(oa,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>V(y.slice(0,N+1)),title:o,className:Ee("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",l?"font-medium text-foreground":"text-muted-foreground"),children:o})]},`${o}-${N}`)})]}),e[1]=y,e[2]=R):R=e[2];let _;e[3]!==y||e[4]!==S||e[5]!==h||e[6]!==d||e[7]!==p||e[8]!==v||e[9]!==r||e[10]!==c?(_=n.jsx(aa,{schema:r,value:c,onChange:d,basePath:"",breadcrumbPath:y,onBreadcrumbChange:V,meta:h,decofile:S,onSaveReferencedBlock:p,sandbox:v}),e[3]=y,e[4]=S,e[5]=h,e[6]=d,e[7]=p,e[8]=v,e[9]=r,e[10]=c,e[11]=_):_=e[11];let k;return e[12]!==R||e[13]!==_?(k=n.jsxs("div",{className:"space-y-2",children:[R,_]}),e[12]=R,e[13]=_,e[14]=k):k=e[14],k}function In(m){const e=He.c(21),{activeSchema:r,formValue:c,formResetKey:d,onFormChange:h,onBreadcrumbChange:S,breadcrumbPath:p,emptyMessage:v,beforeForm:g,seoResolveType:y,siteDefaultSeo:V,meta:R,decofile:_,onSaveReferencedBlock:k,sandbox:o}=m;let N;e[0]!==p?(N=p===void 0?[]:p,e[0]=p,e[1]=N):N=e[1];const l=N;let J;e[2]!==r||e[3]!==l||e[4]!==_||e[5]!==d||e[6]!==c||e[7]!==R||e[8]!==S||e[9]!==h||e[10]!==k||e[11]!==o||e[12]!==y||e[13]!==V?(J=r&&c?y?n.jsx(Rr,{schema:r,resolveType:y,value:c,formResetKey:d,onChange:h,onBreadcrumbChange:S,siteDefaultSeo:V}):n.jsx(aa,{schema:r,value:c,onChange:h,basePath:"",breadcrumbPath:l,onBreadcrumbChange:S,meta:R,decofile:_,onSaveReferencedBlock:k,sandbox:o},d):null,e[2]=r,e[3]=l,e[4]=_,e[5]=d,e[6]=c,e[7]=R,e[8]=S,e[9]=h,e[10]=k,e[11]=o,e[12]=y,e[13]=V,e[14]=J):J=e[14];const H=J;let K;e[15]!==v||e[16]!==H?(K=H??n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:v}),e[15]=v,e[16]=H,e[17]=K):K=e[17];let u;return e[18]!==g||e[19]!==K?(u=n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsxs("div",{className:"mx-auto max-w-2xl",children:[g,K]})}),e[18]=g,e[19]=K,e[20]=u):u=e[20],u}const ro="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.22)]";function oo(m,e){return Ds(m,e,tt)}function io(m){const e=He.c(13),{pageKey:r,initialName:c,initialPath:d,onFieldChange:h}=m,[S,p]=w.useState(c),[v,g]=w.useState(d),[y,V]=w.useState(r);y!==r&&(V(r),p(c),g(d));let R;e[0]!==h?(R=l=>{p(l.target.value),h("name",l.target.value)},e[0]=h,e[1]=R):R=e[1];let _;e[2]!==S||e[3]!==R?(_=n.jsx("input",{type:"text",value:S,onChange:R,className:"w-full bg-transparent text-sm font-semibold truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:"Page name"}),e[2]=S,e[3]=R,e[4]=_):_=e[4];let k;e[5]!==h?(k=l=>{g(l.target.value),h("path",l.target.value)},e[5]=h,e[6]=k):k=e[6];let o;e[7]!==v||e[8]!==k?(o=n.jsx("input",{type:"text",value:v,onChange:k,className:"w-full bg-transparent text-xs text-muted-foreground truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:"/path"}),e[7]=v,e[8]=k,e[9]=o):o=e[9];let N;return e[10]!==_||e[11]!==o?(N=n.jsxs("div",{className:"space-y-1",children:[_,o]}),e[10]=_,e[11]=o,e[12]=N):N=e[12],N}function zn(m){const e=He.c(6),{onClick:r}=m;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(la,{size:14}),e[0]=c):c=e[0];let d;e[1]!==r?(d=n.jsx(ft,{asChild:!0,children:n.jsx(We,{type:"button",variant:"ghost",size:"icon","aria-label":"Add variant",className:"size-7 shrink-0 text-[oklch(0.65_0.15_160)]",onClick:r,children:c})}),e[1]=r,e[2]=d):d=e[2];let h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx(pt,{side:"bottom",children:"Add variant"}),e[3]=h):h=e[3];let S;return e[4]!==d?(S=n.jsxs(mt,{children:[d,h]}),e[4]=d,e[5]=S):S=e[5],S}function ic({orgSlug:m,virtualMcpId:e,branch:r,previewReady:c=!0,previewUrl:d,currentPath:h,activePageBlockKey:S=null,activeGlobalBlockKey:p=null,externalSelectedIndex:v,onSaved:g,initialEditSeo:y=!1,onExitSeo:V,onViewJsonFile:R,onVariantPreviewOverride:_}){const k=c?{orgSlug:m,virtualMcpId:e,branch:r,previewUrl:d}:null,{data:o,isLoading:N}=Cs(k),{data:l,isLoading:J}=Vs(k),H=Ts(),K=H?.entity?.id===e?H.entity.metadata?.siteSlug??null:null,[u,T]=w.useState(null),[se,P]=w.useState(null),[pe,D]=w.useState(null),[ce,B]=w.useState(0),[te,oe]=w.useState(void 0),[Ve,E]=w.useState(null),[ue,ie]=w.useState(null),[je,M]=w.useState([]),[Ae,X]=w.useState(0),[De,ve]=w.useState(null),[re,W]=w.useState(null),[q,ne]=w.useState(null),[le,ke]=w.useState(!0),[Se,de]=w.useState(!1),[ye,$]=w.useState(!1),[Z,we]=w.useState(y),[Ke,$e]=w.useState(y);y&&!Ke&&($e(!0),we(!0),T(null),P(null),D(null),M([])),!y&&Ke&&$e(!1);const[Le,Te]=w.useState(null),[Oe,Fe]=w.useState(void 0),[Me,xe]=w.useState([]),[Re,me]=w.useState(0),[ee,L]=w.useState(0),[ae,Q]=w.useState(null),[Ie,he]=w.useState(null),[Qe,dn]=w.useState(null),xa=Ss(),ba=`${m}/${e}/${r}`,Ht=Ps({orgSlug:m,virtualMcpId:e,branch:r}),[ya,_a]=w.useState(h),[ja,ka]=w.useState(S),[wa,Ra]=w.useState(p);(ya!==h||ja!==S||wa!==p)&&(queueMicrotask(()=>Ht.flush()),_a(h),ka(S),Ra(p),T(null),P(null),D(null),B(0),E(null),ie(null),L(0),Q(null),he(null),M([]),X(t=>t+1),we(!1),Te(null),Fe(void 0),xe([]),me(t=>t+1));const be=As({orgSlug:m,virtualMcpId:e,branch:r}),Dt=Xs((t,a)=>{be.mutate({blockKey:t,data:a},{onSuccess:()=>g?.(),onError:s=>G.error(`Save failed: ${s.message}`)})}),Ut=Ms({orgSlug:m,virtualMcpId:e,branch:r}),[yt,Ct]=w.useState(!1),Gt=w.useRef(null),ht=w.useRef(null),gt=w.useRef(null),Wt=w.useRef({}),qe=w.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null});if(!c||N||J)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(Hn,{size:20,className:"animate-spin text-muted-foreground"})});if(!o||!l)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:"Could not load site data."});const Na=Es(o),_e=!!p,ze=_e?null:Ks(Na,h,S),j=_e?p:ze?.key??null,qt=_e&&p?o[p]:void 0,mn=_e&&p&&qt?$s(p,qt):_e&&p?p:"",Vt=!_e&&j&&o[j]?o[j]:null,Yt=Z&&o&&l&&j&&ze?$n(o,{kind:"page",pageKey:j,pageName:String(ze.name??""),path:String(ze.path??"")},l):null,Da=Z?Vt?.seo:void 0,Jt=Oe!==void 0?Oe:Da,Ca=Z?Nr(Jt):void 0,Va=Yt?.seoTypeOptions??[],Ta=Z&&l?Dr(l):"",fn=Le??Ca??{},Qt=Z&&Yt?Cr(fn,Yt):null,Pa=Z&&Qt&&Vr(Jt)?Ot(Qt,l):null,Aa=Z?Tr(o,l)?.seoData:void 0,Be=_e?[{label:"Default",sections:[{__resolveType:p}]}]:oo(Vt?.sections,o??{}),Tt=Be.length>1,Ce=Math.min(ce,Be.length-1),nt=Be[Ce],I=nt?.sections??[],Pe=Bt(I,o),pn=!_e&&Os(Vt?.sections);if(_e&&p&&Qe!==p){dn(p);const t=I[0],a=Pe[0];if(t&&a){T(0),L(0),M([]);const s=ut(t,a,o);s&&(P(s.data),D(s.resolveType),he(null),Q(null))}}!_e&&Qe!==null&&dn(null),qe.current={rawSections:I,parsedSections:Pe,decofile:o??{},activePageKey:j,pageVariants:Be,variantIndex:Ce,sectionVariantIndex:ee,selectedSectionIndex:u};const Ma=()=>({multivariate:pn,index:Ce,variants:Be.map(t=>({rule:t.rule}))}),hn=(t,a)=>{if(!_)return;if(!j||!pn||t.length<=1){_(null);return}const s=En(j,{multivariate:!0,index:a,variants:t},o,l);_(s.length>0?s:null)},vt=(t,a,s)=>{if(!_)return;if(!j){_(null);return}const i=Ma(),f=En(j,i,o,l);if(!t||a<0){_(f.length>0?f:null);return}const b=ar({pageKey:j,page:i,sectionIndex:a,sectionLazy:Pe[a]?.isLazy??!1,mvObj:t,selectedVariantIndex:s,decofile:o,meta:l}),x=[...f,...b];_(x.length>0?x:null)},at=(t,a,s,i=u??-1,f=!1)=>{const b=Je(t,a);if(!b){P(null),D(null),he(null),Q(null),f&&vt(null,i,s);return}const C=Vn(b,tt)[s];if(!C){P(null),D(null),he(null),Q(null),f&&vt(null,i,s);return}const Y=Hs(C.value,o);P(Y?.data??null),D(Y?.resolveType??null);const{resolveType:A,formValue:O}=jt(C.rule,o,l??void 0);he(A),Q(O),f&&vt(b,i,s)};if(v!==void 0&&v!==te&&(oe(v??null),typeof v=="number")){const t=I[v],a=Pe[v];if(t&&a)if(T(v),L(0),M([]),X(s=>s+1),a.isMultivariate)at(t,a,0,v);else{const s=ut(t,a,o);s?(P(s.data),D(s.resolveType)):(P(null),D(null)),he(null),Q(null)}}const Pt={orgSlug:m,virtualMcpId:e,branch:r,previewUrl:d??void 0,siteSlug:K},Xt=pe&&l?Ot(pe,l):null,Ue=(t,a)=>{if(!j)return;const s=wt(o,j,t,Ce,Be);be.mutate({blockKey:j,data:s},{onSuccess:()=>a?.onSuccess?.()??g?.(),onError:i=>G.error(`Save failed: ${i.message}`)})},St=()=>{T(null),P(null),D(null),L(0),Q(null),he(null),M([]),X(t=>t+1)},Ea=(t,a)=>{Gt.current&&clearTimeout(Gt.current);const s=qe.current.sectionVariantIndex;Gt.current=setTimeout(()=>{const{rawSections:i,parsedSections:f,decofile:b,activePageKey:x,pageVariants:C,variantIndex:Y}=qe.current,A=i[a];if(!A)return;const O=f[a];if(!O)return;if(O.isSavedBlock){const z=O.isLazy?A.section?.__resolveType??A.__resolveType:A.__resolveType;be.mutate({blockKey:z,data:t},{onSuccess:()=>g?.(),onError:U=>G.error(`Save failed: ${U.message}`)});return}if(!x)return;const F={...b[x]},ge=[...i];if(O.isMultivariate){const z=Je(A,O);if(!z||!x)return;const U=rr(z,s,t);ge[a]=dt(A,O,U)}else if(O.isHidden){const z=qn(A.__resolveType),U=z?{...A.section}:{...A},Ne=Array.isArray(U.variants)?[...U.variants]:[];Ne[0]&&(Ne[0]={...Ne[0],value:t}),U.variants=Ne,z?ge[a]={...A,section:U}:ge[a]=U}else O.isLazy?ge[a]={...A,section:t}:ge[a]=t;if(C.length>1){const z=F.sections,U=[...z?.variants??[]];U[Y]&&(U[Y]={...U[Y],value:ge}),F.sections={...z,variants:U}}else F.sections=ge;be.mutate({blockKey:x,data:F},{onSuccess:()=>g?.(),onError:z=>G.error(`Save failed: ${z.message}`)})},on)},Ka=t=>{T(t),L(0),M([]),X(f=>f+1);const a=I[t],s=Pe[t];if(!a||!s)return;if(s.isMultivariate){at(a,s,0,t);return}const i=ut(a,s,o);if(!i){P(null),D(null),he(null),Q(null),vt(null,t,0);return}P(i.data),D(i.resolveType),he(null),Q(null),vt(null,t,0)},gn=t=>{const a=t;P(a),u!==null&&Ea(a,u)},Zt=t=>{if(!j||!o||!l||!ze)return;const a={kind:"page",pageKey:j,pageName:String(ze.name??""),path:String(ze.path??"")},s=$n(o,a,l);s&&Ht.save(j,()=>{const i=xa.getQueryData(xs.decofile(ba))?.[j];if(!i||typeof i!="object"||i===null||Array.isArray(i))return null;const f={...i,...Wt.current};return Wt.current={},t?.raw!==void 0?{...f,seo:t.raw}:t?.inner!==void 0?Ar(a,s,f,t.inner):f})},$a=(t,a)=>{j&&(Wt.current[t]=a,Zt())},Oa=(t,a)=>{if(!j)return;const s=Rt([...I],t,a);u!==null&&(u===t?T(a):t<u&&a>=u?T(u-1):t>u&&a<=u&&T(u+1)),Ue(s)},Ba=t=>{if(!j)return;const a=I.filter((s,i)=>i!==t);u===t?St():u!==null&&u>t&&T(u-1),Ue(a)},La=t=>{if(!j)return;const a=I[t];if(!a)return;const s=[...I];s.splice(t+1,0,nr(a)),u!==null&&u>t&&T(u+1),Ue(s)},Fa=t=>{if(!j)return;const a=I[t],s=Pe[t];if(!a||!s||s.isMultivariate)return;const i=s.isHidden?er(a):tr(a);if(!i)return;const f=[...I];f[t]=i,u===t&&St(),Ue(f)},Ia=t=>{if(!j)return;const a=I[t],s=Pe[t];if(!a||!s||s.isMultivariate)return;const i=Zs(a);if(!i)return;const f=[...I];f[t]=i,u===t&&St(),Ue(f)},za=t=>{if(!j)return;const a=I[t],s=Pe[t];if(!a||!s?.isSavedBlock)return;const i=ut(a,s,o);if(!i?.data)return;const{name:f,...b}=i.data,x=[...I];s.isLazy?x[t]={...a,section:b}:x[t]=b,u===t&&St(),Ue(x)},Ha=t=>{if(!j)return;const a=[...I,{__resolveType:t.resolveType}],s=a.length-1;Ue(a,{onSuccess:()=>{de(!1),T(s),L(0),M([]),X(x=>x+1);const i=a[s],f=Bt(a,o)[s];if(!i||!f)return;if(f.isMultivariate){at(i,f,0);return}const b=ut(i,f,o);if(!b){P(null),D(null),he(null),Q(null);return}P(b.data),D(b.resolveType),he(null),Q(null)}})},Ua=t=>{if(u===null)return;const a=I[u],s=Pe[u];!a||!s?.isMultivariate||(L(t),M([]),X(i=>i+1),at(a,s,t,u,!0))},Ga=t=>{if(u===null||!j)return;const a=I[u],s=Pe[u];if(!a||!s?.isMultivariate)return;const i=Je(a,s);if(!i)return;const f=Js(i,t);if(!f){G.error("Cannot delete the only variant.");return}const b=[...I];b[u]=dt(a,s,f);const x=f.variants;let C=ee;t===ee?C=Math.min(t,x.length-1):t<ee&&(C=ee-1),L(C),M([]),X(Y=>Y+1),at(b[u],s,C),Ue(b)},Wa=t=>{if(u===null||!j)return;const a=I[u],s=Pe[u];if(!a||!s?.isMultivariate)return;const i=Je(a,s);if(!i)return;const f=Qs(i,t),b=[...I];b[u]=dt(a,s,f);const x=t+1;L(x),M([]),X(C=>C+1),at(b[u],s,x),Ue(b)},qa=(t,a)=>{if(u===null||!j||t===a)return;const s=I[u],i=Pe[u];if(!s||!i?.isMultivariate)return;const f=Je(s,i);if(!f)return;const b=qs(f,t,a),x=[...I];x[u]=dt(s,i,b);let C=ee;ee===t?C=a:t<ee&&a>=ee?C=ee-1:t>ee&&a<=ee&&(C=ee+1),L(C),at(x[u],i,C),Ue(x)},en=t=>{const a=t??u;if(a===null||!j)return;const s=I[a],i=Pe[a];if(!s||!i)return;const f=Us(s,i);if(!f){G.error("This section cannot have variants.");return}const b=[...I];b[a]=f.section;const x=Bt(b,o)[a];if(!x?.isMultivariate){G.error("Could not add variant.");return}T(a),L(f.newVariantIndex),M([]),X(C=>C+1),at(f.section,x,f.newVariantIndex,a),Ue(b)},Ya=()=>{if(u===null||!j)return;const t=I[u],a=Pe[u];if(!t||!a?.isMultivariate)return;const s=Je(t,a);if(!s)return;const i=Ys(t,a,s);if(!i){G.error("Could not remove variants.");return}const f=[...I];f[u]=i;const b=Bt(f,o)[u];if(!b)return;L(0),he(null),Q(null),M([]),X(C=>C+1);const x=ut(i,b,o);x?(P(x.data),D(x.resolveType)):(P(null),D(null)),vt(null,u,0),Ue(f)},Ja=async t=>{if(De===null||!j)return;const a=rn(t,o);if(a){G.error(a);return}const s=I[De],i=Pe[De];if(!s||!i)return;const f=ut(s,i,o);if(!f){G.error("This section cannot be saved as global.");return}const b={...f.data,name:t};try{await be.mutateAsync({blockKey:t,data:b});const x=[...I];x[De]={__resolveType:t},await be.mutateAsync({blockKey:j,data:wt(o,j,x,Ce,Be)}),u===De&&St(),ve(null),G.success(`Saved global block "${t}"`),g?.()}catch(x){G.error(x instanceof Error?x.message:"Failed to save global block")}},vn=nt?.rule;if(Tt&&u===null&&ue===null&&vn){const{resolveType:t,formValue:a}=jt(vn,o??{},l??void 0);ie(t),E(a)}const At=l?Bs(l):[],Sn=l&&o?Ls(l,o):[],Qa=!_e&&!!(d&&l&&o),xn=ue&&l?Ot(ue,l):null,Mt=()=>{ht.current&&(clearTimeout(ht.current),ht.current=null),gt.current&&(clearTimeout(gt.current),gt.current=null)},_t=async(t,a)=>{if(!(sr(a,t,l)>0))try{await Ut.mutateAsync({blockKey:t})}catch(s){G.error(s instanceof Error?s.message:"Could not delete matcher block")}},bn=t=>{ht.current&&clearTimeout(ht.current),ht.current=setTimeout(()=>{const{activePageKey:a,decofile:s,variantIndex:i}=qe.current;if(!a)return;const f={...s[a]},b={...f.sections},x=[...b.variants??[]],C=x[i],Y=C?.rule;if(xt(Y,s,l)){const A=Y?.__resolveType??"",O=s[A],F=typeof O?.name=="string"?O.name:A,{__resolveType:ge,...z}=t;be.mutate({blockKey:A,data:bt(ge??"",z,F)},{onSuccess:()=>g?.(),onError:U=>G.error(`Save failed: ${U.message}`)});return}C&&(x[i]={...C,rule:t}),f.sections={...b,variants:x},be.mutate({blockKey:a,data:f},{onSuccess:()=>g?.(),onError:A=>G.error(`Save failed: ${A.message}`)})},on)},Xa=t=>{ie(t);const a=t?{__resolveType:t}:{__resolveType:Kn};E({}),bn(a)},Za=t=>{const a=t;E(a);const s=ue?{__resolveType:ue,...a}:{...a};bn(s)},es=async t=>{Mt();const{activePageKey:a,decofile:s,variantIndex:i}=qe.current;if(!a)return;const f=s[a],b=f?.sections;if(!b||typeof b!="object"||Array.isArray(b))return;const x=b;if(!Array.isArray(x.variants))return;const C=[...x.variants],Y=C[i];if(!Y)return;const A=kt(Y.rule,s,l),O=Ft(t);C[i]={...Y,rule:O};const F={...s,[a]:{...f,sections:{...x,variants:C}}},{resolveType:ge,formValue:z}=jt(O,F,l??void 0);ie(ge),E(z);try{await be.mutateAsync({blockKey:a,data:F[a]}),A&&A!==t&&await _t(A,F),g?.()}catch(U){G.error(U instanceof Error?U.message:"Could not apply saved rule")}},yn=t=>{gt.current&&clearTimeout(gt.current);const{selectedSectionIndex:a,sectionVariantIndex:s}=qe.current;a!==null&&(gt.current=setTimeout(()=>{const{rawSections:i,parsedSections:f,decofile:b,activePageKey:x,pageVariants:C,variantIndex:Y}=qe.current;if(!x)return;const A=i[a],O=f[a];if(!A||!O?.isMultivariate)return;const F=Je(A,O);if(!F)return;const z=(F.variants??[])[s]?.rule;if(xt(z,b,l)){const fe=z?.__resolveType??"",Ge=b[fe],Ze=typeof Ge?.name=="string"?Ge.name:fe,{__resolveType:rt,...et}=t;be.mutate({blockKey:fe,data:bt(rt??"",et,Ze)},{onSuccess:()=>g?.(),onError:ot=>G.error(`Save failed: ${ot.message}`)});return}const U=Pn(F,s,t),Ne=[...i];Ne[a]=dt(A,O,U);const Ye=wt(b,x,Ne,Y,C);be.mutate({blockKey:x,data:Ye},{onSuccess:()=>g?.(),onError:fe=>G.error(`Save failed: ${fe.message}`)})},on))},ts=t=>{he(t),Q({}),yn(t?{__resolveType:t}:{__resolveType:Kn})},ns=t=>{const a=t;Q(a);const s=Ie?{__resolveType:Ie,...a}:{...a};yn(s)},as=async t=>{Mt();const{selectedSectionIndex:a,sectionVariantIndex:s,rawSections:i,parsedSections:f,decofile:b,activePageKey:x,pageVariants:C,variantIndex:Y}=qe.current;if(a===null||!x)return;const A=i[a],O=f[a];if(!A||!O?.isMultivariate)return;const F=Je(A,O);if(!F)return;const ge=F.variants??[],z=kt(ge[s]?.rule,b,l),U=Ft(t),Ne=Pn(F,s,U),Ye=[...i];Ye[a]=dt(A,O,Ne);const fe=wt(b,x,Ye,Y,C),Ge={...b,[x]:fe},{resolveType:Ze,formValue:rt}=jt(U,Ge,l??void 0);he(Ze),Q(rt);try{await be.mutateAsync({blockKey:x,data:fe}),z&&z!==t&&await _t(z,Ge),g?.()}catch(et){G.error(et instanceof Error?et.message:"Could not apply saved rule")}};if(!_e&&!ze)return n.jsxs("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:["No page found for ",h]});if(_e&&!qt)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:"Global block not found"});const st=u!==null?Pe[u]??null:null,_n=u!==null?I[u]:null,jn=_n&&st?.isMultivariate?Je(_n,st):null,lt=jn?Vn(jn,tt):[],tn=Math.min(ee,Math.max(lt.length-1,0)),Et=lt[tn]??null,ct=st?.isMultivariate===!0,kn=u!==null&&st!==null,Kt=kn&&(ct||!!(Xt&&se)),ss=Kt&&!_e&&st?.isSavedBlock===!0,Xe=_e||ss,rs=_e?mn:st?.label??"",wn=Ie&&l?Ot(Ie,l):null,nn=Kt&&(!_e||je.length>0)?_e?[mn,...je]:[ze.name,st.label,...ct&&Et?[Et.label]:[],...je]:[],os=Z&&ze?[ze.name,"SEO",...Me]:[],$t=Z?os:Xe?nn.length>0?nn:[rs]:nn,Rn=()=>{if(!j)return;const t=o[j],a=Gs(t.sections,I);if(!a)return;const s=Ws(a);be.mutate({blockKey:j,data:{...t,sections:a}},{onSuccess:()=>{B(s),T(null),P(null),D(null),M([]),E(null),ie(null)},onError:i=>G.error(`Save failed: ${i.message}`)})},an=(t,a,s)=>{if(!j)return;const i=o[j],f=i.sections;if(!f||typeof f!="object"||Array.isArray(f))return;const b=f;if(!Array.isArray(b.variants))return;const x=t([...b.variants]);if(!x)return;const C=or(b,x),Y={...o,[j]:{...i,sections:C}};be.mutate({blockKey:j,data:Y[j]},{onSuccess:()=>{a?.(),s&&_t(s,Y)},onError:A=>G.error(`Save failed: ${A.message}`)})},is=t=>{W(null),B(t),T(null),P(null),D(null),M([]);const a=Be[t]?.rule,{resolveType:s,formValue:i}=jt(a,o??{},l??void 0);ie(s),E(i),hn(Be.map(f=>({rule:f.rule})),t)},ls=(t,a)=>{if(t===a)return;let s=Ce;Ce===t?s=a:t<Ce&&a>=Ce?s=Ce-1:t>Ce&&a<=Ce&&(s=Ce+1),B(s);const i=Rt(Be.map(f=>({rule:f.rule})),t,a);hn(i,s),an(f=>Rt(f,t,a))},cs=t=>{const a=Be[t]?.rule,s=kt(a,o??{},l??void 0);an(i=>i.length<=1?null:(i.splice(t,1),i),()=>{Be.length-1===1?B(0):t<Ce?B(Ce-1):t===Ce&&B(Math.max(0,t-1)),T(null),P(null),D(null),M([]),E(null),ie(null)},s)},us=t=>{an(a=>ir(a,t),()=>{B(t+1),T(null),P(null),D(null),M([]),E(null),ie(null)})},ds=async(t,a)=>{Mt();const s=qe.current.activePageKey,i=qe.current.decofile;if(!s)return;const f=i[s],b=f.sections;if(!b||typeof b!="object"||Array.isArray(b))return;const x=b;if(!Array.isArray(x.variants))return;const C=[...x.variants],Y=C[t];if(!Y?.rule||typeof Y.rule!="object"){G.error("This variant has no matcher rule to rename.");return}const A=Y.rule,O=a.trim();Ct(!0);try{if(!O){if(!xt(A,i,l)){W(null);return}const Ye=A.__resolveType??"";C[t]={...Y,rule:An(A,i,l)};const fe={...i,[s]:{...f,sections:{...x,variants:C}}};await be.mutateAsync({blockKey:s,data:fe[s]}),await _t(Ye,fe),W(null),g?.();return}const F=Mn(A,i,l);if(!F){G.error("Could not read this variant's matcher rule.");return}if(F.blockKey){await be.mutateAsync({blockKey:F.blockKey,data:bt(F.resolveType,F.data,O)}),W(null),g?.();return}const ge=sn(O),z=rn(ge,i);if(z){G.error(z);return}const U=bt(F.resolveType,F.data,O);let Ne=null;try{await be.mutateAsync({blockKey:ge,data:U}),Ne=ge,C[t]={...Y,rule:Ft(ge)},await be.mutateAsync({blockKey:s,data:{...f,sections:{...x,variants:C}}}),Ne=null}catch(Ye){throw Ne&&await Ut.mutateAsync({blockKey:Ne}).catch(()=>{}),Ye}W(null),G.success(`Saved matcher as global block "${O}"`),g?.()}catch(F){G.error(F instanceof Error?F.message:"Failed to rename variant")}finally{Ct(!1)}},ms=async(t,a)=>{Mt();const{selectedSectionIndex:s,rawSections:i,parsedSections:f,decofile:b,activePageKey:x,pageVariants:C,variantIndex:Y}=qe.current;if(s===null||!x)return;const A=i[s],O=f[s];if(!A||!O?.isMultivariate)return;const F=Je(A,O);if(!F)return;const ge=F.variants??[],z=ge[t];if(!z?.rule||typeof z.rule!="object"){G.error("This variant has no matcher rule to rename.");return}const U=z.rule,Ne=a.trim();Ct(!0);const Ye=async fe=>{const Ge={...F,variants:fe},Ze=[...i];Ze[s]=dt(A,O,Ge);const rt=wt(b,x,Ze,Y,C);return await be.mutateAsync({blockKey:x,data:rt}),{...b,[x]:rt}};try{if(!Ne){if(!xt(U,b,l)){ne(null);return}const ot=U.__resolveType??"",Cn=[...ge];Cn[t]={...z,rule:An(U,b,l)};const vs=await Ye(Cn);await _t(ot,vs),ne(null),g?.();return}const fe=Mn(U,b,l);if(!fe){G.error("Could not read this variant's matcher rule.");return}if(fe.blockKey){await be.mutateAsync({blockKey:fe.blockKey,data:bt(fe.resolveType,fe.data,Ne)}),ne(null),g?.();return}const Ge=sn(Ne),Ze=rn(Ge,b);if(Ze){G.error(Ze);return}const rt=bt(fe.resolveType,fe.data,Ne);let et=null;try{await be.mutateAsync({blockKey:Ge,data:rt}),et=Ge;const ot=[...ge];ot[t]={...z,rule:Ft(Ge)},await Ye(ot),et=null}catch(ot){throw et&&await Ut.mutateAsync({blockKey:et}).catch(()=>{}),ot}ne(null),G.success(`Saved matcher as global block "${Ne}"`),g?.()}catch(fe){G.error(fe instanceof Error?fe.message:"Failed to rename variant")}finally{Ct(!1)}},Nn=()=>{St()},fs=t=>{Te(t),Zt({inner:t})},ps=t=>{Fe(t),Zt({raw:t})},hs=()=>{Te(null),xe([])},gs=()=>me(t=>t+1),Dn=t=>{if(Z){if(t===0){Ht.flush(),we(!1),Te(null),Fe(void 0),xe([]),me(s=>s+1),V?.();return}if(t===1){xe([]),me(s=>s+1);return}xe(Me.slice(0,t-1)),me(s=>s+1);return}if(_e){M(je.slice(0,t)),X(s=>s+1);return}if(t===0){Nn();return}if(t===1){M([]),X(s=>s+1);return}if(ct&&t===2){M([]),X(s=>s+1);return}const a=ct?2:1;M(je.slice(0,t-a))};return n.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[n.jsx("div",{className:"shrink-0",children:Xe||Kt||Z?n.jsxs("div",{className:Ee("border-b px-3 py-2.5",Xe&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[n.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[$t.length>1&&n.jsx("button",{type:"button",onClick:()=>Dn($t.length-2),title:"Back","aria-label":"Back",className:Ee("shrink-0 inline-flex size-6 items-center justify-center rounded-md transition-colors",Xe?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:n.jsx(ra,{className:"size-4"})}),!_e&&Tt&&nt&&n.jsxs("button",{type:"button",onClick:Nn,title:`Editing in variant: ${nt.label}`,className:Ee("shrink-0 inline-flex items-center gap-1 rounded-md h-6 px-1.5 text-xs font-medium cursor-pointer transition-opacity hover:opacity-80",ro),children:[n.jsx(va,{rule:Nt(nt.rule,o??{},l??void 0),matchers:At}),n.jsx("span",{className:"max-w-[160px] truncate",children:nt.label})]}),n.jsx("nav",{"aria-label":"Editing breadcrumb",className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:$t.map((t,a)=>{const s=a===$t.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[a>0&&n.jsx(oa,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>Dn(a),title:t,className:Ee("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",s?Xe?"font-semibold text-global-section-fg dark:text-global-section-fg-dark":"font-medium text-foreground":Xe?"text-foreground/80":"text-muted-foreground",Xe?"hover:bg-global-section/15":"hover:bg-accent hover:text-accent-foreground"),children:t})]},`${t}-${a}`)})}),Xe&&n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(fr,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(pt,{side:"bottom",className:"max-w-[260px]",children:"A global section is a reusable block shared across your site. Editing it here updates it everywhere it's used."})]}),kn&&!ct&&!st?.isHidden&&j&&n.jsx(zn,{onClick:()=>en()})]}),Xe&&n.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:"This is a global section. Changes apply everywhere this section is used across your site."})]}):n.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx(io,{pageKey:j,initialName:ze.name,initialPath:ze.path,onFieldChange:$a})}),n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx(We,{type:"button",variant:"ghost",size:"icon","aria-label":"Edit SEO",className:"size-7 shrink-0",onClick:()=>we(!0),children:n.jsx(dr,{size:14})})}),n.jsx(pt,{side:"bottom",children:"Edit SEO"})]}),n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx(We,{type:"button",variant:"ghost",size:"icon","aria-label":"View JSON",className:"size-7 shrink-0",onClick:()=>R&&j?R(j):$(!0),children:n.jsx(mr,{size:14})})}),n.jsx(pt,{side:"bottom",children:"View JSON"})]}),n.jsx(zn,{onClick:Rn})]})}),Z?n.jsx(It,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsx("div",{className:"mx-auto max-w-2xl",children:Vt&&j?n.jsx(Pr,{rawSeo:Jt,innerSeo:fn,defaultResolveType:Ta,seoSchema:Pa,activeResolveType:Qt,seoTypeOptions:Va,formResetKey:Re,siteDefaultSeo:Aa,onBreadcrumbChange:xe,onPersistRaw:ps,onInnerChange:fs,onClearForm:hs,onBumpFormKey:gs}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:"SEO schema not found for this site."})})})}):Kt?n.jsxs(It,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[ct&<.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(Fs,{listKey:`${j??""}:${u??""}`,variants:lt.map((t,a)=>({index:a,label:t.label})),selectedIndex:tn,onSelect:Ua,onRename:ne,onDuplicate:Wa,onDelete:Ga,onRemoveAll:Ya,onReorder:qa,onAdd:()=>en()}),ct&&n.jsxs("div",{className:"px-3 py-3 border-b space-y-2",children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variant rule"}),n.jsx(Tn,{currentRt:Ie??"",currentLabel:Lt(Et?.rule,o??{},tt,l??void 0),currentGlobalKey:kt(Et?.rule,o??{},l??void 0)??void 0,matchers:At,globals:Sn,onSelect:ts,onSelectGlobal:as}),wn&&ae&&n.jsx("div",{className:"pt-1",children:n.jsx(Fn,{schema:wn,value:ae,onChange:ns,meta:l??void 0,decofile:o,onSaveReferencedBlock:Dt,sandbox:Pt},`${u??"none"}:${tn}:${Ie??""}`)})]})]}),n.jsx(In,{activeSchema:Xt,formValue:se,formResetKey:Ae,onFormChange:gn,onBreadcrumbChange:M,breadcrumbPath:je,emptyMessage:"No editable fields for this variant.",meta:l,decofile:o,onSaveReferencedBlock:Dt,sandbox:Pt})]}):_e?n.jsx(It,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx(In,{activeSchema:Xt,formValue:se,formResetKey:Ae,onFormChange:gn,onBreadcrumbChange:M,breadcrumbPath:je,emptyMessage:"No editable fields for this global block.",meta:l,decofile:o,onSaveReferencedBlock:Dt,sandbox:Pt})}):n.jsxs(It,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[Tt&&j&&n.jsx(ao,{listKey:j,variants:Be,activeIndex:Ce,decofile:o??{},meta:l,matchers:At,onSelect:is,onReorder:ls,onRename:W,onDuplicate:us,onDelete:cs,onAdd:Rn}),Tt&&ue!==null&&n.jsxs("div",{className:Ee("px-3 border-b",le?"pt-3 pb-5 space-y-3":"py-2"),children:[n.jsxs("button",{type:"button",onClick:()=>ke(t=>!t),className:"flex w-full items-center justify-between gap-2 text-left cursor-pointer rounded-sm py-0.5 hover:bg-muted/40","aria-expanded":le,children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variant rule"}),le?n.jsx(cr,{className:"size-3.5 shrink-0 text-muted-foreground"}):n.jsx(lr,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),le&&n.jsxs("div",{className:Ee("space-y-3",yt&&"pointer-events-none opacity-50"),children:[n.jsx(Tn,{currentRt:ue,currentLabel:Lt(nt?.rule,o??{},tt,l??void 0),currentGlobalKey:kt(nt?.rule,o??{},l??void 0)??void 0,matchers:At,globals:Sn,onSelect:Xa,onSelectGlobal:es}),xn&&Ve&&n.jsx("div",{className:"space-y-3",children:n.jsx(Fn,{schema:xn,value:Ve,onChange:Za,meta:l??void 0,decofile:o,onSaveReferencedBlock:Dt,sandbox:Pt},`${Ce}:${ue??""}`)})]})]}),n.jsx("div",{className:"p-2 pt-3",children:n.jsx(qr,{listKey:`${j??""}-${Ce}`,rawSections:I,sections:Pe,meta:l,selectedIndex:u,onSelect:Ka,onReorder:Oa,onDelete:Ba,onDuplicate:La,onMakeReusable:ve,onToggleHidden:Fa,onToggleLazy:Ia,onAddVariant:en,onDetach:za,onAddSection:()=>de(!0),canAddSection:Qa})})]}),n.jsx(Is,{open:De!==null,onOpenChange:t=>{t||ve(null)},defaultBlockId:De!==null?sn(Pe[De]?.label??""):"",isPending:be.isPending,onSubmit:Ja}),d&&n.jsx(Er,{open:Se,onOpenChange:de,meta:l,decofile:o,previewBaseUrl:d,onSelect:Ha}),ye&&j&&o&&n.jsx(zs,{open:ye,onOpenChange:$,pageKey:j,decofile:o}),re!==null&&n.jsx(Bn,{open:!0,initialName:xt(Be[re]?.rule,o??{},l??void 0)?Lt(Be[re]?.rule,o??{},tt,l??void 0):"",autoLabel:tt(Nt(Be[re]?.rule,o??{},l??void 0)),isPending:yt,onSubmit:async t=>{await ds(re,t)},onOpenChange:t=>{!t&&!yt&&W(null)}}),q!==null&&n.jsx(Bn,{open:!0,initialName:xt(lt[q]?.rule,o??{},l??void 0)?Lt(lt[q]?.rule,o??{},tt,l??void 0):"",autoLabel:tt(Nt(lt[q]?.rule,o??{},l??void 0)),isPending:yt,onSubmit:async t=>{await ms(q,t)},onOpenChange:t=>{!t&&!yt&&ne(null)}})]})}export{ic as SectionsEditor};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as i,aT as nt,aR as Pe,j as d,cR as rt,aV as be,aS as k,cS as st,aO as j,aU as _,bM as $,cT as lt,at as Ne,cU as Ee,aP as at,bI as ct,bO as it,c_ as dt,c$ as ut,d0 as pt,d1 as ft,cV as mt,aQ as ht,d2 as vt,cW as gt,cY as xt,c as ee,l as oe}from"./index-CcnDuzQF.js";import{V as St}from"./tooltip-2I_b-6X7.js";import{i as wt}from"./Check-BH0H5-aR.js";import{t as Re}from"./ChevronDown-B1YuVRBJ.js";import{n as Ct}from"./ChevronUp-DGgV5Zh7.js";function _e(r,[e,t]){return Math.min(t,Math.max(e,r))}var yt=[" ","Enter","ArrowUp","ArrowDown"],It=[" ","Enter"],Q="Select",[de,ue,bt]=at(Q),[ne]=ht(Q,[bt,Ee]),pe=Ee(),[Tt,G]=ne(Q),[Pt,_t]=ne(Q),je=r=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:n,onOpenChange:c,value:s,defaultValue:l,onValueChange:a,dir:u,name:h,autoComplete:g,disabled:b,required:w,form:S}=r,p=pe(e),[v,C]=i.useState(null),[m,x]=i.useState(null),[U,M]=i.useState(!1),re=nt(u),[N,O]=Pe({prop:o,defaultProp:n??!1,onChange:c,caller:Q}),[F,q]=Pe({prop:s,defaultProp:l,onChange:a,caller:Q}),L=i.useRef(null),B=v?S||!!v.closest("form"):!0,[W,V]=i.useState(new Set),H=Array.from(W).map(E=>E.props.value).join(";");return d.jsx(rt,{...p,children:d.jsxs(Tt,{required:w,scope:e,trigger:v,onTriggerChange:C,valueNode:m,onValueNodeChange:x,valueNodeHasChildren:U,onValueNodeHasChildrenChange:M,contentId:be(),value:F,onValueChange:q,open:N,onOpenChange:O,dir:re,triggerPointerDownPosRef:L,disabled:b,children:[d.jsx(de.Provider,{scope:e,children:d.jsx(Pt,{scope:r.__scopeSelect,onNativeOptionAdd:i.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:i.useCallback(E=>{V(D=>{const z=new Set(D);return z.delete(E),z})},[]),children:t})}),B?d.jsxs(Je,{"aria-hidden":!0,required:w,tabIndex:-1,name:h,autoComplete:g,value:F,onChange:E=>q(E.target.value),disabled:b,form:S,children:[F===void 0?d.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};je.displayName=Q;var Me="SelectTrigger",Ae=i.forwardRef((r,e)=>{const{__scopeSelect:t,disabled:o=!1,...n}=r,c=pe(t),s=G(Me,t),l=s.disabled||o,a=k(e,s.onTriggerChange),u=ue(t),h=i.useRef("touch"),[g,b,w]=tt(p=>{const v=u().filter(x=>!x.disabled),C=v.find(x=>x.value===s.value),m=ot(v,p,C);m!==void 0&&s.onValueChange(m.value)}),S=p=>{l||(s.onOpenChange(!0),w()),p&&(s.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return d.jsx(st,{asChild:!0,...c,children:d.jsx(j.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":et(s.value)?"":void 0,...n,ref:a,onClick:_(n.onClick,p=>{p.currentTarget.focus(),h.current!=="mouse"&&S(p)}),onPointerDown:_(n.onPointerDown,p=>{h.current=p.pointerType;const v=p.target;v.hasPointerCapture(p.pointerId)&&v.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:_(n.onKeyDown,p=>{const v=g.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&b(p.key),!(v&&p.key===" ")&&yt.includes(p.key)&&(S(),p.preventDefault())})})})});Ae.displayName=Me;var Oe="SelectValue",De=i.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,children:c,placeholder:s="",...l}=r,a=G(Oe,t),{onValueNodeHasChildrenChange:u}=a,h=c!==void 0,g=k(e,a.onValueNodeChange);return $(()=>{u(h)},[u,h]),d.jsx(j.span,{...l,ref:g,style:{pointerEvents:"none"},children:et(a.value)?d.jsx(d.Fragment,{children:s}):c})});De.displayName=Oe;var Nt="SelectIcon",ke=i.forwardRef((r,e)=>{const{__scopeSelect:t,children:o,...n}=r;return d.jsx(j.span,{"aria-hidden":!0,...n,ref:e,children:o||"▼"})});ke.displayName=Nt;var Et="SelectPortal",Le=r=>d.jsx(lt,{asChild:!0,...r});Le.displayName=Et;var J="SelectContent",Be=i.forwardRef((r,e)=>{const t=G(J,r.__scopeSelect),[o,n]=i.useState();if($(()=>{n(new DocumentFragment)},[]),!t.open){const c=o;return c?Ne.createPortal(d.jsx(Ve,{scope:r.__scopeSelect,children:d.jsx(de.Slot,{scope:r.__scopeSelect,children:d.jsx("div",{children:r.children})})}),c):null}return d.jsx(He,{...r,ref:e})});Be.displayName=J;var A=10,[Ve,Y]=ne(J),Rt="SelectContentImpl",jt=vt("SelectContent.RemoveScroll"),He=i.forwardRef((r,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:c,onPointerDownOutside:s,side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:v,...C}=r,m=G(J,t),[x,U]=i.useState(null),[M,re]=i.useState(null),N=k(e,f=>U(f)),[O,F]=i.useState(null),[q,L]=i.useState(null),B=ue(t),[W,V]=i.useState(!1),H=i.useRef(!1);i.useEffect(()=>{if(x)return dt(x)},[x]),ut();const E=i.useCallback(f=>{const[T,...R]=B().map(P=>P.ref.current),[y]=R.slice(-1),I=document.activeElement;for(const P of f)if(P===I||(P?.scrollIntoView({block:"nearest"}),P===T&&M&&(M.scrollTop=0),P===y&&M&&(M.scrollTop=M.scrollHeight),P?.focus(),document.activeElement!==I))return},[B,M]),D=i.useCallback(()=>E([O,x]),[E,O,x]);i.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=m;i.useEffect(()=>{if(x){let f={x:0,y:0};const T=y=>{f={x:Math.abs(Math.round(y.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(y.pageY)-(K.current?.y??0))}},R=y=>{f.x<=10&&f.y<=10?y.preventDefault():x.contains(y.target)||z(!1),document.removeEventListener("pointermove",T),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",T),document.addEventListener("pointerup",R,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",R,{capture:!0})}}},[x,z,K]),i.useEffect(()=>{const f=()=>z(!1);return window.addEventListener("blur",f),window.addEventListener("resize",f),()=>{window.removeEventListener("blur",f),window.removeEventListener("resize",f)}},[z]);const[fe,ae]=tt(f=>{const T=B().filter(I=>!I.disabled),R=T.find(I=>I.ref.current===document.activeElement),y=ot(T,f,R);y&&setTimeout(()=>y.ref.current.focus())}),me=i.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&(F(f),y&&(H.current=!0))},[m.value]),he=i.useCallback(()=>x?.focus(),[x]),te=i.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&L(f)},[m.value]),ce=o==="popper"?Se:ze,se=ce===Se?{side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:v}:{};return d.jsx(Ve,{scope:t,content:x,viewport:M,onViewportChange:re,itemRefCallback:me,selectedItem:O,onItemLeave:he,itemTextRefCallback:te,focusSelectedItem:D,selectedItemText:q,position:o,isPositioned:W,searchRef:fe,children:d.jsx(pt,{as:jt,allowPinchZoom:!0,children:d.jsx(ft,{asChild:!0,trapped:m.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:_(n,f=>{m.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:d.jsx(mt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:c,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:d.jsx(ce,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:f=>f.preventDefault(),...C,...se,onPlaced:()=>V(!0),ref:N,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:_(C.onKeyDown,f=>{const T=f.ctrlKey||f.altKey||f.metaKey;if(f.key==="Tab"&&f.preventDefault(),!T&&f.key.length===1&&ae(f.key),["ArrowUp","ArrowDown","Home","End"].includes(f.key)){let y=B().filter(I=>!I.disabled).map(I=>I.ref.current);if(["ArrowUp","End"].includes(f.key)&&(y=y.slice().reverse()),["ArrowUp","ArrowDown"].includes(f.key)){const I=f.target,P=y.indexOf(I);y=y.slice(P+1)}setTimeout(()=>E(y)),f.preventDefault()}})})})})})})});He.displayName=Rt;var Mt="SelectItemAlignedPosition",ze=i.forwardRef((r,e)=>{const{__scopeSelect:t,onPlaced:o,...n}=r,c=G(J,t),s=Y(J,t),[l,a]=i.useState(null),[u,h]=i.useState(null),g=k(e,N=>h(N)),b=ue(t),w=i.useRef(!1),S=i.useRef(!0),{viewport:p,selectedItem:v,selectedItemText:C,focusSelectedItem:m}=s,x=i.useCallback(()=>{if(c.trigger&&c.valueNode&&l&&u&&p&&v&&C){const N=c.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),F=c.valueNode.getBoundingClientRect(),q=C.getBoundingClientRect();if(c.dir!=="rtl"){const I=q.left-O.left,P=F.left-I,X=N.left-P,Z=N.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=_e(P,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.left=xe+"px"}else{const I=O.right-q.right,P=window.innerWidth-F.right-I,X=window.innerWidth-N.right-P,Z=N.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=_e(P,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.right=xe+"px"}const L=b(),B=window.innerHeight-A*2,W=p.scrollHeight,V=window.getComputedStyle(u),H=parseInt(V.borderTopWidth,10),E=parseInt(V.paddingTop,10),D=parseInt(V.borderBottomWidth,10),z=parseInt(V.paddingBottom,10),K=H+E+W+z+D,fe=Math.min(v.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=N.top+N.height/2-A,ce=B-te,se=v.offsetHeight/2,f=v.offsetTop+se,T=H+E+f,R=K-T;if(T<=te){const I=L.length>0&&v===L[L.length-1].ref.current;l.style.bottom="0px";const P=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(ce,se+(I?he:0)+P+D),Z=T+X;l.style.height=Z+"px"}else{const I=L.length>0&&v===L[0].ref.current;l.style.top="0px";const X=Math.max(te,H+p.offsetTop+(I?me:0)+se)+R;l.style.height=X+"px",p.scrollTop=T-te+p.offsetTop}l.style.margin=`${A}px 0`,l.style.minHeight=fe+"px",l.style.maxHeight=B+"px",o?.(),requestAnimationFrame(()=>w.current=!0)}},[b,c.trigger,c.valueNode,l,u,p,v,C,c.dir,o]);$(()=>x(),[x]);const[U,M]=i.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const re=i.useCallback(N=>{N&&S.current===!0&&(x(),m?.(),S.current=!1)},[x,m]);return d.jsx(Ot,{scope:t,contentWrapper:l,shouldExpandOnScrollRef:w,onScrollButtonChange:re,children:d.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:U},children:d.jsx(j.div,{...n,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});ze.displayName=Mt;var At="SelectPopperPosition",Se=i.forwardRef((r,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:n=A,...c}=r,s=pe(t);return d.jsx(gt,{...s,...c,ref:e,align:o,collisionPadding:n,style:{boxSizing:"border-box",...c.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Se.displayName=At;var[Ot,Te]=ne(J,{}),we="SelectViewport",Ue=i.forwardRef((r,e)=>{const{__scopeSelect:t,nonce:o,...n}=r,c=Y(we,t),s=Te(we,t),l=k(e,c.onViewportChange),a=i.useRef(0);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),d.jsx(de.Slot,{scope:t,children:d.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:_(n.onScroll,u=>{const h=u.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:b}=s;if(b?.current&&g){const w=Math.abs(a.current-h.scrollTop);if(w>0){const S=window.innerHeight-A*2,p=parseFloat(g.style.minHeight),v=parseFloat(g.style.height),C=Math.max(p,v);if(C<S){const m=C+w,x=Math.min(S,m),U=m-x;g.style.height=x+"px",g.style.bottom==="0px"&&(h.scrollTop=U>0?U:0,g.style.justifyContent="flex-end")}}}a.current=h.scrollTop})})})]})});Ue.displayName=we;var Fe="SelectGroup",[Dt,kt]=ne(Fe),Lt=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=be();return d.jsx(Dt,{scope:t,id:n,children:d.jsx(j.div,{role:"group","aria-labelledby":n,...o,ref:e})})});Lt.displayName=Fe;var We="SelectLabel",Bt=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=kt(We,t);return d.jsx(j.div,{id:n.id,...o,ref:e})});Bt.displayName=We;var ie="SelectItem",[Vt,Ke]=ne(ie),$e=i.forwardRef((r,e)=>{const{__scopeSelect:t,value:o,disabled:n=!1,textValue:c,...s}=r,l=G(ie,t),a=Y(ie,t),u=l.value===o,[h,g]=i.useState(c??""),[b,w]=i.useState(!1),S=k(e,m=>a.itemRefCallback?.(m,o,n)),p=be(),v=i.useRef("touch"),C=()=>{n||(l.onValueChange(o),l.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.jsx(Vt,{scope:t,value:o,disabled:n,textId:p,isSelected:u,onItemTextChange:i.useCallback(m=>{g(x=>x||(m?.textContent??"").trim())},[]),children:d.jsx(de.ItemSlot,{scope:t,value:o,disabled:n,textValue:h,children:d.jsx(j.div,{role:"option","aria-labelledby":p,"data-highlighted":b?"":void 0,"aria-selected":u&&b,"data-state":u?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...s,ref:S,onFocus:_(s.onFocus,()=>w(!0)),onBlur:_(s.onBlur,()=>w(!1)),onClick:_(s.onClick,()=>{v.current!=="mouse"&&C()}),onPointerUp:_(s.onPointerUp,()=>{v.current==="mouse"&&C()}),onPointerDown:_(s.onPointerDown,m=>{v.current=m.pointerType}),onPointerMove:_(s.onPointerMove,m=>{v.current=m.pointerType,n?a.onItemLeave?.():v.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:_(s.onPointerLeave,m=>{m.currentTarget===document.activeElement&&a.onItemLeave?.()}),onKeyDown:_(s.onKeyDown,m=>{a.searchRef?.current!==""&&m.key===" "||(It.includes(m.key)&&C(),m.key===" "&&m.preventDefault())})})})})});$e.displayName=ie;var le="SelectItemText",Ge=i.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,...c}=r,s=G(le,t),l=Y(le,t),a=Ke(le,t),u=_t(le,t),[h,g]=i.useState(null),b=k(e,C=>g(C),a.onItemTextChange,C=>l.itemTextRefCallback?.(C,a.value,a.disabled)),w=h?.textContent,S=i.useMemo(()=>d.jsx("option",{value:a.value,disabled:a.disabled,children:w},a.value),[a.disabled,a.value,w]),{onNativeOptionAdd:p,onNativeOptionRemove:v}=u;return $(()=>(p(S),()=>v(S)),[p,v,S]),d.jsxs(d.Fragment,{children:[d.jsx(j.span,{id:a.textId,...c,ref:b}),a.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Ne.createPortal(c.children,s.valueNode):null]})});Ge.displayName=le;var Ye="SelectItemIndicator",qe=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return Ke(Ye,t).isSelected?d.jsx(j.span,{"aria-hidden":!0,...o,ref:e}):null});qe.displayName=Ye;var Ce="SelectScrollUpButton",Xe=i.forwardRef((r,e)=>{const t=Y(Ce,r.__scopeSelect),o=Te(Ce,r.__scopeSelect),[n,c]=i.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollTop>0;c(u)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?d.jsx(Qe,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop-a.offsetHeight)}}):null});Xe.displayName=Ce;var ye="SelectScrollDownButton",Ze=i.forwardRef((r,e)=>{const t=Y(ye,r.__scopeSelect),o=Te(ye,r.__scopeSelect),[n,c]=i.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollHeight-a.clientHeight,h=Math.ceil(a.scrollTop)<u;c(h)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?d.jsx(Qe,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop+a.offsetHeight)}}):null});Ze.displayName=ye;var Qe=i.forwardRef((r,e)=>{const{__scopeSelect:t,onAutoScroll:o,...n}=r,c=Y("SelectScrollButton",t),s=i.useRef(null),l=ue(t),a=i.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return i.useEffect(()=>()=>a(),[a]),$(()=>{l().find(h=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),d.jsx(j.div,{"aria-hidden":!0,...n,ref:e,style:{flexShrink:0,...n.style},onPointerDown:_(n.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(o,50))}),onPointerMove:_(n.onPointerMove,()=>{c.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:_(n.onPointerLeave,()=>{a()})})}),Ht="SelectSeparator",zt=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return d.jsx(j.div,{"aria-hidden":!0,...o,ref:e})});zt.displayName=Ht;var Ie="SelectArrow",Ut=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=pe(t),c=G(Ie,t),s=Y(Ie,t);return c.open&&s.position==="popper"?d.jsx(xt,{...n,...o,ref:e}):null});Ut.displayName=Ie;var Ft="SelectBubbleInput",Je=i.forwardRef(({__scopeSelect:r,value:e,...t},o)=>{const n=i.useRef(null),c=k(o,n),s=ct(e);return i.useEffect(()=>{const l=n.current;if(!l)return;const a=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(a,"value").set;if(s!==e&&h){const g=new Event("change",{bubbles:!0});h.call(l,e),l.dispatchEvent(g)}},[s,e]),d.jsx(j.select,{...t,style:{...St,...t.style},ref:c,defaultValue:e})});Je.displayName=Ft;function et(r){return r===""||r===void 0}function tt(r){const e=it(r),t=i.useRef(""),o=i.useRef(0),n=i.useCallback(s=>{const l=t.current+s;e(l),(function a(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>a(""),1e3))})(l)},[e]),c=i.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return i.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,n,c]}function ot(r,e,t){const n=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,c=t?r.indexOf(t):-1;let s=Wt(r,Math.max(c,0));n.length===1&&(s=s.filter(u=>u!==t));const a=s.find(u=>u.textValue.toLowerCase().startsWith(n.toLowerCase()));return a!==t?a:void 0}function Wt(r,e){return r.map((t,o)=>r[(e+o)%r.length])}var Kt=je,$t=Ae,Gt=De,Yt=ke,qt=Le,Xt=Be,Zt=Ue,Qt=$e,Jt=Ge,eo=qe,to=Xe,oo=Ze;function uo(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Kt,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function po(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Gt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function fo(r){const e=ee.c(13);let t,o,n,c;e[0]!==r?({className:o,size:c,children:t,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c):(t=e[1],o=e[2],n=e[3],c=e[4]);const s=c===void 0?"default":c;let l;e[5]!==o?(l=oe("data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-lg bg-background px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[2px] card-shadow disabled:opacity-50 data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=xs]:h-6 data-[size=xs]:px-2.5 data-[size=xs]:py-1.5 data-[size=xs]:rounded-lg *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]===Symbol.for("react.memo_cache_sentinel")?(a=d.jsx(Yt,{asChild:!0,children:d.jsx(Re,{className:"size-4 opacity-50"})}),e[7]=a):a=e[7];let u;return e[8]!==t||e[9]!==n||e[10]!==s||e[11]!==l?(u=d.jsxs($t,{"data-slot":"select-trigger","data-size":s,className:l,...n,children:[t,a]}),e[8]=t,e[9]=n,e[10]=s,e[11]=l,e[12]=u):u=e[12],u}function mo(r){const e=ee.c(25);let t,o,n,c,s;e[0]!==r?({className:o,children:t,position:c,hideScrollButtons:s,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c,e[5]=s):(t=e[1],o=e[2],n=e[3],c=e[4],s=e[5]);const l=c===void 0?"popper":c,a=s===void 0?!1:s,u=l==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1";let h;e[6]!==o||e[7]!==u?(h=oe("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border shadow-md",u,o),e[6]=o,e[7]=u,e[8]=h):h=e[8];let g;e[9]!==a?(g=!a&&d.jsx(no,{}),e[9]=a,e[10]=g):g=e[10];const b=l==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let w;e[11]!==b?(w=oe("p-1",b),e[11]=b,e[12]=w):w=e[12];let S;e[13]!==t||e[14]!==w?(S=d.jsx(Zt,{className:w,children:t}),e[13]=t,e[14]=w,e[15]=S):S=e[15];let p;e[16]!==a?(p=!a&&d.jsx(ro,{}),e[16]=a,e[17]=p):p=e[17];let v;return e[18]!==l||e[19]!==n||e[20]!==h||e[21]!==g||e[22]!==S||e[23]!==p?(v=d.jsx(qt,{children:d.jsxs(Xt,{"data-slot":"select-content",className:h,position:l,...n,children:[g,S,p]})}),e[18]=l,e[19]=n,e[20]=h,e[21]=g,e[22]=S,e[23]=p,e[24]=v):v=e[24],v}function ho(r){const e=ee.c(16);let t,o,n,c;e[0]!==r?({className:o,children:t,hideCheck:c,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c):(t=e[1],o=e[2],n=e[3],c=e[4]);const s=c===void 0?!1:c;let l;e[5]!==o?(l=oe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]!==s?(a=!s&&d.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:d.jsx(eo,{children:d.jsx(wt,{className:"size-4"})})}),e[7]=s,e[8]=a):a=e[8];let u;e[9]!==t?(u=d.jsx(Jt,{children:t}),e[9]=t,e[10]=u):u=e[10];let h;return e[11]!==n||e[12]!==l||e[13]!==a||e[14]!==u?(h=d.jsxs(Qt,{"data-slot":"select-item",className:l,...n,children:[a,u]}),e[11]=n,e[12]=l,e[13]=a,e[14]=u,e[15]=h):h=e[15],h}function no(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=d.jsx(Ct,{className:"size-4"}),e[5]=c):c=e[5];let s;return e[6]!==o||e[7]!==n?(s=d.jsx(to,{"data-slot":"select-scroll-up-button",className:n,...o,children:c}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}function ro(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=d.jsx(Re,{className:"size-4"}),e[5]=c):c=e[5];let s;return e[6]!==o||e[7]!==n?(s=d.jsx(oo,{"data-slot":"select-scroll-down-button",className:n,...o,children:c}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}export{uo as S,fo as a,po as b,mo as c,ho as d,_e as e};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Z as Nt,_ as $e,$ as wt,a0 as Et,a1 as lt,n as he,a2 as It,a3 as Tt,r as Q,a4 as Ot,a5 as Rt,a6 as kt,a7 as At,a8 as it,a9 as Lt,aa as Dt,ab as Pt,c as H,l as ie,j as s,B,d as Oe,K as Y,H as be,I as ae,J as Ce,M as ve,i as Ie,m as me,ac as $t,t as Re,v as Pe,p as oe,Q as zt,E as qt,a as Ft}from"./index-CcnDuzQF.js";import{u as ze}from"./use-mcp-client-DNLhxapG.js";import{W as ct,g as Kt,S as Ut}from"./constants-BHDe7bIw.js";import{I as qe}from"./integration-icon-CgQTPrq8.js";import{c as fe,a as dt,h as ut,D as mt,d as ft,e as pt}from"./dialog-CSPNf1M2.js";import{b as Fe,T as Ke,a as Ue}from"./tooltip-2I_b-6X7.js";import{i as Me}from"./CheckCircle-8vSEu8DC.js";import{c as ht,e as Mt,f as gt}from"./agent-icon-CwIj7ip2.js";import{u as J,t as Qt,m as Gt,s as Ht,g as Vt,p as Bt,F as Wt,b as Yt,a as Zt,c as Xt}from"./companions-core-nxOBF2bU.js";import{F as re,a as je,b as le,c as Ee,d as ce,f as de,e as Jt}from"./form-DZWEEJcU.js";import{I as _e}from"./input-C9C08vUS.js";import{i as es}from"./Check-BH0H5-aR.js";import{a as xt}from"./Copy01-DEGDYVwN.js";import{i as ts}from"./Settings02-9vuwfVDi.js";import{s as ss}from"./Eye-DeQrUDT5.js";import{u as ns}from"./use-debounced-value-DdzAq6K1.js";import{f as yt,a as os,p as is}from"./provision-repo-scoped-github-connection-2iDn-wQ1.js";import{c as as,e as rs}from"./extract-connection-data-NqYjy1W6.js";import{a as ls}from"./authenticate-and-persist-oauth-D-sBYsRy.js";import{i as bt}from"./ArrowUpRight-D-YvHLwD.js";function at(o,e){const t=new Set(e);return o.filter(n=>!t.has(n))}function cs(o,e,t){const n=o.slice(0);return n[e]=t,n}var ds=class extends Nt{#o;#e;#i;#n;#t;#s;#a;#r;#l;#c=[];constructor(o,e,t){super(),this.#o=o,this.#n=t,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,$e.batch(()=>{const t=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=t.length!==i.length,c=i.some((r,f)=>r!==t[f]),u=l||c,p=u?!0:a.some((r,f)=>{const m=this.#e[f];return!m||!wt(r,m)});!u&&!p||(u&&(this.#c=n,this.#t=i),this.#e=a,this.hasListeners()&&(u&&(at(t,i).forEach(r=>{r.destroy()}),at(i,t).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 t=this.#m(o),n=t.map(a=>a.observer.getOptimisticResult(a.defaultedQueryOptions)),i=t.map(a=>a.defaultedQueryOptions.queryHash);return[n,a=>this.#u(a??n,e,i),()=>this.#d(n,t)]}#d(o,e){return e.map((t,n)=>{const i=o[n];return t.defaultedQueryOptions.notifyOnChangeProps?i:t.observer.trackResult(i,a=>{e.forEach(l=>{l.observer.trackProp(a)})})})}#u(o,e,t){if(e){const n=this.#l,i=t!==void 0&&n!==void 0&&(n.length!==t.length||t.some((a,l)=>a!==n[l]));return(!this.#s||this.#e!==this.#r||i||e!==this.#a)&&(this.#a=e,this.#r=this.#e,t!==void 0&&(this.#l=t),this.#s=Et(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 t=[];return o.forEach(n=>{const i=this.#o.defaultQueryOptions(n),l=e.get(i.queryHash)?.shift()??new lt(this.#o,i);t.push({defaultedQueryOptions:i,observer:l})}),t}#f(o,e){const t=this.#t.indexOf(o);t!==-1&&(this.#e=cs(this.#e,t,e),this.#p())}#p(){if(this.hasListeners()){const o=this.#d(this.#e,this.#c),e=this.#h(),t=this.#s,n=e?t:this.#u(o,this.#n?.combine);(e||t!==n)&&$e.batch(()=>{this.listeners.forEach(i=>{i(this.#e)})})}}};function us({queries:o,...e},t){const n=he(t),i=It(),a=Tt(),l=Q.useMemo(()=>o.map(C=>{const g=n.defaultQueryOptions(C);return g._optimisticResults=i?"isRestoring":"optimistic",g}),[o,n,i]);l.forEach(C=>{Ot(C);const g=n.getQueryCache().get(C.queryHash);Rt(C,a,g)}),kt(a);const[c]=Q.useState(()=>new ds(n,l,e)),[u,p,r]=c.getOptimisticResult(l,e.combine),f=!i&&e.subscribed!==!1;Q.useSyncExternalStore(Q.useCallback(C=>f?c.subscribe($e.batchCalls(C)):At,[c,f]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),Q.useEffect(()=>{c.setQueries(l,e)},[l,e,c]);const h=u.some((C,g)=>it(l[g],C))?u.flatMap((C,g)=>{const d=l[g];if(d&&it(d,C)){const y=new lt(n,d);return Lt(d,y,a)}return[]}):[];if(h.length>0)throw Promise.all(h);const _=u.find((C,g)=>{const d=l[g];return d&&Dt({result:C,errorResetBoundary:a,throwOnError:d.throwOnError,query:n.getQueryCache().get(d.queryHash),suspense:d.suspense})});if(_?.error)throw _.error;return p(r())}function ms(o,e){return us({...o,queries:o.queries.map(t=>({...t,suspense:!0,throwOnError:Pt,enabled:!0,placeholderData:void 0}))},e)}const fs=/^[a-zA-Z][a-zA-Z\d+.-]*:/,ps=/^[a-zA-Z][a-zA-Z\d+.-]*:\/\//,hs=/^[^\s/:?#]+\.[^\s/:?#]+:\d+(?:[/?#]|$)/,gs=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/i;function Te(o){const e=o.trim();if(!e)return{ok:!1,error:"Enter a website URL."};const t=fs.test(e),n=ps.test(e),i=hs.test(e);if(t&&!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||!gs.test(u))?{ok:!1,error:"Enter a valid website URL."}:(l.protocol="https:",{ok:!0,value:l.origin})}function Gn(o,e){if(!o.trim())return!0;const t=Te(o);if(!t.ok||!e)return!1;const n=Te(e);return n.ok&&n.value===t.value}function Hn(o){if(!o)return null;const e=Te(o);return e.ok?new URL(e.value).hostname:null}function xs(o){const e=H.c(14),{children:t,className:n,wrapperClassName:i}=o,[a,l]=Q.useState(!0);let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=C=>{if(!C)return;const g=()=>{const y=C.scrollHeight-C.scrollTop-C.clientHeight<8;l(y)};g(),C.addEventListener("scroll",g,{passive:!0});const d=new ResizeObserver(g);d.observe(C);for(const y of Array.from(C.children))d.observe(y);return()=>{C.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]!==t||e[4]!==n?(r=s.jsx("div",{ref:u,className:n,children:t}),e[3]=t,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=s.jsx("div",{"aria-hidden":!0,className:m}),e[8]=m,e[9]=h):h=e[9];let _;return e[10]!==p||e[11]!==r||e[12]!==h?(_=s.jsxs("div",{className:p,children:[r,h]}),e[10]=p,e[11]=r,e[12]=h,e[13]=_):_=e[13],_}function rt(o){const e=H.c(38);let t,n,i,a,l;e[0]!==o?({value:l,onChange:n,placeholder:i,className:t,...a}=o,e[0]=o,e[1]=t,e[2]=n,e[3]=i,e[4]=a,e[5]=l):(t=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(R){console.error("Failed to copy text: ",R)}},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 _=h,C=c?"text":"password";let g;e[10]!==t?(g=ie("pr-20",t),e[10]=t,e[11]=g):g=e[11];let d;e[12]!==n||e[13]!==i||e[14]!==a||e[15]!==C||e[16]!==g||e[17]!==l?(d=s.jsx(_e,{type:C,value:l,onChange:n,placeholder:i,className:g,...a}),e[12]=n,e[13]=i,e[14]=a,e[15]=C,e[16]=g,e[17]=l,e[18]=d):d=e[18];const y=c?"Hide password":"Show password";let v;e[19]!==c?(v=c?s.jsx(ts,{size:16}):s.jsx(ss,{size:16}),e[19]=c,e[20]=v):v=e[20];let x;e[21]!==y||e[22]!==v||e[23]!==_?(x=s.jsx(B,{type:"button",variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:_,title:y,children:v}),e[21]=y,e[22]=v,e[23]=_,e[24]=x):x=e[24];const E=!l,S=p?"Copied!":"Copy token";let j;e[25]!==p?(j=p?s.jsx(es,{size:16}):s.jsx(xt,{size:16}),e[25]=p,e[26]=j):j=e[26];let b;e[27]!==m||e[28]!==S||e[29]!==j||e[30]!==E?(b=s.jsx(B,{type:"button",variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:m,disabled:E,title:S,children:j}),e[27]=m,e[28]=S,e[29]=j,e[30]=E,e[31]=b):b=e[31];let N;e[32]!==b||e[33]!==x?(N=s.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=s.jsxs("div",{className:"relative",children:[d,N]}),e[35]=N,e[36]=d,e[37]=O):O=e[37],O}function Qe(o){const e=H.c(19),{card:t,selfClient:n,org:i,onDone:a,onError:l}=o,c=he();let u;e[0]!==t||e[1]!==n?(u=async g=>{const d={...t.configurationState??{},...g};await n.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:t.linkedConnectionId||t.candidateConnectionId,data:{configuration_state:d}}})},e[0]=t,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:Y.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=Oe(f);let h;e[13]!==m?(h=g=>m.mutate(g),e[13]=m,e[14]=h):h=e[14];const _=h;let C;return e[15]!==m.error||e[16]!==m.isPending||e[17]!==_?(C={save:_,isPending:m.isPending,error:m.error},e[15]=m.error,e[16]=m.isPending,e[17]=_,e[18]=C):C=e[18],C}const ys=be({accountName:ae().min(1,"Informe o nome da conta"),appKey:ae().optional(),appToken:ae().optional()});function bs(o){const e=H.c(63),{card:t,selfClient:n,org:i,onDone:a,onIsPendingChange:l}=o;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=Ce(ys),e[0]=c):c=e[0];const u=t.configurationState?.accountName||"",p=t.configurationState?.appKey||"",r=t.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=ve(f);let h;e[5]!==t.configurationState?.accountName||e[6]!==t.configurationState?.appKey||e[7]!==t.configurationState?.appToken||e[8]!==m?(h=()=>{m.reset({accountName:t.configurationState?.accountName||"",appKey:t.configurationState?.appKey||"",appToken:t.configurationState?.appToken||""})},e[5]=t.configurationState?.accountName,e[6]=t.configurationState?.appKey,e[7]=t.configurationState?.appToken,e[8]=m,e[9]=h):h=e[9];let _;e[10]!==t.configurationState||e[11]!==m?(_=[t.configurationState,m],e[10]=t.configurationState,e[11]=m,e[12]=_):_=e[12],Q.useEffect(h,_);let C;e[13]!==t||e[14]!==a||e[15]!==i||e[16]!==n?(C={card:t,selfClient:n,org:i,onDone:a},e[13]=t,e[14]=a,e[15]=i,e[16]=n,e[17]=C):C=e[17];const{save:g,isPending:d,error:y}=Qe(C);let v,x;e[18]!==d||e[19]!==l?(x=()=>{l?.(d)},v=[d,l],e[18]=d,e[19]=l,e[20]=v,e[21]=x):(v=e[20],x=e[21]),Q.useEffect(x,v);let E;if(e[22]!==m||e[23]!==g){let D;e[25]!==g?(D=async F=>{g(F)},e[25]=g,e[26]=D):D=e[26],E=m.handleSubmit(D),e[22]=m,e[23]=g,e[24]=E}else E=e[24];const S=E;let j;e[27]!==d?(j=D=>{const{field:F}=D;return s.jsxs(le,{children:[s.jsx(Ee,{children:"Nome da conta"}),s.jsx(ce,{children:s.jsx(_e,{placeholder:"Nome da sua conta VTEX",...F,disabled:d})}),s.jsx(de,{})]})},e[27]=d,e[28]=j):j=e[28];let b;e[29]!==m.control||e[30]!==j?(b=s.jsx(re,{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=D=>{const{field:F}=D;return s.jsxs(le,{children:[s.jsx(Ee,{children:"App Key (opcional)"}),s.jsx(ce,{children:s.jsx(rt,{placeholder:"App Key da VTEX",...F,disabled:d})}),s.jsx(de,{})]})},e[32]=d,e[33]=N):N=e[33];let O;e[34]!==m.control||e[35]!==N?(O=s.jsx(re,{control:m.control,name:"appKey",render:N}),e[34]=m.control,e[35]=N,e[36]=O):O=e[36];let R;e[37]!==d?(R=D=>{const{field:F}=D;return s.jsxs(le,{children:[s.jsx(Ee,{children:"App Token (opcional)"}),s.jsx(ce,{children:s.jsx(rt,{placeholder:"App Token da VTEX",...F,disabled:d})}),s.jsx(de,{})]})},e[37]=d,e[38]=R):R=e[38];let w;e[39]!==m.control||e[40]!==R?(w=s.jsx(re,{control:m.control,name:"appToken",render:R}),e[39]=m.control,e[40]=R,e[41]=w):w=e[41];let T;e[42]!==m||e[43]!==b||e[44]!==O||e[45]!==w?(T=s.jsxs(je,{...m,children:[b,O,w]}),e[42]=m,e[43]=b,e[44]=O,e[45]=w,e[46]=T):T=e[46];let L;e[47]!==y?(L=y&&s.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]=L):L=e[48];let P;e[49]!==d||e[50]!==a?(P=s.jsx(B,{type:"button",variant:"outline",onClick:a,disabled:d,children:"Cancelar"}),e[49]=d,e[50]=a,e[51]=P):P=e[51];const K=d?"Salvando...":"Salvar";let $;e[52]!==d||e[53]!==K?($=s.jsx(B,{type:"submit",disabled:d,children:K}),e[52]=d,e[53]=K,e[54]=$):$=e[54];let q;e[55]!==P||e[56]!==$?(q=s.jsxs(fe,{className:"pt-4",children:[P,$]}),e[55]=P,e[56]=$,e[57]=q):q=e[57];let M;return e[58]!==S||e[59]!==T||e[60]!==L||e[61]!==q?(M=s.jsxs("form",{onSubmit:S,className:"space-y-4",children:[T,L,q]}),e[58]=S,e[59]=T,e[60]=L,e[61]=q,e[62]=M):M=e[62],M}function Ge(o){const e=H.c(29),{options:t,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,_,C;if(e[0]!==t||e[1]!==f||e[2]!==n){const j=f.trim().toLowerCase();h=j?t.filter(b=>b.label.toLowerCase().includes(j)):t,_=h.map(Cs),C=_.includes(n)?n:_[0]??"",e[0]=t,e[1]=f,e[2]=n,e[3]=h,e[4]=_,e[5]=C}else h=e[3],_=e[4],C=e[5];const g=C;let d;e[6]!==a||e[7]!==_||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,R=_.indexOf(O),w=_.length;if(w===0)return;let T;b.key==="ArrowDown"||b.key==="ArrowRight"?T=(R+1)%w:b.key==="ArrowUp"||b.key==="ArrowLeft"?T=(R-1+w)%w:b.key==="Home"?T=0:T=w-1;const L=_[T];i(L),b.currentTarget.closest('[role="radiogroup"]')?.querySelector(`[data-value="${CSS.escape(L)}"]`)?.focus()},e[6]=a,e[7]=_,e[8]=i,e[9]=d):d=e[9];const y=d;let v;e[10]!==l||e[11]!==a||e[12]!==r||e[13]!==f||e[14]!==p?(v=r?null:s.jsxs("div",{className:"relative",children:[s.jsx(ht,{size:16,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),s.jsx(_e,{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]=v):v=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?s.jsx("div",{className:"px-2 py-2 text-sm text-muted-foreground",children:"Nenhum resultado"}):h.map(j=>{const b=j.value===n;return s.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:[s.jsx("span",{className:"truncate",children:j.label}),b?s.jsx(Me,{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=s.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 S;return e[26]!==v||e[27]!==E?(S=s.jsxs("div",{className:"space-y-2",children:[v,E]}),e[26]=v,e[27]=E,e[28]=S):S=e[28],S}function Cs(o){return o.value}function He(o){const e=H.c(16),{label:t,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=s.jsx(Ie,{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]!==t||e[10]!==f?(m=s.jsx("span",{className:f,children:t}),e[9]=t,e[10]=f,e[11]=m):m=e[11];let h;return e[12]!==u||e[13]!==r||e[14]!==m?(h=s.jsxs("span",{className:u,children:[r,m]}),e[12]=u,e[13]=r,e[14]=m,e[15]=h):h=e[15],h}const vs=be({propertyId:ae().min(1,"Selecione uma propriedade")});function js(o){const e=H.c(68),{card:t,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=Y.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 k=await i.callTool({name:"get-account-summaries",arguments:{}}),I=J(k);return Qt(I)},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 _;e[8]===Symbol.for("react.memo_cache_sentinel")?(_=Ce(vs),e[8]=_):_=e[8];const C=t.configurationState?.propertyId||"";let g;e[9]!==C?(g={resolver:_,defaultValues:{propertyId:C}},e[9]=C,e[10]=g):g=e[10];const d=ve(g);let y;e[11]!==t||e[12]!==c||e[13]!==l||e[14]!==a?(y={card:t,selfClient:a,org:l,onDone:c},e[11]=t,e[12]=c,e[13]=l,e[14]=a,e[15]=y):y=e[15];const{save:v,isPending:x,error:E}=Qe(y);let S,j;e[16]!==x||e[17]!==p?(S=()=>{p?.(x)},j=[x,p],e[16]=x,e[17]=p,e[18]=S,e[19]=j):(S=e[18],j=e[19]),Q.useEffect(S,j);let b;if(e[20]!==d||e[21]!==v){let k;e[23]!==v?(k=async I=>{v(I)},e[23]=v,e[24]=k):k=e[24],b=d.handleSubmit(k),e[20]=d,e[21]=v,e[22]=b}else b=e[22];const N=b;if(h.isLoading){let k;return e[25]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx("div",{className:"flex min-h-[200px] items-center justify-center",children:s.jsx(He,{label:"Carregando propriedades..."})}),e[25]=k):k=e[25],k}if(h.isError){let k;return e[26]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx("div",{className:"space-y-4",children:s.jsx("p",{className:"text-sm text-destructive",children:"Não foi possível carregar as propriedades do Google Analytics."})}),e[26]=k):k=e[26],k}let O;e[27]!==h.data?(O=h.data||[],e[27]=h.data,e[28]=O):O=e[28];const R=O;if(R.flatMap(Ss).length===0){let k;e[29]===Symbol.for("react.memo_cache_sentinel")?(k=s.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]=k):k=e[29];let I;e[30]!==u?(I=u?s.jsx("button",{type:"button",onClick:u,className:"text-xs text-muted-foreground underline underline-offset-2 hover:text-destructive",children:"Desconectar conta"}):s.jsx("span",{}),e[30]=u,e[31]=I):I=e[31];let G;e[32]!==c?(G=s.jsx(B,{type:"button",variant:"outline",onClick:c,children:"Fechar"}),e[32]=c,e[33]=G):G=e[33];let Z;return e[34]!==I||e[35]!==G?(Z=s.jsxs("div",{className:"space-y-4",children:[k,s.jsxs(fe,{className:"flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[I,G]})]}),e[34]=I,e[35]=G,e[36]=Z):Z=e[36],Z}let T;e[37]!==x||e[38]!==R?(T=k=>{const{field:I}=k;return s.jsxs(le,{children:[s.jsx(ce,{children:s.jsx(Ge,{options:R.flatMap(_s),value:I.value,onChange:I.onChange,disabled:x,ariaLabel:"Propriedade do Google Analytics"})}),s.jsx(de,{})]})},e[37]=x,e[38]=R,e[39]=T):T=e[39];let L;e[40]!==d.control||e[41]!==T?(L=s.jsx(re,{control:d.control,name:"propertyId",render:T}),e[40]=d.control,e[41]=T,e[42]=L):L=e[42];let P;e[43]!==d||e[44]!==L?(P=s.jsx(je,{...d,children:L}),e[43]=d,e[44]=L,e[45]=P):P=e[45];let K;e[46]!==E?(K=E&&s.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?s.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"}):s.jsx("span",{}),e[48]=x,e[49]=u,e[50]=$):$=e[50];let q;e[51]!==x||e[52]!==c?(q=s.jsx(B,{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 D;e[54]!==x||e[55]!==M?(D=s.jsx(B,{type:"submit",disabled:x,children:M}),e[54]=x,e[55]=M,e[56]=D):D=e[56];let F;e[57]!==q||e[58]!==D?(F=s.jsxs("div",{className:"flex gap-2",children:[q,D]}),e[57]=q,e[58]=D,e[59]=F):F=e[59];let z;e[60]!==$||e[61]!==F?(z=s.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]!==P||e[65]!==K||e[66]!==z?(U=s.jsxs("form",{onSubmit:N,className:"space-y-4",children:[P,K,z]}),e[63]=N,e[64]=P,e[65]=K,e[66]=z,e[67]=U):U=e[67],U}function _s(o){return o.options}function Ss(o){return o.options}const Ns=be({siteUrl:ae().min(1,"Selecione um site")});function ws(o){const e=H.c(62),{card:t,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=Y.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 I=await i.callTool({name:"list_sites",arguments:{}});return J(I).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 _;e[8]===Symbol.for("react.memo_cache_sentinel")?(_=Ce(Ns),e[8]=_):_=e[8];const C=t.configurationState?.siteUrl||"";let g;e[9]!==C?(g={resolver:_,defaultValues:{siteUrl:C}},e[9]=C,e[10]=g):g=e[10];const d=ve(g);let y;e[11]!==t||e[12]!==u||e[13]!==l||e[14]!==a?(y={card:t,selfClient:a,org:l,onDone:u},e[11]=t,e[12]=u,e[13]=l,e[14]=a,e[15]=y):y=e[15];const{save:v,isPending:x,error:E}=Qe(y),S=Q.useRef(!1),j=t.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,R;e[20]!==c||e[21]!==d||e[22]!==j||e[23]!==h.data||e[24]!==h.isSuccess?(O=()=>{if(!(S.current||!h.isSuccess)){if(S.current=!0,j){d.getValues("siteUrl")!==j&&d.setValue("siteUrl",j);return}if(!d.getValues("siteUrl")){const I=Gt(c,h.data??[]);I&&d.setValue("siteUrl",I)}}},R=[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]=R):(O=e[25],R=e[26]),Q.useEffect(O,R);let w;if(e[27]!==d||e[28]!==v){let I;e[30]!==v?(I=async G=>{v(G)},e[30]=v,e[31]=I):I=e[31],w=d.handleSubmit(I),e[27]=d,e[28]=v,e[29]=w}else w=e[29];const T=w;if(h.isLoading){let I;return e[32]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx("div",{className:"flex min-h-[200px] items-center justify-center",children:s.jsx(He,{label:"Carregando sites..."})}),e[32]=I):I=e[32],I}if(h.isError){let I;return e[33]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx("div",{className:"space-y-4",children:s.jsx("p",{className:"text-sm text-destructive",children:"Não foi possível carregar os sites do Google Search Console."})}),e[33]=I):I=e[33],I}let L;e[34]!==h.data?(L=h.data||[],e[34]=h.data,e[35]=L):L=e[35];const P=L;if(P.length===0){let I;return e[36]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx("div",{className:"space-y-4",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:"Nenhum site verificado foi encontrado. Verifique um site no Google Search Console."})}),e[36]=I):I=e[36],I}let K;e[37]!==x||e[38]!==P?(K=I=>{const{field:G}=I;return s.jsxs(le,{children:[s.jsx(ce,{children:s.jsx(Ge,{options:P.map(Es),value:G.value,onChange:G.onChange,disabled:x,ariaLabel:"Site verificado"})}),s.jsx(de,{})]})},e[37]=x,e[38]=P,e[39]=K):K=e[39];let $;e[40]!==d.control||e[41]!==K?($=s.jsx(re,{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=s.jsx(je,{...d,children:$}),e[43]=d,e[44]=$,e[45]=q):q=e[45];let M;e[46]!==E?(M=E&&s.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 D;e[48]!==x||e[49]!==u?(D=s.jsx(B,{type:"button",variant:"outline",onClick:u,disabled:x,children:"Cancelar"}),e[48]=x,e[49]=u,e[50]=D):D=e[50];const F=x?"Salvando...":"Salvar";let z;e[51]!==x||e[52]!==F?(z=s.jsx(B,{type:"submit",disabled:x,children:F}),e[51]=x,e[52]=F,e[53]=z):z=e[53];let U;e[54]!==D||e[55]!==z?(U=s.jsxs(fe,{className:"pt-4",children:[D,z]}),e[54]=D,e[55]=z,e[56]=U):U=e[56];let k;return e[57]!==T||e[58]!==q||e[59]!==M||e[60]!==U?(k=s.jsxs("form",{onSubmit:T,className:"space-y-4",children:[q,M,U]}),e[57]=T,e[58]=q,e[59]=M,e[60]=U,e[61]=k):k=e[61],k}function Es(o){return{value:o.siteUrl,label:o.siteUrl}}function Is(o){const[e,t]=o.split("/");return!e||!t?null:{owner:e,name:t}}function Ts(o){const{existingRepo:e,owner:t,name:n}=o;return e?.connectionId&&e.owner.toLowerCase()===t.toLowerCase()&&e.name.toLowerCase()===n.toLowerCase()?{connectionId:e.connectionId,installationId:e.installationId}:null}function Os(o){const{existingRepo:e,existingConnections:t,repoConnectionId:n}=o,i=e?.connectionId&&e.connectionId!==n?e.connectionId:void 0,a=[...t.filter(l=>l.connection_id!==n&&l.connection_id!==i),{connection_id:n,selected_tools:[]}];return{staleConnectionId:i,mergedConnections:a}}const Rs=be({githubRepo:ae().min(1,"Selecione um repositório")}),ks=15e3,As=/^[\w.-]+\/[\w.-]+$/;async function Ls(o,e,t,n){const{installations:i}=await yt(o,t),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}`,_=await e.callTool({name:"search_repositories",arguments:{query:m,page:1,perPage:50}},void 0,{signal:AbortSignal.timeout(ks)}),C=_.content?.[0]?.text;if(_.isError)throw new Error(C??"search_repositories failed");if(!C)throw new Error("empty search_repositories response");return JSON.parse(C).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(89),{connectionId:t,companionClient:n,selfClient:i,org:a,onDone:l,onIsPendingChange:c}=o,u=he();let p;e[0]!==a.id?(p=ct.COMMERCE_DISCOVERY(a.id),e[0]=a.id,e[1]=p):p=e[1];const r=p,[f,m]=Q.useState(""),h=ns(f,300),_=Q.useRef(!1);let C;e[2]!==t||e[3]!==a.id?(C=Y.commerceDiscoveryCompanionGithubSelected(a.id,t),e[2]=t,e[3]=a.id,e[4]=C):C=e[4];let g;e[5]!==r||e[6]!==i?(g=async()=>{const W=await i.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:r}}),se=J(W).item?.configuration_state??null;return typeof se?.github_repo=="string"?se.github_repo:""},e[5]=r,e[6]=i,e[7]=g):g=e[7];let d;e[8]!==C||e[9]!==g?(d={queryKey:C,queryFn:g},e[8]=C,e[9]=g,e[10]=d):d=e[10];const y=me(d);let v;e[11]!==t||e[12]!==h||e[13]!==a.id?(v=Y.commerceDiscoveryCompanionGithubRepos(a.id,t,h.trim()),e[11]=t,e[12]=h,e[13]=a.id,e[14]=v):v=e[14];let x;e[15]!==n||e[16]!==t||e[17]!==h||e[18]!==i?(x=()=>Ls(W=>i.callTool(W),n,t,h),e[15]=n,e[16]=t,e[17]=h,e[18]=i,e[19]=x):x=e[19];let E;e[20]!==v||e[21]!==x?(E={queryKey:v,queryFn:x},e[20]=v,e[21]=x,e[22]=E):E=e[22];const S=me(E);let j;e[23]===Symbol.for("react.memo_cache_sentinel")?(j={resolver:Ce(Rs),defaultValues:{githubRepo:""}},e[23]=j):j=e[23];const b=ve(j);let N;e[24]!==r||e[25]!==n||e[26]!==t||e[27]!==a.id||e[28]!==a.slug||e[29]!==i?(N=async W=>{const se=await i.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:r}}),jt={...J(se).item?.configuration_state??null??{},github_repo:W};await i.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:r,data:{configuration_state:jt}}});const Ze=Is(W);if(!Ze)throw new Error(`Repositório inválido: "${W}". Use o formato owner/nome.`);const{owner:ge,name:ke}=Ze,Xe=Kt(a.id),Je=J(await i.callTool({name:"COLLECTION_VIRTUAL_MCP_GET",arguments:{id:Xe}})).item,et=Je?.metadata?.githubRepo,_t=Je?.connections??[],tt=Ts({existingRepo:et,owner:ge,name:ke});let Ne=tt?.connectionId,Ae=tt?.installationId,Le;if(!Ne){const{installations:De}=await yt(xe=>i.callTool(xe),t),we=os(De,ge);if(!we)throw new Error(`Nenhuma instalação do GitHub encontrada para "${ge}".`);Ae=we.installationId;const nt=J(await i.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:t}})).item;if(!nt)throw new Error("Conexão do GitHub não encontrada.");const{childConnectionId:ot}=await is({orgSlug:a.slug,sourceConnection:nt,installationId:Ae,owner:ge,repo:ke,githubCallTool:xe=>n.callTool(xe),selfCallTool:xe=>i.callTool(xe)});Ne=ot,Le=ot}const{staleConnectionId:st,mergedConnections:St}=Os({existingRepo:et,existingConnections:_t,repoConnectionId:Ne});try{await i.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:Xe,data:{connections:St,metadata:{githubRepo:{owner:ge,name:ke,url:`https://github.com/${W}`,installationId:Ae,connectionId:Ne}}}}}),st&&await i.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:st,force:!0}}).catch(zs)}catch(De){const we=De;throw Le&&await i.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:Le,force:!0}}).catch($s),we}},e[24]=r,e[25]=n,e[26]=t,e[27]=a.id,e[28]=a.slug,e[29]=i,e[30]=N):N=e[30];let O;e[31]!==r||e[32]!==l||e[33]!==a.id||e[34]!==u?(O=async()=>{await u.invalidateQueries({queryKey:Y.commerceDiscoveryConnection(a.id,r)}),await u.invalidateQueries({queryKey:Y.commerceDiscoveryCompanionConnectionsPrefix(a.id)}),$t(u,a.id),l()},e[31]=r,e[32]=l,e[33]=a.id,e[34]=u,e[35]=O):O=e[35];let R;e[36]!==O||e[37]!==N?(R={mutationFn:N,onSuccess:O},e[36]=O,e[37]=N,e[38]=R):R=e[38];const w=Oe(R),T=w.isPending;let L,P;e[39]!==T||e[40]!==c?(L=()=>{c?.(T)},P=[T,c],e[39]=T,e[40]=c,e[41]=L,e[42]=P):(L=e[41],P=e[42]),Q.useEffect(L,P);const K=y.data??"";let $,q;e[43]!==b||e[44]!==y.data||e[45]!==y.isSuccess?($=()=>{!y.isSuccess||_.current||(_.current=!0,y.data&&b.setValue("githubRepo",y.data))},q=[y.isSuccess,y.data,b],e[43]=b,e[44]=y.data,e[45]=y.isSuccess,e[46]=$,e[47]=q):($=e[46],q=e[47]),Q.useEffect($,q);let M;if(e[48]!==b||e[49]!==w){let W;e[51]!==w?(W=async se=>{w.mutate(se.githubRepo)},e[51]=w,e[52]=W):W=e[52],M=b.handleSubmit(W),e[48]=b,e[49]=w,e[50]=M}else M=e[50];const D=M;let F,z,U;if(e[53]!==h||e[54]!==S.data?.failed||e[55]!==S.data?.repos||e[56]!==S.data?.total||e[57]!==K){const W=S.data?.repos??[];F=S.data?.failed??0,U=S.data?.total??0;const se=h.trim();z=[...W],se&&As.test(se)&&!z.includes(se)&&z.unshift(se),K&&!z.includes(K)&&z.push(K),e[53]=h,e[54]=S.data?.failed,e[55]=S.data?.repos,e[56]=S.data?.total,e[57]=K,e[58]=F,e[59]=z,e[60]=U}else F=e[58],z=e[59],U=e[60];const k=U>0&&F===U,I=S.isError||k?"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[61]===Symbol.for("react.memo_cache_sentinel")?(G=s.jsx(ht,{size:16,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),e[61]=G):G=e[61];let Z;e[62]===Symbol.for("react.memo_cache_sentinel")?(Z=W=>m(W.target.value),e[62]=Z):Z=e[62];let X;e[63]!==T||e[64]!==f?(X=s.jsxs("div",{className:"relative",children:[G,s.jsx(_e,{type:"text",value:f,onChange:Z,disabled:T,placeholder:"Buscar repositório","aria-label":"Buscar repositório",className:"h-8 pl-8"})]}),e[63]=T,e[64]=f,e[65]=X):X=e[65];let ee;e[66]!==b||e[67]!==T||e[68]!==z||e[69]!==S.isLoading||e[70]!==I?(ee=S.isLoading?s.jsx("div",{className:"flex min-h-[160px] items-center justify-center",children:s.jsx(He,{label:"Carregando repositórios..."})}):s.jsxs(s.Fragment,{children:[I&&s.jsx("p",{role:"alert",className:"text-sm text-destructive",children:I}),z.length===0?!I&&s.jsx("p",{className:"text-sm text-muted-foreground",children:"Nenhum repositório encontrado. Digite o nome do repositório (owner/nome) para buscar."}):s.jsx(je,{...b,children:s.jsx(re,{control:b.control,name:"githubRepo",render:W=>{const{field:se}=W;return s.jsxs(le,{children:[s.jsx(ce,{children:s.jsx(Ge,{options:z.map(Ps),value:se.value,onChange:se.onChange,disabled:T,ariaLabel:"Repositório",hideSearch:!0})}),s.jsx(de,{})]})}})})]}),e[66]=b,e[67]=T,e[68]=z,e[69]=S.isLoading,e[70]=I,e[71]=ee):ee=e[71];let V;e[72]!==w.error?(V=w.error&&s.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[72]=w.error,e[73]=V):V=e[73];let A;e[74]!==T||e[75]!==l?(A=s.jsx(B,{type:"button",variant:"outline",onClick:l,disabled:T,children:"Cancelar"}),e[74]=T,e[75]=l,e[76]=A):A=e[76];const te=T?"Salvando...":"Salvar";let ne;e[77]!==T||e[78]!==te?(ne=s.jsx(B,{type:"submit",disabled:T,children:te}),e[77]=T,e[78]=te,e[79]=ne):ne=e[79];let ue;e[80]!==A||e[81]!==ne?(ue=s.jsxs(fe,{className:"pt-4",children:[A,ne]}),e[80]=A,e[81]=ne,e[82]=ue):ue=e[82];let Se;return e[83]!==D||e[84]!==X||e[85]!==ee||e[86]!==V||e[87]!==ue?(Se=s.jsxs("form",{onSubmit:D,className:"space-y-4",children:[X,ee,V,ue]}),e[83]=D,e[84]=X,e[85]=ee,e[86]=V,e[87]=ue,e[88]=Se):Se=e[88],Se}function Ps(o){return{value:o,label:o}}function $s(){}function zs(){}const qs={vtex:bs,"google-analytics":js,"google-search-console":ws,github:Ds},pe="deco-reader@decocms.iam.gserviceaccount.com",Ct={"google-analytics":"ga4","google-search-console":"gsc"},vt={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 t=vt[o].label;switch(e){case"no-access":return{title:`Ainda não conseguimos acessar este recurso no ${t}.`,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 Ks(o){const e=H.c(76),{provider:t,siteUrl:n,selfClient:i,org:a,initialResourceId:l,onDone:c,onIsPendingChange:u,onOAuthInstead:p}=o,r=vt[t],f=he(),[m,h]=Q.useState(null);let _,C;if(e[0]!==r.resourceLabel){const V=be({resourceId:ae().trim().min(1,`Informe o ${r.resourceLabel.toLowerCase()}`)});C=ve,_=Ce(V),e[0]=r.resourceLabel,e[1]=_,e[2]=C}else _=e[1],C=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]!==_||e[6]!==d?(y={resolver:_,defaultValues:d},e[5]=_,e[6]=d,e[7]=y):y=e[7];const v=C(y);let x;e[8]!==t||e[9]!==i||e[10]!==n?(x=async V=>{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:t,resourceId:V.resourceId}});return J(A)},e[8]=t,e[9]=i,e[10]=n,e[11]=x):x=e[11];let E,S;e[12]!==u?(E=()=>u?.(!0),S=()=>u?.(!1),e[12]=u,e[13]=E,e[14]=S):(E=e[13],S=e[14]);let j;e[15]!==r.label||e[16]!==c||e[17]!==a||e[18]!==t||e[19]!==f||e[20]!==n?(j=async V=>{if(V.ok){h(null),Re.success(`${r.label} conectado`),n&&await f.invalidateQueries({queryKey:Y.commerceDiscoveryConnectionStatus(a.id,n)}),c();return}h({...Fs(t,V.reason??"unknown"),detail:V.detail})},e[15]=r.label,e[16]=c,e[17]=a,e[18]=t,e[19]=f,e[20]=n,e[21]=j):j=e[21];let b;e[22]!==x||e[23]!==E||e[24]!==S||e[25]!==j?(b={mutationFn:x,onMutate:E,onSettled:S,onSuccess:j},e[22]=x,e[23]=E,e[24]=S,e[25]=j,e[26]=b):b=e[26];const N=Oe(b);let O;if(e[27]!==v||e[28]!==N){let V;e[30]!==N?(V=A=>N.mutate(A),e[30]=N,e[31]=V):V=e[31],O=v.handleSubmit(V),e[27]=v,e[28]=N,e[29]=O}else O=e[29];const R=O,w=N.isPending,T=Qs;let L;e[32]!==r.connectSteps?(L=r.connectSteps.map(Ms),e[32]=r.connectSteps,e[33]=L):L=e[33];let P;e[34]!==L?(P=s.jsx("ol",{className:"space-y-2 text-sm text-muted-foreground",children:L}),e[34]=L,e[35]=P):P=e[35];let K;e[36]===Symbol.for("react.memo_cache_sentinel")?(K=s.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")?($=s.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-border bg-muted/40 p-2",children:[K,s.jsx(B,{type:"button",variant:"ghost",size:"icon-sm",onClick:T,"aria-label":"Copiar e-mail do service account",children:s.jsx(xt,{size:16})})]}),e[37]=$):$=e[37];let q;e[38]!==r.resourceHint||e[39]!==r.resourceLabel||e[40]!==r.resourcePlaceholder||e[41]!==w?(q=V=>{const{field:A}=V;return s.jsxs(le,{children:[s.jsx(Ee,{children:r.resourceLabel}),s.jsx(ce,{children:s.jsx(_e,{...A,placeholder:r.resourcePlaceholder,disabled:w,autoComplete:"off"})}),s.jsx(Jt,{children:r.resourceHint}),s.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]!==v.control||e[44]!==q?(M=s.jsx(re,{control:v.control,name:"resourceId",render:q}),e[43]=v.control,e[44]=q,e[45]=M):M=e[45];let D;e[46]!==v||e[47]!==M?(D=s.jsx(je,{...v,children:M}),e[46]=v,e[47]=M,e[48]=D):D=e[48];let F;e[49]!==m?(F=m&&s.jsxs("div",{role:"alert",className:"space-y-2 rounded-lg border border-destructive/40 bg-destructive/5 p-3",children:[s.jsx("p",{className:"text-sm font-medium text-foreground",children:m.title}),s.jsx("ol",{className:"space-y-1 text-sm text-muted-foreground",children:m.steps.map(Us)})]}),e[49]=m,e[50]=F):F=e[50];let z;e[51]!==N.error||e[52]!==N.isError?(z=N.isError&&s.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?s.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"}):s.jsx("span",{}),e[54]=w,e[55]=p,e[56]=U):U=e[56];let k;e[57]!==w||e[58]!==c?(k=s.jsx(B,{type:"button",variant:"outline",onClick:c,disabled:w,children:"Cancelar"}),e[57]=w,e[58]=c,e[59]=k):k=e[59];const I=w?"Verificando...":"Vincular";let G;e[60]!==w||e[61]!==I?(G=s.jsx(B,{type:"submit",disabled:w,children:I}),e[60]=w,e[61]=I,e[62]=G):G=e[62];let Z;e[63]!==k||e[64]!==G?(Z=s.jsxs("div",{className:"flex gap-2",children:[k,G]}),e[63]=k,e[64]=G,e[65]=Z):Z=e[65];let X;e[66]!==U||e[67]!==Z?(X=s.jsxs(fe,{className:"flex-col gap-2 pt-2 sm:flex-row sm:items-center sm:justify-between",children:[U,Z]}),e[66]=U,e[67]=Z,e[68]=X):X=e[68];let ee;return e[69]!==R||e[70]!==P||e[71]!==D||e[72]!==F||e[73]!==z||e[74]!==X?(ee=s.jsxs("form",{onSubmit:R,className:"space-y-4",children:[P,$,D,F,z,X]}),e[69]=R,e[70]=P,e[71]=D,e[72]=F,e[73]=z,e[74]=X,e[75]=ee):ee=e[75],ee}function Us(o){return s.jsxs("li",{className:"flex gap-2",children:[s.jsx("span",{"aria-hidden":!0,children:"•"}),s.jsx("span",{children:o})]},o)}function Ms(o,e){return s.jsxs("li",{className:"flex gap-2",children:[s.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}),s.jsx("span",{children:o})]},o)}function Qs(){navigator.clipboard?.writeText(pe),Re.success("E-mail copiado")}function Gs(){const o=H.c(2);let e;o[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"size-9 shrink-0 animate-pulse rounded-lg bg-muted/60"}),o[0]=e):e=o[0];let t;return o[1]===Symbol.for("react.memo_cache_sentinel")?(t=s.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,s.jsxs("div",{className:"min-w-0 flex-1 space-y-2",children:[s.jsx("div",{className:"h-4 w-24 animate-pulse rounded bg-muted/60"}),s.jsx("div",{className:"hidden h-3 w-full animate-pulse rounded bg-muted/60 sm:block"})]}),s.jsx("div",{className:"h-8 w-20 shrink-0 animate-pulse rounded-lg bg-muted/60 sm:mt-auto sm:w-full"})]}),o[1]=t):t=o[1],t}const Hs="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:t,connecting:n,disconnecting:i,disabled:a,onConnect:l,onDisconnect:c,org:u,selfClient:p,siteUrl:r,autoOpenConfigFieldKey:f,onAutoOpenConfigHandled:m}=o,h=t.linkedConnectionId,_=Ct[t.bindingType],C=!!_&&t.boundVia!=="oauth";let g;e[0]!==f||e[1]!==t||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]!==_||e[11]!==p||e[12]!==r||e[13]!==C?(g=C&&_?s.jsx(Bs,{card:t,provider:_,org:u,selfClient:p,siteUrl:r,onOAuthInstead:l,disabled:a,connecting:n}):t.satisfied&&h?s.jsxs("div",{className:"flex items-center justify-end gap-1 sm:justify-start",children:[s.jsxs("span",{className:"flex items-center gap-1.5 text-sm text-muted-foreground",children:[s.jsx(Me,{size:16,className:"text-success"})," Conectado"]}),s.jsx(Q.Suspense,{fallback:s.jsx(Ws,{}),children:s.jsx(Ys,{card:t,org:u,selfClient:p,connectionId:h,contextSiteUrl:r,autoOpen:Ht({autoOpenFieldKey:f,card:t}),onAutoOpenHandled:m})}),s.jsxs(Fe,{children:[s.jsx(Ke,{asChild:!0,children:s.jsx(B,{type:"button",variant:"ghost",size:"icon-sm",className:"shrink-0 text-muted-foreground hover:text-destructive",disabled:a||i,onClick:c,"aria-label":`Desconectar ${t.title}`,children:i?s.jsx(Ie,{size:16,className:"animate-spin"}):s.jsx(Mt,{size:16})})}),s.jsx(Ue,{children:"Desconectar"})]})]}):s.jsx(B,{type:"button",variant:"outline",size:"sm",className:"sm:w-full",disabled:a||n,onClick:l,"aria-label":`Conectar ${t.title}`,children:n?s.jsx(Ie,{size:16,className:"animate-spin"}):"Conectar"}),e[0]=f,e[1]=t,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]=_,e[11]=p,e[12]=r,e[13]=C,e[14]=g):g=e[14];const d=g;let y;e[15]!==t.icon||e[16]!==t.title?(y=s.jsx(qe,{icon:t.icon,name:t.title,size:"sm",fit:"contain",className:"shrink-0 p-1.5"}),e[15]=t.icon,e[16]=t.title,e[17]=y):y=e[17];let v;e[18]!==t.area?(v=t.area&&s.jsx("span",{className:ie("hidden sm:inline-block",Hs),children:t.area}),e[18]=t.area,e[19]=v):v=e[19];let x;e[20]!==y||e[21]!==v?(x=s.jsxs("div",{className:"shrink-0 sm:flex sm:w-full sm:items-center sm:justify-between sm:gap-2",children:[y,v]}),e[20]=y,e[21]=v,e[22]=x):x=e[22];let E;e[23]!==t.title?(E=s.jsx("p",{className:"text-sm font-medium text-foreground",children:t.title}),e[23]=t.title,e[24]=E):E=e[24];let S;e[25]!==t.headline?(S=t.headline&&s.jsx("p",{className:"hidden text-sm leading-5 text-muted-foreground sm:mt-0.5 sm:line-clamp-2 sm:block",children:t.headline}),e[25]=t.headline,e[26]=S):S=e[26];let j;e[27]!==E||e[28]!==S?(j=s.jsxs("div",{className:"min-w-0 flex-1",children:[E,S]}),e[27]=E,e[28]=S,e[29]=j):j=e[29];let b;e[30]!==d?(b=s.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=s.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 Bs(o){const e=H.c(39),{card:t,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 _;e[0]!==m?(_=T=>{!T&&m||f(T)},e[0]=m,e[1]=_):_=e[1];const C=_;let g;e[2]!==t.satisfied||e[3]!==t.title||e[4]!==p||e[5]!==u?(g=t.satisfied?s.jsxs("div",{className:"flex items-center justify-end gap-1 sm:justify-start",children:[s.jsxs("span",{className:"flex items-center gap-1.5 text-sm text-muted-foreground",children:[s.jsx(Me,{size:16,className:"text-success"})," Conectado"]}),s.jsxs(Fe,{children:[s.jsx(Ke,{asChild:!0,children:s.jsx(B,{type:"button",variant:"ghost",size:"icon-sm",className:"shrink-0",onClick:()=>f(!0),"aria-label":`Configurar ${t.title}`,children:s.jsx(gt,{size:16})})}),s.jsx(Ue,{children:"Editar configuração"})]})]}):s.jsx(B,{type:"button",variant:"outline",size:"sm",className:"sm:w-full",disabled:u||p,onClick:()=>f(!0),"aria-label":`Conectar ${t.title}`,children:p?s.jsx(Ie,{size:16,className:"animate-spin"}):"Conectar"}),e[2]=t.satisfied,e[3]=t.title,e[4]=p,e[5]=u,e[6]=g):g=e[6];let d;e[7]!==t.icon||e[8]!==t.title?(d=s.jsx(qe,{icon:t.icon,name:t.title,size:"md",fit:"contain",className:"p-1.5"}),e[7]=t.icon,e[8]=t.title,e[9]=d):d=e[9];let y;e[10]!==t.title?(y=s.jsx(dt,{children:t.title}),e[10]=t.title,e[11]=y):y=e[11];let v;e[12]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(ut,{children:"Conceda acesso ao nosso leitor e informe o identificador"}),e[12]=v):v=e[12];let x;e[13]!==y?(x=s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[y,v]}),e[13]=y,e[14]=x):x=e[14];let E;e[15]!==d||e[16]!==x?(E=s.jsxs(mt,{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=t.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]!==t.satisfied||e[20]!==c?(b=t.satisfied?void 0:()=>{f(!1),c()},e[19]=t.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]!==S?(N=s.jsx(Ks,{provider:n,siteUrl:l,selfClient:a,org:i,initialResourceId:S,onDone:j,onIsPendingChange:h,onOAuthInstead:b}),e[22]=i,e[23]=n,e[24]=a,e[25]=l,e[26]=b,e[27]=S,e[28]=N):N=e[28];let O;e[29]!==N||e[30]!==E?(O=s.jsxs(ft,{className:"sm:max-w-lg",children:[E,N]}),e[29]=N,e[30]=E,e[31]=O):O=e[31];let R;e[32]!==C||e[33]!==r||e[34]!==O?(R=s.jsx(pt,{open:r,onOpenChange:C,children:O}),e[32]=C,e[33]=r,e[34]=O,e[35]=R):R=e[35];let w;return e[36]!==R||e[37]!==g?(w=s.jsxs(s.Fragment,{children:[g,R]}),e[36]=R,e[37]=g,e[38]=w):w=e[38],w}function Ws(){const o=H.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"size-8 shrink-0 animate-pulse rounded-lg bg-muted/60"}),o[0]=e):e=o[0],e}function Ys(o){const e=H.c(60),{card:t,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=ze(p),[f,m]=Q.useState(c),[h,_]=Q.useState(!1),C=he(),g=qs[t.bindingType],d=Vt(t.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 v=y;let x;e[7]!==v||e[8]!==h?(x=I=>{if(!(!I&&h)){if(!I){v();return}m(!0)}},e[7]=v,e[8]=h,e[9]=x):x=e[9];const E=x;let S;e[10]!==a||e[11]!==i?(S=async()=>{await i.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:a,force:!0}})},e[10]=a,e[11]=i,e[12]=S):S=e[12];let j;e[13]!==t.title||e[14]!==v||e[15]!==n.id||e[16]!==C?(j=async()=>{await C.invalidateQueries({queryKey:Y.commerceDiscoveryCompanionConnectionsPrefix(n.id)}),Re.success(`${t.title} desconectado`),v()},e[13]=t.title,e[14]=v,e[15]=n.id,e[16]=C,e[17]=j):j=e[17];let b;e[18]!==S||e[19]!==j?(b={mutationFn:S,onSuccess:j,onError:Zs},e[18]=S,e[19]=j,e[20]=b):b=e[20];const N=Oe(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 R=`Configurar ${t.title}`;let w;e[22]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(gt,{size:16}),e[22]=w):w=e[22];let T;e[23]!==R?(T=s.jsx(Ke,{asChild:!0,children:s.jsx(B,{type:"button",variant:"ghost",size:"icon-sm",className:"shrink-0",onClick:O,"aria-label":R,children:w})}),e[23]=R,e[24]=T):T=e[24];const L=d.length>0?"Editar configuração":"Configurar";let P;e[25]!==L?(P=s.jsx(Ue,{children:L}),e[25]=L,e[26]=P):P=e[26];let K;e[27]!==T||e[28]!==P?(K=s.jsxs(Fe,{children:[T,P]}),e[27]=T,e[28]=P,e[29]=K):K=e[29];let $;e[30]!==t.icon||e[31]!==t.title?($=s.jsx(qe,{icon:t.icon,name:t.title,size:"md",fit:"contain",className:"p-1.5"}),e[30]=t.icon,e[31]=t.title,e[32]=$):$=e[32];let q;e[33]!==t.title?(q=s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[s.jsx(dt,{children:t.title}),s.jsxs(ut,{children:["Configure o ",t.title," para enriquecer os dados"]})]}),e[33]=t.title,e[34]=q):q=e[34];let M;e[35]!==$||e[36]!==q?(M=s.jsxs(mt,{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 D;e[38]!==N?(D=()=>N.mutate(),e[38]=N,e[39]=D):D=e[39];let F;e[40]!==g||e[41]!==t||e[42]!==v||e[43]!==r||e[44]!==a||e[45]!==l||e[46]!==n||e[47]!==i||e[48]!==D?(F=s.jsx(g,{card:t,connectionId:a,companionClient:r,selfClient:i,org:n,contextSiteUrl:l,onDone:v,onDisconnect:D,onIsPendingChange:_}),e[40]=g,e[41]=t,e[42]=v,e[43]=r,e[44]=a,e[45]=l,e[46]=n,e[47]=i,e[48]=D,e[49]=F):F=e[49];let z;e[50]!==M||e[51]!==F?(z=s.jsxs(ft,{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=s.jsx(pt,{open:f,onOpenChange:E,children:z}),e[53]=f,e[54]=E,e[55]=z,e[56]=U):U=e[56];let k;return e[57]!==K||e[58]!==U?(k=s.jsxs(s.Fragment,{children:[K,U]}),e[57]=K,e[58]=U,e[59]=k):k=e[59],k}function Zs(){Re.error("Não foi possível desconectar. Tente novamente.")}const Ve={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 Xs(o){const e=H.c(40),{selfClient:t,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=ze(l);let u;e[4]!==i||e[5]!==n.id?(u=Y.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 J(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?Bt(f.data.stateSchema):null,h=m&&m.length>0?m:Wt,_=h.map(cn),C=h.map(ln).filter(rn),g=h.filter(an).map(on),d=[...C,...g].sort().join(",");let y;e[12]!==i||e[13]!==n.id?(y=Y.commerceDiscoveryConnection(n.id,i),e[12]=i,e[13]=n.id,e[14]=y):y=e[14];let v;e[15]!==i||e[16]!==t?(v=async()=>{const A=await t.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:i}});return J(A)},e[15]=i,e[16]=t,e[17]=v):v=e[17];let x;e[18]!==y||e[19]!==v?(x={queryKey:y,queryFn:v},e[18]=y,e[19]=v,e[20]=x):x=e[20];const S=Pe(x).data?.item?.configuration_state??null;let j;e[21]!==S?(j=A=>S?.[A.fieldKey]?.value,e[21]=S,e[22]=j):j=e[22];const b=h.map(j).filter(nn),N=[..._.map(sn),...C.map(tn),...b.map(en)].sort().join(","),R=Pe({queryKey:Y.commerceDiscoveryCompanionConnections(n.id,N),queryFn:async()=>{if(h.length===0)return{items:[]};const A=[{field:["app_name"],operator:"in",value:_},{field:["app_id"],operator:"in",value:C}];b.length>0&&A.push({field:["id"],operator:"in",value:b});const te=await t.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{where:{operator:"or",conditions:A},limit:1e3}});return J(te)}}).data?.items??[],w=new Set(b),T=R.filter(A=>w.has(A.id)),L=T.filter(Js);let P;e[23]!==n.id||e[24]!==n.slug?(P=A=>({queryKey:Y.commerceDiscoveryCompanionOAuthStatus(n.id,A.id),queryFn:async()=>{try{const te=await fetch(`/api/${encodeURIComponent(n.slug)}/connections/${encodeURIComponent(A.id)}/oauth-token/status`,{credentials:"include"});return te.ok?{hasToken:(await te.json()).hasToken===!0}:{hasToken:!1}}catch{return{hasToken:!1}}},retry:!1}),e[23]=n.id,e[24]=n.slug,e[25]=P):P=e[25];const K=ms({queries:L.map(P)});let $;e[26]!==K?($=(A,te)=>[A.id,K[te]?.data?.hasToken===!0],e[26]=K,e[27]=$):$=e[27];const q=new Map(L.map($)),M={};for(const A of T)M[A.id]=!A.oauth_config||!!A.connection_token||q.get(A.id)===!0;const D=Pe({queryKey:Y.commerceDiscoveryCompanionRegistry(n.id,d),queryFn:async()=>{if(h.length===0)return{items:[]};const A=Yt(C,g),te=await as(ct.REGISTRY(n.id),n.id,n.slug,"COLLECTION_REGISTRY_APP_LIST",{...A?{where:A}:{},limit:1e3});return J(te)}}),F={},z={};for(const A of D.data?.items??[])F[A.id]=A,A.server?.name&&(z[A.server.name]=A);let U;e[28]!==n.id||e[29]!==a?(U=Y.commerceDiscoveryConnectionStatus(n.id,a??""),e[28]=n.id,e[29]=a,e[30]=U):U=e[30];const k=!!a;let I;e[31]!==t||e[32]!==a?(I=async()=>{const A=await t.callTool({name:"COMMERCE_DISCOVERY_CONNECTION_STATUS",arguments:{siteUrl:a}});return J(A)},e[31]=t,e[32]=a,e[33]=I):I=e[33];let G;e[34]!==U||e[35]!==k||e[36]!==I?(G={queryKey:U,enabled:k,queryFn:I},e[34]=U,e[35]=k,e[36]=I,e[37]=G):G=e[37];const Z=me(G),X={};for(const[A,te]of Object.entries(Ct)){const ne=Z.data?.providers?.[te];ne?.connected&&ne.via==="sa"&&(X[A]={resource:ne.resource??null})}const ee=Zt({requirements:h,itemsById:F,itemsByName:z,connections:R,connectionReadiness:M,configurationState:S,curated:Ve,saBindings:X});let V;return e[38]!==ee?(V={cards:ee},e[38]=ee,e[39]=V):V=e[39],V}function Js(o){return o.oauth_config&&!o.connection_token}function en(o){return`linked:${o}`}function tn(o){return`app:${o}`}function sn(o){return`binding:${o}`}function nn(o){return typeof o=="string"&&o.length>0}function on(o){return o.bindingType}function an(o){return!Ve[o.bindingType]}function rn(o){return!!o}function ln(o){return Ve[o.bindingType]?.registryAppId}function cn(o){return o.bindingType}function dn({selfClient:o,org:e,userId:t,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 J(y)};async function _(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=rs(g.registryItem,e.id,t,{remoteIndex:0}),N=b.connection_type==="STDIO",O=!!b.connection_url,R=N&&b.connection_headers&&typeof b.connection_headers=="object"&&"command"in b.connection_headers;if(!O&&!R)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=J(w).item.id}const v=y,x=await ls({connectionId:v,orgId:e.id,orgSlug:e.slug,persistFallback:b=>h(v,{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}}),S=J(E).item?.configuration_state??null,j=Xt(S,g.fieldKey,g.bindingType,v);return g.bindingType==="github"&&delete j.github_repo,await h(n,{configuration_state:j}),await l.invalidateQueries({queryKey:Y.commerceDiscoveryConnection(e.id,n)}),await l.invalidateQueries({queryKey:Y.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 C(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={...J(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:Y.commerceDiscoveryConnection(e.id,n)}),await l.invalidateQueries({queryKey:Y.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:_,connectingFieldKey:c,disconnect:C,disconnectingFieldKey:p,error:f}}const Be="flex min-h-0 flex-1 flex-col gap-4 md:grid md:flex-none md:gap-4";function We(){const o=H.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.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 un(){const o=H.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[0,1,2,3].map(mn)}),o[0]=e):e=o[0],e}function mn(o){return s.jsx(Gs,{},o)}function fn(){const o=H.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsxs("div",{className:Be,children:[s.jsx(We,{}),s.jsx(un,{})]}),o[0]=e):e=o[0],e}function pn(o){const e=H.c(5),{onRetry:t}=o;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(We,{}),e[0]=n):n=e[0];let i,a;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("p",{className:"text-sm text-foreground",children:"Não foi possível carregar as integrações complementares."}),a=s.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]!==t?(l=s.jsxs("div",{className:Be,children:[n,s.jsxs("div",{role:"alert",className:"rounded-2xl border border-border bg-card p-4",children:[i,a,s.jsx(B,{type:"button",variant:"outline",size:"sm",className:"mt-3",onClick:t,children:"Tentar novamente"})]})]}),e[3]=t,e[4]=l):l=e[4],l}function Vn(o){const e=H.c(2);let t;return e[0]!==o?(t=s.jsx(zt,{children:n=>{const{reset:i}=n;return s.jsx(qt,{fallback:a=>{const{resetError:l}=a;return s.jsx(pn,{onRetry:()=>{i(),l()}})},children:s.jsx(Q.Suspense,{fallback:s.jsx(fn,{}),children:s.jsx(hn,{...o})})})}}),e[0]=o,e[1]=t):t=e[1],t}function hn(o){const e=H.c(46),{org:t,cdConnectionId:n,siteUrl:i,onReadinessChange:a}=o,{data:l}=Ft.useSession(),c=l?.user?.id??"";let u;if(e[0]!==i){const R=i?Te(i):null;if(R?.ok)try{u=new URL(R.value).hostname}catch{u=void 0}e[0]=i,e[1]=u}else u=e[1];let p;e[2]!==t.id||e[3]!==t.slug?(p={connectionId:Ut,orgId:t.id,orgSlug:t.slug},e[2]=t.id,e[3]=t.slug,e[4]=p):p=e[4];const r=ze(p);let f;e[5]!==n||e[6]!==t||e[7]!==r||e[8]!==i?(f={selfClient:r,org:t,cdConnectionId:n,siteUrl:i},e[5]=n,e[6]=t,e[7]=r,e[8]=i,e[9]=f):f=e[9];const{cards:m}=Xs(f);let h;e[10]!==n||e[11]!==t||e[12]!==r||e[13]!==u||e[14]!==i||e[15]!==c?(h={selfClient:r,org:t,userId:c,cdConnectionId:n,domain:u,siteUrl:i},e[10]=n,e[11]=t,e[12]=r,e[13]=u,e[14]=i,e[15]=c,e[16]=h):h=e[16];const{connect:_,connectingFieldKey:C,disconnect:g,disconnectingFieldKey:d,error:y}=dn(h),[v,x]=Q.useState(null);if(a?.(m.length===0||m.some(gn)),m.length===0)return null;const E=C!==null||d!==null;let S;e[17]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(We,{}),e[17]=S):S=e[17];let j;e[18]!==y?(j=y&&s.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]!==v||e[21]!==E||e[22]!==m||e[23]!==_||e[24]!==C||e[25]!==g||e[26]!==d||e[27]!==t||e[28]!==r||e[29]!==i){let R;e[31]!==v||e[32]!==E||e[33]!==_||e[34]!==C||e[35]!==g||e[36]!==d||e[37]!==t||e[38]!==r||e[39]!==i?(R=w=>{const T=async()=>{await _(w)&&x(w.fieldKey)};return s.jsx(Vs,{card:w,connecting:C===w.fieldKey,disconnecting:d===w.fieldKey,disabled:E&&C!==w.fieldKey&&d!==w.fieldKey,org:t,selfClient:r,siteUrl:i,autoOpenConfigFieldKey:v,onAutoOpenConfigHandled:()=>x(L=>L===w.fieldKey?null:L),onConnect:()=>{T()},onDisconnect:()=>{g(w)}},w.fieldKey)},e[31]=v,e[32]=E,e[33]=_,e[34]=C,e[35]=g,e[36]=d,e[37]=t,e[38]=r,e[39]=i,e[40]=R):R=e[40],b=m.map(R),e[20]=v,e[21]=E,e[22]=m,e[23]=_,e[24]=C,e[25]=g,e[26]=d,e[27]=t,e[28]=r,e[29]=i,e[30]=b}else b=e[30];let N;e[41]!==b?(N=s.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=s.jsxs("div",{className:Be,children:[S,s.jsxs(xs,{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 gn(o){return o.satisfied}const Ye="https://decocms.com/agendar",xn="Precisa de ajuda? Fale conosco",yn="Agende uma chamada e ajudamos você a conectar suas ferramentas.",ye=[{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"}],bn="var(--brand-green-dark)";function Bn({siteUrl:o,email:e}){const t=new URL(Ye);return o&&t.searchParams.set("siteUrl",o),e&&t.searchParams.set("email",e),t.toString()}function Cn(o){const e=H.c(12),{href:t,size:n,className:i,orgId:a}=o,l=t===void 0?Ye:t,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=s.jsx(bt,{size:16}),e[4]=r):r=e[4];let f;e[5]!==l||e[6]!==p?(f=s.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=s.jsx(B,{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 vn(o){const e=H.c(10),{size:t}=o,n=t===void 0?72:t;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=ye.map((p,r)=>s.jsxs("div",{className:"relative shrink-0",style:{width:n,height:n,marginLeft:r===0?0:-a,zIndex:ye.length-r},children:[s.jsx("div",{className:"h-full w-full overflow-hidden rounded-full border-4 border-card bg-muted",children:s.jsx("img",{src:p.photo,alt:p.alt,className:"h-full w-full object-cover",loading:"lazy"})}),r===0&&s.jsxs("span",{className:"absolute bottom-1.5 right-1.5 flex h-3.5 w-3.5",children:[s.jsx("span",{className:"absolute inline-flex h-full w-full rounded-full bg-success opacity-60 motion-safe:animate-ping","aria-hidden":!0}),s.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=s.jsx("div",{className:"flex items-end",style:l,children:c}),e[7]=l,e[8]=c,e[9]=u):u=e[9],u}function Wn(o){const e=H.c(6),{href:t,orgId:n}=o;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"h-20",style:{backgroundColor:bn}}),e[0]=i):i=e[0];let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{className:"-mt-9 mb-4",children:s.jsx(vn,{})}),e[1]=a):a=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs("div",{className:"grid gap-1.5",children:[s.jsx("h2",{className:"text-lg font-medium leading-6 text-foreground",children:xn}),s.jsx("p",{className:"text-sm leading-5 text-muted-foreground",children:yn})]}),e[2]=l):l=e[2];let c;return e[3]!==t||e[4]!==n?(c=s.jsx("div",{className:"relative flex h-full w-full items-center justify-center p-10",children:s.jsxs("div",{className:"w-full max-w-[440px] overflow-hidden rounded-3xl border border-border bg-card card-shadow",children:[i,s.jsxs("div",{className:"px-8 pb-8",children:[a,l,s.jsx(Cn,{href:t,size:"lg",className:"mt-6",orgId:n})]})]})}),e[3]=t,e[4]=n,e[5]=c):c=e[5],c}function Yn(o){const e=H.c(13),{className:t,href:n,orgId:i}=o,a=n===void 0?Ye: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]!==t?(c=ie("flex items-center gap-3 rounded-xl border border-border bg-card p-3 card-shadow transition-colors hover:bg-accent",t),e[2]=t,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=ye.map(jn),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=s.jsxs("span",{className:"relative flex shrink-0 items-center",style:u,children:[p,s.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:ye.length+1}})]}),f=s.jsx("span",{className:"flex-1 text-sm font-medium leading-tight text-foreground",children:"Precisa de ajuda? Fale conosco"}),m=s.jsx(bt,{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=s.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 jn(o,e){return s.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:ye.length-e},children:s.jsx("img",{src:o.photo,alt:o.alt,className:"h-full w-full object-cover",loading:"lazy"})},o.photo)}function Zn(o){const e=H.c(10),{host:t}=o,n=`https://www.google.com/s2/favicons?domain=${t}&sz=128`;let i,a,l;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-7 w-7 dark:hidden"}),a=s.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-7 w-7 hidden dark:block"}),l=s.jsx("div",{className:"h-6 w-px rotate-12 bg-border","aria-hidden":"true"}),e[0]=i,e[1]=a,e[2]=l):(i=e[0],a=e[1],l=e[2]);let c;e[3]!==n?(c=s.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-border bg-white",children:s.jsx("img",{src:n,alt:"",className:"h-5 w-5",loading:"lazy"})}),e[3]=n,e[4]=c):c=e[4];let u;e[5]!==t?(u=s.jsx("span",{className:"text-lg font-medium text-foreground",children:t}),e[5]=t,e[6]=u):u=e[6];let p;return e[7]!==c||e[8]!==u?(p=s.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 _n(o){return o.content?.find(e=>e.text)?.text??"A configuração do Commerce Discovery falhou."}function Xn(o){const e=o;if(e.isError)throw new Error(_n(e));return e.structuredContent??o}export{fn as C,He as L,Zn as S,xs as a,Bn as b,Wn as c,Vn as d,Yn as e,Gn as i,Te as n,Xn as p,Hn as s};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as T,j as t,r as J,B as je,i as be}from"./index-CcnDuzQF.js";import{i as Se}from"./ChevronRight-BJB9_FhX.js";import{S as fe}from"./agent-icon-CwIj7ip2.js";import{A as ue}from"./automation-runs-CkDldPBm.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-8TDfaInh.js";import{Z as xe,r as ze}from"./index-itkS_lok.js";import{a as ge}from"./Image01-CPXRt0hE.js";import"./AlertCircle-lFskF6YY.js";import"./UserPlus01-CqBsiM1H.js";import"./Tool01-Dy5hyOiW.js";import"./ArrowUp-ygdMVrQH.js";import"./Settings02-9vuwfVDi.js";import"./Tool02-XJPr8Y_R.js";import"./XCircle-BSeVixi7.js";import"./ArrowUpRight-D-YvHLwD.js";import"./TrendUp01-Dr8DqK3L.js";import"./ZapSquare-CoYWWwWK.js";import"./ZoomOut-Viuq6Pl_.js";import"./Users03-fvOQBJ4F.js";import"./CheckCircle-8vSEu8DC.js";import"./Check-BH0H5-aR.js";import"./ChevronDown-B1YuVRBJ.js";import"./ChevronUp-DGgV5Zh7.js";import"./Circle-2BJQT-zG.js";import"./Stars02-1ZRp_s0O.js";import"./Copy01-DEGDYVwN.js";import"./DotsVertical-DlHU-amx.js";import"./Globe01-CT3--ij5.js";import"./Eye-DeQrUDT5.js";import"./FilterLines-DjDwh0th.js";import"./Flag01-BwPR9oyI.js";import"./Star01-Dy0cf-WL.js";import"./Globe04-ChKR_KFt.js";import"./SwitchHorizontal01-BIESqUhz.js";import"./HardDrive-BU215eSg.js";import"./Key01-BCu952rc.js";import"./LayoutLeft-CVRYZq32.js";import"./LinkExternal01-CdOt02SY.js";import"./List-yL6XInvz.js";import"./Monitor01-BcfLMfxc.js";import"./Sun-YaAUXtgz.js";import"./Package-BL0jdV3W.js";import"./Palette-CCdAyeGI.js";import"./Play-DGFyqrSw.js";import"./Plus-By3V7_aY.js";import"./SearchLg-WE6yBjyb.js";import"./SearchMd-fYsPzheL.js";import"./Shield01-Cjl9SB9n.js";import"./Stars01-yBNtNGKk.js";import"./Trash01-B38J7mB_.js";import"./Upload01-C3Qt0frN.js";import"./User01-80dWa4Cm.js";import"./Users01-CmHqRWr9.js";import"./XClose-BVJ-MEjc.js";import"./X-Bhz5GImQ.js";import"./Zap-D-Ze3svs.js";import"./select-BlgNnINX.js";import"./tooltip-2I_b-6X7.js";import"./useInfiniteQuery-Dvpyv_Ki.js";import"./use-infinite-scroll-xSLFTpsv.js";import"./use-connection-W4m2UAAR.js";import"./use-collections-XYRpJlwJ.js";import"./use-mcp-client-DNLhxapG.js";import"./constants-BHDe7bIw.js";import"./auth-QfoVG72I.js";import"./use-virtual-mcp-D0buNzsY.js";import"./card-BwSLlExQ.js";import"./sidebar-QaWFVWqc.js";import"./use-mobile-BBzH2hXY.js";import"./table-BqgRZyFk.js";import"./empty-state-C9ZZeV5U.js";import"./use-members-MzPIs59g.js";import"./use-org-auth-client-8TBxSh-W.js";import"./use-clock-tick-DxUHNNfQ.js";import"./use-automations-fHz136Fu.js";import"./studio-tools-CenRUFIk.js";import"./useSuspenseInfiniteQuery-CYG1CE5G.js";import"./avatar-D5c6HQA-.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-D1NDEQwd.js";import"./file-type-icon-Dw0tI5nk.js";import"./dialog-CSPNf1M2.js";import"./tab-id-BijBBRwE.js";import"./hooks-Cruglddo.js";import"./decopilot-sse-pool-pQTikeGF.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./chat-context-D4QrlA70.js";import"./autosend-BUw740M6.js";import"./use-ai-providers-BfZ-rcXF.js";import"./location-BpLtHjTZ.js";import"./use-decopilot-events-CXPYfBME.js";import"./use-organization-settings-Bd9PTvWZ.js";import"./monaco-editor-GgZXnppw.js";import"./index-DiHEyi6k.js";import"./index-SICUCD_4.js";import"./shell-layout-BdhBs9fD.js";import"./required-auth-layout-Ct9RjuO1.js";import"./use-org-sso-CEo2DhxC.js";import"./integration-icon-CgQTPrq8.js";import"./use-navigate-to-agent-B0FPvEI2.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-CEQ7SfFQ.js";import"./form-DZWEEJcU.js";import"./label-CXarTOxH.js";import"./input-C9C08vUS.js";import"./switch-RPHbuzW8.js";import"./drawer-DRDSpHGN.js";import"./collection-search-D-f_rjVH.js";import"./tabs-BXBrXjFm.js";import"./toggle-group-wS8Ypese.js";import"./use-deco-credits-B_UNdLb6.js";import"./extract-connection-data-NqYjy1W6.js";import"./connection-card-B8wGpyDx.js";import"./use-registry-connections-Dht86cFk.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-CeAKw7uR.js";import"./connection-form-helpers-Bpz9M-Z0.js";import"./authenticate-and-persist-oauth-D-sBYsRy.js";import"./mcp-oauth-qMEpITxW.js";import"./collection-tabs-JWPRYdFI.js";import"./badge-Cq-ZVkxw.js";import"./connect-desktop-dialog-DzsxaBBr.js";import"./select-model-ClAJFfDX.js";import"./checkbox-UrgW9h_w.js";import"./skeleton-BihPrDsJ.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-FaO6W2dI.js";import"./command-DhR1pFgj.js";import"./index-DSYxxNrJ.js";import"./popover-ChNVRGUA.js";import"./dropdown-menu-Dm6yHfCA.js";import"./index-B5kPsZvB.js";import"./alert-dialog-CJpw8NP1.js";import"./toolbar-2t2LWIlp.js";import"./use-debounced-value-DdzAq6K1.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-3EdF-Lof.js";import"./use-mcp-tools-BToM4-zh.js";import"./use-capability-BF6nPm2s.js";import"./toolbar-icon-button-D0GDL8yO.js";import"./use-debounced-autosave-BeR_XDOQ.js";import"./index-CJEtdv0a.js";import"./search-input-BNLePuM-.js";import"./use-mcp-auth-status-C424940c.js";import"./use-registry-app-BTOjr2tZ.js";import"./github-repo-picker-B0mUI5QG.js";import"./provision-repo-scoped-github-connection-2iDn-wQ1.js";import"./github-repo-scope-DjMZbiKa.js";import"./use-secrets-ClB5h_LI.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./companions-core-nxOBF2bU.js";import"./index-CWbQSt4G.js";import"./get-initials-D-f_fDFw.js";import"./calendar-DYgC6cUR.js";import"./use-file-configs-BtGcN1Ob.js";import"./automation-list-row-DyujL0A9.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:l,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]!==l||e[2]!==i?(p=t.jsx("img",{src:i,alt:"",referrerPolicy:"no-referrer",className:l,style:m}),e[1]=l,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 r;return e[7]!==l||e[8]!==o?(r=t.jsx("div",{className:l,style:s,children:o}),e[7]=l,e[8]=o,e[9]=r):r=e[9],r}function $e(n){const e=T.c(27),{seo:i,host:l,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 r;e[4]===Symbol.for("react.memo_cache_sentinel")?(r={color:"#202124"},e[4]=r):r=e[4];let m;e[5]!==l?(m=t.jsx("div",{className:"truncate text-[13px] leading-tight",style:r,children:l}),e[5]=l,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]!==l||e[9]!==h?(d=t.jsxs("div",{className:"truncate text-[12px] leading-tight",style:p,children:[l,h]}),e[8]=l,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:l}=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 r;e[5]!==l?(r=t.jsx("div",{className:"truncate text-[11px]",style:o,children:l}),e[5]=l,e[6]=r):r=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]!==r||e[15]!==d?(x=t.jsxs("div",{className:"px-3 py-2",style:s,children:[r,d,f]}),e[13]=f,e[14]=r,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:l,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 r;e[2]!==o?(r={background:"#fff",borderLeft:o},e[2]=o,e[3]=r):r=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]!==l?(j=t.jsx("div",{className:"mt-0.5 text-[10px]",style:u,children:l}),e[13]=l,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]!==r||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:r,children:[m,v]})]}),e[19]=v,e[20]=r,e[21]=m,e[22]=y):y=e[22],y}function Ae(n){const e=T.c(33),{seo:i,host:l,accent:h,dark:a}=n,s=a?"#2b2d31":"#fff",o=a?"#00a8fc":"#1264a3",r=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]!==l||e[8]!==f?(x=t.jsx("div",{className:"text-[10px]",style:f,children:l}),e[7]=l,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]!==r?(y={color:r},e[15]=r,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:l,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]!==l?(s=i.layout==="search"?t.jsx($e,{seo:l,host:h,path:a}):i.layout==="card"?t.jsx(De,{seo:l,host:h,path:a}):i.layout==="chat"?t.jsx(Ie,{seo:l,host:h,path:a,accent:i.color}):t.jsx(Ae,{seo:l,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]=l,e[6]=s):s=e[6];const o=s;let r;e[7]!==i.color?(r=t.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{background:i.color}}),e[7]=i.color,e[8]=r):r=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]!==r||e[12]!==m?(p=t.jsxs("div",{className:"mb-1.5 flex items-center gap-1.5",children:[r,m]}),e[11]=r,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:l,path:h}=n,a=h===void 0?"/":h;let s,o,r;if(e[0]!==i||e[1]!==l){const u=Pe(i);s=u,o=he(u.image,l),r=he(u.favicon,l),e[0]=i,e[1]=l,e[2]=s,e[3]=o,e[4]=r}else s=e[2],o=e[3],r=e[4];let m;e[5]!==s||e[6]!==o||e[7]!==r?(m={...s,image:o,favicon:r},e[5]=s,e[6]=o,e[7]=r,e[8]=m):m=e[8];const p=m;let d;e[9]!==l?(d=Oe(l),e[9]=l,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 Gi(n){const e=T.c(63),{orgSlug:i,virtualMcpId:l,branch:h,decofile:a,meta:s,target:o,previewBaseUrl:r,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:l,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,G;e[2]!==a||e[3]!==w||e[4]!==s||e[5]!==o.kind?(R=o.kind==="page"?Fe(a,s)?.seoData??{}:{},G=o.kind==="page"?Ve(R,w):w,e[2]=a,e[3]=w,e[4]=s,e[5]=o.kind,e[6]=R,e[7]=G):(R=e[6],G=e[7]);const ie=G;let V;e[8]!==S||e[9]!==c||e[10]!==v?(V=E=>{if(!c)return;const de=E;v(de),S(de)},e[8]=S,e[9]=c,e[10]=v,e[11]=V):V=e[11];const se=V;let Y;e[12]!==v?(Y=()=>v(null),e[12]=v,e[13]=Y):Y=e[13];const re=Y;let H;e[14]!==b?(H=()=>b(Ke),e[14]=b,e[15]=H):H=e[15];const le=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]!==r||e[21]!==o.kind?(X=o.kind==="page"&&r?Ge(P,r):r??null,e[19]=P,e[20]=r,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]!==le||e[40]!==re||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:re,onBumpFormKey:le})]}):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]=le,e[40]=re,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 Ge(n,e){try{return new URL(n,e).href}catch{return e}}function Ve(n,e){const i=e.__resolveType,l=n.__resolveType;if(typeof i=="string"&&typeof l=="string"&&i!==l)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{Gi as SeoEditor};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{C as D,r as v,j as e,B as p,p as S,t as c,c as N}from"./index-CcnDuzQF.js";import{D as k}from"./domain-settings-DzMUWaKc.js";import{P as f}from"./index-CJEtdv0a.js";import{I as l}from"./input-C9C08vUS.js";import{S as z}from"./switch-RPHbuzW8.js";import{a as P,b as R,c as A,d as T}from"./use-org-sso-CEo2DhxC.js";import{c as F,S as y,a as C,b as r,d as O}from"./settings-section-FaO6W2dI.js";import{s as L}from"./Trash01-B38J7mB_.js";import{R as q}from"./require-capability-3UqoOdNg.js";import"./studio-tools-CenRUFIk.js";import"./badge-Cq-ZVkxw.js";import"./select-BlgNnINX.js";import"./tooltip-2I_b-6X7.js";import"./Check-BH0H5-aR.js";import"./ChevronDown-B1YuVRBJ.js";import"./ChevronUp-DGgV5Zh7.js";import"./sidebar-QaWFVWqc.js";import"./LayoutLeft-CVRYZq32.js";import"./use-mobile-BBzH2hXY.js";import"./X-Bhz5GImQ.js";import"./card-BwSLlExQ.js";import"./ArrowUpRight-D-YvHLwD.js";import"./use-capability-BF6nPm2s.js";import"./access-gate-CUbrXOy3.js";import"./capability-load-error-B419nly_.js";function B(){const{org:s}=D(),{data:a,isLoading:E}=P(s.id,s.slug),x=R(s.id,s.slug),h=A(s.id,s.slug),j=T(s.id,s.slug),[t,d]=v.useState({issuer:"",clientId:"",clientSecret:"",discoveryEndpoint:"",domain:"",scopes:"openid email profile"}),[m,g]=v.useState(!1),u=a?.configured&&a.config,o=a?.config,I=()=>{o&&d({issuer:o.issuer,clientId:o.clientId,clientSecret:"",discoveryEndpoint:o.discoveryEndpoint??"",domain:o.domain,scopes:o.scopes.join(" ")}),g(!0)},b=async()=>{if(!t.issuer||!t.clientId||!t.domain){c.error("Issuer, Client ID, and Domain are required");return}if(!u&&!t.clientSecret){c.error("Client Secret is required for initial setup");return}try{await x.mutateAsync({issuer:t.issuer,clientId:t.clientId,clientSecret:t.clientSecret,discoveryEndpoint:t.discoveryEndpoint||void 0,scopes:t.scopes.split(/\s+/).filter(Boolean),domain:t.domain,enforced:o?.enforced??!1}),S(u?"sso_config_updated":"sso_configured",{organization_id:s.id,email_domain:t.domain}),c.success("SSO configuration saved"),g(!1)}catch(i){c.error(i instanceof Error?i.message:"Failed to save SSO config")}},w=async()=>{if(confirm("Are you sure you want to remove SSO configuration?"))try{await h.mutateAsync(),S("sso_config_removed",{organization_id:s.id}),c.success("SSO configuration removed"),g(!1)}catch{c.error("Failed to remove SSO config")}},_=async i=>{try{await j.mutateAsync(i),S("sso_enforcement_toggled",{organization_id:s.id,enforced:i}),c.success(i?"SSO enforcement enabled":"SSO enforcement disabled")}catch{c.error("Failed to toggle SSO enforcement")}};return e.jsx(f,{children:e.jsx(f.Content,{children:e.jsx(f.Body,{children:e.jsxs(F,{children:[e.jsx(f.Title,{children:"Security"}),e.jsx(k,{}),E?e.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading..."}):e.jsxs(e.Fragment,{children:[u&&!m&&e.jsx(y,{title:"Single Sign-On",children:e.jsxs(C,{children:[e.jsx(r,{title:"Provider",action:e.jsx("span",{className:"font-medium",children:o.issuer})}),e.jsx(r,{title:"Client ID",action:e.jsx("span",{className:"font-mono text-xs",children:o.clientId})}),e.jsx(r,{title:"Domain",action:e.jsx("span",{className:"font-medium",children:o.domain})}),e.jsx(r,{title:"Scopes",action:e.jsx("span",{className:"font-mono text-xs",children:o.scopes.join(" ")})}),e.jsx("div",{className:"h-px bg-border mx-5"}),e.jsx(r,{title:"Enforce SSO",description:"Require all members to authenticate via SSO",action:e.jsx(z,{checked:o.enforced,onCheckedChange:_,disabled:j.isPending})}),e.jsxs(O,{children:[e.jsxs(p,{variant:"ghost",size:"sm",onClick:w,disabled:h.isPending,className:"text-destructive hover:text-destructive mr-auto",children:[e.jsx(L,{size:14}),"Remove"]}),e.jsx(p,{variant:"outline",size:"sm",onClick:()=>{window.open(`/api/${s.slug}/sso/authorize`,"_blank")},children:"Test SSO"}),e.jsx(p,{variant:"outline",size:"sm",onClick:I,children:"Edit configuration"})]})]})}),(!u||m)&&e.jsx(y,{title:"Single Sign-On",children:e.jsxs(C,{children:[e.jsx(r,{title:"Issuer URL",description:"The OIDC issuer URL of your identity provider.",action:e.jsx(l,{id:"sso-issuer",placeholder:"https://login.microsoftonline.com/{tenant}/v2.0",value:t.issuer,onChange:i=>d(n=>({...n,issuer:i.target.value})),className:"w-[280px]"})}),e.jsx(r,{title:"Client ID",action:e.jsx(l,{id:"sso-client-id",placeholder:"your-client-id",value:t.clientId,onChange:i=>d(n=>({...n,clientId:i.target.value})),className:"w-[280px]"})}),e.jsx(r,{title:"Client Secret",description:m&&u?"Leave empty to keep current":void 0,action:e.jsx(l,{id:"sso-client-secret",type:"password",placeholder:"your-client-secret",value:t.clientSecret,onChange:i=>d(n=>({...n,clientSecret:i.target.value})),className:"w-[280px]"})}),e.jsx(r,{title:"Email Domain",description:"The email domain this SSO provider covers.",action:e.jsx(l,{id:"sso-domain",placeholder:"company.com",value:t.domain,onChange:i=>d(n=>({...n,domain:i.target.value})),className:"w-[280px]"})}),e.jsx(r,{title:"Scopes",action:e.jsx(l,{id:"sso-scopes",placeholder:"openid email profile",value:t.scopes,onChange:i=>d(n=>({...n,scopes:i.target.value})),className:"w-[280px]"})}),e.jsx(r,{title:"Discovery Endpoint",description:"Optional — auto-detected from issuer if omitted.",action:e.jsx(l,{id:"sso-discovery",placeholder:"Auto-detected from issuer",value:t.discoveryEndpoint,onChange:i=>d(n=>({...n,discoveryEndpoint:i.target.value})),className:"w-[280px]"})}),e.jsxs(O,{children:[m&&e.jsx(p,{variant:"outline",size:"sm",onClick:()=>g(!1),children:"Cancel"}),e.jsx(p,{onClick:b,disabled:x.isPending,size:"sm",children:x.isPending?"Saving...":m?"Update":"Configure SSO"})]})]})})]})]})})})})}function ue(){const s=N.c(1);let a;return s[0]===Symbol.for("react.memo_cache_sentinel")?(a=e.jsx(q,{capability:"org:manage",area:"security",children:e.jsx(B,{})}),s[0]=a):a=s[0],a}export{ue as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/registry-layout-6DaHeWLa.js","assets/index-CcnDuzQF.js","assets/index-DpLPq5a_.css","assets/Tool02-XJPr8Y_R.js","assets/CheckCircle-8vSEu8DC.js","assets/Settings02-9vuwfVDi.js","assets/use-mcp-client-DNLhxapG.js","assets/constants-BHDe7bIw.js","assets/auth-QfoVG72I.js","assets/useInfiniteQuery-Dvpyv_Ki.js","assets/use-infinite-scroll-xSLFTpsv.js","assets/studio-tools-CenRUFIk.js","assets/badge-Cq-ZVkxw.js","assets/input-C9C08vUS.js","assets/dropdown-menu-Dm6yHfCA.js","assets/Check-BH0H5-aR.js","assets/ChevronRight-BJB9_FhX.js","assets/Circle-2BJQT-zG.js","assets/table-BqgRZyFk.js","assets/toggle-group-wS8Ypese.js","assets/use-view-mode-CLbJOwJV.js","assets/use-mobile-BBzH2hXY.js","assets/DotsVertical-DlHU-amx.js","assets/FilterLines-DjDwh0th.js","assets/Globe01-CT3--ij5.js","assets/SearchMd-fYsPzheL.js","assets/dialog-CSPNf1M2.js","assets/X-Bhz5GImQ.js","assets/AlertCircle-lFskF6YY.js","assets/Upload01-C3Qt0frN.js","assets/alert-dialog-CJpw8NP1.js","assets/card-BwSLlExQ.js","assets/Trash01-B38J7mB_.js","assets/label-CXarTOxH.js","assets/select-BlgNnINX.js","assets/tooltip-2I_b-6X7.js","assets/ChevronDown-B1YuVRBJ.js","assets/ChevronUp-DGgV5Zh7.js","assets/switch-RPHbuzW8.js","assets/textarea-CeAKw7uR.js","assets/XCircle-BSeVixi7.js","assets/checkbox-UrgW9h_w.js","assets/Eye-DeQrUDT5.js","assets/LinkExternal01-CdOt02SY.js","assets/use-copy-D1NDEQwd.js","assets/Copy01-DEGDYVwN.js","assets/Key01-BCu952rc.js","assets/Plus-By3V7_aY.js","assets/mcp-oauth-qMEpITxW.js","assets/Play-DGFyqrSw.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-CcnDuzQF.js";import{R as u}from"./require-capability-3UqoOdNg.js";import"./use-capability-BF6nPm2s.js";import"./access-gate-CUbrXOy3.js";import"./capability-load-error-B419nly_.js";const g=l.lazy(()=>f(()=>import("./registry-layout-6DaHeWLa.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,49])));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{i as a}from"./AlertCircle-lFskF6YY.js";import{i as c}from"./CheckCircle-8vSEu8DC.js";import{i as u}from"./Circle-2BJQT-zG.js";import{au as m}from"./agent-icon-CwIj7ip2.js";import{i as b,c as d,r as f}from"./index-CcnDuzQF.js";import{a as p}from"./XCircle-BSeVixi7.js";const g={requires_action:{label:"Needs review",verb:"Waiting for your review",icon:a,iconClassName:"text-warning",labelColor:"text-warning"},failed:{label:"Failed",verb:"Something went wrong",icon:p,iconClassName:"text-destructive",labelColor:"text-destructive"},expired:{label:"Timed out",verb:"Stopped responding",icon:m,iconClassName:"text-warning",labelColor:"text-warning"},in_progress:{label:"Running",verb:"Agent is working",icon:b,iconClassName:"text-primary",labelColor:"text-primary"},completed:{label:"Done",verb:"Completed",icon:c,iconClassName:"text-muted-foreground/50",labelColor:"text-muted-foreground"}},v={label:"Unknown",verb:"Unknown status",icon:u,iconClassName:"text-muted-foreground",labelColor:"text-muted-foreground"};function y(r){return g[r??"completed"]??v}const i=new Map;function s(r){let t=i.get(r);return t||(t={tick:0,subscribers:new Set,intervalId:null},i.set(r,t)),t}function x(r,t){const e=s(r);return e.subscribers.add(t),e.intervalId===null&&(e.intervalId=setInterval(()=>{e.tick+=1;for(const o of e.subscribers)o()},r)),()=>{e.subscribers.delete(t),e.subscribers.size===0&&e.intervalId!==null&&(clearInterval(e.intervalId),e.intervalId=null)}}function T(r){const t=d.c(3),e=r===void 0?6e4:r;let o,n;return t[0]!==e?(o=l=>x(e,l),n=()=>s(e).tick,t[0]=e,t[1]=o,t[2]=n):(o=t[1],n=t[2]),f.useSyncExternalStore(o,n,C)}function C(){return 0}export{g as S,y as g,T as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{C as Ie,a as en,z as un,M as mn,J as pn,j as e,B as J,t as U,c as hn,r as de,G as fn,D as xn,K as Ke,l as gn,i as we,p as S,n as jn,b as vn,m as yn}from"./index-CcnDuzQF.js";import{C as _n}from"./collection-search-D-f_rjVH.js";import{g as Cn,a as bn,b as Nn,e as wn}from"./extract-connection-data-NqYjy1W6.js";import{u as nn,a as tn,g as Sn,C as Me}from"./connection-card-B8wGpyDx.js";import{e as sn,d as on,D as an,a as rn,h as In,c as kn}from"./dialog-CSPNf1M2.js";import{D as An,a as Dn,c as Tn,b as Pn,d as Fn,e as Vn,f as Bn}from"./drawer-DRDSpHGN.js";import{u as On}from"./use-mobile-BBzH2hXY.js";import{F as O,b as M,c as L,d as E,f as z,a as We}from"./form-DZWEEJcU.js";import{I as Y}from"./input-C9C08vUS.js";import{S as Mn,a as Ln,b as En,c as zn,d as pe}from"./select-BlgNnINX.js";import{T as Rn}from"./textarea-CeAKw7uR.js";import{b as cn}from"./use-connection-W4m2UAAR.js";import{n as Se,i as Le}from"./Tool02-XJPr8Y_R.js";import{s as Ee}from"./Star01-Dy0cf-WL.js";import{af as $n}from"./agent-icon-CwIj7ip2.js";import{s as Hn}from"./XClose-BVJ-MEjc.js";import{c as Kn,i as be,a as Qe,E as Un,p as Xn,b as Gn,d as qn}from"./connection-form-helpers-Bpz9M-Z0.js";import{a as ze}from"./authenticate-and-persist-oauth-D-sBYsRy.js";import{g as Wn}from"./connection-slug-eyAPH6o3.js";import{C as Qn}from"./collection-tabs-JWPRYdFI.js";import{u as Ye}from"./use-infinite-scroll-xSLFTpsv.js";import{B as Ne}from"./badge-Cq-ZVkxw.js";import{b as Re,T as $e,a as He}from"./tooltip-2I_b-6X7.js";import{u as Yn}from"./useSuspenseInfiniteQuery-CYG1CE5G.js";import{u as Jn}from"./use-mcp-client-DNLhxapG.js";import{S as Zn}from"./constants-BHDe7bIw.js";import{i as Je}from"./Check-BH0H5-aR.js";import{s as et}from"./Plus-By3V7_aY.js";import{u as nt}from"./studio-tools-CenRUFIk.js";import{u as tt}from"./use-ai-providers-BfZ-rcXF.js";function Ue(s){const n=s?.metadata?.githubRepo;if(!n?.url)return{status:"none"};const u=n.connectionId;return!!u&&!!s?.connections?.some(N=>N.connection_id===u)?{status:"attached",repo:n,connectionId:u}:!!u||n.installationId!=null?{status:"detached",repo:n}:{status:"public-clone",repo:n}}function Ht(s){const n=Ue(s);return n.status==="attached"||n.status==="public-clone"?n.repo:null}function Kt(s){if(typeof s!="object"||s===null)return!1;const u=s.githubRepo?.url;return typeof u=="string"&&u.length>0}function Ut(s){return Ue(s).status==="attached"}function Xt(s){const n=Ue(s).status;return n==="attached"||n==="detached"}function Gt(s){const n=new Set;for(const u of s??[]){const v=u.metadata?.liveAgentId;typeof v=="string"&&v&&n.add(u.id)}return n}function qt(s,n){if(!s)return null;const u=s.metadata?.liveAgentId;if(typeof u=="string"&&u)return{mode:"dev",targetId:u};const v=(n??[]).find(h=>h.metadata?.liveAgentId===s.id);return v?{mode:"live",targetId:v.id}:null}function st({open:s,onOpenChange:n,onCreated:u}){const{org:v}=Ie(),{data:h}=en.useSession(),{stdioEnabled:N}=un(),k=On(),R=cn(),l=nn(),A=tn(l,"").items,o=mn({resolver:pn(Kn),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),f=o.watch("ui_type"),w=o.watch("connection_url"),F=o.watch("npx_package"),j=be({uiType:f,connectionUrl:w??"",npxPackage:F??""})??Qe({uiType:f,connectionUrl:w??"",registryItems:A}),c=t=>{const d=t.trim();if(!d)return;const x=!!o.formState.dirtyFields.title,i=!!o.formState.dirtyFields.description,r=!!o.formState.dirtyFields.env_vars,g=m=>{if(m&&(!x&&!o.getValues("title").trim()&&m.title&&o.setValue("title",m.title,{shouldDirty:!1}),!i&&!(o.getValues("description")??"").trim()&&m.description&&o.setValue("description",m.description,{shouldDirty:!1}),!r&&m.envVarKeys?.length)){const y=o.getValues("env_vars")??[],T=new Set(y.map(V=>V.key)),Z=m.envVarKeys.filter(V=>!T.has(V));Z.length>0&&o.setValue("env_vars",[...y,...Z.map(V=>({key:V,value:""}))],{shouldDirty:!0})}},G=Xn(d);if(G&&N){o.setValue("ui_type","NPX",{shouldDirty:!0}),o.setValue("npx_package",G.packageName,{shouldDirty:!0}),o.setValue("connection_url","",{shouldDirty:!0}),o.setValue("connection_token",null,{shouldDirty:!0}),g(be({uiType:"NPX",npxPackage:G.packageName}));return}if(d.startsWith("http://")||d.startsWith("https://")){const m=f==="HTTP"||f==="SSE"||f==="Websocket"?f:"HTTP";o.setValue("ui_type",m,{shouldDirty:!0}),o.setValue("connection_url",d,{shouldDirty:!0}),g(be({uiType:m,connectionUrl:d})??Qe({uiType:m,connectionUrl:d,registryItems:A}));return}f==="NPX"&&g(be({uiType:"NPX",npxPackage:d}))},$=t=>{t||o.reset(),n(t)},b=async t=>{let d,x=null,i=null,r=null;t.ui_type==="NPX"?(d="STDIO",x="",r=Gn(t.npx_package||"",t.env_vars||[])):t.ui_type==="STDIO"?(d="STDIO",x="",r=qn(t.stdio_command||"",t.stdio_args||"",t.stdio_cwd,t.env_vars||[])):(d=t.ui_type,x=t.connection_url||"",i=t.connection_token||null);const g=Cn("conn");try{await R.create.mutateAsync({id:g,title:t.title,description:t.description||null,connection_type:d,connection_url:x,connection_token:i,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:h?.user?.id||"system",organization_id:v.id,icon:t.icon??null,app_name:null,app_id:null,connection_headers:r,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),o.reset(),n(!1),u?.(g)}catch{U.error("Failed to create connection")}},D="Create Connection",H="Create a custom connection in your organization. Fill in the details below.",C=o.formState.isSubmitting?"Saving...":"Create Connection",X=e.jsxs("div",{className:"grid gap-4",children:[e.jsx(O,{control:o.control,name:"ui_type",render:({field:t})=>e.jsxs(M,{children:[e.jsx(L,{children:"Type *"}),e.jsxs(Mn,{value:t.value,onValueChange:t.onChange,children:[e.jsx(E,{children:e.jsx(Ln,{children:e.jsx(En,{})})}),e.jsxs(zn,{children:[e.jsx(pe,{value:"HTTP",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(Ee,{className:"w-4 h-4"}),"HTTP"]})}),e.jsx(pe,{value:"SSE",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(Ee,{className:"w-4 h-4"}),"SSE"]})}),e.jsx(pe,{value:"Websocket",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(Ee,{className:"w-4 h-4"}),"Websocket"]})}),N&&e.jsxs(e.Fragment,{children:[e.jsx(pe,{value:"NPX",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(Se,{className:"w-4 h-4"}),"NPX Package"]})}),e.jsx(pe,{value:"STDIO",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx($n,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),e.jsx(z,{})]})}),f==="NPX"&&e.jsx(O,{control:o.control,name:"npx_package",render:({field:t})=>e.jsxs(M,{children:[e.jsx(L,{children:"NPM Package *"}),e.jsx(E,{children:e.jsx(Y,{placeholder:"@perplexity-ai/mcp-server",...t,value:t.value??"",onPaste:d=>{const x=d.clipboardData.getData("text");x&&(d.preventDefault(),o.setValue("npx_package",x.trim(),{shouldDirty:!0}),c(x))},onBlur:d=>{c(d.target.value),t.onBlur()}})}),e.jsx(z,{})]})}),f==="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[e.jsx(O,{control:o.control,name:"stdio_command",render:({field:t})=>e.jsxs(M,{children:[e.jsx(L,{children:"Command *"}),e.jsx(E,{children:e.jsx(Y,{placeholder:"node, bun, python...",...t,value:t.value??""})}),e.jsx(z,{})]})}),e.jsx(O,{control:o.control,name:"stdio_args",render:({field:t})=>e.jsxs(M,{children:[e.jsx(L,{children:"Arguments"}),e.jsx(E,{children:e.jsx(Y,{placeholder:"arg1 arg2 --flag value",...t,value:t.value??""})}),e.jsx(z,{})]})})]}),e.jsx(O,{control:o.control,name:"stdio_cwd",render:({field:t})=>e.jsxs(M,{children:[e.jsx(L,{children:"Working Directory"}),e.jsx(E,{children:e.jsx(Y,{placeholder:"/path/to/project (optional)",...t,value:t.value??""})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),e.jsx(z,{})]})})]}),(f==="NPX"||f==="STDIO")&&e.jsx(O,{control:o.control,name:"env_vars",render:({field:t})=>e.jsxs(M,{children:[e.jsx(L,{children:"Environment Variables"}),e.jsx(E,{children:e.jsx(Un,{value:t.value??[],onChange:t.onChange})}),e.jsx(z,{})]})}),f!=="NPX"&&f!=="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsx(O,{control:o.control,name:"connection_url",render:({field:t})=>e.jsxs(M,{children:[e.jsx(L,{children:"URL *"}),e.jsx(E,{children:e.jsx(Y,{placeholder:"https://example.com/mcp",...t,value:t.value??"",onPaste:d=>{const x=d.clipboardData.getData("text");x&&(d.preventDefault(),o.setValue("connection_url",x.trim(),{shouldDirty:!0}),c(x))},onBlur:d=>{c(d.target.value),t.onBlur()}})}),e.jsx(z,{})]})}),e.jsx(O,{control:o.control,name:"connection_token",render:({field:t})=>e.jsxs(M,{children:[e.jsx(L,{children:j?.token?.label??"Token (optional)"}),e.jsx(E,{children:e.jsx(Y,{type:"password",placeholder:j?.token?.placeholder??"Bearer token or API key",className:"ph-no-capture",...t,value:t.value??""})}),j?.token?.helperText&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:[j.token.helperText,j.id==="github"&&e.jsxs(e.Fragment,{children:[" ","·"," ",e.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:"Open GitHub PAT settings"})]})]}),e.jsx(z,{})]})})]}),e.jsx(O,{control:o.control,name:"title",render:({field:t})=>e.jsxs(M,{children:[e.jsx(L,{children:"Name *"}),e.jsx(E,{children:e.jsx(Y,{placeholder:"My Connection",...t})}),e.jsx(z,{})]})}),e.jsx(O,{control:o.control,name:"description",render:({field:t})=>e.jsxs(M,{children:[e.jsx(L,{children:"Description"}),e.jsx(E,{children:e.jsx(Rn,{placeholder:"A brief description of this connection",rows:3,...t,value:t.value??""})}),e.jsx(z,{})]})})]});return k?e.jsx(An,{open:s,onOpenChange:$,children:e.jsxs(Dn,{className:"max-h-[90vh]",children:[e.jsx(Tn,{className:"pb-2",children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex-1 text-left",children:[e.jsx(Pn,{children:D}),e.jsx(Fn,{className:"mt-1",children:H})]}),e.jsx(Vn,{asChild:!0,children:e.jsx(J,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:e.jsx(Hn,{size:16})})})]})}),e.jsx(We,{...o,children:e.jsxs("form",{onSubmit:o.handleSubmit(b),children:[e.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:X}),e.jsx(Bn,{children:e.jsx(J,{type:"submit",disabled:o.formState.isSubmitting,className:"w-full",children:C})})]})})]})}):e.jsx(sn,{open:s,onOpenChange:$,children:e.jsxs(on,{className:"sm:max-w-[525px]",children:[e.jsxs(an,{children:[e.jsx(rn,{children:D}),e.jsx(In,{children:H})]}),e.jsx(We,{...o,children:e.jsxs("form",{onSubmit:o.handleSubmit(b),children:[e.jsx("div",{className:"py-4",children:X}),e.jsxs(kn,{children:[e.jsx(J,{type:"button",variant:"outline",onClick:()=>$(!1),children:"Cancel"}),e.jsx(J,{type:"submit",disabled:o.formState.isSubmitting,className:"min-w-40",children:C})]})]})})]})})}function ot(s){const n=hn.c(68),{mode:u,agentId:v,addedConnectionIds:h,onAdd:N,onCloneAndAdd:k,onConnectAndAdd:R,connectingItemId:l,search:_,onCreateConnection:A,onBrowseNavigate:o,defaultTab:f}=s,w=u===void 0?"add":u,F=f===void 0?"connected":f,{org:j}=Ie(),c=de.useDeferredValue(_),$=_!==c;let b;n[0]!==c?(b=c.trim().toLowerCase(),n[0]=c,n[1]=b):b=n[1];const D=b;let H;n[2]!==F?(H=a=>a??F,n[2]=F,n[3]=H):H=n[3];const[C,X]=fn(xn.connectionsTab(j.slug)+(F==="all"?":home-modal":":agent-modal"),H);let t;n[4]!==C||n[5]!==X?(t=a=>{a!==C&&S("connections_dialog_tab_changed",{to_tab:a}),X(a)},n[4]=C,n[5]=X,n[6]=t):t=n[6];const d=t;let x;n[7]!==j.id||n[8]!==j.slug?(x={connectionId:Zn,orgId:j.id,orgSlug:j.slug},n[7]=j.id,n[8]=j.slug,n[9]=x):x=n[9];const i=Jn(x),r=c?.trim().split(/\s+/).filter(Boolean)??[],g=r.length>0?{operator:"or",conditions:r.flatMap(mt)}:void 0,G={...g&&{where:g},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:0},m=JSON.stringify(G),{data:y,fetchNextPage:T,hasNextPage:Z,isFetchingNextPage:V}=Yn({queryKey:Ke.collectionListInfinite(i,j.id,"","CONNECTIONS",m),queryFn:async a=>{const{pageParam:p}=a,K=p===void 0?0:p;return(await i.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...g&&{where:g},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:K}})).structuredContent},initialPageParam:0,getNextPageParam:dt,staleTime:3e4}),Xe=y?.pages.flatMap(lt)??[],he=Sn(Xe),ln=new Set(Xe.filter(ct).map(rt)),fe=nn(),q=tn(fe,c),ke=Ye(q.loadMore,q.hasMore,q.isLoadingMore),Ae=Ye(T,Z??!1,V),P=C==="all"||!!D,Ge=P?q.items.filter(a=>{const p=bn(a);if(p&&ln.has(p))return!1;if(!D)return!0;const K=a._meta?.["mcp.mesh"],W=[a.title,a.description,a.name,a.server?.title,a.server?.description,a.server?.name,K?.friendly_name,K?.friendlyName].filter(Boolean).join(" ").toLowerCase();return r.some(B=>W.includes(B.toLowerCase()))}):[],ue=Ge.filter(it),me=Ge.filter(at);let xe;n[10]!==h?(xe=a=>a.some(p=>h.has(p.id)),n[10]=h,n[11]=xe):xe=n[11];const De=xe;let ge;n[12]!==h||n[13]!==v||n[14]!==l||n[15]!==De||n[16]!==w||n[17]!==N||n[18]!==o||n[19]!==k?(ge=(a,p,K,W,B)=>{const Ce=De(B),le=B.find(Q=>!h.has(Q.id)),I=B[0];if(w==="browse"){const Q=Wn(I);return e.jsx(Me,{connection:{title:p,icon:K,description:B.length>1?`${B.length} instances`:W??void 0},fallbackIcon:e.jsx(Se,{}),headerActionsAlwaysVisible:!0,headerActions:e.jsxs(Ne,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[e.jsx(Je,{size:11})," Connected"]}),onClick:()=>{S("connection_browse_clicked",{app_name:I.app_name??null,connection_id:I.id,instances_count:B.length}),o?.(Q)}},a)}return e.jsx(Me,{connection:{title:p,icon:K,description:W},fallbackIcon:e.jsx(Se,{}),headerActionsAlwaysVisible:!0,headerActions:e.jsxs("div",{className:"flex items-center gap-1.5",children:[Ce&&e.jsxs(Ne,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[e.jsx(Je,{size:11})," Added"]}),e.jsx(J,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:l!==null,onClick:Q=>{Q.stopPropagation(),le?(S("connection_add_clicked",{action:"use_existing",app_name:I.app_name??null,connection_id:le.id}),v&&S("agent_connection_attached",{agent_id:v,connection_id:le.id,app_name:I.app_name??null,mode:"existing"}),N(le.id)):(S("connection_add_clicked",{action:"clone",app_name:I.app_name??null,base_connection_id:I.id}),k(I))},children:"Add"})]})},a)},n[12]=h,n[13]=v,n[14]=l,n[15]=De,n[16]=w,n[17]=N,n[18]=o,n[19]=k,n[20]=ge):ge=n[20];const je=ge;let ve;n[21]!==l||n[22]!==w||n[23]!==R?(ve=a=>{const p=a._meta?.["mcp.mesh"],K=p?.friendlyName||p?.friendly_name||a.server?.title||a.title||a.server?.name||a.name||a.id||"",W=a.server?.description||a.description||null,B=a.server?.icons?.[0]?.src||Nn(a.server?.repository)||null,Ce=p?.official===!0,le=p?.verified===!0,I=p?.owner==="deco";return e.jsx(Me,{connection:{title:K,description:W,icon:B},fallbackIcon:e.jsx(Se,{}),headerActionsAlwaysVisible:!0,headerActions:e.jsxs("div",{className:"flex items-center gap-1.5",children:[I&&e.jsxs(Re,{children:[e.jsx($e,{asChild:!0,children:e.jsx("span",{className:"inline-flex items-center justify-center size-5 rounded-md bg-muted shrink-0",children:e.jsx("img",{src:"/logos/deco logo.svg",alt:"Made by Deco",className:"size-3"})})}),e.jsx(He,{children:"Built and maintained by Deco"})]}),!I&&Ce&&e.jsxs(Re,{children:[e.jsx($e,{asChild:!0,children:e.jsx(Ne,{variant:"outline",size:"icon",children:e.jsx(Le,{})})}),e.jsx(He,{children:"Built and maintained by the official vendor"})]}),!I&&!Ce&&le&&e.jsxs(Re,{children:[e.jsx($e,{asChild:!0,children:e.jsx(Ne,{variant:"outline",size:"icon",children:e.jsx(Le,{})})}),e.jsx(He,{children:"Verified by the Deco team"})]}),e.jsx(J,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:l!==null,onClick:Q=>{Q.stopPropagation(),S("connection_add_clicked",{action:"connect_new",registry_item_id:a.id,app_name:p?.friendlyName||a.server?.name||a.name||null}),R(a)},children:l===a.id?e.jsx(we,{size:14,className:"animate-spin"}):w==="browse"?"Connect":"Add"})]})},`catalog-${a.id}`)},n[21]=l,n[22]=w,n[23]=R,n[24]=ve):ve=n[24];const qe=ve;let ee;n[25]!==C||n[26]!==d||n[27]!==A||n[28]!==D?(ee=!D&&e.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border shrink-0",children:[e.jsx(Qn,{tabs:[{id:"all",label:"All"},{id:"connected",label:"Connected"}],activeTab:C,onTabChange:a=>d(a)}),e.jsxs(J,{variant:"outline",size:"sm",className:"h-7 px-2 text-sm",onClick:()=>{S("connections_dialog_custom_clicked"),A()},children:[e.jsx(et,{size:12}),"Custom Connection"]})]}),n[25]=C,n[26]=d,n[27]=A,n[28]=D,n[29]=ee):ee=n[29];const Te=$&&"opacity-50 pointer-events-none";let ne;n[30]!==Te?(ne=gn("flex-1 overflow-auto p-5 transition-opacity duration-150",Te),n[30]=Te,n[31]=ne):ne=n[31];const dn="grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] gap-4";let ye;n[32]!==je?(ye=a=>{if(a.type==="group")return je(a.key,a.title,a.icon,null,a.connections);const p=a.connection;return je(p.id,p.title,p.icon,p.description??null,[p])},n[32]=je,n[33]=ye):ye=n[33];const Pe=he.map(ye);let te;n[34]!==Ae?(te=e.jsx("div",{ref:Ae,className:"col-span-full h-1"}),n[34]=Ae,n[35]=te):te=n[35];let se;n[36]!==V?(se=V&&e.jsx("div",{className:"col-span-full flex justify-center py-6",children:e.jsx(we,{size:24,className:"animate-spin text-muted-foreground"})}),n[36]=V,n[37]=se):se=n[37];const Fe=P&&ue.length>0&&e.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[e.jsx(Le,{size:13,className:"text-muted-foreground shrink-0"}),e.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:"Verified"}),e.jsx("div",{className:"flex-1 h-px bg-border"})]}),Ve=P&&ue.map(qe),Be=P&&me.length>0&&e.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[e.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:"All connections"}),e.jsx("div",{className:"flex-1 h-px bg-border"})]}),Oe=P&&me.map(qe);let oe;n[38]!==ke||n[39]!==fe||n[40]!==P?(oe=P&&fe.length>0&&e.jsx("div",{ref:ke,className:"col-span-full h-1"}),n[38]=ke,n[39]=fe,n[40]=P,n[41]=oe):oe=n[41];let ae;n[42]!==q.isLoadingMore||n[43]!==P?(ae=P&&q.isLoadingMore&&e.jsx("div",{className:"col-span-full flex justify-center py-6",children:e.jsx(we,{size:24,className:"animate-spin text-muted-foreground"})}),n[42]=q.isLoadingMore,n[43]=P,n[44]=ae):ae=n[44];let ie;n[45]!==Pe||n[46]!==te||n[47]!==se||n[48]!==Fe||n[49]!==Ve||n[50]!==Be||n[51]!==Oe||n[52]!==oe||n[53]!==ae?(ie=e.jsxs("div",{className:dn,children:[Pe,te,se,Fe,Ve,Be,Oe,oe,ae]}),n[45]=Pe,n[46]=te,n[47]=se,n[48]=Fe,n[49]=Ve,n[50]=Be,n[51]=Oe,n[52]=oe,n[53]=ae,n[54]=ie):ie=n[54];let re;n[55]!==C||n[56]!==he.length||n[57]!==me||n[58]!==_||n[59]!==ue?(re=he.length===0&&ue.length===0&&me.length===0&&e.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:_?`No connections match "${_}"`:C==="connected"?"No connections yet":"No connections available"}),n[55]=C,n[56]=he.length,n[57]=me,n[58]=_,n[59]=ue,n[60]=re):re=n[60];let ce;n[61]!==ne||n[62]!==ie||n[63]!==re?(ce=e.jsxs("div",{className:ne,children:[ie,re]}),n[61]=ne,n[62]=ie,n[63]=re,n[64]=ce):ce=n[64];let _e;return n[65]!==ee||n[66]!==ce?(_e=e.jsxs(e.Fragment,{children:[ee,ce]}),n[65]=ee,n[66]=ce,n[67]=_e):_e=n[67],_e}function at(s){return!s.verified&&!s._meta?.["mcp.mesh"]?.verified&&!s.meta?.verified}function it(s){return s.verified||s._meta?.["mcp.mesh"]?.verified||s.meta?.verified}function rt(s){return s.app_name}function ct(s){return s.app_name}function lt(s){return s?.items??[]}function dt(s,n){if(s?.hasMore)return n.reduce(ut,0)}function ut(s,n){return s+(n?.items?.length??0)}function mt(s){return[{field:["title"],operator:"contains",value:s},{field:["description"],operator:"contains",value:s}]}function Wt({open:s,onOpenChange:n,defaultTab:u,initialSearch:v="",...h}){const N=h.mode??"add",k="agentId"in h?h.agentId:void 0,R="addedConnectionIds"in h?h.addedConnectionIds??new Set:new Set,l="onAdd"in h&&h.onAdd?h.onAdd:i=>{},_=(i,r,g)=>{k&&S("agent_connection_attached",{agent_id:k,connection_id:i,app_name:r,mode:g})},[A,o]=de.useState(null),[f,w]=de.useState(v),[F,j]=de.useState(!1),{org:c}=Ie(),{data:$}=en.useSession(),b=cn(),D=jn(),H=vn(),C=i=>{n(!1),H({to:"/$org/settings/connections/$appSlug",params:{org:c.slug,appSlug:i}})},X=()=>{D.invalidateQueries({predicate:i=>{const r=i.queryKey;return r[1]===c.id&&r[3]==="collection"&&r[4]==="CONNECTIONS"}})},t=async(i,r)=>{S("connection_oauth_succeeded",{connection_id:i,flow:r});const g=new URL(`/api/${c.slug}/mcp/${i}`,window.location.origin);await D.invalidateQueries({queryKey:Ke.isMCPAuthenticated(g.href,null)}),X()},d=async i=>{o(i.app_name??i.id);try{const g=`${i.title.replace(/\s*\(\d+\)\s*$/,"")} (${Date.now().toString(36).slice(-4)})`,m=(await b.create.mutateAsync({title:g,description:i.description??null,connection_type:i.connection_type,connection_url:i.connection_url??null,connection_token:null,icon:i.icon??null,app_name:i.app_name??null,app_id:i.app_id??null,connection_headers:i.connection_headers??null})).id,y=await ze({connectionId:m,orgId:c.id,orgSlug:c.slug,persistFallback:T=>b.update.mutateAsync({id:m,data:{connection_token:T}}).then(()=>{})});if(y.ran&&!y.ok){S("connection_oauth_failed",{connection_id:m,flow:"clone",error:y.error??"no_token"}),U.error(`Authentication failed: ${y.error??"no token received"}`),await b.delete.mutateAsync(m);return}y.ran&&await t(m,"clone"),_(m,i.app_name??null,"clone"),l(m)}catch(r){console.error("Failed to add connection:",r),U.error("Failed to add connection")}finally{o(null)}},x=async i=>{if(!(!c||!$?.user?.id)){o(i.id);try{const r=wn(i,c.id,$.user.id,{remoteIndex:0}),g=r.connection_type==="STDIO",G=!!r.connection_url,m=g&&r.connection_headers&&typeof r.connection_headers=="object"&&"command"in r.connection_headers;if(!G&&!m){U.error("This MCP Server cannot be connected: no connection method available"),o(null);return}const{id:y}=await b.create.mutateAsync(r),T=await ze({connectionId:y,orgId:c.id,orgSlug:c.slug,persistFallback:Z=>b.update.mutateAsync({id:y,data:{connection_token:Z}}).then(()=>{})});if(T.ran&&!T.ok){S("connection_oauth_failed",{connection_id:y,flow:"connect_new",error:T.error??"no_token"}),U.warning("Couldn't sign in to this connection",{description:`It was added to your agent, but its sign-in setup looks off. You can try authenticating again later from the connection's settings. (${T.error??"no token received"})`}),_(y,r.app_name??null,"new"),l(y);return}T.ran?(await t(y,"connect_new"),U.success("Connected and authenticated")):U.success("Connected"),_(y,r.app_name??null,"new"),l(y)}catch(r){console.error("Failed to connect:",r),U.error("Failed to connect")}finally{o(null)}}};return e.jsxs(sn,{open:s,onOpenChange:n,children:[e.jsxs(on,{className:"sm:max-w-5xl h-[85vh] max-h-[85vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[e.jsx(an,{className:"px-6 pt-5 pb-0 shrink-0",children:e.jsx(rn,{className:"text-base font-semibold",children:N==="browse"?"Connections":"Add Connection"})}),e.jsx("div",{className:"pt-3 shrink-0",children:e.jsx(_n,{value:f,onChange:w,placeholder:"Search connections..."})}),e.jsx(de.Suspense,{fallback:e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsx(we,{size:24,className:"animate-spin text-muted-foreground"})}),children:e.jsx(ot,{mode:N,agentId:k,addedConnectionIds:R,onAdd:l,onCloneAndAdd:d,onConnectAndAdd:x,connectingItemId:A,search:f,onCreateConnection:()=>j(!0),onBrowseNavigate:C,defaultTab:u})})]}),e.jsx(st,{open:F,onOpenChange:j,onCreated:async i=>{j(!1);const r=await ze({connectionId:i,orgId:c.id,orgSlug:c.slug,persistFallback:g=>b.update.mutateAsync({id:i,data:{connection_token:g}}).then(()=>{})});if(r.ran&&!r.ok){S("connection_oauth_failed",{connection_id:i,flow:"custom_create",error:r.error??"no_token"}),U.warning("Couldn't sign in to this connection",{description:`It was added to your agent, but its sign-in setup looks off. You can try authenticating again later from the connection's settings. (${r.error??"no token received"})`}),_(i,null,"custom"),l(i),n(!1);return}r.ran&&await t(i,"custom_create"),_(i,null,"custom"),l(i),n(!1)}})]})}const Ze=new Map;function Qt(){const{org:s}=Ie(),n=nt(),u=tt(),v=u.find(c=>c.providerId==="deco"),{data:h,isLoading:N,refetch:k,isFetching:R}=yn({queryKey:Ke.aiProviderCredits(s.id,"deco"),enabled:!!v,staleTime:6e4,queryFn:async()=>{try{return await n.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}}}),l=h?.balanceCents??null,_=l!=null?l/100:null,A=de.useRef(new Map);if(l!=null){const c=Ze.get(s.id);A.current.get(s.id)&&c!=null&&l>c&&S("credits_topped_up_detected",{organization_id:s.id,delta_cents:l-c,previous_balance_cents:c,new_balance_cents:l}),Ze.set(s.id,l),A.current.set(s.id,!0)}const o=!!v,f=l!=null&&l>0,w=l!=null&&l===0,F=l!=null&&l===200,j=u.length>0&&u.every(c=>c.providerId==="deco");return{hasDecoKey:o,decoKeyId:v?.id??null,balanceCents:l,balanceDollars:_,hasCredits:f,isZeroBalance:w,isInitialFreeCredit:F,hasOnlyDecoProvider:j,isLoading:N,isFetching:R,refetch:k}}export{Wt as A,Kt as a,Ht as b,Ut as c,Xt as d,qt as f,Gt as g,Ue as r,Qt as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{I as u}from"./use-infinite-scroll-xSLFTpsv.js";import{dK as i}from"./index-CcnDuzQF.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-xSLFTpsv.js";import{dK as u,ab as n}from"./index-CcnDuzQF.js";function a(r,e){return u({...r,enabled:!0,suspense:!0,throwOnError:n},s,e)}export{a as u};
|