decocms 4.76.76 → 4.76.78
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-BVlB73Gd.js → AlertCircle-DBEuJvXd.js} +1 -1
- package/dist/client/assets/{AreaChart-C1SgmDdh.js → AreaChart-RJnPaDTO.js} +1 -1
- package/dist/client/assets/{ArrowUp-BcoNWaDn.js → ArrowUp-OqBYOpu3.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-COlnzfbE.js → ArrowUpRight-3xkp-kWm.js} +1 -1
- package/dist/client/assets/{Check-ylcp47jh.js → Check-Oxo5mPeL.js} +1 -1
- package/dist/client/assets/{CheckCircle-jaIqf58w.js → CheckCircle-DAvZWWWn.js} +1 -1
- package/dist/client/assets/{ChevronDown-DorDM-K-.js → ChevronDown-DCZlSvzQ.js} +1 -1
- package/dist/client/assets/{ChevronRight-NJ1RHqa7.js → ChevronRight-L_rxCnv3.js} +1 -1
- package/dist/client/assets/{ChevronUp-C85SxyPM.js → ChevronUp-BXrO8J56.js} +1 -1
- package/dist/client/assets/{Circle-BGJOKhru.js → Circle-DLL8alCD.js} +1 -1
- package/dist/client/assets/{Copy01-C5M0y3sD.js → Copy01-uwiMYWRU.js} +1 -1
- package/dist/client/assets/{DotsVertical-Ckk9mZsT.js → DotsVertical-B0IViKUD.js} +1 -1
- package/dist/client/assets/{Eye-ByzbJOuX.js → Eye-DVo1_Pm2.js} +1 -1
- package/dist/client/assets/{FilterLines-hGzDxUbQ.js → FilterLines-CAdlDh3I.js} +1 -1
- package/dist/client/assets/{Flag01-D6FA8Gqb.js → Flag01-fXAeu3l9.js} +1 -1
- package/dist/client/assets/{Globe01-DwjnaG3m.js → Globe01-By9gtoyg.js} +1 -1
- package/dist/client/assets/{Globe04-KMRfe3Ap.js → Globe04-uOyvHHk7.js} +1 -1
- package/dist/client/assets/{HardDrive-BLW7r-EP.js → HardDrive-D38nWE_J.js} +1 -1
- package/dist/client/assets/{Image01-DID7YK1H.js → Image01-B-uMMK1I.js} +1 -1
- package/dist/client/assets/{Key01-BNdv9d9e.js → Key01-ChBXFLCM.js} +1 -1
- package/dist/client/assets/{LayoutLeft-DP-M8mno.js → LayoutLeft-DPtsS7J4.js} +1 -1
- package/dist/client/assets/{LinkExternal01-CJELREUW.js → LinkExternal01-C3luIiQr.js} +1 -1
- package/dist/client/assets/{List-B6zsWjbc.js → List-CgvHjjyd.js} +1 -1
- package/dist/client/assets/{Monitor01-DGMiqS2G.js → Monitor01-BbnHlrzQ.js} +1 -1
- package/dist/client/assets/{Package-Cys9wdnk.js → Package-CJkGCd9M.js} +1 -1
- package/dist/client/assets/{Palette-CjpYx7Ii.js → Palette-Dem2eeFJ.js} +1 -1
- package/dist/client/assets/{Play-BIDZ3Qx4.js → Play-02R_l1hm.js} +1 -1
- package/dist/client/assets/{Plus-OGxa0fdn.js → Plus-D8fSfWhL.js} +1 -1
- package/dist/client/assets/{SearchLg-BkGBAC6u.js → SearchLg-BKY8fQrj.js} +1 -1
- package/dist/client/assets/{SearchMd-DhGVvJ2r.js → SearchMd-Di7fRkvt.js} +1 -1
- package/dist/client/assets/{Settings02-s4dN6VnR.js → Settings02-CJygIZBg.js} +1 -1
- package/dist/client/assets/{Shield01-C2gwqyT0.js → Shield01-bU8ewL-C.js} +1 -1
- package/dist/client/assets/{Star01-CdWOUCGL.js → Star01-CAO22TgC.js} +1 -1
- package/dist/client/assets/{Stars01-Ce7N7beA.js → Stars01-BbGPjqZd.js} +1 -1
- package/dist/client/assets/{Stars02-Brbdnmc2.js → Stars02-Bs0TEaNy.js} +1 -1
- package/dist/client/assets/{Sun-DrhefHVP.js → Sun-BZaKEOLT.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-CQC-VHSM.js → SwitchHorizontal01-DqE-u_vC.js} +1 -1
- package/dist/client/assets/{Tool01-CQ5Yi4Y5.js → Tool01-DHJpebK1.js} +1 -1
- package/dist/client/assets/{Tool02-B5mtXP4w.js → Tool02-DlSNNbnL.js} +1 -1
- package/dist/client/assets/{Trash01-9Yhy1NDp.js → Trash01-BGwW4PUs.js} +1 -1
- package/dist/client/assets/{TrendUp01-CUYb4fKq.js → TrendUp01-Lnwj2rUh.js} +1 -1
- package/dist/client/assets/{Upload01-BGaIkl8C.js → Upload01-DVcY511n.js} +1 -1
- package/dist/client/assets/{User01-DY8EdPzH.js → User01-joygJQdk.js} +1 -1
- package/dist/client/assets/{UserPlus01-ByXfLuOW.js → UserPlus01-DvdLIpOn.js} +1 -1
- package/dist/client/assets/{Users01-DnUyZ4sc.js → Users01-BVTwFHJb.js} +1 -1
- package/dist/client/assets/{Users03-DQHSM-ip.js → Users03-FhX9tiey.js} +1 -1
- package/dist/client/assets/{X-8dZUy9dd.js → X-Bs0u_0yh.js} +1 -1
- package/dist/client/assets/{XCircle-DY5ehXOb.js → XCircle-DGorVz-d.js} +1 -1
- package/dist/client/assets/{XClose-IT2oT79e.js → XClose-hq2LkF75.js} +1 -1
- package/dist/client/assets/{Zap-UNZ6wjOU.js → Zap-CT4kcBoV.js} +1 -1
- package/dist/client/assets/{ZapSquare-CIT8HcpR.js → ZapSquare-DivgtbPr.js} +1 -1
- package/dist/client/assets/{ZoomOut-DoDMe5dD.js → ZoomOut-B2C9WPW-.js} +1 -1
- package/dist/client/assets/{access-gate-BjqlcKiO.js → access-gate-B4pZWmwl.js} +1 -1
- package/dist/client/assets/{add-section-modal-C8E813YY.js → add-section-modal-JBdSC8cO.js} +1 -1
- package/dist/client/assets/{agent-icon-DCK7PpQ3.js → agent-icon-Xdz_mRuJ.js} +1 -1
- package/dist/client/assets/{agents-list-Bwjyc61n.js → agents-list-2gWOzqrw.js} +1 -1
- package/dist/client/assets/{ai-providers-peEIA4y0.js → ai-providers-N4FbEwVk.js} +1 -1
- package/dist/client/assets/{alert-dialog-iGippWYX.js → alert-dialog-CWlVUd73.js} +1 -1
- package/dist/client/assets/{alert-CMPxdRHq.js → alert-j61mFoia.js} +1 -1
- package/dist/client/assets/{app-editor-CuUlGlJd.js → app-editor-BRpM18eX.js} +1 -1
- package/dist/client/assets/{auth-BBryGktV.js → auth-DDOP_TUe.js} +1 -1
- package/dist/client/assets/{auth-catchall-CVb1uch8.js → auth-catchall-B0LUMpZy.js} +1 -1
- package/dist/client/assets/{auth-entry-C6Y1Coh9.js → auth-entry-wtr1fLwN.js} +1 -1
- package/dist/client/assets/{auth-split-layout-C7bMt_tF.js → auth-split-layout-Bifmzv2W.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-BVhm4ZHQ.js → authenticate-and-persist-oauth-BcKcvBur.js} +1 -1
- package/dist/client/assets/{automation-list-row-CW2Mr4ne.js → automation-list-row-CWbyvM3t.js} +1 -1
- package/dist/client/assets/{automation-runs-DtF_plhA.js → automation-runs-ewxrJgPk.js} +1 -1
- package/dist/client/assets/automations-C5v25H5e.js +1 -0
- package/dist/client/assets/{autosend-YOQ-CO-z.js → autosend-sntJRLit.js} +1 -1
- package/dist/client/assets/{avatar-6ZpKSJQ1.js → avatar-BumqAYVV.js} +1 -1
- package/dist/client/assets/{badge-Brm7dRFm.js → badge-DuwyDvgL.js} +1 -1
- package/dist/client/assets/{block-document-BE7E93rt.js → block-document-COkNQDU1.js} +1 -1
- package/dist/client/assets/{brand-context-CMCsnbCM.js → brand-context-DJ55kBWm.js} +1 -1
- package/dist/client/assets/{buckets-sTBT-mWR.js → buckets-CZaQ9-E2.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-CnXvOLen.js → bulk-category-panel-C4UbsY4X.js} +1 -1
- package/dist/client/assets/{calendar-C8mrI2UH.js → calendar-Dpt7QB2d.js} +1 -1
- package/dist/client/assets/{capability-load-error-u8-vFMPG.js → capability-load-error-CVQ-0IvS.js} +1 -1
- package/dist/client/assets/{card-DmJEBNvh.js → card-whir3-TU.js} +1 -1
- package/dist/client/assets/{category-editor-BS7auS6b.js → category-editor-DSjyTevO.js} +1 -1
- package/dist/client/assets/{chat-context-DeX0VT17.js → chat-context-CZYpc7lP.js} +1 -1
- package/dist/client/assets/{checkbox-YjFOYgvp.js → checkbox-DbEZ6b_D.js} +1 -1
- package/dist/client/assets/{cli-auth-success-CYFaZSY8.js → cli-auth-success-DhmnJDJJ.js} +1 -1
- package/dist/client/assets/{collection-detail-DM2ekT5E.js → collection-detail-B32MmFU7.js} +1 -1
- package/dist/client/assets/{collection-display-button-B5vJJ8M2.js → collection-display-button--OVhArve.js} +1 -1
- package/dist/client/assets/{collection-search-BebQySxJ.js → collection-search-26JlKJRJ.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-D1lST78v.js → collection-table-wrapper-DPtPbXkO.js} +1 -1
- package/dist/client/assets/{collection-tabs-DhPjZGgE.js → collection-tabs-CMkX9SJV.js} +1 -1
- package/dist/client/assets/{command-DgNLNLpt.js → command-BoNCgAXF.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-Di2Fzvlr.js → commerce-onboarding-DbO5ycXJ.js} +1 -1
- package/dist/client/assets/{companions-core-BXSVQzy2.js → companions-core-C3l18hJe.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-BFe8wpxN.js → connect-desktop-dialog-DR3AZpl6.js} +1 -1
- package/dist/client/assets/{connection-card-B0Odymge.js → connection-card-ClbjHgoq.js} +1 -1
- package/dist/client/assets/{connection-detail-B00fRni_.js → connection-detail-B8ktqErv.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-Cfzc9ntz.js → connection-form-helpers-CkjvvPa_.js} +1 -1
- package/dist/client/assets/{connections-CDGkbkgV.js → connections-BcUWe8c_.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-DpwU6Fnw.js → decopilot-sse-pool-ByDpDqQ2.js} +1 -1
- package/dist/client/assets/{dialog-C6_0qLBU.js → dialog-hBUfi5DB.js} +1 -1
- package/dist/client/assets/{domain-settings-Bhf5R19l.js → domain-settings-DnawB_fV.js} +1 -1
- package/dist/client/assets/{drawer-BtRJAb0M.js → drawer-CrQJ-4Ry.js} +1 -1
- package/dist/client/assets/{dropdown-menu-96rpJkjm.js → dropdown-menu-BDW1EJyx.js} +1 -1
- package/dist/client/assets/{empty-state-jjn-bhGa.js → empty-state-LUctNkh2.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BKfZXo3n.js → extract-connection-data-BFgBaCrk.js} +1 -1
- package/dist/client/assets/{file-explorer-CeKeprFE.js → file-explorer-1FqRLQQ5.js} +1 -1
- package/dist/client/assets/{file-type-icon-cPIVgg9x.js → file-type-icon-CaoqUw2g.js} +1 -1
- package/dist/client/assets/{files-Bn3ru1FT.js → files-BpPo_clL.js} +1 -1
- package/dist/client/assets/{form-BLqlEubb.js → form-B8zhOVR3.js} +1 -1
- package/dist/client/assets/{general-CKz0uKhP.js → general-DxlJNW0F.js} +1 -1
- package/dist/client/assets/{github-repo-picker-CiS_eOYq.js → github-repo-picker-D93GRlsF.js} +1 -1
- package/dist/client/assets/{hooks-B5swj9vo.js → hooks-DNLn_ut2.js} +1 -1
- package/dist/client/assets/{index-Dliz359x.js → index-BUTM8e7t.js} +1 -1
- package/dist/client/assets/{index-DPSWF_0V.js → index-CWrnaczo.js} +1 -1
- package/dist/client/assets/{index-CqkHhPgZ.js → index-Cag8mnTh.js} +1 -1
- package/dist/client/assets/{index-CM-AY9Fy.js → index-CdyljS_N.js} +1 -1
- package/dist/client/assets/{index-Bb3luPLV.js → index-DArYfizl.js} +1 -1
- package/dist/client/assets/{index-BUWOf6-H.js → index-DGQdC8j6.js} +3 -3
- package/dist/client/assets/{index-BYdleGn4.js → index-DTiOXvtP.js} +1 -1
- package/dist/client/assets/{index-C_fgqMB7.js → index-F-ZMCKP-.js} +2 -2
- package/dist/client/assets/{index-_AfOMAmM.js → index-MnX4iOa5.js} +1 -1
- package/dist/client/assets/{index-gNz_kq5D.js → index-gpoC3ssJ.js} +28 -28
- package/dist/client/assets/{index-CWxmaANj.js → index-ivY09p7e.js} +1 -1
- package/dist/client/assets/{index-BdUl5bJN.js → index-qg-bT8JA.js} +1 -1
- package/dist/client/assets/{index-redirect-CmPVrw8O.js → index-redirect-UnLDnJlQ.js} +1 -1
- package/dist/client/assets/{index-C9TMdwOy.js → index-sveg7vlb.js} +1 -1
- package/dist/client/assets/{index-Qvw8OnY1.js → index-vt02LGOF.js} +1 -1
- package/dist/client/assets/{input-C2XNQcRH.js → input-DwWe5Hqk.js} +1 -1
- package/dist/client/assets/{integration-icon-IezBYdjm.js → integration-icon-CfaWXLBn.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-DdEYWFzF.js → invite-member-dialog-D3eUhcy1.js} +1 -1
- package/dist/client/assets/{label-CK1XiDPB.js → label-DdsuSm6M.js} +1 -1
- package/dist/client/assets/{layout-DdW7yJtW.js → layout-Bts6NJ_J.js} +1 -1
- package/dist/client/assets/{login-dKsCPJDm.js → login-Dd4NGdu8.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BtnOcT8N.js → mcp-oauth-SHxAJnkD.js} +1 -1
- package/dist/client/assets/{members-OHD_cH5V.js → members-6mHVnRNm.js} +1 -1
- package/dist/client/assets/{monaco-editor-45RX9-wa.js → monaco-editor-DGONpAoN.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-Pf0PyiYb.js → monitoring-stats-row-CfSW2sgf.js} +1 -1
- package/dist/client/assets/{multi-select-B1IegP8Y.js → multi-select-CD32kF2s.js} +1 -1
- package/dist/client/assets/{oauth-callback-NJnfVzCp.js → oauth-callback-Bzq_-z2r.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-CTrqu6Je.js → oauth-callback-ai-provider-DxKql_z0.js} +1 -1
- package/dist/client/assets/{onboarding-VNgiRiDL.js → onboarding-BwDunMKX.js} +1 -1
- package/dist/client/assets/{org-install-DH3udQUZ.js → org-install-BR62T5jO.js} +1 -1
- package/dist/client/assets/{org-layout-BwVt-wlI.js → org-layout-BHG4t6-u.js} +1 -1
- package/dist/client/assets/{organization-choice-CA519nnl.js → organization-choice-DlY0QjY5.js} +1 -1
- package/dist/client/assets/{orgs-CyzbToZq.js → orgs-Bsar34iG.js} +1 -1
- package/dist/client/assets/{page-seo-form-txb12Kn3.js → page-seo-form-D8JddRAG.js} +1 -1
- package/dist/client/assets/page-seo-sheet-CaWQpVxd.js +1 -0
- package/dist/client/assets/{popover-B2zk9niv.js → popover-BoSjy_J9.js} +1 -1
- package/dist/client/assets/{post-editor-DrrNmiiH.js → post-editor-BeOF_jnK.js} +1 -1
- package/dist/client/assets/{primitives-DlChEJzy.js → primitives-cDJctbRp.js} +1 -1
- package/dist/client/assets/{profile-Ds0StJLd.js → profile-BpIHCO3e.js} +1 -1
- package/dist/client/assets/project-app-view-CD4EGdca.js +1 -0
- package/dist/client/assets/record-editor-DpnQ11Qy.js +1 -0
- package/dist/client/assets/redirect-editor-DTyzzd3k.js +1 -0
- package/dist/client/assets/registry-B76hNPE7.js +2 -0
- package/dist/client/assets/{registry-layout-Dalyr-dX.js → registry-layout-BTDmQem2.js} +1 -1
- package/dist/client/assets/{reports-zmHYxym4.js → reports-rH-WO9Po.js} +1 -1
- package/dist/client/assets/{require-capability-qkGmH7NG.js → require-capability--U_vi60H.js} +1 -1
- package/dist/client/assets/{required-auth-layout-DJSVKequ.js → required-auth-layout-B-_kB-P-.js} +1 -1
- package/dist/client/assets/{reset-password-BQvQW_Yc.js → reset-password-BbwEGkWF.js} +1 -1
- package/dist/client/assets/{roles-BO1zYp8H.js → roles-BRucDg6D.js} +1 -1
- package/dist/client/assets/{search-input-DoQewDAM.js → search-input-B0lumlG7.js} +1 -1
- package/dist/client/assets/{secrets-CwEm2qB4.js → secrets-Cx316kN4.js} +1 -1
- package/dist/client/assets/{sections-editor-CeZVcic7.js → sections-editor-DUBW607x.js} +1 -1
- package/dist/client/assets/{select-model-w8ZEBOqQ.js → select-model-BltF0usx.js} +1 -1
- package/dist/client/assets/{select-BVg_AKhS.js → select-vVirKMnE.js} +1 -1
- package/dist/client/assets/{self-tool-result-8XOi1iaO.js → self-tool-result-hAvB5Ojq.js} +1 -1
- package/dist/client/assets/{seo-editor-Ctu5yT8I.js → seo-editor-CWtXZnRQ.js} +1 -1
- package/dist/client/assets/{settings-layout-Dpo54nzI.js → settings-layout-Bew9lvu0.js} +1 -1
- package/dist/client/assets/{settings-section-Cd7MHbmE.js → settings-section-CvpT3RW4.js} +1 -1
- package/dist/client/assets/{shell-controls-IB_xzFFr.js → shell-controls-C-g_XIqJ.js} +1 -1
- package/dist/client/assets/{shell-layout-BDvpeGAX.js → shell-layout-b2wj0DO7.js} +1 -1
- package/dist/client/assets/{sidebar-Bg21lFNS.js → sidebar-C_llE2r0.js} +1 -1
- package/dist/client/assets/{skeleton-JjNP43lD.js → skeleton-CB7DUvyX.js} +1 -1
- package/dist/client/assets/{sso-C_5vX52P.js → sso-CUBuMbRD.js} +1 -1
- package/dist/client/assets/{store-DDBShmzT.js → store-B1pmnLUq.js} +1 -1
- package/dist/client/assets/store-registry-UxzRtugx.js +2 -0
- package/dist/client/assets/{studio-tools-JGMjsS9V.js → studio-tools-DII0jqi8.js} +1 -1
- package/dist/client/assets/{switch-Dbe5CgqQ.js → switch-DW7tjnTv.js} +1 -1
- package/dist/client/assets/{table-kChvW90I.js → table-DqN44BtI.js} +1 -1
- package/dist/client/assets/{tabs-D6exMqkv.js → tabs-DoePSWje.js} +1 -1
- package/dist/client/assets/{textarea-C-upgcvq.js → textarea-BH3kgWLk.js} +1 -1
- package/dist/client/assets/{toggle-group-CSfYzN1e.js → toggle-group-Dbv18C0K.js} +1 -1
- package/dist/client/assets/{toolbar-CdhDSP7U.js → toolbar-CFkubGs8.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button--2c5nPA5.js → toolbar-icon-button-B2gRcy3Z.js} +1 -1
- package/dist/client/assets/{tooltip-cXMPTvhQ.js → tooltip-CO1zVhUs.js} +1 -1
- package/dist/client/assets/{use-ai-providers-cFLtai6A.js → use-ai-providers-DuJIHuvT.js} +1 -1
- package/dist/client/assets/{use-automations-ljR2TnPA.js → use-automations-CjVm1klr.js} +1 -1
- package/dist/client/assets/{use-autosave-hI5b40ec.js → use-autosave-IhKsmyqJ.js} +1 -1
- package/dist/client/assets/{use-capability-BI2Ao-_m.js → use-capability-CEIYeJxR.js} +1 -1
- package/dist/client/assets/{use-clock-tick-BJ7X5vRI.js → use-clock-tick-BDXFn1B6.js} +1 -1
- package/dist/client/assets/{use-collections-7ERyEkIU.js → use-collections-BqfJEMNR.js} +1 -1
- package/dist/client/assets/{use-connection-CD2Fnptb.js → use-connection-DM8eKjeN.js} +1 -1
- package/dist/client/assets/{use-copy-BhzNp8tf.js → use-copy-eCXRBbSs.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-C-AFRt9S.js → use-create-virtual-mcp-C4Sbw3ia.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-CZ0xTx2w.js → use-debounced-autosave-DQFgMtID.js} +1 -1
- package/dist/client/assets/{use-debounced-value-B52whIH7.js → use-debounced-value-CMoeorqx.js} +1 -1
- package/dist/client/assets/{use-deco-credits-Cfgq3ZjW.js → use-deco-credits-C0lExqRa.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-BNjf3dpu.js → use-decopilot-events-qGOD1WG0.js} +1 -1
- package/dist/client/assets/{use-delete-connection-zsTP85HZ.js → use-delete-connection-BOFCmtMj.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-C6GJURpg.js → use-deployment-admin-Cwn49qZM.js} +1 -1
- package/dist/client/assets/{use-file-configs-1u4ZUq9F.js → use-file-configs-Nmeyll7B.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-DiSaAQPl.js → use-infinite-scroll-DW-B2iyn.js} +1 -1
- package/dist/client/assets/{use-join-requests-U5r9xSzr.js → use-join-requests-Dz8x0kbW.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-dq4wRd85.js → use-mcp-auth-status-D-ki6Fzr.js} +1 -1
- package/dist/client/assets/{use-mcp-client-qnk43eG1.js → use-mcp-client-Csg0Ohl1.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-SncKc9ct.js → use-mcp-tools-DF4E3rLo.js} +1 -1
- package/dist/client/assets/{use-members-Dey3M7mC.js → use-members-B1t5oiJJ.js} +1 -1
- package/dist/client/assets/{use-mobile-oSorlQMv.js → use-mobile-DVuyUrh-.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-7gJqLFkE.js → use-navigate-to-agent-BL2c2hni.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-aAeyG-Cs.js → use-org-auth-client-dM7W8lCQ.js} +1 -1
- package/dist/client/assets/{use-org-sso-De26T__u.js → use-org-sso-w2vntLws.js} +1 -1
- package/dist/client/assets/{use-organization-roles-DNlG9eUj.js → use-organization-roles-7B2EryzT.js} +1 -1
- package/dist/client/assets/{use-organization-settings-DrhRsJWG.js → use-organization-settings-Dfv3IVMe.js} +1 -1
- package/dist/client/assets/{use-registry-connections-CmItta1b.js → use-registry-connections-DMVj_IUs.js} +1 -1
- package/dist/client/assets/{use-secrets-DDzz0qxd.js → use-secrets-j8nq_pg4.js} +1 -1
- package/dist/client/assets/{use-status-sounds-4kB8txsU.js → use-status-sounds-CQv-RBYC.js} +1 -1
- package/dist/client/assets/{use-view-mode-CtgJ6di_.js → use-view-mode-DJr2m2Jz.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-BJxeG1T-.js → use-virtual-mcp-6yApsgIW.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-CzbwdXBh.js +1 -0
- package/dist/client/assets/{useRouterState-DRz1wrvb.js → useRouterState-D5zTQX9l.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-0mVVL1tH.js +1 -0
- package/dist/client/assets/{users-CUTUKT6m.js → users-Dji-ZHlw.js} +1 -1
- package/dist/client/assets/{variant-calendar-HHl2ENnf.js → variant-calendar-UBPoL6eu.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-DqoxH_gE.js → view-mode-toggle-BxM9Rzzk.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/automations-TF-uE_JU.js +0 -1
- package/dist/client/assets/page-seo-sheet-B7-vAcY0.js +0 -1
- package/dist/client/assets/project-app-view-Dtfecj3R.js +0 -1
- package/dist/client/assets/record-editor-5g7SCJ1d.js +0 -1
- package/dist/client/assets/redirect-editor-BVp57v49.js +0 -1
- package/dist/client/assets/registry-ddiHAuZI.js +0 -2
- package/dist/client/assets/store-registry-D43DIoAy.js +0 -2
- package/dist/client/assets/useInfiniteQuery-C6UXsGIP.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-Cn5B2KcA.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as He,r as w,l as Ee,j as n,B as We,i as Hn,n as Ss,t as G,K as xs}from"./index-BUWOf6-H.js";import{X as ys,Y as bs,Z as _s,K as Un,L as zt,M as Gn,P as Wn,i as qn,_ as js,F as Yn,H as Jn,$ as ks,G as ws,a0 as Rs,N as Qn,O as Rt,T as Xn,U as Zn,Q as ea,R as ta,a1 as na,a2 as Ns,a3 as Nt,a4 as Ds,S as aa,a5 as tt,a6 as Cs,a7 as Vs,a8 as Ts,e as Ps,k as As,a9 as Ms,aa as Es,ab as Ks,ac as $s,r as Ot,ad as Bt,ae as Os,af as ut,ag as jt,ah as Bs,ai as Ls,aj as Je,ak as Vn,al as Fs,am as Tn,an as kt,ao as Lt,ap as Is,aq as sn,ar as zs,as as xt,at as Hs,au as Us,av as Gs,aw as Ws,ax as qs,ay as dt,az as Ys,aA as Js,aB as Qs,aC as Pn,aD as wt,m as Xs,aE as Zs,aF as er,aG as tr,aH as nr,aI as rn,aJ as An,aK as Mn,aL as yt,aM as Ft,aN as En,aO as ar,aP as sr,aQ as on,aR as rr,aS as or,aT as Kn,aU as ir}from"./index-gNz_kq5D.js";import{t as lr}from"./ChevronDown-DorDM-K-.js";import{a as sa,n as ra}from"./UserPlus01-ByXfLuOW.js";import{i as oa}from"./ChevronRight-NJ1RHqa7.js";import{n as cr}from"./ChevronUp-C85SxyPM.js";import{S as cn,y as ur,T as dr,U as mr}from"./agent-icon-DCK7PpQ3.js";import{i as fr}from"./Globe01-DwjnaG3m.js";import{A as It}from"./automation-runs-DtF_plhA.js";import{b as mt,T as ft,a as pt}from"./tooltip-cXMPTvhQ.js";import{a as pr,D as hr,h as gr,c as vr,d as Sr,e as xr}from"./dialog-C6_0qLBU.js";import{I as yr}from"./input-C2XNQcRH.js";import{a as ia}from"./Copy01-C5M0y3sD.js";import{b as br}from"./ZoomOut-DoDMe5dD.js";import{i as _r}from"./Settings02-s4dN6VnR.js";import{s as jr}from"./Eye-ByzbJOuX.js";import{s as la}from"./Flag01-D6FA8Gqb.js";import{s as un}from"./Plus-OGxa0fdn.js";import{s as ca}from"./Trash01-9Yhy1NDp.js";import{i as kr}from"./Zap-UNZ6wjOU.js";import{d as it,a as ua,D as da,c as ma,j as wr}from"./dropdown-menu-96rpJkjm.js";import{S as Rr,r as $n,a as Nr,d as Dr,b as Cr,i as Vr,f as Tr,P as Pr,c as Ar}from"./page-seo-form-txb12Kn3.js";import{b as Mr}from"./Tool01-CQ5Yi4Y5.js";import{A as Er}from"./add-section-modal-C8E813YY.js";import"./ArrowUp-BcoNWaDn.js";import"./chat-context-DeX0VT17.js";import"./autosend-YOQ-CO-z.js";import"./hooks-B5swj9vo.js";import"./use-mcp-client-qnk43eG1.js";import"./constants-D_FQAPnt.js";import"./auth-BBryGktV.js";import"./decopilot-sse-pool-DpwU6Fnw.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./studio-tools-JGMjsS9V.js";import"./use-virtual-mcp-BJxeG1T-.js";import"./use-collections-7ERyEkIU.js";import"./use-ai-providers-cFLtai6A.js";import"./use-decopilot-events-BNjf3dpu.js";import"./tab-id-BijBBRwE.js";import"./use-organization-settings-DrhRsJWG.js";import"./drawer-BtRJAb0M.js";import"./collection-search-BebQySxJ.js";import"./SearchMd-DhGVvJ2r.js";import"./use-mobile-oSorlQMv.js";import"./AreaChart-C1SgmDdh.js";import"./index-Dliz359x.js";import"./X-8dZUy9dd.js";import"./shell-layout-BDvpeGAX.js";import"./avatar-6ZpKSJQ1.js";import"./User01-DY8EdPzH.js";import"./Users03-DQHSM-ip.js";import"./SearchLg-BkGBAC6u.js";import"./Stars02-Brbdnmc2.js";import"./XClose-IT2oT79e.js";import"./CheckCircle-jaIqf58w.js";import"./FilterLines-hGzDxUbQ.js";import"./alert-dialog-iGippWYX.js";import"./required-auth-layout-DJSVKequ.js";import"./use-org-sso-De26T__u.js";import"./ZapSquare-CIT8HcpR.js";import"./Check-ylcp47jh.js";import"./Star01-CdWOUCGL.js";import"./Image01-DID7YK1H.js";import"./Upload01-BGaIkl8C.js";import"./AlertCircle-BVlB73Gd.js";import"./form-BLqlEubb.js";import"./label-CK1XiDPB.js";import"./select-BVg_AKhS.js";import"./XCircle-DY5ehXOb.js";import"./tabs-D6exMqkv.js";import"./Tool02-B5mtXP4w.js";import"./toggle-group-CSfYzN1e.js";import"./use-deco-credits-Cfgq3ZjW.js";import"./extract-connection-data-BKfZXo3n.js";import"./connection-card-B0Odymge.js";import"./use-registry-connections-CmItta1b.js";import"./use-connection-CD2Fnptb.js";import"./useInfiniteQuery-C6UXsGIP.js";import"./use-infinite-scroll-DiSaAQPl.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./card-DmJEBNvh.js";import"./integration-icon-IezBYdjm.js";import"./textarea-C-upgcvq.js";import"./connection-form-helpers-Cfzc9ntz.js";import"./authenticate-and-persist-oauth-BVhm4ZHQ.js";import"./mcp-oauth-BtnOcT8N.js";import"./collection-tabs-DhPjZGgE.js";import"./badge-Brm7dRFm.js";import"./useSuspenseInfiniteQuery-Cn5B2KcA.js";import"./Monitor01-DGMiqS2G.js";import"./connect-desktop-dialog-BFe8wpxN.js";import"./select-model-w8ZEBOqQ.js";import"./checkbox-YjFOYgvp.js";import"./skeleton-JjNP43lD.js";import"./Key01-BNdv9d9e.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-Cd7MHbmE.js";import"./ArrowUpRight-COlnzfbE.js";import"./Stars01-Ce7N7beA.js";import"./command-DgNLNLpt.js";import"./index-CqkHhPgZ.js";import"./popover-B2zk9niv.js";import"./index-DPSWF_0V.js";import"./Palette-CjpYx7Ii.js";import"./file-type-icon-cPIVgg9x.js";import"./toolbar-CdhDSP7U.js";import"./Package-Cys9wdnk.js";import"./use-debounced-value-B52whIH7.js";import"./LinkExternal01-CJELREUW.js";import"./index-Qvw8OnY1.js";import"./LayoutLeft-DP-M8mno.js";import"./DotsVertical-Ckk9mZsT.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-4kB8txsU.js";import"./empty-state-jjn-bhGa.js";import"./use-mcp-tools-SncKc9ct.js";import"./use-capability-BI2Ao-_m.js";import"./Play-BIDZ3Qx4.js";import"./use-debounced-autosave-CZ0xTx2w.js";import"./index-BdUl5bJN.js";import"./sidebar-Bg21lFNS.js";import"./search-input-DoQewDAM.js";import"./use-mcp-auth-status-dq4wRd85.js";import"./switch-Dbe5CgqQ.js";import"./github-repo-picker-CiS_eOYq.js";import"./use-navigate-to-agent-7gJqLFkE.js";import"./reusable-new-chat-CouMjkYR.js";import"./provision-repo-scoped-github-connection-CB4ICKHq.js";import"./Users01-DnUyZ4sc.js";import"./use-secrets-DDzz0qxd.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./companions-core-BXSVQzy2.js";import"./format-time-BnbuEtat.js";import"./TrendUp01-CUYb4fKq.js";import"./use-members-Dey3M7mC.js";import"./use-org-auth-client-aAeyG-Cs.js";import"./index-C_fgqMB7.js";import"./get-initials-D-f_fDFw.js";import"./List-B6zsWjbc.js";import"./Circle-BGJOKhru.js";import"./calendar-C8mrI2UH.js";import"./use-copy-BhzNp8tf.js";import"./toolbar-icon-button--2c5nPA5.js";import"./SwitchHorizontal01-CQC-VHSM.js";import"./monaco-editor-45RX9-wa.js";import"./use-file-configs-1u4ZUq9F.js";import"./use-automations-ljR2TnPA.js";import"./automation-list-row-CW2Mr4ne.js";import"./Globe04-KMRfe3Ap.js";import"./HardDrive-BLW7r-EP.js";import"./Sun-DrhefHVP.js";import"./Shield01-C2gwqyT0.js";import"./table-kChvW90I.js";import"./use-clock-tick-BJ7X5vRI.js";function Kr(m){return m.schema?.definitions??m.schema?.$defs??{}}function $r(m,e){const r=Kr(e),c=r[btoa(m)];if(!c)return;let d=typeof c.image=="string"?c.image:void 0;if(!d&&Array.isArray(c.allOf)){const h=c.allOf.find(S=>typeof S.$ref=="string")?.$ref;if(typeof h=="string"){const S=h.replace("#/definitions/",""),p=r[S];d=typeof p?.image=="string"?p.image:void 0}}if(d?.includes("{{{"))return d}function Or(m,e){if(!e)return;const r=ys(m);if(!r)return;const c=$r(r.resolveType,e);if(!c)return;const d=bs(c,r.data);if(d)return _s(d)}const Br="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",Lr="text-global-section-fg focus:bg-global-section/12 focus:text-global-section-fg dark:text-global-section-fg-dark dark:focus:bg-global-section/15 dark:focus:text-global-section-fg-dark [&_svg]:!text-global-section";function On(m){return Array.from({length:m},(e,r)=>({id:crypto.randomUUID(),index:r}))}function fa(m){return m.map((e,r)=>({...e,index:r}))}function Fr(m,e){if(e===m.length)return m;if(e<m.length)return fa(m.slice(0,e));const r=Array.from({length:e-m.length},(c,d)=>({id:crypto.randomUUID(),index:m.length+d}));return[...m,...r]}function pa(m){const e=He.c(20),{section:r,raw:c,meta:d}=m,h=r.isSavedBlock===!0,S=r.isMultivariate===!0;let p;e[0]!==d||e[1]!==c?(p=c&&d?Or(c,d):void 0,e[0]=d,e[1]=c,e[2]=p):p=e[2];const v=p;let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(br,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[3]=g):g=e[3];let b;e[4]!==v?(b=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]=b):b=e[5];let V;e[6]!==S||e[7]!==h?(V=h?{color:ws}:S?{color:"oklch(0.65 0.15 160)"}:void 0,e[6]=S,e[7]=h,e[8]=V):V=e[8];let R;e[9]!==V?(R=n.jsx(cn,{className:"h-4 w-4 shrink-0",style:V}),e[9]=V,e[10]=R):R=e[10];const _=r.isHidden&&"line-through opacity-50";let k;e[11]!==_?(k=Ee("min-w-0 flex-1 truncate text-sm font-medium",_),e[11]=_,e[12]=k):k=e[12];let o;e[13]!==r.label||e[14]!==k?(o=n.jsx("span",{className:k,children:r.label}),e[13]=r.label,e[14]=k,e[15]=o):o=e[15];let N;return e[16]!==b||e[17]!==R||e[18]!==o?(N=n.jsxs(n.Fragment,{children:[g,b,R,o]}),e[16]=b,e[17]=R,e[18]=o,e[19]=N):N=e[19],N}function ha(m,e){const r=m.isSavedBlock===!0,c=m.isMultivariate===!0;return Ee("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":r?Br:c?"text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]":"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function Ir(m){const e=He.c(64),{section:r,raw:c,meta:d,sortableId:h,selected:S,onSelect:p,onDelete:v,onDuplicate:g,onMakeReusable:b,onToggleHidden:V,onToggleLazy:R,onAddVariant:_,onDetach:k}=m,o=c?qn(c.__resolveType??""):!1;let N;e[0]!==r?(N=js(r),e[0]=r,e[1]=N):N=e[1];const l=N;let J;e[2]!==h?(J={id:h,animateLayoutChanges:Wr},e[2]=h,e[3]=J):J=e[3];const{attributes:H,listeners:K,setNodeRef:u,transform:T,isDragging:se}=Yn(J);let P;e[4]!==T?(P=Jn.Transform.toString(T?{...T,x:0}:null),e[4]=T,e[5]=P):P=e[5];const pe=se?0:void 0;let D;e[6]!==P||e[7]!==pe?(D={transform:P,opacity:pe},e[6]=P,e[7]=pe,e[8]=D):D=e[8];const ce=D;let B;e[9]!==r?(B=ks(r),e[9]=r,e[10]=B):B=e[10];const te=B,oe="button",Ve=0;let E;e[11]!==p?(E=$=>{($.key==="Enter"||$.key===" ")&&($.preventDefault(),p())},e[11]=p,e[12]=E):E=e[12];const ue=se?"cursor-grabbing":"cursor-pointer";let ie;e[13]!==r||e[14]!==S||e[15]!==ue?(ie=Ee("touch-none transition-colors",ue,ha(r,S)),e[13]=r,e[14]=S,e[15]=ue,e[16]=ie):ie=e[16];let je;e[17]!==d||e[18]!==c||e[19]!==r?(je=n.jsx(pa,{section:r,raw:c,meta:d}),e[17]=d,e[18]=c,e[19]=r,e[20]=je):je=e[20];const M=!r.isMultivariate&&n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx(We,{type:"button",variant:"ghost",size:"icon","aria-label":o?"Disable async render":"Enable async render",className:Ee("h-7 w-7 shrink-0",o?"":"opacity-0 group-hover:opacity-100"),onClick:$=>{$.stopPropagation(),R()},onPointerDown:Gr,children:n.jsx(kr,{className:Ee("h-3.5 w-3.5",o&&"text-yellow-500")})})}),n.jsx(pt,{side:"bottom",children:o?"Disable async render":"Enable async render"})]});let Ae;e[21]!==V||e[22]!==r.isHidden||e[23]!==r.isMultivariate?(Ae=!r.isMultivariate&&n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx(We,{type:"button",variant:"ghost",size:"icon","aria-label":r.isHidden?"Show section":"Hide section",className:Ee("h-7 w-7 shrink-0",r.isHidden?"opacity-100":"opacity-0 group-hover:opacity-100"),onClick:$=>{$.stopPropagation(),V()},onPointerDown:Ur,children:r.isHidden?n.jsx(_r,{className:"h-3.5 w-3.5"}):n.jsx(jr,{className:"h-3.5 w-3.5"})})}),n.jsx(pt,{side:"bottom",children:r.isHidden?"Show section":"Hide section"})]}),e[21]=V,e[22]=r.isHidden,e[23]=r.isMultivariate,e[24]=Ae):Ae=e[24];let X;e[25]===Symbol.for("react.memo_cache_sentinel")?(X=n.jsx(ua,{asChild:!0,children:n.jsx(We,{type:"button",variant:"ghost",size:"icon","aria-label":"Section actions",className:"h-7 w-7 shrink-0 opacity-0 group-hover:opacity-100",onClick:Hr,onPointerDown:zr,children:n.jsx(sa,{className:"h-3.5 w-3.5"})})}),e[25]=X):X=e[25];let De;e[26]!==g?(De=$=>{$.stopPropagation(),g()},e[26]=g,e[27]=De):De=e[27];let ve;e[28]===Symbol.for("react.memo_cache_sentinel")?(ve=n.jsx(ia,{className:"h-4 w-4"}),e[28]=ve):ve=e[28];let re;e[29]!==De?(re=n.jsxs(it,{onClick:De,children:[ve,"Duplicate"]}),e[29]=De,e[30]=re):re=e[30];let W;e[31]!==l||e[32]!==_?(W=l&&n.jsxs(it,{className:Rs,onClick:$=>{$.stopPropagation(),_()},children:[n.jsx(la,{className:"h-4 w-4"}),"Add variant"]}),e[31]=l,e[32]=_,e[33]=W):W=e[33];let q;e[34]!==te||e[35]!==b?(q=te&&n.jsxs(it,{className:Lr,onClick:$=>{$.stopPropagation(),b()},children:[n.jsx(cn,{className:"h-4 w-4"}),"Make reusable"]}),e[34]=te,e[35]=b,e[36]=q):q=e[36];let ne;e[37]!==k||e[38]!==r.isMultivariate||e[39]!==r.isSavedBlock?(ne=r.isSavedBlock===!0&&!r.isMultivariate&&n.jsxs(it,{onClick:$=>{$.stopPropagation(),k()},children:[n.jsx(cn,{className:"h-4 w-4"}),"Detach"]}),e[37]=k,e[38]=r.isMultivariate,e[39]=r.isSavedBlock,e[40]=ne):ne=e[40];let le;e[41]!==v?(le=$=>{$.stopPropagation(),v()},e[41]=v,e[42]=le):le=e[42];let ke;e[43]===Symbol.for("react.memo_cache_sentinel")?(ke=n.jsx(ca,{className:"h-4 w-4"}),e[43]=ke):ke=e[43];let Se;e[44]!==le?(Se=n.jsxs(it,{className:"text-destructive focus:text-destructive",onClick:le,children:[ke,"Delete"]}),e[44]=le,e[45]=Se):Se=e[45];let de;e[46]!==re||e[47]!==W||e[48]!==q||e[49]!==ne||e[50]!==Se?(de=n.jsxs(da,{children:[X,n.jsxs(ma,{align:"end",className:"w-44",children:[re,W,q,ne,Se]})]}),e[46]=re,e[47]=W,e[48]=q,e[49]=ne,e[50]=Se,e[51]=de):de=e[51];let be;return e[52]!==H||e[53]!==K||e[54]!==p||e[55]!==u||e[56]!==ce||e[57]!==ie||e[58]!==je||e[59]!==M||e[60]!==Ae||e[61]!==de||e[62]!==E?(be=n.jsxs("div",{ref:u,style:ce,...H,...K,role:oe,tabIndex:Ve,onClick:p,onKeyDown:E,className:ie,children:[je,M,Ae,de]}),e[52]=H,e[53]=K,e[54]=p,e[55]=u,e[56]=ce,e[57]=ie,e[58]=je,e[59]=M,e[60]=Ae,e[61]=de,e[62]=E,e[63]=be):be=e[63],be}function zr(m){return m.stopPropagation()}function Hr(m){return m.stopPropagation()}function Ur(m){return m.stopPropagation()}function Gr(m){return m.stopPropagation()}function Wr(){return!1}function qr(m){const e=He.c(90),{listKey:r,rawSections:c,sections:d,meta:h,selectedIndex:S,onSelect:p,onReorder:v,onDelete:g,onDuplicate:b,onMakeReusable:V,onToggleHidden:R,onToggleLazy:_,onAddVariant:k,onDetach:o,onAddSection:N,canAddSection:l}=m,J=l===void 0?!0:l;let H;e[0]!==d.length?(H=()=>On(d.length),e[0]=d.length,e[1]=H):H=e[1];const[K,u]=w.useState(H),[T,se]=w.useState(null),[P,pe]=w.useState(r),[D,ce]=w.useState(d.length),B=w.useRef(!1);P!==r?(pe(r),ce(d.length),u(On(d.length))):D!==d.length&&(ce(d.length),u(L=>Fr(L,d.length)));let te;e[2]===Symbol.for("react.memo_cache_sentinel")?(te={activationConstraint:{distance:8}},e[2]=te):te=e[2];let oe;e[3]===Symbol.for("react.memo_cache_sentinel")?(oe={coordinateGetter:Qn},e[3]=oe):oe=e[3];const Ve=Un(zt(Wn,te),zt(Gn,oe));let E;e[4]!==K?(E=K.map(Yr),e[4]=K,e[5]=E):E=e[5];const ue=E;let ie;e[6]===Symbol.for("react.memo_cache_sentinel")?(ie=L=>{se(String(L.active.id))},e[6]=ie):ie=e[6];const je=ie;let M;e[7]!==ue||e[8]!==v?(M=L=>{se(null);const{active:ae,over:Q}=L;if(!Q||ae.id===Q.id)return;const Ie=ue.indexOf(String(ae.id)),he=ue.indexOf(String(Q.id));Ie===-1||he===-1||(u(Qe=>fa(Rt([...Qe],Ie,he))),B.current=!0,requestAnimationFrame(()=>{B.current=!1}),v?.(Ie,he))},e[7]=ue,e[8]=v,e[9]=M):M=e[9];const Ae=M;let X;e[10]===Symbol.for("react.memo_cache_sentinel")?(X=()=>{se(null)},e[10]=X):X=e[10];const De=X;let ve,re,W,q,ne,le,ke,Se,de,be,$,Z,we,Ke,$e;if(e[11]!==T||e[12]!==J||e[13]!==K||e[14]!==ue||e[15]!==Ae||e[16]!==h||e[17]!==N||e[18]!==k||e[19]!==g||e[20]!==o||e[21]!==b||e[22]!==V||e[23]!==p||e[24]!==R||e[25]!==_||e[26]!==c||e[27]!==d||e[28]!==S||e[29]!==Ve){Ke=Symbol.for("react.early_return_sentinel");e:{const L=ae=>{B.current||p(ae)};if(e[45]!==T||e[46]!==J||e[47]!==K||e[48]!==N||e[49]!==c||e[50]!==d){const ae=T?K.find(Q=>Q.id===T):null;if(q=ae!=null?d[ae.index]:null,W=ae!=null?c[ae.index]:void 0,K.length===0){let Q;e[54]===Symbol.for("react.memo_cache_sentinel")?(Q=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:"No sections in this page."}),e[54]=Q):Q=e[54];const Ie=!J;let he;e[55]===Symbol.for("react.memo_cache_sentinel")?(he=n.jsx(un,{size:14}),e[55]=he):he=e[55];let Qe;e[56]!==N||e[57]!==Ie?(Qe=n.jsxs("div",{className:"space-y-2",children:[Q,n.jsxs(We,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:Ie,onClick:N,children:[he,"Add section"]})]}),e[56]=N,e[57]=Ie,e[58]=Qe):Qe=e[58],Ke=Qe;break e}we=Ee(ae&&"cursor-grabbing"),e[45]=T,e[46]=J,e[47]=K,e[48]=N,e[49]=c,e[50]=d,e[51]=W,e[52]=q,e[53]=we}else W=e[51],q=e[52],we=e[53];re=Xn,Se=Ve,de=Zn,be=je,$=Ae,Z=De,ve=ea,le=ue,ke=ta,$e="space-y-1",ne=K.map(ae=>{const Q=d[ae.index];return Q?n.jsx(Ir,{sortableId:ae.id,section:Q,raw:c[ae.index],meta:h,selected:S===ae.index,onSelect:()=>L(ae.index),onDelete:()=>g(ae.index),onDuplicate:()=>b(ae.index),onMakeReusable:()=>V(ae.index),onToggleHidden:()=>R(ae.index),onToggleLazy:()=>_(ae.index),onAddVariant:()=>k(ae.index),onDetach:()=>o(ae.index)},ae.id):null})}e[11]=T,e[12]=J,e[13]=K,e[14]=ue,e[15]=Ae,e[16]=h,e[17]=N,e[18]=k,e[19]=g,e[20]=o,e[21]=b,e[22]=V,e[23]=p,e[24]=R,e[25]=_,e[26]=c,e[27]=d,e[28]=S,e[29]=Ve,e[30]=ve,e[31]=re,e[32]=W,e[33]=q,e[34]=ne,e[35]=le,e[36]=ke,e[37]=Se,e[38]=de,e[39]=be,e[40]=$,e[41]=Z,e[42]=we,e[43]=Ke,e[44]=$e}else ve=e[30],re=e[31],W=e[32],q=e[33],ne=e[34],le=e[35],ke=e[36],Se=e[37],de=e[38],be=e[39],$=e[40],Z=e[41],we=e[42],Ke=e[43],$e=e[44];if(Ke!==Symbol.for("react.early_return_sentinel"))return Ke;let Le;e[59]!==ne||e[60]!==$e?(Le=n.jsx("div",{className:$e,children:ne}),e[59]=ne,e[60]=$e,e[61]=Le):Le=e[61];let Te;e[62]!==ve||e[63]!==le||e[64]!==ke||e[65]!==Le?(Te=n.jsx(ve,{items:le,strategy:ke,children:Le}),e[62]=ve,e[63]=le,e[64]=ke,e[65]=Le,e[66]=Te):Te=e[66];let Oe;e[67]!==W||e[68]!==q||e[69]!==h?(Oe=q?n.jsx("div",{className:Ee("cursor-grabbing shadow-lg ring-1 ring-border/60",ha(q,!1)),children:n.jsx(pa,{section:q,raw:W,meta:h})}):null,e[67]=W,e[68]=q,e[69]=h,e[70]=Oe):Oe=e[70];let Fe;e[71]!==Oe?(Fe=n.jsx(na,{dropAnimation:null,children:Oe}),e[71]=Oe,e[72]=Fe):Fe=e[72];let Me;e[73]!==re||e[74]!==Se||e[75]!==de||e[76]!==be||e[77]!==$||e[78]!==Z||e[79]!==Te||e[80]!==Fe?(Me=n.jsxs(re,{sensors:Se,collisionDetection:de,onDragStart:be,onDragEnd:$,onDragCancel:Z,children:[Te,Fe]}),e[73]=re,e[74]=Se,e[75]=de,e[76]=be,e[77]=$,e[78]=Z,e[79]=Te,e[80]=Fe,e[81]=Me):Me=e[81];const xe=!J;let Re;e[82]===Symbol.for("react.memo_cache_sentinel")?(Re=n.jsx(un,{size:14}),e[82]=Re):Re=e[82];let me;e[83]!==N||e[84]!==xe?(me=n.jsxs(We,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:xe,onClick:N,children:[Re,"Add section"]}),e[83]=N,e[84]=xe,e[85]=me):me=e[85];let ee;return e[86]!==we||e[87]!==Me||e[88]!==me?(ee=n.jsxs("div",{className:we,children:[Me,me]}),e[86]=we,e[87]=Me,e[88]=me,e[89]=ee):ee=e[89],ee}function Yr(m){return m.id}function Bn(m){const e=He.c(38),{open:r,initialName:c,autoLabel:d,isPending:h,onSubmit:S,onOpenChange:p}=m,v=h===void 0?!1:h,[g,b]=w.useState(c),[V,R]=w.useState(r);r!==V&&(R(r),r&&b(c));let _;e[0]!==v||e[1]!==p?(_=oe=>{!oe&&!v&&p(!1)},e[0]=v,e[1]=p,e[2]=_):_=e[2];const k=_;let o;e[3]!==v||e[4]!==g||e[5]!==S?(o=async oe=>{oe.preventDefault(),!v&&await S(g.trim())},e[3]=v,e[4]=g,e[5]=S,e[6]=o):o=e[6];const N=o;let l;e[7]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(pr,{children:"Rename variant"}),e[7]=l):l=e[7];const J=d||"the rule";let H;e[8]!==J?(H=n.jsxs(hr,{children:[l,n.jsxs(gr,{children:["Save this matcher as a global block with a custom label. Leave empty to inline the matcher again and fall back to"," ",n.jsx("span",{className:"font-medium",children:J}),"."]})]}),e[8]=J,e[9]=H):H=e[9];let K;e[10]===Symbol.for("react.memo_cache_sentinel")?(K=n.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[10]=K):K=e[10];let u;e[11]===Symbol.for("react.memo_cache_sentinel")?(u=oe=>b(oe.target.value),e[11]=u):u=e[11];let T;e[12]!==d||e[13]!==v||e[14]!==g?(T=n.jsxs("div",{className:"space-y-1.5 py-4",children:[K,n.jsx(yr,{id:"variant-rename-name",value:g,onChange:u,placeholder:d,autoFocus:!0,disabled:v})]}),e[12]=d,e[13]=v,e[14]=g,e[15]=T):T=e[15];let se;e[16]!==p?(se=()=>p(!1),e[16]=p,e[17]=se):se=e[17];let P;e[18]!==v||e[19]!==se?(P=n.jsx(We,{type:"button",variant:"outline",onClick:se,disabled:v,children:"Cancel"}),e[18]=v,e[19]=se,e[20]=P):P=e[20];let pe;e[21]!==v?(pe=v?n.jsxs(n.Fragment,{children:[n.jsx(Hn,{size:14,className:"animate-spin"}),"Saving…"]}):"Save",e[21]=v,e[22]=pe):pe=e[22];let D;e[23]!==v||e[24]!==pe?(D=n.jsx(We,{type:"submit",disabled:v,children:pe}),e[23]=v,e[24]=pe,e[25]=D):D=e[25];let ce;e[26]!==P||e[27]!==D?(ce=n.jsxs(vr,{children:[P,D]}),e[26]=P,e[27]=D,e[28]=ce):ce=e[28];let B;e[29]!==N||e[30]!==ce||e[31]!==H||e[32]!==T?(B=n.jsx(Sr,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:N,children:[H,T,ce]})}),e[29]=N,e[30]=ce,e[31]=H,e[32]=T,e[33]=B):B=e[33];let te;return e[34]!==k||e[35]!==r||e[36]!==B?(te=n.jsx(xr,{open:r,onOpenChange:k,children:B}),e[34]=k,e[35]=r,e[36]=B,e[37]=te):te=e[37],te}const Jr="text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]",ga="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.2)]";function va(m){const e=He.c(5),{rule:r,matchers:c}=m,d=r?.__resolveType??"";let h;if(e[0]!==c||e[1]!==d){const g=c.find(b=>b.resolveType===d)?.iconName??Ns(d);h=ur(g),e[0]=c,e[1]=d,e[2]=h}else h=e[2];const S=h;if(!S)return null;let p;return e[3]!==S?(p=n.jsx(S,{size:14,className:"shrink-0"}),e[3]=S,e[4]=p):p=e[4],p}function Ln(m){return m.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
|
|
1
|
+
import{c as He,r as w,l as Ee,j as n,B as We,i as Hn,n as Ss,t as G,K as xs}from"./index-DGQdC8j6.js";import{X as ys,Y as bs,Z as _s,K as Un,L as zt,M as Gn,P as Wn,i as qn,_ as js,F as Yn,H as Jn,$ as ks,G as ws,a0 as Rs,N as Qn,O as Rt,T as Xn,U as Zn,Q as ea,R as ta,a1 as na,a2 as Ns,a3 as Nt,a4 as Ds,S as aa,a5 as tt,a6 as Cs,a7 as Vs,a8 as Ts,e as Ps,k as As,a9 as Ms,aa as Es,ab as Ks,ac as $s,r as Ot,ad as Bt,ae as Os,af as ut,ag as jt,ah as Bs,ai as Ls,aj as Je,ak as Vn,al as Fs,am as Tn,an as kt,ao as Lt,ap as Is,aq as sn,ar as zs,as as xt,at as Hs,au as Us,av as Gs,aw as Ws,ax as qs,ay as dt,az as Ys,aA as Js,aB as Qs,aC as Pn,aD as wt,m as Xs,aE as Zs,aF as er,aG as tr,aH as nr,aI as rn,aJ as An,aK as Mn,aL as yt,aM as Ft,aN as En,aO as ar,aP as sr,aQ as on,aR as rr,aS as or,aT as Kn,aU as ir}from"./index-gpoC3ssJ.js";import{t as lr}from"./ChevronDown-DCZlSvzQ.js";import{a as sa,n as ra}from"./UserPlus01-DvdLIpOn.js";import{i as oa}from"./ChevronRight-L_rxCnv3.js";import{n as cr}from"./ChevronUp-BXrO8J56.js";import{S as cn,y as ur,T as dr,U as mr}from"./agent-icon-Xdz_mRuJ.js";import{i as fr}from"./Globe01-By9gtoyg.js";import{A as It}from"./automation-runs-ewxrJgPk.js";import{b as mt,T as ft,a as pt}from"./tooltip-CO1zVhUs.js";import{a as pr,D as hr,h as gr,c as vr,d as Sr,e as xr}from"./dialog-hBUfi5DB.js";import{I as yr}from"./input-DwWe5Hqk.js";import{a as ia}from"./Copy01-uwiMYWRU.js";import{b as br}from"./ZoomOut-B2C9WPW-.js";import{i as _r}from"./Settings02-CJygIZBg.js";import{s as jr}from"./Eye-DVo1_Pm2.js";import{s as la}from"./Flag01-fXAeu3l9.js";import{s as un}from"./Plus-D8fSfWhL.js";import{s as ca}from"./Trash01-BGwW4PUs.js";import{i as kr}from"./Zap-CT4kcBoV.js";import{d as it,a as ua,D as da,c as ma,j as wr}from"./dropdown-menu-BDW1EJyx.js";import{S as Rr,r as $n,a as Nr,d as Dr,b as Cr,i as Vr,f as Tr,P as Pr,c as Ar}from"./page-seo-form-D8JddRAG.js";import{b as Mr}from"./Tool01-DHJpebK1.js";import{A as Er}from"./add-section-modal-JBdSC8cO.js";import"./ArrowUp-OqBYOpu3.js";import"./chat-context-CZYpc7lP.js";import"./autosend-sntJRLit.js";import"./hooks-DNLn_ut2.js";import"./use-mcp-client-Csg0Ohl1.js";import"./constants-D_FQAPnt.js";import"./auth-DDOP_TUe.js";import"./decopilot-sse-pool-ByDpDqQ2.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./studio-tools-DII0jqi8.js";import"./use-virtual-mcp-6yApsgIW.js";import"./use-collections-BqfJEMNR.js";import"./use-ai-providers-DuJIHuvT.js";import"./use-decopilot-events-qGOD1WG0.js";import"./tab-id-BijBBRwE.js";import"./use-organization-settings-Dfv3IVMe.js";import"./drawer-CrQJ-4Ry.js";import"./collection-search-26JlKJRJ.js";import"./SearchMd-Di7fRkvt.js";import"./use-mobile-DVuyUrh-.js";import"./AreaChart-RJnPaDTO.js";import"./index-BUTM8e7t.js";import"./X-Bs0u_0yh.js";import"./shell-layout-b2wj0DO7.js";import"./avatar-BumqAYVV.js";import"./User01-joygJQdk.js";import"./Users03-FhX9tiey.js";import"./SearchLg-BKY8fQrj.js";import"./Stars02-Bs0TEaNy.js";import"./XClose-hq2LkF75.js";import"./CheckCircle-DAvZWWWn.js";import"./FilterLines-CAdlDh3I.js";import"./alert-dialog-CWlVUd73.js";import"./required-auth-layout-B-_kB-P-.js";import"./use-org-sso-w2vntLws.js";import"./ZapSquare-DivgtbPr.js";import"./Check-Oxo5mPeL.js";import"./Star01-CAO22TgC.js";import"./Image01-B-uMMK1I.js";import"./Upload01-DVcY511n.js";import"./AlertCircle-DBEuJvXd.js";import"./form-B8zhOVR3.js";import"./label-DdsuSm6M.js";import"./select-vVirKMnE.js";import"./XCircle-DGorVz-d.js";import"./tabs-DoePSWje.js";import"./Tool02-DlSNNbnL.js";import"./toggle-group-Dbv18C0K.js";import"./use-deco-credits-C0lExqRa.js";import"./extract-connection-data-BFgBaCrk.js";import"./connection-card-ClbjHgoq.js";import"./use-registry-connections-DMVj_IUs.js";import"./use-connection-DM8eKjeN.js";import"./useInfiniteQuery-CzbwdXBh.js";import"./use-infinite-scroll-DW-B2iyn.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./card-whir3-TU.js";import"./integration-icon-CfaWXLBn.js";import"./textarea-BH3kgWLk.js";import"./connection-form-helpers-CkjvvPa_.js";import"./authenticate-and-persist-oauth-BcKcvBur.js";import"./mcp-oauth-SHxAJnkD.js";import"./collection-tabs-CMkX9SJV.js";import"./badge-DuwyDvgL.js";import"./useSuspenseInfiniteQuery-0mVVL1tH.js";import"./Monitor01-BbnHlrzQ.js";import"./connect-desktop-dialog-DR3AZpl6.js";import"./select-model-BltF0usx.js";import"./checkbox-DbEZ6b_D.js";import"./skeleton-CB7DUvyX.js";import"./Key01-ChBXFLCM.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-CvpT3RW4.js";import"./ArrowUpRight-3xkp-kWm.js";import"./Stars01-BbGPjqZd.js";import"./command-BoNCgAXF.js";import"./index-Cag8mnTh.js";import"./popover-BoSjy_J9.js";import"./index-CWrnaczo.js";import"./Palette-Dem2eeFJ.js";import"./file-type-icon-CaoqUw2g.js";import"./toolbar-CFkubGs8.js";import"./Package-CJkGCd9M.js";import"./use-debounced-value-CMoeorqx.js";import"./LinkExternal01-C3luIiQr.js";import"./index-vt02LGOF.js";import"./LayoutLeft-DPtsS7J4.js";import"./DotsVertical-B0IViKUD.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-CQv-RBYC.js";import"./empty-state-LUctNkh2.js";import"./use-mcp-tools-DF4E3rLo.js";import"./use-capability-CEIYeJxR.js";import"./Play-02R_l1hm.js";import"./use-debounced-autosave-DQFgMtID.js";import"./index-qg-bT8JA.js";import"./sidebar-C_llE2r0.js";import"./search-input-B0lumlG7.js";import"./use-mcp-auth-status-D-ki6Fzr.js";import"./switch-DW7tjnTv.js";import"./github-repo-picker-D93GRlsF.js";import"./use-navigate-to-agent-BL2c2hni.js";import"./reusable-new-chat-CouMjkYR.js";import"./provision-repo-scoped-github-connection-CB4ICKHq.js";import"./Users01-BVTwFHJb.js";import"./use-secrets-j8nq_pg4.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./companions-core-C3l18hJe.js";import"./format-time-BnbuEtat.js";import"./TrendUp01-Lnwj2rUh.js";import"./use-members-B1t5oiJJ.js";import"./use-org-auth-client-dM7W8lCQ.js";import"./index-F-ZMCKP-.js";import"./get-initials-D-f_fDFw.js";import"./List-CgvHjjyd.js";import"./Circle-DLL8alCD.js";import"./calendar-Dpt7QB2d.js";import"./use-copy-eCXRBbSs.js";import"./toolbar-icon-button-B2gRcy3Z.js";import"./SwitchHorizontal01-DqE-u_vC.js";import"./monaco-editor-DGONpAoN.js";import"./use-file-configs-Nmeyll7B.js";import"./use-automations-CjVm1klr.js";import"./automation-list-row-CWbyvM3t.js";import"./Globe04-uOyvHHk7.js";import"./HardDrive-D38nWE_J.js";import"./Sun-BZaKEOLT.js";import"./Shield01-bU8ewL-C.js";import"./table-DqN44BtI.js";import"./use-clock-tick-BDXFn1B6.js";function Kr(m){return m.schema?.definitions??m.schema?.$defs??{}}function $r(m,e){const r=Kr(e),c=r[btoa(m)];if(!c)return;let d=typeof c.image=="string"?c.image:void 0;if(!d&&Array.isArray(c.allOf)){const h=c.allOf.find(S=>typeof S.$ref=="string")?.$ref;if(typeof h=="string"){const S=h.replace("#/definitions/",""),p=r[S];d=typeof p?.image=="string"?p.image:void 0}}if(d?.includes("{{{"))return d}function Or(m,e){if(!e)return;const r=ys(m);if(!r)return;const c=$r(r.resolveType,e);if(!c)return;const d=bs(c,r.data);if(d)return _s(d)}const Br="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",Lr="text-global-section-fg focus:bg-global-section/12 focus:text-global-section-fg dark:text-global-section-fg-dark dark:focus:bg-global-section/15 dark:focus:text-global-section-fg-dark [&_svg]:!text-global-section";function On(m){return Array.from({length:m},(e,r)=>({id:crypto.randomUUID(),index:r}))}function fa(m){return m.map((e,r)=>({...e,index:r}))}function Fr(m,e){if(e===m.length)return m;if(e<m.length)return fa(m.slice(0,e));const r=Array.from({length:e-m.length},(c,d)=>({id:crypto.randomUUID(),index:m.length+d}));return[...m,...r]}function pa(m){const e=He.c(20),{section:r,raw:c,meta:d}=m,h=r.isSavedBlock===!0,S=r.isMultivariate===!0;let p;e[0]!==d||e[1]!==c?(p=c&&d?Or(c,d):void 0,e[0]=d,e[1]=c,e[2]=p):p=e[2];const v=p;let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(br,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[3]=g):g=e[3];let b;e[4]!==v?(b=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]=b):b=e[5];let V;e[6]!==S||e[7]!==h?(V=h?{color:ws}:S?{color:"oklch(0.65 0.15 160)"}:void 0,e[6]=S,e[7]=h,e[8]=V):V=e[8];let R;e[9]!==V?(R=n.jsx(cn,{className:"h-4 w-4 shrink-0",style:V}),e[9]=V,e[10]=R):R=e[10];const _=r.isHidden&&"line-through opacity-50";let k;e[11]!==_?(k=Ee("min-w-0 flex-1 truncate text-sm font-medium",_),e[11]=_,e[12]=k):k=e[12];let o;e[13]!==r.label||e[14]!==k?(o=n.jsx("span",{className:k,children:r.label}),e[13]=r.label,e[14]=k,e[15]=o):o=e[15];let N;return e[16]!==b||e[17]!==R||e[18]!==o?(N=n.jsxs(n.Fragment,{children:[g,b,R,o]}),e[16]=b,e[17]=R,e[18]=o,e[19]=N):N=e[19],N}function ha(m,e){const r=m.isSavedBlock===!0,c=m.isMultivariate===!0;return Ee("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":r?Br:c?"text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]":"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function Ir(m){const e=He.c(64),{section:r,raw:c,meta:d,sortableId:h,selected:S,onSelect:p,onDelete:v,onDuplicate:g,onMakeReusable:b,onToggleHidden:V,onToggleLazy:R,onAddVariant:_,onDetach:k}=m,o=c?qn(c.__resolveType??""):!1;let N;e[0]!==r?(N=js(r),e[0]=r,e[1]=N):N=e[1];const l=N;let J;e[2]!==h?(J={id:h,animateLayoutChanges:Wr},e[2]=h,e[3]=J):J=e[3];const{attributes:H,listeners:K,setNodeRef:u,transform:T,isDragging:se}=Yn(J);let P;e[4]!==T?(P=Jn.Transform.toString(T?{...T,x:0}:null),e[4]=T,e[5]=P):P=e[5];const pe=se?0:void 0;let D;e[6]!==P||e[7]!==pe?(D={transform:P,opacity:pe},e[6]=P,e[7]=pe,e[8]=D):D=e[8];const ce=D;let B;e[9]!==r?(B=ks(r),e[9]=r,e[10]=B):B=e[10];const te=B,oe="button",Ve=0;let E;e[11]!==p?(E=$=>{($.key==="Enter"||$.key===" ")&&($.preventDefault(),p())},e[11]=p,e[12]=E):E=e[12];const ue=se?"cursor-grabbing":"cursor-pointer";let ie;e[13]!==r||e[14]!==S||e[15]!==ue?(ie=Ee("touch-none transition-colors",ue,ha(r,S)),e[13]=r,e[14]=S,e[15]=ue,e[16]=ie):ie=e[16];let je;e[17]!==d||e[18]!==c||e[19]!==r?(je=n.jsx(pa,{section:r,raw:c,meta:d}),e[17]=d,e[18]=c,e[19]=r,e[20]=je):je=e[20];const M=!r.isMultivariate&&n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx(We,{type:"button",variant:"ghost",size:"icon","aria-label":o?"Disable async render":"Enable async render",className:Ee("h-7 w-7 shrink-0",o?"":"opacity-0 group-hover:opacity-100"),onClick:$=>{$.stopPropagation(),R()},onPointerDown:Gr,children:n.jsx(kr,{className:Ee("h-3.5 w-3.5",o&&"text-yellow-500")})})}),n.jsx(pt,{side:"bottom",children:o?"Disable async render":"Enable async render"})]});let Ae;e[21]!==V||e[22]!==r.isHidden||e[23]!==r.isMultivariate?(Ae=!r.isMultivariate&&n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx(We,{type:"button",variant:"ghost",size:"icon","aria-label":r.isHidden?"Show section":"Hide section",className:Ee("h-7 w-7 shrink-0",r.isHidden?"opacity-100":"opacity-0 group-hover:opacity-100"),onClick:$=>{$.stopPropagation(),V()},onPointerDown:Ur,children:r.isHidden?n.jsx(_r,{className:"h-3.5 w-3.5"}):n.jsx(jr,{className:"h-3.5 w-3.5"})})}),n.jsx(pt,{side:"bottom",children:r.isHidden?"Show section":"Hide section"})]}),e[21]=V,e[22]=r.isHidden,e[23]=r.isMultivariate,e[24]=Ae):Ae=e[24];let X;e[25]===Symbol.for("react.memo_cache_sentinel")?(X=n.jsx(ua,{asChild:!0,children:n.jsx(We,{type:"button",variant:"ghost",size:"icon","aria-label":"Section actions",className:"h-7 w-7 shrink-0 opacity-0 group-hover:opacity-100",onClick:Hr,onPointerDown:zr,children:n.jsx(sa,{className:"h-3.5 w-3.5"})})}),e[25]=X):X=e[25];let De;e[26]!==g?(De=$=>{$.stopPropagation(),g()},e[26]=g,e[27]=De):De=e[27];let ve;e[28]===Symbol.for("react.memo_cache_sentinel")?(ve=n.jsx(ia,{className:"h-4 w-4"}),e[28]=ve):ve=e[28];let re;e[29]!==De?(re=n.jsxs(it,{onClick:De,children:[ve,"Duplicate"]}),e[29]=De,e[30]=re):re=e[30];let W;e[31]!==l||e[32]!==_?(W=l&&n.jsxs(it,{className:Rs,onClick:$=>{$.stopPropagation(),_()},children:[n.jsx(la,{className:"h-4 w-4"}),"Add variant"]}),e[31]=l,e[32]=_,e[33]=W):W=e[33];let q;e[34]!==te||e[35]!==b?(q=te&&n.jsxs(it,{className:Lr,onClick:$=>{$.stopPropagation(),b()},children:[n.jsx(cn,{className:"h-4 w-4"}),"Make reusable"]}),e[34]=te,e[35]=b,e[36]=q):q=e[36];let ne;e[37]!==k||e[38]!==r.isMultivariate||e[39]!==r.isSavedBlock?(ne=r.isSavedBlock===!0&&!r.isMultivariate&&n.jsxs(it,{onClick:$=>{$.stopPropagation(),k()},children:[n.jsx(cn,{className:"h-4 w-4"}),"Detach"]}),e[37]=k,e[38]=r.isMultivariate,e[39]=r.isSavedBlock,e[40]=ne):ne=e[40];let le;e[41]!==v?(le=$=>{$.stopPropagation(),v()},e[41]=v,e[42]=le):le=e[42];let ke;e[43]===Symbol.for("react.memo_cache_sentinel")?(ke=n.jsx(ca,{className:"h-4 w-4"}),e[43]=ke):ke=e[43];let Se;e[44]!==le?(Se=n.jsxs(it,{className:"text-destructive focus:text-destructive",onClick:le,children:[ke,"Delete"]}),e[44]=le,e[45]=Se):Se=e[45];let de;e[46]!==re||e[47]!==W||e[48]!==q||e[49]!==ne||e[50]!==Se?(de=n.jsxs(da,{children:[X,n.jsxs(ma,{align:"end",className:"w-44",children:[re,W,q,ne,Se]})]}),e[46]=re,e[47]=W,e[48]=q,e[49]=ne,e[50]=Se,e[51]=de):de=e[51];let be;return e[52]!==H||e[53]!==K||e[54]!==p||e[55]!==u||e[56]!==ce||e[57]!==ie||e[58]!==je||e[59]!==M||e[60]!==Ae||e[61]!==de||e[62]!==E?(be=n.jsxs("div",{ref:u,style:ce,...H,...K,role:oe,tabIndex:Ve,onClick:p,onKeyDown:E,className:ie,children:[je,M,Ae,de]}),e[52]=H,e[53]=K,e[54]=p,e[55]=u,e[56]=ce,e[57]=ie,e[58]=je,e[59]=M,e[60]=Ae,e[61]=de,e[62]=E,e[63]=be):be=e[63],be}function zr(m){return m.stopPropagation()}function Hr(m){return m.stopPropagation()}function Ur(m){return m.stopPropagation()}function Gr(m){return m.stopPropagation()}function Wr(){return!1}function qr(m){const e=He.c(90),{listKey:r,rawSections:c,sections:d,meta:h,selectedIndex:S,onSelect:p,onReorder:v,onDelete:g,onDuplicate:b,onMakeReusable:V,onToggleHidden:R,onToggleLazy:_,onAddVariant:k,onDetach:o,onAddSection:N,canAddSection:l}=m,J=l===void 0?!0:l;let H;e[0]!==d.length?(H=()=>On(d.length),e[0]=d.length,e[1]=H):H=e[1];const[K,u]=w.useState(H),[T,se]=w.useState(null),[P,pe]=w.useState(r),[D,ce]=w.useState(d.length),B=w.useRef(!1);P!==r?(pe(r),ce(d.length),u(On(d.length))):D!==d.length&&(ce(d.length),u(L=>Fr(L,d.length)));let te;e[2]===Symbol.for("react.memo_cache_sentinel")?(te={activationConstraint:{distance:8}},e[2]=te):te=e[2];let oe;e[3]===Symbol.for("react.memo_cache_sentinel")?(oe={coordinateGetter:Qn},e[3]=oe):oe=e[3];const Ve=Un(zt(Wn,te),zt(Gn,oe));let E;e[4]!==K?(E=K.map(Yr),e[4]=K,e[5]=E):E=e[5];const ue=E;let ie;e[6]===Symbol.for("react.memo_cache_sentinel")?(ie=L=>{se(String(L.active.id))},e[6]=ie):ie=e[6];const je=ie;let M;e[7]!==ue||e[8]!==v?(M=L=>{se(null);const{active:ae,over:Q}=L;if(!Q||ae.id===Q.id)return;const Ie=ue.indexOf(String(ae.id)),he=ue.indexOf(String(Q.id));Ie===-1||he===-1||(u(Qe=>fa(Rt([...Qe],Ie,he))),B.current=!0,requestAnimationFrame(()=>{B.current=!1}),v?.(Ie,he))},e[7]=ue,e[8]=v,e[9]=M):M=e[9];const Ae=M;let X;e[10]===Symbol.for("react.memo_cache_sentinel")?(X=()=>{se(null)},e[10]=X):X=e[10];const De=X;let ve,re,W,q,ne,le,ke,Se,de,be,$,Z,we,Ke,$e;if(e[11]!==T||e[12]!==J||e[13]!==K||e[14]!==ue||e[15]!==Ae||e[16]!==h||e[17]!==N||e[18]!==k||e[19]!==g||e[20]!==o||e[21]!==b||e[22]!==V||e[23]!==p||e[24]!==R||e[25]!==_||e[26]!==c||e[27]!==d||e[28]!==S||e[29]!==Ve){Ke=Symbol.for("react.early_return_sentinel");e:{const L=ae=>{B.current||p(ae)};if(e[45]!==T||e[46]!==J||e[47]!==K||e[48]!==N||e[49]!==c||e[50]!==d){const ae=T?K.find(Q=>Q.id===T):null;if(q=ae!=null?d[ae.index]:null,W=ae!=null?c[ae.index]:void 0,K.length===0){let Q;e[54]===Symbol.for("react.memo_cache_sentinel")?(Q=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:"No sections in this page."}),e[54]=Q):Q=e[54];const Ie=!J;let he;e[55]===Symbol.for("react.memo_cache_sentinel")?(he=n.jsx(un,{size:14}),e[55]=he):he=e[55];let Qe;e[56]!==N||e[57]!==Ie?(Qe=n.jsxs("div",{className:"space-y-2",children:[Q,n.jsxs(We,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:Ie,onClick:N,children:[he,"Add section"]})]}),e[56]=N,e[57]=Ie,e[58]=Qe):Qe=e[58],Ke=Qe;break e}we=Ee(ae&&"cursor-grabbing"),e[45]=T,e[46]=J,e[47]=K,e[48]=N,e[49]=c,e[50]=d,e[51]=W,e[52]=q,e[53]=we}else W=e[51],q=e[52],we=e[53];re=Xn,Se=Ve,de=Zn,be=je,$=Ae,Z=De,ve=ea,le=ue,ke=ta,$e="space-y-1",ne=K.map(ae=>{const Q=d[ae.index];return Q?n.jsx(Ir,{sortableId:ae.id,section:Q,raw:c[ae.index],meta:h,selected:S===ae.index,onSelect:()=>L(ae.index),onDelete:()=>g(ae.index),onDuplicate:()=>b(ae.index),onMakeReusable:()=>V(ae.index),onToggleHidden:()=>R(ae.index),onToggleLazy:()=>_(ae.index),onAddVariant:()=>k(ae.index),onDetach:()=>o(ae.index)},ae.id):null})}e[11]=T,e[12]=J,e[13]=K,e[14]=ue,e[15]=Ae,e[16]=h,e[17]=N,e[18]=k,e[19]=g,e[20]=o,e[21]=b,e[22]=V,e[23]=p,e[24]=R,e[25]=_,e[26]=c,e[27]=d,e[28]=S,e[29]=Ve,e[30]=ve,e[31]=re,e[32]=W,e[33]=q,e[34]=ne,e[35]=le,e[36]=ke,e[37]=Se,e[38]=de,e[39]=be,e[40]=$,e[41]=Z,e[42]=we,e[43]=Ke,e[44]=$e}else ve=e[30],re=e[31],W=e[32],q=e[33],ne=e[34],le=e[35],ke=e[36],Se=e[37],de=e[38],be=e[39],$=e[40],Z=e[41],we=e[42],Ke=e[43],$e=e[44];if(Ke!==Symbol.for("react.early_return_sentinel"))return Ke;let Le;e[59]!==ne||e[60]!==$e?(Le=n.jsx("div",{className:$e,children:ne}),e[59]=ne,e[60]=$e,e[61]=Le):Le=e[61];let Te;e[62]!==ve||e[63]!==le||e[64]!==ke||e[65]!==Le?(Te=n.jsx(ve,{items:le,strategy:ke,children:Le}),e[62]=ve,e[63]=le,e[64]=ke,e[65]=Le,e[66]=Te):Te=e[66];let Oe;e[67]!==W||e[68]!==q||e[69]!==h?(Oe=q?n.jsx("div",{className:Ee("cursor-grabbing shadow-lg ring-1 ring-border/60",ha(q,!1)),children:n.jsx(pa,{section:q,raw:W,meta:h})}):null,e[67]=W,e[68]=q,e[69]=h,e[70]=Oe):Oe=e[70];let Fe;e[71]!==Oe?(Fe=n.jsx(na,{dropAnimation:null,children:Oe}),e[71]=Oe,e[72]=Fe):Fe=e[72];let Me;e[73]!==re||e[74]!==Se||e[75]!==de||e[76]!==be||e[77]!==$||e[78]!==Z||e[79]!==Te||e[80]!==Fe?(Me=n.jsxs(re,{sensors:Se,collisionDetection:de,onDragStart:be,onDragEnd:$,onDragCancel:Z,children:[Te,Fe]}),e[73]=re,e[74]=Se,e[75]=de,e[76]=be,e[77]=$,e[78]=Z,e[79]=Te,e[80]=Fe,e[81]=Me):Me=e[81];const xe=!J;let Re;e[82]===Symbol.for("react.memo_cache_sentinel")?(Re=n.jsx(un,{size:14}),e[82]=Re):Re=e[82];let me;e[83]!==N||e[84]!==xe?(me=n.jsxs(We,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:xe,onClick:N,children:[Re,"Add section"]}),e[83]=N,e[84]=xe,e[85]=me):me=e[85];let ee;return e[86]!==we||e[87]!==Me||e[88]!==me?(ee=n.jsxs("div",{className:we,children:[Me,me]}),e[86]=we,e[87]=Me,e[88]=me,e[89]=ee):ee=e[89],ee}function Yr(m){return m.id}function Bn(m){const e=He.c(38),{open:r,initialName:c,autoLabel:d,isPending:h,onSubmit:S,onOpenChange:p}=m,v=h===void 0?!1:h,[g,b]=w.useState(c),[V,R]=w.useState(r);r!==V&&(R(r),r&&b(c));let _;e[0]!==v||e[1]!==p?(_=oe=>{!oe&&!v&&p(!1)},e[0]=v,e[1]=p,e[2]=_):_=e[2];const k=_;let o;e[3]!==v||e[4]!==g||e[5]!==S?(o=async oe=>{oe.preventDefault(),!v&&await S(g.trim())},e[3]=v,e[4]=g,e[5]=S,e[6]=o):o=e[6];const N=o;let l;e[7]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(pr,{children:"Rename variant"}),e[7]=l):l=e[7];const J=d||"the rule";let H;e[8]!==J?(H=n.jsxs(hr,{children:[l,n.jsxs(gr,{children:["Save this matcher as a global block with a custom label. Leave empty to inline the matcher again and fall back to"," ",n.jsx("span",{className:"font-medium",children:J}),"."]})]}),e[8]=J,e[9]=H):H=e[9];let K;e[10]===Symbol.for("react.memo_cache_sentinel")?(K=n.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[10]=K):K=e[10];let u;e[11]===Symbol.for("react.memo_cache_sentinel")?(u=oe=>b(oe.target.value),e[11]=u):u=e[11];let T;e[12]!==d||e[13]!==v||e[14]!==g?(T=n.jsxs("div",{className:"space-y-1.5 py-4",children:[K,n.jsx(yr,{id:"variant-rename-name",value:g,onChange:u,placeholder:d,autoFocus:!0,disabled:v})]}),e[12]=d,e[13]=v,e[14]=g,e[15]=T):T=e[15];let se;e[16]!==p?(se=()=>p(!1),e[16]=p,e[17]=se):se=e[17];let P;e[18]!==v||e[19]!==se?(P=n.jsx(We,{type:"button",variant:"outline",onClick:se,disabled:v,children:"Cancel"}),e[18]=v,e[19]=se,e[20]=P):P=e[20];let pe;e[21]!==v?(pe=v?n.jsxs(n.Fragment,{children:[n.jsx(Hn,{size:14,className:"animate-spin"}),"Saving…"]}):"Save",e[21]=v,e[22]=pe):pe=e[22];let D;e[23]!==v||e[24]!==pe?(D=n.jsx(We,{type:"submit",disabled:v,children:pe}),e[23]=v,e[24]=pe,e[25]=D):D=e[25];let ce;e[26]!==P||e[27]!==D?(ce=n.jsxs(vr,{children:[P,D]}),e[26]=P,e[27]=D,e[28]=ce):ce=e[28];let B;e[29]!==N||e[30]!==ce||e[31]!==H||e[32]!==T?(B=n.jsx(Sr,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:N,children:[H,T,ce]})}),e[29]=N,e[30]=ce,e[31]=H,e[32]=T,e[33]=B):B=e[33];let te;return e[34]!==k||e[35]!==r||e[36]!==B?(te=n.jsx(xr,{open:r,onOpenChange:k,children:B}),e[34]=k,e[35]=r,e[36]=B,e[37]=te):te=e[37],te}const Jr="text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]",ga="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.2)]";function va(m){const e=He.c(5),{rule:r,matchers:c}=m,d=r?.__resolveType??"";let h;if(e[0]!==c||e[1]!==d){const g=c.find(b=>b.resolveType===d)?.iconName??Ns(d);h=ur(g),e[0]=c,e[1]=d,e[2]=h}else h=e[2];const S=h;if(!S)return null;let p;return e[3]!==S?(p=n.jsx(S,{size:14,className:"shrink-0"}),e[3]=S,e[4]=p):p=e[4],p}function Ln(m){return m.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
|
|
2
2
|
`)}function ln(m){return m.map((e,r)=>({id:crypto.randomUUID(),index:r,variant:e}))}function Qr(m){return m.map((e,r)=>({...e,index:r}))}function Sa(m){const e=He.c(16),{label:r,effectiveRule:c,matchers:d,canDelete:h,dragging:S,onRename:p,onDuplicate:v,onDelete:g}=m;let b;e[0]!==c||e[1]!==d?(b=n.jsx(va,{rule:c,matchers:d}),e[0]=c,e[1]=d,e[2]=b):b=e[2];let V;e[3]!==r?(V=n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:r}),e[3]=r,e[4]=V):V=e[4];let R;e[5]!==h||e[6]!==S||e[7]!==r||e[8]!==g||e[9]!==v||e[10]!==p?(R=!S&&n.jsxs(da,{children:[n.jsx(ua,{asChild:!0,children:n.jsx(We,{type:"button",variant:"ghost",size:"icon","aria-label":`Actions for ${r}`,className:"size-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100",onClick:Zr,onPointerDown:Xr,children:n.jsx(sa,{size:14})})}),n.jsxs(ma,{align:"end",className:"w-36",children:[n.jsxs(it,{onClick:k=>{k.stopPropagation(),p?.()},children:[n.jsx(Mr,{size:14}),"Rename"]}),n.jsxs(it,{onClick:k=>{k.stopPropagation(),v?.()},children:[n.jsx(ia,{size:14}),"Duplicate"]}),n.jsx(wr,{}),n.jsxs(it,{variant:"destructive",disabled:!h,onClick:k=>{k.stopPropagation(),g?.()},children:[n.jsx(ca,{size:14}),"Delete"]})]})]}),e[5]=h,e[6]=S,e[7]=r,e[8]=g,e[9]=v,e[10]=p,e[11]=R):R=e[11];let _;return e[12]!==b||e[13]!==V||e[14]!==R?(_=n.jsxs(n.Fragment,{children:[b,V,R]}),e[12]=b,e[13]=V,e[14]=R,e[15]=_):_=e[15],_}function Xr(m){return m.stopPropagation()}function Zr(m){return m.stopPropagation()}function eo(m){const e=He.c(33),{entry:r,sortableId:c,isActive:d,canDelete:h,decofile:S,meta:p,matchers:v,onSelect:g,onRename:b,onDuplicate:V,onDelete:R}=m;let _;e[0]!==c?(_={id:c,animateLayoutChanges:to},e[0]=c,e[1]=_):_=e[1];const{attributes:k,listeners:o,setNodeRef:N,transform:l,isDragging:J}=Yn(_);let H;e[2]!==l?(H=Jn.Transform.toString(l?{...l,x:0}:null),e[2]=l,e[3]=H):H=e[3];const K=J?0:void 0;let u;e[4]!==H||e[5]!==K?(u={transform:H,opacity:K},e[4]=H,e[5]=K,e[6]=u):u=e[6];const T=u,se=p??void 0;let P;e[7]!==S||e[8]!==r.variant.rule||e[9]!==se?(P=Nt(r.variant.rule,S,se),e[7]=S,e[8]=r.variant.rule,e[9]=se,e[10]=P):P=e[10];const pe=P;let D;e[11]!==g?(D=E=>{E.target===E.currentTarget&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),g())},e[11]=g,e[12]=D):D=e[12];const ce=J?"cursor-grabbing":"cursor-pointer active:cursor-grabbing",B=d?ga:Jr;let te;e[13]!==ce||e[14]!==B?(te=Ee("group flex select-none items-center gap-2 rounded-md px-2 py-2.5 transition-colors touch-none",ce,B),e[13]=ce,e[14]=B,e[15]=te):te=e[15];let oe;e[16]!==h||e[17]!==pe||e[18]!==r.variant.label||e[19]!==v||e[20]!==R||e[21]!==V||e[22]!==b?(oe=n.jsx(Sa,{label:r.variant.label,effectiveRule:pe,matchers:v,canDelete:h,onRename:b,onDuplicate:V,onDelete:R}),e[16]=h,e[17]=pe,e[18]=r.variant.label,e[19]=v,e[20]=R,e[21]=V,e[22]=b,e[23]=oe):oe=e[23];let Ve;return e[24]!==k||e[25]!==o||e[26]!==g||e[27]!==N||e[28]!==T||e[29]!==te||e[30]!==oe||e[31]!==D?(Ve=n.jsx("div",{ref:N,style:T,...k,...o,onClick:g,onKeyDown:D,className:te,children:oe}),e[24]=k,e[25]=o,e[26]=g,e[27]=N,e[28]=T,e[29]=te,e[30]=oe,e[31]=D,e[32]=Ve):Ve=e[32],Ve}function to(){return!1}function no(m){const e=He.c(9),{variant:r,decofile:c,meta:d,matchers:h}=m,S=d??void 0;let p;e[0]!==c||e[1]!==S||e[2]!==r.rule?(p=Nt(r.rule,c,S),e[0]=c,e[1]=S,e[2]=r.rule,e[3]=p):p=e[3];const v=p;let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=Ee("flex items-center gap-2 rounded-md px-2 py-2.5 shadow-lg ring-1 ring-border/60 cursor-grabbing",ga),e[4]=g):g=e[4];let b;return e[5]!==v||e[6]!==h||e[7]!==r.label?(b=n.jsx("div",{className:g,children:n.jsx(Sa,{label:r.label,effectiveRule:v,matchers:h,canDelete:!1,dragging:!0})}),e[5]=v,e[6]=h,e[7]=r.label,e[8]=b):b=e[8],b}function ao(m){const e=He.c(77),{listKey:r,variants:c,activeIndex:d,decofile:h,meta:S,matchers:p,onSelect:v,onReorder:g,onRename:b,onDuplicate:V,onDelete:R,onAdd:_}=m;let k;e[0]!==c?(k=()=>ln(c),e[0]=c,e[1]=k):k=e[1];const[o,N]=w.useState(k),[l,J]=w.useState(null),[H,K]=w.useState(r),[u,T]=w.useState(c.length);let se;e[2]!==c?(se=()=>Ln(c),e[2]=c,e[3]=se):se=e[3];const[P,pe]=w.useState(se),D=w.useRef(!1),ce=Ln(c);H!==r?(K(r),T(c.length),pe(ce),N(ln(c))):u!==c.length?(T(c.length),pe(ce),N(ln(c))):P!==ce&&(pe(ce),N(Me=>c.map((xe,Re)=>({id:Me[Re]?.id??crypto.randomUUID(),index:Re,variant:xe}))));let B;e[4]===Symbol.for("react.memo_cache_sentinel")?(B={activationConstraint:{distance:8}},e[4]=B):B=e[4];let te;e[5]===Symbol.for("react.memo_cache_sentinel")?(te={coordinateGetter:Qn},e[5]=te):te=e[5];const oe=Un(zt(Wn,B),zt(Gn,te));let Ve;e[6]!==o?(Ve=o.map(so),e[6]=o,e[7]=Ve):Ve=e[7];const E=Ve,ue=c.length>1;let ie;e[8]!==o?(ie=Me=>{const xe=String(Me.active.id);J(o.find(Re=>Re.id===xe)??null)},e[8]=o,e[9]=ie):ie=e[9];const je=ie;let M;e[10]!==E||e[11]!==g?(M=Me=>{J(null);const{active:xe,over:Re}=Me;if(!Re||xe.id===Re.id)return;const me=E.indexOf(String(xe.id)),ee=E.indexOf(String(Re.id));me===-1||ee===-1||(N(L=>Qr(Rt([...L],me,ee))),D.current=!0,requestAnimationFrame(()=>{D.current=!1}),g(me,ee))},e[10]=E,e[11]=g,e[12]=M):M=e[12];const Ae=M;let X;e[13]===Symbol.for("react.memo_cache_sentinel")?(X=()=>{J(null)},e[13]=X):X=e[13];const De=X;let ve,re,W,q,ne,le,ke,Se,de,be,$,Z,we;if(e[14]!==d||e[15]!==ue||e[16]!==h||e[17]!==o||e[18]!==E||e[19]!==Ae||e[20]!==je||e[21]!==p||e[22]!==S||e[23]!==_||e[24]!==R||e[25]!==V||e[26]!==b||e[27]!==v||e[28]!==oe){const Me=L=>{D.current||v(L)};$="space-y-1 border-b p-2";let xe;e[42]===Symbol.for("react.memo_cache_sentinel")?(xe=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variants"}),e[42]=xe):xe=e[42];let Re;e[43]===Symbol.for("react.memo_cache_sentinel")?(Re=n.jsx(un,{size:14}),e[43]=Re):Re=e[43];let me;e[44]!==_?(me=n.jsx(ft,{asChild:!0,children:n.jsx(We,{type:"button",variant:"ghost",size:"icon","aria-label":"Add variant",className:"size-6",onClick:_,children:Re})}),e[44]=_,e[45]=me):me=e[45];let ee;e[46]===Symbol.for("react.memo_cache_sentinel")?(ee=n.jsx(pt,{children:"Add variant"}),e[46]=ee):ee=e[46],e[47]!==me?(Z=n.jsxs("div",{className:"flex items-center justify-between",children:[xe,n.jsxs(mt,{children:[me,ee]})]}),e[47]=me,e[48]=Z):Z=e[48],re=Xn,le=oe,ke=Zn,Se=je,de=Ae,be=De,ve=ea,q=E,ne=ta,we="space-y-0.5",W=o.map(L=>n.jsx(eo,{sortableId:L.id,entry:L,isActive:L.index===d,canDelete:ue,decofile:h,meta:S,matchers:p,onSelect:()=>Me(L.index),onRename:()=>b(L.index),onDuplicate:()=>V(L.index),onDelete:()=>R(L.index)},L.id)),e[14]=d,e[15]=ue,e[16]=h,e[17]=o,e[18]=E,e[19]=Ae,e[20]=je,e[21]=p,e[22]=S,e[23]=_,e[24]=R,e[25]=V,e[26]=b,e[27]=v,e[28]=oe,e[29]=ve,e[30]=re,e[31]=W,e[32]=q,e[33]=ne,e[34]=le,e[35]=ke,e[36]=Se,e[37]=de,e[38]=be,e[39]=$,e[40]=Z,e[41]=we}else ve=e[29],re=e[30],W=e[31],q=e[32],ne=e[33],le=e[34],ke=e[35],Se=e[36],de=e[37],be=e[38],$=e[39],Z=e[40],we=e[41];let Ke;e[49]!==W||e[50]!==we?(Ke=n.jsx("div",{className:we,children:W}),e[49]=W,e[50]=we,e[51]=Ke):Ke=e[51];let $e;e[52]!==ve||e[53]!==q||e[54]!==ne||e[55]!==Ke?($e=n.jsx(ve,{items:q,strategy:ne,children:Ke}),e[52]=ve,e[53]=q,e[54]=ne,e[55]=Ke,e[56]=$e):$e=e[56];let Le;e[57]!==l||e[58]!==h||e[59]!==p||e[60]!==S?(Le=l?n.jsx(no,{variant:l.variant,decofile:h,meta:S,matchers:p}):null,e[57]=l,e[58]=h,e[59]=p,e[60]=S,e[61]=Le):Le=e[61];let Te;e[62]!==Le?(Te=n.jsx(na,{dropAnimation:null,children:Le}),e[62]=Le,e[63]=Te):Te=e[63];let Oe;e[64]!==re||e[65]!==le||e[66]!==ke||e[67]!==Se||e[68]!==de||e[69]!==be||e[70]!==$e||e[71]!==Te?(Oe=n.jsxs(re,{sensors:le,collisionDetection:ke,onDragStart:Se,onDragEnd:de,onDragCancel:be,children:[$e,Te]}),e[64]=re,e[65]=le,e[66]=ke,e[67]=Se,e[68]=de,e[69]=be,e[70]=$e,e[71]=Te,e[72]=Oe):Oe=e[72];let Fe;return e[73]!==$||e[74]!==Z||e[75]!==Oe?(Fe=n.jsxs("div",{className:$,children:[Z,Oe]}),e[73]=$,e[74]=Z,e[75]=Oe,e[76]=Fe):Fe=e[76],Fe}function so(m){return m.id}function Fn(m){const e=He.c(15),{schema:r,value:c,onChange:d,meta:h,decofile:S,onSaveReferencedBlock:p,sandbox:v}=m;let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=[],e[0]=g):g=e[0];const[b,V]=w.useState(g);let R;e[1]!==b?(R=b.length>0&&n.jsxs("nav",{"aria-label":"Variant rule breadcrumb",className:"flex min-w-0 items-center gap-1 overflow-hidden text-xs",children:[n.jsx("button",{type:"button",onClick:()=>V([]),className:"flex shrink-0 items-center gap-0.5 rounded-md px-1 py-0.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",title:"Back to rule",children:n.jsx(ra,{className:"size-3.5"})}),b.map((o,N)=>{const l=N===b.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[N>0&&n.jsx(oa,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>V(b.slice(0,N+1)),title:o,className:Ee("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",l?"font-medium text-foreground":"text-muted-foreground"),children:o})]},`${o}-${N}`)})]}),e[1]=b,e[2]=R):R=e[2];let _;e[3]!==b||e[4]!==S||e[5]!==h||e[6]!==d||e[7]!==p||e[8]!==v||e[9]!==r||e[10]!==c?(_=n.jsx(aa,{schema:r,value:c,onChange:d,basePath:"",breadcrumbPath:b,onBreadcrumbChange:V,meta:h,decofile:S,onSaveReferencedBlock:p,sandbox:v}),e[3]=b,e[4]=S,e[5]=h,e[6]=d,e[7]=p,e[8]=v,e[9]=r,e[10]=c,e[11]=_):_=e[11];let k;return e[12]!==R||e[13]!==_?(k=n.jsxs("div",{className:"space-y-2",children:[R,_]}),e[12]=R,e[13]=_,e[14]=k):k=e[14],k}function In(m){const e=He.c(21),{activeSchema:r,formValue:c,formResetKey:d,onFormChange:h,onBreadcrumbChange:S,breadcrumbPath:p,emptyMessage:v,beforeForm:g,seoResolveType:b,siteDefaultSeo:V,meta:R,decofile:_,onSaveReferencedBlock:k,sandbox:o}=m;let N;e[0]!==p?(N=p===void 0?[]:p,e[0]=p,e[1]=N):N=e[1];const l=N;let J;e[2]!==r||e[3]!==l||e[4]!==_||e[5]!==d||e[6]!==c||e[7]!==R||e[8]!==S||e[9]!==h||e[10]!==k||e[11]!==o||e[12]!==b||e[13]!==V?(J=r&&c?b?n.jsx(Rr,{schema:r,resolveType:b,value:c,formResetKey:d,onChange:h,onBreadcrumbChange:S,siteDefaultSeo:V}):n.jsx(aa,{schema:r,value:c,onChange:h,basePath:"",breadcrumbPath:l,onBreadcrumbChange:S,meta:R,decofile:_,onSaveReferencedBlock:k,sandbox:o},d):null,e[2]=r,e[3]=l,e[4]=_,e[5]=d,e[6]=c,e[7]=R,e[8]=S,e[9]=h,e[10]=k,e[11]=o,e[12]=b,e[13]=V,e[14]=J):J=e[14];const H=J;let K;e[15]!==v||e[16]!==H?(K=H??n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:v}),e[15]=v,e[16]=H,e[17]=K):K=e[17];let u;return e[18]!==g||e[19]!==K?(u=n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsxs("div",{className:"mx-auto max-w-2xl",children:[g,K]})}),e[18]=g,e[19]=K,e[20]=u):u=e[20],u}const ro="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.22)]";function oo(m,e){return Ds(m,e,tt)}function io(m){const e=He.c(13),{pageKey:r,initialName:c,initialPath:d,onFieldChange:h}=m,[S,p]=w.useState(c),[v,g]=w.useState(d),[b,V]=w.useState(r);b!==r&&(V(r),p(c),g(d));let R;e[0]!==h?(R=l=>{p(l.target.value),h("name",l.target.value)},e[0]=h,e[1]=R):R=e[1];let _;e[2]!==S||e[3]!==R?(_=n.jsx("input",{type:"text",value:S,onChange:R,className:"w-full bg-transparent text-sm font-semibold truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:"Page name"}),e[2]=S,e[3]=R,e[4]=_):_=e[4];let k;e[5]!==h?(k=l=>{g(l.target.value),h("path",l.target.value)},e[5]=h,e[6]=k):k=e[6];let o;e[7]!==v||e[8]!==k?(o=n.jsx("input",{type:"text",value:v,onChange:k,className:"w-full bg-transparent text-xs text-muted-foreground truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:"/path"}),e[7]=v,e[8]=k,e[9]=o):o=e[9];let N;return e[10]!==_||e[11]!==o?(N=n.jsxs("div",{className:"space-y-1",children:[_,o]}),e[10]=_,e[11]=o,e[12]=N):N=e[12],N}function zn(m){const e=He.c(6),{onClick:r}=m;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(la,{size:14}),e[0]=c):c=e[0];let d;e[1]!==r?(d=n.jsx(ft,{asChild:!0,children:n.jsx(We,{type:"button",variant:"ghost",size:"icon","aria-label":"Add variant",className:"size-7 shrink-0 text-[oklch(0.65_0.15_160)]",onClick:r,children:c})}),e[1]=r,e[2]=d):d=e[2];let h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx(pt,{side:"bottom",children:"Add variant"}),e[3]=h):h=e[3];let S;return e[4]!==d?(S=n.jsxs(mt,{children:[d,h]}),e[4]=d,e[5]=S):S=e[5],S}function sc({orgSlug:m,virtualMcpId:e,branch:r,previewReady:c=!0,previewUrl:d,currentPath:h,activePageBlockKey:S=null,activeGlobalBlockKey:p=null,externalSelectedIndex:v,onSaved:g,initialEditSeo:b=!1,onExitSeo:V,onViewJsonFile:R,onVariantPreviewOverride:_}){const k=c?{orgSlug:m,virtualMcpId:e,branch:r,previewUrl:d}:null,{data:o,isLoading:N}=Cs(k),{data:l,isLoading:J}=Vs(k),H=Ts(),K=H?.entity?.id===e?H.entity.metadata?.siteSlug??null:null,[u,T]=w.useState(null),[se,P]=w.useState(null),[pe,D]=w.useState(null),[ce,B]=w.useState(0),[te,oe]=w.useState(void 0),[Ve,E]=w.useState(null),[ue,ie]=w.useState(null),[je,M]=w.useState([]),[Ae,X]=w.useState(0),[De,ve]=w.useState(null),[re,W]=w.useState(null),[q,ne]=w.useState(null),[le,ke]=w.useState(!0),[Se,de]=w.useState(!1),[be,$]=w.useState(!1),[Z,we]=w.useState(b),[Ke,$e]=w.useState(b);b&&!Ke&&($e(!0),we(!0),T(null),P(null),D(null),M([])),!b&&Ke&&$e(!1);const[Le,Te]=w.useState(null),[Oe,Fe]=w.useState(void 0),[Me,xe]=w.useState([]),[Re,me]=w.useState(0),[ee,L]=w.useState(0),[ae,Q]=w.useState(null),[Ie,he]=w.useState(null),[Qe,dn]=w.useState(null),xa=Ss(),ya=`${m}/${e}/${r}`,Ht=Ps({orgSlug:m,virtualMcpId:e,branch:r}),[ba,_a]=w.useState(h),[ja,ka]=w.useState(S),[wa,Ra]=w.useState(p);(ba!==h||ja!==S||wa!==p)&&(queueMicrotask(()=>Ht.flush()),_a(h),ka(S),Ra(p),T(null),P(null),D(null),B(0),E(null),ie(null),L(0),Q(null),he(null),M([]),X(t=>t+1),we(!1),Te(null),Fe(void 0),xe([]),me(t=>t+1));const ye=As({orgSlug:m,virtualMcpId:e,branch:r}),Dt=Xs((t,a)=>{ye.mutate({blockKey:t,data:a},{onSuccess:()=>g?.(),onError:s=>G.error(`Save failed: ${s.message}`)})}),Ut=Ms({orgSlug:m,virtualMcpId:e,branch:r}),[bt,Ct]=w.useState(!1),Gt=w.useRef(null),ht=w.useRef(null),gt=w.useRef(null),Wt=w.useRef({}),qe=w.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null});if(!c||N||J)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(Hn,{size:20,className:"animate-spin text-muted-foreground"})});if(!o||!l)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:"Could not load site data."});const Na=Es(o),_e=!!p,ze=_e?null:Ks(Na,h,S),j=_e?p:ze?.key??null,qt=_e&&p?o[p]:void 0,mn=_e&&p&&qt?$s(p,qt):_e&&p?p:"",Vt=!_e&&j&&o[j]?o[j]:null,Yt=Z&&o&&l&&j&&ze?$n(o,{kind:"page",pageKey:j,pageName:String(ze.name??""),path:String(ze.path??"")},l):null,Da=Z?Vt?.seo:void 0,Jt=Oe!==void 0?Oe:Da,Ca=Z?Nr(Jt):void 0,Va=Yt?.seoTypeOptions??[],Ta=Z&&l?Dr(l):"",fn=Le??Ca??{},Qt=Z&&Yt?Cr(fn,Yt):null,Pa=Z&&Qt&&Vr(Jt)?Ot(Qt,l):null,Aa=Z?Tr(o,l)?.seoData:void 0,Be=_e?[{label:"Default",sections:[{__resolveType:p}]}]:oo(Vt?.sections,o??{}),Tt=Be.length>1,Ce=Math.min(ce,Be.length-1),nt=Be[Ce],I=nt?.sections??[],Pe=Bt(I,o),pn=!_e&&Os(Vt?.sections);if(_e&&p&&Qe!==p){dn(p);const t=I[0],a=Pe[0];if(t&&a){T(0),L(0),M([]);const s=ut(t,a,o);s&&(P(s.data),D(s.resolveType),he(null),Q(null))}}!_e&&Qe!==null&&dn(null),qe.current={rawSections:I,parsedSections:Pe,decofile:o??{},activePageKey:j,pageVariants:Be,variantIndex:Ce,sectionVariantIndex:ee,selectedSectionIndex:u};const Ma=()=>({multivariate:pn,index:Ce,variants:Be.map(t=>({rule:t.rule}))}),hn=(t,a)=>{if(!_)return;if(!j||!pn||t.length<=1){_(null);return}const s=En(j,{multivariate:!0,index:a,variants:t},o,l);_(s.length>0?s:null)},vt=(t,a,s)=>{if(!_)return;if(!j){_(null);return}const i=Ma(),f=En(j,i,o,l);if(!t||a<0){_(f.length>0?f:null);return}const y=ar({pageKey:j,page:i,sectionIndex:a,sectionLazy:Pe[a]?.isLazy??!1,mvObj:t,selectedVariantIndex:s,decofile:o,meta:l}),x=[...f,...y];_(x.length>0?x:null)},at=(t,a,s,i=u??-1,f=!1)=>{const y=Je(t,a);if(!y){P(null),D(null),he(null),Q(null),f&&vt(null,i,s);return}const C=Vn(y,tt)[s];if(!C){P(null),D(null),he(null),Q(null),f&&vt(null,i,s);return}const Y=Hs(C.value,o);P(Y?.data??null),D(Y?.resolveType??null);const{resolveType:A,formValue:O}=jt(C.rule,o,l??void 0);he(A),Q(O),f&&vt(y,i,s)};if(v!==void 0&&v!==te&&(oe(v??null),typeof v=="number")){const t=I[v],a=Pe[v];if(t&&a)if(T(v),L(0),M([]),X(s=>s+1),a.isMultivariate)at(t,a,0,v);else{const s=ut(t,a,o);s?(P(s.data),D(s.resolveType)):(P(null),D(null)),he(null),Q(null)}}const Pt={orgSlug:m,virtualMcpId:e,branch:r,previewUrl:d??void 0,siteSlug:K},Xt=pe&&l?Ot(pe,l):null,Ue=(t,a)=>{if(!j)return;const s=wt(o,j,t,Ce,Be);ye.mutate({blockKey:j,data:s},{onSuccess:()=>a?.onSuccess?.()??g?.(),onError:i=>G.error(`Save failed: ${i.message}`)})},St=()=>{T(null),P(null),D(null),L(0),Q(null),he(null),M([]),X(t=>t+1)},Ea=(t,a)=>{Gt.current&&clearTimeout(Gt.current);const s=qe.current.sectionVariantIndex;Gt.current=setTimeout(()=>{const{rawSections:i,parsedSections:f,decofile:y,activePageKey:x,pageVariants:C,variantIndex:Y}=qe.current,A=i[a];if(!A)return;const O=f[a];if(!O)return;if(O.isSavedBlock){const z=O.isLazy?A.section?.__resolveType??A.__resolveType:A.__resolveType;ye.mutate({blockKey:z,data:t},{onSuccess:()=>g?.(),onError:U=>G.error(`Save failed: ${U.message}`)});return}if(!x)return;const F={...y[x]},ge=[...i];if(O.isMultivariate){const z=Je(A,O);if(!z||!x)return;const U=rr(z,s,t);ge[a]=dt(A,O,U)}else if(O.isHidden){const z=qn(A.__resolveType),U=z?{...A.section}:{...A},Ne=Array.isArray(U.variants)?[...U.variants]:[];Ne[0]&&(Ne[0]={...Ne[0],value:t}),U.variants=Ne,z?ge[a]={...A,section:U}:ge[a]=U}else O.isLazy?ge[a]={...A,section:t}:ge[a]=t;if(C.length>1){const z=F.sections,U=[...z?.variants??[]];U[Y]&&(U[Y]={...U[Y],value:ge}),F.sections={...z,variants:U}}else F.sections=ge;ye.mutate({blockKey:x,data:F},{onSuccess:()=>g?.(),onError:z=>G.error(`Save failed: ${z.message}`)})},on)},Ka=t=>{T(t),L(0),M([]),X(f=>f+1);const a=I[t],s=Pe[t];if(!a||!s)return;if(s.isMultivariate){at(a,s,0,t);return}const i=ut(a,s,o);if(!i){P(null),D(null),he(null),Q(null),vt(null,t,0);return}P(i.data),D(i.resolveType),he(null),Q(null),vt(null,t,0)},gn=t=>{const a=t;P(a),u!==null&&Ea(a,u)},Zt=t=>{if(!j||!o||!l||!ze)return;const a={kind:"page",pageKey:j,pageName:String(ze.name??""),path:String(ze.path??"")},s=$n(o,a,l);s&&Ht.save(j,()=>{const i=xa.getQueryData(xs.decofile(ya))?.[j];if(!i||typeof i!="object"||i===null||Array.isArray(i))return null;const f={...i,...Wt.current};return Wt.current={},t?.raw!==void 0?{...f,seo:t.raw}:t?.inner!==void 0?Ar(a,s,f,t.inner):f})},$a=(t,a)=>{j&&(Wt.current[t]=a,Zt())},Oa=(t,a)=>{if(!j)return;const s=Rt([...I],t,a);u!==null&&(u===t?T(a):t<u&&a>=u?T(u-1):t>u&&a<=u&&T(u+1)),Ue(s)},Ba=t=>{if(!j)return;const a=I.filter((s,i)=>i!==t);u===t?St():u!==null&&u>t&&T(u-1),Ue(a)},La=t=>{if(!j)return;const a=I[t];if(!a)return;const s=[...I];s.splice(t+1,0,nr(a)),u!==null&&u>t&&T(u+1),Ue(s)},Fa=t=>{if(!j)return;const a=I[t],s=Pe[t];if(!a||!s||s.isMultivariate)return;const i=s.isHidden?er(a):tr(a);if(!i)return;const f=[...I];f[t]=i,u===t&&St(),Ue(f)},Ia=t=>{if(!j)return;const a=I[t],s=Pe[t];if(!a||!s||s.isMultivariate)return;const i=Zs(a);if(!i)return;const f=[...I];f[t]=i,u===t&&St(),Ue(f)},za=t=>{if(!j)return;const a=I[t],s=Pe[t];if(!a||!s?.isSavedBlock)return;const i=ut(a,s,o);if(!i?.data)return;const{name:f,...y}=i.data,x=[...I];s.isLazy?x[t]={...a,section:y}:x[t]=y,u===t&&St(),Ue(x)},Ha=t=>{if(!j)return;const a=[...I,{__resolveType:t.resolveType}],s=a.length-1;Ue(a,{onSuccess:()=>{de(!1),T(s),L(0),M([]),X(x=>x+1);const i=a[s],f=Bt(a,o)[s];if(!i||!f)return;if(f.isMultivariate){at(i,f,0);return}const y=ut(i,f,o);if(!y){P(null),D(null),he(null),Q(null);return}P(y.data),D(y.resolveType),he(null),Q(null)}})},Ua=t=>{if(u===null)return;const a=I[u],s=Pe[u];!a||!s?.isMultivariate||(L(t),M([]),X(i=>i+1),at(a,s,t,u,!0))},Ga=t=>{if(u===null||!j)return;const a=I[u],s=Pe[u];if(!a||!s?.isMultivariate)return;const i=Je(a,s);if(!i)return;const f=Js(i,t);if(!f){G.error("Cannot delete the only variant.");return}const y=[...I];y[u]=dt(a,s,f);const x=f.variants;let C=ee;t===ee?C=Math.min(t,x.length-1):t<ee&&(C=ee-1),L(C),M([]),X(Y=>Y+1),at(y[u],s,C),Ue(y)},Wa=t=>{if(u===null||!j)return;const a=I[u],s=Pe[u];if(!a||!s?.isMultivariate)return;const i=Je(a,s);if(!i)return;const f=Qs(i,t),y=[...I];y[u]=dt(a,s,f);const x=t+1;L(x),M([]),X(C=>C+1),at(y[u],s,x),Ue(y)},qa=(t,a)=>{if(u===null||!j||t===a)return;const s=I[u],i=Pe[u];if(!s||!i?.isMultivariate)return;const f=Je(s,i);if(!f)return;const y=qs(f,t,a),x=[...I];x[u]=dt(s,i,y);let C=ee;ee===t?C=a:t<ee&&a>=ee?C=ee-1:t>ee&&a<=ee&&(C=ee+1),L(C),at(x[u],i,C),Ue(x)},en=t=>{const a=t??u;if(a===null||!j)return;const s=I[a],i=Pe[a];if(!s||!i)return;const f=Us(s,i);if(!f){G.error("This section cannot have variants.");return}const y=[...I];y[a]=f.section;const x=Bt(y,o)[a];if(!x?.isMultivariate){G.error("Could not add variant.");return}T(a),L(f.newVariantIndex),M([]),X(C=>C+1),at(f.section,x,f.newVariantIndex,a),Ue(y)},Ya=()=>{if(u===null||!j)return;const t=I[u],a=Pe[u];if(!t||!a?.isMultivariate)return;const s=Je(t,a);if(!s)return;const i=Ys(t,a,s);if(!i){G.error("Could not remove variants.");return}const f=[...I];f[u]=i;const y=Bt(f,o)[u];if(!y)return;L(0),he(null),Q(null),M([]),X(C=>C+1);const x=ut(i,y,o);x?(P(x.data),D(x.resolveType)):(P(null),D(null)),vt(null,u,0),Ue(f)},Ja=async t=>{if(De===null||!j)return;const a=rn(t,o);if(a){G.error(a);return}const s=I[De],i=Pe[De];if(!s||!i)return;const f=ut(s,i,o);if(!f){G.error("This section cannot be saved as global.");return}const y={...f.data,name:t};try{await ye.mutateAsync({blockKey:t,data:y});const x=[...I];x[De]={__resolveType:t},await ye.mutateAsync({blockKey:j,data:wt(o,j,x,Ce,Be)}),u===De&&St(),ve(null),G.success(`Saved global block "${t}"`),g?.()}catch(x){G.error(x instanceof Error?x.message:"Failed to save global block")}},vn=nt?.rule;if(Tt&&u===null&&ue===null&&vn){const{resolveType:t,formValue:a}=jt(vn,o??{},l??void 0);ie(t),E(a)}const At=l?Bs(l):[],Sn=l&&o?Ls(l,o):[],Qa=!_e&&!!(d&&l&&o),xn=ue&&l?Ot(ue,l):null,Mt=()=>{ht.current&&(clearTimeout(ht.current),ht.current=null),gt.current&&(clearTimeout(gt.current),gt.current=null)},_t=async(t,a)=>{if(!(sr(a,t,l)>0))try{await Ut.mutateAsync({blockKey:t})}catch(s){G.error(s instanceof Error?s.message:"Could not delete matcher block")}},yn=t=>{ht.current&&clearTimeout(ht.current),ht.current=setTimeout(()=>{const{activePageKey:a,decofile:s,variantIndex:i}=qe.current;if(!a)return;const f={...s[a]},y={...f.sections},x=[...y.variants??[]],C=x[i],Y=C?.rule;if(xt(Y,s,l)){const A=Y?.__resolveType??"",O=s[A],F=typeof O?.name=="string"?O.name:A,{__resolveType:ge,...z}=t;ye.mutate({blockKey:A,data:yt(ge??"",z,F)},{onSuccess:()=>g?.(),onError:U=>G.error(`Save failed: ${U.message}`)});return}C&&(x[i]={...C,rule:t}),f.sections={...y,variants:x},ye.mutate({blockKey:a,data:f},{onSuccess:()=>g?.(),onError:A=>G.error(`Save failed: ${A.message}`)})},on)},Xa=t=>{ie(t);const a=t?{__resolveType:t}:{__resolveType:Kn};E({}),yn(a)},Za=t=>{const a=t;E(a);const s=ue?{__resolveType:ue,...a}:{...a};yn(s)},es=async t=>{Mt();const{activePageKey:a,decofile:s,variantIndex:i}=qe.current;if(!a)return;const f=s[a],y=f?.sections;if(!y||typeof y!="object"||Array.isArray(y))return;const x=y;if(!Array.isArray(x.variants))return;const C=[...x.variants],Y=C[i];if(!Y)return;const A=kt(Y.rule,s,l),O=Ft(t);C[i]={...Y,rule:O};const F={...s,[a]:{...f,sections:{...x,variants:C}}},{resolveType:ge,formValue:z}=jt(O,F,l??void 0);ie(ge),E(z);try{await ye.mutateAsync({blockKey:a,data:F[a]}),A&&A!==t&&await _t(A,F),g?.()}catch(U){G.error(U instanceof Error?U.message:"Could not apply saved rule")}},bn=t=>{gt.current&&clearTimeout(gt.current);const{selectedSectionIndex:a,sectionVariantIndex:s}=qe.current;a!==null&&(gt.current=setTimeout(()=>{const{rawSections:i,parsedSections:f,decofile:y,activePageKey:x,pageVariants:C,variantIndex:Y}=qe.current;if(!x)return;const A=i[a],O=f[a];if(!A||!O?.isMultivariate)return;const F=Je(A,O);if(!F)return;const z=(F.variants??[])[s]?.rule;if(xt(z,y,l)){const fe=z?.__resolveType??"",Ge=y[fe],Ze=typeof Ge?.name=="string"?Ge.name:fe,{__resolveType:rt,...et}=t;ye.mutate({blockKey:fe,data:yt(rt??"",et,Ze)},{onSuccess:()=>g?.(),onError:ot=>G.error(`Save failed: ${ot.message}`)});return}const U=Pn(F,s,t),Ne=[...i];Ne[a]=dt(A,O,U);const Ye=wt(y,x,Ne,Y,C);ye.mutate({blockKey:x,data:Ye},{onSuccess:()=>g?.(),onError:fe=>G.error(`Save failed: ${fe.message}`)})},on))},ts=t=>{he(t),Q({}),bn(t?{__resolveType:t}:{__resolveType:Kn})},ns=t=>{const a=t;Q(a);const s=Ie?{__resolveType:Ie,...a}:{...a};bn(s)},as=async t=>{Mt();const{selectedSectionIndex:a,sectionVariantIndex:s,rawSections:i,parsedSections:f,decofile:y,activePageKey:x,pageVariants:C,variantIndex:Y}=qe.current;if(a===null||!x)return;const A=i[a],O=f[a];if(!A||!O?.isMultivariate)return;const F=Je(A,O);if(!F)return;const ge=F.variants??[],z=kt(ge[s]?.rule,y,l),U=Ft(t),Ne=Pn(F,s,U),Ye=[...i];Ye[a]=dt(A,O,Ne);const fe=wt(y,x,Ye,Y,C),Ge={...y,[x]:fe},{resolveType:Ze,formValue:rt}=jt(U,Ge,l??void 0);he(Ze),Q(rt);try{await ye.mutateAsync({blockKey:x,data:fe}),z&&z!==t&&await _t(z,Ge),g?.()}catch(et){G.error(et instanceof Error?et.message:"Could not apply saved rule")}};if(!_e&&!ze)return n.jsxs("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:["No page found for ",h]});if(_e&&!qt)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:"Global block not found"});const st=u!==null?Pe[u]??null:null,_n=u!==null?I[u]:null,jn=_n&&st?.isMultivariate?Je(_n,st):null,lt=jn?Vn(jn,tt):[],tn=Math.min(ee,Math.max(lt.length-1,0)),Et=lt[tn]??null,ct=st?.isMultivariate===!0,kn=u!==null&&st!==null,Kt=kn&&(ct||!!(Xt&&se)),ss=Kt&&!_e&&st?.isSavedBlock===!0,Xe=_e||ss,rs=_e?mn:st?.label??"",wn=Ie&&l?Ot(Ie,l):null,nn=Kt&&(!_e||je.length>0)?_e?[mn,...je]:[ze.name,st.label,...ct&&Et?[Et.label]:[],...je]:[],os=Z&&ze?[ze.name,"SEO",...Me]:[],$t=Z?os:Xe?nn.length>0?nn:[rs]:nn,Rn=()=>{if(!j)return;const t=o[j],a=Gs(t.sections,I);if(!a)return;const s=Ws(a);ye.mutate({blockKey:j,data:{...t,sections:a}},{onSuccess:()=>{B(s),T(null),P(null),D(null),M([]),E(null),ie(null)},onError:i=>G.error(`Save failed: ${i.message}`)})},an=(t,a,s)=>{if(!j)return;const i=o[j],f=i.sections;if(!f||typeof f!="object"||Array.isArray(f))return;const y=f;if(!Array.isArray(y.variants))return;const x=t([...y.variants]);if(!x)return;const C=or(y,x),Y={...o,[j]:{...i,sections:C}};ye.mutate({blockKey:j,data:Y[j]},{onSuccess:()=>{a?.(),s&&_t(s,Y)},onError:A=>G.error(`Save failed: ${A.message}`)})},is=t=>{W(null),B(t),T(null),P(null),D(null),M([]);const a=Be[t]?.rule,{resolveType:s,formValue:i}=jt(a,o??{},l??void 0);ie(s),E(i),hn(Be.map(f=>({rule:f.rule})),t)},ls=(t,a)=>{if(t===a)return;let s=Ce;Ce===t?s=a:t<Ce&&a>=Ce?s=Ce-1:t>Ce&&a<=Ce&&(s=Ce+1),B(s);const i=Rt(Be.map(f=>({rule:f.rule})),t,a);hn(i,s),an(f=>Rt(f,t,a))},cs=t=>{const a=Be[t]?.rule,s=kt(a,o??{},l??void 0);an(i=>i.length<=1?null:(i.splice(t,1),i),()=>{Be.length-1===1?B(0):t<Ce?B(Ce-1):t===Ce&&B(Math.max(0,t-1)),T(null),P(null),D(null),M([]),E(null),ie(null)},s)},us=t=>{an(a=>ir(a,t),()=>{B(t+1),T(null),P(null),D(null),M([]),E(null),ie(null)})},ds=async(t,a)=>{Mt();const s=qe.current.activePageKey,i=qe.current.decofile;if(!s)return;const f=i[s],y=f.sections;if(!y||typeof y!="object"||Array.isArray(y))return;const x=y;if(!Array.isArray(x.variants))return;const C=[...x.variants],Y=C[t];if(!Y?.rule||typeof Y.rule!="object"){G.error("This variant has no matcher rule to rename.");return}const A=Y.rule,O=a.trim();Ct(!0);try{if(!O){if(!xt(A,i,l)){W(null);return}const Ye=A.__resolveType??"";C[t]={...Y,rule:An(A,i,l)};const fe={...i,[s]:{...f,sections:{...x,variants:C}}};await ye.mutateAsync({blockKey:s,data:fe[s]}),await _t(Ye,fe),W(null),g?.();return}const F=Mn(A,i,l);if(!F){G.error("Could not read this variant's matcher rule.");return}if(F.blockKey){await ye.mutateAsync({blockKey:F.blockKey,data:yt(F.resolveType,F.data,O)}),W(null),g?.();return}const ge=sn(O),z=rn(ge,i);if(z){G.error(z);return}const U=yt(F.resolveType,F.data,O);let Ne=null;try{await ye.mutateAsync({blockKey:ge,data:U}),Ne=ge,C[t]={...Y,rule:Ft(ge)},await ye.mutateAsync({blockKey:s,data:{...f,sections:{...x,variants:C}}}),Ne=null}catch(Ye){throw Ne&&await Ut.mutateAsync({blockKey:Ne}).catch(()=>{}),Ye}W(null),G.success(`Saved matcher as global block "${O}"`),g?.()}catch(F){G.error(F instanceof Error?F.message:"Failed to rename variant")}finally{Ct(!1)}},ms=async(t,a)=>{Mt();const{selectedSectionIndex:s,rawSections:i,parsedSections:f,decofile:y,activePageKey:x,pageVariants:C,variantIndex:Y}=qe.current;if(s===null||!x)return;const A=i[s],O=f[s];if(!A||!O?.isMultivariate)return;const F=Je(A,O);if(!F)return;const ge=F.variants??[],z=ge[t];if(!z?.rule||typeof z.rule!="object"){G.error("This variant has no matcher rule to rename.");return}const U=z.rule,Ne=a.trim();Ct(!0);const Ye=async fe=>{const Ge={...F,variants:fe},Ze=[...i];Ze[s]=dt(A,O,Ge);const rt=wt(y,x,Ze,Y,C);return await ye.mutateAsync({blockKey:x,data:rt}),{...y,[x]:rt}};try{if(!Ne){if(!xt(U,y,l)){ne(null);return}const ot=U.__resolveType??"",Cn=[...ge];Cn[t]={...z,rule:An(U,y,l)};const vs=await Ye(Cn);await _t(ot,vs),ne(null),g?.();return}const fe=Mn(U,y,l);if(!fe){G.error("Could not read this variant's matcher rule.");return}if(fe.blockKey){await ye.mutateAsync({blockKey:fe.blockKey,data:yt(fe.resolveType,fe.data,Ne)}),ne(null),g?.();return}const Ge=sn(Ne),Ze=rn(Ge,y);if(Ze){G.error(Ze);return}const rt=yt(fe.resolveType,fe.data,Ne);let et=null;try{await ye.mutateAsync({blockKey:Ge,data:rt}),et=Ge;const ot=[...ge];ot[t]={...z,rule:Ft(Ge)},await Ye(ot),et=null}catch(ot){throw et&&await Ut.mutateAsync({blockKey:et}).catch(()=>{}),ot}ne(null),G.success(`Saved matcher as global block "${Ne}"`),g?.()}catch(fe){G.error(fe instanceof Error?fe.message:"Failed to rename variant")}finally{Ct(!1)}},Nn=()=>{St()},fs=t=>{Te(t),Zt({inner:t})},ps=t=>{Fe(t),Zt({raw:t})},hs=()=>{Te(null),xe([])},gs=()=>me(t=>t+1),Dn=t=>{if(Z){if(t===0){Ht.flush(),we(!1),Te(null),Fe(void 0),xe([]),me(s=>s+1),V?.();return}if(t===1){xe([]),me(s=>s+1);return}xe(Me.slice(0,t-1)),me(s=>s+1);return}if(_e){M(je.slice(0,t)),X(s=>s+1);return}if(t===0){Nn();return}if(t===1){M([]),X(s=>s+1);return}if(ct&&t===2){M([]),X(s=>s+1);return}const a=ct?2:1;M(je.slice(0,t-a))};return n.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[n.jsx("div",{className:"shrink-0",children:Xe||Kt||Z?n.jsxs("div",{className:Ee("border-b px-3 py-2.5",Xe&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[n.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[$t.length>1&&n.jsx("button",{type:"button",onClick:()=>Dn($t.length-2),title:"Back","aria-label":"Back",className:Ee("shrink-0 inline-flex size-6 items-center justify-center rounded-md transition-colors",Xe?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:n.jsx(ra,{className:"size-4"})}),!_e&&Tt&&nt&&n.jsxs("button",{type:"button",onClick:Nn,title:`Editing in variant: ${nt.label}`,className:Ee("shrink-0 inline-flex items-center gap-1 rounded-md h-6 px-1.5 text-xs font-medium cursor-pointer transition-opacity hover:opacity-80",ro),children:[n.jsx(va,{rule:Nt(nt.rule,o??{},l??void 0),matchers:At}),n.jsx("span",{className:"max-w-[160px] truncate",children:nt.label})]}),n.jsx("nav",{"aria-label":"Editing breadcrumb",className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:$t.map((t,a)=>{const s=a===$t.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[a>0&&n.jsx(oa,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>Dn(a),title:t,className:Ee("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",s?Xe?"font-semibold text-global-section-fg dark:text-global-section-fg-dark":"font-medium text-foreground":Xe?"text-foreground/80":"text-muted-foreground",Xe?"hover:bg-global-section/15":"hover:bg-accent hover:text-accent-foreground"),children:t})]},`${t}-${a}`)})}),Xe&&n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(fr,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(pt,{side:"bottom",className:"max-w-[260px]",children:"A global section is a reusable block shared across your site. Editing it here updates it everywhere it's used."})]}),kn&&!ct&&!st?.isHidden&&j&&n.jsx(zn,{onClick:()=>en()})]}),Xe&&n.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:"This is a global section. Changes apply everywhere this section is used across your site."})]}):n.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx(io,{pageKey:j,initialName:ze.name,initialPath:ze.path,onFieldChange:$a})}),n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx(We,{type:"button",variant:"ghost",size:"icon","aria-label":"Edit SEO",className:"size-7 shrink-0",onClick:()=>we(!0),children:n.jsx(dr,{size:14})})}),n.jsx(pt,{side:"bottom",children:"Edit SEO"})]}),n.jsxs(mt,{children:[n.jsx(ft,{asChild:!0,children:n.jsx(We,{type:"button",variant:"ghost",size:"icon","aria-label":"View JSON",className:"size-7 shrink-0",onClick:()=>R&&j?R(j):$(!0),children:n.jsx(mr,{size:14})})}),n.jsx(pt,{side:"bottom",children:"View JSON"})]}),n.jsx(zn,{onClick:Rn})]})}),Z?n.jsx(It,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsx("div",{className:"mx-auto max-w-2xl",children:Vt&&j?n.jsx(Pr,{rawSeo:Jt,innerSeo:fn,defaultResolveType:Ta,seoSchema:Pa,activeResolveType:Qt,seoTypeOptions:Va,formResetKey:Re,siteDefaultSeo:Aa,onBreadcrumbChange:xe,onPersistRaw:ps,onInnerChange:fs,onClearForm:hs,onBumpFormKey:gs}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:"SEO schema not found for this site."})})})}):Kt?n.jsxs(It,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[ct&<.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(Fs,{listKey:`${j??""}:${u??""}`,variants:lt.map((t,a)=>({index:a,label:t.label})),selectedIndex:tn,onSelect:Ua,onRename:ne,onDuplicate:Wa,onDelete:Ga,onRemoveAll:Ya,onReorder:qa,onAdd:()=>en()}),ct&&n.jsxs("div",{className:"px-3 py-3 border-b space-y-2",children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variant rule"}),n.jsx(Tn,{currentRt:Ie??"",currentLabel:Lt(Et?.rule,o??{},tt,l??void 0),currentGlobalKey:kt(Et?.rule,o??{},l??void 0)??void 0,matchers:At,globals:Sn,onSelect:ts,onSelectGlobal:as}),wn&&ae&&n.jsx("div",{className:"pt-1",children:n.jsx(Fn,{schema:wn,value:ae,onChange:ns,meta:l??void 0,decofile:o,onSaveReferencedBlock:Dt,sandbox:Pt},`${u??"none"}:${tn}:${Ie??""}`)})]})]}),n.jsx(In,{activeSchema:Xt,formValue:se,formResetKey:Ae,onFormChange:gn,onBreadcrumbChange:M,breadcrumbPath:je,emptyMessage:"No editable fields for this variant.",meta:l,decofile:o,onSaveReferencedBlock:Dt,sandbox:Pt})]}):_e?n.jsx(It,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx(In,{activeSchema:Xt,formValue:se,formResetKey:Ae,onFormChange:gn,onBreadcrumbChange:M,breadcrumbPath:je,emptyMessage:"No editable fields for this global block.",meta:l,decofile:o,onSaveReferencedBlock:Dt,sandbox:Pt})}):n.jsxs(It,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[Tt&&j&&n.jsx(ao,{listKey:j,variants:Be,activeIndex:Ce,decofile:o??{},meta:l,matchers:At,onSelect:is,onReorder:ls,onRename:W,onDuplicate:us,onDelete:cs,onAdd:Rn}),Tt&&ue!==null&&n.jsxs("div",{className:Ee("px-3 border-b",le?"pt-3 pb-5 space-y-3":"py-2"),children:[n.jsxs("button",{type:"button",onClick:()=>ke(t=>!t),className:"flex w-full items-center justify-between gap-2 text-left cursor-pointer rounded-sm py-0.5 hover:bg-muted/40","aria-expanded":le,children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Variant rule"}),le?n.jsx(cr,{className:"size-3.5 shrink-0 text-muted-foreground"}):n.jsx(lr,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),le&&n.jsxs("div",{className:Ee("space-y-3",bt&&"pointer-events-none opacity-50"),children:[n.jsx(Tn,{currentRt:ue,currentLabel:Lt(nt?.rule,o??{},tt,l??void 0),currentGlobalKey:kt(nt?.rule,o??{},l??void 0)??void 0,matchers:At,globals:Sn,onSelect:Xa,onSelectGlobal:es}),xn&&Ve&&n.jsx("div",{className:"space-y-3",children:n.jsx(Fn,{schema:xn,value:Ve,onChange:Za,meta:l??void 0,decofile:o,onSaveReferencedBlock:Dt,sandbox:Pt},`${Ce}:${ue??""}`)})]})]}),n.jsx("div",{className:"p-2 pt-3",children:n.jsx(qr,{listKey:`${j??""}-${Ce}`,rawSections:I,sections:Pe,meta:l,selectedIndex:u,onSelect:Ka,onReorder:Oa,onDelete:Ba,onDuplicate:La,onMakeReusable:ve,onToggleHidden:Fa,onToggleLazy:Ia,onAddVariant:en,onDetach:za,onAddSection:()=>de(!0),canAddSection:Qa})})]}),n.jsx(Is,{open:De!==null,onOpenChange:t=>{t||ve(null)},defaultBlockId:De!==null?sn(Pe[De]?.label??""):"",isPending:ye.isPending,onSubmit:Ja}),d&&n.jsx(Er,{open:Se,onOpenChange:de,meta:l,decofile:o,previewBaseUrl:d,onSelect:Ha}),be&&j&&o&&n.jsx(zs,{open:be,onOpenChange:$,pageKey:j,decofile:o}),re!==null&&n.jsx(Bn,{open:!0,initialName:xt(Be[re]?.rule,o??{},l??void 0)?Lt(Be[re]?.rule,o??{},tt,l??void 0):"",autoLabel:tt(Nt(Be[re]?.rule,o??{},l??void 0)),isPending:bt,onSubmit:async t=>{await ds(re,t)},onOpenChange:t=>{!t&&!bt&&W(null)}}),q!==null&&n.jsx(Bn,{open:!0,initialName:xt(lt[q]?.rule,o??{},l??void 0)?Lt(lt[q]?.rule,o??{},tt,l??void 0):"",autoLabel:tt(Nt(lt[q]?.rule,o??{},l??void 0)),isPending:bt,onSubmit:async t=>{await ms(q,t)},onOpenChange:t=>{!t&&!bt&&ne(null)}})]})}export{sc as SectionsEditor};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as $,at as nt,c as B,j as s,H as Re,I as ae,C as oe,n as pe,J as Le,M as Pe,d as fe,K as te,t as Z,B as ee,p as J,z as ot,l as ne,m as rt,b as at,E as ct,x as dt}from"./index-
|
|
1
|
+
import{r as $,at as nt,c as B,j as s,H as Re,I as ae,C as oe,n as pe,J as Le,M as Pe,d as fe,K as te,t as Z,B as ee,p as J,z as ot,l as ne,m as rt,b as at,E as ct,x as dt}from"./index-DGQdC8j6.js";import{c as $e,e as De,d as Fe,D as ut,a as Ke,h as mt,b as ft}from"./dialog-hBUfi5DB.js";import{g as ht,b as pt,a as xt,D as gt}from"./drawer-CrQJ-4Ry.js";import{u as vt}from"./use-mobile-DVuyUrh-.js";import{S as ye,u as bt,m as jt,a as xe}from"./chat-context-CZYpc7lP.js";import{C as yt}from"./checkbox-DbEZ6b_D.js";import{I as le}from"./input-DwWe5Hqk.js";import{S as St,a as kt,b as Nt,c as Ct,d as wt}from"./select-vVirKMnE.js";import{S as X}from"./skeleton-CB7DUvyX.js";import{i as Ue,b as Be,c as _t,a as It,s as Mt}from"./Settings02-CJygIZBg.js";import{c as Ot,a as Et,i as Tt}from"./Tool01-DHJpebK1.js";import{i as At}from"./Key01-ChBXFLCM.js";import{i as We}from"./SearchMd-Di7fRkvt.js";import{b as ge,u as zt,a as Rt}from"./use-ai-providers-DuJIHuvT.js";import{g as ve}from"./ai-providers-logos-DD3qZ33J.js";import{i as Lt}from"./Monitor01-BbnHlrzQ.js";import{i as Pt}from"./AlertCircle-DBEuJvXd.js";import{u as he}from"./studio-tools-DII0jqi8.js";import{i as $t}from"./ChevronRight-L_rxCnv3.js";import{A as Dt}from"./avatar-BumqAYVV.js";import{S as Se,a as ke,b as He}from"./settings-section-CvpT3RW4.js";import{s as Ve}from"./Eye-DVo1_Pm2.js";import{a as ue,b as me,C as Ft}from"./connect-desktop-dialog-DR3AZpl6.js";import{t as Ne}from"./ChevronDown-DCZlSvzQ.js";import{a as Kt}from"./Image01-B-uMMK1I.js";import{t as Ut}from"./Stars01-BbGPjqZd.js";function ie(i,e,t){let l=t.initialDeps??[],n,o=!0;function r(){var a,c,d;let u;t.key&&((a=t.debug)!=null&&a.call(t))&&(u=Date.now());const m=i();if(!(m.length!==l.length||m.some((g,x)=>l[x]!==g)))return n;l=m;let f;if(t.key&&((c=t.debug)!=null&&c.call(t))&&(f=Date.now()),n=e(...m),t.key&&((d=t.debug)!=null&&d.call(t))){const g=Math.round((Date.now()-u)*100)/100,x=Math.round((Date.now()-f)*100)/100,j=x/16,k=(w,_)=>{for(w=String(w);w.length<_;)w=" "+w;return w};console.info(`%c⏱ ${k(x,5)} /${k(g,5)} ms`,`
|
|
2
2
|
font-size: .6rem;
|
|
3
3
|
font-weight: bold;
|
|
4
4
|
color: hsl(${Math.max(0,Math.min(120-120*j,120))}deg 100% 31%);`,t?.key)}return t?.onChange&&!(o&&t.skipInitialOnChange)&&t.onChange(n),o=!1,n}return r.updateDeps=a=>{l=a},r}function Ce(i,e){if(i===void 0)throw new Error("Unexpected undefined");return i}const Bt=(i,e)=>Math.abs(i-e)<1.01,Wt=(i,e,t)=>{let l;return function(...n){i.clearTimeout(l),l=i.setTimeout(()=>e.apply(this,n),t)}},we=i=>{const{offsetWidth:e,offsetHeight:t}=i;return{width:e,height:t}},Ht=i=>i,Vt=i=>{const e=Math.max(i.startIndex-i.overscan,0),t=Math.min(i.endIndex+i.overscan,i.count-1),l=[];for(let n=e;n<=t;n++)l.push(n);return l},qt=(i,e)=>{const t=i.scrollElement;if(!t)return;const l=i.targetWindow;if(!l)return;const n=r=>{const{width:a,height:c}=r;e({width:Math.round(a),height:Math.round(c)})};if(n(we(t)),!l.ResizeObserver)return()=>{};const o=new l.ResizeObserver(r=>{const a=()=>{const c=r[0];if(c?.borderBoxSize){const d=c.borderBoxSize[0];if(d){n({width:d.inlineSize,height:d.blockSize});return}}n(we(t))};i.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return o.observe(t,{box:"border-box"}),()=>{o.unobserve(t)}},_e={passive:!0},Ie=typeof window>"u"?!0:"onscrollend"in window,Gt=(i,e)=>{const t=i.scrollElement;if(!t)return;const l=i.targetWindow;if(!l)return;let n=0;const o=i.options.useScrollendEvent&&Ie?()=>{}:Wt(l,()=>{e(n,!1)},i.options.isScrollingResetDelay),r=u=>()=>{const{horizontal:m,isRtl:p}=i.options;n=m?t.scrollLeft*(p&&-1||1):t.scrollTop,o(),e(n,u)},a=r(!0),c=r(!1);t.addEventListener("scroll",a,_e);const d=i.options.useScrollendEvent&&Ie;return d&&t.addEventListener("scrollend",c,_e),()=>{t.removeEventListener("scroll",a),d&&t.removeEventListener("scrollend",c)}},Xt=(i,e,t)=>{if(e?.borderBoxSize){const l=e.borderBoxSize[0];if(l)return Math.round(l[t.options.horizontal?"inlineSize":"blockSize"])}return i[t.options.horizontal?"offsetWidth":"offsetHeight"]},Yt=(i,{adjustments:e=0,behavior:t},l)=>{var n,o;const r=i+e;(o=(n=l.scrollElement)==null?void 0:n.scrollTo)==null||o.call(n,{[l.options.horizontal?"left":"top"]:r,behavior:t})};class Qt{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,l,n;return((n=(l=(t=this.targetWindow)==null?void 0:t.performance)==null?void 0:l.now)==null?void 0:n.call(l))??Date.now()},this.observer=(()=>{let t=null;const l=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(n=>{n.forEach(o=>{const r=()=>{const a=o.target,c=this.indexFromElement(a);if(!a.isConnected){this.observer.unobserve(a);return}this.shouldMeasureDuringScroll(c)&&this.resizeItem(c,this.options.measureElement(a,o,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()})}));return{disconnect:()=>{var n;(n=l())==null||n.disconnect(),t=null},observe:n=>{var o;return(o=l())==null?void 0:o.observe(n,{box:"border-box"})},unobserve:n=>{var o;return(o=l())==null?void 0:o.unobserve(n)}}})(),this.range=null,this.setOptions=t=>{Object.entries(t).forEach(([l,n])=>{typeof n>"u"&&delete t[l]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Ht,rangeExtractor:Vt,onChange:()=>{},measureElement:Xt,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 l,n;(n=(l=this.options).onChange)==null||n.call(l,this,t)},this.maybeNotify=ie(()=>(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 l=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==l){if(this.cleanup(),!l){this.maybeNotify();return}this.scrollElement=l,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,l)=>{const n=new Map,o=new Map;for(let r=l-1;r>=0;r--){const a=t[r];if(n.has(a.lane))continue;const c=o.get(a.lane);if(c==null||a.end>c.end?o.set(a.lane,a):a.end<c.end&&n.set(a.lane,!0),n.size===this.options.lanes)break}return o.size===this.options.lanes?Array.from(o.values()).sort((r,a)=>r.end===a.end?r.index-a.index:r.end-a.end)[0]:void 0},this.getMeasurementOptions=ie(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(t,l,n,o,r,a,c)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:l,scrollMargin:n,getItemKey:o,enabled:r,lanes:a,laneAssignmentMode:c}),{key:!1}),this.getMeasurements=ie(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:t,paddingStart:l,scrollMargin:n,getItemKey:o,enabled:r,lanes:a,laneAssignmentMode:c},d)=>{if(!r)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>t)for(const f of this.laneAssignments.keys())f>=t&&this.laneAssignments.delete(f);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(f=>{this.itemSizeCache.set(f.key,f.size)}));const u=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===t&&(this.lanesSettling=!1);const m=this.measurementsCache.slice(0,u),p=new Array(a).fill(void 0);for(let f=0;f<u;f++){const g=m[f];g&&(p[g.lane]=f)}for(let f=u;f<t;f++){const g=o(f),x=this.laneAssignments.get(f);let j,k;const w=c==="estimate"||d.has(g);if(x!==void 0&&this.options.lanes>1){j=x;const b=p[j],N=b!==void 0?m[b]:void 0;k=N?N.end+this.options.gap:l+n}else{const b=this.options.lanes===1?m[f-1]:this.getFurthestMeasurement(m,f);k=b?b.end+this.options.gap:l+n,j=b?b.lane:f%this.options.lanes,this.options.lanes>1&&w&&this.laneAssignments.set(f,j)}const _=d.get(g),I=typeof _=="number"?_:this.options.estimateSize(f),M=k+I;m[f]={index:f,start:k,size:I,end:M,key:g,lane:j},p[j]=f}return this.measurementsCache=m,m},{key:!1,debug:()=>this.options.debug}),this.calculateRange=ie(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,l,n,o)=>this.range=t.length>0&&l>0?Jt({measurements:t,outerSize:l,scrollOffset:n,lanes:o}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=ie(()=>{let t=null,l=null;const n=this.calculateRange();return n&&(t=n.startIndex,l=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,l]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,l]},(t,l,n,o,r)=>o===null||r===null?[]:t({startIndex:o,endIndex:r,overscan:l,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=t=>{const l=this.options.indexAttribute,n=t.getAttribute(l);return n?parseInt(n,10):(console.warn(`Missing attribute name '${l}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=t=>{var l;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const n=this.scrollState.index??((l=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:l.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),a=Math.min(this.options.count-1,n+o);return t>=r&&t<=a}return!0},this.measureElement=t=>{if(!t){this.elementsCache.forEach((r,a)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(a))});return}const l=this.indexFromElement(t),n=this.options.getItemKey(l),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(l)&&this.resizeItem(l,this.options.measureElement(t,void 0,this))},this.resizeItem=(t,l)=>{var n;const o=this.measurementsCache[t];if(!o)return;const r=this.itemSizeCache.get(o.key)??o.size,a=l-r;a!==0&&(((n=this.scrollState)==null?void 0:n.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(o,a,this):o.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=a,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(o.index),this.itemSizeCache=new Map(this.itemSizeCache.set(o.key,l)),this.notify(!1))},this.getVirtualItems=ie(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,l)=>{const n=[];for(let o=0,r=t.length;o<r;o++){const a=t[o],c=l[a];n.push(c)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const l=this.getMeasurements();if(l.length!==0)return Ce(l[qe(0,l.length-1,n=>Ce(l[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,l,n=0)=>{if(!this.scrollElement)return 0;const o=this.getSize(),r=this.getScrollOffset();l==="auto"&&(l=t>=r+o?"end":"start"),l==="center"?t+=(n-o)/2:l==="end"&&(t-=o);const a=this.getMaxScrollOffset();return Math.max(Math.min(a,t),0)},this.getOffsetForIndex=(t,l="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(l==="auto")if(r.end>=o+n-this.options.scrollPaddingEnd)l="end";else if(r.start<=o+this.options.scrollPaddingStart)l="start";else return[o,l];if(l==="end"&&t===this.options.count-1)return[this.getMaxScrollOffset(),l];const a=l==="end"?r.end+this.options.scrollPaddingEnd:r.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,l,r.size),l]},this.scrollToOffset=(t,{align:l="start",behavior:n="auto"}={})=>{const o=this.getOffsetForAlignment(t,l),r=this.now();this.scrollState={index:null,align:l,behavior:n,startedAt:r,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(t,{align:l="auto",behavior:n="auto"}={})=>{t=Math.max(0,Math.min(t,this.options.count-1));const o=this.getOffsetForIndex(t,l);if(!o)return;const[r,a]=o,c=this.now();this.scrollState={index:t,align:a,behavior:n,startedAt:c,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(t,{behavior:l="auto"}={})=>{const n=this.getScrollOffset()+t,o=this.now();this.scrollState={index:null,align:"start",behavior:l,startedAt:o,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:l}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{var t;const l=this.getMeasurements();let n;if(l.length===0)n=this.options.paddingStart;else if(this.options.lanes===1)n=((t=l[l.length-1])==null?void 0:t.end)??0;else{const o=Array(this.options.lanes).fill(null);let r=l.length-1;for(;r>=0&&o.some(a=>a===null);){const a=l[r];o[a.lane]===null&&(o[a.lane]=a.end),r--}n=Math.max(...o.filter(a=>a!==null))}return Math.max(n-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(t,{adjustments:l,behavior:n})=>{this.options.scrollToFn(t,{behavior:n,adjustments:l},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 l=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,n=l?l[0]:this.scrollState.lastTargetOffset,o=1,r=n!==this.scrollState.lastTargetOffset;if(!r&&Bt(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 qe=(i,e,t,l)=>{for(;i<=e;){const n=(i+e)/2|0,o=t(n);if(o<l)i=n+1;else if(o>l)e=n-1;else return n}return i>0?i-1:0};function Jt({measurements:i,outerSize:e,scrollOffset:t,lanes:l}){const n=i.length-1,o=c=>i[c].start;if(i.length<=l)return{startIndex:0,endIndex:n};let r=qe(0,n,o,t),a=r;if(l===1)for(;a<n&&i[a].end<t+e;)a++;else if(l>1){const c=Array(l).fill(0);for(;a<n&&c.some(u=>u<t+e);){const u=i[a];c[u.lane]=u.end,a++}const d=Array(l).fill(t+e);for(;r>=0&&d.some(u=>u>=t);){const u=i[r];d[u.lane]=u.start,r--}r=Math.max(0,r-r%l),a=Math.min(n,a+(l-1-a%l))}return{startIndex:r,endIndex:a}}const Me=typeof document<"u"?$.useLayoutEffect:$.useEffect;function Zt({useFlushSync:i=!0,...e}){const t=$.useReducer(()=>({}),{})[1],l={...e,onChange:(o,r)=>{var a;i&&r?nt.flushSync(t):t(),(a=e.onChange)==null||a.call(e,o,r)}},[n]=$.useState(()=>new Qt(l));return n.setOptions(l),Me(()=>n._didMount(),[]),Me(()=>n._willUpdate()),n}function es(i){return Zt({observeElementRect:qt,observeElementOffset:Gt,scrollToFn:Yt,...i})}const ce=[{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 Oe(i){if(i)return ce.find(e=>e.id===i)}const Ee=4;function re(i){const e=B.c(8),{logo:t,name:l,description:n,onClick:o}=i;let r;e[0]!==t||e[1]!==l?(r=t?s.jsx("img",{src:t,alt:l,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):s.jsx(Dt,{fallback:l.charAt(0),className:"size-8 bg-primary/10 text-primary"}),e[0]=t,e[1]=l,e[2]=r):r=e[2];let a;return e[3]!==n||e[4]!==l||e[5]!==o||e[6]!==r?(a=s.jsx(He,{onClick:o,icon:r,title:l,description:n}),e[3]=n,e[4]=l,e[5]=o,e[6]=r,e[7]=a):a=e[7],a}function Ge(i){const e=B.c(32),{providers:t,onSelect:l,onShowAll:n}=i;let o;e[0]!==t?(o=t.find(ns),e[0]=t,e[1]=o):o=e[1];const r=o;let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a={openrouter:0,llmapi:1,anthropic:2,google:3},e[2]=a):a=e[2];const c=a;let d;if(e[3]!==l||e[4]!==t){let _;e[6]===Symbol.for("react.memo_cache_sentinel")?(_=(v,O)=>{const T=c[v.id]??Number.MAX_SAFE_INTEGER,A=c[O.id]??Number.MAX_SAFE_INTEGER;return T-A},e[6]=_):_=e[6];const I=t.filter(ls).sort(_);let M;e[7]!==t?(M=t.find(is),e[7]=t,e[8]=M):M=e[8];const b=M;let N;e[9]===Symbol.for("react.memo_cache_sentinel")?(N=ce.find(ss),e[9]=N):N=e[9];const S=N;let C;e[10]!==l?(C=v=>s.jsx(re,{logo:v.logo,name:v.name,description:v.description,onClick:()=>l({kind:"provider",provider:v})},v.id),e[10]=l,e[11]=C):C=e[11];let h,y;e[12]!==l||e[13]!==b?(h=b&&S?[s.jsx(re,{logo:S.logo,name:S.name,description:S.description,onClick:()=>l({kind:"openai-compatible",provider:b,preset:S})},S.id)]:[],y=b?[...ce.filter(ts).map(v=>s.jsx(re,{logo:v.logo,name:v.name,description:v.description,onClick:()=>l({kind:"openai-compatible",provider:b,preset:v})},v.id)),s.jsx(re,{logo:b.logo,name:"Custom OpenAI-compatible",description:"Bring your own model server (advanced)",onClick:()=>l({kind:"openai-compatible",provider:b,preset:null})},"custom")]:[],e[12]=l,e[13]=b,e[14]=h,e[15]=y):(h=e[14],y=e[15]),d=[...I.map(C),...h,...y],e[3]=l,e[4]=t,e[5]=d}else d=e[5];const u=d,m=u.length-Ee,p=!!n&&m>0;let f;e[16]!==u||e[17]!==p?(f=p?u.slice(0,Ee):u,e[16]=u,e[17]=p,e[18]=f):f=e[18];const g=f;let x;e[19]!==r||e[20]!==l?(x=r&&s.jsx(Se,{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:"Recommended — 100+ models, pay as you go"}),s.jsx(ke,{className:"relative",children:s.jsx(re,{logo:r.logo,name:r.name,description:r.description,onClick:()=>l({kind:"provider",provider:r})})})]})}),e[19]=r,e[20]=l,e[21]=x):x=e[21];let j;e[22]!==m||e[23]!==n||e[24]!==p?(j=p&&s.jsx(He,{onClick:n,title:`${m} more provider${m===1?"":"s"}`,action:s.jsx($t,{size:16,className:"text-muted-foreground"})}),e[22]=m,e[23]=n,e[24]=p,e[25]=j):j=e[25];let k;e[26]!==j||e[27]!==g?(k=s.jsx(Se,{children:s.jsxs(ke,{children:[g,j]})}),e[26]=j,e[27]=g,e[28]=k):k=e[28];let w;return e[29]!==x||e[30]!==k?(w=s.jsxs("div",{className:"flex flex-col gap-6",children:[x,k]}),e[29]=x,e[30]=k,e[31]=w):w=e[31],w}function ts(i){return i.id!=="openai"}function ss(i){return i.id==="openai"}function is(i){return i.id==="openai-compatible"}function ls(i){return i.id!=="deco"&&i.id!=="openai-compatible"}function ns(i){return i.id==="deco"}const os=Re({label:ae().optional(),apiKey:ae().min(1,"API key is required")});function rs(i){const e=B.c(59),{providerId:t,onCancel:l,onSuccess:n}=i,{org:o}=oe(),r=he(),a=pe(),[c,d]=$.useState(!1);let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u={resolver:Le(os),defaultValues:{label:"",apiKey:""}},e[0]=u):u=e[0];const{register:m,handleSubmit:p,formState:f}=Pe(u),{errors:g}=f;let x;e[1]!==t||e[2]!==r?(x=async z=>{await r.call("AI_PROVIDER_KEY_CREATE",{providerId:t,label:z.label||"Personal key",apiKey:z.apiKey})},e[1]=t,e[2]=r,e[3]=x):x=e[3];let j;e[4]!==n||e[5]!==o||e[6]!==a?(j=()=>{a.invalidateQueries({queryKey:te.aiProviderKeys(o.id)}),a.invalidateQueries({queryKey:te.aiProviders(o.id)}),Z.success("Key saved successfully"),n()},e[4]=n,e[5]=o,e[6]=a,e[7]=j):j=e[7];let k;e[8]!==x||e[9]!==j?(k={mutationFn:x,onSuccess:j,onError:as},e[8]=x,e[9]=j,e[10]=k):k=e[10];const{mutate:w,isPending:_,error:I}=fe(k);let M;e[11]!==w?(M=z=>w(z),e[11]=w,e[12]=M):M=e[12];let b;e[13]!==p||e[14]!==M?(b=p(M),e[13]=p,e[14]=M,e[15]=b):b=e[15];let N;e[16]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Label"}),e[16]=N):N=e[16];let S;e[17]!==m?(S=m("label"),e[17]=m,e[18]=S):S=e[18];let C;e[19]!==S?(C=s.jsxs("div",{className:"space-y-1",children:[N,s.jsx(le,{placeholder:"e.g. Personal key",...S,className:"h-8 text-sm"})]}),e[19]=S,e[20]=C):C=e[20];let h;e[21]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"API Key"}),e[21]=h):h=e[21];const y=c?"text":"password";let v;e[22]!==m?(v=m("apiKey"),e[22]=m,e[23]=v):v=e[23];let O;e[24]!==y||e[25]!==v?(O=s.jsx(le,{type:y,placeholder:"sk-...",...v,className:"ph-no-capture h-8 text-sm pr-8"}),e[24]=y,e[25]=v,e[26]=O):O=e[26];let T;e[27]!==c?(T=()=>d(!c),e[27]=c,e[28]=T):T=e[28];let A;e[29]!==c?(A=c?s.jsx(Ue,{size:14}):s.jsx(Ve,{size:14}),e[29]=c,e[30]=A):A=e[30];let E;e[31]!==T||e[32]!==A?(E=s.jsx("button",{type:"button",onClick:T,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:A}),e[31]=T,e[32]=A,e[33]=E):E=e[33];let L;e[34]!==O||e[35]!==E?(L=s.jsxs("div",{className:"relative",children:[O,E]}),e[34]=O,e[35]=E,e[36]=L):L=e[36];let R;e[37]!==g.apiKey?(R=g.apiKey&&s.jsx("p",{className:"text-xs text-destructive",children:g.apiKey.message}),e[37]=g.apiKey,e[38]=R):R=e[38];let P;e[39]!==L||e[40]!==R?(P=s.jsxs("div",{className:"space-y-1",children:[h,L,R]}),e[39]=L,e[40]=R,e[41]=P):P=e[41];let D;e[42]!==I?(D=I&&s.jsx("p",{className:"text-xs text-destructive",children:I.message}),e[42]=I,e[43]=D):D=e[43];let F;e[44]!==_||e[45]!==l?(F=s.jsx(ee,{type:"button",variant:"ghost",size:"sm",onClick:l,disabled:_,children:"Cancel"}),e[44]=_,e[45]=l,e[46]=F):F=e[46];const W=_?"Saving...":"Save Key";let H;e[47]!==_||e[48]!==W?(H=s.jsx(ee,{type:"submit",size:"sm",disabled:_,children:W}),e[47]=_,e[48]=W,e[49]=H):H=e[49];let K;e[50]!==F||e[51]!==H?(K=s.jsxs($e,{children:[F,H]}),e[50]=F,e[51]=H,e[52]=K):K=e[52];let V;return e[53]!==C||e[54]!==P||e[55]!==D||e[56]!==K||e[57]!==b?(V=s.jsxs("form",{onSubmit:b,className:"space-y-3",children:[C,P,D,K]}),e[53]=C,e[54]=P,e[55]=D,e[56]=K,e[57]=b,e[58]=V):V=e[58],V}function as(i){Z.error(`Failed to save key: ${i.message}`)}const cs=Re({label:ae().optional(),baseUrl:ae().min(1,"Base URL is required"),apiKey:ae().optional()});function ds(i){const e=B.c(70),{preset:t,onCancel:l,onSuccess:n}=i,{org:o}=oe(),r=he(),a=pe(),[c,d]=$.useState(!1);let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=Le(cs),e[0]=u):u=e[0];const m=t?.defaultBaseUrl??"";let p;e[1]!==m?(p={resolver:u,defaultValues:{label:"",baseUrl:m,apiKey:""}},e[1]=m,e[2]=p):p=e[2];const{register:f,handleSubmit:g,formState:x}=Pe(p),{errors:j}=x;let k;e[3]!==t||e[4]!==r?(k=async se=>{const lt=JSON.stringify({baseUrl:se.baseUrl,apiKey:se.apiKey||""});await r.call("AI_PROVIDER_KEY_CREATE",{providerId:"openai-compatible",label:se.label||t?.name||se.baseUrl,apiKey:lt,...t?{presetId:t.id}:{}})},e[3]=t,e[4]=r,e[5]=k):k=e[5];let w;e[6]!==n||e[7]!==o||e[8]!==a?(w=()=>{a.invalidateQueries({queryKey:te.aiProviderKeys(o.id)}),a.invalidateQueries({queryKey:te.aiProviders(o.id)}),Z.success("Connection saved successfully"),n()},e[6]=n,e[7]=o,e[8]=a,e[9]=w):w=e[9];let _;e[10]!==k||e[11]!==w?(_={mutationFn:k,onSuccess:w,onError:us},e[10]=k,e[11]=w,e[12]=_):_=e[12];const{mutate:I,isPending:M,error:b}=fe(_),N=t?`e.g. ${t.name} prod, ${t.name} dev`:"e.g. My OpenAI-compatible server",S=t?.baseUrlPlaceholder??"http://localhost:4000/v1";let C;e[13]!==I?(C=se=>I(se),e[13]=I,e[14]=C):C=e[14];let h;e[15]!==g||e[16]!==C?(h=g(C),e[15]=g,e[16]=C,e[17]=h):h=e[17];let y;e[18]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Label"}),e[18]=y):y=e[18];let v;e[19]!==f?(v=f("label"),e[19]=f,e[20]=v):v=e[20];let O;e[21]!==N||e[22]!==v?(O=s.jsxs("div",{className:"space-y-1",children:[y,s.jsx(le,{placeholder:N,...v,className:"h-8 text-sm"})]}),e[21]=N,e[22]=v,e[23]=O):O=e[23];let T;e[24]!==S||e[25]!==j||e[26]!==t?.defaultBaseUrl||e[27]!==f?(T=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:"Base URL"}),s.jsx(le,{type:"url",placeholder:S,...f("baseUrl"),className:"h-8 text-sm"}),j.baseUrl&&s.jsx("p",{className:"text-xs text-destructive",children:j.baseUrl.message})]}),e[24]=S,e[25]=j,e[26]=t?.defaultBaseUrl,e[27]=f,e[28]=T):T=e[28];const A=t?.apiKeyRecommended?"recommended":"optional";let E;e[29]!==A?(E=s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["API Key"," ",s.jsxs("span",{className:"text-muted-foreground/60",children:["(",A,")"]})]}),e[29]=A,e[30]=E):E=e[30];const L=c?"text":"password";let R;e[31]!==f?(R=f("apiKey"),e[31]=f,e[32]=R):R=e[32];let P;e[33]!==L||e[34]!==R?(P=s.jsx(le,{type:L,placeholder:"sk-...",...R,className:"ph-no-capture h-8 text-sm pr-8"}),e[33]=L,e[34]=R,e[35]=P):P=e[35];let D;e[36]!==c?(D=()=>d(!c),e[36]=c,e[37]=D):D=e[37];let F;e[38]!==c?(F=c?s.jsx(Ue,{size:14}):s.jsx(Ve,{size:14}),e[38]=c,e[39]=F):F=e[39];let W;e[40]!==D||e[41]!==F?(W=s.jsx("button",{type:"button",onClick:D,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:F}),e[40]=D,e[41]=F,e[42]=W):W=e[42];let H;e[43]!==P||e[44]!==W?(H=s.jsxs("div",{className:"relative",children:[P,W]}),e[43]=P,e[44]=W,e[45]=H):H=e[45];let K;e[46]!==E||e[47]!==H?(K=s.jsxs("div",{className:"space-y-1",children:[E,H]}),e[46]=E,e[47]=H,e[48]=K):K=e[48];let V;e[49]!==t?(V=t?.helpText&&s.jsx("p",{className:"text-xs text-muted-foreground",children:t.helpText}),e[49]=t,e[50]=V):V=e[50];let z;e[51]!==b?(z=b&&s.jsx("p",{className:"text-xs text-destructive",children:b.message}),e[51]=b,e[52]=z):z=e[52];let Y;e[53]!==M||e[54]!==l?(Y=s.jsx(ee,{type:"button",variant:"ghost",size:"sm",onClick:l,disabled:M,children:"Cancel"}),e[53]=M,e[54]=l,e[55]=Y):Y=e[55];const Q=M?"Saving...":"Save Connection";let q;e[56]!==M||e[57]!==Q?(q=s.jsx(ee,{type:"submit",size:"sm",disabled:M,children:Q}),e[56]=M,e[57]=Q,e[58]=q):q=e[58];let G;e[59]!==Y||e[60]!==q?(G=s.jsxs($e,{children:[Y,q]}),e[59]=Y,e[60]=q,e[61]=G):G=e[61];let U;return e[62]!==O||e[63]!==T||e[64]!==K||e[65]!==V||e[66]!==z||e[67]!==G||e[68]!==h?(U=s.jsxs("form",{onSubmit:h,className:"space-y-3",children:[O,T,K,V,z,G]}),e[62]=O,e[63]=T,e[64]=K,e[65]=V,e[66]=z,e[67]=G,e[68]=h,e[69]=U):U=e[69],U}function us(i){Z.error(`Failed to save connection: ${i.message}`)}const ms={kind:"closed"};function fs(i,e){switch(e.type){case"open":return i.kind==="closed"?{kind:"grid"}:i;case"close":return{kind:"closed"};case"back":switch(i.kind){case"form":case"oauth-pending":case"provision-pending":case"provision-error":return{kind:"grid"};default:return i}case"select-form":return i.kind!=="grid"?i:{kind:"form",providerId:e.providerId,presetId:e.presetId};case"select-oauth":return i.kind!=="grid"?i:{kind:"oauth-pending",providerId:e.providerId,stateToken:e.stateToken};case"oauth-failed":return i.kind==="oauth-pending"?{kind:"grid"}:i;case"select-provision":return i.kind!=="grid"?i:{kind:"provision-pending",providerId:e.providerId};case"provision-error":return i.kind!=="provision-pending"?i:{kind:"provision-error",providerId:i.providerId,error:e.error};case"retry-provision":return i.kind!=="provision-error"?i:{kind:"provision-pending",providerId:i.providerId}}}function hs(i){switch(i.kind){case"form":case"oauth-pending":case"provision-pending":case"provision-error":return i.providerId;default:return null}}function ps({open:i,onOpenChange:e,initialProvider:t}){const n=ge()?.providers??[],{org:o}=oe(),r=he(),a=pe(),[c,d]=$.useReducer(fs,ms),u=$.useRef(!1);$.useEffect(()=>{i&&c.kind==="closed"?d({type:"open"}):!i&&c.kind!=="closed"&&d({type:"close"})},[i,c.kind]);const m=()=>{u.current=!1,d({type:"close"}),e(!1)},p=()=>{a.invalidateQueries({queryKey:te.aiProviderKeys(o.id)}),a.invalidateQueries({queryKey:te.aiProviders(o.id)})},{mutate:f}=fe({mutationFn:async({providerId:h,code:y,stateToken:v,label:O})=>(await r.call("AI_PROVIDER_OAUTH_EXCHANGE",{providerId:h,code:y,stateToken:v,label:O}),h),onSuccess:h=>{J("ai_provider_oauth_succeeded",{provider_id:h}),p();const y=n.find(v=>v.id===h);Z.success(`${y?.name??"Provider"} connected successfully`),m()},onError:(h,y)=>{J("ai_provider_oauth_failed",{provider_id:y.providerId,error:h.message}),Z.error(`OAuth connection failed: ${h.message}`),d({type:"oauth-failed"})}}),{mutate:g}=fe({mutationFn:async h=>(await r.call("AI_PROVIDER_PROVISION_KEY",{providerId:h}),h),onSuccess:h=>{J("ai_provider_provision_succeeded",{provider_id:h}),p();const y=n.find(v=>v.id===h);Z.success(`${y?.name??"Provider"} connected successfully`),m()},onError:(h,y)=>{J("ai_provider_provision_failed",{provider_id:y,error:h.message}),d({type:"provision-error",error:h.message})}}),x=async h=>{const{provider:y}=h,v=h.kind==="openai-compatible"?h.preset?.id??null:null,O=y.supportedMethods.includes("oauth-pkce"),T=y.supportedMethods.includes("api-key");if(y.supportsProvision===!0){J("ai_provider_connect_clicked",{provider_id:y.id,method:"provision"}),d({type:"select-provision",providerId:y.id}),g(y.id);return}if(O){J("ai_provider_connect_clicked",{provider_id:y.id,method:"oauth-pkce"});try{const E=await r.call("AI_PROVIDER_OAUTH_URL",{providerId:y.id,callbackUrl:`${window.location.origin}/oauth/callback/ai-provider`});if(!E?.url)throw new Error("Invalid response from AI_PROVIDER_OAUTH_URL");d({type:"select-oauth",providerId:y.id,stateToken:E.stateToken}),window.open(E.url,"AiProviderOAuth","width=600,height=700")}catch(E){Z.error(`Failed to start OAuth: ${E instanceof Error?E.message:String(E)}`)}return}T&&(J("ai_provider_connect_clicked",{provider_id:y.id,...v!==null?{preset_id:v}:{},method:"api-key"}),d({type:"select-form",providerId:y.id,presetId:v}))},j=$.useRef(x);j.current=x;const k=$.useRef(t);k.current=t,$.useEffect(()=>{!k.current||c.kind!=="grid"||u.current||(u.current=!0,j.current(k.current))},[c.kind]);const w=c.kind==="oauth-pending"?c.stateToken:null,_=c.kind==="oauth-pending"?c.providerId:null;$.useEffect(()=>{if(c.kind!=="oauth-pending")return;let h=!1;const y=c.stateToken,v=c.providerId,O=A=>{if(A.origin!==window.location.origin||A.data?.type!=="AI_PROVIDER_OAUTH_CALLBACK")return;const{code:E,stateToken:L}=A.data;if(L!==y){Z.error("Security check failed: State token mismatch"),d({type:"oauth-failed"});return}h=!0;const R=n.find(P=>P.id===v);f({providerId:v,code:E,stateToken:y,label:R?.name??v})};window.addEventListener("message",O);const T=setTimeout(()=>{h||(J("ai_provider_oauth_timeout",{provider_id:v}),d({type:"oauth-failed"}),Z.error("Connection timed out"))},12e4);return()=>{window.removeEventListener("message",O),clearTimeout(T)}},[c.kind,w,_,f]);const I=hs(c),M=I?n.find(h=>h.id===I):null,N=(c.kind==="form"&&c.presetId?ce.find(h=>h.id===c.presetId):null)?.name??M?.name??"Connect an AI provider",S=c.kind!=="grid"&&c.kind!=="closed",C=()=>{t?m():d({type:"back"})};return s.jsx(De,{open:c.kind!=="closed",onOpenChange:h=>!h&&m(),children:s.jsxs(Fe,{className:"sm:max-w-md max-h-[90vh] overflow-y-auto",children:[s.jsxs(ut,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[S&&s.jsx(ee,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:C,children:s.jsx(Be,{size:16})}),s.jsx(Ke,{children:N})]}),c.kind==="grid"&&!t&&s.jsx(mt,{children:"Pick a provider — we'll handle the rest."})]}),c.kind==="grid"&&!t&&s.jsx(Ge,{providers:n,onSelect:x}),c.kind==="form"&&(c.providerId==="openai-compatible"?s.jsx(ds,{preset:c.presetId?ce.find(h=>h.id===c.presetId):void 0,onCancel:()=>d({type:"back"}),onSuccess:()=>{p(),m()}}):s.jsx(rs,{providerId:c.providerId,onCancel:()=>d({type:"back"}),onSuccess:()=>{p(),m()}})),c.kind==="oauth-pending"&&s.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[s.jsx(ye,{size:"lg"}),s.jsx("p",{className:"text-sm text-muted-foreground text-center",children:"Authorize the connection in the popup window. This dialog will close once authorization completes."})]}),c.kind==="provision-pending"&&s.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[s.jsx(ye,{size:"lg"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Connecting…"})]}),c.kind==="provision-error"&&s.jsxs("div",{className:"flex flex-col items-center gap-4 py-6",children:[s.jsx(Pt,{size:28,className:"text-destructive"}),s.jsx("p",{className:"text-sm text-foreground text-center",children:c.error}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(ee,{variant:"outline",size:"sm",onClick:()=>d({type:"back"}),children:"Back"}),s.jsx(ee,{size:"sm",onClick:()=>{d({type:"retry-provision"}),g(c.providerId)},children:"Retry"})]})]})]})})}function xs(){const i=B.c(7),{org:e}=oe(),t=he();let l;i[0]!==e.id?(l=te.defaultBrand(e.id),i[0]=e.id,i[1]=l):l=i[1];let n;i[2]!==t?(n=async()=>{const{items:a}=await t.call("BRAND_CONTEXT_LIST",{});return(Array.isArray(a)?a:[]).find(gs)??null},i[2]=t,i[3]=n):n=i[3];let o;i[4]!==l||i[5]!==n?(o={queryKey:l,queryFn:n},i[4]=l,i[5]=n,i[6]=o):o=i[6];const{data:r}=rt(o);return r??null}function gs(i){return i.isDefault&&!i.archivedAt}function vs(i){const e=i.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)),l=t?t.value:e[0]?.value;return typeof l=="string"?l:null}if(typeof e=="object"){const t=e;return t.primary??Object.values(t)[0]??null}return null}function bs(i){const e=B.c(50);let t;e[0]!==i?(t=i===void 0?{}:i,e[0]=i,e[1]=t):t=e[1];const{title:l,description:n,onLocalRuntimePicked:o}=t,{org:r}=oe(),{localMode:a}=ot(),c=xs(),d=bt(),u=jt(),[m,p]=$.useState(null),[f,g]=$.useState(!1),[x,j]=$.useState(!1),k=ge();let w;e[2]!==k?.providers?(w=k?.providers??[],e[2]=k?.providers,e[3]=w):w=e[3];const _=w;let I;if(e[4]!==d.capabilities||e[5]!==d.online){if(I=[],d.online){if(d.capabilities.includes("claude-code")){let U;e[7]===Symbol.for("react.memo_cache_sentinel")?(U={option:"claude-code-desktop",label:"Claude Code",icon:s.jsx(ue,{size:16})},e[7]=U):U=e[7],I.push(U)}if(d.capabilities.includes("codex")){let U;e[8]===Symbol.for("react.memo_cache_sentinel")?(U={option:"codex-desktop",label:"Codex",icon:s.jsx(me,{size:16})},e[8]=U):U=e[8],I.push(U)}}e[4]=d.capabilities,e[5]=d.online,e[6]=I}else I=e[6];const M=I.length>0&&u!==null,b=r.name;let N;e[9]!==c?(N=c?vs(c):null,e[9]=c,e[10]=N):N=e[10];const S=N,C=c?.favicon??c?.logo??null,h=l??(b?`${b} is ready for agents`:"Your agents are almost ready"),y=n??(M?"Your desktop is linked — start now with a local coding agent, or connect a cloud provider for hosted models.":a?"Connect a provider, or run `bunx decocms@latest link` on your desktop for Claude Code, Codex, and local files.":"Connect a provider — or run `bunx decocms@latest link` on your desktop to use Claude Code, Codex, or your local files."),v=!!(C||S);let O;e[11]!==S?(O=S?{backgroundColor:`${S}18`,borderColor:`${S}30`}:void 0,e[11]=S,e[12]=O):O=e[12];const T=O,A=v?"flex items-center justify-center size-14 rounded-2xl border":"flex items-center justify-center size-14 rounded-2xl bg-muted border border-border";let E;e[13]!==A||e[14]!==T||e[15]!==C||e[16]!==d.online||e[17]!==S?(E=C?s.jsx("div",{className:A,style:T,children:s.jsx("img",{src:C,alt:"",className:"size-7 rounded object-contain"})}):s.jsx("button",{type:"button",onClick:()=>j(!0),"aria-label":d.online?"Desktop linked":"Connect your desktop",className:ne(A,"cursor-pointer transition-colors hover:bg-accent"),style:T,children:s.jsxs("span",{className:"relative inline-flex items-center justify-center",children:[s.jsx(Lt,{size:24,style:S?{color:S}:void 0,className:ne(!S&&"text-muted-foreground")}),d.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[13]=A,e[14]=T,e[15]=C,e[16]=d.online,e[17]=S,e[18]=E):E=e[18];let L;e[19]!==h?(L=s.jsx("p",{className:"text-xl font-semibold text-foreground tracking-tight",children:h}),e[19]=h,e[20]=L):L=e[20];let R;e[21]!==y?(R=s.jsx("p",{className:"text-sm text-muted-foreground max-w-md",children:y}),e[21]=y,e[22]=R):R=e[22];let P;e[23]!==L||e[24]!==R?(P=s.jsxs("div",{className:"space-y-2",children:[L,R]}),e[23]=L,e[24]=R,e[25]=P):P=e[25];let D;e[26]!==E||e[27]!==P?(D=s.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[E,P]}),e[26]=E,e[27]=P,e[28]=D):D=e[28];let F;e[29]!==u||e[30]!==M||e[31]!==I||e[32]!==o?(F=M&&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:I.map(U=>s.jsxs(ee,{variant:"default",className:"gap-2",onClick:()=>{u?.setPendingAgentOption(U.option),o?.(U.option)},children:[U.icon,"Use ",U.label]},U.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"}),"or connect a cloud provider",s.jsx("span",{className:"h-px flex-1 bg-border"})]})]}),e[29]=u,e[30]=M,e[31]=I,e[32]=o,e[33]=F):F=e[33];let W,H;e[34]===Symbol.for("react.memo_cache_sentinel")?(W=U=>p(U),H=()=>g(!0),e[34]=W,e[35]=H):(W=e[34],H=e[35]);let K;e[36]!==_?(K=s.jsx("div",{className:"w-full",children:s.jsx(Ge,{providers:_,onSelect:W,onShowAll:H})}),e[36]=_,e[37]=K):K=e[37];const V=m!==null||f;let z;e[38]===Symbol.for("react.memo_cache_sentinel")?(z=U=>{U||(p(null),g(!1))},e[38]=z):z=e[38];const Y=m??void 0;let Q;e[39]!==V||e[40]!==Y?(Q=s.jsx(ps,{open:V,onOpenChange:z,initialProvider:Y}),e[39]=V,e[40]=Y,e[41]=Q):Q=e[41];let q;e[42]!==x?(q=s.jsx(Ft,{open:x,onOpenChange:j}),e[42]=x,e[43]=q):q=e[43];let G;return e[44]!==F||e[45]!==K||e[46]!==Q||e[47]!==q||e[48]!==D?(G=s.jsxs("div",{className:"flex flex-col items-center gap-8 w-full max-w-3xl px-4",children:[D,F,K,Q,q]}),e[44]=F,e[45]=K,e[46]=Q,e[47]=q,e[48]=D,e[49]=G):G=e[49],G}function be(i){const e=i.title.includes(": ");return{provider:e?i.title.split(": ")[0]??"":i.modelId.split("/")[0]??"",displayName:e?i.title.split(": ").slice(1).join(": "):i.title}}function js(i){return i<32e3?{level:1,label:"Small",description:"Short conversations"}:i<2e5?{level:2,label:"Medium",description:"Good for most tasks"}:i<5e5?{level:3,label:"Large",description:"Long projects & research"}:{level:4,label:"Very large",description:"Massive files & data"}}const ys=["bg-destructive","bg-warning","bg-success","bg-success"],Ss=["text-success","text-warning","text-warning","text-destructive"];function ks(i){const e=Math.round(i*.75/1e3);return e>=1?`~${e}K words`:`~${Math.round(i*.75)} words`}function Ns(i){return i<1?{level:1,label:"Cheap"}:i<5?{level:2,label:"Moderate"}:i<15?{level:3,label:"High"}:{level:4,label:"Expensive"}}const Cs={text:{icon:s.jsx(Et,{className:"size-3.5"}),label:"Text"},vision:{icon:s.jsx(Kt,{className:"size-3.5"}),label:"Vision"},image:{icon:s.jsx(_t,{className:"size-3.5"}),label:"Image"},tools:{icon:s.jsx(Ot,{className:"size-3.5"}),label:"Tools"},reasoning:{icon:s.jsx(Ut,{className:"size-3.5"}),label:"Reasoning"},"web-search":{icon:s.jsx(We,{className:"size-3.5"}),label:"Web search"}};function ws(i){const e=B.c(5),{capability:t}=i;let l;e[0]!==t?(l=Cs[t]??{icon:null,label:t.charAt(0).toUpperCase()+t.slice(1)},e[0]=t,e[1]=l):l=e[1];const n=l;let o;return e[2]!==n.icon||e[3]!==n.label?(o=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:[n.icon,n.label]}),e[2]=n.icon,e[3]=n.label,e[4]=o):o=e[4],o}function _s(i){const e=B.c(49),{model:t,compact:l}=i,n=l===void 0?!1:l;if(!t){let b;return e[0]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:"Hover to preview"}),e[0]=b):b=e[0],b}const o=t.costs?.input!=null?t.costs.input*1e6:null,r=t.costs?.output!=null?t.costs.output*1e6:null;let a;e[1]!==t?(a=be(t),e[1]=t,e[2]=a):a=e[2];const{provider:c,displayName:d}=a;if(n){let b;e[3]!==t.limits?(b=t.limits?.contextWindow&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Context"}),s.jsxs("span",{className:"text-foreground font-medium",children:[t.limits.contextWindow.toLocaleString()," tokens"]})]}),e[3]=t.limits,e[4]=b):b=e[4];let N;e[5]!==o?(N=o!=null&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Input"}),s.jsxs("span",{className:"text-foreground font-medium",children:["$",o.toFixed(2)," / 1M"]})]}),e[5]=o,e[6]=N):N=e[6];let S;e[7]!==r?(S=r!=null&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Output"}),s.jsxs("span",{className:"text-foreground font-medium",children:["$",r.toFixed(2)," / 1M"]})]}),e[7]=r,e[8]=S):S=e[8];let C;e[9]!==t.limits?(C=t.limits?.maxOutputTokens&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Output limit"}),s.jsxs("span",{className:"text-foreground font-medium",children:[t.limits.maxOutputTokens.toLocaleString()," tokens"]})]}),e[9]=t.limits,e[10]=C):C=e[10];let h;return e[11]!==b||e[12]!==N||e[13]!==S||e[14]!==C?(h=s.jsxs("div",{className:"flex flex-col gap-2 pt-3 pb-3 px-3 text-xs",children:[b,N,S,C]}),e[11]=b,e[12]=N,e[13]=S,e[14]=C,e[15]=h):h=e[15],h}let u;e[16]!==c?(u=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:c}),e[16]=c,e[17]=u):u=e[17];let m;e[18]!==t.logo||e[19]!==t.title?(m=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[18]=t.logo,e[19]=t.title,e[20]=m):m=e[20];let p;e[21]!==d?(p=s.jsx("p",{className:"text-lg font-semibold leading-snug tracking-tight",children:d}),e[21]=d,e[22]=p):p=e[22];let f;e[23]!==m||e[24]!==p?(f=s.jsxs("div",{className:"flex items-center gap-2.5",children:[m,p]}),e[23]=m,e[24]=p,e[25]=f):f=e[25];let g;e[26]!==t.modelId?(g=s.jsx("p",{className:"text-xs text-muted-foreground/50 font-mono",children:t.modelId}),e[26]=t.modelId,e[27]=g):g=e[27];let x;e[28]!==u||e[29]!==f||e[30]!==g?(x=s.jsxs("div",{className:"flex flex-col gap-1 pt-1 pr-6",children:[u,f,g]}),e[28]=u,e[29]=f,e[30]=g,e[31]=x):x=e[31];let j;e[32]!==t.capabilities?(j=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(Is)}),e[32]=t.capabilities,e[33]=j):j=e[33];let k;e[34]!==t.limits?(k=t.limits?.contextWindow&&(()=>{const{level:b,label:N,description:S}=js(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:"Context window"}),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(C=>s.jsx("div",{className:ne("w-2 h-2 rounded-full",C<=b?ys[b-1]:"bg-muted")},C))}),s.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:N}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:["— ",S]})]}),s.jsxs("span",{className:"text-sm text-muted-foreground",children:[t.limits.contextWindow.toLocaleString()," tokens"]})]})})(),e[34]=t.limits,e[35]=k):k=e[35];let w;e[36]!==t.limits?(w=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:"Output limit"}),s.jsxs("div",{className:"flex items-baseline gap-2",children:[s.jsxs("span",{className:"text-sm text-foreground",children:[t.limits.maxOutputTokens.toLocaleString()," tokens"]}),s.jsx("span",{className:"text-sm text-muted-foreground",children:ks(t.limits.maxOutputTokens)})]})]}),e[36]=t.limits,e[37]=w):w=e[37];let _;e[38]!==o||e[39]!==r?(_=(o!=null||r!=null)&&(()=>{const{level:b,label:N}=o!=null?Ns(o):{level:0,label:""};return s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Pricing"}),o!=null&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex items-center",children:[1,2,3,4].map(S=>s.jsx("span",{className:ne("text-sm font-bold leading-none",S<=b?Ss[b-1]:"text-muted-foreground/20"),children:"$"},S))}),s.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:N})]}),s.jsxs("div",{className:"flex flex-col gap-1",children:[o!=null&&s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"Input"}),s.jsxs("span",{className:"text-xs text-foreground",children:["$",o.toFixed(2)," / 1M tokens"]})]}),r!=null&&s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"Output"}),s.jsxs("span",{className:"text-xs text-foreground",children:["$",r.toFixed(2)," / 1M tokens"]})]})]})]})})(),e[38]=o,e[39]=r,e[40]=_):_=e[40];let I;e[41]!==k||e[42]!==w||e[43]!==_?(I=s.jsxs("div",{className:"flex flex-col gap-6",children:[k,w,_]}),e[41]=k,e[42]=w,e[43]=_,e[44]=I):I=e[44];let M;return e[45]!==I||e[46]!==x||e[47]!==j?(M=s.jsxs("div",{className:"flex flex-col gap-5 py-1 px-1.5",children:[x,j,I]}),e[45]=I,e[46]=x,e[47]=j,e[48]=M):M=e[48],M}function Is(i){return s.jsx(ws,{capability:i},i)}function Xe(i){const e=B.c(19),{model:t,placeholder:l,isLoading:n}=i,o=l===void 0?"Select model":l;if(n===void 0?!1:n){let x;return e[0]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(X,{className:"w-5 h-5 rounded-sm shrink-0"}),s.jsx(X,{className:"w-16 h-3 hidden md:block"})]}),e[0]=x):x=e[0],x}if(!t){let x;e[1]!==o?(x=s.jsx("span",{className:"text-sm text-muted-foreground",children:o}),e[1]=o,e[2]=x):x=e[2];let j;e[3]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Ne,{size:14,className:"text-muted-foreground opacity-50 shrink-0"}),e[3]=j):j=e[3];let k;return e[4]!==x?(k=s.jsxs("div",{className:"flex items-center gap-1.5",children:[x,j]}),e[4]=x,e[5]=k):k=e[5],k}let a;e[6]!==t?(a=be(t),e[6]=t,e[7]=a):a=e[7];const{displayName:c}=a;let d;e[8]!==t?(d=ve(t),e[8]=t,e[9]=d):d=e[9];const u=d;let m;e[10]!==t.title||e[11]!==u?(m=s.jsx("img",{src:u,className:"w-3.5 h-3.5 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[10]=t.title,e[11]=u,e[12]=m):m=e[12];let p;e[13]!==c?(p=s.jsx("span",{className:"text-sm truncate whitespace-nowrap text-muted-foreground max-w-[100px] sm:max-w-none",children:c}),e[13]=c,e[14]=p):p=e[14];let f;e[15]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(Ne,{size:14,className:"text-muted-foreground opacity-50 shrink-0"}),e[15]=f):f=e[15];let g;return e[16]!==m||e[17]!==p?(g=s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0 overflow-hidden",children:[m,p,f]}),e[16]=m,e[17]=p,e[18]=g):g=e[18],g}const Ms=["vision","image","file","audio","video"],Ye=["image/png","image/jpeg","image/gif","image/webp"],Qe=["application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"];function je(i){const e=i?.capabilities;return e?Ms.some(t=>e.includes(t)):!1}function Di(i,e){if(!i)return!1;if(i.startsWith("text/"))return!0;const t=e?.capabilities??[],l=t.includes("vision")||t.includes("image"),n=t.includes("file"),o=t.includes("audio"),r=t.includes("video");return!!(l&&Ye.includes(i)||n&&i==="application/pdf"||o&&i.startsWith("audio/")||r&&i.startsWith("video/")||je(e)&&Qe.includes(i))}function Fi(i){const e=i?.capabilities??[],t=["text/*"];return(e.includes("vision")||e.includes("image"))&&t.push(...Ye),e.includes("file")&&t.push("application/pdf"),e.includes("audio")&&t.push("audio/*"),e.includes("video")&&t.push("video/*"),je(i)&&t.push(...Qe),t.join(",")}function Ki(i){const e=i?.capabilities??[],t=[];return(e.includes("vision")||e.includes("image"))&&t.push("images"),e.includes("file")&&t.push("PDFs"),e.includes("audio")&&t.push("audio"),e.includes("video")&&t.push("video"),je(i)&&t.push("Office files"),t.length===0?"text only":t.length===1?t[0]:t.length===2?`${t[0]} and ${t[1]}`:`${t.slice(0,-1).join(", ")}, and ${t.at(-1)}`}const Je=["smarter","faster","cheaper"],Ze={smarter:"Smarter",faster:"Faster",cheaper:"Cheaper"},Os=[{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"]}],Es=Os.flatMap(({tier:i,prefixes:e})=>e.map(t=>({tier:i,prefix:t}))).sort((i,e)=>e.prefix.length-i.prefix.length),Ts="google/gemini-2.5-pro",Te=new Map;function As(i){const e=Te.get(i);if(e!==void 0)return e;let t=null;if(i.endsWith(":free"))t="cheaper";else for(const{tier:l,prefix:n}of Es)if(i.startsWith(n)){if(n===Ts&&i.length>n.length&&i[n.length]==="-"){const r=i[n.length+1];if(!r||!/\d/.test(r))continue}t=l;break}return Te.set(i,t),t}function Ae(i){const e={smarter:[],faster:[],cheaper:[],other:[]};for(const t of i){const l=As(t.modelId);e[l??"other"].push(t)}for(const t of Object.keys(e))e[t].sort((l,n)=>l.title.localeCompare(n.title));return e}const et="mesh:model-shortlist:",zs=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 Rs(i){try{const e=localStorage.getItem(et+i);return e?new Set(JSON.parse(e)):null}catch{return null}}function Ls(i,e){localStorage.setItem(et+i,JSON.stringify([...e]))}function Ps(i){const e=B.c(21),{model:t,onHover:l}=i;let n;e[0]!==t?(n=be(t),e[0]=t,e[1]=n):n=e[1];const{displayName:o,provider:r}=n;let a;e[2]!==t?(a=ve(t),e[2]=t,e[3]=a):a=e[3];const c=a;let d;e[4]!==t||e[5]!==l?(d=()=>l(t),e[4]=t,e[5]=l,e[6]=d):d=e[6];let u;e[7]!==t.title||e[8]!==c?(u=s.jsx("img",{src:c,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]=c,e[9]=u):u=e[9];let m;e[10]!==o?(m=s.jsx("span",{className:"text-sm text-foreground leading-tight truncate",children:o}),e[10]=o,e[11]=m):m=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 f;e[14]!==m||e[15]!==p?(f=s.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[m,p]}),e[14]=m,e[15]=p,e[16]=f):f=e[16];let g;return e[17]!==d||e[18]!==u||e[19]!==f?(g=s.jsxs("div",{className:"flex items-center gap-2.5 py-2 px-3 hover:bg-accent cursor-pointer rounded-lg",onMouseEnter:d,children:[u,f]}),e[17]=d,e[18]=u,e[19]=f,e[20]=g):g=e[20],g}function $s(i){const e=B.c(10),{error:t,onRetry:l}=i;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("div",{className:"bg-destructive/10 p-2 rounded-full",children:s.jsx(dt,{className:"size-5 text-destructive"})}),e[0]=n):n=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("p",{className:"text-sm font-medium text-foreground",children:"Failed to load models"}),e[1]=o):o=e[1];const r=t?.message||"Could not fetch models from this provider.";let a;e[2]!==r?(a=s.jsxs("div",{className:"flex flex-col gap-1",children:[o,s.jsxs("p",{className:"text-xs text-muted-foreground max-w-[260px]",children:[r," Try another provider or retry."]})]}),e[2]=r,e[3]=a):a=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Mt,{className:"size-3.5"}),e[4]=c):c=e[4];let d;e[5]!==l?(d=s.jsx("div",{className:"flex items-center gap-2",children:s.jsxs(ee,{variant:"outline",size:"sm",onClick:l,className:"gap-1.5",children:[c,"Retry"]})}),e[5]=l,e[6]=d):d=e[6];let u;return e[7]!==a||e[8]!==d?(u=s.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-4 py-8 text-center",children:[n,a,d]}),e[7]=a,e[8]=d,e[9]=u):u=e[9],u}function Ds(){const i=B.c(1);let e;return i[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(Fs)}),i[0]=e):e=i[0],e}function Fs(i,e){return s.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 rounded-lg",children:[s.jsx(X,{className:"size-5 shrink-0 rounded-sm"}),s.jsx(X,{className:"flex-1 h-4"}),s.jsx(X,{className:"w-16 h-5 shrink-0 rounded-md"})]},e)}function ze(i){const e=B.c(12),{label:t,models:l,onSelect:n,onHover:o}=i;if(l.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 a;if(e[2]!==l||e[3]!==o||e[4]!==n){let d;e[6]!==o||e[7]!==n?(d=u=>s.jsx("div",{onClick:()=>n(u),className:"cursor-pointer",children:s.jsx(Ps,{model:u,onHover:o})},u.modelId),e[6]=o,e[7]=n,e[8]=d):d=e[8],a=l.map(d),e[2]=l,e[3]=o,e[4]=n,e[5]=a}else a=e[5];let c;return e[9]!==r||e[10]!==a?(c=s.jsxs("div",{children:[r,a]}),e[9]=r,e[10]=a,e[11]=c):c=e[11],c}function Ks(i){const e=B.c(21),{model:t,isChecked:l,onToggle:n,onHover:o}=i,[r,a]=$.useState(l);r!==l&&a(l);let c;e[0]!==t?(c=ve(t),e[0]=t,e[1]=c):c=e[1];const d=c;let u;e[2]!==t||e[3]!==o?(u=()=>o(t),e[2]=t,e[3]=o,e[4]=u):u=e[4];let m;e[5]!==t.modelId||e[6]!==n?(m=()=>{a(Us),n(t.modelId)},e[5]=t.modelId,e[6]=n,e[7]=m):m=e[7];let p;e[8]!==r||e[9]!==m?(p=s.jsx(yt,{checked:r,onCheckedChange:m}),e[8]=r,e[9]=m,e[10]=p):p=e[10];let f;e[11]!==d||e[12]!==t.title?(f=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]=f):f=e[13];let g;e[14]!==t.title?(g=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]=g):g=e[15];let x;return e[16]!==u||e[17]!==p||e[18]!==f||e[19]!==g?(x=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:u,children:[p,f,g]}),e[16]=u,e[17]=p,e[18]=f,e[19]=g,e[20]=x):x=e[20],x}function Us(i){return!i}function Bs(i){const e=[];for(const t of Je)if(i[t].length>0){e.push({type:"header",label:Ze[t]});for(const l of i[t])e.push({type:"model",model:l})}if(i.other.length>0){e.push({type:"header",label:"Other"});for(const t of i.other)e.push({type:"model",model:t})}return e}function Ws({items:i,shortlistSet:e,onToggle:t,onHover:l}){const n=$.useRef(null),o=es({count:i.length,getScrollElement:()=>n.current,estimateSize:r=>i[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 a=i[r.index];return a?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:a.type==="header"?s.jsx("div",{className:"text-xs font-medium text-muted-foreground px-3 pt-3 pb-1",children:a.label}):s.jsx(Ks,{model:a.model,isChecked:e.has(a.model.modelId),onToggle:t,onHover:l})},r.key):null})})})}function Hs(i){const e=B.c(23),{keyId:t,searchTerm:l,onHover:n,onModelSelect:o,managing:r,onToggleManage:a,filterModels:c}=i,{models:d}=Rt(t),u=c?d.filter(c):d.filter(Vs);let m;e[0]!==t?(m=()=>(t?Rs(t):null)??zs,e[0]=t,e[1]=m):m=e[1];const[p,f]=$.useState(m),[,g]=$.useTransition();let x;e[2]!==t||e[3]!==g?(x=h=>{t&&g(()=>{f(y=>{const v=new Set(y);return v.has(h)?v.delete(h):v.add(h),Ls(t,v),v})})},e[2]=t,e[3]=g,e[4]=x):x=e[4];const j=x,k=l.toLowerCase().trim(),w=h=>k?h.filter(y=>y.title.toLowerCase().includes(k)||y.modelId.toLowerCase().includes(k)):h;if(r){const h=Ae(w(u)),y=Bs(h);let v;e[5]!==p?(v=E=>p.has(E.modelId),e[5]=p,e[6]=v):v=e[6];const O=u.filter(v).length;let T;e[7]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx(Be,{size:14}),e[7]=T):T=e[7];let A;return e[8]!==a?(A=s.jsxs("button",{type:"button",onClick:a,className:"flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground cursor-pointer",children:[T,"Back"]}),e[8]=a,e[9]=A):A=e[9],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:[A,s.jsxs("span",{className:"text-xs text-muted-foreground",children:[O," selected"]})]}),s.jsx(Ws,{items:y,shortlistSet:p,onToggle:j,onHover:n})]})}let _;e[10]!==p?(_=h=>p.has(h.modelId),e[10]=p,e[11]=_):_=e[11];const I=u.filter(_),M=I.length>0?I:u,b=Ae(w(M));let N;e[12]!==b||e[13]!==n||e[14]!==o?(N=Je.map(h=>s.jsx(ze,{label:Ze[h],models:b[h],onSelect:o,onHover:n},h)),e[12]=b,e[13]=n,e[14]=o,e[15]=N):N=e[15];let S;e[16]!==b.other||e[17]!==n||e[18]!==o?(S=s.jsx(ze,{label:"Other",models:b.other,onSelect:o,onHover:n}),e[16]=b.other,e[17]=n,e[18]=o,e[19]=S):S=e[19];let C;return e[20]!==N||e[21]!==S?(C=s.jsxs("div",{className:"flex-1 overflow-y-auto px-0.5 pt-1 [touch-action:pan-y]",children:[N,S]}),e[20]=N,e[21]=S,e[22]=C):C=e[22],C}function Vs(i){return i.asyncResearch!==!0}function qs(){const i=B.c(6);let e;i[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(X,{className:"size-4 shrink-0"}),s.jsx(X,{className:"flex-1 h-6"}),s.jsx(X,{className:"w-[140px] h-8 shrink-0"})]})}),i[0]=e):e=i[0];let t;i[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(Gs)})]}),i[1]=t):t=i[1];let l;i[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[s.jsx(X,{className:"size-6 shrink-0"}),s.jsx(X,{className:"h-6 w-32"})]}),i[2]=l):l=i[2];let n;i[3]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"flex flex-col gap-3 py-2 px-0",children:[l,s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(X,{className:"h-6 w-20 rounded-md"}),s.jsx(X,{className:"h-6 w-24 rounded-md"})]})]}),i[3]=n):n=i[3];let o;i[4]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(X,{className:"h-4 w-24"}),s.jsx(X,{className:"h-4 w-32"})]}),i[4]=o):o=i[4];let r;return i[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(X,{className:"h-4 w-16"}),s.jsx(X,{className:"h-4 w-40"})]})]})]})})]}),i[5]=r):r=i[5],r}function Gs(i,e){return s.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 rounded-lg",children:[s.jsx(X,{className:"size-5 shrink-0 rounded-sm"}),s.jsx(X,{className:"flex-1 h-4"}),s.jsx(X,{className:"w-16 h-5 shrink-0 rounded-md"})]},e)}function tt(i){const e=B.c(49),{onClose:t,credentialId:l,onCredentialChange:n,selectedModel:o,onModelChange:r,filterModels:a}=i,[c,d]=$.useState(null),[u,m]=$.useState(""),[p,f]=$.useState(!1),g=$.useRef(null),x=ge(),j=zt();let k;e[0]!==x?.providers?(k=Object.fromEntries((x?.providers??[]).map(Qs)),e[0]=x?.providers,e[1]=k):k=e[1];const w=k,_=at(),{org:I}=oe();let M;e[2]!==n?(M=z=>{n(z),d(null)},e[2]=n,e[3]=M):M=e[3];const b=M;let N;e[4]!==l||e[5]!==t||e[6]!==r?(N=z=>{l&&(r(z),m(""),t())},e[4]=l,e[5]=t,e[6]=r,e[7]=N):N=e[7];const S=N;if(j.length===0){let z;return e[8]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx("div",{className:"flex items-center justify-center p-8 w-full sm:w-[740px]",children:s.jsx(bs,{})}),e[8]=z):z=e[8],z}let C;e[9]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(We,{size:16,className:"text-muted-foreground shrink-0"}),e[9]=C):C=e[9];const h=p?"Search all models...":"Search for a model...";let y;e[10]===Symbol.for("react.memo_cache_sentinel")?(y=z=>m(z.target.value),e[10]=y):y=e[10];let v;e[11]!==u||e[12]!==h?(v=s.jsx(le,{ref:g,type:"text",placeholder:h,value:u,onChange:y,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[11]=u,e[12]=h,e[13]=v):v=e[13];let O;e[14]!==l||e[15]!==b||e[16]!==j||e[17]!==w?(O=j.length>0&&s.jsxs(St,{value:l??"",onValueChange:b,children:[s.jsxs(kt,{size:"sm",className:"w-auto max-w-[140px] h-8 shrink-0 gap-1.5 px-2 [&>svg:last-child]:hidden",onClick:Ys,children:[s.jsx(Nt,{placeholder:"Key",children:(()=>{const z=j.find(U=>U.id===l),Y=z?w[z.providerId]:void 0,Q=Oe(z?.presetId),q=Q?.logo??Y?.logo,G=Q?.name??Y?.name??z?.providerId??"Key";return s.jsxs("span",{className:"flex items-center gap-1.5 min-w-0",children:[q?s.jsx("img",{src:q,alt:G,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:G.slice(0,1).toUpperCase()}),s.jsx("span",{className:"text-xs truncate",children:G})]})})()}),s.jsx(Tt,{className:"size-4 opacity-50 shrink-0 pointer-events-none"})]}),s.jsx(Ct,{children:j.map(z=>{const Y=w[z.providerId],Q=Oe(z.presetId),q=Q?.logo??Y?.logo,G=Q?.name??Y?.name??z.providerId;return s.jsx(wt,{value:z.id,children:s.jsxs("div",{className:"flex items-center gap-2",children:[q?s.jsx("img",{src:q,alt:G,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:G.slice(0,1).toUpperCase()}),s.jsxs("span",{children:[G," — ",z.label]})]})},z.id)})})]}),e[14]=l,e[15]=b,e[16]=j,e[17]=w,e[18]=O):O=e[18];let T;e[19]!==v||e[20]!==O?(T=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:[C,v,O]})}),e[19]=v,e[20]=O,e[21]=T):T=e[21];let A;e[22]!==l?(A=z=>{const{error:Y,resetError:Q}=z;return s.jsx($s,{error:Y,onRetry:Q,credentialId:l??void 0})},e[22]=l,e[23]=A):A=e[23];let E;e[24]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx(Ds,{}),e[24]=E):E=e[24];const L=l??void 0;let R;e[25]===Symbol.for("react.memo_cache_sentinel")?(R=()=>f(Xs),e[25]=R):R=e[25];let P;e[26]!==a||e[27]!==S||e[28]!==p||e[29]!==u||e[30]!==L?(P=s.jsx($.Suspense,{fallback:E,children:s.jsx(Hs,{keyId:L,searchTerm:u,onHover:d,onModelSelect:S,managing:p,onToggleManage:R,filterModels:a})}),e[26]=a,e[27]=S,e[28]=p,e[29]=u,e[30]=L,e[31]=P):P=e[31];let D;e[32]!==l||e[33]!==A||e[34]!==P?(D=s.jsx(ct,{fallback:A,children:P},l),e[32]=l,e[33]=A,e[34]=P,e[35]=D):D=e[35];let F;e[36]!==p||e[37]!==_||e[38]!==I?(F=!p&&s.jsxs("div",{className:"border-t border-border flex",children:[s.jsxs("button",{type:"button",onClick:()=>$.startTransition(()=>f(!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(It,{className:"size-3.5 shrink-0"}),"Manage models"]}),s.jsx("div",{className:"w-px bg-border shrink-0"}),s.jsxs("button",{type:"button",onClick:()=>_({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(At,{className:"size-3.5 shrink-0"}),"Manage API keys"]})]}),e[36]=p,e[37]=_,e[38]=I,e[39]=F):F=e[39];let W;e[40]!==D||e[41]!==F||e[42]!==T?(W=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:[T,D,F]}),e[40]=D,e[41]=F,e[42]=T,e[43]=W):W=e[43];const H=c??o??null;let K;e[44]!==H?(K=s.jsx("div",{className:"hidden md:flex md:flex-col md:w-[320px] md:shrink-0 p-3",children:s.jsx(_s,{model:H})}),e[44]=H,e[45]=K):K=e[45];let V;return e[46]!==W||e[47]!==K?(V=s.jsxs("div",{className:"flex flex-col md:flex-row h-full sm:h-[460px] min-h-0",children:[W,K]}),e[46]=W,e[47]=K,e[48]=V):V=e[48],V}function Xs(i){return!i}function Ys(i){return i.stopPropagation()}function Qs(i){return[i.id,i]}function Js(i){const e=B.c(12),{onClose:t}=i,{credentialId:l,setCredentialId:n,selectedModel:o,setModel:r}=xe();let a;e[0]!==n?(a=u=>{J("chat_credential_changed",{credential_id:u}),n(u)},e[0]=n,e[1]=a):a=e[1];let c;e[2]!==l||e[3]!==o?.modelId||e[4]!==r?(c=u=>{l&&(J("chat_model_changed",{from_model_id:o?.modelId??null,to_model_id:u.modelId,to_model_provider:u.providerId??null,credential_id:l}),r({...u,keyId:l}))},e[2]=l,e[3]=o?.modelId,e[4]=r,e[5]=c):c=e[5];let d;return e[6]!==l||e[7]!==t||e[8]!==o||e[9]!==a||e[10]!==c?(d=s.jsx(tt,{onClose:t,credentialId:l,onCredentialChange:a,selectedModel:o,onModelChange:c}),e[6]=l,e[7]=t,e[8]=o,e[9]=a,e[10]=c,e[11]=d):d=e[11],d}function Zs(i){const e=B.c(2),{onClose:t}=i;let l;return e[0]!==t?(l=s.jsx(Js,{onClose:t}),e[0]=t,e[1]=l):l=e[1],l}function ei(i){const e=B.c(2);let t;return e[0]!==i?(t=s.jsx(tt,{...i}),e[0]=i,e[1]=t):t=e[1],t}const ti=[{tier:"fast",description:"Quicker responses"},{tier:"smart",description:"Balanced quality"},{tier:"thinking",description:"Deeper reasoning"}];function st(i){const e=B.c(10),{modelSet:t,selectedModelId:l,onSelect:n}=i;let o,r;if(e[0]!==t.logo||e[1]!==t.models||e[2]!==t.tiers||e[3]!==n||e[4]!==l){const c=Object.fromEntries(t.models.map(si));o="flex flex-col p-2 w-[320px]",r=ti.map(d=>{const{tier:u,description:m}=d,p=t.tiers[u];if(!p.modelId)return null;const f=c[p.modelId];if(!f)return null;const g=l===p.modelId;return s.jsxs("button",{type:"button",onClick:()=>n(f),className:ne("flex items-center gap-3 px-3 py-2.5 rounded-lg text-left hover:bg-accent",g&&"bg-accent/50"),children:[s.jsx("img",{src:t.logo,alt:p.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:p.label}),s.jsx("span",{className:"text-xs text-muted-foreground leading-tight",children:m})]})]},u)}),e[0]=t.logo,e[1]=t.models,e[2]=t.tiers,e[3]=n,e[4]=l,e[5]=o,e[6]=r}else o=e[5],r=e[6];let a;return e[7]!==o||e[8]!==r?(a=s.jsx("div",{className:o,children:r}),e[7]=o,e[8]=r,e[9]=a):a=e[9],a}function si(i){return[i.modelId,i]}const ii=[{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 4.8 1M",description:"Most capable, 1M context window",capabilities:["text","reasoning"],limits:{contextWindow:1e6,maxOutputTokens:null},costs:null}],de="https://assets.decocache.com/decocms/6ac44f1c-c0cf-4480-84b5-2ae6fe742d0b/codex-app.png.png",li=[{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:de,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:de,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:de,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:de,limits:null,costs:null}],ni="https://decoims.com/decocms/93e4059c-e598-412b-87eb-54d72a946ec8/claude-stroke-rounded.svg",oi="https://decoims.com/decocms/9170ffd4-b9cc-4661-ad8f-ae2eea019e00/codex.svg",ri={fast:{modelId:"claude-code:haiku",label:"Haiku 4.5",description:"Quicker responses",iconNode:s.jsx(ue,{size:16})},smart:{modelId:"claude-code:sonnet",label:"Sonnet 5",description:"Balanced quality",iconNode:s.jsx(ue,{size:16})},thinking:{modelId:"claude-code:opus-1m",label:"Opus 4.8 1M",description:"Deeper reasoning",iconNode:s.jsx(ue,{size:16})}},ai={fast:{modelId:"codex:gpt-5.6-luna",label:"GPT-5.6 Luna",description:"Quicker responses",iconNode:s.jsx(me,{size:16})},smart:{modelId:"codex:gpt-5.6-terra",label:"GPT-5.6 Terra",description:"Balanced quality",iconNode:s.jsx(me,{size:16})},thinking:{modelId:"codex:gpt-5.6-sol",label:"GPT-5.6 Sol",description:"Deeper reasoning",iconNode:s.jsx(me,{size:16})}};function it(i){return i==="claude-code"?{logo:ni,tiers:ri,models:ii}:i==="codex"?{logo:oi,tiers:ai,models:li}:null}function ci(i){const e=B.c(11),{onClose:t,agent:l}=i,n=xe(),o=l??n.pendingHarnessId??"decopilot";let r;e[0]!==o?(r=it(o),e[0]=o,e[1]=r):r=e[1];const a=r;if(!a){let m;return e[2]!==t?(m=s.jsx(Zs,{onClose:t}),e[2]=t,e[3]=m):m=e[3],m}const c=n.selectedModel?.modelId??a.tiers[n.simpleModeTier].modelId;let d;e[4]!==t||e[5]!==n?(d=m=>{n.setModel({...m,keyId:void 0}),t()},e[4]=t,e[5]=n,e[6]=d):d=e[6];let u;return e[7]!==a||e[8]!==c||e[9]!==d?(u=s.jsx(st,{modelSet:a,selectedModelId:c,onSelect:d}),e[7]=a,e[8]=c,e[9]=d,e[10]=u):u=e[10],u}function di(i){const e=B.c(13);let t,l;e[0]!==i?({agent:t,...l}=i,e[0]=i,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let n;e[3]!==t?(n=t?it(t):null,e[3]=t,e[4]=n):n=e[4];const o=n;if(!o){let d;return e[5]!==l?(d=s.jsx(ei,{...l}),e[5]=l,e[6]=d):d=e[6],d}const r=l.selectedModel?.modelId??o.tiers.smart.modelId;let a;e[7]!==l?(a=d=>{l.onModelChange(d),l.onClose()},e[7]=l,e[8]=a):a=e[8];let c;return e[9]!==o||e[10]!==r||e[11]!==a?(c=s.jsx(st,{modelSet:o,selectedModelId:r,onSelect:a}),e[9]=o,e[10]=r,e[11]=a,e[12]=c):c=e[12],c}function Ui(i){const e=B.c(39),{variant:t,className:l,placeholder:n,model:o,isLoading:r,credentialId:a,onCredentialChange:c,onModelChange:d,filterModels:u,agent:m}=i,p=t===void 0?"borderless":t,f=n===void 0?"Select model":n,[g,x]=$.useState(!1),j=d!==void 0,k=vt(),w=p==="borderless"?"ghost":"outline",_=p==="borderless"&&"md:border-none";let I;e[0]!==l||e[1]!==_?(I=ne("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",_,l),e[0]=l,e[1]=_,e[2]=I):I=e[2];let M;e[3]!==r||e[4]!==o||e[5]!==f||e[6]!==j?(M=j?s.jsx(Xe,{model:o??null,placeholder:f,isLoading:r}):s.jsx(mi,{placeholder:f}),e[3]=r,e[4]=o,e[5]=f,e[6]=j,e[7]=M):M=e[7];let b;e[8]!==w||e[9]!==I||e[10]!==M?(b=s.jsx(ee,{variant:w,size:"sm",className:I,children:M}),e[8]=w,e[9]=I,e[10]=M,e[11]=b):b=e[11];const N=b;let S;e[12]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(qs,{}),e[12]=S):S=e[12];let C;e[13]!==m||e[14]!==a||e[15]!==u||e[16]!==o||e[17]!==c||e[18]!==d||e[19]!==j?(C=s.jsx($.Suspense,{fallback:S,children:j?s.jsx(di,{onClose:()=>x(!1),agent:m,credentialId:a??null,onCredentialChange:c??ui,selectedModel:o??null,onModelChange:d,filterModels:u}):s.jsx(ci,{onClose:()=>x(!1),agent:m})}),e[13]=m,e[14]=a,e[15]=u,e[16]=o,e[17]=c,e[18]=d,e[19]=j,e[20]=C):C=e[20];const h=C;if(k){let A;e[21]!==N?(A=s.jsx(ht,{asChild:!0,children:N}),e[21]=N,e[22]=A):A=e[22];let E;e[23]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx(pt,{className:"sr-only",children:"Select model"}),e[23]=E):E=e[23];let L;e[24]!==h?(L=s.jsxs(xt,{className:"p-0 flex flex-col max-h-[95vh]",children:[E,s.jsx("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden",children:h})]}),e[24]=h,e[25]=L):L=e[25];let R;return e[26]!==g||e[27]!==A||e[28]!==L?(R=s.jsxs(gt,{open:g,onOpenChange:x,children:[A,L]}),e[26]=g,e[27]=A,e[28]=L,e[29]=R):R=e[29],R}let y;e[30]!==N?(y=s.jsx(ft,{asChild:!0,children:N}),e[30]=N,e[31]=y):y=e[31];let v;e[32]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(Ke,{className:"sr-only",children:"Select model"}),e[32]=v):v=e[32];let O;e[33]!==h?(O=s.jsxs(Fe,{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:[v,h]}),e[33]=h,e[34]=O):O=e[34];let T;return e[35]!==g||e[36]!==y||e[37]!==O?(T=s.jsxs(De,{open:g,onOpenChange:x,children:[y,O]}),e[35]=g,e[36]=y,e[37]=O,e[38]=T):T=e[38],T}function ui(){}function mi(i){const e=B.c(4),{placeholder:t}=i,{selectedModel:l,isModelsLoading:n}=xe();let o;return e[0]!==n||e[1]!==l||e[2]!==t?(o=s.jsx(Xe,{model:l,placeholder:t,isLoading:n}),e[0]=n,e[1]=l,e[2]=t,e[3]=o):o=e[3],o}export{ps as C,Ui as M,bs as N,ce as O,Ge as P,Fi as a,Ki as g,Di as i,je as m};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,aT as nt,aR as Pe,j as d,cR as rt,aV as be,aS as k,cS as st,aO as j,aU as _,bM as $,cT as lt,at as Ne,cU as Ee,aP as at,bI as ct,bO as it,c_ as dt,c$ as ut,d0 as pt,d1 as ft,cV as mt,aQ as ht,d2 as vt,cW as gt,cY as xt,c as ee,l as oe}from"./index-BUWOf6-H.js";import{V as St}from"./tooltip-cXMPTvhQ.js";import{i as wt}from"./Check-ylcp47jh.js";import{t as Re}from"./ChevronDown-DorDM-K-.js";import{n as Ct}from"./ChevronUp-C85SxyPM.js";function _e(r,[e,t]){return Math.min(t,Math.max(e,r))}var yt=[" ","Enter","ArrowUp","ArrowDown"],It=[" ","Enter"],Q="Select",[de,ue,bt]=at(Q),[ne]=ht(Q,[bt,Ee]),pe=Ee(),[Tt,G]=ne(Q),[Pt,_t]=ne(Q),je=r=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:n,onOpenChange:c,value:s,defaultValue:l,onValueChange:a,dir:u,name:h,autoComplete:g,disabled:b,required:w,form:S}=r,p=pe(e),[v,C]=i.useState(null),[m,x]=i.useState(null),[U,M]=i.useState(!1),re=nt(u),[N,O]=Pe({prop:o,defaultProp:n??!1,onChange:c,caller:Q}),[F,q]=Pe({prop:s,defaultProp:l,onChange:a,caller:Q}),L=i.useRef(null),B=v?S||!!v.closest("form"):!0,[W,V]=i.useState(new Set),H=Array.from(W).map(E=>E.props.value).join(";");return d.jsx(rt,{...p,children:d.jsxs(Tt,{required:w,scope:e,trigger:v,onTriggerChange:C,valueNode:m,onValueNodeChange:x,valueNodeHasChildren:U,onValueNodeHasChildrenChange:M,contentId:be(),value:F,onValueChange:q,open:N,onOpenChange:O,dir:re,triggerPointerDownPosRef:L,disabled:b,children:[d.jsx(de.Provider,{scope:e,children:d.jsx(Pt,{scope:r.__scopeSelect,onNativeOptionAdd:i.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:i.useCallback(E=>{V(D=>{const z=new Set(D);return z.delete(E),z})},[]),children:t})}),B?d.jsxs(Je,{"aria-hidden":!0,required:w,tabIndex:-1,name:h,autoComplete:g,value:F,onChange:E=>q(E.target.value),disabled:b,form:S,children:[F===void 0?d.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};je.displayName=Q;var Me="SelectTrigger",Ae=i.forwardRef((r,e)=>{const{__scopeSelect:t,disabled:o=!1,...n}=r,c=pe(t),s=G(Me,t),l=s.disabled||o,a=k(e,s.onTriggerChange),u=ue(t),h=i.useRef("touch"),[g,b,w]=tt(p=>{const v=u().filter(x=>!x.disabled),C=v.find(x=>x.value===s.value),m=ot(v,p,C);m!==void 0&&s.onValueChange(m.value)}),S=p=>{l||(s.onOpenChange(!0),w()),p&&(s.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return d.jsx(st,{asChild:!0,...c,children:d.jsx(j.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":et(s.value)?"":void 0,...n,ref:a,onClick:_(n.onClick,p=>{p.currentTarget.focus(),h.current!=="mouse"&&S(p)}),onPointerDown:_(n.onPointerDown,p=>{h.current=p.pointerType;const v=p.target;v.hasPointerCapture(p.pointerId)&&v.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:_(n.onKeyDown,p=>{const v=g.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&b(p.key),!(v&&p.key===" ")&&yt.includes(p.key)&&(S(),p.preventDefault())})})})});Ae.displayName=Me;var Oe="SelectValue",De=i.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,children:c,placeholder:s="",...l}=r,a=G(Oe,t),{onValueNodeHasChildrenChange:u}=a,h=c!==void 0,g=k(e,a.onValueNodeChange);return $(()=>{u(h)},[u,h]),d.jsx(j.span,{...l,ref:g,style:{pointerEvents:"none"},children:et(a.value)?d.jsx(d.Fragment,{children:s}):c})});De.displayName=Oe;var Nt="SelectIcon",ke=i.forwardRef((r,e)=>{const{__scopeSelect:t,children:o,...n}=r;return d.jsx(j.span,{"aria-hidden":!0,...n,ref:e,children:o||"▼"})});ke.displayName=Nt;var Et="SelectPortal",Le=r=>d.jsx(lt,{asChild:!0,...r});Le.displayName=Et;var J="SelectContent",Be=i.forwardRef((r,e)=>{const t=G(J,r.__scopeSelect),[o,n]=i.useState();if($(()=>{n(new DocumentFragment)},[]),!t.open){const c=o;return c?Ne.createPortal(d.jsx(Ve,{scope:r.__scopeSelect,children:d.jsx(de.Slot,{scope:r.__scopeSelect,children:d.jsx("div",{children:r.children})})}),c):null}return d.jsx(He,{...r,ref:e})});Be.displayName=J;var A=10,[Ve,Y]=ne(J),Rt="SelectContentImpl",jt=vt("SelectContent.RemoveScroll"),He=i.forwardRef((r,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:c,onPointerDownOutside:s,side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:v,...C}=r,m=G(J,t),[x,U]=i.useState(null),[M,re]=i.useState(null),N=k(e,f=>U(f)),[O,F]=i.useState(null),[q,L]=i.useState(null),B=ue(t),[W,V]=i.useState(!1),H=i.useRef(!1);i.useEffect(()=>{if(x)return dt(x)},[x]),ut();const E=i.useCallback(f=>{const[T,...R]=B().map(P=>P.ref.current),[y]=R.slice(-1),I=document.activeElement;for(const P of f)if(P===I||(P?.scrollIntoView({block:"nearest"}),P===T&&M&&(M.scrollTop=0),P===y&&M&&(M.scrollTop=M.scrollHeight),P?.focus(),document.activeElement!==I))return},[B,M]),D=i.useCallback(()=>E([O,x]),[E,O,x]);i.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=m;i.useEffect(()=>{if(x){let f={x:0,y:0};const T=y=>{f={x:Math.abs(Math.round(y.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(y.pageY)-(K.current?.y??0))}},R=y=>{f.x<=10&&f.y<=10?y.preventDefault():x.contains(y.target)||z(!1),document.removeEventListener("pointermove",T),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",T),document.addEventListener("pointerup",R,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",R,{capture:!0})}}},[x,z,K]),i.useEffect(()=>{const f=()=>z(!1);return window.addEventListener("blur",f),window.addEventListener("resize",f),()=>{window.removeEventListener("blur",f),window.removeEventListener("resize",f)}},[z]);const[fe,ae]=tt(f=>{const T=B().filter(I=>!I.disabled),R=T.find(I=>I.ref.current===document.activeElement),y=ot(T,f,R);y&&setTimeout(()=>y.ref.current.focus())}),me=i.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&(F(f),y&&(H.current=!0))},[m.value]),he=i.useCallback(()=>x?.focus(),[x]),te=i.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&L(f)},[m.value]),ce=o==="popper"?Se:ze,se=ce===Se?{side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:v}:{};return d.jsx(Ve,{scope:t,content:x,viewport:M,onViewportChange:re,itemRefCallback:me,selectedItem:O,onItemLeave:he,itemTextRefCallback:te,focusSelectedItem:D,selectedItemText:q,position:o,isPositioned:W,searchRef:fe,children:d.jsx(pt,{as:jt,allowPinchZoom:!0,children:d.jsx(ft,{asChild:!0,trapped:m.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:_(n,f=>{m.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:d.jsx(mt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:c,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:d.jsx(ce,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:f=>f.preventDefault(),...C,...se,onPlaced:()=>V(!0),ref:N,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:_(C.onKeyDown,f=>{const T=f.ctrlKey||f.altKey||f.metaKey;if(f.key==="Tab"&&f.preventDefault(),!T&&f.key.length===1&&ae(f.key),["ArrowUp","ArrowDown","Home","End"].includes(f.key)){let y=B().filter(I=>!I.disabled).map(I=>I.ref.current);if(["ArrowUp","End"].includes(f.key)&&(y=y.slice().reverse()),["ArrowUp","ArrowDown"].includes(f.key)){const I=f.target,P=y.indexOf(I);y=y.slice(P+1)}setTimeout(()=>E(y)),f.preventDefault()}})})})})})})});He.displayName=Rt;var Mt="SelectItemAlignedPosition",ze=i.forwardRef((r,e)=>{const{__scopeSelect:t,onPlaced:o,...n}=r,c=G(J,t),s=Y(J,t),[l,a]=i.useState(null),[u,h]=i.useState(null),g=k(e,N=>h(N)),b=ue(t),w=i.useRef(!1),S=i.useRef(!0),{viewport:p,selectedItem:v,selectedItemText:C,focusSelectedItem:m}=s,x=i.useCallback(()=>{if(c.trigger&&c.valueNode&&l&&u&&p&&v&&C){const N=c.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),F=c.valueNode.getBoundingClientRect(),q=C.getBoundingClientRect();if(c.dir!=="rtl"){const I=q.left-O.left,P=F.left-I,X=N.left-P,Z=N.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=_e(P,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.left=xe+"px"}else{const I=O.right-q.right,P=window.innerWidth-F.right-I,X=window.innerWidth-N.right-P,Z=N.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=_e(P,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.right=xe+"px"}const L=b(),B=window.innerHeight-A*2,W=p.scrollHeight,V=window.getComputedStyle(u),H=parseInt(V.borderTopWidth,10),E=parseInt(V.paddingTop,10),D=parseInt(V.borderBottomWidth,10),z=parseInt(V.paddingBottom,10),K=H+E+W+z+D,fe=Math.min(v.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=N.top+N.height/2-A,ce=B-te,se=v.offsetHeight/2,f=v.offsetTop+se,T=H+E+f,R=K-T;if(T<=te){const I=L.length>0&&v===L[L.length-1].ref.current;l.style.bottom="0px";const P=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(ce,se+(I?he:0)+P+D),Z=T+X;l.style.height=Z+"px"}else{const I=L.length>0&&v===L[0].ref.current;l.style.top="0px";const X=Math.max(te,H+p.offsetTop+(I?me:0)+se)+R;l.style.height=X+"px",p.scrollTop=T-te+p.offsetTop}l.style.margin=`${A}px 0`,l.style.minHeight=fe+"px",l.style.maxHeight=B+"px",o?.(),requestAnimationFrame(()=>w.current=!0)}},[b,c.trigger,c.valueNode,l,u,p,v,C,c.dir,o]);$(()=>x(),[x]);const[U,M]=i.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const re=i.useCallback(N=>{N&&S.current===!0&&(x(),m?.(),S.current=!1)},[x,m]);return d.jsx(Ot,{scope:t,contentWrapper:l,shouldExpandOnScrollRef:w,onScrollButtonChange:re,children:d.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:U},children:d.jsx(j.div,{...n,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});ze.displayName=Mt;var At="SelectPopperPosition",Se=i.forwardRef((r,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:n=A,...c}=r,s=pe(t);return d.jsx(gt,{...s,...c,ref:e,align:o,collisionPadding:n,style:{boxSizing:"border-box",...c.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Se.displayName=At;var[Ot,Te]=ne(J,{}),we="SelectViewport",Ue=i.forwardRef((r,e)=>{const{__scopeSelect:t,nonce:o,...n}=r,c=Y(we,t),s=Te(we,t),l=k(e,c.onViewportChange),a=i.useRef(0);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),d.jsx(de.Slot,{scope:t,children:d.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:_(n.onScroll,u=>{const h=u.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:b}=s;if(b?.current&&g){const w=Math.abs(a.current-h.scrollTop);if(w>0){const S=window.innerHeight-A*2,p=parseFloat(g.style.minHeight),v=parseFloat(g.style.height),C=Math.max(p,v);if(C<S){const m=C+w,x=Math.min(S,m),U=m-x;g.style.height=x+"px",g.style.bottom==="0px"&&(h.scrollTop=U>0?U:0,g.style.justifyContent="flex-end")}}}a.current=h.scrollTop})})})]})});Ue.displayName=we;var Fe="SelectGroup",[Dt,kt]=ne(Fe),Lt=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=be();return d.jsx(Dt,{scope:t,id:n,children:d.jsx(j.div,{role:"group","aria-labelledby":n,...o,ref:e})})});Lt.displayName=Fe;var We="SelectLabel",Bt=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=kt(We,t);return d.jsx(j.div,{id:n.id,...o,ref:e})});Bt.displayName=We;var ie="SelectItem",[Vt,Ke]=ne(ie),$e=i.forwardRef((r,e)=>{const{__scopeSelect:t,value:o,disabled:n=!1,textValue:c,...s}=r,l=G(ie,t),a=Y(ie,t),u=l.value===o,[h,g]=i.useState(c??""),[b,w]=i.useState(!1),S=k(e,m=>a.itemRefCallback?.(m,o,n)),p=be(),v=i.useRef("touch"),C=()=>{n||(l.onValueChange(o),l.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.jsx(Vt,{scope:t,value:o,disabled:n,textId:p,isSelected:u,onItemTextChange:i.useCallback(m=>{g(x=>x||(m?.textContent??"").trim())},[]),children:d.jsx(de.ItemSlot,{scope:t,value:o,disabled:n,textValue:h,children:d.jsx(j.div,{role:"option","aria-labelledby":p,"data-highlighted":b?"":void 0,"aria-selected":u&&b,"data-state":u?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...s,ref:S,onFocus:_(s.onFocus,()=>w(!0)),onBlur:_(s.onBlur,()=>w(!1)),onClick:_(s.onClick,()=>{v.current!=="mouse"&&C()}),onPointerUp:_(s.onPointerUp,()=>{v.current==="mouse"&&C()}),onPointerDown:_(s.onPointerDown,m=>{v.current=m.pointerType}),onPointerMove:_(s.onPointerMove,m=>{v.current=m.pointerType,n?a.onItemLeave?.():v.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:_(s.onPointerLeave,m=>{m.currentTarget===document.activeElement&&a.onItemLeave?.()}),onKeyDown:_(s.onKeyDown,m=>{a.searchRef?.current!==""&&m.key===" "||(It.includes(m.key)&&C(),m.key===" "&&m.preventDefault())})})})})});$e.displayName=ie;var le="SelectItemText",Ge=i.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,...c}=r,s=G(le,t),l=Y(le,t),a=Ke(le,t),u=_t(le,t),[h,g]=i.useState(null),b=k(e,C=>g(C),a.onItemTextChange,C=>l.itemTextRefCallback?.(C,a.value,a.disabled)),w=h?.textContent,S=i.useMemo(()=>d.jsx("option",{value:a.value,disabled:a.disabled,children:w},a.value),[a.disabled,a.value,w]),{onNativeOptionAdd:p,onNativeOptionRemove:v}=u;return $(()=>(p(S),()=>v(S)),[p,v,S]),d.jsxs(d.Fragment,{children:[d.jsx(j.span,{id:a.textId,...c,ref:b}),a.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Ne.createPortal(c.children,s.valueNode):null]})});Ge.displayName=le;var Ye="SelectItemIndicator",qe=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return Ke(Ye,t).isSelected?d.jsx(j.span,{"aria-hidden":!0,...o,ref:e}):null});qe.displayName=Ye;var Ce="SelectScrollUpButton",Xe=i.forwardRef((r,e)=>{const t=Y(Ce,r.__scopeSelect),o=Te(Ce,r.__scopeSelect),[n,c]=i.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollTop>0;c(u)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?d.jsx(Qe,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop-a.offsetHeight)}}):null});Xe.displayName=Ce;var ye="SelectScrollDownButton",Ze=i.forwardRef((r,e)=>{const t=Y(ye,r.__scopeSelect),o=Te(ye,r.__scopeSelect),[n,c]=i.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollHeight-a.clientHeight,h=Math.ceil(a.scrollTop)<u;c(h)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?d.jsx(Qe,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop+a.offsetHeight)}}):null});Ze.displayName=ye;var Qe=i.forwardRef((r,e)=>{const{__scopeSelect:t,onAutoScroll:o,...n}=r,c=Y("SelectScrollButton",t),s=i.useRef(null),l=ue(t),a=i.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return i.useEffect(()=>()=>a(),[a]),$(()=>{l().find(h=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),d.jsx(j.div,{"aria-hidden":!0,...n,ref:e,style:{flexShrink:0,...n.style},onPointerDown:_(n.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(o,50))}),onPointerMove:_(n.onPointerMove,()=>{c.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:_(n.onPointerLeave,()=>{a()})})}),Ht="SelectSeparator",zt=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return d.jsx(j.div,{"aria-hidden":!0,...o,ref:e})});zt.displayName=Ht;var Ie="SelectArrow",Ut=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=pe(t),c=G(Ie,t),s=Y(Ie,t);return c.open&&s.position==="popper"?d.jsx(xt,{...n,...o,ref:e}):null});Ut.displayName=Ie;var Ft="SelectBubbleInput",Je=i.forwardRef(({__scopeSelect:r,value:e,...t},o)=>{const n=i.useRef(null),c=k(o,n),s=ct(e);return i.useEffect(()=>{const l=n.current;if(!l)return;const a=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(a,"value").set;if(s!==e&&h){const g=new Event("change",{bubbles:!0});h.call(l,e),l.dispatchEvent(g)}},[s,e]),d.jsx(j.select,{...t,style:{...St,...t.style},ref:c,defaultValue:e})});Je.displayName=Ft;function et(r){return r===""||r===void 0}function tt(r){const e=it(r),t=i.useRef(""),o=i.useRef(0),n=i.useCallback(s=>{const l=t.current+s;e(l),(function a(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>a(""),1e3))})(l)},[e]),c=i.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return i.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,n,c]}function ot(r,e,t){const n=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,c=t?r.indexOf(t):-1;let s=Wt(r,Math.max(c,0));n.length===1&&(s=s.filter(u=>u!==t));const a=s.find(u=>u.textValue.toLowerCase().startsWith(n.toLowerCase()));return a!==t?a:void 0}function Wt(r,e){return r.map((t,o)=>r[(e+o)%r.length])}var Kt=je,$t=Ae,Gt=De,Yt=ke,qt=Le,Xt=Be,Zt=Ue,Qt=$e,Jt=Ge,eo=qe,to=Xe,oo=Ze;function uo(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Kt,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function po(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Gt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function fo(r){const e=ee.c(13);let t,o,n,c;e[0]!==r?({className:o,size:c,children:t,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c):(t=e[1],o=e[2],n=e[3],c=e[4]);const s=c===void 0?"default":c;let l;e[5]!==o?(l=oe("data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-lg bg-background px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[2px] card-shadow disabled:opacity-50 data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=xs]:h-6 data-[size=xs]:px-2.5 data-[size=xs]:py-1.5 data-[size=xs]:rounded-lg *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]===Symbol.for("react.memo_cache_sentinel")?(a=d.jsx(Yt,{asChild:!0,children:d.jsx(Re,{className:"size-4 opacity-50"})}),e[7]=a):a=e[7];let u;return e[8]!==t||e[9]!==n||e[10]!==s||e[11]!==l?(u=d.jsxs($t,{"data-slot":"select-trigger","data-size":s,className:l,...n,children:[t,a]}),e[8]=t,e[9]=n,e[10]=s,e[11]=l,e[12]=u):u=e[12],u}function mo(r){const e=ee.c(25);let t,o,n,c,s;e[0]!==r?({className:o,children:t,position:c,hideScrollButtons:s,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c,e[5]=s):(t=e[1],o=e[2],n=e[3],c=e[4],s=e[5]);const l=c===void 0?"popper":c,a=s===void 0?!1:s,u=l==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1";let h;e[6]!==o||e[7]!==u?(h=oe("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border shadow-md",u,o),e[6]=o,e[7]=u,e[8]=h):h=e[8];let g;e[9]!==a?(g=!a&&d.jsx(no,{}),e[9]=a,e[10]=g):g=e[10];const b=l==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let w;e[11]!==b?(w=oe("p-1",b),e[11]=b,e[12]=w):w=e[12];let S;e[13]!==t||e[14]!==w?(S=d.jsx(Zt,{className:w,children:t}),e[13]=t,e[14]=w,e[15]=S):S=e[15];let p;e[16]!==a?(p=!a&&d.jsx(ro,{}),e[16]=a,e[17]=p):p=e[17];let v;return e[18]!==l||e[19]!==n||e[20]!==h||e[21]!==g||e[22]!==S||e[23]!==p?(v=d.jsx(qt,{children:d.jsxs(Xt,{"data-slot":"select-content",className:h,position:l,...n,children:[g,S,p]})}),e[18]=l,e[19]=n,e[20]=h,e[21]=g,e[22]=S,e[23]=p,e[24]=v):v=e[24],v}function ho(r){const e=ee.c(16);let t,o,n,c;e[0]!==r?({className:o,children:t,hideCheck:c,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c):(t=e[1],o=e[2],n=e[3],c=e[4]);const s=c===void 0?!1:c;let l;e[5]!==o?(l=oe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]!==s?(a=!s&&d.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:d.jsx(eo,{children:d.jsx(wt,{className:"size-4"})})}),e[7]=s,e[8]=a):a=e[8];let u;e[9]!==t?(u=d.jsx(Jt,{children:t}),e[9]=t,e[10]=u):u=e[10];let h;return e[11]!==n||e[12]!==l||e[13]!==a||e[14]!==u?(h=d.jsxs(Qt,{"data-slot":"select-item",className:l,...n,children:[a,u]}),e[11]=n,e[12]=l,e[13]=a,e[14]=u,e[15]=h):h=e[15],h}function no(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=d.jsx(Ct,{className:"size-4"}),e[5]=c):c=e[5];let s;return e[6]!==o||e[7]!==n?(s=d.jsx(to,{"data-slot":"select-scroll-up-button",className:n,...o,children:c}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}function ro(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=d.jsx(Re,{className:"size-4"}),e[5]=c):c=e[5];let s;return e[6]!==o||e[7]!==n?(s=d.jsx(oo,{"data-slot":"select-scroll-down-button",className:n,...o,children:c}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}export{uo as S,fo as a,po as b,mo as c,ho as d,_e as e};
|
|
1
|
+
import{r as i,aT as nt,aR as Pe,j as d,cR as rt,aV as be,aS as k,cS as st,aO as j,aU as _,bM as $,cT as lt,at as Ne,cU as Ee,aP as at,bI as ct,bO as it,c_ as dt,c$ as ut,d0 as pt,d1 as ft,cV as mt,aQ as ht,d2 as vt,cW as gt,cY as xt,c as ee,l as oe}from"./index-DGQdC8j6.js";import{V as St}from"./tooltip-CO1zVhUs.js";import{i as wt}from"./Check-Oxo5mPeL.js";import{t as Re}from"./ChevronDown-DCZlSvzQ.js";import{n as Ct}from"./ChevronUp-BXrO8J56.js";function _e(r,[e,t]){return Math.min(t,Math.max(e,r))}var yt=[" ","Enter","ArrowUp","ArrowDown"],It=[" ","Enter"],Q="Select",[de,ue,bt]=at(Q),[ne]=ht(Q,[bt,Ee]),pe=Ee(),[Tt,G]=ne(Q),[Pt,_t]=ne(Q),je=r=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:n,onOpenChange:c,value:s,defaultValue:l,onValueChange:a,dir:u,name:h,autoComplete:g,disabled:b,required:w,form:S}=r,p=pe(e),[v,C]=i.useState(null),[m,x]=i.useState(null),[U,M]=i.useState(!1),re=nt(u),[N,O]=Pe({prop:o,defaultProp:n??!1,onChange:c,caller:Q}),[F,q]=Pe({prop:s,defaultProp:l,onChange:a,caller:Q}),L=i.useRef(null),B=v?S||!!v.closest("form"):!0,[W,V]=i.useState(new Set),H=Array.from(W).map(E=>E.props.value).join(";");return d.jsx(rt,{...p,children:d.jsxs(Tt,{required:w,scope:e,trigger:v,onTriggerChange:C,valueNode:m,onValueNodeChange:x,valueNodeHasChildren:U,onValueNodeHasChildrenChange:M,contentId:be(),value:F,onValueChange:q,open:N,onOpenChange:O,dir:re,triggerPointerDownPosRef:L,disabled:b,children:[d.jsx(de.Provider,{scope:e,children:d.jsx(Pt,{scope:r.__scopeSelect,onNativeOptionAdd:i.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:i.useCallback(E=>{V(D=>{const z=new Set(D);return z.delete(E),z})},[]),children:t})}),B?d.jsxs(Je,{"aria-hidden":!0,required:w,tabIndex:-1,name:h,autoComplete:g,value:F,onChange:E=>q(E.target.value),disabled:b,form:S,children:[F===void 0?d.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};je.displayName=Q;var Me="SelectTrigger",Ae=i.forwardRef((r,e)=>{const{__scopeSelect:t,disabled:o=!1,...n}=r,c=pe(t),s=G(Me,t),l=s.disabled||o,a=k(e,s.onTriggerChange),u=ue(t),h=i.useRef("touch"),[g,b,w]=tt(p=>{const v=u().filter(x=>!x.disabled),C=v.find(x=>x.value===s.value),m=ot(v,p,C);m!==void 0&&s.onValueChange(m.value)}),S=p=>{l||(s.onOpenChange(!0),w()),p&&(s.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return d.jsx(st,{asChild:!0,...c,children:d.jsx(j.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":et(s.value)?"":void 0,...n,ref:a,onClick:_(n.onClick,p=>{p.currentTarget.focus(),h.current!=="mouse"&&S(p)}),onPointerDown:_(n.onPointerDown,p=>{h.current=p.pointerType;const v=p.target;v.hasPointerCapture(p.pointerId)&&v.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:_(n.onKeyDown,p=>{const v=g.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&b(p.key),!(v&&p.key===" ")&&yt.includes(p.key)&&(S(),p.preventDefault())})})})});Ae.displayName=Me;var Oe="SelectValue",De=i.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,children:c,placeholder:s="",...l}=r,a=G(Oe,t),{onValueNodeHasChildrenChange:u}=a,h=c!==void 0,g=k(e,a.onValueNodeChange);return $(()=>{u(h)},[u,h]),d.jsx(j.span,{...l,ref:g,style:{pointerEvents:"none"},children:et(a.value)?d.jsx(d.Fragment,{children:s}):c})});De.displayName=Oe;var Nt="SelectIcon",ke=i.forwardRef((r,e)=>{const{__scopeSelect:t,children:o,...n}=r;return d.jsx(j.span,{"aria-hidden":!0,...n,ref:e,children:o||"▼"})});ke.displayName=Nt;var Et="SelectPortal",Le=r=>d.jsx(lt,{asChild:!0,...r});Le.displayName=Et;var J="SelectContent",Be=i.forwardRef((r,e)=>{const t=G(J,r.__scopeSelect),[o,n]=i.useState();if($(()=>{n(new DocumentFragment)},[]),!t.open){const c=o;return c?Ne.createPortal(d.jsx(Ve,{scope:r.__scopeSelect,children:d.jsx(de.Slot,{scope:r.__scopeSelect,children:d.jsx("div",{children:r.children})})}),c):null}return d.jsx(He,{...r,ref:e})});Be.displayName=J;var A=10,[Ve,Y]=ne(J),Rt="SelectContentImpl",jt=vt("SelectContent.RemoveScroll"),He=i.forwardRef((r,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:c,onPointerDownOutside:s,side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:v,...C}=r,m=G(J,t),[x,U]=i.useState(null),[M,re]=i.useState(null),N=k(e,f=>U(f)),[O,F]=i.useState(null),[q,L]=i.useState(null),B=ue(t),[W,V]=i.useState(!1),H=i.useRef(!1);i.useEffect(()=>{if(x)return dt(x)},[x]),ut();const E=i.useCallback(f=>{const[T,...R]=B().map(P=>P.ref.current),[y]=R.slice(-1),I=document.activeElement;for(const P of f)if(P===I||(P?.scrollIntoView({block:"nearest"}),P===T&&M&&(M.scrollTop=0),P===y&&M&&(M.scrollTop=M.scrollHeight),P?.focus(),document.activeElement!==I))return},[B,M]),D=i.useCallback(()=>E([O,x]),[E,O,x]);i.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=m;i.useEffect(()=>{if(x){let f={x:0,y:0};const T=y=>{f={x:Math.abs(Math.round(y.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(y.pageY)-(K.current?.y??0))}},R=y=>{f.x<=10&&f.y<=10?y.preventDefault():x.contains(y.target)||z(!1),document.removeEventListener("pointermove",T),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",T),document.addEventListener("pointerup",R,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",R,{capture:!0})}}},[x,z,K]),i.useEffect(()=>{const f=()=>z(!1);return window.addEventListener("blur",f),window.addEventListener("resize",f),()=>{window.removeEventListener("blur",f),window.removeEventListener("resize",f)}},[z]);const[fe,ae]=tt(f=>{const T=B().filter(I=>!I.disabled),R=T.find(I=>I.ref.current===document.activeElement),y=ot(T,f,R);y&&setTimeout(()=>y.ref.current.focus())}),me=i.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&(F(f),y&&(H.current=!0))},[m.value]),he=i.useCallback(()=>x?.focus(),[x]),te=i.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&L(f)},[m.value]),ce=o==="popper"?Se:ze,se=ce===Se?{side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:v}:{};return d.jsx(Ve,{scope:t,content:x,viewport:M,onViewportChange:re,itemRefCallback:me,selectedItem:O,onItemLeave:he,itemTextRefCallback:te,focusSelectedItem:D,selectedItemText:q,position:o,isPositioned:W,searchRef:fe,children:d.jsx(pt,{as:jt,allowPinchZoom:!0,children:d.jsx(ft,{asChild:!0,trapped:m.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:_(n,f=>{m.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:d.jsx(mt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:c,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:d.jsx(ce,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:f=>f.preventDefault(),...C,...se,onPlaced:()=>V(!0),ref:N,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:_(C.onKeyDown,f=>{const T=f.ctrlKey||f.altKey||f.metaKey;if(f.key==="Tab"&&f.preventDefault(),!T&&f.key.length===1&&ae(f.key),["ArrowUp","ArrowDown","Home","End"].includes(f.key)){let y=B().filter(I=>!I.disabled).map(I=>I.ref.current);if(["ArrowUp","End"].includes(f.key)&&(y=y.slice().reverse()),["ArrowUp","ArrowDown"].includes(f.key)){const I=f.target,P=y.indexOf(I);y=y.slice(P+1)}setTimeout(()=>E(y)),f.preventDefault()}})})})})})})});He.displayName=Rt;var Mt="SelectItemAlignedPosition",ze=i.forwardRef((r,e)=>{const{__scopeSelect:t,onPlaced:o,...n}=r,c=G(J,t),s=Y(J,t),[l,a]=i.useState(null),[u,h]=i.useState(null),g=k(e,N=>h(N)),b=ue(t),w=i.useRef(!1),S=i.useRef(!0),{viewport:p,selectedItem:v,selectedItemText:C,focusSelectedItem:m}=s,x=i.useCallback(()=>{if(c.trigger&&c.valueNode&&l&&u&&p&&v&&C){const N=c.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),F=c.valueNode.getBoundingClientRect(),q=C.getBoundingClientRect();if(c.dir!=="rtl"){const I=q.left-O.left,P=F.left-I,X=N.left-P,Z=N.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=_e(P,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.left=xe+"px"}else{const I=O.right-q.right,P=window.innerWidth-F.right-I,X=window.innerWidth-N.right-P,Z=N.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=_e(P,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.right=xe+"px"}const L=b(),B=window.innerHeight-A*2,W=p.scrollHeight,V=window.getComputedStyle(u),H=parseInt(V.borderTopWidth,10),E=parseInt(V.paddingTop,10),D=parseInt(V.borderBottomWidth,10),z=parseInt(V.paddingBottom,10),K=H+E+W+z+D,fe=Math.min(v.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=N.top+N.height/2-A,ce=B-te,se=v.offsetHeight/2,f=v.offsetTop+se,T=H+E+f,R=K-T;if(T<=te){const I=L.length>0&&v===L[L.length-1].ref.current;l.style.bottom="0px";const P=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(ce,se+(I?he:0)+P+D),Z=T+X;l.style.height=Z+"px"}else{const I=L.length>0&&v===L[0].ref.current;l.style.top="0px";const X=Math.max(te,H+p.offsetTop+(I?me:0)+se)+R;l.style.height=X+"px",p.scrollTop=T-te+p.offsetTop}l.style.margin=`${A}px 0`,l.style.minHeight=fe+"px",l.style.maxHeight=B+"px",o?.(),requestAnimationFrame(()=>w.current=!0)}},[b,c.trigger,c.valueNode,l,u,p,v,C,c.dir,o]);$(()=>x(),[x]);const[U,M]=i.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const re=i.useCallback(N=>{N&&S.current===!0&&(x(),m?.(),S.current=!1)},[x,m]);return d.jsx(Ot,{scope:t,contentWrapper:l,shouldExpandOnScrollRef:w,onScrollButtonChange:re,children:d.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:U},children:d.jsx(j.div,{...n,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});ze.displayName=Mt;var At="SelectPopperPosition",Se=i.forwardRef((r,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:n=A,...c}=r,s=pe(t);return d.jsx(gt,{...s,...c,ref:e,align:o,collisionPadding:n,style:{boxSizing:"border-box",...c.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Se.displayName=At;var[Ot,Te]=ne(J,{}),we="SelectViewport",Ue=i.forwardRef((r,e)=>{const{__scopeSelect:t,nonce:o,...n}=r,c=Y(we,t),s=Te(we,t),l=k(e,c.onViewportChange),a=i.useRef(0);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),d.jsx(de.Slot,{scope:t,children:d.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:_(n.onScroll,u=>{const h=u.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:b}=s;if(b?.current&&g){const w=Math.abs(a.current-h.scrollTop);if(w>0){const S=window.innerHeight-A*2,p=parseFloat(g.style.minHeight),v=parseFloat(g.style.height),C=Math.max(p,v);if(C<S){const m=C+w,x=Math.min(S,m),U=m-x;g.style.height=x+"px",g.style.bottom==="0px"&&(h.scrollTop=U>0?U:0,g.style.justifyContent="flex-end")}}}a.current=h.scrollTop})})})]})});Ue.displayName=we;var Fe="SelectGroup",[Dt,kt]=ne(Fe),Lt=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=be();return d.jsx(Dt,{scope:t,id:n,children:d.jsx(j.div,{role:"group","aria-labelledby":n,...o,ref:e})})});Lt.displayName=Fe;var We="SelectLabel",Bt=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=kt(We,t);return d.jsx(j.div,{id:n.id,...o,ref:e})});Bt.displayName=We;var ie="SelectItem",[Vt,Ke]=ne(ie),$e=i.forwardRef((r,e)=>{const{__scopeSelect:t,value:o,disabled:n=!1,textValue:c,...s}=r,l=G(ie,t),a=Y(ie,t),u=l.value===o,[h,g]=i.useState(c??""),[b,w]=i.useState(!1),S=k(e,m=>a.itemRefCallback?.(m,o,n)),p=be(),v=i.useRef("touch"),C=()=>{n||(l.onValueChange(o),l.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.jsx(Vt,{scope:t,value:o,disabled:n,textId:p,isSelected:u,onItemTextChange:i.useCallback(m=>{g(x=>x||(m?.textContent??"").trim())},[]),children:d.jsx(de.ItemSlot,{scope:t,value:o,disabled:n,textValue:h,children:d.jsx(j.div,{role:"option","aria-labelledby":p,"data-highlighted":b?"":void 0,"aria-selected":u&&b,"data-state":u?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...s,ref:S,onFocus:_(s.onFocus,()=>w(!0)),onBlur:_(s.onBlur,()=>w(!1)),onClick:_(s.onClick,()=>{v.current!=="mouse"&&C()}),onPointerUp:_(s.onPointerUp,()=>{v.current==="mouse"&&C()}),onPointerDown:_(s.onPointerDown,m=>{v.current=m.pointerType}),onPointerMove:_(s.onPointerMove,m=>{v.current=m.pointerType,n?a.onItemLeave?.():v.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:_(s.onPointerLeave,m=>{m.currentTarget===document.activeElement&&a.onItemLeave?.()}),onKeyDown:_(s.onKeyDown,m=>{a.searchRef?.current!==""&&m.key===" "||(It.includes(m.key)&&C(),m.key===" "&&m.preventDefault())})})})})});$e.displayName=ie;var le="SelectItemText",Ge=i.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,...c}=r,s=G(le,t),l=Y(le,t),a=Ke(le,t),u=_t(le,t),[h,g]=i.useState(null),b=k(e,C=>g(C),a.onItemTextChange,C=>l.itemTextRefCallback?.(C,a.value,a.disabled)),w=h?.textContent,S=i.useMemo(()=>d.jsx("option",{value:a.value,disabled:a.disabled,children:w},a.value),[a.disabled,a.value,w]),{onNativeOptionAdd:p,onNativeOptionRemove:v}=u;return $(()=>(p(S),()=>v(S)),[p,v,S]),d.jsxs(d.Fragment,{children:[d.jsx(j.span,{id:a.textId,...c,ref:b}),a.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Ne.createPortal(c.children,s.valueNode):null]})});Ge.displayName=le;var Ye="SelectItemIndicator",qe=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return Ke(Ye,t).isSelected?d.jsx(j.span,{"aria-hidden":!0,...o,ref:e}):null});qe.displayName=Ye;var Ce="SelectScrollUpButton",Xe=i.forwardRef((r,e)=>{const t=Y(Ce,r.__scopeSelect),o=Te(Ce,r.__scopeSelect),[n,c]=i.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollTop>0;c(u)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?d.jsx(Qe,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop-a.offsetHeight)}}):null});Xe.displayName=Ce;var ye="SelectScrollDownButton",Ze=i.forwardRef((r,e)=>{const t=Y(ye,r.__scopeSelect),o=Te(ye,r.__scopeSelect),[n,c]=i.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollHeight-a.clientHeight,h=Math.ceil(a.scrollTop)<u;c(h)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?d.jsx(Qe,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop+a.offsetHeight)}}):null});Ze.displayName=ye;var Qe=i.forwardRef((r,e)=>{const{__scopeSelect:t,onAutoScroll:o,...n}=r,c=Y("SelectScrollButton",t),s=i.useRef(null),l=ue(t),a=i.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return i.useEffect(()=>()=>a(),[a]),$(()=>{l().find(h=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),d.jsx(j.div,{"aria-hidden":!0,...n,ref:e,style:{flexShrink:0,...n.style},onPointerDown:_(n.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(o,50))}),onPointerMove:_(n.onPointerMove,()=>{c.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:_(n.onPointerLeave,()=>{a()})})}),Ht="SelectSeparator",zt=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return d.jsx(j.div,{"aria-hidden":!0,...o,ref:e})});zt.displayName=Ht;var Ie="SelectArrow",Ut=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=pe(t),c=G(Ie,t),s=Y(Ie,t);return c.open&&s.position==="popper"?d.jsx(xt,{...n,...o,ref:e}):null});Ut.displayName=Ie;var Ft="SelectBubbleInput",Je=i.forwardRef(({__scopeSelect:r,value:e,...t},o)=>{const n=i.useRef(null),c=k(o,n),s=ct(e);return i.useEffect(()=>{const l=n.current;if(!l)return;const a=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(a,"value").set;if(s!==e&&h){const g=new Event("change",{bubbles:!0});h.call(l,e),l.dispatchEvent(g)}},[s,e]),d.jsx(j.select,{...t,style:{...St,...t.style},ref:c,defaultValue:e})});Je.displayName=Ft;function et(r){return r===""||r===void 0}function tt(r){const e=it(r),t=i.useRef(""),o=i.useRef(0),n=i.useCallback(s=>{const l=t.current+s;e(l),(function a(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>a(""),1e3))})(l)},[e]),c=i.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return i.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,n,c]}function ot(r,e,t){const n=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,c=t?r.indexOf(t):-1;let s=Wt(r,Math.max(c,0));n.length===1&&(s=s.filter(u=>u!==t));const a=s.find(u=>u.textValue.toLowerCase().startsWith(n.toLowerCase()));return a!==t?a:void 0}function Wt(r,e){return r.map((t,o)=>r[(e+o)%r.length])}var Kt=je,$t=Ae,Gt=De,Yt=ke,qt=Le,Xt=Be,Zt=Ue,Qt=$e,Jt=Ge,eo=qe,to=Xe,oo=Ze;function uo(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Kt,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function po(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Gt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function fo(r){const e=ee.c(13);let t,o,n,c;e[0]!==r?({className:o,size:c,children:t,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c):(t=e[1],o=e[2],n=e[3],c=e[4]);const s=c===void 0?"default":c;let l;e[5]!==o?(l=oe("data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-lg bg-background px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[2px] card-shadow disabled:opacity-50 data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=xs]:h-6 data-[size=xs]:px-2.5 data-[size=xs]:py-1.5 data-[size=xs]:rounded-lg *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]===Symbol.for("react.memo_cache_sentinel")?(a=d.jsx(Yt,{asChild:!0,children:d.jsx(Re,{className:"size-4 opacity-50"})}),e[7]=a):a=e[7];let u;return e[8]!==t||e[9]!==n||e[10]!==s||e[11]!==l?(u=d.jsxs($t,{"data-slot":"select-trigger","data-size":s,className:l,...n,children:[t,a]}),e[8]=t,e[9]=n,e[10]=s,e[11]=l,e[12]=u):u=e[12],u}function mo(r){const e=ee.c(25);let t,o,n,c,s;e[0]!==r?({className:o,children:t,position:c,hideScrollButtons:s,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c,e[5]=s):(t=e[1],o=e[2],n=e[3],c=e[4],s=e[5]);const l=c===void 0?"popper":c,a=s===void 0?!1:s,u=l==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1";let h;e[6]!==o||e[7]!==u?(h=oe("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border shadow-md",u,o),e[6]=o,e[7]=u,e[8]=h):h=e[8];let g;e[9]!==a?(g=!a&&d.jsx(no,{}),e[9]=a,e[10]=g):g=e[10];const b=l==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let w;e[11]!==b?(w=oe("p-1",b),e[11]=b,e[12]=w):w=e[12];let S;e[13]!==t||e[14]!==w?(S=d.jsx(Zt,{className:w,children:t}),e[13]=t,e[14]=w,e[15]=S):S=e[15];let p;e[16]!==a?(p=!a&&d.jsx(ro,{}),e[16]=a,e[17]=p):p=e[17];let v;return e[18]!==l||e[19]!==n||e[20]!==h||e[21]!==g||e[22]!==S||e[23]!==p?(v=d.jsx(qt,{children:d.jsxs(Xt,{"data-slot":"select-content",className:h,position:l,...n,children:[g,S,p]})}),e[18]=l,e[19]=n,e[20]=h,e[21]=g,e[22]=S,e[23]=p,e[24]=v):v=e[24],v}function ho(r){const e=ee.c(16);let t,o,n,c;e[0]!==r?({className:o,children:t,hideCheck:c,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c):(t=e[1],o=e[2],n=e[3],c=e[4]);const s=c===void 0?!1:c;let l;e[5]!==o?(l=oe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]!==s?(a=!s&&d.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:d.jsx(eo,{children:d.jsx(wt,{className:"size-4"})})}),e[7]=s,e[8]=a):a=e[8];let u;e[9]!==t?(u=d.jsx(Jt,{children:t}),e[9]=t,e[10]=u):u=e[10];let h;return e[11]!==n||e[12]!==l||e[13]!==a||e[14]!==u?(h=d.jsxs(Qt,{"data-slot":"select-item",className:l,...n,children:[a,u]}),e[11]=n,e[12]=l,e[13]=a,e[14]=u,e[15]=h):h=e[15],h}function no(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=d.jsx(Ct,{className:"size-4"}),e[5]=c):c=e[5];let s;return e[6]!==o||e[7]!==n?(s=d.jsx(to,{"data-slot":"select-scroll-up-button",className:n,...o,children:c}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}function ro(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=d.jsx(Re,{className:"size-4"}),e[5]=c):c=e[5];let s;return e[6]!==o||e[7]!==n?(s=d.jsx(oo,{"data-slot":"select-scroll-down-button",className:n,...o,children:c}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}export{uo as S,fo as a,po as b,mo as c,ho as d,_e as e};
|