decocms 4.167.4 → 4.167.5
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-BXOs8pgi.js → AlertCircle-DdtdV7M4.js} +1 -1
- package/dist/client/assets/{AreaChart-C8CciM_k.js → AreaChart-D7FaG8Lf.js} +1 -1
- package/dist/client/assets/{ArrowUp-BFGzDO5k.js → ArrowUp-CpEPYAOf.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-h69wSa4W.js → ArrowUpRight-CHW6cpx0.js} +1 -1
- package/dist/client/assets/{Check-CKtI4hGn.js → Check-BwHliFRj.js} +1 -1
- package/dist/client/assets/{CheckCircle-CP9SNP9d.js → CheckCircle-CTIPijUa.js} +1 -1
- package/dist/client/assets/{ChevronDown-DfcP5Y1G.js → ChevronDown-CKkO8sAW.js} +1 -1
- package/dist/client/assets/{ChevronRight-BIlAcWT5.js → ChevronRight-B8f4wyDl.js} +1 -1
- package/dist/client/assets/{ChevronUp-SkDgfV9P.js → ChevronUp-C1afs1xa.js} +1 -1
- package/dist/client/assets/{Copy01-CjgXfC24.js → Copy01-BlkL52M8.js} +1 -1
- package/dist/client/assets/{CpuChip01-t2Y6TVWu.js → CpuChip01-Cs3gfrhP.js} +1 -1
- package/dist/client/assets/{DotsVertical-DTkYQ2kM.js → DotsVertical-BFrinGvO.js} +1 -1
- package/dist/client/assets/{Eye-D7uVxsd6.js → Eye-CQsjSohp.js} +1 -1
- package/dist/client/assets/{FilterLines-FPJrIJmP.js → FilterLines-oPoBPuqv.js} +1 -1
- package/dist/client/assets/{HardDrive-DLAbk7yi.js → HardDrive-CpV48xOn.js} +1 -1
- package/dist/client/assets/{Key01-BNEdMwqa.js → Key01-CIup5BVm.js} +1 -1
- package/dist/client/assets/{LayoutLeft-pwNqM9Bq.js → LayoutLeft-DrcKo4sm.js} +1 -1
- package/dist/client/assets/{LinkExternal01-CUFmEJ-r.js → LinkExternal01-CgpMIzO0.js} +1 -1
- package/dist/client/assets/{LogOut01-CL5erPho.js → LogOut01-uhMfgP0K.js} +1 -1
- package/dist/client/assets/{Monitor01-BTT_gkH0.js → Monitor01-BT8WHZmo.js} +1 -1
- package/dist/client/assets/{Palette-D4hJdFvA.js → Palette-CpgDl594.js} +1 -1
- package/dist/client/assets/{Play-BPaNNVsN.js → Play-BBCpB_Tz.js} +1 -1
- package/dist/client/assets/{Plus-DigHRvrB.js → Plus-DO9NbOAK.js} +1 -1
- package/dist/client/assets/{SearchLg-CcVjy7cv.js → SearchLg-Df6klb6Y.js} +1 -1
- package/dist/client/assets/{SearchMd-UJHWms5O.js → SearchMd-GYne36B-.js} +1 -1
- package/dist/client/assets/{Settings02-C2z8V4b1.js → Settings02-DerOgVc2.js} +1 -1
- package/dist/client/assets/{Shield01-CE6E4vWT.js → Shield01-gMQ1chGf.js} +1 -1
- package/dist/client/assets/{Star01-Cw9ulDl8.js → Star01-CH5MEDQn.js} +1 -1
- package/dist/client/assets/{Stars01-DqE2p9rj.js → Stars01-DAx8aZEr.js} +1 -1
- package/dist/client/assets/{Stars02-DKPhD_jS.js → Stars02-BG4AWaaX.js} +1 -1
- package/dist/client/assets/{Sun-quy8cVor.js → Sun-DPokUB7F.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-B7BlklUe.js → SwitchHorizontal01-B4ZgCyE5.js} +1 -1
- package/dist/client/assets/{Tool01-d6PLxuqZ.js → Tool01-Dn1kpGdl.js} +1 -1
- package/dist/client/assets/{Tool02-CG-MJEAZ.js → Tool02-DZ2vEkP4.js} +1 -1
- package/dist/client/assets/{Trash01-BEfNCj7H.js → Trash01-BOMqKZ1K.js} +1 -1
- package/dist/client/assets/{TrendUp01-CTjYh8Ln.js → TrendUp01-DwZeXU3a.js} +1 -1
- package/dist/client/assets/{Upload01-CSguqWGj.js → Upload01-S_KetqzT.js} +1 -1
- package/dist/client/assets/{User01-CN3QhMor.js → User01-HXIFsqtn.js} +1 -1
- package/dist/client/assets/{Users01-ALInePB-.js → Users01-ByuTyOLr.js} +1 -1
- package/dist/client/assets/{Users03-DBjTudH5.js → Users03-CI91FsuH.js} +1 -1
- package/dist/client/assets/{X-DvW6lnRi.js → X-B6K21IFp.js} +1 -1
- package/dist/client/assets/{XCircle-Fr7R0JyH.js → XCircle-Df3ZOY6R.js} +1 -1
- package/dist/client/assets/{XClose-yYL9HV11.js → XClose-DBug4o8k.js} +1 -1
- package/dist/client/assets/{Zap-B2AmO5T-.js → Zap-C9gRaG5K.js} +1 -1
- package/dist/client/assets/{ZapSquare-DHGjnuEa.js → ZapSquare-CPOIzhEC.js} +1 -1
- package/dist/client/assets/{access-gate-8z-Zjc69.js → access-gate-CScD5WwV.js} +1 -1
- package/dist/client/assets/{add-section-modal-DsiOPGLK.js → add-section-modal---WRWqCq.js} +1 -1
- package/dist/client/assets/{agent-icon-D0v0CAMQ.js → agent-icon-Dcc64Amv.js} +1 -1
- package/dist/client/assets/{agents-list-DYxy5a5k.js → agents-list-Cc9aJCuF.js} +1 -1
- package/dist/client/assets/{ai-providers-DMeor9A-.js → ai-providers-BSRRBbsG.js} +1 -1
- package/dist/client/assets/{alert-6lmsmlPy.js → alert-Bep9Lxpp.js} +1 -1
- package/dist/client/assets/{alert-dialog-DctPzbrJ.js → alert-dialog-tPwVc9uJ.js} +1 -1
- package/dist/client/assets/{app-editor-BSi2b5c2.js → app-editor-B6Hjw_Pg.js} +1 -1
- package/dist/client/assets/{auth-CVt7QHVR.js → auth-Q0kADPVB.js} +1 -1
- package/dist/client/assets/{auth-catchall-BBAoqWD1.js → auth-catchall-BGhPLdgj.js} +1 -1
- package/dist/client/assets/{auth-entry-BGQZOuqe.js → auth-entry-7vb620Uc.js} +1 -1
- package/dist/client/assets/{auth-split-layout-CjrJN_23.js → auth-split-layout-_MAsIBb7.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-DiCc1vu0.js → authenticate-and-persist-oauth-Dus5ShT0.js} +1 -1
- package/dist/client/assets/{automation-list-row-2xdC3lws.js → automation-list-row-eD1c19d3.js} +1 -1
- package/dist/client/assets/{automation-runs-BQK2qG6I.js → automation-runs-D7I8QaWS.js} +1 -1
- package/dist/client/assets/{automations-BQP8aSA2.js → automations-B6GTOD2v.js} +1 -1
- package/dist/client/assets/{avatar-DNua1J9J.js → avatar-3ae7eb9x.js} +1 -1
- package/dist/client/assets/{badge-p90WsvMa.js → badge-ClTHWVhH.js} +1 -1
- package/dist/client/assets/{block-document-gAmyXvk5.js → block-document-DoV2ApVE.js} +1 -1
- package/dist/client/assets/{brand-context-BfD_K-Ti.js → brand-context-DU88wlq-.js} +1 -1
- package/dist/client/assets/{buckets-CFmjd9DE.js → buckets-Dv64V13u.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-CyIrpC-y.js → bulk-category-panel-D9d-CPZi.js} +1 -1
- package/dist/client/assets/{calendar-CsE8P_v6.js → calendar-CaFuCBn0.js} +1 -1
- package/dist/client/assets/{capability-load-error-BwIQSVk2.js → capability-load-error-Bb2HUhlv.js} +1 -1
- package/dist/client/assets/{card-CAY4LRtc.js → card-BkMfo3-L.js} +1 -1
- package/dist/client/assets/{category-editor-08CLTJQC.js → category-editor-95YwksDq.js} +1 -1
- package/dist/client/assets/{chat-context-CZ8b18Fc.js → chat-context-CklmWc6u.js} +1 -1
- package/dist/client/assets/{checkbox-CpkMAAxs.js → checkbox-BXAaMwzS.js} +1 -1
- package/dist/client/assets/{cli-auth-success-CGJ8yhJu.js → cli-auth-success-Dgklezpk.js} +1 -1
- package/dist/client/assets/{collection-detail-5DB4iz01.js → collection-detail-8NE3cr65.js} +1 -1
- package/dist/client/assets/{collection-display-button-CdVHGe1g.js → collection-display-button-CyKBEium.js} +1 -1
- package/dist/client/assets/{collection-search-BXhZ3O1D.js → collection-search-CgEc7JVV.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-BzYCc6H4.js → collection-table-wrapper-DwhAFC5W.js} +1 -1
- package/dist/client/assets/{collection-tabs-BMBpTAbo.js → collection-tabs-jHD3PV9U.js} +1 -1
- package/dist/client/assets/{command-BOE7MzSb.js → command-DUTyl3qs.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-B0diSDM4.js → commerce-onboarding-DYZssxx_.js} +1 -1
- package/dist/client/assets/{companions-core-BmlZqb3z.js → companions-core-DdNaKkOK.js} +1 -1
- package/dist/client/assets/{connect-NJbaa1Dq.js → connect-DnZs58Fx.js} +1 -1
- package/dist/client/assets/{connection-card-DdoyOAg3.js → connection-card-BoLbm0Lq.js} +1 -1
- package/dist/client/assets/{connection-detail-w7-8BS05.js → connection-detail-CuzNCThW.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-D6bw0HEg.js → connection-form-helpers-MuJLCV8m.js} +1 -1
- package/dist/client/assets/{connection-BvHGO9d1.js → connection-yFrSB_Ck.js} +1 -1
- package/dist/client/assets/{connections-WZ8-STzM.js → connections-C4UBN-Ku.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-B682c9RZ.js → decopilot-sse-pool-C9wT7nFZ.js} +1 -1
- package/dist/client/assets/{dialog-CRj0zBQ_.js → dialog-Y2c_xFO9.js} +1 -1
- package/dist/client/assets/{domain-settings-D51GX1ZP.js → domain-settings-BixkB4wg.js} +1 -1
- package/dist/client/assets/{drawer-ZyqfN_k8.js → drawer-Dn6DCG1a.js} +1 -1
- package/dist/client/assets/{dropdown-menu-BaxzJoD1.js → dropdown-menu-hQO8uf9z.js} +1 -1
- package/dist/client/assets/{empty-state-CX0ihzR5.js → empty-state-BYwKHc7l.js} +1 -1
- package/dist/client/assets/{extract-connection-data-DY9nlWot.js → extract-connection-data-C2o6ZTIY.js} +1 -1
- package/dist/client/assets/{file-explorer-DTnN5mkB.js → file-explorer-D4pNhhOc.js} +1 -1
- package/dist/client/assets/{form-r7LLoRlt.js → form-92MvHLxT.js} +1 -1
- package/dist/client/assets/{general-BPd6Q1nT.js → general-CCHZeIqH.js} +1 -1
- package/dist/client/assets/{github-repo-picker-C4LbYEVp.js → github-repo-picker-CgWDATG6.js} +1 -1
- package/dist/client/assets/{hooks-C_nIzkQJ.js → hooks-VEM1hLto.js} +1 -1
- package/dist/client/assets/{index-BDYacwdo.js → index-BAPkgzXp.js} +1 -1
- package/dist/client/assets/{index-BD1XIck_.js → index-BIINGXKR.js} +3 -3
- package/dist/client/assets/{index-Y5IRZDB7.js → index-BTg6jfKl.js} +5 -5
- package/dist/client/assets/{index-bW9oPKeA.js → index-C2-dhaI-.js} +1 -1
- package/dist/client/assets/{index-CKKq15hA.js → index-CG2piyb3.js} +1 -1
- package/dist/client/assets/{index-CsMY3E0n.js → index-Ct5z4bLK.js} +3 -3
- package/dist/client/assets/{index-B6b7-ndb.js → index-D3cRbFZn.js} +1 -1
- package/dist/client/assets/{index-D56QVQ2L.js → index-DCk4UwEM.js} +1 -1
- package/dist/client/assets/{index-BF6I2QS7.js → index-DWnwwFPu.js} +1 -1
- package/dist/client/assets/{index-DauQBNEJ.js → index-DXYTRa9w.js} +1 -1
- package/dist/client/assets/{index-Bur1TB7U.js → index-cp39w1Sm.js} +1 -1
- package/dist/client/assets/{index-redirect-Di0ZRgqA.js → index-redirect-mcpsT-db.js} +1 -1
- package/dist/client/assets/{input-Bxlv4wq5.js → input-J1mhqAdN.js} +1 -1
- package/dist/client/assets/{integration-icon-BnGA9SX5.js → integration-icon-C2mjeHEI.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-CIwtalGm.js → invite-member-dialog-CNAKazL-.js} +1 -1
- package/dist/client/assets/{label-CPAOOmgU.js → label-CXy-_gNr.js} +1 -1
- package/dist/client/assets/{layout-msWgxbNB.js → layout-X5hM7nOr.js} +1 -1
- package/dist/client/assets/{login-C36k4ZEx.js → login-BbQ5kAsz.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BBshTxEG.js → mcp-oauth-C2w2n5sc.js} +1 -1
- package/dist/client/assets/{members-BJnujW0k.js → members-DCcNOZYQ.js} +1 -1
- package/dist/client/assets/{monaco-editor-pAlq3Hbk.js → monaco-editor-BlUBHNk6.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-BG7ttYuz.js → monitoring-stats-row-C8t8xcl-.js} +1 -1
- package/dist/client/assets/{multi-select-qotXRxVG.js → multi-select-Bsz4hp3f.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-DUZnMuan.js → oauth-callback-ai-provider-CW0zzOtE.js} +1 -1
- package/dist/client/assets/{oauth-callback-DGSSyNOQ.js → oauth-callback-nGTeJjL9.js} +1 -1
- package/dist/client/assets/{onboarding-CHd3Ety4.js → onboarding-Bsyf93ke.js} +1 -1
- package/dist/client/assets/{org-layout-DTr6NF05.js → org-layout-B7FeJv1e.js} +1 -1
- package/dist/client/assets/{organization-choice-CeJCjdWH.js → organization-choice-Izk-OEPw.js} +1 -1
- package/dist/client/assets/{orgs-BwxsxSe_.js → orgs-C32kHiDb.js} +1 -1
- package/dist/client/assets/{page-seo-form-D0xtD3rR.js → page-seo-form-Cl2_e8dB.js} +1 -1
- package/dist/client/assets/{popover-DJARnKJN.js → popover-CqIaLo6d.js} +1 -1
- package/dist/client/assets/{post-editor-B3yOO9Jy.js → post-editor-CdNgXoS-.js} +1 -1
- package/dist/client/assets/{primitives-BmYJCXvO.js → primitives-Crc8xFCt.js} +1 -1
- package/dist/client/assets/{profile-BA45RqWa.js → profile-BEXHPCef.js} +1 -1
- package/dist/client/assets/project-app-view-Caj-wVy9.js +1 -0
- package/dist/client/assets/record-editor-Gg2yYvWK.js +1 -0
- package/dist/client/assets/{redirect-editor-cTl0Zx_4.js → redirect-editor-CECrXl-i.js} +1 -1
- package/dist/client/assets/registry-CrwbPuRI.js +2 -0
- package/dist/client/assets/{registry-layout-CwYqOrKQ.js → registry-layout-1tl7K2yu.js} +1 -1
- package/dist/client/assets/{reports-krQamnYh.js → reports-Dec6vyLn.js} +1 -1
- package/dist/client/assets/{require-capability-CFPLqPWb.js → require-capability-Cws6dYpT.js} +1 -1
- package/dist/client/assets/{required-auth-layout-BB-yluZd.js → required-auth-layout-CKzC4Wry.js} +1 -1
- package/dist/client/assets/{reset-password-tBeq6iDe.js → reset-password-CF1AWZ9e.js} +1 -1
- package/dist/client/assets/{roles-CN9bPOqD.js → roles-D74h0S27.js} +1 -1
- package/dist/client/assets/{search-input-DoOBid5A.js → search-input-zDL_p_LQ.js} +1 -1
- package/dist/client/assets/{secrets-CdSh-98G.js → secrets-8wXE75XO.js} +1 -1
- package/dist/client/assets/{sections-editor-BSuE7v7K.js → sections-editor-BlTn3Sit.js} +1 -1
- package/dist/client/assets/{select-Bv-2ewD2.js → select-Ctd_ZZ0k.js} +1 -1
- package/dist/client/assets/{select-model-DGHQ7XQO.js → select-model-CRAkLaCL.js} +1 -1
- package/dist/client/assets/{self-tool-result-BJVDpzHC.js → self-tool-result-BCYw36Eu.js} +1 -1
- package/dist/client/assets/{seo-editor-BiXc5-eM.js → seo-editor-BKDYZkhV.js} +1 -1
- package/dist/client/assets/{settings-layout-2gF7ZghW.js → settings-layout-B5JYfisv.js} +1 -1
- package/dist/client/assets/{settings-section-DlAvH5Ow.js → settings-section-B_1oLymV.js} +1 -1
- package/dist/client/assets/{shell-controls-ui9DsV1B.js → shell-controls-D3ipd2jw.js} +1 -1
- package/dist/client/assets/{shell-layout-_reN3Shc.js → shell-layout-1C4_PYHs.js} +1 -1
- package/dist/client/assets/{sidebar-ChD8CCYT.js → sidebar-CAZ2FyoU.js} +1 -1
- package/dist/client/assets/{skeleton-C65ogTvo.js → skeleton-tW3UOR15.js} +1 -1
- package/dist/client/assets/{spinner-_TqSaOQN.js → spinner-BVMuKuHb.js} +1 -1
- package/dist/client/assets/{sso-BqBxDadH.js → sso-BFHTrmFE.js} +1 -1
- package/dist/client/assets/{store-T98vssIu.js → store-BL5oTmqc.js} +1 -1
- package/dist/client/assets/store-registry-CaYPeu2J.js +2 -0
- package/dist/client/assets/{studio-tools-DfsuYmJt.js → studio-tools-D0M8AyaL.js} +1 -1
- package/dist/client/assets/{switch-lfu04CGM.js → switch-DskVyYCS.js} +1 -1
- package/dist/client/assets/{tab-id-BqPdm69o.js → tab-id-BhaxduZ_.js} +1 -1
- package/dist/client/assets/{table-C2TMn1li.js → table-DrUjEYlL.js} +1 -1
- package/dist/client/assets/{tabs-oVlPQ_HA.js → tabs-DjKkhJF-.js} +1 -1
- package/dist/client/assets/{textarea-Bn4a6Dgo.js → textarea-BroNzwSJ.js} +1 -1
- package/dist/client/assets/{toggle-group-BRzf8EHW.js → toggle-group-BsjhKaUR.js} +1 -1
- package/dist/client/assets/{toolbar-DYLo2f04.js → toolbar-TQryde5B.js} +1 -1
- package/dist/client/assets/{tooltip-Cpi2mja1.js → tooltip-DcvI3Qmq.js} +1 -1
- package/dist/client/assets/{use-ai-providers-DFQIA0YS.js → use-ai-providers-BWHJhqYW.js} +1 -1
- package/dist/client/assets/{use-automations-CwyD7KUw.js → use-automations-CZHCGQrS.js} +1 -1
- package/dist/client/assets/{use-autosave-DEblj-jV.js → use-autosave-C7cBRroM.js} +1 -1
- package/dist/client/assets/{use-capability-Cc8HiELK.js → use-capability-7L6HM4-F.js} +1 -1
- package/dist/client/assets/{use-clock-tick--ht2pzb8.js → use-clock-tick-BWJoXcll.js} +1 -1
- package/dist/client/assets/{use-connection-CSBpX4PU.js → use-connection-COSULjHn.js} +1 -1
- package/dist/client/assets/{use-copy-DTInUOoW.js → use-copy-DkOP7abA.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-CMUKV_-M.js → use-create-virtual-mcp-C2ATuS8O.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-2vwUh_VG.js → use-debounced-autosave-Hz9sqsxr.js} +1 -1
- package/dist/client/assets/{use-debounced-value-CwhSCFuf.js → use-debounced-value-DqJiqnYk.js} +1 -1
- package/dist/client/assets/{use-deco-credits-DvYCBBFc.js → use-deco-credits-BHzyr0wR.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-DM97rtIw.js → use-decopilot-events-DhC1PW_6.js} +1 -1
- package/dist/client/assets/{use-delete-connection-B58V-_B1.js → use-delete-connection-JY4ayTjm.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-CF8Zio-a.js → use-deployment-admin-DCJNChjl.js} +1 -1
- package/dist/client/assets/{use-file-configs-Eq9DEvtL.js → use-file-configs-shCGf-89.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-BhWnCwa_.js → use-infinite-scroll-BQbD3RgJ.js} +1 -1
- package/dist/client/assets/{use-join-requests-Babs1XE8.js → use-join-requests-Eybe4FCk.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-8kwewAjR.js → use-mcp-auth-status-B3eaajte.js} +1 -1
- package/dist/client/assets/{use-mcp-client-CpOZK5-l.js → use-mcp-client-B2w_Vv7G.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-CqY2nbaz.js → use-mcp-tools-CpiBQMkC.js} +1 -1
- package/dist/client/assets/{use-members-DsksLoYY.js → use-members-1iyOisn8.js} +1 -1
- package/dist/client/assets/{use-mobile-ieOqtEHL.js → use-mobile-CEeeXHm_.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-DBGPkYj0.js → use-navigate-to-agent-DtRj8Nu_.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-BU-wvvoc.js → use-org-auth-client-Bcl40eqI.js} +1 -1
- package/dist/client/assets/{use-org-sso-DOw7Tfv8.js → use-org-sso-CM7UG764.js} +1 -1
- package/dist/client/assets/{use-organization-roles-Dcy4uPK8.js → use-organization-roles-D5PTbPg1.js} +1 -1
- package/dist/client/assets/{use-organization-settings-CVw_W4UD.js → use-organization-settings-CyU2O9C4.js} +1 -1
- package/dist/client/assets/{use-registry-connections-BPju-Y9r.js → use-registry-connections-DRTunUDV.js} +1 -1
- package/dist/client/assets/{use-secrets-CaSIcPta.js → use-secrets-DzfLLYjI.js} +1 -1
- package/dist/client/assets/{use-status-sounds-BgT_jGkq.js → use-status-sounds-BsT1VQN-.js} +1 -1
- package/dist/client/assets/{use-tags-C7XcT7ZI.js → use-tags-B4S441L8.js} +1 -1
- package/dist/client/assets/{use-view-mode-ChsGe0PO.js → use-view-mode-CHvTaXmO.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-6MeqW-FL.js → use-virtual-mcp-DmnaO1IL.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-ddyR5cpH.js +1 -0
- package/dist/client/assets/{useQueries-B5JmsTek.js → useQueries-D3Lp43ym.js} +1 -1
- package/dist/client/assets/{useRouterState-Ch85_6Dg.js → useRouterState-C3P1iOeR.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-D4QmwKBY.js +1 -0
- package/dist/client/assets/{users-CAHjBk9x.js → users-jpxk8SpM.js} +1 -1
- package/dist/client/assets/{variant-calendar-DwnAVLtp.js → variant-calendar-DLLlNEC5.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-D9-ncCO8.js → view-mode-toggle-mSOu7veP.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/project-app-view-D64d6xFs.js +0 -1
- package/dist/client/assets/record-editor-CkXMC3NF.js +0 -1
- package/dist/client/assets/registry-VbA6qBLr.js +0 -2
- package/dist/client/assets/store-registry-BcExQn86.js +0 -2
- package/dist/client/assets/useInfiniteQuery-D_QXkkfk.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-C2EK0lz_.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as Ue,b as ct,r as w,m as Oe,j as n,ag as Yn,B as Qe,k as Jn,o as Na,t as X,K as Da}from"./index-CsMY3E0n.js";import{a6 as Ta,a7 as Pa,a8 as Aa,a9 as Qn,aa as Xn,ab as Ca,ac as Ma,ad as Ka,N as La,ae as Ba,af as Ct,ag as Fa,S as Zn,ah as lt,ai as Oa,aj as Ia,ak as $a,al as za,D as Ha,F as Ga,am as Ua,an as Wa,ao as qa,ap as Ya,a0 as Gt,aq as Ut,ar as Ja,as as xt,at as Tt,au as Qa,av as Xa,aw as tt,ax as Mn,ay as Za,az as Pt,aA as Wt,aB as eo,aC as dn,aD as to,aE as wt,aF as no,aG as so,aH as ao,aI as oo,aJ as ro,aK as bt,aL as io,aM as lo,aN as co,H as uo,aO as Kn,aP as At,aQ as Ln,aR as Bn,aS as mo,aT as fo,aU as po,aV as go,aW as mn,aX as Fn,aY as On,aZ as Vt,a_ as qt,a$ as In,b0 as ho,b1 as fn,b2 as vo,b3 as So,b4 as xo,b5 as bo,b6 as yo}from"./index-Y5IRZDB7.js";import{t as _o}from"./ChevronDown-DfcP5Y1G.js";import{a3 as gn,x as jo,X as es,I as Eo,w as ts,a5 as ko,a6 as Ro}from"./agent-icon-D0v0CAMQ.js";import{i as ns}from"./ChevronRight-BIlAcWT5.js";import{n as wo}from"./ChevronUp-SkDgfV9P.js";import{i as Vo}from"./Tool02-CG-MJEAZ.js";import{l as Yt}from"./automation-runs-BQK2qG6I.js";import{c as yt,T as _t,a as jt}from"./tooltip-Cpi2mja1.js";import{b as No,h as Do,a as To,c as Po,d as Ao,e as Co}from"./dialog-CRj0zBQ_.js";import{I as Mo}from"./input-Bxlv4wq5.js";import{a as ss}from"./Copy01-CjgXfC24.js";import{i as Ko}from"./Settings02-C2z8V4b1.js";import{s as Lo}from"./Eye-D7uVxsd6.js";import{s as as}from"./TrendUp01-CTjYh8Ln.js";import{s as hn}from"./Plus-DigHRvrB.js";import{s as os}from"./Trash01-BEfNCj7H.js";import{i as Bo}from"./Zap-B2AmO5T-.js";import{a as ht,D as rs,b as is,c as ls,i as Fo}from"./dropdown-menu-BaxzJoD1.js";import{o as cs,p as Jt,K as us,P as ds,q as ms,z as fs,C as ps,A as gs,B as Mt,D as hs,v as vs,x as Ss,y as xs}from"./index-BD1XIck_.js";import{S as Oo,r as $n,u as Io,d as $o,a as zo,i as Ho,f as Go,P as Uo,b as Wo}from"./page-seo-form-D0xtD3rR.js";import{c as qo}from"./Tool01-d6PLxuqZ.js";import{A as Yo}from"./add-section-modal-DsiOPGLK.js";import"./ArrowUp-BFGzDO5k.js";import"./chat-context-CZ8b18Fc.js";import"./tab-id-BqPdm69o.js";import"./Check-CKtI4hGn.js";import"./hooks-C_nIzkQJ.js";import"./use-mcp-client-CpOZK5-l.js";import"./auth-CVt7QHVR.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-B682c9RZ.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-6MeqW-FL.js";import"./use-ai-providers-DFQIA0YS.js";import"./studio-tools-DfsuYmJt.js";import"./use-decopilot-events-DM97rtIw.js";import"./use-organization-settings-CVw_W4UD.js";import"./spinner-_TqSaOQN.js";import"./drawer-ZyqfN_k8.js";import"./collection-search-BXhZ3O1D.js";import"./SearchMd-UJHWms5O.js";import"./use-mobile-ieOqtEHL.js";import"./AreaChart-C8CciM_k.js";import"./index-BF6I2QS7.js";import"./calendar-CsE8P_v6.js";import"./X-DvW6lnRi.js";import"./shell-layout-_reN3Shc.js";import"./avatar-DNua1J9J.js";import"./User01-CN3QhMor.js";import"./Users03-DBjTudH5.js";import"./SearchLg-CcVjy7cv.js";import"./Stars02-DKPhD_jS.js";import"./XClose-yYL9HV11.js";import"./CheckCircle-CP9SNP9d.js";import"./CpuChip01-t2Y6TVWu.js";import"./FilterLines-FPJrIJmP.js";import"./Monitor01-BTT_gkH0.js";import"./required-auth-layout-BB-yluZd.js";import"./use-org-sso-DOw7Tfv8.js";import"./ZapSquare-DHGjnuEa.js";import"./Star01-Cw9ulDl8.js";import"./Upload01-CSguqWGj.js";import"./AlertCircle-BXOs8pgi.js";import"./form-r7LLoRlt.js";import"./label-CPAOOmgU.js";import"./select-Bv-2ewD2.js";import"./XCircle-Fr7R0JyH.js";import"./tabs-oVlPQ_HA.js";import"./toggle-group-BRzf8EHW.js";import"./use-deco-credits-DvYCBBFc.js";import"./sidebar-ChD8CCYT.js";import"./LayoutLeft-pwNqM9Bq.js";import"./popover-DJARnKJN.js";import"./alert-dialog-DctPzbrJ.js";import"./toolbar-DYLo2f04.js";import"./skeleton-C65ogTvo.js";import"./github-repo-picker-C4LbYEVp.js";import"./use-debounced-value-CwhSCFuf.js";import"./use-connection-CSBpX4PU.js";import"./authenticate-and-persist-oauth-DiCc1vu0.js";import"./mcp-oauth-BBshTxEG.js";import"./LinkExternal01-CUFmEJ-r.js";import"./use-mcp-tools-CqY2nbaz.js";import"./extract-connection-data-DY9nlWot.js";import"./metadata-dUsYcpuu.js";import"./use-navigate-to-agent-DBGPkYj0.js";import"./reusable-new-chat-CouMjkYR.js";import"./provision-repo-scoped-github-connection-CAXumITS.js";import"./agent-capabilities-cXfbMfjV.js";import"./connection-card-DdoyOAg3.js";import"./use-registry-connections-BPju-Y9r.js";import"./useInfiniteQuery-D_QXkkfk.js";import"./use-infinite-scroll-BhWnCwa_.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./card-CAY4LRtc.js";import"./integration-icon-BnGA9SX5.js";import"./textarea-Bn4a6Dgo.js";import"./connection-form-helpers-D6bw0HEg.js";import"./collection-tabs-BMBpTAbo.js";import"./badge-p90WsvMa.js";import"./useSuspenseInfiniteQuery-C2EK0lz_.js";import"./select-model-DGHQ7XQO.js";import"./checkbox-CpkMAAxs.js";import"./Key01-BNEdMwqa.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-DlAvH5Ow.js";import"./ArrowUpRight-h69wSa4W.js";import"./Stars01-DqE2p9rj.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-BgT_jGkq.js";import"./empty-state-CX0ihzR5.js";import"./deco-site-production-url-CaKZ7xBn.js";import"./use-capability-Cc8HiELK.js";import"./monaco-editor-pAlq3Hbk.js";import"./pt-BR-CLy76QW2.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-mcp-auth-status-8kwewAjR.js";import"./DotsVertical-DTkYQ2kM.js";import"./Play-BPaNNVsN.js";import"./use-debounced-autosave-2vwUh_VG.js";import"./index-Bur1TB7U.js";import"./search-input-DoOBid5A.js";import"./switch-lfu04CGM.js";import"./Users01-ALInePB-.js";import"./use-secrets-CaSIcPta.js";import"./format-time-BnbuEtat.js";import"./use-members-DsksLoYY.js";import"./use-org-auth-client-BU-wvvoc.js";import"./command-BOE7MzSb.js";import"./index-bW9oPKeA.js";import"./useQueries-B5JmsTek.js";import"./SwitchHorizontal01-B7BlklUe.js";import"./Palette-D4hJdFvA.js";import"./use-file-configs-Eq9DEvtL.js";import"./use-automations-CwyD7KUw.js";import"./automation-list-row-2xdC3lws.js";import"./get-initials-D-f_fDFw.js";import"./HardDrive-DLAbk7yi.js";import"./LogOut01-CL5erPho.js";import"./Sun-quy8cVor.js";import"./Shield01-CE6E4vWT.js";import"./table-C2TMn1li.js";import"./use-clock-tick--ht2pzb8.js";import"./use-copy-DTInUOoW.js";import"./use-tags-C7XcT7ZI.js";import"./companions-core-BmlZqb3z.js";function Jo(h){return h.schema?.definitions??h.schema?.$defs??{}}function Qo(h,e){const o=Jo(e),d=o[btoa(h)];if(!d)return;let m=typeof d.image=="string"?d.image:void 0;if(!m&&Array.isArray(d.allOf)){const x=d.allOf.find(b=>typeof b.$ref=="string")?.$ref;if(typeof x=="string"){const b=x.replace("#/definitions/",""),f=o[b];m=typeof f?.image=="string"?f.image:void 0}}if(m?.includes("{{{"))return m}function Xo(h,e){if(!e)return;const o=Ta(h);if(!o)return;const d=Qo(o.resolveType,e);if(!d)return;const m=Pa(d,o.data);if(m)return Aa(m)}const Zo="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",er="text-global-section-fg focus:bg-global-section/12 focus:text-global-section-fg dark:text-global-section-fg-dark dark:focus:bg-global-section/15 dark:focus:text-global-section-fg-dark [&_svg]:!text-global-section";function zn(h){return Array.from({length:h},(e,o)=>({id:crypto.randomUUID(),index:o}))}function bs(h){return h.map((e,o)=>({...e,index:o}))}function tr(h,e){if(e===h.length)return h;if(e<h.length)return bs(h.slice(0,e));const o=Array.from({length:e-h.length},(d,m)=>({id:crypto.randomUUID(),index:h.length+m}));return[...h,...o]}function ys(h){const e=Ue.c(20),{section:o,raw:d,meta:m}=h,x=o.isSavedBlock===!0,b=o.isMultivariate===!0;let f;e[0]!==m||e[1]!==d?(f=d&&m?Xo(d,m):void 0,e[0]=m,e[1]=d,e[2]=f):f=e[2];const v=f;let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(jo,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[3]=u):u=e[3];let y;e[4]!==v?(y=v&&n.jsx("img",{src:v,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[4]=v,e[5]=y):y=e[5];let k;e[6]!==b||e[7]!==x?(k=x?{color:La}:b?{color:"oklch(0.65 0.15 160)"}:void 0,e[6]=b,e[7]=x,e[8]=k):k=e[8];let D;e[9]!==k?(D=n.jsx(gn,{className:"h-4 w-4 shrink-0",style:k}),e[9]=k,e[10]=D):D=e[10];const E=o.isHidden&&"line-through opacity-50";let i;e[11]!==E?(i=Oe("min-w-0 flex-1 truncate text-sm font-medium",E),e[11]=E,e[12]=i):i=e[12];let g;e[13]!==o.label||e[14]!==i?(g=n.jsx("span",{className:i,children:o.label}),e[13]=o.label,e[14]=i,e[15]=g):g=e[15];let r;return e[16]!==y||e[17]!==D||e[18]!==g?(r=n.jsxs(n.Fragment,{children:[u,y,D,g]}),e[16]=y,e[17]=D,e[18]=g,e[19]=r):r=e[19],r}function _s(h,e){const o=h.isSavedBlock===!0,d=h.isMultivariate===!0;return Oe("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":o?Zo:d?"text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]":"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function nr(h){const e=Ue.c(81),{section:o,raw:d,meta:m,sortableId:x,selected:b,onSelect:f,onDelete:v,onDuplicate:u,onMakeReusable:y,onToggleHidden:k,onToggleLazy:D,onAddVariant:E,onDetach:i}=h,g=ct(),r=d?Xn(d.__resolveType??""):!1;let A;e[0]!==o?(A=Ca(o),e[0]=o,e[1]=A):A=e[1];const l=A;let R;e[2]!==x?(R={id:x,animateLayoutChanges:ir},e[2]=x,e[3]=R):R=e[3];const{attributes:K,listeners:z,setNodeRef:p,transform:N,isDragging:ie}=fs(R);let L;e[4]!==N?(L=ps.Transform.toString(N?{...N,x:0}:null),e[4]=N,e[5]=L):L=e[5];const ce=ie?0:void 0;let M;e[6]!==L||e[7]!==ce?(M={transform:L,opacity:ce},e[6]=L,e[7]=ce,e[8]=M):M=e[8];const ge=M;let O;e[9]!==o?(O=Ma(o),e[9]=o,e[10]=O):O=e[10];const ne=O,he="button",me=0;let I;e[11]!==f?(I=T=>{(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),f())},e[11]=f,e[12]=I):I=e[12];const J=ie?"cursor-grabbing":"cursor-pointer";let Z;e[13]!==o||e[14]!==b||e[15]!==J?(Z=Oe("touch-none transition-colors",J,_s(o,b)),e[13]=o,e[14]=b,e[15]=J,e[16]=Z):Z=e[16];let ee;e[17]!==m||e[18]!==d||e[19]!==o?(ee=n.jsx(ys,{section:o,raw:d,meta:m}),e[17]=m,e[18]=d,e[19]=o,e[20]=ee):ee=e[20];const $=!o.isMultivariate&&n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":g(r?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:Oe("h-7 w-7 shrink-0",r?"":"opacity-0 group-hover:opacity-100"),onClick:T=>{T.stopPropagation(),D()},onPointerDown:rr,children:n.jsx(Bo,{className:Oe("h-3.5 w-3.5",r&&"text-yellow-500")})})}),n.jsx(jt,{side:"bottom",children:g(r?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]});let Ae;e[21]!==k||e[22]!==o.isHidden||e[23]!==o.isMultivariate||e[24]!==g?(Ae=!o.isMultivariate&&n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":o.isHidden?g("sectionsEditor.sectionList.showSection"):g("sectionsEditor.sectionList.hideSection"),className:Oe("h-7 w-7 shrink-0",o.isHidden?"opacity-100":"opacity-0 group-hover:opacity-100"),onClick:T=>{T.stopPropagation(),k()},onPointerDown:or,children:o.isHidden?n.jsx(Ko,{className:"h-3.5 w-3.5"}):n.jsx(Lo,{className:"h-3.5 w-3.5"})})}),n.jsx(jt,{side:"bottom",children:o.isHidden?g("sectionsEditor.sectionList.showSection"):g("sectionsEditor.sectionList.hideSection")})]}),e[21]=k,e[22]=o.isHidden,e[23]=o.isMultivariate,e[24]=g,e[25]=Ae):Ae=e[25];let Me;e[26]!==g?(Me=g("sectionsEditor.sectionList.sectionActionsMenu"),e[26]=g,e[27]=Me):Me=e[27];let et;e[28]===Symbol.for("react.memo_cache_sentinel")?(et=n.jsx(es,{className:"h-3.5 w-3.5"}),e[28]=et):et=e[28];let Se;e[29]!==Me?(Se=n.jsx(rs,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":Me,className:"h-7 w-7 shrink-0 opacity-0 group-hover:opacity-100",onClick:ar,onPointerDown:sr,children:et})}),e[29]=Me,e[30]=Se):Se=e[30];let H;e[31]!==u?(H=T=>{T.stopPropagation(),u()},e[31]=u,e[32]=H):H=e[32];let se;e[33]===Symbol.for("react.memo_cache_sentinel")?(se=n.jsx(ss,{className:"h-4 w-4"}),e[33]=se):se=e[33];let ae;e[34]!==g?(ae=g("sectionsEditor.sectionList.duplicateMenuItem"),e[34]=g,e[35]=ae):ae=e[35];let ue;e[36]!==H||e[37]!==ae?(ue=n.jsxs(ht,{onClick:H,children:[se,ae]}),e[36]=H,e[37]=ae,e[38]=ue):ue=e[38];let oe;e[39]!==l||e[40]!==E||e[41]!==g?(oe=l&&n.jsxs(ht,{className:Ka,onClick:T=>{T.stopPropagation(),E()},children:[n.jsx(as,{className:"h-4 w-4"}),g("sectionsEditor.sectionList.addVariantMenuItem")]}),e[39]=l,e[40]=E,e[41]=g,e[42]=oe):oe=e[42];let de;e[43]!==ne||e[44]!==y||e[45]!==g?(de=ne&&n.jsxs(ht,{className:er,onClick:T=>{T.stopPropagation(),y()},children:[n.jsx(gn,{className:"h-4 w-4"}),g("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[43]=ne,e[44]=y,e[45]=g,e[46]=de):de=e[46];let le;e[47]!==i||e[48]!==o.isMultivariate||e[49]!==o.isSavedBlock||e[50]!==g?(le=o.isSavedBlock===!0&&!o.isMultivariate&&n.jsxs(ht,{onClick:T=>{T.stopPropagation(),i()},children:[n.jsx(gn,{className:"h-4 w-4"}),g("sectionsEditor.sectionList.detachMenuItem")]}),e[47]=i,e[48]=o.isMultivariate,e[49]=o.isSavedBlock,e[50]=g,e[51]=le):le=e[51];let fe;e[52]!==v?(fe=T=>{T.stopPropagation(),v()},e[52]=v,e[53]=fe):fe=e[53];let De;e[54]===Symbol.for("react.memo_cache_sentinel")?(De=n.jsx(os,{className:"h-4 w-4"}),e[54]=De):De=e[54];let je;e[55]!==g?(je=g("sectionsEditor.sectionList.deleteMenuItem"),e[55]=g,e[56]=je):je=e[56];let re;e[57]!==fe||e[58]!==je?(re=n.jsxs(ht,{className:"text-destructive focus:text-destructive",onClick:fe,children:[De,je]}),e[57]=fe,e[58]=je,e[59]=re):re=e[59];let pe;e[60]!==ue||e[61]!==oe||e[62]!==de||e[63]!==le||e[64]!==re?(pe=n.jsxs(is,{align:"end",className:"w-44",children:[ue,oe,de,le,re]}),e[60]=ue,e[61]=oe,e[62]=de,e[63]=le,e[64]=re,e[65]=pe):pe=e[65];let xe;e[66]!==Se||e[67]!==pe?(xe=n.jsxs(ls,{children:[Se,pe]}),e[66]=Se,e[67]=pe,e[68]=xe):xe=e[68];let be;return e[69]!==K||e[70]!==z||e[71]!==f||e[72]!==p||e[73]!==ge||e[74]!==Z||e[75]!==ee||e[76]!==$||e[77]!==Ae||e[78]!==xe||e[79]!==I?(be=n.jsxs("div",{ref:p,style:ge,...K,...z,role:he,tabIndex:me,onClick:f,onKeyDown:I,className:Z,children:[ee,$,Ae,xe]}),e[69]=K,e[70]=z,e[71]=f,e[72]=p,e[73]=ge,e[74]=Z,e[75]=ee,e[76]=$,e[77]=Ae,e[78]=xe,e[79]=I,e[80]=be):be=e[80],be}function sr(h){return h.stopPropagation()}function ar(h){return h.stopPropagation()}function or(h){return h.stopPropagation()}function rr(h){return h.stopPropagation()}function ir(){return!1}function lr(h){const e=Ue.c(104),{listKey:o,rawSections:d,sections:m,meta:x,selectedIndex:b,onSelect:f,onReorder:v,onDelete:u,onDuplicate:y,onMakeReusable:k,onToggleHidden:D,onToggleLazy:E,onAddVariant:i,onDetach:g,onAddSection:r,canAddSection:A}=h,l=A===void 0?!0:A,R=ct();let K;e[0]!==m.length?(K=()=>zn(m.length),e[0]=m.length,e[1]=K):K=e[1];const[z,p]=w.useState(K),[N,ie]=w.useState(null),[L,ce]=w.useState(o),[M,ge]=w.useState(m.length),O=w.useRef(!1);L!==o?(ce(o),ge(m.length),p(zn(m.length))):M!==m.length&&(ge(m.length),p(ze=>tr(ze,m.length)));let ne;e[2]===Symbol.for("react.memo_cache_sentinel")?(ne={activationConstraint:{distance:8}},e[2]=ne):ne=e[2];let he;e[3]===Symbol.for("react.memo_cache_sentinel")?(he={coordinateGetter:gs},e[3]=he):he=e[3];const me=cs(Jt(ds,ne),Jt(us,he));let I;e[4]!==z?(I=z.map(cr),e[4]=z,e[5]=I):I=e[5];const J=I;let Z;e[6]===Symbol.for("react.memo_cache_sentinel")?(Z=ze=>{ie(String(ze.active.id))},e[6]=Z):Z=e[6];const ee=Z;let $;e[7]!==J||e[8]!==v?($=ze=>{ie(null);const{active:B,over:F}=ze;if(!F||B.id===F.id)return;const G=J.indexOf(String(B.id)),nt=J.indexOf(String(F.id));G===-1||nt===-1||(p(Re=>bs(Mt([...Re],G,nt))),O.current=!0,requestAnimationFrame(()=>{O.current=!1}),v?.(G,nt))},e[7]=J,e[8]=v,e[9]=$):$=e[9];const Ae=$;let Me;e[10]===Symbol.for("react.memo_cache_sentinel")?(Me=()=>{ie(null)},e[10]=Me):Me=e[10];const et=Me;let Se,H,se,ae,ue,oe,de,le,fe,De,je,re,pe,xe,be;if(e[11]!==N||e[12]!==l||e[13]!==z||e[14]!==J||e[15]!==Ae||e[16]!==x||e[17]!==r||e[18]!==i||e[19]!==u||e[20]!==g||e[21]!==y||e[22]!==k||e[23]!==f||e[24]!==D||e[25]!==E||e[26]!==d||e[27]!==m||e[28]!==b||e[29]!==me||e[30]!==R){xe=Symbol.for("react.early_return_sentinel");e:{const ze=B=>{O.current||f(B)};if(e[46]!==N||e[47]!==l||e[48]!==z||e[49]!==r||e[50]!==d||e[51]!==m||e[52]!==R){const B=N?z.find(F=>F.id===N):null;if(ae=B!=null?m[B.index]:null,se=B!=null?d[B.index]:void 0,z.length===0){let F;e[56]!==R?(F=R("sectionsEditor.sectionList.noSections"),e[56]=R,e[57]=F):F=e[57];let G;e[58]!==F?(G=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:F}),e[58]=F,e[59]=G):G=e[59];const nt=!l;let Re;e[60]===Symbol.for("react.memo_cache_sentinel")?(Re=n.jsx(hn,{size:14}),e[60]=Re):Re=e[60];let We;e[61]!==R?(We=R("sectionsEditor.sectionList.addSectionButton"),e[61]=R,e[62]=We):We=e[62];let Ne;e[63]!==r||e[64]!==nt||e[65]!==We?(Ne=n.jsxs(Qe,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:nt,onClick:r,children:[Re,We]}),e[63]=r,e[64]=nt,e[65]=We,e[66]=Ne):Ne=e[66];let vt;e[67]!==G||e[68]!==Ne?(vt=n.jsxs("div",{className:"space-y-2",children:[G,Ne]}),e[67]=G,e[68]=Ne,e[69]=vt):vt=e[69],xe=vt;break e}pe=Oe(B&&"cursor-grabbing"),e[46]=N,e[47]=l,e[48]=z,e[49]=r,e[50]=d,e[51]=m,e[52]=R,e[53]=se,e[54]=ae,e[55]=pe}else se=e[53],ae=e[54],pe=e[55];H=hs,le=me,fe=vs,De=ee,je=Ae,re=et,Se=Ss,oe=J,de=xs,be="space-y-1",ue=z.map(B=>{const F=m[B.index];return F?n.jsx(nr,{sortableId:B.id,section:F,raw:d[B.index],meta:x,selected:b===B.index,onSelect:()=>ze(B.index),onDelete:()=>u(B.index),onDuplicate:()=>y(B.index),onMakeReusable:()=>k(B.index),onToggleHidden:()=>D(B.index),onToggleLazy:()=>E(B.index),onAddVariant:()=>i(B.index),onDetach:()=>g(B.index)},B.id):null})}e[11]=N,e[12]=l,e[13]=z,e[14]=J,e[15]=Ae,e[16]=x,e[17]=r,e[18]=i,e[19]=u,e[20]=g,e[21]=y,e[22]=k,e[23]=f,e[24]=D,e[25]=E,e[26]=d,e[27]=m,e[28]=b,e[29]=me,e[30]=R,e[31]=Se,e[32]=H,e[33]=se,e[34]=ae,e[35]=ue,e[36]=oe,e[37]=de,e[38]=le,e[39]=fe,e[40]=De,e[41]=je,e[42]=re,e[43]=pe,e[44]=xe,e[45]=be}else Se=e[31],H=e[32],se=e[33],ae=e[34],ue=e[35],oe=e[36],de=e[37],le=e[38],fe=e[39],De=e[40],je=e[41],re=e[42],pe=e[43],xe=e[44],be=e[45];if(xe!==Symbol.for("react.early_return_sentinel"))return xe;let T;e[70]!==ue||e[71]!==be?(T=n.jsx("div",{className:be,children:ue}),e[70]=ue,e[71]=be,e[72]=T):T=e[72];let Ke;e[73]!==Se||e[74]!==oe||e[75]!==de||e[76]!==T?(Ke=n.jsx(Se,{items:oe,strategy:de,children:T}),e[73]=Se,e[74]=oe,e[75]=de,e[76]=T,e[77]=Ke):Ke=e[77];let Ie;e[78]!==se||e[79]!==ae||e[80]!==x?(Ie=ae?n.jsx("div",{className:Oe("cursor-grabbing shadow-lg ring-1 ring-border/60",_s(ae,!1)),children:n.jsx(ys,{section:ae,raw:se,meta:x})}):null,e[78]=se,e[79]=ae,e[80]=x,e[81]=Ie):Ie=e[81];let Ge;e[82]!==Ie?(Ge=Yn.createPortal(n.jsx(ms,{dropAnimation:Qn,children:Ie}),document.body),e[82]=Ie,e[83]=Ge):Ge=e[83];let $e;e[84]!==H||e[85]!==le||e[86]!==fe||e[87]!==De||e[88]!==je||e[89]!==re||e[90]!==Ke||e[91]!==Ge?($e=n.jsxs(H,{sensors:le,collisionDetection:fe,onDragStart:De,onDragEnd:je,onDragCancel:re,children:[Ke,Ge]}),e[84]=H,e[85]=le,e[86]=fe,e[87]=De,e[88]=je,e[89]=re,e[90]=Ke,e[91]=Ge,e[92]=$e):$e=e[92];const Ee=!l;let ye;e[93]===Symbol.for("react.memo_cache_sentinel")?(ye=n.jsx(hn,{size:14}),e[93]=ye):ye=e[93];let ke;e[94]!==R?(ke=R("sectionsEditor.sectionList.addSectionButton"),e[94]=R,e[95]=ke):ke=e[95];let Le;e[96]!==r||e[97]!==Ee||e[98]!==ke?(Le=n.jsxs(Qe,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:Ee,onClick:r,children:[ye,ke]}),e[96]=r,e[97]=Ee,e[98]=ke,e[99]=Le):Le=e[99];let Te;return e[100]!==pe||e[101]!==$e||e[102]!==Le?(Te=n.jsxs("div",{className:pe,children:[$e,Le]}),e[100]=pe,e[101]=$e,e[102]=Le,e[103]=Te):Te=e[103],Te}function cr(h){return h.id}function Hn(h){const e=Ue.c(57),{open:o,initialName:d,autoLabel:m,isPending:x,onSubmit:b,onOpenChange:f}=h,v=x===void 0?!1:x,u=ct(),[y,k]=w.useState(d),[D,E]=w.useState(o);o!==D&&(E(o),o&&k(d));let i;e[0]!==v||e[1]!==f?(i=ee=>{!ee&&!v&&f(!1)},e[0]=v,e[1]=f,e[2]=i):i=e[2];const g=i;let r;e[3]!==v||e[4]!==y||e[5]!==b?(r=async ee=>{ee.preventDefault(),!v&&await b(y.trim())},e[3]=v,e[4]=y,e[5]=b,e[6]=r):r=e[6];const A=r;let l;e[7]!==u?(l=u("sectionsEditor.variantRenameDialog.title"),e[7]=u,e[8]=l):l=e[8];let R;e[9]!==l?(R=n.jsx(No,{children:l}),e[9]=l,e[10]=R):R=e[10];let K;e[11]!==m||e[12]!==u?(K=u("sectionsEditor.variantRenameDialog.description",{fallback:m||u("sectionsEditor.variantRenameDialog.defaultFallback")}),e[11]=m,e[12]=u,e[13]=K):K=e[13];let z;e[14]!==K?(z=n.jsx(Do,{children:K}),e[14]=K,e[15]=z):z=e[15];let p;e[16]!==R||e[17]!==z?(p=n.jsxs(To,{children:[R,z]}),e[16]=R,e[17]=z,e[18]=p):p=e[18];let N;e[19]!==u?(N=u("sectionsEditor.variantRenameDialog.nameLabel"),e[19]=u,e[20]=N):N=e[20];let ie;e[21]!==N?(ie=n.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:N}),e[21]=N,e[22]=ie):ie=e[22];let L;e[23]===Symbol.for("react.memo_cache_sentinel")?(L=ee=>k(ee.target.value),e[23]=L):L=e[23];let ce;e[24]!==m||e[25]!==v||e[26]!==y?(ce=n.jsx(Mo,{id:"variant-rename-name",value:y,onChange:L,placeholder:m,autoFocus:!0,disabled:v}),e[24]=m,e[25]=v,e[26]=y,e[27]=ce):ce=e[27];let M;e[28]!==ie||e[29]!==ce?(M=n.jsxs("div",{className:"space-y-1.5 py-4",children:[ie,ce]}),e[28]=ie,e[29]=ce,e[30]=M):M=e[30];let ge;e[31]!==f?(ge=()=>f(!1),e[31]=f,e[32]=ge):ge=e[32];let O;e[33]!==u?(O=u("sectionsEditor.variantRenameDialog.cancel"),e[33]=u,e[34]=O):O=e[34];let ne;e[35]!==v||e[36]!==ge||e[37]!==O?(ne=n.jsx(Qe,{type:"button",variant:"outline",onClick:ge,disabled:v,children:O}),e[35]=v,e[36]=ge,e[37]=O,e[38]=ne):ne=e[38];let he;e[39]!==v||e[40]!==u?(he=v?n.jsxs(n.Fragment,{children:[n.jsx(Jn,{size:14,className:"animate-spin"}),u("sectionsEditor.variantRenameDialog.saving")]}):u("sectionsEditor.variantRenameDialog.save"),e[39]=v,e[40]=u,e[41]=he):he=e[41];let me;e[42]!==v||e[43]!==he?(me=n.jsx(Qe,{type:"submit",disabled:v,children:he}),e[42]=v,e[43]=he,e[44]=me):me=e[44];let I;e[45]!==ne||e[46]!==me?(I=n.jsxs(Po,{children:[ne,me]}),e[45]=ne,e[46]=me,e[47]=I):I=e[47];let J;e[48]!==A||e[49]!==M||e[50]!==I||e[51]!==p?(J=n.jsx(Ao,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:A,children:[p,M,I]})}),e[48]=A,e[49]=M,e[50]=I,e[51]=p,e[52]=J):J=e[52];let Z;return e[53]!==g||e[54]!==o||e[55]!==J?(Z=n.jsx(Co,{open:o,onOpenChange:g,children:J}),e[53]=g,e[54]=o,e[55]=J,e[56]=Z):Z=e[56],Z}const ur="text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]",js="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.2)]";function Es(h){const e=Ue.c(5),{rule:o,matchers:d}=h,m=o?.__resolveType??"";let x;if(e[0]!==d||e[1]!==m){const u=d.find(y=>y.resolveType===m)?.iconName??Ba(m);x=Eo(u),e[0]=d,e[1]=m,e[2]=x}else x=e[2];const b=x;if(!b)return null;let f;return e[3]!==b?(f=n.jsx(b,{size:14,className:"shrink-0"}),e[3]=b,e[4]=f):f=e[4],f}function Gn(h){return h.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
|
|
1
|
+
import{c as Ue,b as ct,r as w,m as Oe,j as n,ag as Yn,B as Qe,k as Jn,o as Na,t as X,K as Da}from"./index-Ct5z4bLK.js";import{a6 as Ta,a7 as Pa,a8 as Aa,a9 as Qn,aa as Xn,ab as Ca,ac as Ma,ad as Ka,N as La,ae as Ba,af as Ct,ag as Fa,S as Zn,ah as lt,ai as Oa,aj as Ia,ak as $a,al as za,D as Ha,F as Ga,am as Ua,an as Wa,ao as qa,ap as Ya,a0 as Gt,aq as Ut,ar as Ja,as as xt,at as Tt,au as Qa,av as Xa,aw as tt,ax as Mn,ay as Za,az as Pt,aA as Wt,aB as eo,aC as dn,aD as to,aE as wt,aF as no,aG as so,aH as ao,aI as oo,aJ as ro,aK as bt,aL as io,aM as lo,aN as co,H as uo,aO as Kn,aP as At,aQ as Ln,aR as Bn,aS as mo,aT as fo,aU as po,aV as go,aW as mn,aX as Fn,aY as On,aZ as Vt,a_ as qt,a$ as In,b0 as ho,b1 as fn,b2 as vo,b3 as So,b4 as xo,b5 as bo,b6 as yo}from"./index-BTg6jfKl.js";import{t as _o}from"./ChevronDown-CKkO8sAW.js";import{a3 as gn,x as jo,X as es,I as Eo,w as ts,a5 as ko,a6 as Ro}from"./agent-icon-Dcc64Amv.js";import{i as ns}from"./ChevronRight-B8f4wyDl.js";import{n as wo}from"./ChevronUp-C1afs1xa.js";import{i as Vo}from"./Tool02-DZ2vEkP4.js";import{l as Yt}from"./automation-runs-D7I8QaWS.js";import{c as yt,T as _t,a as jt}from"./tooltip-DcvI3Qmq.js";import{b as No,h as Do,a as To,c as Po,d as Ao,e as Co}from"./dialog-Y2c_xFO9.js";import{I as Mo}from"./input-J1mhqAdN.js";import{a as ss}from"./Copy01-BlkL52M8.js";import{i as Ko}from"./Settings02-DerOgVc2.js";import{s as Lo}from"./Eye-CQsjSohp.js";import{s as as}from"./TrendUp01-DwZeXU3a.js";import{s as hn}from"./Plus-DO9NbOAK.js";import{s as os}from"./Trash01-BOMqKZ1K.js";import{i as Bo}from"./Zap-C9gRaG5K.js";import{a as ht,D as rs,b as is,c as ls,i as Fo}from"./dropdown-menu-hQO8uf9z.js";import{o as cs,p as Jt,K as us,P as ds,q as ms,z as fs,C as ps,A as gs,B as Mt,D as hs,v as vs,x as Ss,y as xs}from"./index-BIINGXKR.js";import{S as Oo,r as $n,u as Io,d as $o,a as zo,i as Ho,f as Go,P as Uo,b as Wo}from"./page-seo-form-Cl2_e8dB.js";import{c as qo}from"./Tool01-Dn1kpGdl.js";import{A as Yo}from"./add-section-modal---WRWqCq.js";import"./ArrowUp-CpEPYAOf.js";import"./chat-context-CklmWc6u.js";import"./tab-id-BhaxduZ_.js";import"./Check-BwHliFRj.js";import"./hooks-VEM1hLto.js";import"./use-mcp-client-B2w_Vv7G.js";import"./auth-Q0kADPVB.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-C9wT7nFZ.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-DmnaO1IL.js";import"./use-ai-providers-BWHJhqYW.js";import"./studio-tools-D0M8AyaL.js";import"./use-decopilot-events-DhC1PW_6.js";import"./use-organization-settings-CyU2O9C4.js";import"./spinner-BVMuKuHb.js";import"./drawer-Dn6DCG1a.js";import"./collection-search-CgEc7JVV.js";import"./SearchMd-GYne36B-.js";import"./use-mobile-CEeeXHm_.js";import"./AreaChart-D7FaG8Lf.js";import"./index-DWnwwFPu.js";import"./calendar-CaFuCBn0.js";import"./X-B6K21IFp.js";import"./shell-layout-1C4_PYHs.js";import"./avatar-3ae7eb9x.js";import"./User01-HXIFsqtn.js";import"./Users03-CI91FsuH.js";import"./SearchLg-Df6klb6Y.js";import"./Stars02-BG4AWaaX.js";import"./XClose-DBug4o8k.js";import"./CheckCircle-CTIPijUa.js";import"./CpuChip01-Cs3gfrhP.js";import"./FilterLines-oPoBPuqv.js";import"./Monitor01-BT8WHZmo.js";import"./required-auth-layout-CKzC4Wry.js";import"./use-org-sso-CM7UG764.js";import"./ZapSquare-CPOIzhEC.js";import"./Star01-CH5MEDQn.js";import"./Upload01-S_KetqzT.js";import"./AlertCircle-DdtdV7M4.js";import"./form-92MvHLxT.js";import"./label-CXy-_gNr.js";import"./select-Ctd_ZZ0k.js";import"./XCircle-Df3ZOY6R.js";import"./tabs-DjKkhJF-.js";import"./toggle-group-BsjhKaUR.js";import"./use-deco-credits-BHzyr0wR.js";import"./sidebar-CAZ2FyoU.js";import"./LayoutLeft-DrcKo4sm.js";import"./popover-CqIaLo6d.js";import"./alert-dialog-tPwVc9uJ.js";import"./toolbar-TQryde5B.js";import"./skeleton-tW3UOR15.js";import"./github-repo-picker-CgWDATG6.js";import"./use-debounced-value-DqJiqnYk.js";import"./use-connection-COSULjHn.js";import"./authenticate-and-persist-oauth-Dus5ShT0.js";import"./mcp-oauth-C2w2n5sc.js";import"./LinkExternal01-CgpMIzO0.js";import"./use-mcp-tools-CpiBQMkC.js";import"./extract-connection-data-C2o6ZTIY.js";import"./metadata-dUsYcpuu.js";import"./use-navigate-to-agent-DtRj8Nu_.js";import"./reusable-new-chat-CouMjkYR.js";import"./provision-repo-scoped-github-connection-CAXumITS.js";import"./agent-capabilities-cXfbMfjV.js";import"./connection-card-BoLbm0Lq.js";import"./use-registry-connections-DRTunUDV.js";import"./useInfiniteQuery-ddyR5cpH.js";import"./use-infinite-scroll-BQbD3RgJ.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./card-BkMfo3-L.js";import"./integration-icon-C2mjeHEI.js";import"./textarea-BroNzwSJ.js";import"./connection-form-helpers-MuJLCV8m.js";import"./collection-tabs-jHD3PV9U.js";import"./badge-ClTHWVhH.js";import"./useSuspenseInfiniteQuery-D4QmwKBY.js";import"./select-model-CRAkLaCL.js";import"./checkbox-BXAaMwzS.js";import"./Key01-CIup5BVm.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-B_1oLymV.js";import"./ArrowUpRight-CHW6cpx0.js";import"./Stars01-DAx8aZEr.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-BsT1VQN-.js";import"./empty-state-BYwKHc7l.js";import"./deco-site-production-url-CaKZ7xBn.js";import"./use-capability-7L6HM4-F.js";import"./monaco-editor-BlUBHNk6.js";import"./pt-BR-CLy76QW2.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-mcp-auth-status-B3eaajte.js";import"./DotsVertical-BFrinGvO.js";import"./Play-BBCpB_Tz.js";import"./use-debounced-autosave-Hz9sqsxr.js";import"./index-cp39w1Sm.js";import"./search-input-zDL_p_LQ.js";import"./switch-DskVyYCS.js";import"./Users01-ByuTyOLr.js";import"./use-secrets-DzfLLYjI.js";import"./format-time-BnbuEtat.js";import"./use-members-1iyOisn8.js";import"./use-org-auth-client-Bcl40eqI.js";import"./command-DUTyl3qs.js";import"./index-C2-dhaI-.js";import"./useQueries-D3Lp43ym.js";import"./SwitchHorizontal01-B4ZgCyE5.js";import"./Palette-CpgDl594.js";import"./use-file-configs-shCGf-89.js";import"./use-automations-CZHCGQrS.js";import"./automation-list-row-eD1c19d3.js";import"./get-initials-D-f_fDFw.js";import"./HardDrive-CpV48xOn.js";import"./LogOut01-uhMfgP0K.js";import"./Sun-DPokUB7F.js";import"./Shield01-gMQ1chGf.js";import"./table-DrUjEYlL.js";import"./use-clock-tick-BWJoXcll.js";import"./use-copy-DkOP7abA.js";import"./use-tags-B4S441L8.js";import"./companions-core-DdNaKkOK.js";function Jo(h){return h.schema?.definitions??h.schema?.$defs??{}}function Qo(h,e){const o=Jo(e),d=o[btoa(h)];if(!d)return;let m=typeof d.image=="string"?d.image:void 0;if(!m&&Array.isArray(d.allOf)){const x=d.allOf.find(b=>typeof b.$ref=="string")?.$ref;if(typeof x=="string"){const b=x.replace("#/definitions/",""),f=o[b];m=typeof f?.image=="string"?f.image:void 0}}if(m?.includes("{{{"))return m}function Xo(h,e){if(!e)return;const o=Ta(h);if(!o)return;const d=Qo(o.resolveType,e);if(!d)return;const m=Pa(d,o.data);if(m)return Aa(m)}const Zo="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",er="text-global-section-fg focus:bg-global-section/12 focus:text-global-section-fg dark:text-global-section-fg-dark dark:focus:bg-global-section/15 dark:focus:text-global-section-fg-dark [&_svg]:!text-global-section";function zn(h){return Array.from({length:h},(e,o)=>({id:crypto.randomUUID(),index:o}))}function bs(h){return h.map((e,o)=>({...e,index:o}))}function tr(h,e){if(e===h.length)return h;if(e<h.length)return bs(h.slice(0,e));const o=Array.from({length:e-h.length},(d,m)=>({id:crypto.randomUUID(),index:h.length+m}));return[...h,...o]}function ys(h){const e=Ue.c(20),{section:o,raw:d,meta:m}=h,x=o.isSavedBlock===!0,b=o.isMultivariate===!0;let f;e[0]!==m||e[1]!==d?(f=d&&m?Xo(d,m):void 0,e[0]=m,e[1]=d,e[2]=f):f=e[2];const v=f;let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(jo,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[3]=u):u=e[3];let y;e[4]!==v?(y=v&&n.jsx("img",{src:v,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[4]=v,e[5]=y):y=e[5];let k;e[6]!==b||e[7]!==x?(k=x?{color:La}:b?{color:"oklch(0.65 0.15 160)"}:void 0,e[6]=b,e[7]=x,e[8]=k):k=e[8];let D;e[9]!==k?(D=n.jsx(gn,{className:"h-4 w-4 shrink-0",style:k}),e[9]=k,e[10]=D):D=e[10];const E=o.isHidden&&"line-through opacity-50";let i;e[11]!==E?(i=Oe("min-w-0 flex-1 truncate text-sm font-medium",E),e[11]=E,e[12]=i):i=e[12];let g;e[13]!==o.label||e[14]!==i?(g=n.jsx("span",{className:i,children:o.label}),e[13]=o.label,e[14]=i,e[15]=g):g=e[15];let r;return e[16]!==y||e[17]!==D||e[18]!==g?(r=n.jsxs(n.Fragment,{children:[u,y,D,g]}),e[16]=y,e[17]=D,e[18]=g,e[19]=r):r=e[19],r}function _s(h,e){const o=h.isSavedBlock===!0,d=h.isMultivariate===!0;return Oe("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":o?Zo:d?"text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]":"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function nr(h){const e=Ue.c(81),{section:o,raw:d,meta:m,sortableId:x,selected:b,onSelect:f,onDelete:v,onDuplicate:u,onMakeReusable:y,onToggleHidden:k,onToggleLazy:D,onAddVariant:E,onDetach:i}=h,g=ct(),r=d?Xn(d.__resolveType??""):!1;let A;e[0]!==o?(A=Ca(o),e[0]=o,e[1]=A):A=e[1];const l=A;let R;e[2]!==x?(R={id:x,animateLayoutChanges:ir},e[2]=x,e[3]=R):R=e[3];const{attributes:K,listeners:z,setNodeRef:p,transform:N,isDragging:ie}=fs(R);let L;e[4]!==N?(L=ps.Transform.toString(N?{...N,x:0}:null),e[4]=N,e[5]=L):L=e[5];const ce=ie?0:void 0;let M;e[6]!==L||e[7]!==ce?(M={transform:L,opacity:ce},e[6]=L,e[7]=ce,e[8]=M):M=e[8];const ge=M;let O;e[9]!==o?(O=Ma(o),e[9]=o,e[10]=O):O=e[10];const ne=O,he="button",me=0;let I;e[11]!==f?(I=T=>{(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),f())},e[11]=f,e[12]=I):I=e[12];const J=ie?"cursor-grabbing":"cursor-pointer";let Z;e[13]!==o||e[14]!==b||e[15]!==J?(Z=Oe("touch-none transition-colors",J,_s(o,b)),e[13]=o,e[14]=b,e[15]=J,e[16]=Z):Z=e[16];let ee;e[17]!==m||e[18]!==d||e[19]!==o?(ee=n.jsx(ys,{section:o,raw:d,meta:m}),e[17]=m,e[18]=d,e[19]=o,e[20]=ee):ee=e[20];const $=!o.isMultivariate&&n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":g(r?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:Oe("h-7 w-7 shrink-0",r?"":"opacity-0 group-hover:opacity-100"),onClick:T=>{T.stopPropagation(),D()},onPointerDown:rr,children:n.jsx(Bo,{className:Oe("h-3.5 w-3.5",r&&"text-yellow-500")})})}),n.jsx(jt,{side:"bottom",children:g(r?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]});let Ae;e[21]!==k||e[22]!==o.isHidden||e[23]!==o.isMultivariate||e[24]!==g?(Ae=!o.isMultivariate&&n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":o.isHidden?g("sectionsEditor.sectionList.showSection"):g("sectionsEditor.sectionList.hideSection"),className:Oe("h-7 w-7 shrink-0",o.isHidden?"opacity-100":"opacity-0 group-hover:opacity-100"),onClick:T=>{T.stopPropagation(),k()},onPointerDown:or,children:o.isHidden?n.jsx(Ko,{className:"h-3.5 w-3.5"}):n.jsx(Lo,{className:"h-3.5 w-3.5"})})}),n.jsx(jt,{side:"bottom",children:o.isHidden?g("sectionsEditor.sectionList.showSection"):g("sectionsEditor.sectionList.hideSection")})]}),e[21]=k,e[22]=o.isHidden,e[23]=o.isMultivariate,e[24]=g,e[25]=Ae):Ae=e[25];let Me;e[26]!==g?(Me=g("sectionsEditor.sectionList.sectionActionsMenu"),e[26]=g,e[27]=Me):Me=e[27];let et;e[28]===Symbol.for("react.memo_cache_sentinel")?(et=n.jsx(es,{className:"h-3.5 w-3.5"}),e[28]=et):et=e[28];let Se;e[29]!==Me?(Se=n.jsx(rs,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":Me,className:"h-7 w-7 shrink-0 opacity-0 group-hover:opacity-100",onClick:ar,onPointerDown:sr,children:et})}),e[29]=Me,e[30]=Se):Se=e[30];let H;e[31]!==u?(H=T=>{T.stopPropagation(),u()},e[31]=u,e[32]=H):H=e[32];let se;e[33]===Symbol.for("react.memo_cache_sentinel")?(se=n.jsx(ss,{className:"h-4 w-4"}),e[33]=se):se=e[33];let ae;e[34]!==g?(ae=g("sectionsEditor.sectionList.duplicateMenuItem"),e[34]=g,e[35]=ae):ae=e[35];let ue;e[36]!==H||e[37]!==ae?(ue=n.jsxs(ht,{onClick:H,children:[se,ae]}),e[36]=H,e[37]=ae,e[38]=ue):ue=e[38];let oe;e[39]!==l||e[40]!==E||e[41]!==g?(oe=l&&n.jsxs(ht,{className:Ka,onClick:T=>{T.stopPropagation(),E()},children:[n.jsx(as,{className:"h-4 w-4"}),g("sectionsEditor.sectionList.addVariantMenuItem")]}),e[39]=l,e[40]=E,e[41]=g,e[42]=oe):oe=e[42];let de;e[43]!==ne||e[44]!==y||e[45]!==g?(de=ne&&n.jsxs(ht,{className:er,onClick:T=>{T.stopPropagation(),y()},children:[n.jsx(gn,{className:"h-4 w-4"}),g("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[43]=ne,e[44]=y,e[45]=g,e[46]=de):de=e[46];let le;e[47]!==i||e[48]!==o.isMultivariate||e[49]!==o.isSavedBlock||e[50]!==g?(le=o.isSavedBlock===!0&&!o.isMultivariate&&n.jsxs(ht,{onClick:T=>{T.stopPropagation(),i()},children:[n.jsx(gn,{className:"h-4 w-4"}),g("sectionsEditor.sectionList.detachMenuItem")]}),e[47]=i,e[48]=o.isMultivariate,e[49]=o.isSavedBlock,e[50]=g,e[51]=le):le=e[51];let fe;e[52]!==v?(fe=T=>{T.stopPropagation(),v()},e[52]=v,e[53]=fe):fe=e[53];let De;e[54]===Symbol.for("react.memo_cache_sentinel")?(De=n.jsx(os,{className:"h-4 w-4"}),e[54]=De):De=e[54];let je;e[55]!==g?(je=g("sectionsEditor.sectionList.deleteMenuItem"),e[55]=g,e[56]=je):je=e[56];let re;e[57]!==fe||e[58]!==je?(re=n.jsxs(ht,{className:"text-destructive focus:text-destructive",onClick:fe,children:[De,je]}),e[57]=fe,e[58]=je,e[59]=re):re=e[59];let pe;e[60]!==ue||e[61]!==oe||e[62]!==de||e[63]!==le||e[64]!==re?(pe=n.jsxs(is,{align:"end",className:"w-44",children:[ue,oe,de,le,re]}),e[60]=ue,e[61]=oe,e[62]=de,e[63]=le,e[64]=re,e[65]=pe):pe=e[65];let xe;e[66]!==Se||e[67]!==pe?(xe=n.jsxs(ls,{children:[Se,pe]}),e[66]=Se,e[67]=pe,e[68]=xe):xe=e[68];let be;return e[69]!==K||e[70]!==z||e[71]!==f||e[72]!==p||e[73]!==ge||e[74]!==Z||e[75]!==ee||e[76]!==$||e[77]!==Ae||e[78]!==xe||e[79]!==I?(be=n.jsxs("div",{ref:p,style:ge,...K,...z,role:he,tabIndex:me,onClick:f,onKeyDown:I,className:Z,children:[ee,$,Ae,xe]}),e[69]=K,e[70]=z,e[71]=f,e[72]=p,e[73]=ge,e[74]=Z,e[75]=ee,e[76]=$,e[77]=Ae,e[78]=xe,e[79]=I,e[80]=be):be=e[80],be}function sr(h){return h.stopPropagation()}function ar(h){return h.stopPropagation()}function or(h){return h.stopPropagation()}function rr(h){return h.stopPropagation()}function ir(){return!1}function lr(h){const e=Ue.c(104),{listKey:o,rawSections:d,sections:m,meta:x,selectedIndex:b,onSelect:f,onReorder:v,onDelete:u,onDuplicate:y,onMakeReusable:k,onToggleHidden:D,onToggleLazy:E,onAddVariant:i,onDetach:g,onAddSection:r,canAddSection:A}=h,l=A===void 0?!0:A,R=ct();let K;e[0]!==m.length?(K=()=>zn(m.length),e[0]=m.length,e[1]=K):K=e[1];const[z,p]=w.useState(K),[N,ie]=w.useState(null),[L,ce]=w.useState(o),[M,ge]=w.useState(m.length),O=w.useRef(!1);L!==o?(ce(o),ge(m.length),p(zn(m.length))):M!==m.length&&(ge(m.length),p(ze=>tr(ze,m.length)));let ne;e[2]===Symbol.for("react.memo_cache_sentinel")?(ne={activationConstraint:{distance:8}},e[2]=ne):ne=e[2];let he;e[3]===Symbol.for("react.memo_cache_sentinel")?(he={coordinateGetter:gs},e[3]=he):he=e[3];const me=cs(Jt(ds,ne),Jt(us,he));let I;e[4]!==z?(I=z.map(cr),e[4]=z,e[5]=I):I=e[5];const J=I;let Z;e[6]===Symbol.for("react.memo_cache_sentinel")?(Z=ze=>{ie(String(ze.active.id))},e[6]=Z):Z=e[6];const ee=Z;let $;e[7]!==J||e[8]!==v?($=ze=>{ie(null);const{active:B,over:F}=ze;if(!F||B.id===F.id)return;const G=J.indexOf(String(B.id)),nt=J.indexOf(String(F.id));G===-1||nt===-1||(p(Re=>bs(Mt([...Re],G,nt))),O.current=!0,requestAnimationFrame(()=>{O.current=!1}),v?.(G,nt))},e[7]=J,e[8]=v,e[9]=$):$=e[9];const Ae=$;let Me;e[10]===Symbol.for("react.memo_cache_sentinel")?(Me=()=>{ie(null)},e[10]=Me):Me=e[10];const et=Me;let Se,H,se,ae,ue,oe,de,le,fe,De,je,re,pe,xe,be;if(e[11]!==N||e[12]!==l||e[13]!==z||e[14]!==J||e[15]!==Ae||e[16]!==x||e[17]!==r||e[18]!==i||e[19]!==u||e[20]!==g||e[21]!==y||e[22]!==k||e[23]!==f||e[24]!==D||e[25]!==E||e[26]!==d||e[27]!==m||e[28]!==b||e[29]!==me||e[30]!==R){xe=Symbol.for("react.early_return_sentinel");e:{const ze=B=>{O.current||f(B)};if(e[46]!==N||e[47]!==l||e[48]!==z||e[49]!==r||e[50]!==d||e[51]!==m||e[52]!==R){const B=N?z.find(F=>F.id===N):null;if(ae=B!=null?m[B.index]:null,se=B!=null?d[B.index]:void 0,z.length===0){let F;e[56]!==R?(F=R("sectionsEditor.sectionList.noSections"),e[56]=R,e[57]=F):F=e[57];let G;e[58]!==F?(G=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:F}),e[58]=F,e[59]=G):G=e[59];const nt=!l;let Re;e[60]===Symbol.for("react.memo_cache_sentinel")?(Re=n.jsx(hn,{size:14}),e[60]=Re):Re=e[60];let We;e[61]!==R?(We=R("sectionsEditor.sectionList.addSectionButton"),e[61]=R,e[62]=We):We=e[62];let Ne;e[63]!==r||e[64]!==nt||e[65]!==We?(Ne=n.jsxs(Qe,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:nt,onClick:r,children:[Re,We]}),e[63]=r,e[64]=nt,e[65]=We,e[66]=Ne):Ne=e[66];let vt;e[67]!==G||e[68]!==Ne?(vt=n.jsxs("div",{className:"space-y-2",children:[G,Ne]}),e[67]=G,e[68]=Ne,e[69]=vt):vt=e[69],xe=vt;break e}pe=Oe(B&&"cursor-grabbing"),e[46]=N,e[47]=l,e[48]=z,e[49]=r,e[50]=d,e[51]=m,e[52]=R,e[53]=se,e[54]=ae,e[55]=pe}else se=e[53],ae=e[54],pe=e[55];H=hs,le=me,fe=vs,De=ee,je=Ae,re=et,Se=Ss,oe=J,de=xs,be="space-y-1",ue=z.map(B=>{const F=m[B.index];return F?n.jsx(nr,{sortableId:B.id,section:F,raw:d[B.index],meta:x,selected:b===B.index,onSelect:()=>ze(B.index),onDelete:()=>u(B.index),onDuplicate:()=>y(B.index),onMakeReusable:()=>k(B.index),onToggleHidden:()=>D(B.index),onToggleLazy:()=>E(B.index),onAddVariant:()=>i(B.index),onDetach:()=>g(B.index)},B.id):null})}e[11]=N,e[12]=l,e[13]=z,e[14]=J,e[15]=Ae,e[16]=x,e[17]=r,e[18]=i,e[19]=u,e[20]=g,e[21]=y,e[22]=k,e[23]=f,e[24]=D,e[25]=E,e[26]=d,e[27]=m,e[28]=b,e[29]=me,e[30]=R,e[31]=Se,e[32]=H,e[33]=se,e[34]=ae,e[35]=ue,e[36]=oe,e[37]=de,e[38]=le,e[39]=fe,e[40]=De,e[41]=je,e[42]=re,e[43]=pe,e[44]=xe,e[45]=be}else Se=e[31],H=e[32],se=e[33],ae=e[34],ue=e[35],oe=e[36],de=e[37],le=e[38],fe=e[39],De=e[40],je=e[41],re=e[42],pe=e[43],xe=e[44],be=e[45];if(xe!==Symbol.for("react.early_return_sentinel"))return xe;let T;e[70]!==ue||e[71]!==be?(T=n.jsx("div",{className:be,children:ue}),e[70]=ue,e[71]=be,e[72]=T):T=e[72];let Ke;e[73]!==Se||e[74]!==oe||e[75]!==de||e[76]!==T?(Ke=n.jsx(Se,{items:oe,strategy:de,children:T}),e[73]=Se,e[74]=oe,e[75]=de,e[76]=T,e[77]=Ke):Ke=e[77];let Ie;e[78]!==se||e[79]!==ae||e[80]!==x?(Ie=ae?n.jsx("div",{className:Oe("cursor-grabbing shadow-lg ring-1 ring-border/60",_s(ae,!1)),children:n.jsx(ys,{section:ae,raw:se,meta:x})}):null,e[78]=se,e[79]=ae,e[80]=x,e[81]=Ie):Ie=e[81];let Ge;e[82]!==Ie?(Ge=Yn.createPortal(n.jsx(ms,{dropAnimation:Qn,children:Ie}),document.body),e[82]=Ie,e[83]=Ge):Ge=e[83];let $e;e[84]!==H||e[85]!==le||e[86]!==fe||e[87]!==De||e[88]!==je||e[89]!==re||e[90]!==Ke||e[91]!==Ge?($e=n.jsxs(H,{sensors:le,collisionDetection:fe,onDragStart:De,onDragEnd:je,onDragCancel:re,children:[Ke,Ge]}),e[84]=H,e[85]=le,e[86]=fe,e[87]=De,e[88]=je,e[89]=re,e[90]=Ke,e[91]=Ge,e[92]=$e):$e=e[92];const Ee=!l;let ye;e[93]===Symbol.for("react.memo_cache_sentinel")?(ye=n.jsx(hn,{size:14}),e[93]=ye):ye=e[93];let ke;e[94]!==R?(ke=R("sectionsEditor.sectionList.addSectionButton"),e[94]=R,e[95]=ke):ke=e[95];let Le;e[96]!==r||e[97]!==Ee||e[98]!==ke?(Le=n.jsxs(Qe,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:Ee,onClick:r,children:[ye,ke]}),e[96]=r,e[97]=Ee,e[98]=ke,e[99]=Le):Le=e[99];let Te;return e[100]!==pe||e[101]!==$e||e[102]!==Le?(Te=n.jsxs("div",{className:pe,children:[$e,Le]}),e[100]=pe,e[101]=$e,e[102]=Le,e[103]=Te):Te=e[103],Te}function cr(h){return h.id}function Hn(h){const e=Ue.c(57),{open:o,initialName:d,autoLabel:m,isPending:x,onSubmit:b,onOpenChange:f}=h,v=x===void 0?!1:x,u=ct(),[y,k]=w.useState(d),[D,E]=w.useState(o);o!==D&&(E(o),o&&k(d));let i;e[0]!==v||e[1]!==f?(i=ee=>{!ee&&!v&&f(!1)},e[0]=v,e[1]=f,e[2]=i):i=e[2];const g=i;let r;e[3]!==v||e[4]!==y||e[5]!==b?(r=async ee=>{ee.preventDefault(),!v&&await b(y.trim())},e[3]=v,e[4]=y,e[5]=b,e[6]=r):r=e[6];const A=r;let l;e[7]!==u?(l=u("sectionsEditor.variantRenameDialog.title"),e[7]=u,e[8]=l):l=e[8];let R;e[9]!==l?(R=n.jsx(No,{children:l}),e[9]=l,e[10]=R):R=e[10];let K;e[11]!==m||e[12]!==u?(K=u("sectionsEditor.variantRenameDialog.description",{fallback:m||u("sectionsEditor.variantRenameDialog.defaultFallback")}),e[11]=m,e[12]=u,e[13]=K):K=e[13];let z;e[14]!==K?(z=n.jsx(Do,{children:K}),e[14]=K,e[15]=z):z=e[15];let p;e[16]!==R||e[17]!==z?(p=n.jsxs(To,{children:[R,z]}),e[16]=R,e[17]=z,e[18]=p):p=e[18];let N;e[19]!==u?(N=u("sectionsEditor.variantRenameDialog.nameLabel"),e[19]=u,e[20]=N):N=e[20];let ie;e[21]!==N?(ie=n.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:N}),e[21]=N,e[22]=ie):ie=e[22];let L;e[23]===Symbol.for("react.memo_cache_sentinel")?(L=ee=>k(ee.target.value),e[23]=L):L=e[23];let ce;e[24]!==m||e[25]!==v||e[26]!==y?(ce=n.jsx(Mo,{id:"variant-rename-name",value:y,onChange:L,placeholder:m,autoFocus:!0,disabled:v}),e[24]=m,e[25]=v,e[26]=y,e[27]=ce):ce=e[27];let M;e[28]!==ie||e[29]!==ce?(M=n.jsxs("div",{className:"space-y-1.5 py-4",children:[ie,ce]}),e[28]=ie,e[29]=ce,e[30]=M):M=e[30];let ge;e[31]!==f?(ge=()=>f(!1),e[31]=f,e[32]=ge):ge=e[32];let O;e[33]!==u?(O=u("sectionsEditor.variantRenameDialog.cancel"),e[33]=u,e[34]=O):O=e[34];let ne;e[35]!==v||e[36]!==ge||e[37]!==O?(ne=n.jsx(Qe,{type:"button",variant:"outline",onClick:ge,disabled:v,children:O}),e[35]=v,e[36]=ge,e[37]=O,e[38]=ne):ne=e[38];let he;e[39]!==v||e[40]!==u?(he=v?n.jsxs(n.Fragment,{children:[n.jsx(Jn,{size:14,className:"animate-spin"}),u("sectionsEditor.variantRenameDialog.saving")]}):u("sectionsEditor.variantRenameDialog.save"),e[39]=v,e[40]=u,e[41]=he):he=e[41];let me;e[42]!==v||e[43]!==he?(me=n.jsx(Qe,{type:"submit",disabled:v,children:he}),e[42]=v,e[43]=he,e[44]=me):me=e[44];let I;e[45]!==ne||e[46]!==me?(I=n.jsxs(Po,{children:[ne,me]}),e[45]=ne,e[46]=me,e[47]=I):I=e[47];let J;e[48]!==A||e[49]!==M||e[50]!==I||e[51]!==p?(J=n.jsx(Ao,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:A,children:[p,M,I]})}),e[48]=A,e[49]=M,e[50]=I,e[51]=p,e[52]=J):J=e[52];let Z;return e[53]!==g||e[54]!==o||e[55]!==J?(Z=n.jsx(Co,{open:o,onOpenChange:g,children:J}),e[53]=g,e[54]=o,e[55]=J,e[56]=Z):Z=e[56],Z}const ur="text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]",js="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.2)]";function Es(h){const e=Ue.c(5),{rule:o,matchers:d}=h,m=o?.__resolveType??"";let x;if(e[0]!==d||e[1]!==m){const u=d.find(y=>y.resolveType===m)?.iconName??Ba(m);x=Eo(u),e[0]=d,e[1]=m,e[2]=x}else x=e[2];const b=x;if(!b)return null;let f;return e[3]!==b?(f=n.jsx(b,{size:14,className:"shrink-0"}),e[3]=b,e[4]=f):f=e[4],f}function Gn(h){return h.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
|
|
2
2
|
`)}function pn(h){return h.map((e,o)=>({id:crypto.randomUUID(),index:o,variant:e}))}function dr(h){return h.map((e,o)=>({...e,index:o}))}function ks(h){const e=Ue.c(17),{label:o,effectiveRule:d,matchers:m,canDelete:x,dragging:b,onRename:f,onDuplicate:v,onDelete:u}=h,y=ct();let k;e[0]!==d||e[1]!==m?(k=n.jsx(Es,{rule:d,matchers:m}),e[0]=d,e[1]=m,e[2]=k):k=e[2];let D;e[3]!==o?(D=n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:o}),e[3]=o,e[4]=D):D=e[4];let E;e[5]!==x||e[6]!==b||e[7]!==o||e[8]!==u||e[9]!==v||e[10]!==f||e[11]!==y?(E=!b&&n.jsxs(ls,{children:[n.jsx(rs,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":y("sectionsEditor.pageVariantTabs.actionsAriaLabel",{label:o}),className:"size-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100",onClick:fr,onPointerDown:mr,children:n.jsx(es,{size:14})})}),n.jsxs(is,{align:"end",className:"w-36",children:[n.jsxs(ht,{onClick:g=>{g.stopPropagation(),f?.()},children:[n.jsx(qo,{size:14}),y("sectionsEditor.pageVariantTabs.renameAction")]}),n.jsxs(ht,{onClick:g=>{g.stopPropagation(),v?.()},children:[n.jsx(ss,{size:14}),y("sectionsEditor.pageVariantTabs.duplicateAction")]}),n.jsx(Fo,{}),n.jsxs(ht,{variant:"destructive",disabled:!x,onClick:g=>{g.stopPropagation(),u?.()},children:[n.jsx(os,{size:14}),y("sectionsEditor.pageVariantTabs.deleteAction")]})]})]}),e[5]=x,e[6]=b,e[7]=o,e[8]=u,e[9]=v,e[10]=f,e[11]=y,e[12]=E):E=e[12];let i;return e[13]!==k||e[14]!==D||e[15]!==E?(i=n.jsxs(n.Fragment,{children:[k,D,E]}),e[13]=k,e[14]=D,e[15]=E,e[16]=i):i=e[16],i}function mr(h){return h.stopPropagation()}function fr(h){return h.stopPropagation()}function pr(h){const e=Ue.c(33),{entry:o,sortableId:d,isActive:m,canDelete:x,decofile:b,meta:f,matchers:v,onSelect:u,onRename:y,onDuplicate:k,onDelete:D}=h;let E;e[0]!==d?(E={id:d,animateLayoutChanges:gr},e[0]=d,e[1]=E):E=e[1];const{attributes:i,listeners:g,setNodeRef:r,transform:A,isDragging:l}=fs(E);let R;e[2]!==A?(R=ps.Transform.toString(A?{...A,x:0}:null),e[2]=A,e[3]=R):R=e[3];const K=l?0:void 0;let z;e[4]!==R||e[5]!==K?(z={transform:R,opacity:K},e[4]=R,e[5]=K,e[6]=z):z=e[6];const p=z,N=f??void 0;let ie;e[7]!==b||e[8]!==o.variant.rule||e[9]!==N?(ie=Ct(o.variant.rule,b,N),e[7]=b,e[8]=o.variant.rule,e[9]=N,e[10]=ie):ie=e[10];const L=ie;let ce;e[11]!==u?(ce=me=>{me.target===me.currentTarget&&(me.key==="Enter"||me.key===" ")&&(me.preventDefault(),u())},e[11]=u,e[12]=ce):ce=e[12];const M=l?"cursor-grabbing":"cursor-pointer active:cursor-grabbing",ge=m?js:ur;let O;e[13]!==M||e[14]!==ge?(O=Oe("group flex select-none items-center gap-2 rounded-md px-2 py-2.5 transition-colors touch-none",M,ge),e[13]=M,e[14]=ge,e[15]=O):O=e[15];let ne;e[16]!==x||e[17]!==L||e[18]!==o.variant.label||e[19]!==v||e[20]!==D||e[21]!==k||e[22]!==y?(ne=n.jsx(ks,{label:o.variant.label,effectiveRule:L,matchers:v,canDelete:x,onRename:y,onDuplicate:k,onDelete:D}),e[16]=x,e[17]=L,e[18]=o.variant.label,e[19]=v,e[20]=D,e[21]=k,e[22]=y,e[23]=ne):ne=e[23];let he;return e[24]!==i||e[25]!==g||e[26]!==u||e[27]!==r||e[28]!==p||e[29]!==O||e[30]!==ne||e[31]!==ce?(he=n.jsx("div",{ref:r,style:p,...i,...g,onClick:u,onKeyDown:ce,className:O,children:ne}),e[24]=i,e[25]=g,e[26]=u,e[27]=r,e[28]=p,e[29]=O,e[30]=ne,e[31]=ce,e[32]=he):he=e[32],he}function gr(){return!1}function hr(h){const e=Ue.c(9),{variant:o,decofile:d,meta:m,matchers:x}=h,b=m??void 0;let f;e[0]!==d||e[1]!==b||e[2]!==o.rule?(f=Ct(o.rule,d,b),e[0]=d,e[1]=b,e[2]=o.rule,e[3]=f):f=e[3];const v=f;let u;e[4]===Symbol.for("react.memo_cache_sentinel")?(u=Oe("flex items-center gap-2 rounded-md px-2 py-2.5 shadow-lg ring-1 ring-border/60 cursor-grabbing",js),e[4]=u):u=e[4];let y;return e[5]!==v||e[6]!==x||e[7]!==o.label?(y=n.jsx("div",{className:u,children:n.jsx(ks,{label:o.label,effectiveRule:v,matchers:x,canDelete:!1,dragging:!0})}),e[5]=v,e[6]=x,e[7]=o.label,e[8]=y):y=e[8],y}function vr(h){const e=Ue.c(91),{listKey:o,variants:d,activeIndex:m,decofile:x,meta:b,matchers:f,onSelect:v,onReorder:u,onRename:y,onDuplicate:k,onDelete:D,onAdd:E}=h,i=ct();let g;e[0]!==d?(g=()=>pn(d),e[0]=d,e[1]=g):g=e[1];const[r,A]=w.useState(g),[l,R]=w.useState(null),[K,z]=w.useState(o),[p,N]=w.useState(d.length);let ie;e[2]!==d?(ie=()=>Gn(d),e[2]=d,e[3]=ie):ie=e[3];const[L,ce]=w.useState(ie),M=w.useRef(!1),ge=Gn(d);K!==o?(z(o),N(d.length),ce(ge),A(pn(d))):p!==d.length?(N(d.length),ce(ge),A(pn(d))):L!==ge&&(ce(ge),A($e=>d.map((Ee,ye)=>({id:$e[ye]?.id??crypto.randomUUID(),index:ye,variant:Ee}))));let O;e[4]===Symbol.for("react.memo_cache_sentinel")?(O={activationConstraint:{distance:8}},e[4]=O):O=e[4];let ne;e[5]===Symbol.for("react.memo_cache_sentinel")?(ne={coordinateGetter:gs},e[5]=ne):ne=e[5];const he=cs(Jt(ds,O),Jt(us,ne));let me;e[6]!==r?(me=r.map(Sr),e[6]=r,e[7]=me):me=e[7];const I=me,J=d.length>1;let Z;e[8]!==r?(Z=$e=>{const Ee=String($e.active.id);R(r.find(ye=>ye.id===Ee)??null)},e[8]=r,e[9]=Z):Z=e[9];const ee=Z;let $;e[10]!==I||e[11]!==u?($=$e=>{R(null);const{active:Ee,over:ye}=$e;if(!ye||Ee.id===ye.id)return;const ke=I.indexOf(String(Ee.id)),Le=I.indexOf(String(ye.id));ke===-1||Le===-1||(A(Te=>dr(Mt([...Te],ke,Le))),M.current=!0,requestAnimationFrame(()=>{M.current=!1}),u(ke,Le))},e[10]=I,e[11]=u,e[12]=$):$=e[12];const Ae=$;let Me;e[13]===Symbol.for("react.memo_cache_sentinel")?(Me=()=>{R(null)},e[13]=Me):Me=e[13];const et=Me;let Se,H,se,ae,ue,oe,de,le,fe,De,je,re,pe;if(e[14]!==m||e[15]!==J||e[16]!==x||e[17]!==r||e[18]!==I||e[19]!==Ae||e[20]!==ee||e[21]!==f||e[22]!==b||e[23]!==E||e[24]!==D||e[25]!==k||e[26]!==y||e[27]!==v||e[28]!==he||e[29]!==i){const $e=G=>{M.current||v(G)};je="space-y-1 border-b p-2";let Ee;e[43]!==i?(Ee=i("sectionsEditor.pageVariantTabs.variantsLabel"),e[43]=i,e[44]=Ee):Ee=e[44];let ye;e[45]!==Ee?(ye=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:Ee}),e[45]=Ee,e[46]=ye):ye=e[46];let ke;e[47]!==i?(ke=i("sectionsEditor.pageVariantTabs.addVariantAriaLabel"),e[47]=i,e[48]=ke):ke=e[48];let Le;e[49]===Symbol.for("react.memo_cache_sentinel")?(Le=n.jsx(hn,{size:14}),e[49]=Le):Le=e[49];let Te;e[50]!==E||e[51]!==ke?(Te=n.jsx(_t,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":ke,className:"size-6",onClick:E,children:Le})}),e[50]=E,e[51]=ke,e[52]=Te):Te=e[52];let ze;e[53]!==i?(ze=i("sectionsEditor.pageVariantTabs.addVariantTooltip"),e[53]=i,e[54]=ze):ze=e[54];let B;e[55]!==ze?(B=n.jsx(jt,{children:ze}),e[55]=ze,e[56]=B):B=e[56];let F;e[57]!==Te||e[58]!==B?(F=n.jsxs(yt,{children:[Te,B]}),e[57]=Te,e[58]=B,e[59]=F):F=e[59],e[60]!==ye||e[61]!==F?(re=n.jsxs("div",{className:"flex items-center justify-between",children:[ye,F]}),e[60]=ye,e[61]=F,e[62]=re):re=e[62],H=hs,oe=he,de=vs,le=ee,fe=Ae,De=et,Se=Ss,ae=I,ue=xs,pe="space-y-0.5",se=r.map(G=>n.jsx(pr,{sortableId:G.id,entry:G,isActive:G.index===m,canDelete:J,decofile:x,meta:b,matchers:f,onSelect:()=>$e(G.index),onRename:()=>y(G.index),onDuplicate:()=>k(G.index),onDelete:()=>D(G.index)},G.id)),e[14]=m,e[15]=J,e[16]=x,e[17]=r,e[18]=I,e[19]=Ae,e[20]=ee,e[21]=f,e[22]=b,e[23]=E,e[24]=D,e[25]=k,e[26]=y,e[27]=v,e[28]=he,e[29]=i,e[30]=Se,e[31]=H,e[32]=se,e[33]=ae,e[34]=ue,e[35]=oe,e[36]=de,e[37]=le,e[38]=fe,e[39]=De,e[40]=je,e[41]=re,e[42]=pe}else Se=e[30],H=e[31],se=e[32],ae=e[33],ue=e[34],oe=e[35],de=e[36],le=e[37],fe=e[38],De=e[39],je=e[40],re=e[41],pe=e[42];let xe;e[63]!==se||e[64]!==pe?(xe=n.jsx("div",{className:pe,children:se}),e[63]=se,e[64]=pe,e[65]=xe):xe=e[65];let be;e[66]!==Se||e[67]!==ae||e[68]!==ue||e[69]!==xe?(be=n.jsx(Se,{items:ae,strategy:ue,children:xe}),e[66]=Se,e[67]=ae,e[68]=ue,e[69]=xe,e[70]=be):be=e[70];let T;e[71]!==l||e[72]!==x||e[73]!==f||e[74]!==b?(T=l?n.jsx(hr,{variant:l.variant,decofile:x,meta:b,matchers:f}):null,e[71]=l,e[72]=x,e[73]=f,e[74]=b,e[75]=T):T=e[75];let Ke;e[76]!==T?(Ke=Yn.createPortal(n.jsx(ms,{dropAnimation:Qn,children:T}),document.body),e[76]=T,e[77]=Ke):Ke=e[77];let Ie;e[78]!==H||e[79]!==oe||e[80]!==de||e[81]!==le||e[82]!==fe||e[83]!==De||e[84]!==be||e[85]!==Ke?(Ie=n.jsxs(H,{sensors:oe,collisionDetection:de,onDragStart:le,onDragEnd:fe,onDragCancel:De,children:[be,Ke]}),e[78]=H,e[79]=oe,e[80]=de,e[81]=le,e[82]=fe,e[83]=De,e[84]=be,e[85]=Ke,e[86]=Ie):Ie=e[86];let Ge;return e[87]!==je||e[88]!==re||e[89]!==Ie?(Ge=n.jsxs("div",{className:je,children:[re,Ie]}),e[87]=je,e[88]=re,e[89]=Ie,e[90]=Ge):Ge=e[90],Ge}function Sr(h){return h.id}function xr(h){const e=Ue.c(16),{schema:o,value:d,onChange:m,meta:x,decofile:b,onSaveReferencedBlock:f,sandbox:v}=h,u=ct();let y;e[0]===Symbol.for("react.memo_cache_sentinel")?(y=[],e[0]=y):y=e[0];const[k,D]=w.useState(y);let E;e[1]!==k||e[2]!==u?(E=k.length>0&&n.jsxs("nav",{"aria-label":u("sectionsEditor.sectionsEditorPanels.variantRuleBreadcrumb"),className:"flex min-w-0 items-center gap-1 overflow-hidden text-xs",children:[n.jsx("button",{type:"button",onClick:()=>D([]),className:"flex shrink-0 items-center gap-0.5 rounded-md px-1 py-0.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",title:u("sectionsEditor.sectionsEditorPanels.backToRule"),children:n.jsx(ts,{className:"size-3.5"})}),k.map((r,A)=>{const l=A===k.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[A>0&&n.jsx(ns,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>D(k.slice(0,A+1)),title:r,className:Oe("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",l?"font-medium text-foreground":"text-muted-foreground"),children:r})]},`${r}-${A}`)})]}),e[1]=k,e[2]=u,e[3]=E):E=e[3];let i;e[4]!==k||e[5]!==b||e[6]!==x||e[7]!==m||e[8]!==f||e[9]!==v||e[10]!==o||e[11]!==d?(i=n.jsx(Zn,{schema:o,value:d,onChange:m,basePath:"",breadcrumbPath:k,onBreadcrumbChange:D,meta:x,decofile:b,onSaveReferencedBlock:f,sandbox:v}),e[4]=k,e[5]=b,e[6]=x,e[7]=m,e[8]=f,e[9]=v,e[10]=o,e[11]=d,e[12]=i):i=e[12];let g;return e[13]!==E||e[14]!==i?(g=n.jsxs("div",{className:"space-y-2",children:[E,i]}),e[13]=E,e[14]=i,e[15]=g):g=e[15],g}function Un(h){const e=Ue.c(23),{activeSchema:o,formValue:d,formResetKey:m,onFormChange:x,onBreadcrumbChange:b,breadcrumbPath:f,emptyMessage:v,beforeForm:u,seoResolveType:y,siteDefaultSeo:k,meta:D,decofile:E,onSaveReferencedBlock:i,sandbox:g,previewBaseUrl:r,onRequestAddSection:A}=h;let l;e[0]!==f?(l=f===void 0?[]:f,e[0]=f,e[1]=l):l=e[1];const R=l;let K;e[2]!==o||e[3]!==R||e[4]!==E||e[5]!==m||e[6]!==d||e[7]!==D||e[8]!==b||e[9]!==x||e[10]!==A||e[11]!==i||e[12]!==r||e[13]!==g||e[14]!==y||e[15]!==k?(K=o&&d?y?n.jsx(Oo,{schema:o,resolveType:y,value:d,formResetKey:m,onChange:x,onBreadcrumbChange:b,siteDefaultSeo:k}):n.jsx(Zn,{schema:o,value:d,onChange:x,basePath:"",breadcrumbPath:R,onBreadcrumbChange:b,meta:D,decofile:E,onSaveReferencedBlock:i,sandbox:g,previewBaseUrl:r,onRequestAddSection:A},m):null,e[2]=o,e[3]=R,e[4]=E,e[5]=m,e[6]=d,e[7]=D,e[8]=b,e[9]=x,e[10]=A,e[11]=i,e[12]=r,e[13]=g,e[14]=y,e[15]=k,e[16]=K):K=e[16];const z=K;let p;e[17]!==v||e[18]!==z?(p=z??n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:v}),e[17]=v,e[18]=z,e[19]=p):p=e[19];let N;return e[20]!==u||e[21]!==p?(N=n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsxs("div",{className:"mx-auto max-w-2xl",children:[u,p]})}),e[20]=u,e[21]=p,e[22]=N):N=e[22],N}const br="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.22)]";function yr(h,e){return Fa(h,e,lt)}function _r(h){const e=Ue.c(19),{pageKey:o,initialName:d,initialPath:m,onFieldChange:x}=h,b=ct(),[f,v]=w.useState(d),[u,y]=w.useState(m),[k,D]=w.useState(o);k!==o&&(D(o),v(d),y(m));let E;e[0]!==x?(E=K=>{v(K.target.value),x("name",K.target.value)},e[0]=x,e[1]=E):E=e[1];let i;e[2]!==b?(i=b("sectionsEditor.sectionsEditorPanels.pageNamePlaceholder"),e[2]=b,e[3]=i):i=e[3];let g;e[4]!==f||e[5]!==E||e[6]!==i?(g=n.jsx("input",{type:"text",value:f,onChange:E,className:"w-full bg-transparent text-sm font-semibold truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:i}),e[4]=f,e[5]=E,e[6]=i,e[7]=g):g=e[7];let r;e[8]!==x?(r=K=>{y(K.target.value),x("path",K.target.value)},e[8]=x,e[9]=r):r=e[9];let A;e[10]!==b?(A=b("sectionsEditor.sectionsEditorPanels.pathPlaceholder"),e[10]=b,e[11]=A):A=e[11];let l;e[12]!==u||e[13]!==r||e[14]!==A?(l=n.jsx("input",{type:"text",value:u,onChange:r,className:"w-full bg-transparent text-xs text-muted-foreground truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:A}),e[12]=u,e[13]=r,e[14]=A,e[15]=l):l=e[15];let R;return e[16]!==g||e[17]!==l?(R=n.jsxs("div",{className:"space-y-1",children:[g,l]}),e[16]=g,e[17]=l,e[18]=R):R=e[18],R}function Wn(h){const e=Ue.c(13),{onClick:o}=h,d=ct();let m;e[0]!==d?(m=d("sectionsEditor.sectionsEditorPanels.addVariant"),e[0]=d,e[1]=m):m=e[1];let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(as,{size:14}),e[2]=x):x=e[2];let b;e[3]!==o||e[4]!==m?(b=n.jsx(_t,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":m,className:"size-7 shrink-0 text-[oklch(0.65_0.15_160)]",onClick:o,children:x})}),e[3]=o,e[4]=m,e[5]=b):b=e[5];let f;e[6]!==d?(f=d("sectionsEditor.sectionsEditorPanels.addVariant"),e[6]=d,e[7]=f):f=e[7];let v;e[8]!==f?(v=n.jsx(jt,{side:"bottom",children:f}),e[8]=f,e[9]=v):v=e[9];let u;return e[10]!==b||e[11]!==v?(u=n.jsxs(yt,{children:[b,v]}),e[10]=b,e[11]=v,e[12]=u):u=e[12],u}function qn(h){const e=Ue.c(21),{currentRt:o,currentLabel:d,currentGlobalKey:m,matchers:x,globals:b,onSelect:f,onSelectGlobal:v,schema:u,formValue:y,onChange:k,formKey:D,formWrapperClassName:E,meta:i,decofile:g,onSaveReferencedBlock:r,sandbox:A}=h;let l;e[0]!==m||e[1]!==d||e[2]!==o||e[3]!==b||e[4]!==x||e[5]!==f||e[6]!==v?(l=n.jsx(Oa,{currentRt:o,currentLabel:d,currentGlobalKey:m,matchers:x,globals:b,onSelect:f,onSelectGlobal:v}),e[0]=m,e[1]=d,e[2]=o,e[3]=b,e[4]=x,e[5]=f,e[6]=v,e[7]=l):l=e[7];let R;e[8]!==g||e[9]!==D||e[10]!==y||e[11]!==E||e[12]!==i||e[13]!==k||e[14]!==r||e[15]!==A||e[16]!==u?(R=u&&y&&n.jsx("div",{className:E,children:n.jsx(xr,{schema:u,value:y,onChange:k,meta:i,decofile:g,onSaveReferencedBlock:r,sandbox:A},D)}),e[8]=g,e[9]=D,e[10]=y,e[11]=E,e[12]=i,e[13]=k,e[14]=r,e[15]=A,e[16]=u,e[17]=R):R=e[17];let K;return e[18]!==l||e[19]!==R?(K=n.jsxs(n.Fragment,{children:[l,R]}),e[18]=l,e[19]=R,e[20]=K):K=e[20],K}function uc({orgSlug:h,virtualMcpId:e,branch:o,previewReady:d=!0,previewUrl:m,currentPath:x,activePageBlockKey:b=null,activeGlobalBlockKey:f=null,externalSelectedIndex:v,onSaved:u,initialEditSeo:y=!1,onExitSeo:k,onViewJsonFile:D,onVariantPreviewOverride:E}){const i=ct(),g=d?{orgSlug:h,virtualMcpId:e,branch:o,previewUrl:m}:null,{data:r,isLoading:A}=Ia(g),{data:l,isLoading:R}=$a(g),K=za(),z=K?.entity?.id===e?K.entity.metadata?.siteSlug??null:null,[p,N]=w.useState(null),[ie,L]=w.useState(null),[ce,M]=w.useState(null),[ge,O]=w.useState(0),[ne,he]=w.useState(void 0),[me,I]=w.useState(null),[J,Z]=w.useState(null),[ee,$]=w.useState([]),Ae=w.useRef(null),[Me,et]=w.useState(ee.length);Me!==ee.length&&(et(ee.length),requestAnimationFrame(()=>{Ae.current&&(Ae.current.scrollTop=0)}));const[Se,H]=w.useState(0),[se,ae]=w.useState(null),[ue,oe]=w.useState(null),[de,le]=w.useState(null),[fe,De]=w.useState(!0),[je,re]=w.useState(!1),[pe,xe]=w.useState(!1),be=w.useRef(null),[T,Ke]=w.useState(y),[Ie,Ge]=w.useState(y);y&&!Ie&&(Ge(!0),Ke(!0),N(null),L(null),M(null),$([])),!y&&Ie&&Ge(!1);const[$e,Ee]=w.useState(null),[ye,ke]=w.useState(void 0),[Le,Te]=w.useState([]),[ze,B]=w.useState(0),[F,G]=w.useState(0),[nt,Re]=w.useState(null),[We,Ne]=w.useState(null),[vt,vn]=w.useState(null),Rs=Na(),ws=`${h}/${e}/${o}`,Qt=Ha({orgSlug:h,virtualMcpId:e,branch:o}),[Vs,Ns]=w.useState(x),[Ds,Ts]=w.useState(b),[Ps,As]=w.useState(f);(Vs!==x||Ds!==b||Ps!==f)&&(queueMicrotask(()=>Qt.flush()),Ns(x),Ts(b),As(f),N(null),L(null),M(null),O(0),I(null),Z(null),G(0),Re(null),Ne(null),$([]),H(t=>t+1),Ke(!1),Ee(null),ke(void 0),Te([]),B(t=>t+1));const we=Ga({orgSlug:h,virtualMcpId:e,branch:o}),Kt=uo((t,s)=>{we.mutate({blockKey:t,data:s},{onSuccess:()=>u?.(),onError:a=>X.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:a.message}))})}),Xt=Ua({orgSlug:h,virtualMcpId:e,branch:o}),[Nt,Lt]=w.useState(!1),Be=w.useRef(null),st=w.useRef(null),at=w.useRef(null),Zt=w.useRef({}),Xe=w.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null});if(!d||A||R)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(Jn,{size:20,className:"animate-spin text-muted-foreground"})});if(!r||!l)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:i("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const Cs=Wa(r),Ve=!!f,qe=Ve?null:qa(Cs,x,b),V=Ve?f:qe?.key??null,en=Ve&&f?r[f]:void 0,Sn=Ve&&f&&en?Ya(f,en):Ve&&f?f:"",Bt=!Ve&&V&&r[V]?r[V]:null,tn=T&&r&&l&&V&&qe?$n(r,{kind:"page",pageKey:V,pageName:String(qe.name??""),path:String(qe.path??"")},l):null,Ms=T?Bt?.seo:void 0,nn=ye!==void 0?ye:Ms,Ks=T?Io(nn):void 0,Ls=tn?.seoTypeOptions??[],Bs=T&&l?$o(l):"",xn=$e??Ks??{},sn=T&&tn?zo(xn,tn):null,Fs=T&&sn&&Ho(nn)?Gt(sn,l):null,Os=T?Go(r,l)?.seoData:void 0,He=Ve?[{label:"Default",sections:[{__resolveType:f}]}]:yr(Bt?.sections,r??{}),Ft=He.length>1,Ce=Math.min(ge,He.length-1),ut=He[Ce],q=ut?.sections??[],Fe=Ut(q,r),bn=!Ve&&Ja(Bt?.sections);if(Ve&&f&&vt!==f){vn(f);const t=q[0],s=Fe[0];if(t&&s){N(0),G(0),$([]);const a=xt(t,s,r);a&&(L(a.data),M(a.resolveType),Ne(null),Re(null))}}!Ve&&vt!==null&&vn(null),Xe.current={rawSections:q,parsedSections:Fe,decofile:r??{},activePageKey:V,pageVariants:He,variantIndex:Ce,sectionVariantIndex:F,selectedSectionIndex:p};const Is=()=>({multivariate:bn,index:Ce,variants:He.map(t=>({rule:t.rule}))}),yn=(t,s)=>{if(!E)return;if(!V||!bn||t.length<=1){E(null);return}const a=In(V,{multivariate:!0,index:s,variants:t},r,l);E(a.length>0?a:null)},Et=(t,s,a)=>{if(!E)return;if(!V){E(null);return}const c=Is(),S=In(V,c,r,l);if(!t||s<0){E(S.length>0?S:null);return}const j=ho({pageKey:V,page:c,sectionIndex:s,sectionLazy:Fe[s]?.isLazy??!1,mvObj:t,selectedVariantIndex:a,decofile:r,meta:l}),_=[...S,...j];E(_.length>0?_:null)},dt=(t,s,a,c=p??-1,S=!1)=>{const j=tt(t,s);if(!j){L(null),M(null),Ne(null),Re(null),S&&Et(null,c,a);return}const P=Mn(j,lt)[a];if(!P){L(null),M(null),Ne(null),Re(null),S&&Et(null,c,a);return}const te=no(P.value,r);L(te?.data??null),M(te?.resolveType??null);const{resolveType:C,formValue:U}=Tt(P.rule,r,l??void 0);Ne(C),Re(U),S&&Et(j,c,a)};if(v!==void 0&&v!==ne&&(he(v??null),typeof v=="number")){const t=q[v],s=Fe[v];if(t&&s)if(N(v),G(0),$([]),H(a=>a+1),s.isMultivariate)dt(t,s,0,v);else{const a=xt(t,s,r);a?(L(a.data),M(a.resolveType)):(L(null),M(null)),Ne(null),Re(null)}}const Ot={orgSlug:h,virtualMcpId:e,branch:o,previewUrl:m??void 0,siteSlug:z},an=ce&&l?Gt(ce,l):null,Ye=(t,s)=>{if(!V)return;Be.current&&(clearTimeout(Be.current),Be.current=null),at.current&&(clearTimeout(at.current),at.current=null),st.current&&(clearTimeout(st.current),st.current=null);const a=At(r,V,t,Ce,He);we.mutate({blockKey:V,data:a},{onSuccess:()=>s?.onSuccess?.()??u?.(),onError:c=>X.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:c.message}))})},kt=()=>{N(null),L(null),M(null),G(0),Re(null),Ne(null),$([]),H(t=>t+1)},$s=(t,s)=>{Be.current&&clearTimeout(Be.current);const a=Xe.current.sectionVariantIndex;Be.current=setTimeout(()=>{const{rawSections:c,parsedSections:S,decofile:j,activePageKey:_,pageVariants:P,variantIndex:te}=Xe.current,C=c[s];if(!C)return;const U=S[s];if(!U)return;if(U.isSavedBlock){const Y=U.isLazy?C.section?.__resolveType??C.__resolveType:C.__resolveType;we.mutate({blockKey:Y,data:t},{onSuccess:()=>u?.(),onError:Q=>X.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:Q.message}))});return}if(!_)return;const W={...j[_]},_e=[...c];if(U.isMultivariate){const Y=tt(C,U);if(!Y||!_)return;const Q=So(Y,a,t);_e[s]=bt(C,U,Q)}else if(U.isHidden){const Y=Xn(C.__resolveType),Q=Y?{...C.section}:{...C},Pe=Array.isArray(Q.variants)?[...Q.variants]:[];Pe[0]&&(Pe[0]={...Pe[0],value:t}),Q.variants=Pe,Y?_e[s]={...C,section:Q}:_e[s]=Q}else U.isLazy?_e[s]={...C,section:t}:_e[s]=t;if(P.length>1){const Y=W.sections,Q=[...Y?.variants??[]];Q[te]&&(Q[te]={...Q[te],value:_e}),W.sections={...Y,variants:Q}}else W.sections=_e;we.mutate({blockKey:_,data:W},{onSuccess:()=>u?.(),onError:Y=>X.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:Y.message}))})},fn)},zs=t=>{N(t),G(0),$([]),H(S=>S+1);const s=q[t],a=Fe[t];if(!s||!a)return;if(a.isMultivariate){dt(s,a,0,t);return}const c=xt(s,a,r);if(!c){L(null),M(null),Ne(null),Re(null),Et(null,t,0);return}L(c.data),M(c.resolveType),Ne(null),Re(null),Et(null,t,0)},_n=t=>{const s=t;L(s),p!==null&&$s(s,p)},on=t=>{if(!V||!r||!l||!qe)return;const s={kind:"page",pageKey:V,pageName:String(qe.name??""),path:String(qe.path??"")},a=$n(r,s,l);a&&Qt.save(V,()=>{const c=Rs.getQueryData(Da.decofile(ws))?.[V];if(!c||typeof c!="object"||c===null||Array.isArray(c))return null;const S={...c,...Zt.current};return Zt.current={},t?.raw!==void 0?{...S,seo:t.raw}:t?.inner!==void 0?Wo(s,a,S,t.inner):S})},Hs=(t,s)=>{V&&(Zt.current[t]=s,on())},Gs=(t,s)=>{if(!V)return;const a=Mt([...q],t,s);p!==null&&(p===t?N(s):t<p&&s>=p?N(p-1):t>p&&s<=p&&N(p+1)),Ye(a)},Us=t=>{if(!V)return;const s=q.filter((a,c)=>c!==t);p===t?kt():p!==null&&p>t&&N(p-1),Ye(s)},Ws=t=>{if(!V)return;const s=q[t];if(!s)return;const a=[...q];a.splice(t+1,0,go(s)),p!==null&&p>t&&N(p+1),Ye(a)},qs=t=>{if(!V)return;const s=q[t],a=Fe[t];if(!s||!a||a.isMultivariate)return;const c=a.isHidden?fo(s):po(s);if(!c)return;const S=[...q];S[t]=c,p===t&&kt(),Ye(S)},Ys=t=>{if(!V)return;const s=q[t],a=Fe[t];if(!s||!a||a.isMultivariate)return;const c=mo(s);if(!c)return;const S=[...q];S[t]=c,p===t&&kt(),Ye(S)},Js=t=>{if(!V)return;const s=q[t],a=Fe[t];if(!s||!a?.isSavedBlock)return;const c=xt(s,a,r);if(!c?.data)return;const{name:S,...j}=c.data,_=[...q];a.isLazy?_[t]={...s,section:j}:_[t]=j,p===t&&kt(),Ye(_)},Qs=t=>{if(!V)return;const s=[...q,{__resolveType:t.resolveType}],a=s.length-1;Ye(s,{onSuccess:()=>{re(!1),N(a),G(0),$([]),H(_=>_+1);const c=s[a],S=Ut(s,r)[a];if(!c||!S)return;if(S.isMultivariate){dt(c,S,0);return}const j=xt(c,S,r);if(!j){L(null),M(null),Ne(null),Re(null);return}L(j.data),M(j.resolveType),Ne(null),Re(null)}})},jn=t=>{be.current=t.append,re(!0)},Xs=t=>{const s=be.current;if(!s){Qs(t);return}s({__resolveType:t.resolveType}),re(!1),be.current=null},Zs=t=>{if(p===null)return;const s=q[p],a=Fe[p];!s||!a?.isMultivariate||(G(t),$([]),H(c=>c+1),dt(s,a,t,p,!0))},ea=t=>{if(p===null||!V)return;const s=q[p],a=Fe[p];if(!s||!a?.isMultivariate)return;const c=tt(s,a);if(!c)return;const S=lo(c,t);if(!S){X.error(i("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const j=[...q];j[p]=bt(s,a,S);const _=S.variants;let P=F;t===F?P=Math.min(t,_.length-1):t<F&&(P=F-1),G(P),$([]),H(te=>te+1),dt(j[p],a,P),Ye(j)},ta=t=>{if(p===null||!V)return;const s=q[p],a=Fe[p];if(!s||!a?.isMultivariate)return;const c=tt(s,a);if(!c)return;const S=co(c,t),j=[...q];j[p]=bt(s,a,S);const _=t+1;G(_),$([]),H(P=>P+1),dt(j[p],a,_),Ye(j)},na=(t,s)=>{if(p===null||!V||t===s)return;const a=q[p],c=Fe[p];if(!a||!c?.isMultivariate)return;const S=tt(a,c);if(!S)return;const j=ro(S,t,s),_=[...q];_[p]=bt(a,c,j);let P=F;F===t?P=s:t<F&&s>=F?P=F-1:t>F&&s<=F&&(P=F+1),G(P),dt(_[p],c,P),Ye(_)},rn=t=>{const s=t??p;if(s===null||!V)return;const a=q[s],c=Fe[s];if(!a||!c)return;const S=so(a,c);if(!S){X.error(i("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const j=[...q];j[s]=S.section;const _=Ut(j,r)[s];if(!_?.isMultivariate){X.error(i("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}N(s),G(S.newVariantIndex),$([]),H(P=>P+1),dt(S.section,_,S.newVariantIndex,s),Ye(j)},sa=()=>{if(p===null||!V)return;const t=q[p],s=Fe[p];if(!t||!s?.isMultivariate)return;const a=tt(t,s);if(!a)return;const c=io(t,s,a);if(!c){X.error(i("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const S=[...q];S[p]=c;const j=Ut(S,r)[p];if(!j)return;G(0),Ne(null),Re(null),$([]),H(P=>P+1);const _=xt(c,j,r);_?(L(_.data),M(_.resolveType)):(L(null),M(null)),Et(null,p,0),Ye(S)},aa=async t=>{if(se===null||!V)return;const s=mn(t,r);if(s){X.error(s);return}const a=q[se],c=Fe[se];if(!a||!c)return;const S=xt(a,c,r);if(!S){X.error(i("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const j={...S.data,name:t};try{await we.mutateAsync({blockKey:t,data:j});const _=[...q];_[se]={__resolveType:t},await we.mutateAsync({blockKey:V,data:At(r,V,_,Ce,He)}),p===se&&kt(),ae(null),X.success(i("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),u?.()}catch(_){X.error(_ instanceof Error?_.message:i("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"))}},En=ut?.rule;if(Ft&&p===null&&J===null&&En){const{resolveType:t,formValue:s}=Tt(En,r??{},l??void 0);Z(t),I(s)}const It=l?Qa(l):[],kn=l&&r?Xa(l,r):[],oa=!Ve&&!!(m&&l&&r),ra=J&&l?Gt(J,l):null,Rt=()=>{st.current&&(clearTimeout(st.current),st.current=null),at.current&&(clearTimeout(at.current),at.current=null)},Dt=async(t,s)=>{if(!(vo(s,t,l)>0))try{await Xt.mutateAsync({blockKey:t})}catch(a){X.error(a instanceof Error?a.message:i("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"))}},Rn=t=>{st.current&&clearTimeout(st.current),st.current=setTimeout(()=>{const{activePageKey:s,decofile:a,variantIndex:c}=Xe.current;if(!s)return;const S={...a[s]},j={...S.sections},_=[...j.variants??[]],P=_[c],te=P?.rule;if(wt(te,a,l)){const C=te?.__resolveType??"",U=a[C],W=typeof U?.name=="string"?U.name:C,{__resolveType:_e,...Y}=t;we.mutate({blockKey:C,data:Vt(_e??"",Y,W)},{onSuccess:()=>u?.(),onError:Q=>X.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:Q.message}))});return}P&&(_[c]={...P,rule:t}),S.sections={...j,variants:_},we.mutate({blockKey:s,data:S},{onSuccess:()=>u?.(),onError:C=>X.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:C.message}))})},fn)},ia=t=>{Z(t);const s=t?Ln(t,l):{__resolveType:Bn};I(t?s:{}),Rn(s)},la=t=>{const s=t;I(s);const a=J?{__resolveType:J,...s}:{...s};Rn(a)},ca=async t=>{Rt();const{activePageKey:s,decofile:a,variantIndex:c}=Xe.current;if(!s)return;const S=a[s],j=S?.sections;if(!j||typeof j!="object"||Array.isArray(j))return;const _=j;if(!Array.isArray(_.variants))return;const P=[..._.variants],te=P[c];if(!te)return;const C=Pt(te.rule,a,l),U=qt(t);P[c]={...te,rule:U};const W={...a,[s]:{...S,sections:{..._,variants:P}}},{resolveType:_e,formValue:Y}=Tt(U,W,l??void 0);Z(_e),I(Y);try{await we.mutateAsync({blockKey:s,data:W[s]}),C&&C!==t&&await Dt(C,W),u?.()}catch(Q){X.error(Q instanceof Error?Q.message:i("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}},wn=t=>{at.current&&clearTimeout(at.current);const{selectedSectionIndex:s,sectionVariantIndex:a}=Xe.current;s!==null&&(at.current=setTimeout(()=>{const{rawSections:c,parsedSections:S,decofile:j,activePageKey:_,pageVariants:P,variantIndex:te}=Xe.current;if(!_)return;const C=c[s],U=S[s];if(!C||!U?.isMultivariate)return;const W=tt(C,U);if(!W)return;const Y=(W.variants??[])[a]?.rule;if(wt(Y,j,l)){const ve=Y?.__resolveType??"",Je=j[ve],rt=typeof Je?.name=="string"?Je.name:ve,{__resolveType:pt,...it}=t;we.mutate({blockKey:ve,data:Vt(pt??"",it,rt)},{onSuccess:()=>u?.(),onError:gt=>X.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:gt.message}))});return}const Q=Kn(W,a,t),Pe=[...c];Pe[s]=bt(C,U,Q);const Ze=At(j,_,Pe,te,P);we.mutate({blockKey:_,data:Ze},{onSuccess:()=>u?.(),onError:ve=>X.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:ve.message}))})},fn))},ua=t=>{Ne(t);const s=t?Ln(t,l):{__resolveType:Bn};Re(t?s:{}),wn(s)},da=t=>{const s=t;Re(s);const a=We?{__resolveType:We,...s}:{...s};wn(a)},ma=async t=>{Rt();const{selectedSectionIndex:s,sectionVariantIndex:a,rawSections:c,parsedSections:S,decofile:j,activePageKey:_,pageVariants:P,variantIndex:te}=Xe.current;if(s===null||!_)return;const C=c[s],U=S[s];if(!C||!U?.isMultivariate)return;const W=tt(C,U);if(!W)return;const _e=W.variants??[],Y=Pt(_e[a]?.rule,j,l),Q=qt(t),Pe=Kn(W,a,Q),Ze=[...c];Ze[s]=bt(C,U,Pe);const ve=At(j,_,Ze,te,P),Je={...j,[_]:ve},{resolveType:rt,formValue:pt}=Tt(Q,Je,l??void 0);Ne(rt),Re(pt);try{await we.mutateAsync({blockKey:_,data:ve}),Y&&Y!==t&&await Dt(Y,Je),u?.()}catch(it){X.error(it instanceof Error?it.message:i("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}};if(!Ve&&!qe)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:i("sectionsEditor.sectionsEditor.noPageFound",{currentPath:x})});if(Ve&&!en)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:i("sectionsEditor.sectionsEditor.globalBlockNotFound")});const mt=p!==null?Fe[p]??null:null,Vn=p!==null?q[p]:null,Nn=Vn&&mt?.isMultivariate?tt(Vn,mt):null,St=Nn?Mn(Nn,lt):[],ln=Math.min(F,Math.max(St.length-1,0)),$t=St[ln]??null,ft=mt?.isMultivariate===!0,Dn=p!==null&&mt!==null,zt=Dn&&(ft||!!(an&&ie)),fa=zt&&!Ve&&mt?.isSavedBlock===!0,ot=Ve||fa,pa=Ve?Sn:mt?.label??"",ga=We&&l?Gt(We,l):null,cn=zt&&(!Ve||ee.length>0)?Ve?[Sn,...ee]:[qe.name,mt.label,...ft&&$t?[$t.label]:[],...ee]:[],ha=T&&qe?[qe.name,"SEO",...Le]:[],Ht=T?ha:ot?cn.length>0?cn:[pa]:cn,va=!T&&!Ve&&ft&&ee.length===0,Tn=()=>{if(!V)return;Rt(),Be.current&&(clearTimeout(Be.current),Be.current=null);const t=r[V],s=ao(t.sections,q);if(!s)return;const a=oo(s);we.mutate({blockKey:V,data:{...t,sections:s}},{onSuccess:()=>{O(a),N(null),L(null),M(null),$([]),I(null),Z(null)},onError:c=>X.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:c.message}))})},un=(t,s,a)=>{if(!V)return;Rt(),Be.current&&(clearTimeout(Be.current),Be.current=null);const c=r[V],S=c.sections;if(!S||typeof S!="object"||Array.isArray(S))return;const j=S;if(!Array.isArray(j.variants))return;const _=t([...j.variants]);if(!_)return;const P=xo(j,_),te={...r,[V]:{...c,sections:P}};we.mutate({blockKey:V,data:te[V]},{onSuccess:()=>{s?.(),a&&Dt(a,te)},onError:C=>X.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:C.message}))})},Sa=t=>{oe(null),O(t),N(null),L(null),M(null),$([]);const s=He[t]?.rule,{resolveType:a,formValue:c}=Tt(s,r??{},l??void 0);Z(a),I(c),yn(He.map(S=>({rule:S.rule})),t)},xa=(t,s)=>{if(t===s)return;let a=Ce;Ce===t?a=s:t<Ce&&s>=Ce?a=Ce-1:t>Ce&&s<=Ce&&(a=Ce+1),O(a);const c=Mt(He.map(S=>({rule:S.rule})),t,s);yn(c,a),un(S=>Mt(S,t,s))},ba=t=>{const s=He[t]?.rule,a=Pt(s,r??{},l??void 0);un(c=>c.length<=1?null:(c.splice(t,1),c),()=>{He.length-1===1?O(0):t<Ce?O(Ce-1):t===Ce&&O(Math.max(0,t-1)),N(null),L(null),M(null),$([]),I(null),Z(null)},a)},ya=t=>{un(s=>bo(s,t),()=>{O(t+1),N(null),L(null),M(null),$([]),I(null),Z(null)})},_a=async(t,s)=>{Rt(),Be.current&&(clearTimeout(Be.current),Be.current=null);const a=Xe.current.activePageKey,c=Xe.current.decofile;if(!a)return;const S=c[a],j=S.sections;if(!j||typeof j!="object"||Array.isArray(j))return;const _=j;if(!Array.isArray(_.variants))return;const P=[..._.variants],te=P[t];if(!te?.rule||typeof te.rule!="object"){X.error(i("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const C=te.rule,U=s.trim();Lt(!0);try{if(!U){if(!wt(C,c,l)){oe(null);return}const Ze=C.__resolveType??"";P[t]={...te,rule:Fn(C,c,l)};const ve={...c,[a]:{...S,sections:{..._,variants:P}}};await we.mutateAsync({blockKey:a,data:ve[a]}),await Dt(Ze,ve),oe(null),u?.();return}const W=On(C,c,l);if(!W){X.error(i("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(W.blockKey){await we.mutateAsync({blockKey:W.blockKey,data:Vt(W.resolveType,W.data,U)}),oe(null),u?.();return}const _e=dn(U),Y=mn(_e,c);if(Y){X.error(Y);return}const Q=Vt(W.resolveType,W.data,U);let Pe=null;try{await we.mutateAsync({blockKey:_e,data:Q}),Pe=_e,P[t]={...te,rule:qt(_e)},await we.mutateAsync({blockKey:a,data:{...S,sections:{..._,variants:P}}}),Pe=null}catch(Ze){throw Pe&&await Xt.mutateAsync({blockKey:Pe}).catch(()=>{}),Ze}oe(null),X.success(i("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:U})),u?.()}catch(W){X.error(W instanceof Error?W.message:i("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Lt(!1)}},ja=async(t,s)=>{Rt(),Be.current&&(clearTimeout(Be.current),Be.current=null);const{selectedSectionIndex:a,rawSections:c,parsedSections:S,decofile:j,activePageKey:_,pageVariants:P,variantIndex:te}=Xe.current;if(a===null||!_)return;const C=c[a],U=S[a];if(!C||!U?.isMultivariate)return;const W=tt(C,U);if(!W)return;const _e=W.variants??[],Y=_e[t];if(!Y?.rule||typeof Y.rule!="object"){X.error(i("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const Q=Y.rule,Pe=s.trim();Lt(!0);const Ze=async ve=>{const Je={...W,variants:ve},rt=[...c];rt[a]=bt(C,U,Je);const pt=At(j,_,rt,te,P);return await we.mutateAsync({blockKey:_,data:pt}),{...j,[_]:pt}};try{if(!Pe){if(!wt(Q,j,l)){le(null);return}const gt=Q.__resolveType??"",Cn=[..._e];Cn[t]={...Y,rule:Fn(Q,j,l)};const Va=await Ze(Cn);await Dt(gt,Va),le(null),u?.();return}const ve=On(Q,j,l);if(!ve){X.error(i("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(ve.blockKey){await we.mutateAsync({blockKey:ve.blockKey,data:Vt(ve.resolveType,ve.data,Pe)}),le(null),u?.();return}const Je=dn(Pe),rt=mn(Je,j);if(rt){X.error(rt);return}const pt=Vt(ve.resolveType,ve.data,Pe);let it=null;try{await we.mutateAsync({blockKey:Je,data:pt}),it=Je;const gt=[..._e];gt[t]={...Y,rule:qt(Je)},await Ze(gt),it=null}catch(gt){throw it&&await Xt.mutateAsync({blockKey:it}).catch(()=>{}),gt}le(null),X.success(i("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:Pe})),u?.()}catch(ve){X.error(ve instanceof Error?ve.message:i("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Lt(!1)}},Pn=()=>{kt()},Ea=t=>{Ee(t),on({inner:t})},ka=t=>{ke(t),on({raw:t})},Ra=()=>{Ee(null),Te([])},wa=()=>B(t=>t+1),An=t=>{if(T){if(t===0){Qt.flush(),Ke(!1),Ee(null),ke(void 0),Te([]),B(a=>a+1),k?.();return}if(t===1){Te([]),B(a=>a+1);return}Te(Le.slice(0,t-1)),B(a=>a+1);return}if(Ve){$(ee.slice(0,t)),H(a=>a+1);return}if(t===0){Pn();return}if(t===1){$([]),H(a=>a+1);return}if(ft&&t===2){$([]),H(a=>a+1);return}const s=ft?2:1;$(ee.slice(0,t-s))};return n.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[n.jsx("div",{className:"shrink-0",children:ot||zt||T?n.jsxs("div",{className:Oe("border-b px-3 py-2.5",ot&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[n.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[Ht.length>1&&n.jsx("button",{type:"button",onClick:()=>An(yo(Ht.length,{isMultivariateSectionTop:va})),title:i("sectionsEditor.sectionsEditor.back"),"aria-label":i("sectionsEditor.sectionsEditor.back"),className:Oe("shrink-0 inline-flex size-6 items-center justify-center rounded-md transition-colors",ot?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:n.jsx(ts,{className:"size-4"})}),!Ve&&Ft&&ut&&n.jsxs("button",{type:"button",onClick:Pn,title:i("sectionsEditor.sectionsEditor.editingInVariant",{variant:ut.label}),className:Oe("shrink-0 inline-flex items-center gap-1 rounded-md h-6 px-1.5 text-xs font-medium cursor-pointer transition-opacity hover:opacity-80",br),children:[n.jsx(Es,{rule:Ct(ut.rule,r??{},l??void 0),matchers:It}),n.jsx("span",{className:"max-w-[160px] truncate",children:ut.label})]}),n.jsx("nav",{"aria-label":i("sectionsEditor.sectionsEditor.editingBreadcrumb"),className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:Ht.map((t,s)=>{const a=s===Ht.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[s>0&&n.jsx(ns,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>An(s),title:t,className:Oe("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",a?ot?"font-semibold text-global-section-fg dark:text-global-section-fg-dark":"font-medium text-foreground":ot?"text-foreground/80":"text-muted-foreground",ot?"hover:bg-global-section/15":"hover:bg-accent hover:text-accent-foreground"),children:t})]},`${t}-${s}`)})}),ot&&n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(Vo,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(jt,{side:"bottom",className:"max-w-[260px]",children:i("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),Dn&&!ft&&!mt?.isHidden&&V&&n.jsx(Wn,{onClick:()=>rn()})]}),ot&&n.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:i("sectionsEditor.sectionsEditor.globalSectionBanner")})]}):n.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx(_r,{pageKey:V,initialName:qe.name,initialPath:qe.path,onFieldChange:Hs})}),n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":i("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:()=>Ke(!0),children:n.jsx(ko,{size:14})})}),n.jsx(jt,{side:"bottom",children:i("sectionsEditor.sectionsEditor.editSeo")})]}),n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Qe,{type:"button",variant:"ghost",size:"icon","aria-label":i("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>D&&V?D(V):xe(!0),children:n.jsx(Ro,{size:14})})}),n.jsx(jt,{side:"bottom",children:i("sectionsEditor.sectionsEditor.viewJson")})]}),n.jsx(Wn,{onClick:Tn})]})}),T?n.jsx(Yt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsx("div",{className:"mx-auto max-w-2xl",children:Bt&&V?n.jsx(Uo,{rawSeo:nn,innerSeo:xn,defaultResolveType:Bs,seoSchema:Fs,activeResolveType:sn,seoTypeOptions:Ls,formResetKey:ze,siteDefaultSeo:Os,onBreadcrumbChange:Te,onPersistRaw:ka,onInnerChange:Ea,onClearForm:Ra,onBumpFormKey:wa}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:i("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})}):zt?n.jsxs(Yt,{viewportRef:Ae,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[ft&&St.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(Za,{listKey:`${V??""}:${p??""}`,variants:St.map((t,s)=>({index:s,label:t.label})),selectedIndex:ln,onSelect:Zs,onRename:le,onDuplicate:ta,onDelete:ea,onRemoveAll:sa,onReorder:na,onAdd:()=>rn()}),ft&&n.jsxs("div",{className:"px-3 py-3 border-b space-y-2",children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:i("sectionsEditor.sectionsEditor.variantRule")}),n.jsx(qn,{currentRt:We??"",currentLabel:Wt($t?.rule,r??{},lt,l??void 0),currentGlobalKey:Pt($t?.rule,r??{},l??void 0)??void 0,matchers:It,globals:kn,onSelect:ua,onSelectGlobal:ma,schema:ga,formValue:nt,onChange:da,formKey:`${p??"none"}:${ln}:${We??""}`,formWrapperClassName:"pt-1",meta:l??void 0,decofile:r,onSaveReferencedBlock:Kt,sandbox:Ot})]})]}),n.jsx(Un,{activeSchema:an,formValue:ie,formResetKey:Se,onFormChange:_n,onBreadcrumbChange:$,breadcrumbPath:ee,emptyMessage:i("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:l,decofile:r,onSaveReferencedBlock:Kt,sandbox:Ot,previewBaseUrl:m,onRequestAddSection:jn})]}):Ve?n.jsx(Yt,{viewportRef:Ae,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx(Un,{activeSchema:an,formValue:ie,formResetKey:Se,onFormChange:_n,onBreadcrumbChange:$,breadcrumbPath:ee,emptyMessage:i("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:l,decofile:r,onSaveReferencedBlock:Kt,sandbox:Ot,previewBaseUrl:m,onRequestAddSection:jn})}):n.jsxs(Yt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[Ft&&V&&n.jsx(vr,{listKey:V,variants:He,activeIndex:Ce,decofile:r??{},meta:l,matchers:It,onSelect:Sa,onReorder:xa,onRename:oe,onDuplicate:ya,onDelete:ba,onAdd:Tn}),Ft&&J!==null&&n.jsxs("div",{className:Oe("px-3 border-b",fe?"pt-3 pb-5 space-y-3":"py-2"),children:[n.jsxs("button",{type:"button",onClick:()=>De(t=>!t),className:"flex w-full items-center justify-between gap-2 text-left cursor-pointer rounded-sm py-0.5 hover:bg-muted/40","aria-expanded":fe,children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:i("sectionsEditor.sectionsEditor.variantRule")}),fe?n.jsx(wo,{className:"size-3.5 shrink-0 text-muted-foreground"}):n.jsx(_o,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),fe&&n.jsx("div",{className:Oe("space-y-3",Nt&&"pointer-events-none opacity-50"),children:n.jsx(qn,{currentRt:J,currentLabel:Wt(ut?.rule,r??{},lt,l??void 0),currentGlobalKey:Pt(ut?.rule,r??{},l??void 0)??void 0,matchers:It,globals:kn,onSelect:ia,onSelectGlobal:ca,schema:ra,formValue:me,onChange:la,formKey:`${Ce}:${J??""}`,formWrapperClassName:"space-y-3",meta:l??void 0,decofile:r,onSaveReferencedBlock:Kt,sandbox:Ot})})]}),n.jsx("div",{className:"p-2 pt-3",children:n.jsx(lr,{listKey:`${V??""}-${Ce}`,rawSections:q,sections:Fe,meta:l,selectedIndex:p,onSelect:zs,onReorder:Gs,onDelete:Us,onDuplicate:Ws,onMakeReusable:ae,onToggleHidden:qs,onToggleLazy:Ys,onAddVariant:rn,onDetach:Js,onAddSection:()=>re(!0),canAddSection:oa})})]}),n.jsx(eo,{open:se!==null,onOpenChange:t=>{t||ae(null)},defaultBlockId:se!==null?dn(Fe[se]?.label??""):"",isPending:we.isPending,onSubmit:aa}),m&&n.jsx(Yo,{open:je,onOpenChange:t=>{re(t),t||(be.current=null)},meta:l,decofile:r,previewBaseUrl:m,onSelect:Xs}),pe&&V&&r&&n.jsx(to,{open:pe,onOpenChange:xe,pageKey:V,decofile:r}),ue!==null&&n.jsx(Hn,{open:!0,initialName:wt(He[ue]?.rule,r??{},l??void 0)?Wt(He[ue]?.rule,r??{},lt,l??void 0):"",autoLabel:lt(Ct(He[ue]?.rule,r??{},l??void 0)),isPending:Nt,onSubmit:async t=>{await _a(ue,t)},onOpenChange:t=>{!t&&!Nt&&oe(null)}}),de!==null&&n.jsx(Hn,{open:!0,initialName:wt(St[de]?.rule,r??{},l??void 0)?Wt(St[de]?.rule,r??{},lt,l??void 0):"",autoLabel:lt(Ct(St[de]?.rule,r??{},l??void 0)),isPending:Nt,onSubmit:async t=>{await ja(de,t)},onOpenChange:t=>{!t&&!Nt&&le(null)}})]})}export{uc as SectionsEditor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,aD as nt,aB as Pe,j as d,c$ as rt,aF as be,aC as k,d0 as st,ay as j,aE as N,bN as $,d1 as lt,ag as _e,d2 as Ee,az as at,bI as ct,bP as it,d8 as dt,d9 as ut,da as pt,db as ft,d3 as mt,aA as ht,dc as gt,d4 as vt,d6 as xt,c as ee,m as oe}from"./index-CsMY3E0n.js";import{V as St}from"./tooltip-Cpi2mja1.js";import{i as wt}from"./Check-CKtI4hGn.js";import{t as Re}from"./ChevronDown-DfcP5Y1G.js";import{n as Ct}from"./ChevronUp-SkDgfV9P.js";function Ne(r,[e,t]){return Math.min(t,Math.max(e,r))}var yt=[" ","Enter","ArrowUp","ArrowDown"],It=[" ","Enter"],J="Select",[de,ue,bt]=at(J),[ne]=ht(J,[bt,Ee]),pe=Ee(),[Tt,G]=ne(J),[Pt,Nt]=ne(J),je=r=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:n,onOpenChange:c,value:s,defaultValue:l,onValueChange:a,dir:u,name:h,autoComplete:v,disabled:b,required:w,form:S}=r,p=pe(e),[g,C]=i.useState(null),[m,x]=i.useState(null),[F,M]=i.useState(!1),re=nt(u),[_,O]=Pe({prop:o,defaultProp:n??!1,onChange:c,caller:J}),[U,q]=Pe({prop:s,defaultProp:l,onChange:a,caller:J}),L=i.useRef(null),B=g?S||!!g.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:g,onTriggerChange:C,valueNode:m,onValueNodeChange:x,valueNodeHasChildren:F,onValueNodeHasChildrenChange:M,contentId:be(),value:U,onValueChange:q,open:_,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(Qe,{"aria-hidden":!0,required:w,tabIndex:-1,name:h,autoComplete:v,value:U,onChange:E=>q(E.target.value),disabled:b,form:S,children:[U===void 0?d.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};je.displayName=J;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"),[v,b,w]=tt(p=>{const g=u().filter(x=>!x.disabled),C=g.find(x=>x.value===s.value),m=ot(g,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(n.onClick,p=>{p.currentTarget.focus(),h.current!=="mouse"&&S(p)}),onPointerDown:N(n.onPointerDown,p=>{h.current=p.pointerType;const g=p.target;g.hasPointerCapture(p.pointerId)&&g.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:N(n.onKeyDown,p=>{const g=v.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&b(p.key),!(g&&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,v=k(e,a.onValueNodeChange);return $(()=>{u(h)},[u,h]),d.jsx(j.span,{...l,ref:v,style:{pointerEvents:"none"},children:et(a.value)?d.jsx(d.Fragment,{children:s}):c})});De.displayName=Oe;var _t="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=_t;var Et="SelectPortal",Le=r=>d.jsx(lt,{asChild:!0,...r});Le.displayName=Et;var Q="SelectContent",Be=i.forwardRef((r,e)=>{const t=G(Q,r.__scopeSelect),[o,n]=i.useState();if($(()=>{n(new DocumentFragment)},[]),!t.open){const c=o;return c?_e.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=Q;var A=10,[Ve,Y]=ne(Q),Rt="SelectContentImpl",jt=gt("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:v,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:g,...C}=r,m=G(Q,t),[x,F]=i.useState(null),[M,re]=i.useState(null),_=k(e,f=>F(f)),[O,U]=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)&&(U(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:v,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:g}:{};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(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:_,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:N(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(Q,t),s=Y(Q,t),[l,a]=i.useState(null),[u,h]=i.useState(null),v=k(e,_=>h(_)),b=ue(t),w=i.useRef(!1),S=i.useRef(!0),{viewport:p,selectedItem:g,selectedItemText:C,focusSelectedItem:m}=s,x=i.useCallback(()=>{if(c.trigger&&c.valueNode&&l&&u&&p&&g&&C){const _=c.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),U=c.valueNode.getBoundingClientRect(),q=C.getBoundingClientRect();if(c.dir!=="rtl"){const I=q.left-O.left,P=U.left-I,X=_.left-P,Z=_.width+X,ge=Math.max(Z,O.width),ve=window.innerWidth-A,xe=Ne(P,[A,Math.max(A,ve-ge)]);l.style.minWidth=Z+"px",l.style.left=xe+"px"}else{const I=O.right-q.right,P=window.innerWidth-U.right-I,X=window.innerWidth-_.right-P,Z=_.width+X,ge=Math.max(Z,O.width),ve=window.innerWidth-A,xe=Ne(P,[A,Math.max(A,ve-ge)]);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(g.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=_.top+_.height/2-A,ce=B-te,se=g.offsetHeight/2,f=g.offsetTop+se,T=H+E+f,R=K-T;if(T<=te){const I=L.length>0&&g===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&&g===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,g,C,c.dir,o]);$(()=>x(),[x]);const[F,M]=i.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const re=i.useCallback(_=>{_&&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:F},children:d.jsx(j.div,{...n,ref:v,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(vt,{...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(Q,{}),we="SelectViewport",Fe=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(n.onScroll,u=>{const h=u.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:b}=s;if(b?.current&&v){const w=Math.abs(a.current-h.scrollTop);if(w>0){const S=window.innerHeight-A*2,p=parseFloat(v.style.minHeight),g=parseFloat(v.style.height),C=Math.max(p,g);if(C<S){const m=C+w,x=Math.min(S,m),F=m-x;v.style.height=x+"px",v.style.bottom==="0px"&&(h.scrollTop=F>0?F:0,v.style.justifyContent="flex-end")}}}a.current=h.scrollTop})})})]})});Fe.displayName=we;var Ue="SelectGroup",[Dt,kt]=ne(Ue),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=Ue;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,v]=i.useState(c??""),[b,w]=i.useState(!1),S=k(e,m=>a.itemRefCallback?.(m,o,n)),p=be(),g=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=>{v(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:N(s.onFocus,()=>w(!0)),onBlur:N(s.onBlur,()=>w(!1)),onClick:N(s.onClick,()=>{g.current!=="mouse"&&C()}),onPointerUp:N(s.onPointerUp,()=>{g.current==="mouse"&&C()}),onPointerDown:N(s.onPointerDown,m=>{g.current=m.pointerType}),onPointerMove:N(s.onPointerMove,m=>{g.current=m.pointerType,n?a.onItemLeave?.():g.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:N(s.onPointerLeave,m=>{m.currentTarget===document.activeElement&&a.onItemLeave?.()}),onKeyDown:N(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=Nt(le,t),[h,v]=i.useState(null),b=k(e,C=>v(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:g}=u;return $(()=>(p(S),()=>g(S)),[p,g,S]),d.jsxs(d.Fragment,{children:[d.jsx(j.span,{id:a.textId,...c,ref:b}),a.isSelected&&s.valueNode&&!s.valueNodeHasChildren?_e.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(Je,{...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(Je,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop+a.offsetHeight)}}):null});Ze.displayName=ye;var Je=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(n.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(o,50))}),onPointerMove:N(n.onPointerMove,()=>{c.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:N(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",Ft=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});Ft.displayName=Ie;var Ut="SelectBubbleInput",Qe=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 v=new Event("change",{bubbles:!0});h.call(l,e),l.dispatchEvent(v)}},[s,e]),d.jsx(j.select,{...t,style:{...St,...t.style},ref:c,defaultValue:e})});Qe.displayName=Ut;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=Fe,Jt=$e,Qt=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("notranslate 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 v;e[9]!==a?(v=!a&&d.jsx(no,{}),e[9]=a,e[10]=v):v=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 g;return e[18]!==l||e[19]!==n||e[20]!==h||e[21]!==v||e[22]!==S||e[23]!==p?(g=d.jsx(qt,{children:d.jsxs(Xt,{"data-slot":"select-content",translate:"no",className:h,position:l,...n,children:[v,S,p]})}),e[18]=l,e[19]=n,e[20]=h,e[21]=v,e[22]=S,e[23]=p,e[24]=g):g=e[24],g}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(Qt,{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(Jt,{"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,Ne as e};
|
|
1
|
+
import{r as i,aD as nt,aB as Pe,j as d,c$ as rt,aF as be,aC as k,d0 as st,ay as j,aE as N,bN as $,d1 as lt,ag as _e,d2 as Ee,az as at,bI as ct,bP as it,d8 as dt,d9 as ut,da as pt,db as ft,d3 as mt,aA as ht,dc as gt,d4 as vt,d6 as xt,c as ee,m as oe}from"./index-Ct5z4bLK.js";import{V as St}from"./tooltip-DcvI3Qmq.js";import{i as wt}from"./Check-BwHliFRj.js";import{t as Re}from"./ChevronDown-CKkO8sAW.js";import{n as Ct}from"./ChevronUp-C1afs1xa.js";function Ne(r,[e,t]){return Math.min(t,Math.max(e,r))}var yt=[" ","Enter","ArrowUp","ArrowDown"],It=[" ","Enter"],J="Select",[de,ue,bt]=at(J),[ne]=ht(J,[bt,Ee]),pe=Ee(),[Tt,G]=ne(J),[Pt,Nt]=ne(J),je=r=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:n,onOpenChange:c,value:s,defaultValue:l,onValueChange:a,dir:u,name:h,autoComplete:v,disabled:b,required:w,form:S}=r,p=pe(e),[g,C]=i.useState(null),[m,x]=i.useState(null),[F,M]=i.useState(!1),re=nt(u),[_,O]=Pe({prop:o,defaultProp:n??!1,onChange:c,caller:J}),[U,q]=Pe({prop:s,defaultProp:l,onChange:a,caller:J}),L=i.useRef(null),B=g?S||!!g.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:g,onTriggerChange:C,valueNode:m,onValueNodeChange:x,valueNodeHasChildren:F,onValueNodeHasChildrenChange:M,contentId:be(),value:U,onValueChange:q,open:_,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(Qe,{"aria-hidden":!0,required:w,tabIndex:-1,name:h,autoComplete:v,value:U,onChange:E=>q(E.target.value),disabled:b,form:S,children:[U===void 0?d.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};je.displayName=J;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"),[v,b,w]=tt(p=>{const g=u().filter(x=>!x.disabled),C=g.find(x=>x.value===s.value),m=ot(g,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(n.onClick,p=>{p.currentTarget.focus(),h.current!=="mouse"&&S(p)}),onPointerDown:N(n.onPointerDown,p=>{h.current=p.pointerType;const g=p.target;g.hasPointerCapture(p.pointerId)&&g.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:N(n.onKeyDown,p=>{const g=v.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&b(p.key),!(g&&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,v=k(e,a.onValueNodeChange);return $(()=>{u(h)},[u,h]),d.jsx(j.span,{...l,ref:v,style:{pointerEvents:"none"},children:et(a.value)?d.jsx(d.Fragment,{children:s}):c})});De.displayName=Oe;var _t="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=_t;var Et="SelectPortal",Le=r=>d.jsx(lt,{asChild:!0,...r});Le.displayName=Et;var Q="SelectContent",Be=i.forwardRef((r,e)=>{const t=G(Q,r.__scopeSelect),[o,n]=i.useState();if($(()=>{n(new DocumentFragment)},[]),!t.open){const c=o;return c?_e.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=Q;var A=10,[Ve,Y]=ne(Q),Rt="SelectContentImpl",jt=gt("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:v,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:g,...C}=r,m=G(Q,t),[x,F]=i.useState(null),[M,re]=i.useState(null),_=k(e,f=>F(f)),[O,U]=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)&&(U(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:v,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:g}:{};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(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:_,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:N(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(Q,t),s=Y(Q,t),[l,a]=i.useState(null),[u,h]=i.useState(null),v=k(e,_=>h(_)),b=ue(t),w=i.useRef(!1),S=i.useRef(!0),{viewport:p,selectedItem:g,selectedItemText:C,focusSelectedItem:m}=s,x=i.useCallback(()=>{if(c.trigger&&c.valueNode&&l&&u&&p&&g&&C){const _=c.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),U=c.valueNode.getBoundingClientRect(),q=C.getBoundingClientRect();if(c.dir!=="rtl"){const I=q.left-O.left,P=U.left-I,X=_.left-P,Z=_.width+X,ge=Math.max(Z,O.width),ve=window.innerWidth-A,xe=Ne(P,[A,Math.max(A,ve-ge)]);l.style.minWidth=Z+"px",l.style.left=xe+"px"}else{const I=O.right-q.right,P=window.innerWidth-U.right-I,X=window.innerWidth-_.right-P,Z=_.width+X,ge=Math.max(Z,O.width),ve=window.innerWidth-A,xe=Ne(P,[A,Math.max(A,ve-ge)]);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(g.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=_.top+_.height/2-A,ce=B-te,se=g.offsetHeight/2,f=g.offsetTop+se,T=H+E+f,R=K-T;if(T<=te){const I=L.length>0&&g===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&&g===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,g,C,c.dir,o]);$(()=>x(),[x]);const[F,M]=i.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const re=i.useCallback(_=>{_&&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:F},children:d.jsx(j.div,{...n,ref:v,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(vt,{...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(Q,{}),we="SelectViewport",Fe=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(n.onScroll,u=>{const h=u.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:b}=s;if(b?.current&&v){const w=Math.abs(a.current-h.scrollTop);if(w>0){const S=window.innerHeight-A*2,p=parseFloat(v.style.minHeight),g=parseFloat(v.style.height),C=Math.max(p,g);if(C<S){const m=C+w,x=Math.min(S,m),F=m-x;v.style.height=x+"px",v.style.bottom==="0px"&&(h.scrollTop=F>0?F:0,v.style.justifyContent="flex-end")}}}a.current=h.scrollTop})})})]})});Fe.displayName=we;var Ue="SelectGroup",[Dt,kt]=ne(Ue),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=Ue;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,v]=i.useState(c??""),[b,w]=i.useState(!1),S=k(e,m=>a.itemRefCallback?.(m,o,n)),p=be(),g=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=>{v(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:N(s.onFocus,()=>w(!0)),onBlur:N(s.onBlur,()=>w(!1)),onClick:N(s.onClick,()=>{g.current!=="mouse"&&C()}),onPointerUp:N(s.onPointerUp,()=>{g.current==="mouse"&&C()}),onPointerDown:N(s.onPointerDown,m=>{g.current=m.pointerType}),onPointerMove:N(s.onPointerMove,m=>{g.current=m.pointerType,n?a.onItemLeave?.():g.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:N(s.onPointerLeave,m=>{m.currentTarget===document.activeElement&&a.onItemLeave?.()}),onKeyDown:N(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=Nt(le,t),[h,v]=i.useState(null),b=k(e,C=>v(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:g}=u;return $(()=>(p(S),()=>g(S)),[p,g,S]),d.jsxs(d.Fragment,{children:[d.jsx(j.span,{id:a.textId,...c,ref:b}),a.isSelected&&s.valueNode&&!s.valueNodeHasChildren?_e.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(Je,{...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(Je,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop+a.offsetHeight)}}):null});Ze.displayName=ye;var Je=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(n.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(o,50))}),onPointerMove:N(n.onPointerMove,()=>{c.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:N(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",Ft=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});Ft.displayName=Ie;var Ut="SelectBubbleInput",Qe=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 v=new Event("change",{bubbles:!0});h.call(l,e),l.dispatchEvent(v)}},[s,e]),d.jsx(j.select,{...t,style:{...St,...t.style},ref:c,defaultValue:e})});Qe.displayName=Ut;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=Fe,Jt=$e,Qt=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("notranslate 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 v;e[9]!==a?(v=!a&&d.jsx(no,{}),e[9]=a,e[10]=v):v=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 g;return e[18]!==l||e[19]!==n||e[20]!==h||e[21]!==v||e[22]!==S||e[23]!==p?(g=d.jsx(qt,{children:d.jsxs(Xt,{"data-slot":"select-content",translate:"no",className:h,position:l,...n,children:[v,S,p]})}),e[18]=l,e[19]=n,e[20]=h,e[21]=v,e[22]=S,e[23]=p,e[24]=g):g=e[24],g}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(Qt,{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(Jt,{"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,Ne as e};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as $,ag as ut,c as G,b as se,j as s,Y as Be,Z as ve,F as xe,o as we,_ as We,$ as Ve,e as je,K as ce,t as ne,B as le,p as ie,m as oe,n as mt,d as ft,E as pt,z as xt}from"./index-
|
|
1
|
+
import{r as $,ag as ut,c as G,b as se,j as s,Y as Be,Z as ve,F as xe,o as we,_ as We,$ as Ve,e as je,K as ce,t as ne,B as le,p as ie,m as oe,n as mt,d as ft,E as pt,z as xt}from"./index-Ct5z4bLK.js";import{c as He,e as qe,d as Ye,a as gt,b as Ge,h as vt,D as bt}from"./dialog-Y2c_xFO9.js";import{d as yt,b as jt,a as St,D as Nt}from"./drawer-Dn6DCG1a.js";import{u as wt}from"./use-mobile-CEeeXHm_.js";import{u as Xe}from"./chat-context-CklmWc6u.js";import{C as kt}from"./checkbox-BXAaMwzS.js";import{I as pe}from"./input-J1mhqAdN.js";import{S as _t,a as Ct,b as It,c as Mt,d as Et}from"./select-Ctd_ZZ0k.js";import{S as ee}from"./skeleton-tW3UOR15.js";import{i as Qe,b as Je,c as Ot,a as At,s as Pt}from"./Settings02-DerOgVc2.js";import{d as Tt,a as Lt,b as zt,i as Rt}from"./Tool01-Dn1kpGdl.js";import{i as Ft}from"./Key01-CIup5BVm.js";import{i as Ze}from"./SearchMd-GYne36B-.js";import{f as ke,u as Kt,b as Dt}from"./use-ai-providers-BWHJhqYW.js";import{g as _e}from"./ai-providers-logos-DD3qZ33J.js";import{i as Me}from"./Monitor01-BT8WHZmo.js";import{i as $t}from"./AlertCircle-DdtdV7M4.js";import{S as Ee}from"./spinner-BVMuKuHb.js";import{u as Ne}from"./studio-tools-D0M8AyaL.js";import{i as Ut}from"./ChevronRight-B8f4wyDl.js";import{A as Bt}from"./avatar-3ae7eb9x.js";import{S as Oe,a as Ae,b as et}from"./settings-section-B_1oLymV.js";import{s as tt}from"./Eye-CQsjSohp.js";import{i as Wt,D as Vt}from"./tab-id-BhaxduZ_.js";import{u as Ht}from"./use-is-desktop-app-BNujXJc_.js";import{t as Pe}from"./ChevronDown-CKkO8sAW.js";import{t as qt}from"./Stars01-DAx8aZEr.js";function fe(n,e,t){let i=t.initialDeps??[],o,l=!0;function a(){var r,h,d;let c;t.key&&((r=t.debug)!=null&&r.call(t))&&(c=Date.now());const f=n();if(!(f.length!==i.length||f.some((m,j)=>i[j]!==m)))return o;i=f;let u;if(t.key&&((h=t.debug)!=null&&h.call(t))&&(u=Date.now()),o=e(...f),t.key&&((d=t.debug)!=null&&d.call(t))){const m=Math.round((Date.now()-c)*100)/100,j=Math.round((Date.now()-u)*100)/100,N=j/16,S=(b,I)=>{for(b=String(b);b.length<I;)b=" "+b;return b};console.info(`%c⏱ ${S(j,5)} /${S(m,5)} ms`,`
|
|
2
2
|
font-size: .6rem;
|
|
3
3
|
font-weight: bold;
|
|
4
4
|
color: hsl(${Math.max(0,Math.min(120-120*N,120))}deg 100% 31%);`,t?.key)}return t?.onChange&&!(l&&t.skipInitialOnChange)&&t.onChange(o),l=!1,o}return a.updateDeps=r=>{i=r},a}function Te(n,e){if(n===void 0)throw new Error("Unexpected undefined");return n}const Yt=(n,e)=>Math.abs(n-e)<1.01,Gt=(n,e,t)=>{let i;return function(...o){n.clearTimeout(i),i=n.setTimeout(()=>e.apply(this,o),t)}},Le=n=>{const{offsetWidth:e,offsetHeight:t}=n;return{width:e,height:t}},Xt=n=>n,Qt=n=>{const e=Math.max(n.startIndex-n.overscan,0),t=Math.min(n.endIndex+n.overscan,n.count-1),i=[];for(let o=e;o<=t;o++)i.push(o);return i},Jt=(n,e)=>{const t=n.scrollElement;if(!t)return;const i=n.targetWindow;if(!i)return;const o=a=>{const{width:r,height:h}=a;e({width:Math.round(r),height:Math.round(h)})};if(o(Le(t)),!i.ResizeObserver)return()=>{};const l=new i.ResizeObserver(a=>{const r=()=>{const h=a[0];if(h?.borderBoxSize){const d=h.borderBoxSize[0];if(d){o({width:d.inlineSize,height:d.blockSize});return}}o(Le(t))};n.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()});return l.observe(t,{box:"border-box"}),()=>{l.unobserve(t)}},ze={passive:!0},Re=typeof window>"u"?!0:"onscrollend"in window,Zt=(n,e)=>{const t=n.scrollElement;if(!t)return;const i=n.targetWindow;if(!i)return;let o=0;const l=n.options.useScrollendEvent&&Re?()=>{}:Gt(i,()=>{e(o,!1)},n.options.isScrollingResetDelay),a=c=>()=>{const{horizontal:f,isRtl:p}=n.options;o=f?t.scrollLeft*(p&&-1||1):t.scrollTop,l(),e(o,c)},r=a(!0),h=a(!1);t.addEventListener("scroll",r,ze);const d=n.options.useScrollendEvent&ℜreturn d&&t.addEventListener("scrollend",h,ze),()=>{t.removeEventListener("scroll",r),d&&t.removeEventListener("scrollend",h)}},es=(n,e,t)=>{if(e?.borderBoxSize){const i=e.borderBoxSize[0];if(i)return Math.round(i[t.options.horizontal?"inlineSize":"blockSize"])}return n[t.options.horizontal?"offsetWidth":"offsetHeight"]},ts=(n,{adjustments:e=0,behavior:t},i)=>{var o,l;const a=n+e;(l=(o=i.scrollElement)==null?void 0:o.scrollTo)==null||l.call(o,{[i.options.horizontal?"left":"top"]:a,behavior:t})};class ss{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var t,i,o;return((o=(i=(t=this.targetWindow)==null?void 0:t.performance)==null?void 0:i.now)==null?void 0:o.call(i))??Date.now()},this.observer=(()=>{let t=null;const i=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(o=>{o.forEach(l=>{const a=()=>{const r=l.target,h=this.indexFromElement(r);if(!r.isConnected){this.observer.unobserve(r);return}this.shouldMeasureDuringScroll(h)&&this.resizeItem(h,this.options.measureElement(r,l,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()})}));return{disconnect:()=>{var o;(o=i())==null||o.disconnect(),t=null},observe:o=>{var l;return(l=i())==null?void 0:l.observe(o,{box:"border-box"})},unobserve:o=>{var l;return(l=i())==null?void 0:l.unobserve(o)}}})(),this.range=null,this.setOptions=t=>{Object.entries(t).forEach(([i,o])=>{typeof o>"u"&&delete t[i]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Xt,rangeExtractor:Qt,onChange:()=>{},measureElement:es,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",...t}},this.notify=t=>{var i,o;(o=(i=this.options).onChange)==null||o.call(i,this,t)},this.maybeNotify=fe(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const i=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==i){if(this.cleanup(),!i){this.maybeNotify();return}this.scrollElement=i,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(o=>{this.observer.observe(o)}),this.unsubs.push(this.options.observeElementRect(this,o=>{this.scrollRect=o,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(o,l)=>{this.scrollAdjustments=0,this.scrollDirection=l?this.getScrollOffset()<o?"forward":"backward":null,this.scrollOffset=o,this.isScrolling=l,this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(t,i)=>{const o=new Map,l=new Map;for(let a=i-1;a>=0;a--){const r=t[a];if(o.has(r.lane))continue;const h=l.get(r.lane);if(h==null||r.end>h.end?l.set(r.lane,r):r.end<h.end&&o.set(r.lane,!0),o.size===this.options.lanes)break}return l.size===this.options.lanes?Array.from(l.values()).sort((a,r)=>a.end===r.end?a.index-r.index:a.end-r.end)[0]:void 0},this.getMeasurementOptions=fe(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(t,i,o,l,a,r,h)=>(this.prevLanes!==void 0&&this.prevLanes!==r&&(this.lanesChangedFlag=!0),this.prevLanes=r,this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:i,scrollMargin:o,getItemKey:l,enabled:a,lanes:r,laneAssignmentMode:h}),{key:!1}),this.getMeasurements=fe(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:t,paddingStart:i,scrollMargin:o,getItemKey:l,enabled:a,lanes:r,laneAssignmentMode:h},d)=>{if(!a)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>t)for(const u of this.laneAssignments.keys())u>=t&&this.laneAssignments.delete(u);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(u=>{this.itemSizeCache.set(u.key,u.size)}));const c=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===t&&(this.lanesSettling=!1);const f=this.measurementsCache.slice(0,c),p=new Array(r).fill(void 0);for(let u=0;u<c;u++){const m=f[u];m&&(p[m.lane]=u)}for(let u=c;u<t;u++){const m=l(u),j=this.laneAssignments.get(u);let N,S;const b=h==="estimate"||d.has(m);if(j!==void 0&&this.options.lanes>1){N=j;const k=p[N],x=k!==void 0?f[k]:void 0;S=x?x.end+this.options.gap:i+o}else{const k=this.options.lanes===1?f[u-1]:this.getFurthestMeasurement(f,u);S=k?k.end+this.options.gap:i+o,N=k?k.lane:u%this.options.lanes,this.options.lanes>1&&b&&this.laneAssignments.set(u,N)}const I=d.get(m),E=typeof I=="number"?I:this.options.estimateSize(u),O=S+E;f[u]={index:u,start:S,size:E,end:O,key:m,lane:N},p[N]=u}return this.measurementsCache=f,f},{key:!1,debug:()=>this.options.debug}),this.calculateRange=fe(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,i,o,l)=>this.range=t.length>0&&i>0?is({measurements:t,outerSize:i,scrollOffset:o,lanes:l}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=fe(()=>{let t=null,i=null;const o=this.calculateRange();return o&&(t=o.startIndex,i=o.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,i]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,i]},(t,i,o,l,a)=>l===null||a===null?[]:t({startIndex:l,endIndex:a,overscan:i,count:o}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=t=>{const i=this.options.indexAttribute,o=t.getAttribute(i);return o?parseInt(o,10):(console.warn(`Missing attribute name '${i}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=t=>{var i;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const o=this.scrollState.index??((i=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:i.index);if(o!==void 0&&this.range){const l=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),a=Math.max(0,o-l),r=Math.min(this.options.count-1,o+l);return t>=a&&t<=r}return!0},this.measureElement=t=>{if(!t){this.elementsCache.forEach((a,r)=>{a.isConnected||(this.observer.unobserve(a),this.elementsCache.delete(r))});return}const i=this.indexFromElement(t),o=this.options.getItemKey(i),l=this.elementsCache.get(o);l!==t&&(l&&this.observer.unobserve(l),this.observer.observe(t),this.elementsCache.set(o,t)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(i)&&this.resizeItem(i,this.options.measureElement(t,void 0,this))},this.resizeItem=(t,i)=>{var o;const l=this.measurementsCache[t];if(!l)return;const a=this.itemSizeCache.get(l.key)??l.size,r=i-a;r!==0&&(((o=this.scrollState)==null?void 0:o.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(l,r,this):l.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=r,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(l.index),this.itemSizeCache=new Map(this.itemSizeCache.set(l.key,i)),this.notify(!1))},this.getVirtualItems=fe(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,i)=>{const o=[];for(let l=0,a=t.length;l<a;l++){const r=t[l],h=i[r];o.push(h)}return o},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const i=this.getMeasurements();if(i.length!==0)return Te(i[st(0,i.length-1,o=>Te(i[o]).start,t)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const t=this.scrollElement.document.documentElement;return this.options.horizontal?t.scrollWidth-this.scrollElement.innerWidth:t.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(t,i,o=0)=>{if(!this.scrollElement)return 0;const l=this.getSize(),a=this.getScrollOffset();i==="auto"&&(i=t>=a+l?"end":"start"),i==="center"?t+=(o-l)/2:i==="end"&&(t-=l);const r=this.getMaxScrollOffset();return Math.max(Math.min(r,t),0)},this.getOffsetForIndex=(t,i="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const o=this.getSize(),l=this.getScrollOffset(),a=this.measurementsCache[t];if(!a)return;if(i==="auto")if(a.end>=l+o-this.options.scrollPaddingEnd)i="end";else if(a.start<=l+this.options.scrollPaddingStart)i="start";else return[l,i];if(i==="end"&&t===this.options.count-1)return[this.getMaxScrollOffset(),i];const r=i==="end"?a.end+this.options.scrollPaddingEnd:a.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(r,i,a.size),i]},this.scrollToOffset=(t,{align:i="start",behavior:o="auto"}={})=>{const l=this.getOffsetForAlignment(t,i),a=this.now();this.scrollState={index:null,align:i,behavior:o,startedAt:a,lastTargetOffset:l,stableFrames:0},this._scrollToOffset(l,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollToIndex=(t,{align:i="auto",behavior:o="auto"}={})=>{t=Math.max(0,Math.min(t,this.options.count-1));const l=this.getOffsetForIndex(t,i);if(!l)return;const[a,r]=l,h=this.now();this.scrollState={index:t,align:r,behavior:o,startedAt:h,lastTargetOffset:a,stableFrames:0},this._scrollToOffset(a,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollBy=(t,{behavior:i="auto"}={})=>{const o=this.getScrollOffset()+t,l=this.now();this.scrollState={index:null,align:"start",behavior:i,startedAt:l,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:i}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{var t;const i=this.getMeasurements();let o;if(i.length===0)o=this.options.paddingStart;else if(this.options.lanes===1)o=((t=i[i.length-1])==null?void 0:t.end)??0;else{const l=Array(this.options.lanes).fill(null);let a=i.length-1;for(;a>=0&&l.some(r=>r===null);){const r=i[a];l[r.lane]===null&&(l[r.lane]=r.end),a--}o=Math.max(...l.filter(r=>r!==null))}return Math.max(o-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(t,{adjustments:i,behavior:o})=>{this.options.scrollToFn(t,{behavior:o,adjustments:i},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(e)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const i=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,o=i?i[0]:this.scrollState.lastTargetOffset,l=1,a=o!==this.scrollState.lastTargetOffset;if(!a&&Yt(o,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=l){this.scrollState=null;return}}else this.scrollState.stableFrames=0,a&&(this.scrollState.lastTargetOffset=o,this.scrollState.behavior="auto",this._scrollToOffset(o,{adjustments:void 0,behavior:"auto"}));this.scheduleScrollReconcile()}}const st=(n,e,t,i)=>{for(;n<=e;){const o=(n+e)/2|0,l=t(o);if(l<i)n=o+1;else if(l>i)e=o-1;else return o}return n>0?n-1:0};function is({measurements:n,outerSize:e,scrollOffset:t,lanes:i}){const o=n.length-1,l=h=>n[h].start;if(n.length<=i)return{startIndex:0,endIndex:o};let a=st(0,o,l,t),r=a;if(i===1)for(;r<o&&n[r].end<t+e;)r++;else if(i>1){const h=Array(i).fill(0);for(;r<o&&h.some(c=>c<t+e);){const c=n[r];h[c.lane]=c.end,r++}const d=Array(i).fill(t+e);for(;a>=0&&d.some(c=>c>=t);){const c=n[a];d[c.lane]=c.start,a--}a=Math.max(0,a-a%i),r=Math.min(o,r+(i-1-r%i))}return{startIndex:a,endIndex:r}}const Fe=typeof document<"u"?$.useLayoutEffect:$.useEffect;function ns({useFlushSync:n=!0,...e}){const t=$.useReducer(()=>({}),{})[1],i={...e,onChange:(l,a)=>{var r;n&&a?ut.flushSync(t):t(),(r=e.onChange)==null||r.call(e,l,a)}},[o]=$.useState(()=>new ss(i));return o.setOptions(i),Fe(()=>o._didMount(),[]),Fe(()=>o._willUpdate()),o}function ls(n){return ns({observeElementRect:Jt,observeElementOffset:Zt,scrollToFn:ts,...n})}const it=[{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 be(n){if(n)return it.find(e=>e.id===n)}const Ke=4;function ge(n){const e=G.c(8),{logo:t,name:i,description:o,onClick:l}=n;let a;e[0]!==t||e[1]!==i?(a=t?s.jsx("img",{src:t,alt:i,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):s.jsx(Bt,{fallback:i.charAt(0),className:"size-8 bg-primary/10 text-primary"}),e[0]=t,e[1]=i,e[2]=a):a=e[2];let r;return e[3]!==o||e[4]!==i||e[5]!==l||e[6]!==a?(r=s.jsx(et,{onClick:l,icon:a,title:i,description:o}),e[3]=o,e[4]=i,e[5]=l,e[6]=a,e[7]=r):r=e[7],r}function nt(n){const e=G.c(38),{providers:t,onSelect:i,onShowAll:o}=n,l=se();let a;e[0]!==t?(a=t.find(cs),e[0]=t,e[1]=a):a=e[1];const r=a;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h={openrouter:0,llmapi:1,anthropic:2,google:3},e[2]=h):h=e[2];const d=h;let c;if(e[3]!==i||e[4]!==t||e[5]!==l){let E;e[7]===Symbol.for("react.memo_cache_sentinel")?(E=(y,C)=>{const z=d[y.id]??Number.MAX_SAFE_INTEGER,A=d[C.id]??Number.MAX_SAFE_INTEGER;return z-A},e[7]=E):E=e[7];const O=t.filter(as).sort(E);let k;e[8]!==t?(k=t.find(rs),e[8]=t,e[9]=k):k=e[9];const x=k;let w;e[10]===Symbol.for("react.memo_cache_sentinel")?(w=be("openai"),e[10]=w):w=e[10];const _=w;let M;e[11]!==i?(M=y=>s.jsx(ge,{logo:y.logo,name:y.name,description:y.description,onClick:()=>i({kind:"provider",provider:y})},y.id),e[11]=i,e[12]=M):M=e[12];let v;e[13]!==i||e[14]!==x?(v=x&&_?[s.jsx(ge,{logo:_.logo,name:_.name,description:_.description,onClick:()=>i({kind:"openai-compatible",provider:x,preset:_})},_.id)]:[],e[13]=i,e[14]=x,e[15]=v):v=e[15];let g;e[16]!==i||e[17]!==x||e[18]!==l?(g=x?[...it.filter(os).map(y=>s.jsx(ge,{logo:y.logo,name:y.name,description:y.description,onClick:()=>i({kind:"openai-compatible",provider:x,preset:y})},y.id)),s.jsx(ge,{logo:x.logo,name:l("settings.aiProviders.customOpenAiCompatible"),description:l("settings.aiProviders.customOpenAiDescription"),onClick:()=>i({kind:"openai-compatible",provider:x,preset:null})},"custom")]:[],e[16]=i,e[17]=x,e[18]=l,e[19]=g):g=e[19],c=[...O.map(M),...v,...g],e[3]=i,e[4]=t,e[5]=l,e[6]=c}else c=e[6];const f=c,p=f.length-Ke,u=!!o&&p>0;let m;e[20]!==f||e[21]!==u?(m=u?f.slice(0,Ke):f,e[20]=f,e[21]=u,e[22]=m):m=e[22];const j=m;let N;e[23]!==r||e[24]!==i||e[25]!==l?(N=r&&s.jsx(Oe,{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:l("settings.aiProviders.recommended")}),s.jsx(Ae,{className:"relative",children:s.jsx(ge,{logo:r.logo,name:r.name,description:r.description,onClick:()=>i({kind:"provider",provider:r})})})]})}),e[23]=r,e[24]=i,e[25]=l,e[26]=N):N=e[26];let S;e[27]!==p||e[28]!==o||e[29]!==u||e[30]!==l?(S=u&&s.jsx(et,{onClick:o,title:l(p===1?"settings.aiProviders.moreProvidersSingular":"settings.aiProviders.moreProvidersPlural",{count:p}),action:s.jsx(Ut,{size:16,className:"text-muted-foreground"})}),e[27]=p,e[28]=o,e[29]=u,e[30]=l,e[31]=S):S=e[31];let b;e[32]!==S||e[33]!==j?(b=s.jsx(Oe,{children:s.jsxs(Ae,{children:[j,S]})}),e[32]=S,e[33]=j,e[34]=b):b=e[34];let I;return e[35]!==N||e[36]!==b?(I=s.jsxs("div",{className:"flex flex-col gap-6",children:[N,b]}),e[35]=N,e[36]=b,e[37]=I):I=e[37],I}function os(n){return n.id!=="openai"}function rs(n){return n.id==="openai-compatible"}function as(n){return n.id!=="deco"&&n.id!=="openai-compatible"}function cs(n){return n.id==="deco"}const ds=Be({label:ve().optional(),apiKey:ve().min(1,"API key is required")});function hs(n){const e=G.c(87),{providerId:t,onCancel:i,onSuccess:o}=n,{org:l}=xe(),a=Ne(),r=we(),[h,d]=$.useState(!1),c=se();let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f={resolver:We(ds),defaultValues:{label:"",apiKey:""}},e[0]=f):f=e[0];const{register:p,handleSubmit:u,formState:m}=Ve(f),{errors:j}=m;let N;e[1]!==t||e[2]!==a||e[3]!==c?(N=async Y=>{await a.call("AI_PROVIDER_KEY_CREATE",{providerId:t,label:Y.label||c("settings.connectForms.defaultKeyLabel"),apiKey:Y.apiKey})},e[1]=t,e[2]=a,e[3]=c,e[4]=N):N=e[4];let S;e[5]!==o||e[6]!==l||e[7]!==r||e[8]!==c?(S=()=>{r.invalidateQueries({queryKey:ce.aiProviderKeys(l.id)}),r.invalidateQueries({queryKey:ce.aiProviders(l.id)}),ne.success(c("settings.connectForms.keySavedSuccess")),o()},e[5]=o,e[6]=l,e[7]=r,e[8]=c,e[9]=S):S=e[9];let b;e[10]!==c?(b=Y=>{ne.error(c("settings.connectForms.failedSaveKey",{error:Y.message}))},e[10]=c,e[11]=b):b=e[11];let I;e[12]!==N||e[13]!==S||e[14]!==b?(I={mutationFn:N,onSuccess:S,onError:b},e[12]=N,e[13]=S,e[14]=b,e[15]=I):I=e[15];const{mutate:E,isPending:O,error:k}=je(I);let x;e[16]!==E?(x=Y=>E(Y),e[16]=E,e[17]=x):x=e[17];let w;e[18]!==u||e[19]!==x?(w=u(x),e[18]=u,e[19]=x,e[20]=w):w=e[20];let _;e[21]!==c?(_=c("settings.connectForms.labelField"),e[21]=c,e[22]=_):_=e[22];let M;e[23]!==_?(M=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:_}),e[23]=_,e[24]=M):M=e[24];let v;e[25]!==c?(v=c("settings.connectForms.labelPlaceholder"),e[25]=c,e[26]=v):v=e[26];let g;e[27]!==p?(g=p("label"),e[27]=p,e[28]=g):g=e[28];let y;e[29]!==v||e[30]!==g?(y=s.jsx(pe,{placeholder:v,...g,className:"h-8 text-sm"}),e[29]=v,e[30]=g,e[31]=y):y=e[31];let C;e[32]!==M||e[33]!==y?(C=s.jsxs("div",{className:"space-y-1",children:[M,y]}),e[32]=M,e[33]=y,e[34]=C):C=e[34];let z;e[35]!==c?(z=c("settings.connectForms.apiKeyField"),e[35]=c,e[36]=z):z=e[36];let A;e[37]!==z?(A=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:z}),e[37]=z,e[38]=A):A=e[38];const P=h?"text":"password";let T;e[39]!==p?(T=p("apiKey"),e[39]=p,e[40]=T):T=e[40];let L;e[41]!==P||e[42]!==T?(L=s.jsx(pe,{type:P,placeholder:"sk-...",...T,className:"ph-no-capture h-8 text-sm pr-8"}),e[41]=P,e[42]=T,e[43]=L):L=e[43];let F;e[44]!==h?(F=()=>d(!h),e[44]=h,e[45]=F):F=e[45];let K;e[46]!==h||e[47]!==c?(K=c(h?"settings.connectForms.hideApiKey":"settings.connectForms.showApiKey"),e[46]=h,e[47]=c,e[48]=K):K=e[48];let X;e[49]!==h?(X=h?s.jsx(Qe,{size:14}):s.jsx(tt,{size:14}),e[49]=h,e[50]=X):X=e[50];let V;e[51]!==F||e[52]!==K||e[53]!==X?(V=s.jsx("button",{type:"button",onClick:F,"aria-label":K,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:X}),e[51]=F,e[52]=K,e[53]=X,e[54]=V):V=e[54];let Q;e[55]!==L||e[56]!==V?(Q=s.jsxs("div",{className:"relative",children:[L,V]}),e[55]=L,e[56]=V,e[57]=Q):Q=e[57];let J;e[58]!==j.apiKey?(J=j.apiKey&&s.jsx("p",{className:"text-xs text-destructive",children:j.apiKey.message}),e[58]=j.apiKey,e[59]=J):J=e[59];let H;e[60]!==A||e[61]!==Q||e[62]!==J?(H=s.jsxs("div",{className:"space-y-1",children:[A,Q,J]}),e[60]=A,e[61]=Q,e[62]=J,e[63]=H):H=e[63];let U;e[64]!==k?(U=k&&s.jsx("p",{className:"text-xs text-destructive",children:k.message}),e[64]=k,e[65]=U):U=e[65];let B;e[66]!==c?(B=c("settings.connectForms.cancel"),e[66]=c,e[67]=B):B=e[67];let W;e[68]!==O||e[69]!==i||e[70]!==B?(W=s.jsx(le,{type:"button",variant:"ghost",size:"sm",onClick:i,disabled:O,children:B}),e[68]=O,e[69]=i,e[70]=B,e[71]=W):W=e[71];let Z;e[72]!==O||e[73]!==c?(Z=c(O?"settings.connectForms.saving":"settings.connectForms.saveKey"),e[72]=O,e[73]=c,e[74]=Z):Z=e[74];let R;e[75]!==O||e[76]!==Z?(R=s.jsx(le,{type:"submit",size:"sm",disabled:O,children:Z}),e[75]=O,e[76]=Z,e[77]=R):R=e[77];let D;e[78]!==W||e[79]!==R?(D=s.jsxs(He,{children:[W,R]}),e[78]=W,e[79]=R,e[80]=D):D=e[80];let q;return e[81]!==C||e[82]!==H||e[83]!==U||e[84]!==D||e[85]!==w?(q=s.jsxs("form",{onSubmit:w,className:"space-y-3",children:[C,H,U,D]}),e[81]=C,e[82]=H,e[83]=U,e[84]=D,e[85]=w,e[86]=q):q=e[86],q}const us=Be({label:ve().optional(),baseUrl:ve().min(1,"Base URL is required"),apiKey:ve().optional()});function ms(n){const e=G.c(105),{preset:t,onCancel:i,onSuccess:o}=n,{org:l}=xe(),a=Ne(),r=we(),[h,d]=$.useState(!1),c=se();let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=We(us),e[0]=f):f=e[0];const p=t?.defaultBaseUrl??"";let u;e[1]!==p?(u={resolver:f,defaultValues:{label:"",baseUrl:p,apiKey:""}},e[1]=p,e[2]=u):u=e[2];const{register:m,handleSubmit:j,formState:N}=Ve(u),{errors:S}=N;let b;e[3]!==t||e[4]!==a?(b=async ae=>{const ht=JSON.stringify({baseUrl:ae.baseUrl,apiKey:ae.apiKey||""});await a.call("AI_PROVIDER_KEY_CREATE",{providerId:"openai-compatible",label:ae.label||t?.name||ae.baseUrl,apiKey:ht,...t?{presetId:t.id}:{}})},e[3]=t,e[4]=a,e[5]=b):b=e[5];let I;e[6]!==o||e[7]!==l||e[8]!==r||e[9]!==c?(I=()=>{r.invalidateQueries({queryKey:ce.aiProviderKeys(l.id)}),r.invalidateQueries({queryKey:ce.aiProviders(l.id)}),ne.success(c("settings.connectForms.connectionSavedSuccess")),o()},e[6]=o,e[7]=l,e[8]=r,e[9]=c,e[10]=I):I=e[10];let E;e[11]!==c?(E=ae=>{ne.error(c("settings.connectForms.failedSaveConnection",{error:ae.message}))},e[11]=c,e[12]=E):E=e[12];let O;e[13]!==b||e[14]!==I||e[15]!==E?(O={mutationFn:b,onSuccess:I,onError:E},e[13]=b,e[14]=I,e[15]=E,e[16]=O):O=e[16];const{mutate:k,isPending:x,error:w}=je(O);let _;e[17]!==t||e[18]!==c?(_=t?c("settings.connectForms.labelPlaceholderPreset",{name:t.name}):c("settings.connectForms.labelPlaceholderOpenAiCompatible"),e[17]=t,e[18]=c,e[19]=_):_=e[19];const M=_;let v;e[20]!==t?.baseUrlPlaceholder||e[21]!==c?(v=t?.baseUrlPlaceholder??c("settings.connectForms.baseUrlPlaceholder"),e[20]=t?.baseUrlPlaceholder,e[21]=c,e[22]=v):v=e[22];const g=v;let y;e[23]!==k?(y=ae=>k(ae),e[23]=k,e[24]=y):y=e[24];let C;e[25]!==j||e[26]!==y?(C=j(y),e[25]=j,e[26]=y,e[27]=C):C=e[27];let z;e[28]!==c?(z=c("settings.connectForms.labelField"),e[28]=c,e[29]=z):z=e[29];let A;e[30]!==z?(A=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:z}),e[30]=z,e[31]=A):A=e[31];let P;e[32]!==m?(P=m("label"),e[32]=m,e[33]=P):P=e[33];let T;e[34]!==M||e[35]!==P?(T=s.jsx(pe,{placeholder:M,...P,className:"h-8 text-sm"}),e[34]=M,e[35]=P,e[36]=T):T=e[36];let L;e[37]!==A||e[38]!==T?(L=s.jsxs("div",{className:"space-y-1",children:[A,T]}),e[37]=A,e[38]=T,e[39]=L):L=e[39];let F;e[40]!==g||e[41]!==S||e[42]!==t?.defaultBaseUrl||e[43]!==m||e[44]!==c?(F=t?.defaultBaseUrl?s.jsx("input",{type:"hidden",...m("baseUrl")}):s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:c("settings.connectForms.baseUrlField")}),s.jsx(pe,{type:"url",placeholder:g,...m("baseUrl"),className:"h-8 text-sm"}),S.baseUrl&&s.jsx("p",{className:"text-xs text-destructive",children:S.baseUrl.message})]}),e[40]=g,e[41]=S,e[42]=t?.defaultBaseUrl,e[43]=m,e[44]=c,e[45]=F):F=e[45];let K;e[46]!==c?(K=c("settings.connectForms.apiKeyField"),e[46]=c,e[47]=K):K=e[47];let X;e[48]!==t?.apiKeyRecommended||e[49]!==c?(X=t?.apiKeyRecommended?c("settings.connectForms.recommended"):c("settings.connectForms.optional"),e[48]=t?.apiKeyRecommended,e[49]=c,e[50]=X):X=e[50];let V;e[51]!==X?(V=s.jsxs("span",{className:"text-muted-foreground/60",children:["(",X,")"]}),e[51]=X,e[52]=V):V=e[52];let Q;e[53]!==K||e[54]!==V?(Q=s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:[K," ",V]}),e[53]=K,e[54]=V,e[55]=Q):Q=e[55];const J=h?"text":"password";let H;e[56]!==m?(H=m("apiKey"),e[56]=m,e[57]=H):H=e[57];let U;e[58]!==J||e[59]!==H?(U=s.jsx(pe,{type:J,placeholder:"sk-...",...H,className:"ph-no-capture h-8 text-sm pr-8"}),e[58]=J,e[59]=H,e[60]=U):U=e[60];let B;e[61]!==h?(B=()=>d(!h),e[61]=h,e[62]=B):B=e[62];let W;e[63]!==h||e[64]!==c?(W=c(h?"settings.connectForms.hideApiKey":"settings.connectForms.showApiKey"),e[63]=h,e[64]=c,e[65]=W):W=e[65];let Z;e[66]!==h?(Z=h?s.jsx(Qe,{size:14}):s.jsx(tt,{size:14}),e[66]=h,e[67]=Z):Z=e[67];let R;e[68]!==B||e[69]!==W||e[70]!==Z?(R=s.jsx("button",{type:"button",onClick:B,"aria-label":W,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:Z}),e[68]=B,e[69]=W,e[70]=Z,e[71]=R):R=e[71];let D;e[72]!==U||e[73]!==R?(D=s.jsxs("div",{className:"relative",children:[U,R]}),e[72]=U,e[73]=R,e[74]=D):D=e[74];let q;e[75]!==Q||e[76]!==D?(q=s.jsxs("div",{className:"space-y-1",children:[Q,D]}),e[75]=Q,e[76]=D,e[77]=q):q=e[77];let Y;e[78]!==t?(Y=t?.helpText&&s.jsx("p",{className:"text-xs text-muted-foreground",children:t.helpText}),e[78]=t,e[79]=Y):Y=e[79];let te;e[80]!==w?(te=w&&s.jsx("p",{className:"text-xs text-destructive",children:w.message}),e[80]=w,e[81]=te):te=e[81];let re;e[82]!==c?(re=c("settings.connectForms.cancel"),e[82]=c,e[83]=re):re=e[83];let de;e[84]!==x||e[85]!==i||e[86]!==re?(de=s.jsx(le,{type:"button",variant:"ghost",size:"sm",onClick:i,disabled:x,children:re}),e[84]=x,e[85]=i,e[86]=re,e[87]=de):de=e[87];let he;e[88]!==x||e[89]!==c?(he=c(x?"settings.connectForms.saving":"settings.connectForms.saveConnection"),e[88]=x,e[89]=c,e[90]=he):he=e[90];let ue;e[91]!==x||e[92]!==he?(ue=s.jsx(le,{type:"submit",size:"sm",disabled:x,children:he}),e[91]=x,e[92]=he,e[93]=ue):ue=e[93];let me;e[94]!==de||e[95]!==ue?(me=s.jsxs(He,{children:[de,ue]}),e[94]=de,e[95]=ue,e[96]=me):me=e[96];let ye;return e[97]!==C||e[98]!==L||e[99]!==F||e[100]!==q||e[101]!==Y||e[102]!==te||e[103]!==me?(ye=s.jsxs("form",{onSubmit:C,className:"space-y-3",children:[L,F,q,Y,te,me]}),e[97]=C,e[98]=L,e[99]=F,e[100]=q,e[101]=Y,e[102]=te,e[103]=me,e[104]=ye):ye=e[104],ye}const fs={kind:"closed"};function ps(n,e){switch(e.type){case"open":return n.kind==="closed"?{kind:"grid"}:n;case"close":return{kind:"closed"};case"back":switch(n.kind){case"form":case"oauth-pending":case"provision-pending":case"provision-error":return{kind:"grid"};default:return n}case"select-form":return n.kind!=="grid"?n:{kind:"form",providerId:e.providerId,presetId:e.presetId};case"select-oauth":return n.kind!=="grid"?n:{kind:"oauth-pending",providerId:e.providerId,stateToken:e.stateToken};case"oauth-failed":return n.kind==="oauth-pending"?{kind:"grid"}:n;case"select-provision":return n.kind!=="grid"?n:{kind:"provision-pending",providerId:e.providerId};case"provision-error":return n.kind!=="provision-pending"?n:{kind:"provision-error",providerId:n.providerId,error:e.error};case"retry-provision":return n.kind!=="provision-error"?n:{kind:"provision-pending",providerId:n.providerId}}}function xs(n){switch(n.kind){case"form":case"oauth-pending":case"provision-pending":case"provision-error":return n.providerId;default:return null}}function gs({open:n,onOpenChange:e,initialProvider:t}){const i=se(),l=ke()?.providers??[],{org:a}=xe(),r=Ne(),h=we(),[d,c]=$.useReducer(ps,fs),f=$.useRef(!1);$.useEffect(()=>{n&&d.kind==="closed"?c({type:"open"}):!n&&d.kind!=="closed"&&c({type:"close"})},[n,d.kind]);const p=()=>{f.current=!1,c({type:"close"}),e(!1)},u=()=>{h.invalidateQueries({queryKey:ce.aiProviderKeys(a.id)}),h.invalidateQueries({queryKey:ce.aiProviders(a.id)})},{mutate:m}=je({mutationFn:async({providerId:v,code:g,stateToken:y,label:C})=>(await r.call("AI_PROVIDER_OAUTH_EXCHANGE",{providerId:v,code:g,stateToken:y,label:C}),v),onSuccess:v=>{ie("ai_provider_oauth_succeeded",{provider_id:v}),u();const g=l.find(y=>y.id===v);ne.success(i("settings.connectProviderDialog.oauthSuccessMessage",{provider:g?.name??i("settings.connectProviderDialog.defaultProviderName")})),p()},onError:(v,g)=>{ie("ai_provider_oauth_failed",{provider_id:g.providerId,error:v.message}),ne.error(i("settings.connectProviderDialog.oauthFailedMessage",{error:v.message})),c({type:"oauth-failed"})}}),{mutate:j}=je({mutationFn:async v=>(await r.call("AI_PROVIDER_PROVISION_KEY",{providerId:v}),v),onSuccess:v=>{ie("ai_provider_provision_succeeded",{provider_id:v}),u();const g=l.find(y=>y.id===v);ne.success(i("settings.connectProviderDialog.provisionSuccessMessage",{provider:g?.name??i("settings.connectProviderDialog.defaultProviderName")})),p()},onError:(v,g)=>{ie("ai_provider_provision_failed",{provider_id:g,error:v.message}),c({type:"provision-error",error:v.message})}}),N=async v=>{const{provider:g}=v,y=v.kind==="openai-compatible"?v.preset?.id??null:null,C=g.supportedMethods.includes("oauth-pkce"),z=g.supportedMethods.includes("api-key");if(g.supportsProvision===!0){ie("ai_provider_connect_clicked",{provider_id:g.id,method:"provision"}),c({type:"select-provision",providerId:g.id}),j(g.id);return}if(C){ie("ai_provider_connect_clicked",{provider_id:g.id,method:"oauth-pkce"});try{const P=await r.call("AI_PROVIDER_OAUTH_URL",{providerId:g.id,callbackUrl:`${window.location.origin}/oauth/callback/ai-provider`});if(!P?.url)throw new Error("Invalid response from AI_PROVIDER_OAUTH_URL");c({type:"select-oauth",providerId:g.id,stateToken:P.stateToken}),window.open(P.url,"AiProviderOAuth","width=600,height=700")}catch(P){ne.error(i("settings.connectProviderDialog.startOAuthFailedMessage",{error:P instanceof Error?P.message:String(P)}))}return}z&&(ie("ai_provider_connect_clicked",{provider_id:g.id,...y!==null?{preset_id:y}:{},method:"api-key"}),c({type:"select-form",providerId:g.id,presetId:y}))},S=$.useRef(N);S.current=N;const b=$.useRef(t);b.current=t,$.useEffect(()=>{!b.current||d.kind!=="grid"||f.current||(f.current=!0,S.current(b.current))},[d.kind]);const I=d.kind==="oauth-pending"?d.stateToken:null,E=d.kind==="oauth-pending"?d.providerId:null;$.useEffect(()=>{if(d.kind!=="oauth-pending")return;let v=!1;const g=d.stateToken,y=d.providerId,C=A=>{if(A.origin!==window.location.origin||A.data?.type!=="AI_PROVIDER_OAUTH_CALLBACK")return;const{code:P,stateToken:T}=A.data;if(T!==g){ne.error(i("settings.connectProviderDialog.securityCheckFailedMessage")),c({type:"oauth-failed"});return}v=!0;const L=l.find(F=>F.id===y);m({providerId:y,code:P,stateToken:g,label:L?.name??y})};window.addEventListener("message",C);const z=setTimeout(()=>{v||(ie("ai_provider_oauth_timeout",{provider_id:y}),c({type:"oauth-failed"}),ne.error(i("settings.connectProviderDialog.connectionTimedOutMessage")))},12e4);return()=>{window.removeEventListener("message",C),clearTimeout(z)}},[d.kind,I,E,m]);const O=xs(d),k=O?l.find(v=>v.id===O):null,w=(d.kind==="form"&&d.presetId?be(d.presetId):null)?.name??k?.name??i("settings.connectProviderDialog.defaultTitle"),_=d.kind!=="grid"&&d.kind!=="closed",M=()=>{t?p():c({type:"back"})};return s.jsx(qe,{open:d.kind!=="closed",onOpenChange:v=>!v&&p(),children:s.jsxs(Ye,{className:"sm:max-w-md max-h-[90vh] overflow-y-auto",children:[s.jsxs(gt,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[_&&s.jsx(le,{variant:"ghost",size:"icon","aria-label":i("settings.connectProviderDialog.backButtonLabel"),className:"h-7 w-7",onClick:M,children:s.jsx(Je,{size:16})}),s.jsx(Ge,{children:w})]}),d.kind==="grid"&&!t&&s.jsx(vt,{children:i("settings.connectProviderDialog.gridDescription")})]}),d.kind==="grid"&&!t&&s.jsx(nt,{providers:l,onSelect:N}),d.kind==="form"&&(d.providerId==="openai-compatible"?s.jsx(ms,{preset:d.presetId?be(d.presetId):void 0,onCancel:()=>c({type:"back"}),onSuccess:()=>{u(),p()}}):s.jsx(hs,{providerId:d.providerId,onCancel:()=>c({type:"back"}),onSuccess:()=>{u(),p()}})),d.kind==="oauth-pending"&&s.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[s.jsx(Ee,{size:"lg"}),s.jsx("p",{className:"text-sm text-muted-foreground text-center",children:i("settings.connectProviderDialog.oauthPendingMessage")})]}),d.kind==="provision-pending"&&s.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[s.jsx(Ee,{size:"lg"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:i("settings.connectProviderDialog.provisionPendingMessage")})]}),d.kind==="provision-error"&&s.jsxs("div",{className:"flex flex-col items-center gap-4 py-6",children:[s.jsx($t,{size:28,className:"text-destructive"}),s.jsx("p",{className:"text-sm text-foreground text-center",children:d.error}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(le,{variant:"outline",size:"sm",onClick:()=>c({type:"back"}),children:i("settings.connectProviderDialog.backButton")}),s.jsx(le,{size:"sm",onClick:()=>{c({type:"retry-provision"}),j(d.providerId)},children:i("settings.connectProviderDialog.retryButton")})]})]})]})})}function vs(){const n=G.c(7),{org:e}=xe(),t=Ne();let i;n[0]!==e.id?(i=ce.defaultBrand(e.id),n[0]=e.id,n[1]=i):i=n[1];let o;n[2]!==t?(o=async()=>{const{items:r}=await t.call("BRAND_CONTEXT_LIST",{});return(Array.isArray(r)?r:[]).find(bs)??null},n[2]=t,n[3]=o):o=n[3];let l;n[4]!==i||n[5]!==o?(l={queryKey:i,queryFn:o},n[4]=i,n[5]=o,n[6]=l):l=n[6];const{data:a}=mt(l);return a??null}function bs(n){return n.isDefault&&!n.archivedAt}function ys(n){const e=n.colors;if(!e)return null;if(Array.isArray(e)){const t=e.find(o=>typeof o=="object"&&o!==null&&"label"in o&&/primary|brand|main/i.test(o.label)),i=t?t.value:e[0]?.value;return typeof i=="string"?i:null}if(typeof e=="object"){const t=e;return t.primary??Object.values(t)[0]??null}return null}function js(n){const e=G.c(49);let t;e[0]!==n?(t=n===void 0?{}:n,e[0]=n,e[1]=t):t=e[1];const{title:i,description:o}=t,l=se(),{org:a}=xe(),r=vs(),[h,d]=$.useState(null),[c,f]=$.useState(!1),[p,u]=$.useState(!1),m=Ht();let j;e[2]!==m?(j=Wt()&&!m,e[2]=m,e[3]=j):j=e[3];const N=j,S=ke();let b;e[4]!==S?.providers?(b=S?.providers??[],e[4]=S?.providers,e[5]=b):b=e[5];const I=b,E=a.name;let O;e[6]!==r?(O=r?ys(r):null,e[6]=r,e[7]=O):O=e[7];const k=O,x=r?.favicon??r?.logo??null;let w;e[8]!==E||e[9]!==l||e[10]!==i?(w=i??(E?l("chat.noAiProviderEmptyState.headingWithOrg",{org:E}):l("chat.noAiProviderEmptyState.headingDefault")),e[8]=E,e[9]=l,e[10]=i,e[11]=w):w=e[11];const _=w;let M;e[12]!==o||e[13]!==l?(M=o??l("chat.noAiProviderEmptyState.subtitleDefault"),e[12]=o,e[13]=l,e[14]=M):M=e[14];const v=M,g=!!(x||k);let y;e[15]!==k?(y=k?{backgroundColor:`${k}18`,borderColor:`${k}30`}:void 0,e[15]=k,e[16]=y):y=e[16];const C=y,z=g?"flex items-center justify-center size-14 rounded-2xl border":"flex items-center justify-center size-14 rounded-2xl bg-muted border border-border";let A;e[17]!==z||e[18]!==C||e[19]!==x||e[20]!==N||e[21]!==k||e[22]!==l?(A=x?s.jsx("div",{className:z,style:C,children:s.jsx("img",{src:x,alt:"",className:"size-7 rounded object-contain"})}):N?s.jsx("button",{type:"button",onClick:()=>u(!0),"aria-label":l("downloadApp.openLabel"),className:oe(z,"cursor-pointer transition-colors hover:bg-accent"),style:C,children:s.jsx(Me,{size:24,style:k?{color:k}:void 0,className:oe(!k&&"text-muted-foreground")})}):s.jsx("div",{className:z,style:C,children:s.jsx(Me,{size:24,style:k?{color:k}:void 0,className:oe(!k&&"text-muted-foreground")})}),e[17]=z,e[18]=C,e[19]=x,e[20]=N,e[21]=k,e[22]=l,e[23]=A):A=e[23];let P;e[24]!==_?(P=s.jsx("p",{className:"text-xl font-semibold text-foreground tracking-tight",children:_}),e[24]=_,e[25]=P):P=e[25];let T;e[26]!==v?(T=s.jsx("p",{className:"text-sm text-muted-foreground max-w-md",children:v}),e[26]=v,e[27]=T):T=e[27];let L;e[28]!==T||e[29]!==P?(L=s.jsxs("div",{className:"space-y-2",children:[P,T]}),e[28]=T,e[29]=P,e[30]=L):L=e[30];let F;e[31]!==L||e[32]!==A?(F=s.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[A,L]}),e[31]=L,e[32]=A,e[33]=F):F=e[33];let K,X;e[34]===Symbol.for("react.memo_cache_sentinel")?(K=Z=>d(Z),X=()=>f(!0),e[34]=K,e[35]=X):(K=e[34],X=e[35]);let V;e[36]!==I?(V=s.jsx("div",{className:"w-full",children:s.jsx(nt,{providers:I,onSelect:K,onShowAll:X})}),e[36]=I,e[37]=V):V=e[37];const Q=h!==null||c;let J;e[38]===Symbol.for("react.memo_cache_sentinel")?(J=Z=>{Z||(d(null),f(!1))},e[38]=J):J=e[38];const H=h??void 0;let U;e[39]!==Q||e[40]!==H?(U=s.jsx(gs,{open:Q,onOpenChange:J,initialProvider:H}),e[39]=Q,e[40]=H,e[41]=U):U=e[41];let B;e[42]!==p?(B=s.jsx(Vt,{open:p,onOpenChange:u}),e[42]=p,e[43]=B):B=e[43];let W;return e[44]!==F||e[45]!==V||e[46]!==U||e[47]!==B?(W=s.jsxs("div",{className:"flex flex-col items-center gap-8 w-full max-w-3xl px-4",children:[F,V,U,B]}),e[44]=F,e[45]=V,e[46]=U,e[47]=B,e[48]=W):W=e[48],W}function Ce(n){const e=n.title.includes(": ");return{provider:e?n.title.split(": ")[0]??"":n.modelId.split("/")[0]??"",displayName:e?n.title.split(": ").slice(1).join(": "):n.title}}function Ss(n){return n<32e3?{level:1,labelKey:"chat.shared.contextLevelSmall",descriptionKey:"chat.shared.contextLevelSmallDesc"}:n<2e5?{level:2,labelKey:"chat.shared.contextLevelMedium",descriptionKey:"chat.shared.contextLevelMediumDesc"}:n<5e5?{level:3,labelKey:"chat.shared.contextLevelLarge",descriptionKey:"chat.shared.contextLevelLargeDesc"}:{level:4,labelKey:"chat.shared.contextLevelVeryLarge",descriptionKey:"chat.shared.contextLevelVeryLargeDesc"}}const Ns=["bg-destructive","bg-warning","bg-success","bg-success"],ws=["text-success","text-warning","text-warning","text-destructive"];function ks(n,e){const t=Math.round(n*.75/1e3),i=t>=1?`${t}K`:`${Math.round(n*.75)}`;return e("chat.shared.approxWords",{wordCount:i})}function _s(n){return n<1?{level:1,labelKey:"chat.shared.costLevelCheap"}:n<5?{level:2,labelKey:"chat.shared.costLevelModerate"}:n<15?{level:3,labelKey:"chat.shared.costLevelHigh"}:{level:4,labelKey:"chat.shared.costLevelExpensive"}}const Cs={text:{icon:s.jsx(zt,{className:"size-3.5"}),labelKey:"chat.shared.capabilityText"},vision:{icon:s.jsx(Lt,{className:"size-3.5"}),labelKey:"chat.shared.capabilityVision"},image:{icon:s.jsx(Ot,{className:"size-3.5"}),labelKey:"chat.shared.capabilityImage"},tools:{icon:s.jsx(Tt,{className:"size-3.5"}),labelKey:"chat.shared.capabilityTools"},reasoning:{icon:s.jsx(qt,{className:"size-3.5"}),labelKey:"chat.shared.capabilityReasoning"},"web-search":{icon:s.jsx(Ze,{className:"size-3.5"}),labelKey:"chat.shared.capabilityWebSearch"}};function Is(n){const e=G.c(10),{capability:t}=n,i=se(),o=Cs[t];if(o){const h=o.icon;let d;e[0]!==o.labelKey||e[1]!==i?(d=i(o.labelKey),e[0]=o.labelKey,e[1]=i,e[2]=d):d=e[2];let c;return e[3]!==o.icon||e[4]!==d?(c=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:[h,d]}),e[3]=o.icon,e[4]=d,e[5]=c):c=e[5],c}let l;e[6]!==t?(l=t.charAt(0).toUpperCase(),e[6]=t,e[7]=l):l=e[7];const a=l+t.slice(1);let r;return e[8]!==a?(r=s.jsx("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground border border-border rounded px-2 py-0.5",children:a}),e[8]=a,e[9]=r):r=e[9],r}function Ms(n){const e=G.c(59),{model:t,compact:i}=n,o=i===void 0?!1:i,l=se();if(!t){let x;e[0]!==l?(x=l("chat.shared.hoverToPreview"),e[0]=l,e[1]=x):x=e[1];let w;return e[2]!==x?(w=s.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:x}),e[2]=x,e[3]=w):w=e[3],w}const a=t.costs?.input!=null?t.costs.input*1e6:null,r=t.costs?.output!=null?t.costs.output*1e6:null;let h;e[4]!==t?(h=Ce(t),e[4]=t,e[5]=h):h=e[5];const{provider:d,displayName:c}=h;if(o){let x;e[6]!==t.limits||e[7]!==l?(x=t.limits?.contextWindow&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:l("chat.shared.context")}),s.jsxs("span",{className:"text-foreground font-medium",children:[t.limits.contextWindow.toLocaleString()," ",l("chat.shared.tokens")]})]}),e[6]=t.limits,e[7]=l,e[8]=x):x=e[8];let w;e[9]!==a||e[10]!==l?(w=a!=null&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:l("chat.shared.input")}),s.jsxs("span",{className:"text-foreground font-medium",children:["$",a.toFixed(2)," / 1M"]})]}),e[9]=a,e[10]=l,e[11]=w):w=e[11];let _;e[12]!==r||e[13]!==l?(_=r!=null&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:l("chat.shared.output")}),s.jsxs("span",{className:"text-foreground font-medium",children:["$",r.toFixed(2)," / 1M"]})]}),e[12]=r,e[13]=l,e[14]=_):_=e[14];let M;e[15]!==t.limits||e[16]!==l?(M=t.limits?.maxOutputTokens&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:l("chat.shared.outputLimit")}),s.jsxs("span",{className:"text-foreground font-medium",children:[t.limits.maxOutputTokens.toLocaleString()," ",l("chat.shared.tokens")]})]}),e[15]=t.limits,e[16]=l,e[17]=M):M=e[17];let v;return e[18]!==x||e[19]!==w||e[20]!==_||e[21]!==M?(v=s.jsxs("div",{className:"flex flex-col gap-2 pt-3 pb-3 px-3 text-xs",children:[x,w,_,M]}),e[18]=x,e[19]=w,e[20]=_,e[21]=M,e[22]=v):v=e[22],v}let f;e[23]!==d?(f=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:d}),e[23]=d,e[24]=f):f=e[24];let p;e[25]!==t.logo||e[26]!==t.title?(p=t.logo&&s.jsx("img",{src:t.logo,className:"size-6 shrink-0 rounded-md dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[25]=t.logo,e[26]=t.title,e[27]=p):p=e[27];let u;e[28]!==c?(u=s.jsx("p",{className:"text-lg font-semibold leading-snug tracking-tight",children:c}),e[28]=c,e[29]=u):u=e[29];let m;e[30]!==p||e[31]!==u?(m=s.jsxs("div",{className:"flex items-center gap-2.5",children:[p,u]}),e[30]=p,e[31]=u,e[32]=m):m=e[32];let j;e[33]!==t.modelId?(j=s.jsx("p",{className:"text-xs text-muted-foreground/50 font-mono",children:t.modelId}),e[33]=t.modelId,e[34]=j):j=e[34];let N;e[35]!==f||e[36]!==m||e[37]!==j?(N=s.jsxs("div",{className:"flex flex-col gap-1 pt-1 pr-6",children:[f,m,j]}),e[35]=f,e[36]=m,e[37]=j,e[38]=N):N=e[38];let S;e[39]!==t.capabilities?(S=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(Es)}),e[39]=t.capabilities,e[40]=S):S=e[40];let b;e[41]!==t.limits||e[42]!==l?(b=t.limits?.contextWindow&&(()=>{const{level:x,labelKey:w,descriptionKey:_}=Ss(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:l("chat.shared.contextWindow")}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex items-center gap-0.5",children:[1,2,3,4].map(M=>s.jsx("div",{className:oe("w-2 h-2 rounded-full",M<=x?Ns[x-1]:"bg-muted")},M))}),s.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:l(w)}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:["— ",l(_)]})]}),s.jsxs("span",{className:"text-sm text-muted-foreground",children:[t.limits.contextWindow.toLocaleString()," ",l("chat.shared.tokens")]})]})})(),e[41]=t.limits,e[42]=l,e[43]=b):b=e[43];let I;e[44]!==t.limits||e[45]!==l?(I=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:l("chat.shared.outputLimit")}),s.jsxs("div",{className:"flex items-baseline gap-2",children:[s.jsxs("span",{className:"text-sm text-foreground",children:[t.limits.maxOutputTokens.toLocaleString()," ",l("chat.shared.tokens")]}),s.jsx("span",{className:"text-sm text-muted-foreground",children:ks(t.limits.maxOutputTokens,l)})]})]}),e[44]=t.limits,e[45]=l,e[46]=I):I=e[46];let E;e[47]!==a||e[48]!==r||e[49]!==l?(E=(a!=null||r!=null)&&(()=>{const{level:x,labelKey:w}=a!=null?_s(a):{level:0,labelKey:null};return s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:l("chat.shared.pricing")}),a!=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.jsx("span",{className:oe("text-sm font-bold leading-none",_<=x?ws[x-1]:"text-muted-foreground/20"),children:"$"},_))}),s.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:w?l(w):""})]}),s.jsxs("div",{className:"flex flex-col gap-1",children:[a!=null&&s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:l("chat.shared.input")}),s.jsxs("span",{className:"text-xs text-foreground",children:["$",a.toFixed(2)," / 1M"," ",l("chat.shared.tokens")]})]}),r!=null&&s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:l("chat.shared.output")}),s.jsxs("span",{className:"text-xs text-foreground",children:["$",r.toFixed(2)," / 1M"," ",l("chat.shared.tokens")]})]})]})]})})(),e[47]=a,e[48]=r,e[49]=l,e[50]=E):E=e[50];let O;e[51]!==b||e[52]!==I||e[53]!==E?(O=s.jsxs("div",{className:"flex flex-col gap-6",children:[b,I,E]}),e[51]=b,e[52]=I,e[53]=E,e[54]=O):O=e[54];let k;return e[55]!==O||e[56]!==N||e[57]!==S?(k=s.jsxs("div",{className:"flex flex-col gap-5 py-1 px-1.5",children:[N,S,O]}),e[55]=O,e[56]=N,e[57]=S,e[58]=k):k=e[58],k}function Es(n){return s.jsx(Is,{capability:n},n)}function lt(n){const e=G.c(22),{model:t,placeholder:i,isLoading:o}=n,l=o===void 0?!1:o,a=se();let r;e[0]!==i||e[1]!==a?(r=i??a("chat.shared.selectModel"),e[0]=i,e[1]=a,e[2]=r):r=e[2];const h=r;if(l){let S;return e[3]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(ee,{className:"w-5 h-5 rounded-sm shrink-0"}),s.jsx(ee,{className:"w-16 h-3 hidden md:block"})]}),e[3]=S):S=e[3],S}if(!t){let S;e[4]!==h?(S=s.jsx("span",{className:"text-sm text-muted-foreground",children:h}),e[4]=h,e[5]=S):S=e[5];let b;e[6]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(Pe,{size:14,className:"text-muted-foreground opacity-50 shrink-0"}),e[6]=b):b=e[6];let I;return e[7]!==S?(I=s.jsxs("div",{className:"flex items-center gap-1.5",children:[S,b]}),e[7]=S,e[8]=I):I=e[8],I}let d;e[9]!==t?(d=Ce(t),e[9]=t,e[10]=d):d=e[10];const{displayName:c}=d;let f;e[11]!==t?(f=_e(t),e[11]=t,e[12]=f):f=e[12];const p=f;let u;e[13]!==t.title||e[14]!==p?(u=s.jsx("img",{src:p,className:"w-3.5 h-3.5 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[13]=t.title,e[14]=p,e[15]=u):u=e[15];let m;e[16]!==c?(m=s.jsx("span",{className:"text-sm truncate whitespace-nowrap text-muted-foreground max-w-[100px] sm:max-w-none",children:c}),e[16]=c,e[17]=m):m=e[17];let j;e[18]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Pe,{size:14,className:"text-muted-foreground opacity-50 shrink-0"}),e[18]=j):j=e[18];let N;return e[19]!==u||e[20]!==m?(N=s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0 overflow-hidden",children:[u,m,j]}),e[19]=u,e[20]=m,e[21]=N):N=e[21],N}const Os=["vision","image","file","audio","video"],ot=["image/png","image/jpeg","image/gif","image/webp"],rt=["application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"];function Ie(n){const e=n?.capabilities;return e?Os.some(t=>e.includes(t)):!1}function Li(n,e){if(!n)return!1;if(n.startsWith("text/"))return!0;const t=e?.capabilities??[],i=t.includes("vision")||t.includes("image"),o=t.includes("file"),l=t.includes("audio"),a=t.includes("video");return!!(i&&ot.includes(n)||o&&n==="application/pdf"||l&&n.startsWith("audio/")||a&&n.startsWith("video/")||Ie(e)&&rt.includes(n))}function zi(n){const e=n?.capabilities??[],t=["text/*"];return(e.includes("vision")||e.includes("image"))&&t.push(...ot),e.includes("file")&&t.push("application/pdf"),e.includes("audio")&&t.push("audio/*"),e.includes("video")&&t.push("video/*"),Ie(n)&&t.push(...rt),t.join(",")}function Ri(n){const e=n?.capabilities??[],t=[];return(e.includes("vision")||e.includes("image"))&&t.push("chat.shared.fileTypeImages"),e.includes("file")&&t.push("chat.shared.fileTypePdfs"),e.includes("audio")&&t.push("chat.shared.fileTypeAudio"),e.includes("video")&&t.push("chat.shared.fileTypeVideo"),Ie(n)&&t.push("chat.shared.fileTypeOffice"),{parts:t,count:t.length}}const at=["smarter","faster","cheaper"],As={smarter:"chat.decopilot.tierSmarter",faster:"chat.decopilot.tierFaster",cheaper:"chat.decopilot.tierCheaper"},Ps=[{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"]}],Ts=Ps.flatMap(({tier:n,prefixes:e})=>e.map(t=>({tier:n,prefix:t}))).sort((n,e)=>e.prefix.length-n.prefix.length),Ls="google/gemini-2.5-pro",De=new Map;function zs(n){const e=De.get(n);if(e!==void 0)return e;let t=null;if(n.endsWith(":free"))t="cheaper";else for(const{tier:i,prefix:o}of Ts)if(n.startsWith(o)){if(o===Ls&&n.length>o.length&&n[o.length]==="-"){const a=n[o.length+1];if(!a||!/\d/.test(a))continue}t=i;break}return De.set(n,t),t}function $e(n){const e={smarter:[],faster:[],cheaper:[],other:[]};for(const t of n){const i=zs(t.modelId);e[i??"other"].push(t)}for(const t of Object.keys(e))e[t].sort((i,o)=>i.title.localeCompare(o.title));return e}const ct="studio:model-shortlist:",Rs=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 Fs(n){try{const e=localStorage.getItem(ct+n);return e?new Set(JSON.parse(e)):null}catch{return null}}function Ks(n,e){localStorage.setItem(ct+n,JSON.stringify([...e]))}function Ds(n){const e=G.c(21),{model:t,onHover:i}=n;let o;e[0]!==t?(o=Ce(t),e[0]=t,e[1]=o):o=e[1];const{displayName:l,provider:a}=o;let r;e[2]!==t?(r=_e(t),e[2]=t,e[3]=r):r=e[3];const h=r;let d;e[4]!==t||e[5]!==i?(d=()=>i(t),e[4]=t,e[5]=i,e[6]=d):d=e[6];let c;e[7]!==t.title||e[8]!==h?(c=s.jsx("img",{src:h,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]=h,e[9]=c):c=e[9];let f;e[10]!==l?(f=s.jsx("span",{className:"text-sm text-foreground leading-tight truncate",children:l}),e[10]=l,e[11]=f):f=e[11];let p;e[12]!==a?(p=s.jsx("span",{className:"text-xs text-muted-foreground/60 leading-tight",children:a}),e[12]=a,e[13]=p):p=e[13];let u;e[14]!==f||e[15]!==p?(u=s.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[f,p]}),e[14]=f,e[15]=p,e[16]=u):u=e[16];let m;return e[17]!==d||e[18]!==c||e[19]!==u?(m=s.jsxs("div",{className:"flex items-center gap-2.5 py-2 px-3 hover:bg-accent cursor-pointer rounded-lg",onMouseEnter:d,children:[c,u]}),e[17]=d,e[18]=c,e[19]=u,e[20]=m):m=e[20],m}function $s(n){const e=G.c(16),{error:t,onRetry:i}=n,o=se();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"bg-destructive/10 p-2 rounded-full",children:s.jsx(xt,{className:"size-5 text-destructive"})}),e[0]=l):l=e[0];const a=o("chat.decopilot.failedToLoadModels");let r;e[1]!==a?(r=s.jsx("p",{className:"text-sm font-medium text-foreground",children:a}),e[1]=a,e[2]=r):r=e[2];const h=t?.message||o("chat.decopilot.couldNotFetchModels"),d=" "+o("chat.decopilot.tryAnotherProviderOrRetry");let c;e[3]!==h||e[4]!==d?(c=s.jsxs("p",{className:"text-xs text-muted-foreground max-w-[260px]",children:[h,d]}),e[3]=h,e[4]=d,e[5]=c):c=e[5];let f;e[6]!==r||e[7]!==c?(f=s.jsxs("div",{className:"flex flex-col gap-1",children:[r,c]}),e[6]=r,e[7]=c,e[8]=f):f=e[8];let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(Pt,{className:"size-3.5"}),e[9]=p):p=e[9];const u=o("chat.decopilot.retry");let m;e[10]!==i||e[11]!==u?(m=s.jsx("div",{className:"flex items-center gap-2",children:s.jsxs(le,{variant:"outline",size:"sm",onClick:i,className:"gap-1.5",children:[p,u]})}),e[10]=i,e[11]=u,e[12]=m):m=e[12];let j;return e[13]!==m||e[14]!==f?(j=s.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-4 py-8 text-center",children:[l,f,m]}),e[13]=m,e[14]=f,e[15]=j):j=e[15],j}function Us(){const n=G.c(1);let e;return n[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(Bs)}),n[0]=e):e=n[0],e}function Bs(n,e){return s.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 rounded-lg",children:[s.jsx(ee,{className:"size-5 shrink-0 rounded-sm"}),s.jsx(ee,{className:"flex-1 h-4"}),s.jsx(ee,{className:"w-16 h-5 shrink-0 rounded-md"})]},e)}function Ue(n){const e=G.c(12),{label:t,models:i,onSelect:o,onHover:l}=n;if(i.length===0)return null;let a;e[0]!==t?(a=s.jsx("div",{className:"text-xs font-medium text-muted-foreground px-3 pt-3 pb-1",children:t}),e[0]=t,e[1]=a):a=e[1];let r;if(e[2]!==i||e[3]!==l||e[4]!==o){let d;e[6]!==l||e[7]!==o?(d=c=>s.jsx("button",{type:"button",onClick:()=>o(c),onFocus:()=>l(c),className:"w-full text-left cursor-pointer",children:s.jsx(Ds,{model:c,onHover:l})},c.modelId),e[6]=l,e[7]=o,e[8]=d):d=e[8],r=i.map(d),e[2]=i,e[3]=l,e[4]=o,e[5]=r}else r=e[5];let h;return e[9]!==a||e[10]!==r?(h=s.jsxs("div",{children:[a,r]}),e[9]=a,e[10]=r,e[11]=h):h=e[11],h}function Se(n,e){return e(n==="other"?"chat.decopilot.tierOther":As[n])}function Ws(n){const e=G.c(21),{model:t,isChecked:i,onToggle:o,onHover:l}=n,[a,r]=$.useState(i);a!==i&&r(i);let h;e[0]!==t?(h=_e(t),e[0]=t,e[1]=h):h=e[1];const d=h;let c;e[2]!==t||e[3]!==l?(c=()=>l(t),e[2]=t,e[3]=l,e[4]=c):c=e[4];let f;e[5]!==t.modelId||e[6]!==o?(f=()=>{r(Vs),o(t.modelId)},e[5]=t.modelId,e[6]=o,e[7]=f):f=e[7];let p;e[8]!==a||e[9]!==f?(p=s.jsx(kt,{checked:a,onCheckedChange:f}),e[8]=a,e[9]=f,e[10]=p):p=e[10];let u;e[11]!==d||e[12]!==t.title?(u=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]=u):u=e[13];let m;e[14]!==t.title?(m=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]=m):m=e[15];let j;return e[16]!==c||e[17]!==p||e[18]!==u||e[19]!==m?(j=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:c,children:[p,u,m]}),e[16]=c,e[17]=p,e[18]=u,e[19]=m,e[20]=j):j=e[20],j}function Vs(n){return!n}function Hs(n,e){const t=[];for(const i of at)if(n[i].length>0){t.push({type:"header",label:Se(i,e)});for(const o of n[i])t.push({type:"model",model:o})}if(n.other.length>0){t.push({type:"header",label:Se("other",e)});for(const i of n.other)t.push({type:"model",model:i})}return t}function qs({items:n,shortlistSet:e,onToggle:t,onHover:i}){const o=$.useRef(null),l=ls({count:n.length,getScrollElement:()=>o.current,estimateSize:a=>n[a]?.type==="header"?36:44,overscan:6});return s.jsx("div",{ref:o,className:"flex-1 overflow-y-auto",children:s.jsx("div",{className:"relative",style:{height:l.getTotalSize()},children:l.getVirtualItems().map(a=>{const r=n[a.index];return r?s.jsx("div",{"data-index":a.index,ref:l.measureElement,className:"absolute left-0 right-0 top-0 px-0.5",style:{transform:`translateY(${a.start}px)`},children:r.type==="header"?s.jsx("div",{className:"text-xs font-medium text-muted-foreground px-3 pt-3 pb-1",children:r.label}):s.jsx(Ws,{model:r.model,isChecked:e.has(r.model.modelId),onToggle:t,onHover:i})},a.key):null})})})}function Ys(n){const e=G.c(30),{keyId:t,searchTerm:i,onHover:o,onModelSelect:l,managing:a,onToggleManage:r,filterModels:h}=n,d=se(),{models:c}=Dt(t),f=h?c.filter(h):c.filter(Gs);let p;e[0]!==t?(p=()=>(t?Fs(t):null)??Rs,e[0]=t,e[1]=p):p=e[1];const[u,m]=$.useState(p),[,j]=$.useTransition();let N;e[2]!==t||e[3]!==j?(N=g=>{t&&j(()=>{m(y=>{const C=new Set(y);return C.has(g)?C.delete(g):C.add(g),Ks(t,C),C})})},e[2]=t,e[3]=j,e[4]=N):N=e[4];const S=N,b=i.toLowerCase().trim(),I=g=>b?g.filter(y=>y.title.toLowerCase().includes(b)||y.modelId.toLowerCase().includes(b)):g;if(a){const g=$e(I(f)),y=Hs(g,d);let C;e[5]!==u?(C=L=>u.has(L.modelId),e[5]=u,e[6]=C):C=e[6];const z=f.filter(C).length;let A;e[7]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(Je,{size:14}),e[7]=A):A=e[7];let P;e[8]!==d?(P=d("chat.decopilot.back"),e[8]=d,e[9]=P):P=e[9];let T;return e[10]!==r||e[11]!==P?(T=s.jsxs("button",{type:"button",onClick:r,className:"flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground cursor-pointer",children:[A,P]}),e[10]=r,e[11]=P,e[12]=T):T=e[12],s.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[s.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border",children:[T,s.jsx("span",{className:"text-xs text-muted-foreground",children:d("chat.decopilot.selectedCount",{count:z})})]}),s.jsx(qs,{items:y,shortlistSet:u,onToggle:S,onHover:o})]})}let E;e[13]!==u?(E=g=>u.has(g.modelId),e[13]=u,e[14]=E):E=e[14];const O=f.filter(E),k=O.length>0?O:f,x=$e(I(k));let w;e[15]!==x||e[16]!==o||e[17]!==l||e[18]!==d?(w=at.map(g=>s.jsx(Ue,{label:Se(g,d),models:x[g],onSelect:l,onHover:o},g)),e[15]=x,e[16]=o,e[17]=l,e[18]=d,e[19]=w):w=e[19];let _;e[20]!==d?(_=Se("other",d),e[20]=d,e[21]=_):_=e[21];let M;e[22]!==x.other||e[23]!==o||e[24]!==l||e[25]!==_?(M=s.jsx(Ue,{label:_,models:x.other,onSelect:l,onHover:o}),e[22]=x.other,e[23]=o,e[24]=l,e[25]=_,e[26]=M):M=e[26];let v;return e[27]!==w||e[28]!==M?(v=s.jsxs("div",{className:"flex-1 overflow-y-auto px-0.5 pt-1 [touch-action:pan-y]",children:[w,M]}),e[27]=w,e[28]=M,e[29]=v):v=e[29],v}function Gs(n){return n.asyncResearch!==!0}function Xs(){const n=G.c(6);let e;n[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(ee,{className:"size-4 shrink-0"}),s.jsx(ee,{className:"flex-1 h-6"}),s.jsx(ee,{className:"w-[140px] h-8 shrink-0"})]})}),n[0]=e):e=n[0];let t;n[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(Qs)})]}),n[1]=t):t=n[1];let i;n[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[s.jsx(ee,{className:"size-6 shrink-0"}),s.jsx(ee,{className:"h-6 w-32"})]}),n[2]=i):i=n[2];let o;n[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs("div",{className:"flex flex-col gap-3 py-2 px-0",children:[i,s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ee,{className:"h-6 w-20 rounded-md"}),s.jsx(ee,{className:"h-6 w-24 rounded-md"})]})]}),n[3]=o):o=n[3];let l;n[4]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(ee,{className:"h-4 w-24"}),s.jsx(ee,{className:"h-4 w-32"})]}),n[4]=l):l=n[4];let a;return n[5]===Symbol.for("react.memo_cache_sentinel")?(a=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:[o,s.jsxs("div",{className:"flex flex-col gap-4",children:[l,s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(ee,{className:"h-4 w-16"}),s.jsx(ee,{className:"h-4 w-40"})]})]})]})})]}),n[5]=a):a=n[5],a}function Qs(n,e){return s.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 rounded-lg",children:[s.jsx(ee,{className:"size-5 shrink-0 rounded-sm"}),s.jsx(ee,{className:"flex-1 h-4"}),s.jsx(ee,{className:"w-16 h-5 shrink-0 rounded-md"})]},e)}function dt(n){const e=G.c(66),{onClose:t,credentialId:i,onCredentialChange:o,selectedModel:l,onModelChange:a,filterModels:r,compact:h}=n,d=se(),[c,f]=$.useState(null),[p,u]=$.useState(""),[m,j]=$.useState(!1),N=$.useRef(null),S=ke(),b=Kt();let I;e[0]!==S?.providers?(I=Object.fromEntries((S?.providers??[]).map(ei)),e[0]=S?.providers,e[1]=I):I=e[1];const E=I,O=ft(),{org:k}=xe();let x;e[2]!==o?(x=R=>{o(R),f(null)},e[2]=o,e[3]=x):x=e[3];const w=x;let _;e[4]!==i||e[5]!==t||e[6]!==a?(_=R=>{i&&(a(R),u(""),t())},e[4]=i,e[5]=t,e[6]=a,e[7]=_):_=e[7];const M=_;if(b.length===0){const R=!h&&"sm:w-[740px]";let D;e[8]!==R?(D=oe("flex items-center justify-center p-8 w-full",R),e[8]=R,e[9]=D):D=e[9];let q;e[10]===Symbol.for("react.memo_cache_sentinel")?(q=s.jsx(js,{}),e[10]=q):q=e[10];let Y;return e[11]!==D?(Y=s.jsx("div",{className:D,children:q}),e[11]=D,e[12]=Y):Y=e[12],Y}const v=h?"sm:h-[420px]":"sm:h-[460px]";let g;e[13]!==v?(g=oe("flex flex-col md:flex-row h-full min-h-0",v),e[13]=v,e[14]=g):g=e[14];const y=h?"w-full":"md:border-r md:w-[420px] md:min-w-[420px]";let C;e[15]!==y?(C=oe("flex-1 flex flex-col min-h-0 overflow-hidden",y),e[15]=y,e[16]=C):C=e[16];let z;e[17]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx(Ze,{size:16,className:"text-muted-foreground shrink-0"}),e[17]=z):z=e[17];let A;e[18]!==m||e[19]!==d?(A=d(m?"chat.decopilot.searchAllModels":"chat.decopilot.searchForModel"),e[18]=m,e[19]=d,e[20]=A):A=e[20];let P;e[21]===Symbol.for("react.memo_cache_sentinel")?(P=R=>u(R.target.value),e[21]=P):P=e[21];let T;e[22]!==p||e[23]!==A?(T=s.jsx(pe,{ref:N,type:"text",placeholder:A,value:p,onChange:P,className:"flex-1 min-w-0 border-0 !shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"}),e[22]=p,e[23]=A,e[24]=T):T=e[24];let L;e[25]!==i||e[26]!==w||e[27]!==b||e[28]!==E||e[29]!==d?(L=b.length>0&&s.jsxs(_t,{value:i??"",onValueChange:w,children:[s.jsxs(Ct,{size:"sm",className:"w-auto max-w-[140px] h-8 shrink-0 gap-1.5 px-2 [&>svg:last-child]:hidden",onClick:Zs,children:[s.jsx(It,{placeholder:d("chat.decopilot.key"),children:(()=>{const R=b.find(re=>re.id===i),D=R?E[R.providerId]:void 0,q=be(R?.presetId),Y=q?.logo??D?.logo,te=q?.name??D?.name??R?.providerId??"Key";return s.jsxs("span",{className:"flex items-center gap-1.5 min-w-0",children:[Y?s.jsx("img",{src:Y,alt:te,className:"w-4 h-4 rounded shrink-0 dark:bg-white dark:rounded-sm dark:p-px"}):s.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary shrink-0",children:te.slice(0,1).toUpperCase()}),s.jsx("span",{className:"text-xs truncate",children:te})]})})()}),s.jsx(Rt,{className:"size-4 opacity-50 shrink-0 pointer-events-none"})]}),s.jsx(Mt,{children:b.map(R=>{const D=E[R.providerId],q=be(R.presetId),Y=q?.logo??D?.logo,te=q?.name??D?.name??R.providerId;return s.jsx(Et,{value:R.id,children:s.jsxs("div",{className:"flex items-center gap-2",children:[Y?s.jsx("img",{src:Y,alt:te,className:"w-4 h-4 rounded dark:bg-white dark:rounded-sm dark:p-px"}):s.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:te.slice(0,1).toUpperCase()}),s.jsxs("span",{children:[te," — ",R.label]})]})},R.id)})})]}),e[25]=i,e[26]=w,e[27]=b,e[28]=E,e[29]=d,e[30]=L):L=e[30];let F;e[31]!==T||e[32]!==L?(F=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:[z,T,L]})}),e[31]=T,e[32]=L,e[33]=F):F=e[33];let K;e[34]!==i?(K=R=>{const{error:D,resetError:q}=R;return s.jsx($s,{error:D,onRetry:q,credentialId:i??void 0})},e[34]=i,e[35]=K):K=e[35];let X;e[36]===Symbol.for("react.memo_cache_sentinel")?(X=s.jsx(Us,{}),e[36]=X):X=e[36];const V=i??void 0;let Q;e[37]===Symbol.for("react.memo_cache_sentinel")?(Q=()=>j(Js),e[37]=Q):Q=e[37];let J;e[38]!==r||e[39]!==M||e[40]!==m||e[41]!==p||e[42]!==V?(J=s.jsx($.Suspense,{fallback:X,children:s.jsx(Ys,{keyId:V,searchTerm:p,onHover:f,onModelSelect:M,managing:m,onToggleManage:Q,filterModels:r})}),e[38]=r,e[39]=M,e[40]=m,e[41]=p,e[42]=V,e[43]=J):J=e[43];let H;e[44]!==i||e[45]!==K||e[46]!==J?(H=s.jsx(pt,{fallback:K,children:J},i),e[44]=i,e[45]=K,e[46]=J,e[47]=H):H=e[47];let U;e[48]!==m||e[49]!==O||e[50]!==k||e[51]!==d?(U=!m&&s.jsxs("div",{className:"border-t border-border flex",children:[s.jsxs("button",{type:"button",onClick:()=>$.startTransition(()=>j(!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(At,{className:"size-3.5 shrink-0"}),d("chat.decopilot.manageModels")]}),s.jsx("div",{className:"w-px bg-border shrink-0"}),s.jsxs("button",{type:"button",onClick:()=>O({to:"/$org/settings/ai-providers",params:{org:k.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(Ft,{className:"size-3.5 shrink-0"}),d("chat.decopilot.manageApiKeys")]})]}),e[48]=m,e[49]=O,e[50]=k,e[51]=d,e[52]=U):U=e[52];let B;e[53]!==F||e[54]!==H||e[55]!==U||e[56]!==C?(B=s.jsxs("div",{className:C,children:[F,H,U]}),e[53]=F,e[54]=H,e[55]=U,e[56]=C,e[57]=B):B=e[57];let W;e[58]!==h||e[59]!==c||e[60]!==l?(W=!h&&s.jsx("div",{className:"hidden md:flex md:flex-col md:w-[320px] md:shrink-0 p-3",children:s.jsx(Ms,{model:c??l??null})}),e[58]=h,e[59]=c,e[60]=l,e[61]=W):W=e[61];let Z;return e[62]!==B||e[63]!==W||e[64]!==g?(Z=s.jsxs("div",{className:g,children:[B,W]}),e[62]=B,e[63]=W,e[64]=g,e[65]=Z):Z=e[65],Z}function Js(n){return!n}function Zs(n){return n.stopPropagation()}function ei(n){return[n.id,n]}function ti(n){const e=G.c(12),{onClose:t}=n,{credentialId:i,setCredentialId:o,selectedModel:l,setModel:a}=Xe();let r;e[0]!==o?(r=c=>{ie("chat_credential_changed",{credential_id:c}),o(c)},e[0]=o,e[1]=r):r=e[1];let h;e[2]!==i||e[3]!==l?.modelId||e[4]!==a?(h=c=>{i&&(ie("chat_model_changed",{from_model_id:l?.modelId??null,to_model_id:c.modelId,to_model_provider:c.providerId??null,credential_id:i}),a({...c,keyId:i}))},e[2]=i,e[3]=l?.modelId,e[4]=a,e[5]=h):h=e[5];let d;return e[6]!==i||e[7]!==t||e[8]!==l||e[9]!==r||e[10]!==h?(d=s.jsx(dt,{onClose:t,credentialId:i,onCredentialChange:r,selectedModel:l,onModelChange:h}),e[6]=i,e[7]=t,e[8]=l,e[9]=r,e[10]=h,e[11]=d):d=e[11],d}function si(n){const e=G.c(2),{onClose:t}=n;let i;return e[0]!==t?(i=s.jsx(ti,{onClose:t}),e[0]=t,e[1]=i):i=e[1],i}function ii(n){const e=G.c(2);let t;return e[0]!==n?(t=s.jsx(dt,{...n}),e[0]=n,e[1]=t):t=e[1],t}function ni(n){const e=G.c(2),{onClose:t}=n;let i;return e[0]!==t?(i=s.jsx(si,{onClose:t}),e[0]=t,e[1]=i):i=e[1],i}function li(n){const e=G.c(4);let t;e[0]!==n?({...t}=n,e[0]=n,e[1]=t):t=e[1];let i;return e[2]!==t?(i=s.jsx(ii,{...t}),e[2]=t,e[3]=i):i=e[3],i}function Fi(n){const e=G.c(48),{variant:t,className:i,placeholder:o,model:l,isLoading:a,credentialId:r,onCredentialChange:h,onModelChange:d,filterModels:c}=n,f=t===void 0?"borderless":t,p=o===void 0?"Select model":o,u=se(),[m,j]=$.useState(!1),N=d!==void 0,S=wt(),b=f==="borderless"?"ghost":"outline",I=f==="borderless"&&"md:border-none";let E;e[0]!==i||e[1]!==I?(E=oe("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",I,i),e[0]=i,e[1]=I,e[2]=E):E=e[2];let O;e[3]!==a||e[4]!==l||e[5]!==p||e[6]!==N?(O=N?s.jsx(lt,{model:l??null,placeholder:p,isLoading:a}):s.jsx(ri,{placeholder:p}),e[3]=a,e[4]=l,e[5]=p,e[6]=N,e[7]=O):O=e[7];let k;e[8]!==b||e[9]!==E||e[10]!==O?(k=s.jsx(le,{variant:b,size:"sm",className:E,children:O}),e[8]=b,e[9]=E,e[10]=O,e[11]=k):k=e[11];const x=k;let w;e[12]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(Xs,{}),e[12]=w):w=e[12];let _;e[13]!==r||e[14]!==c||e[15]!==l||e[16]!==h||e[17]!==d||e[18]!==N?(_=s.jsx($.Suspense,{fallback:w,children:N?s.jsx(li,{onClose:()=>j(!1),credentialId:r??null,onCredentialChange:h??oi,selectedModel:l??null,onModelChange:d,filterModels:c}):s.jsx(ni,{onClose:()=>j(!1)})}),e[13]=r,e[14]=c,e[15]=l,e[16]=h,e[17]=d,e[18]=N,e[19]=_):_=e[19];const M=_;if(S){let A;e[20]!==x?(A=s.jsx(yt,{asChild:!0,children:x}),e[20]=x,e[21]=A):A=e[21];let P;e[22]!==u?(P=u("chat.selectModel.selectModel"),e[22]=u,e[23]=P):P=e[23];let T;e[24]!==P?(T=s.jsx(jt,{className:"sr-only",children:P}),e[24]=P,e[25]=T):T=e[25];let L;e[26]!==M?(L=s.jsx("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden",children:M}),e[26]=M,e[27]=L):L=e[27];let F;e[28]!==T||e[29]!==L?(F=s.jsxs(St,{className:"p-0 flex flex-col max-h-[95vh]",children:[T,L]}),e[28]=T,e[29]=L,e[30]=F):F=e[30];let K;return e[31]!==m||e[32]!==A||e[33]!==F?(K=s.jsxs(Nt,{open:m,onOpenChange:j,children:[A,F]}),e[31]=m,e[32]=A,e[33]=F,e[34]=K):K=e[34],K}let v;e[35]!==x?(v=s.jsx(bt,{asChild:!0,children:x}),e[35]=x,e[36]=v):v=e[36];let g;e[37]!==u?(g=u("chat.selectModel.selectModel"),e[37]=u,e[38]=g):g=e[38];let y;e[39]!==g?(y=s.jsx(Ge,{className:"sr-only",children:g}),e[39]=g,e[40]=y):y=e[40];let C;e[41]!==M||e[42]!==y?(C=s.jsxs(Ye,{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:[y,M]}),e[41]=M,e[42]=y,e[43]=C):C=e[43];let z;return e[44]!==m||e[45]!==v||e[46]!==C?(z=s.jsxs(qe,{open:m,onOpenChange:j,children:[v,C]}),e[44]=m,e[45]=v,e[46]=C,e[47]=z):z=e[47],z}function oi(){}function ri(n){const e=G.c(4),{placeholder:t}=n,{selectedModel:i,isModelsLoading:o}=Xe();let l;return e[0]!==o||e[1]!==i||e[2]!==t?(l=s.jsx(lt,{model:i,placeholder:t,isLoading:o}),e[0]=o,e[1]=i,e[2]=t,e[3]=l):l=e[3],l}export{gs as C,li as M,js as N,nt as P,Xs as a,zi as b,Fi as c,be as d,Ri as g,Li as i,Ie as m};
|