decocms 4.158.2 → 4.158.3
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-qIC_xSrj.js → AlertCircle-YkJszhyi.js} +1 -1
- package/dist/client/assets/{AreaChart-HkmLkZy2.js → AreaChart-D6sbwDYG.js} +1 -1
- package/dist/client/assets/{ArrowUp-Dv6dW9X3.js → ArrowUp-DPqqjxMs.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-CQVsRNYA.js → ArrowUpRight-DCcGUPRq.js} +1 -1
- package/dist/client/assets/{Check-Dw0yb53j.js → Check-BanZqVS6.js} +1 -1
- package/dist/client/assets/{CheckCircle-Dud6wUS9.js → CheckCircle-CiwBnetw.js} +1 -1
- package/dist/client/assets/{ChevronDown-DvIRW9jR.js → ChevronDown-CUX5BVRH.js} +1 -1
- package/dist/client/assets/{ChevronRight-C9FO0Ghk.js → ChevronRight-D7bdokHb.js} +1 -1
- package/dist/client/assets/{ChevronUp-C8zQGFtm.js → ChevronUp-BvwOltu0.js} +1 -1
- package/dist/client/assets/{Copy01-DBF2xtLX.js → Copy01-D8PXcQlN.js} +1 -1
- package/dist/client/assets/{CpuChip01-Bm59eh5F.js → CpuChip01-Sn9YZC9Z.js} +1 -1
- package/dist/client/assets/{DotsVertical-A7mKqECE.js → DotsVertical-Dh5AhfNj.js} +1 -1
- package/dist/client/assets/{Eye-BQPVNie2.js → Eye-BjzBo9pu.js} +1 -1
- package/dist/client/assets/{FilterLines-CLE41-vv.js → FilterLines-EqTRXCN6.js} +1 -1
- package/dist/client/assets/{HardDrive-Iz7lTyC4.js → HardDrive-CXeNKlS_.js} +1 -1
- package/dist/client/assets/{Key01-Dj3z1dEv.js → Key01-B_NmjlUq.js} +1 -1
- package/dist/client/assets/{LayoutLeft-DMB2s9jy.js → LayoutLeft-BJ-rrVM8.js} +1 -1
- package/dist/client/assets/{LinkExternal01-BiWFfTiD.js → LinkExternal01-B6_9NVrP.js} +1 -1
- package/dist/client/assets/{LogOut01-CmE_ZaFu.js → LogOut01-CPJ6BI1C.js} +1 -1
- package/dist/client/assets/{Monitor01-DpjnSDYR.js → Monitor01-BW-aur37.js} +1 -1
- package/dist/client/assets/{Palette-Cl97ZzbL.js → Palette-SJkRJpeD.js} +1 -1
- package/dist/client/assets/{Play-BpgcQFKU.js → Play-CdlOcV-y.js} +1 -1
- package/dist/client/assets/{Plus-sJs2USHB.js → Plus-CCR2dl91.js} +1 -1
- package/dist/client/assets/{SearchLg-DEgv-uG-.js → SearchLg-BROgsk9l.js} +1 -1
- package/dist/client/assets/{SearchMd-D9FDebLE.js → SearchMd-BBtCjgk8.js} +1 -1
- package/dist/client/assets/{Settings02-Bl_0yVE7.js → Settings02--NDw0tr0.js} +1 -1
- package/dist/client/assets/{Shield01-BO8-H5xY.js → Shield01-Ss0yQTUj.js} +1 -1
- package/dist/client/assets/{Star01-o2L6nHqw.js → Star01-CntjezXG.js} +1 -1
- package/dist/client/assets/{Stars01-CuVmQ4th.js → Stars01-lkb5ewEZ.js} +1 -1
- package/dist/client/assets/{Stars02-DgSFkiw6.js → Stars02-C2Cbwy_X.js} +1 -1
- package/dist/client/assets/{Sun-DL-zXPtw.js → Sun-MMOSzKiH.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-DC3YBwC_.js → SwitchHorizontal01-3z68UsWg.js} +1 -1
- package/dist/client/assets/{Tool01-DVkbgDKg.js → Tool01-B1U6TeQ7.js} +1 -1
- package/dist/client/assets/{Tool02-GyxJVdhs.js → Tool02-FCeFZNlp.js} +1 -1
- package/dist/client/assets/{Trash01-IiY64zb7.js → Trash01-CUyl1xYR.js} +1 -1
- package/dist/client/assets/{TrendUp01-BnywZeMt.js → TrendUp01-CHXXVD4m.js} +1 -1
- package/dist/client/assets/{Upload01-CHdkzkYk.js → Upload01-ZeBMj0BP.js} +1 -1
- package/dist/client/assets/{User01-Dic8NL9t.js → User01-PMJPa_tN.js} +1 -1
- package/dist/client/assets/{Users01-CxHLm5J9.js → Users01-CqQx5tIk.js} +1 -1
- package/dist/client/assets/{Users03-C-Rx_Rc3.js → Users03-BxaRzrtC.js} +1 -1
- package/dist/client/assets/{X-DTAX3OCa.js → X-Fy7AbE7F.js} +1 -1
- package/dist/client/assets/{XCircle-u8Vikw7a.js → XCircle-CWLIEPUH.js} +1 -1
- package/dist/client/assets/{XClose-DV1DPWGC.js → XClose-Bp_RaZDo.js} +1 -1
- package/dist/client/assets/{Zap-C9po9Mov.js → Zap-CXlonpRe.js} +1 -1
- package/dist/client/assets/{ZapSquare-yY2i-ZE0.js → ZapSquare-BmTk-klu.js} +1 -1
- package/dist/client/assets/{access-gate-DKcnqzVk.js → access-gate-CiM6cp0o.js} +1 -1
- package/dist/client/assets/{add-section-modal-BuZ_NECI.js → add-section-modal-BCa7yMsN.js} +1 -1
- package/dist/client/assets/{agent-icon-DwBPTcr7.js → agent-icon-DAE-QVSX.js} +1 -1
- package/dist/client/assets/{agents-list-CNvUWwLk.js → agents-list-BF4lfGs_.js} +1 -1
- package/dist/client/assets/{ai-providers-BjmN_iJH.js → ai-providers-BzSQnJv2.js} +1 -1
- package/dist/client/assets/{alert-CiHMyreR.js → alert-BwjwMJ_u.js} +1 -1
- package/dist/client/assets/{alert-dialog-Ds78S35S.js → alert-dialog-Bejl4UZW.js} +1 -1
- package/dist/client/assets/{app-editor-CJiIIYx0.js → app-editor-Dp-AZe52.js} +1 -1
- package/dist/client/assets/{auth-B-WF-Fyk.js → auth-CSGt0fLM.js} +1 -1
- package/dist/client/assets/{auth-catchall-dNvPV8tq.js → auth-catchall-C6mjSaOw.js} +1 -1
- package/dist/client/assets/{auth-entry-Dl0epUp1.js → auth-entry-B8bklg_Y.js} +1 -1
- package/dist/client/assets/{auth-split-layout-9KD_aCez.js → auth-split-layout-KfT9Fgv_.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-BSdP7jbF.js → authenticate-and-persist-oauth-DTurxjpA.js} +1 -1
- package/dist/client/assets/{automation-list-row-Dwbyv5TT.js → automation-list-row-als2Xpcd.js} +1 -1
- package/dist/client/assets/{automation-runs-DRI95Blq.js → automation-runs-dOAA8A_J.js} +1 -1
- package/dist/client/assets/{automations-CiegP5qa.js → automations-VwnKPcQS.js} +1 -1
- package/dist/client/assets/{avatar-CksInPMf.js → avatar-B4ZEWEhO.js} +1 -1
- package/dist/client/assets/{badge-BQ6hSN97.js → badge-DoTrxPvS.js} +1 -1
- package/dist/client/assets/{block-document-DtApBc50.js → block-document-CdPdyXou.js} +1 -1
- package/dist/client/assets/{brand-context-hq-Z_9qV.js → brand-context-Cb1cYLDv.js} +1 -1
- package/dist/client/assets/{buckets-DZEZvm_j.js → buckets-BOqpTdJo.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-_IbwEONi.js → bulk-category-panel-CZZu1CRx.js} +1 -1
- package/dist/client/assets/{calendar-Dh6Ay4oq.js → calendar-1BAMPIfo.js} +1 -1
- package/dist/client/assets/{capability-load-error-DmwIYHnQ.js → capability-load-error-CCEEpuHJ.js} +1 -1
- package/dist/client/assets/{card-CSjRjipe.js → card-CISWuoNN.js} +1 -1
- package/dist/client/assets/{category-editor-BIqEh4Eq.js → category-editor-DGLGlS3L.js} +1 -1
- package/dist/client/assets/{chat-context-D64R7wZr.js → chat-context-CoSeVfqX.js} +1 -1
- package/dist/client/assets/{checkbox-CPbhbD1e.js → checkbox-hIdnOQby.js} +1 -1
- package/dist/client/assets/{cli-auth-success-CIKWin3h.js → cli-auth-success-BqjCvyB5.js} +1 -1
- package/dist/client/assets/{collection-detail-Cso7X5xa.js → collection-detail-053oVNcD.js} +1 -1
- package/dist/client/assets/{collection-display-button-0fTpEpjG.js → collection-display-button-BEHwBZFo.js} +1 -1
- package/dist/client/assets/{collection-search-BwFX8J9H.js → collection-search-Dza0Wnqg.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-zuHVMAKO.js → collection-table-wrapper-BJ75h_ci.js} +1 -1
- package/dist/client/assets/{collection-tabs-CvyLDMWR.js → collection-tabs-BQWDYbtI.js} +1 -1
- package/dist/client/assets/{command-57yejGBk.js → command-EKXrfvyu.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-CfO1R-2I.js → commerce-onboarding-DlJYxHQw.js} +1 -1
- package/dist/client/assets/{companions-core-DFao4P_s.js → companions-core-CvQj41-P.js} +1 -1
- package/dist/client/assets/{connect-CNm71Hjc.js → connect-Dis7hEDy.js} +1 -1
- package/dist/client/assets/{connection-QATUkG05.js → connection-BZEuAZZC.js} +1 -1
- package/dist/client/assets/{connection-card-DrJZGb5B.js → connection-card-D9VnLzY1.js} +1 -1
- package/dist/client/assets/{connection-detail-C5oyVr86.js → connection-detail-DkCZJSCg.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-DrZpyl95.js → connection-form-helpers-CwB0lnHg.js} +1 -1
- package/dist/client/assets/{connections-D3o8P-Wb.js → connections-DFaFU1nP.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-s13SK9y4.js → decopilot-sse-pool-ddxDh-T3.js} +1 -1
- package/dist/client/assets/{dialog-C7c6o6FP.js → dialog-BAhwXLtu.js} +1 -1
- package/dist/client/assets/{domain-settings-Mv5ZBGq6.js → domain-settings-3XVvFKO7.js} +1 -1
- package/dist/client/assets/{drawer-BKO67Xux.js → drawer-BQd2nFSf.js} +1 -1
- package/dist/client/assets/{dropdown-menu-CbU2D-c0.js → dropdown-menu-8-9RMyUq.js} +1 -1
- package/dist/client/assets/{empty-state-c2j5Ds6E.js → empty-state-C-PMtz9f.js} +1 -1
- package/dist/client/assets/{extract-connection-data-CHzJzImj.js → extract-connection-data-BZa8p_H-.js} +1 -1
- package/dist/client/assets/{file-explorer-DjGGJJmb.js → file-explorer-DXY03oX6.js} +1 -1
- package/dist/client/assets/{form-4dv9_c-3.js → form-BvU3JKee.js} +1 -1
- package/dist/client/assets/{general-DmeeYFiw.js → general-CP6LTcbJ.js} +1 -1
- package/dist/client/assets/{github-repo-picker-BDJbJq_X.js → github-repo-picker-Df-OSUFw.js} +1 -1
- package/dist/client/assets/{hooks-CQZEoVeJ.js → hooks-8r52ZzPh.js} +1 -1
- package/dist/client/assets/{index-C_siJ8jb.js → index-B6Z7PR0c.js} +3 -3
- package/dist/client/assets/{index-DoiyHa2I.js → index-BoLS04lq.js} +1 -1
- package/dist/client/assets/{index-DK327Z1m.js → index-Bvfh6gNn.js} +1 -1
- package/dist/client/assets/{index-C02mImEU.js → index-C4i4dW_0.js} +1 -1
- package/dist/client/assets/{index-BHj_z9is.js → index-CHYDq1Mt.js} +1 -1
- package/dist/client/assets/{index-BUR03TdS.js → index-CfOvqDrF.js} +5 -5
- package/dist/client/assets/{index-Bd5TxvXq.js → index-CqSKWTR6.js} +1 -1
- package/dist/client/assets/{index-ObaO_KTB.js → index-CxoHON83.js} +1 -1
- package/dist/client/assets/{index-DhhX5FGH.js → index-DWIeHGtm.js} +1 -1
- package/dist/client/assets/{index-kTQ08f_V.js → index-DxOAuh92.js} +1 -1
- package/dist/client/assets/{index-redirect-BM56RLHI.js → index-redirect-DzgwSAE0.js} +1 -1
- package/dist/client/assets/{index-CCKcgzR3.js → index-xLZV-a-I.js} +3 -3
- package/dist/client/assets/{input-C0DYQwT4.js → input-BojcyffB.js} +1 -1
- package/dist/client/assets/{integration-icon-qI9RoW2h.js → integration-icon-CArxB5uE.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-BuemHTqS.js → invite-member-dialog-B8ckXtQt.js} +1 -1
- package/dist/client/assets/{label-DwTm1B-u.js → label-CkgoFapr.js} +1 -1
- package/dist/client/assets/{layout-BdY4uzlC.js → layout-C-sM6rKc.js} +1 -1
- package/dist/client/assets/{login-BdD1Za0l.js → login-B4ADCVAk.js} +1 -1
- package/dist/client/assets/{mcp-oauth-Che7vtan.js → mcp-oauth-CHnOKcYw.js} +1 -1
- package/dist/client/assets/{members-CymT0WFw.js → members-faZAtqbf.js} +1 -1
- package/dist/client/assets/{monaco-editor-Cyh8g4ki.js → monaco-editor-CcMhH2ul.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-ym6EVlnJ.js → monitoring-stats-row-BmU63u-K.js} +1 -1
- package/dist/client/assets/{multi-select-D7N-MiN0.js → multi-select-D9AH5ZXR.js} +1 -1
- package/dist/client/assets/{oauth-callback-BUEw7QDH.js → oauth-callback-B8FYxv5p.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-DRD_6RrT.js → oauth-callback-ai-provider-D_wc92xB.js} +1 -1
- package/dist/client/assets/{onboarding-r5XtoSLm.js → onboarding-DPHO6jJq.js} +1 -1
- package/dist/client/assets/{org-layout-DC_k-BB6.js → org-layout-DnsmheU0.js} +1 -1
- package/dist/client/assets/{organization-choice-D7ScNtlb.js → organization-choice-C8DRHLSZ.js} +1 -1
- package/dist/client/assets/{orgs-CFErd6sg.js → orgs-DGcaLxGF.js} +1 -1
- package/dist/client/assets/{page-seo-form-hYazo0Jj.js → page-seo-form-DtArubh-.js} +1 -1
- package/dist/client/assets/{popover-Gmg5lY4q.js → popover-DVFAT0c-.js} +1 -1
- package/dist/client/assets/{post-editor-COrFDOZo.js → post-editor-CIF81oIw.js} +1 -1
- package/dist/client/assets/{primitives-CE6etn75.js → primitives-w9Lg9eWu.js} +1 -1
- package/dist/client/assets/{profile-C7W3wF9h.js → profile-cEVpZAUx.js} +1 -1
- package/dist/client/assets/project-app-view-CatDRucp.js +1 -0
- package/dist/client/assets/record-editor-CnhwCwUv.js +1 -0
- package/dist/client/assets/{redirect-editor-5lNy5HsW.js → redirect-editor-CprSKjFX.js} +1 -1
- package/dist/client/assets/registry-jo0U30T7.js +2 -0
- package/dist/client/assets/{registry-layout-CC2oyVmB.js → registry-layout-CjC8MD0g.js} +1 -1
- package/dist/client/assets/{reports-DTetgeJj.js → reports-Bmfny53H.js} +1 -1
- package/dist/client/assets/{require-capability-DMai0dE_.js → require-capability-KV0-YKXW.js} +1 -1
- package/dist/client/assets/{required-auth-layout-BNLV3Z9n.js → required-auth-layout-B8V_mVLF.js} +1 -1
- package/dist/client/assets/{reset-password-BC57Hkeq.js → reset-password-BSgfWKYU.js} +1 -1
- package/dist/client/assets/{roles-las8u9fW.js → roles-BKKRsW49.js} +1 -1
- package/dist/client/assets/{search-input-C83eu_0r.js → search-input-zOnTA2ZC.js} +1 -1
- package/dist/client/assets/{secrets-TEsTjL46.js → secrets-BO1pYpF8.js} +1 -1
- package/dist/client/assets/{sections-editor-C2Om6EFx.js → sections-editor-DIrENEAq.js} +1 -1
- package/dist/client/assets/{select-model-urZAnlWP.js → select-model-irlX9OHt.js} +1 -1
- package/dist/client/assets/{select-CBqI6EKt.js → select-vILxxytl.js} +1 -1
- package/dist/client/assets/{self-tool-result-BU8ra_BU.js → self-tool-result-CLRYKd2s.js} +1 -1
- package/dist/client/assets/{seo-editor-CGrEOztm.js → seo-editor-RmjyGTpd.js} +1 -1
- package/dist/client/assets/{settings-layout-B6UunhIC.js → settings-layout-jRIjhxbU.js} +1 -1
- package/dist/client/assets/{settings-section-BkCa2hSF.js → settings-section-DN6dwCrb.js} +1 -1
- package/dist/client/assets/{shell-controls-DvqqvSsN.js → shell-controls-BMNXpy_H.js} +1 -1
- package/dist/client/assets/{shell-layout-DK_eY-ht.js → shell-layout-DPwXTcE5.js} +1 -1
- package/dist/client/assets/{sidebar-DY8K_17u.js → sidebar-BNYlE7AV.js} +1 -1
- package/dist/client/assets/{skeleton-DNroJ5d2.js → skeleton-6qQI888K.js} +1 -1
- package/dist/client/assets/{spinner-CNTd4wtK.js → spinner-o1rRSgzv.js} +1 -1
- package/dist/client/assets/{sso-DbH0TO7h.js → sso-CYHJYar5.js} +1 -1
- package/dist/client/assets/{store-DzjFcyTL.js → store-WWl5qYba.js} +1 -1
- package/dist/client/assets/store-registry-CJKalEyT.js +2 -0
- package/dist/client/assets/{studio-tools-Dnhpj5qh.js → studio-tools-BtWoNkcq.js} +1 -1
- package/dist/client/assets/{switch-D7HAjvDx.js → switch-D3xI7duw.js} +1 -1
- package/dist/client/assets/{tab-id-DxO0cBtb.js → tab-id-DiqmaBy2.js} +1 -1
- package/dist/client/assets/{table-BE4QKzOE.js → table-rGuxqPwr.js} +1 -1
- package/dist/client/assets/{tabs-O9QjcYrv.js → tabs-BmMYATnP.js} +1 -1
- package/dist/client/assets/{textarea-DFBGfRuK.js → textarea-BJt8cC6S.js} +1 -1
- package/dist/client/assets/{toggle-group-BtPvM55s.js → toggle-group-B6JAyI2q.js} +1 -1
- package/dist/client/assets/{toolbar-Cpvuujer.js → toolbar-CkCyMacW.js} +1 -1
- package/dist/client/assets/{tooltip-D9s1yr4p.js → tooltip-BkG8gKDz.js} +1 -1
- package/dist/client/assets/{use-ai-providers-CQPjpXWl.js → use-ai-providers-DsZYnQg7.js} +1 -1
- package/dist/client/assets/{use-automations-CKUnBMBC.js → use-automations-DE2_NNy6.js} +1 -1
- package/dist/client/assets/{use-autosave-Dg87V8v1.js → use-autosave-8Cxke91M.js} +1 -1
- package/dist/client/assets/{use-capability-BHSV9gBd.js → use-capability-D0DkHssD.js} +1 -1
- package/dist/client/assets/{use-clock-tick-cqkvm-Ef.js → use-clock-tick-CXln3MAa.js} +1 -1
- package/dist/client/assets/{use-connection-Cy658_xM.js → use-connection-CwxutjPh.js} +1 -1
- package/dist/client/assets/{use-copy-CVhZVr-U.js → use-copy-C3D96rny.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-Bi8HgMn7.js → use-create-virtual-mcp-6r2-LHL3.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-Ch2W7ZiY.js → use-debounced-autosave-CU83xIiP.js} +1 -1
- package/dist/client/assets/{use-debounced-value-DOn4Suao.js → use-debounced-value-DcuInD5Y.js} +1 -1
- package/dist/client/assets/{use-deco-credits-C98B9sz1.js → use-deco-credits-Ch8Vm2Gh.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-DHxI6exQ.js → use-decopilot-events-CzpHE_oH.js} +1 -1
- package/dist/client/assets/{use-delete-connection-DJ9n74qf.js → use-delete-connection-BBWErgtv.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-BqcUjJTV.js → use-deployment-admin-Bu5Ua4e6.js} +1 -1
- package/dist/client/assets/{use-file-configs-D9dmpUrg.js → use-file-configs-DhMqka3s.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-Hu8-0kRx.js → use-infinite-scroll-CqngkeUq.js} +1 -1
- package/dist/client/assets/{use-join-requests-DcUe6bm_.js → use-join-requests-C8pWePHr.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-CkEtujGJ.js → use-mcp-auth-status-Do6e__rE.js} +1 -1
- package/dist/client/assets/{use-mcp-client-D51gNtSm.js → use-mcp-client-CpQD6Mz_.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-B1FxPgHp.js → use-mcp-tools-B9hG9X55.js} +1 -1
- package/dist/client/assets/{use-members-0ZMl36LX.js → use-members-DWfet2FQ.js} +1 -1
- package/dist/client/assets/{use-mobile-Be620oYx.js → use-mobile-4pnpeHV9.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-Czj1eRPz.js → use-navigate-to-agent-RjkB7mVO.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-J_HWXHei.js → use-org-auth-client-BppvrEHw.js} +1 -1
- package/dist/client/assets/{use-org-sso-0BdA3rsr.js → use-org-sso-C6r7r7Z-.js} +1 -1
- package/dist/client/assets/{use-organization-roles-CYDjrcGS.js → use-organization-roles-CFZWX9hz.js} +1 -1
- package/dist/client/assets/{use-organization-settings-Dx8YLTtr.js → use-organization-settings-M5Zt0kWH.js} +1 -1
- package/dist/client/assets/{use-registry-connections-CZVi37FP.js → use-registry-connections-C7i_uv3Z.js} +1 -1
- package/dist/client/assets/{use-secrets-C2jMKR1n.js → use-secrets-BgeMMiZf.js} +1 -1
- package/dist/client/assets/{use-status-sounds-3jCuX-9T.js → use-status-sounds-BZR8_RrZ.js} +1 -1
- package/dist/client/assets/{use-tags-D6OOOtp7.js → use-tags-BHi49oJt.js} +1 -1
- package/dist/client/assets/{use-view-mode-CfanfKcA.js → use-view-mode-DmoOwGW1.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-DQmehG0S.js → use-virtual-mcp-CaUP1Uqm.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-Dekopob7.js +1 -0
- package/dist/client/assets/{useQueries-BRhSLBW5.js → useQueries-DcjddpQA.js} +1 -1
- package/dist/client/assets/{useRouterState-BTPqZkPv.js → useRouterState-Bo_NQVoe.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DqjaZzvF.js +1 -0
- package/dist/client/assets/{users-DetSWk8v.js → users-CvweS0eq.js} +1 -1
- package/dist/client/assets/{variant-calendar-B7KPrNWl.js → variant-calendar-CvrAdj38.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-BmJXsKF6.js → view-mode-toggle-8krhraza.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +2 -2
- package/dist/server/server.js +2 -2
- package/package.json +1 -1
- package/dist/client/assets/project-app-view-Drm83BNO.js +0 -1
- package/dist/client/assets/record-editor-Cd1O7CW0.js +0 -1
- package/dist/client/assets/registry-CA8KXJkV.js +0 -2
- package/dist/client/assets/store-registry-Bcjy_qj0.js +0 -2
- package/dist/client/assets/useInfiniteQuery-CazF2pt1.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BKzWCoNd.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as Ue,b as ct,r as w,m as Oe,j as n,af as Yn,B as Qe,k as Jn,o as Na,t as X,K as Da}from"./index-CCKcgzR3.js";import{a6 as Ta,a7 as Pa,a8 as Aa,a9 as Qn,aa as Xn,ab as Ca,ac as Ma,ad as Ka,N as La,ae as Ba,af as Ct,ag as Fa,S as Zn,ah as lt,ai as Oa,aj as Ia,ak as $a,al as za,D as Ha,F as Ga,am as Ua,an as Wa,ao as qa,ap as Ya,a0 as Gt,aq as Ut,ar as Ja,as as xt,at as Tt,au as Qa,av as Xa,aw as tt,ax as Mn,ay as Za,az as Pt,aA as Wt,aB as eo,aC as dn,aD as to,aE as wt,aF as no,aG as so,aH as ao,aI as oo,aJ as ro,aK as bt,aL as io,aM as lo,aN as co,H as uo,aO as Kn,aP as At,aQ as Ln,aR as Bn,aS as mo,aT as fo,aU as po,aV as go,aW as mn,aX as Fn,aY as On,aZ as Vt,a_ as qt,a$ as In,b0 as ho,b1 as fn,b2 as vo,b3 as So,b4 as xo,b5 as bo,b6 as yo}from"./index-BUR03TdS.js";import{t as _o}from"./ChevronDown-DvIRW9jR.js";import{a4 as gn,y as jo,Y as es,J as Eo,x as ts,a6 as ko,a7 as Ro}from"./agent-icon-DwBPTcr7.js";import{i as ns}from"./ChevronRight-C9FO0Ghk.js";import{n as wo}from"./ChevronUp-C8zQGFtm.js";import{i as Vo}from"./Tool02-GyxJVdhs.js";import{l as Yt}from"./automation-runs-DRI95Blq.js";import{c as yt,T as _t,a as jt}from"./tooltip-D9s1yr4p.js";import{b as No,h as Do,a as To,c as Po,d as Ao,e as Co}from"./dialog-C7c6o6FP.js";import{I as Mo}from"./input-C0DYQwT4.js";import{a as ss}from"./Copy01-DBF2xtLX.js";import{i as Ko}from"./Settings02-Bl_0yVE7.js";import{s as Lo}from"./Eye-BQPVNie2.js";import{s as as}from"./TrendUp01-BnywZeMt.js";import{s as hn}from"./Plus-sJs2USHB.js";import{s as os}from"./Trash01-IiY64zb7.js";import{i as Bo}from"./Zap-C9po9Mov.js";import{a as ht,D as rs,b as is,c as ls,i as Fo}from"./dropdown-menu-CbU2D-c0.js";import{o as cs,p as Jt,K as us,P as ds,q as ms,z as fs,C as ps,A as gs,B as Mt,D as hs,v as vs,x as Ss,y as xs}from"./index-C_siJ8jb.js";import{S as Oo,r as $n,u as Io,d as $o,a as zo,i as Ho,f as Go,P as Uo,b as Wo}from"./page-seo-form-hYazo0Jj.js";import{c as qo}from"./Tool01-DVkbgDKg.js";import{A as Yo}from"./add-section-modal-BuZ_NECI.js";import"./ArrowUp-Dv6dW9X3.js";import"./chat-context-D64R7wZr.js";import"./tab-id-DxO0cBtb.js";import"./Check-Dw0yb53j.js";import"./hooks-CQZEoVeJ.js";import"./use-mcp-client-D51gNtSm.js";import"./auth-B-WF-Fyk.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-s13SK9y4.js";import"./studio-tools-Dnhpj5qh.js";import"./use-virtual-mcp-DQmehG0S.js";import"./use-ai-providers-CQPjpXWl.js";import"./use-decopilot-events-DHxI6exQ.js";import"./use-organization-settings-Dx8YLTtr.js";import"./spinner-CNTd4wtK.js";import"./drawer-BKO67Xux.js";import"./collection-search-BwFX8J9H.js";import"./SearchMd-D9FDebLE.js";import"./use-mobile-Be620oYx.js";import"./AreaChart-HkmLkZy2.js";import"./index-kTQ08f_V.js";import"./calendar-Dh6Ay4oq.js";import"./X-DTAX3OCa.js";import"./shell-layout-DK_eY-ht.js";import"./avatar-CksInPMf.js";import"./User01-Dic8NL9t.js";import"./Users03-C-Rx_Rc3.js";import"./SearchLg-DEgv-uG-.js";import"./Stars02-DgSFkiw6.js";import"./XClose-DV1DPWGC.js";import"./CheckCircle-Dud6wUS9.js";import"./CpuChip01-Bm59eh5F.js";import"./FilterLines-CLE41-vv.js";import"./Monitor01-DpjnSDYR.js";import"./use-is-desktop-app-BNujXJc_.js";import"./required-auth-layout-BNLV3Z9n.js";import"./use-org-sso-0BdA3rsr.js";import"./ZapSquare-yY2i-ZE0.js";import"./Star01-o2L6nHqw.js";import"./Upload01-CHdkzkYk.js";import"./AlertCircle-qIC_xSrj.js";import"./form-4dv9_c-3.js";import"./label-DwTm1B-u.js";import"./select-CBqI6EKt.js";import"./XCircle-u8Vikw7a.js";import"./tabs-O9QjcYrv.js";import"./toggle-group-BtPvM55s.js";import"./use-deco-credits-C98B9sz1.js";import"./sidebar-DY8K_17u.js";import"./LayoutLeft-DMB2s9jy.js";import"./popover-Gmg5lY4q.js";import"./alert-dialog-Ds78S35S.js";import"./toolbar-Cpvuujer.js";import"./skeleton-DNroJ5d2.js";import"./github-repo-picker-BDJbJq_X.js";import"./use-debounced-value-DOn4Suao.js";import"./use-connection-Cy658_xM.js";import"./authenticate-and-persist-oauth-BSdP7jbF.js";import"./mcp-oauth-Che7vtan.js";import"./LinkExternal01-BiWFfTiD.js";import"./use-mcp-tools-B1FxPgHp.js";import"./extract-connection-data-CHzJzImj.js";import"./metadata-dUsYcpuu.js";import"./use-navigate-to-agent-Czj1eRPz.js";import"./reusable-new-chat-CouMjkYR.js";import"./provision-repo-scoped-github-connection-CAXumITS.js";import"./agent-capabilities-cXfbMfjV.js";import"./connection-card-DrJZGb5B.js";import"./use-registry-connections-CZVi37FP.js";import"./useInfiniteQuery-CazF2pt1.js";import"./use-infinite-scroll-Hu8-0kRx.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./card-CSjRjipe.js";import"./integration-icon-qI9RoW2h.js";import"./textarea-DFBGfRuK.js";import"./connection-form-helpers-DrZpyl95.js";import"./collection-tabs-CvyLDMWR.js";import"./badge-BQ6hSN97.js";import"./useSuspenseInfiniteQuery-BKzWCoNd.js";import"./select-model-urZAnlWP.js";import"./checkbox-CPbhbD1e.js";import"./Key01-Dj3z1dEv.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-BkCa2hSF.js";import"./ArrowUpRight-CQVsRNYA.js";import"./Stars01-CuVmQ4th.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-3jCuX-9T.js";import"./empty-state-c2j5Ds6E.js";import"./deco-site-production-url-CaKZ7xBn.js";import"./use-capability-BHSV9gBd.js";import"./monaco-editor-Cyh8g4ki.js";import"./pt-BR-CLy76QW2.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-mcp-auth-status-CkEtujGJ.js";import"./DotsVertical-A7mKqECE.js";import"./Play-BpgcQFKU.js";import"./use-debounced-autosave-Ch2W7ZiY.js";import"./index-Bd5TxvXq.js";import"./search-input-C83eu_0r.js";import"./switch-D7HAjvDx.js";import"./Users01-CxHLm5J9.js";import"./use-secrets-C2jMKR1n.js";import"./format-time-BnbuEtat.js";import"./use-members-0ZMl36LX.js";import"./use-org-auth-client-J_HWXHei.js";import"./command-57yejGBk.js";import"./index-ObaO_KTB.js";import"./useQueries-BRhSLBW5.js";import"./SwitchHorizontal01-DC3YBwC_.js";import"./Palette-Cl97ZzbL.js";import"./use-file-configs-D9dmpUrg.js";import"./use-automations-CKUnBMBC.js";import"./automation-list-row-Dwbyv5TT.js";import"./get-initials-D-f_fDFw.js";import"./HardDrive-Iz7lTyC4.js";import"./LogOut01-CmE_ZaFu.js";import"./Sun-DL-zXPtw.js";import"./Shield01-BO8-H5xY.js";import"./table-BE4QKzOE.js";import"./use-clock-tick-cqkvm-Ef.js";import"./use-copy-CVhZVr-U.js";import"./use-tags-D6OOOtp7.js";import"./companions-core-DFao4P_s.js";function Jo(h){return h.schema?.definitions??h.schema?.$defs??{}}function Qo(h,e){const o=Jo(e),d=o[btoa(h)];if(!d)return;let m=typeof d.image=="string"?d.image:void 0;if(!m&&Array.isArray(d.allOf)){const x=d.allOf.find(b=>typeof b.$ref=="string")?.$ref;if(typeof x=="string"){const b=x.replace("#/definitions/",""),f=o[b];m=typeof f?.image=="string"?f.image:void 0}}if(m?.includes("{{{"))return m}function Xo(h,e){if(!e)return;const o=Ta(h);if(!o)return;const d=Qo(o.resolveType,e);if(!d)return;const m=Pa(d,o.data);if(m)return Aa(m)}const Zo="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",er="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 zn(h){return Array.from({length:h},(e,o)=>({id:crypto.randomUUID(),index:o}))}function bs(h){return h.map((e,o)=>({...e,index:o}))}function tr(h,e){if(e===h.length)return h;if(e<h.length)return bs(h.slice(0,e));const o=Array.from({length:e-h.length},(d,m)=>({id:crypto.randomUUID(),index:h.length+m}));return[...h,...o]}function ys(h){const e=Ue.c(20),{section:o,raw:d,meta:m}=h,x=o.isSavedBlock===!0,b=o.isMultivariate===!0;let f;e[0]!==m||e[1]!==d?(f=d&&m?Xo(d,m):void 0,e[0]=m,e[1]=d,e[2]=f):f=e[2];const v=f;let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(jo,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[3]=u):u=e[3];let y;e[4]!==v?(y=v&&n.jsx("img",{src:v,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[4]=v,e[5]=y):y=e[5];let k;e[6]!==b||e[7]!==x?(k=x?{color:La}:b?{color:"oklch(0.65 0.15 160)"}:void 0,e[6]=b,e[7]=x,e[8]=k):k=e[8];let D;e[9]!==k?(D=n.jsx(gn,{className:"h-4 w-4 shrink-0",style:k}),e[9]=k,e[10]=D):D=e[10];const E=o.isHidden&&"line-through opacity-50";let i;e[11]!==E?(i=Oe("min-w-0 flex-1 truncate text-sm font-medium",E),e[11]=E,e[12]=i):i=e[12];let g;e[13]!==o.label||e[14]!==i?(g=n.jsx("span",{className:i,children:o.label}),e[13]=o.label,e[14]=i,e[15]=g):g=e[15];let r;return e[16]!==y||e[17]!==D||e[18]!==g?(r=n.jsxs(n.Fragment,{children:[u,y,D,g]}),e[16]=y,e[17]=D,e[18]=g,e[19]=r):r=e[19],r}function _s(h,e){const o=h.isSavedBlock===!0,d=h.isMultivariate===!0;return Oe("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":o?Zo:d?"text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]":"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function nr(h){const e=Ue.c(81),{section:o,raw:d,meta:m,sortableId:x,selected:b,onSelect:f,onDelete:v,onDuplicate:u,onMakeReusable:y,onToggleHidden:k,onToggleLazy:D,onAddVariant:E,onDetach:i}=h,g=ct(),r=d?Xn(d.__resolveType??""):!1;let A;e[0]!==o?(A=Ca(o),e[0]=o,e[1]=A):A=e[1];const l=A;let R;e[2]!==x?(R={id:x,animateLayoutChanges:ir},e[2]=x,e[3]=R):R=e[3];const{attributes:K,listeners:z,setNodeRef:p,transform:N,isDragging:ie}=fs(R);let L;e[4]!==N?(L=ps.Transform.toString(N?{...N,x:0}:null),e[4]=N,e[5]=L):L=e[5];const ce=ie?0:void 0;let M;e[6]!==L||e[7]!==ce?(M={transform:L,opacity:ce},e[6]=L,e[7]=ce,e[8]=M):M=e[8];const ge=M;let O;e[9]!==o?(O=Ma(o),e[9]=o,e[10]=O):O=e[10];const ne=O,he="button",me=0;let I;e[11]!==f?(I=T=>{(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),f())},e[11]=f,e[12]=I):I=e[12];const J=ie?"cursor-grabbing":"cursor-pointer";let Z;e[13]!==o||e[14]!==b||e[15]!==J?(Z=Oe("touch-none transition-colors",J,_s(o,b)),e[13]=o,e[14]=b,e[15]=J,e[16]=Z):Z=e[16];let ee;e[17]!==m||e[18]!==d||e[19]!==o?(ee=n.jsx(ys,{section:o,raw:d,meta:m}),e[17]=m,e[18]=d,e[19]=o,e[20]=ee):ee=e[20];const $=!o.isMultivariate&&n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":g(r?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:Oe("h-7 w-7 shrink-0",r?"":"opacity-0 group-hover:opacity-100"),onClick:T=>{T.stopPropagation(),D()},onPointerDown:rr,children:n.jsx(Bo,{className:Oe("h-3.5 w-3.5",r&&"text-yellow-500")})})}),n.jsx(jt,{side:"bottom",children:g(r?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]});let Ae;e[21]!==k||e[22]!==o.isHidden||e[23]!==o.isMultivariate||e[24]!==g?(Ae=!o.isMultivariate&&n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":o.isHidden?g("sectionsEditor.sectionList.showSection"):g("sectionsEditor.sectionList.hideSection"),className:Oe("h-7 w-7 shrink-0",o.isHidden?"opacity-100":"opacity-0 group-hover:opacity-100"),onClick:T=>{T.stopPropagation(),k()},onPointerDown:or,children:o.isHidden?n.jsx(Ko,{className:"h-3.5 w-3.5"}):n.jsx(Lo,{className:"h-3.5 w-3.5"})})}),n.jsx(jt,{side:"bottom",children:o.isHidden?g("sectionsEditor.sectionList.showSection"):g("sectionsEditor.sectionList.hideSection")})]}),e[21]=k,e[22]=o.isHidden,e[23]=o.isMultivariate,e[24]=g,e[25]=Ae):Ae=e[25];let Me;e[26]!==g?(Me=g("sectionsEditor.sectionList.sectionActionsMenu"),e[26]=g,e[27]=Me):Me=e[27];let et;e[28]===Symbol.for("react.memo_cache_sentinel")?(et=n.jsx(es,{className:"h-3.5 w-3.5"}),e[28]=et):et=e[28];let Se;e[29]!==Me?(Se=n.jsx(rs,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":Me,className:"h-7 w-7 shrink-0 opacity-0 group-hover:opacity-100",onClick:ar,onPointerDown:sr,children:et})}),e[29]=Me,e[30]=Se):Se=e[30];let H;e[31]!==u?(H=T=>{T.stopPropagation(),u()},e[31]=u,e[32]=H):H=e[32];let se;e[33]===Symbol.for("react.memo_cache_sentinel")?(se=n.jsx(ss,{className:"h-4 w-4"}),e[33]=se):se=e[33];let ae;e[34]!==g?(ae=g("sectionsEditor.sectionList.duplicateMenuItem"),e[34]=g,e[35]=ae):ae=e[35];let ue;e[36]!==H||e[37]!==ae?(ue=n.jsxs(ht,{onClick:H,children:[se,ae]}),e[36]=H,e[37]=ae,e[38]=ue):ue=e[38];let oe;e[39]!==l||e[40]!==E||e[41]!==g?(oe=l&&n.jsxs(ht,{className:Ka,onClick:T=>{T.stopPropagation(),E()},children:[n.jsx(as,{className:"h-4 w-4"}),g("sectionsEditor.sectionList.addVariantMenuItem")]}),e[39]=l,e[40]=E,e[41]=g,e[42]=oe):oe=e[42];let de;e[43]!==ne||e[44]!==y||e[45]!==g?(de=ne&&n.jsxs(ht,{className:er,onClick:T=>{T.stopPropagation(),y()},children:[n.jsx(gn,{className:"h-4 w-4"}),g("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[43]=ne,e[44]=y,e[45]=g,e[46]=de):de=e[46];let le;e[47]!==i||e[48]!==o.isMultivariate||e[49]!==o.isSavedBlock||e[50]!==g?(le=o.isSavedBlock===!0&&!o.isMultivariate&&n.jsxs(ht,{onClick:T=>{T.stopPropagation(),i()},children:[n.jsx(gn,{className:"h-4 w-4"}),g("sectionsEditor.sectionList.detachMenuItem")]}),e[47]=i,e[48]=o.isMultivariate,e[49]=o.isSavedBlock,e[50]=g,e[51]=le):le=e[51];let fe;e[52]!==v?(fe=T=>{T.stopPropagation(),v()},e[52]=v,e[53]=fe):fe=e[53];let De;e[54]===Symbol.for("react.memo_cache_sentinel")?(De=n.jsx(os,{className:"h-4 w-4"}),e[54]=De):De=e[54];let je;e[55]!==g?(je=g("sectionsEditor.sectionList.deleteMenuItem"),e[55]=g,e[56]=je):je=e[56];let re;e[57]!==fe||e[58]!==je?(re=n.jsxs(ht,{className:"text-destructive focus:text-destructive",onClick:fe,children:[De,je]}),e[57]=fe,e[58]=je,e[59]=re):re=e[59];let pe;e[60]!==ue||e[61]!==oe||e[62]!==de||e[63]!==le||e[64]!==re?(pe=n.jsxs(is,{align:"end",className:"w-44",children:[ue,oe,de,le,re]}),e[60]=ue,e[61]=oe,e[62]=de,e[63]=le,e[64]=re,e[65]=pe):pe=e[65];let xe;e[66]!==Se||e[67]!==pe?(xe=n.jsxs(ls,{children:[Se,pe]}),e[66]=Se,e[67]=pe,e[68]=xe):xe=e[68];let be;return e[69]!==K||e[70]!==z||e[71]!==f||e[72]!==p||e[73]!==ge||e[74]!==Z||e[75]!==ee||e[76]!==$||e[77]!==Ae||e[78]!==xe||e[79]!==I?(be=n.jsxs("div",{ref:p,style:ge,...K,...z,role:he,tabIndex:me,onClick:f,onKeyDown:I,className:Z,children:[ee,$,Ae,xe]}),e[69]=K,e[70]=z,e[71]=f,e[72]=p,e[73]=ge,e[74]=Z,e[75]=ee,e[76]=$,e[77]=Ae,e[78]=xe,e[79]=I,e[80]=be):be=e[80],be}function sr(h){return h.stopPropagation()}function ar(h){return h.stopPropagation()}function or(h){return h.stopPropagation()}function rr(h){return h.stopPropagation()}function ir(){return!1}function lr(h){const e=Ue.c(104),{listKey:o,rawSections:d,sections:m,meta:x,selectedIndex:b,onSelect:f,onReorder:v,onDelete:u,onDuplicate:y,onMakeReusable:k,onToggleHidden:D,onToggleLazy:E,onAddVariant:i,onDetach:g,onAddSection:r,canAddSection:A}=h,l=A===void 0?!0:A,R=ct();let K;e[0]!==m.length?(K=()=>zn(m.length),e[0]=m.length,e[1]=K):K=e[1];const[z,p]=w.useState(K),[N,ie]=w.useState(null),[L,ce]=w.useState(o),[M,ge]=w.useState(m.length),O=w.useRef(!1);L!==o?(ce(o),ge(m.length),p(zn(m.length))):M!==m.length&&(ge(m.length),p(ze=>tr(ze,m.length)));let ne;e[2]===Symbol.for("react.memo_cache_sentinel")?(ne={activationConstraint:{distance:8}},e[2]=ne):ne=e[2];let he;e[3]===Symbol.for("react.memo_cache_sentinel")?(he={coordinateGetter:gs},e[3]=he):he=e[3];const me=cs(Jt(ds,ne),Jt(us,he));let I;e[4]!==z?(I=z.map(cr),e[4]=z,e[5]=I):I=e[5];const J=I;let Z;e[6]===Symbol.for("react.memo_cache_sentinel")?(Z=ze=>{ie(String(ze.active.id))},e[6]=Z):Z=e[6];const ee=Z;let $;e[7]!==J||e[8]!==v?($=ze=>{ie(null);const{active:B,over:F}=ze;if(!F||B.id===F.id)return;const G=J.indexOf(String(B.id)),nt=J.indexOf(String(F.id));G===-1||nt===-1||(p(Re=>bs(Mt([...Re],G,nt))),O.current=!0,requestAnimationFrame(()=>{O.current=!1}),v?.(G,nt))},e[7]=J,e[8]=v,e[9]=$):$=e[9];const Ae=$;let Me;e[10]===Symbol.for("react.memo_cache_sentinel")?(Me=()=>{ie(null)},e[10]=Me):Me=e[10];const et=Me;let Se,H,se,ae,ue,oe,de,le,fe,De,je,re,pe,xe,be;if(e[11]!==N||e[12]!==l||e[13]!==z||e[14]!==J||e[15]!==Ae||e[16]!==x||e[17]!==r||e[18]!==i||e[19]!==u||e[20]!==g||e[21]!==y||e[22]!==k||e[23]!==f||e[24]!==D||e[25]!==E||e[26]!==d||e[27]!==m||e[28]!==b||e[29]!==me||e[30]!==R){xe=Symbol.for("react.early_return_sentinel");e:{const ze=B=>{O.current||f(B)};if(e[46]!==N||e[47]!==l||e[48]!==z||e[49]!==r||e[50]!==d||e[51]!==m||e[52]!==R){const B=N?z.find(F=>F.id===N):null;if(ae=B!=null?m[B.index]:null,se=B!=null?d[B.index]:void 0,z.length===0){let F;e[56]!==R?(F=R("sectionsEditor.sectionList.noSections"),e[56]=R,e[57]=F):F=e[57];let G;e[58]!==F?(G=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:F}),e[58]=F,e[59]=G):G=e[59];const nt=!l;let Re;e[60]===Symbol.for("react.memo_cache_sentinel")?(Re=n.jsx(hn,{size:14}),e[60]=Re):Re=e[60];let We;e[61]!==R?(We=R("sectionsEditor.sectionList.addSectionButton"),e[61]=R,e[62]=We):We=e[62];let Ne;e[63]!==r||e[64]!==nt||e[65]!==We?(Ne=n.jsxs(Qe,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:nt,onClick:r,children:[Re,We]}),e[63]=r,e[64]=nt,e[65]=We,e[66]=Ne):Ne=e[66];let vt;e[67]!==G||e[68]!==Ne?(vt=n.jsxs("div",{className:"space-y-2",children:[G,Ne]}),e[67]=G,e[68]=Ne,e[69]=vt):vt=e[69],xe=vt;break e}pe=Oe(B&&"cursor-grabbing"),e[46]=N,e[47]=l,e[48]=z,e[49]=r,e[50]=d,e[51]=m,e[52]=R,e[53]=se,e[54]=ae,e[55]=pe}else se=e[53],ae=e[54],pe=e[55];H=hs,le=me,fe=vs,De=ee,je=Ae,re=et,Se=Ss,oe=J,de=xs,be="space-y-1",ue=z.map(B=>{const F=m[B.index];return F?n.jsx(nr,{sortableId:B.id,section:F,raw:d[B.index],meta:x,selected:b===B.index,onSelect:()=>ze(B.index),onDelete:()=>u(B.index),onDuplicate:()=>y(B.index),onMakeReusable:()=>k(B.index),onToggleHidden:()=>D(B.index),onToggleLazy:()=>E(B.index),onAddVariant:()=>i(B.index),onDetach:()=>g(B.index)},B.id):null})}e[11]=N,e[12]=l,e[13]=z,e[14]=J,e[15]=Ae,e[16]=x,e[17]=r,e[18]=i,e[19]=u,e[20]=g,e[21]=y,e[22]=k,e[23]=f,e[24]=D,e[25]=E,e[26]=d,e[27]=m,e[28]=b,e[29]=me,e[30]=R,e[31]=Se,e[32]=H,e[33]=se,e[34]=ae,e[35]=ue,e[36]=oe,e[37]=de,e[38]=le,e[39]=fe,e[40]=De,e[41]=je,e[42]=re,e[43]=pe,e[44]=xe,e[45]=be}else Se=e[31],H=e[32],se=e[33],ae=e[34],ue=e[35],oe=e[36],de=e[37],le=e[38],fe=e[39],De=e[40],je=e[41],re=e[42],pe=e[43],xe=e[44],be=e[45];if(xe!==Symbol.for("react.early_return_sentinel"))return xe;let T;e[70]!==ue||e[71]!==be?(T=n.jsx("div",{className:be,children:ue}),e[70]=ue,e[71]=be,e[72]=T):T=e[72];let Ke;e[73]!==Se||e[74]!==oe||e[75]!==de||e[76]!==T?(Ke=n.jsx(Se,{items:oe,strategy:de,children:T}),e[73]=Se,e[74]=oe,e[75]=de,e[76]=T,e[77]=Ke):Ke=e[77];let Ie;e[78]!==se||e[79]!==ae||e[80]!==x?(Ie=ae?n.jsx("div",{className:Oe("cursor-grabbing shadow-lg ring-1 ring-border/60",_s(ae,!1)),children:n.jsx(ys,{section:ae,raw:se,meta:x})}):null,e[78]=se,e[79]=ae,e[80]=x,e[81]=Ie):Ie=e[81];let Ge;e[82]!==Ie?(Ge=Yn.createPortal(n.jsx(ms,{dropAnimation:Qn,children:Ie}),document.body),e[82]=Ie,e[83]=Ge):Ge=e[83];let $e;e[84]!==H||e[85]!==le||e[86]!==fe||e[87]!==De||e[88]!==je||e[89]!==re||e[90]!==Ke||e[91]!==Ge?($e=n.jsxs(H,{sensors:le,collisionDetection:fe,onDragStart:De,onDragEnd:je,onDragCancel:re,children:[Ke,Ge]}),e[84]=H,e[85]=le,e[86]=fe,e[87]=De,e[88]=je,e[89]=re,e[90]=Ke,e[91]=Ge,e[92]=$e):$e=e[92];const Ee=!l;let ye;e[93]===Symbol.for("react.memo_cache_sentinel")?(ye=n.jsx(hn,{size:14}),e[93]=ye):ye=e[93];let ke;e[94]!==R?(ke=R("sectionsEditor.sectionList.addSectionButton"),e[94]=R,e[95]=ke):ke=e[95];let Le;e[96]!==r||e[97]!==Ee||e[98]!==ke?(Le=n.jsxs(Qe,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:Ee,onClick:r,children:[ye,ke]}),e[96]=r,e[97]=Ee,e[98]=ke,e[99]=Le):Le=e[99];let Te;return e[100]!==pe||e[101]!==$e||e[102]!==Le?(Te=n.jsxs("div",{className:pe,children:[$e,Le]}),e[100]=pe,e[101]=$e,e[102]=Le,e[103]=Te):Te=e[103],Te}function cr(h){return h.id}function Hn(h){const e=Ue.c(57),{open:o,initialName:d,autoLabel:m,isPending:x,onSubmit:b,onOpenChange:f}=h,v=x===void 0?!1:x,u=ct(),[y,k]=w.useState(d),[D,E]=w.useState(o);o!==D&&(E(o),o&&k(d));let i;e[0]!==v||e[1]!==f?(i=ee=>{!ee&&!v&&f(!1)},e[0]=v,e[1]=f,e[2]=i):i=e[2];const g=i;let r;e[3]!==v||e[4]!==y||e[5]!==b?(r=async ee=>{ee.preventDefault(),!v&&await b(y.trim())},e[3]=v,e[4]=y,e[5]=b,e[6]=r):r=e[6];const A=r;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(No,{children:l}),e[9]=l,e[10]=R):R=e[10];let K;e[11]!==m||e[12]!==u?(K=u("sectionsEditor.variantRenameDialog.description",{fallback:m||u("sectionsEditor.variantRenameDialog.defaultFallback")}),e[11]=m,e[12]=u,e[13]=K):K=e[13];let z;e[14]!==K?(z=n.jsx(Do,{children:K}),e[14]=K,e[15]=z):z=e[15];let p;e[16]!==R||e[17]!==z?(p=n.jsxs(To,{children:[R,z]}),e[16]=R,e[17]=z,e[18]=p):p=e[18];let N;e[19]!==u?(N=u("sectionsEditor.variantRenameDialog.nameLabel"),e[19]=u,e[20]=N):N=e[20];let ie;e[21]!==N?(ie=n.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:N}),e[21]=N,e[22]=ie):ie=e[22];let L;e[23]===Symbol.for("react.memo_cache_sentinel")?(L=ee=>k(ee.target.value),e[23]=L):L=e[23];let ce;e[24]!==m||e[25]!==v||e[26]!==y?(ce=n.jsx(Mo,{id:"variant-rename-name",value:y,onChange:L,placeholder:m,autoFocus:!0,disabled:v}),e[24]=m,e[25]=v,e[26]=y,e[27]=ce):ce=e[27];let M;e[28]!==ie||e[29]!==ce?(M=n.jsxs("div",{className:"space-y-1.5 py-4",children:[ie,ce]}),e[28]=ie,e[29]=ce,e[30]=M):M=e[30];let ge;e[31]!==f?(ge=()=>f(!1),e[31]=f,e[32]=ge):ge=e[32];let O;e[33]!==u?(O=u("sectionsEditor.variantRenameDialog.cancel"),e[33]=u,e[34]=O):O=e[34];let ne;e[35]!==v||e[36]!==ge||e[37]!==O?(ne=n.jsx(Qe,{type:"button",variant:"outline",onClick:ge,disabled:v,children:O}),e[35]=v,e[36]=ge,e[37]=O,e[38]=ne):ne=e[38];let he;e[39]!==v||e[40]!==u?(he=v?n.jsxs(n.Fragment,{children:[n.jsx(Jn,{size:14,className:"animate-spin"}),u("sectionsEditor.variantRenameDialog.saving")]}):u("sectionsEditor.variantRenameDialog.save"),e[39]=v,e[40]=u,e[41]=he):he=e[41];let me;e[42]!==v||e[43]!==he?(me=n.jsx(Qe,{type:"submit",disabled:v,children:he}),e[42]=v,e[43]=he,e[44]=me):me=e[44];let I;e[45]!==ne||e[46]!==me?(I=n.jsxs(Po,{children:[ne,me]}),e[45]=ne,e[46]=me,e[47]=I):I=e[47];let J;e[48]!==A||e[49]!==M||e[50]!==I||e[51]!==p?(J=n.jsx(Ao,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:A,children:[p,M,I]})}),e[48]=A,e[49]=M,e[50]=I,e[51]=p,e[52]=J):J=e[52];let Z;return e[53]!==g||e[54]!==o||e[55]!==J?(Z=n.jsx(Co,{open:o,onOpenChange:g,children:J}),e[53]=g,e[54]=o,e[55]=J,e[56]=Z):Z=e[56],Z}const ur="text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]",js="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.2)]";function Es(h){const e=Ue.c(5),{rule:o,matchers:d}=h,m=o?.__resolveType??"";let x;if(e[0]!==d||e[1]!==m){const u=d.find(y=>y.resolveType===m)?.iconName??Ba(m);x=Eo(u),e[0]=d,e[1]=m,e[2]=x}else x=e[2];const b=x;if(!b)return null;let f;return e[3]!==b?(f=n.jsx(b,{size:14,className:"shrink-0"}),e[3]=b,e[4]=f):f=e[4],f}function Gn(h){return h.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
|
|
1
|
+
import{c as Ue,b as ct,r as w,m as Oe,j as n,af as Yn,B as Qe,k as Jn,o as Na,t as X,K as Da}from"./index-xLZV-a-I.js";import{a6 as Ta,a7 as Pa,a8 as Aa,a9 as Qn,aa as Xn,ab as Ca,ac as Ma,ad as Ka,N as La,ae as Ba,af as Ct,ag as Fa,S as Zn,ah as lt,ai as Oa,aj as Ia,ak as $a,al as za,D as Ha,F as Ga,am as Ua,an as Wa,ao as qa,ap as Ya,a0 as Gt,aq as Ut,ar as Ja,as as xt,at as Tt,au as Qa,av as Xa,aw as tt,ax as Mn,ay as Za,az as Pt,aA as Wt,aB as eo,aC as dn,aD as to,aE as wt,aF as no,aG as so,aH as ao,aI as oo,aJ as ro,aK as bt,aL as io,aM as lo,aN as co,H as uo,aO as Kn,aP as At,aQ as Ln,aR as Bn,aS as mo,aT as fo,aU as po,aV as go,aW as mn,aX as Fn,aY as On,aZ as Vt,a_ as qt,a$ as In,b0 as ho,b1 as fn,b2 as vo,b3 as So,b4 as xo,b5 as bo,b6 as yo}from"./index-CfOvqDrF.js";import{t as _o}from"./ChevronDown-CUX5BVRH.js";import{a4 as gn,y as jo,Y as es,J as Eo,x as ts,a6 as ko,a7 as Ro}from"./agent-icon-DAE-QVSX.js";import{i as ns}from"./ChevronRight-D7bdokHb.js";import{n as wo}from"./ChevronUp-BvwOltu0.js";import{i as Vo}from"./Tool02-FCeFZNlp.js";import{l as Yt}from"./automation-runs-dOAA8A_J.js";import{c as yt,T as _t,a as jt}from"./tooltip-BkG8gKDz.js";import{b as No,h as Do,a as To,c as Po,d as Ao,e as Co}from"./dialog-BAhwXLtu.js";import{I as Mo}from"./input-BojcyffB.js";import{a as ss}from"./Copy01-D8PXcQlN.js";import{i as Ko}from"./Settings02--NDw0tr0.js";import{s as Lo}from"./Eye-BjzBo9pu.js";import{s as as}from"./TrendUp01-CHXXVD4m.js";import{s as hn}from"./Plus-CCR2dl91.js";import{s as os}from"./Trash01-CUyl1xYR.js";import{i as Bo}from"./Zap-CXlonpRe.js";import{a as ht,D as rs,b as is,c as ls,i as Fo}from"./dropdown-menu-8-9RMyUq.js";import{o as cs,p as Jt,K as us,P as ds,q as ms,z as fs,C as ps,A as gs,B as Mt,D as hs,v as vs,x as Ss,y as xs}from"./index-B6Z7PR0c.js";import{S as Oo,r as $n,u as Io,d as $o,a as zo,i as Ho,f as Go,P as Uo,b as Wo}from"./page-seo-form-DtArubh-.js";import{c as qo}from"./Tool01-B1U6TeQ7.js";import{A as Yo}from"./add-section-modal-BCa7yMsN.js";import"./ArrowUp-DPqqjxMs.js";import"./chat-context-CoSeVfqX.js";import"./tab-id-DiqmaBy2.js";import"./Check-BanZqVS6.js";import"./hooks-8r52ZzPh.js";import"./use-mcp-client-CpQD6Mz_.js";import"./auth-CSGt0fLM.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-ddxDh-T3.js";import"./studio-tools-BtWoNkcq.js";import"./use-virtual-mcp-CaUP1Uqm.js";import"./use-ai-providers-DsZYnQg7.js";import"./use-decopilot-events-CzpHE_oH.js";import"./use-organization-settings-M5Zt0kWH.js";import"./spinner-o1rRSgzv.js";import"./drawer-BQd2nFSf.js";import"./collection-search-Dza0Wnqg.js";import"./SearchMd-BBtCjgk8.js";import"./use-mobile-4pnpeHV9.js";import"./AreaChart-D6sbwDYG.js";import"./index-DxOAuh92.js";import"./calendar-1BAMPIfo.js";import"./X-Fy7AbE7F.js";import"./shell-layout-DPwXTcE5.js";import"./avatar-B4ZEWEhO.js";import"./User01-PMJPa_tN.js";import"./Users03-BxaRzrtC.js";import"./SearchLg-BROgsk9l.js";import"./Stars02-C2Cbwy_X.js";import"./XClose-Bp_RaZDo.js";import"./CheckCircle-CiwBnetw.js";import"./CpuChip01-Sn9YZC9Z.js";import"./FilterLines-EqTRXCN6.js";import"./Monitor01-BW-aur37.js";import"./use-is-desktop-app-BNujXJc_.js";import"./required-auth-layout-B8V_mVLF.js";import"./use-org-sso-C6r7r7Z-.js";import"./ZapSquare-BmTk-klu.js";import"./Star01-CntjezXG.js";import"./Upload01-ZeBMj0BP.js";import"./AlertCircle-YkJszhyi.js";import"./form-BvU3JKee.js";import"./label-CkgoFapr.js";import"./select-vILxxytl.js";import"./XCircle-CWLIEPUH.js";import"./tabs-BmMYATnP.js";import"./toggle-group-B6JAyI2q.js";import"./use-deco-credits-Ch8Vm2Gh.js";import"./sidebar-BNYlE7AV.js";import"./LayoutLeft-BJ-rrVM8.js";import"./popover-DVFAT0c-.js";import"./alert-dialog-Bejl4UZW.js";import"./toolbar-CkCyMacW.js";import"./skeleton-6qQI888K.js";import"./github-repo-picker-Df-OSUFw.js";import"./use-debounced-value-DcuInD5Y.js";import"./use-connection-CwxutjPh.js";import"./authenticate-and-persist-oauth-DTurxjpA.js";import"./mcp-oauth-CHnOKcYw.js";import"./LinkExternal01-B6_9NVrP.js";import"./use-mcp-tools-B9hG9X55.js";import"./extract-connection-data-BZa8p_H-.js";import"./metadata-dUsYcpuu.js";import"./use-navigate-to-agent-RjkB7mVO.js";import"./reusable-new-chat-CouMjkYR.js";import"./provision-repo-scoped-github-connection-CAXumITS.js";import"./agent-capabilities-cXfbMfjV.js";import"./connection-card-D9VnLzY1.js";import"./use-registry-connections-C7i_uv3Z.js";import"./useInfiniteQuery-Dekopob7.js";import"./use-infinite-scroll-CqngkeUq.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./card-CISWuoNN.js";import"./integration-icon-CArxB5uE.js";import"./textarea-BJt8cC6S.js";import"./connection-form-helpers-CwB0lnHg.js";import"./collection-tabs-BQWDYbtI.js";import"./badge-DoTrxPvS.js";import"./useSuspenseInfiniteQuery-DqjaZzvF.js";import"./select-model-irlX9OHt.js";import"./checkbox-hIdnOQby.js";import"./Key01-B_NmjlUq.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-DN6dwCrb.js";import"./ArrowUpRight-DCcGUPRq.js";import"./Stars01-lkb5ewEZ.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-BZR8_RrZ.js";import"./empty-state-C-PMtz9f.js";import"./deco-site-production-url-CaKZ7xBn.js";import"./use-capability-D0DkHssD.js";import"./monaco-editor-CcMhH2ul.js";import"./pt-BR-CLy76QW2.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-mcp-auth-status-Do6e__rE.js";import"./DotsVertical-Dh5AhfNj.js";import"./Play-CdlOcV-y.js";import"./use-debounced-autosave-CU83xIiP.js";import"./index-CqSKWTR6.js";import"./search-input-zOnTA2ZC.js";import"./switch-D3xI7duw.js";import"./Users01-CqQx5tIk.js";import"./use-secrets-BgeMMiZf.js";import"./format-time-BnbuEtat.js";import"./use-members-DWfet2FQ.js";import"./use-org-auth-client-BppvrEHw.js";import"./command-EKXrfvyu.js";import"./index-CxoHON83.js";import"./useQueries-DcjddpQA.js";import"./SwitchHorizontal01-3z68UsWg.js";import"./Palette-SJkRJpeD.js";import"./use-file-configs-DhMqka3s.js";import"./use-automations-DE2_NNy6.js";import"./automation-list-row-als2Xpcd.js";import"./get-initials-D-f_fDFw.js";import"./HardDrive-CXeNKlS_.js";import"./LogOut01-CPJ6BI1C.js";import"./Sun-MMOSzKiH.js";import"./Shield01-Ss0yQTUj.js";import"./table-rGuxqPwr.js";import"./use-clock-tick-CXln3MAa.js";import"./use-copy-C3D96rny.js";import"./use-tags-BHi49oJt.js";import"./companions-core-CvQj41-P.js";function Jo(h){return h.schema?.definitions??h.schema?.$defs??{}}function Qo(h,e){const o=Jo(e),d=o[btoa(h)];if(!d)return;let m=typeof d.image=="string"?d.image:void 0;if(!m&&Array.isArray(d.allOf)){const x=d.allOf.find(b=>typeof b.$ref=="string")?.$ref;if(typeof x=="string"){const b=x.replace("#/definitions/",""),f=o[b];m=typeof f?.image=="string"?f.image:void 0}}if(m?.includes("{{{"))return m}function Xo(h,e){if(!e)return;const o=Ta(h);if(!o)return;const d=Qo(o.resolveType,e);if(!d)return;const m=Pa(d,o.data);if(m)return Aa(m)}const Zo="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",er="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 zn(h){return Array.from({length:h},(e,o)=>({id:crypto.randomUUID(),index:o}))}function bs(h){return h.map((e,o)=>({...e,index:o}))}function tr(h,e){if(e===h.length)return h;if(e<h.length)return bs(h.slice(0,e));const o=Array.from({length:e-h.length},(d,m)=>({id:crypto.randomUUID(),index:h.length+m}));return[...h,...o]}function ys(h){const e=Ue.c(20),{section:o,raw:d,meta:m}=h,x=o.isSavedBlock===!0,b=o.isMultivariate===!0;let f;e[0]!==m||e[1]!==d?(f=d&&m?Xo(d,m):void 0,e[0]=m,e[1]=d,e[2]=f):f=e[2];const v=f;let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(jo,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[3]=u):u=e[3];let y;e[4]!==v?(y=v&&n.jsx("img",{src:v,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[4]=v,e[5]=y):y=e[5];let k;e[6]!==b||e[7]!==x?(k=x?{color:La}:b?{color:"oklch(0.65 0.15 160)"}:void 0,e[6]=b,e[7]=x,e[8]=k):k=e[8];let D;e[9]!==k?(D=n.jsx(gn,{className:"h-4 w-4 shrink-0",style:k}),e[9]=k,e[10]=D):D=e[10];const E=o.isHidden&&"line-through opacity-50";let i;e[11]!==E?(i=Oe("min-w-0 flex-1 truncate text-sm font-medium",E),e[11]=E,e[12]=i):i=e[12];let g;e[13]!==o.label||e[14]!==i?(g=n.jsx("span",{className:i,children:o.label}),e[13]=o.label,e[14]=i,e[15]=g):g=e[15];let r;return e[16]!==y||e[17]!==D||e[18]!==g?(r=n.jsxs(n.Fragment,{children:[u,y,D,g]}),e[16]=y,e[17]=D,e[18]=g,e[19]=r):r=e[19],r}function _s(h,e){const o=h.isSavedBlock===!0,d=h.isMultivariate===!0;return Oe("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":o?Zo:d?"text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]":"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function nr(h){const e=Ue.c(81),{section:o,raw:d,meta:m,sortableId:x,selected:b,onSelect:f,onDelete:v,onDuplicate:u,onMakeReusable:y,onToggleHidden:k,onToggleLazy:D,onAddVariant:E,onDetach:i}=h,g=ct(),r=d?Xn(d.__resolveType??""):!1;let A;e[0]!==o?(A=Ca(o),e[0]=o,e[1]=A):A=e[1];const l=A;let R;e[2]!==x?(R={id:x,animateLayoutChanges:ir},e[2]=x,e[3]=R):R=e[3];const{attributes:K,listeners:z,setNodeRef:p,transform:N,isDragging:ie}=fs(R);let L;e[4]!==N?(L=ps.Transform.toString(N?{...N,x:0}:null),e[4]=N,e[5]=L):L=e[5];const ce=ie?0:void 0;let M;e[6]!==L||e[7]!==ce?(M={transform:L,opacity:ce},e[6]=L,e[7]=ce,e[8]=M):M=e[8];const ge=M;let O;e[9]!==o?(O=Ma(o),e[9]=o,e[10]=O):O=e[10];const ne=O,he="button",me=0;let I;e[11]!==f?(I=T=>{(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),f())},e[11]=f,e[12]=I):I=e[12];const J=ie?"cursor-grabbing":"cursor-pointer";let Z;e[13]!==o||e[14]!==b||e[15]!==J?(Z=Oe("touch-none transition-colors",J,_s(o,b)),e[13]=o,e[14]=b,e[15]=J,e[16]=Z):Z=e[16];let ee;e[17]!==m||e[18]!==d||e[19]!==o?(ee=n.jsx(ys,{section:o,raw:d,meta:m}),e[17]=m,e[18]=d,e[19]=o,e[20]=ee):ee=e[20];const $=!o.isMultivariate&&n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":g(r?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:Oe("h-7 w-7 shrink-0",r?"":"opacity-0 group-hover:opacity-100"),onClick:T=>{T.stopPropagation(),D()},onPointerDown:rr,children:n.jsx(Bo,{className:Oe("h-3.5 w-3.5",r&&"text-yellow-500")})})}),n.jsx(jt,{side:"bottom",children:g(r?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]});let Ae;e[21]!==k||e[22]!==o.isHidden||e[23]!==o.isMultivariate||e[24]!==g?(Ae=!o.isMultivariate&&n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":o.isHidden?g("sectionsEditor.sectionList.showSection"):g("sectionsEditor.sectionList.hideSection"),className:Oe("h-7 w-7 shrink-0",o.isHidden?"opacity-100":"opacity-0 group-hover:opacity-100"),onClick:T=>{T.stopPropagation(),k()},onPointerDown:or,children:o.isHidden?n.jsx(Ko,{className:"h-3.5 w-3.5"}):n.jsx(Lo,{className:"h-3.5 w-3.5"})})}),n.jsx(jt,{side:"bottom",children:o.isHidden?g("sectionsEditor.sectionList.showSection"):g("sectionsEditor.sectionList.hideSection")})]}),e[21]=k,e[22]=o.isHidden,e[23]=o.isMultivariate,e[24]=g,e[25]=Ae):Ae=e[25];let Me;e[26]!==g?(Me=g("sectionsEditor.sectionList.sectionActionsMenu"),e[26]=g,e[27]=Me):Me=e[27];let et;e[28]===Symbol.for("react.memo_cache_sentinel")?(et=n.jsx(es,{className:"h-3.5 w-3.5"}),e[28]=et):et=e[28];let Se;e[29]!==Me?(Se=n.jsx(rs,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":Me,className:"h-7 w-7 shrink-0 opacity-0 group-hover:opacity-100",onClick:ar,onPointerDown:sr,children:et})}),e[29]=Me,e[30]=Se):Se=e[30];let H;e[31]!==u?(H=T=>{T.stopPropagation(),u()},e[31]=u,e[32]=H):H=e[32];let se;e[33]===Symbol.for("react.memo_cache_sentinel")?(se=n.jsx(ss,{className:"h-4 w-4"}),e[33]=se):se=e[33];let ae;e[34]!==g?(ae=g("sectionsEditor.sectionList.duplicateMenuItem"),e[34]=g,e[35]=ae):ae=e[35];let ue;e[36]!==H||e[37]!==ae?(ue=n.jsxs(ht,{onClick:H,children:[se,ae]}),e[36]=H,e[37]=ae,e[38]=ue):ue=e[38];let oe;e[39]!==l||e[40]!==E||e[41]!==g?(oe=l&&n.jsxs(ht,{className:Ka,onClick:T=>{T.stopPropagation(),E()},children:[n.jsx(as,{className:"h-4 w-4"}),g("sectionsEditor.sectionList.addVariantMenuItem")]}),e[39]=l,e[40]=E,e[41]=g,e[42]=oe):oe=e[42];let de;e[43]!==ne||e[44]!==y||e[45]!==g?(de=ne&&n.jsxs(ht,{className:er,onClick:T=>{T.stopPropagation(),y()},children:[n.jsx(gn,{className:"h-4 w-4"}),g("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[43]=ne,e[44]=y,e[45]=g,e[46]=de):de=e[46];let le;e[47]!==i||e[48]!==o.isMultivariate||e[49]!==o.isSavedBlock||e[50]!==g?(le=o.isSavedBlock===!0&&!o.isMultivariate&&n.jsxs(ht,{onClick:T=>{T.stopPropagation(),i()},children:[n.jsx(gn,{className:"h-4 w-4"}),g("sectionsEditor.sectionList.detachMenuItem")]}),e[47]=i,e[48]=o.isMultivariate,e[49]=o.isSavedBlock,e[50]=g,e[51]=le):le=e[51];let fe;e[52]!==v?(fe=T=>{T.stopPropagation(),v()},e[52]=v,e[53]=fe):fe=e[53];let De;e[54]===Symbol.for("react.memo_cache_sentinel")?(De=n.jsx(os,{className:"h-4 w-4"}),e[54]=De):De=e[54];let je;e[55]!==g?(je=g("sectionsEditor.sectionList.deleteMenuItem"),e[55]=g,e[56]=je):je=e[56];let re;e[57]!==fe||e[58]!==je?(re=n.jsxs(ht,{className:"text-destructive focus:text-destructive",onClick:fe,children:[De,je]}),e[57]=fe,e[58]=je,e[59]=re):re=e[59];let pe;e[60]!==ue||e[61]!==oe||e[62]!==de||e[63]!==le||e[64]!==re?(pe=n.jsxs(is,{align:"end",className:"w-44",children:[ue,oe,de,le,re]}),e[60]=ue,e[61]=oe,e[62]=de,e[63]=le,e[64]=re,e[65]=pe):pe=e[65];let xe;e[66]!==Se||e[67]!==pe?(xe=n.jsxs(ls,{children:[Se,pe]}),e[66]=Se,e[67]=pe,e[68]=xe):xe=e[68];let be;return e[69]!==K||e[70]!==z||e[71]!==f||e[72]!==p||e[73]!==ge||e[74]!==Z||e[75]!==ee||e[76]!==$||e[77]!==Ae||e[78]!==xe||e[79]!==I?(be=n.jsxs("div",{ref:p,style:ge,...K,...z,role:he,tabIndex:me,onClick:f,onKeyDown:I,className:Z,children:[ee,$,Ae,xe]}),e[69]=K,e[70]=z,e[71]=f,e[72]=p,e[73]=ge,e[74]=Z,e[75]=ee,e[76]=$,e[77]=Ae,e[78]=xe,e[79]=I,e[80]=be):be=e[80],be}function sr(h){return h.stopPropagation()}function ar(h){return h.stopPropagation()}function or(h){return h.stopPropagation()}function rr(h){return h.stopPropagation()}function ir(){return!1}function lr(h){const e=Ue.c(104),{listKey:o,rawSections:d,sections:m,meta:x,selectedIndex:b,onSelect:f,onReorder:v,onDelete:u,onDuplicate:y,onMakeReusable:k,onToggleHidden:D,onToggleLazy:E,onAddVariant:i,onDetach:g,onAddSection:r,canAddSection:A}=h,l=A===void 0?!0:A,R=ct();let K;e[0]!==m.length?(K=()=>zn(m.length),e[0]=m.length,e[1]=K):K=e[1];const[z,p]=w.useState(K),[N,ie]=w.useState(null),[L,ce]=w.useState(o),[M,ge]=w.useState(m.length),O=w.useRef(!1);L!==o?(ce(o),ge(m.length),p(zn(m.length))):M!==m.length&&(ge(m.length),p(ze=>tr(ze,m.length)));let ne;e[2]===Symbol.for("react.memo_cache_sentinel")?(ne={activationConstraint:{distance:8}},e[2]=ne):ne=e[2];let he;e[3]===Symbol.for("react.memo_cache_sentinel")?(he={coordinateGetter:gs},e[3]=he):he=e[3];const me=cs(Jt(ds,ne),Jt(us,he));let I;e[4]!==z?(I=z.map(cr),e[4]=z,e[5]=I):I=e[5];const J=I;let Z;e[6]===Symbol.for("react.memo_cache_sentinel")?(Z=ze=>{ie(String(ze.active.id))},e[6]=Z):Z=e[6];const ee=Z;let $;e[7]!==J||e[8]!==v?($=ze=>{ie(null);const{active:B,over:F}=ze;if(!F||B.id===F.id)return;const G=J.indexOf(String(B.id)),nt=J.indexOf(String(F.id));G===-1||nt===-1||(p(Re=>bs(Mt([...Re],G,nt))),O.current=!0,requestAnimationFrame(()=>{O.current=!1}),v?.(G,nt))},e[7]=J,e[8]=v,e[9]=$):$=e[9];const Ae=$;let Me;e[10]===Symbol.for("react.memo_cache_sentinel")?(Me=()=>{ie(null)},e[10]=Me):Me=e[10];const et=Me;let Se,H,se,ae,ue,oe,de,le,fe,De,je,re,pe,xe,be;if(e[11]!==N||e[12]!==l||e[13]!==z||e[14]!==J||e[15]!==Ae||e[16]!==x||e[17]!==r||e[18]!==i||e[19]!==u||e[20]!==g||e[21]!==y||e[22]!==k||e[23]!==f||e[24]!==D||e[25]!==E||e[26]!==d||e[27]!==m||e[28]!==b||e[29]!==me||e[30]!==R){xe=Symbol.for("react.early_return_sentinel");e:{const ze=B=>{O.current||f(B)};if(e[46]!==N||e[47]!==l||e[48]!==z||e[49]!==r||e[50]!==d||e[51]!==m||e[52]!==R){const B=N?z.find(F=>F.id===N):null;if(ae=B!=null?m[B.index]:null,se=B!=null?d[B.index]:void 0,z.length===0){let F;e[56]!==R?(F=R("sectionsEditor.sectionList.noSections"),e[56]=R,e[57]=F):F=e[57];let G;e[58]!==F?(G=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:F}),e[58]=F,e[59]=G):G=e[59];const nt=!l;let Re;e[60]===Symbol.for("react.memo_cache_sentinel")?(Re=n.jsx(hn,{size:14}),e[60]=Re):Re=e[60];let We;e[61]!==R?(We=R("sectionsEditor.sectionList.addSectionButton"),e[61]=R,e[62]=We):We=e[62];let Ne;e[63]!==r||e[64]!==nt||e[65]!==We?(Ne=n.jsxs(Qe,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:nt,onClick:r,children:[Re,We]}),e[63]=r,e[64]=nt,e[65]=We,e[66]=Ne):Ne=e[66];let vt;e[67]!==G||e[68]!==Ne?(vt=n.jsxs("div",{className:"space-y-2",children:[G,Ne]}),e[67]=G,e[68]=Ne,e[69]=vt):vt=e[69],xe=vt;break e}pe=Oe(B&&"cursor-grabbing"),e[46]=N,e[47]=l,e[48]=z,e[49]=r,e[50]=d,e[51]=m,e[52]=R,e[53]=se,e[54]=ae,e[55]=pe}else se=e[53],ae=e[54],pe=e[55];H=hs,le=me,fe=vs,De=ee,je=Ae,re=et,Se=Ss,oe=J,de=xs,be="space-y-1",ue=z.map(B=>{const F=m[B.index];return F?n.jsx(nr,{sortableId:B.id,section:F,raw:d[B.index],meta:x,selected:b===B.index,onSelect:()=>ze(B.index),onDelete:()=>u(B.index),onDuplicate:()=>y(B.index),onMakeReusable:()=>k(B.index),onToggleHidden:()=>D(B.index),onToggleLazy:()=>E(B.index),onAddVariant:()=>i(B.index),onDetach:()=>g(B.index)},B.id):null})}e[11]=N,e[12]=l,e[13]=z,e[14]=J,e[15]=Ae,e[16]=x,e[17]=r,e[18]=i,e[19]=u,e[20]=g,e[21]=y,e[22]=k,e[23]=f,e[24]=D,e[25]=E,e[26]=d,e[27]=m,e[28]=b,e[29]=me,e[30]=R,e[31]=Se,e[32]=H,e[33]=se,e[34]=ae,e[35]=ue,e[36]=oe,e[37]=de,e[38]=le,e[39]=fe,e[40]=De,e[41]=je,e[42]=re,e[43]=pe,e[44]=xe,e[45]=be}else Se=e[31],H=e[32],se=e[33],ae=e[34],ue=e[35],oe=e[36],de=e[37],le=e[38],fe=e[39],De=e[40],je=e[41],re=e[42],pe=e[43],xe=e[44],be=e[45];if(xe!==Symbol.for("react.early_return_sentinel"))return xe;let T;e[70]!==ue||e[71]!==be?(T=n.jsx("div",{className:be,children:ue}),e[70]=ue,e[71]=be,e[72]=T):T=e[72];let Ke;e[73]!==Se||e[74]!==oe||e[75]!==de||e[76]!==T?(Ke=n.jsx(Se,{items:oe,strategy:de,children:T}),e[73]=Se,e[74]=oe,e[75]=de,e[76]=T,e[77]=Ke):Ke=e[77];let Ie;e[78]!==se||e[79]!==ae||e[80]!==x?(Ie=ae?n.jsx("div",{className:Oe("cursor-grabbing shadow-lg ring-1 ring-border/60",_s(ae,!1)),children:n.jsx(ys,{section:ae,raw:se,meta:x})}):null,e[78]=se,e[79]=ae,e[80]=x,e[81]=Ie):Ie=e[81];let Ge;e[82]!==Ie?(Ge=Yn.createPortal(n.jsx(ms,{dropAnimation:Qn,children:Ie}),document.body),e[82]=Ie,e[83]=Ge):Ge=e[83];let $e;e[84]!==H||e[85]!==le||e[86]!==fe||e[87]!==De||e[88]!==je||e[89]!==re||e[90]!==Ke||e[91]!==Ge?($e=n.jsxs(H,{sensors:le,collisionDetection:fe,onDragStart:De,onDragEnd:je,onDragCancel:re,children:[Ke,Ge]}),e[84]=H,e[85]=le,e[86]=fe,e[87]=De,e[88]=je,e[89]=re,e[90]=Ke,e[91]=Ge,e[92]=$e):$e=e[92];const Ee=!l;let ye;e[93]===Symbol.for("react.memo_cache_sentinel")?(ye=n.jsx(hn,{size:14}),e[93]=ye):ye=e[93];let ke;e[94]!==R?(ke=R("sectionsEditor.sectionList.addSectionButton"),e[94]=R,e[95]=ke):ke=e[95];let Le;e[96]!==r||e[97]!==Ee||e[98]!==ke?(Le=n.jsxs(Qe,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:Ee,onClick:r,children:[ye,ke]}),e[96]=r,e[97]=Ee,e[98]=ke,e[99]=Le):Le=e[99];let Te;return e[100]!==pe||e[101]!==$e||e[102]!==Le?(Te=n.jsxs("div",{className:pe,children:[$e,Le]}),e[100]=pe,e[101]=$e,e[102]=Le,e[103]=Te):Te=e[103],Te}function cr(h){return h.id}function Hn(h){const e=Ue.c(57),{open:o,initialName:d,autoLabel:m,isPending:x,onSubmit:b,onOpenChange:f}=h,v=x===void 0?!1:x,u=ct(),[y,k]=w.useState(d),[D,E]=w.useState(o);o!==D&&(E(o),o&&k(d));let i;e[0]!==v||e[1]!==f?(i=ee=>{!ee&&!v&&f(!1)},e[0]=v,e[1]=f,e[2]=i):i=e[2];const g=i;let r;e[3]!==v||e[4]!==y||e[5]!==b?(r=async ee=>{ee.preventDefault(),!v&&await b(y.trim())},e[3]=v,e[4]=y,e[5]=b,e[6]=r):r=e[6];const A=r;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(No,{children:l}),e[9]=l,e[10]=R):R=e[10];let K;e[11]!==m||e[12]!==u?(K=u("sectionsEditor.variantRenameDialog.description",{fallback:m||u("sectionsEditor.variantRenameDialog.defaultFallback")}),e[11]=m,e[12]=u,e[13]=K):K=e[13];let z;e[14]!==K?(z=n.jsx(Do,{children:K}),e[14]=K,e[15]=z):z=e[15];let p;e[16]!==R||e[17]!==z?(p=n.jsxs(To,{children:[R,z]}),e[16]=R,e[17]=z,e[18]=p):p=e[18];let N;e[19]!==u?(N=u("sectionsEditor.variantRenameDialog.nameLabel"),e[19]=u,e[20]=N):N=e[20];let ie;e[21]!==N?(ie=n.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:N}),e[21]=N,e[22]=ie):ie=e[22];let L;e[23]===Symbol.for("react.memo_cache_sentinel")?(L=ee=>k(ee.target.value),e[23]=L):L=e[23];let ce;e[24]!==m||e[25]!==v||e[26]!==y?(ce=n.jsx(Mo,{id:"variant-rename-name",value:y,onChange:L,placeholder:m,autoFocus:!0,disabled:v}),e[24]=m,e[25]=v,e[26]=y,e[27]=ce):ce=e[27];let M;e[28]!==ie||e[29]!==ce?(M=n.jsxs("div",{className:"space-y-1.5 py-4",children:[ie,ce]}),e[28]=ie,e[29]=ce,e[30]=M):M=e[30];let ge;e[31]!==f?(ge=()=>f(!1),e[31]=f,e[32]=ge):ge=e[32];let O;e[33]!==u?(O=u("sectionsEditor.variantRenameDialog.cancel"),e[33]=u,e[34]=O):O=e[34];let ne;e[35]!==v||e[36]!==ge||e[37]!==O?(ne=n.jsx(Qe,{type:"button",variant:"outline",onClick:ge,disabled:v,children:O}),e[35]=v,e[36]=ge,e[37]=O,e[38]=ne):ne=e[38];let he;e[39]!==v||e[40]!==u?(he=v?n.jsxs(n.Fragment,{children:[n.jsx(Jn,{size:14,className:"animate-spin"}),u("sectionsEditor.variantRenameDialog.saving")]}):u("sectionsEditor.variantRenameDialog.save"),e[39]=v,e[40]=u,e[41]=he):he=e[41];let me;e[42]!==v||e[43]!==he?(me=n.jsx(Qe,{type:"submit",disabled:v,children:he}),e[42]=v,e[43]=he,e[44]=me):me=e[44];let I;e[45]!==ne||e[46]!==me?(I=n.jsxs(Po,{children:[ne,me]}),e[45]=ne,e[46]=me,e[47]=I):I=e[47];let J;e[48]!==A||e[49]!==M||e[50]!==I||e[51]!==p?(J=n.jsx(Ao,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:A,children:[p,M,I]})}),e[48]=A,e[49]=M,e[50]=I,e[51]=p,e[52]=J):J=e[52];let Z;return e[53]!==g||e[54]!==o||e[55]!==J?(Z=n.jsx(Co,{open:o,onOpenChange:g,children:J}),e[53]=g,e[54]=o,e[55]=J,e[56]=Z):Z=e[56],Z}const ur="text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]",js="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.2)]";function Es(h){const e=Ue.c(5),{rule:o,matchers:d}=h,m=o?.__resolveType??"";let x;if(e[0]!==d||e[1]!==m){const u=d.find(y=>y.resolveType===m)?.iconName??Ba(m);x=Eo(u),e[0]=d,e[1]=m,e[2]=x}else x=e[2];const b=x;if(!b)return null;let f;return e[3]!==b?(f=n.jsx(b,{size:14,className:"shrink-0"}),e[3]=b,e[4]=f):f=e[4],f}function Gn(h){return h.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
|
|
2
2
|
`)}function pn(h){return h.map((e,o)=>({id:crypto.randomUUID(),index:o,variant:e}))}function dr(h){return h.map((e,o)=>({...e,index:o}))}function ks(h){const e=Ue.c(17),{label:o,effectiveRule:d,matchers:m,canDelete:x,dragging:b,onRename:f,onDuplicate:v,onDelete:u}=h,y=ct();let k;e[0]!==d||e[1]!==m?(k=n.jsx(Es,{rule:d,matchers:m}),e[0]=d,e[1]=m,e[2]=k):k=e[2];let D;e[3]!==o?(D=n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:o}),e[3]=o,e[4]=D):D=e[4];let E;e[5]!==x||e[6]!==b||e[7]!==o||e[8]!==u||e[9]!==v||e[10]!==f||e[11]!==y?(E=!b&&n.jsxs(ls,{children:[n.jsx(rs,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":y("sectionsEditor.pageVariantTabs.actionsAriaLabel",{label:o}),className:"size-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100",onClick:fr,onPointerDown:mr,children:n.jsx(es,{size:14})})}),n.jsxs(is,{align:"end",className:"w-36",children:[n.jsxs(ht,{onClick:g=>{g.stopPropagation(),f?.()},children:[n.jsx(qo,{size:14}),y("sectionsEditor.pageVariantTabs.renameAction")]}),n.jsxs(ht,{onClick:g=>{g.stopPropagation(),v?.()},children:[n.jsx(ss,{size:14}),y("sectionsEditor.pageVariantTabs.duplicateAction")]}),n.jsx(Fo,{}),n.jsxs(ht,{variant:"destructive",disabled:!x,onClick:g=>{g.stopPropagation(),u?.()},children:[n.jsx(os,{size:14}),y("sectionsEditor.pageVariantTabs.deleteAction")]})]})]}),e[5]=x,e[6]=b,e[7]=o,e[8]=u,e[9]=v,e[10]=f,e[11]=y,e[12]=E):E=e[12];let i;return e[13]!==k||e[14]!==D||e[15]!==E?(i=n.jsxs(n.Fragment,{children:[k,D,E]}),e[13]=k,e[14]=D,e[15]=E,e[16]=i):i=e[16],i}function mr(h){return h.stopPropagation()}function fr(h){return h.stopPropagation()}function pr(h){const e=Ue.c(33),{entry:o,sortableId:d,isActive:m,canDelete:x,decofile:b,meta:f,matchers:v,onSelect:u,onRename:y,onDuplicate:k,onDelete:D}=h;let E;e[0]!==d?(E={id:d,animateLayoutChanges:gr},e[0]=d,e[1]=E):E=e[1];const{attributes:i,listeners:g,setNodeRef:r,transform:A,isDragging:l}=fs(E);let R;e[2]!==A?(R=ps.Transform.toString(A?{...A,x:0}:null),e[2]=A,e[3]=R):R=e[3];const K=l?0:void 0;let z;e[4]!==R||e[5]!==K?(z={transform:R,opacity:K},e[4]=R,e[5]=K,e[6]=z):z=e[6];const p=z,N=f??void 0;let ie;e[7]!==b||e[8]!==o.variant.rule||e[9]!==N?(ie=Ct(o.variant.rule,b,N),e[7]=b,e[8]=o.variant.rule,e[9]=N,e[10]=ie):ie=e[10];const L=ie;let ce;e[11]!==u?(ce=me=>{me.target===me.currentTarget&&(me.key==="Enter"||me.key===" ")&&(me.preventDefault(),u())},e[11]=u,e[12]=ce):ce=e[12];const M=l?"cursor-grabbing":"cursor-pointer active:cursor-grabbing",ge=m?js:ur;let O;e[13]!==M||e[14]!==ge?(O=Oe("group flex select-none items-center gap-2 rounded-md px-2 py-2.5 transition-colors touch-none",M,ge),e[13]=M,e[14]=ge,e[15]=O):O=e[15];let ne;e[16]!==x||e[17]!==L||e[18]!==o.variant.label||e[19]!==v||e[20]!==D||e[21]!==k||e[22]!==y?(ne=n.jsx(ks,{label:o.variant.label,effectiveRule:L,matchers:v,canDelete:x,onRename:y,onDuplicate:k,onDelete:D}),e[16]=x,e[17]=L,e[18]=o.variant.label,e[19]=v,e[20]=D,e[21]=k,e[22]=y,e[23]=ne):ne=e[23];let he;return e[24]!==i||e[25]!==g||e[26]!==u||e[27]!==r||e[28]!==p||e[29]!==O||e[30]!==ne||e[31]!==ce?(he=n.jsx("div",{ref:r,style:p,...i,...g,onClick:u,onKeyDown:ce,className:O,children:ne}),e[24]=i,e[25]=g,e[26]=u,e[27]=r,e[28]=p,e[29]=O,e[30]=ne,e[31]=ce,e[32]=he):he=e[32],he}function gr(){return!1}function hr(h){const e=Ue.c(9),{variant:o,decofile:d,meta:m,matchers:x}=h,b=m??void 0;let f;e[0]!==d||e[1]!==b||e[2]!==o.rule?(f=Ct(o.rule,d,b),e[0]=d,e[1]=b,e[2]=o.rule,e[3]=f):f=e[3];const v=f;let u;e[4]===Symbol.for("react.memo_cache_sentinel")?(u=Oe("flex items-center gap-2 rounded-md px-2 py-2.5 shadow-lg ring-1 ring-border/60 cursor-grabbing",js),e[4]=u):u=e[4];let y;return e[5]!==v||e[6]!==x||e[7]!==o.label?(y=n.jsx("div",{className:u,children:n.jsx(ks,{label:o.label,effectiveRule:v,matchers:x,canDelete:!1,dragging:!0})}),e[5]=v,e[6]=x,e[7]=o.label,e[8]=y):y=e[8],y}function vr(h){const e=Ue.c(91),{listKey:o,variants:d,activeIndex:m,decofile:x,meta:b,matchers:f,onSelect:v,onReorder:u,onRename:y,onDuplicate:k,onDelete:D,onAdd:E}=h,i=ct();let g;e[0]!==d?(g=()=>pn(d),e[0]=d,e[1]=g):g=e[1];const[r,A]=w.useState(g),[l,R]=w.useState(null),[K,z]=w.useState(o),[p,N]=w.useState(d.length);let ie;e[2]!==d?(ie=()=>Gn(d),e[2]=d,e[3]=ie):ie=e[3];const[L,ce]=w.useState(ie),M=w.useRef(!1),ge=Gn(d);K!==o?(z(o),N(d.length),ce(ge),A(pn(d))):p!==d.length?(N(d.length),ce(ge),A(pn(d))):L!==ge&&(ce(ge),A($e=>d.map((Ee,ye)=>({id:$e[ye]?.id??crypto.randomUUID(),index:ye,variant:Ee}))));let O;e[4]===Symbol.for("react.memo_cache_sentinel")?(O={activationConstraint:{distance:8}},e[4]=O):O=e[4];let ne;e[5]===Symbol.for("react.memo_cache_sentinel")?(ne={coordinateGetter:gs},e[5]=ne):ne=e[5];const he=cs(Jt(ds,O),Jt(us,ne));let me;e[6]!==r?(me=r.map(Sr),e[6]=r,e[7]=me):me=e[7];const I=me,J=d.length>1;let Z;e[8]!==r?(Z=$e=>{const Ee=String($e.active.id);R(r.find(ye=>ye.id===Ee)??null)},e[8]=r,e[9]=Z):Z=e[9];const ee=Z;let $;e[10]!==I||e[11]!==u?($=$e=>{R(null);const{active:Ee,over:ye}=$e;if(!ye||Ee.id===ye.id)return;const ke=I.indexOf(String(Ee.id)),Le=I.indexOf(String(ye.id));ke===-1||Le===-1||(A(Te=>dr(Mt([...Te],ke,Le))),M.current=!0,requestAnimationFrame(()=>{M.current=!1}),u(ke,Le))},e[10]=I,e[11]=u,e[12]=$):$=e[12];const Ae=$;let Me;e[13]===Symbol.for("react.memo_cache_sentinel")?(Me=()=>{R(null)},e[13]=Me):Me=e[13];const et=Me;let Se,H,se,ae,ue,oe,de,le,fe,De,je,re,pe;if(e[14]!==m||e[15]!==J||e[16]!==x||e[17]!==r||e[18]!==I||e[19]!==Ae||e[20]!==ee||e[21]!==f||e[22]!==b||e[23]!==E||e[24]!==D||e[25]!==k||e[26]!==y||e[27]!==v||e[28]!==he||e[29]!==i){const $e=G=>{M.current||v(G)};je="space-y-1 border-b p-2";let Ee;e[43]!==i?(Ee=i("sectionsEditor.pageVariantTabs.variantsLabel"),e[43]=i,e[44]=Ee):Ee=e[44];let ye;e[45]!==Ee?(ye=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:Ee}),e[45]=Ee,e[46]=ye):ye=e[46];let ke;e[47]!==i?(ke=i("sectionsEditor.pageVariantTabs.addVariantAriaLabel"),e[47]=i,e[48]=ke):ke=e[48];let Le;e[49]===Symbol.for("react.memo_cache_sentinel")?(Le=n.jsx(hn,{size:14}),e[49]=Le):Le=e[49];let Te;e[50]!==E||e[51]!==ke?(Te=n.jsx(_t,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":ke,className:"size-6",onClick:E,children:Le})}),e[50]=E,e[51]=ke,e[52]=Te):Te=e[52];let ze;e[53]!==i?(ze=i("sectionsEditor.pageVariantTabs.addVariantTooltip"),e[53]=i,e[54]=ze):ze=e[54];let B;e[55]!==ze?(B=n.jsx(jt,{children:ze}),e[55]=ze,e[56]=B):B=e[56];let F;e[57]!==Te||e[58]!==B?(F=n.jsxs(yt,{children:[Te,B]}),e[57]=Te,e[58]=B,e[59]=F):F=e[59],e[60]!==ye||e[61]!==F?(re=n.jsxs("div",{className:"flex items-center justify-between",children:[ye,F]}),e[60]=ye,e[61]=F,e[62]=re):re=e[62],H=hs,oe=he,de=vs,le=ee,fe=Ae,De=et,Se=Ss,ae=I,ue=xs,pe="space-y-0.5",se=r.map(G=>n.jsx(pr,{sortableId:G.id,entry:G,isActive:G.index===m,canDelete:J,decofile:x,meta:b,matchers:f,onSelect:()=>$e(G.index),onRename:()=>y(G.index),onDuplicate:()=>k(G.index),onDelete:()=>D(G.index)},G.id)),e[14]=m,e[15]=J,e[16]=x,e[17]=r,e[18]=I,e[19]=Ae,e[20]=ee,e[21]=f,e[22]=b,e[23]=E,e[24]=D,e[25]=k,e[26]=y,e[27]=v,e[28]=he,e[29]=i,e[30]=Se,e[31]=H,e[32]=se,e[33]=ae,e[34]=ue,e[35]=oe,e[36]=de,e[37]=le,e[38]=fe,e[39]=De,e[40]=je,e[41]=re,e[42]=pe}else Se=e[30],H=e[31],se=e[32],ae=e[33],ue=e[34],oe=e[35],de=e[36],le=e[37],fe=e[38],De=e[39],je=e[40],re=e[41],pe=e[42];let xe;e[63]!==se||e[64]!==pe?(xe=n.jsx("div",{className:pe,children:se}),e[63]=se,e[64]=pe,e[65]=xe):xe=e[65];let be;e[66]!==Se||e[67]!==ae||e[68]!==ue||e[69]!==xe?(be=n.jsx(Se,{items:ae,strategy:ue,children:xe}),e[66]=Se,e[67]=ae,e[68]=ue,e[69]=xe,e[70]=be):be=e[70];let T;e[71]!==l||e[72]!==x||e[73]!==f||e[74]!==b?(T=l?n.jsx(hr,{variant:l.variant,decofile:x,meta:b,matchers:f}):null,e[71]=l,e[72]=x,e[73]=f,e[74]=b,e[75]=T):T=e[75];let Ke;e[76]!==T?(Ke=Yn.createPortal(n.jsx(ms,{dropAnimation:Qn,children:T}),document.body),e[76]=T,e[77]=Ke):Ke=e[77];let Ie;e[78]!==H||e[79]!==oe||e[80]!==de||e[81]!==le||e[82]!==fe||e[83]!==De||e[84]!==be||e[85]!==Ke?(Ie=n.jsxs(H,{sensors:oe,collisionDetection:de,onDragStart:le,onDragEnd:fe,onDragCancel:De,children:[be,Ke]}),e[78]=H,e[79]=oe,e[80]=de,e[81]=le,e[82]=fe,e[83]=De,e[84]=be,e[85]=Ke,e[86]=Ie):Ie=e[86];let Ge;return e[87]!==je||e[88]!==re||e[89]!==Ie?(Ge=n.jsxs("div",{className:je,children:[re,Ie]}),e[87]=je,e[88]=re,e[89]=Ie,e[90]=Ge):Ge=e[90],Ge}function Sr(h){return h.id}function xr(h){const e=Ue.c(16),{schema:o,value:d,onChange:m,meta:x,decofile:b,onSaveReferencedBlock:f,sandbox:v}=h,u=ct();let y;e[0]===Symbol.for("react.memo_cache_sentinel")?(y=[],e[0]=y):y=e[0];const[k,D]=w.useState(y);let E;e[1]!==k||e[2]!==u?(E=k.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:()=>D([]),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(ts,{className:"size-3.5"})}),k.map((r,A)=>{const l=A===k.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[A>0&&n.jsx(ns,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>D(k.slice(0,A+1)),title:r,className:Oe("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}-${A}`)})]}),e[1]=k,e[2]=u,e[3]=E):E=e[3];let i;e[4]!==k||e[5]!==b||e[6]!==x||e[7]!==m||e[8]!==f||e[9]!==v||e[10]!==o||e[11]!==d?(i=n.jsx(Zn,{schema:o,value:d,onChange:m,basePath:"",breadcrumbPath:k,onBreadcrumbChange:D,meta:x,decofile:b,onSaveReferencedBlock:f,sandbox:v}),e[4]=k,e[5]=b,e[6]=x,e[7]=m,e[8]=f,e[9]=v,e[10]=o,e[11]=d,e[12]=i):i=e[12];let g;return e[13]!==E||e[14]!==i?(g=n.jsxs("div",{className:"space-y-2",children:[E,i]}),e[13]=E,e[14]=i,e[15]=g):g=e[15],g}function Un(h){const e=Ue.c(23),{activeSchema:o,formValue:d,formResetKey:m,onFormChange:x,onBreadcrumbChange:b,breadcrumbPath:f,emptyMessage:v,beforeForm:u,seoResolveType:y,siteDefaultSeo:k,meta:D,decofile:E,onSaveReferencedBlock:i,sandbox:g,previewBaseUrl:r,onRequestAddSection:A}=h;let l;e[0]!==f?(l=f===void 0?[]:f,e[0]=f,e[1]=l):l=e[1];const R=l;let K;e[2]!==o||e[3]!==R||e[4]!==E||e[5]!==m||e[6]!==d||e[7]!==D||e[8]!==b||e[9]!==x||e[10]!==A||e[11]!==i||e[12]!==r||e[13]!==g||e[14]!==y||e[15]!==k?(K=o&&d?y?n.jsx(Oo,{schema:o,resolveType:y,value:d,formResetKey:m,onChange:x,onBreadcrumbChange:b,siteDefaultSeo:k}):n.jsx(Zn,{schema:o,value:d,onChange:x,basePath:"",breadcrumbPath:R,onBreadcrumbChange:b,meta:D,decofile:E,onSaveReferencedBlock:i,sandbox:g,previewBaseUrl:r,onRequestAddSection:A},m):null,e[2]=o,e[3]=R,e[4]=E,e[5]=m,e[6]=d,e[7]=D,e[8]=b,e[9]=x,e[10]=A,e[11]=i,e[12]=r,e[13]=g,e[14]=y,e[15]=k,e[16]=K):K=e[16];const z=K;let p;e[17]!==v||e[18]!==z?(p=z??n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:v}),e[17]=v,e[18]=z,e[19]=p):p=e[19];let N;return e[20]!==u||e[21]!==p?(N=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,p]})}),e[20]=u,e[21]=p,e[22]=N):N=e[22],N}const br="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 yr(h,e){return Fa(h,e,lt)}function _r(h){const e=Ue.c(19),{pageKey:o,initialName:d,initialPath:m,onFieldChange:x}=h,b=ct(),[f,v]=w.useState(d),[u,y]=w.useState(m),[k,D]=w.useState(o);k!==o&&(D(o),v(d),y(m));let E;e[0]!==x?(E=K=>{v(K.target.value),x("name",K.target.value)},e[0]=x,e[1]=E):E=e[1];let i;e[2]!==b?(i=b("sectionsEditor.sectionsEditorPanels.pageNamePlaceholder"),e[2]=b,e[3]=i):i=e[3];let g;e[4]!==f||e[5]!==E||e[6]!==i?(g=n.jsx("input",{type:"text",value:f,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]=f,e[5]=E,e[6]=i,e[7]=g):g=e[7];let r;e[8]!==x?(r=K=>{y(K.target.value),x("path",K.target.value)},e[8]=x,e[9]=r):r=e[9];let A;e[10]!==b?(A=b("sectionsEditor.sectionsEditorPanels.pathPlaceholder"),e[10]=b,e[11]=A):A=e[11];let l;e[12]!==u||e[13]!==r||e[14]!==A?(l=n.jsx("input",{type:"text",value:u,onChange:r,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:A}),e[12]=u,e[13]=r,e[14]=A,e[15]=l):l=e[15];let R;return e[16]!==g||e[17]!==l?(R=n.jsxs("div",{className:"space-y-1",children:[g,l]}),e[16]=g,e[17]=l,e[18]=R):R=e[18],R}function Wn(h){const e=Ue.c(13),{onClick:o}=h,d=ct();let m;e[0]!==d?(m=d("sectionsEditor.sectionsEditorPanels.addVariant"),e[0]=d,e[1]=m):m=e[1];let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(as,{size:14}),e[2]=x):x=e[2];let b;e[3]!==o||e[4]!==m?(b=n.jsx(_t,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":m,className:"size-7 shrink-0 text-[oklch(0.65_0.15_160)]",onClick:o,children:x})}),e[3]=o,e[4]=m,e[5]=b):b=e[5];let f;e[6]!==d?(f=d("sectionsEditor.sectionsEditorPanels.addVariant"),e[6]=d,e[7]=f):f=e[7];let v;e[8]!==f?(v=n.jsx(jt,{side:"bottom",children:f}),e[8]=f,e[9]=v):v=e[9];let u;return e[10]!==b||e[11]!==v?(u=n.jsxs(yt,{children:[b,v]}),e[10]=b,e[11]=v,e[12]=u):u=e[12],u}function qn(h){const e=Ue.c(21),{currentRt:o,currentLabel:d,currentGlobalKey:m,matchers:x,globals:b,onSelect:f,onSelectGlobal:v,schema:u,formValue:y,onChange:k,formKey:D,formWrapperClassName:E,meta:i,decofile:g,onSaveReferencedBlock:r,sandbox:A}=h;let l;e[0]!==m||e[1]!==d||e[2]!==o||e[3]!==b||e[4]!==x||e[5]!==f||e[6]!==v?(l=n.jsx(Oa,{currentRt:o,currentLabel:d,currentGlobalKey:m,matchers:x,globals:b,onSelect:f,onSelectGlobal:v}),e[0]=m,e[1]=d,e[2]=o,e[3]=b,e[4]=x,e[5]=f,e[6]=v,e[7]=l):l=e[7];let R;e[8]!==g||e[9]!==D||e[10]!==y||e[11]!==E||e[12]!==i||e[13]!==k||e[14]!==r||e[15]!==A||e[16]!==u?(R=u&&y&&n.jsx("div",{className:E,children:n.jsx(xr,{schema:u,value:y,onChange:k,meta:i,decofile:g,onSaveReferencedBlock:r,sandbox:A},D)}),e[8]=g,e[9]=D,e[10]=y,e[11]=E,e[12]=i,e[13]=k,e[14]=r,e[15]=A,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 uc({orgSlug:h,virtualMcpId:e,branch:o,previewReady:d=!0,previewUrl:m,currentPath:x,activePageBlockKey:b=null,activeGlobalBlockKey:f=null,externalSelectedIndex:v,onSaved:u,initialEditSeo:y=!1,onExitSeo:k,onViewJsonFile:D,onVariantPreviewOverride:E}){const i=ct(),g=d?{orgSlug:h,virtualMcpId:e,branch:o,previewUrl:m}:null,{data:r,isLoading:A}=Ia(g),{data:l,isLoading:R}=$a(g),K=za(),z=K?.entity?.id===e?K.entity.metadata?.siteSlug??null:null,[p,N]=w.useState(null),[ie,L]=w.useState(null),[ce,M]=w.useState(null),[ge,O]=w.useState(0),[ne,he]=w.useState(void 0),[me,I]=w.useState(null),[J,Z]=w.useState(null),[ee,$]=w.useState([]),Ae=w.useRef(null),[Me,et]=w.useState(ee.length);Me!==ee.length&&(et(ee.length),requestAnimationFrame(()=>{Ae.current&&(Ae.current.scrollTop=0)}));const[Se,H]=w.useState(0),[se,ae]=w.useState(null),[ue,oe]=w.useState(null),[de,le]=w.useState(null),[fe,De]=w.useState(!0),[je,re]=w.useState(!1),[pe,xe]=w.useState(!1),be=w.useRef(null),[T,Ke]=w.useState(y),[Ie,Ge]=w.useState(y);y&&!Ie&&(Ge(!0),Ke(!0),N(null),L(null),M(null),$([])),!y&&Ie&&Ge(!1);const[$e,Ee]=w.useState(null),[ye,ke]=w.useState(void 0),[Le,Te]=w.useState([]),[ze,B]=w.useState(0),[F,G]=w.useState(0),[nt,Re]=w.useState(null),[We,Ne]=w.useState(null),[vt,vn]=w.useState(null),Rs=Na(),ws=`${h}/${e}/${o}`,Qt=Ha({orgSlug:h,virtualMcpId:e,branch:o}),[Vs,Ns]=w.useState(x),[Ds,Ts]=w.useState(b),[Ps,As]=w.useState(f);(Vs!==x||Ds!==b||Ps!==f)&&(queueMicrotask(()=>Qt.flush()),Ns(x),Ts(b),As(f),N(null),L(null),M(null),O(0),I(null),Z(null),G(0),Re(null),Ne(null),$([]),H(t=>t+1),Ke(!1),Ee(null),ke(void 0),Te([]),B(t=>t+1));const we=Ga({orgSlug:h,virtualMcpId:e,branch:o}),Kt=uo((t,s)=>{we.mutate({blockKey:t,data:s},{onSuccess:()=>u?.(),onError:a=>X.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:a.message}))})}),Xt=Ua({orgSlug:h,virtualMcpId:e,branch:o}),[Nt,Lt]=w.useState(!1),Be=w.useRef(null),st=w.useRef(null),at=w.useRef(null),Zt=w.useRef({}),Xe=w.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null});if(!d||A||R)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(Jn,{size:20,className:"animate-spin text-muted-foreground"})});if(!r||!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 Cs=Wa(r),Ve=!!f,qe=Ve?null:qa(Cs,x,b),V=Ve?f:qe?.key??null,en=Ve&&f?r[f]:void 0,Sn=Ve&&f&&en?Ya(f,en):Ve&&f?f:"",Bt=!Ve&&V&&r[V]?r[V]:null,tn=T&&r&&l&&V&&qe?$n(r,{kind:"page",pageKey:V,pageName:String(qe.name??""),path:String(qe.path??"")},l):null,Ms=T?Bt?.seo:void 0,nn=ye!==void 0?ye:Ms,Ks=T?Io(nn):void 0,Ls=tn?.seoTypeOptions??[],Bs=T&&l?$o(l):"",xn=$e??Ks??{},sn=T&&tn?zo(xn,tn):null,Fs=T&&sn&&Ho(nn)?Gt(sn,l):null,Os=T?Go(r,l)?.seoData:void 0,He=Ve?[{label:"Default",sections:[{__resolveType:f}]}]:yr(Bt?.sections,r??{}),Ft=He.length>1,Ce=Math.min(ge,He.length-1),ut=He[Ce],q=ut?.sections??[],Fe=Ut(q,r),bn=!Ve&&Ja(Bt?.sections);if(Ve&&f&&vt!==f){vn(f);const t=q[0],s=Fe[0];if(t&&s){N(0),G(0),$([]);const a=xt(t,s,r);a&&(L(a.data),M(a.resolveType),Ne(null),Re(null))}}!Ve&&vt!==null&&vn(null),Xe.current={rawSections:q,parsedSections:Fe,decofile:r??{},activePageKey:V,pageVariants:He,variantIndex:Ce,sectionVariantIndex:F,selectedSectionIndex:p};const Is=()=>({multivariate:bn,index:Ce,variants:He.map(t=>({rule:t.rule}))}),yn=(t,s)=>{if(!E)return;if(!V||!bn||t.length<=1){E(null);return}const a=In(V,{multivariate:!0,index:s,variants:t},r,l);E(a.length>0?a:null)},Et=(t,s,a)=>{if(!E)return;if(!V){E(null);return}const c=Is(),S=In(V,c,r,l);if(!t||s<0){E(S.length>0?S:null);return}const j=ho({pageKey:V,page:c,sectionIndex:s,sectionLazy:Fe[s]?.isLazy??!1,mvObj:t,selectedVariantIndex:a,decofile:r,meta:l}),_=[...S,...j];E(_.length>0?_:null)},dt=(t,s,a,c=p??-1,S=!1)=>{const j=tt(t,s);if(!j){L(null),M(null),Ne(null),Re(null),S&&Et(null,c,a);return}const P=Mn(j,lt)[a];if(!P){L(null),M(null),Ne(null),Re(null),S&&Et(null,c,a);return}const te=no(P.value,r);L(te?.data??null),M(te?.resolveType??null);const{resolveType:C,formValue:U}=Tt(P.rule,r,l??void 0);Ne(C),Re(U),S&&Et(j,c,a)};if(v!==void 0&&v!==ne&&(he(v??null),typeof v=="number")){const t=q[v],s=Fe[v];if(t&&s)if(N(v),G(0),$([]),H(a=>a+1),s.isMultivariate)dt(t,s,0,v);else{const a=xt(t,s,r);a?(L(a.data),M(a.resolveType)):(L(null),M(null)),Ne(null),Re(null)}}const Ot={orgSlug:h,virtualMcpId:e,branch:o,previewUrl:m??void 0,siteSlug:z},an=ce&&l?Gt(ce,l):null,Ye=(t,s)=>{if(!V)return;Be.current&&(clearTimeout(Be.current),Be.current=null),at.current&&(clearTimeout(at.current),at.current=null),st.current&&(clearTimeout(st.current),st.current=null);const a=At(r,V,t,Ce,He);we.mutate({blockKey:V,data:a},{onSuccess:()=>s?.onSuccess?.()??u?.(),onError:c=>X.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:c.message}))})},kt=()=>{N(null),L(null),M(null),G(0),Re(null),Ne(null),$([]),H(t=>t+1)},$s=(t,s)=>{Be.current&&clearTimeout(Be.current);const a=Xe.current.sectionVariantIndex;Be.current=setTimeout(()=>{const{rawSections:c,parsedSections:S,decofile:j,activePageKey:_,pageVariants:P,variantIndex:te}=Xe.current,C=c[s];if(!C)return;const U=S[s];if(!U)return;if(U.isSavedBlock){const Y=U.isLazy?C.section?.__resolveType??C.__resolveType:C.__resolveType;we.mutate({blockKey:Y,data:t},{onSuccess:()=>u?.(),onError:Q=>X.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:Q.message}))});return}if(!_)return;const W={...j[_]},_e=[...c];if(U.isMultivariate){const Y=tt(C,U);if(!Y||!_)return;const Q=So(Y,a,t);_e[s]=bt(C,U,Q)}else if(U.isHidden){const Y=Xn(C.__resolveType),Q=Y?{...C.section}:{...C},Pe=Array.isArray(Q.variants)?[...Q.variants]:[];Pe[0]&&(Pe[0]={...Pe[0],value:t}),Q.variants=Pe,Y?_e[s]={...C,section:Q}:_e[s]=Q}else U.isLazy?_e[s]={...C,section:t}:_e[s]=t;if(P.length>1){const Y=W.sections,Q=[...Y?.variants??[]];Q[te]&&(Q[te]={...Q[te],value:_e}),W.sections={...Y,variants:Q}}else W.sections=_e;we.mutate({blockKey:_,data:W},{onSuccess:()=>u?.(),onError:Y=>X.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:Y.message}))})},fn)},zs=t=>{N(t),G(0),$([]),H(S=>S+1);const s=q[t],a=Fe[t];if(!s||!a)return;if(a.isMultivariate){dt(s,a,0,t);return}const c=xt(s,a,r);if(!c){L(null),M(null),Ne(null),Re(null),Et(null,t,0);return}L(c.data),M(c.resolveType),Ne(null),Re(null),Et(null,t,0)},_n=t=>{const s=t;L(s),p!==null&&$s(s,p)},on=t=>{if(!V||!r||!l||!qe)return;const s={kind:"page",pageKey:V,pageName:String(qe.name??""),path:String(qe.path??"")},a=$n(r,s,l);a&&Qt.save(V,()=>{const c=Rs.getQueryData(Da.decofile(ws))?.[V];if(!c||typeof c!="object"||c===null||Array.isArray(c))return null;const S={...c,...Zt.current};return Zt.current={},t?.raw!==void 0?{...S,seo:t.raw}:t?.inner!==void 0?Wo(s,a,S,t.inner):S})},Hs=(t,s)=>{V&&(Zt.current[t]=s,on())},Gs=(t,s)=>{if(!V)return;const a=Mt([...q],t,s);p!==null&&(p===t?N(s):t<p&&s>=p?N(p-1):t>p&&s<=p&&N(p+1)),Ye(a)},Us=t=>{if(!V)return;const s=q.filter((a,c)=>c!==t);p===t?kt():p!==null&&p>t&&N(p-1),Ye(s)},Ws=t=>{if(!V)return;const s=q[t];if(!s)return;const a=[...q];a.splice(t+1,0,go(s)),p!==null&&p>t&&N(p+1),Ye(a)},qs=t=>{if(!V)return;const s=q[t],a=Fe[t];if(!s||!a||a.isMultivariate)return;const c=a.isHidden?fo(s):po(s);if(!c)return;const S=[...q];S[t]=c,p===t&&kt(),Ye(S)},Ys=t=>{if(!V)return;const s=q[t],a=Fe[t];if(!s||!a||a.isMultivariate)return;const c=mo(s);if(!c)return;const S=[...q];S[t]=c,p===t&&kt(),Ye(S)},Js=t=>{if(!V)return;const s=q[t],a=Fe[t];if(!s||!a?.isSavedBlock)return;const c=xt(s,a,r);if(!c?.data)return;const{name:S,...j}=c.data,_=[...q];a.isLazy?_[t]={...s,section:j}:_[t]=j,p===t&&kt(),Ye(_)},Qs=t=>{if(!V)return;const s=[...q,{__resolveType:t.resolveType}],a=s.length-1;Ye(s,{onSuccess:()=>{re(!1),N(a),G(0),$([]),H(_=>_+1);const c=s[a],S=Ut(s,r)[a];if(!c||!S)return;if(S.isMultivariate){dt(c,S,0);return}const j=xt(c,S,r);if(!j){L(null),M(null),Ne(null),Re(null);return}L(j.data),M(j.resolveType),Ne(null),Re(null)}})},jn=t=>{be.current=t.append,re(!0)},Xs=t=>{const s=be.current;if(!s){Qs(t);return}s({__resolveType:t.resolveType}),re(!1),be.current=null},Zs=t=>{if(p===null)return;const s=q[p],a=Fe[p];!s||!a?.isMultivariate||(G(t),$([]),H(c=>c+1),dt(s,a,t,p,!0))},ea=t=>{if(p===null||!V)return;const s=q[p],a=Fe[p];if(!s||!a?.isMultivariate)return;const c=tt(s,a);if(!c)return;const S=lo(c,t);if(!S){X.error(i("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const j=[...q];j[p]=bt(s,a,S);const _=S.variants;let P=F;t===F?P=Math.min(t,_.length-1):t<F&&(P=F-1),G(P),$([]),H(te=>te+1),dt(j[p],a,P),Ye(j)},ta=t=>{if(p===null||!V)return;const s=q[p],a=Fe[p];if(!s||!a?.isMultivariate)return;const c=tt(s,a);if(!c)return;const S=co(c,t),j=[...q];j[p]=bt(s,a,S);const _=t+1;G(_),$([]),H(P=>P+1),dt(j[p],a,_),Ye(j)},na=(t,s)=>{if(p===null||!V||t===s)return;const a=q[p],c=Fe[p];if(!a||!c?.isMultivariate)return;const S=tt(a,c);if(!S)return;const j=ro(S,t,s),_=[...q];_[p]=bt(a,c,j);let P=F;F===t?P=s:t<F&&s>=F?P=F-1:t>F&&s<=F&&(P=F+1),G(P),dt(_[p],c,P),Ye(_)},rn=t=>{const s=t??p;if(s===null||!V)return;const a=q[s],c=Fe[s];if(!a||!c)return;const S=so(a,c);if(!S){X.error(i("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const j=[...q];j[s]=S.section;const _=Ut(j,r)[s];if(!_?.isMultivariate){X.error(i("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}N(s),G(S.newVariantIndex),$([]),H(P=>P+1),dt(S.section,_,S.newVariantIndex,s),Ye(j)},sa=()=>{if(p===null||!V)return;const t=q[p],s=Fe[p];if(!t||!s?.isMultivariate)return;const a=tt(t,s);if(!a)return;const c=io(t,s,a);if(!c){X.error(i("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const S=[...q];S[p]=c;const j=Ut(S,r)[p];if(!j)return;G(0),Ne(null),Re(null),$([]),H(P=>P+1);const _=xt(c,j,r);_?(L(_.data),M(_.resolveType)):(L(null),M(null)),Et(null,p,0),Ye(S)},aa=async t=>{if(se===null||!V)return;const s=mn(t,r);if(s){X.error(s);return}const a=q[se],c=Fe[se];if(!a||!c)return;const S=xt(a,c,r);if(!S){X.error(i("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const j={...S.data,name:t};try{await we.mutateAsync({blockKey:t,data:j});const _=[...q];_[se]={__resolveType:t},await we.mutateAsync({blockKey:V,data:At(r,V,_,Ce,He)}),p===se&&kt(),ae(null),X.success(i("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),u?.()}catch(_){X.error(_ instanceof Error?_.message:i("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"))}},En=ut?.rule;if(Ft&&p===null&&J===null&&En){const{resolveType:t,formValue:s}=Tt(En,r??{},l??void 0);Z(t),I(s)}const It=l?Qa(l):[],kn=l&&r?Xa(l,r):[],oa=!Ve&&!!(m&&l&&r),ra=J&&l?Gt(J,l):null,Rt=()=>{st.current&&(clearTimeout(st.current),st.current=null),at.current&&(clearTimeout(at.current),at.current=null)},Dt=async(t,s)=>{if(!(vo(s,t,l)>0))try{await Xt.mutateAsync({blockKey:t})}catch(a){X.error(a instanceof Error?a.message:i("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"))}},Rn=t=>{st.current&&clearTimeout(st.current),st.current=setTimeout(()=>{const{activePageKey:s,decofile:a,variantIndex:c}=Xe.current;if(!s)return;const S={...a[s]},j={...S.sections},_=[...j.variants??[]],P=_[c],te=P?.rule;if(wt(te,a,l)){const C=te?.__resolveType??"",U=a[C],W=typeof U?.name=="string"?U.name:C,{__resolveType:_e,...Y}=t;we.mutate({blockKey:C,data:Vt(_e??"",Y,W)},{onSuccess:()=>u?.(),onError:Q=>X.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:Q.message}))});return}P&&(_[c]={...P,rule:t}),S.sections={...j,variants:_},we.mutate({blockKey:s,data:S},{onSuccess:()=>u?.(),onError:C=>X.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:C.message}))})},fn)},ia=t=>{Z(t);const s=t?Ln(t,l):{__resolveType:Bn};I(t?s:{}),Rn(s)},la=t=>{const s=t;I(s);const a=J?{__resolveType:J,...s}:{...s};Rn(a)},ca=async t=>{Rt();const{activePageKey:s,decofile:a,variantIndex:c}=Xe.current;if(!s)return;const S=a[s],j=S?.sections;if(!j||typeof j!="object"||Array.isArray(j))return;const _=j;if(!Array.isArray(_.variants))return;const P=[..._.variants],te=P[c];if(!te)return;const C=Pt(te.rule,a,l),U=qt(t);P[c]={...te,rule:U};const W={...a,[s]:{...S,sections:{..._,variants:P}}},{resolveType:_e,formValue:Y}=Tt(U,W,l??void 0);Z(_e),I(Y);try{await we.mutateAsync({blockKey:s,data:W[s]}),C&&C!==t&&await Dt(C,W),u?.()}catch(Q){X.error(Q instanceof Error?Q.message:i("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}},wn=t=>{at.current&&clearTimeout(at.current);const{selectedSectionIndex:s,sectionVariantIndex:a}=Xe.current;s!==null&&(at.current=setTimeout(()=>{const{rawSections:c,parsedSections:S,decofile:j,activePageKey:_,pageVariants:P,variantIndex:te}=Xe.current;if(!_)return;const C=c[s],U=S[s];if(!C||!U?.isMultivariate)return;const W=tt(C,U);if(!W)return;const Y=(W.variants??[])[a]?.rule;if(wt(Y,j,l)){const ve=Y?.__resolveType??"",Je=j[ve],rt=typeof Je?.name=="string"?Je.name:ve,{__resolveType:pt,...it}=t;we.mutate({blockKey:ve,data:Vt(pt??"",it,rt)},{onSuccess:()=>u?.(),onError:gt=>X.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:gt.message}))});return}const Q=Kn(W,a,t),Pe=[...c];Pe[s]=bt(C,U,Q);const Ze=At(j,_,Pe,te,P);we.mutate({blockKey:_,data:Ze},{onSuccess:()=>u?.(),onError:ve=>X.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:ve.message}))})},fn))},ua=t=>{Ne(t);const s=t?Ln(t,l):{__resolveType:Bn};Re(t?s:{}),wn(s)},da=t=>{const s=t;Re(s);const a=We?{__resolveType:We,...s}:{...s};wn(a)},ma=async t=>{Rt();const{selectedSectionIndex:s,sectionVariantIndex:a,rawSections:c,parsedSections:S,decofile:j,activePageKey:_,pageVariants:P,variantIndex:te}=Xe.current;if(s===null||!_)return;const C=c[s],U=S[s];if(!C||!U?.isMultivariate)return;const W=tt(C,U);if(!W)return;const _e=W.variants??[],Y=Pt(_e[a]?.rule,j,l),Q=qt(t),Pe=Kn(W,a,Q),Ze=[...c];Ze[s]=bt(C,U,Pe);const ve=At(j,_,Ze,te,P),Je={...j,[_]:ve},{resolveType:rt,formValue:pt}=Tt(Q,Je,l??void 0);Ne(rt),Re(pt);try{await we.mutateAsync({blockKey:_,data:ve}),Y&&Y!==t&&await Dt(Y,Je),u?.()}catch(it){X.error(it instanceof Error?it.message:i("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}};if(!Ve&&!qe)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:x})});if(Ve&&!en)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 mt=p!==null?Fe[p]??null:null,Vn=p!==null?q[p]:null,Nn=Vn&&mt?.isMultivariate?tt(Vn,mt):null,St=Nn?Mn(Nn,lt):[],ln=Math.min(F,Math.max(St.length-1,0)),$t=St[ln]??null,ft=mt?.isMultivariate===!0,Dn=p!==null&&mt!==null,zt=Dn&&(ft||!!(an&&ie)),fa=zt&&!Ve&&mt?.isSavedBlock===!0,ot=Ve||fa,pa=Ve?Sn:mt?.label??"",ga=We&&l?Gt(We,l):null,cn=zt&&(!Ve||ee.length>0)?Ve?[Sn,...ee]:[qe.name,mt.label,...ft&&$t?[$t.label]:[],...ee]:[],ha=T&&qe?[qe.name,"SEO",...Le]:[],Ht=T?ha:ot?cn.length>0?cn:[pa]:cn,va=!T&&!Ve&&ft&&ee.length===0,Tn=()=>{if(!V)return;Rt(),Be.current&&(clearTimeout(Be.current),Be.current=null);const t=r[V],s=ao(t.sections,q);if(!s)return;const a=oo(s);we.mutate({blockKey:V,data:{...t,sections:s}},{onSuccess:()=>{O(a),N(null),L(null),M(null),$([]),I(null),Z(null)},onError:c=>X.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:c.message}))})},un=(t,s,a)=>{if(!V)return;Rt(),Be.current&&(clearTimeout(Be.current),Be.current=null);const c=r[V],S=c.sections;if(!S||typeof S!="object"||Array.isArray(S))return;const j=S;if(!Array.isArray(j.variants))return;const _=t([...j.variants]);if(!_)return;const P=xo(j,_),te={...r,[V]:{...c,sections:P}};we.mutate({blockKey:V,data:te[V]},{onSuccess:()=>{s?.(),a&&Dt(a,te)},onError:C=>X.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:C.message}))})},Sa=t=>{oe(null),O(t),N(null),L(null),M(null),$([]);const s=He[t]?.rule,{resolveType:a,formValue:c}=Tt(s,r??{},l??void 0);Z(a),I(c),yn(He.map(S=>({rule:S.rule})),t)},xa=(t,s)=>{if(t===s)return;let a=Ce;Ce===t?a=s:t<Ce&&s>=Ce?a=Ce-1:t>Ce&&s<=Ce&&(a=Ce+1),O(a);const c=Mt(He.map(S=>({rule:S.rule})),t,s);yn(c,a),un(S=>Mt(S,t,s))},ba=t=>{const s=He[t]?.rule,a=Pt(s,r??{},l??void 0);un(c=>c.length<=1?null:(c.splice(t,1),c),()=>{He.length-1===1?O(0):t<Ce?O(Ce-1):t===Ce&&O(Math.max(0,t-1)),N(null),L(null),M(null),$([]),I(null),Z(null)},a)},ya=t=>{un(s=>bo(s,t),()=>{O(t+1),N(null),L(null),M(null),$([]),I(null),Z(null)})},_a=async(t,s)=>{Rt(),Be.current&&(clearTimeout(Be.current),Be.current=null);const a=Xe.current.activePageKey,c=Xe.current.decofile;if(!a)return;const S=c[a],j=S.sections;if(!j||typeof j!="object"||Array.isArray(j))return;const _=j;if(!Array.isArray(_.variants))return;const P=[..._.variants],te=P[t];if(!te?.rule||typeof te.rule!="object"){X.error(i("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const C=te.rule,U=s.trim();Lt(!0);try{if(!U){if(!wt(C,c,l)){oe(null);return}const Ze=C.__resolveType??"";P[t]={...te,rule:Fn(C,c,l)};const ve={...c,[a]:{...S,sections:{..._,variants:P}}};await we.mutateAsync({blockKey:a,data:ve[a]}),await Dt(Ze,ve),oe(null),u?.();return}const W=On(C,c,l);if(!W){X.error(i("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(W.blockKey){await we.mutateAsync({blockKey:W.blockKey,data:Vt(W.resolveType,W.data,U)}),oe(null),u?.();return}const _e=dn(U),Y=mn(_e,c);if(Y){X.error(Y);return}const Q=Vt(W.resolveType,W.data,U);let Pe=null;try{await we.mutateAsync({blockKey:_e,data:Q}),Pe=_e,P[t]={...te,rule:qt(_e)},await we.mutateAsync({blockKey:a,data:{...S,sections:{..._,variants:P}}}),Pe=null}catch(Ze){throw Pe&&await Xt.mutateAsync({blockKey:Pe}).catch(()=>{}),Ze}oe(null),X.success(i("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:U})),u?.()}catch(W){X.error(W instanceof Error?W.message:i("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Lt(!1)}},ja=async(t,s)=>{Rt(),Be.current&&(clearTimeout(Be.current),Be.current=null);const{selectedSectionIndex:a,rawSections:c,parsedSections:S,decofile:j,activePageKey:_,pageVariants:P,variantIndex:te}=Xe.current;if(a===null||!_)return;const C=c[a],U=S[a];if(!C||!U?.isMultivariate)return;const W=tt(C,U);if(!W)return;const _e=W.variants??[],Y=_e[t];if(!Y?.rule||typeof Y.rule!="object"){X.error(i("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const Q=Y.rule,Pe=s.trim();Lt(!0);const Ze=async ve=>{const Je={...W,variants:ve},rt=[...c];rt[a]=bt(C,U,Je);const pt=At(j,_,rt,te,P);return await we.mutateAsync({blockKey:_,data:pt}),{...j,[_]:pt}};try{if(!Pe){if(!wt(Q,j,l)){le(null);return}const gt=Q.__resolveType??"",Cn=[..._e];Cn[t]={...Y,rule:Fn(Q,j,l)};const Va=await Ze(Cn);await Dt(gt,Va),le(null),u?.();return}const ve=On(Q,j,l);if(!ve){X.error(i("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(ve.blockKey){await we.mutateAsync({blockKey:ve.blockKey,data:Vt(ve.resolveType,ve.data,Pe)}),le(null),u?.();return}const Je=dn(Pe),rt=mn(Je,j);if(rt){X.error(rt);return}const pt=Vt(ve.resolveType,ve.data,Pe);let it=null;try{await we.mutateAsync({blockKey:Je,data:pt}),it=Je;const gt=[..._e];gt[t]={...Y,rule:qt(Je)},await Ze(gt),it=null}catch(gt){throw it&&await Xt.mutateAsync({blockKey:it}).catch(()=>{}),gt}le(null),X.success(i("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:Pe})),u?.()}catch(ve){X.error(ve instanceof Error?ve.message:i("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Lt(!1)}},Pn=()=>{kt()},Ea=t=>{Ee(t),on({inner:t})},ka=t=>{ke(t),on({raw:t})},Ra=()=>{Ee(null),Te([])},wa=()=>B(t=>t+1),An=t=>{if(T){if(t===0){Qt.flush(),Ke(!1),Ee(null),ke(void 0),Te([]),B(a=>a+1),k?.();return}if(t===1){Te([]),B(a=>a+1);return}Te(Le.slice(0,t-1)),B(a=>a+1);return}if(Ve){$(ee.slice(0,t)),H(a=>a+1);return}if(t===0){Pn();return}if(t===1){$([]),H(a=>a+1);return}if(ft&&t===2){$([]),H(a=>a+1);return}const s=ft?2:1;$(ee.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||zt||T?n.jsxs("div",{className:Oe("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:[Ht.length>1&&n.jsx("button",{type:"button",onClick:()=>An(yo(Ht.length,{isMultivariateSectionTop:va})),title:i("sectionsEditor.sectionsEditor.back"),"aria-label":i("sectionsEditor.sectionsEditor.back"),className:Oe("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(ts,{className:"size-4"})}),!Ve&&Ft&&ut&&n.jsxs("button",{type:"button",onClick:Pn,title:i("sectionsEditor.sectionsEditor.editingInVariant",{variant:ut.label}),className:Oe("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",br),children:[n.jsx(Es,{rule:Ct(ut.rule,r??{},l??void 0),matchers:It}),n.jsx("span",{className:"max-w-[160px] truncate",children:ut.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:Ht.map((t,s)=>{const a=s===Ht.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[s>0&&n.jsx(ns,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>An(s),title:t,className:Oe("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:t})]},`${t}-${s}`)})}),ot&&n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(Vo,{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")})]}),Dn&&!ft&&!mt?.isHidden&&V&&n.jsx(Wn,{onClick:()=>rn()})]}),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(_r,{pageKey:V,initialName:qe.name,initialPath:qe.path,onFieldChange:Hs})}),n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":i("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:()=>Ke(!0),children:n.jsx(ko,{size:14})})}),n.jsx(jt,{side:"bottom",children:i("sectionsEditor.sectionsEditor.editSeo")})]}),n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":i("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>D&&V?D(V):xe(!0),children:n.jsx(Ro,{size:14})})}),n.jsx(jt,{side:"bottom",children:i("sectionsEditor.sectionsEditor.viewJson")})]}),n.jsx(Wn,{onClick:Tn})]})}),T?n.jsx(Yt,{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:Bt&&V?n.jsx(Uo,{rawSeo:nn,innerSeo:xn,defaultResolveType:Bs,seoSchema:Fs,activeResolveType:sn,seoTypeOptions:Ls,formResetKey:ze,siteDefaultSeo:Os,onBreadcrumbChange:Te,onPersistRaw:ka,onInnerChange:Ea,onClearForm:Ra,onBumpFormKey:wa}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:i("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})}):zt?n.jsxs(Yt,{viewportRef:Ae,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[ft&&St.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(Za,{listKey:`${V??""}:${p??""}`,variants:St.map((t,s)=>({index:s,label:t.label})),selectedIndex:ln,onSelect:Zs,onRename:le,onDuplicate:ta,onDelete:ea,onRemoveAll:sa,onReorder:na,onAdd:()=>rn()}),ft&&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($t?.rule,r??{},lt,l??void 0),currentGlobalKey:Pt($t?.rule,r??{},l??void 0)??void 0,matchers:It,globals:kn,onSelect:ua,onSelectGlobal:ma,schema:ga,formValue:nt,onChange:da,formKey:`${p??"none"}:${ln}:${We??""}`,formWrapperClassName:"pt-1",meta:l??void 0,decofile:r,onSaveReferencedBlock:Kt,sandbox:Ot})]})]}),n.jsx(Un,{activeSchema:an,formValue:ie,formResetKey:Se,onFormChange:_n,onBreadcrumbChange:$,breadcrumbPath:ee,emptyMessage:i("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:l,decofile:r,onSaveReferencedBlock:Kt,sandbox:Ot,previewBaseUrl:m,onRequestAddSection:jn})]}):Ve?n.jsx(Yt,{viewportRef:Ae,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx(Un,{activeSchema:an,formValue:ie,formResetKey:Se,onFormChange:_n,onBreadcrumbChange:$,breadcrumbPath:ee,emptyMessage:i("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:l,decofile:r,onSaveReferencedBlock:Kt,sandbox:Ot,previewBaseUrl:m,onRequestAddSection:jn})}):n.jsxs(Yt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[Ft&&V&&n.jsx(vr,{listKey:V,variants:He,activeIndex:Ce,decofile:r??{},meta:l,matchers:It,onSelect:Sa,onReorder:xa,onRename:oe,onDuplicate:ya,onDelete:ba,onAdd:Tn}),Ft&&J!==null&&n.jsxs("div",{className:Oe("px-3 border-b",fe?"pt-3 pb-5 space-y-3":"py-2"),children:[n.jsxs("button",{type:"button",onClick:()=>De(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":fe,children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:i("sectionsEditor.sectionsEditor.variantRule")}),fe?n.jsx(wo,{className:"size-3.5 shrink-0 text-muted-foreground"}):n.jsx(_o,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),fe&&n.jsx("div",{className:Oe("space-y-3",Nt&&"pointer-events-none opacity-50"),children:n.jsx(qn,{currentRt:J,currentLabel:Wt(ut?.rule,r??{},lt,l??void 0),currentGlobalKey:Pt(ut?.rule,r??{},l??void 0)??void 0,matchers:It,globals:kn,onSelect:ia,onSelectGlobal:ca,schema:ra,formValue:me,onChange:la,formKey:`${Ce}:${J??""}`,formWrapperClassName:"space-y-3",meta:l??void 0,decofile:r,onSaveReferencedBlock:Kt,sandbox:Ot})})]}),n.jsx("div",{className:"p-2 pt-3",children:n.jsx(lr,{listKey:`${V??""}-${Ce}`,rawSections:q,sections:Fe,meta:l,selectedIndex:p,onSelect:zs,onReorder:Gs,onDelete:Us,onDuplicate:Ws,onMakeReusable:ae,onToggleHidden:qs,onToggleLazy:Ys,onAddVariant:rn,onDetach:Js,onAddSection:()=>re(!0),canAddSection:oa})})]}),n.jsx(eo,{open:se!==null,onOpenChange:t=>{t||ae(null)},defaultBlockId:se!==null?dn(Fe[se]?.label??""):"",isPending:we.isPending,onSubmit:aa}),m&&n.jsx(Yo,{open:je,onOpenChange:t=>{re(t),t||(be.current=null)},meta:l,decofile:r,previewBaseUrl:m,onSelect:Xs}),pe&&V&&r&&n.jsx(to,{open:pe,onOpenChange:xe,pageKey:V,decofile:r}),ue!==null&&n.jsx(Hn,{open:!0,initialName:wt(He[ue]?.rule,r??{},l??void 0)?Wt(He[ue]?.rule,r??{},lt,l??void 0):"",autoLabel:lt(Ct(He[ue]?.rule,r??{},l??void 0)),isPending:Nt,onSubmit:async t=>{await _a(ue,t)},onOpenChange:t=>{!t&&!Nt&&oe(null)}}),de!==null&&n.jsx(Hn,{open:!0,initialName:wt(St[de]?.rule,r??{},l??void 0)?Wt(St[de]?.rule,r??{},lt,l??void 0):"",autoLabel:lt(Ct(St[de]?.rule,r??{},l??void 0)),isPending:Nt,onSubmit:async t=>{await ja(de,t)},onOpenChange:t=>{!t&&!Nt&&le(null)}})]})}export{uc as SectionsEditor};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as V,j as s,b as ie,r as U,B as de,m as ce,af as yt,X as Ye,Y as je,F as be,o as _e,Z as Qe,_ as Je,e as ke,K as fe,t as me,p as ue,D as jt,n as St,d as Nt,E as kt,z as wt}from"./index-
|
|
1
|
+
import{c as V,j as s,b as ie,r as U,B as de,m as ce,af as yt,X as Ye,Y as je,F as be,o as _e,Z as Qe,_ as Je,e as ke,K as fe,t as me,p as ue,D as jt,n as St,d as Nt,E as kt,z as wt}from"./index-xLZV-a-I.js";import{e as Me,d as Ee,a as Ze,b as Oe,h as et,c as tt,D as Ct}from"./dialog-BAhwXLtu.js";import{d as It,b as _t,a as Mt,D as Et}from"./drawer-BQd2nFSf.js";import{u as Ot}from"./use-mobile-4pnpeHV9.js";import{c as st,D as Lt,u as Le}from"./chat-context-CoSeVfqX.js";import{C as At}from"./checkbox-hIdnOQby.js";import{I as xe}from"./input-BojcyffB.js";import{S as Pt,a as Tt,b as Dt,c as zt,d as Rt}from"./select-vILxxytl.js";import{S as se}from"./skeleton-6qQI888K.js";import{i as it,b as lt,c as Kt,a as Ft,s as $t}from"./Settings02--NDw0tr0.js";import{d as Ut,a as Bt,b as Wt,i as Vt}from"./Tool01-B1U6TeQ7.js";import{i as Ht}from"./Key01-B_NmjlUq.js";import{i as nt}from"./SearchMd-BBtCjgk8.js";import{d as Ae,u as qt,b as Gt}from"./use-ai-providers-DsZYnQg7.js";import{g as Pe}from"./ai-providers-logos-DD3qZ33J.js";import{i as Xt}from"./Monitor01-BW-aur37.js";import{i as Yt}from"./AlertCircle-YkJszhyi.js";import{S as Ie}from"./spinner-o1rRSgzv.js";import{u as Ce}from"./studio-tools-BtWoNkcq.js";import{i as Qt}from"./ChevronRight-D7bdokHb.js";import{A as Jt}from"./avatar-B4ZEWEhO.js";import{S as ze,a as Re,b as ot}from"./settings-section-DN6dwCrb.js";import{s as rt}from"./Eye-BjzBo9pu.js";import{i as Zt,D as es}from"./tab-id-DiqmaBy2.js";import{u as ts}from"./use-is-desktop-app-BNujXJc_.js";import{i as ss}from"./Check-BanZqVS6.js";import{a as is}from"./Copy01-D8PXcQlN.js";import{t as Ke}from"./ChevronDown-CUX5BVRH.js";import{t as ls}from"./Stars01-lkb5ewEZ.js";function ge(l){const e=V.c(3),{size:t}=l,i=t===void 0?16:t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("path",{d:"M13 12L18.5 5M7.63965 3L12.5 12L13.6865 3M4.48381 6.71679L11.9872 12M3 12L11.9872 12.473M12.2244 13.177L7 20M4.84194 16.8682L11.2824 12.9758M11.5 21L12.665 13.177M21 14L13.1846 12.668M21 10.5788L13 12.3223M16.779 19.646L12.8876 13.3772M19.3566 18.207L13.313 12.9893"}),e[0]=n):n=e[0];let o;return e[1]!==i?(o=s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:i,height:i,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:n}),e[1]=i,e[2]=o):o=e[2],o}function ve(l){const e=V.c(3),{size:t}=l,i=t===void 0?16:t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("path",{clipRule:"evenodd",d:"M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z"}),e[0]=n):n=e[0];let o;return e[1]!==i?(o=s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:i,height:i,fill:"currentColor",fillRule:"evenodd","aria-hidden":"true",children:n}),e[1]=i,e[2]=o):o=e[2],o}const ns={"claude-code":{labelKey:"chat.agentIcons.claudeCode",Icon:ge},codex:{labelKey:"chat.agentIcons.codex",Icon:ve}};function nl(l){return(l&&ns[l])??null}const Fe="bunx decocms@latest link",os=[{capability:"claude-code",labelKey:"chat.connectDesktopDialog.agentClaudeCodeLabel",descriptionKey:"chat.connectDesktopDialog.agentClaudeCodeDescription",icon:s.jsx(ge,{size:18})},{capability:"codex",labelKey:"chat.connectDesktopDialog.agentCodexLabel",descriptionKey:"chat.connectDesktopDialog.agentCodexDescription",icon:s.jsx(ve,{size:18})}];function rs(l){const e=V.c(46),{open:t,onOpenChange:i}=l,n=ie();let o;e[0]!==t?(o={fast:t},e[0]=t,e[1]=o):o=e[1];const r=st(o),[c,u]=U.useState(!1);let d,a,h,p,m,f,b,N;if(e[2]!==r.hostname||e[3]!==r.machineId||e[4]!==r.online||e[5]!==i||e[6]!==t||e[7]!==n){const w=r.hostname??r.machineId??n("chat.connectDesktopDialog.yourDesktop");p=Me,b=t,N=i,h=Ee,f="sm:max-w-md",a=Ze,d=Oe,m=r.online?n("chat.connectDesktopDialog.connectedTo",{desktopName:w}):n("chat.connectDesktopDialog.connectYourDesktop"),e[2]=r.hostname,e[3]=r.machineId,e[4]=r.online,e[5]=i,e[6]=t,e[7]=n,e[8]=d,e[9]=a,e[10]=h,e[11]=p,e[12]=m,e[13]=f,e[14]=b,e[15]=N}else d=e[8],a=e[9],h=e[10],p=e[11],m=e[12],f=e[13],b=e[14],N=e[15];let y;e[16]!==d||e[17]!==m?(y=s.jsx(d,{children:m}),e[16]=d,e[17]=m,e[18]=y):y=e[18];let j;e[19]!==r.online||e[20]!==n?(j=r.online?n("chat.connectDesktopDialog.machineAgentsDescription"):n("chat.connectDesktopDialog.runCommandDescription"),e[19]=r.online,e[20]=n,e[21]=j):j=e[21];let C;e[22]!==j?(C=s.jsx(et,{children:j}),e[22]=j,e[23]=C):C=e[23];let E;e[24]!==a||e[25]!==y||e[26]!==C?(E=s.jsxs(a,{children:[y,C]}),e[24]=a,e[25]=y,e[26]=C,e[27]=E):E=e[27];let M;e[28]!==c||e[29]!==r.online?(M=!r.online&&s.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-muted px-3 py-2 font-mono text-sm",children:[s.jsx("span",{className:"flex-1",children:Fe}),s.jsx(de,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>{navigator.clipboard.writeText(Fe).then(()=>{u(!0),setTimeout(()=>u(!1),1500)})},children:c?s.jsx(ss,{size:14}):s.jsx(is,{size:14})})]}),e[28]=c,e[29]=r.online,e[30]=M):M=e[30];let I;e[31]!==r.capabilities||e[32]!==r.online||e[33]!==n?(I=r.online?s.jsx("div",{className:"flex flex-col gap-3 text-sm",children:s.jsx("div",{className:"flex flex-col gap-2",children:os.map(w=>{const _=r.capabilities.includes(w.capability);return s.jsxs("div",{className:ce("flex items-center gap-3 rounded-md border px-3 py-2",_?"border-border bg-background text-foreground":"border-border/60 bg-muted/40 text-muted-foreground"),children:[s.jsx("div",{className:ce("flex size-6 items-center justify-center",_?"text-foreground":"text-muted-foreground"),children:w.icon}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"font-medium",children:n(w.labelKey)}),s.jsx("p",{className:"text-xs text-muted-foreground",children:n(_?w.descriptionKey:"chat.connectDesktopDialog.notDetected")})]}),s.jsx("span",{className:ce("size-2 rounded-full",_?"bg-success":"bg-muted-foreground/30")})]},w.capability)})})}):s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(Ie,{size:"sm"}),n("chat.connectDesktopDialog.waitingForDesktop")]}),e[31]=r.capabilities,e[32]=r.online,e[33]=n,e[34]=I):I=e[34];let x;e[35]!==h||e[36]!==M||e[37]!==I||e[38]!==f||e[39]!==E?(x=s.jsxs(h,{className:f,children:[E,M,I]}),e[35]=h,e[36]=M,e[37]=I,e[38]=f,e[39]=E,e[40]=x):x=e[40];let k;return e[41]!==p||e[42]!==x||e[43]!==b||e[44]!==N?(k=s.jsx(p,{open:b,onOpenChange:N,children:x}),e[41]=p,e[42]=x,e[43]=b,e[44]=N,e[45]=k):k=e[45],k}function pe(l,e,t){let i=t.initialDeps??[],n,o=!0;function r(){var c,u,d;let a;t.key&&((c=t.debug)!=null&&c.call(t))&&(a=Date.now());const h=l();if(!(h.length!==i.length||h.some((f,b)=>i[b]!==f)))return n;i=h;let m;if(t.key&&((u=t.debug)!=null&&u.call(t))&&(m=Date.now()),n=e(...h),t.key&&((d=t.debug)!=null&&d.call(t))){const f=Math.round((Date.now()-a)*100)/100,b=Math.round((Date.now()-m)*100)/100,N=b/16,y=(j,C)=>{for(j=String(j);j.length<C;)j=" "+j;return j};console.info(`%c⏱ ${y(b,5)} /${y(f,5)} ms`,`
|
|
2
2
|
font-size: .6rem;
|
|
3
3
|
font-weight: bold;
|
|
4
4
|
color: hsl(${Math.max(0,Math.min(120-120*N,120))}deg 100% 31%);`,t?.key)}return t?.onChange&&!(o&&t.skipInitialOnChange)&&t.onChange(n),o=!1,n}return r.updateDeps=c=>{i=c},r}function $e(l,e){if(l===void 0)throw new Error("Unexpected undefined");return l}const as=(l,e)=>Math.abs(l-e)<1.01,cs=(l,e,t)=>{let i;return function(...n){l.clearTimeout(i),i=l.setTimeout(()=>e.apply(this,n),t)}},Ue=l=>{const{offsetWidth:e,offsetHeight:t}=l;return{width:e,height:t}},ds=l=>l,us=l=>{const e=Math.max(l.startIndex-l.overscan,0),t=Math.min(l.endIndex+l.overscan,l.count-1),i=[];for(let n=e;n<=t;n++)i.push(n);return i},ms=(l,e)=>{const t=l.scrollElement;if(!t)return;const i=l.targetWindow;if(!i)return;const n=r=>{const{width:c,height:u}=r;e({width:Math.round(c),height:Math.round(u)})};if(n(Ue(t)),!i.ResizeObserver)return()=>{};const o=new i.ResizeObserver(r=>{const c=()=>{const u=r[0];if(u?.borderBoxSize){const d=u.borderBoxSize[0];if(d){n({width:d.inlineSize,height:d.blockSize});return}}n(Ue(t))};l.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(c):c()});return o.observe(t,{box:"border-box"}),()=>{o.unobserve(t)}},Be={passive:!0},We=typeof window>"u"?!0:"onscrollend"in window,hs=(l,e)=>{const t=l.scrollElement;if(!t)return;const i=l.targetWindow;if(!i)return;let n=0;const o=l.options.useScrollendEvent&&We?()=>{}:cs(i,()=>{e(n,!1)},l.options.isScrollingResetDelay),r=a=>()=>{const{horizontal:h,isRtl:p}=l.options;n=h?t.scrollLeft*(p&&-1||1):t.scrollTop,o(),e(n,a)},c=r(!0),u=r(!1);t.addEventListener("scroll",c,Be);const d=l.options.useScrollendEvent&&We;return d&&t.addEventListener("scrollend",u,Be),()=>{t.removeEventListener("scroll",c),d&&t.removeEventListener("scrollend",u)}},fs=(l,e,t)=>{if(e?.borderBoxSize){const i=e.borderBoxSize[0];if(i)return Math.round(i[t.options.horizontal?"inlineSize":"blockSize"])}return l[t.options.horizontal?"offsetWidth":"offsetHeight"]},ps=(l,{adjustments:e=0,behavior:t},i)=>{var n,o;const r=l+e;(o=(n=i.scrollElement)==null?void 0:n.scrollTo)==null||o.call(n,{[i.options.horizontal?"left":"top"]:r,behavior:t})};class xs{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var t,i,n;return((n=(i=(t=this.targetWindow)==null?void 0:t.performance)==null?void 0:i.now)==null?void 0:n.call(i))??Date.now()},this.observer=(()=>{let t=null;const i=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(n=>{n.forEach(o=>{const r=()=>{const c=o.target,u=this.indexFromElement(c);if(!c.isConnected){this.observer.unobserve(c);return}this.shouldMeasureDuringScroll(u)&&this.resizeItem(u,this.options.measureElement(c,o,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()})}));return{disconnect:()=>{var n;(n=i())==null||n.disconnect(),t=null},observe:n=>{var o;return(o=i())==null?void 0:o.observe(n,{box:"border-box"})},unobserve:n=>{var o;return(o=i())==null?void 0:o.unobserve(n)}}})(),this.range=null,this.setOptions=t=>{Object.entries(t).forEach(([i,n])=>{typeof n>"u"&&delete t[i]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:ds,rangeExtractor:us,onChange:()=>{},measureElement:fs,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",...t}},this.notify=t=>{var i,n;(n=(i=this.options).onChange)==null||n.call(i,this,t)},this.maybeNotify=pe(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const i=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==i){if(this.cleanup(),!i){this.maybeNotify();return}this.scrollElement=i,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(n=>{this.observer.observe(n)}),this.unsubs.push(this.options.observeElementRect(this,n=>{this.scrollRect=n,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(n,o)=>{this.scrollAdjustments=0,this.scrollDirection=o?this.getScrollOffset()<n?"forward":"backward":null,this.scrollOffset=n,this.isScrolling=o,this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(t,i)=>{const n=new Map,o=new Map;for(let r=i-1;r>=0;r--){const c=t[r];if(n.has(c.lane))continue;const u=o.get(c.lane);if(u==null||c.end>u.end?o.set(c.lane,c):c.end<u.end&&n.set(c.lane,!0),n.size===this.options.lanes)break}return o.size===this.options.lanes?Array.from(o.values()).sort((r,c)=>r.end===c.end?r.index-c.index:r.end-c.end)[0]:void 0},this.getMeasurementOptions=pe(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(t,i,n,o,r,c,u)=>(this.prevLanes!==void 0&&this.prevLanes!==c&&(this.lanesChangedFlag=!0),this.prevLanes=c,this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:i,scrollMargin:n,getItemKey:o,enabled:r,lanes:c,laneAssignmentMode:u}),{key:!1}),this.getMeasurements=pe(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:t,paddingStart:i,scrollMargin:n,getItemKey:o,enabled:r,lanes:c,laneAssignmentMode:u},d)=>{if(!r)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>t)for(const m of this.laneAssignments.keys())m>=t&&this.laneAssignments.delete(m);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(m=>{this.itemSizeCache.set(m.key,m.size)}));const a=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===t&&(this.lanesSettling=!1);const h=this.measurementsCache.slice(0,a),p=new Array(c).fill(void 0);for(let m=0;m<a;m++){const f=h[m];f&&(p[f.lane]=m)}for(let m=a;m<t;m++){const f=o(m),b=this.laneAssignments.get(m);let N,y;const j=u==="estimate"||d.has(f);if(b!==void 0&&this.options.lanes>1){N=b;const I=p[N],x=I!==void 0?h[I]:void 0;y=x?x.end+this.options.gap:i+n}else{const I=this.options.lanes===1?h[m-1]:this.getFurthestMeasurement(h,m);y=I?I.end+this.options.gap:i+n,N=I?I.lane:m%this.options.lanes,this.options.lanes>1&&j&&this.laneAssignments.set(m,N)}const C=d.get(f),E=typeof C=="number"?C:this.options.estimateSize(m),M=y+E;h[m]={index:m,start:y,size:E,end:M,key:f,lane:N},p[N]=m}return this.measurementsCache=h,h},{key:!1,debug:()=>this.options.debug}),this.calculateRange=pe(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,i,n,o)=>this.range=t.length>0&&i>0?gs({measurements:t,outerSize:i,scrollOffset:n,lanes:o}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=pe(()=>{let t=null,i=null;const n=this.calculateRange();return n&&(t=n.startIndex,i=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,i]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,i]},(t,i,n,o,r)=>o===null||r===null?[]:t({startIndex:o,endIndex:r,overscan:i,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=t=>{const i=this.options.indexAttribute,n=t.getAttribute(i);return n?parseInt(n,10):(console.warn(`Missing attribute name '${i}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=t=>{var i;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const n=this.scrollState.index??((i=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:i.index);if(n!==void 0&&this.range){const o=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,n-o),c=Math.min(this.options.count-1,n+o);return t>=r&&t<=c}return!0},this.measureElement=t=>{if(!t){this.elementsCache.forEach((r,c)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(c))});return}const i=this.indexFromElement(t),n=this.options.getItemKey(i),o=this.elementsCache.get(n);o!==t&&(o&&this.observer.unobserve(o),this.observer.observe(t),this.elementsCache.set(n,t)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(i)&&this.resizeItem(i,this.options.measureElement(t,void 0,this))},this.resizeItem=(t,i)=>{var n;const o=this.measurementsCache[t];if(!o)return;const r=this.itemSizeCache.get(o.key)??o.size,c=i-r;c!==0&&(((n=this.scrollState)==null?void 0:n.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(o,c,this):o.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=c,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(o.index),this.itemSizeCache=new Map(this.itemSizeCache.set(o.key,i)),this.notify(!1))},this.getVirtualItems=pe(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,i)=>{const n=[];for(let o=0,r=t.length;o<r;o++){const c=t[o],u=i[c];n.push(u)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const i=this.getMeasurements();if(i.length!==0)return $e(i[at(0,i.length-1,n=>$e(i[n]).start,t)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const t=this.scrollElement.document.documentElement;return this.options.horizontal?t.scrollWidth-this.scrollElement.innerWidth:t.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(t,i,n=0)=>{if(!this.scrollElement)return 0;const o=this.getSize(),r=this.getScrollOffset();i==="auto"&&(i=t>=r+o?"end":"start"),i==="center"?t+=(n-o)/2:i==="end"&&(t-=o);const c=this.getMaxScrollOffset();return Math.max(Math.min(c,t),0)},this.getOffsetForIndex=(t,i="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const n=this.getSize(),o=this.getScrollOffset(),r=this.measurementsCache[t];if(!r)return;if(i==="auto")if(r.end>=o+n-this.options.scrollPaddingEnd)i="end";else if(r.start<=o+this.options.scrollPaddingStart)i="start";else return[o,i];if(i==="end"&&t===this.options.count-1)return[this.getMaxScrollOffset(),i];const c=i==="end"?r.end+this.options.scrollPaddingEnd:r.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(c,i,r.size),i]},this.scrollToOffset=(t,{align:i="start",behavior:n="auto"}={})=>{const o=this.getOffsetForAlignment(t,i),r=this.now();this.scrollState={index:null,align:i,behavior:n,startedAt:r,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(t,{align:i="auto",behavior:n="auto"}={})=>{t=Math.max(0,Math.min(t,this.options.count-1));const o=this.getOffsetForIndex(t,i);if(!o)return;const[r,c]=o,u=this.now();this.scrollState={index:t,align:c,behavior:n,startedAt:u,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(t,{behavior:i="auto"}={})=>{const n=this.getScrollOffset()+t,o=this.now();this.scrollState={index:null,align:"start",behavior:i,startedAt:o,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:i}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{var t;const i=this.getMeasurements();let n;if(i.length===0)n=this.options.paddingStart;else if(this.options.lanes===1)n=((t=i[i.length-1])==null?void 0:t.end)??0;else{const o=Array(this.options.lanes).fill(null);let r=i.length-1;for(;r>=0&&o.some(c=>c===null);){const c=i[r];o[c.lane]===null&&(o[c.lane]=c.end),r--}n=Math.max(...o.filter(c=>c!==null))}return Math.max(n-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(t,{adjustments:i,behavior:n})=>{this.options.scrollToFn(t,{behavior:n,adjustments:i},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(e)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const i=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,n=i?i[0]:this.scrollState.lastTargetOffset,o=1,r=n!==this.scrollState.lastTargetOffset;if(!r&&as(n,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=o){this.scrollState=null;return}}else this.scrollState.stableFrames=0,r&&(this.scrollState.lastTargetOffset=n,this.scrollState.behavior="auto",this._scrollToOffset(n,{adjustments:void 0,behavior:"auto"}));this.scheduleScrollReconcile()}}const at=(l,e,t,i)=>{for(;l<=e;){const n=(l+e)/2|0,o=t(n);if(o<i)l=n+1;else if(o>i)e=n-1;else return n}return l>0?l-1:0};function gs({measurements:l,outerSize:e,scrollOffset:t,lanes:i}){const n=l.length-1,o=u=>l[u].start;if(l.length<=i)return{startIndex:0,endIndex:n};let r=at(0,n,o,t),c=r;if(i===1)for(;c<n&&l[c].end<t+e;)c++;else if(i>1){const u=Array(i).fill(0);for(;c<n&&u.some(a=>a<t+e);){const a=l[c];u[a.lane]=a.end,c++}const d=Array(i).fill(t+e);for(;r>=0&&d.some(a=>a>=t);){const a=l[r];d[a.lane]=a.start,r--}r=Math.max(0,r-r%i),c=Math.min(n,c+(i-1-c%i))}return{startIndex:r,endIndex:c}}const Ve=typeof document<"u"?U.useLayoutEffect:U.useEffect;function vs({useFlushSync:l=!0,...e}){const t=U.useReducer(()=>({}),{})[1],i={...e,onChange:(o,r)=>{var c;l&&r?yt.flushSync(t):t(),(c=e.onChange)==null||c.call(e,o,r)}},[n]=U.useState(()=>new xs(i));return n.setOptions(i),Ve(()=>n._didMount(),[]),Ve(()=>n._willUpdate()),n}function bs(l){return vs({observeElementRect:ms,observeElementOffset:hs,scrollToFn:ps,...l})}const ct=[{id:"openai",name:"OpenAI",description:"GPT-4, GPT-5, and other OpenAI models",logo:"https://decoims.com/decocms/b51001ef-ae58-4db4-8a75-9e6d2df2dd8e/openai.png",baseUrlPlaceholder:"https://api.openai.com/v1",defaultBaseUrl:"https://api.openai.com/v1",apiKeyRecommended:!0,helpText:"Use your OpenAI API key (starts with sk-)."},{id:"litellm",name:"LiteLLM",description:"Connect to a LiteLLM gateway your team manages",logo:"https://decoims.com/decocms/e974ae05-ad64-4b4a-8444-d9705f019b85/litellm.png",baseUrlPlaceholder:"http://localhost:4000",apiKeyRecommended:!0,helpText:"Point at your LiteLLM proxy. The base URL should be the root of the proxy (we'll append /v1)."},{id:"ollama",name:"Ollama",description:"Run open-source models on your own computer",logo:"https://decoims.com/decocms/2bb2f822-5288-4b7c-a541-dcbef76525a0/ollama.png",baseUrlPlaceholder:"http://localhost:11434",apiKeyRecommended:!1,helpText:"Ollama exposes /v1 by default — no API key required for local use."},{id:"lm-studio",name:"LM Studio",description:"Open models running through LM Studio",logo:"https://decoims.com/decocms/9f0ab1a9-d2d5-4f3e-9de0-aadd4926428d/lmstudio.webp",baseUrlPlaceholder:"http://localhost:1234",apiKeyRecommended:!1,helpText:"Start the local server in LM Studio, then paste its base URL here."},{id:"vllm",name:"vLLM",description:"Connect to your team's self-hosted vLLM server",logo:"https://decoims.com/decocms/b6c60e4f-a4aa-443c-981f-ad0f31640e22/vllm.png",baseUrlPlaceholder:"http://localhost:8000",apiKeyRecommended:!1}];function Se(l){if(l)return ct.find(e=>e.id===l)}const He=4;function ye(l){const e=V.c(8),{logo:t,name:i,description:n,onClick:o}=l;let r;e[0]!==t||e[1]!==i?(r=t?s.jsx("img",{src:t,alt:i,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):s.jsx(Jt,{fallback:i.charAt(0),className:"size-8 bg-primary/10 text-primary"}),e[0]=t,e[1]=i,e[2]=r):r=e[2];let c;return e[3]!==n||e[4]!==i||e[5]!==o||e[6]!==r?(c=s.jsx(ot,{onClick:o,icon:r,title:i,description:n}),e[3]=n,e[4]=i,e[5]=o,e[6]=r,e[7]=c):c=e[7],c}function dt(l){const e=V.c(38),{providers:t,onSelect:i,onShowAll:n}=l,o=ie();let r;e[0]!==t?(r=t.find(Ns),e[0]=t,e[1]=r):r=e[1];const c=r;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u={openrouter:0,llmapi:1,anthropic:2,google:3},e[2]=u):u=e[2];const d=u;let a;if(e[3]!==i||e[4]!==t||e[5]!==o){let E;e[7]===Symbol.for("react.memo_cache_sentinel")?(E=(S,O)=>{const T=d[S.id]??Number.MAX_SAFE_INTEGER,P=d[O.id]??Number.MAX_SAFE_INTEGER;return T-P},e[7]=E):E=e[7];const M=t.filter(Ss).sort(E);let I;e[8]!==t?(I=t.find(js),e[8]=t,e[9]=I):I=e[9];const x=I;let k;e[10]===Symbol.for("react.memo_cache_sentinel")?(k=Se("openai"),e[10]=k):k=e[10];const w=k;let _;e[11]!==i?(_=S=>s.jsx(ye,{logo:S.logo,name:S.name,description:S.description,onClick:()=>i({kind:"provider",provider:S})},S.id),e[11]=i,e[12]=_):_=e[12];let v;e[13]!==i||e[14]!==x?(v=x&&w?[s.jsx(ye,{logo:w.logo,name:w.name,description:w.description,onClick:()=>i({kind:"openai-compatible",provider:x,preset:w})},w.id)]:[],e[13]=i,e[14]=x,e[15]=v):v=e[15];let g;e[16]!==i||e[17]!==x||e[18]!==o?(g=x?[...ct.filter(ys).map(S=>s.jsx(ye,{logo:S.logo,name:S.name,description:S.description,onClick:()=>i({kind:"openai-compatible",provider:x,preset:S})},S.id)),s.jsx(ye,{logo:x.logo,name:o("settings.aiProviders.customOpenAiCompatible"),description:o("settings.aiProviders.customOpenAiDescription"),onClick:()=>i({kind:"openai-compatible",provider:x,preset:null})},"custom")]:[],e[16]=i,e[17]=x,e[18]=o,e[19]=g):g=e[19],a=[...M.map(_),...v,...g],e[3]=i,e[4]=t,e[5]=o,e[6]=a}else a=e[6];const h=a,p=h.length-He,m=!!n&&p>0;let f;e[20]!==h||e[21]!==m?(f=m?h.slice(0,He):h,e[20]=h,e[21]=m,e[22]=f):f=e[22];const b=f;let N;e[23]!==c||e[24]!==i||e[25]!==o?(N=c&&s.jsx(ze,{children:s.jsxs("div",{className:"relative rounded-xl border border-violet-400/30 bg-gradient-to-br from-violet-50/50 via-transparent to-lime-50/30 dark:from-violet-950/20 dark:to-lime-950/10 p-1.5",children:[s.jsx("div",{className:"absolute inset-0 rounded-xl bg-gradient-to-br from-violet-400/5 to-lime-400/5 pointer-events-none"}),s.jsx("p",{className:"text-xs font-medium text-violet-700 dark:text-violet-400 mb-1.5 px-2 pt-2 relative",children:o("settings.aiProviders.recommended")}),s.jsx(Re,{className:"relative",children:s.jsx(ye,{logo:c.logo,name:c.name,description:c.description,onClick:()=>i({kind:"provider",provider:c})})})]})}),e[23]=c,e[24]=i,e[25]=o,e[26]=N):N=e[26];let y;e[27]!==p||e[28]!==n||e[29]!==m||e[30]!==o?(y=m&&s.jsx(ot,{onClick:n,title:o(p===1?"settings.aiProviders.moreProvidersSingular":"settings.aiProviders.moreProvidersPlural",{count:p}),action:s.jsx(Qt,{size:16,className:"text-muted-foreground"})}),e[27]=p,e[28]=n,e[29]=m,e[30]=o,e[31]=y):y=e[31];let j;e[32]!==y||e[33]!==b?(j=s.jsx(ze,{children:s.jsxs(Re,{children:[b,y]})}),e[32]=y,e[33]=b,e[34]=j):j=e[34];let C;return e[35]!==N||e[36]!==j?(C=s.jsxs("div",{className:"flex flex-col gap-6",children:[N,j]}),e[35]=N,e[36]=j,e[37]=C):C=e[37],C}function ys(l){return l.id!=="openai"}function js(l){return l.id==="openai-compatible"}function Ss(l){return l.id!=="deco"&&l.id!=="openai-compatible"}function Ns(l){return l.id==="deco"}const ks=Ye({label:je().optional(),apiKey:je().min(1,"API key is required")});function ws(l){const e=V.c(87),{providerId:t,onCancel:i,onSuccess:n}=l,{org:o}=be(),r=Ce(),c=_e(),[u,d]=U.useState(!1),a=ie();let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={resolver:Qe(ks),defaultValues:{label:"",apiKey:""}},e[0]=h):h=e[0];const{register:p,handleSubmit:m,formState:f}=Je(h),{errors:b}=f;let N;e[1]!==t||e[2]!==r||e[3]!==a?(N=async B=>{await r.call("AI_PROVIDER_KEY_CREATE",{providerId:t,label:B.label||a("settings.connectForms.defaultKeyLabel"),apiKey:B.apiKey})},e[1]=t,e[2]=r,e[3]=a,e[4]=N):N=e[4];let y;e[5]!==n||e[6]!==o||e[7]!==c||e[8]!==a?(y=()=>{c.invalidateQueries({queryKey:fe.aiProviderKeys(o.id)}),c.invalidateQueries({queryKey:fe.aiProviders(o.id)}),me.success(a("settings.connectForms.keySavedSuccess")),n()},e[5]=n,e[6]=o,e[7]=c,e[8]=a,e[9]=y):y=e[9];let j;e[10]!==a?(j=B=>{me.error(a("settings.connectForms.failedSaveKey",{error:B.message}))},e[10]=a,e[11]=j):j=e[11];let C;e[12]!==N||e[13]!==y||e[14]!==j?(C={mutationFn:N,onSuccess:y,onError:j},e[12]=N,e[13]=y,e[14]=j,e[15]=C):C=e[15];const{mutate:E,isPending:M,error:I}=ke(C);let x;e[16]!==E?(x=B=>E(B),e[16]=E,e[17]=x):x=e[17];let k;e[18]!==m||e[19]!==x?(k=m(x),e[18]=m,e[19]=x,e[20]=k):k=e[20];let w;e[21]!==a?(w=a("settings.connectForms.labelField"),e[21]=a,e[22]=w):w=e[22];let _;e[23]!==w?(_=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:w}),e[23]=w,e[24]=_):_=e[24];let v;e[25]!==a?(v=a("settings.connectForms.labelPlaceholder"),e[25]=a,e[26]=v):v=e[26];let g;e[27]!==p?(g=p("label"),e[27]=p,e[28]=g):g=e[28];let S;e[29]!==v||e[30]!==g?(S=s.jsx(xe,{placeholder:v,...g,className:"h-8 text-sm"}),e[29]=v,e[30]=g,e[31]=S):S=e[31];let O;e[32]!==_||e[33]!==S?(O=s.jsxs("div",{className:"space-y-1",children:[_,S]}),e[32]=_,e[33]=S,e[34]=O):O=e[34];let T;e[35]!==a?(T=a("settings.connectForms.apiKeyField"),e[35]=a,e[36]=T):T=e[36];let P;e[37]!==T?(P=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:T}),e[37]=T,e[38]=P):P=e[38];const L=u?"text":"password";let D;e[39]!==p?(D=p("apiKey"),e[39]=p,e[40]=D):D=e[40];let z;e[41]!==L||e[42]!==D?(z=s.jsx(xe,{type:L,placeholder:"sk-...",...D,className:"ph-no-capture h-8 text-sm pr-8"}),e[41]=L,e[42]=D,e[43]=z):z=e[43];let R;e[44]!==u?(R=()=>d(!u),e[44]=u,e[45]=R):R=e[45];let K;e[46]!==u||e[47]!==a?(K=a(u?"settings.connectForms.hideApiKey":"settings.connectForms.showApiKey"),e[46]=u,e[47]=a,e[48]=K):K=e[48];let W;e[49]!==u?(W=u?s.jsx(it,{size:14}):s.jsx(rt,{size:14}),e[49]=u,e[50]=W):W=e[50];let H;e[51]!==R||e[52]!==K||e[53]!==W?(H=s.jsx("button",{type:"button",onClick:R,"aria-label":K,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:W}),e[51]=R,e[52]=K,e[53]=W,e[54]=H):H=e[54];let Q;e[55]!==z||e[56]!==H?(Q=s.jsxs("div",{className:"relative",children:[z,H]}),e[55]=z,e[56]=H,e[57]=Q):Q=e[57];let J;e[58]!==b.apiKey?(J=b.apiKey&&s.jsx("p",{className:"text-xs text-destructive",children:b.apiKey.message}),e[58]=b.apiKey,e[59]=J):J=e[59];let X;e[60]!==P||e[61]!==Q||e[62]!==J?(X=s.jsxs("div",{className:"space-y-1",children:[P,Q,J]}),e[60]=P,e[61]=Q,e[62]=J,e[63]=X):X=e[63];let F;e[64]!==I?(F=I&&s.jsx("p",{className:"text-xs text-destructive",children:I.message}),e[64]=I,e[65]=F):F=e[65];let q;e[66]!==a?(q=a("settings.connectForms.cancel"),e[66]=a,e[67]=q):q=e[67];let Y;e[68]!==M||e[69]!==i||e[70]!==q?(Y=s.jsx(de,{type:"button",variant:"ghost",size:"sm",onClick:i,disabled:M,children:q}),e[68]=M,e[69]=i,e[70]=q,e[71]=Y):Y=e[71];let Z;e[72]!==M||e[73]!==a?(Z=a(M?"settings.connectForms.saving":"settings.connectForms.saveKey"),e[72]=M,e[73]=a,e[74]=Z):Z=e[74];let A;e[75]!==M||e[76]!==Z?(A=s.jsx(de,{type:"submit",size:"sm",disabled:M,children:Z}),e[75]=M,e[76]=Z,e[77]=A):A=e[77];let $;e[78]!==Y||e[79]!==A?($=s.jsxs(tt,{children:[Y,A]}),e[78]=Y,e[79]=A,e[80]=$):$=e[80];let G;return e[81]!==O||e[82]!==X||e[83]!==F||e[84]!==$||e[85]!==k?(G=s.jsxs("form",{onSubmit:k,className:"space-y-3",children:[O,X,F,$]}),e[81]=O,e[82]=X,e[83]=F,e[84]=$,e[85]=k,e[86]=G):G=e[86],G}const Cs=Ye({label:je().optional(),baseUrl:je().min(1,"Base URL is required"),apiKey:je().optional()});function Is(l){const e=V.c(105),{preset:t,onCancel:i,onSuccess:n}=l,{org:o}=be(),r=Ce(),c=_e(),[u,d]=U.useState(!1),a=ie();let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=Qe(Cs),e[0]=h):h=e[0];const p=t?.defaultBaseUrl??"";let m;e[1]!==p?(m={resolver:h,defaultValues:{label:"",baseUrl:p,apiKey:""}},e[1]=p,e[2]=m):m=e[2];const{register:f,handleSubmit:b,formState:N}=Je(m),{errors:y}=N;let j;e[3]!==t||e[4]!==r?(j=async he=>{const bt=JSON.stringify({baseUrl:he.baseUrl,apiKey:he.apiKey||""});await r.call("AI_PROVIDER_KEY_CREATE",{providerId:"openai-compatible",label:he.label||t?.name||he.baseUrl,apiKey:bt,...t?{presetId:t.id}:{}})},e[3]=t,e[4]=r,e[5]=j):j=e[5];let C;e[6]!==n||e[7]!==o||e[8]!==c||e[9]!==a?(C=()=>{c.invalidateQueries({queryKey:fe.aiProviderKeys(o.id)}),c.invalidateQueries({queryKey:fe.aiProviders(o.id)}),me.success(a("settings.connectForms.connectionSavedSuccess")),n()},e[6]=n,e[7]=o,e[8]=c,e[9]=a,e[10]=C):C=e[10];let E;e[11]!==a?(E=he=>{me.error(a("settings.connectForms.failedSaveConnection",{error:he.message}))},e[11]=a,e[12]=E):E=e[12];let M;e[13]!==j||e[14]!==C||e[15]!==E?(M={mutationFn:j,onSuccess:C,onError:E},e[13]=j,e[14]=C,e[15]=E,e[16]=M):M=e[16];const{mutate:I,isPending:x,error:k}=ke(M);let w;e[17]!==t||e[18]!==a?(w=t?a("settings.connectForms.labelPlaceholderPreset",{name:t.name}):a("settings.connectForms.labelPlaceholderOpenAiCompatible"),e[17]=t,e[18]=a,e[19]=w):w=e[19];const _=w;let v;e[20]!==t?.baseUrlPlaceholder||e[21]!==a?(v=t?.baseUrlPlaceholder??a("settings.connectForms.baseUrlPlaceholder"),e[20]=t?.baseUrlPlaceholder,e[21]=a,e[22]=v):v=e[22];const g=v;let S;e[23]!==I?(S=he=>I(he),e[23]=I,e[24]=S):S=e[24];let O;e[25]!==b||e[26]!==S?(O=b(S),e[25]=b,e[26]=S,e[27]=O):O=e[27];let T;e[28]!==a?(T=a("settings.connectForms.labelField"),e[28]=a,e[29]=T):T=e[29];let P;e[30]!==T?(P=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:T}),e[30]=T,e[31]=P):P=e[31];let L;e[32]!==f?(L=f("label"),e[32]=f,e[33]=L):L=e[33];let D;e[34]!==_||e[35]!==L?(D=s.jsx(xe,{placeholder:_,...L,className:"h-8 text-sm"}),e[34]=_,e[35]=L,e[36]=D):D=e[36];let z;e[37]!==P||e[38]!==D?(z=s.jsxs("div",{className:"space-y-1",children:[P,D]}),e[37]=P,e[38]=D,e[39]=z):z=e[39];let R;e[40]!==g||e[41]!==y||e[42]!==t?.defaultBaseUrl||e[43]!==f||e[44]!==a?(R=t?.defaultBaseUrl?s.jsx("input",{type:"hidden",...f("baseUrl")}):s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:a("settings.connectForms.baseUrlField")}),s.jsx(xe,{type:"url",placeholder:g,...f("baseUrl"),className:"h-8 text-sm"}),y.baseUrl&&s.jsx("p",{className:"text-xs text-destructive",children:y.baseUrl.message})]}),e[40]=g,e[41]=y,e[42]=t?.defaultBaseUrl,e[43]=f,e[44]=a,e[45]=R):R=e[45];let K;e[46]!==a?(K=a("settings.connectForms.apiKeyField"),e[46]=a,e[47]=K):K=e[47];let W;e[48]!==t?.apiKeyRecommended||e[49]!==a?(W=t?.apiKeyRecommended?a("settings.connectForms.recommended"):a("settings.connectForms.optional"),e[48]=t?.apiKeyRecommended,e[49]=a,e[50]=W):W=e[50];let H;e[51]!==W?(H=s.jsxs("span",{className:"text-muted-foreground/60",children:["(",W,")"]}),e[51]=W,e[52]=H):H=e[52];let Q;e[53]!==K||e[54]!==H?(Q=s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:[K," ",H]}),e[53]=K,e[54]=H,e[55]=Q):Q=e[55];const J=u?"text":"password";let X;e[56]!==f?(X=f("apiKey"),e[56]=f,e[57]=X):X=e[57];let F;e[58]!==J||e[59]!==X?(F=s.jsx(xe,{type:J,placeholder:"sk-...",...X,className:"ph-no-capture h-8 text-sm pr-8"}),e[58]=J,e[59]=X,e[60]=F):F=e[60];let q;e[61]!==u?(q=()=>d(!u),e[61]=u,e[62]=q):q=e[62];let Y;e[63]!==u||e[64]!==a?(Y=a(u?"settings.connectForms.hideApiKey":"settings.connectForms.showApiKey"),e[63]=u,e[64]=a,e[65]=Y):Y=e[65];let Z;e[66]!==u?(Z=u?s.jsx(it,{size:14}):s.jsx(rt,{size:14}),e[66]=u,e[67]=Z):Z=e[67];let A;e[68]!==q||e[69]!==Y||e[70]!==Z?(A=s.jsx("button",{type:"button",onClick:q,"aria-label":Y,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:Z}),e[68]=q,e[69]=Y,e[70]=Z,e[71]=A):A=e[71];let $;e[72]!==F||e[73]!==A?($=s.jsxs("div",{className:"relative",children:[F,A]}),e[72]=F,e[73]=A,e[74]=$):$=e[74];let G;e[75]!==Q||e[76]!==$?(G=s.jsxs("div",{className:"space-y-1",children:[Q,$]}),e[75]=Q,e[76]=$,e[77]=G):G=e[77];let B;e[78]!==t?(B=t?.helpText&&s.jsx("p",{className:"text-xs text-muted-foreground",children:t.helpText}),e[78]=t,e[79]=B):B=e[79];let te;e[80]!==k?(te=k&&s.jsx("p",{className:"text-xs text-destructive",children:k.message}),e[80]=k,e[81]=te):te=e[81];let le;e[82]!==a?(le=a("settings.connectForms.cancel"),e[82]=a,e[83]=le):le=e[83];let ne;e[84]!==x||e[85]!==i||e[86]!==le?(ne=s.jsx(de,{type:"button",variant:"ghost",size:"sm",onClick:i,disabled:x,children:le}),e[84]=x,e[85]=i,e[86]=le,e[87]=ne):ne=e[87];let oe;e[88]!==x||e[89]!==a?(oe=a(x?"settings.connectForms.saving":"settings.connectForms.saveConnection"),e[88]=x,e[89]=a,e[90]=oe):oe=e[90];let re;e[91]!==x||e[92]!==oe?(re=s.jsx(de,{type:"submit",size:"sm",disabled:x,children:oe}),e[91]=x,e[92]=oe,e[93]=re):re=e[93];let ae;e[94]!==ne||e[95]!==re?(ae=s.jsxs(tt,{children:[ne,re]}),e[94]=ne,e[95]=re,e[96]=ae):ae=e[96];let ee;return e[97]!==O||e[98]!==z||e[99]!==R||e[100]!==G||e[101]!==B||e[102]!==te||e[103]!==ae?(ee=s.jsxs("form",{onSubmit:O,className:"space-y-3",children:[z,R,G,B,te,ae]}),e[97]=O,e[98]=z,e[99]=R,e[100]=G,e[101]=B,e[102]=te,e[103]=ae,e[104]=ee):ee=e[104],ee}const _s={kind:"closed"};function Ms(l,e){switch(e.type){case"open":return l.kind==="closed"?{kind:"grid"}:l;case"close":return{kind:"closed"};case"back":switch(l.kind){case"form":case"oauth-pending":case"provision-pending":case"provision-error":return{kind:"grid"};default:return l}case"select-form":return l.kind!=="grid"?l:{kind:"form",providerId:e.providerId,presetId:e.presetId};case"select-oauth":return l.kind!=="grid"?l:{kind:"oauth-pending",providerId:e.providerId,stateToken:e.stateToken};case"oauth-failed":return l.kind==="oauth-pending"?{kind:"grid"}:l;case"select-provision":return l.kind!=="grid"?l:{kind:"provision-pending",providerId:e.providerId};case"provision-error":return l.kind!=="provision-pending"?l:{kind:"provision-error",providerId:l.providerId,error:e.error};case"retry-provision":return l.kind!=="provision-error"?l:{kind:"provision-pending",providerId:l.providerId}}}function Es(l){switch(l.kind){case"form":case"oauth-pending":case"provision-pending":case"provision-error":return l.providerId;default:return null}}function Os({open:l,onOpenChange:e,initialProvider:t}){const i=ie(),o=Ae()?.providers??[],{org:r}=be(),c=Ce(),u=_e(),[d,a]=U.useReducer(Ms,_s),h=U.useRef(!1);U.useEffect(()=>{l&&d.kind==="closed"?a({type:"open"}):!l&&d.kind!=="closed"&&a({type:"close"})},[l,d.kind]);const p=()=>{h.current=!1,a({type:"close"}),e(!1)},m=()=>{u.invalidateQueries({queryKey:fe.aiProviderKeys(r.id)}),u.invalidateQueries({queryKey:fe.aiProviders(r.id)})},{mutate:f}=ke({mutationFn:async({providerId:v,code:g,stateToken:S,label:O})=>(await c.call("AI_PROVIDER_OAUTH_EXCHANGE",{providerId:v,code:g,stateToken:S,label:O}),v),onSuccess:v=>{ue("ai_provider_oauth_succeeded",{provider_id:v}),m();const g=o.find(S=>S.id===v);me.success(i("settings.connectProviderDialog.oauthSuccessMessage",{provider:g?.name??i("settings.connectProviderDialog.defaultProviderName")})),p()},onError:(v,g)=>{ue("ai_provider_oauth_failed",{provider_id:g.providerId,error:v.message}),me.error(i("settings.connectProviderDialog.oauthFailedMessage",{error:v.message})),a({type:"oauth-failed"})}}),{mutate:b}=ke({mutationFn:async v=>(await c.call("AI_PROVIDER_PROVISION_KEY",{providerId:v}),v),onSuccess:v=>{ue("ai_provider_provision_succeeded",{provider_id:v}),m();const g=o.find(S=>S.id===v);me.success(i("settings.connectProviderDialog.provisionSuccessMessage",{provider:g?.name??i("settings.connectProviderDialog.defaultProviderName")})),p()},onError:(v,g)=>{ue("ai_provider_provision_failed",{provider_id:g,error:v.message}),a({type:"provision-error",error:v.message})}}),N=async v=>{const{provider:g}=v,S=v.kind==="openai-compatible"?v.preset?.id??null:null,O=g.supportedMethods.includes("oauth-pkce"),T=g.supportedMethods.includes("api-key");if(g.supportsProvision===!0){ue("ai_provider_connect_clicked",{provider_id:g.id,method:"provision"}),a({type:"select-provision",providerId:g.id}),b(g.id);return}if(O){ue("ai_provider_connect_clicked",{provider_id:g.id,method:"oauth-pkce"});try{const L=await c.call("AI_PROVIDER_OAUTH_URL",{providerId:g.id,callbackUrl:`${window.location.origin}/oauth/callback/ai-provider`});if(!L?.url)throw new Error("Invalid response from AI_PROVIDER_OAUTH_URL");a({type:"select-oauth",providerId:g.id,stateToken:L.stateToken}),window.open(L.url,"AiProviderOAuth","width=600,height=700")}catch(L){me.error(i("settings.connectProviderDialog.startOAuthFailedMessage",{error:L instanceof Error?L.message:String(L)}))}return}T&&(ue("ai_provider_connect_clicked",{provider_id:g.id,...S!==null?{preset_id:S}:{},method:"api-key"}),a({type:"select-form",providerId:g.id,presetId:S}))},y=U.useRef(N);y.current=N;const j=U.useRef(t);j.current=t,U.useEffect(()=>{!j.current||d.kind!=="grid"||h.current||(h.current=!0,y.current(j.current))},[d.kind]);const C=d.kind==="oauth-pending"?d.stateToken:null,E=d.kind==="oauth-pending"?d.providerId:null;U.useEffect(()=>{if(d.kind!=="oauth-pending")return;let v=!1;const g=d.stateToken,S=d.providerId,O=P=>{if(P.origin!==window.location.origin||P.data?.type!=="AI_PROVIDER_OAUTH_CALLBACK")return;const{code:L,stateToken:D}=P.data;if(D!==g){me.error(i("settings.connectProviderDialog.securityCheckFailedMessage")),a({type:"oauth-failed"});return}v=!0;const z=o.find(R=>R.id===S);f({providerId:S,code:L,stateToken:g,label:z?.name??S})};window.addEventListener("message",O);const T=setTimeout(()=>{v||(ue("ai_provider_oauth_timeout",{provider_id:S}),a({type:"oauth-failed"}),me.error(i("settings.connectProviderDialog.connectionTimedOutMessage")))},12e4);return()=>{window.removeEventListener("message",O),clearTimeout(T)}},[d.kind,C,E,f]);const M=Es(d),I=M?o.find(v=>v.id===M):null,k=(d.kind==="form"&&d.presetId?Se(d.presetId):null)?.name??I?.name??i("settings.connectProviderDialog.defaultTitle"),w=d.kind!=="grid"&&d.kind!=="closed",_=()=>{t?p():a({type:"back"})};return s.jsx(Me,{open:d.kind!=="closed",onOpenChange:v=>!v&&p(),children:s.jsxs(Ee,{className:"sm:max-w-md max-h-[90vh] overflow-y-auto",children:[s.jsxs(Ze,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[w&&s.jsx(de,{variant:"ghost",size:"icon","aria-label":i("settings.connectProviderDialog.backButtonLabel"),className:"h-7 w-7",onClick:_,children:s.jsx(lt,{size:16})}),s.jsx(Oe,{children:k})]}),d.kind==="grid"&&!t&&s.jsx(et,{children:i("settings.connectProviderDialog.gridDescription")})]}),d.kind==="grid"&&!t&&s.jsx(dt,{providers:o,onSelect:N}),d.kind==="form"&&(d.providerId==="openai-compatible"?s.jsx(Is,{preset:d.presetId?Se(d.presetId):void 0,onCancel:()=>a({type:"back"}),onSuccess:()=>{m(),p()}}):s.jsx(ws,{providerId:d.providerId,onCancel:()=>a({type:"back"}),onSuccess:()=>{m(),p()}})),d.kind==="oauth-pending"&&s.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[s.jsx(Ie,{size:"lg"}),s.jsx("p",{className:"text-sm text-muted-foreground text-center",children:i("settings.connectProviderDialog.oauthPendingMessage")})]}),d.kind==="provision-pending"&&s.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[s.jsx(Ie,{size:"lg"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:i("settings.connectProviderDialog.provisionPendingMessage")})]}),d.kind==="provision-error"&&s.jsxs("div",{className:"flex flex-col items-center gap-4 py-6",children:[s.jsx(Yt,{size:28,className:"text-destructive"}),s.jsx("p",{className:"text-sm text-foreground text-center",children:d.error}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(de,{variant:"outline",size:"sm",onClick:()=>a({type:"back"}),children:i("settings.connectProviderDialog.backButton")}),s.jsx(de,{size:"sm",onClick:()=>{a({type:"retry-provision"}),b(d.providerId)},children:i("settings.connectProviderDialog.retryButton")})]})]})]})})}function Ls(){const l=V.c(7),{org:e}=be(),t=Ce();let i;l[0]!==e.id?(i=fe.defaultBrand(e.id),l[0]=e.id,l[1]=i):i=l[1];let n;l[2]!==t?(n=async()=>{const{items:c}=await t.call("BRAND_CONTEXT_LIST",{});return(Array.isArray(c)?c:[]).find(As)??null},l[2]=t,l[3]=n):n=l[3];let o;l[4]!==i||l[5]!==n?(o={queryKey:i,queryFn:n},l[4]=i,l[5]=n,l[6]=o):o=l[6];const{data:r}=St(o);return r??null}function As(l){return l.isDefault&&!l.archivedAt}function Ps(l){const e=l.colors;if(!e)return null;if(Array.isArray(e)){const t=e.find(n=>typeof n=="object"&&n!==null&&"label"in n&&/primary|brand|main/i.test(n.label)),i=t?t.value:e[0]?.value;return typeof i=="string"?i:null}if(typeof e=="object"){const t=e;return t.primary??Object.values(t)[0]??null}return null}function Ts(l){const e=V.c(74);let t;e[0]!==l?(t=l===void 0?{}:l,e[0]=l,e[1]=t):t=e[1];const{title:i,description:n,onLocalRuntimePicked:o}=t,r=ie(),{org:c}=be(),{localMode:u}=jt(),d=Ls(),a=st(),h=Lt(),[p,m]=U.useState(null),[f,b]=U.useState(!1),[N,y]=U.useState(!1),[j,C]=U.useState(!1),E=ts();let M;e[2]!==E||e[3]!==a.online?(M=Zt()&&!E&&!a.online,e[2]=E,e[3]=a.online,e[4]=M):M=e[4];const I=M,x=Ae();let k;e[5]!==x?.providers?(k=x?.providers??[],e[5]=x?.providers,e[6]=k):k=e[6];const w=k;let _,v,g;if(e[7]!==d||e[8]!==h||e[9]!==n||e[10]!==a.capabilities||e[11]!==a.online||e[12]!==u||e[13]!==I||e[14]!==o||e[15]!==c.name||e[16]!==r||e[17]!==i){const H=[];if(a.online){if(a.capabilities.includes("claude-code")){let ee;e[21]===Symbol.for("react.memo_cache_sentinel")?(ee=s.jsx(ge,{size:16}),e[21]=ee):ee=e[21],H.push({option:"claude-code-desktop",label:"Claude Code",icon:ee})}if(a.capabilities.includes("codex")){let ee;e[22]===Symbol.for("react.memo_cache_sentinel")?(ee=s.jsx(ve,{size:16}),e[22]=ee):ee=e[22],H.push({option:"codex-desktop",label:"Codex",icon:ee})}}const Q=H.length>0&&h!==null,J=c.name;let X;e[23]!==d?(X=d?Ps(d):null,e[23]=d,e[24]=X):X=e[24];const F=X,q=d?.favicon??d?.logo??null;let Y;e[25]!==J||e[26]!==r||e[27]!==i?(Y=i??(J?r("chat.noAiProviderEmptyState.headingWithOrg",{org:J}):r("chat.noAiProviderEmptyState.headingDefault")),e[25]=J,e[26]=r,e[27]=i,e[28]=Y):Y=e[28];const Z=Y;let A;e[29]!==n||e[30]!==Q||e[31]!==u||e[32]!==r?(A=n??r(Q?"chat.noAiProviderEmptyState.subtitleWithDesktop":u?"chat.noAiProviderEmptyState.subtitleLocalMode":"chat.noAiProviderEmptyState.subtitleDefault"),e[29]=n,e[30]=Q,e[31]=u,e[32]=r,e[33]=A):A=e[33];const $=A,G=!!(q||F);let B;e[34]!==F?(B=F?{backgroundColor:`${F}18`,borderColor:`${F}30`}:void 0,e[34]=F,e[35]=B):B=e[35];const te=B,le=G?"flex items-center justify-center size-14 rounded-2xl border":"flex items-center justify-center size-14 rounded-2xl bg-muted border border-border";_="flex flex-col items-center gap-8 w-full max-w-3xl px-4";let ne;e[36]!==le||e[37]!==te||e[38]!==q||e[39]!==a.online||e[40]!==I||e[41]!==F||e[42]!==r?(ne=q?s.jsx("div",{className:le,style:te,children:s.jsx("img",{src:q,alt:"",className:"size-7 rounded object-contain"})}):s.jsx("button",{type:"button",onClick:()=>I?C(!0):y(!0),"aria-label":I?r("downloadApp.openLabel"):a.online?r("chat.noAiProviderEmptyState.desktopLinkedLabel"):r("chat.noAiProviderEmptyState.connectDesktopLabel"),className:ce(le,"cursor-pointer transition-colors hover:bg-accent"),style:te,children:s.jsxs("span",{className:"relative inline-flex items-center justify-center",children:[s.jsx(Xt,{size:24,style:F?{color:F}:void 0,className:ce(!F&&"text-muted-foreground")}),a.online&&s.jsx("span",{className:"absolute -top-0.5 -right-0.5 size-2.5 rounded-full bg-success ring-2 ring-background animate-pulse"})]})}),e[36]=le,e[37]=te,e[38]=q,e[39]=a.online,e[40]=I,e[41]=F,e[42]=r,e[43]=ne):ne=e[43];let oe;e[44]!==Z?(oe=s.jsx("p",{className:"text-xl font-semibold text-foreground tracking-tight",children:Z}),e[44]=Z,e[45]=oe):oe=e[45];let re;e[46]!==$?(re=s.jsx("p",{className:"text-sm text-muted-foreground max-w-md",children:$}),e[46]=$,e[47]=re):re=e[47];let ae;e[48]!==oe||e[49]!==re?(ae=s.jsxs("div",{className:"space-y-2",children:[oe,re]}),e[48]=oe,e[49]=re,e[50]=ae):ae=e[50],e[51]!==ne||e[52]!==ae?(v=s.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[ne,ae]}),e[51]=ne,e[52]=ae,e[53]=v):v=e[53],g=Q&&s.jsxs("div",{className:"flex flex-col items-center gap-3 w-full",children:[s.jsx("div",{className:"flex flex-wrap items-center justify-center gap-2",children:H.map(ee=>s.jsxs(de,{variant:"default",className:"gap-2",onClick:()=>{h?.setPendingAgentOption(ee.option),o?.(ee.option)},children:[ee.icon,r("chat.noAiProviderEmptyState.useLabel",{label:ee.label})]},ee.option))}),s.jsxs("div",{className:"flex items-center gap-3 w-full max-w-xs text-xs text-muted-foreground",children:[s.jsx("span",{className:"h-px flex-1 bg-border"}),r("chat.noAiProviderEmptyState.orConnectProvider"),s.jsx("span",{className:"h-px flex-1 bg-border"})]})]}),e[7]=d,e[8]=h,e[9]=n,e[10]=a.capabilities,e[11]=a.online,e[12]=u,e[13]=I,e[14]=o,e[15]=c.name,e[16]=r,e[17]=i,e[18]=_,e[19]=v,e[20]=g}else _=e[18],v=e[19],g=e[20];let S,O;e[54]===Symbol.for("react.memo_cache_sentinel")?(S=H=>m(H),O=()=>b(!0),e[54]=S,e[55]=O):(S=e[54],O=e[55]);let T;e[56]!==w?(T=s.jsx("div",{className:"w-full",children:s.jsx(dt,{providers:w,onSelect:S,onShowAll:O})}),e[56]=w,e[57]=T):T=e[57];const P=p!==null||f;let L;e[58]===Symbol.for("react.memo_cache_sentinel")?(L=H=>{H||(m(null),b(!1))},e[58]=L):L=e[58];const D=p??void 0;let z;e[59]!==P||e[60]!==D?(z=s.jsx(Os,{open:P,onOpenChange:L,initialProvider:D}),e[59]=P,e[60]=D,e[61]=z):z=e[61];let R;e[62]!==N?(R=s.jsx(rs,{open:N,onOpenChange:y}),e[62]=N,e[63]=R):R=e[63];let K;e[64]!==j?(K=s.jsx(es,{open:j,onOpenChange:C}),e[64]=j,e[65]=K):K=e[65];let W;return e[66]!==z||e[67]!==R||e[68]!==K||e[69]!==_||e[70]!==v||e[71]!==g||e[72]!==T?(W=s.jsxs("div",{className:_,children:[v,g,T,z,R,K]}),e[66]=z,e[67]=R,e[68]=K,e[69]=_,e[70]=v,e[71]=g,e[72]=T,e[73]=W):W=e[73],W}function Te(l){const e=l.title.includes(": ");return{provider:e?l.title.split(": ")[0]??"":l.modelId.split("/")[0]??"",displayName:e?l.title.split(": ").slice(1).join(": "):l.title}}function Ds(l){return l<32e3?{level:1,labelKey:"chat.shared.contextLevelSmall",descriptionKey:"chat.shared.contextLevelSmallDesc"}:l<2e5?{level:2,labelKey:"chat.shared.contextLevelMedium",descriptionKey:"chat.shared.contextLevelMediumDesc"}:l<5e5?{level:3,labelKey:"chat.shared.contextLevelLarge",descriptionKey:"chat.shared.contextLevelLargeDesc"}:{level:4,labelKey:"chat.shared.contextLevelVeryLarge",descriptionKey:"chat.shared.contextLevelVeryLargeDesc"}}const zs=["bg-destructive","bg-warning","bg-success","bg-success"],Rs=["text-success","text-warning","text-warning","text-destructive"];function Ks(l,e){const t=Math.round(l*.75/1e3),i=t>=1?`${t}K`:`${Math.round(l*.75)}`;return e("chat.shared.approxWords",{wordCount:i})}function Fs(l){return l<1?{level:1,labelKey:"chat.shared.costLevelCheap"}:l<5?{level:2,labelKey:"chat.shared.costLevelModerate"}:l<15?{level:3,labelKey:"chat.shared.costLevelHigh"}:{level:4,labelKey:"chat.shared.costLevelExpensive"}}const $s={text:{icon:s.jsx(Wt,{className:"size-3.5"}),labelKey:"chat.shared.capabilityText"},vision:{icon:s.jsx(Bt,{className:"size-3.5"}),labelKey:"chat.shared.capabilityVision"},image:{icon:s.jsx(Kt,{className:"size-3.5"}),labelKey:"chat.shared.capabilityImage"},tools:{icon:s.jsx(Ut,{className:"size-3.5"}),labelKey:"chat.shared.capabilityTools"},reasoning:{icon:s.jsx(ls,{className:"size-3.5"}),labelKey:"chat.shared.capabilityReasoning"},"web-search":{icon:s.jsx(nt,{className:"size-3.5"}),labelKey:"chat.shared.capabilityWebSearch"}};function Us(l){const e=V.c(10),{capability:t}=l,i=ie(),n=$s[t];if(n){const u=n.icon;let d;e[0]!==n.labelKey||e[1]!==i?(d=i(n.labelKey),e[0]=n.labelKey,e[1]=i,e[2]=d):d=e[2];let a;return e[3]!==n.icon||e[4]!==d?(a=s.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground border border-border rounded px-2 py-0.5",children:[u,d]}),e[3]=n.icon,e[4]=d,e[5]=a):a=e[5],a}let o;e[6]!==t?(o=t.charAt(0).toUpperCase(),e[6]=t,e[7]=o):o=e[7];const r=o+t.slice(1);let c;return e[8]!==r?(c=s.jsx("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground border border-border rounded px-2 py-0.5",children:r}),e[8]=r,e[9]=c):c=e[9],c}function Bs(l){const e=V.c(59),{model:t,compact:i}=l,n=i===void 0?!1:i,o=ie();if(!t){let x;e[0]!==o?(x=o("chat.shared.hoverToPreview"),e[0]=o,e[1]=x):x=e[1];let k;return e[2]!==x?(k=s.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:x}),e[2]=x,e[3]=k):k=e[3],k}const r=t.costs?.input!=null?t.costs.input*1e6:null,c=t.costs?.output!=null?t.costs.output*1e6:null;let u;e[4]!==t?(u=Te(t),e[4]=t,e[5]=u):u=e[5];const{provider:d,displayName:a}=u;if(n){let x;e[6]!==t.limits||e[7]!==o?(x=t.limits?.contextWindow&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:o("chat.shared.context")}),s.jsxs("span",{className:"text-foreground font-medium",children:[t.limits.contextWindow.toLocaleString()," ",o("chat.shared.tokens")]})]}),e[6]=t.limits,e[7]=o,e[8]=x):x=e[8];let k;e[9]!==r||e[10]!==o?(k=r!=null&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:o("chat.shared.input")}),s.jsxs("span",{className:"text-foreground font-medium",children:["$",r.toFixed(2)," / 1M"]})]}),e[9]=r,e[10]=o,e[11]=k):k=e[11];let w;e[12]!==c||e[13]!==o?(w=c!=null&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:o("chat.shared.output")}),s.jsxs("span",{className:"text-foreground font-medium",children:["$",c.toFixed(2)," / 1M"]})]}),e[12]=c,e[13]=o,e[14]=w):w=e[14];let _;e[15]!==t.limits||e[16]!==o?(_=t.limits?.maxOutputTokens&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:o("chat.shared.outputLimit")}),s.jsxs("span",{className:"text-foreground font-medium",children:[t.limits.maxOutputTokens.toLocaleString()," ",o("chat.shared.tokens")]})]}),e[15]=t.limits,e[16]=o,e[17]=_):_=e[17];let v;return e[18]!==x||e[19]!==k||e[20]!==w||e[21]!==_?(v=s.jsxs("div",{className:"flex flex-col gap-2 pt-3 pb-3 px-3 text-xs",children:[x,k,w,_]}),e[18]=x,e[19]=k,e[20]=w,e[21]=_,e[22]=v):v=e[22],v}let h;e[23]!==d?(h=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:d}),e[23]=d,e[24]=h):h=e[24];let p;e[25]!==t.logo||e[26]!==t.title?(p=t.logo&&s.jsx("img",{src:t.logo,className:"size-6 shrink-0 rounded-md dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[25]=t.logo,e[26]=t.title,e[27]=p):p=e[27];let m;e[28]!==a?(m=s.jsx("p",{className:"text-lg font-semibold leading-snug tracking-tight",children:a}),e[28]=a,e[29]=m):m=e[29];let f;e[30]!==p||e[31]!==m?(f=s.jsxs("div",{className:"flex items-center gap-2.5",children:[p,m]}),e[30]=p,e[31]=m,e[32]=f):f=e[32];let b;e[33]!==t.modelId?(b=s.jsx("p",{className:"text-xs text-muted-foreground/50 font-mono",children:t.modelId}),e[33]=t.modelId,e[34]=b):b=e[34];let N;e[35]!==h||e[36]!==f||e[37]!==b?(N=s.jsxs("div",{className:"flex flex-col gap-1 pt-1 pr-6",children:[h,f,b]}),e[35]=h,e[36]=f,e[37]=b,e[38]=N):N=e[38];let y;e[39]!==t.capabilities?(y=t.capabilities&&t.capabilities.length>0&&s.jsx("div",{className:"flex flex-wrap items-center gap-1.5 pb-4 border-b border-border",children:[...new Set(t.capabilities)].map(Ws)}),e[39]=t.capabilities,e[40]=y):y=e[40];let j;e[41]!==t.limits||e[42]!==o?(j=t.limits?.contextWindow&&(()=>{const{level:x,labelKey:k,descriptionKey:w}=Ds(t.limits.contextWindow);return s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:o("chat.shared.contextWindow")}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex items-center gap-0.5",children:[1,2,3,4].map(_=>s.jsx("div",{className:ce("w-2 h-2 rounded-full",_<=x?zs[x-1]:"bg-muted")},_))}),s.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:o(k)}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:["— ",o(w)]})]}),s.jsxs("span",{className:"text-sm text-muted-foreground",children:[t.limits.contextWindow.toLocaleString()," ",o("chat.shared.tokens")]})]})})(),e[41]=t.limits,e[42]=o,e[43]=j):j=e[43];let C;e[44]!==t.limits||e[45]!==o?(C=t.limits?.maxOutputTokens&&s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:o("chat.shared.outputLimit")}),s.jsxs("div",{className:"flex items-baseline gap-2",children:[s.jsxs("span",{className:"text-sm text-foreground",children:[t.limits.maxOutputTokens.toLocaleString()," ",o("chat.shared.tokens")]}),s.jsx("span",{className:"text-sm text-muted-foreground",children:Ks(t.limits.maxOutputTokens,o)})]})]}),e[44]=t.limits,e[45]=o,e[46]=C):C=e[46];let E;e[47]!==r||e[48]!==c||e[49]!==o?(E=(r!=null||c!=null)&&(()=>{const{level:x,labelKey:k}=r!=null?Fs(r):{level:0,labelKey:null};return s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:o("chat.shared.pricing")}),r!=null&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex items-center",children:[1,2,3,4].map(w=>s.jsx("span",{className:ce("text-sm font-bold leading-none",w<=x?Rs[x-1]:"text-muted-foreground/20"),children:"$"},w))}),s.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:k?o(k):""})]}),s.jsxs("div",{className:"flex flex-col gap-1",children:[r!=null&&s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:o("chat.shared.input")}),s.jsxs("span",{className:"text-xs text-foreground",children:["$",r.toFixed(2)," / 1M"," ",o("chat.shared.tokens")]})]}),c!=null&&s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:o("chat.shared.output")}),s.jsxs("span",{className:"text-xs text-foreground",children:["$",c.toFixed(2)," / 1M"," ",o("chat.shared.tokens")]})]})]})]})})(),e[47]=r,e[48]=c,e[49]=o,e[50]=E):E=e[50];let M;e[51]!==j||e[52]!==C||e[53]!==E?(M=s.jsxs("div",{className:"flex flex-col gap-6",children:[j,C,E]}),e[51]=j,e[52]=C,e[53]=E,e[54]=M):M=e[54];let I;return e[55]!==M||e[56]!==N||e[57]!==y?(I=s.jsxs("div",{className:"flex flex-col gap-5 py-1 px-1.5",children:[N,y,M]}),e[55]=M,e[56]=N,e[57]=y,e[58]=I):I=e[58],I}function Ws(l){return s.jsx(Us,{capability:l},l)}function ut(l){const e=V.c(22),{model:t,placeholder:i,isLoading:n}=l,o=n===void 0?!1:n,r=ie();let c;e[0]!==i||e[1]!==r?(c=i??r("chat.shared.selectModel"),e[0]=i,e[1]=r,e[2]=c):c=e[2];const u=c;if(o){let y;return e[3]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(se,{className:"w-5 h-5 rounded-sm shrink-0"}),s.jsx(se,{className:"w-16 h-3 hidden md:block"})]}),e[3]=y):y=e[3],y}if(!t){let y;e[4]!==u?(y=s.jsx("span",{className:"text-sm text-muted-foreground",children:u}),e[4]=u,e[5]=y):y=e[5];let j;e[6]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Ke,{size:14,className:"text-muted-foreground opacity-50 shrink-0"}),e[6]=j):j=e[6];let C;return e[7]!==y?(C=s.jsxs("div",{className:"flex items-center gap-1.5",children:[y,j]}),e[7]=y,e[8]=C):C=e[8],C}let d;e[9]!==t?(d=Te(t),e[9]=t,e[10]=d):d=e[10];const{displayName:a}=d;let h;e[11]!==t?(h=Pe(t),e[11]=t,e[12]=h):h=e[12];const p=h;let m;e[13]!==t.title||e[14]!==p?(m=s.jsx("img",{src:p,className:"w-3.5 h-3.5 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[13]=t.title,e[14]=p,e[15]=m):m=e[15];let f;e[16]!==a?(f=s.jsx("span",{className:"text-sm truncate whitespace-nowrap text-muted-foreground max-w-[100px] sm:max-w-none",children:a}),e[16]=a,e[17]=f):f=e[17];let b;e[18]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(Ke,{size:14,className:"text-muted-foreground opacity-50 shrink-0"}),e[18]=b):b=e[18];let N;return e[19]!==m||e[20]!==f?(N=s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0 overflow-hidden",children:[m,f,b]}),e[19]=m,e[20]=f,e[21]=N):N=e[21],N}const Vs=["vision","image","file","audio","video"],mt=["image/png","image/jpeg","image/gif","image/webp"],ht=["application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"];function De(l){const e=l?.capabilities;return e?Vs.some(t=>e.includes(t)):!1}function ol(l,e){if(!l)return!1;if(l.startsWith("text/"))return!0;const t=e?.capabilities??[],i=t.includes("vision")||t.includes("image"),n=t.includes("file"),o=t.includes("audio"),r=t.includes("video");return!!(i&&mt.includes(l)||n&&l==="application/pdf"||o&&l.startsWith("audio/")||r&&l.startsWith("video/")||De(e)&&ht.includes(l))}function rl(l){const e=l?.capabilities??[],t=["text/*"];return(e.includes("vision")||e.includes("image"))&&t.push(...mt),e.includes("file")&&t.push("application/pdf"),e.includes("audio")&&t.push("audio/*"),e.includes("video")&&t.push("video/*"),De(l)&&t.push(...ht),t.join(",")}function al(l){const e=l?.capabilities??[],t=[];return(e.includes("vision")||e.includes("image"))&&t.push("chat.shared.fileTypeImages"),e.includes("file")&&t.push("chat.shared.fileTypePdfs"),e.includes("audio")&&t.push("chat.shared.fileTypeAudio"),e.includes("video")&&t.push("chat.shared.fileTypeVideo"),De(l)&&t.push("chat.shared.fileTypeOffice"),{parts:t,count:t.length}}const ft=["smarter","faster","cheaper"],Hs={smarter:"chat.decopilot.tierSmarter",faster:"chat.decopilot.tierFaster",cheaper:"chat.decopilot.tierCheaper"},qs=[{tier:"smarter",prefixes:["anthropic/claude-opus-4.8","anthropic/claude-sonnet-4.6","anthropic/claude-4.6-sonnet","openai/gpt-5.3-codex","google/gemini-3-pro","google/gemini-2.5-pro","cohere/command-r-plus","cohere/command-a"]},{tier:"faster",prefixes:["anthropic/claude-haiku-4.5","anthropic/claude-4.5-haiku","google/gemini-3-flash","openai/gpt-5.1-codex-mini","x-ai/grok-code-fast","x-ai/grok-3","mistralai/mistral-large","mistralai/codestral","mistralai/mistral-medium","minimax/minimax-m1"]},{tier:"cheaper",prefixes:["google/gemini-2.5-flash-lite","google/gemini-2.5-flash","google/gemini-2.0-flash","deepseek/deepseek-v3","openai/gpt-oss-120b","mistralai/mistral-small","mistralai/pixtral","cohere/command-r"]}],Gs=qs.flatMap(({tier:l,prefixes:e})=>e.map(t=>({tier:l,prefix:t}))).sort((l,e)=>e.prefix.length-l.prefix.length),Xs="google/gemini-2.5-pro",qe=new Map;function Ys(l){const e=qe.get(l);if(e!==void 0)return e;let t=null;if(l.endsWith(":free"))t="cheaper";else for(const{tier:i,prefix:n}of Gs)if(l.startsWith(n)){if(n===Xs&&l.length>n.length&&l[n.length]==="-"){const r=l[n.length+1];if(!r||!/\d/.test(r))continue}t=i;break}return qe.set(l,t),t}function Ge(l){const e={smarter:[],faster:[],cheaper:[],other:[]};for(const t of l){const i=Ys(t.modelId);e[i??"other"].push(t)}for(const t of Object.keys(e))e[t].sort((i,n)=>i.title.localeCompare(n.title));return e}const pt="studio:model-shortlist:",Qs=new Set(["anthropic/claude-opus-4.8","anthropic/claude-sonnet-4.6","anthropic/claude-4.6-sonnet","anthropic/claude-sonnet-4.6:extended","openai/gpt-5.3-codex","google/gemini-3-pro-preview","google/gemini-2.5-pro","anthropic/claude-haiku-4.5","anthropic/claude-haiku-4.5-20251001","anthropic/claude-4.5-haiku","google/gemini-3-flash-preview","openai/gpt-5.1-codex-mini","x-ai/grok-code-fast-1","google/gemini-2.5-flash","deepseek/deepseek-v3.2","google/gemini-2.5-flash-lite","openai/gpt-oss-120b:free"]);function Js(l){try{const e=localStorage.getItem(pt+l);return e?new Set(JSON.parse(e)):null}catch{return null}}function Zs(l,e){localStorage.setItem(pt+l,JSON.stringify([...e]))}function ei(l){const e=V.c(21),{model:t,onHover:i}=l;let n;e[0]!==t?(n=Te(t),e[0]=t,e[1]=n):n=e[1];const{displayName:o,provider:r}=n;let c;e[2]!==t?(c=Pe(t),e[2]=t,e[3]=c):c=e[3];const u=c;let d;e[4]!==t||e[5]!==i?(d=()=>i(t),e[4]=t,e[5]=i,e[6]=d):d=e[6];let a;e[7]!==t.title||e[8]!==u?(a=s.jsx("img",{src:u,className:"w-4 h-4 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[7]=t.title,e[8]=u,e[9]=a):a=e[9];let h;e[10]!==o?(h=s.jsx("span",{className:"text-sm text-foreground leading-tight truncate",children:o}),e[10]=o,e[11]=h):h=e[11];let p;e[12]!==r?(p=s.jsx("span",{className:"text-xs text-muted-foreground/60 leading-tight",children:r}),e[12]=r,e[13]=p):p=e[13];let m;e[14]!==h||e[15]!==p?(m=s.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[h,p]}),e[14]=h,e[15]=p,e[16]=m):m=e[16];let f;return e[17]!==d||e[18]!==a||e[19]!==m?(f=s.jsxs("div",{className:"flex items-center gap-2.5 py-2 px-3 hover:bg-accent cursor-pointer rounded-lg",onMouseEnter:d,children:[a,m]}),e[17]=d,e[18]=a,e[19]=m,e[20]=f):f=e[20],f}function ti(l){const e=V.c(16),{error:t,onRetry:i}=l,n=ie();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"bg-destructive/10 p-2 rounded-full",children:s.jsx(wt,{className:"size-5 text-destructive"})}),e[0]=o):o=e[0];const r=n("chat.decopilot.failedToLoadModels");let c;e[1]!==r?(c=s.jsx("p",{className:"text-sm font-medium text-foreground",children:r}),e[1]=r,e[2]=c):c=e[2];const u=t?.message||n("chat.decopilot.couldNotFetchModels"),d=" "+n("chat.decopilot.tryAnotherProviderOrRetry");let a;e[3]!==u||e[4]!==d?(a=s.jsxs("p",{className:"text-xs text-muted-foreground max-w-[260px]",children:[u,d]}),e[3]=u,e[4]=d,e[5]=a):a=e[5];let h;e[6]!==c||e[7]!==a?(h=s.jsxs("div",{className:"flex flex-col gap-1",children:[c,a]}),e[6]=c,e[7]=a,e[8]=h):h=e[8];let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx($t,{className:"size-3.5"}),e[9]=p):p=e[9];const m=n("chat.decopilot.retry");let f;e[10]!==i||e[11]!==m?(f=s.jsx("div",{className:"flex items-center gap-2",children:s.jsxs(de,{variant:"outline",size:"sm",onClick:i,className:"gap-1.5",children:[p,m]})}),e[10]=i,e[11]=m,e[12]=f):f=e[12];let b;return e[13]!==f||e[14]!==h?(b=s.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-4 py-8 text-center",children:[o,h,f]}),e[13]=f,e[14]=h,e[15]=b):b=e[15],b}function si(){const l=V.c(1);let e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex-1 overflow-y-auto p-2 space-y-1",children:Array.from({length:6}).map(ii)}),l[0]=e):e=l[0],e}function ii(l,e){return s.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 rounded-lg",children:[s.jsx(se,{className:"size-5 shrink-0 rounded-sm"}),s.jsx(se,{className:"flex-1 h-4"}),s.jsx(se,{className:"w-16 h-5 shrink-0 rounded-md"})]},e)}function Xe(l){const e=V.c(12),{label:t,models:i,onSelect:n,onHover:o}=l;if(i.length===0)return null;let r;e[0]!==t?(r=s.jsx("div",{className:"text-xs font-medium text-muted-foreground px-3 pt-3 pb-1",children:t}),e[0]=t,e[1]=r):r=e[1];let c;if(e[2]!==i||e[3]!==o||e[4]!==n){let d;e[6]!==o||e[7]!==n?(d=a=>s.jsx("div",{onClick:()=>n(a),className:"cursor-pointer",children:s.jsx(ei,{model:a,onHover:o})},a.modelId),e[6]=o,e[7]=n,e[8]=d):d=e[8],c=i.map(d),e[2]=i,e[3]=o,e[4]=n,e[5]=c}else c=e[5];let u;return e[9]!==r||e[10]!==c?(u=s.jsxs("div",{children:[r,c]}),e[9]=r,e[10]=c,e[11]=u):u=e[11],u}function we(l,e){return e(l==="other"?"chat.decopilot.tierOther":Hs[l])}function li(l){const e=V.c(21),{model:t,isChecked:i,onToggle:n,onHover:o}=l,[r,c]=U.useState(i);r!==i&&c(i);let u;e[0]!==t?(u=Pe(t),e[0]=t,e[1]=u):u=e[1];const d=u;let a;e[2]!==t||e[3]!==o?(a=()=>o(t),e[2]=t,e[3]=o,e[4]=a):a=e[4];let h;e[5]!==t.modelId||e[6]!==n?(h=()=>{c(ni),n(t.modelId)},e[5]=t.modelId,e[6]=n,e[7]=h):h=e[7];let p;e[8]!==r||e[9]!==h?(p=s.jsx(At,{checked:r,onCheckedChange:h}),e[8]=r,e[9]=h,e[10]=p):p=e[10];let m;e[11]!==d||e[12]!==t.title?(m=s.jsx("img",{src:d,className:"w-5 h-5 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[11]=d,e[12]=t.title,e[13]=m):m=e[13];let f;e[14]!==t.title?(f=s.jsx("span",{className:"text-sm text-foreground flex-1 min-w-0 line-clamp-1",children:t.title}),e[14]=t.title,e[15]=f):f=e[15];let b;return e[16]!==a||e[17]!==p||e[18]!==m||e[19]!==f?(b=s.jsxs("label",{className:"flex items-center gap-3 min-h-8 py-2.5 px-3 hover:bg-accent cursor-pointer rounded-lg",onMouseEnter:a,children:[p,m,f]}),e[16]=a,e[17]=p,e[18]=m,e[19]=f,e[20]=b):b=e[20],b}function ni(l){return!l}function oi(l,e){const t=[];for(const i of ft)if(l[i].length>0){t.push({type:"header",label:we(i,e)});for(const n of l[i])t.push({type:"model",model:n})}if(l.other.length>0){t.push({type:"header",label:we("other",e)});for(const i of l.other)t.push({type:"model",model:i})}return t}function ri({items:l,shortlistSet:e,onToggle:t,onHover:i}){const n=U.useRef(null),o=bs({count:l.length,getScrollElement:()=>n.current,estimateSize:r=>l[r]?.type==="header"?36:44,overscan:6});return s.jsx("div",{ref:n,className:"flex-1 overflow-y-auto",children:s.jsx("div",{className:"relative",style:{height:o.getTotalSize()},children:o.getVirtualItems().map(r=>{const c=l[r.index];return c?s.jsx("div",{"data-index":r.index,ref:o.measureElement,className:"absolute left-0 right-0 top-0 px-0.5",style:{transform:`translateY(${r.start}px)`},children:c.type==="header"?s.jsx("div",{className:"text-xs font-medium text-muted-foreground px-3 pt-3 pb-1",children:c.label}):s.jsx(li,{model:c.model,isChecked:e.has(c.model.modelId),onToggle:t,onHover:i})},r.key):null})})})}function ai(l){const e=V.c(30),{keyId:t,searchTerm:i,onHover:n,onModelSelect:o,managing:r,onToggleManage:c,filterModels:u}=l,d=ie(),{models:a}=Gt(t),h=u?a.filter(u):a.filter(ci);let p;e[0]!==t?(p=()=>(t?Js(t):null)??Qs,e[0]=t,e[1]=p):p=e[1];const[m,f]=U.useState(p),[,b]=U.useTransition();let N;e[2]!==t||e[3]!==b?(N=g=>{t&&b(()=>{f(S=>{const O=new Set(S);return O.has(g)?O.delete(g):O.add(g),Zs(t,O),O})})},e[2]=t,e[3]=b,e[4]=N):N=e[4];const y=N,j=i.toLowerCase().trim(),C=g=>j?g.filter(S=>S.title.toLowerCase().includes(j)||S.modelId.toLowerCase().includes(j)):g;if(r){const g=Ge(C(h)),S=oi(g,d);let O;e[5]!==m?(O=z=>m.has(z.modelId),e[5]=m,e[6]=O):O=e[6];const T=h.filter(O).length;let P;e[7]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx(lt,{size:14}),e[7]=P):P=e[7];let L;e[8]!==d?(L=d("chat.decopilot.back"),e[8]=d,e[9]=L):L=e[9];let D;return e[10]!==c||e[11]!==L?(D=s.jsxs("button",{type:"button",onClick:c,className:"flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground cursor-pointer",children:[P,L]}),e[10]=c,e[11]=L,e[12]=D):D=e[12],s.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[s.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border",children:[D,s.jsx("span",{className:"text-xs text-muted-foreground",children:d("chat.decopilot.selectedCount",{count:T})})]}),s.jsx(ri,{items:S,shortlistSet:m,onToggle:y,onHover:n})]})}let E;e[13]!==m?(E=g=>m.has(g.modelId),e[13]=m,e[14]=E):E=e[14];const M=h.filter(E),I=M.length>0?M:h,x=Ge(C(I));let k;e[15]!==x||e[16]!==n||e[17]!==o||e[18]!==d?(k=ft.map(g=>s.jsx(Xe,{label:we(g,d),models:x[g],onSelect:o,onHover:n},g)),e[15]=x,e[16]=n,e[17]=o,e[18]=d,e[19]=k):k=e[19];let w;e[20]!==d?(w=we("other",d),e[20]=d,e[21]=w):w=e[21];let _;e[22]!==x.other||e[23]!==n||e[24]!==o||e[25]!==w?(_=s.jsx(Xe,{label:w,models:x.other,onSelect:o,onHover:n}),e[22]=x.other,e[23]=n,e[24]=o,e[25]=w,e[26]=_):_=e[26];let v;return e[27]!==k||e[28]!==_?(v=s.jsxs("div",{className:"flex-1 overflow-y-auto px-0.5 pt-1 [touch-action:pan-y]",children:[k,_]}),e[27]=k,e[28]=_,e[29]=v):v=e[29],v}function ci(l){return l.asyncResearch!==!0}function di(){const l=V.c(6);let e;l[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"border-b border-border h-12 bg-background/95 backdrop-blur sticky top-0 z-10",children:s.jsxs("div",{className:"flex items-center gap-2.5 h-12 px-4",children:[s.jsx(se,{className:"size-4 shrink-0"}),s.jsx(se,{className:"flex-1 h-6"}),s.jsx(se,{className:"w-[140px] h-8 shrink-0"})]})}),l[0]=e):e=l[0];let t;l[1]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsxs("div",{className:"flex-1 flex flex-col md:border-r md:w-[420px] md:min-w-[420px] min-h-0 overflow-hidden",children:[e,s.jsx("div",{className:"flex-1 overflow-y-auto p-2 space-y-1",children:Array.from({length:8}).map(ui)})]}),l[1]=t):t=l[1];let i;l[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[s.jsx(se,{className:"size-6 shrink-0"}),s.jsx(se,{className:"h-6 w-32"})]}),l[2]=i):i=l[2];let n;l[3]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"flex flex-col gap-3 py-2 px-0",children:[i,s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(se,{className:"h-6 w-20 rounded-md"}),s.jsx(se,{className:"h-6 w-24 rounded-md"})]})]}),l[3]=n):n=l[3];let o;l[4]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(se,{className:"h-4 w-24"}),s.jsx(se,{className:"h-4 w-32"})]}),l[4]=o):o=l[4];let r;return l[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("div",{className:"flex flex-col md:flex-row h-full sm:h-[460px] min-h-0",children:[t,s.jsx("div",{className:"hidden md:block md:w-[320px] md:shrink-0 p-3",children:s.jsxs("div",{className:"flex flex-col gap-3 py-1 px-1.5",children:[n,s.jsxs("div",{className:"flex flex-col gap-4",children:[o,s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(se,{className:"h-4 w-16"}),s.jsx(se,{className:"h-4 w-40"})]})]})]})})]}),l[5]=r):r=l[5],r}function ui(l,e){return s.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 rounded-lg",children:[s.jsx(se,{className:"size-5 shrink-0 rounded-sm"}),s.jsx(se,{className:"flex-1 h-4"}),s.jsx(se,{className:"w-16 h-5 shrink-0 rounded-md"})]},e)}function xt(l){const e=V.c(66),{onClose:t,credentialId:i,onCredentialChange:n,selectedModel:o,onModelChange:r,filterModels:c,compact:u}=l,d=ie(),[a,h]=U.useState(null),[p,m]=U.useState(""),[f,b]=U.useState(!1),N=U.useRef(null),y=Ae(),j=qt();let C;e[0]!==y?.providers?(C=Object.fromEntries((y?.providers??[]).map(fi)),e[0]=y?.providers,e[1]=C):C=e[1];const E=C,M=Nt(),{org:I}=be();let x;e[2]!==n?(x=A=>{n(A),h(null)},e[2]=n,e[3]=x):x=e[3];const k=x;let w;e[4]!==i||e[5]!==t||e[6]!==r?(w=A=>{i&&(r(A),m(""),t())},e[4]=i,e[5]=t,e[6]=r,e[7]=w):w=e[7];const _=w;if(j.length===0){const A=!u&&"sm:w-[740px]";let $;e[8]!==A?($=ce("flex items-center justify-center p-8 w-full",A),e[8]=A,e[9]=$):$=e[9];let G;e[10]===Symbol.for("react.memo_cache_sentinel")?(G=s.jsx(Ts,{}),e[10]=G):G=e[10];let B;return e[11]!==$?(B=s.jsx("div",{className:$,children:G}),e[11]=$,e[12]=B):B=e[12],B}const v=u?"sm:h-[420px]":"sm:h-[460px]";let g;e[13]!==v?(g=ce("flex flex-col md:flex-row h-full min-h-0",v),e[13]=v,e[14]=g):g=e[14];const S=u?"w-full":"md:border-r md:w-[420px] md:min-w-[420px]";let O;e[15]!==S?(O=ce("flex-1 flex flex-col min-h-0 overflow-hidden",S),e[15]=S,e[16]=O):O=e[16];let T;e[17]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx(nt,{size:16,className:"text-muted-foreground shrink-0"}),e[17]=T):T=e[17];let P;e[18]!==f||e[19]!==d?(P=d(f?"chat.decopilot.searchAllModels":"chat.decopilot.searchForModel"),e[18]=f,e[19]=d,e[20]=P):P=e[20];let L;e[21]===Symbol.for("react.memo_cache_sentinel")?(L=A=>m(A.target.value),e[21]=L):L=e[21];let D;e[22]!==p||e[23]!==P?(D=s.jsx(xe,{ref:N,type:"text",placeholder:P,value:p,onChange:L,className:"flex-1 min-w-0 border-0 !shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"}),e[22]=p,e[23]=P,e[24]=D):D=e[24];let z;e[25]!==i||e[26]!==k||e[27]!==j||e[28]!==E||e[29]!==d?(z=j.length>0&&s.jsxs(Pt,{value:i??"",onValueChange:k,children:[s.jsxs(Tt,{size:"sm",className:"w-auto max-w-[140px] h-8 shrink-0 gap-1.5 px-2 [&>svg:last-child]:hidden",onClick:hi,children:[s.jsx(Dt,{placeholder:d("chat.decopilot.key"),children:(()=>{const A=j.find(le=>le.id===i),$=A?E[A.providerId]:void 0,G=Se(A?.presetId),B=G?.logo??$?.logo,te=G?.name??$?.name??A?.providerId??"Key";return s.jsxs("span",{className:"flex items-center gap-1.5 min-w-0",children:[B?s.jsx("img",{src:B,alt:te,className:"w-4 h-4 rounded shrink-0 dark:bg-white dark:rounded-sm dark:p-px"}):s.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary shrink-0",children:te.slice(0,1).toUpperCase()}),s.jsx("span",{className:"text-xs truncate",children:te})]})})()}),s.jsx(Vt,{className:"size-4 opacity-50 shrink-0 pointer-events-none"})]}),s.jsx(zt,{children:j.map(A=>{const $=E[A.providerId],G=Se(A.presetId),B=G?.logo??$?.logo,te=G?.name??$?.name??A.providerId;return s.jsx(Rt,{value:A.id,children:s.jsxs("div",{className:"flex items-center gap-2",children:[B?s.jsx("img",{src:B,alt:te,className:"w-4 h-4 rounded dark:bg-white dark:rounded-sm dark:p-px"}):s.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:te.slice(0,1).toUpperCase()}),s.jsxs("span",{children:[te," — ",A.label]})]})},A.id)})})]}),e[25]=i,e[26]=k,e[27]=j,e[28]=E,e[29]=d,e[30]=z):z=e[30];let R;e[31]!==D||e[32]!==z?(R=s.jsx("div",{className:"border-b border-border h-12 bg-background/95 backdrop-blur sticky top-0 z-10",children:s.jsxs("label",{className:"flex items-center gap-2.5 h-12 px-4 pr-12 md:pr-4 cursor-text",children:[T,D,z]})}),e[31]=D,e[32]=z,e[33]=R):R=e[33];let K;e[34]!==i?(K=A=>{const{error:$,resetError:G}=A;return s.jsx(ti,{error:$,onRetry:G,credentialId:i??void 0})},e[34]=i,e[35]=K):K=e[35];let W;e[36]===Symbol.for("react.memo_cache_sentinel")?(W=s.jsx(si,{}),e[36]=W):W=e[36];const H=i??void 0;let Q;e[37]===Symbol.for("react.memo_cache_sentinel")?(Q=()=>b(mi),e[37]=Q):Q=e[37];let J;e[38]!==c||e[39]!==_||e[40]!==f||e[41]!==p||e[42]!==H?(J=s.jsx(U.Suspense,{fallback:W,children:s.jsx(ai,{keyId:H,searchTerm:p,onHover:h,onModelSelect:_,managing:f,onToggleManage:Q,filterModels:c})}),e[38]=c,e[39]=_,e[40]=f,e[41]=p,e[42]=H,e[43]=J):J=e[43];let X;e[44]!==i||e[45]!==K||e[46]!==J?(X=s.jsx(kt,{fallback:K,children:J},i),e[44]=i,e[45]=K,e[46]=J,e[47]=X):X=e[47];let F;e[48]!==f||e[49]!==M||e[50]!==I||e[51]!==d?(F=!f&&s.jsxs("div",{className:"border-t border-border flex",children:[s.jsxs("button",{type:"button",onClick:()=>U.startTransition(()=>b(!0)),className:"flex items-center gap-2 flex-1 px-4 py-2.5 text-xs text-muted-foreground hover:text-foreground hover:bg-accent cursor-pointer",children:[s.jsx(Ft,{className:"size-3.5 shrink-0"}),d("chat.decopilot.manageModels")]}),s.jsx("div",{className:"w-px bg-border shrink-0"}),s.jsxs("button",{type:"button",onClick:()=>M({to:"/$org/settings/ai-providers",params:{org:I.slug}}),className:"flex items-center gap-2 flex-1 px-4 py-2.5 text-xs text-muted-foreground hover:text-foreground hover:bg-accent cursor-pointer",children:[s.jsx(Ht,{className:"size-3.5 shrink-0"}),d("chat.decopilot.manageApiKeys")]})]}),e[48]=f,e[49]=M,e[50]=I,e[51]=d,e[52]=F):F=e[52];let q;e[53]!==R||e[54]!==X||e[55]!==F||e[56]!==O?(q=s.jsxs("div",{className:O,children:[R,X,F]}),e[53]=R,e[54]=X,e[55]=F,e[56]=O,e[57]=q):q=e[57];let Y;e[58]!==u||e[59]!==a||e[60]!==o?(Y=!u&&s.jsx("div",{className:"hidden md:flex md:flex-col md:w-[320px] md:shrink-0 p-3",children:s.jsx(Bs,{model:a??o??null})}),e[58]=u,e[59]=a,e[60]=o,e[61]=Y):Y=e[61];let Z;return e[62]!==q||e[63]!==Y||e[64]!==g?(Z=s.jsxs("div",{className:g,children:[q,Y]}),e[62]=q,e[63]=Y,e[64]=g,e[65]=Z):Z=e[65],Z}function mi(l){return!l}function hi(l){return l.stopPropagation()}function fi(l){return[l.id,l]}function pi(l){const e=V.c(12),{onClose:t}=l,{credentialId:i,setCredentialId:n,selectedModel:o,setModel:r}=Le();let c;e[0]!==n?(c=a=>{ue("chat_credential_changed",{credential_id:a}),n(a)},e[0]=n,e[1]=c):c=e[1];let u;e[2]!==i||e[3]!==o?.modelId||e[4]!==r?(u=a=>{i&&(ue("chat_model_changed",{from_model_id:o?.modelId??null,to_model_id:a.modelId,to_model_provider:a.providerId??null,credential_id:i}),r({...a,keyId:i}))},e[2]=i,e[3]=o?.modelId,e[4]=r,e[5]=u):u=e[5];let d;return e[6]!==i||e[7]!==t||e[8]!==o||e[9]!==c||e[10]!==u?(d=s.jsx(xt,{onClose:t,credentialId:i,onCredentialChange:c,selectedModel:o,onModelChange:u}),e[6]=i,e[7]=t,e[8]=o,e[9]=c,e[10]=u,e[11]=d):d=e[11],d}function xi(l){const e=V.c(2),{onClose:t}=l;let i;return e[0]!==t?(i=s.jsx(pi,{onClose:t}),e[0]=t,e[1]=i):i=e[1],i}function gi(l){const e=V.c(2);let t;return e[0]!==l?(t=s.jsx(xt,{...l}),e[0]=l,e[1]=t):t=e[1],t}const vi=[{tier:"fast",labelKey:"chat.desktopCli.tierFastDescription"},{tier:"smart",labelKey:"chat.desktopCli.tierSmartDescription"},{tier:"thinking",labelKey:"chat.desktopCli.tierThinkingDescription"}];function gt(l){const e=V.c(11),{modelSet:t,selectedModelId:i,onSelect:n}=l,o=ie();let r,c;if(e[0]!==t.logo||e[1]!==t.models||e[2]!==t.tiers||e[3]!==n||e[4]!==i||e[5]!==o){const d=Object.fromEntries(t.models.map(bi));r="flex flex-col p-2 w-[320px]",c=vi.map(a=>{const{tier:h,labelKey:p}=a,m=t.tiers[h];if(!m.modelId)return null;const f=d[m.modelId];if(!f)return null;const b=i===m.modelId;return s.jsxs("button",{type:"button",onClick:()=>n(f),className:ce("flex items-center gap-3 px-3 py-2.5 rounded-lg text-left hover:bg-accent",b&&"bg-accent/50"),children:[s.jsx("img",{src:t.logo,alt:m.label,className:"size-5 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px"}),s.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[s.jsx("span",{className:"text-sm text-foreground leading-tight truncate",children:m.label}),s.jsx("span",{className:"text-xs text-muted-foreground leading-tight",children:o(p)})]})]},h)}),e[0]=t.logo,e[1]=t.models,e[2]=t.tiers,e[3]=n,e[4]=i,e[5]=o,e[6]=r,e[7]=c}else r=e[6],c=e[7];let u;return e[8]!==r||e[9]!==c?(u=s.jsx("div",{className:r,children:c}),e[8]=r,e[9]=c,e[10]=u):u=e[10],u}function bi(l){return[l.modelId,l]}const yi=[{providerId:"claude-code",modelId:"claude-code:haiku",title:"Claude Code Haiku",description:"Fast and lightweight",capabilities:["text"],limits:null,costs:null},{providerId:"claude-code",modelId:"claude-code:sonnet",title:"Claude Code Sonnet 5",description:"Balanced performance",capabilities:["text","reasoning"],limits:null,costs:null},{providerId:"claude-code",modelId:"claude-code:opus",title:"Claude Code Opus",description:"Most capable",capabilities:["text","reasoning"],limits:null,costs:null},{providerId:"claude-code",modelId:"claude-code:opus-1m",title:"Claude Code Opus 5 1M",description:"Most capable, 1M context window",capabilities:["text","reasoning"],limits:{contextWindow:1e6,maxOutputTokens:null},costs:null}],Ne="https://assets.decocache.com/decocms/6ac44f1c-c0cf-4480-84b5-2ae6fe742d0b/codex-app.png.png",ji=[{providerId:"codex",modelId:"codex:gpt-5.6-sol",title:"GPT-5.6 Sol",description:"Frontier Codex model for deep reasoning, complex coding, and real-world work",capabilities:["text","reasoning"],logo:Ne,limits:null,costs:null},{providerId:"codex",modelId:"codex:gpt-5.6-terra",title:"GPT-5.6 Terra",description:"Balanced Codex model for everyday coding and agent work",capabilities:["text","reasoning"],logo:Ne,limits:null,costs:null},{providerId:"codex",modelId:"codex:gpt-5.6-luna",title:"GPT-5.6 Luna",description:"Fast Codex model for lightweight coding tasks and titles",capabilities:["text","reasoning"],logo:Ne,limits:null,costs:null},{providerId:"codex",modelId:"codex:gpt-5.3-codex-spark",title:"GPT-5.3 Codex Spark",description:"Ultra-fast coding model",capabilities:["text","reasoning"],logo:Ne,limits:null,costs:null}],Si="https://decoims.com/decocms/93e4059c-e598-412b-87eb-54d72a946ec8/claude-stroke-rounded.svg",Ni="https://decoims.com/decocms/9170ffd4-b9cc-4661-ad8f-ae2eea019e00/codex.svg";function ki(l){return{fast:{modelId:"claude-code:haiku",label:l("chat.agentModels.haikuLabel"),description:l("chat.agentModels.quickerResponses"),iconNode:s.jsx(ge,{size:16})},smart:{modelId:"claude-code:sonnet",label:l("chat.agentModels.sonnetLabel"),description:l("chat.agentModels.balancedQuality"),iconNode:s.jsx(ge,{size:16})},thinking:{modelId:"claude-code:opus-1m",label:l("chat.agentModels.opusLabel"),description:l("chat.agentModels.deeperReasoning"),iconNode:s.jsx(ge,{size:16})}}}function wi(l){return{fast:{modelId:"codex:gpt-5.6-luna",label:l("chat.agentModels.gptLunaLabel"),description:l("chat.agentModels.quickerResponses"),iconNode:s.jsx(ve,{size:16})},smart:{modelId:"codex:gpt-5.6-terra",label:l("chat.agentModels.gptTerraLabel"),description:l("chat.agentModels.balancedQuality"),iconNode:s.jsx(ve,{size:16})},thinking:{modelId:"codex:gpt-5.6-sol",label:l("chat.agentModels.gptSolLabel"),description:l("chat.agentModels.deeperReasoning"),iconNode:s.jsx(ve,{size:16})}}}function vt(l,e){return l==="claude-code"?{logo:Si,tiers:ki(e),models:yi}:l==="codex"?{logo:Ni,tiers:wi(e),models:ji}:null}function Ci(l){const e=V.c(12),{onClose:t,agent:i}=l,n=ie(),o=Le(),r=i??o.pendingHarnessId??"decopilot";let c;e[0]!==r||e[1]!==n?(c=vt(r,n),e[0]=r,e[1]=n,e[2]=c):c=e[2];const u=c;if(!u){let p;return e[3]!==t?(p=s.jsx(xi,{onClose:t}),e[3]=t,e[4]=p):p=e[4],p}const d=o.selectedModel?.modelId??u.tiers[o.simpleModeTier].modelId;let a;e[5]!==t||e[6]!==o?(a=p=>{o.setModel({...p,keyId:void 0}),t()},e[5]=t,e[6]=o,e[7]=a):a=e[7];let h;return e[8]!==u||e[9]!==d||e[10]!==a?(h=s.jsx(gt,{modelSet:u,selectedModelId:d,onSelect:a}),e[8]=u,e[9]=d,e[10]=a,e[11]=h):h=e[11],h}function Ii(l){const e=V.c(14);let t,i;e[0]!==l?({agent:t,...i}=l,e[0]=l,e[1]=t,e[2]=i):(t=e[1],i=e[2]);const n=ie();let o;e[3]!==t||e[4]!==n?(o=t?vt(t,n):null,e[3]=t,e[4]=n,e[5]=o):o=e[5];const r=o;if(!r){let a;return e[6]!==i?(a=s.jsx(gi,{...i}),e[6]=i,e[7]=a):a=e[7],a}const c=i.selectedModel?.modelId??r.tiers.smart.modelId;let u;e[8]!==i?(u=a=>{i.onModelChange(a),i.onClose()},e[8]=i,e[9]=u):u=e[9];let d;return e[10]!==r||e[11]!==c||e[12]!==u?(d=s.jsx(gt,{modelSet:r,selectedModelId:c,onSelect:u}),e[10]=r,e[11]=c,e[12]=u,e[13]=d):d=e[13],d}function cl(l){const e=V.c(49),{variant:t,className:i,placeholder:n,model:o,isLoading:r,credentialId:c,onCredentialChange:u,onModelChange:d,filterModels:a,agent:h}=l,p=t===void 0?"borderless":t,m=n===void 0?"Select model":n,f=ie(),[b,N]=U.useState(!1),y=d!==void 0,j=Ot(),C=p==="borderless"?"ghost":"outline",E=p==="borderless"&&"md:border-none";let M;e[0]!==i||e[1]!==E?(M=ce("text-sm hover:bg-accent rounded-lg py-0.5 px-1 gap-1 shadow-none cursor-pointer border-0 group focus-visible:ring-0 focus-visible:ring-offset-0 min-w-0 shrink justify-start overflow-hidden",E,i),e[0]=i,e[1]=E,e[2]=M):M=e[2];let I;e[3]!==r||e[4]!==o||e[5]!==m||e[6]!==y?(I=y?s.jsx(ut,{model:o??null,placeholder:m,isLoading:r}):s.jsx(Mi,{placeholder:m}),e[3]=r,e[4]=o,e[5]=m,e[6]=y,e[7]=I):I=e[7];let x;e[8]!==C||e[9]!==M||e[10]!==I?(x=s.jsx(de,{variant:C,size:"sm",className:M,children:I}),e[8]=C,e[9]=M,e[10]=I,e[11]=x):x=e[11];const k=x;let w;e[12]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(di,{}),e[12]=w):w=e[12];let _;e[13]!==h||e[14]!==c||e[15]!==a||e[16]!==o||e[17]!==u||e[18]!==d||e[19]!==y?(_=s.jsx(U.Suspense,{fallback:w,children:y?s.jsx(Ii,{onClose:()=>N(!1),agent:h,credentialId:c??null,onCredentialChange:u??_i,selectedModel:o??null,onModelChange:d,filterModels:a}):s.jsx(Ci,{onClose:()=>N(!1),agent:h})}),e[13]=h,e[14]=c,e[15]=a,e[16]=o,e[17]=u,e[18]=d,e[19]=y,e[20]=_):_=e[20];const v=_;if(j){let L;e[21]!==k?(L=s.jsx(It,{asChild:!0,children:k}),e[21]=k,e[22]=L):L=e[22];let D;e[23]!==f?(D=f("chat.selectModel.selectModel"),e[23]=f,e[24]=D):D=e[24];let z;e[25]!==D?(z=s.jsx(_t,{className:"sr-only",children:D}),e[25]=D,e[26]=z):z=e[26];let R;e[27]!==v?(R=s.jsx("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden",children:v}),e[27]=v,e[28]=R):R=e[28];let K;e[29]!==z||e[30]!==R?(K=s.jsxs(Mt,{className:"p-0 flex flex-col max-h-[95vh]",children:[z,R]}),e[29]=z,e[30]=R,e[31]=K):K=e[31];let W;return e[32]!==b||e[33]!==L||e[34]!==K?(W=s.jsxs(Et,{open:b,onOpenChange:N,children:[L,K]}),e[32]=b,e[33]=L,e[34]=K,e[35]=W):W=e[35],W}let g;e[36]!==k?(g=s.jsx(Ct,{asChild:!0,children:k}),e[36]=k,e[37]=g):g=e[37];let S;e[38]!==f?(S=f("chat.selectModel.selectModel"),e[38]=f,e[39]=S):S=e[39];let O;e[40]!==S?(O=s.jsx(Oe,{className:"sr-only",children:S}),e[40]=S,e[41]=O):O=e[41];let T;e[42]!==v||e[43]!==O?(T=s.jsxs(Ee,{className:"p-0 gap-0 sm:max-w-fit overflow-hidden h-[100dvh] sm:h-auto max-h-[100dvh] sm:max-h-[85vh] w-full max-w-full sm:max-w-fit rounded-none sm:rounded-xl border-0 sm:border",closeButtonClassName:"top-3.5 right-3.5 z-20",children:[O,v]}),e[42]=v,e[43]=O,e[44]=T):T=e[44];let P;return e[45]!==b||e[46]!==g||e[47]!==T?(P=s.jsxs(Me,{open:b,onOpenChange:N,children:[g,T]}),e[45]=b,e[46]=g,e[47]=T,e[48]=P):P=e[48],P}function _i(){}function Mi(l){const e=V.c(4),{placeholder:t}=l,{selectedModel:i,isModelsLoading:n}=Le();let o;return e[0]!==n||e[1]!==i||e[2]!==t?(o=s.jsx(ut,{model:i,placeholder:t,isLoading:n}),e[0]=n,e[1]=i,e[2]=t,e[3]=o):o=e[3],o}export{rs as C,di as M,Ts as N,dt as P,Ii as a,ge as b,ve as c,rl as d,cl as e,Se as f,al as g,Os as h,ol as i,nl as l,De as m};
|