decocms 4.198.2 → 4.199.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-BWppLd8c.js → AlertCircle-1FZS3v-O.js} +1 -1
- package/dist/client/assets/{AreaChart-CMqdqW-X.js → AreaChart-6BJhVF5T.js} +1 -1
- package/dist/client/assets/{ArrowLeft-cFWJcCye.js → ArrowLeft-CR4vxoJp.js} +1 -1
- package/dist/client/assets/{ArrowUp-CK7po7JD.js → ArrowUp-CC_mbqe1.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-7JgIYGFf.js → ArrowUpRight-CbCF70v1.js} +1 -1
- package/dist/client/assets/{Check-Dc66au0h.js → Check-COUqEm5U.js} +1 -1
- package/dist/client/assets/{CheckCircle-UOyFv4rE.js → CheckCircle-OafhoQfB.js} +1 -1
- package/dist/client/assets/{ChevronDown-LNz16DWG.js → ChevronDown-BQOZpawT.js} +1 -1
- package/dist/client/assets/{ChevronRight-DjBVHQoY.js → ChevronRight-cIZXph7r.js} +1 -1
- package/dist/client/assets/{ChevronUp-DZ-mKv_H.js → ChevronUp-1zullNEp.js} +1 -1
- package/dist/client/assets/{Copy01-DPPY_ooc.js → Copy01-DOQujw91.js} +1 -1
- package/dist/client/assets/{CpuChip01-DyWba75a.js → CpuChip01-DP6ksU24.js} +1 -1
- package/dist/client/assets/{CreditCard01-e79FUmFN.js → CreditCard01-CufFLIFI.js} +1 -1
- package/dist/client/assets/{DotsVertical-CILzGe_q.js → DotsVertical-wivS0onw.js} +1 -1
- package/dist/client/assets/{Eye-BT74JrOy.js → Eye-DrB86SUu.js} +1 -1
- package/dist/client/assets/{FilterLines-DcRWfBwT.js → FilterLines-D-22jIZj.js} +1 -1
- package/dist/client/assets/{Globe01-W4lyjKuH.js → Globe01-4yOmtvQc.js} +1 -1
- package/dist/client/assets/{Globe04-_uS8YiyQ.js → Globe04-m8WcbUjt.js} +1 -1
- package/dist/client/assets/{HardDrive-D7RLSuvq.js → HardDrive-DZ-Roc4G.js} +1 -1
- package/dist/client/assets/{Key01-Bk2QhvNY.js → Key01-Dkj1imoI.js} +1 -1
- package/dist/client/assets/{LayoutLeft-P7wDvRlA.js → LayoutLeft-qMb6nkLN.js} +1 -1
- package/dist/client/assets/{LinkExternal01-CP1N0ekO.js → LinkExternal01-B8ehDauF.js} +1 -1
- package/dist/client/assets/{LogOut01-BNm98lqM.js → LogOut01-oc8d9SJs.js} +1 -1
- package/dist/client/assets/{Monitor01-D9pvMYQd.js → Monitor01-BOSd8wQ1.js} +1 -1
- package/dist/client/assets/{Palette-DJfFKmjP.js → Palette-CSOJeVFB.js} +1 -1
- package/dist/client/assets/{Play-DrC9uZbx.js → Play-H-b9CdPO.js} +1 -1
- package/dist/client/assets/{Plus-9KDBMlCX.js → Plus-DJU_4kbx.js} +1 -1
- package/dist/client/assets/{SearchLg-BSg_Ve-L.js → SearchLg-BQmUG7S4.js} +1 -1
- package/dist/client/assets/{SearchMd-CDwUuDyr.js → SearchMd-SbBW-oPu.js} +1 -1
- package/dist/client/assets/{Settings02-D_by58BO.js → Settings02-CtYuLrf4.js} +1 -1
- package/dist/client/assets/{Share07-DFtUk4DH.js → Share07-CT2dyret.js} +1 -1
- package/dist/client/assets/{Shield01-2VpHyEx6.js → Shield01-W_oC4KLS.js} +1 -1
- package/dist/client/assets/{Star01-YV_bqOAU.js → Star01-COyWVOwH.js} +1 -1
- package/dist/client/assets/{Stars01-CyMHMvzU.js → Stars01-B9M6VkZj.js} +1 -1
- package/dist/client/assets/{Stars02-D6uxt7rn.js → Stars02-l4Bi009V.js} +1 -1
- package/dist/client/assets/{Sun-CvD6V1mt.js → Sun-BgLBLrAR.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-BJcUWOrf.js → SwitchHorizontal01-D3zKTM_Y.js} +1 -1
- package/dist/client/assets/{Tool01-BsXkza2k.js → Tool01-C-9oM8hx.js} +1 -1
- package/dist/client/assets/{Tool02-Bk0Wi_jc.js → Tool02-CWP-2wPJ.js} +1 -1
- package/dist/client/assets/{Trash01-Dk2U_er_.js → Trash01-DUPlExuW.js} +1 -1
- package/dist/client/assets/{TrendUp01-BQPOQTfU.js → TrendUp01-9IbbL3_o.js} +1 -1
- package/dist/client/assets/{Upload01-De1aQPW9.js → Upload01-CykCKPTH.js} +1 -1
- package/dist/client/assets/{User01-DZLXXgFt.js → User01-DdCsns_p.js} +1 -1
- package/dist/client/assets/{Users01-D-f87RLp.js → Users01-DddX3P2e.js} +1 -1
- package/dist/client/assets/{Users03-CmtC3U6j.js → Users03-Bx6UOYkE.js} +1 -1
- package/dist/client/assets/{X-DmV-M3--.js → X-B3ybq5w2.js} +1 -1
- package/dist/client/assets/{XCircle-Cj1jhbDm.js → XCircle-C4ggJi18.js} +1 -1
- package/dist/client/assets/{XClose-8V-NoWeD.js → XClose-DAaNDUux.js} +1 -1
- package/dist/client/assets/{Zap-BxOODR1h.js → Zap-Bo7ywofH.js} +1 -1
- package/dist/client/assets/{ZapSquare-BesqE3Kv.js → ZapSquare-Bg5_XykS.js} +1 -1
- package/dist/client/assets/{access-gate-CcFlUK4A.js → access-gate-CM__cLeC.js} +1 -1
- package/dist/client/assets/{agent-icon-DrJqDdNd.js → agent-icon-ChlSj_zC.js} +1 -1
- package/dist/client/assets/{agents-list-B1lrsW_H.js → agents-list-FKXfmE0I.js} +1 -1
- package/dist/client/assets/{ai-providers-Kv5WIAV1.js → ai-providers-BFIskFbw.js} +1 -1
- package/dist/client/assets/{alert-C4a51Bkg.js → alert-CYsDgWPP.js} +1 -1
- package/dist/client/assets/{alert-dialog-Bpd-0p4I.js → alert-dialog-CEWyrZ_Z.js} +1 -1
- package/dist/client/assets/{app-editor-wt5YFcqv.js → app-editor-BhYIbVrX.js} +1 -1
- package/dist/client/assets/{auth-catchall-B_zCiAnJ.js → auth-catchall-cwMYBp3y.js} +1 -1
- package/dist/client/assets/{auth-entry-BcKY1S7E.js → auth-entry-utz1nSNV.js} +1 -1
- package/dist/client/assets/{auth-split-layout-D_earcwe.js → auth-split-layout-CSD4ZOjw.js} +1 -1
- package/dist/client/assets/{auth-B56MWIKT.js → auth-v89NYv9q.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-DgNMLRjT.js → authenticate-and-persist-oauth-Bx2wnD4m.js} +1 -1
- package/dist/client/assets/{automation-list-row-CF0CYhrz.js → automation-list-row-CtwPJ_qi.js} +1 -1
- package/dist/client/assets/{automation-runs-DkpIo76-.js → automation-runs-jWstZftP.js} +2 -2
- package/dist/client/assets/{automations-DFe_tV_r.js → automations-DYLWv316.js} +1 -1
- package/dist/client/assets/{avatar-BN3TMI7O.js → avatar-BpypxYS_.js} +1 -1
- package/dist/client/assets/{badge-CXZR0JJ6.js → badge-D7AIZASF.js} +1 -1
- package/dist/client/assets/{billing-CYgiUsj0.js → billing-DvQB5EP4.js} +1 -1
- package/dist/client/assets/{block-document-DTEuQoSM.js → block-document-BieiLkD8.js} +1 -1
- package/dist/client/assets/{brand-context-1EzU2len.js → brand-context-CyT0dJvx.js} +1 -1
- package/dist/client/assets/{buckets-BFKqGOhH.js → buckets-CEQI-s6s.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-CsOSjWnO.js → bulk-category-panel-DGtK7V8c.js} +1 -1
- package/dist/client/assets/{capability-load-error-CKW0147S.js → capability-load-error-BL2lrddy.js} +1 -1
- package/dist/client/assets/{card-B-Mzv0lS.js → card-CoBKo1D2.js} +1 -1
- package/dist/client/assets/{cards-BfTjTHpY.js → cards-OWxF4nj0.js} +1 -1
- package/dist/client/assets/{category-editor-BbGetzYN.js → category-editor-Dn0rz6Sk.js} +1 -1
- package/dist/client/assets/{chat-context-B91LcyJ6.js → chat-context-C5IpUGyL.js} +1 -1
- package/dist/client/assets/{checkbox-DU-r9RK1.js → checkbox-B_axFhC0.js} +1 -1
- package/dist/client/assets/{cli-auth-success-Cm6QoDUK.js → cli-auth-success-D_b0jLm-.js} +1 -1
- package/dist/client/assets/{collection-detail-tAe3Dmgp.js → collection-detail-BaUxPBtg.js} +1 -1
- package/dist/client/assets/{collection-display-button-BLCZ2vkr.js → collection-display-button-TeFEpehu.js} +1 -1
- package/dist/client/assets/{collection-search-yhxjYY4J.js → collection-search-jgJieFUU.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-B10YZ9u0.js → collection-table-wrapper-VyWx7MWu.js} +1 -1
- package/dist/client/assets/{collection-tabs-SNVmmaXX.js → collection-tabs-D8Hgew32.js} +1 -1
- package/dist/client/assets/{command-Cz9Vx3RB.js → command-mz5vaCyb.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-CcIJiyl8.js → commerce-onboarding-oCzW05oi.js} +1 -1
- package/dist/client/assets/{connect-BfBt9RNI.js → connect-B55TAI-T.js} +1 -1
- package/dist/client/assets/{connection-BUKTSmLs.js → connection-DKRnbF5j.js} +1 -1
- package/dist/client/assets/{connection-card-m4tgOItf.js → connection-card-BBnyhURe.js} +1 -1
- package/dist/client/assets/{connection-detail-BkPBxKFf.js → connection-detail-jFa2SZOI.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-BkrR5b_e.js → connection-form-helpers-DmMFoW_E.js} +1 -1
- package/dist/client/assets/{connections-Elpblskc.js → connections-B2phlZuI.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-DjQPpjDZ.js → decopilot-sse-pool-D6eFDIhm.js} +1 -1
- package/dist/client/assets/{dialog-Cg0277WK.js → dialog-CFILfZOA.js} +1 -1
- package/dist/client/assets/{domain-settings-BraWpz77.js → domain-settings-Dz8mlaOV.js} +1 -1
- package/dist/client/assets/{drawer-Dfn3cqSh.js → drawer-CUdV6oxw.js} +1 -1
- package/dist/client/assets/{dropdown-menu-DPde1UkW.js → dropdown-menu-CvmqCZWH.js} +1 -1
- package/dist/client/assets/{empty-state-BvR4kC3B.js → empty-state-B-59kVV9.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BudtEuf9.js → extract-connection-data-DXrSXKT4.js} +1 -1
- package/dist/client/assets/{file-explorer-CEqyHkOE.js → file-explorer-DKr1xc8P.js} +1 -1
- package/dist/client/assets/{file-type-icon-DjpfQdvY.js → file-type-icon-ClrRx9NG.js} +1 -1
- package/dist/client/assets/{form-PWBx8QQq.js → form-BjBdY0X7.js} +1 -1
- package/dist/client/assets/{general-aWH4SlEd.js → general-ATn8tjRI.js} +1 -1
- package/dist/client/assets/{github-repo-picker-x1X872QG.js → github-repo-picker-D-sEtEsJ.js} +1 -1
- package/dist/client/assets/{hooks-DE78iZyB.js → hooks-CdOH0sr_.js} +1 -1
- package/dist/client/assets/{index-BZrHlw0j.js → index--OjyTwFQ.js} +1 -1
- package/dist/client/assets/{index-C-bJCsC6.css → index-BEdBSIIA.css} +1 -1
- package/dist/client/assets/{index-GlvqvXVJ.js → index-BHRSTVbm.js} +1 -1
- package/dist/client/assets/index-BPPqwJmq.js +5 -0
- package/dist/client/assets/{index-X6wqL5Rn.js → index-BzRGcU66.js} +1 -1
- package/dist/client/assets/{index-BfpQCjmG.js → index-CFJJgkw9.js} +1 -1
- package/dist/client/assets/{index-SRgwcnf7.js → index-COzRe4rY.js} +1 -1
- package/dist/client/assets/{index-Dh6yRBua.js → index-D1wTzn4-.js} +1 -1
- package/dist/client/assets/{index-BfE9EYhg.js → index-DoiZIymS.js} +5 -5
- package/dist/client/assets/{index-BQFOspRh.js → index-HpF4ydE2.js} +6 -6
- package/dist/client/assets/{index-YHwob8Sm.js → index-kMw37nKO.js} +1 -1
- package/dist/client/assets/{index-redirect-BdzOsvXL.js → index-redirect-B8Hgwnpy.js} +1 -1
- package/dist/client/assets/{input-DLmq-Bri.js → input-Dw4GelAn.js} +1 -1
- package/dist/client/assets/{integration-icon-FPSluFwK.js → integration-icon-Cyu5omdT.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-BjF0_uLE.js → invite-member-dialog-B7Q8c3nD.js} +1 -1
- package/dist/client/assets/{label-B1DonsU-.js → label-CJtuYe4Q.js} +1 -1
- package/dist/client/assets/{layout-BV0PSd_m.js → layout-LadKSCFh.js} +1 -1
- package/dist/client/assets/{login-BnLip_s5.js → login-k6W7OWLC.js} +1 -1
- package/dist/client/assets/{mcp-oauth-0Wpz4XYZ.js → mcp-oauth-JmfL6YDg.js} +1 -1
- package/dist/client/assets/{members-CdtAdhlo.js → members-Cax5phLv.js} +1 -1
- package/dist/client/assets/{monaco-editor-CrpwfOtU.js → monaco-editor-DsEoV7tZ.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-Bf4ASMnO.js → monitoring-stats-row-hSnWEB1g.js} +1 -1
- package/dist/client/assets/{multi-select-DegmZzJM.js → multi-select-C_9JXCXf.js} +1 -1
- package/dist/client/assets/{oauth-callback-iu-wcPts.js → oauth-callback-CbwDrfNN.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-hu1Pvh_J.js → oauth-callback-ai-provider-bqe7WxPA.js} +1 -1
- package/dist/client/assets/{onboarding-DLQPdZwW.js → onboarding-BMg-CQb8.js} +1 -1
- package/dist/client/assets/{org-layout-DTN_XooU.js → org-layout-BPZhd6ha.js} +1 -1
- package/dist/client/assets/{organization-choice-D1zMzhki.js → organization-choice-DQcCIgDf.js} +1 -1
- package/dist/client/assets/{orgs-7aGZzQVk.js → orgs-C5W9WsQP.js} +1 -1
- package/dist/client/assets/{page-seo-form-M3-RVvpj.js → page-seo-form-C7E_eneh.js} +1 -1
- package/dist/client/assets/{popover-BYTopHKb.js → popover-DCriArZo.js} +1 -1
- package/dist/client/assets/{post-editor-z0QRZmIL.js → post-editor-CmqSuVDD.js} +1 -1
- package/dist/client/assets/{primitives-S2CqucHt.js → primitives-Dt6-h_k5.js} +1 -1
- package/dist/client/assets/{profile-Hutoer3r.js → profile-Dqn8oDYU.js} +1 -1
- package/dist/client/assets/{project-app-view-BVmBtQTJ.js → project-app-view-B6KrZpsP.js} +1 -1
- package/dist/client/assets/record-editor-CP7nR48h.js +1 -0
- package/dist/client/assets/{redirect-editor-Dd2TDz4G.js → redirect-editor-toR3MzGX.js} +1 -1
- package/dist/client/assets/registry-CgsXhhHY.js +2 -0
- package/dist/client/assets/{registry-layout-Cm227W9R.js → registry-layout-Crop-FRo.js} +1 -1
- package/dist/client/assets/{reports-ab0wxN51.js → reports-Cd0v7eMn.js} +1 -1
- package/dist/client/assets/{require-capability-B3XvoArB.js → require-capability--L_GlXpd.js} +1 -1
- package/dist/client/assets/{required-auth-layout-D4xEI9J8.js → required-auth-layout-BAhPwscS.js} +1 -1
- package/dist/client/assets/{reset-password-BAG9ZsbJ.js → reset-password-CNmC6-k_.js} +1 -1
- package/dist/client/assets/roles-DWnvl1bF.js +1 -0
- package/dist/client/assets/{search-input-C9pC3WrF.js → search-input-BnJDFRMl.js} +1 -1
- package/dist/client/assets/{secrets-DVNv8yxX.js → secrets-DJInY_nu.js} +1 -1
- package/dist/client/assets/{sections-editor-Cq6s5Oed.js → sections-editor-DCBUfbWr.js} +1 -1
- package/dist/client/assets/{select-BoHatn08.js → select--icxBUQG.js} +1 -1
- package/dist/client/assets/{select-model-CaoH2ToV.js → select-model-CoTowZP9.js} +1 -1
- package/dist/client/assets/{self-tool-result-m7izFHM4.js → self-tool-result-CZm-aTd6.js} +1 -1
- package/dist/client/assets/{seo-editor-BmA8_Ouc.js → seo-editor-D4CFsGBp.js} +1 -1
- package/dist/client/assets/{settings-layout-CtQk6Z90.js → settings-layout-468cimaL.js} +1 -1
- package/dist/client/assets/{settings-section-XmYJ6Nk2.js → settings-section-B3ifPXpy.js} +1 -1
- package/dist/client/assets/{shell-controls-DtrTq4G_.js → shell-controls-okLnfuDR.js} +1 -1
- package/dist/client/assets/{shell-layout-Cd3V9av7.js → shell-layout-B2-xnSYQ.js} +1 -1
- package/dist/client/assets/{sidebar-nvbJrgVY.js → sidebar-CY8kI7Hv.js} +1 -1
- package/dist/client/assets/{skeleton-DxXAcunF.js → skeleton-BzHO_UZ_.js} +1 -1
- package/dist/client/assets/{spinner-BoBi9JH7.js → spinner-CR38v4SM.js} +1 -1
- package/dist/client/assets/{sso-BwhmanKT.js → sso-DaxZcPHF.js} +1 -1
- package/dist/client/assets/{store-CFuLGHOE.js → store-DmtY-Ut9.js} +1 -1
- package/dist/client/assets/store-registry-cv-3taNw.js +2 -0
- package/dist/client/assets/{studio-tools-BETupmQh.js → studio-tools-B9uOZhNU.js} +1 -1
- package/dist/client/assets/{switch-D5nHMM9-.js → switch-CicvP6tN.js} +1 -1
- package/dist/client/assets/{synced-repos-BC7dcdDm.js → synced-repos-1QYY_o14.js} +1 -1
- package/dist/client/assets/{tab-id-BdQ_M6R3.js → tab-id-D78T7QdF.js} +1 -1
- package/dist/client/assets/{table-DHyF1BO5.js → table-Cmvfib2K.js} +1 -1
- package/dist/client/assets/{tabs-bgoBmYh1.js → tabs-BBQmojOt.js} +1 -1
- package/dist/client/assets/{textarea-DLfz9L-W.js → textarea-D_MBsxxq.js} +1 -1
- package/dist/client/assets/{toggle-group-DVALkDJ2.js → toggle-group-D7E7rM45.js} +1 -1
- package/dist/client/assets/{toolbar-BseEnCPh.js → toolbar-DavdshhZ.js} +1 -1
- package/dist/client/assets/{tooltip-CpPLj5ml.js → tooltip-ZrjhT2HZ.js} +1 -1
- package/dist/client/assets/{use-ai-providers-DFLh4od7.js → use-ai-providers-jug9WjpB.js} +1 -1
- package/dist/client/assets/{use-automations-xk7Cu5D8.js → use-automations-CSTZ3886.js} +1 -1
- package/dist/client/assets/{use-autosave-BkJZ15dZ.js → use-autosave-ChvE0G33.js} +1 -1
- package/dist/client/assets/{use-capability-CxUt0m8I.js → use-capability-CD2_oMAe.js} +1 -1
- package/dist/client/assets/{use-clock-tick--4azGxeb.js → use-clock-tick-5wPqFXoc.js} +1 -1
- package/dist/client/assets/{use-connection-B7w0W3ts.js → use-connection-Cq-TmGuZ.js} +1 -1
- package/dist/client/assets/{use-copy-C6oZHBaC.js → use-copy-qVFT-iwH.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-BfVXbnRO.js → use-create-virtual-mcp-BKePGkVk.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-BMFBm4Py.js → use-debounced-autosave-BD5uwc1n.js} +1 -1
- package/dist/client/assets/{use-debounced-value-usyjdfzM.js → use-debounced-value-ZcGR3H0U.js} +1 -1
- package/dist/client/assets/{use-deco-credits-CGRraY5U.js → use-deco-credits-DZXadVhu.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-CfIikgvk.js → use-decopilot-events-Da84Mplm.js} +1 -1
- package/dist/client/assets/{use-delete-connection-WvDQKt5f.js → use-delete-connection-CUI5WjpR.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-Rs8yRNEE.js → use-deployment-admin-BXpDgUni.js} +1 -1
- package/dist/client/assets/{use-file-configs-Bp6CR8ct.js → use-file-configs-Cr6Dl2n3.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-Bct8OYtv.js → use-infinite-scroll-Cuq5t_LZ.js} +1 -1
- package/dist/client/assets/{use-join-requests-1tzcg5D1.js → use-join-requests-B-BwVS7j.js} +1 -1
- package/dist/client/assets/{use-mcp-client-B9fn1TBn.js → use-mcp-client-DguMnEWc.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-Cry83Gza.js → use-mcp-tools-Bc0RjdGq.js} +1 -1
- package/dist/client/assets/{use-members-HbYBEeJu.js → use-members-BSnfTEP4.js} +1 -1
- package/dist/client/assets/{use-mobile-CnfmCPF3.js → use-mobile-DMf3bWCn.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-BKt6uZhU.js → use-navigate-to-agent-BpKSuM9c.js} +1 -1
- package/dist/client/assets/{use-open-billing-url-DJ4izovt.js → use-open-billing-url-COnZPFfP.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-DDDMIikQ.js → use-org-auth-client-Bvzf-tUx.js} +1 -1
- package/dist/client/assets/{use-org-sso-TyWjgGeP.js → use-org-sso-CPuDLMAO.js} +1 -1
- package/dist/client/assets/{use-organization-roles-C0bVuJXK.js → use-organization-roles-CGLPno6a.js} +1 -1
- package/dist/client/assets/{use-organization-settings-BN4kKknX.js → use-organization-settings-BVocOGaq.js} +1 -1
- package/dist/client/assets/{use-registry-connections-VTJBa0En.js → use-registry-connections-C0HsNyAs.js} +1 -1
- package/dist/client/assets/{use-secrets-D6-WGKvN.js → use-secrets-BP-H3C8p.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-DcK97OvO.js → use-section-preview-base-DowNDHjh.js} +1 -1
- package/dist/client/assets/{use-status-sounds-CzyM6HAc.js → use-status-sounds-CjmrYixb.js} +1 -1
- package/dist/client/assets/{use-tags-BS8JieCa.js → use-tags-Cg8znnEF.js} +1 -1
- package/dist/client/assets/{use-view-mode-Qv39nezx.js → use-view-mode-2Cvl7LGq.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-C7NRfPhc.js → use-virtual-mcp-DnVlCNEk.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-DJ3TPFA7.js +1 -0
- package/dist/client/assets/{useRouterState-CjR4UZBL.js → useRouterState-ClmonZrX.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BKyBbyvL.js +1 -0
- package/dist/client/assets/{users-BF3gSgZn.js → users-CGfdaZgy.js} +1 -1
- package/dist/client/assets/{variant-calendar-By4-97I2.js → variant-calendar-Djt_WQR_.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-DGzElltC.js → view-mode-toggle-DOCvJ3u_.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +552 -552
- package/dist/server/server.js +325 -325
- package/package.json +1 -1
- package/dist/client/assets/index-BqKCSZFF.js +0 -5
- package/dist/client/assets/record-editor-7pz_uGMj.js +0 -1
- package/dist/client/assets/registry-Cn1toh1T.js +0 -2
- package/dist/client/assets/roles-BKn8lA_3.js +0 -1
- package/dist/client/assets/store-registry-ZIu_RLpB.js +0 -2
- package/dist/client/assets/useInfiniteQuery-C-kiHDyf.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-9epNuRWF.js +0 -1
package/dist/client/assets/{require-capability-B3XvoArB.js → require-capability--L_GlXpd.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as p,j as m}from"./index-
|
|
1
|
+
import{c as p,j as m}from"./index-HpF4ydE2.js";import{u as l}from"./use-capability-CD2_oMAe.js";import{A as u}from"./access-gate-CM__cLeC.js";function b(c){const t=p.c(6),{capability:n,area:e,children:i}=c,{granted:a,loading:o,error:s}=l(n);let r;return t[0]!==e||t[1]!==i||t[2]!==s||t[3]!==a||t[4]!==o?(r=m.jsx(u,{granted:a,loading:o,error:s,area:e,children:i}),t[0]=e,t[1]=i,t[2]=s,t[3]=a,t[4]=o,t[5]=r):r=t[5],r}export{b as R};
|
package/dist/client/assets/{required-auth-layout-D4xEI9J8.js → required-auth-layout-BAhPwscS.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as l,j as s,A as a,S as m,g as h,i as u,N as g}from"./index-
|
|
1
|
+
import{c as l,j as s,A as a,S as m,g as h,i as u,N as g}from"./index-HpF4ydE2.js";function x(){const o=l.c(1),e=window.location.pathname+window.location.search;let t;if(o[0]===Symbol.for("react.memo_cache_sentinel")){const n=e==="/login"||e.startsWith("/login?")?{}:{next:e};t=s.jsx(g,{to:"/login",search:n,replace:!0}),o[0]=t}else t=o[0];return t}function f(o){const e=l.c(6),{children:t}=o;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(a,{children:s.jsx(m,{})}),e[0]=i):i=e[0];let n;e[1]!==t?(n=s.jsx(h,{children:t}),e[1]=t,e[2]=n):n=e[2];let r;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(u,{children:s.jsx(x,{})}),e[3]=r):r=e[3];let c;return e[4]!==n?(c=s.jsxs(s.Fragment,{children:[i,n,r]}),e[4]=n,e[5]=c):c=e[5],c}export{f as R};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as O,b as A,u as K,d as V,r as z,e as $,j as s,B as T,a as G}from"./index-
|
|
1
|
+
import{c as O,b as A,u as K,d as V,r as z,e as $,j as s,B as T,a as G}from"./index-HpF4ydE2.js";import{I as D}from"./input-Dw4GelAn.js";function U(){const e=O.c(53),t=A();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/reset-password"},e[0]=n):n=e[0];const{token:o,error:F}=K(n),a=V(),[l,M]=z.useState(""),[i,q]=z.useState(""),[r,B]=z.useState(!1),c=F==="INVALID_TOKEN";let v;e[1]===Symbol.for("react.memo_cache_sentinel")?(v={mutationFn:H,onSuccess:()=>{B(!0)}},e[1]=v):v=e[1];const b=$(v),N=l===i,d=l.length>=8&&i.length>=8&&N,m=b.isPending,P=b.error;let y;e[2]!==d||e[3]!==l||e[4]!==b||e[5]!==o?(y=j=>{j.preventDefault(),!(!o||!d)&&b.mutate({newPassword:l,token:o})},e[2]=d,e[3]=l,e[4]=b,e[5]=o,e[6]=y):y=e[6];const I=y;let k;e[7]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(circle, var(--primary-foreground) 1px, transparent 1px)",backgroundSize:"16px 16px",opacity:.15}}),e[7]=k):k=e[7];let S,_,L,E;e[8]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),_=s.jsx("div",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),L=s.jsx("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),E=s.jsx("div",{className:"absolute right-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),e[8]=S,e[9]=_,e[10]=L,e[11]=E):(S=e[8],_=e[9],L=e[10],E=e[11]);let C;e[12]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx("div",{className:"flex justify-center",children:s.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12"})}),e[12]=C):C=e[12];let u;e[13]!==r||e[14]!==t?(u=t(r?"routes.resetPassword.passwordResetSuccessful":"routes.resetPassword.setNewPassword"),e[13]=r,e[14]=t,e[15]=u):u=e[15];let x;e[16]!==u?(x=s.jsx("div",{className:"text-center space-y-1",children:s.jsx("p",{className:"text-sm text-foreground/70",children:u})}),e[16]=u,e[17]=x):x=e[17];let f;e[18]!==c||e[19]!==a||e[20]!==r||e[21]!==t||e[22]!==o?(f=(c||!o&&!r)&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:t("routes.resetPassword.invalidOrExpiredLink")}),s.jsx(T,{onClick:()=>a({to:"/login"}),className:"w-full font-semibold",size:"lg",children:t("routes.resetPassword.backToLogin")})]}),e[18]=c,e[19]=a,e[20]=r,e[21]=t,e[22]=o,e[23]=f):f=e[23];let g;e[24]!==P||e[25]!==t?(g=P&&s.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:P.message||t("routes.resetPassword.failedToReset")}),e[24]=P,e[25]=t,e[26]=g):g=e[26];let p;e[27]!==a||e[28]!==r||e[29]!==t?(p=r&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"rounded-xl bg-success/10 p-3 text-sm text-success text-center",children:t("routes.resetPassword.passwordResetDescription")}),s.jsx(T,{onClick:()=>a({to:"/login"}),className:"w-full font-semibold",size:"lg",children:t("routes.resetPassword.goToLogin")})]}),e[27]=a,e[28]=r,e[29]=t,e[30]=p):p=e[30];let w;e[31]!==d||e[32]!==i||e[33]!==I||e[34]!==c||e[35]!==m||e[36]!==l||e[37]!==N||e[38]!==r||e[39]!==t||e[40]!==o?(w=o&&!c&&!r&&s.jsxs("form",{onSubmit:I,className:"grid gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:t("routes.resetPassword.newPasswordLabel")}),s.jsx(D,{type:"password",placeholder:"••••••••",value:l,onChange:j=>M(j.target.value),required:!0,minLength:8,disabled:m})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:t("routes.resetPassword.confirmPasswordLabel")}),s.jsx(D,{type:"password",placeholder:"••••••••",value:i,onChange:j=>q(j.target.value),required:!0,minLength:8,disabled:m}),i&&!N&&s.jsx("p",{className:"text-xs text-destructive mt-1.5",children:t("routes.resetPassword.passwordsDoNotMatch")})]}),s.jsx(T,{type:"submit",disabled:m||!d,className:"w-full font-semibold",size:"lg",children:t(m?"routes.resetPassword.resetting":"routes.resetPassword.resetPassword")})]}),e[31]=d,e[32]=i,e[33]=I,e[34]=c,e[35]=m,e[36]=l,e[37]=N,e[38]=r,e[39]=t,e[40]=o,e[41]=w):w=e[41];let h;e[42]!==a||e[43]!==r||e[44]!==t?(h=!r&&s.jsx("div",{className:"text-center",children:s.jsx(T,{type:"button",variant:"link",onClick:()=>a({to:"/login"}),className:"text-sm text-muted-foreground hover:text-foreground",children:t("routes.resetPassword.backToSignIn")})}),e[42]=a,e[43]=r,e[44]=t,e[45]=h):h=e[45];let R;return e[46]!==x||e[47]!==f||e[48]!==g||e[49]!==p||e[50]!==w||e[51]!==h?(R=s.jsxs("main",{className:"relative flex min-h-screen items-center justify-center bg-gradient-to-br from-primary to-primary/75 p-4",children:[k,s.jsxs("div",{className:"relative z-10",children:[S,_,L,E,s.jsxs("div",{className:"mx-auto w-full min-w-[400px] max-w-md grid gap-6 bg-card p-10 border border-primary-foreground/20",children:[C,x,f,g,p,w,h]})]})]}),e[46]=x,e[47]=f,e[48]=g,e[49]=p,e[50]=w,e[51]=h,e[52]=R):R=e[52],R}async function H(e){const{newPassword:t,token:n}=e,o=await G.resetPassword({newPassword:t,token:n});if(o.error)throw new Error(o.error.message||"Failed to reset password");return o}export{U as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as re,r as $,F as Be,K as me,n as Ke,j as s,m as W,k as je,B as ce,c as J,Z as Xe,_ as Ue,$ as ae,a3 as Je,a4 as et,o as rt,a1 as Ot,a2 as jt,e as at,t as Me,p as Fe,y as ct,z as Mt,E as Dt,d as vt,u as yt}from"./index-HpF4ydE2.js";import{u as Pt}from"./use-organization-roles-CGLPno6a.js";import{u as $e}from"./use-org-auth-client-Bvzf-tUx.js";import{g as dt,a as Lt}from"./role-color-Dn2tXDDF.js";import{B as De}from"./badge-D7AIZASF.js";import{g as mt,f as ut,A as ft,a as gt,b as ht,c as xt,d as pt,e as Tt}from"./alert-dialog-CEWyrZ_Z.js";import{c as wt,D as Gt,b as kt,a as Ut}from"./dropdown-menu-CvmqCZWH.js";import{a as Bt}from"./DotsVertical-wivS0onw.js";import{s as ze}from"./Plus-DJU_4kbx.js";import{s as Vt}from"./Trash01-DUPlExuW.js";import{C as Yt}from"./collection-table-wrapper-VyWx7MWu.js";import{P as ie}from"./index--OjyTwFQ.js";import{E as tt}from"./empty-state-B-59kVV9.js";import{S as Qe}from"./search-input-BnJDFRMl.js";import{P as Et,D as _t}from"./ai-providers-logos-DD3qZ33J.js";import{I as He}from"./integration-icon-Cyu5omdT.js";import{u as zt}from"./use-infinite-scroll-Cuq5t_LZ.js";import{C as Ze}from"./checkbox-B_axFhC0.js";import{i as Kt}from"./ArrowLeft-CR4vxoJp.js";import{u as Ft}from"./useSuspenseInfiniteQuery-BKyBbyvL.js";import{u as $t,S as Qt}from"./use-mcp-client-DguMnEWc.js";import{C as Ht}from"./collection-search-jgJieFUU.js";import{p as Zt}from"./connection-DKRnbF5j.js";import{u as It}from"./use-members-BSnfTEP4.js";import{g as Rt}from"./get-initials-D-f_fDFw.js";import{u as qt}from"./use-connection-Cq-TmGuZ.js";import{u as Wt,g as Xt}from"./use-ai-providers-jug9WjpB.js";import{A as St}from"./avatar-BpypxYS_.js";import{S as ve}from"./switch-CicvP6tN.js";import{b as ye,c as Pe,T as Le,a as we}from"./tooltip-ZrjhT2HZ.js";import{S as st,a as lt,b as ot}from"./settings-section-B3ifPXpy.js";import{t as Jt}from"./ChevronDown-BQOZpawT.js";import{i as es}from"./ChevronRight-cIZXph7r.js";import{i as nt}from"./X-B3ybq5w2.js";import{a as ts}from"./use-capability-CD2_oMAe.js";import{A as ss}from"./access-gate-CM__cLeC.js";import"./Check-COUqEm5U.js";import"./table-Cmvfib2K.js";import"./ArrowUp-CC_mbqe1.js";import"./sidebar-CY8kI7Hv.js";import"./LayoutLeft-qMb6nkLN.js";import"./use-mobile-DMf3bWCn.js";import"./SearchMd-SbBW-oPu.js";import"./Tool02-CWP-2wPJ.js";import"./agent-icon-ChlSj_zC.js";import"./AlertCircle-1FZS3v-O.js";import"./Tool01-C-9oM8hx.js";import"./XCircle-C4ggJi18.js";import"./ArrowUpRight-CbCF70v1.js";import"./TrendUp01-9IbbL3_o.js";import"./ZapSquare-Bg5_XykS.js";import"./Users03-Bx6UOYkE.js";import"./CheckCircle-OafhoQfB.js";import"./ChevronUp-1zullNEp.js";import"./Stars02-l4Bi009V.js";import"./Copy01-DOQujw91.js";import"./CpuChip01-DP6ksU24.js";import"./CreditCard01-CufFLIFI.js";import"./Globe01-4yOmtvQc.js";import"./Settings02-CtYuLrf4.js";import"./Eye-DrB86SUu.js";import"./FilterLines-D-22jIZj.js";import"./Share07-CT2dyret.js";import"./Star01-COyWVOwH.js";import"./Globe04-m8WcbUjt.js";import"./SwitchHorizontal01-D3zKTM_Y.js";import"./HardDrive-DZ-Roc4G.js";import"./Key01-Dkj1imoI.js";import"./LinkExternal01-B8ehDauF.js";import"./LogOut01-oc8d9SJs.js";import"./Monitor01-BOSd8wQ1.js";import"./Sun-BgLBLrAR.js";import"./Palette-CSOJeVFB.js";import"./Play-H-b9CdPO.js";import"./SearchLg-BQmUG7S4.js";import"./Shield01-W_oC4KLS.js";import"./Stars01-B9M6VkZj.js";import"./Upload01-CykCKPTH.js";import"./User01-DdCsns_p.js";import"./Users01-DddX3P2e.js";import"./XClose-DAaNDUux.js";import"./Zap-Bo7ywofH.js";import"./auth-v89NYv9q.js";import"./studio-tools-B9uOZhNU.js";import"./card-CoBKo1D2.js";import"./capability-load-error-BL2lrddy.js";const qe="basic-usage",We=[{id:qe,label:"Basic Usage",description:"Tools all org members can access by default",section:"Basic Usage",tools:["COLLECTION_CONNECTIONS_LIST","COLLECTION_CONNECTIONS_GET","CONNECTION_TEST","COLLECTION_VIRTUAL_MCP_LIST","COLLECTION_VIRTUAL_MCP_GET","VIRTUAL_MCP_PLUGIN_CONFIG_GET","VIRTUAL_MCP_LAST_USED_LIST","AUTOMATION_GET","AUTOMATION_LIST","AUTOMATION_RUN_STATS","AI_PROVIDERS_LIST","AI_PROVIDERS_LIST_MODELS","AI_PROVIDERS_ACTIVE","AI_PROVIDER_KEY_LIST","AI_PROVIDER_CREDITS","AI_PROVIDER_TOPUP_URL","LIST_OBJECTS","GET_OBJECT_METADATA","GET_PRESIGNED_URL","PUT_PRESIGNED_URL","FILE_OBJECTS_LIST","ORG_REPO_SYNC_LIST","SANDBOX_START","SANDBOX_DELETE","GLOBAL_SEARCH","ORGANIZATION_SETTINGS_GET","USER_GET","BRAND_CONTEXT_LIST","COLLECTION_THREADS_CREATE","COLLECTION_THREADS_LIST","COLLECTION_THREADS_GET","COLLECTION_THREADS_UPDATE","COLLECTION_THREADS_DELETE","COLLECTION_THREAD_MESSAGES_LIST","TASK_BOARD_ITEM_CREATE","TASK_BOARD_ITEM_LIST","TASK_BOARD_ITEM_UPDATE","TASK_BOARD_ITEM_DELETE","TASK_BOARD_ITEM_PRS_GET","TASK_BOARD_ITEM_PR_LINK","TASK_BOARD_ITEM_RERUN","TASK_BOARD_REVIEW_DECISION","TASK_BOARD_PROMOTE_TO_PRODUCTION","TASK_BOARD_ACTIVITY_LIST","TASK_BOARD_COMMENT_LIST","TASK_BOARD_COMMENT_CREATE","TASK_BOARD_COMMENT_UPDATE","TASK_BOARD_COMMENT_DELETE","TASK_BOARD_DISMISSED_LIST","TASK_BOARD_DISMISSED_RESTORE"]},{id:"org:manage",label:"Manage organization",description:"Edit organization settings, brand context, and domain configuration",section:"Organization",tools:["ORGANIZATION_GET","ORGANIZATION_LIST","ORGANIZATION_UPDATE","ORGANIZATION_SETTINGS_GET","ORGANIZATION_SETTINGS_UPDATE","BRAND_CONTEXT_LIST","BRAND_CONTEXT_GET","BRAND_CONTEXT_CREATE","BRAND_CONTEXT_UPDATE","BRAND_CONTEXT_DELETE","BRAND_CONTEXT_EXTRACT","BRAND_GET","BRAND_LIST","ORGANIZATION_DOMAIN_LIST","ORGANIZATION_DOMAIN_ADD","ORGANIZATION_DOMAIN_UPDATE","ORGANIZATION_DOMAIN_VERIFY","ORGANIZATION_DOMAIN_REMOVE"]},{id:"members:manage",label:"Manage members",description:"Invite members, remove them, and change their roles",section:"Organization",tools:["ORGANIZATION_MEMBER_LIST","ORGANIZATION_MEMBER_ADD","ORGANIZATION_MEMBER_REMOVE","ORGANIZATION_MEMBER_UPDATE_ROLE","ORGANIZATION_BILLING_CHECKOUT_START","ORGANIZATION_BILLING_PORTAL","ORGANIZATION_TASK_QUOTA_GET","ORGANIZATION_JOIN_REQUEST_LIST","ORGANIZATION_JOIN_REQUEST_APPROVE","ORGANIZATION_JOIN_REQUEST_DENY"],dangerous:!0},{id:"connections:manage",label:"Manage connections",description:"Create, update, and delete connections",section:"Connections & Agents",tools:["COLLECTION_CONNECTIONS_CREATE","COLLECTION_CONNECTIONS_UPDATE","COLLECTION_CONNECTIONS_DELETE","COMMERCE_DISCOVERY_SETUP","COMMERCE_DISCOVERY_RUN","COMMERCE_DISCOVERY_BIND","COMMERCE_DISCOVERY_CONNECTION_STATUS"],dangerous:!0},{id:"agents:manage",label:"Manage agents",description:"Create, configure, and delete agents",section:"Connections & Agents",tools:["COLLECTION_VIRTUAL_MCP_CREATE","COLLECTION_VIRTUAL_MCP_UPDATE","COLLECTION_VIRTUAL_MCP_DELETE","VIRTUAL_MCP_PLUGIN_CONFIG_UPDATE","VIRTUAL_MCP_PINNED_VIEWS_UPDATE"],dangerous:!0},{id:"automations:manage",label:"Manage automations",description:"Create, update, run, and delete automations",section:"Automations",tools:["AUTOMATION_CREATE","AUTOMATION_UPDATE","AUTOMATION_DELETE","AUTOMATION_TRIGGER_ADD","AUTOMATION_TRIGGER_REMOVE","AUTOMATION_TRIGGER_ROTATE_TOKEN","AUTOMATION_RUN"],dangerous:!0},{id:"monitoring:view",label:"View monitoring",description:"Access logs and usage statistics",section:"Monitoring",tools:["MONITORING_HEATMAP","MONITORING_LOG_GET","MONITORING_LOGS_LIST","MONITORING_STATS","MONITORING_THREAD_USAGE"]},{id:"secrets:manage",label:"Manage secrets",description:"Create and list secrets stored in the credential vault",section:"Organization",tools:["SECRET_CREATE","SECRET_LIST"]},{id:"file-configs:manage",label:"Manage file configs",description:"Create, list, update and delete S3 bucket configurations and synced GitHub repositories",section:"Organization",tools:["FILE_CONFIG_CREATE","FILE_CONFIG_LIST","FILE_CONFIG_UPDATE","FILE_CONFIG_DELETE","FILE_OBJECTS_LIST","ORG_REPO_SYNC_CREATE","ORG_REPO_SYNC_LIST","ORG_REPO_SYNC_UPDATE","ORG_REPO_SYNC_DELETE","ORG_REPO_SYNC_RUN"]},{id:"ai-providers:manage",label:"Manage AI providers",description:"Add or remove API keys and provision provider credentials",section:"AI Providers",tools:["AI_PROVIDER_KEY_CREATE","AI_PROVIDER_KEY_LIST","AI_PROVIDER_KEY_DELETE","AI_PROVIDER_KEY_UPDATE","AI_PROVIDER_KEY_PREVIEW","AI_PROVIDER_OAUTH_URL","AI_PROVIDER_OAUTH_EXCHANGE","AI_PROVIDER_PROVISION_KEY","AI_PROVIDER_TOPUP_URL","AI_PROVIDER_CREDITS","CLAUDE_SUBSCRIPTION_CONNECT","CLAUDE_SUBSCRIPTION_STATUS","CLAUDE_SUBSCRIPTION_DISCONNECT"]},{id:"tags:manage",label:"Manage tags",description:"Create, assign, and delete organization tags",section:"Organization",tools:["TAGS_LIST","TAGS_CREATE","TAGS_DELETE","MEMBER_TAGS_GET","MEMBER_TAGS_SET"]},{id:"registry:manage",label:"Manage registry",description:"Browse, publish, and manage items in the registry",section:"Store & Registry",tools:["COLLECTION_REGISTRY_APP_LIST","COLLECTION_REGISTRY_APP_GET","COLLECTION_REGISTRY_APP_VERSIONS","COLLECTION_REGISTRY_APP_FILTERS","REGISTRY_ITEM_LIST","REGISTRY_ITEM_SEARCH","REGISTRY_ITEM_GET","REGISTRY_ITEM_VERSIONS","REGISTRY_ITEM_FILTERS","REGISTRY_DISCOVER_TOOLS","REGISTRY_ITEM_CREATE","REGISTRY_ITEM_BULK_CREATE","REGISTRY_ITEM_UPDATE","REGISTRY_ITEM_DELETE","REGISTRY_AI_GENERATE","REGISTRY_PUBLISH_REQUEST_LIST","REGISTRY_PUBLISH_REQUEST_REVIEW","REGISTRY_PUBLISH_REQUEST_COUNT","REGISTRY_PUBLISH_REQUEST_DELETE","REGISTRY_PUBLISH_API_KEY_GENERATE","REGISTRY_PUBLISH_API_KEY_LIST","REGISTRY_PUBLISH_API_KEY_REVOKE"],dangerous:!0},{id:"registry:monitor",label:"Monitor registry health",description:"Run health checks on registry connections and view results",section:"Store & Registry",tools:["REGISTRY_MONITOR_RUN_START","REGISTRY_MONITOR_RUN_LIST","REGISTRY_MONITOR_RUN_GET","REGISTRY_MONITOR_RUN_CANCEL","REGISTRY_MONITOR_RESULT_LIST","REGISTRY_MONITOR_CONNECTION_LIST","REGISTRY_MONITOR_CONNECTION_SYNC","REGISTRY_MONITOR_CONNECTION_UPDATE_AUTH"]},{id:"api-keys:manage",label:"Manage API keys",description:"Create, update, and revoke API keys",section:"Developer",tools:["API_KEY_CREATE","API_KEY_LIST","API_KEY_UPDATE","API_KEY_DELETE"]},{id:"storage:delete",label:"Delete from storage",description:"Permanently delete files from object storage",section:"Developer",tools:["DELETE_OBJECT","DELETE_OBJECTS"],dangerous:!0},{id:"connections:sql",label:"Run SQL queries",description:"Execute raw SQL against connected databases",section:"Developer",tools:["DATABASES_RUN_SQL"],dangerous:!0}];[...We.find(t=>t.id===qe)?.tools??[]];const ls=["agents:manage","connections:manage"];new Set(We.filter(t=>ls.includes(t.id)).flatMap(t=>t.tools));function os(){const t=new Map;for(const e of We){if(e.id===qe)continue;const l=t.get(e.section)??[];l.push(e),t.set(e.section,l)}return Array.from(t.entries()).map(([e,l])=>({section:e,capabilities:l}))}function ns(t,e,l){return l?!0:t.tools.every(n=>e.includes(n))}function is(t,e,l){if(l){const i=new Set(e);for(const o of t.tools)i.add(o);return Array.from(i)}const n=new Set(e);for(const i of t.tools)n.delete(i);return Array.from(n)}function rs(t){const e=J.c(21),{connection:l,isSelected:n,hasToolsEnabled:i,activeToolsCount:o,totalToolsCount:c,onSelect:g,onToggle:h}=t,m=n?"bg-accent/50":"hover:bg-muted/50";let f;e[0]!==m?(f=W("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",m),e[0]=m,e[1]=f):f=e[1];let a;e[2]!==l.icon||e[3]!==l.title?(a=s.jsx(He,{icon:l.icon,name:l.title,size:"xs"}),e[2]=l.icon,e[3]=l.title,e[4]=a):a=e[4];let u;e[5]!==l.title?(u=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:l.title})}),e[5]=l.title,e[6]=u):u=e[6];let x;e[7]!==g||e[8]!==a||e[9]!==u?(x=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:g,children:[a,u]}),e[7]=g,e[8]=a,e[9]=u,e[10]=x):x=e[10];let d;e[11]!==o||e[12]!==l.tools||e[13]!==i||e[14]!==h||e[15]!==c?(d=l.tools&&l.tools.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[o,"/",c]}),s.jsx(Ze,{checked:i,onCheckedChange:h,onClick:as})]}),e[11]=o,e[12]=l.tools,e[13]=i,e[14]=h,e[15]=c,e[16]=d):d=e[16];let p;return e[17]!==f||e[18]!==x||e[19]!==d?(p=s.jsxs("div",{className:f,children:[x,d]}),e[17]=f,e[18]=x,e[19]=d,e[20]=p):p=e[20],p}function as(t){return t.stopPropagation()}function cs(t){const e=J.c(18),{connectionId:l,tool:n,isSelected:i,onToggle:o}=t,c=`tool-${l}-${n.name}`,g=i?"text-foreground":"text-muted-foreground";let h;e[0]!==g?(h=W("text-sm font-medium",g),e[0]=g,e[1]=h):h=e[1];let m;e[2]!==h||e[3]!==n.name?(m=s.jsx("div",{className:"flex items-center gap-2 mb-1",children:s.jsx("span",{className:h,children:n.name})}),e[2]=h,e[3]=n.name,e[4]=m):m=e[4];let f;e[5]!==n.description?(f=n.description&&s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:n.description}),e[5]=n.description,e[6]=f):f=e[6];let a;e[7]!==m||e[8]!==f?(a=s.jsxs("div",{className:"flex-1 min-w-0",children:[m,f]}),e[7]=m,e[8]=f,e[9]=a):a=e[9];const u=`tool-${l}-${n.name}`;let x;e[10]!==i||e[11]!==o||e[12]!==u?(x=s.jsx("div",{className:"flex items-center shrink-0",children:s.jsx(Ze,{id:u,checked:i,onCheckedChange:o,onClick:ds})}),e[10]=i,e[11]=o,e[12]=u,e[13]=x):x=e[13];let d;return e[14]!==c||e[15]!==a||e[16]!==x?(d=s.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:c,children:[a,x]}),e[14]=c,e[15]=a,e[16]=x,e[17]=d):d=e[17],d}function ds(t){return t.stopPropagation()}function ms({toolSet:t,onToolSetChange:e,excludeVirtualMcpId:l,searchQuery:n}){const i=re(),[o,c]=$.useState(""),g=n!==void 0?n:o,h=$.useDeferredValue(g),[m,f]=$.useState("all"),[a,u]=$.useState(!1),x=$.useRef(new Set(Object.keys(t))),{org:d}=Be(),p=$t({connectionId:Qt,orgId:d.id,orgSlug:d.slug}),A=100,R=h.trim(),I=R?{operator:"or",conditions:[{field:["title"],operator:"contains",value:R},{field:["description"],operator:"contains",value:R}]}:void 0,b=!!l,N={...I&&{where:I},orderBy:[{field:["updated_at"],direction:"asc"}],limit:A,offset:0,...b&&{include_virtual:!0}},M=JSON.stringify(N),{data:S,fetchNextPage:O,hasNextPage:D,isFetchingNextPage:E}=Ft({queryKey:me.collectionListInfinite(p,d.id,"","CONNECTIONS",M),queryFn:async({pageParam:T=0})=>(await p.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...I&&{where:I},orderBy:[{field:["updated_at"],direction:"asc"}],limit:A,offset:T,...b&&{include_virtual:!0}}})).structuredContent,initialPageParam:0,getNextPageParam:(T,G)=>{if(T?.hasMore)return G.reduce((Q,q)=>Q+(q?.items?.length??0),0)},staleTime:3e4}),C=S?.pages.flatMap(T=>T?.items??[])??[],v=zt(O,D??!1,E),r=l?C.filter(T=>T.connection_type!=="VIRTUAL"?!0:Zt(T.connection_url)!==l):C,_=x.current,k=[..._.values()].map(T=>r.find(G=>G.id===T)).filter(T=>T!==void 0),w=r.filter(T=>!_.has(T.id)),Y=[...k,...w],y=T=>{const G=t[T];return G!==void 0&&G.length>0},z=Y.filter(T=>{if(m==="all")return!0;const G=y(T.id);return m==="selected"?G:m==="unselected"?!G:!0}),[P,K]=$.useState(Y[0]?.id??null),V=P?Y.find(T=>T.id===P)??null:null,{data:U,isFetching:B}=Ke({queryKey:me.collectionItem(p,d.id,"","CONNECTIONS",P??""),queryFn:async()=>P?(await p.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:P}})).structuredContent?.item??null:null,enabled:!!P,staleTime:3e4}),H=U?.tools??[],X=(T,G)=>t[T]?.includes(G)??!1,te=(T,G)=>{const Q=t[T]??[],q=Q.includes(G),ne={...t};if(q){const se=Q.filter(oe=>oe!==G);se.length===0?delete ne[T]:ne[T]=se}else ne[T]=[...Q,G];e(ne)},le=T=>{const G=T===P?H:[];if(!G.length)return;const Q=t[T]??[],q=G.map(oe=>oe.name),ne=Q.length>0&&q.every(oe=>Q.includes(oe)),se={...t};ne?delete se[T]:(se[T]=q,K(T)),e(se)},F=T=>{K(T),u(!0)},Z=()=>{u(!1)};return s.jsxs("div",{className:"flex h-full",children:[s.jsxs("div",{className:W("w-full md:w-80 border-r border-border flex flex-col",a&&"hidden md:flex"),children:[n===void 0&&s.jsx(Ht,{value:o,onChange:c,placeholder:i("common.toolSetSelector.searchPlaceholder")}),s.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[s.jsx("button",{onClick:()=>f("all"),className:W("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",m==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:i("common.toolSetSelector.filterAll")}),s.jsx("button",{onClick:()=>f("selected"),className:W("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",m==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:i("common.toolSetSelector.filterSelected")}),s.jsx("button",{onClick:()=>f("unselected"),className:W("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",m==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:i("common.toolSetSelector.filterUnselected")})]}),s.jsx("div",{className:"flex-1 overflow-auto",children:z.length===0?s.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:i(g?"common.toolSetSelector.noConnectionsFound":m==="selected"?"common.toolSetSelector.noServersSelected":m==="unselected"?"common.toolSetSelector.noUnselectedServers":"common.toolSetSelector.noConnectionsAvailable")}):s.jsxs("div",{className:"p-2 space-y-1",children:[z.map(T=>{const G=P===T.id,Q=G?H.length:0,q=t[T.id]?.length??0;return s.jsx(rs,{connection:{...T,tools:G?H:T.tools},isSelected:G,hasToolsEnabled:y(T.id),activeToolsCount:q,totalToolsCount:Q,onSelect:()=>F(T.id),onToggle:()=>le(T.id)},T.id)}),s.jsx("div",{ref:v,className:"h-4"}),E&&s.jsx("div",{className:"flex justify-center py-3",children:s.jsx(je,{size:18,className:"animate-spin text-muted-foreground"})})]})})]}),s.jsx("div",{className:W("flex-1 flex-col",a?"flex":"hidden md:flex"),children:V?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"md:hidden border-b border-border p-4 flex items-center gap-3",children:[s.jsx(ce,{variant:"ghost",size:"sm",onClick:Z,className:"h-8 w-8 p-0 shrink-0",children:s.jsx(Kt,{size:20})}),s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[s.jsx(He,{icon:V.icon,name:V.title,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:V.title}),V.description&&s.jsx("p",{className:"text-sm text-muted-foreground truncate",children:V.description})]})]})]}),s.jsx("div",{className:"flex-1 overflow-auto p-4",children:B?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(je,{size:18,className:"animate-spin text-muted-foreground"})}):H.length===0?s.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:i("common.toolSetSelector.noToolsAvailable")}):s.jsx("div",{className:"space-y-2",children:H.map(T=>s.jsx(cs,{connectionId:V.id,tool:T,isSelected:X(V.id,T.name),onToggle:()=>te(V.id,T.name)},T.name))})})]}):s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx("div",{className:"text-sm text-muted-foreground text-center",children:i("common.toolSetSelector.selectConnection")})})})]})}const us=Xe({role:Xe({id:ae().optional(),slug:ae().optional(),label:ae()}),allowAllStaticPermissions:et(),staticPermissions:Ue(ae()),toolSet:Je(ae(),Ue(ae())),allowAllModels:et(),modelSet:Je(ae(),Ue(ae())),memberIds:Ue(ae())});function it(t,e,l,n){const i=s.jsx(ve,{checked:e,disabled:l,onCheckedChange:n});return l?s.jsx(ye,{children:s.jsxs(Pe,{children:[s.jsx(Le,{asChild:!0,children:s.jsx("div",{children:i})}),s.jsx(we,{children:s.jsx("p",{children:t("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):i}function fs(t){const e=J.c(41),{allowAllStaticPermissions:l,staticPermissions:n,onAllowAllChange:i,onPermissionsChange:o,readOnly:c,searchQuery:g}=t,h=c===void 0?!1:c,m=re();let f;e[0]!==g?(f=g.trim().toLowerCase(),e[0]=g,e[1]=f):f=e[1];const a=$.useDeferredValue(f);let u;if(e[2]!==l||e[3]!==a||e[4]!==i||e[5]!==o||e[6]!==h||e[7]!==g||e[8]!==n||e[9]!==m){const x=os(),d=(E,C)=>{if(!h){if(l&&C){const v=x.flatMap(xs).flatMap(hs);i(!1),o(v.filter(r=>!E.tools.includes(r)));return}l||o(is(E,n,!C))}};let p;e[11]!==a?(p=E=>{const{section:C,capabilities:v}=E;return{section:C,capabilities:v.filter(r=>!a||r.label.toLowerCase().includes(a)||r.description.toLowerCase().includes(a))}},e[11]=a,e[12]=p):p=e[12];const A=x.map(p).filter(gs);let R;e[13]!==m?(R=m("settings.orgRoleDetail.general"),e[13]=m,e[14]=R):R=e[14];let I;e[15]!==m?(I=m("settings.orgRoleDetail.allOrgPermissions"),e[15]=m,e[16]=I):I=e[16];let b;e[17]!==m?(b=m("settings.orgRoleDetail.grantFullAccessToAllFeaturesBelow"),e[17]=m,e[18]=b):b=e[18];let N;e[19]!==l||e[20]!==i||e[21]!==o?(N=()=>{i(!l),o([])},e[19]=l,e[20]=i,e[21]=o,e[22]=N):N=e[22];let M;e[23]!==l||e[24]!==h||e[25]!==m||e[26]!==N?(M=it(m,l,h,N),e[23]=l,e[24]=h,e[25]=m,e[26]=N,e[27]=M):M=e[27];let S;e[28]!==l||e[29]!==i||e[30]!==o||e[31]!==h?(S=h?void 0:()=>{i(!l),o([])},e[28]=l,e[29]=i,e[30]=o,e[31]=h,e[32]=S):S=e[32];let O;e[33]!==S||e[34]!==I||e[35]!==b||e[36]!==M?(O=s.jsx(lt,{children:s.jsx(ot,{title:I,description:b,action:M,onClick:S})}),e[33]=S,e[34]=I,e[35]=b,e[36]=M,e[37]=O):O=e[37];let D;e[38]!==O||e[39]!==R?(D=s.jsx(st,{title:R,children:O}),e[38]=O,e[39]=R,e[40]=D):D=e[40],u=s.jsx("div",{children:s.jsxs("div",{className:"flex flex-col gap-10 py-4",children:[D,A.length===0&&a?s.jsx("p",{className:"text-sm text-muted-foreground py-4",children:m("settings.orgRoleDetail.noPermissionsMatch",{searchQuery:g})}):A.map(E=>{const{section:C,capabilities:v}=E;return s.jsx(st,{title:C,children:s.jsx(lt,{children:v.map(r=>{const _=ns(r,n,l);return s.jsx(ot,{title:s.jsxs("span",{className:"flex items-center gap-1.5",children:[r.label,r.dangerous&&s.jsx(Mt,{size:12,className:"text-warning shrink-0"})]}),description:r.description,action:it(m,_,h,()=>d(r,_)),onClick:h?void 0:()=>d(r,_)},r.id)})})},C)})]})}),e[2]=l,e[3]=a,e[4]=i,e[5]=o,e[6]=h,e[7]=g,e[8]=n,e[9]=m,e[10]=u}else u=e[10];return u}function gs(t){return t.capabilities.length>0}function hs(t){return t.tools}function xs(t){return t.capabilities}const Nt={anthropic:"Anthropic",openrouter:"OpenRouter"},ps={openai:"OpenAI",anthropic:"Anthropic",google:"Google","meta-llama":"Meta",mistralai:"Mistral","x-ai":"xAI",deepseek:"DeepSeek",qwen:"Qwen",moonshotai:"MoonshotAI",nvidia:"NVIDIA",perplexity:"Perplexity",cohere:"Cohere",amazon:"Amazon",microsoft:"Microsoft","z-ai":"Z.ai","ibm-granite":"IBM Granite",alibaba:"Alibaba",baidu:"Baidu",bytedance:"ByteDance",tencent:"Tencent",minimax:"MiniMax",nousresearch:"Nous Research",allenai:"Allen AI",inception:"Inception"};function Ts(t,e){const l=t.indexOf("/"),n=l>0?t.slice(0,l):e;return n.startsWith("~")?n.slice(1):n}function Es(t){return ps[t]??Nt[t]??t}function _s(t){const e=t.indexOf(": ");return e>0&&e<32?t.slice(e+2):t}const Ct=30;function Is(t){const e=J.c(40),{connectionId:l,subProviderId:n,subProviderName:i,groupLogo:o,models:c,allConnectionModelIds:g,selectedModels:h,allowAllModels:m,allConnectionModelsSelected:f,onToggleModel:a,onExitAllowAll:u,readOnly:x,defaultExpanded:d}=t,p=re(),[A,R]=$.useState(d),I=d||A,b=R,[N,M]=$.useState(Ct);let S;e[0]!==f||e[1]!==m||e[2]!==h?(S=E=>m||f||h.includes("*")||h.includes(E),e[0]=f,e[1]=m,e[2]=h,e[3]=S):S=e[3];const O=S;let D;if(e[4]!==g||e[5]!==m||e[6]!==l||e[7]!==I||e[8]!==o||e[9]!==O||e[10]!==c||e[11]!==u||e[12]!==a||e[13]!==x||e[14]!==n||e[15]!==i||e[16]!==p||e[17]!==N){let E;e[19]!==O?(E=B=>O(B.id),e[19]=O,e[20]=E):E=e[20];const C=c.filter(E).length,v=c.slice(0,N),r=c.length>N;let _;e[21]===Symbol.for("react.memo_cache_sentinel")?(_=()=>b(Cs),e[21]=_):_=e[21];const k=o??Et[n]??_t;let w;e[22]!==i||e[23]!==k?(w=s.jsx(He,{icon:k,name:i,size:"sm"}),e[22]=i,e[23]=k,e[24]=w):w=e[24];let Y;e[25]!==i?(Y=s.jsx("span",{className:"text-sm font-medium truncate",children:i}),e[25]=i,e[26]=Y):Y=e[26];let y;e[27]!==w||e[28]!==Y?(y=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[w,Y]}),e[27]=w,e[28]=Y,e[29]=y):y=e[29];const z=p("settings.orgRoleDetail.enabledCount",{enabledCount:C,total:c.length});let P;e[30]!==z?(P=s.jsx(De,{variant:"secondary",className:"text-xs text-muted-foreground",children:z}),e[30]=z,e[31]=P):P=e[31];let K;e[32]!==I?(K=I?s.jsx(Jt,{size:16,className:"text-muted-foreground shrink-0"}):s.jsx(es,{size:16,className:"text-muted-foreground shrink-0"}),e[32]=I,e[33]=K):K=e[33];let V;e[34]!==P||e[35]!==K?(V=s.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[P,K]}),e[34]=P,e[35]=K,e[36]=V):V=e[36];let U;e[37]!==V||e[38]!==y?(U=s.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3 hover:bg-muted/50 cursor-pointer",onClick:_,children:[y,V]}),e[37]=V,e[38]=y,e[39]=U):U=e[39],D=s.jsxs("div",{className:"border border-border rounded-lg overflow-hidden bg-card",children:[U,I&&s.jsxs("div",{className:"border-t border-border bg-muted/20",children:[v.map(B=>{const H=O(B.id),X=()=>{if(!x){if(m){u(l,g,B.id);return}a(l,B.id)}};return s.jsxs("div",{className:W("flex items-center justify-between gap-3 px-4 py-3 border-b border-border last:border-b-0",!x&&"hover:bg-muted/50 cursor-pointer"),onClick:X,children:[s.jsx("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:s.jsx("span",{className:"text-sm truncate",children:B.title})}),s.jsx("div",{onClick:Ns,children:x?s.jsx(ye,{children:s.jsxs(Pe,{children:[s.jsx(Le,{asChild:!0,children:s.jsx("div",{children:s.jsx(ve,{checked:H,disabled:!0,onCheckedChange:Ss})})}),s.jsx(we,{children:s.jsx("p",{children:p("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):s.jsx(ve,{checked:H,onCheckedChange:X})})]},B.id)}),r&&s.jsx("button",{type:"button",className:"w-full px-4 py-2 text-xs text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors",onClick:()=>M(Rs),children:p("settings.orgRoleDetail.showMore",{remaining:c.length-N})})]})]}),e[4]=g,e[5]=m,e[6]=l,e[7]=I,e[8]=o,e[9]=O,e[10]=c,e[11]=u,e[12]=a,e[13]=x,e[14]=n,e[15]=i,e[16]=p,e[17]=N,e[18]=D}else D=e[18];return D}function Rs(t){return t+Ct}function Ss(){}function Ns(t){return t.stopPropagation()}function Cs(t){return!t}function As(t){const e=J.c(33),{connection:l,selectedModels:n,allowAllModels:i,onToggleModel:o,onExitAllowAll:c,allConnectionModelsSelected:g,searchQuery:h,readOnly:m}=t,f=Xt(l.id);let a,u,x,d,p;if(e[0]!==g||e[1]!==i||e[2]!==l.id||e[3]!==l.label||e[4]!==l.providerId||e[5]!==c||e[6]!==o||e[7]!==f||e[8]!==m||e[9]!==h||e[10]!==n){p=Symbol.for("react.early_return_sentinel");e:{let I;e[16]!==l.label?(I=_=>({..._,id:_.modelId,provider:l.label}),e[16]=l.label,e[17]=I):I=e[17];const b=f.filter(Ms).map(I),N=h.trim().toLowerCase(),M=N?b.filter(_=>_.title.toLowerCase().includes(N)||_.id.toLowerCase().includes(N)||_.provider?.toLowerCase().includes(N)):b;if(M.length===0){p=null;break e}const S=new Map;for(const _ of M){const k=Ts(_.id,l.providerId),w=S.get(k)??{models:[],logo:null};w.models.push({id:_.id,title:_s(_.title),logo:_.logo}),!w.logo&&_.logo&&(w.logo=_.logo),S.set(k,w)}const O=Array.from(S.entries()).map(js).sort(Os),D=O.length===1||N.length>0;x="flex flex-col gap-3";const E=Et[l.providerId]??_t;let C;e[18]!==l.providerId||e[19]!==E?(C=s.jsx("img",{src:E,alt:l.providerId,className:"w-4 h-4 rounded-sm dark:bg-white dark:rounded-sm dark:p-px"}),e[18]=l.providerId,e[19]=E,e[20]=C):C=e[20];const v=Nt[l.providerId]??l.providerId;let r;e[21]!==v?(r=s.jsx("h4",{className:"text-sm font-medium",children:v}),e[21]=v,e[22]=r):r=e[22],e[23]!==r||e[24]!==C?(d=s.jsxs("div",{className:"flex items-center gap-2",children:[C,r]}),e[23]=r,e[24]=C,e[25]=d):d=e[25],a="flex flex-col gap-3",u=O.map(_=>s.jsx(Is,{connectionId:l.id,subProviderId:_.id,subProviderName:_.name,groupLogo:_.logo,models:_.models,allConnectionModelIds:b.map(bs),selectedModels:n,allowAllModels:i,allConnectionModelsSelected:g,onToggleModel:o,onExitAllowAll:c,readOnly:m,defaultExpanded:D},_.id))}e[0]=g,e[1]=i,e[2]=l.id,e[3]=l.label,e[4]=l.providerId,e[5]=c,e[6]=o,e[7]=f,e[8]=m,e[9]=h,e[10]=n,e[11]=a,e[12]=u,e[13]=x,e[14]=d,e[15]=p}else a=e[11],u=e[12],x=e[13],d=e[14],p=e[15];if(p!==Symbol.for("react.early_return_sentinel"))return p;let A;e[26]!==a||e[27]!==u?(A=s.jsx("div",{className:a,children:u}),e[26]=a,e[27]=u,e[28]=A):A=e[28];let R;return e[29]!==x||e[30]!==d||e[31]!==A?(R=s.jsxs("div",{className:x,children:[d,A]}),e[29]=x,e[30]=d,e[31]=A,e[32]=R):R=e[32],R}function bs(t){return t.id}function Os(t,e){return t.name.localeCompare(e.name)}function js(t){const[e,l]=t;return{id:e,name:Es(e),logo:l.logo,models:l.models}}function Ms(t,e,l){return l.findIndex(n=>n.modelId===t.modelId)===e}function Ds(t){const e=J.c(41),{allowAllModels:l,modelSet:n,onAllowAllChange:i,onModelSetChange:o,readOnly:c,searchQuery:g}=t,h=c===void 0?!1:c,m=re(),f=$.useDeferredValue(g),a=Wt();let u;e[0]!==n||e[1]!==o?(u=(E,C)=>{const v=n[E]??[],r={...n};if(v.includes(C)){const _=v.filter(k=>k!==C);_.length===0?delete r[E]:r[E]=_}else r[E]=[...v,C];o(r)},e[0]=n,e[1]=o,e[2]=u):u=e[2];const x=u;let d;e[3]!==n||e[4]!==i||e[5]!==o?(d=(E,C,v)=>{i(!1),o({...n,[E]:C.filter(r=>r!==v)})},e[3]=n,e[4]=i,e[5]=o,e[6]=d):d=e[6];const p=d,A=!h&&"hover:bg-muted/50 cursor-pointer";let R;e[7]!==A?(R=W("flex items-center justify-between px-4 py-3 rounded-lg border border-border bg-card",A),e[7]=A,e[8]=R):R=e[8];let I;e[9]!==l||e[10]!==i||e[11]!==o||e[12]!==h?(I=()=>{if(h)return;const E=!l;i(E),E&&o({})},e[9]=l,e[10]=i,e[11]=o,e[12]=h,e[13]=I):I=e[13];let b;e[14]!==m?(b=m("settings.orgRoleDetail.allModels"),e[14]=m,e[15]=b):b=e[15];let N;e[16]!==b?(N=s.jsx("span",{className:"text-sm font-medium",children:b}),e[16]=b,e[17]=N):N=e[17];let M;e[18]!==l||e[19]!==i||e[20]!==o||e[21]!==h||e[22]!==m?(M=s.jsx("div",{onClick:ys,children:h?s.jsx(ye,{children:s.jsxs(Pe,{children:[s.jsx(Le,{asChild:!0,children:s.jsx("div",{children:s.jsx(ve,{checked:l,disabled:!0,onCheckedChange:vs})})}),s.jsx(we,{children:s.jsx("p",{children:m("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):s.jsx(ve,{checked:l,onCheckedChange:E=>{i(E),E&&o({})}})}),e[18]=l,e[19]=i,e[20]=o,e[21]=h,e[22]=m,e[23]=M):M=e[23];let S;e[24]!==R||e[25]!==I||e[26]!==N||e[27]!==M?(S=s.jsxs("div",{className:R,onClick:I,children:[N,M]}),e[24]=R,e[25]=I,e[26]=N,e[27]=M,e[28]=S):S=e[28];let O;e[29]!==a||e[30]!==l||e[31]!==f||e[32]!==p||e[33]!==n||e[34]!==h||e[35]!==m||e[36]!==x?(O=a.length===0?s.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:m("settings.orgRoleDetail.noLlmConnectionsConfigured")}):a.map(E=>s.jsx($.Suspense,{fallback:s.jsxs("div",{className:"px-4 py-3 flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(je,{className:"size-4 animate-spin"}),m("settings.orgRoleDetail.loadingModels")]}),children:s.jsx(As,{connection:E,selectedModels:n[E.id]??[],allowAllModels:l,onToggleModel:x,onExitAllowAll:p,allConnectionModelsSelected:(n[E.id]??[]).includes("*"),searchQuery:f,readOnly:h})},E.id)),e[29]=a,e[30]=l,e[31]=f,e[32]=p,e[33]=n,e[34]=h,e[35]=m,e[36]=x,e[37]=O):O=e[37];let D;return e[38]!==S||e[39]!==O?(D=s.jsxs("div",{className:"flex flex-col h-full overflow-auto gap-6 pb-6",children:[S,O]}),e[38]=S,e[39]=O,e[40]=D):D=e[40],D}function vs(){}function ys(t){return t.stopPropagation()}function Ps(t){const e=J.c(75),{open:l,onOpenChange:n,selectedMemberIds:i,onAddMembers:o}=t,c=re(),[g,h]=$.useState(""),m=$.useDeferredValue(g);let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=[],e[0]=f):f=e[0];const[a,u]=$.useState(f),{data:x}=It();let d,p,A,R,I,b,N,M,S,O,D;if(e[1]!==x?.data?.members||e[2]!==m||e[3]!==o||e[4]!==n||e[5]!==l||e[6]!==a||e[7]!==g||e[8]!==i||e[9]!==c){const P=x?.data?.members??[];let K;e[21]!==m?(K=F=>{const Z=m.toLowerCase();return F.user?.name?.toLowerCase().includes(Z)||F.user?.email?.toLowerCase().includes(Z)},e[21]=m,e[22]=K):K=e[22];const V=P.filter(K);let U;e[23]!==o||e[24]!==n||e[25]!==a?(U=()=>{o(a),u([]),n(!1)},e[23]=o,e[24]=n,e[25]=a,e[26]=U):U=e[26],A=U,p=mt,O=l,D=n,d=ut,M="sm:max-w-md p-0";let B;e[27]!==c?(B=c("settings.orgRoleDetail.addMembersToRole"),e[27]=c,e[28]=B):B=e[28];let H;e[29]!==B?(H=s.jsx(ft,{children:B}),e[29]=B,e[30]=H):H=e[30];let X;e[31]!==c?(X=c("settings.orgRoleDetail.selectMembersToAddToThisRole"),e[31]=c,e[32]=X):X=e[32];let te;e[33]!==X?(te=s.jsx(gt,{children:X}),e[33]=X,e[34]=te):te=e[34],e[35]!==H||e[36]!==te?(S=s.jsxs(ht,{className:"px-6 pt-6",children:[H,te]}),e[35]=H,e[36]=te,e[37]=S):S=e[37],b="flex flex-col h-80";let le;e[38]!==c?(le=c("settings.orgRoleDetail.searchMembers"),e[38]=c,e[39]=le):le=e[39],e[40]!==g||e[41]!==le?(N=s.jsx("div",{className:"border-b border-border px-4 py-3",children:s.jsx(Qe,{value:g,onChange:h,placeholder:le,className:"w-full"})}),e[40]=g,e[41]=le,e[42]=N):N=e[42],R="flex-1 overflow-auto",I=V.length===0?s.jsx("div",{className:"flex items-center justify-center h-full px-6",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:c(g?"settings.orgRoleDetail.noMembersFound":"settings.orgRoleDetail.noMembersAvailable")})}):s.jsx("div",{className:"px-6 py-2 space-y-1",children:V.map(F=>{const Z=F.role!=="owner",T=i.includes(F.id),G=a.includes(F.id);return s.jsxs("label",{className:W("flex items-center gap-3 p-2 rounded-lg",!Z||T?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-muted/50"),children:[s.jsx(Ze,{checked:G||T,onCheckedChange:()=>{!Z||T||u(Q=>Q.includes(F.id)?Q.filter(q=>q!==F.id):[...Q,F.id])},disabled:!Z||T}),s.jsx(St,{url:F.user?.image??void 0,fallback:Rt(F.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:F.user?.name||c("settings.orgRoleDetail.unknown")}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:F.user?.email})]}),!Z&&s.jsx(De,{variant:"secondary",className:"shrink-0",children:c("settings.orgRoleDetail.owner")}),T&&Z&&s.jsx(De,{variant:"outline",className:"shrink-0",children:c("settings.orgRoleDetail.added")})]},F.id)})}),e[1]=x?.data?.members,e[2]=m,e[3]=o,e[4]=n,e[5]=l,e[6]=a,e[7]=g,e[8]=i,e[9]=c,e[10]=d,e[11]=p,e[12]=A,e[13]=R,e[14]=I,e[15]=b,e[16]=N,e[17]=M,e[18]=S,e[19]=O,e[20]=D}else d=e[10],p=e[11],A=e[12],R=e[13],I=e[14],b=e[15],N=e[16],M=e[17],S=e[18],O=e[19],D=e[20];let E;e[43]!==R||e[44]!==I?(E=s.jsx("div",{className:R,children:I}),e[43]=R,e[44]=I,e[45]=E):E=e[45];let C;e[46]!==E||e[47]!==b||e[48]!==N?(C=s.jsxs("div",{className:b,children:[N,E]}),e[46]=E,e[47]=b,e[48]=N,e[49]=C):C=e[49];let v;e[50]!==c?(v=c("settings.orgRoleDetail.cancel"),e[50]=c,e[51]=v):v=e[51];let r;e[52]!==v?(r=s.jsx(xt,{children:v}),e[52]=v,e[53]=r):r=e[53];const _=a.length===0;let k;e[54]!==a.length||e[55]!==c?(k=c("settings.orgRoleDetail.addWithCount",{count:a.length}),e[54]=a.length,e[55]=c,e[56]=k):k=e[56];let w;e[57]!==A||e[58]!==_||e[59]!==k?(w=s.jsx(pt,{onClick:A,disabled:_,children:k}),e[57]=A,e[58]=_,e[59]=k,e[60]=w):w=e[60];let Y;e[61]!==r||e[62]!==w?(Y=s.jsxs(Tt,{className:"px-6 pb-6",children:[r,w]}),e[61]=r,e[62]=w,e[63]=Y):Y=e[63];let y;e[64]!==d||e[65]!==C||e[66]!==Y||e[67]!==M||e[68]!==S?(y=s.jsxs(d,{className:M,children:[S,C,Y]}),e[64]=d,e[65]=C,e[66]=Y,e[67]=M,e[68]=S,e[69]=y):y=e[69];let z;return e[70]!==p||e[71]!==y||e[72]!==O||e[73]!==D?(z=s.jsx(p,{open:O,onOpenChange:D,children:y}),e[70]=p,e[71]=y,e[72]=O,e[73]=D,e[74]=z):z=e[74],z}function Ls(t){const e=J.c(33),{memberIds:l,onMemberIdsChange:n,readOnly:i,readOnlyMessage:o,searchQuery:c,addMemberDialogOpen:g,onAddMemberDialogOpenChange:h}=t,m=i===void 0?!1:i,f=o===void 0?void 0:o,a=re(),u=$.useDeferredValue(c),{data:x}=It();let d,p,A;if(e[0]!==x?.data?.members||e[1]!==u||e[2]!==l||e[3]!==n||e[4]!==m||e[5]!==f||e[6]!==c||e[7]!==a){const M=x?.data?.members??[];let S;e[11]!==l?(S=r=>l.includes(r.id),e[11]=l,e[12]=S):S=e[12];const O=M.filter(S);let D;e[13]!==u?(D=r=>{const _=u.toLowerCase();return r.user?.name?.toLowerCase().includes(_)||r.user?.email?.toLowerCase().includes(_)},e[13]=u,e[14]=D):D=e[14];const E=O.filter(D);let C;e[15]!==f||e[16]!==a?(C=f??a("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),e[15]=f,e[16]=a,e[17]=C):C=e[17];const v=C;A="flex flex-col h-full",d="flex-1 overflow-auto",p=O.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsxs("div",{className:"text-center",children:[s.jsx("h3",{className:"text-base font-medium mb-1",children:a("settings.orgRoleDetail.noMembers")}),s.jsx("p",{className:"text-sm text-muted-foreground",children:a("settings.orgRoleDetail.addMembersToGrantPermissions")})]})}):E.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:a("settings.orgRoleDetail.noMembersMatch",{searchQuery:c})})}):s.jsx("div",{className:"p-4 space-y-2",children:E.map(r=>s.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-muted/30",children:[s.jsx(St,{url:r.user?.image??void 0,fallback:Rt(r.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:r.user?.name||a("settings.orgRoleDetail.unknown")}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:r.user?.email})]}),m?s.jsx(ye,{children:s.jsxs(Pe,{children:[s.jsx(Le,{asChild:!0,children:s.jsx("div",{children:s.jsx(ce,{variant:"ghost",size:"sm",disabled:!0,"aria-label":a("settings.orgRoleDetail.removeMember",{name:r.user?.name||a("settings.orgRoleDetail.unknown")}),children:s.jsx(nt,{size:16})})})}),s.jsx(we,{children:s.jsx("p",{children:v})})]})}):s.jsx(ce,{variant:"ghost",size:"sm","aria-label":a("settings.orgRoleDetail.removeMember",{name:r.user?.name||a("settings.orgRoleDetail.unknown")}),onClick:()=>n(l.filter(_=>_!==r.id)),children:s.jsx(nt,{size:16})})]},r.id))}),e[0]=x?.data?.members,e[1]=u,e[2]=l,e[3]=n,e[4]=m,e[5]=f,e[6]=c,e[7]=a,e[8]=d,e[9]=p,e[10]=A}else d=e[8],p=e[9],A=e[10];let R;e[18]!==d||e[19]!==p?(R=s.jsx("div",{className:d,children:p}),e[18]=d,e[19]=p,e[20]=R):R=e[20];let I;e[21]!==l||e[22]!==n?(I=M=>n([...l,...M]),e[21]=l,e[22]=n,e[23]=I):I=e[23];let b;e[24]!==g||e[25]!==l||e[26]!==h||e[27]!==I?(b=s.jsx(Ps,{open:g,onOpenChange:h,selectedMemberIds:l,onAddMembers:I}),e[24]=g,e[25]=l,e[26]=h,e[27]=I,e[28]=b):b=e[28];let N;return e[29]!==A||e[30]!==R||e[31]!==b?(N=s.jsxs("div",{className:A,children:[R,b]}),e[29]=A,e[30]=R,e[31]=b,e[32]=N):N=e[32],N}function ws(t){const e=J.c(3);let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(je,{size:24,className:"animate-spin text-muted-foreground"})}),e[0]=l):l=e[0];let n;return e[1]!==t?(n=s.jsx($.Suspense,{fallback:l,children:s.jsx(Ls,{...t})}),e[1]=t,e[2]=n):n=e[2],n}const Gs={owner:[],admin:[],user:[]};function ks(t,e,l,n){const i=t==="owner"||t==="admin";return{role:{id:l?.id,slug:t,label:t.charAt(0).toUpperCase()+t.slice(1)},allowAllStaticPermissions:i,staticPermissions:Gs[t],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:e.filter(o=>o.role===t).map(o=>o.id)}}function Us(t,e,l){const n=t.permission||{},i=n.self||[],o=i.includes("*"),c=o?[]:i.filter(a=>a!=="*"),g={};for(const[a,u]of Object.entries(n))if(!(a==="self"||a==="models"))if(a==="*")for(const x of l)g[x.id]=u.includes("*")?x.tools?.map(d=>d.name)??[]:u;else{const x=l.find(d=>d.id===a);x&&(g[a]=u.includes("*")?x.tools?.map(d=>d.name)??[]:u)}const h=n.models||[],m=h.length===0||h.includes("*:*"),f={};if(!m)for(const a of h){const u=a.indexOf(":");if(u===-1)continue;const x=a.slice(0,u),d=a.slice(u+1);f[x]||(f[x]=[]),f[x].push(d)}return{role:{id:t.id,slug:t.role,label:t.label},allowAllStaticPermissions:o,staticPermissions:c,toolSet:g,allowAllModels:m,modelSet:f,memberIds:e.filter(a=>a.role===t.role).map(a=>a.id)}}function Bs(t,e){const l={};t.allowAllStaticPermissions?l.self=["*"]:t.staticPermissions.length>0&&(l.self=t.staticPermissions);for(const[n,i]of Object.entries(t.toolSet))if(i.length>0){const c=e.find(g=>g.id===n)?.tools?.map(g=>g.name)??[];l[n]=c.length>0&&c.every(g=>i.includes(g))?["*"]:i}if(t.allowAllModels)l.models=["*:*"];else{const n=[];for(const[i,o]of Object.entries(t.modelSet))for(const c of o)n.push(`${i}:${c}`);n.length>0&&(l.models=n)}return l}function Vs(t,e,l){return t.kind==="builtin"?ks(t.role,e,void 0):t.kind==="custom"?Us(t.role,e,l):{role:{id:void 0,slug:void 0,label:""},allowAllStaticPermissions:!1,staticPermissions:[],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:[]}}function Ys(t){const e=J.c(19),{readOnly:l,readOnlyMessage:n,onOpen:i}=t,o=n===void 0?void 0:n,c=re();let g;e[0]!==o||e[1]!==c?(g=o??c("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),e[0]=o,e[1]=c,e[2]=g):g=e[2];const h=g;if(l){let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(ze,{size:16}),e[3]=u):u=e[3];let x;e[4]!==c?(x=c("settings.orgRoleDetail.addMember"),e[4]=c,e[5]=x):x=e[5];let d;e[6]!==x?(d=s.jsx(Le,{asChild:!0,children:s.jsx("div",{children:s.jsxs(ce,{variant:"outline",size:"sm",disabled:!0,children:[u,x]})})}),e[6]=x,e[7]=d):d=e[7];let p;e[8]!==h?(p=s.jsx(we,{children:s.jsx("p",{children:h})}),e[8]=h,e[9]=p):p=e[9];let A;return e[10]!==d||e[11]!==p?(A=s.jsx(ye,{children:s.jsxs(Pe,{children:[d,p]})}),e[10]=d,e[11]=p,e[12]=A):A=e[12],A}let m;e[13]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(ze,{size:16}),e[13]=m):m=e[13];let f;e[14]!==c?(f=c("settings.orgRoleDetail.addMember"),e[14]=c,e[15]=f):f=e[15];let a;return e[16]!==i||e[17]!==f?(a=s.jsxs(ce,{variant:"outline",size:"sm",onClick:i,children:[m,f]}),e[16]=i,e[17]=f,e[18]=a):a=e[18],a}function zs(t){const e=J.c(14),{locator:l}=Be(),n=$e(),i=qt();let o;e[0]!==l?(o=me.members(l),e[0]=l,e[1]=o):o=e[1];let c;e[2]!==n?(c=()=>n.organization.listMembers(),e[2]=n,e[3]=c):c=e[3];let g;e[4]!==o||e[5]!==c?(g={queryKey:o,queryFn:c},e[4]=o,e[5]=c,e[6]=g):g=e[6];const{data:h,isPending:m}=Ke(g);if(m||!i){let x;return e[7]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(ie,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(je,{size:32,className:"animate-spin text-muted-foreground"})})}),e[7]=x):x=e[7],x}let f;e[8]!==h?.data?.members?(f=h?.data?.members??[],e[8]=h?.data?.members,e[9]=f):f=e[9];const a=f;let u;return e[10]!==i||e[11]!==a||e[12]!==t?(u=s.jsx(Ks,{...t,members:a,connections:i}),e[10]=i,e[11]=a,e[12]=t,e[13]=u):u=e[13],u}function Ks({target:t,onBack:e,onSaved:l,members:n,connections:i}){const o=re(),{locator:c}=Be(),g=$e(),h=rt(),m=t.kind==="builtin",f=t.kind==="builtin"&&t.role==="owner",a=t.kind==="new",[u,x]=$.useState(m?"org":"mcp"),d=Ot({resolver:jt(us),defaultValues:Vs(t,n,i)}),p=d.formState.isValid,A=d.formState.isDirty,R=at({mutationFn:async r=>{const _=Bs(r,i),k=r.role.slug||r.role.label.toLowerCase().replace(/\s+/g,"-"),w=(r.role.slug==="owner"||r.role.slug==="admin"||r.role.slug==="user")&&!r.role.id,Y=async(y,z)=>{const P=n.filter(U=>U.role===(z??y)).map(U=>U.id),K=r.memberIds.filter(U=>!P.includes(U)),V=P.filter(U=>!r.memberIds.includes(U));for(const U of K){const B=await g.organization.updateMemberRole({memberId:U,role:[y]});if(B?.error)throw new Error(B.error.message??o("settings.orgRoleDetail.somethingWentWrong"))}for(const U of V){const B=await g.organization.updateMemberRole({memberId:U,role:["user"]});if(B?.error)throw new Error(B.error.message??o("settings.orgRoleDetail.somethingWentWrong"))}};if(w)return await Y(r.role.slug),r;if(r.role.id){const y=r.role.label.toLowerCase().replace(/\s+/g,"-"),z=r.role.slug,P=y!==z,K=await g.organization.updateRole({roleId:r.role.id,data:{permission:_,...P?{roleName:y}:{}}});if(K?.error)throw new Error(K.error.message??o("settings.orgRoleDetail.somethingWentWrong"));return await Y(P?y:z,P?z:void 0),P?{...r,role:{...r.role,slug:y}}:r}else{const y=await g.organization.createRole({role:k,permission:_});if(y?.error)throw new Error(y.error.message??o("settings.orgRoleDetail.somethingWentWrong"));for(const z of r.memberIds){const P=await g.organization.updateMemberRole({memberId:z,role:[k]});if(P?.error)throw new Error(P.error.message)}return{...r,role:{...r.role,id:y.data?.roleData?.id,slug:k}}}},onSuccess:(r,_)=>{h.invalidateQueries({queryKey:me.members(c)}),h.invalidateQueries({queryKey:me.organizationRoles(c)});const k=!_.role.id&&!_.role.slug,w=_.role.slug==="owner"&&!_.role.id;Fe(w?"role_members_updated":k?"role_created":"role_updated",{role_slug:_.role.slug??null}),Me.success(o(w?"settings.orgRoleDetail.membersUpdatedSuccessfully":k?"settings.orgRoleDetail.roleCreatedSuccessfully":"settings.orgRoleDetail.roleUpdatedSuccessfully")),d.reset(r),l(r.role.id)},onError:r=>{Me.error(r instanceof Error?r.message:o("settings.orgRoleDetail.failedToSaveRole"))}}),I=d.handleSubmit(r=>{if(!r.role.label.trim()){Me.error(o("settings.orgRoleDetail.roleNameIsRequired")),d.setFocus("role.label");return}R.mutate(r)}),b=!f,N=t.kind==="builtin"?t.role.charAt(0).toUpperCase()+t.role.slice(1):t.kind==="custom"?t.role.label:"",M=[...f?[]:[{id:"mcp",label:o("settings.orgRoleDetail.mcpPermissions")}],{id:"org",label:o("settings.orgRoleDetail.organizationPermissions")},{id:"models",label:o("settings.orgRoleDetail.models")},{id:"members",label:o("settings.orgRoleDetail.members")}],[S,O]=$.useState(""),[D,E]=$.useState(!1),C=r=>{x(r),O("")},v={mcp:o("settings.orgRoleDetail.searchMcpServers"),org:o("settings.orgRoleDetail.searchPermissions"),models:o("settings.orgRoleDetail.searchModels"),members:o("settings.orgRoleDetail.searchMembers")};return s.jsx(ie,{children:s.jsxs(ie.Content,{className:W("flex flex-col",u!=="org"&&"overflow-hidden"),children:[s.jsx("div",{className:"shrink-0 mx-auto w-full max-w-[1200px] px-4 md:px-10 pt-8 md:pt-12 pb-4",children:s.jsxs("div",{className:"flex flex-col gap-5",children:[s.jsx(ie.Title,{actions:b&&s.jsxs(s.Fragment,{children:[s.jsx(ce,{variant:"outline",size:"sm",onClick:e,disabled:R.isPending,children:o("settings.orgRoleDetail.cancel")}),s.jsx(ce,{size:"sm",onClick:I,disabled:R.isPending||!p||!A,children:R.isPending?o("settings.orgRoleDetail.saving"):o(a?"settings.orgRoleDetail.createRole":"settings.orgRoleDetail.saveChanges")})]}),children:s.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[s.jsx("div",{className:W("size-2.5 rounded-full shrink-0",t.kind==="builtin"?dt(t.role,!0):Lt(d.watch("role.label")))}),f&&s.jsx(ct,{size:16,className:"text-muted-foreground shrink-0"}),a||t.kind==="custom"?s.jsx("input",{...d.register("role.label"),placeholder:o("settings.orgRoleDetail.roleName"),className:"leading-tight text-foreground bg-transparent border-none outline-none px-1 -mx-1 rounded hover:bg-input/25 focus:bg-input/25 transition-colors w-64 placeholder:text-muted-foreground/50",autoFocus:a}):s.jsx("span",{className:"truncate",children:N})]})}),s.jsx("div",{className:"flex items-center gap-2",children:M.map(r=>s.jsx("button",{type:"button",onClick:()=>C(r.id),className:W("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex items-center",u===r.id?"bg-accent border-border text-foreground":"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:r.label},r.id))}),s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsx(Qe,{value:S,onChange:O,placeholder:v[u]??"Search...",className:"w-full md:w-[375px]"}),u==="members"&&s.jsx(Ys,{readOnly:t.kind==="builtin"&&t.role==="owner",onOpen:()=>E(!0)})]})]})}),s.jsx("div",{className:W("mx-auto w-full max-w-[1200px] px-4 md:px-10 pb-6",u!=="org"&&"flex-1 min-h-0"),children:s.jsxs("div",{className:W(u!=="org"&&"h-full overflow-hidden",u!=="models"&&u!=="org"&&"border border-border rounded-xl bg-card"),children:[u==="mcp"&&!f&&s.jsx(ms,{toolSet:d.watch("toolSet"),onToolSetChange:r=>d.setValue("toolSet",r,{shouldDirty:!0}),searchQuery:S}),u==="org"&&s.jsx(fs,{allowAllStaticPermissions:d.watch("allowAllStaticPermissions"),staticPermissions:d.watch("staticPermissions"),onAllowAllChange:r=>d.setValue("allowAllStaticPermissions",r,{shouldDirty:!0}),onPermissionsChange:r=>d.setValue("staticPermissions",r,{shouldDirty:!0}),readOnly:f,searchQuery:S}),u==="models"&&s.jsx(Ds,{allowAllModels:d.watch("allowAllModels"),modelSet:d.watch("modelSet"),onAllowAllChange:r=>d.setValue("allowAllModels",r,{shouldDirty:!0}),onModelSetChange:r=>d.setValue("modelSet",r,{shouldDirty:!0}),readOnly:f,searchQuery:S}),u==="members"&&s.jsx(ws,{memberIds:d.watch("memberIds"),onMemberIdsChange:r=>d.setValue("memberIds",r,{shouldDirty:!0}),readOnly:t.kind==="builtin"&&(t.role==="owner"||t.role==="user"),readOnlyMessage:t.kind==="builtin"&&t.role==="user"?o("settings.orgRoleDetail.userIsDefaultRoleMessage"):o("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),searchQuery:S,addMemberDialogOpen:D,onAddMemberDialogOpenChange:E})]})})]})})}function Fs(t){return t.kind==="builtin"?`builtin-${t.role}`:t.kind==="custom"?`custom-${t.role.id}`:"new"}function $s(t){const e=J.c(6),{area:l,children:n}=t,{isPrivileged:i,loading:o,error:c}=ts();let g;return e[0]!==l||e[1]!==n||e[2]!==c||e[3]!==i||e[4]!==o?(g=s.jsx(ss,{granted:i,loading:o,error:c,area:l,children:n}),e[0]=l,e[1]=n,e[2]=c,e[3]=i,e[4]=o,e[5]=g):g=e[5],g}const Qs=[{role:"owner",labelKey:"settings.roles.roleOwner"},{role:"admin",labelKey:"settings.roles.roleAdmin"},{role:"user",labelKey:"settings.roles.roleUser"}];function Hs(){const t=J.c(135),e=re(),[l,n]=$.useState(""),[i,o]=$.useState(null),c=vt();let g;t[0]===Symbol.for("react.memo_cache_sentinel")?(g={strict:!1},t[0]=g):g=t[0];const{role:h}=yt(g),{locator:m}=Be(),f=$e(),a=rt(),{customRoles:u,refetch:x}=Pt();let d;t[1]!==c?(d=j=>c({to:".",search:L=>({...L,role:j})}),t[1]=c,t[2]=d):d=t[2];const p=d;let A;e:{if(!h){A=null;break e}if(h==="new"){A={kind:"new"};break e}if(h.startsWith("builtin-")){A={kind:"builtin",role:h.slice(8)};break e}let j;t[3]!==h?(j=ee=>ee.id===h,t[3]=h,t[4]=j):j=t[4];const L=u.find(j);A=L?{kind:"custom",role:L}:null}const R=A;let I;t[5]!==m?(I=me.members(m),t[5]=m,t[6]=I):I=t[6];let b;t[7]!==f?(b=()=>f.organization.listMembers(),t[7]=f,t[8]=b):b=t[8];let N;t[9]!==I||t[10]!==b?(N={queryKey:I,queryFn:b},t[9]=I,t[10]=b,t[11]=N):N=t[11];const{data:M}=Ke(N);let S;t[12]!==M?.data?.members?(S=M?.data?.members??[],t[12]=M?.data?.members,t[13]=S):S=t[13];const O=S;let D;t[14]!==O?(D=j=>O.filter(L=>L.role===j).length,t[14]=O,t[15]=D):D=t[15];const E=D;let C;if(t[16]!==u||t[17]!==E||t[18]!==l||t[19]!==e){let j;t[21]!==E||t[22]!==e?(j=de=>({kind:"builtin",role:{...de,memberCount:E(de.role),label:e(de.labelKey)}}),t[21]=E,t[22]=e,t[23]=j):j=t[23];const L=Qs.map(j);let ee;t[24]!==E?(ee=de=>({kind:"custom",role:{...de,memberCount:E(de.role)}}),t[24]=E,t[25]=ee):ee=t[25];const At=u.map(ee);if(C=[...L,...At],l){const de=l.toLowerCase();C=C.filter(bt=>bt.role.label.toLowerCase().includes(de))}t[16]=u,t[17]=E,t[18]=l,t[19]=e,t[20]=C}else C=t[20];let v;t[26]!==f?(v=async j=>{const L=await f.organization.deleteRole({roleId:j});if(L?.error)throw new Error(L.error.message);return L?.data},t[26]=f,t[27]=v):v=t[27];const r=at({mutationFn:v,onSuccess:(j,L)=>{Fe("role_deleted",{role_id:L}),a.invalidateQueries({queryKey:me.members(m)}),a.invalidateQueries({queryKey:me.organizationRoles(m)}),Me.success(e("settings.roles.deletedSuccessfully")),x(),R?.kind==="custom"&&R.role.id===L&&p(void 0)},onError:Js});let _;t[28]!==e?(_=e("settings.roles.columnRole"),t[28]=e,t[29]=_):_=t[29];let k;t[30]!==_?(k={id:"role",header:_,render:Xs,cellClassName:"flex-1 min-w-0",sortable:!0},t[30]=_,t[31]=k):k=t[31];let w;t[32]!==e?(w=e("settings.roles.columnType"),t[32]=e,t[33]=w):w=t[33];let Y;t[34]!==e?(Y=j=>j.kind==="builtin"?s.jsx(De,{variant:"secondary",className:"text-xs",children:e("settings.roles.builtIn")}):s.jsx(De,{variant:"outline",className:"text-xs",children:e("settings.roles.custom")}),t[34]=e,t[35]=Y):Y=t[35];let y;t[36]!==w||t[37]!==Y?(y={id:"type",header:w,render:Y,cellClassName:"w-28 shrink-0"},t[36]=w,t[37]=Y,t[38]=y):y=t[38];let z;t[39]!==e?(z=e("settings.roles.columnPermissions"),t[39]=e,t[40]=z):z=t[40];let P;t[41]!==e?(P=j=>{if(j.kind==="builtin")return j.role.role==="owner"||j.role.role==="admin"?s.jsx("span",{className:"text-sm text-muted-foreground",children:e("settings.roles.fullAccess")}):s.jsx("span",{className:"text-sm text-muted-foreground",children:e("settings.roles.basicAccess")});const L=j.role,ee=[];return L.allowsAllStaticPermissions?ee.push(e("settings.roles.fullOrgAccess")):L.staticPermissionCount&&L.staticPermissionCount>0&&ee.push(e("settings.roles.orgPermsCount",{count:L.staticPermissionCount})),L.allowsAllConnections?ee.push(e("settings.roles.allConnections")):L.connectionCount&&L.connectionCount>0&&ee.push(e("settings.roles.connectionCount",{count:L.connectionCount})),s.jsx("span",{className:"text-sm text-muted-foreground truncate",children:ee.length>0?ee.join(", "):e("settings.roles.noPermissions")})},t[41]=e,t[42]=P):P=t[42];let K;t[43]!==z||t[44]!==P?(K={id:"permissions",header:z,render:P,cellClassName:"flex-1 min-w-0"},t[43]=z,t[44]=P,t[45]=K):K=t[45];let V;t[46]!==e?(V=e("settings.roles.columnMembers"),t[46]=e,t[47]=V):V=t[47];let U;t[48]!==V?(U={id:"members",header:V,render:Ws,cellClassName:"w-24 shrink-0"},t[48]=V,t[49]=U):U=t[49];let B;t[50]!==e?(B={id:"actions",header:"",render:j=>j.kind==="builtin"?null:s.jsxs(wt,{children:[s.jsx(Gt,{asChild:!0,children:s.jsx(ce,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:qs,children:s.jsx(Bt,{size:16})})}),s.jsx(kt,{align:"end",onClick:Zs,children:s.jsxs(Ut,{variant:"destructive",onClick:()=>{const L=j.role;L.id&&o({id:L.id,label:L.label})},children:[s.jsx(Vt,{size:16}),e("settings.roles.delete")]})})]}),cellClassName:"w-12 shrink-0"},t[50]=e,t[51]=B):B=t[51];let H;t[52]!==k||t[53]!==y||t[54]!==K||t[55]!==U||t[56]!==B?(H=[k,y,K,U,B],t[52]=k,t[53]=y,t[54]=K,t[55]=U,t[56]=B,t[57]=H):H=t[57];const X=H;let te;t[58]!==p?(te=j=>{if(j.kind==="builtin")p(`builtin-${j.role.role}`);else{const L=j.role;p(L.id)}},t[58]=p,t[59]=te):te=t[59];const le=te;if(R){let j;t[60]!==p?(j=()=>p(void 0),t[60]=p,t[61]=j):j=t[61];let L;return t[62]!==x||t[63]!==p?(L=()=>{x(),p(void 0)},t[62]=x,t[63]=p,t[64]=L):L=t[64],s.jsx(zs,{target:R,onBack:j,onSaved:L},Fs(R))}let F;t[65]!==e?(F=e("settings.roles.pageTitle"),t[65]=e,t[66]=F):F=t[66];let Z;t[67]!==F?(Z=s.jsx(ie.Title,{children:F}),t[67]=F,t[68]=Z):Z=t[68];let T;t[69]!==e?(T=e("settings.roles.searchPlaceholder"),t[69]=e,t[70]=T):T=t[70];let G;t[71]===Symbol.for("react.memo_cache_sentinel")?(G=j=>{j.key==="Escape"&&(n(""),j.target.blur())},t[71]=G):G=t[71];let Q;t[72]!==l||t[73]!==T?(Q=s.jsx(Qe,{value:l,onChange:n,placeholder:T,className:"w-full md:w-[375px]",onKeyDown:G}),t[72]=l,t[73]=T,t[74]=Q):Q=t[74];let q;t[75]!==p?(q=()=>p("new"),t[75]=p,t[76]=q):q=t[76];let ne;t[77]===Symbol.for("react.memo_cache_sentinel")?(ne=s.jsx(ze,{size:16}),t[77]=ne):ne=t[77];let se;t[78]!==e?(se=e("settings.roles.createRole"),t[78]=e,t[79]=se):se=t[79];let oe;t[80]!==q||t[81]!==se?(oe=s.jsxs(ce,{onClick:q,children:[ne,se]}),t[80]=q,t[81]=se,t[82]=oe):oe=t[82];let ue;t[83]!==Q||t[84]!==oe?(ue=s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[Q,oe]}),t[83]=Q,t[84]=oe,t[85]=ue):ue=t[85];let fe;t[86]!==l||t[87]!==e?(fe=l?s.jsx(tt,{title:e("settings.roles.noRolesFound"),description:e("settings.roles.noRolesMatchSearch",{search:l})}):s.jsx(tt,{title:e("settings.roles.noRoles"),description:e("settings.roles.createRoleGetStarted")}),t[86]=l,t[87]=e,t[88]=fe):fe=t[88];let ge;t[89]!==C||t[90]!==X||t[91]!==le||t[92]!==fe?(ge=s.jsx(Yt,{columns:X,data:C,isLoading:!1,onRowClick:le,emptyState:fe}),t[89]=C,t[90]=X,t[91]=le,t[92]=fe,t[93]=ge):ge=t[93];let he;t[94]!==Z||t[95]!==ue||t[96]!==ge?(he=s.jsx(ie.Content,{children:s.jsx(ie.Body,{children:s.jsxs("div",{className:"flex flex-col gap-6",children:[Z,ue,ge]})})}),t[94]=Z,t[95]=ue,t[96]=ge,t[97]=he):he=t[97];const Ve=i!==null;let Ge;t[98]===Symbol.for("react.memo_cache_sentinel")?(Ge=j=>!j&&o(null),t[98]=Ge):Ge=t[98];let xe;t[99]!==e?(xe=e("settings.roles.deleteRoleTitle"),t[99]=e,t[100]=xe):xe=t[100];let pe;t[101]!==xe?(pe=s.jsx(ft,{children:xe}),t[101]=xe,t[102]=pe):pe=t[102];const Ye=i?.label??"";let Te;t[103]!==e||t[104]!==Ye?(Te=e("settings.roles.deleteRoleConfirm",{role:Ye}),t[103]=e,t[104]=Ye,t[105]=Te):Te=t[105];let Ee;t[106]!==Te?(Ee=s.jsx(gt,{children:Te}),t[106]=Te,t[107]=Ee):Ee=t[107];let _e;t[108]!==pe||t[109]!==Ee?(_e=s.jsxs(ht,{children:[pe,Ee]}),t[108]=pe,t[109]=Ee,t[110]=_e):_e=t[110];let Ie;t[111]!==e?(Ie=e("settings.roles.cancel"),t[111]=e,t[112]=Ie):Ie=t[112];let Re;t[113]!==Ie?(Re=s.jsx(xt,{children:Ie}),t[113]=Ie,t[114]=Re):Re=t[114];let Se;t[115]!==r||t[116]!==i?(Se=()=>{i?.id&&r.mutate(i.id),o(null)},t[115]=r,t[116]=i,t[117]=Se):Se=t[117];let Ne;t[118]!==e?(Ne=e("settings.roles.delete"),t[118]=e,t[119]=Ne):Ne=t[119];let Ce;t[120]!==Se||t[121]!==Ne?(Ce=s.jsx(pt,{onClick:Se,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Ne}),t[120]=Se,t[121]=Ne,t[122]=Ce):Ce=t[122];let Ae;t[123]!==Re||t[124]!==Ce?(Ae=s.jsxs(Tt,{children:[Re,Ce]}),t[123]=Re,t[124]=Ce,t[125]=Ae):Ae=t[125];let be;t[126]!==_e||t[127]!==Ae?(be=s.jsxs(ut,{children:[_e,Ae]}),t[126]=_e,t[127]=Ae,t[128]=be):be=t[128];let Oe;t[129]!==Ve||t[130]!==be?(Oe=s.jsx(mt,{open:Ve,onOpenChange:Ge,children:be}),t[129]=Ve,t[130]=be,t[131]=Oe):Oe=t[131];let ke;return t[132]!==he||t[133]!==Oe?(ke=s.jsxs(ie,{children:[he,Oe]}),t[132]=he,t[133]=Oe,t[134]=ke):ke=t[134],ke}function Zs(t){return t.stopPropagation()}function qs(t){return t.stopPropagation()}function Ws(t){return s.jsx("span",{className:"text-sm text-foreground",children:t.role.memberCount})}function Xs(t){return s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:W("size-2.5 rounded-full shrink-0",dt(t.role.role,t.kind==="builtin"))}),s.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:t.role.label}),t.kind==="builtin"&&s.jsx(ct,{size:12,className:"text-muted-foreground shrink-0"})]})}function Js(t,e){Fe("role_delete_failed",{role_id:e,error:t instanceof Error?t.message:String(t)}),Me.error(t instanceof Error?t.message:"Failed to delete role")}function el(){const t=J.c(7),e=re();let l;t[0]!==e?(l=e("settings.roles.failedToLoad"),t[0]=e,t[1]=l):l=t[1];let n;t[2]!==l?(n=s.jsx(ie,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-sm text-muted-foreground",children:l})})}),t[2]=l,t[3]=n):n=t[3];let i;t[4]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx($.Suspense,{fallback:s.jsx(ie,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(je,{size:32,className:"animate-spin text-muted-foreground"})})}),children:s.jsx(Hs,{})}),t[4]=i):i=t[4];let o;return t[5]!==n?(o=s.jsx(Dt,{fallback:n,children:i}),t[5]=n,t[6]=o):o=t[6],o}function Po(){const t=J.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx($s,{area:"roles",children:s.jsx(el,{})}),t[0]=e):e=t[0],e}export{Po as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as b,m as w,j as a,k as j}from"./index-
|
|
1
|
+
import{c as b,m as w,j as a,k as j}from"./index-HpF4ydE2.js";import{i as k}from"./SearchMd-SbBW-oPu.js";function S(f){const e=b.c(17),{value:l,onChange:c,placeholder:g,onKeyDown:d,className:u,isSearching:m,disabled:i}=f,p=g===void 0?"Search...":g,x=i&&"pointer-events-none opacity-50";let t;e[0]!==u||e[1]!==x?(t=w("flex items-center gap-4 rounded-lg bg-background dark:bg-input/30 px-3 h-8 card-shadow","focus-within:border-ring focus-within:ring-ring/20 focus-within:ring-[2px]","transition-[color,box-shadow]",x,u),e[0]=u,e[1]=x,e[2]=t):t=e[2];let n;e[3]!==m?(n=m?a.jsx(j,{size:16,className:"animate-spin text-muted-foreground/75 shrink-0"}):a.jsx(k,{size:16,className:"text-muted-foreground/75 shrink-0"}),e[3]=m,e[4]=n):n=e[4];let s;e[5]!==c?(s=h=>c(h.target.value),e[5]=c,e[6]=s):s=e[6];let o;e[7]!==i||e[8]!==d||e[9]!==p||e[10]!==s||e[11]!==l?(o=a.jsx("input",{type:"text",value:l,onChange:s,onKeyDown:d,placeholder:p,disabled:i,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[7]=i,e[8]=d,e[9]=p,e[10]=s,e[11]=l,e[12]=o):o=e[12];let r;return e[13]!==t||e[14]!==n||e[15]!==o?(r=a.jsxs("label",{className:t,children:[n,o]}),e[13]=t,e[14]=n,e[15]=o,e[16]=r):r=e[16],r}export{S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as j,b as y,j as s,E as $,r as v,y as k,B as _,t as w}from"./index-BQFOspRh.js";import{i as F}from"./AlertCircle-BWppLd8c.js";import{s as E}from"./Plus-9KDBMlCX.js";import{s as B}from"./User01-DZLXXgFt.js";import{t as L}from"./Users01-D-f87RLp.js";import{e as O,d as R,a as A,b as I,h as q,c as V}from"./dialog-Cg0277WK.js";import{I as z}from"./input-DLmq-Bri.js";import{L as N}from"./label-B1DonsU-.js";import{S as H,a as G,b as J,c as K,d as D}from"./select-BoHatn08.js";import{S as M}from"./skeleton-DxXAcunF.js";import{T as Q}from"./textarea-DLfz9L-W.js";import{P as C}from"./index-BZrHlw0j.js";import{c as U}from"./settings-section-XmYJ6Nk2.js";import{u as W,a as X}from"./use-secrets-D6-WGKvN.js";import{R as Y}from"./require-capability-B3XvoArB.js";import"./X-DmV-M3--.js";import"./tooltip-CpPLj5ml.js";import"./Check-Dc66au0h.js";import"./ChevronDown-LNz16DWG.js";import"./ChevronUp-DZ-mKv_H.js";import"./sidebar-nvbJrgVY.js";import"./LayoutLeft-P7wDvRlA.js";import"./use-mobile-CnfmCPF3.js";import"./card-B-Mzv0lS.js";import"./ArrowUpRight-7JgIYGFf.js";import"./studio-tools-BETupmQh.js";import"./use-capability-CxUt0m8I.js";import"./access-gate-CcFlUK4A.js";import"./capability-load-error-CKW0147S.js";function Z(t){const e=j.c(6),{error:r}=t,i=y();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(F,{size:16}),e[0]=c):c=e[0];let n;e[1]!==r.message||e[2]!==i?(n=i("settings.secrets.failedToLoadError",{error:r.message}),e[1]=r.message,e[2]=i,e[3]=n):n=e[3];let l;return e[4]!==n?(l=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[c,s.jsx("span",{className:"text-sm font-medium",children:n})]}),e[4]=n,e[5]=l):l=e[5],l}function ee(t){const e=j.c(8),{scope:r}=t,i=y(),c=r==="user"?B:L;let n;e[0]!==r||e[1]!==i?(n=i(r==="user"?"settings.secrets.scopePrivate":"settings.secrets.scopeOrganization"),e[0]=r,e[1]=i,e[2]=n):n=e[2];const l=n;let o;e[3]!==c?(o=s.jsx(c,{size:12}),e[3]=c,e[4]=o):o=e[4];let a;return e[5]!==l||e[6]!==o?(a=s.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-muted text-muted-foreground text-xs",children:[o,l]}),e[5]=l,e[6]=o,e[7]=a):a=e[7],a}function T(t){const e=j.c(20),{secret:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:s.jsx(k,{size:16,className:"text-muted-foreground"})}),e[0]=i):i=e[0];let c;e[1]!==r.name?(c=s.jsx("span",{className:"font-medium text-sm truncate",children:r.name}),e[1]=r.name,e[2]=c):c=e[2];let n;e[3]!==r.scope?(n=s.jsx(ee,{scope:r.scope}),e[3]=r.scope,e[4]=n):n=e[4];let l;e[5]!==c||e[6]!==n?(l=s.jsxs("div",{className:"flex items-center gap-2",children:[c,n]}),e[5]=c,e[6]=n,e[7]=l):l=e[7];let o;e[8]!==r.description?(o=r.description?s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:r.description}):null,e[8]=r.description,e[9]=o):o=e[9];let a;e[10]!==l||e[11]!==o?(a=s.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[i,s.jsxs("div",{className:"min-w-0",children:[l,o]})]}),e[10]=l,e[11]=o,e[12]=a):a=e[12];let u;e[13]!==r.createdAt?(u=new Date(r.createdAt).toLocaleDateString(),e[13]=r.createdAt,e[14]=u):u=e[14];let d;e[15]!==u?(d=s.jsx("div",{className:"text-xs text-muted-foreground shrink-0",children:u}),e[15]=u,e[16]=d):d=e[16];let m;return e[17]!==a||e[18]!==d?(m=s.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[a,d]}),e[17]=a,e[18]=d,e[19]=m):m=e[19],m}function te(t){const e=j.c(21),{onCreate:r}=t,i=y();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:s.jsx(k,{size:20,className:"text-muted-foreground"})}),e[0]=c):c=e[0];let n;e[1]!==i?(n=i("settings.secrets.emptyTitle"),e[1]=i,e[2]=n):n=e[2];let l;e[3]!==n?(l=s.jsx("p",{className:"font-medium text-sm",children:n}),e[3]=n,e[4]=l):l=e[4];let o;e[5]!==i?(o=i("settings.secrets.emptyDescription"),e[5]=i,e[6]=o):o=e[6];let a;e[7]!==o?(a=s.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:o}),e[7]=o,e[8]=a):a=e[8];let u;e[9]!==l||e[10]!==a?(u=s.jsxs("div",{children:[l,a]}),e[9]=l,e[10]=a,e[11]=u):u=e[11];let d;e[12]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(E,{size:14}),e[12]=d):d=e[12];let m;e[13]!==i?(m=i("settings.secrets.newSecret"),e[13]=i,e[14]=m):m=e[14];let p;e[15]!==r||e[16]!==m?(p=s.jsxs(_,{onClick:r,size:"sm",className:"mt-2",children:[d,m]}),e[15]=r,e[16]=m,e[17]=p):p=e[17];let x;return e[18]!==u||e[19]!==p?(x=s.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[c,u,p]}),e[18]=u,e[19]=p,e[20]=x):x=e[20],x}function P({open:t,onOpenChange:e}){const r=y(),[i,c]=v.useState("organization"),[n,l]=v.useState(""),[o,a]=v.useState(""),[u,d]=v.useState(""),m=X();function p(){c("organization"),l(""),a(""),d("")}function x(){p(),e(!1)}async function g(f){if(f.preventDefault(),!(!n.trim()||!o))try{await m.mutateAsync({scope:i,name:n.trim(),value:o,description:u.trim()||void 0}),w.success(r("settings.secrets.secretCreated",{name:n.trim()})),x()}catch(h){w.error(h instanceof Error?h.message:r("settings.secrets.failedToCreateSecret"))}}return s.jsx(O,{open:t,onOpenChange:f=>{f?e(f):x()},children:s.jsxs(R,{className:"sm:max-w-lg",children:[s.jsxs(A,{children:[s.jsx(I,{children:r("settings.secrets.newSecretTitle")}),s.jsx(q,{children:r("settings.secrets.newSecretDescription")})]}),s.jsxs("form",{onSubmit:g,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(N,{htmlFor:"secret-scope",children:r("settings.secrets.scopeLabel")}),s.jsxs(H,{value:i,onValueChange:f=>c(f),children:[s.jsx(G,{id:"secret-scope",children:s.jsx(J,{})}),s.jsxs(K,{children:[s.jsx(D,{value:"organization",children:r("settings.secrets.scopeOrganizationDescription")}),s.jsx(D,{value:"user",children:r("settings.secrets.scopePrivateDescription")})]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(N,{htmlFor:"secret-name",children:r("settings.secrets.nameLabel")}),s.jsx(z,{id:"secret-name",value:n,onChange:f=>l(f.target.value),placeholder:r("settings.secrets.namePlaceholder"),autoComplete:"off",required:!0}),s.jsx("p",{className:"text-xs text-muted-foreground",children:r("settings.secrets.nameHelp")})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(N,{htmlFor:"secret-value",children:r("settings.secrets.valueLabel")}),s.jsx(z,{id:"secret-value",type:"password",value:o,onChange:f=>a(f.target.value),autoComplete:"new-password",required:!0})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(N,{htmlFor:"secret-description",children:r("settings.secrets.descriptionLabel")}),s.jsx(Q,{id:"secret-description",value:u,onChange:f=>d(f.target.value),rows:2,placeholder:r("settings.secrets.descriptionPlaceholder")})]}),s.jsxs(V,{children:[s.jsx(_,{type:"button",variant:"outline",onClick:x,disabled:m.isPending,children:r("settings.secrets.cancelButton")}),s.jsx(_,{type:"submit",disabled:m.isPending||!n.trim()||!o,children:m.isPending?r("settings.secrets.creatingButton"):r("settings.secrets.createButton")})]})]})]})})}function se(){const t=j.c(30),e=y(),r=W(),[i,c]=v.useState(!1);if(r.length===0){let d;t[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(te,{onCreate:()=>c(!0)}),t[0]=d):d=t[0];let m;return t[1]!==i?(m=s.jsxs(s.Fragment,{children:[d,s.jsx(P,{open:i,onOpenChange:c})]}),t[1]=i,t[2]=m):m=t[2],m}let n,l,o;if(t[3]!==r||t[4]!==e){const d=r.filter(ce),m=r.filter(ie),p=r.length===1?"settings.secrets.secretsCountSingular":"settings.secrets.secretsCountPlural";let x;t[8]!==r.length||t[9]!==e||t[10]!==p?(x=e(p,{count:r.length}),t[8]=r.length,t[9]=e,t[10]=p,t[11]=x):x=t[11];let g;t[12]!==x?(g=s.jsx("p",{className:"text-sm text-muted-foreground",children:x}),t[12]=x,t[13]=g):g=t[13];let f;t[14]===Symbol.for("react.memo_cache_sentinel")?(f=()=>c(!0),t[14]=f):f=t[14];let h;t[15]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(E,{size:14}),t[15]=h):h=t[15];let b;t[16]!==e?(b=e("settings.secrets.newSecret"),t[16]=e,t[17]=b):b=t[17];let S;t[18]!==b?(S=s.jsxs(_,{onClick:f,size:"sm",children:[h,b]}),t[18]=b,t[19]=S):S=t[19],t[20]!==g||t[21]!==S?(n=s.jsxs("div",{className:"flex items-center justify-between",children:[g,S]}),t[20]=g,t[21]=S,t[22]=n):n=t[22],l=d.length>0?s.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:e("settings.secrets.sectionOrganization")}),s.jsx("div",{children:d.map(ne)})]}):null,o=m.length>0?s.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:e("settings.secrets.sectionPrivate")}),s.jsx("div",{children:m.map(re)})]}):null,t[3]=r,t[4]=e,t[5]=n,t[6]=l,t[7]=o}else n=t[5],l=t[6],o=t[7];let a;t[23]!==i?(a=s.jsx(P,{open:i,onOpenChange:c}),t[23]=i,t[24]=a):a=t[24];let u;return t[25]!==n||t[26]!==l||t[27]!==o||t[28]!==a?(u=s.jsxs(s.Fragment,{children:[n,l,o,a]}),t[25]=n,t[26]=l,t[27]=o,t[28]=a,t[29]=u):u=t[29],u}function re(t){return s.jsx(T,{secret:t},t.id)}function ne(t){return s.jsx(T,{secret:t},t.id)}function ie(t){return t.scope==="user"}function ce(t){return t.scope==="organization"}function le(){const t=j.c(7),e=y();let r;t[0]!==e?(r=e("settings.nav.secrets"),t[0]=e,t[1]=r):r=t[1];let i;t[2]!==r?(i=s.jsx(C.Title,{children:r}),t[2]=r,t[3]=i):i=t[3];let c;t[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx($,{fallback:oe,children:s.jsx(v.Suspense,{fallback:s.jsx(M,{className:"h-32 w-full"}),children:s.jsx(se,{})})}),t[4]=c):c=t[4];let n;return t[5]!==i?(n=s.jsx(C,{children:s.jsx(C.Content,{children:s.jsx(C.Body,{children:s.jsxs(U,{children:[i,c]})})})}),t[5]=i,t[6]=n):n=t[6],n}function oe(t){const{error:e}=t;return s.jsx(Z,{error:e??new Error("Failed to load secrets")})}function Re(){const t=j.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Y,{capability:"secrets:manage",area:"secrets",children:s.jsx(le,{})}),t[0]=e):e=t[0],e}export{Re as default};
|
|
1
|
+
import{c as j,b as y,j as s,E as $,r as v,y as k,B as _,t as w}from"./index-HpF4ydE2.js";import{i as F}from"./AlertCircle-1FZS3v-O.js";import{s as E}from"./Plus-DJU_4kbx.js";import{s as B}from"./User01-DdCsns_p.js";import{t as L}from"./Users01-DddX3P2e.js";import{e as O,d as R,a as A,b as I,h as q,c as V}from"./dialog-CFILfZOA.js";import{I as z}from"./input-Dw4GelAn.js";import{L as N}from"./label-CJtuYe4Q.js";import{S as H,a as G,b as J,c as K,d as D}from"./select--icxBUQG.js";import{S as M}from"./skeleton-BzHO_UZ_.js";import{T as Q}from"./textarea-D_MBsxxq.js";import{P as C}from"./index--OjyTwFQ.js";import{c as U}from"./settings-section-B3ifPXpy.js";import{u as W,a as X}from"./use-secrets-BP-H3C8p.js";import{R as Y}from"./require-capability--L_GlXpd.js";import"./X-B3ybq5w2.js";import"./tooltip-ZrjhT2HZ.js";import"./Check-COUqEm5U.js";import"./ChevronDown-BQOZpawT.js";import"./ChevronUp-1zullNEp.js";import"./sidebar-CY8kI7Hv.js";import"./LayoutLeft-qMb6nkLN.js";import"./use-mobile-DMf3bWCn.js";import"./card-CoBKo1D2.js";import"./ArrowUpRight-CbCF70v1.js";import"./studio-tools-B9uOZhNU.js";import"./use-capability-CD2_oMAe.js";import"./access-gate-CM__cLeC.js";import"./capability-load-error-BL2lrddy.js";function Z(t){const e=j.c(6),{error:r}=t,i=y();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(F,{size:16}),e[0]=c):c=e[0];let n;e[1]!==r.message||e[2]!==i?(n=i("settings.secrets.failedToLoadError",{error:r.message}),e[1]=r.message,e[2]=i,e[3]=n):n=e[3];let l;return e[4]!==n?(l=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[c,s.jsx("span",{className:"text-sm font-medium",children:n})]}),e[4]=n,e[5]=l):l=e[5],l}function ee(t){const e=j.c(8),{scope:r}=t,i=y(),c=r==="user"?B:L;let n;e[0]!==r||e[1]!==i?(n=i(r==="user"?"settings.secrets.scopePrivate":"settings.secrets.scopeOrganization"),e[0]=r,e[1]=i,e[2]=n):n=e[2];const l=n;let o;e[3]!==c?(o=s.jsx(c,{size:12}),e[3]=c,e[4]=o):o=e[4];let a;return e[5]!==l||e[6]!==o?(a=s.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-muted text-muted-foreground text-xs",children:[o,l]}),e[5]=l,e[6]=o,e[7]=a):a=e[7],a}function T(t){const e=j.c(20),{secret:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:s.jsx(k,{size:16,className:"text-muted-foreground"})}),e[0]=i):i=e[0];let c;e[1]!==r.name?(c=s.jsx("span",{className:"font-medium text-sm truncate",children:r.name}),e[1]=r.name,e[2]=c):c=e[2];let n;e[3]!==r.scope?(n=s.jsx(ee,{scope:r.scope}),e[3]=r.scope,e[4]=n):n=e[4];let l;e[5]!==c||e[6]!==n?(l=s.jsxs("div",{className:"flex items-center gap-2",children:[c,n]}),e[5]=c,e[6]=n,e[7]=l):l=e[7];let o;e[8]!==r.description?(o=r.description?s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:r.description}):null,e[8]=r.description,e[9]=o):o=e[9];let a;e[10]!==l||e[11]!==o?(a=s.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[i,s.jsxs("div",{className:"min-w-0",children:[l,o]})]}),e[10]=l,e[11]=o,e[12]=a):a=e[12];let u;e[13]!==r.createdAt?(u=new Date(r.createdAt).toLocaleDateString(),e[13]=r.createdAt,e[14]=u):u=e[14];let d;e[15]!==u?(d=s.jsx("div",{className:"text-xs text-muted-foreground shrink-0",children:u}),e[15]=u,e[16]=d):d=e[16];let m;return e[17]!==a||e[18]!==d?(m=s.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[a,d]}),e[17]=a,e[18]=d,e[19]=m):m=e[19],m}function te(t){const e=j.c(21),{onCreate:r}=t,i=y();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:s.jsx(k,{size:20,className:"text-muted-foreground"})}),e[0]=c):c=e[0];let n;e[1]!==i?(n=i("settings.secrets.emptyTitle"),e[1]=i,e[2]=n):n=e[2];let l;e[3]!==n?(l=s.jsx("p",{className:"font-medium text-sm",children:n}),e[3]=n,e[4]=l):l=e[4];let o;e[5]!==i?(o=i("settings.secrets.emptyDescription"),e[5]=i,e[6]=o):o=e[6];let a;e[7]!==o?(a=s.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:o}),e[7]=o,e[8]=a):a=e[8];let u;e[9]!==l||e[10]!==a?(u=s.jsxs("div",{children:[l,a]}),e[9]=l,e[10]=a,e[11]=u):u=e[11];let d;e[12]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(E,{size:14}),e[12]=d):d=e[12];let m;e[13]!==i?(m=i("settings.secrets.newSecret"),e[13]=i,e[14]=m):m=e[14];let p;e[15]!==r||e[16]!==m?(p=s.jsxs(_,{onClick:r,size:"sm",className:"mt-2",children:[d,m]}),e[15]=r,e[16]=m,e[17]=p):p=e[17];let x;return e[18]!==u||e[19]!==p?(x=s.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[c,u,p]}),e[18]=u,e[19]=p,e[20]=x):x=e[20],x}function P({open:t,onOpenChange:e}){const r=y(),[i,c]=v.useState("organization"),[n,l]=v.useState(""),[o,a]=v.useState(""),[u,d]=v.useState(""),m=X();function p(){c("organization"),l(""),a(""),d("")}function x(){p(),e(!1)}async function g(f){if(f.preventDefault(),!(!n.trim()||!o))try{await m.mutateAsync({scope:i,name:n.trim(),value:o,description:u.trim()||void 0}),w.success(r("settings.secrets.secretCreated",{name:n.trim()})),x()}catch(h){w.error(h instanceof Error?h.message:r("settings.secrets.failedToCreateSecret"))}}return s.jsx(O,{open:t,onOpenChange:f=>{f?e(f):x()},children:s.jsxs(R,{className:"sm:max-w-lg",children:[s.jsxs(A,{children:[s.jsx(I,{children:r("settings.secrets.newSecretTitle")}),s.jsx(q,{children:r("settings.secrets.newSecretDescription")})]}),s.jsxs("form",{onSubmit:g,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(N,{htmlFor:"secret-scope",children:r("settings.secrets.scopeLabel")}),s.jsxs(H,{value:i,onValueChange:f=>c(f),children:[s.jsx(G,{id:"secret-scope",children:s.jsx(J,{})}),s.jsxs(K,{children:[s.jsx(D,{value:"organization",children:r("settings.secrets.scopeOrganizationDescription")}),s.jsx(D,{value:"user",children:r("settings.secrets.scopePrivateDescription")})]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(N,{htmlFor:"secret-name",children:r("settings.secrets.nameLabel")}),s.jsx(z,{id:"secret-name",value:n,onChange:f=>l(f.target.value),placeholder:r("settings.secrets.namePlaceholder"),autoComplete:"off",required:!0}),s.jsx("p",{className:"text-xs text-muted-foreground",children:r("settings.secrets.nameHelp")})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(N,{htmlFor:"secret-value",children:r("settings.secrets.valueLabel")}),s.jsx(z,{id:"secret-value",type:"password",value:o,onChange:f=>a(f.target.value),autoComplete:"new-password",required:!0})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(N,{htmlFor:"secret-description",children:r("settings.secrets.descriptionLabel")}),s.jsx(Q,{id:"secret-description",value:u,onChange:f=>d(f.target.value),rows:2,placeholder:r("settings.secrets.descriptionPlaceholder")})]}),s.jsxs(V,{children:[s.jsx(_,{type:"button",variant:"outline",onClick:x,disabled:m.isPending,children:r("settings.secrets.cancelButton")}),s.jsx(_,{type:"submit",disabled:m.isPending||!n.trim()||!o,children:m.isPending?r("settings.secrets.creatingButton"):r("settings.secrets.createButton")})]})]})]})})}function se(){const t=j.c(30),e=y(),r=W(),[i,c]=v.useState(!1);if(r.length===0){let d;t[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(te,{onCreate:()=>c(!0)}),t[0]=d):d=t[0];let m;return t[1]!==i?(m=s.jsxs(s.Fragment,{children:[d,s.jsx(P,{open:i,onOpenChange:c})]}),t[1]=i,t[2]=m):m=t[2],m}let n,l,o;if(t[3]!==r||t[4]!==e){const d=r.filter(ce),m=r.filter(ie),p=r.length===1?"settings.secrets.secretsCountSingular":"settings.secrets.secretsCountPlural";let x;t[8]!==r.length||t[9]!==e||t[10]!==p?(x=e(p,{count:r.length}),t[8]=r.length,t[9]=e,t[10]=p,t[11]=x):x=t[11];let g;t[12]!==x?(g=s.jsx("p",{className:"text-sm text-muted-foreground",children:x}),t[12]=x,t[13]=g):g=t[13];let f;t[14]===Symbol.for("react.memo_cache_sentinel")?(f=()=>c(!0),t[14]=f):f=t[14];let h;t[15]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(E,{size:14}),t[15]=h):h=t[15];let b;t[16]!==e?(b=e("settings.secrets.newSecret"),t[16]=e,t[17]=b):b=t[17];let S;t[18]!==b?(S=s.jsxs(_,{onClick:f,size:"sm",children:[h,b]}),t[18]=b,t[19]=S):S=t[19],t[20]!==g||t[21]!==S?(n=s.jsxs("div",{className:"flex items-center justify-between",children:[g,S]}),t[20]=g,t[21]=S,t[22]=n):n=t[22],l=d.length>0?s.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:e("settings.secrets.sectionOrganization")}),s.jsx("div",{children:d.map(ne)})]}):null,o=m.length>0?s.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:e("settings.secrets.sectionPrivate")}),s.jsx("div",{children:m.map(re)})]}):null,t[3]=r,t[4]=e,t[5]=n,t[6]=l,t[7]=o}else n=t[5],l=t[6],o=t[7];let a;t[23]!==i?(a=s.jsx(P,{open:i,onOpenChange:c}),t[23]=i,t[24]=a):a=t[24];let u;return t[25]!==n||t[26]!==l||t[27]!==o||t[28]!==a?(u=s.jsxs(s.Fragment,{children:[n,l,o,a]}),t[25]=n,t[26]=l,t[27]=o,t[28]=a,t[29]=u):u=t[29],u}function re(t){return s.jsx(T,{secret:t},t.id)}function ne(t){return s.jsx(T,{secret:t},t.id)}function ie(t){return t.scope==="user"}function ce(t){return t.scope==="organization"}function le(){const t=j.c(7),e=y();let r;t[0]!==e?(r=e("settings.nav.secrets"),t[0]=e,t[1]=r):r=t[1];let i;t[2]!==r?(i=s.jsx(C.Title,{children:r}),t[2]=r,t[3]=i):i=t[3];let c;t[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx($,{fallback:oe,children:s.jsx(v.Suspense,{fallback:s.jsx(M,{className:"h-32 w-full"}),children:s.jsx(se,{})})}),t[4]=c):c=t[4];let n;return t[5]!==i?(n=s.jsx(C,{children:s.jsx(C.Content,{children:s.jsx(C.Body,{children:s.jsxs(U,{children:[i,c]})})})}),t[5]=i,t[6]=n):n=t[6],n}function oe(t){const{error:e}=t;return s.jsx(Z,{error:e??new Error("Failed to load secrets")})}function Re(){const t=j.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Y,{capability:"secrets:manage",area:"secrets",children:s.jsx(le,{})}),t[0]=e):e=t[0],e}export{Re as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as Ge,b as ct,r as w,m as $e,j as n,ae as Xn,B as Xe,k as Zn,o as Ca,t as Q,K as Ma}from"./index-BQFOspRh.js";import{ap as Ba,aq as Ka,ar as La,a4 as es,a5 as Qt,as as ts,at as ns,a6 as ss,a7 as as,au as os,av as Fa,ae as rs,af as is,aw as Ia,ax as Oa,ay as ls,O as $a,a8 as cs,a9 as Mt,ac as us,ad as ds,aa as ms,ak as fs,az as za,aA as Bt,aB as ps,aC as Ha,S as gs,aD as lt,G as hs,aE as Ua,aF as qa,aG as Ga,aH as Wa,D as Ya,F as Ja,aI as Qa,aJ as Xa,aK as Za,aL as eo,ai as qt,aM as Gt,aN as to,aO as St,aP as Pt,aQ as no,aR as so,aS as tt,aT as Kn,aU as ao,aV as At,aW as Wt,aX as oo,aY as mn,aZ as ro,a_ as kt,a$ as io,b0 as lo,b1 as co,b2 as uo,b3 as mo,b4 as xt,b5 as fo,b6 as po,b7 as go,I as ho,b8 as Ln,b9 as Ct,ba as Fn,bb as In,bc as vo,bd as bo,be as So,bf as xo,bg as fn,bh as On,bi as $n,bj as Tt,bk as Yt,bl as zn,bm as yo,bn as pn,bo as _o,bp as jo,bq as Eo,br as Ro,bs as wo}from"./index-BfE9EYhg.js";import{t as ko}from"./ChevronDown-LNz16DWG.js";import{ad as hn,v as To,T as vs,E as No,u as bs,af as Vo,_ as Do}from"./agent-icon-DrJqDdNd.js";import{i as Ss}from"./ChevronRight-DjBVHQoY.js";import{n as Po}from"./ChevronUp-DZ-mKv_H.js";import{i as Ao}from"./Globe01-W4lyjKuH.js";import{B as Jt}from"./automation-runs-DkpIo76-.js";import{c as yt,T as _t,a as jt}from"./tooltip-CpPLj5ml.js";import{b as Co,h as Mo,a as Bo,c as Ko,d as Lo,e as Fo}from"./dialog-Cg0277WK.js";import{I as Io}from"./input-DLmq-Bri.js";import{a as xs}from"./Copy01-DPPY_ooc.js";import{i as Oo}from"./Settings02-D_by58BO.js";import{s as $o}from"./Eye-BT74JrOy.js";import{s as ys}from"./TrendUp01-BQPOQTfU.js";import{s as vn}from"./Plus-9KDBMlCX.js";import{s as _s}from"./Trash01-Dk2U_er_.js";import{i as zo}from"./Zap-BxOODR1h.js";import{D as js,a as vt,c as Es,b as Rs,i as Ho}from"./dropdown-menu-DPde1UkW.js";import{S as Uo,r as Hn,u as qo,d as Go,a as Wo,i as Yo,f as Jo,P as Qo,b as Xo}from"./page-seo-form-M3-RVvpj.js";import{c as Zo}from"./Tool01-BsXkza2k.js";import{u as er,A as tr}from"./use-section-preview-base-DcK97OvO.js";import"./ArrowUp-CK7po7JD.js";import"./chat-context-B91LcyJ6.js";import"./tab-id-BdQ_M6R3.js";import"./Check-Dc66au0h.js";import"./hooks-DE78iZyB.js";import"./use-mcp-client-B9fn1TBn.js";import"./auth-B56MWIKT.js";import"./decopilot-sse-pool-DjQPpjDZ.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-C7NRfPhc.js";import"./use-ai-providers-DFLh4od7.js";import"./studio-tools-BETupmQh.js";import"./use-decopilot-events-CfIikgvk.js";import"./use-organization-settings-BN4kKknX.js";import"./spinner-BoBi9JH7.js";import"./drawer-Dfn3cqSh.js";import"./collection-search-yhxjYY4J.js";import"./SearchMd-CDwUuDyr.js";import"./use-mobile-CnfmCPF3.js";import"./AreaChart-CMqdqW-X.js";import"./index-X6wqL5Rn.js";import"./X-DmV-M3--.js";import"./shell-layout-Cd3V9av7.js";import"./avatar-BN3TMI7O.js";import"./User01-DZLXXgFt.js";import"./Users03-CmtC3U6j.js";import"./SearchLg-BSg_Ve-L.js";import"./Stars02-D6uxt7rn.js";import"./XClose-8V-NoWeD.js";import"./CheckCircle-UOyFv4rE.js";import"./CpuChip01-DyWba75a.js";import"./FilterLines-DcRWfBwT.js";import"./Monitor01-D9pvMYQd.js";import"./required-auth-layout-D4xEI9J8.js";import"./use-org-sso-TyWjgGeP.js";import"./ZapSquare-BesqE3Kv.js";import"./Star01-YV_bqOAU.js";import"./Upload01-De1aQPW9.js";import"./AlertCircle-BWppLd8c.js";import"./form-PWBx8QQq.js";import"./label-B1DonsU-.js";import"./select-BoHatn08.js";import"./ArrowLeft-cFWJcCye.js";import"./XCircle-Cj1jhbDm.js";import"./tabs-bgoBmYh1.js";import"./Tool02-Bk0Wi_jc.js";import"./toggle-group-DVALkDJ2.js";import"./use-deco-credits-CGRraY5U.js";import"./sidebar-nvbJrgVY.js";import"./LayoutLeft-P7wDvRlA.js";import"./popover-BYTopHKb.js";import"./alert-dialog-Bpd-0p4I.js";import"./toolbar-BseEnCPh.js";import"./skeleton-DxXAcunF.js";import"./github-repo-picker-x1X872QG.js";import"./use-debounced-value-usyjdfzM.js";import"./use-connection-B7w0W3ts.js";import"./authenticate-and-persist-oauth-DgNMLRjT.js";import"./mcp-oauth-0Wpz4XYZ.js";import"./LinkExternal01-CP1N0ekO.js";import"./Share07-DFtUk4DH.js";import"./use-mcp-tools-Cry83Gza.js";import"./extract-connection-data-BudtEuf9.js";import"./metadata-dUsYcpuu.js";import"./use-navigate-to-agent-BKt6uZhU.js";import"./reusable-new-chat-CouMjkYR.js";import"./provision-repo-scoped-github-connection-ufuvpGD9.js";import"./agent-capabilities-cXfbMfjV.js";import"./connection-card-m4tgOItf.js";import"./use-registry-connections-VTJBa0En.js";import"./useInfiniteQuery-C-kiHDyf.js";import"./use-infinite-scroll-Bct8OYtv.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./card-B-Mzv0lS.js";import"./integration-icon-FPSluFwK.js";import"./textarea-DLfz9L-W.js";import"./connection-form-helpers-BkrR5b_e.js";import"./collection-tabs-SNVmmaXX.js";import"./badge-CXZR0JJ6.js";import"./useSuspenseInfiniteQuery-9epNuRWF.js";import"./use-open-billing-url-DJ4izovt.js";import"./select-model-CaoH2ToV.js";import"./checkbox-DU-r9RK1.js";import"./Key01-Bk2QhvNY.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-XmYJ6Nk2.js";import"./ArrowUpRight-7JgIYGFf.js";import"./Stars01-CyMHMvzU.js";import"./cards-BfTjTHpY.js";import"./DotsVertical-CILzGe_q.js";import"./Palette-DJfFKmjP.js";import"./file-type-icon-DjpfQdvY.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-CzyM6HAc.js";import"./empty-state-BvR4kC3B.js";import"./deco-site-production-url-CaKZ7xBn.js";import"./use-capability-CxUt0m8I.js";import"./monaco-editor-CrpwfOtU.js";import"./pt-BR-CLy76QW2.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./switch-D5nHMM9-.js";import"./Play-DrC9uZbx.js";import"./use-debounced-autosave-BMFBm4Py.js";import"./index-BZrHlw0j.js";import"./search-input-C9pC3WrF.js";import"./index-BfpQCjmG.js";import"./Users01-D-f87RLp.js";import"./use-secrets-D6-WGKvN.js";import"./self-tool-result-m7izFHM4.js";import"./format-time-BnbuEtat.js";import"./use-members-HbYBEeJu.js";import"./use-org-auth-client-DDDMIikQ.js";import"./use-copy-C6oZHBaC.js";import"./SwitchHorizontal01-BJcUWOrf.js";import"./use-tags-BS8JieCa.js";import"./get-initials-D-f_fDFw.js";import"./command-Cz9Vx3RB.js";import"./index-SRgwcnf7.js";import"./use-file-configs-Bp6CR8ct.js";import"./use-automations-xk7Cu5D8.js";import"./automation-list-row-CF0CYhrz.js";import"./CreditCard01-e79FUmFN.js";import"./Globe04-_uS8YiyQ.js";import"./HardDrive-D7RLSuvq.js";import"./LogOut01-BNm98lqM.js";import"./Sun-CvD6V1mt.js";import"./Shield01-2VpHyEx6.js";import"./table-DHyF1BO5.js";import"./use-clock-tick--4azGxeb.js";function nr(g){return g.schema?.definitions??g.schema?.$defs??{}}function sr(g,e){const r=nr(e),d=r[btoa(g)];if(!d)return;let p=typeof d.image=="string"?d.image:void 0;if(!p&&Array.isArray(d.allOf)){const b=d.allOf.find(S=>typeof S.$ref=="string")?.$ref;if(typeof b=="string"){const S=b.replace("#/definitions/",""),m=r[S];p=typeof m?.image=="string"?m.image:void 0}}if(p?.includes("{{{"))return p}function ar(g,e){if(!e)return;const r=Ba(g);if(!r)return;const d=sr(r.resolveType,e);if(!d)return;const p=Ka(d,r.data);if(p)return La(p)}const or="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",rr="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 Un(g){return Array.from({length:g},(e,r)=>({id:crypto.randomUUID(),index:r}))}function ws(g){return g.map((e,r)=>({...e,index:r}))}function ir(g,e){if(e===g.length)return g;if(e<g.length)return ws(g.slice(0,e));const r=Array.from({length:e-g.length},(d,p)=>({id:crypto.randomUUID(),index:g.length+p}));return[...g,...r]}function ks(g){const e=Ge.c(20),{section:r,raw:d,meta:p}=g,b=r.isSavedBlock===!0,S=r.isMultivariate===!0;let m;e[0]!==p||e[1]!==d?(m=d&&p?ar(d,p):void 0,e[0]=p,e[1]=d,e[2]=m):m=e[2];const x=m;let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(To,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[3]=u):u=e[3];let y;e[4]!==x?(y=x&&n.jsx("img",{src:x,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[4]=x,e[5]=y):y=e[5];let T;e[6]!==S||e[7]!==b?(T=b?{color:$a}:S?{color:"oklch(0.65 0.15 160)"}:void 0,e[6]=S,e[7]=b,e[8]=T):T=e[8];let V;e[9]!==T?(V=n.jsx(hn,{className:"h-4 w-4 shrink-0",style:T}),e[9]=T,e[10]=V):V=e[10];const E=r.isHidden&&"line-through opacity-50";let i;e[11]!==E?(i=$e("min-w-0 flex-1 truncate text-sm font-medium",E),e[11]=E,e[12]=i):i=e[12];let h;e[13]!==r.label||e[14]!==i?(h=n.jsx("span",{className:i,children:r.label}),e[13]=r.label,e[14]=i,e[15]=h):h=e[15];let o;return e[16]!==y||e[17]!==V||e[18]!==h?(o=n.jsxs(n.Fragment,{children:[u,y,V,h]}),e[16]=y,e[17]=V,e[18]=h,e[19]=o):o=e[19],o}const lr="w-7 ml-0 opacity-100 [transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]",cr="w-0 -ml-2 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:ml-0 group-hover:w-7 group-hover:opacity-100 group-hover:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms] group-has-[:focus-visible]:ml-0 group-has-[:focus-visible]:w-7 group-has-[:focus-visible]:opacity-100 group-has-[:focus-visible]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]",ur="w-7 ml-0 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:opacity-100 group-has-[:focus-visible]:opacity-100";function gn(g,e){return $e("h-7 shrink-0 overflow-hidden",e?lr:g?ur:cr)}function Ts(g,e){const r=g.isSavedBlock===!0,d=g.isMultivariate===!0;return $e("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":r?or:d?ls:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function dr(g){const e=Ge.c(82),{section:r,raw:d,meta:p,sortableId:b,selected:S,onSelect:m,onDelete:x,onDuplicate:u,onMakeReusable:y,onToggleHidden:T,onToggleLazy:V,onAddVariant:E,onDetach:i}=g,h=ct(),o=d?os(d.__resolveType??""):!1,P=r.isHidden===!0,l=o||P;let R;e[0]!==r?(R=Fa(r),e[0]=r,e[1]=R):R=e[1];const K=R;let O;e[2]!==b?(O={id:b,animateLayoutChanges:hr},e[2]=b,e[3]=O):O=e[3];const{attributes:H,listeners:f,setNodeRef:A,transform:De,isDragging:C}=rs(O);let ce;e[4]!==De?(ce=is.Transform.toString(De?{...De,x:0}:null),e[4]=De,e[5]=ce):ce=e[5];const B=C?0:void 0;let ne;e[6]!==ce||e[7]!==B?(ne={transform:ce,opacity:B},e[6]=ce,e[7]=B,e[8]=ne):ne=e[8];const F=ne;let ie;e[9]!==r?(ie=Ia(r),e[9]=r,e[10]=ie):ie=e[10];const le=ie,ye="button",X=0;let Z;e[11]!==m?(Z=N=>{(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),m())},e[11]=m,e[12]=Z):Z=e[12];const ge=C?"cursor-grabbing":"cursor-pointer";let se;e[13]!==r||e[14]!==S||e[15]!==ge?(se=$e("touch-none transition-colors",ge,Ts(r,S)),e[13]=r,e[14]=S,e[15]=ge,e[16]=se):se=e[16];let L;e[17]!==p||e[18]!==d||e[19]!==r?(L=n.jsx(ks,{section:r,raw:d,meta:p}),e[17]=p,e[18]=d,e[19]=r,e[20]=L):L=e[20];const ze=!r.isMultivariate&&n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Xe,{type:"button",variant:"ghost",size:"icon","aria-label":h(o?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:$e(gn(l,o)),onClick:N=>{N.stopPropagation(),V()},onPointerDown:gr,children:n.jsx(zo,{className:$e("h-3.5 w-3.5",o&&"text-yellow-500")})})}),n.jsx(jt,{side:"bottom",children:h(o?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),nt=!r.isMultivariate&&n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Xe,{type:"button",variant:"ghost",size:"icon","aria-label":h(P?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),className:$e(gn(l,P)),onClick:N=>{N.stopPropagation(),T()},onPointerDown:pr,children:P?n.jsx(Oo,{className:"h-3.5 w-3.5"}):n.jsx($o,{className:"h-3.5 w-3.5"})})}),n.jsx(jt,{side:"bottom",children:h(P?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection")})]}),Le=Es,Me=js,Y=!0,ee=Xe,Fe="button",Pe="ghost",_e="icon";let ue;e[21]!==h?(ue=h("sectionsEditor.sectionList.sectionActionsMenu"),e[21]=h,e[22]=ue):ue=e[22];const he=$e(gn(l,!1),"data-[state=open]:ml-0 data-[state=open]:w-7 data-[state=open]:opacity-100 data-[state=open]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]");let je;e[23]===Symbol.for("react.memo_cache_sentinel")?(je=n.jsx(vs,{className:"h-3.5 w-3.5"}),e[23]=je):je=e[23];let ke;e[24]!==ee||e[25]!==ue||e[26]!==he?(ke=n.jsx(ee,{type:Fe,variant:Pe,size:_e,"aria-label":ue,className:he,onClick:fr,onPointerDown:mr,children:je}),e[24]=ee,e[25]=ue,e[26]=he,e[27]=ke):ke=e[27];let ve;e[28]!==Me||e[29]!==ke?(ve=n.jsx(Me,{asChild:Y,children:ke}),e[28]=Me,e[29]=ke,e[30]=ve):ve=e[30];let ae;e[31]!==u?(ae=N=>{N.stopPropagation(),u()},e[31]=u,e[32]=ae):ae=e[32];let Ae;e[33]===Symbol.for("react.memo_cache_sentinel")?(Ae=n.jsx(xs,{className:"h-4 w-4"}),e[33]=Ae):Ae=e[33];let Ee;e[34]!==h?(Ee=h("sectionsEditor.sectionList.duplicateMenuItem"),e[34]=h,e[35]=Ee):Ee=e[35];let fe;e[36]!==ae||e[37]!==Ee?(fe=n.jsxs(vt,{onClick:ae,children:[Ae,Ee]}),e[36]=ae,e[37]=Ee,e[38]=fe):fe=e[38];let $;e[39]!==K||e[40]!==E||e[41]!==h?($=K&&n.jsxs(vt,{className:Oa,onClick:N=>{N.stopPropagation(),E()},children:[n.jsx(ys,{className:"h-4 w-4"}),h("sectionsEditor.sectionList.addVariantMenuItem")]}),e[39]=K,e[40]=E,e[41]=h,e[42]=$):$=e[42];let pe;e[43]!==le||e[44]!==y||e[45]!==h?(pe=le&&n.jsxs(vt,{className:rr,onClick:N=>{N.stopPropagation(),y()},children:[n.jsx(hn,{className:"h-4 w-4"}),h("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[43]=le,e[44]=y,e[45]=h,e[46]=pe):pe=e[46];let Ce;e[47]!==i||e[48]!==r.isMultivariate||e[49]!==r.isSavedBlock||e[50]!==h?(Ce=r.isSavedBlock===!0&&!r.isMultivariate&&n.jsxs(vt,{onClick:N=>{N.stopPropagation(),i()},children:[n.jsx(hn,{className:"h-4 w-4"}),h("sectionsEditor.sectionList.detachMenuItem")]}),e[47]=i,e[48]=r.isMultivariate,e[49]=r.isSavedBlock,e[50]=h,e[51]=Ce):Ce=e[51];let be;e[52]!==x?(be=N=>{N.stopPropagation(),x()},e[52]=x,e[53]=be):be=e[53];let Se;e[54]===Symbol.for("react.memo_cache_sentinel")?(Se=n.jsx(_s,{className:"h-4 w-4"}),e[54]=Se):Se=e[54];let q;e[55]!==h?(q=h("sectionsEditor.sectionList.deleteMenuItem"),e[55]=h,e[56]=q):q=e[56];let oe;e[57]!==be||e[58]!==q?(oe=n.jsxs(vt,{className:"text-destructive focus:text-destructive",onClick:be,children:[Se,q]}),e[57]=be,e[58]=q,e[59]=oe):oe=e[59];let de;e[60]!==fe||e[61]!==$||e[62]!==pe||e[63]!==Ce||e[64]!==oe?(de=n.jsxs(Rs,{align:"end",className:"w-44",children:[fe,$,pe,Ce,oe]}),e[60]=fe,e[61]=$,e[62]=pe,e[63]=Ce,e[64]=oe,e[65]=de):de=e[65];let Re;e[66]!==Le||e[67]!==ve||e[68]!==de?(Re=n.jsxs(Le,{children:[ve,de]}),e[66]=Le,e[67]=ve,e[68]=de,e[69]=Re):Re=e[69];let me;return e[70]!==H||e[71]!==f||e[72]!==m||e[73]!==A||e[74]!==F||e[75]!==se||e[76]!==L||e[77]!==ze||e[78]!==nt||e[79]!==Re||e[80]!==Z?(me=n.jsxs("div",{ref:A,style:F,...H,...f,role:ye,tabIndex:X,onClick:m,onKeyDown:Z,className:se,children:[L,ze,nt,Re]}),e[70]=H,e[71]=f,e[72]=m,e[73]=A,e[74]=F,e[75]=se,e[76]=L,e[77]=ze,e[78]=nt,e[79]=Re,e[80]=Z,e[81]=me):me=e[81],me}function mr(g){return g.stopPropagation()}function fr(g){return g.stopPropagation()}function pr(g){return g.stopPropagation()}function gr(g){return g.stopPropagation()}function hr(){return!1}function vr(g){const e=Ge.c(104),{listKey:r,rawSections:d,sections:p,meta:b,selectedIndex:S,onSelect:m,onReorder:x,onDelete:u,onDuplicate:y,onMakeReusable:T,onToggleHidden:V,onToggleLazy:E,onAddVariant:i,onDetach:h,onAddSection:o,canAddSection:P}=g,l=P===void 0?!0:P,R=ct();let K;e[0]!==p.length?(K=()=>Un(p.length),e[0]=p.length,e[1]=K):K=e[1];const[O,H]=w.useState(K),[f,A]=w.useState(null),[De,C]=w.useState(r),[ce,B]=w.useState(p.length),ne=w.useRef(!1);De!==r?(C(r),B(p.length),H(Un(p.length))):ce!==p.length&&(B(p.length),H(me=>ir(me,p.length)));let F;e[2]===Symbol.for("react.memo_cache_sentinel")?(F={activationConstraint:{distance:8}},e[2]=F):F=e[2];let ie;e[3]===Symbol.for("react.memo_cache_sentinel")?(ie={coordinateGetter:cs},e[3]=ie):ie=e[3];const le=es(Qt(as,F),Qt(ss,ie));let ye;e[4]!==O?(ye=O.map(br),e[4]=O,e[5]=ye):ye=e[5];const X=ye;let Z;e[6]===Symbol.for("react.memo_cache_sentinel")?(Z=me=>{A(String(me.active.id))},e[6]=Z):Z=e[6];const ge=Z;let se;e[7]!==X||e[8]!==x?(se=me=>{A(null);const{active:N,over:re}=me;if(!re||N.id===re.id)return;const I=X.indexOf(String(N.id)),Be=X.indexOf(String(re.id));I===-1||Be===-1||(H(ut=>ws(Mt([...ut],I,Be))),ne.current=!0,requestAnimationFrame(()=>{ne.current=!1}),x?.(I,Be))},e[7]=X,e[8]=x,e[9]=se):se=e[9];const L=se;let ze;e[10]===Symbol.for("react.memo_cache_sentinel")?(ze=()=>{A(null)},e[10]=ze):ze=e[10];const nt=ze;let Le,Me,Y,ee,Fe,Pe,_e,ue,he,je,ke,ve,ae,Ae,Ee;if(e[11]!==f||e[12]!==l||e[13]!==O||e[14]!==X||e[15]!==L||e[16]!==b||e[17]!==o||e[18]!==i||e[19]!==u||e[20]!==h||e[21]!==y||e[22]!==T||e[23]!==m||e[24]!==V||e[25]!==E||e[26]!==d||e[27]!==p||e[28]!==S||e[29]!==le||e[30]!==R){Ae=Symbol.for("react.early_return_sentinel");e:{const me=N=>{ne.current||m(N)};if(e[46]!==f||e[47]!==l||e[48]!==O||e[49]!==o||e[50]!==d||e[51]!==p||e[52]!==R){const N=f?O.find(re=>re.id===f):null;if(ee=N!=null?p[N.index]:null,Y=N!=null?d[N.index]:void 0,O.length===0){let re;e[56]!==R?(re=R("sectionsEditor.sectionList.noSections"),e[56]=R,e[57]=re):re=e[57];let I;e[58]!==re?(I=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:re}),e[58]=re,e[59]=I):I=e[59];const Be=!l;let ut;e[60]===Symbol.for("react.memo_cache_sentinel")?(ut=n.jsx(vn,{size:14}),e[60]=ut):ut=e[60];let Te;e[61]!==R?(Te=R("sectionsEditor.sectionList.addSectionButton"),e[61]=R,e[62]=Te):Te=e[62];let We;e[63]!==o||e[64]!==Be||e[65]!==Te?(We=n.jsxs(Xe,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:Be,onClick:o,children:[ut,Te]}),e[63]=o,e[64]=Be,e[65]=Te,e[66]=We):We=e[66];let Ie;e[67]!==I||e[68]!==We?(Ie=n.jsxs("div",{className:"space-y-2",children:[I,We]}),e[67]=I,e[68]=We,e[69]=Ie):Ie=e[69],Ae=Ie;break e}ae=$e(N&&"cursor-grabbing"),e[46]=f,e[47]=l,e[48]=O,e[49]=o,e[50]=d,e[51]=p,e[52]=R,e[53]=Y,e[54]=ee,e[55]=ae}else Y=e[53],ee=e[54],ae=e[55];Me=us,ue=le,he=ds,je=ge,ke=L,ve=nt,Le=ms,Pe=X,_e=fs,Ee="space-y-1",Fe=O.map(N=>{const re=p[N.index];return re?n.jsx(dr,{sortableId:N.id,section:re,raw:d[N.index],meta:b,selected:S===N.index,onSelect:()=>me(N.index),onDelete:()=>u(N.index),onDuplicate:()=>y(N.index),onMakeReusable:()=>T(N.index),onToggleHidden:()=>V(N.index),onToggleLazy:()=>E(N.index),onAddVariant:()=>i(N.index),onDetach:()=>h(N.index)},N.id):null})}e[11]=f,e[12]=l,e[13]=O,e[14]=X,e[15]=L,e[16]=b,e[17]=o,e[18]=i,e[19]=u,e[20]=h,e[21]=y,e[22]=T,e[23]=m,e[24]=V,e[25]=E,e[26]=d,e[27]=p,e[28]=S,e[29]=le,e[30]=R,e[31]=Le,e[32]=Me,e[33]=Y,e[34]=ee,e[35]=Fe,e[36]=Pe,e[37]=_e,e[38]=ue,e[39]=he,e[40]=je,e[41]=ke,e[42]=ve,e[43]=ae,e[44]=Ae,e[45]=Ee}else Le=e[31],Me=e[32],Y=e[33],ee=e[34],Fe=e[35],Pe=e[36],_e=e[37],ue=e[38],he=e[39],je=e[40],ke=e[41],ve=e[42],ae=e[43],Ae=e[44],Ee=e[45];if(Ae!==Symbol.for("react.early_return_sentinel"))return Ae;let fe;e[70]!==Fe||e[71]!==Ee?(fe=n.jsx("div",{className:Ee,children:Fe}),e[70]=Fe,e[71]=Ee,e[72]=fe):fe=e[72];let $;e[73]!==Le||e[74]!==Pe||e[75]!==_e||e[76]!==fe?($=n.jsx(Le,{items:Pe,strategy:_e,children:fe}),e[73]=Le,e[74]=Pe,e[75]=_e,e[76]=fe,e[77]=$):$=e[77];let pe;e[78]!==Y||e[79]!==ee||e[80]!==b?(pe=ee?n.jsx("div",{className:$e("cursor-grabbing shadow-lg ring-1 ring-border/60",Ts(ee,!1)),children:n.jsx(ks,{section:ee,raw:Y,meta:b})}):null,e[78]=Y,e[79]=ee,e[80]=b,e[81]=pe):pe=e[81];let Ce;e[82]!==pe?(Ce=Xn.createPortal(n.jsx(ts,{dropAnimation:ns,children:pe}),document.body),e[82]=pe,e[83]=Ce):Ce=e[83];let be;e[84]!==Me||e[85]!==ue||e[86]!==he||e[87]!==je||e[88]!==ke||e[89]!==ve||e[90]!==$||e[91]!==Ce?(be=n.jsxs(Me,{sensors:ue,collisionDetection:he,onDragStart:je,onDragEnd:ke,onDragCancel:ve,children:[$,Ce]}),e[84]=Me,e[85]=ue,e[86]=he,e[87]=je,e[88]=ke,e[89]=ve,e[90]=$,e[91]=Ce,e[92]=be):be=e[92];const Se=!l;let q;e[93]===Symbol.for("react.memo_cache_sentinel")?(q=n.jsx(vn,{size:14}),e[93]=q):q=e[93];let oe;e[94]!==R?(oe=R("sectionsEditor.sectionList.addSectionButton"),e[94]=R,e[95]=oe):oe=e[95];let de;e[96]!==o||e[97]!==Se||e[98]!==oe?(de=n.jsxs(Xe,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:Se,onClick:o,children:[q,oe]}),e[96]=o,e[97]=Se,e[98]=oe,e[99]=de):de=e[99];let Re;return e[100]!==ae||e[101]!==be||e[102]!==de?(Re=n.jsxs("div",{className:ae,children:[be,de]}),e[100]=ae,e[101]=be,e[102]=de,e[103]=Re):Re=e[103],Re}function br(g){return g.id}function qn(g){const e=Ge.c(57),{open:r,initialName:d,autoLabel:p,isPending:b,onSubmit:S,onOpenChange:m}=g,x=b===void 0?!1:b,u=ct(),[y,T]=w.useState(d),[V,E]=w.useState(r);r!==V&&(E(r),r&&T(d));let i;e[0]!==x||e[1]!==m?(i=ge=>{!ge&&!x&&m(!1)},e[0]=x,e[1]=m,e[2]=i):i=e[2];const h=i;let o;e[3]!==x||e[4]!==y||e[5]!==S?(o=async ge=>{ge.preventDefault(),!x&&await S(y.trim())},e[3]=x,e[4]=y,e[5]=S,e[6]=o):o=e[6];const P=o;let l;e[7]!==u?(l=u("sectionsEditor.variantRenameDialog.title"),e[7]=u,e[8]=l):l=e[8];let R;e[9]!==l?(R=n.jsx(Co,{children:l}),e[9]=l,e[10]=R):R=e[10];let K;e[11]!==p||e[12]!==u?(K=u("sectionsEditor.variantRenameDialog.description",{fallback:p||u("sectionsEditor.variantRenameDialog.defaultFallback")}),e[11]=p,e[12]=u,e[13]=K):K=e[13];let O;e[14]!==K?(O=n.jsx(Mo,{children:K}),e[14]=K,e[15]=O):O=e[15];let H;e[16]!==R||e[17]!==O?(H=n.jsxs(Bo,{children:[R,O]}),e[16]=R,e[17]=O,e[18]=H):H=e[18];let f;e[19]!==u?(f=u("sectionsEditor.variantRenameDialog.nameLabel"),e[19]=u,e[20]=f):f=e[20];let A;e[21]!==f?(A=n.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:f}),e[21]=f,e[22]=A):A=e[22];let De;e[23]===Symbol.for("react.memo_cache_sentinel")?(De=ge=>T(ge.target.value),e[23]=De):De=e[23];let C;e[24]!==p||e[25]!==x||e[26]!==y?(C=n.jsx(Io,{id:"variant-rename-name",value:y,onChange:De,placeholder:p,autoFocus:!0,disabled:x}),e[24]=p,e[25]=x,e[26]=y,e[27]=C):C=e[27];let ce;e[28]!==A||e[29]!==C?(ce=n.jsxs("div",{className:"space-y-1.5 py-4",children:[A,C]}),e[28]=A,e[29]=C,e[30]=ce):ce=e[30];let B;e[31]!==m?(B=()=>m(!1),e[31]=m,e[32]=B):B=e[32];let ne;e[33]!==u?(ne=u("sectionsEditor.variantRenameDialog.cancel"),e[33]=u,e[34]=ne):ne=e[34];let F;e[35]!==x||e[36]!==B||e[37]!==ne?(F=n.jsx(Xe,{type:"button",variant:"outline",onClick:B,disabled:x,children:ne}),e[35]=x,e[36]=B,e[37]=ne,e[38]=F):F=e[38];let ie;e[39]!==x||e[40]!==u?(ie=x?n.jsxs(n.Fragment,{children:[n.jsx(Zn,{size:14,className:"animate-spin"}),u("sectionsEditor.variantRenameDialog.saving")]}):u("sectionsEditor.variantRenameDialog.save"),e[39]=x,e[40]=u,e[41]=ie):ie=e[41];let le;e[42]!==x||e[43]!==ie?(le=n.jsx(Xe,{type:"submit",disabled:x,children:ie}),e[42]=x,e[43]=ie,e[44]=le):le=e[44];let ye;e[45]!==F||e[46]!==le?(ye=n.jsxs(Ko,{children:[F,le]}),e[45]=F,e[46]=le,e[47]=ye):ye=e[47];let X;e[48]!==P||e[49]!==ce||e[50]!==ye||e[51]!==H?(X=n.jsx(Lo,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:P,children:[H,ce,ye]})}),e[48]=P,e[49]=ce,e[50]=ye,e[51]=H,e[52]=X):X=e[52];let Z;return e[53]!==h||e[54]!==r||e[55]!==X?(Z=n.jsx(Fo,{open:r,onOpenChange:h,children:X}),e[53]=h,e[54]=r,e[55]=X,e[56]=Z):Z=e[56],Z}function Ns(g){const e=Ge.c(5),{rule:r,matchers:d}=g,p=r?.__resolveType??"";let b;if(e[0]!==d||e[1]!==p){const u=d.find(y=>y.resolveType===p)?.iconName??za(p);b=No(u),e[0]=d,e[1]=p,e[2]=b}else b=e[2];const S=b;if(!S)return null;let m;return e[3]!==S?(m=n.jsx(S,{size:14,className:"shrink-0"}),e[3]=S,e[4]=m):m=e[4],m}function Gn(g){return g.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
|
|
1
|
+
import{c as Ge,b as ct,r as w,m as $e,j as n,ae as Xn,B as Xe,k as Zn,o as Ca,t as Q,K as Ma}from"./index-HpF4ydE2.js";import{ap as Ba,aq as Ka,ar as La,a4 as es,a5 as Qt,as as ts,at as ns,a6 as ss,a7 as as,au as os,av as Fa,ae as rs,af as is,aw as Ia,ax as Oa,ay as ls,O as $a,a8 as cs,a9 as Mt,ac as us,ad as ds,aa as ms,ak as fs,az as za,aA as Bt,aB as ps,aC as Ha,S as gs,aD as lt,G as hs,aE as Ua,aF as qa,aG as Ga,aH as Wa,D as Ya,F as Ja,aI as Qa,aJ as Xa,aK as Za,aL as eo,ai as qt,aM as Gt,aN as to,aO as St,aP as Pt,aQ as no,aR as so,aS as tt,aT as Kn,aU as ao,aV as At,aW as Wt,aX as oo,aY as mn,aZ as ro,a_ as kt,a$ as io,b0 as lo,b1 as co,b2 as uo,b3 as mo,b4 as xt,b5 as fo,b6 as po,b7 as go,I as ho,b8 as Ln,b9 as Ct,ba as Fn,bb as In,bc as vo,bd as bo,be as So,bf as xo,bg as fn,bh as On,bi as $n,bj as Tt,bk as Yt,bl as zn,bm as yo,bn as pn,bo as _o,bp as jo,bq as Eo,br as Ro,bs as wo}from"./index-DoiZIymS.js";import{t as ko}from"./ChevronDown-BQOZpawT.js";import{ad as hn,v as To,T as vs,E as No,u as bs,af as Vo,_ as Do}from"./agent-icon-ChlSj_zC.js";import{i as Ss}from"./ChevronRight-cIZXph7r.js";import{n as Po}from"./ChevronUp-1zullNEp.js";import{i as Ao}from"./Globe01-4yOmtvQc.js";import{B as Jt}from"./automation-runs-jWstZftP.js";import{c as yt,T as _t,a as jt}from"./tooltip-ZrjhT2HZ.js";import{b as Co,h as Mo,a as Bo,c as Ko,d as Lo,e as Fo}from"./dialog-CFILfZOA.js";import{I as Io}from"./input-Dw4GelAn.js";import{a as xs}from"./Copy01-DOQujw91.js";import{i as Oo}from"./Settings02-CtYuLrf4.js";import{s as $o}from"./Eye-DrB86SUu.js";import{s as ys}from"./TrendUp01-9IbbL3_o.js";import{s as vn}from"./Plus-DJU_4kbx.js";import{s as _s}from"./Trash01-DUPlExuW.js";import{i as zo}from"./Zap-Bo7ywofH.js";import{D as js,a as vt,c as Es,b as Rs,i as Ho}from"./dropdown-menu-CvmqCZWH.js";import{S as Uo,r as Hn,u as qo,d as Go,a as Wo,i as Yo,f as Jo,P as Qo,b as Xo}from"./page-seo-form-C7E_eneh.js";import{c as Zo}from"./Tool01-C-9oM8hx.js";import{u as er,A as tr}from"./use-section-preview-base-DowNDHjh.js";import"./ArrowUp-CC_mbqe1.js";import"./chat-context-C5IpUGyL.js";import"./tab-id-D78T7QdF.js";import"./Check-COUqEm5U.js";import"./hooks-CdOH0sr_.js";import"./use-mcp-client-DguMnEWc.js";import"./auth-v89NYv9q.js";import"./decopilot-sse-pool-D6eFDIhm.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-DnVlCNEk.js";import"./use-ai-providers-jug9WjpB.js";import"./studio-tools-B9uOZhNU.js";import"./use-decopilot-events-Da84Mplm.js";import"./use-organization-settings-BVocOGaq.js";import"./spinner-CR38v4SM.js";import"./drawer-CUdV6oxw.js";import"./collection-search-jgJieFUU.js";import"./SearchMd-SbBW-oPu.js";import"./use-mobile-DMf3bWCn.js";import"./AreaChart-6BJhVF5T.js";import"./index-BzRGcU66.js";import"./X-B3ybq5w2.js";import"./shell-layout-B2-xnSYQ.js";import"./avatar-BpypxYS_.js";import"./User01-DdCsns_p.js";import"./Users03-Bx6UOYkE.js";import"./SearchLg-BQmUG7S4.js";import"./Stars02-l4Bi009V.js";import"./XClose-DAaNDUux.js";import"./CheckCircle-OafhoQfB.js";import"./CpuChip01-DP6ksU24.js";import"./FilterLines-D-22jIZj.js";import"./Monitor01-BOSd8wQ1.js";import"./required-auth-layout-BAhPwscS.js";import"./use-org-sso-CPuDLMAO.js";import"./ZapSquare-Bg5_XykS.js";import"./Star01-COyWVOwH.js";import"./Upload01-CykCKPTH.js";import"./AlertCircle-1FZS3v-O.js";import"./form-BjBdY0X7.js";import"./label-CJtuYe4Q.js";import"./select--icxBUQG.js";import"./ArrowLeft-CR4vxoJp.js";import"./XCircle-C4ggJi18.js";import"./tabs-BBQmojOt.js";import"./Tool02-CWP-2wPJ.js";import"./toggle-group-D7E7rM45.js";import"./use-deco-credits-DZXadVhu.js";import"./sidebar-CY8kI7Hv.js";import"./LayoutLeft-qMb6nkLN.js";import"./popover-DCriArZo.js";import"./alert-dialog-CEWyrZ_Z.js";import"./toolbar-DavdshhZ.js";import"./skeleton-BzHO_UZ_.js";import"./github-repo-picker-D-sEtEsJ.js";import"./use-debounced-value-ZcGR3H0U.js";import"./use-connection-Cq-TmGuZ.js";import"./authenticate-and-persist-oauth-Bx2wnD4m.js";import"./mcp-oauth-JmfL6YDg.js";import"./LinkExternal01-B8ehDauF.js";import"./Share07-CT2dyret.js";import"./use-mcp-tools-Bc0RjdGq.js";import"./extract-connection-data-DXrSXKT4.js";import"./metadata-dUsYcpuu.js";import"./use-navigate-to-agent-BpKSuM9c.js";import"./reusable-new-chat-CouMjkYR.js";import"./provision-repo-scoped-github-connection-ufuvpGD9.js";import"./agent-capabilities-cXfbMfjV.js";import"./connection-card-BBnyhURe.js";import"./use-registry-connections-C0HsNyAs.js";import"./useInfiniteQuery-DJ3TPFA7.js";import"./use-infinite-scroll-Cuq5t_LZ.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./card-CoBKo1D2.js";import"./integration-icon-Cyu5omdT.js";import"./textarea-D_MBsxxq.js";import"./connection-form-helpers-DmMFoW_E.js";import"./collection-tabs-D8Hgew32.js";import"./badge-D7AIZASF.js";import"./useSuspenseInfiniteQuery-BKyBbyvL.js";import"./use-open-billing-url-COnZPFfP.js";import"./select-model-CoTowZP9.js";import"./checkbox-B_axFhC0.js";import"./Key01-Dkj1imoI.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-B3ifPXpy.js";import"./ArrowUpRight-CbCF70v1.js";import"./Stars01-B9M6VkZj.js";import"./cards-OWxF4nj0.js";import"./DotsVertical-wivS0onw.js";import"./Palette-CSOJeVFB.js";import"./file-type-icon-ClrRx9NG.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-CjmrYixb.js";import"./empty-state-B-59kVV9.js";import"./deco-site-production-url-CaKZ7xBn.js";import"./use-capability-CD2_oMAe.js";import"./monaco-editor-DsEoV7tZ.js";import"./pt-BR-CLy76QW2.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./switch-CicvP6tN.js";import"./Play-H-b9CdPO.js";import"./use-debounced-autosave-BD5uwc1n.js";import"./index--OjyTwFQ.js";import"./search-input-BnJDFRMl.js";import"./index-CFJJgkw9.js";import"./Users01-DddX3P2e.js";import"./use-secrets-BP-H3C8p.js";import"./self-tool-result-CZm-aTd6.js";import"./format-time-BnbuEtat.js";import"./use-members-BSnfTEP4.js";import"./use-org-auth-client-Bvzf-tUx.js";import"./use-copy-qVFT-iwH.js";import"./SwitchHorizontal01-D3zKTM_Y.js";import"./use-tags-Cg8znnEF.js";import"./get-initials-D-f_fDFw.js";import"./command-mz5vaCyb.js";import"./index-COzRe4rY.js";import"./use-file-configs-Cr6Dl2n3.js";import"./use-automations-CSTZ3886.js";import"./automation-list-row-CtwPJ_qi.js";import"./CreditCard01-CufFLIFI.js";import"./Globe04-m8WcbUjt.js";import"./HardDrive-DZ-Roc4G.js";import"./LogOut01-oc8d9SJs.js";import"./Sun-BgLBLrAR.js";import"./Shield01-W_oC4KLS.js";import"./table-Cmvfib2K.js";import"./use-clock-tick-5wPqFXoc.js";function nr(g){return g.schema?.definitions??g.schema?.$defs??{}}function sr(g,e){const r=nr(e),d=r[btoa(g)];if(!d)return;let p=typeof d.image=="string"?d.image:void 0;if(!p&&Array.isArray(d.allOf)){const b=d.allOf.find(S=>typeof S.$ref=="string")?.$ref;if(typeof b=="string"){const S=b.replace("#/definitions/",""),m=r[S];p=typeof m?.image=="string"?m.image:void 0}}if(p?.includes("{{{"))return p}function ar(g,e){if(!e)return;const r=Ba(g);if(!r)return;const d=sr(r.resolveType,e);if(!d)return;const p=Ka(d,r.data);if(p)return La(p)}const or="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",rr="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 Un(g){return Array.from({length:g},(e,r)=>({id:crypto.randomUUID(),index:r}))}function ws(g){return g.map((e,r)=>({...e,index:r}))}function ir(g,e){if(e===g.length)return g;if(e<g.length)return ws(g.slice(0,e));const r=Array.from({length:e-g.length},(d,p)=>({id:crypto.randomUUID(),index:g.length+p}));return[...g,...r]}function ks(g){const e=Ge.c(20),{section:r,raw:d,meta:p}=g,b=r.isSavedBlock===!0,S=r.isMultivariate===!0;let m;e[0]!==p||e[1]!==d?(m=d&&p?ar(d,p):void 0,e[0]=p,e[1]=d,e[2]=m):m=e[2];const x=m;let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(To,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[3]=u):u=e[3];let y;e[4]!==x?(y=x&&n.jsx("img",{src:x,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[4]=x,e[5]=y):y=e[5];let T;e[6]!==S||e[7]!==b?(T=b?{color:$a}:S?{color:"oklch(0.65 0.15 160)"}:void 0,e[6]=S,e[7]=b,e[8]=T):T=e[8];let V;e[9]!==T?(V=n.jsx(hn,{className:"h-4 w-4 shrink-0",style:T}),e[9]=T,e[10]=V):V=e[10];const E=r.isHidden&&"line-through opacity-50";let i;e[11]!==E?(i=$e("min-w-0 flex-1 truncate text-sm font-medium",E),e[11]=E,e[12]=i):i=e[12];let h;e[13]!==r.label||e[14]!==i?(h=n.jsx("span",{className:i,children:r.label}),e[13]=r.label,e[14]=i,e[15]=h):h=e[15];let o;return e[16]!==y||e[17]!==V||e[18]!==h?(o=n.jsxs(n.Fragment,{children:[u,y,V,h]}),e[16]=y,e[17]=V,e[18]=h,e[19]=o):o=e[19],o}const lr="w-7 ml-0 opacity-100 [transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]",cr="w-0 -ml-2 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:ml-0 group-hover:w-7 group-hover:opacity-100 group-hover:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms] group-has-[:focus-visible]:ml-0 group-has-[:focus-visible]:w-7 group-has-[:focus-visible]:opacity-100 group-has-[:focus-visible]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]",ur="w-7 ml-0 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:opacity-100 group-has-[:focus-visible]:opacity-100";function gn(g,e){return $e("h-7 shrink-0 overflow-hidden",e?lr:g?ur:cr)}function Ts(g,e){const r=g.isSavedBlock===!0,d=g.isMultivariate===!0;return $e("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":r?or:d?ls:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function dr(g){const e=Ge.c(82),{section:r,raw:d,meta:p,sortableId:b,selected:S,onSelect:m,onDelete:x,onDuplicate:u,onMakeReusable:y,onToggleHidden:T,onToggleLazy:V,onAddVariant:E,onDetach:i}=g,h=ct(),o=d?os(d.__resolveType??""):!1,P=r.isHidden===!0,l=o||P;let R;e[0]!==r?(R=Fa(r),e[0]=r,e[1]=R):R=e[1];const K=R;let O;e[2]!==b?(O={id:b,animateLayoutChanges:hr},e[2]=b,e[3]=O):O=e[3];const{attributes:H,listeners:f,setNodeRef:A,transform:De,isDragging:C}=rs(O);let ce;e[4]!==De?(ce=is.Transform.toString(De?{...De,x:0}:null),e[4]=De,e[5]=ce):ce=e[5];const B=C?0:void 0;let ne;e[6]!==ce||e[7]!==B?(ne={transform:ce,opacity:B},e[6]=ce,e[7]=B,e[8]=ne):ne=e[8];const F=ne;let ie;e[9]!==r?(ie=Ia(r),e[9]=r,e[10]=ie):ie=e[10];const le=ie,ye="button",X=0;let Z;e[11]!==m?(Z=N=>{(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),m())},e[11]=m,e[12]=Z):Z=e[12];const ge=C?"cursor-grabbing":"cursor-pointer";let se;e[13]!==r||e[14]!==S||e[15]!==ge?(se=$e("touch-none transition-colors",ge,Ts(r,S)),e[13]=r,e[14]=S,e[15]=ge,e[16]=se):se=e[16];let L;e[17]!==p||e[18]!==d||e[19]!==r?(L=n.jsx(ks,{section:r,raw:d,meta:p}),e[17]=p,e[18]=d,e[19]=r,e[20]=L):L=e[20];const ze=!r.isMultivariate&&n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Xe,{type:"button",variant:"ghost",size:"icon","aria-label":h(o?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:$e(gn(l,o)),onClick:N=>{N.stopPropagation(),V()},onPointerDown:gr,children:n.jsx(zo,{className:$e("h-3.5 w-3.5",o&&"text-yellow-500")})})}),n.jsx(jt,{side:"bottom",children:h(o?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),nt=!r.isMultivariate&&n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Xe,{type:"button",variant:"ghost",size:"icon","aria-label":h(P?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),className:$e(gn(l,P)),onClick:N=>{N.stopPropagation(),T()},onPointerDown:pr,children:P?n.jsx(Oo,{className:"h-3.5 w-3.5"}):n.jsx($o,{className:"h-3.5 w-3.5"})})}),n.jsx(jt,{side:"bottom",children:h(P?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection")})]}),Le=Es,Me=js,Y=!0,ee=Xe,Fe="button",Pe="ghost",_e="icon";let ue;e[21]!==h?(ue=h("sectionsEditor.sectionList.sectionActionsMenu"),e[21]=h,e[22]=ue):ue=e[22];const he=$e(gn(l,!1),"data-[state=open]:ml-0 data-[state=open]:w-7 data-[state=open]:opacity-100 data-[state=open]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]");let je;e[23]===Symbol.for("react.memo_cache_sentinel")?(je=n.jsx(vs,{className:"h-3.5 w-3.5"}),e[23]=je):je=e[23];let ke;e[24]!==ee||e[25]!==ue||e[26]!==he?(ke=n.jsx(ee,{type:Fe,variant:Pe,size:_e,"aria-label":ue,className:he,onClick:fr,onPointerDown:mr,children:je}),e[24]=ee,e[25]=ue,e[26]=he,e[27]=ke):ke=e[27];let ve;e[28]!==Me||e[29]!==ke?(ve=n.jsx(Me,{asChild:Y,children:ke}),e[28]=Me,e[29]=ke,e[30]=ve):ve=e[30];let ae;e[31]!==u?(ae=N=>{N.stopPropagation(),u()},e[31]=u,e[32]=ae):ae=e[32];let Ae;e[33]===Symbol.for("react.memo_cache_sentinel")?(Ae=n.jsx(xs,{className:"h-4 w-4"}),e[33]=Ae):Ae=e[33];let Ee;e[34]!==h?(Ee=h("sectionsEditor.sectionList.duplicateMenuItem"),e[34]=h,e[35]=Ee):Ee=e[35];let fe;e[36]!==ae||e[37]!==Ee?(fe=n.jsxs(vt,{onClick:ae,children:[Ae,Ee]}),e[36]=ae,e[37]=Ee,e[38]=fe):fe=e[38];let $;e[39]!==K||e[40]!==E||e[41]!==h?($=K&&n.jsxs(vt,{className:Oa,onClick:N=>{N.stopPropagation(),E()},children:[n.jsx(ys,{className:"h-4 w-4"}),h("sectionsEditor.sectionList.addVariantMenuItem")]}),e[39]=K,e[40]=E,e[41]=h,e[42]=$):$=e[42];let pe;e[43]!==le||e[44]!==y||e[45]!==h?(pe=le&&n.jsxs(vt,{className:rr,onClick:N=>{N.stopPropagation(),y()},children:[n.jsx(hn,{className:"h-4 w-4"}),h("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[43]=le,e[44]=y,e[45]=h,e[46]=pe):pe=e[46];let Ce;e[47]!==i||e[48]!==r.isMultivariate||e[49]!==r.isSavedBlock||e[50]!==h?(Ce=r.isSavedBlock===!0&&!r.isMultivariate&&n.jsxs(vt,{onClick:N=>{N.stopPropagation(),i()},children:[n.jsx(hn,{className:"h-4 w-4"}),h("sectionsEditor.sectionList.detachMenuItem")]}),e[47]=i,e[48]=r.isMultivariate,e[49]=r.isSavedBlock,e[50]=h,e[51]=Ce):Ce=e[51];let be;e[52]!==x?(be=N=>{N.stopPropagation(),x()},e[52]=x,e[53]=be):be=e[53];let Se;e[54]===Symbol.for("react.memo_cache_sentinel")?(Se=n.jsx(_s,{className:"h-4 w-4"}),e[54]=Se):Se=e[54];let q;e[55]!==h?(q=h("sectionsEditor.sectionList.deleteMenuItem"),e[55]=h,e[56]=q):q=e[56];let oe;e[57]!==be||e[58]!==q?(oe=n.jsxs(vt,{className:"text-destructive focus:text-destructive",onClick:be,children:[Se,q]}),e[57]=be,e[58]=q,e[59]=oe):oe=e[59];let de;e[60]!==fe||e[61]!==$||e[62]!==pe||e[63]!==Ce||e[64]!==oe?(de=n.jsxs(Rs,{align:"end",className:"w-44",children:[fe,$,pe,Ce,oe]}),e[60]=fe,e[61]=$,e[62]=pe,e[63]=Ce,e[64]=oe,e[65]=de):de=e[65];let Re;e[66]!==Le||e[67]!==ve||e[68]!==de?(Re=n.jsxs(Le,{children:[ve,de]}),e[66]=Le,e[67]=ve,e[68]=de,e[69]=Re):Re=e[69];let me;return e[70]!==H||e[71]!==f||e[72]!==m||e[73]!==A||e[74]!==F||e[75]!==se||e[76]!==L||e[77]!==ze||e[78]!==nt||e[79]!==Re||e[80]!==Z?(me=n.jsxs("div",{ref:A,style:F,...H,...f,role:ye,tabIndex:X,onClick:m,onKeyDown:Z,className:se,children:[L,ze,nt,Re]}),e[70]=H,e[71]=f,e[72]=m,e[73]=A,e[74]=F,e[75]=se,e[76]=L,e[77]=ze,e[78]=nt,e[79]=Re,e[80]=Z,e[81]=me):me=e[81],me}function mr(g){return g.stopPropagation()}function fr(g){return g.stopPropagation()}function pr(g){return g.stopPropagation()}function gr(g){return g.stopPropagation()}function hr(){return!1}function vr(g){const e=Ge.c(104),{listKey:r,rawSections:d,sections:p,meta:b,selectedIndex:S,onSelect:m,onReorder:x,onDelete:u,onDuplicate:y,onMakeReusable:T,onToggleHidden:V,onToggleLazy:E,onAddVariant:i,onDetach:h,onAddSection:o,canAddSection:P}=g,l=P===void 0?!0:P,R=ct();let K;e[0]!==p.length?(K=()=>Un(p.length),e[0]=p.length,e[1]=K):K=e[1];const[O,H]=w.useState(K),[f,A]=w.useState(null),[De,C]=w.useState(r),[ce,B]=w.useState(p.length),ne=w.useRef(!1);De!==r?(C(r),B(p.length),H(Un(p.length))):ce!==p.length&&(B(p.length),H(me=>ir(me,p.length)));let F;e[2]===Symbol.for("react.memo_cache_sentinel")?(F={activationConstraint:{distance:8}},e[2]=F):F=e[2];let ie;e[3]===Symbol.for("react.memo_cache_sentinel")?(ie={coordinateGetter:cs},e[3]=ie):ie=e[3];const le=es(Qt(as,F),Qt(ss,ie));let ye;e[4]!==O?(ye=O.map(br),e[4]=O,e[5]=ye):ye=e[5];const X=ye;let Z;e[6]===Symbol.for("react.memo_cache_sentinel")?(Z=me=>{A(String(me.active.id))},e[6]=Z):Z=e[6];const ge=Z;let se;e[7]!==X||e[8]!==x?(se=me=>{A(null);const{active:N,over:re}=me;if(!re||N.id===re.id)return;const I=X.indexOf(String(N.id)),Be=X.indexOf(String(re.id));I===-1||Be===-1||(H(ut=>ws(Mt([...ut],I,Be))),ne.current=!0,requestAnimationFrame(()=>{ne.current=!1}),x?.(I,Be))},e[7]=X,e[8]=x,e[9]=se):se=e[9];const L=se;let ze;e[10]===Symbol.for("react.memo_cache_sentinel")?(ze=()=>{A(null)},e[10]=ze):ze=e[10];const nt=ze;let Le,Me,Y,ee,Fe,Pe,_e,ue,he,je,ke,ve,ae,Ae,Ee;if(e[11]!==f||e[12]!==l||e[13]!==O||e[14]!==X||e[15]!==L||e[16]!==b||e[17]!==o||e[18]!==i||e[19]!==u||e[20]!==h||e[21]!==y||e[22]!==T||e[23]!==m||e[24]!==V||e[25]!==E||e[26]!==d||e[27]!==p||e[28]!==S||e[29]!==le||e[30]!==R){Ae=Symbol.for("react.early_return_sentinel");e:{const me=N=>{ne.current||m(N)};if(e[46]!==f||e[47]!==l||e[48]!==O||e[49]!==o||e[50]!==d||e[51]!==p||e[52]!==R){const N=f?O.find(re=>re.id===f):null;if(ee=N!=null?p[N.index]:null,Y=N!=null?d[N.index]:void 0,O.length===0){let re;e[56]!==R?(re=R("sectionsEditor.sectionList.noSections"),e[56]=R,e[57]=re):re=e[57];let I;e[58]!==re?(I=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:re}),e[58]=re,e[59]=I):I=e[59];const Be=!l;let ut;e[60]===Symbol.for("react.memo_cache_sentinel")?(ut=n.jsx(vn,{size:14}),e[60]=ut):ut=e[60];let Te;e[61]!==R?(Te=R("sectionsEditor.sectionList.addSectionButton"),e[61]=R,e[62]=Te):Te=e[62];let We;e[63]!==o||e[64]!==Be||e[65]!==Te?(We=n.jsxs(Xe,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:Be,onClick:o,children:[ut,Te]}),e[63]=o,e[64]=Be,e[65]=Te,e[66]=We):We=e[66];let Ie;e[67]!==I||e[68]!==We?(Ie=n.jsxs("div",{className:"space-y-2",children:[I,We]}),e[67]=I,e[68]=We,e[69]=Ie):Ie=e[69],Ae=Ie;break e}ae=$e(N&&"cursor-grabbing"),e[46]=f,e[47]=l,e[48]=O,e[49]=o,e[50]=d,e[51]=p,e[52]=R,e[53]=Y,e[54]=ee,e[55]=ae}else Y=e[53],ee=e[54],ae=e[55];Me=us,ue=le,he=ds,je=ge,ke=L,ve=nt,Le=ms,Pe=X,_e=fs,Ee="space-y-1",Fe=O.map(N=>{const re=p[N.index];return re?n.jsx(dr,{sortableId:N.id,section:re,raw:d[N.index],meta:b,selected:S===N.index,onSelect:()=>me(N.index),onDelete:()=>u(N.index),onDuplicate:()=>y(N.index),onMakeReusable:()=>T(N.index),onToggleHidden:()=>V(N.index),onToggleLazy:()=>E(N.index),onAddVariant:()=>i(N.index),onDetach:()=>h(N.index)},N.id):null})}e[11]=f,e[12]=l,e[13]=O,e[14]=X,e[15]=L,e[16]=b,e[17]=o,e[18]=i,e[19]=u,e[20]=h,e[21]=y,e[22]=T,e[23]=m,e[24]=V,e[25]=E,e[26]=d,e[27]=p,e[28]=S,e[29]=le,e[30]=R,e[31]=Le,e[32]=Me,e[33]=Y,e[34]=ee,e[35]=Fe,e[36]=Pe,e[37]=_e,e[38]=ue,e[39]=he,e[40]=je,e[41]=ke,e[42]=ve,e[43]=ae,e[44]=Ae,e[45]=Ee}else Le=e[31],Me=e[32],Y=e[33],ee=e[34],Fe=e[35],Pe=e[36],_e=e[37],ue=e[38],he=e[39],je=e[40],ke=e[41],ve=e[42],ae=e[43],Ae=e[44],Ee=e[45];if(Ae!==Symbol.for("react.early_return_sentinel"))return Ae;let fe;e[70]!==Fe||e[71]!==Ee?(fe=n.jsx("div",{className:Ee,children:Fe}),e[70]=Fe,e[71]=Ee,e[72]=fe):fe=e[72];let $;e[73]!==Le||e[74]!==Pe||e[75]!==_e||e[76]!==fe?($=n.jsx(Le,{items:Pe,strategy:_e,children:fe}),e[73]=Le,e[74]=Pe,e[75]=_e,e[76]=fe,e[77]=$):$=e[77];let pe;e[78]!==Y||e[79]!==ee||e[80]!==b?(pe=ee?n.jsx("div",{className:$e("cursor-grabbing shadow-lg ring-1 ring-border/60",Ts(ee,!1)),children:n.jsx(ks,{section:ee,raw:Y,meta:b})}):null,e[78]=Y,e[79]=ee,e[80]=b,e[81]=pe):pe=e[81];let Ce;e[82]!==pe?(Ce=Xn.createPortal(n.jsx(ts,{dropAnimation:ns,children:pe}),document.body),e[82]=pe,e[83]=Ce):Ce=e[83];let be;e[84]!==Me||e[85]!==ue||e[86]!==he||e[87]!==je||e[88]!==ke||e[89]!==ve||e[90]!==$||e[91]!==Ce?(be=n.jsxs(Me,{sensors:ue,collisionDetection:he,onDragStart:je,onDragEnd:ke,onDragCancel:ve,children:[$,Ce]}),e[84]=Me,e[85]=ue,e[86]=he,e[87]=je,e[88]=ke,e[89]=ve,e[90]=$,e[91]=Ce,e[92]=be):be=e[92];const Se=!l;let q;e[93]===Symbol.for("react.memo_cache_sentinel")?(q=n.jsx(vn,{size:14}),e[93]=q):q=e[93];let oe;e[94]!==R?(oe=R("sectionsEditor.sectionList.addSectionButton"),e[94]=R,e[95]=oe):oe=e[95];let de;e[96]!==o||e[97]!==Se||e[98]!==oe?(de=n.jsxs(Xe,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:Se,onClick:o,children:[q,oe]}),e[96]=o,e[97]=Se,e[98]=oe,e[99]=de):de=e[99];let Re;return e[100]!==ae||e[101]!==be||e[102]!==de?(Re=n.jsxs("div",{className:ae,children:[be,de]}),e[100]=ae,e[101]=be,e[102]=de,e[103]=Re):Re=e[103],Re}function br(g){return g.id}function qn(g){const e=Ge.c(57),{open:r,initialName:d,autoLabel:p,isPending:b,onSubmit:S,onOpenChange:m}=g,x=b===void 0?!1:b,u=ct(),[y,T]=w.useState(d),[V,E]=w.useState(r);r!==V&&(E(r),r&&T(d));let i;e[0]!==x||e[1]!==m?(i=ge=>{!ge&&!x&&m(!1)},e[0]=x,e[1]=m,e[2]=i):i=e[2];const h=i;let o;e[3]!==x||e[4]!==y||e[5]!==S?(o=async ge=>{ge.preventDefault(),!x&&await S(y.trim())},e[3]=x,e[4]=y,e[5]=S,e[6]=o):o=e[6];const P=o;let l;e[7]!==u?(l=u("sectionsEditor.variantRenameDialog.title"),e[7]=u,e[8]=l):l=e[8];let R;e[9]!==l?(R=n.jsx(Co,{children:l}),e[9]=l,e[10]=R):R=e[10];let K;e[11]!==p||e[12]!==u?(K=u("sectionsEditor.variantRenameDialog.description",{fallback:p||u("sectionsEditor.variantRenameDialog.defaultFallback")}),e[11]=p,e[12]=u,e[13]=K):K=e[13];let O;e[14]!==K?(O=n.jsx(Mo,{children:K}),e[14]=K,e[15]=O):O=e[15];let H;e[16]!==R||e[17]!==O?(H=n.jsxs(Bo,{children:[R,O]}),e[16]=R,e[17]=O,e[18]=H):H=e[18];let f;e[19]!==u?(f=u("sectionsEditor.variantRenameDialog.nameLabel"),e[19]=u,e[20]=f):f=e[20];let A;e[21]!==f?(A=n.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:f}),e[21]=f,e[22]=A):A=e[22];let De;e[23]===Symbol.for("react.memo_cache_sentinel")?(De=ge=>T(ge.target.value),e[23]=De):De=e[23];let C;e[24]!==p||e[25]!==x||e[26]!==y?(C=n.jsx(Io,{id:"variant-rename-name",value:y,onChange:De,placeholder:p,autoFocus:!0,disabled:x}),e[24]=p,e[25]=x,e[26]=y,e[27]=C):C=e[27];let ce;e[28]!==A||e[29]!==C?(ce=n.jsxs("div",{className:"space-y-1.5 py-4",children:[A,C]}),e[28]=A,e[29]=C,e[30]=ce):ce=e[30];let B;e[31]!==m?(B=()=>m(!1),e[31]=m,e[32]=B):B=e[32];let ne;e[33]!==u?(ne=u("sectionsEditor.variantRenameDialog.cancel"),e[33]=u,e[34]=ne):ne=e[34];let F;e[35]!==x||e[36]!==B||e[37]!==ne?(F=n.jsx(Xe,{type:"button",variant:"outline",onClick:B,disabled:x,children:ne}),e[35]=x,e[36]=B,e[37]=ne,e[38]=F):F=e[38];let ie;e[39]!==x||e[40]!==u?(ie=x?n.jsxs(n.Fragment,{children:[n.jsx(Zn,{size:14,className:"animate-spin"}),u("sectionsEditor.variantRenameDialog.saving")]}):u("sectionsEditor.variantRenameDialog.save"),e[39]=x,e[40]=u,e[41]=ie):ie=e[41];let le;e[42]!==x||e[43]!==ie?(le=n.jsx(Xe,{type:"submit",disabled:x,children:ie}),e[42]=x,e[43]=ie,e[44]=le):le=e[44];let ye;e[45]!==F||e[46]!==le?(ye=n.jsxs(Ko,{children:[F,le]}),e[45]=F,e[46]=le,e[47]=ye):ye=e[47];let X;e[48]!==P||e[49]!==ce||e[50]!==ye||e[51]!==H?(X=n.jsx(Lo,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:P,children:[H,ce,ye]})}),e[48]=P,e[49]=ce,e[50]=ye,e[51]=H,e[52]=X):X=e[52];let Z;return e[53]!==h||e[54]!==r||e[55]!==X?(Z=n.jsx(Fo,{open:r,onOpenChange:h,children:X}),e[53]=h,e[54]=r,e[55]=X,e[56]=Z):Z=e[56],Z}function Ns(g){const e=Ge.c(5),{rule:r,matchers:d}=g,p=r?.__resolveType??"";let b;if(e[0]!==d||e[1]!==p){const u=d.find(y=>y.resolveType===p)?.iconName??za(p);b=No(u),e[0]=d,e[1]=p,e[2]=b}else b=e[2];const S=b;if(!S)return null;let m;return e[3]!==S?(m=n.jsx(S,{size:14,className:"shrink-0"}),e[3]=S,e[4]=m):m=e[4],m}function Gn(g){return g.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
|
|
2
2
|
`)}function Wn(g){return g.map((e,r)=>({id:crypto.randomUUID(),index:r,variant:e}))}function Sr(g){return g.map((e,r)=>({...e,index:r}))}function Vs(g){const e=Ge.c(17),{label:r,effectiveRule:d,matchers:p,canDelete:b,dragging:S,onRename:m,onDuplicate:x,onDelete:u}=g,y=ct();let T;e[0]!==d||e[1]!==p?(T=n.jsx(Ns,{rule:d,matchers:p}),e[0]=d,e[1]=p,e[2]=T):T=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 E;e[5]!==b||e[6]!==S||e[7]!==r||e[8]!==u||e[9]!==x||e[10]!==m||e[11]!==y?(E=!S&&n.jsxs(Es,{children:[n.jsx(js,{asChild:!0,children:n.jsx(Xe,{type:"button",variant:"ghost",size:"icon","aria-label":y("sectionsEditor.pageVariantTabs.actionsAriaLabel",{label:r}),className:"size-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100",onClick:yr,onPointerDown:xr,children:n.jsx(vs,{size:14})})}),n.jsxs(Rs,{align:"end",className:"w-36",children:[n.jsxs(vt,{onClick:h=>{h.stopPropagation(),m?.()},children:[n.jsx(Zo,{size:14}),y("sectionsEditor.pageVariantTabs.renameAction")]}),n.jsxs(vt,{onClick:h=>{h.stopPropagation(),x?.()},children:[n.jsx(xs,{size:14}),y("sectionsEditor.pageVariantTabs.duplicateAction")]}),n.jsx(Ho,{}),n.jsxs(vt,{variant:"destructive",disabled:!b,onClick:h=>{h.stopPropagation(),u?.()},children:[n.jsx(_s,{size:14}),y("sectionsEditor.pageVariantTabs.deleteAction")]})]})]}),e[5]=b,e[6]=S,e[7]=r,e[8]=u,e[9]=x,e[10]=m,e[11]=y,e[12]=E):E=e[12];let i;return e[13]!==T||e[14]!==V||e[15]!==E?(i=n.jsxs(n.Fragment,{children:[T,V,E]}),e[13]=T,e[14]=V,e[15]=E,e[16]=i):i=e[16],i}function xr(g){return g.stopPropagation()}function yr(g){return g.stopPropagation()}function _r(g){const e=Ge.c(33),{entry:r,sortableId:d,isActive:p,canDelete:b,decofile:S,meta:m,matchers:x,onSelect:u,onRename:y,onDuplicate:T,onDelete:V}=g;let E;e[0]!==d?(E={id:d,animateLayoutChanges:jr},e[0]=d,e[1]=E):E=e[1];const{attributes:i,listeners:h,setNodeRef:o,transform:P,isDragging:l}=rs(E);let R;e[2]!==P?(R=is.Transform.toString(P?{...P,x:0}:null),e[2]=P,e[3]=R):R=e[3];const K=l?0:void 0;let O;e[4]!==R||e[5]!==K?(O={transform:R,opacity:K},e[4]=R,e[5]=K,e[6]=O):O=e[6];const H=O,f=m??void 0;let A;e[7]!==S||e[8]!==r.variant.rule||e[9]!==f?(A=Bt(r.variant.rule,S,f),e[7]=S,e[8]=r.variant.rule,e[9]=f,e[10]=A):A=e[10];const De=A;let C;e[11]!==u?(C=le=>{le.target===le.currentTarget&&(le.key==="Enter"||le.key===" ")&&(le.preventDefault(),u())},e[11]=u,e[12]=C):C=e[12];const ce=l?"cursor-grabbing":"cursor-pointer active:cursor-grabbing",B=p?ps:ls;let ne;e[13]!==ce||e[14]!==B?(ne=$e("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]=ne):ne=e[15];let F;e[16]!==b||e[17]!==De||e[18]!==r.variant.label||e[19]!==x||e[20]!==V||e[21]!==T||e[22]!==y?(F=n.jsx(Vs,{label:r.variant.label,effectiveRule:De,matchers:x,canDelete:b,onRename:y,onDuplicate:T,onDelete:V}),e[16]=b,e[17]=De,e[18]=r.variant.label,e[19]=x,e[20]=V,e[21]=T,e[22]=y,e[23]=F):F=e[23];let ie;return e[24]!==i||e[25]!==h||e[26]!==u||e[27]!==o||e[28]!==H||e[29]!==ne||e[30]!==F||e[31]!==C?(ie=n.jsx("div",{ref:o,style:H,...i,...h,onClick:u,onKeyDown:C,className:ne,children:F}),e[24]=i,e[25]=h,e[26]=u,e[27]=o,e[28]=H,e[29]=ne,e[30]=F,e[31]=C,e[32]=ie):ie=e[32],ie}function jr(){return!1}function Er(g){const e=Ge.c(9),{variant:r,decofile:d,meta:p,matchers:b}=g,S=p??void 0;let m;e[0]!==d||e[1]!==S||e[2]!==r.rule?(m=Bt(r.rule,d,S),e[0]=d,e[1]=S,e[2]=r.rule,e[3]=m):m=e[3];const x=m;let u;e[4]===Symbol.for("react.memo_cache_sentinel")?(u=$e("flex items-center gap-2 rounded-md px-2 py-2.5 shadow-lg ring-1 ring-border/60 cursor-grabbing",ps),e[4]=u):u=e[4];let y;return e[5]!==x||e[6]!==b||e[7]!==r.label?(y=n.jsx("div",{className:u,children:n.jsx(Vs,{label:r.label,effectiveRule:x,matchers:b,canDelete:!1,dragging:!0})}),e[5]=x,e[6]=b,e[7]=r.label,e[8]=y):y=e[8],y}function Rr(g){const e=Ge.c(91),{listKey:r,variants:d,activeIndex:p,decofile:b,meta:S,matchers:m,onSelect:x,onReorder:u,onRename:y,onDuplicate:T,onDelete:V,onAdd:E}=g,i=ct();let h;e[0]!==d?(h=()=>Wn(d),e[0]=d,e[1]=h):h=e[1];const[o,P]=w.useState(h),[l,R]=w.useState(null),[K,O]=w.useState(r),[H,f]=w.useState(d.length);let A;e[2]!==d?(A=()=>Gn(d),e[2]=d,e[3]=A):A=e[3];const[De,C]=w.useState(A),ce=w.useRef(!1),B=Gn(d);K!==r?(O(r),f(d.length),C(B),P(Wn(d))):(H!==d.length||De!==B)&&(f(d.length),C(B),P(be=>d.map((Se,q)=>({id:be[q]?.id??crypto.randomUUID(),index:q,variant:Se}))));let ne;e[4]===Symbol.for("react.memo_cache_sentinel")?(ne={activationConstraint:{distance:8}},e[4]=ne):ne=e[4];let F;e[5]===Symbol.for("react.memo_cache_sentinel")?(F={coordinateGetter:cs},e[5]=F):F=e[5];const ie=es(Qt(as,ne),Qt(ss,F));let le;e[6]!==o?(le=o.map(wr),e[6]=o,e[7]=le):le=e[7];const ye=le,X=d.length>1;let Z;e[8]!==o?(Z=be=>{const Se=String(be.active.id);R(o.find(q=>q.id===Se)??null)},e[8]=o,e[9]=Z):Z=e[9];const ge=Z;let se;e[10]!==ye||e[11]!==u?(se=be=>{R(null);const{active:Se,over:q}=be;if(!q||Se.id===q.id)return;const oe=ye.indexOf(String(Se.id)),de=ye.indexOf(String(q.id));oe===-1||de===-1||(P(Re=>Sr(Mt([...Re],oe,de))),ce.current=!0,requestAnimationFrame(()=>{ce.current=!1}),u(oe,de))},e[10]=ye,e[11]=u,e[12]=se):se=e[12];const L=se;let ze;e[13]===Symbol.for("react.memo_cache_sentinel")?(ze=()=>{R(null)},e[13]=ze):ze=e[13];const nt=ze;let Le,Me,Y,ee,Fe,Pe,_e,ue,he,je,ke,ve,ae;if(e[14]!==p||e[15]!==X||e[16]!==b||e[17]!==o||e[18]!==ye||e[19]!==L||e[20]!==ge||e[21]!==m||e[22]!==S||e[23]!==E||e[24]!==V||e[25]!==T||e[26]!==y||e[27]!==x||e[28]!==ie||e[29]!==i){const be=I=>{ce.current||x(I)};ke="space-y-1 border-b p-2";let Se;e[43]!==i?(Se=i("sectionsEditor.pageVariantTabs.variantsLabel"),e[43]=i,e[44]=Se):Se=e[44];let q;e[45]!==Se?(q=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:Se}),e[45]=Se,e[46]=q):q=e[46];let oe;e[47]!==i?(oe=i("sectionsEditor.pageVariantTabs.addVariantAriaLabel"),e[47]=i,e[48]=oe):oe=e[48];let de;e[49]===Symbol.for("react.memo_cache_sentinel")?(de=n.jsx(vn,{size:14}),e[49]=de):de=e[49];let Re;e[50]!==E||e[51]!==oe?(Re=n.jsx(_t,{asChild:!0,children:n.jsx(Xe,{type:"button",variant:"ghost",size:"icon","aria-label":oe,className:"size-6",onClick:E,children:de})}),e[50]=E,e[51]=oe,e[52]=Re):Re=e[52];let me;e[53]!==i?(me=i("sectionsEditor.pageVariantTabs.addVariantTooltip"),e[53]=i,e[54]=me):me=e[54];let N;e[55]!==me?(N=n.jsx(jt,{children:me}),e[55]=me,e[56]=N):N=e[56];let re;e[57]!==Re||e[58]!==N?(re=n.jsxs(yt,{children:[Re,N]}),e[57]=Re,e[58]=N,e[59]=re):re=e[59],e[60]!==q||e[61]!==re?(ve=n.jsxs("div",{className:"flex items-center justify-between",children:[q,re]}),e[60]=q,e[61]=re,e[62]=ve):ve=e[62],Me=us,Pe=ie,_e=ds,ue=ge,he=L,je=nt,Le=ms,ee=ye,Fe=fs,ae="space-y-0.5",Y=o.map(I=>n.jsx(_r,{sortableId:I.id,entry:I,isActive:I.index===p,canDelete:X,decofile:b,meta:S,matchers:m,onSelect:()=>be(I.index),onRename:()=>y(I.index),onDuplicate:()=>T(I.index),onDelete:()=>V(I.index)},I.id)),e[14]=p,e[15]=X,e[16]=b,e[17]=o,e[18]=ye,e[19]=L,e[20]=ge,e[21]=m,e[22]=S,e[23]=E,e[24]=V,e[25]=T,e[26]=y,e[27]=x,e[28]=ie,e[29]=i,e[30]=Le,e[31]=Me,e[32]=Y,e[33]=ee,e[34]=Fe,e[35]=Pe,e[36]=_e,e[37]=ue,e[38]=he,e[39]=je,e[40]=ke,e[41]=ve,e[42]=ae}else Le=e[30],Me=e[31],Y=e[32],ee=e[33],Fe=e[34],Pe=e[35],_e=e[36],ue=e[37],he=e[38],je=e[39],ke=e[40],ve=e[41],ae=e[42];let Ae;e[63]!==Y||e[64]!==ae?(Ae=n.jsx("div",{className:ae,children:Y}),e[63]=Y,e[64]=ae,e[65]=Ae):Ae=e[65];let Ee;e[66]!==Le||e[67]!==ee||e[68]!==Fe||e[69]!==Ae?(Ee=n.jsx(Le,{items:ee,strategy:Fe,children:Ae}),e[66]=Le,e[67]=ee,e[68]=Fe,e[69]=Ae,e[70]=Ee):Ee=e[70];let fe;e[71]!==l||e[72]!==b||e[73]!==m||e[74]!==S?(fe=l?n.jsx(Er,{variant:l.variant,decofile:b,meta:S,matchers:m}):null,e[71]=l,e[72]=b,e[73]=m,e[74]=S,e[75]=fe):fe=e[75];let $;e[76]!==fe?($=Xn.createPortal(n.jsx(ts,{dropAnimation:ns,children:fe}),document.body),e[76]=fe,e[77]=$):$=e[77];let pe;e[78]!==Me||e[79]!==Pe||e[80]!==_e||e[81]!==ue||e[82]!==he||e[83]!==je||e[84]!==Ee||e[85]!==$?(pe=n.jsxs(Me,{sensors:Pe,collisionDetection:_e,onDragStart:ue,onDragEnd:he,onDragCancel:je,children:[Ee,$]}),e[78]=Me,e[79]=Pe,e[80]=_e,e[81]=ue,e[82]=he,e[83]=je,e[84]=Ee,e[85]=$,e[86]=pe):pe=e[86];let Ce;return e[87]!==ke||e[88]!==ve||e[89]!==pe?(Ce=n.jsxs("div",{className:ke,children:[ve,pe]}),e[87]=ke,e[88]=ve,e[89]=pe,e[90]=Ce):Ce=e[90],Ce}function wr(g){return g.id}function kr(g){const e=Ge.c(16),{schema:r,value:d,onChange:p,meta:b,decofile:S,onSaveReferencedBlock:m,sandbox:x}=g,u=ct();let y;e[0]===Symbol.for("react.memo_cache_sentinel")?(y=[],e[0]=y):y=e[0];const[T,V]=w.useState(y);let E;e[1]!==T||e[2]!==u?(E=T.length>0&&n.jsxs("nav",{"aria-label":u("sectionsEditor.sectionsEditorPanels.variantRuleBreadcrumb"),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:u("sectionsEditor.sectionsEditorPanels.backToRule"),children:n.jsx(bs,{className:"size-3.5"})}),T.map((o,P)=>{const l=P===T.length-1,R=hs(o);return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[P>0&&n.jsx(Ss,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>V(T.slice(0,P+1)),title:R,className:$e("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:R})]},`${R}-${P}`)})]}),e[1]=T,e[2]=u,e[3]=E):E=e[3];let i;e[4]!==T||e[5]!==S||e[6]!==b||e[7]!==p||e[8]!==m||e[9]!==x||e[10]!==r||e[11]!==d?(i=n.jsx(gs,{schema:r,value:d,onChange:p,basePath:"",breadcrumbPath:T,onBreadcrumbChange:V,meta:b,decofile:S,onSaveReferencedBlock:m,sandbox:x}),e[4]=T,e[5]=S,e[6]=b,e[7]=p,e[8]=m,e[9]=x,e[10]=r,e[11]=d,e[12]=i):i=e[12];let h;return e[13]!==E||e[14]!==i?(h=n.jsxs("div",{className:"space-y-2",children:[E,i]}),e[13]=E,e[14]=i,e[15]=h):h=e[15],h}function Yn(g){const e=Ge.c(23),{activeSchema:r,formValue:d,formResetKey:p,onFormChange:b,onBreadcrumbChange:S,breadcrumbPath:m,emptyMessage:x,beforeForm:u,seoResolveType:y,siteDefaultSeo:T,meta:V,decofile:E,onSaveReferencedBlock:i,sandbox:h,previewBaseUrl:o,onRequestAddSection:P}=g;let l;e[0]!==m?(l=m===void 0?[]:m,e[0]=m,e[1]=l):l=e[1];const R=l;let K;e[2]!==r||e[3]!==R||e[4]!==E||e[5]!==p||e[6]!==d||e[7]!==V||e[8]!==S||e[9]!==b||e[10]!==P||e[11]!==i||e[12]!==o||e[13]!==h||e[14]!==y||e[15]!==T?(K=r&&d?y?n.jsx(Uo,{schema:r,resolveType:y,value:d,formResetKey:p,onChange:b,onBreadcrumbChange:S,siteDefaultSeo:T}):n.jsx(gs,{schema:r,value:d,onChange:b,basePath:"",breadcrumbPath:R,onBreadcrumbChange:S,meta:V,decofile:E,onSaveReferencedBlock:i,sandbox:h,previewBaseUrl:o,onRequestAddSection:P},p):null,e[2]=r,e[3]=R,e[4]=E,e[5]=p,e[6]=d,e[7]=V,e[8]=S,e[9]=b,e[10]=P,e[11]=i,e[12]=o,e[13]=h,e[14]=y,e[15]=T,e[16]=K):K=e[16];const O=K;let H;e[17]!==x||e[18]!==O?(H=O??n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:x}),e[17]=x,e[18]=O,e[19]=H):H=e[19];let f;return e[20]!==u||e[21]!==H?(f=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:[u,H]})}),e[20]=u,e[21]=H,e[22]=f):f=e[22],f}const Tr="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 Nr(g,e){return Ha(g,e,lt)}function Vr(g){const e=Ge.c(19),{pageKey:r,initialName:d,initialPath:p,onFieldChange:b}=g,S=ct(),[m,x]=w.useState(d),[u,y]=w.useState(p),[T,V]=w.useState(r);T!==r&&(V(r),x(d),y(p));let E;e[0]!==b?(E=K=>{x(K.target.value),b("name",K.target.value)},e[0]=b,e[1]=E):E=e[1];let i;e[2]!==S?(i=S("sectionsEditor.sectionsEditorPanels.pageNamePlaceholder"),e[2]=S,e[3]=i):i=e[3];let h;e[4]!==m||e[5]!==E||e[6]!==i?(h=n.jsx("input",{type:"text",value:m,onChange:E,className:"w-full bg-transparent text-sm font-semibold truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:i}),e[4]=m,e[5]=E,e[6]=i,e[7]=h):h=e[7];let o;e[8]!==b?(o=K=>{y(K.target.value),b("path",K.target.value)},e[8]=b,e[9]=o):o=e[9];let P;e[10]!==S?(P=S("sectionsEditor.sectionsEditorPanels.pathPlaceholder"),e[10]=S,e[11]=P):P=e[11];let l;e[12]!==u||e[13]!==o||e[14]!==P?(l=n.jsx("input",{type:"text",value:u,onChange:o,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:P}),e[12]=u,e[13]=o,e[14]=P,e[15]=l):l=e[15];let R;return e[16]!==h||e[17]!==l?(R=n.jsxs("div",{className:"space-y-1",children:[h,l]}),e[16]=h,e[17]=l,e[18]=R):R=e[18],R}function Jn(g){const e=Ge.c(13),{onClick:r}=g,d=ct();let p;e[0]!==d?(p=d("sectionsEditor.sectionsEditorPanels.addVariant"),e[0]=d,e[1]=p):p=e[1];let b;e[2]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx(ys,{size:14}),e[2]=b):b=e[2];let S;e[3]!==r||e[4]!==p?(S=n.jsx(_t,{asChild:!0,children:n.jsx(Xe,{type:"button",variant:"ghost",size:"icon","aria-label":p,className:"size-7 shrink-0 text-[oklch(0.65_0.15_160)]",onClick:r,children:b})}),e[3]=r,e[4]=p,e[5]=S):S=e[5];let m;e[6]!==d?(m=d("sectionsEditor.sectionsEditorPanels.addVariant"),e[6]=d,e[7]=m):m=e[7];let x;e[8]!==m?(x=n.jsx(jt,{side:"bottom",children:m}),e[8]=m,e[9]=x):x=e[9];let u;return e[10]!==S||e[11]!==x?(u=n.jsxs(yt,{children:[S,x]}),e[10]=S,e[11]=x,e[12]=u):u=e[12],u}function Qn(g){const e=Ge.c(21),{currentRt:r,currentLabel:d,currentGlobalKey:p,matchers:b,globals:S,onSelect:m,onSelectGlobal:x,schema:u,formValue:y,onChange:T,formKey:V,formWrapperClassName:E,meta:i,decofile:h,onSaveReferencedBlock:o,sandbox:P}=g;let l;e[0]!==p||e[1]!==d||e[2]!==r||e[3]!==S||e[4]!==b||e[5]!==m||e[6]!==x?(l=n.jsx(Ua,{currentRt:r,currentLabel:d,currentGlobalKey:p,matchers:b,globals:S,onSelect:m,onSelectGlobal:x}),e[0]=p,e[1]=d,e[2]=r,e[3]=S,e[4]=b,e[5]=m,e[6]=x,e[7]=l):l=e[7];let R;e[8]!==h||e[9]!==V||e[10]!==y||e[11]!==E||e[12]!==i||e[13]!==T||e[14]!==o||e[15]!==P||e[16]!==u?(R=u&&y&&n.jsx("div",{className:E,children:n.jsx(kr,{schema:u,value:y,onChange:T,meta:i,decofile:h,onSaveReferencedBlock:o,sandbox:P},V)}),e[8]=h,e[9]=V,e[10]=y,e[11]=E,e[12]=i,e[13]=T,e[14]=o,e[15]=P,e[16]=u,e[17]=R):R=e[17];let K;return e[18]!==l||e[19]!==R?(K=n.jsxs(n.Fragment,{children:[l,R]}),e[18]=l,e[19]=R,e[20]=K):K=e[20],K}function jc({orgSlug:g,virtualMcpId:e,branch:r,previewReady:d=!0,previewUrl:p,currentPath:b,activePageBlockKey:S=null,activeGlobalBlockKey:m=null,externalSelection:x,onSaved:u,initialEditSeo:y=!1,onExitSeo:T,onViewJsonFile:V,onVariantPreviewOverride:E}){const i=ct(),h=d?{orgSlug:g,virtualMcpId:e,branch:r,previewUrl:p}:null,{data:o,isLoading:P}=qa(h),{data:l,isLoading:R}=Ga(h),K=Wa(),O=K?.entity?.id===e?K.entity.metadata?.siteSlug??null:null,H=er({virtualMcpId:e,sandboxUrl:p}),[f,A]=w.useState(null),[De,C]=w.useState(null),[ce,B]=w.useState(null),[ne,F]=w.useState(0),[ie,le]=w.useState(void 0),[ye,X]=w.useState(null),[Z,ge]=w.useState(null),[se,L]=w.useState([]),ze=w.useRef(null),[nt,Le]=w.useState(se.length);nt!==se.length&&(Le(se.length),requestAnimationFrame(()=>{ze.current&&(ze.current.scrollTop=0)}));const[Me,Y]=w.useState(0),[ee,Fe]=w.useState(null),[Pe,_e]=w.useState(null),[ue,he]=w.useState(null),[je,ke]=w.useState(!0),[ve,ae]=w.useState(!1),[Ae,Ee]=w.useState(!1),fe=w.useRef(null),[$,pe]=w.useState(y),[Ce,be]=w.useState(y);y&&!Ce&&(be(!0),pe(!0),A(null),C(null),B(null),L([])),!y&&Ce&&be(!1);const[Se,q]=w.useState(null),[oe,de]=w.useState(void 0),[Re,me]=w.useState([]),[N,re]=w.useState(0),[I,Be]=w.useState(0),[ut,Te]=w.useState(null),[We,Ie]=w.useState(null),[bn,Sn]=w.useState(null),Ds=Ca(),Ps=`${g}/${e}/${r}`,Xt=Ya({orgSlug:g,virtualMcpId:e,branch:r}),[As,Cs]=w.useState(b),[Ms,Bs]=w.useState(S),[Ks,Ls]=w.useState(m);(As!==b||Ms!==S||Ks!==m)&&(queueMicrotask(()=>Xt.flush()),Cs(b),Bs(S),Ls(m),A(null),C(null),B(null),F(0),X(null),ge(null),Be(0),Te(null),Ie(null),L([]),Y(t=>t+1),pe(!1),q(null),de(void 0),me([]),re(t=>t+1));const Ne=Ja({orgSlug:g,virtualMcpId:e,branch:r}),Kt=ho((t,s)=>{Ne.mutate({blockKey:t,data:s},{onSuccess:()=>u?.(),onError:a=>Q.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:a.message}))})}),Zt=Qa({orgSlug:g,virtualMcpId:e,branch:r}),[Nt,Lt]=w.useState(!1),He=w.useRef(null),st=w.useRef(null),at=w.useRef(null),en=w.useRef({}),Ze=w.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null});if(!d||P||R)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(Zn,{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:i("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const Fs=Xa(o),Ve=!!m,Ye=Ve?null:Za(Fs,b,S),k=Ve?m:Ye?.key??null,tn=Ve&&m?o[m]:void 0,xn=Ve&&m&&tn?eo(m,tn):Ve&&m?m:"",Ft=!Ve&&k&&o[k]?o[k]:null,nn=$&&o&&l&&k&&Ye?Hn(o,{kind:"page",pageKey:k,pageName:String(Ye.name??""),path:String(Ye.path??"")},l):null,Is=$?Ft?.seo:void 0,sn=oe!==void 0?oe:Is,Os=$?qo(sn):void 0,$s=nn?.seoTypeOptions??[],zs=$&&l?Go(l):"",yn=Se??Os??{},an=$&&nn?Wo(yn,nn):null,Hs=$&&an&&Yo(sn)?qt(an,l):null,Us=$?Jo(o,l)?.seoData:void 0,qe=Ve?[{label:"Default",sections:[{__resolveType:m}]}]:Nr(Ft?.sections,o??{}),It=qe.length>1,Oe=Math.min(ne,qe.length-1),dt=qe[Oe],G=dt?.sections??[],Ue=Gt(G,o),_n=!Ve&&to(Ft?.sections);if(Ve&&m&&bn!==m){Sn(m);const t=G[0],s=Ue[0];if(t&&s){A(0),Be(0),L([]);const a=St(t,s,o);a&&(C(a.data),B(a.resolveType),Ie(null),Te(null))}}!Ve&&bn!==null&&Sn(null),Ze.current={rawSections:G,parsedSections:Ue,decofile:o??{},activePageKey:k,pageVariants:qe,variantIndex:Oe,sectionVariantIndex:I,selectedSectionIndex:f};const qs=()=>({multivariate:_n,index:Oe,variants:qe.map(t=>({rule:t.rule}))}),jn=(t,s)=>{if(!E)return;if(!k||!_n||t.length<=1){E(null);return}const a=zn(k,{multivariate:!0,index:s,variants:t},o,l);E(a.length>0?a:null)},Et=(t,s,a)=>{if(!E)return;if(!k){E(null);return}const c=qs(),v=zn(k,c,o,l);if(!t||s<0){E(v.length>0?v:null);return}const j=yo({pageKey:k,page:c,sectionIndex:s,sectionLazy:Ue[s]?.isLazy??!1,mvObj:t,selectedVariantIndex:a,decofile:o,meta:l}),_=[...v,...j];E(_.length>0?_:null)},mt=(t,s,a,c=f??-1,v=!1)=>{const j=tt(t,s);if(!j){C(null),B(null),Ie(null),Te(null),v&&Et(null,c,a);return}const D=Kn(j,lt)[a];if(!D){C(null),B(null),Ie(null),Te(null),v&&Et(null,c,a);return}const te=io(D.value,o);C(te?.data??null),B(te?.resolveType??null);const{resolveType:M,formValue:z}=Pt(D.rule,o,l??void 0);Ie(M),Te(z),v&&Et(j,c,a)},Vt=x?.index;if(x!==void 0&&(x?.seq??null)!==ie&&(le(x?.seq??null),typeof Vt=="number")){const t=G[Vt],s=Ue[Vt];if(t&&s)if(A(Vt),Be(0),L([]),Y(a=>a+1),s.isMultivariate)mt(t,s,0,Vt);else{const a=St(t,s,o);a?(C(a.data),B(a.resolveType)):(C(null),B(null)),Ie(null),Te(null)}}const Ot={orgSlug:g,virtualMcpId:e,branch:r,previewUrl:p??void 0,siteSlug:O},on=ce&&l?qt(ce,l):null,Je=(t,s)=>{if(!k)return;He.current&&(clearTimeout(He.current),He.current=null),at.current&&(clearTimeout(at.current),at.current=null),st.current&&(clearTimeout(st.current),st.current=null);const a=Ct(o,k,t,Oe,qe);Ne.mutate({blockKey:k,data:a},{onSuccess:()=>s?.onSuccess?.()??u?.(),onError:c=>Q.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:c.message}))})},Rt=()=>{A(null),C(null),B(null),Be(0),Te(null),Ie(null),L([]),Y(t=>t+1)},Gs=(t,s)=>{He.current&&clearTimeout(He.current);const a=Ze.current.sectionVariantIndex;He.current=setTimeout(()=>{const{rawSections:c,parsedSections:v,decofile:j,activePageKey:_,pageVariants:D,variantIndex:te}=Ze.current,M=c[s];if(!M)return;const z=v[s];if(!z)return;if(z.isSavedBlock){const W=z.isLazy?M.section?.__resolveType??M.__resolveType:M.__resolveType;Ne.mutate({blockKey:W,data:t},{onSuccess:()=>u?.(),onError:J=>Q.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:J.message}))});return}if(!_)return;const U={...j[_]},we=[...c];if(z.isMultivariate){const W=tt(M,z);if(!W||!_)return;const J=jo(W,a,t);we[s]=xt(M,z,J)}else if(z.isHidden){const W=os(M.__resolveType),J=W?{...M.section}:{...M},Ke=Array.isArray(J.variants)?[...J.variants]:[];Ke[0]&&(Ke[0]={...Ke[0],value:t}),J.variants=Ke,W?we[s]={...M,section:J}:we[s]=J}else z.isLazy?we[s]={...M,section:t}:we[s]=t;if(D.length>1){const W=U.sections,J=[...W?.variants??[]];J[te]&&(J[te]={...J[te],value:we}),U.sections={...W,variants:J}}else U.sections=we;Ne.mutate({blockKey:_,data:U},{onSuccess:()=>u?.(),onError:W=>Q.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:W.message}))})},pn)},Ws=t=>{A(t),Be(0),L([]),Y(v=>v+1);const s=G[t],a=Ue[t];if(!s||!a)return;if(a.isMultivariate){mt(s,a,0,t);return}const c=St(s,a,o);if(!c){C(null),B(null),Ie(null),Te(null),Et(null,t,0);return}C(c.data),B(c.resolveType),Ie(null),Te(null),Et(null,t,0)},En=t=>{const s=t;C(s),f!==null&&Gs(s,f)},rn=t=>{if(!k||!o||!l||!Ye)return;const s={kind:"page",pageKey:k,pageName:String(Ye.name??""),path:String(Ye.path??"")},a=Hn(o,s,l);a&&Xt.save(k,()=>{const c=Ds.getQueryData(Ma.decofile(Ps))?.[k];if(!c||typeof c!="object"||c===null||Array.isArray(c))return null;const v={...c,...en.current};return en.current={},t?.raw!==void 0?{...v,seo:t.raw}:t?.inner!==void 0?Xo(s,a,v,t.inner):v})},Ys=(t,s)=>{k&&(en.current[t]=s,rn())},Js=(t,s)=>{if(!k)return;const a=Mt([...G],t,s);f!==null&&(f===t?A(s):t<f&&s>=f?A(f-1):t>f&&s<=f&&A(f+1)),Je(a)},Qs=t=>{if(!k)return;const s=G.filter((a,c)=>c!==t);f===t?Rt():f!==null&&f>t&&A(f-1),Je(s)},Xs=t=>{if(!k)return;const s=G[t];if(!s)return;const a=[...G];a.splice(t+1,0,xo(s)),f!==null&&f>t&&A(f+1),Je(a)},Zs=t=>{if(!k)return;const s=G[t],a=Ue[t];if(!s||!a||a.isMultivariate)return;const c=a.isHidden?bo(s):So(s);if(!c)return;const v=[...G];v[t]=c,f===t&&Rt(),Je(v)},ea=t=>{if(!k)return;const s=G[t],a=Ue[t];if(!s||!a||a.isMultivariate)return;const c=vo(s);if(!c)return;const v=[...G];v[t]=c,f===t&&Rt(),Je(v)},ta=t=>{if(!k)return;const s=G[t],a=Ue[t];if(!s||!a?.isSavedBlock)return;const c=St(s,a,o);if(!c?.data)return;const{name:v,...j}=c.data,_=[...G];a.isLazy?_[t]={...s,section:j}:_[t]=j,f===t&&Rt(),Je(_)},na=t=>{if(!k)return;const s=[...G,{__resolveType:t.resolveType}],a=s.length-1;Je(s,{onSuccess:()=>{ae(!1),A(a),Be(0),L([]),Y(_=>_+1);const c=s[a],v=Gt(s,o)[a];if(!c||!v)return;if(v.isMultivariate){mt(c,v,0);return}const j=St(c,v,o);if(!j){C(null),B(null),Ie(null),Te(null);return}C(j.data),B(j.resolveType),Ie(null),Te(null)}})},Rn=t=>{fe.current=t.append,ae(!0)},sa=t=>{const s=fe.current;if(!s){na(t);return}s({__resolveType:t.resolveType}),ae(!1),fe.current=null},aa=t=>{if(f===null)return;const s=G[f],a=Ue[f];!s||!a?.isMultivariate||(Be(t),L([]),Y(c=>c+1),mt(s,a,t,f,!0))},oa=t=>{if(f===null||!k)return;const s=G[f],a=Ue[f];if(!s||!a?.isMultivariate)return;const c=tt(s,a);if(!c)return;const v=po(c,t);if(!v){Q.error(i("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const j=[...G];j[f]=xt(s,a,v);const _=v.variants;let D=I;t===I?D=Math.min(t,_.length-1):t<I&&(D=I-1),Be(D),L([]),Y(te=>te+1),mt(j[f],a,D),Je(j)},ra=t=>{if(f===null||!k)return;const s=G[f],a=Ue[f];if(!s||!a?.isMultivariate)return;const c=tt(s,a);if(!c)return;const v=go(c,t),j=[...G];j[f]=xt(s,a,v);const _=t+1;Be(_),L([]),Y(D=>D+1),mt(j[f],a,_),Je(j)},ia=(t,s)=>{if(f===null||!k||t===s)return;const a=G[f],c=Ue[f];if(!a||!c?.isMultivariate)return;const v=tt(a,c);if(!v)return;const j=mo(v,t,s),_=[...G];_[f]=xt(a,c,j);let D=I;I===t?D=s:t<I&&s>=I?D=I-1:t>I&&s<=I&&(D=I+1),Be(D),mt(_[f],c,D),Je(_)},ln=t=>{const s=t??f;if(s===null||!k)return;const a=G[s],c=Ue[s];if(!a||!c)return;const v=lo(a,c);if(!v){Q.error(i("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const j=[...G];j[s]=v.section;const _=Gt(j,o)[s];if(!_?.isMultivariate){Q.error(i("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}A(s),Be(v.newVariantIndex),L([]),Y(D=>D+1),mt(v.section,_,v.newVariantIndex,s),Je(j)},la=()=>{if(f===null||!k)return;const t=G[f],s=Ue[f];if(!t||!s?.isMultivariate)return;const a=tt(t,s);if(!a)return;const c=fo(t,s,a);if(!c){Q.error(i("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const v=[...G];v[f]=c;const j=Gt(v,o)[f];if(!j)return;Be(0),Ie(null),Te(null),L([]),Y(D=>D+1);const _=St(c,j,o);_?(C(_.data),B(_.resolveType)):(C(null),B(null)),Et(null,f,0),Je(v)},ca=async t=>{if(ee===null||!k)return;const s=fn(t,o);if(s){Q.error(s);return}const a=G[ee],c=Ue[ee];if(!a||!c)return;const v=St(a,c,o);if(!v){Q.error(i("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const j={...v.data,name:t};try{await Ne.mutateAsync({blockKey:t,data:j});const _=[...G];_[ee]={__resolveType:t},await Ne.mutateAsync({blockKey:k,data:Ct(o,k,_,Oe,qe)}),f===ee&&Rt(),Fe(null),Q.success(i("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),u?.()}catch(_){Q.error(_ instanceof Error?_.message:i("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"))}},wn=dt?.rule;if(It&&f===null&&Z===null&&wn){const{resolveType:t,formValue:s}=Pt(wn,o??{},l??void 0);ge(t),X(s)}const $t=l?no(l):[],kn=l&&o?so(l,o):[],ua=!Ve&&!!(H&&l&&o),da=Z&&l?qt(Z,l):null,wt=()=>{st.current&&(clearTimeout(st.current),st.current=null),at.current&&(clearTimeout(at.current),at.current=null)},Dt=async(t,s)=>{if(!(_o(s,t,l)>0))try{await Zt.mutateAsync({blockKey:t})}catch(a){Q.error(a instanceof Error?a.message:i("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"))}},Tn=t=>{st.current&&clearTimeout(st.current),st.current=setTimeout(()=>{const{activePageKey:s,decofile:a,variantIndex:c}=Ze.current;if(!s)return;const v={...a[s]},j={...v.sections},_=[...j.variants??[]],D=_[c],te=D?.rule;if(kt(te,a,l)){const M=te?.__resolveType??"",z=a[M],U=typeof z?.name=="string"?z.name:M,{__resolveType:we,...W}=t;Ne.mutate({blockKey:M,data:Tt(we??"",W,U)},{onSuccess:()=>u?.(),onError:J=>Q.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:J.message}))});return}D&&(_[c]={...D,rule:t}),v.sections={...j,variants:_},Ne.mutate({blockKey:s,data:v},{onSuccess:()=>u?.(),onError:M=>Q.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:M.message}))})},pn)},ma=t=>{ge(t);const s=t?Fn(t,l):{__resolveType:In};X(t?s:{}),Tn(s)},fa=t=>{const s=t;X(s);const a=Z?{__resolveType:Z,...s}:{...s};Tn(a)},pa=async t=>{wt();const{activePageKey:s,decofile:a,variantIndex:c}=Ze.current;if(!s)return;const v=a[s],j=v?.sections;if(!j||typeof j!="object"||Array.isArray(j))return;const _=j;if(!Array.isArray(_.variants))return;const D=[..._.variants],te=D[c];if(!te)return;const M=At(te.rule,a,l),z=Yt(t);D[c]={...te,rule:z};const U={...a,[s]:{...v,sections:{..._,variants:D}}},{resolveType:we,formValue:W}=Pt(z,U,l??void 0);ge(we),X(W);try{await Ne.mutateAsync({blockKey:s,data:U[s]}),M&&M!==t&&await Dt(M,U),u?.()}catch(J){Q.error(J instanceof Error?J.message:i("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}},Nn=t=>{at.current&&clearTimeout(at.current);const{selectedSectionIndex:s,sectionVariantIndex:a}=Ze.current;s!==null&&(at.current=setTimeout(()=>{const{rawSections:c,parsedSections:v,decofile:j,activePageKey:_,pageVariants:D,variantIndex:te}=Ze.current;if(!_)return;const M=c[s],z=v[s];if(!M||!z?.isMultivariate)return;const U=tt(M,z);if(!U)return;const W=(U.variants??[])[a]?.rule;if(kt(W,j,l)){const xe=W?.__resolveType??"",Qe=j[xe],rt=typeof Qe?.name=="string"?Qe.name:xe,{__resolveType:gt,...it}=t;Ne.mutate({blockKey:xe,data:Tt(gt??"",it,rt)},{onSuccess:()=>u?.(),onError:ht=>Q.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:ht.message}))});return}const J=Ln(U,a,t),Ke=[...c];Ke[s]=xt(M,z,J);const et=Ct(j,_,Ke,te,D);Ne.mutate({blockKey:_,data:et},{onSuccess:()=>u?.(),onError:xe=>Q.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:xe.message}))})},pn))},ga=t=>{Ie(t);const s=t?Fn(t,l):{__resolveType:In};Te(t?s:{}),Nn(s)},ha=t=>{const s=t;Te(s);const a=We?{__resolveType:We,...s}:{...s};Nn(a)},va=async t=>{wt();const{selectedSectionIndex:s,sectionVariantIndex:a,rawSections:c,parsedSections:v,decofile:j,activePageKey:_,pageVariants:D,variantIndex:te}=Ze.current;if(s===null||!_)return;const M=c[s],z=v[s];if(!M||!z?.isMultivariate)return;const U=tt(M,z);if(!U)return;const we=U.variants??[],W=At(we[a]?.rule,j,l),J=Yt(t),Ke=Ln(U,a,J),et=[...c];et[s]=xt(M,z,Ke);const xe=Ct(j,_,et,te,D),Qe={...j,[_]:xe},{resolveType:rt,formValue:gt}=Pt(J,Qe,l??void 0);Ie(rt),Te(gt);try{await Ne.mutateAsync({blockKey:_,data:xe}),W&&W!==t&&await Dt(W,Qe),u?.()}catch(it){Q.error(it instanceof Error?it.message:i("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}};if(!Ve&&!Ye)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:i("sectionsEditor.sectionsEditor.noPageFound",{currentPath:b})});if(Ve&&!tn)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:i("sectionsEditor.sectionsEditor.globalBlockNotFound")});const ft=f!==null?Ue[f]??null:null,Vn=f!==null?G[f]:null,Dn=Vn&&ft?.isMultivariate?tt(Vn,ft):null,bt=Dn?Kn(Dn,lt):[],cn=Math.min(I,Math.max(bt.length-1,0)),zt=bt[cn]??null,pt=ft?.isMultivariate===!0,Pn=f!==null&&ft!==null,Ht=Pn&&(pt||!!(on&&De)),ba=Ht&&!Ve&&ft?.isSavedBlock===!0,ot=Ve||ba,Sa=Ve?xn:ft?.label??"",xa=We&&l?qt(We,l):null,un=Ht&&(!Ve||se.length>0)?Ve?[xn,...se]:[Ye.name,ft.label,...pt&&zt?[zt.label]:[],...se]:[],ya=$&&Ye?[Ye.name,"SEO",...Re]:[],Ut=$?ya:ot?un.length>0?un:[Sa]:un,_a=!$&&!Ve&&pt&&se.length===0,An=()=>{if(!k)return;wt(),He.current&&(clearTimeout(He.current),He.current=null);const t=o[k],s=co(t.sections,G);if(!s)return;const a=uo(s);Ne.mutate({blockKey:k,data:{...t,sections:s}},{onSuccess:()=>{F(a),A(null),C(null),B(null),L([]),X(null),ge(null)},onError:c=>Q.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:c.message}))})},dn=(t,s,a)=>{if(!k)return;wt(),He.current&&(clearTimeout(He.current),He.current=null);const c=o[k],v=c.sections;if(!v||typeof v!="object"||Array.isArray(v))return;const j=v;if(!Array.isArray(j.variants))return;const _=t([...j.variants]);if(!_)return;const D=Eo(j,_),te={...o,[k]:{...c,sections:D}};Ne.mutate({blockKey:k,data:te[k]},{onSuccess:()=>{s?.(),a&&Dt(a,te)},onError:M=>Q.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:M.message}))})},ja=t=>{_e(null),F(t),A(null),C(null),B(null),L([]);const s=qe[t]?.rule,{resolveType:a,formValue:c}=Pt(s,o??{},l??void 0);ge(a),X(c),jn(qe.map(v=>({rule:v.rule})),t)},Ea=(t,s)=>{if(t===s)return;let a=Oe;Oe===t?a=s:t<Oe&&s>=Oe?a=Oe-1:t>Oe&&s<=Oe&&(a=Oe+1),F(a);const c=Mt(qe.map(v=>({rule:v.rule})),t,s);jn(c,a),dn(v=>Mt(v,t,s))},Ra=t=>{const s=qe[t]?.rule,a=At(s,o??{},l??void 0);dn(c=>c.length<=1?null:(c.splice(t,1),c),()=>{qe.length-1===1?F(0):t<Oe?F(Oe-1):t===Oe&&F(Math.max(0,t-1)),A(null),C(null),B(null),L([]),X(null),ge(null)},a)},wa=t=>{dn(s=>Ro(s,t),()=>{F(t+1),A(null),C(null),B(null),L([]),X(null),ge(null)})},ka=async(t,s)=>{wt(),He.current&&(clearTimeout(He.current),He.current=null);const a=Ze.current.activePageKey,c=Ze.current.decofile;if(!a)return;const v=c[a],j=v.sections;if(!j||typeof j!="object"||Array.isArray(j))return;const _=j;if(!Array.isArray(_.variants))return;const D=[..._.variants],te=D[t];if(!te?.rule||typeof te.rule!="object"){Q.error(i("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const M=te.rule,z=s.trim();Lt(!0);try{if(!z){if(!kt(M,c,l)){_e(null);return}const et=M.__resolveType??"";D[t]={...te,rule:On(M,c,l)};const xe={...c,[a]:{...v,sections:{..._,variants:D}}};await Ne.mutateAsync({blockKey:a,data:xe[a]}),await Dt(et,xe),_e(null),u?.();return}const U=$n(M,c,l);if(!U){Q.error(i("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(U.blockKey){await Ne.mutateAsync({blockKey:U.blockKey,data:Tt(U.resolveType,U.data,z)}),_e(null),u?.();return}const we=mn(z),W=fn(we,c);if(W){Q.error(W);return}const J=Tt(U.resolveType,U.data,z);let Ke=null;try{await Ne.mutateAsync({blockKey:we,data:J}),Ke=we,D[t]={...te,rule:Yt(we)},await Ne.mutateAsync({blockKey:a,data:{...v,sections:{..._,variants:D}}}),Ke=null}catch(et){throw Ke&&await Zt.mutateAsync({blockKey:Ke}).catch(()=>{}),et}_e(null),Q.success(i("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:z})),u?.()}catch(U){Q.error(U instanceof Error?U.message:i("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Lt(!1)}},Ta=async(t,s)=>{wt(),He.current&&(clearTimeout(He.current),He.current=null);const{selectedSectionIndex:a,rawSections:c,parsedSections:v,decofile:j,activePageKey:_,pageVariants:D,variantIndex:te}=Ze.current;if(a===null||!_)return;const M=c[a],z=v[a];if(!M||!z?.isMultivariate)return;const U=tt(M,z);if(!U)return;const we=U.variants??[],W=we[t];if(!W?.rule||typeof W.rule!="object"){Q.error(i("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const J=W.rule,Ke=s.trim();Lt(!0);const et=async xe=>{const Qe={...U,variants:xe},rt=[...c];rt[a]=xt(M,z,Qe);const gt=Ct(j,_,rt,te,D);return await Ne.mutateAsync({blockKey:_,data:gt}),{...j,[_]:gt}};try{if(!Ke){if(!kt(J,j,l)){he(null);return}const ht=J.__resolveType??"",Bn=[...we];Bn[t]={...W,rule:On(J,j,l)};const Aa=await et(Bn);await Dt(ht,Aa),he(null),u?.();return}const xe=$n(J,j,l);if(!xe){Q.error(i("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(xe.blockKey){await Ne.mutateAsync({blockKey:xe.blockKey,data:Tt(xe.resolveType,xe.data,Ke)}),he(null),u?.();return}const Qe=mn(Ke),rt=fn(Qe,j);if(rt){Q.error(rt);return}const gt=Tt(xe.resolveType,xe.data,Ke);let it=null;try{await Ne.mutateAsync({blockKey:Qe,data:gt}),it=Qe;const ht=[...we];ht[t]={...W,rule:Yt(Qe)},await et(ht),it=null}catch(ht){throw it&&await Zt.mutateAsync({blockKey:it}).catch(()=>{}),ht}he(null),Q.success(i("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:Ke})),u?.()}catch(xe){Q.error(xe instanceof Error?xe.message:i("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Lt(!1)}},Cn=()=>{Rt()},Na=t=>{q(t),rn({inner:t})},Va=t=>{de(t),rn({raw:t})},Da=()=>{q(null),me([])},Pa=()=>re(t=>t+1),Mn=t=>{if($){if(t===0){Xt.flush(),pe(!1),q(null),de(void 0),me([]),re(a=>a+1),T?.();return}if(t===1){me([]),re(a=>a+1);return}me(Re.slice(0,t-1)),re(a=>a+1);return}if(Ve){L(se.slice(0,t)),Y(a=>a+1);return}if(t===0){Cn();return}if(t===1){L([]),Y(a=>a+1);return}if(pt&&t===2){L([]),Y(a=>a+1);return}const s=pt?2:1;L(se.slice(0,t-s))};return n.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[n.jsx("div",{className:"shrink-0",children:ot||Ht||$?n.jsxs("div",{className:$e("border-b px-3 py-2.5",ot&&"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:[Ut.length>1&&n.jsx("button",{type:"button",onClick:()=>Mn(wo(Ut.length,{isMultivariateSectionTop:_a})),title:i("sectionsEditor.sectionsEditor.back"),"aria-label":i("sectionsEditor.sectionsEditor.back"),className:$e("shrink-0 inline-flex size-6 items-center justify-center rounded-md transition-colors",ot?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:n.jsx(bs,{className:"size-4"})}),!Ve&&It&&dt&&n.jsxs("button",{type:"button",onClick:Cn,title:i("sectionsEditor.sectionsEditor.editingInVariant",{variant:dt.label}),className:$e("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",Tr),children:[n.jsx(Ns,{rule:Bt(dt.rule,o??{},l??void 0),matchers:$t}),n.jsx("span",{className:"max-w-[160px] truncate",children:dt.label})]}),n.jsx("nav",{"aria-label":i("sectionsEditor.sectionsEditor.editingBreadcrumb"),className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:Ut.map((t,s)=>{const a=s===Ut.length-1,c=hs(t);return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[s>0&&n.jsx(Ss,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>Mn(s),title:c,className:$e("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",a?ot?"font-semibold text-global-section-fg dark:text-global-section-fg-dark":"font-medium text-foreground":ot?"text-foreground/80":"text-muted-foreground",ot?"hover:bg-global-section/15":"hover:bg-accent hover:text-accent-foreground"),children:c})]},`${c}-${s}`)})}),ot&&n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(Ao,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(jt,{side:"bottom",className:"max-w-[260px]",children:i("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),Pn&&!pt&&!ft?.isHidden&&k&&n.jsx(Jn,{onClick:()=>ln()})]}),ot&&n.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:i("sectionsEditor.sectionsEditor.globalSectionBanner")})]}):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(Vr,{pageKey:k,initialName:Ye.name,initialPath:Ye.path,onFieldChange:Ys})}),n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Xe,{type:"button",variant:"ghost",size:"icon","aria-label":i("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:()=>pe(!0),children:n.jsx(Vo,{size:14})})}),n.jsx(jt,{side:"bottom",children:i("sectionsEditor.sectionsEditor.editSeo")})]}),n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Xe,{type:"button",variant:"ghost",size:"icon","aria-label":i("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>V&&k?V(k):Ee(!0),children:n.jsx(Do,{size:14})})}),n.jsx(jt,{side:"bottom",children:i("sectionsEditor.sectionsEditor.viewJson")})]}),n.jsx(Jn,{onClick:An})]})}),$?n.jsx(Jt,{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:Ft&&k?n.jsx(Qo,{rawSeo:sn,innerSeo:yn,defaultResolveType:zs,seoSchema:Hs,activeResolveType:an,seoTypeOptions:$s,formResetKey:N,siteDefaultSeo:Us,onBreadcrumbChange:me,onPersistRaw:Va,onInnerChange:Na,onClearForm:Da,onBumpFormKey:Pa}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:i("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})}):Ht?n.jsxs(Jt,{viewportRef:ze,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[pt&&bt.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(ao,{listKey:`${k??""}:${f??""}`,variants:bt.map((t,s)=>({index:s,label:t.label})),selectedIndex:cn,onSelect:aa,onRename:he,onDuplicate:ra,onDelete:oa,onRemoveAll:la,onReorder:ia,onAdd:()=>ln()}),pt&&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:i("sectionsEditor.sectionsEditor.variantRule")}),n.jsx(Qn,{currentRt:We??"",currentLabel:Wt(zt?.rule,o??{},lt,l??void 0),currentGlobalKey:At(zt?.rule,o??{},l??void 0)??void 0,matchers:$t,globals:kn,onSelect:ga,onSelectGlobal:va,schema:xa,formValue:ut,onChange:ha,formKey:`${f??"none"}:${cn}:${We??""}`,formWrapperClassName:"pt-1",meta:l??void 0,decofile:o,onSaveReferencedBlock:Kt,sandbox:Ot})]})]}),n.jsx(Yn,{activeSchema:on,formValue:De,formResetKey:Me,onFormChange:En,onBreadcrumbChange:L,breadcrumbPath:se,emptyMessage:i("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:l,decofile:o,onSaveReferencedBlock:Kt,sandbox:Ot,previewBaseUrl:H,onRequestAddSection:Rn})]}):Ve?n.jsx(Jt,{viewportRef:ze,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx(Yn,{activeSchema:on,formValue:De,formResetKey:Me,onFormChange:En,onBreadcrumbChange:L,breadcrumbPath:se,emptyMessage:i("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:l,decofile:o,onSaveReferencedBlock:Kt,sandbox:Ot,previewBaseUrl:H,onRequestAddSection:Rn})}):n.jsxs(Jt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[It&&k&&n.jsx(Rr,{listKey:k,variants:qe,activeIndex:Oe,decofile:o??{},meta:l,matchers:$t,onSelect:ja,onReorder:Ea,onRename:_e,onDuplicate:wa,onDelete:Ra,onAdd:An}),It&&Z!==null&&n.jsxs("div",{className:$e("px-3 border-b",je?"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":je,children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:i("sectionsEditor.sectionsEditor.variantRule")}),je?n.jsx(Po,{className:"size-3.5 shrink-0 text-muted-foreground"}):n.jsx(ko,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),je&&n.jsx("div",{className:$e("space-y-3",Nt&&"pointer-events-none opacity-50"),children:n.jsx(Qn,{currentRt:Z,currentLabel:Wt(dt?.rule,o??{},lt,l??void 0),currentGlobalKey:At(dt?.rule,o??{},l??void 0)??void 0,matchers:$t,globals:kn,onSelect:ma,onSelectGlobal:pa,schema:da,formValue:ye,onChange:fa,formKey:`${Oe}:${Z??""}`,formWrapperClassName:"space-y-3",meta:l??void 0,decofile:o,onSaveReferencedBlock:Kt,sandbox:Ot})})]}),n.jsx("div",{className:"p-2 pt-3",children:n.jsx(vr,{listKey:`${k??""}-${Oe}`,rawSections:G,sections:Ue,meta:l,selectedIndex:f,onSelect:Ws,onReorder:Js,onDelete:Qs,onDuplicate:Xs,onMakeReusable:Fe,onToggleHidden:Zs,onToggleLazy:ea,onAddVariant:ln,onDetach:ta,onAddSection:()=>ae(!0),canAddSection:ua})})]}),n.jsx(oo,{open:ee!==null,onOpenChange:t=>{t||Fe(null)},defaultBlockId:ee!==null?mn(Ue[ee]?.label??""):"",isPending:Ne.isPending,onSubmit:ca}),H&&n.jsx(tr,{open:ve,onOpenChange:t=>{ae(t),t||(fe.current=null)},meta:l,decofile:o,previewBaseUrl:H,onSelect:sa}),Ae&&k&&o&&n.jsx(ro,{open:Ae,onOpenChange:Ee,pageKey:k,decofile:o}),Pe!==null&&n.jsx(qn,{open:!0,initialName:kt(qe[Pe]?.rule,o??{},l??void 0)?Wt(qe[Pe]?.rule,o??{},lt,l??void 0):"",autoLabel:lt(Bt(qe[Pe]?.rule,o??{},l??void 0)),isPending:Nt,onSubmit:async t=>{await ka(Pe,t)},onOpenChange:t=>{!t&&!Nt&&_e(null)}}),ue!==null&&n.jsx(qn,{open:!0,initialName:kt(bt[ue]?.rule,o??{},l??void 0)?Wt(bt[ue]?.rule,o??{},lt,l??void 0):"",autoLabel:lt(Bt(bt[ue]?.rule,o??{},l??void 0)),isPending:Nt,onSubmit:async t=>{await Ta(ue,t)},onOpenChange:t=>{!t&&!Nt&&he(null)}})]})}export{jc as SectionsEditor};
|