@p4code/cli 0.8.2 → 0.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.mjs +1 -1
- package/dist/{binCli-C1tFongj.mjs → binCli-DouSNynJ.mjs} +17297 -3439
- package/dist/client/.vite/manifest.json +2164 -2147
- package/dist/client/assets/{AnimatedHeight-PJxVEp27.js → AnimatedHeight-DoG4b7y8.js} +2 -2
- package/dist/client/assets/{AuthSurfaceShell-BrPHaco9.js → AuthSurfaceShell-DbeJoeXz.js} +2 -2
- package/dist/client/assets/{CSPContext-C7uwFl6f.js → CSPContext-DkFc4cYo.js} +2 -2
- package/dist/client/assets/ChatGptUsageButton-D93cMeTp.js +2 -0
- package/dist/client/assets/ChatMarkdown-CLD9Y6dg.js +65 -0
- package/dist/client/assets/CodexSetupSection.logic-DJw6xB7P.js +2 -0
- package/dist/client/assets/ComboboxClear-ZQvkAjz8.js +2 -0
- package/dist/client/assets/{CommandBlock-JrUX9e8E.js → CommandBlock-c98wFxMU.js} +2 -2
- package/dist/client/assets/{ComposerPromptEditor-Ba1dvqDN.js → ComposerPromptEditor-CBuOXkT9.js} +55 -55
- package/dist/client/assets/CompositeRoot-BMUI_bmJ.js +2 -0
- package/dist/client/assets/{ConnectionStatusDot-Cjh57o6i.js → ConnectionStatusDot-B69zfKRh.js} +2 -2
- package/dist/client/assets/DevicePanel-1xw7KQ15.js +2 -0
- package/dist/client/assets/{DeviceSetup-DccRVnjb.js → DeviceSetup-DemgUuG-.js} +2 -2
- package/dist/client/assets/DialogTitle-BXot7RA0.js +2 -0
- package/dist/client/assets/{DiffCommentAnnotation-DDBZcMFv.js → DiffCommentAnnotation-vAZP7JBy.js} +3 -3
- package/dist/client/assets/DiffFileTree-BhqF8nD5.js +2 -0
- package/dist/client/assets/DiffPanel-Dqh76p3E.js +2 -0
- package/dist/client/assets/{DiffWorkerPoolProvider-RcplgHGv.js → DiffWorkerPoolProvider-D4VIo5Vu.js} +3 -3
- package/dist/client/assets/{EnvironmentMachineIcon-DMZGa766.js → EnvironmentMachineIcon-DPQkDtvr.js} +2 -2
- package/dist/client/assets/{ExpandableText-DfY-qqRW.js → ExpandableText-EZ9C25tN.js} +3 -3
- package/dist/client/assets/{FieldControl-C9UnFGZn.js → FieldControl-C4IsJLMZ.js} +2 -2
- package/dist/client/assets/{FileDiff-BXlBWSxx.js → FileDiff-H9QHqXa0.js} +2 -2
- package/dist/client/assets/FilePreviewPanel-DGm_SU_e.js +34 -0
- package/dist/client/assets/FoldedSettingsSection-BSYFyChk.js +2 -0
- package/dist/client/assets/{FormContext-haYZgWIK.js → FormContext-DiXpMuU8.js} +2 -2
- package/dist/client/assets/{Icons-C12feMOO.js → Icons-DA4msgfR.js} +2 -2
- package/dist/client/assets/{KeybindingsSettings.logic-DhXMdk5O.js → KeybindingsSettings.logic-7EBA0xLE.js} +2 -2
- package/dist/client/assets/{NoProjectsHero-CDoSxJVV.js → NoProjectsHero-YjEc2OIw.js} +2 -2
- package/dist/client/assets/{PanelLayoutControls-CCKUTh1H.js → PanelLayoutControls-BfRIRM0o.js} +13 -13
- package/dist/client/assets/{PierreEntryIcon-7x50Pz_C.js → PierreEntryIcon-BxxykifK.js} +2 -2
- package/dist/client/assets/PreviewPanel-QkMfuC1J.js +2 -0
- package/dist/client/assets/ProjectDefaultsSettings-C6wxaRmJ.js +2 -0
- package/dist/client/assets/{ProjectFavicon-ExMHrN16.js → ProjectFavicon-CiauSitF.js} +3 -3
- package/dist/client/assets/ProjectIconPickerDialog-GDqk2LEH.js +2 -0
- package/dist/client/assets/{ProjectMonogram-um8sYqIi.js → ProjectMonogram-Bqe3OyZR.js} +2 -2
- package/dist/client/assets/{ProviderAuthTerminal-Tw3kH5vc.js → ProviderAuthTerminal-D_OC5vdS.js} +2 -2
- package/dist/client/assets/ProviderModelPicker-Bfpy_Rw1.js +2 -0
- package/dist/client/assets/ProviderSettingsForm-BA6yGdRn.js +2 -0
- package/dist/client/assets/PullRequestCodeTab-BOM7mgfd.js +6 -0
- package/dist/client/assets/{ReadOnlySourcePreview-Cw6lfMjA.js → ReadOnlySourcePreview-C3LnvSkA.js} +2 -2
- package/dist/client/assets/{RenderErrorBoundary-D21mPr47.js → RenderErrorBoundary-C-EIIrrq.js} +2 -2
- package/dist/client/assets/ScheduledTasksSettings-DFtwNfb8.js +4 -0
- package/dist/client/assets/ScopedSwitch-DsEcG6rk.js +2 -0
- package/dist/client/assets/SecretInput-Be5Akw8x.js +2 -0
- package/dist/client/assets/{SettingsPanels-DjzXV7Dm.js → SettingsPanels-CI-FknGh.js} +7 -7
- package/dist/client/assets/{SettingsPanels.logic-DpdMN_lX.js → SettingsPanels.logic-CLB8Pu-U.js} +2 -2
- package/dist/client/assets/{SettingsScopeNotice-CdNfxmW3.js → SettingsScopeNotice-CVoWG1oN.js} +2 -2
- package/dist/client/assets/T3ConnectAccountPages-ClNzwIQw.js +2 -0
- package/dist/client/assets/{T3ConnectSidebarSignIn-DewmE1PI.js → T3ConnectSidebarSignIn-BqM_Vqe1.js} +2 -2
- package/dist/client/assets/{ThemeEditorPanel-aEsLfkYx.js → ThemeEditorPanel-vVmQV_Vv.js} +3 -3
- package/dist/client/assets/ThreadTerminalDrawer-aLeVbe6g.js +5 -0
- package/dist/client/assets/{Virtualizer-B2BG0GB9.js → Virtualizer-DTOYU5Jp.js} +2 -2
- package/dist/client/assets/WorkspaceBreadcrumb-C9OPPGJE.js +2 -0
- package/dist/client/assets/WorkspacePageContainer-DtXJ5ept.js +2 -0
- package/dist/client/assets/{WorkspacePageHeader-BCZXPSxj.js → WorkspacePageHeader-5zzLFpEN.js} +2 -2
- package/dist/client/assets/_chat-BKcYL38S.js +45 -0
- package/dist/client/assets/{_chat.index-7o1_qjfU.js → _chat.index-BP1JWABB.js} +2 -2
- package/dist/client/assets/{_chat.new-W2E0MZ4y.js → _chat.new-BX5LyFum.js} +3 -3
- package/dist/client/assets/{_chat.pull-requests-DnQ-MKRG.js → _chat.pull-requests-B6-Vck8B.js} +2 -2
- package/dist/client/assets/{abnfDiagram-VCTEODGH-DJY5x2uS.js → abnfDiagram-VCTEODGH-BXvAfzAg.js} +2 -2
- package/dist/client/assets/{alert-yllEf0yh.js → alert-B-or1ble.js} +2 -2
- package/dist/client/assets/architecture-7GRP2DOG-DqzmsB35.js +1 -0
- package/dist/client/assets/{architectureDiagram-5GKGNRK7-6YiKazHv.js → architectureDiagram-5GKGNRK7-MEUA3QVe.js} +2 -2
- package/dist/client/assets/arrow-left-DI1Oo3nI.js +1 -0
- package/dist/client/assets/arrow-right-DRgAj8le.js +1 -0
- package/dist/client/assets/arrow-up-down-C6OEPUz7.js +1 -0
- package/dist/client/assets/assets-_CWIS9vb.js +2 -0
- package/dist/client/assets/bell-DW1iPWzH.js +1 -0
- package/dist/client/assets/{blockDiagram-I7D4REHJ-D_EURhbV.js → blockDiagram-I7D4REHJ-BOdLeYJh.js} +2 -2
- package/dist/client/assets/blocks-DKOyf4K4.js +1 -0
- package/dist/client/assets/bot-DYcBiSui.js +1 -0
- package/dist/client/assets/{browserHistoryStore-B-t3Vc_Z.js → browserHistoryStore-BJD0OPpb.js} +2 -2
- package/dist/client/assets/{browserLinkTarget-CiQS1wUg.js → browserLinkTarget-CoogLhhO.js} +2 -2
- package/dist/client/assets/{c4Diagram-7LVT6UL2-CmfPrrIj.js → c4Diagram-7LVT6UL2-COZrm1O8.js} +2 -2
- package/dist/client/assets/calendar-clock-BqL7OneL.js +1 -0
- package/dist/client/assets/channel-DbsUczqI.js +2 -0
- package/dist/client/assets/chart-no-axes-column-CtQ7A5KE.js +1 -0
- package/dist/client/assets/checkbox-CaZu1EKJ.js +2 -0
- package/dist/client/assets/{chunk-4HAMMTFA-BdvKUuii.js → chunk-4HAMMTFA-Bs-Fo0v1.js} +2 -2
- package/dist/client/assets/{chunk-75Z2AOVW-DXz8BlJz.js → chunk-75Z2AOVW-DpOWzc3R.js} +2 -2
- package/dist/client/assets/{chunk-DU6HZSFF-ebFBoLTT.js → chunk-DU6HZSFF-Bgpi4W6E.js} +2 -2
- package/dist/client/assets/{chunk-F27PBJKO-B1MlVcaX.js → chunk-F27PBJKO-CLxgnzXS.js} +2 -2
- package/dist/client/assets/{chunk-GMAD6QVW-CEXqem_-.js → chunk-GMAD6QVW-D98J5Pan.js} +2 -2
- package/dist/client/assets/{chunk-GVQU2GXP-wsgr7T0u.js → chunk-GVQU2GXP-VuCIOHGI.js} +2 -2
- package/dist/client/assets/{chunk-IMKFNOWR-Daxc_3WP.js → chunk-IMKFNOWR-DXIyBsaE.js} +2 -2
- package/dist/client/assets/{chunk-L3NEJ4N5-C4NnipZ0.js → chunk-L3NEJ4N5-CrMlU3ZU.js} +2 -2
- package/dist/client/assets/{chunk-OSK3NFVY-DDd2Ay5_.js → chunk-OSK3NFVY-V2__4gNB.js} +2 -2
- package/dist/client/assets/{chunk-P2QGCYS3-I9iEYMEJ.js → chunk-P2QGCYS3-BrPw6V5F.js} +2 -2
- package/dist/client/assets/{chunk-POPQ4Y6H-Cgwl0wkZ.js → chunk-POPQ4Y6H-DBQ9Y51x.js} +2 -2
- package/dist/client/assets/{chunk-PWAF6VOD-kBB0Jquc.js → chunk-PWAF6VOD-BN6AAbfF.js} +2 -2
- package/dist/client/assets/{chunk-SHT3W25Y-gtUoMWd0.js → chunk-SHT3W25Y-Vay44dCU.js} +2 -2
- package/dist/client/assets/{chunk-SVP7TREG-CbL5vJ0z.js → chunk-SVP7TREG-CcGlNErV.js} +2 -2
- package/dist/client/assets/{chunk-TICWLB2K-CMgrptzc.js → chunk-TICWLB2K-Dk1P_xkD.js} +2 -2
- package/dist/client/assets/classDiagram-ZZMXUADV-DotTjRcO.js +2 -0
- package/dist/client/assets/classDiagram-v2-VYDZK3BY-DotTjRcO.js +2 -0
- package/dist/client/assets/{color-picker-Cj2frYnP.js → color-picker-gBclRe5T.js} +2 -2
- package/dist/client/assets/{combobox-DixSlhgy.js → combobox-C81z_216.js} +2 -2
- package/dist/client/assets/{command-B45LRbFT.js → command-DnJZPOmf.js} +2 -2
- package/dist/client/assets/{connect-CYM5DIkv.js → connect-Am2IS-vZ.js} +2 -2
- package/dist/client/assets/{connect-agent-nn3QLMb4.js → connect-agent-Cw1s7hYt.js} +2 -2
- package/dist/client/assets/corner-left-up-BT-2gfvH.js +1 -0
- package/dist/client/assets/{cynefin-OW5HDTMX-CmLjrFzm.js → cynefin-OW5HDTMX-0s30RxOq.js} +1 -1
- package/dist/client/assets/{cynefinDiagram-5FMLGOSQ-xQBevUIj.js → cynefinDiagram-5FMLGOSQ-Drd0Msog.js} +2 -2
- package/dist/client/assets/{dagre-GXQ25YYZ-Ck8BwJaT.js → dagre-GXQ25YYZ-BMfu7T0o.js} +2 -2
- package/dist/client/assets/device-C_oIGJqy.js +2 -0
- package/dist/client/assets/{diagram-S7CK7UJ4-Bl0e661x.js → diagram-S7CK7UJ4-8egngY0E.js} +2 -2
- package/dist/client/assets/{diagram-UQ7AKVKN-TO9a3uQI.js → diagram-UQ7AKVKN-BALPQoDH.js} +2 -2
- package/dist/client/assets/{diagram-VSXAHHWV-BZ7xQ8wz.js → diagram-VSXAHHWV-BjyJZVGC.js} +2 -2
- package/dist/client/assets/{diagram-VX7I27RA-C4cA30qa.js → diagram-VX7I27RA-B9f6eKkq.js} +2 -2
- package/dist/client/assets/{diagram-Z3DM3KII-Hl3MmqeP.js → diagram-Z3DM3KII-CRUj2d3v.js} +2 -2
- package/dist/client/assets/{dialog-DhJeevKt.js → dialog-Bn1u_Xoc.js} +2 -2
- package/dist/client/assets/{diffRendering-QVeYVRDU.js → diffRendering-C26rfQBu.js} +2 -2
- package/dist/client/assets/{discovery-list-VoilmsP7.js → discovery-list-Fg_u6w-x.js} +2 -2
- package/dist/client/assets/{dist-CxgL3edJ.js → dist-DtKaGeij.js} +5 -5
- package/dist/client/assets/download-DNjijPHR.js +1 -0
- package/dist/client/assets/{draft-input-BrEXLyuj.js → draft-input-D8eUYug0.js} +2 -2
- package/dist/client/assets/{duoViewer-D-_bD3-L.js → duoViewer-CBoAg4hS.js} +2 -2
- package/dist/client/assets/dynamic-p5s8CQGu.js +3 -0
- package/dist/client/assets/earth-DGA4iwBJ.js +1 -0
- package/dist/client/assets/{ebnfDiagram-PWID7BFC-Bo_ALmgV.js → ebnfDiagram-PWID7BFC-BSbPiqg7.js} +2 -2
- package/dist/client/assets/ellipsis-Cbd-Ac19.js +1 -0
- package/dist/client/assets/{embeddedScripts-DKKE5k7D.js → embeddedScripts-Dsi0aZEx.js} +2 -2
- package/dist/client/assets/empty-C-gDaZ_z.js +2 -0
- package/dist/client/assets/entities-82m-Smm-.js +2 -0
- package/dist/client/assets/{erDiagram-RLTQ6QDP-B38FLl2U.js → erDiagram-RLTQ6QDP-sL_q0j_k.js} +2 -2
- package/dist/client/assets/eventmodeling-NTZA5JFV-OEIkdS25.js +1 -0
- package/dist/client/assets/eye-BUplLfz9.js +1 -0
- package/dist/client/assets/file-search-CcnLiCku.js +1 -0
- package/dist/client/assets/fileContextMenu-Dcs50sFI.js +2 -0
- package/dist/client/assets/{fileLinks-VfyxNu8P.js → fileLinks-DubkPNVt.js} +2 -2
- package/dist/client/assets/{fileTreeExpansion-BfMZMaRV.js → fileTreeExpansion-VtSAPhxL.js} +2 -2
- package/dist/client/assets/flowDiagram-HODETNUW-BDZPeVYD.js +1 -0
- package/dist/client/assets/fold-vertical-BMLbHh0a.js +2 -0
- package/dist/client/assets/folder-cog-BMK_9DOi.js +2 -0
- package/dist/client/assets/folder-git-2-5RczFn6m.js +1 -0
- package/dist/client/assets/folder-open-PwiT4lvQ.js +1 -0
- package/dist/client/assets/folder-plus--IokSBmG.js +1 -0
- package/dist/client/assets/{ganttDiagram-EL5Y4UJY-Cj0Kstgh.js → ganttDiagram-EL5Y4UJY-DCiKb0rQ.js} +2 -2
- package/dist/client/assets/{getDiffFileInput-XUe1xsym.js → getDiffFileInput-DU5zpXo3.js} +2 -2
- package/dist/client/assets/git-branch-jf-x2c63.js +1 -0
- package/dist/client/assets/{gitGraph-4MIJSDKK-C84uaaYZ.js → gitGraph-4MIJSDKK-DfRe6ZT5.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-WWUBYQGX-CvyimLfZ.js → gitGraphDiagram-WWUBYQGX-Bt7diV1n.js} +2 -2
- package/dist/client/assets/grip-vertical-OASdudbE.js +1 -0
- package/dist/client/assets/{guideRunStore-DwmmS8D0.js → guideRunStore-CF9bByzk.js} +2 -2
- package/dist/client/assets/hard-drive-BxN5msOb.js +1 -0
- package/dist/client/assets/history-DdVU5lcf.js +1 -0
- package/dist/client/assets/house-mbks5FAa.js +1 -0
- package/dist/client/assets/{htmlRender-DRfZ8nFp.js → htmlRender-vOqAdlJH.js} +2 -2
- package/dist/client/assets/index-1HGbj0-7.js +3 -0
- package/dist/client/assets/{info-A6RAGUB7-AXJa674d.js → info-A6RAGUB7-0FtL6-Am.js} +1 -1
- package/dist/client/assets/{infoDiagram-27XIBGKW-CgaIIar7.js → infoDiagram-27XIBGKW-BPLvtPCc.js} +2 -2
- package/dist/client/assets/{input-u5qjnfMr.js → input-Cd_0h7h_.js} +2 -2
- package/dist/client/assets/{input-group-DIOgVvbV.js → input-group-CJ7ZOvDN.js} +2 -2
- package/dist/client/assets/{ishikawaDiagram-5VMMS53U-DSDzMD_t.js → ishikawaDiagram-5VMMS53U-DVcx0XTh.js} +2 -2
- package/dist/client/assets/{journeyDiagram-3NMN7TZE-Be6o5a7O.js → journeyDiagram-3NMN7TZE-w46bbjL2.js} +2 -2
- package/dist/client/assets/{kanban-definition-UXKFOSKX-Fpr0ne16.js → kanban-definition-UXKFOSKX-C41yE_yV.js} +2 -2
- package/dist/client/assets/kbd-c17EHIx1.js +2 -0
- package/dist/client/assets/keybindings-uYm_vnXl.js +2 -0
- package/dist/client/assets/keyboard-DckDn_SM.js +1 -0
- package/dist/client/assets/{lazyRouteComponent-dLOOuQ-r.js → lazyRouteComponent-CTVuEvaz.js} +2 -2
- package/dist/client/assets/{line-BXhbrPh0.js → line-tu9XZ0qp.js} +2 -2
- package/dist/client/assets/{link-YLDgrmSN.js → link-C4sEUNOK.js} +2 -2
- package/dist/client/assets/link-Dw3ue0Rm.js +1 -0
- package/dist/client/assets/{linkedPrompt-E32o3H76.js → linkedPrompt-VYl90REW.js} +2 -2
- package/dist/client/assets/list-1rglB5Lq.js +1 -0
- package/dist/client/assets/main-BB3F4O6Y.js +30 -0
- package/dist/client/assets/main-CnVegMVf.css +2 -0
- package/dist/client/assets/{mediaReference-C-grVzJf.js → mediaReference-BTVvzs2e.js} +2 -2
- package/dist/client/assets/{mediaSource-CxVHZYDj.js → mediaSource-DXHFWHMA.js} +2 -2
- package/dist/client/assets/{mermaid-parser.core-BFPy42Wg.js → mermaid-parser.core-DNd412Oc.js} +4 -4
- package/dist/client/assets/{mermaid.core-zK2u82e-.js → mermaid.core-CyE6QOQY.js} +5 -5
- package/dist/client/assets/message-circle-question-mark-CLPs5tYP.js +1 -0
- package/dist/client/assets/message-square-BInn4EwR.js +1 -0
- package/dist/client/assets/message-square-dashed-Dea7_sXv.js +1 -0
- package/dist/client/assets/{mindmap-definition-YA3MSWOX-RzkTvFrT.js → mindmap-definition-YA3MSWOX-DH1uxdTm.js} +2 -2
- package/dist/client/assets/mouse-pointer-2-BPl1Yb5N.js +1 -0
- package/dist/client/assets/number-field-CVtwAsLe.js +2 -0
- package/dist/client/assets/{observeResize-WQaFQjbx.js → observeResize-Csvw3hy4.js} +2 -2
- package/dist/client/assets/{onboarding-DNafmm6s.js → onboarding-CJPrQc71.js} +2 -2
- package/dist/client/assets/openFileInPreview-C3O_ayUT.js +2 -0
- package/dist/client/assets/{p4ProjectFile-BzCYJ8I-.js → p4ProjectFile-BWszgcDk.js} +2 -2
- package/dist/client/assets/{packet-AYTQ26CC-rDYSbNWh.js → packet-AYTQ26CC-DflCOkCN.js} +1 -1
- package/dist/client/assets/{pair-nG9A6oxp.js → pair-Dd_e1jxq.js} +2 -2
- package/dist/client/assets/palette-DC6st-Ld.js +1 -0
- package/dist/client/assets/panel-left-BxNE-mqR.js +1 -0
- package/dist/client/assets/panels-top-left-CpwWAaSX.js +1 -0
- package/dist/client/assets/{pegDiagram-XKGWAZYB-8wodyYDi.js → pegDiagram-XKGWAZYB-Cnx9j2xX.js} +2 -2
- package/dist/client/assets/{phoneViewer-Bei8FsYJ.js → phoneViewer-B9EUVDD2.js} +2 -2
- package/dist/client/assets/{pie-WAS4IAKB-Ce0_zpeP.js → pie-WAS4IAKB-CDwew7fN.js} +1 -1
- package/dist/client/assets/{pieDiagram-E7YTZNPT-C3QJYWCY.js → pieDiagram-E7YTZNPT-BxejSN6k.js} +2 -2
- package/dist/client/assets/{pierre-icons-CsjmRq9p.js → pierre-icons-C839Otpo.js} +2 -2
- package/dist/client/assets/plug-Cdxb0djR.js +2 -0
- package/dist/client/assets/popover-CKyetthu.js +2 -0
- package/dist/client/assets/{preview-DFDpDpup.js → preview-CEMnbqVB.js} +2 -2
- package/dist/client/assets/{preview-BpTu6A2K.js → preview-CjgXQQdj.js} +2 -2
- package/dist/client/assets/{previewMiniPlayerStore-BfMwexwO.js → previewMiniPlayerStore-B9Lqaaij.js} +2 -2
- package/dist/client/assets/primary-uszZTzpR.js +2 -0
- package/dist/client/assets/primaryCloudLinkState-CWT2YTBZ.js +2 -0
- package/dist/client/assets/projectFilesQueryState-ELgLflk5.js +2 -0
- package/dist/client/assets/projectScriptEditor-BAuP_HeU.js +2 -0
- package/dist/client/assets/{pullRequestDetail.logic-CE7fVOsp.js → pullRequestDetail.logic-DTxWqKoX.js} +4 -4
- package/dist/client/assets/{pullRequestReviewStore-BHEIYvsP.js → pullRequestReviewStore-C5gaoGaz.js} +2 -2
- package/dist/client/assets/pullRequests-DjbQ49mZ.js +2 -0
- package/dist/client/assets/puzzle-foT3lPUZ.js +1 -0
- package/dist/client/assets/{quadrantDiagram-AXDQQJYC-Cqx4Dcqi.js → quadrantDiagram-AXDQQJYC-Bj4FEpOg.js} +2 -2
- package/dist/client/assets/queries-Cq5C9N-K.js +2 -0
- package/dist/client/assets/query-DpwJQzeq.js +2 -0
- package/dist/client/assets/{radar-RG4KPBEZ-DsccxBWq.js → radar-RG4KPBEZ-DEopr2Gv.js} +1 -1
- package/dist/client/assets/radio-group-fljQQ7Xp.js +2 -0
- package/dist/client/assets/{railroad-74A4TZTK-B-UN2mSQ.js → railroad-74A4TZTK-BSAOgUn6.js} +1 -1
- package/dist/client/assets/railroad-abnf-HS5TGJTU-C_4g8TOP.js +1 -0
- package/dist/client/assets/railroad-ebnf-LZEXJU2U-CHZB5YoP.js +1 -0
- package/dist/client/assets/railroad-peg-WCYAUIDC-B-PbMjlp.js +1 -0
- package/dist/client/assets/{railroadDiagram-O6MQD6OU-B_PdDy5r.js → railroadDiagram-O6MQD6OU-BSOJGJ6v.js} +2 -2
- package/dist/client/assets/{renderScheduler-D1ml_j--.js → renderScheduler-v8LIpnE2.js} +2 -2
- package/dist/client/assets/{requirementDiagram-BXWQKSXE-CKZ6HpQu.js → requirementDiagram-BXWQKSXE-Bp5TqEho.js} +2 -2
- package/dist/client/assets/rightPanelStore-DqMd0tFH.js +2 -0
- package/dist/client/assets/rotate-ccw-rssHZoOL.js +1 -0
- package/dist/client/assets/rotate-cw-D726GGah.js +1 -0
- package/dist/client/assets/runtime-BQJQC-Ny.js +6 -0
- package/dist/client/assets/runtime-C6FwphD-.js +2 -0
- package/dist/client/assets/{sankeyDiagram-P5KCCOFB-BLF-VPcj.js → sankeyDiagram-P5KCCOFB-C7KUHrP7.js} +2 -2
- package/dist/client/assets/scheduledTasksSettings.logic-C3Mbc4mh.js +3 -0
- package/dist/client/assets/{scroll-area-CsrtHuL8.js → scroll-area-LhpLVf8r.js} +2 -2
- package/dist/client/assets/select-B4VvMEs2.js +2 -0
- package/dist/client/assets/{sequenceDiagram-WJ2MYXX4-BpJGkNAx.js → sequenceDiagram-WJ2MYXX4-Bs9mfTLC.js} +2 -2
- package/dist/client/assets/server-BD_Y5Gsn.js +2 -0
- package/dist/client/assets/session-DsbInyNV.js +2 -0
- package/dist/client/assets/session-logic-DneZDyPZ.js +26 -0
- package/dist/client/assets/settings-2-Qrnq-5XQ.js +1 -0
- package/dist/client/assets/settings-C8FiUQu0.js +2 -0
- package/dist/client/assets/settings-MUAsYy_j.js +1 -0
- package/dist/client/assets/settings.appearance-B5-X4oyX.js +2 -0
- package/dist/client/assets/settings.archived-DVUmF0nS.js +2 -0
- package/dist/client/assets/{settings.computer-use-DuW-mXPO.js → settings.computer-use-B3Ujc2AS.js} +2 -2
- package/dist/client/assets/settings.connections-EQYBOa7e.js +2 -0
- package/dist/client/assets/settings.decisions-C5UE4drK.js +2 -0
- package/dist/client/assets/{settings.diagnostics-DSw1QN-I.js → settings.diagnostics-CBcOEqPM.js} +2 -2
- package/dist/client/assets/settings.general-BOmr4mSV.js +2 -0
- package/dist/client/assets/settings.integrations-BCtpk2dY.js +2 -0
- package/dist/client/assets/{settings.keybindings-BeQmUtKv.js → settings.keybindings-DfFrYXxY.js} +2 -2
- package/dist/client/assets/settings.open-source-licenses-CqRM1gRd.js +2 -0
- package/dist/client/assets/settings.plugins-DC4js6dE.js +5 -0
- package/dist/client/assets/{settings.projects--jLA2A5b.js → settings.projects-CT-l0EfX.js} +4 -4
- package/dist/client/assets/settings.providers-CJuBTAiR.js +3 -0
- package/dist/client/assets/settings.scheduled-tasks-CvLNaadX.js +2 -0
- package/dist/client/assets/{settings.snap-shot-CUZNOX9M.js → settings.snap-shot-BMxV-ClC.js} +2 -2
- package/dist/client/assets/settings.source-control-DJWucVsM.js +2 -0
- package/dist/client/assets/settings.storage-DKm6BZ2r.js +2 -0
- package/dist/client/assets/settingsLayout-jP1a50ek.js +3 -0
- package/dist/client/assets/shield-question-mark-kKJBH4Uj.js +1 -0
- package/dist/client/assets/{sidebar-Dj0htG-5.js → sidebar-DI1ZJMkM.js} +2 -2
- package/dist/client/assets/{sidebarProjectGrouping-DxzT7QCQ.js → sidebarProjectGrouping-DXRKqrOP.js} +2 -2
- package/dist/client/assets/skeleton-BlMPaSbD.js +2 -0
- package/dist/client/assets/{sortable.esm-n8ce5zjO.js → sortable.esm-CnSn9HhJ.js} +2 -2
- package/dist/client/assets/{sourceControl-C3RSledt.js → sourceControl-ogZI3Qhj.js} +2 -2
- package/dist/client/assets/{spinner-BXr4m38K.js → spinner-I_NrXl2i.js} +2 -2
- package/dist/client/assets/square-menu-dCwciC39.js +2 -0
- package/dist/client/assets/square-pen-DilH8raK.js +1 -0
- package/dist/client/assets/square-plus-CeFmBUPF.js +2 -0
- package/dist/client/assets/{standalone-page-DSQDdNcR.js → standalone-page-C0mvdk0N.js} +2 -2
- package/dist/client/assets/{stateDiagram-D77RDMKH-DFGb4Fx3.js → stateDiagram-D77RDMKH-lcvbm4gc.js} +2 -2
- package/dist/client/assets/stateDiagram-v2-MP3YSRHH-DuLLhUia.js +2 -0
- package/dist/client/assets/{swimlanes-42K2YHIH-D0z9osG6.js → swimlanes-42K2YHIH-BftXRbCQ.js} +2 -2
- package/dist/client/assets/swimlanesDiagram-VR7AAH4N-BrHQKVnf.js +9 -0
- package/dist/client/assets/terminal-links-BWEpET__.js +2 -0
- package/dist/client/assets/terminalLabels-BgLOlb2G.js +2 -0
- package/dist/client/assets/{terminalSessions-3aynRXX1.js → terminalSessions-CQOPPXfy.js} +2 -2
- package/dist/client/assets/text-search-DpDcKspl.js +1 -0
- package/dist/client/assets/{textarea-DZLyhzuZ.js → textarea-Bu723jDd.js} +2 -2
- package/dist/client/assets/themePalette-CAxv2FDZ.js +5 -0
- package/dist/client/assets/threadSort-BoaTqeGH.js +2 -0
- package/dist/client/assets/{timeline-definition-24CTP7MA-oHM5IS4i.js → timeline-definition-24CTP7MA-_aV_EuqE.js} +2 -2
- package/dist/client/assets/toast-CjelgyqV.js +2 -0
- package/dist/client/assets/{toggle-BzIEPTf7.js → toggle-B5fidRv0.js} +2 -2
- package/dist/client/assets/{toggle-group-_C7nJPTT.js → toggle-group-DCQTLIPb.js} +2 -2
- package/dist/client/assets/tooltip-taOyJZax.js +2 -0
- package/dist/client/assets/{treeView-Q6P3EWNA-ONHv8oqx.js → treeView-Q6P3EWNA-ALGd5g_W.js} +1 -1
- package/dist/client/assets/{treemap-WGGIJYW6-Go2hwkyn.js → treemap-WGGIJYW6-CGQrkzMs.js} +1 -1
- package/dist/client/assets/unfold-vertical-BLnEY4R7.js +2 -0
- package/dist/client/assets/usage-DmGxFUdr.js +2 -0
- package/dist/client/assets/{usageAccess-BNLOTFbF.js → usageAccess-CY-JtQnU.js} +2 -2
- package/dist/client/assets/{usageFormat-DKCO_wk0.js → usageFormat-Cs-UHzLq.js} +2 -2
- package/dist/client/assets/{usageShortcuts-DxLRXv0W.js → usageShortcuts-CP952NDO.js} +2 -2
- package/dist/client/assets/use-atom-command-CQHjSXPR.js +2 -0
- package/dist/client/assets/{useAriaLabelledBy-CJjXf8Fd.js → useAriaLabelledBy-4I5xhNlP.js} +2 -2
- package/dist/client/assets/useHandleNewThread-Bzaf_PDE.js +2 -0
- package/dist/client/assets/{useLocation-9axGTsrg.js → useLocation-QINZoaPz.js} +2 -2
- package/dist/client/assets/useNavigate-4thj06GJ.js +2 -0
- package/dist/client/assets/{useNavigateBack-AIHPN0Oo.js → useNavigateBack-CbbWf0z6.js} +2 -2
- package/dist/client/assets/{useParams-CCV3vN4E.js → useParams-BTKEXLBT.js} +2 -2
- package/dist/client/assets/{usePermissionStatus-BnBF7CdE.js → usePermissionStatus-Zbsv_90x.js} +2 -2
- package/dist/client/assets/{usePullRequestActions-aKrHzIiJ.js → usePullRequestActions-DGTJ6ne6.js} +3 -3
- package/dist/client/assets/useRegisterFieldControl-Cr87Snzk.js +2 -0
- package/dist/client/assets/useScopedModelAvailability-BEfh0WXx.js +2 -0
- package/dist/client/assets/useSettings-CLtJrOYI.js +3 -0
- package/dist/client/assets/{useT3ConnectAuthPrompt-CK8il-7e.js → useT3ConnectAuthPrompt-BYqrzQIx.js} +2 -2
- package/dist/client/assets/utils-DmfMX1v5.js +37 -0
- package/dist/client/assets/vcsRefInvalidation-nP-qgsHs.js +2 -0
- package/dist/client/assets/{vennDiagram-4TSXK5OY-BwVRZPOj.js → vennDiagram-4TSXK5OY-9Jx7JrgE.js} +2 -2
- package/dist/client/assets/{wardley-WFR3VGLG-CYl4h3U-.js → wardley-WFR3VGLG-qG58RzFw.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-VM6X3IG4-yHMYVGhg.js → wardleyDiagram-VM6X3IG4-8Ml3tzfR.js} +2 -2
- package/dist/client/assets/welcome-CPcQsM9H.js +2 -0
- package/dist/client/assets/{xychartDiagram-S5SC5T6Z-Td7MQ_xN.js → xychartDiagram-S5SC5T6Z-C-u_0wo0.js} +2 -2
- package/dist/client/index.html +11 -8
- package/package.json +1 -1
- package/dist/client/assets/ChatGptUsageButton-7IZqWaQq.js +0 -2
- package/dist/client/assets/ChatMarkdown-D3ITm4U-.js +0 -65
- package/dist/client/assets/CodexSetupSection.logic-DyTuN6tg.js +0 -2
- package/dist/client/assets/ComboboxClear-BXGqqvsR.js +0 -2
- package/dist/client/assets/CompositeRoot-CW06ANMY.js +0 -2
- package/dist/client/assets/DevicePanel-zG3feCFw.js +0 -2
- package/dist/client/assets/DialogTitle-7tvQYVxE.js +0 -2
- package/dist/client/assets/DiffFileTree-BhSPT6m_.js +0 -2
- package/dist/client/assets/DiffPanel-D7QMWq_A.js +0 -2
- package/dist/client/assets/FilePreviewPanel-CSKeM-xZ.js +0 -34
- package/dist/client/assets/FoldedSettingsSection-BJm8ZaTy.js +0 -2
- package/dist/client/assets/PreviewPanel-BEWZuH6o.js +0 -2
- package/dist/client/assets/ProjectDefaultsSettings-BRRQlvgR.js +0 -2
- package/dist/client/assets/ProjectIconPickerDialog-DXSyEGg8.js +0 -2
- package/dist/client/assets/ProviderModelPicker-CpgHpUCG.js +0 -2
- package/dist/client/assets/ProviderSettingsForm-CaNO8FYK.js +0 -2
- package/dist/client/assets/PullRequestCodeTab-DwqL4aAJ.js +0 -6
- package/dist/client/assets/RedactedSensitiveText-citJBx4E.js +0 -2
- package/dist/client/assets/ScheduledTasksSettings-BXOG7dPV.js +0 -4
- package/dist/client/assets/ScopedSwitch-2MBm4Srn.js +0 -2
- package/dist/client/assets/T3ConnectAccountPages-C6qHq26m.js +0 -2
- package/dist/client/assets/ThreadTerminalDrawer-C1NDkTSs.js +0 -5
- package/dist/client/assets/UsageLimits-BUS51Bjr.js +0 -2
- package/dist/client/assets/WorkspaceBreadcrumb-DX3xH6tC.js +0 -2
- package/dist/client/assets/WorkspacePageContainer-BFo6qTGJ.js +0 -2
- package/dist/client/assets/_chat-B3j3XTUJ.js +0 -58
- package/dist/client/assets/architecture-7GRP2DOG-nO5xG-8k.js +0 -1
- package/dist/client/assets/arrow-left-yEW5WFYj.js +0 -1
- package/dist/client/assets/arrow-right-BzVZfSb7.js +0 -1
- package/dist/client/assets/arrow-up-down-DjL7trCL.js +0 -1
- package/dist/client/assets/assets-BxSVuao2.js +0 -2
- package/dist/client/assets/bell-ue7A6JFg.js +0 -1
- package/dist/client/assets/blocks-De0WwZYY.js +0 -1
- package/dist/client/assets/bot-_T9E-nkd.js +0 -1
- package/dist/client/assets/calendar-clock-DXFNSdXM.js +0 -1
- package/dist/client/assets/channel-BE0ymtNV.js +0 -2
- package/dist/client/assets/chart-no-axes-column-Dx_cyfN9.js +0 -1
- package/dist/client/assets/checkbox-CIeee0-J.js +0 -2
- package/dist/client/assets/classDiagram-ZZMXUADV-YRduSbl9.js +0 -2
- package/dist/client/assets/classDiagram-v2-VYDZK3BY-YRduSbl9.js +0 -2
- package/dist/client/assets/collapsible-C3qenpEI.js +0 -2
- package/dist/client/assets/corner-left-up-DohBMTTI.js +0 -1
- package/dist/client/assets/device-BRhRKysY.js +0 -2
- package/dist/client/assets/download-B587khDU.js +0 -1
- package/dist/client/assets/dynamic-R3OtJZHK.js +0 -3
- package/dist/client/assets/earth-26IFbzWm.js +0 -1
- package/dist/client/assets/ellipsis-BScTTB_n.js +0 -1
- package/dist/client/assets/empty-uoiaKPHo.js +0 -2
- package/dist/client/assets/entities-DNKDCsf2.js +0 -2
- package/dist/client/assets/eventmodeling-NTZA5JFV-6XFarcvj.js +0 -1
- package/dist/client/assets/eye-DTlv8Vet.js +0 -1
- package/dist/client/assets/file-search-gFHOfI6S.js +0 -1
- package/dist/client/assets/flowDiagram-HODETNUW-DQXavjl4.js +0 -1
- package/dist/client/assets/fold-vertical-BNQMJ6gu.js +0 -1
- package/dist/client/assets/folder-cog-CYwPj2H1.js +0 -2
- package/dist/client/assets/folder-git-2-6ON-nxul.js +0 -1
- package/dist/client/assets/folder-open-Rja0vZjv.js +0 -1
- package/dist/client/assets/folder-plus-CfJ5c8wa.js +0 -1
- package/dist/client/assets/git-branch-BuWXMpmq.js +0 -1
- package/dist/client/assets/grip-vertical-qjSy6wXX.js +0 -1
- package/dist/client/assets/hard-drive-DAxFba08.js +0 -1
- package/dist/client/assets/history-CrY611k2.js +0 -1
- package/dist/client/assets/house-CKS51Vx8.js +0 -1
- package/dist/client/assets/index-G0rP4C-v.js +0 -3
- package/dist/client/assets/kbd-D4mDfHPa.js +0 -2
- package/dist/client/assets/keybindings-CzL-fWkh.js +0 -2
- package/dist/client/assets/keyboard-Y7zJXIRo.js +0 -1
- package/dist/client/assets/link-CbhoiCa8.js +0 -1
- package/dist/client/assets/list-Cq4wtMwR.js +0 -1
- package/dist/client/assets/main-D9nJEeym.css +0 -2
- package/dist/client/assets/main-D9z9rMK1.js +0 -27
- package/dist/client/assets/message-circle-question-mark-BwzHSg4C.js +0 -1
- package/dist/client/assets/message-square-DcSgYDZ6.js +0 -1
- package/dist/client/assets/message-square-dashed-Cu56tC0F.js +0 -1
- package/dist/client/assets/mouse-pointer-2-DxhF1Woc.js +0 -1
- package/dist/client/assets/number-field-BLz8W5SU.js +0 -2
- package/dist/client/assets/openFileInPreview-l6IXWIxV.js +0 -2
- package/dist/client/assets/palette-B79srcx1.js +0 -1
- package/dist/client/assets/panel-left-Bp59PK2R.js +0 -1
- package/dist/client/assets/panel-tab-close-button-B2GW1bDy.js +0 -2
- package/dist/client/assets/panels-top-left-CC3HCiIs.js +0 -1
- package/dist/client/assets/plug-B1ccrQcT.js +0 -2
- package/dist/client/assets/popover-6BYEGLLK.js +0 -2
- package/dist/client/assets/primary-Cc8Am8Ju.js +0 -2
- package/dist/client/assets/primaryCloudLinkState-N7pLty-_.js +0 -2
- package/dist/client/assets/projectFilesQueryState-CrGsc81w.js +0 -2
- package/dist/client/assets/projectScriptEditor-RR3KkKhh.js +0 -2
- package/dist/client/assets/pullRequests-KhjrMCa0.js +0 -2
- package/dist/client/assets/puzzle-Df6hPSJS.js +0 -2
- package/dist/client/assets/queries-Cn1FJB1_.js +0 -2
- package/dist/client/assets/query-CK8MOmXr.js +0 -2
- package/dist/client/assets/radio-group-CM6Ra-QS.js +0 -2
- package/dist/client/assets/railroad-abnf-HS5TGJTU-CIxA0Vp4.js +0 -1
- package/dist/client/assets/railroad-ebnf-LZEXJU2U-Czs81Kdn.js +0 -1
- package/dist/client/assets/railroad-peg-WCYAUIDC-B7O8OPsa.js +0 -1
- package/dist/client/assets/rightPanelStore-6LLb3GY0.js +0 -2
- package/dist/client/assets/rotate-ccw-dcahmZQ2.js +0 -1
- package/dist/client/assets/rotate-cw-CIep6yNT.js +0 -1
- package/dist/client/assets/runtime-BVgeNXTV.js +0 -2
- package/dist/client/assets/runtime-CCr9UADV.js +0 -6
- package/dist/client/assets/scheduledTasksSettings.logic-ozIaTRfT.js +0 -3
- package/dist/client/assets/select-BiARKKgd.js +0 -2
- package/dist/client/assets/server-B26doYv6.js +0 -2
- package/dist/client/assets/session-CQXL-cTI.js +0 -2
- package/dist/client/assets/session-logic-C0mrkZ0j.js +0 -13
- package/dist/client/assets/settings-2-C2dIdVBr.js +0 -1
- package/dist/client/assets/settings-B5Dj0jhP.js +0 -2
- package/dist/client/assets/settings-DiBtchmK.js +0 -1
- package/dist/client/assets/settings.appearance-Di8HZa2Q.js +0 -2
- package/dist/client/assets/settings.archived-By34XjbG.js +0 -2
- package/dist/client/assets/settings.connections-BJuKrJhl.js +0 -2
- package/dist/client/assets/settings.decisions-BO8hfyYm.js +0 -2
- package/dist/client/assets/settings.general-RyWWgxqp.js +0 -2
- package/dist/client/assets/settings.integrations--N8SMmw7.js +0 -2
- package/dist/client/assets/settings.open-source-licenses-BmgFSigO.js +0 -2
- package/dist/client/assets/settings.providers-Cvt1-bmr.js +0 -3
- package/dist/client/assets/settings.scheduled-tasks-D5IG4nj_.js +0 -2
- package/dist/client/assets/settings.source-control-R63Z9kEM.js +0 -2
- package/dist/client/assets/settings.storage-J1kthey9.js +0 -2
- package/dist/client/assets/settingsLayout-BzyY4qHt.js +0 -3
- package/dist/client/assets/shield-question-mark-l31p7uuJ.js +0 -1
- package/dist/client/assets/skeleton-CtSxs1y1.js +0 -2
- package/dist/client/assets/square-menu-Bq3HnG2U.js +0 -2
- package/dist/client/assets/square-pen-CxvvUOOt.js +0 -1
- package/dist/client/assets/square-plus-B9j2jkOq.js +0 -2
- package/dist/client/assets/stateDiagram-v2-MP3YSRHH-BFcRJjAO.js +0 -2
- package/dist/client/assets/swimlanesDiagram-VR7AAH4N-B7z2b1Qv.js +0 -9
- package/dist/client/assets/text-search-DsadxNJw.js +0 -1
- package/dist/client/assets/themePalette-BZeqG2Hu.js +0 -5
- package/dist/client/assets/threadSort-BvhI6zOp.js +0 -2
- package/dist/client/assets/toast-Bm36EaG6.js +0 -2
- package/dist/client/assets/tooltip-Df-4YKs5.js +0 -2
- package/dist/client/assets/unfold-vertical--twzQtvn.js +0 -1
- package/dist/client/assets/usage-B26GT0RK.js +0 -2
- package/dist/client/assets/use-atom-command-CiEeUGsC.js +0 -2
- package/dist/client/assets/useHandleNewThread-DTz3ztCG.js +0 -2
- package/dist/client/assets/useNavigate-BK_XZ1It.js +0 -2
- package/dist/client/assets/useRegisterFieldControl-Daf1iBkI.js +0 -2
- package/dist/client/assets/useScopedModelAvailability-IKTxpeQL.js +0 -2
- package/dist/client/assets/useSettings-CckatJFa.js +0 -3
- package/dist/client/assets/utils-DmS758az.js +0 -37
- package/dist/client/assets/vcsRefInvalidation-lkYjTxah.js +0 -2
- package/dist/client/assets/welcome-CGBWwWzE.js +0 -2
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{Ao as n,Bs as r,E as i,Ef as a,Jl as o,Jn as s,Kn as c,Mo as l,Po as u,Qn as d,Ro as f,Un as p,Wn as m,Xn as h,Zn as g,ar as _,er as v,eu as y,ir as b,ma as x,nr as S,or as C,qn as w,rr as ee,t as T,wx as E}from"./utils-DmS758az.js";import{t as D}from"./camera-V1Ufc9sC.js";import{t as O}from"./ellipsis-vertical-fYTS1grT.js";import{t as te}from"./external-link-NWS0I_zo.js";import{t as k}from"./globe-BygqUCSx.js";import{t as ne}from"./minus-C7W28oE7.js";import{t as re}from"./mouse-pointer-click-DsDE4K7M.js";import{t as ie}from"./picture-in-picture-2-g5nsWFVw.js";import{t as ae}from"./plus-Cr075-cy.js";import{t as oe}from"./radio-tower-CT5Np78y.js";import{t as A}from"./x-CSwbgjBe.js";import{L as j,U as M}from"./runtime-CCr9UADV.js";import{b as N}from"./entities-DNKDCsf2.js";import{a as se,n as P,t as F}from"./tooltip-Df-4YKs5.js";import{ct as ce}from"./ChatMarkdown-D3ITm4U-.js";import{i as I}from"./toast-Bm36EaG6.js";import{C as le,O as L,S as ue,q as R}from"./useSettings-CckatJFa.js";import{i as de,n as z}from"./session-CQXL-cTI.js";import{t as B}from"./use-atom-command-CiEeUGsC.js";import{l as V}from"./rightPanelStore-6LLb3GY0.js";import{n as H}from"./toastHelpers-Dsph6LwL.js";import{A as U,k as W}from"./PanelLayoutControls-CCKUTh1H.js";import{o as fe}from"./timestampFormat-wac2e_Jz.js";import{a as G,o as K,r as q,t as pe}from"./empty-uoiaKPHo.js";import{a as me,i as he,t as ge}from"./previewMiniPlayerStore-BfMwexwO.js";import{n as _e,t as ve}from"./discovery-list-VoilmsP7.js";import{t as ye}from"./observeResize-WQaFQjbx.js";import{n as be}from"./openFileInPreview-l6IXWIxV.js";import{T as xe,a as Se,b as Ce,f as we,i as Te,n as Ee,o as De,r as Oe,t as ke,u as Ae,w as je}from"./browserHistoryStore-B-t3Vc_Z.js";import{t as Me}from"./preview-DFDpDpup.js";import{n as Ne,r as Pe,t as Fe}from"./preview-BpTu6A2K.js";import{n as Ie,r as Le,t as Re}from"./input-group-DIOgVvbV.js";import{$i as ze,Bi as Be,Hi as Ve,Ia as He,Ji as Ue,Qi as We,Ui as Ge,Vi as Ke,Wi as qe,Yi as Je,Za as Ye,ea as J,ia as Y,ls as X,qi as Xe,ra as Ze,sa as Qe,ss as $e,xo as et}from"./main-D9z9rMK1.js";import{a as tt,c as nt,d as rt,f as it,i as at,l as ot,n as st,o as ct,r as lt,s as ut,u as dt}from"./_chat-B3j3XTUJ.js";var Z=e(t(),1),Q=E(),ft=`data:image/png;base64,`;function pt(e){if(!e.screenshot)return{status:`none`};try{let{dataUrl:t}=e.screenshot;if(!t.startsWith(ft))return{status:`failed`};let n=Qe(t,`preview-annotation-${e.id}.png`,`image/png`);return n.size>0?{status:`captured`,file:n}:{status:`failed`}}catch{return{status:`failed`}}}var $=e(x(),1),mt=()=>{};function ht(e){let t=(0,Q.c)(78),{url:n,loading:r,canGoBack:i,canGoForward:a,refreshDisabled:o,inputDisabled:s,focusUrlNonce:c,onBack:l,onForward:u,onRefresh:d,onSubmit:f,onOpenInBrowser:p,onCapture:m,captureDisabled:h,recording:g,onPictureInPicture:_,pictureInPicture:v,pictureInPictureDisabled:y,onPickElement:b,pickActive:x,pickDisabled:S,pickDisabledReason:w,trailingActions:ee,leadingActions:E}=e,O=(0,Z.useRef)(null),[k,ne]=(0,Z.useState)(n),[ae,oe]=(0,Z.useState)(!1),A,j;t[0]===c?(A=t[1],j=t[2]):(A=()=>{if(c==null)return;let e=O.current;e&&e.focus()},j=[c],t[0]=c,t[1]=A,t[2]=j),(0,Z.useEffect)(A,j);let M;t[3]!==k||t[4]!==f?(M=e=>{e?.preventDefault();let t=k.trim();t.length!==0&&(f(t),O.current?.blur())},t[3]=k,t[4]=f,t[5]=M):M=t[5];let N=M,ce=i?l:mt,I=!i,le;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(le=(0,$.jsx)(X,{}),t[6]=le):le=t[6];let L;t[7]!==ce||t[8]!==I?(L=(0,$.jsx)(C,{variant:`ghost`,size:`icon-xs`,onClick:ce,disabled:I,"aria-label":`Back`,type:`button`,children:le}),t[7]=ce,t[8]=I,t[9]=L):L=t[9];let ue=a?u:mt,R=!a,de;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(de=(0,$.jsx)($e,{}),t[10]=de):de=t[10];let z;t[11]!==ue||t[12]!==R?(z=(0,$.jsx)(C,{variant:`ghost`,size:`icon-xs`,onClick:ue,disabled:R,"aria-label":`Forward`,type:`button`,children:de}),t[11]=ue,t[12]=R,t[13]=z):z=t[13];let B=o?mt:d,V=r?`Stop`:`Refresh`,H;t[14]!==o||t[15]!==B||t[16]!==V?(H=(0,$.jsx)(C,{variant:`ghost`,size:`icon-xs`,onClick:B,disabled:o,"aria-label":V,type:`button`}),t[14]=o,t[15]=B,t[16]=V,t[17]=H):H=t[17];let U;t[18]===r?U=t[19]:(U=(0,$.jsx)(He,{refreshing:r}),t[18]=r,t[19]=U);let W;t[20]!==H||t[21]!==U?(W=(0,$.jsx)(se,{render:H,children:U}),t[20]=H,t[21]=U,t[22]=W):W=t[22];let fe=r?`Loading…`:`Refresh`,G;t[23]===fe?G=t[24]:(G=(0,$.jsx)(P,{children:fe}),t[23]=fe,t[24]=G);let K;t[25]!==W||t[26]!==G?(K=(0,$.jsxs)(F,{children:[W,G]}),t[25]=W,t[26]=G,t[27]=K):K=t[27];let q;t[28]!==z||t[29]!==K||t[30]!==L?(q=(0,$.jsxs)(`div`,{className:`flex items-center gap-0.5`,role:`group`,"aria-label":`Navigation`,children:[L,z,K]}),t[28]=z,t[29]=K,t[30]=L,t[31]=q):q=t[31];let pe=ae?k:n,me;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(me=e=>ne(e.target.value),t[32]=me):me=t[32];let he;t[33]===n?he=t[34]:(he=()=>{ne(n),oe(!0),queueMicrotask(()=>O.current?.select())},t[33]=n,t[34]=he);let ge;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(ge=()=>{oe(!1)},t[35]=ge):ge=t[35];let _e;t[36]!==N||t[37]!==n?(_e=e=>{e.key===`Enter`&&N(e),e.key===`Escape`&&(e.preventDefault(),ne(n),O.current?.blur())},t[36]=N,t[37]=n,t[38]=_e):_e=t[38];let ve;t[39]!==s||t[40]!==pe||t[41]!==he||t[42]!==_e?(ve=(0,$.jsx)(F,{children:(0,$.jsx)(se,{render:(0,$.jsx)(Le,{ref:O,value:pe,onChange:me,onFocus:he,onBlur:ge,onKeyDown:_e,placeholder:`Search or enter URL`,spellCheck:!1,disabled:s,"data-preview-url-input":!0,size:`sm`})})}),t[39]=s,t[40]=pe,t[41]=he,t[42]=_e,t[43]=ve):ve=t[43];let ye;t[44]!==ae||t[45]!==p?(ye=p&&!ae?(0,$.jsx)(Ie,{align:`inline-end`,children:(0,$.jsx)(`span`,{className:`pointer-events-none flex opacity-0 transition-opacity focus-within:pointer-events-auto focus-within:opacity-100 group-hover/address:pointer-events-auto group-hover/address:opacity-100`,children:(0,$.jsx)(C,{variant:`ghost`,size:`icon-xs`,onClick:p,"aria-label":`Open in system browser`,type:`button`,children:(0,$.jsx)(te,{})})})}):null,t[44]=ae,t[45]=p,t[46]=ye):ye=t[46];let be;t[47]!==ve||t[48]!==ye?(be=(0,$.jsxs)(Re,{variant:`ghost`,className:`group/address h-7 flex-1`,children:[ve,ye]}),t[47]=ve,t[48]=ye,t[49]=be):be=t[49];let xe;t[50]!==b||t[51]!==x||t[52]!==S||t[53]!==w?(xe=b?(0,$.jsxs)(F,{children:[(0,$.jsx)(se,{render:(0,$.jsx)(C,{variant:x?`secondary`:`ghost`,size:`icon-xs`,onClick:b,disabled:S,"aria-label":x?`Cancel annotation`:`Annotate preview`,"aria-pressed":x?`true`:`false`,type:`button`}),children:(0,$.jsx)(re,{className:T(x&&`text-primary`)})}),(0,$.jsx)(P,{children:S&&w?w:x?`Cancel annotation (Esc)`:`Annotate elements, regions, and drawings`})]}):null,t[50]=b,t[51]=x,t[52]=S,t[53]=w,t[54]=xe):xe=t[54];let Se;t[55]!==h||t[56]!==m||t[57]!==g?(Se=m?(0,$.jsxs)(F,{children:[(0,$.jsxs)(se,{render:(0,$.jsx)(C,{variant:g?`secondary`:`ghost`,size:`icon-xs`,onClick:e=>m(e.shiftKey),"aria-label":g?`Stop recording`:`Capture screenshot`,type:`button`,className:`relative`,disabled:h}),children:[(0,$.jsx)(D,{className:T(g&&`text-destructive`)}),g?(0,$.jsx)(`span`,{className:`absolute right-0.5 top-0.5 size-1.5 animate-status-pulse rounded-full bg-destructive`}):null]}),(0,$.jsx)(P,{children:g?`Stop recording`:`Screenshot · Shift-click to record`})]}):null,t[55]=h,t[56]=m,t[57]=g,t[58]=Se):Se=t[58];let Ce;t[59]!==_||t[60]!==v||t[61]!==y?(Ce=_?(0,$.jsx)(C,{variant:v?`secondary`:`ghost`,size:`icon-xs`,onClick:_,"aria-label":v?`Close floating preview`:`Float preview over chat`,"aria-pressed":v?`true`:`false`,type:`button`,disabled:y,children:(0,$.jsx)(ie,{className:T(v&&`text-primary`)})}):null,t[59]=_,t[60]=v,t[61]=y,t[62]=Ce):Ce=t[62];let we;t[63]!==E||t[64]!==N||t[65]!==q||t[66]!==be||t[67]!==xe||t[68]!==Se||t[69]!==Ce||t[70]!==ee?(we=(0,$.jsxs)(`form`,{onSubmit:N,className:`flex h-10 min-h-10 shrink-0 items-center gap-1 border-b border-border/60 bg-background px-2 in-data-[preview-panel-mode=inline]:mb-3 in-data-[preview-panel-mode=inline]:h-7 in-data-[preview-panel-mode=inline]:min-h-7 in-data-[preview-panel-mode=inline]:border-b-transparent`,"data-surface-subheader":!0,children:[q,E,be,xe,Se,Ce,ee]}),t[63]=E,t[64]=N,t[65]=q,t[66]=be,t[67]=xe,t[68]=Se,t[69]=Ce,t[70]=ee,t[71]=we):we=t[71];let Te;t[72]===Symbol.for(`react.memo_cache_sentinel`)?(Te={boxShadow:`0 0 6px 1px var(--color-ring)`},t[72]=Te):Te=t[72];let Ee;t[73]===r?Ee=t[74]:(Ee=(0,$.jsx)(`div`,{"aria-hidden":!0,"data-loading":r,className:`preview-loading-progress pointer-events-none absolute bottom-0 left-0 z-10 h-0.5 w-full origin-left rounded-r-full bg-primary`,style:Te}),t[73]=r,t[74]=Ee);let De;return t[75]!==we||t[76]!==Ee?(De=(0,$.jsxs)(`div`,{className:`relative`,children:[we,Ee]}),t[75]=we,t[76]=Ee,t[77]=De):De=t[77],De}function gt(e){let t=(0,Q.c)(10),{threadRef:n,server:r,onOpen:i}=e,a;t[0]===r?a=t[1]:(a=_t(r),t[0]=r,t[1]=a);let o=a,s;t[2]!==r.requestedUrl||t[3]!==n?(s=(0,$.jsx)(W,{threadRef:n,url:r.requestedUrl}),t[2]=r.requestedUrl,t[3]=n,t[4]=s):s=t[4];let c=`${r.host}:${r.port}`,l;return t[5]!==i||t[6]!==o||t[7]!==s||t[8]!==c?(l=(0,$.jsx)(_e,{onClick:i,icon:s,title:o,description:c}),t[5]=i,t[6]=o,t[7]=s,t[8]=c,t[9]=l):l=t[9],l}function _t(e){return e.processName?e.processName:`Listening`}function vt(e){let t=(0,Q.c)(26),{threadRef:n,entry:r,onOpen:i,onRemove:a}=e,o;t[0]===r.url?o=t[1]:(o=new URL(r.url),t[0]=r.url,t[1]=o);let s=o,c=s.pathname===`/`?``:s.pathname,l=`${s.host}${c}${s.search}${s.hash}`,u;t[2]===r.lastVisitedAt?u=t[3]:(u=ke(r.lastVisitedAt)?fe(new Date(r.lastVisitedAt).toISOString()):``,t[2]=r.lastVisitedAt,t[3]=u);let d=u;ut();let f;t[4]!==r.url||t[5]!==n?(f=(0,$.jsx)(W,{threadRef:n,url:r.url}),t[4]=r.url,t[5]=n,t[6]=f):f=t[6];let p=r.title??l,m;t[7]===p?m=t[8]:(m=(0,$.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground`,children:p}),t[7]=p,t[8]=m);let h=r.title?`${l} · `:``,g;t[9]!==h||t[10]!==d?(g=(0,$.jsxs)(`span`,{className:`truncate text-xs text-muted-foreground`,children:[h,d]}),t[9]=h,t[10]=d,t[11]=g):g=t[11];let _;t[12]!==m||t[13]!==g?(_=(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[m,g]}),t[12]=m,t[13]=g,t[14]=_):_=t[14];let v;t[15]!==i||t[16]!==f||t[17]!==_?(v=(0,$.jsxs)(`button`,{type:`button`,onClick:i,className:`flex w-full items-center gap-3 px-3 py-3 pr-10 text-left hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,children:[f,_]}),t[15]=i,t[16]=f,t[17]=_,t[18]=v):v=t[18];let y=`Remove ${l} from history`,b;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,$.jsx)(A,{className:`size-3.5`}),t[19]=b):b=t[19];let x;t[20]!==a||t[21]!==y?(x=(0,$.jsx)(`button`,{type:`button`,"aria-label":y,onClick:a,className:`absolute right-3 rounded p-1 text-muted-foreground opacity-0 hover:bg-accent hover:text-foreground focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring group-hover:opacity-100`,children:b}),t[20]=a,t[21]=y,t[22]=x):x=t[22];let S;return t[23]!==x||t[24]!==v?(S=(0,$.jsxs)(`div`,{className:`group relative flex w-full items-center`,children:[v,x]}),t[23]=x,t[24]=v,t[25]=S):S=t[25],S}function yt(e){let t=(0,Q.c)(7),n=J(e.environmentId,e.configuredUrls),r;if(t[0]!==e.configuredUrls||t[1]!==e.environmentId||t[2]!==n.configuredUrlProbing||t[3]!==n.servers){let i;t[5]===e.environmentId?i=t[6]:(i=t=>({...t,url:De(e.environmentId,t.url),requestedUrl:t.url}),t[5]=e.environmentId,t[6]=i),r=bt({scanner:n.servers.map(i),configuredUrls:e.configuredUrls??[],configuredUrlProbing:n.configuredUrlProbing}),t[0]=e.configuredUrls,t[1]=e.environmentId,t[2]=n.configuredUrlProbing,t[3]=n.servers,t[4]=r}else r=t[4];return r}function bt(e){let t=new Map;for(let n of e.configuredUrls){let e=St(n);if(!e)continue;let r=xt(e.host,e.port);t.has(r)||t.set(r,e)}let n=[];for(let r of e.scanner){let i=xt(r.host,r.port),a=t.get(i);n.push({...r,requestedUrl:a&&e.configuredUrlProbing===!1?a.url:r.requestedUrl,source:a?`configured`:`scanner`})}return n.toSorted((e,t)=>{let n={configured:0,scanner:1};return n[e.source]===n[t.source]?e.port-t.port:n[e.source]-n[t.source]})}function xt(e,t){let n=e.toLowerCase();return`${Fe(n)?`loopback`:n}:${t}`}function St(e){try{let t=new URL(e);if(t.protocol!==`http:`&&t.protocol!==`https:`||!Fe(t.hostname))return null;let n=t.port?Number.parseInt(t.port,10):t.protocol===`http:`?80:443;return!Number.isFinite(n)||n<=0?null:{host:t.hostname,port:n,url:t.href}}catch{return null}}function Ct(e){let t=(0,Q.c)(24),{threadRef:n,environmentId:r,configuredUrls:i,recentEntries:a,onRemoveRecent:o,onOpenUrl:s}=e,c;t[0]!==i||t[1]!==r?(c={environmentId:r,configuredUrls:i},t[0]=i,t[1]=r,t[2]=c):c=t[2];let l=yt(c),u,d,f,p;if(t[3]!==s||t[4]!==o||t[5]!==a||t[6]!==l.length||t[7]!==n){p=Symbol.for(`react.early_return_sentinel`);bb0:{let e=a.filter(wt).slice(0,8);if(l.length===0&&e.length===0){let e;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsxs)(pe,{children:[(0,$.jsx)(G,{variant:`icon`,children:(0,$.jsx)(k,{className:`size-4.5 text-muted-foreground`})}),(0,$.jsx)(K,{children:`No preview yet`}),(0,$.jsx)(q,{children:`Type a URL above, or run a dev script. Browser-ready localhost servers will show up here automatically.`})]}),t[12]=e):e=t[12],p=e;break bb0}f=`scrollbar-gutter-both flex h-full min-h-0 overflow-y-auto px-5 py-8`,u=`mx-auto flex w-full max-w-xl flex-col gap-6`,d=e.length>0?(0,$.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,$.jsx)(et,{className:`size-4 shrink-0`}),(0,$.jsx)(`h2`,{className:`font-medium`,children:`Recently used`})]}),(0,$.jsx)(ve,{children:e.map(e=>(0,$.jsx)(vt,{threadRef:n,entry:e,onOpen:()=>s(e.url),onRemove:()=>o(e.url)},e.url))})]}):null}t[3]=s,t[4]=o,t[5]=a,t[6]=l.length,t[7]=n,t[8]=u,t[9]=d,t[10]=f,t[11]=p}else u=t[8],d=t[9],f=t[10],p=t[11];if(p!==Symbol.for(`react.early_return_sentinel`))return p;let m;t[13]!==s||t[14]!==l||t[15]!==n?(m=l.length>0?(0,$.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,$.jsx)(oe,{className:`size-4 shrink-0`}),(0,$.jsx)(`h2`,{className:`font-medium`,children:`Local servers`})]}),(0,$.jsx)(ve,{children:l.map(e=>(0,$.jsx)(gt,{threadRef:n,server:e,onOpen:()=>s(e.requestedUrl)},`${e.host}:${e.port}`))}),(0,$.jsx)(`p`,{className:`px-1 text-xs text-muted-foreground`,children:`Select a live local server to open it in this browser tab.`})]}):null,t[13]=s,t[14]=l,t[15]=n,t[16]=m):m=t[16];let h;t[17]!==u||t[18]!==d||t[19]!==m?(h=(0,$.jsxs)(`div`,{className:u,children:[d,m]}),t[17]=u,t[18]=d,t[19]=m,t[20]=h):h=t[20];let g;return t[21]!==f||t[22]!==h?(g=(0,$.jsx)(`div`,{className:f,children:h}),t[21]=f,t[22]=h,t[23]=g):g=t[23],g}function wt(e){return URL.canParse(e.url)}var Tt=[{value:`system`,label:`System`},{value:`light`,label:`Light`},{value:`dark`,label:`Dark`}],Et=()=>{let e=(0,Q.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsxs)(F,{children:[(0,$.jsx)(se,{render:(0,$.jsx)(_,{render:(0,$.jsx)(C,{variant:`ghost`,size:`icon-xs`,type:`button`,"aria-label":`Preview menu`})}),children:(0,$.jsx)(O,{})}),(0,$.jsx)(P,{children:`More`})]}),e[0]=t):t=e[0],t};function Dt(e){let t=(0,Q.c)(74),{enabled:n,actions:r,zoomFactor:i,colorScheme:a,deviceToolbarVisible:o,onToggleDeviceToolbar:l,nativePictureInPicture:u,profileName:d,move:f}=e,p;t[0]===i?p=t[1]:(p=Math.round(i*100),t[0]=i,t[1]=p);let _=`${p}%`,y=!n,x;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsx)(Et,{}),t[2]=x):x=t[2];let T;t[3]!==r.hardReload||t[4]!==y?(T=(0,$.jsx)(s,{onClick:r.hardReload,disabled:y,children:`Hard reload`}),t[3]=r.hardReload,t[4]=y,t[5]=T):T=t[5];let E;t[6]!==r.openDevTools||t[7]!==y?(E=r.openDevTools?(0,$.jsx)(s,{onClick:r.openDevTools,disabled:y,children:`Open DevTools`}):null,t[6]=r.openDevTools,t[7]=y,t[8]=E):E=t[8];let D;t[9]!==r.toggleNativePictureInPicture||t[10]!==y||t[11]!==u?(D=r.toggleNativePictureInPicture?(0,$.jsx)(s,{onClick:r.toggleNativePictureInPicture,disabled:y,children:u?`Close separate preview window`:`Open separate preview window`}):null,t[9]=r.toggleNativePictureInPicture,t[10]=y,t[11]=u,t[12]=D):D=t[12];let O;t[13]===f?O=t[14]:(O=f?(0,$.jsx)(s,{onClick:f.onMove,children:f.label}):null,t[13]=f,t[14]=O);let te=o?`Hide device toolbar`:`Show device toolbar`,k;t[15]!==y||t[16]!==l||t[17]!==te?(k=(0,$.jsx)(s,{onClick:l,disabled:y,children:te}),t[15]=y,t[16]=l,t[17]=te,t[18]=k):k=t[18];let re;t[19]===y?re=t[20]:(re=(0,$.jsx)(b,{disabled:y,children:`Appearance`}),t[19]=y,t[20]=re);let ie;t[21]===r?ie=t[22]:(ie=e=>r.setColorScheme(e),t[21]=r,t[22]=ie);let oe;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(oe=Tt.map(kt),t[23]=oe):oe=t[23];let A;t[24]!==a||t[25]!==ie?(A=(0,$.jsx)(ee,{children:(0,$.jsx)(g,{value:a,onValueChange:ie,children:oe})}),t[24]=a,t[25]=ie,t[26]=A):A=t[26];let j;t[27]!==A||t[28]!==re?(j=(0,$.jsxs)(S,{children:[re,A]}),t[27]=A,t[28]=re,t[29]=j):j=t[29];let M;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,$.jsx)(v,{}),t[30]=M):M=t[30];let N;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,$.jsx)(`span`,{children:`Zoom`}),t[31]=N):N=t[31];let se;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(se=(0,$.jsx)(ne,{}),t[32]=se):se=t[32];let P;t[33]!==r.zoomOut||t[34]!==y?(P=(0,$.jsx)(C,{variant:`outline`,size:`icon-xs`,type:`button`,onClick:r.zoomOut,"aria-label":`Zoom out`,disabled:y,children:se}),t[33]=r.zoomOut,t[34]=y,t[35]=P):P=t[35];let F;t[36]===_?F=t[37]:(F=(0,$.jsx)(`span`,{className:`min-w-12 text-center text-xs tabular-nums text-muted-foreground`,children:_}),t[36]=_,t[37]=F);let ce;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(ce=(0,$.jsx)(ae,{}),t[38]=ce):ce=t[38];let I;t[39]!==r.zoomIn||t[40]!==y?(I=(0,$.jsx)(C,{variant:`outline`,size:`icon-xs`,type:`button`,onClick:r.zoomIn,"aria-label":`Zoom in`,disabled:y,children:ce}),t[39]=r.zoomIn,t[40]=y,t[41]=I):I=t[41];let le;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(le=(0,$.jsx)(Ye,{}),t[42]=le):le=t[42];let L;t[43]!==r.resetZoom||t[44]!==y?(L=(0,$.jsx)(C,{variant:`ghost`,size:`icon-xs`,type:`button`,onClick:r.resetZoom,"aria-label":`Reset zoom`,disabled:y,children:le}),t[43]=r.resetZoom,t[44]=y,t[45]=L):L=t[45];let ue;t[46]!==P||t[47]!==F||t[48]!==I||t[49]!==L?(ue=(0,$.jsxs)(`span`,{className:`flex items-center gap-1`,children:[P,F,I,L]}),t[46]=P,t[47]=F,t[48]=I,t[49]=L,t[50]=ue):ue=t[50];let R;t[51]!==y||t[52]!==ue?(R=(0,$.jsxs)(s,{closeOnClick:!1,onClick:Ot,className:`justify-between`,disabled:y,children:[N,ue]}),t[51]=y,t[52]=ue,t[53]=R):R=t[53];let de;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(de=(0,$.jsx)(v,{}),t[54]=de):de=t[54];let z;t[55]===d?z=t[56]:(z=d?(0,$.jsx)(w,{className:`max-w-64`,children:(0,$.jsxs)(`span`,{className:`block truncate`,children:[`Profile: `,d]})}):null,t[55]=d,t[56]=z);let B;t[57]===r.clearCookies?B=t[58]:(B=(0,$.jsx)(s,{onClick:r.clearCookies,children:`Clear cookies`}),t[57]=r.clearCookies,t[58]=B);let V;t[59]===r.clearCache?V=t[60]:(V=(0,$.jsx)(s,{onClick:r.clearCache,children:`Clear cache`}),t[59]=r.clearCache,t[60]=V);let H;t[61]!==z||t[62]!==B||t[63]!==V?(H=(0,$.jsxs)(c,{children:[z,B,V]}),t[61]=z,t[62]=B,t[63]=V,t[64]=H):H=t[64];let U;return t[65]!==j||t[66]!==R||t[67]!==H||t[68]!==T||t[69]!==E||t[70]!==D||t[71]!==O||t[72]!==k?(U=(0,$.jsxs)(m,{children:[x,(0,$.jsxs)(h,{align:`end`,sideOffset:6,children:[T,E,D,O,k,j,M,R,de,H]})]}),t[65]=j,t[66]=R,t[67]=H,t[68]=T,t[69]=E,t[70]=D,t[71]=O,t[72]=k,t[73]=U):U=t[73],U}function Ot(e){return e.preventDefault()}function kt(e){return(0,$.jsx)(d,{value:e.value,children:e.label},e.value)}function At(e){return f[e]||(e.length>0?e:`Network error`)}function jt(e){let t=(0,Q.c)(21),{url:n,fileName:r,downloadUrl:i,onOpen:a}=e,o;t[0]===n?o=t[1]:(o=Ft(n)??n,t[0]=n,t[1]=o);let s=o,c,l;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(Pt,{className:`mb-6 size-12 text-muted-foreground/70`}),l=(0,$.jsx)(`h1`,{className:`mb-3 text-2xl font-semibold leading-tight text-foreground`,children:`This file can’t be shown here`}),t[2]=c,t[3]=l):(c=t[2],l=t[3]);let u;t[4]===r?u=t[5]:(u=(0,$.jsx)(`span`,{className:`font-semibold text-foreground`,children:r}),t[4]=r,t[5]=u);let d;t[6]!==s||t[7]!==u?(d=(0,$.jsxs)(`p`,{className:`text-sm leading-relaxed text-muted-foreground`,children:[u,` from `,s,` was downloaded instead.`]}),t[6]=s,t[7]=u,t[8]=d):d=t[8];let f;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsx)(`div`,{className:`flex-1`}),t[9]=f):f=t[9];let p;t[10]===a?p=t[11]:(p=(0,$.jsx)(C,{type:`button`,variant:`outline`,size:`sm`,onClick:a,children:`Open in browser`}),t[10]=a,t[11]=p);let m;t[12]!==i||t[13]!==r?(m=i?(0,$.jsx)(C,{type:`button`,size:`sm`,render:(0,$.jsx)(`a`,{href:i,download:r}),children:`Download`}):null,t[12]=i,t[13]=r,t[14]=m):m=t[14];let h;t[15]!==p||t[16]!==m?(h=(0,$.jsxs)(`div`,{className:`mt-auto flex items-center gap-2 pt-8`,children:[f,p,m]}),t[15]=p,t[16]=m,t[17]=h):h=t[17];let g;return t[18]!==d||t[19]!==h?(g=(0,$.jsx)(`div`,{className:`scrollbar-gutter-both relative flex h-full min-h-0 w-full overflow-y-auto bg-background`,children:(0,$.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-1 flex-col px-8 py-12 sm:py-16`,children:[c,l,d,h]})}),t[18]=d,t[19]=h,t[20]=g):g=t[20],g}function Mt(e){let t=(0,Q.c)(36),{url:n,code:r,description:i,onReload:a,move:o}=e,[s,c]=(0,Z.useState)(!1),l;t[0]===n?l=t[1]:(l=Ft(n)??n,t[0]=n,t[1]=l);let u=l,d;t[2]===i?d=t[3]:(d=At(i),t[2]=i,t[3]=d);let f=d,p;t[4]!==r||t[5]!==i?(p=i.length>0?i:`ERR_${Math.abs(r)||`FAILED`}`,t[4]=r,t[5]=i,t[6]=p):p=t[6];let m=p,h,g;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,$.jsx)(Pt,{className:`mb-6 size-12 text-muted-foreground/70`}),g=(0,$.jsx)(`h1`,{className:`mb-3 text-2xl font-semibold leading-tight text-foreground`,children:`This site can’t be reached`}),t[7]=h,t[8]=g):(h=t[7],g=t[8]);let _;t[9]===u?_=t[10]:(_=(0,$.jsx)(`span`,{className:`font-semibold text-foreground`,children:u}),t[9]=u,t[10]=_);let v;t[11]!==f||t[12]!==_?(v=(0,$.jsxs)(`p`,{className:`text-sm leading-relaxed text-muted-foreground`,children:[_,`: `,f,`.`]}),t[11]=f,t[12]=_,t[13]=v):v=t[13];let y;t[14]!==o||t[15]!==s?(y=s?(0,$.jsxs)(`div`,{className:`mt-6 rounded-lg border border-border bg-muted/40 p-4 text-sm`,children:[(0,$.jsx)(`p`,{className:`mb-2 font-medium text-foreground`,children:`Try:`}),(0,$.jsxs)(`ul`,{className:`list-disc space-y-1 pl-5 text-muted-foreground`,children:[(0,$.jsx)(`li`,{children:`Checking your connection`}),(0,$.jsx)(`li`,{children:`Confirming the dev server is running`}),o?(0,$.jsx)(`li`,{children:`Opening it in the environment’s browser, which reaches its network`}):null,(0,$.jsx)(`li`,{children:`Checking the proxy and the firewall`})]})]}):null,t[14]=o,t[15]=s,t[16]=y):y=t[16];let b;t[17]===m?b=t[18]:(b=(0,$.jsx)(`div`,{className:`mt-8 text-xs uppercase tracking-wide text-muted-foreground/70`,children:m}),t[17]=m,t[18]=b);let x;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(x=()=>c(Nt),t[19]=x):x=t[19];let S=s?`Hide details`:`Details`,w;t[20]===S?w=t[21]:(w=(0,$.jsx)(C,{type:`button`,variant:`outline`,size:`sm`,onClick:x,children:S}),t[20]=S,t[21]=w);let ee;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,$.jsx)(`div`,{className:`flex-1`}),t[22]=ee):ee=t[22];let T;t[23]===o?T=t[24]:(T=o?(0,$.jsx)(C,{type:`button`,variant:`outline`,size:`sm`,onClick:o.onMove,children:o.label}):null,t[23]=o,t[24]=T);let E;t[25]===a?E=t[26]:(E=(0,$.jsx)(C,{type:`button`,size:`sm`,onClick:a,children:`Reload`}),t[25]=a,t[26]=E);let D;t[27]!==w||t[28]!==T||t[29]!==E?(D=(0,$.jsxs)(`div`,{className:`mt-auto flex items-center gap-2 pt-8`,children:[w,ee,T,E]}),t[27]=w,t[28]=T,t[29]=E,t[30]=D):D=t[30];let O;return t[31]!==D||t[32]!==v||t[33]!==y||t[34]!==b?(O=(0,$.jsx)(`div`,{className:`scrollbar-gutter-both relative flex h-full min-h-0 w-full overflow-y-auto bg-background`,children:(0,$.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-1 flex-col px-8 py-12 sm:py-16`,children:[h,g,v,y,b,D]})}),t[31]=D,t[32]=v,t[33]=y,t[34]=b,t[35]=O):O=t[35],O}function Nt(e){return!e}function Pt(e){let t=(0,Q.c)(5),{className:n}=e,r,i,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(`path`,{d:`M16 12 L48 12 L48 52 L16 52 Z`}),i=(0,$.jsx)(`path`,{d:`M22 22 L42 22 M22 30 L36 30 M22 38 L40 38`,strokeLinecap:`round`}),a=(0,$.jsx)(`path`,{d:`M52 8 L12 56`,strokeLinecap:`round`}),t[0]=r,t[1]=i,t[2]=a):(r=t[0],i=t[1],a=t[2]);let o;return t[3]===n?o=t[4]:(o=(0,$.jsxs)(`svg`,{viewBox:`0 0 64 64`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,className:n,children:[r,i,a]}),t[3]=n,t[4]=o),o}function Ft(e){try{return new URL(e).host}catch{return null}}var It=1500,Lt=.001;function Rt(e){let t=(0,Q.c)(11),{zoomFactor:n}=e,[r,i]=(0,Z.useState)(!1),a=(0,Z.useRef)(n),o=(0,Z.useRef)(null),s,c;t[0]===n?(s=t[1],c=t[2]):(s=()=>{if(!(Math.abs(a.current-n)<Lt))return a.current=n,i(!0),o.current!==null&&window.clearTimeout(o.current),o.current=window.setTimeout(()=>{i(!1),o.current=null},It),()=>{o.current!==null&&(window.clearTimeout(o.current),o.current=null)}},c=[n],t[0]=n,t[1]=s,t[2]=c),(0,Z.useEffect)(s,c);let l;t[3]===n?l=t[4]:(l=Math.round(n*100),t[3]=n,t[4]=l);let u=`${l}%`,d=!r,f=r?`opacity-100 translate-y-0`:`opacity-0 -translate-y-1`,p;t[5]===f?p=t[6]:(p=T(`pointer-events-none absolute top-3 right-3 z-20 select-none rounded-full border border-border/70 bg-popover/95 px-2.5 py-1 text-xs font-medium text-foreground shadow-md/10 backdrop-blur transition-all duration-200 ease-out`,f),t[5]=f,t[6]=p);let m;return t[7]!==u||t[8]!==d||t[9]!==p?(m=(0,$.jsx)(`div`,{"aria-hidden":d,className:p,children:u}),t[7]=u,t[8]=d,t[9]=p,t[10]=m):m=t[10],m}function zt(e,t){return e.find(e=>e.id===t)?.name??`Removed profile`}var Bt=typeof window>`u`?null:R();function Vt(e){let t=(0,Q.c)(12),n=rt(e.threadRef.environmentId),r;t[0]!==n||t[1]!==e.download.id||t[2]!==e.tabId||t[3]!==e.threadRef.threadId?(r=n?it({access:n,threadId:e.threadRef.threadId,tabId:e.tabId},e.download.id):null,t[0]=n,t[1]=e.download.id,t[2]=e.tabId,t[3]=e.threadRef.threadId,t[4]=r):r=t[4];let i;t[5]===e.url?i=t[6]:(i=()=>void Bt?.shell.openExternal(e.url).catch(Ht),t[5]=e.url,t[6]=i);let a;return t[7]!==e.download.fileName||t[8]!==e.url||t[9]!==r||t[10]!==i?(a=(0,$.jsx)(jt,{url:e.url,fileName:e.download.fileName,downloadUrl:r,onOpen:i}),t[7]=e.download.fileName,t[8]=e.url,t[9]=r,t[10]=i,t[11]=a):a=t[11],a}function Ht(){}function Ut({threadRef:e,tabId:t,configuredUrls:a,visible:s,onSendAnnotation:c}){let[d,f]=(0,Z.useState)(void 0),[m,h]=(0,Z.useState)(!1),g=de(e.environmentId,`orchestration:operate`)&&!!c,_=qe(),v=(0,Z.useRef)(null),b=(0,Z.useRef)(!0),x=(0,Z.useRef)(e);x.current=e;let S=u(e),C=Se(e,50),w=me(t=>he(t.byThreadKey,e)),ee=i(e=>e.addPreviewAnnotation),E=i(e=>e.addImage),D=le(e.environmentId),O=D?new URL(D).hostname:null,te=B(Me.open),k=B(Me.close,`preview close`),ne=ue(e.environmentId)?.label??`the environment`,re=L(),ie=N(e.environmentId),ae=B(Me.resize,`preview viewport resize`),oe=B(Me.adjust,`preview appearance or zoom`);st(e),(0,Z.useEffect)(()=>(b.current=!0,()=>{b.current=!1}),[]);let A=t??S.activeTabId,R=A?Ue(e,S.serverEpoch,A):null,U=A&&R?_.has(R)?R:Be(e,A):null,W=A?S.sessions[A]??null:null,fe=xe(e.environmentId,W),G=W?.runtime===`server`&&!fe,K=W?.runtime===`server`,q=(0,Z.useRef)(null),[pe,_e]=(0,Z.useState)(!1),ve=(0,Z.useRef)(null),[ke,je]=(0,Z.useState)(0),Fe=W?.runtime===`server`&&(W.viewport??o)._tag!==`fill`;(0,Z.useEffect)(()=>{let e=ve.current;if(e&&Fe)return ye(e,([e])=>je(Math.max(1,Math.round(e?.contentRect.width??0))))},[Fe]);let[Ie,Le]=(0,Z.useState)(null),Re=G&&Ie!==R,[He,Ye]=(0,Z.useState)(null),J=A?S.desktopByTabId[A]??null:null,X=W?.navStatus??{_tag:`Idle`},Qe=X._tag===`Idle`?``:X.url,$e=J?.loading??X._tag===`Loading`,et=J?.canGoBack??W?.canGoBack??!1,rt=J?.canGoForward??W?.canGoForward??!1,it=X._tag===`Idle`,ut=X._tag===`LoadFailed`,Q=ct(W),ft=G&&!Q&&!ut&&He!==R,mt=J?.controller??`none`,gt=W?.viewport??o,_t=we(),vt=W?.profileId??`default`,yt=zt(_t.profiles,vt),bt=Xe(e=>R?e.byTabId[R]?.rect??null:null),xt=X._tag===`Success`?X.url:null,St=X._tag===`Success`?X.title:null,wt=C[0]?.url,Tt=r(e);(0,Z.useEffect)(()=>{xt&&St&&wt&&Te(x.current,xt,St,O)},[O,wt,St,xt,Tt]);let Et=(0,Z.useCallback)(async t=>{if(G&&q.current)return!Re&&(q.current.navigate(t),n(e,t),!0);if(R&&Y)return await Y.navigate(R,t),n(e,t),!0;let r=await Ze({openPreview:te,threadRef:e,url:t});if(r._tag===`Failure`&&!j(r)){let e=M(r);e instanceof be&&I.add({type:`error`,title:`Unable to open browser`,description:e.message})}return r._tag===`Success`},[G,te,R,Re,e]),Ot=(0,Z.useCallback)(async t=>{try{let n=Pe(t);await Et(n)&&Ee(e,n)}catch{}},[Et,e]),kt=(0,Z.useCallback)(async t=>{try{let n=G||!Y?Ne(t):De(e.environmentId,t);await Et(n)&&Ee(e,t)}catch{}},[G,Et,e]),At=(0,Z.useCallback)(()=>{G?q.current?.reload():Y&&R&&Y.refresh(R)},[G,R]),jt=(0,Z.useCallback)(async t=>{if(!A)return;let n=await oe({environmentId:e.environmentId,input:{threadId:e.threadId,tabId:A,...t}});if(n._tag===`Failure`){let e=M(n);I.add({type:`error`,title:`Unable to change the browser tab`,description:e instanceof Error?e.message:`An error occurred.`});return}l(e,n.value)},[oe,A,e]),Nt=W?.zoomFactor??1,Pt=(0,Z.useCallback)(e=>{let t=y.indexOf(Nt),n=e===0?1:y[Math.min(Math.max((t<0?7:t)+e,0),y.length-1)];n!==Nt&&jt({zoomFactor:n})},[jt,Nt]),Ft=(0,Z.useCallback)(()=>{K?Pt(1):Y&&R&&Y.zoomIn(R)},[R,K,Pt]),It=(0,Z.useCallback)(()=>{K?Pt(-1):Y&&R&&Y.zoomOut(R)},[R,K,Pt]),Lt=(0,Z.useCallback)(()=>{K?Pt(0):Y&&R&&Y.resetZoom(R)},[R,K,Pt]),Ht=(0,Z.useCallback)(async t=>{if(!A)return;let n=await ae({environmentId:e.environmentId,input:{threadId:e.threadId,tabId:A,viewport:t}});if(n._tag===`Failure`){let e=M(n);throw I.add({type:`error`,title:`Unable to resize browser viewport`,description:e instanceof Error?e.message:`An error occurred.`}),e}l(e,n.value)},[ae,A,e]),Ut=()=>{if(R){if(gt._tag!==`fill`){We(R,o).catch(()=>void 0);return}We(R,Ae({defaults:_t,panelRect:bt,zoomFactor:K?Nt:J?.zoomFactor})).catch(()=>void 0)}};(0,Z.useEffect)(()=>{if(R)return ze(R,Ht)},[Ht,R]);let Wt=(0,Z.useCallback)(()=>{G?q.current?.history(-1):Y&&R&&Y.goBack(R)},[G,R]),Gt=(0,Z.useCallback)(()=>{G?q.current?.history(1):Y&&R&&Y.goForward(R)},[G,R]),Kt=(0,Z.useCallback)(()=>{Bt&&Qe&&Bt.shell.openExternal(Qe).catch(()=>void 0)},[Qe]),qt=Ce(e.environmentId,re,ie,W),Jt=qt===`server`?`Open in ${ne}'s browser`:`Open on this computer`,Yt=(0,Z.useCallback)(async()=>{if(!qt||!A||!W)return;let t=await Ze({openPreview:te,threadRef:e,...Qe?{url:qt===`desktop`?De(e.environmentId,Qe):Qe}:{},viewport:gt,...W.profileId===void 0?{}:{profileId:W.profileId},runtime:qt});if(t._tag===`Failure`){if(j(t))return;let e=M(t);I.add({type:`error`,title:`Unable to move the browser tab`,description:e instanceof Error?e.message:`An error occurred.`});return}V.getState().openBrowser(e,t.value.tabId),await ot({closePreview:k,snapshot:W,tabId:A,threadRef:e})},[k,qt,te,W,A,e,Qe,gt]),Xt=(0,Z.useCallback)(()=>{if(A){if(w===A){me.getState().close(e);return}me.getState().open(e,ge(A)),V.getState().close(e)}},[w,A,e]),Zt=e=>()=>{e&&R&&e(R).catch(()=>void 0)},Qt=K?{hardReload:()=>void jt({hardReload:!0}),setColorScheme:e=>void jt({colorScheme:e}),zoomIn:Ft,zoomOut:It,resetZoom:Lt,clearCookies:()=>void jt({clear:`cookies`}),clearCache:()=>void jt({clear:`cache`}),...fe&&Y?{openDevTools:Zt(Y.openDevTools),toggleNativePictureInPicture:()=>$t()}:{}}:Y?{hardReload:Zt(Y.hardReload),setColorScheme:e=>{R&&Y?.setColorScheme(R,e).catch(()=>void 0)},zoomIn:Ft,zoomOut:It,resetZoom:Lt,clearCookies:()=>void Y?.clearCookies(e.environmentId,vt).catch(()=>void 0),clearCache:()=>void Y?.clearCache(e.environmentId,vt).catch(()=>void 0),openDevTools:Zt(Y.openDevTools),toggleNativePictureInPicture:()=>$t()}:null,$t=(0,Z.useCallback)(()=>{Y&&R&&(J?.pictureInPicture?Y.pictureInPicture.close:Y.pictureInPicture.open)(R).catch(e=>{I.add({type:`error`,title:`Unable to update popped-out preview`,description:e instanceof Error?e.message:`An error occurred.`})})},[J?.pictureInPicture,R]),en=(0,Z.useCallback)(t=>{if(!Y||!R||!A)return;let n=Y;if(U){Ge(U).then(e=>{if(!e)return;let t=!1,r,i=()=>{if(!navigator.clipboard?.writeText){I.update(r,H({type:`error`,title:`Unable to copy recording path`,description:`Clipboard API unavailable.`,actionProps:a}));return}navigator.clipboard.writeText(e.path).then(()=>{t=!0,o(),window.setTimeout(()=>{t=!1,o()},2e3)},e=>{I.update(r,H({type:`error`,title:`Unable to copy recording path`,description:e instanceof Error?e.message:`An error occurred.`,actionProps:a}))})},a={children:ce(navigator.platform),onClick:()=>void n.revealArtifact(e.path)},o=()=>{I.update(r,H({type:`success`,title:`Recording saved`,actionProps:a,data:{secondaryActionProps:{children:t?`Copied!`:`Copy path`,disabled:t,onClick:i},secondaryActionVariant:`outline`}}))};r=I.add(H({type:`success`,title:`Recording saved`,actionProps:a,data:{secondaryActionProps:{children:`Copy path`,onClick:i},secondaryActionVariant:`outline`}}))},e=>{I.add({type:`error`,title:`Unable to stop recording`,description:e instanceof Error?e.message:`An error occurred.`})});return}if(t){Ve(R,e,A).catch(e=>{let t=e instanceof Error?e.message:`An error occurred.`;Ke(e)||I.add({type:`error`,title:`Unable to start recording`,description:t})});return}n.captureScreenshot(R).then(e=>{let t={children:ce(navigator.platform),onClick:()=>void n.revealArtifact(e.path)},r=!1,i=!1,a,o=(e=`success`,n=`Screenshot saved`,o)=>{I.update(a,H({type:e,title:n,description:o,actionProps:{children:i?`Copied!`:`Copy image`,disabled:i,onClick:c},data:{additionalActions:[{id:`copy-path`,props:{children:r?`Copied!`:`Copy path`,disabled:r,onClick:s}}],secondaryActionProps:{...t},secondaryActionVariant:`outline`}}))},s=()=>{if(!navigator.clipboard?.writeText){o(`error`,`Unable to copy screenshot path`,`Clipboard API unavailable.`);return}navigator.clipboard.writeText(e.path).then(()=>{r=!0,o(),window.setTimeout(()=>{r=!1,o()},2e3)},e=>{o(`error`,`Unable to copy screenshot path`,e instanceof Error?e.message:`An error occurred.`)})},c=()=>{n.copyArtifactToClipboard(e.path).then(()=>{i=!0,o(),window.setTimeout(()=>{i=!1,o()},2e3)},e=>{o(`error`,`Unable to copy screenshot`,e instanceof Error?e.message:`An error occurred.`)})};a=I.add(H({type:`success`,title:`Screenshot saved`,actionProps:{children:`Copy image`,onClick:c},data:{additionalActions:[{id:`copy-path`,props:{children:`Copy path`,onClick:s}}],secondaryActionProps:{...t},secondaryActionVariant:`outline`}}))},e=>{I.add({type:`error`,title:`Unable to capture screenshot`,description:e instanceof Error?e.message:`An error occurred.`})})},[U,R,A,e]),tn=(0,Z.useCallback)(()=>{if(!Y||!R)return;if(v.current){v.current.cancelled=!0,Y.cancelPickElement(R).catch(()=>void 0);return}let t=typeof document<`u`?document.activeElement:null,n={cancelled:!1},r=!1;v.current=n,h(!0),(async()=>{try{if(await Y.setAnnotationSendEnabled?.(R,!!c&&z(e.environmentId,`orchestration:operate`)),n.cancelled)return;let t=await Y.pickElement(R);if(!t||n.cancelled)return;v.current===n&&(v.current=null,b.current&&h(!1),r=!0);let{annotation:i,submission:a,screenshotFailed:o=!1}=t,s=pt(i),l=o||s.status===`failed`,u=s.status===`failed`?{...i,screenshot:null}:i;ee(e,u),l&&I.add(H({type:`error`,title:`Could not capture the picked element`,description:`The annotation was kept without the screenshot.`}));let d=s.status===`captured`?s.file:null,f=d&&u.screenshot?{type:`image`,id:u.id,name:d.name,mimeType:d.type,sizeBytes:d.size,previewUrl:u.screenshot.dataUrl,file:d}:null;f&&E(e,f),a===`send`&&z(e.environmentId,`orchestration:operate`)&&c?.(u,f)}catch{}finally{let e=v.current===n;if(e&&(v.current=null,b.current&&h(!1)),(e||r)&&t&&t.isConnected&&typeof t.focus==`function`)try{t.focus({preventScroll:!0})}catch{}}})()},[E,ee,c,R,e]);return(0,Z.useEffect)(()=>{m&&Y&&R&&Y.setAnnotationSendEnabled?.(R,g).catch(()=>void 0)},[g,m,R]),(0,Z.useEffect)(()=>()=>{v.current&&(v.current.cancelled=!0,v.current=null,Y&&R&&Y.cancelPickElement(R).catch(()=>void 0),b.current&&h(!1))},[R]),(0,Z.useEffect)(()=>{if(s)return dt(e=>{switch(e){case`refresh`:At();return;case`focus-url`:f(e=>(e??0)+1);return;case`zoom-in`:Ft();return;case`zoom-out`:It();return;case`reset-zoom`:Lt();return;case`toggle-panel`:return}})},[At,Lt,Ft,It,s]),(0,$.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col bg-background`,"data-thread-key":r(e),children:[(0,$.jsx)(ht,{url:Qe,loading:$e||ft,canGoBack:et&&!Re,canGoForward:rt&&!Re,refreshDisabled:it||Re,inputDisabled:Re,focusUrlNonce:d,onBack:Wt,onForward:Gt,onRefresh:At,onSubmit:e=>void Ot(e),onOpenInBrowser:A?Kt:void 0,onCapture:Y&&A&&!G?en:void 0,captureDisabled:!J||ut,recording:U!==null,onPictureInPicture:A&&(G||Y)?Xt:void 0,pictureInPicture:w===A,pictureInPictureDisabled:ut||!G&&!J?.hasWebContents,onPickElement:Y&&A&&!G?tn:void 0,pickActive:m,pickDisabled:!A||ut,pickDisabledReason:ut?`Page didn't load — pick unavailable until the page renders`:void 0,leadingActions:vt===_t.profileId?null:(0,$.jsxs)(F,{children:[(0,$.jsx)(se,{render:(0,$.jsx)(p,{variant:`outline`,className:`max-w-28 shrink-0`}),children:(0,$.jsx)(`span`,{className:`truncate`,children:yt})}),(0,$.jsx)(P,{side:`top`,children:yt})]}),trailingActions:Qt?(0,$.jsx)(Dt,{enabled:R!==null&&(K||(J?.hasWebContents??!1)),actions:Qt,...qt?{move:{label:Jt,onMove:()=>void Yt()}}:{},profileName:yt,zoomFactor:K?Nt:J?.zoomFactor??1,colorScheme:K?W?.colorScheme??`system`:J?.colorScheme??`system`,deviceToolbarVisible:gt._tag!==`fill`,onToggleDeviceToolbar:Ut,nativePictureInPicture:J?.pictureInPicture??!1}):null}),(0,$.jsxs)(`div`,{ref:ve,className:`relative min-h-0 flex-1 overflow-hidden`,children:[R&&W&&G?(0,$.jsxs)($.Fragment,{children:[gt._tag!==`fill`&&!Q&&!ut?(0,$.jsx)(`div`,{className:`absolute inset-x-0 top-0 z-10`,children:(0,$.jsx)(Je,{setting:gt,width:ke,aspectRatio:pe?gt.width/gt.height:null,onAspectRatioChange:e=>_e(e!==null),onChange:e=>We(R,e)})}):null,(0,$.jsx)(`div`,{className:`absolute inset-x-0 bottom-0`,style:{top:gt._tag===`fill`?0:38},children:(0,$.jsx)(lt,{ref:q,environmentId:e.environmentId,threadId:e.threadId,tabId:W.tabId,visible:s,onFirstFrame:()=>Ye(R),onControl:e=>Le(e?.controller===`you`?R:null),onPopup:t=>nt(e,t,`panel`),className:T(`absolute inset-0 h-full w-full`,(Q||ut)&&`invisible`)},R)})]}):R&&W&&!Q?Y?(0,$.jsx)(tt,{tabId:R,visible:s&&!ut,className:`absolute inset-0 h-full w-full`},R):(0,$.jsx)(`div`,{className:`flex h-full items-center justify-center p-8 text-center`,children:(0,$.jsx)(`p`,{className:`max-w-sm text-sm text-muted-foreground`,children:`This tab is open in the P4 Code desktop app.`})}):null,Q?(0,$.jsx)(Ct,{threadRef:e,environmentId:e.environmentId,configuredUrls:a,recentEntries:C,onRemoveRecent:t=>Oe(e,t),onOpenUrl:e=>void kt(e)}):null,W&&J?(0,$.jsx)(Rt,{zoomFactor:J.zoomFactor}):null,R&&J&&!Q&&!ut&&!_.has(R)?(0,$.jsx)(at,{tabId:R,zoomFactor:J.zoomFactor,controller:mt}):null,X._tag===`LoadFailed`&&X.download?(0,$.jsx)(`div`,{className:`absolute inset-0 z-10 bg-background`,children:(0,$.jsx)(Vt,{threadRef:e,tabId:W?.tabId??``,url:X.url,download:X.download})}):X._tag===`LoadFailed`?(0,$.jsx)(`div`,{className:`absolute inset-0 z-10 bg-background`,children:(0,$.jsx)(Mt,{url:X.url,code:X.code,description:X.description,onReload:At,...qt===`server`?{move:{label:Jt,onMove:()=>void Yt()}}:{}})}):null]})]})}function Wt(e){let t=(0,Q.c)(18),{mode:n,threadRef:r,tabId:i,configuredUrls:o,visible:s,onSendAnnotation:c}=e,l=je(r.environmentId),u=de(r.environmentId,a);if(!u||!l){let e=u?`Preview is only available in the P4 Code desktop app.`:`Pair this client again with preview access to control browser previews.`,r;t[0]===e?r=t[1]:(r=(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col items-center justify-center gap-3 p-8 text-center`,children:(0,$.jsx)(`p`,{className:`max-w-sm text-sm text-muted-foreground`,children:e})}),t[0]=e,t[1]=r);let i;return t[2]!==n||t[3]!==r?(i=(0,$.jsx)(U,{mode:n,children:r}),t[2]=n,t[3]=r,t[4]=i):i=t[4],i}let d;t[5]===i?d=t[6]:(d=i===void 0?{}:{tabId:i},t[5]=i,t[6]=d);let f;t[7]===c?f=t[8]:(f=c?{onSendAnnotation:c}:{},t[7]=c,t[8]=f);let p;t[9]!==o||t[10]!==d||t[11]!==f||t[12]!==r||t[13]!==s?(p=(0,$.jsx)(Ut,{threadRef:r,...d,configuredUrls:o,visible:s,...f}),t[9]=o,t[10]=d,t[11]=f,t[12]=r,t[13]=s,t[14]=p):p=t[14];let m;return t[15]!==n||t[16]!==p?(m=(0,$.jsx)(U,{mode:n,children:p}),t[15]=n,t[16]=p,t[17]=m):m=t[17],m}export{Wt as PreviewPanel};
|
|
2
|
-
//# sourceMappingURL=PreviewPanel-BEWZuH6o.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{Bt as t,Gt as ee,Mt as te,Vt as ne,kl as n,ma as r,qt as re,tn as i,wx as a,xs as ie}from"./utils-DmS758az.js";import{a as o,c as s,o as c,s as l,t as u}from"./select-BiARKKgd.js";import{t as ae}from"./useNavigate-BK_XZ1It.js";import{i as oe}from"./toast-Bm36EaG6.js";import{E as se,i as ce}from"./useSettings-CckatJFa.js";import{t as le}from"./server-B26doYv6.js";import{t as d}from"./pullRequestDetail.logic-CE7fVOsp.js";import{i as ue}from"./p4ProjectFile-BzCYJ8I-.js";import{I as de,M as fe,N as pe,P as f,S as me,a as p,n as he,p as ge,r as m,s as _e,z as ve}from"./settingsLayout-BzyY4qHt.js";import{Ea as ye,ir as h}from"./main-D9z9rMK1.js";import{t as be}from"./ProviderModelPicker-CpgHpUCG.js";import{n as xe,t as Se}from"./runtimeModeConfig-DKj6PlUP.js";var Ce=a(),g=e(r(),1),we=[`recursive`,`top-level`,`none`];function Te(e){return e!==null&&we.includes(e)}function Ee(e){let r=(0,Ce.c)(94),{category:a}=e,{scope:Ee,target:_,targets:je,connectedEnvironments:Me}=ve(),v=pe(),y=de(),Ne=ae(),{environments:b}=se(),x,S,C,w,T;if(r[0]!==b||r[1]!==v||r[2]!==_){C=_?b.find(e=>e.environmentId===_.environmentId):void 0;let e=C?.serverConfig?.providers??le;w=ee(e,v.defaultModelSelection),x=re(t(ne(e),v,_?.projectId??null)),S=te(v,e,w?.instanceId,w?.model),T=x.find(e=>e.instanceId===w?.instanceId),r[0]=b,r[1]=v,r[2]=_,r[3]=x,r[4]=S,r[5]=C,r[6]=w,r[7]=T}else x=r[3],S=r[4],C=r[5],w=r[6],T=r[7];let E=T,D;r[8]===Symbol.for(`react.memo_cache_sentinel`)?(D=[`defaultModelSelection`],r[8]=D):D=r[8];let O=f(D),k;r[9]===Symbol.for(`react.memo_cache_sentinel`)?(k=[`defaultRuntimeMode`],r[9]=k):k=r[9];let A=f(k),Pe=Se[v.defaultRuntimeMode].icon,j;r[10]===Symbol.for(`react.memo_cache_sentinel`)?(j=[`defaultThreadEnvMode`],r[10]=j):j=r[10];let M=f(j),N;r[11]===Symbol.for(`react.memo_cache_sentinel`)?(N=[`worktreeSubmodules`],r[11]=N):N=r[11];let P=f(N),F;r[12]===Symbol.for(`react.memo_cache_sentinel`)?(F=[`enableAgentBrowserAccess`],r[12]=F):F=r[12];let I=f(F),L;r[13]===Symbol.for(`react.memo_cache_sentinel`)?(L=[`defaultAutoPull`],r[13]=L):L=r[13];let R=f(L),z;r[14]===Symbol.for(`react.memo_cache_sentinel`)?(z=[`removeAgentCreditsOnMerge`],r[14]=z):z=r[14];let B=f(z),V;r[15]===Symbol.for(`react.memo_cache_sentinel`)?(V=[`pullRequestMergeMethod`],r[15]=V):V=r[15];let H=f(V),Fe;r[16]===Symbol.for(`react.memo_cache_sentinel`)?(Fe=[`defaultModelSelection`],r[16]=Fe):Fe=r[16];let Ie=fe(Fe),U=Ee.kind===`project`||Ee.kind===`checkout`,W=Me.length===0,Le;r[17]===_?Le=r[18]:(Le=_?ue(_.settings,null,null,null).settings:null,r[17]=_,r[18]=Le);let Re=Le,ze;r[19]!==x||r[20]!==b||r[21]!==v||r[22]!==je?(ze=function(e,ee){let n=x.find(t=>t.instanceId===e);for(let r of je){let re=b.find(e=>e.environmentId===r.environmentId),i=re?.serverConfig;if(!i)continue;let a=t(ne(i.providers),r.settings,r.projectId).find(t=>t.instanceId===e),ie=te(ce(r.settings,v),i.providers).get(e);if(!a?.enabled||!a.isAvailable||a.driverKind!==n?.driverKind||!ie?.some(e=>e.slug===ee&&!e.isUnavailable))return`This model is unavailable on ${re?.label??`a selected environment`}. Select that environment to choose its model separately.`}return null},r[19]=x,r[20]=b,r[21]=v,r[22]=je,r[23]=ze):ze=r[23];let G=ze,Be;r[24]!==G||r[25]!==y?(Be=e=>{let t=e?G(e.instanceId,e.model):null;if(t){oe.add({type:`error`,title:`Default model not saved`,description:t});return}y({defaultModelSelection:e})},r[24]=G,r[25]=y,r[26]=Be):Be=r[26];let K=Be,Ve;r[27]===Symbol.for(`react.memo_cache_sentinel`)?(Ve=[`defaultModelSelection`],r[27]=Ve):Ve=r[27];let He=U?`Model for new threads in this project.`:`Default model for new threads. Projects can override it.`,Ue=W||O||Ie===`project`?void 0:v.defaultModelSelection===null?`Automatic`:void 0,q;r[28]!==K||r[29]!==v.defaultModelSelection?(q=v.defaultModelSelection===null?null:(0,g.jsx)(m,{label:`default model`,onClick:()=>K(null)}),r[28]=K,r[29]=v.defaultModelSelection,r[30]=q):q=r[30];let J;r[31]!==E||r[32]!==x||r[33]!==O||r[34]!==G||r[35]!==S||r[36]!==Ne||r[37]!==C||r[38]!==w||r[39]!==K||r[40]!==v.planModeEnabled?(J=w&&E?(0,g.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center justify-end gap-1.5`,children:[(0,g.jsx)(be,{environmentId:C?.environmentId??null,activeInstanceId:w.instanceId,model:w.model,lockedProvider:null,instanceEntries:x,modelOptionsByInstance:S,triggerClassName:he,...O?{triggerLabel:`Mixed`}:{},getModelDisabledReason:G,onOpenProviderSetup:e=>{C&&Ne({to:`/settings/providers`,search:{environmentId:C.environmentId,instanceId:e}})},onInstanceModelChange:(e,t)=>K(ie(e,t))}),O?null:(0,g.jsx)(i,{provider:E.driverKind,models:E.models,model:w.model,prompt:``,onPromptChange:Ae,modelOptions:w.options??[],allowPromptInjectedEffort:!1,planModeEnabled:v.planModeEnabled,triggerClassName:he,onModelOptionsChange:e=>K(ie(w.instanceId,w.model,e))})]}):(0,g.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`No providers available`}),r[31]=E,r[32]=x,r[33]=O,r[34]=G,r[35]=S,r[36]=Ne,r[37]=C,r[38]=w,r[39]=K,r[40]=v.planModeEnabled,r[41]=J):J=r[41];let We;r[42]!==O||r[43]!==He||r[44]!==Ue||r[45]!==q||r[46]!==J?(We=(0,g.jsx)(p,{serverScoped:!0,settingKeys:Ve,mixed:O,id:`default-model`,title:`Model`,description:He,status:Ue,resetAction:q,control:J}),r[42]=O,r[43]=He,r[44]=Ue,r[45]=q,r[46]=J,r[47]=We):We=r[47];let Ge=We,Ke;r[48]===Symbol.for(`react.memo_cache_sentinel`)?(Ke=[`defaultThreadEnvMode`],r[48]=Ke):Ke=r[48];let qe;r[49]===Symbol.for(`react.memo_cache_sentinel`)?(qe=h(`new-threads`),r[49]=qe):qe=r[49];let Je=U?`Where new threads in this project start.`:`Where new threads start. Projects and their p4.json can override it.`,Y;r[50]!==U||r[51]!==v.defaultThreadEnvMode||r[52]!==y?(Y=!U&&v.defaultThreadEnvMode!==null?(0,g.jsx)(m,{label:`default workspace`,onClick:()=>y({defaultThreadEnvMode:null})}):null,r[50]=U,r[51]=v.defaultThreadEnvMode,r[52]=y,r[53]=Y):Y=r[53];let Ye=M?null:Re?.defaultThreadEnvMode??null,X;r[54]===y?X=r[55]:(X=e=>{(e===`local`||e===`worktree`)&&y({defaultThreadEnvMode:e})},r[54]=y,r[55]=X);let Z;r[56]===W?Z=r[57]:(Z=(0,g.jsx)(l,{size:`sm`,"aria-label":`Default workspace`,children:(0,g.jsx)(s,{children:e=>e===`local`||e===`worktree`?me(e):W?`Unavailable`:`Mixed`})}),r[56]=W,r[57]=Z);let Xe;r[58]===Symbol.for(`react.memo_cache_sentinel`)?(Xe=(0,g.jsx)(o,{value:`local`,children:me(`local`)}),r[58]=Xe):Xe=r[58];let Ze;r[59]===Symbol.for(`react.memo_cache_sentinel`)?(Ze=(0,g.jsxs)(c,{align:`end`,alignItemWithTrigger:!1,children:[Xe,(0,g.jsx)(o,{value:`worktree`,children:me(`worktree`)})]}),r[59]=Ze):Ze=r[59];let Q;r[60]!==Ye||r[61]!==X||r[62]!==Z?(Q=(0,g.jsxs)(u,{value:Ye,onValueChange:X,children:[Z,Ze]}),r[60]=Ye,r[61]=X,r[62]=Z,r[63]=Q):Q=r[63];let Qe;r[64]!==M||r[65]!==Je||r[66]!==Y||r[67]!==Q?(Qe=(0,g.jsx)(p,{serverScoped:!0,settingKeys:Ke,mixed:M,id:qe.id,title:`Workspace`,description:Je,resetAction:Y,control:Q}),r[64]=M,r[65]=Je,r[66]=Y,r[67]=Q,r[68]=Qe):Qe=r[68];let $e=Qe,et=a===`general`||a===`project`?`project-defaults`:a===`integrations`?`browser-access`:`source-control-defaults`,tt=a===`general`||a===`project`?`New threads`:a===`integrations`?`Browser`:`Repositories`,$;r[69]!==Pe||r[70]!==a||r[71]!==Re?.worktreeSubmodules||r[72]!==U||r[73]!==B||r[74]!==R||r[75]!==I||r[76]!==H||r[77]!==A||r[78]!==P||r[79]!==Ge||r[80]!==v.defaultAutoPull||r[81]!==v.defaultRuntimeMode||r[82]!==v.enableAgentBrowserAccess||r[83]!==v.pullRequestMergeMethod||r[84]!==v.removeAgentCreditsOnMerge||r[85]!==v.worktreeSubmodules||r[86]!==W||r[87]!==y||r[88]!==$e?($=a===`project`?(0,g.jsxs)(g.Fragment,{children:[Ge,$e]}):a===`general`?(0,g.jsxs)(g.Fragment,{children:[Ge,(0,g.jsx)(p,{serverScoped:!0,settingKeys:[`defaultRuntimeMode`],mixed:A,...h(`default-permissions`),description:U?`Permissions for new threads in this project.`:`Default permissions for new threads. Projects can override them.`,resetAction:v.defaultRuntimeMode===n.defaultRuntimeMode?null:(0,g.jsx)(m,{label:`default permissions`,onClick:()=>y({defaultRuntimeMode:n.defaultRuntimeMode})}),control:(0,g.jsxs)(u,{value:A?null:v.defaultRuntimeMode,onValueChange:e=>{e&&y({defaultRuntimeMode:e})},children:[(0,g.jsxs)(l,{size:`sm`,"aria-label":`Default permissions`,children:[!A&&(0,g.jsx)(Pe,{className:`size-3.5 shrink-0 text-muted-foreground`}),(0,g.jsx)(s,{children:A?`Mixed`:Se[v.defaultRuntimeMode].label})]}),(0,g.jsx)(c,{align:`end`,alignItemWithTrigger:!1,children:xe.map(ke)})]})}),$e,(0,g.jsx)(p,{serverScoped:!0,settingKeys:[`worktreeSubmodules`],mixed:P,...h(`worktree-submodules`),description:U?`How new worktrees in this project populate git submodules.`:`How new worktrees populate git submodules. Projects and their p4.json can override it.`,resetAction:!U&&v.worktreeSubmodules!==null?(0,g.jsx)(m,{label:`worktree submodules`,onClick:()=>y({worktreeSubmodules:null})}):null,control:(0,g.jsxs)(u,{value:P?null:Re?.worktreeSubmodules??null,onValueChange:e=>{Te(e)&&y({worktreeSubmodules:e})},children:[(0,g.jsx)(l,{size:`sm`,"aria-label":`Worktree submodules`,children:(0,g.jsx)(s,{children:e=>Te(e)?ge[e]:W?`Unavailable`:`Mixed`})}),(0,g.jsx)(c,{align:`end`,alignItemWithTrigger:!1,children:we.map(Oe)})]})})]}):a===`source-control`?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(p,{serverScoped:!0,settingKeys:[`defaultAutoPull`],mixed:R,id:`automatic-pull`,title:`Automatically pull`,description:U?`Keeps this project's default branch current when the checkout has no local changes or commits.`:`Keeps the default branch current when the checkout has no local changes or commits. Projects can override it.`,resetAction:v.defaultAutoPull?(0,g.jsx)(m,{label:`default automatic pull`,tooltip:`Reset automatic pull to off`,onClick:()=>y({defaultAutoPull:!1})}):null,control:(0,g.jsx)(ye,{"aria-label":`Default automatic pull`,mixed:R,checked:!R&&v.defaultAutoPull,onCheckedChange:e=>y({defaultAutoPull:e})})}),(0,g.jsx)(p,{serverScoped:!0,settingKeys:[`removeAgentCreditsOnMerge`],mixed:B,...h(`remove-agent-credits-on-merge`),description:`Remove recognized agent credit lines from GitHub merge and squash messages, keeping human co-authors. Includes auto-merge. Excludes merge queues, stack merges, and existing commits.`,resetAction:v.removeAgentCreditsOnMerge?(0,g.jsx)(m,{label:`agent credit removal`,tooltip:`Keep agent credits`,onClick:()=>y({removeAgentCreditsOnMerge:!1})}):null,control:(0,g.jsx)(ye,{"aria-label":`Remove agent credits when merging`,mixed:B,checked:!B&&v.removeAgentCreditsOnMerge,onCheckedChange:e=>y({removeAgentCreditsOnMerge:e})})}),(0,g.jsx)(p,{serverScoped:!0,settingKeys:[`pullRequestMergeMethod`],mixed:H,...h(`pull-request-merge-method`),description:U?`Pull requests in this project start with this method.`:`Pull requests start with this method. Last selected reuses whatever you chose most recently on this device.`,resetAction:v.pullRequestMergeMethod===null?null:(0,g.jsx)(m,{label:`default merge method`,tooltip:`Reset to last selected`,onClick:()=>y({pullRequestMergeMethod:null})}),control:(0,g.jsxs)(u,{value:H?null:v.pullRequestMergeMethod??`last`,onValueChange:e=>{e===`last`?y({pullRequestMergeMethod:null}):(e===`merge`||e===`squash`||e===`rebase`)&&y({pullRequestMergeMethod:e})},children:[(0,g.jsx)(l,{size:`sm`,"aria-label":`Default pull request merge method`,children:(0,g.jsx)(s,{children:De})}),(0,g.jsxs)(c,{align:`end`,alignItemWithTrigger:!1,children:[(0,g.jsx)(o,{value:`last`,children:`Last selected`}),(0,g.jsx)(o,{value:`merge`,children:d.merge}),(0,g.jsx)(o,{value:`squash`,children:d.squash}),(0,g.jsx)(o,{value:`rebase`,children:d.rebase})]})]})})]}):(0,g.jsx)(g.Fragment,{children:(0,g.jsx)(p,{serverScoped:!0,settingKeys:[`enableAgentBrowserAccess`],mixed:I,id:h(`agent-browser-access`).id,title:`Agent browser access`,description:U?`Allow agents in this project to use the shared browser. Applies when the agent session next starts.`:`Allow agents to use the shared browser. Projects can override it.`,resetAction:v.enableAgentBrowserAccess===n.enableAgentBrowserAccess?null:(0,g.jsx)(m,{label:`default browser access`,onClick:()=>y({enableAgentBrowserAccess:n.enableAgentBrowserAccess})}),control:(0,g.jsx)(ye,{"aria-label":`Agent browser access`,mixed:I,checked:!I&&v.enableAgentBrowserAccess,onCheckedChange:e=>y({enableAgentBrowserAccess:e})})})}),r[69]=Pe,r[70]=a,r[71]=Re?.worktreeSubmodules,r[72]=U,r[73]=B,r[74]=R,r[75]=I,r[76]=H,r[77]=A,r[78]=P,r[79]=Ge,r[80]=v.defaultAutoPull,r[81]=v.defaultRuntimeMode,r[82]=v.enableAgentBrowserAccess,r[83]=v.pullRequestMergeMethod,r[84]=v.removeAgentCreditsOnMerge,r[85]=v.worktreeSubmodules,r[86]=W,r[87]=y,r[88]=$e,r[89]=$):$=r[89];let nt;return r[90]!==et||r[91]!==tt||r[92]!==$?(nt=(0,g.jsx)(_e,{id:et,title:tt,children:$}),r[90]=et,r[91]=tt,r[92]=$,r[93]=nt):nt=r[93],nt}function De(e){return e===`merge`||e===`squash`||e===`rebase`?d[e]:e===`last`?`Last selected`:`Mixed`}function Oe(e){return(0,g.jsx)(o,{value:e,children:ge[e]},e)}function ke(e){let t=Se[e],ee=t.icon;return(0,g.jsx)(o,{value:e,className:`min-w-64`,children:(0,g.jsxs)(`div`,{className:`grid gap-0.5`,children:[(0,g.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 font-medium`,children:[(0,g.jsx)(ee,{className:`size-3.5 shrink-0 text-muted-foreground`}),t.label]}),(0,g.jsx)(`span`,{className:`text-xs leading-4 text-muted-foreground`,children:t.description})]})},e)}function Ae(){}export{Ee as t};
|
|
2
|
-
//# sourceMappingURL=ProjectDefaultsSettings-BRRQlvgR.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{ma as n,or as r,t as i,ud as a,wx as o,yh as s}from"./utils-DmS758az.js";import{n as ee,t as c}from"./toggle-group-_C7nJPTT.js";import{t as l}from"./input-u5qjnfMr.js";import{t as u}from"./scroll-area-CsrtHuL8.js";import{a as te,c as ne,i as d,o as re,r as ie,s as ae,t as oe}from"./dialog-DhJeevKt.js";import{n as f,r as se,t as ce}from"./ProjectMonogram-um8sYqIi.js";import{DynamicIcon as le,t as p}from"./dynamic-R3OtJZHK.js";var m=o();function h(e){return e.normalize(`NFKC`).trim()}function g(e){let t=h(e).match(/[\p{L}\p{N}]+/gu)??[],n=t[0];if(!n)return`PR`;let r=Array.from(n),i=r[0]??`P`,a=r.slice(1).find(e=>/\p{N}/u.test(e))??(t.length>1?Array.from(t.at(-1)??``)[0]:r.at(-1))??i;return Array.from(`${i}${a}`.toUpperCase()).slice(0,2).join(``)}function _(e){let t=h(e).toLocaleLowerCase(`en-US`)||`project`,n=0;for(let e of t)n=(n*31+(e.codePointAt(0)??0))%f.length;return f[n]?.value??`blue`}function v(e){return{monogram:g(e),color:_(e)}}var y=e(t(),1),b=[`folder-code`,`code-2`,`terminal`,`globe-2`,`server`,`database`,`bot`,`sparkles`,`smartphone`,`monitor`,`cloud-cog`,`package`,`book-open`,`flask-conical`,`shield-check`,`rocket`,`gamepad-2`,`music`,`image`,`shopping-bag`,`git-branch`,`workflow`,`wrench`,`layers-3`],ue=[{emoji:`💻`,label:`Computer`},{emoji:`🛠️`,label:`Tools`},{emoji:`🚀`,label:`Rocket`},{emoji:`🤖`,label:`Robot`},{emoji:`✨`,label:`Sparkles`},{emoji:`⚡`,label:`Lightning`},{emoji:`🌐`,label:`Web`},{emoji:`📱`,label:`Mobile`},{emoji:`🖥️`,label:`Desktop`},{emoji:`⌨️`,label:`Keyboard`},{emoji:`⚙️`,label:`Gear`},{emoji:`🗄️`,label:`Database`},{emoji:`☁️`,label:`Cloud`},{emoji:`📦`,label:`Package`},{emoji:`📚`,label:`Books`},{emoji:`🧪`,label:`Test tube`},{emoji:`🔒`,label:`Lock`},{emoji:`🎮`,label:`Game`},{emoji:`🎵`,label:`Music`},{emoji:`🎬`,label:`Movie`},{emoji:`🖼️`,label:`Picture`},{emoji:`🛍️`,label:`Shopping`},{emoji:`🔥`,label:`Fire`},{emoji:`💡`,label:`Idea`},{emoji:`🧩`,label:`Puzzle`},{emoji:`📊`,label:`Chart`},{emoji:`🧠`,label:`Brain`},{emoji:`🦄`,label:`Unicorn`},{emoji:`🐙`,label:`Octopus`},{emoji:`🌱`,label:`Seedling`}];function de(e){let t=e.trim().toLowerCase().replaceAll(/\s+/g,`-`);return t?p.filter(e=>e.includes(t)).slice(0,60):b}function fe(e){let t=e.trim();if(!t)return null;let n=new Intl.Segmenter(void 0,{granularity:`grapheme`}).segment(t)[Symbol.iterator]().next().value?.segment,r=/^\p{Regional_Indicator}{2}$/u.test(n??``),i=/^[#*0-9]\uFE0F?\u20E3$/u.test(n??``);return!n||!/\p{Extended_Pictographic}/u.test(n)&&!r&&!i?null:n}var x=e(n(),1),pe=`folder-code`,me=s(a);function he(e){return e.split(`-`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}function S(e){let t=(0,m.c)(84),{current:n,projectName:a,open:o,onOpenChange:s,onSelect:p}=e,h;t[0]===a?h=t[1]:(h=v(a),t[0]=a,t[1]=h);let g=h,[_,b]=(0,y.useState)(n?.kind??`lucide`),[S,ge]=(0,y.useState)(n?.kind===`lucide`?n.name:pe),[C,_e]=(0,y.useState)(n&&n.kind!==`emoji`?n.color:g.color),[w,T]=(0,y.useState)(n?.kind===`monogram`?n.text:g.monogram),[E,D]=(0,y.useState)(n?.kind===`emoji`?n.emoji:`💻`),[O,ve]=(0,y.useState)(``),[k,ye]=(0,y.useState)(``),be=(0,y.useRef)(!1),A,j;t[2]!==g.color||t[3]!==g.monogram||t[4]!==n||t[5]!==o?(A=()=>{o&&!be.current&&(b(n?.kind??`lucide`),ge(n?.kind===`lucide`?n.name:pe),_e(n&&n.kind!==`emoji`?n.color:g.color),T(n?.kind===`monogram`?n.text:g.monogram),D(n?.kind===`emoji`?n.emoji:`💻`),ve(``),ye(``)),be.current=o},j=[n,o,g.color,g.monogram],t[2]=g.color,t[3]=g.monogram,t[4]=n,t[5]=o,t[6]=A,t[7]=j):(A=t[6],j=t[7]),(0,y.useEffect)(A,j);let M;t[8]===O?M=t[9]:(M=de(O),t[8]=O,t[9]=M);let N=M,P,F,I,L,R,z,B,V,H,U,W,G,K;if(t[10]!==g.monogram||t[11]!==C||t[12]!==k||t[13]!==E||t[14]!==S||t[15]!==N||t[16]!==w||t[17]!==_||t[18]!==s||t[19]!==p||t[20]!==o||t[21]!==O){let e=se(C),n,r;t[35]===w?(n=t[36],r=t[37]):(n=w.normalize(`NFKC`).trim().toUpperCase(),r=me(n),t[35]=w,t[36]=n,t[37]=r),K=r;let a;t[38]!==C||t[39]!==E||t[40]!==S||t[41]!==_||t[42]!==n||t[43]!==s||t[44]!==p||t[45]!==K?(a=()=>{(_!==`monogram`||K)&&(p(_===`monogram`?{kind:`monogram`,text:n,color:C}:_===`lucide`?{kind:`lucide`,name:S,color:C}:{kind:`emoji`,emoji:E}),s(!1))},t[38]=C,t[39]=E,t[40]=S,t[41]=_,t[42]=n,t[43]=s,t[44]=p,t[45]=K,t[46]=a):a=t[46],L=a,I=oe,z=o,B=s,F=ae,G=`w-full sm:w-[32rem]`,t[47]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,x.jsxs)(te,{children:[(0,x.jsx)(ne,{children:`Choose project icon`}),(0,x.jsx)(ie,{children:`Choose an icon, emoji, or monogram.`})]}),t[47]=R):R=t[47],P=re,V=`flex min-h-0 flex-col`;let d;t[48]===_?d=t[49]:(d=[_],t[48]=_,t[49]=d);let m,h,v,y;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(m=e=>{let t=e[0];(t===`lucide`||t===`emoji`||t===`monogram`)&&b(t)},h=(0,x.jsx)(c,{value:`lucide`,children:`Icons`}),v=(0,x.jsx)(c,{value:`emoji`,children:`Emoji`}),y=(0,x.jsx)(c,{value:`monogram`,children:`Monogram`}),t[50]=m,t[51]=h,t[52]=v,t[53]=y):(m=t[50],h=t[51],v=t[52],y=t[53]),t[54]===d?H=t[55]:(H=(0,x.jsxs)(ee,{"aria-label":`Icon type`,variant:`segmented`,value:d,onValueChange:m,children:[h,v,y]}),t[54]=d,t[55]=H),t[56]!==C||t[57]!==_?(U=_===`emoji`?null:(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`div`,{className:`mb-2 text-xs font-medium text-muted-foreground`,children:`Color`}),(0,x.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,role:`group`,"aria-label":`Icon color`,children:f.map(e=>(0,x.jsx)(`button`,{type:`button`,"aria-label":e.label,"aria-pressed":C===e.value,className:i(`flex size-6 items-center justify-center rounded-full border border-transparent outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,C===e.value&&`border-foreground/64`),onClick:()=>_e(e.value),children:(0,x.jsx)(`span`,{className:i(`size-4 rounded-full`,e.swatchClassName)})},e.value))})]}),t[56]=C,t[57]=_,t[58]=U):U=t[58],W=_===`lucide`?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(l,{type:`search`,value:O,"aria-label":`Search Lucide icons`,placeholder:`Search all Lucide icons`,onChange:e=>ve(e.currentTarget.value)}),(0,x.jsx)(u,{scrollFade:!0,className:`max-h-64`,children:(0,x.jsx)(`div`,{className:`grid grid-cols-8 gap-1 p-0.5 sm:grid-cols-10`,children:N.map(t=>(0,x.jsx)(`button`,{type:`button`,"aria-label":he(t),"aria-pressed":S===t,className:i(`flex aspect-square items-center justify-center rounded-md border border-transparent outline-none hover:bg-accent focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,S===t&&`border-border bg-accent`,e),onClick:()=>ge(t),children:(0,x.jsx)(le,{name:t,className:`size-5`})},t))})}),N.length===0?(0,x.jsx)(`p`,{className:`py-8 text-center text-sm text-muted-foreground`,children:`No icons found.`}):null]}):_===`monogram`?(0,x.jsxs)(`div`,{className:`flex items-center gap-4 py-2`,children:[(0,x.jsx)(ce,{text:K?n:g.monogram,color:C,className:`size-12`}),(0,x.jsxs)(`div`,{className:`flex-1 space-y-2`,children:[(0,x.jsx)(`label`,{htmlFor:`project-monogram`,className:`text-sm font-medium`,children:`Letters`}),(0,x.jsx)(l,{id:`project-monogram`,value:w,onChange:e=>T(e.currentTarget.value),"aria-describedby":`project-monogram-hint`,"aria-invalid":!K,autoComplete:`off`}),(0,x.jsx)(`p`,{id:`project-monogram-hint`,className:`text-xs text-muted-foreground`,children:`One or two letters or numbers.`})]})]}):(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(u,{scrollFade:!0,className:`max-h-64`,children:(0,x.jsx)(`div`,{className:`grid grid-cols-8 gap-1 p-0.5 sm:grid-cols-10`,children:ue.map(e=>(0,x.jsx)(`button`,{type:`button`,"aria-label":e.label,"aria-pressed":E===e.emoji,className:i(`flex aspect-square items-center justify-center rounded-md border border-transparent text-xl outline-none hover:bg-accent focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,E===e.emoji&&`border-border bg-accent`),onClick:()=>D(e.emoji),children:e.emoji},e.emoji))})}),(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`div`,{className:`mb-2 text-xs font-medium text-muted-foreground`,children:`Or paste any emoji`}),(0,x.jsx)(l,{value:k,"aria-label":`Custom emoji`,placeholder:`Paste an emoji`,onChange:e=>{let t=e.currentTarget.value;ye(t);let n=fe(t);n&&D(n)}})]})]}),t[10]=g.monogram,t[11]=C,t[12]=k,t[13]=E,t[14]=S,t[15]=N,t[16]=w,t[17]=_,t[18]=s,t[19]=p,t[20]=o,t[21]=O,t[22]=P,t[23]=F,t[24]=I,t[25]=L,t[26]=R,t[27]=z,t[28]=B,t[29]=V,t[30]=H,t[31]=U,t[32]=W,t[33]=G,t[34]=K}else P=t[22],F=t[23],I=t[24],L=t[25],R=t[26],z=t[27],B=t[28],V=t[29],H=t[30],U=t[31],W=t[32],G=t[33],K=t[34];let q;t[59]!==P||t[60]!==V||t[61]!==H||t[62]!==U||t[63]!==W?(q=(0,x.jsxs)(P,{className:V,children:[H,U,W]}),t[59]=P,t[60]=V,t[61]=H,t[62]=U,t[63]=W,t[64]=q):q=t[64];let J;t[65]===s?J=t[66]:(J=(0,x.jsx)(r,{variant:`outline`,onClick:()=>s(!1),children:`Cancel`}),t[65]=s,t[66]=J);let Y=_===`monogram`&&!K,X;t[67]!==L||t[68]!==Y?(X=(0,x.jsx)(r,{onClick:L,disabled:Y,children:`Save icon`}),t[67]=L,t[68]=Y,t[69]=X):X=t[69];let Z;t[70]!==J||t[71]!==X?(Z=(0,x.jsxs)(d,{children:[J,X]}),t[70]=J,t[71]=X,t[72]=Z):Z=t[72];let Q;t[73]!==F||t[74]!==R||t[75]!==q||t[76]!==Z||t[77]!==G?(Q=(0,x.jsxs)(F,{className:G,children:[R,q,Z]}),t[73]=F,t[74]=R,t[75]=q,t[76]=Z,t[77]=G,t[78]=Q):Q=t[78];let $;return t[79]!==I||t[80]!==z||t[81]!==B||t[82]!==Q?($=(0,x.jsx)(I,{open:z,onOpenChange:B,children:Q}),t[79]=I,t[80]=z,t[81]=B,t[82]=Q,t[83]=$):$=t[83],$}export{S as ProjectIconPickerDialog};
|
|
2
|
-
//# sourceMappingURL=ProjectIconPickerDialog-DXSyEGg8.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{Hr as n,It as r,Ns as i,Rt as a,Ta as o,Un as s,Ur as c,Ut as l,Vo as u,Wt as d,Xt as f,dn as p,dr as m,js as h,ma as g,or as _,sn as v,sr as y,t as b,um as x,un as S,vo as C,wx as w,yo as T}from"./utils-DmS758az.js";import{t as E}from"./check-Cmy7pM2Y.js";import{t as D}from"./chevron-right-NbahR9_s.js";import{t as O}from"./info-BHB-83EA.js";import{t as k}from"./sparkles-cStmYKbH.js";import{t as A}from"./star-DJ6Ycqv6.js";import{t as j}from"./x-CSwbgjBe.js";import{t as M}from"./zap-CrtYfJ8v.js";import{a as N,n as P,r as F,t as I}from"./tooltip-Df-4YKs5.js";import{t as L}from"./CompositeRoot-CW06ANMY.js";import{t as R}from"./useNavigate-BK_XZ1It.js";import{_ as z,d as B}from"./useSettings-CckatJFa.js";import{s as V}from"./server-B26doYv6.js";import{a as ee,n as te,r as ne,s as H,t as re}from"./combobox-DixSlhgy.js";import{n as ie}from"./scroll-area-CsrtHuL8.js";import{t as ae}from"./AnimatedHeight-PJxVEp27.js";import{g as oe,m as se,p as ce,v as le}from"./keybindings-CzL-fWkh.js";import{x as ue}from"./Icons-C12feMOO.js";import{i as de,o as fe,t as pe}from"./popover-6BYEGLLK.js";import{i as U,n as W,r as G,t as me}from"./alert-yllEf0yh.js";import{t as K}from"./semver-CFbvOQKc.js";import{t as q}from"./kbd-D4mDfHPa.js";import{b as he,t as J,y as Y}from"./ChatGptUsageButton-7IZqWaQq.js";import{gn as ge,hn as X,ls as _e,xn as ve,zr as ye}from"./main-D9z9rMK1.js";var Z=e(t(),1),be=w(),Q=e(g(),1);function xe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function $(e,t){let n=t?.trim();if(!n)return e;let r=RegExp(`^${xe(n)}(?:\\s*[.:/-]\\s*|\\s+)`,`iu`);return e.replace(r,``).trim()||e}function Se(e,t){let n=t?.preferShortName&&e.shortName?e.shortName:e.name;return h($(n,e.subProvider))}function Ce(e,t){let n=e.trim(),r=t?.trim();return r?n&&RegExp(`^${xe(n)}\\s+\\S`,`i`).test(r)?r:`${e} · ${r}`:e}function we(e){return Se(e,{preferShortName:!0})}function Te(e){return we(e)}var Ee={claudeAgent:`Claude Code`,codex:`the Codex CLI`};function De(e){return e.length<=2?e.join(` and `):`${e.slice(0,-1).join(`, `)}, and ${e[e.length-1]}`}function Oe(e,t=``){let n=t.trim().toLocaleLowerCase(),r=(e.updateRequiredModels??[]).filter(e=>n.length===0||e.name.toLocaleLowerCase().includes(n)||e.slug.toLocaleLowerCase().includes(n));if(r.length===0)return null;let i=r.map(e=>e.minVersion).reduce((e,t)=>K(t,e)>0?t:e);return`Update ${Ee[e.driver]??x[e.driver]??e.driver} to ${i.startsWith(`v`)?i:`v${i}`} or newer to use ${De(r.map(e=>e.name))}.`}var ke=`model:`,Ae=`legacy-models:`;function je(e,t){return`${ke}${e.length}:${e}${t}`}function Me(e){if(!e.startsWith(ke))return null;let t=e.slice(6),n=t.indexOf(`:`);if(n===-1)return null;let r=t.slice(0,n);if(!/^\d+$/.test(r))return null;let i=Number(r),a=t.slice(n+1);return!Number.isSafeInteger(i)||i>a.length?null:{instanceId:a.slice(0,i),slug:a.slice(i)}}function Ne(e){return`${Ae}${e}`}function Pe(e){return e.startsWith(Ae)?e.slice(14):null}var Fe=(0,Z.memo)(function(e){let t=(0,be.c)(71),n;t[0]!==e.model.subProvider||t[1]!==e.providerDisplayName?(n=Ce(e.providerDisplayName,e.model.subProvider),t[0]=e.model.subProvider,t[1]=e.providerDisplayName,t[2]=n):n=t[2];let r=n,i=e.index,a;t[3]!==e.instanceId||t[4]!==e.model.slug?(a=je(e.instanceId,e.model.slug),t[3]=e.instanceId,t[4]=e.model.slug,t[5]=a):a=t[5];let o=!!e.disabledReason,c=e.disabledReason&&`data-disabled:pointer-events-auto data-disabled:cursor-not-allowed`,l;t[6]===c?l=t[7]:(l=b(`group relative w-full !min-w-0 max-w-full cursor-pointer`,c),t[6]=c,t[7]=l);let u;t[8]!==e.model||t[9]!==e.preferShortName||t[10]!==e.useTriggerLabel?(u=e.useTriggerLabel?Te(e.model):Se(e.model,e.preferShortName?{preferShortName:!0}:void 0),t[8]=e.model,t[9]=e.preferShortName,t[10]=e.useTriggerLabel,t[11]=u):u=t[11];let d;t[12]===u?d=t[13]:(d=(0,Q.jsx)(`div`,{className:`min-w-0 truncate text-xs font-medium leading-snug`,children:u}),t[12]=u,t[13]=d);let f;t[14]===e.showNewBadge?f=t[15]:(f=e.showNewBadge?(0,Q.jsx)(`span`,{className:`shrink-0 rounded border border-update/35 bg-update/15 px-0.5 py-px text-3xs font-bold uppercase leading-none tracking-wide text-update-foreground`,"aria-label":`New model`,children:`New`}):null,t[14]=e.showNewBadge,t[15]=f);let p;t[16]===e.unavailable?p=t[17]:(p=e.unavailable?(0,Q.jsx)(s,{variant:`outline`,size:`sm`,children:`Unavailable`}):null,t[16]=e.unavailable,t[17]=p);let m;t[18]!==d||t[19]!==f||t[20]!==p?(m=(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[d,f,p]}),t[18]=d,t[19]=f,t[20]=p,t[21]=m):m=t[21];let h;t[22]!==e.acpRegistryAgentId||t[23]!==e.acpRegistryIconUrl||t[24]!==e.driverKind||t[25]!==e.providerDisplayName||t[26]!==e.showProvider||t[27]!==r?(h=e.showProvider&&(0,Q.jsxs)(`div`,{className:`mt-1 flex items-center gap-1.5`,children:[(0,Q.jsx)(he,{driverKind:e.driverKind,displayName:e.providerDisplayName,acpRegistryAgentId:e.acpRegistryAgentId,acpRegistryIconUrl:e.acpRegistryIconUrl,className:`size-3`,iconClassName:`size-3`}),(0,Q.jsx)(`span`,{className:`truncate text-xs font-normal leading-snug text-muted-foreground/70`,children:r})]}),t[22]=e.acpRegistryAgentId,t[23]=e.acpRegistryIconUrl,t[24]=e.driverKind,t[25]=e.providerDisplayName,t[26]=e.showProvider,t[27]=r,t[28]=h):h=t[28];let g;t[29]!==m||t[30]!==h?(g=(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1 text-left`,children:[m,h]}),t[29]=m,t[30]=h,t[31]=g):g=t[31];let v;t[32]!==e.isSelected||t[33]!==e.showSelection?(v=e.showSelection&&e.isSelected?(0,Q.jsx)(E,{className:`size-3.5`,"aria-hidden":`true`}):null,t[32]=e.isSelected,t[33]=e.showSelection,t[34]=v):v=t[34];let y;t[35]===e.jumpLabel?y=t[36]:(y=e.jumpLabel?(0,Q.jsx)(q,{children:e.jumpLabel}):null,t[35]=e.jumpLabel,t[36]=y);let x;t[37]===e?x=t[38]:(x=t=>{t.stopPropagation(),e.onToggleFavorite()},t[37]=e,t[38]=x);let S=!!e.disabledReason,C=e.isFavorite?`Remove from favorites`:`Add to favorites`,w=e.isFavorite&&`fill-current text-warning`,T;t[39]===w?T=t[40]:(T=b(`size-3.5 sm:size-3`,w),t[39]=w,t[40]=T);let D;t[41]===T?D=t[42]:(D=(0,Q.jsx)(A,{className:T}),t[41]=T,t[42]=D);let O;t[43]!==x||t[44]!==S||t[45]!==C||t[46]!==D?(O=(0,Q.jsx)(N,{render:(0,Q.jsx)(_,{size:`icon-xs`,variant:`ghost-muted`,className:`-mr-1 shrink-0`,onClick:x,onKeyDown:Ie,disabled:S,"aria-label":C,children:D})}),t[43]=x,t[44]=S,t[45]=C,t[46]=D,t[47]=O):O=t[47];let k=e.isFavorite?`Remove from favorites`:`Add to favorites`,j;t[48]===k?j=t[49]:(j=(0,Q.jsx)(P,{side:`top`,align:`center`,children:k}),t[48]=k,t[49]=j);let M;t[50]!==O||t[51]!==j?(M=(0,Q.jsxs)(I,{children:[O,j]}),t[50]=O,t[51]=j,t[52]=M):M=t[52];let F;t[53]!==v||t[54]!==y||t[55]!==M?(F=(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[v,y,M]}),t[53]=v,t[54]=y,t[55]=M,t[56]=F):F=t[56];let L;t[57]!==e.index||t[58]!==g||t[59]!==a||t[60]!==F||t[61]!==o||t[62]!==l?(L=(0,Q.jsxs)(ne,{hideIndicator:!0,index:i,value:a,disabled:o,className:l,children:[g,F]}),t[57]=e.index,t[58]=g,t[59]=a,t[60]=F,t[61]=o,t[62]=l,t[63]=L):L=t[63];let R=L;if(!e.disabledReason)return R;let z;t[64]===R?z=t[65]:(z=(0,Q.jsx)(N,{render:R}),t[64]=R,t[65]=z);let B;t[66]===e.disabledReason?B=t[67]:(B=(0,Q.jsx)(P,{side:`left`,align:`center`,children:e.disabledReason}),t[66]=e.disabledReason,t[67]=B);let V;return t[68]!==z||t[69]!==B?(V=(0,Q.jsxs)(I,{children:[z,B]}),t[68]=z,t[69]=B,t[70]=V):V=t[70],V});function Ie(e){e.stopPropagation()}var Le=Z.forwardRef(function(e,t){let{disabled:r=!1,loopFocus:i=!0,orientation:a=`horizontal`,className:o,render:s,style:c,...l}=e,[u,d]=Z.useState(()=>new Map),f=Z.useMemo(()=>{let e=[];for(let t of u.values())t?.index&&!t.focusableWhenDisabled&&e.push(t.index);return e},[u]),p=Z.useMemo(()=>({disabled:r,orientation:a,setItemMap:d}),[r,a,d]),m={disabled:r,orientation:a},h={"aria-orientation":a,role:`toolbar`};return(0,Q.jsx)(n.Provider,{value:p,children:(0,Q.jsx)(L,{render:s,className:o,style:c,state:m,refs:[t],props:[h,l],disabledIndices:f,loopFocus:i,onMapChange:d,orientation:a})})}),Re=Z.createContext(void 0);function ze(e){let t=Z.useContext(Re);if(t===void 0&&!e)throw Error(C(68));return t}var Be=Z.forwardRef(function(e,t){let{className:n,disabled:r=!1,focusableWhenDisabled:i=!0,render:a,nativeButton:s=!0,style:l,...u}=e,d=Z.useMemo(()=>({focusableWhenDisabled:i}),[i]),{disabled:f,orientation:p}=c(),h=ze(!0),g=f||(h?.disabled??!1)||r,{getButtonProps:_,buttonRef:v}=o({disabled:g,focusableWhenDisabled:i,native:s});return(0,Q.jsx)(m,{tag:`button`,render:a,className:n,style:l,metadata:d,state:{disabled:g,orientation:p,focusable:i},refs:[t,v],props:[u,{disabled:g},_]})});function Ve(e){let t=e.displayName;if(!e.enabled||e.status===`disabled`)return`${t} — Disabled in settings.`;if(e.status===`ready`&&e.isAvailable)return t;let n=e.status===`error`?`Unavailable`:e.status===`warning`?`Limited`:`Not ready`,r=e.snapshot.message?.trim();return r?`${t} — ${n}. ${r}`:`${t} — ${n}.`}var He=`pointer-events-none absolute -right-1 top-1/2 z-10 h-5 w-0.75 -translate-y-1/2 rounded-l-full bg-primary`,Ue=`pointer-events-none absolute -right-0.5 top-0.5 z-10 flex size-3.5 items-center justify-center rounded-full bg-transparent shadow-sm text-update-foreground `,We=`left`,Ge=8,Ke=(0,Z.memo)(function(e){let t=(0,be.c)(27),n;t[0]===e?n=t[1]:(n=t=>{e.onSelectInstance(t)},t[0]=e,t[1]=n);let r=n,i=e.showFavorites??!0,[a,o]=(0,Z.useState)(null),s=(0,Z.useRef)(null),[c,u]=(0,Z.useState)(null),d;t[2]===e.selectedInstanceId?d=t[3]:(d=()=>{let t=s.current;if(!t)return;let n=Array.from(t.querySelectorAll(`[data-model-picker-provider]`)).find(t=>t.dataset.modelPickerProvider===e.selectedInstanceId);if(!n){u(null);return}u(n.offsetTop+n.offsetHeight/2-10)},t[2]=e.selectedInstanceId,t[3]=d);let p;t[4]!==e.instanceEntries||t[5]!==e.selectedInstanceId||t[6]!==i?(p=[e.instanceEntries,e.selectedInstanceId,i],t[4]=e.instanceEntries,t[5]=e.selectedInstanceId,t[6]=i,t[7]=p):p=t[7],(0,Z.useLayoutEffect)(d,p);let m;t[8]===e?m=t[9]:(m=t=>{if(!(t.altKey||t.ctrlKey||t.metaKey||t.shiftKey)&&t.key===`ArrowRight`){t.preventDefault(),e.onFocusSearch();return}},t[8]=e,t[9]=m);let h;t[10]===c?h=t[11]:(h=c===null?null:(0,Q.jsx)(`div`,{"data-model-picker-selected-indicator":`true`,className:b(He,`right-0 translate-y-0 transition-[top] duration-200 ease-out`),style:{top:c}}),t[10]=c,t[11]=h);let g;t[12]!==r||t[13]!==e.selectedInstanceId||t[14]!==i?(g=i?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`relative w-full`,"data-model-picker-provider":`favorites`,children:(0,Q.jsxs)(I,{children:[(0,Q.jsx)(N,{render:(0,Q.jsx)(Be,{className:b(`relative isolate flex w-full cursor-pointer aspect-square items-center justify-center rounded-md transition-colors hover:bg-foreground/10 focus-visible:bg-foreground/10 focus-visible:outline-none`),onClick:()=>r(`favorites`),type:`button`,"aria-label":`Favorites`,"aria-pressed":e.selectedInstanceId===`favorites`,children:(0,Q.jsx)(A,{className:`size-5 fill-current shrink-0`,"aria-hidden":!0})})}),(0,Q.jsx)(P,{side:We,sideOffset:Ge,align:`center`,children:`Favorites`})]})}),(0,Q.jsx)(`div`,{className:`border-b border-border/70`,"aria-hidden":`true`})]}):null,t[12]=r,t[13]=e.selectedInstanceId,t[14]=i,t[15]=g):g=t[15];let _;t[16]!==r||t[17]!==a||t[18]!==e?(_=e.instanceEntries.map(t=>{let n=!l(t),i=e.disabledInstanceIds?.has(t.instanceId)??!1,s=e.selectableUnavailableInstanceIds?.has(t.instanceId)??!1,c=n&&!s||i,u=e.selectedInstanceId===t.instanceId,d=a===t.instanceId,p=e.newBadgeInstanceIds?.has(t.instanceId)??!1,m=f(t,e.instanceEntries),h=n?Ve(t):i?e.getDisabledInstanceTooltip?.(t)??t.displayName:p?`${t.displayName} — New`:t.displayName,g=(0,Q.jsxs)(Be,{className:b(`relative isolate flex w-full cursor-pointer aspect-square items-center justify-center rounded-md transition-colors hover:bg-foreground/10 focus-visible:bg-foreground/10 focus-visible:outline-none`,c&&`opacity-50 cursor-not-allowed hover:bg-transparent`),"data-provider-accent-color":t.accentColor,onClick:()=>!c&&r(t.instanceId),onMouseEnter:()=>o(t.instanceId),onMouseLeave:()=>o(e=>e===t.instanceId?null:e),onFocus:()=>o(t.instanceId),onBlur:()=>o(e=>e===t.instanceId?null:e),disabled:c,focusableWhenDisabled:!c,"aria-pressed":u,type:`button`,"aria-label":n||i?h:p?`${t.displayName}, new`:t.displayName,children:[(0,Q.jsx)(he,{driverKind:t.driverKind,displayName:t.displayName,accentColor:t.accentColor,acpRegistryAgentId:t.acpRegistryAgentId,acpRegistryIconUrl:t.acpRegistryIconUrl,showBadge:m,className:`size-6 z-30`,iconClassName:`size-5`,indicatorBackground:d&&!c?`var(--muted)`:u?`var(--background)`:`color-mix(in oklab, var(--muted) 30%, transparent)`,...t.accentColor?{badgeClassName:`h-3 min-w-3 px-0.5 text-5xs`}:{}}),p?(0,Q.jsx)(`span`,{className:Ue,"aria-hidden":!0,children:(0,Q.jsx)(k,{className:`size-2`})}):null]}),_=c?(0,Q.jsx)(`span`,{className:`relative block w-full`,children:g}):g;return(0,Q.jsx)(`div`,{className:`relative w-full`,"data-model-picker-provider":t.instanceId,children:(0,Q.jsxs)(I,{children:[(0,Q.jsx)(N,{render:_}),(0,Q.jsx)(P,{side:We,sideOffset:Ge,align:`center`,children:h})]})},t.instanceId)}),t[16]=r,t[17]=a,t[18]=e,t[19]=_):_=t[19];let v;t[20]!==h||t[21]!==g||t[22]!==_?(v=(0,Q.jsx)(`div`,{className:`h-full overflow-y-auto overscroll-contain [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden`,children:(0,Q.jsxs)(`div`,{ref:s,className:`relative flex min-h-full flex-col gap-1 p-1`,children:[h,g,_]})}),t[20]=h,t[21]=g,t[22]=_,t[23]=v):v=t[23];let y;return t[24]!==m||t[25]!==v?(y=(0,Q.jsx)(Le,{className:`w-11 shrink-0 overflow-hidden bg-muted/30`,"data-model-picker-sidebar":`true`,"aria-label":`Providers`,orientation:`vertical`,onKeyDown:m,children:v}),t[24]=m,t[25]=v,t[26]=y):y=t[26],y});function qe(e){let t=e.compatibilityAdvisory;return e.status===`error`&&e.auth.status===`unauthenticated`?null:t?.status===`broken`||e.status===`ready`&&t?.status===`unsupported`?t:null}function Je(e){if(!e||e.status===`disabled`)return null;let t=qe(e);return t?[e.instanceId,t.status,e.version??``,t.message??``].join(`\0`):e.status===`ready`||e.driver===`antigravity`&&e.installed&&e.status===`warning`&&e.auth.status===`unknown`?null:[e.instanceId,e.status,e.auth.status,e.message??``].join(`\0`)}function Ye(e,t){let n=Je(e);return n!==null&&n!==t}function Xe(e){return e.driver===`antigravity`||e.setup?.canAuthenticate===!0||e.setup?.canInstall===!0}function Ze(e){if(e.auth.status!==`unauthenticated`&&e.compatibilityAdvisory?.status===`broken`&&e.compatibilityAdvisory.message)return e.compatibilityAdvisory.message;if(e.message)return e.message;let t=e.displayName?.trim()||T(e.driver);return!e.installed&&Xe(e)?`Open provider setup to install ${T(e.driver)} on this environment.`:e.auth.status===`unauthenticated`?Xe(e)?e.driver===`antigravity`?`Open provider setup to sign in with Google.`:`Open provider setup to sign in.`:`Sign in via the CLI to authenticate again.`:e.status===`ready`?`No models are available for this provider.`:e.status===`error`?`${t} provider is unavailable.`:`${t} provider has limited availability.`}var Qe=(0,Z.memo)(function(e){let t=(0,be.c)(30),{onDismiss:n,onOpenProviderSetup:r,status:i}=e;if(!i||Je(i)===null)return null;let a;t[0]!==i.displayName||t[1]!==i.driver?(a=i.displayName?.trim()||T(i.driver),t[0]=i.displayName,t[1]=i.driver,t[2]=a):a=t[2];let o=a,s=i.status===`error`&&i.auth.status===`unauthenticated`,c;t[3]===i?c=t[4]:(c=qe(i),t[3]=i,t[4]=c);let l=c,u=s?`${o} is unauthenticated`:l?`${o} ${i.version??``} is ${l.status===`broken`?`known to be broken`:`unsupported`}`:`${o} provider status`,d;t[5]!==l?.message||t[6]!==i?(d=l?.message??Ze(i),t[5]=l?.message,t[6]=i,t[7]=d):d=t[7];let f=d,p=l?.status!==`broken`&&(i.status===`warning`||l!==null)?`warning`:`error`,m=l&&l.status!==`broken`?`status`:`alert`,h;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Q.jsx)(O,{}),t[8]=h):h=t[8];let g;t[9]===u?g=t[10]:(g=(0,Q.jsx)(U,{children:u}),t[9]=u,t[10]=g);let v;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Q.jsx)(`div`,{className:`line-clamp-3`}),t[11]=v):v=t[11];let b;t[12]===f?b=t[13]:(b=(0,Q.jsxs)(I,{children:[(0,Q.jsx)(N,{render:v,children:f}),(0,Q.jsx)(P,{side:`top`,className:`whitespace-pre-wrap`,children:f})]}),t[12]=f,t[13]=b);let x;t[14]!==r||t[15]!==i?(x=r&&Xe(i)?(0,Q.jsx)(y,{onClick:()=>r(i.instanceId),children:`Open provider setup`}):null,t[14]=r,t[15]=i,t[16]=x):x=t[16];let S;t[17]!==x||t[18]!==b?(S=(0,Q.jsxs)(G,{children:[b,x]}),t[17]=x,t[18]=b,t[19]=S):S=t[19];let C=`Dismiss ${o} provider ${i.status}`,w;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Q.jsx)(j,{}),t[20]=w):w=t[20];let E;t[21]!==n||t[22]!==C?(E=(0,Q.jsx)(W,{children:(0,Q.jsx)(_,{"aria-label":C,onClick:n,size:`icon-xs`,variant:`ghost-muted`,children:w})}),t[21]=n,t[22]=C,t[23]=E):E=t[23];let D;return t[24]!==S||t[25]!==E||t[26]!==p||t[27]!==m||t[28]!==g?(D=(0,Q.jsx)(`div`,{className:`pointer-events-auto mx-auto w-fit max-w-[calc(100%-2rem)] pt-3`,children:(0,Q.jsxs)(me,{variant:p,role:m,surface:`glass`,controlAlignment:`first-line`,children:[h,g,S,E]})}),t[24]=S,t[25]=E,t[26]=p,t[27]=m,t[28]=g,t[29]=D):D=t[29],D}),$e=24;function et(e){return[X(e.name),...e.shortName?[X(e.shortName)]:[],...e.subProvider?[X(e.subProvider)]:[],X(e.driverKind),X(e.providerDisplayName),nt(e)]}function tt(e,t,n){return ge({value:e,query:t,exactBase:n,prefixBase:n+2,boundaryBase:n+4,includesBase:n+6,...t.length>=3?{fuzzyBase:n+100}:{}})}function nt(e){return X([e.name,e.shortName,e.subProvider,e.driverKind,e.providerDisplayName].filter(e=>typeof e==`string`&&e.length>0).join(` `))}function rt(e,t){let n=X(t).split(/\s+/u).filter(e=>e.length>0);if(n.length===0)return 0;let r=et(e),i=0;for(let e of n){let t=[];for(let n=0;n<r.length;n+=1){let i=tt(r[n],e,n*10);i!==null&&t.push(i)}if(t.length===0)return null;i+=Math.min(...t)}return e.isFavorite?i-$e:i}function it(e){if(e.driverKind===`antigravity`&&e.model===`antigravity-default`){let t=e.options.filter(e=>e.slug!==`antigravity-default`&&!e.isUnavailable);return t.find(e=>e.aliases?.includes(`antigravity-default`))??t.find(e=>e.isDefault)}return e.options.find(t=>t.slug===e.model)}function at(e){return e.entry.driverKind===`antigravity`&&e.option.slug===`antigravity-default`?!1:l(e.entry)?!0:e.entry.enabled&&(e.entry.driverKind===`opencode`||e.entry.driverKind===`antigravity`)&&e.entry.instanceId===e.activeInstanceId&&e.option.slug===e.activeModel&&e.option.isUnavailable===!0}function ot(e,t){return e.enabled&&e.status!==`disabled`&&Xe(e.snapshot)&&(!l(e)||!e.installed||e.snapshot.auth.status===`unauthenticated`||!t.some(e=>!e.isUnavailable))}function st(e){let t=[`favorites`,...e.entries.filter(t=>!e.disabledInstanceIds?.has(t.instanceId)&&(l(t)||e.selectableUnavailableInstanceIds?.has(t.instanceId))).map(e=>e.instanceId)],n=t.indexOf(e.selectedInstanceId);return t[n<0?e.direction===1?0:t.length-1:(n+e.direction+t.length)%t.length]}var ct=new Map,lt=52;function ut(){let e=(0,be.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsx)(`div`,{className:`h-0.5`}),e[0]=t):t=e[0],t}var dt=(0,Z.memo)(function(e){let{keybindings:t,modelOptionsByInstance:n,instanceEntries:o,getModelDisabledReason:s,onInstanceModelChange:c,onToggleModel:f}=e,[p,m]=(0,Z.useState)(``),[h,g]=(0,Z.useState)(!1),[_,v]=(0,Z.useState)(!1),x=(0,Z.useRef)(null),S=(0,Z.useRef)(null),C=(0,Z.useRef)(null),w=(0,Z.useRef)(null),{favorites:T}=B(e.environmentId),E=e.instanceEntries.find(t=>t.instanceId===e.activeInstanceId),O=it({driverKind:E?.driverKind,model:e.model,options:n.get(e.activeInstanceId)??[]})?.slug??(e.model===`antigravity-default`?``:e.model),k=O?je(e.activeInstanceId,O):null,A=(0,Z.useMemo)(()=>e.selectedModels?.map(e=>{let t=it({driverKind:o.find(t=>t.instanceId===e.instanceId)?.driverKind,model:e.model,options:n.get(e.instanceId)??[]});return je(e.instanceId,t?.slug??e.model)}),[o,n,e.selectedModels]),j=(0,Z.useMemo)(()=>new Set(A??(k?[k]:[])),[A,k]),M=E!==void 0&&(n.get(e.activeInstanceId)??[]).some(t=>at({entry:E,option:t,activeInstanceId:e.activeInstanceId,activeModel:O}))&&!l(E),N=e.onOpenProviderSetup!==void 0&&E!==void 0&&ot(E,n.get(e.activeInstanceId)??[]),[P,I]=(0,Z.useState)(()=>e.lockedProvider!==null||M||N?e.activeInstanceId:T.length>0?`favorites`:e.activeInstanceId),[L,ae]=(0,Z.useState)(()=>new Set(n.get(e.activeInstanceId)?.some(e=>e.slug===O&&e.isLegacy)?[e.activeInstanceId]:[])),ue=u(V),de=t??ue,fe=R(),pe=z(e.environmentId),U=(0,Z.useCallback)(()=>{x.current?.focus({preventScroll:!0})},[]),W=(0,Z.useCallback)(e=>{I(e),window.requestAnimationFrame(()=>{U()})},[U]);(0,Z.useLayoutEffect)(()=>{U();let e=window.requestAnimationFrame(()=>{U()}),t=window.setTimeout(()=>{U()},0);return()=>{window.cancelAnimationFrame(e),window.clearTimeout(t)}},[U]);let G=(0,Z.useMemo)(()=>new Set(T.map(e=>r(e.provider,e.model))),[T]),me=(0,Z.useMemo)(()=>new Map(o.map(e=>[e.instanceId,e])),[o]),K=(0,Z.useCallback)(t=>e.lockedProvider===null?!0:t.driverKind===e.lockedProvider?!e.lockedContinuationGroupKey||t.continuationGroupKey===e.lockedContinuationGroupKey:!1,[e.lockedContinuationGroupKey,e.lockedProvider]),q=(0,Z.useMemo)(()=>{let t=new Set;if(M&&t.add(e.activeInstanceId),e.onOpenProviderSetup)for(let e of o)ot(e,n.get(e.instanceId)??[])&&t.add(e.instanceId);return t.size>0?t:void 0},[M,o,n,e.activeInstanceId,e.onOpenProviderSetup]),he=(0,Z.useMemo)(()=>{let t=[];for(let[r,i]of n){let n=me.get(r);if(n)for(let a of i)at({entry:n,option:a,activeInstanceId:e.activeInstanceId,activeModel:O})&&t.push({slug:a.slug,name:a.name,...a.shortName?{shortName:a.shortName}:{},...a.subProvider?{subProvider:a.subProvider}:{},...a.badge?{badge:a.badge}:{},...a.isLegacy?{isLegacy:!0}:{},...a.isUnavailable?{isUnavailable:!0}:{},instanceId:r,driverKind:n.driverKind,instanceDisplayName:n.displayName,...n.accentColor?{instanceAccentColor:n.accentColor}:{},...n.acpRegistryAgentId?{acpRegistryAgentId:n.acpRegistryAgentId}:{},...n.acpRegistryIconUrl?{acpRegistryIconUrl:n.acpRegistryIconUrl}:{},...n.continuationGroupKey?{continuationGroupKey:n.continuationGroupKey}:{}})}return t},[n,me,e.activeInstanceId,O]),J=e.lockedProvider!==null,Y=p.trim().length>0,ge=(0,Z.useMemo)(()=>{if(!J)return;let e=new Set;for(let t of o)K(t)||e.add(t.instanceId);return e},[o,J,K]),X=(0,Z.useMemo)(()=>{let e=o.filter(d);if(!J)return e;let t=[],n=[];for(let r of e)K(r)?t.push(r):n.push(r);return[...t,...n]},[o,J,K]),_e=!Y&&X.length>0,be=(0,Z.useMemo)(()=>o.map(e=>e.instanceId),[o]),xe=(0,Z.useMemo)(()=>{let t=he;if(p.trim()){let n=t.map(e=>({model:e,score:rt({name:e.name,...e.shortName?{shortName:e.shortName}:{},...e.subProvider?{subProvider:e.subProvider}:{},driverKind:e.driverKind,providerDisplayName:e.instanceDisplayName,isFavorite:G.has(r(e.instanceId,e.slug))},p),isFavorite:G.has(r(e.instanceId,e.slug)),tieBreaker:nt({name:e.name,...e.shortName?{shortName:e.shortName}:{},...e.subProvider?{subProvider:e.subProvider}:{},driverKind:e.driverKind,providerDisplayName:e.instanceDisplayName})})).filter(e=>e.score!==null);if(e.lockedProvider!==null){let e=[];for(let t of n)K(t.model)&&e.push(t);return e.toSorted((e,t)=>{let n=e.score-t.score;return n===0?e.isFavorite===t.isFavorite?e.tieBreaker.localeCompare(t.tieBreaker):e.isFavorite?-1:1:n}).map(e=>e.model)}return n.toSorted((e,t)=>{let n=e.score-t.score;return n===0?e.isFavorite===t.isFavorite?e.tieBreaker.localeCompare(t.tieBreaker):e.isFavorite?-1:1:n}).map(e=>e.model)}return e.lockedProvider===null?t=P===`favorites`?t.filter(e=>G.has(r(e.instanceId,e.slug))):t.filter(e=>e.instanceId===P):(t=t.filter(e=>K(e)),t=P===`favorites`?t.filter(e=>G.has(r(e.instanceId,e.slug))):t.filter(e=>e.instanceId===P)),a(t,{favoriteModelKeys:G,groupFavorites:P!==`favorites`,instanceOrder:P===`favorites`?be:[]})},[G,he,be,K,e.lockedProvider,p,P]),$=(0,Z.useMemo)(()=>{if(Y||P===`favorites`)return null;let e=xe.filter(e=>!e.isLegacy),t=xe.filter(e=>e.isLegacy);return t.length===0?null:{key:Ne(P),currentModels:e,legacyModels:t,isExpanded:L.has(P)}},[L,xe,Y,P]),Se=(0,Z.useMemo)(()=>$?[...$.currentModels,...$.isExpanded?$.legacyModels:[]]:xe,[xe,$]),Ce=P===`favorites`?void 0:me.get(P),we=!Y&&e.onOpenProviderSetup?o.filter(e=>K(e)&&ot(e,n.get(e.instanceId)??[])&&(Ce?e.instanceId===Ce.instanceId:xe.length===0)):[],Te=(Y?o.filter(K):Ce?[Ce]:[]).flatMap(e=>{let t=Oe(e.snapshot,p);return t?[{instanceId:e.instanceId,notice:t}]:[]}),Ee=(0,Z.useCallback)(e=>{ae(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),De=(0,Z.useCallback)((e,t,r=!1)=>{if(s?.(t,e))return;let a=n.get(t);if(!a)return;let o=me.get(t);if(!o)return;let l=i(o.driverKind,e,a);l&&(r&&f?f(t,l):c(t,l))},[me,s,n,c,f]),ke=(0,Z.useMemo)(()=>{let e=new Map,t=0;for(let n of Se){if(s?.(n.instanceId,n.slug))continue;let r=ce(t);if(!r)return e;e.set(je(n.instanceId,n.slug),r),t+=1}return e},[s,Se]),Ae=(0,Z.useMemo)(()=>[...ke.keys()],[ke]),Ie=(0,Z.useMemo)(()=>[...he.map(e=>je(e.instanceId,e.slug)),...new Set(he.filter(e=>e.isLegacy).map(e=>Ne(e.instanceId)))],[he]),Le=(0,Z.useMemo)(()=>{let e=Se.map(e=>je(e.instanceId,e.slug));return $&&e.splice($.currentModels.length,0,$.key),e},[$,Se]),Re=(0,Z.useMemo)(()=>new Map(Se.map(e=>[je(e.instanceId,e.slug),e])),[Se]),[ze,Be]=(0,Z.useState)(()=>Le.length*lt),[Ve,He]=(0,Z.useState)(0);(0,Z.useLayoutEffect)(()=>S.current?.getState().listen(`totalSize`,Be),[]);let Ue=Le.length===0?0:`calc(${ze}px + var(--spacing) * 5)`,We=(0,Z.useCallback)(()=>{let e=S.current?.getScrollableNode();if(!(e instanceof HTMLElement))return;let t=Math.max(0,e.scrollHeight-e.clientHeight);g(e.scrollTop>1),v(t-e.scrollTop>1)},[]),Ge=(0,Z.useMemo)(()=>({terminalFocus:!1,terminalOpen:e.terminalOpen,modelPickerOpen:!0}),[e.terminalOpen]),qe=(0,Z.useMemo)(()=>{if(ke.size===0)return ct;let e={platform:navigator.platform,context:Ge},t=new Map;for(let[n,r]of ke){let i=le(de,r,e);i&&t.set(n,i)}return t.size>0?t:ct},[de,ke,Ge]),Je=(0,Z.useMemo)(()=>({favoritesSet:G,modelJumpLabelByKey:qe,activeModelKey:k,selectedModelKeySet:j}),[G,qe,k,j]);return(0,Z.useEffect)(()=>{let e=e=>{if(e.defaultPrevented||e.repeat||ye())return;let t=oe(e,de,{platform:navigator.platform,context:Ge});if(t===`modelPicker.previousProvider`||t===`modelPicker.nextProvider`){e.preventDefault(),e.stopPropagation();let n=st({entries:X,selectedInstanceId:P,direction:t===`modelPicker.nextProvider`?1:-1,disabledInstanceIds:ge,selectableUnavailableInstanceIds:q});m(``),W(n);return}let n=se(t??``);if(n===null)return;e.preventDefault(),e.stopPropagation();let r=Ae[n];if(!r)return;let i=Me(r);i&&De(i.slug,i.instanceId)};return window.addEventListener(`keydown`,e,!0),()=>{window.removeEventListener(`keydown`,e,!0)}},[De,W,de,ge,Ae,Ge,q,P,X]),(0,Z.useLayoutEffect)(()=>{g(!1),v(Le.length>5);let e=0,t=window.requestAnimationFrame(()=>{We(),e=window.requestAnimationFrame(We)});return()=>{window.cancelAnimationFrame(t),window.cancelAnimationFrame(e)}},[Le,We]),(0,Q.jsx)(F,{delay:0,children:(0,Q.jsxs)(`div`,{ref:C,className:`relative flex max-h-86.5 w-screen max-w-90 flex-row overflow-hidden`,style:Y?{height:Ve}:void 0,"data-model-picker-content":`true`,children:[_e&&(0,Q.jsx)(Ke,{selectedInstanceId:P,onSelectInstance:W,onFocusSearch:U,instanceEntries:X,showFavorites:!0,...q?{selectableUnavailableInstanceIds:q}:{},...ge?{disabledInstanceIds:ge,getDisabledInstanceTooltip:e=>`${e.displayName} is unavailable in this thread. Start a new thread to switch providers.`}:{}}),(0,Q.jsx)(re,{inline:!0,items:Ie,filteredItems:Le,filter:null,autoHighlight:!0,open:!0,virtualized:!0,multiple:f!==void 0,value:f?[...j]:k,onItemHighlighted:(e,t)=>{w.current=typeof e==`string`?e:null,t.reason===`keyboard`&&t.index>=0&&S.current?.scrollIndexIntoView?.({index:t.index,animated:!1})},onValueChange:(e,t)=>{let n=Array.isArray(e)?e.find(e=>!j.has(e))??[...j].find(t=>!e.includes(t)):e;if(typeof n!=`string`)return;let r=Pe(n);if(r){Ee(r);return}let i=Me(n);i&&De(i.slug,i.instanceId,`shiftKey`in t.event&&t.event.shiftKey===!0)},children:(0,Q.jsxs)(`div`,{className:b(`flex min-h-0 flex-1 flex-col overflow-hidden bg-muted/40`,_e&&`border-l border-border/70`),children:[(0,Q.jsx)(H,{ref:x,placeholder:`Search models...`,value:p,onChange:e=>{Y||He(C.current?.offsetHeight??0),m(e.target.value)},onKeyDown:t=>{if(_e&&!t.altKey&&!t.ctrlKey&&!t.metaKey&&(t.key===`ArrowLeft`&&!t.shiftKey&&p.length===0||t.key===`Tab`&&t.shiftKey)){let e=t.currentTarget.closest(`[data-model-picker-content]`)?.querySelector(`[data-model-picker-sidebar]`),n=e?.querySelector(`button[aria-pressed="true"]:not(:disabled)`)??e?.querySelector(`button:not(:disabled)`);if(n){t.preventDefault(),t.stopPropagation(),n.focus();return}}if(t.key===`Escape`){t.preventDefault(),t.stopPropagation(),e.onRequestClose?.();return}if(t.key===`Enter`&&w.current){t.preventBaseUIHandler?.(),t.preventDefault(),t.stopPropagation();let e=Pe(w.current);if(e){Ee(e);return}let n=Me(w.current);n&&De(n.slug,n.instanceId,t.shiftKey);return}t.stopPropagation()},onMouseDown:e=>e.stopPropagation(),onTouchStart:e=>e.stopPropagation()}),(0,Q.jsx)(`div`,{className:`relative min-h-0 overflow-hidden pr-px`,style:{height:Ue},children:(0,Q.jsx)(ee,{children:(0,Q.jsx)(ve,{ref:S,data:Le,extraData:Je,keyExtractor:e=>e,renderItem:({item:e,index:t})=>{if($?.key===e)return(0,Q.jsxs)(ne,{hideIndicator:!0,index:t,value:e,"aria-expanded":$.isExpanded,className:`group w-full cursor-pointer`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1 text-left`,children:[(0,Q.jsx)(`div`,{className:`text-xs font-medium leading-snug`,children:`Legacy models`}),(0,Q.jsxs)(`div`,{className:`mt-1 text-xs font-normal leading-snug text-muted-foreground/70`,children:[$.legacyModels.length,` models`]})]}),(0,Q.jsx)(D,{className:b(`size-4 transition-transform`,$.isExpanded&&`rotate-90`)})]});let n=Re.get(e);if(!n)return null;let i=s?.(n.instanceId,n.slug)??null;return(0,Q.jsx)(Fe,{index:t,model:n,instanceId:n.instanceId,driverKind:n.driverKind,providerDisplayName:n.instanceDisplayName,providerAccentColor:n.instanceAccentColor,acpRegistryAgentId:n.acpRegistryAgentId,acpRegistryIconUrl:n.acpRegistryIconUrl,isFavorite:G.has(r(n.instanceId,n.slug)),isSelected:A===void 0?e===k:j.has(e),showSelection:A!==void 0,showProvider:!0,preferShortName:!J,useTriggerLabel:!1,showNewBadge:n.badge===`new`,unavailable:n.isUnavailable===!0,jumpLabel:qe.get(e)??null,disabledReason:i,onToggleFavorite:()=>pe(n.instanceId,n.slug)},e)},estimatedItemSize:lt,drawDistance:480,recycleItems:!0,contentContainerClassName:`pl-2 pr-px`,ItemSeparatorComponent:ut,onLayout:We,onScroll:We,className:b(`scrollbar-gutter-stable h-full overflow-x-hidden overscroll-y-contain py-1.5 [&::-webkit-scrollbar-track]:my-2`,ie({top:h,bottom:_}))})})}),we.length>0?(0,Q.jsx)(`div`,{className:`max-h-44 shrink-0 overflow-y-auto border-t border-border/70 p-2`,children:we.map(t=>(0,Q.jsxs)(`div`,{className:`px-1 py-1.5 text-xs leading-snug`,children:[(0,Q.jsx)(`p`,{className:`line-clamp-3 text-muted-foreground`,children:Ze(t.snapshot)}),(0,Q.jsx)(y,{className:`mt-1`,onClick:()=>{e.onRequestClose?.(),e.onOpenProviderSetup?.(t.instanceId)},children:we.length>1?`Set up ${t.displayName}`:`Open provider setup`})]},t.instanceId))}):(0,Q.jsx)(te,{className:`empty:h-0`,children:`No models found`}),Te.map(({instanceId:t,notice:n})=>(0,Q.jsxs)(`p`,{className:`shrink-0 border-t border-border/70 px-3 py-2 text-xs leading-snug text-muted-foreground`,children:[n,` `,(0,Q.jsx)(y,{onClick:()=>{e.onRequestClose?.(),fe({to:`/settings/providers`})},children:`Provider settings`})]},t))]})})]})})});function ft(e){let t=(0,be.c)(1),{provider:n}=e;if(!Y(n))return null;let r;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-4 border-t px-3 py-2`,children:[(0,Q.jsxs)(`span`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,Q.jsx)(ue,{className:`size-3.5`,"aria-hidden":`true`}),`Using ChatGPT plan`]}),(0,Q.jsx)(J,{size:`xs`})]}),t[0]=r):r=t[0],r}var pt=(0,Z.memo)(function(e){let t=(0,be.c)(119),n=v(),[r,i]=(0,Z.useState)(!1),a=e.open??r,o=e.size??`sm`,[c,l]=(0,Z.useState)(!1),u=(0,Z.useRef)(null),d=(0,Z.useRef)(!!e.renderSettings),m;t[0]!==a||t[1]!==e?(m=()=>{let t=d.current&&!e.renderSettings;d.current=!!e.renderSettings,a&&t&&(l(!1),e.onOpenChange?.(!1),e.open===void 0&&i(!1))},t[0]=a,t[1]=e,t[2]=m):m=t[2];let h;t[3]!==a||t[4]!==e.onOpenChange||t[5]!==e.open||t[6]!==e.renderSettings?(h=[a,e.renderSettings,e.onOpenChange,e.open],t[3]=a,t[4]=e.onOpenChange,t[5]=e.open,t[6]=e.renderSettings,t[7]=h):h=t[7],(0,Z.useLayoutEffect)(m,h);let g,y;t[8]!==a||t[9]!==c?(g=()=>{a&&!c&&u.current?.querySelector(`[data-composer-model-settings] button:not(:disabled)`)?.focus({preventScroll:!0})},y=[a,c],t[8]=a,t[9]=c,t[10]=g,t[11]=y):(g=t[10],y=t[11]),(0,Z.useLayoutEffect)(g,y);let x;t[12]!==e.activeInstanceId||t[13]!==e.instanceEntries?(x=e.instanceEntries.find(t=>t.instanceId===e.activeInstanceId)??null,t[12]=e.activeInstanceId,t[13]=e.instanceEntries,t[14]=x):x=t[14];let C=x,w=e.activeInstanceId,T,E;if(t[15]!==C?.driverKind||t[16]!==w||t[17]!==e.model||t[18]!==e.modelOptionsByInstance){let n=e.modelOptionsByInstance.get(w)??[];T=it({driverKind:C?.driverKind,model:e.model,options:n})??(C?.driverKind===`opencode`||C?.driverKind===`antigravity`?void 0:n[0]),E=T?we(T):e.model===`antigravity-default`?`Choose model`:e.model||`Choose model`,t[15]=C?.driverKind,t[16]=w,t[17]=e.model,t[18]=e.modelOptionsByInstance,t[19]=T,t[20]=E}else T=t[19],E=t[20];let D=E,O;t[21]!==C||t[22]!==e.instanceEntries?(O=C!==null&&f(C,e.instanceEntries),t[21]=C,t[22]=e.instanceEntries,t[23]=O):O=t[23];let k=O,A;t[24]===e?A=t[25]:(A=t=>{t||l(!1),e.onOpenChange?.(t),e.open===void 0&&i(t)},t[24]=e,t[25]=A);let j=A,N,P;t[26]===a?(N=t[27],P=t[28]):(N=()=>{if(!a)return;let{documentElement:e,body:t}=document,n=e.style.overscrollBehavior,r=t.style.overflow,i=t.style.paddingRight,o=window.innerWidth-e.clientWidth;e.style.overscrollBehavior=`contain`,t.style.overflow=`hidden`,o>0&&(t.style.paddingRight=`${o}px`);let s=mt,c=e=>{s(e.target)||e.preventDefault()},l=e=>{s(e.target)||e.preventDefault()};return document.addEventListener(`wheel`,c,{capture:!0,passive:!1}),document.addEventListener(`touchmove`,l,{capture:!0,passive:!1}),()=>{document.removeEventListener(`wheel`,c,{capture:!0}),document.removeEventListener(`touchmove`,l,{capture:!0}),e.style.overscrollBehavior=n,t.style.overflow=r,t.style.paddingRight=i}},P=[a],t[26]=a,t[27]=N,t[28]=P),(0,Z.useEffect)(N,P);let F;t[29]!==e||t[30]!==j?(F=(t,n)=>{e.disabled||(e.onInstanceModelChange(t,n),e.renderSettings?l(!1):j(!1))},t[29]=e,t[30]=j,t[31]=F):F=t[31];let I=F,L,R,z,B,V,ee,te,ne,H;if(t[32]!==C||t[33]!==a||t[34]!==e.activeProviderIconClassName||t[35]!==e.compact||t[36]!==e.disabled||t[37]!==e.fastMode||t[38]!==e.instanceEntries||t[39]!==e.instanceIndicatorBackground||t[40]!==e.isComposerOwned||t[41]!==e.modelOptionsByInstance||t[42]!==e.renderSettings||t[43]!==e.selectedModels||t[44]!==e.triggerAriaLabel||t[45]!==e.triggerClassName||t[46]!==e.triggerLabel||t[47]!==j||t[48]!==k||t[49]!==o){B=e.selectedModels?.map(t=>{let n=e.instanceEntries.find(e=>e.instanceId===t.instanceId),r=it({driverKind:n?.driverKind,model:t.model,options:e.modelOptionsByInstance.get(t.instanceId)??[]});return{...t,entry:n,label:r?`${we(r)}${r.isUnavailable?` (Unavailable)`:``}`:t.model}}),z=B?B.length===0?`Choose models`:`${B.slice(0,2).map(ht).join(`, `)}${B.length>2?`, ${B.length-2} more`:``}`:void 0;let n=B?B.map(gt).join(`, `)||`Choose models`:void 0;R=pe,ne=a,t[59]!==e.disabled||t[60]!==j?(H=t=>{if(e.disabled){j(!1);return}j(t)},t[59]=e.disabled,t[60]=j,t[61]=H):H=t[61],L=fe;let r=e.compact?`max-w-42 shrink-0`:!e.isComposerOwned&&`max-w-48 sm:max-w-56`,i;t[62]!==e.triggerClassName||t[63]!==r?(i=b(`min-w-0 shrink justify-between whitespace-nowrap`,r,e.triggerClassName),t[62]=e.triggerClassName,t[63]=r,t[64]=i):i=t[64],te=(0,Q.jsx)(S,{"aria-label":e.triggerAriaLabel??n,size:o,"data-chat-provider-model-picker":`true`,"data-composer-shortcut":e.renderSettings?`composer.effort`:void 0,className:i,disabled:e.disabled});let s=o===`xs`?`gap-1`:`gap-1.5`;t[65]===s?V=t[66]:(V=b(`flex min-w-0 flex-1 items-center`,s),t[65]=s,t[66]=V),ee=e.isComposerOwned?e.fastMode?(0,Q.jsx)(M,{"aria-hidden":!0,className:`size-4 fill-current text-foreground`}):null:B&&e.triggerLabel===void 0?(0,Q.jsxs)(`span`,{className:`flex shrink-0 items-center -space-x-1`,"aria-hidden":`true`,children:[B.slice(0,3).map(_t),B.length>3?(0,Q.jsxs)(`span`,{className:`relative z-30 flex size-4 items-center justify-center rounded-full bg-(--chat-composer-glass-surface,var(--background)) text-3xs ring-2 ring-(--chat-composer-glass-surface,var(--background))`,children:[`+`,B.length-3]}):null]}):C&&e.triggerLabel===void 0?(0,Q.jsx)(he,{driverKind:C.driverKind,displayName:C.displayName,accentColor:C.accentColor,acpRegistryAgentId:C.acpRegistryAgentId,acpRegistryIconUrl:C.acpRegistryIconUrl,showBadge:k,className:`size-4`,iconClassName:b(`size-4`,e.activeProviderIconClassName),indicatorBackground:e.instanceIndicatorBackground??`var(--contrast-input)`,badgeClassName:b(`right-[-0.125rem] bottom-[-0.125rem] h-3 min-w-3 px-0.5 text-5xs`,o===`xs`&&`shadow-none`)}):null,t[32]=C,t[33]=a,t[34]=e.activeProviderIconClassName,t[35]=e.compact,t[36]=e.disabled,t[37]=e.fastMode,t[38]=e.instanceEntries,t[39]=e.instanceIndicatorBackground,t[40]=e.isComposerOwned,t[41]=e.modelOptionsByInstance,t[42]=e.renderSettings,t[43]=e.selectedModels,t[44]=e.triggerAriaLabel,t[45]=e.triggerClassName,t[46]=e.triggerLabel,t[47]=j,t[48]=k,t[49]=o,t[50]=L,t[51]=R,t[52]=z,t[53]=B,t[54]=V,t[55]=ee,t[56]=te,t[57]=ne,t[58]=H}else L=t[50],R=t[51],z=t[52],B=t[53],V=t[54],ee=t[55],te=t[56],ne=t[57],H=t[58];let re=e.triggerLabel??z??D,ie;t[67]===re?ie=t[68]:(ie=(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,"data-chat-provider-model-picker-label":`true`,children:re}),t[67]=re,t[68]=ie);let oe;t[69]===e.settingsLabel?oe=t[70]:(oe=e.settingsLabel?(0,Q.jsx)(`span`,{className:`shrink-0 font-normal text-muted-foreground`,children:e.settingsLabel}):null,t[69]=e.settingsLabel,t[70]=oe);let se;t[71]!==e.triggerLabel||t[72]!==B||t[73]!==T?.isUnavailable?(se=T?.isUnavailable&&!B&&e.triggerLabel===void 0?(0,Q.jsx)(s,{variant:`outline`,size:`sm`,children:`Unavailable`}):null,t[71]=e.triggerLabel,t[72]=B,t[73]=T?.isUnavailable,t[74]=se):se=t[74];let ce;t[75]!==V||t[76]!==ee||t[77]!==ie||t[78]!==oe||t[79]!==se?(ce=(0,Q.jsxs)(`span`,{className:V,children:[ee,ie,oe,se]}),t[75]=V,t[76]=ee,t[77]=ie,t[78]=oe,t[79]=se,t[80]=ce):ce=t[80];let le;t[81]===o?le=t[82]:(le=(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:`flex items-center`,children:(0,Q.jsx)(p,{size:o})}),t[81]=o,t[82]=le);let ue;t[83]!==L||t[84]!==te||t[85]!==ce||t[86]!==le?(ue=(0,Q.jsxs)(L,{render:te,children:[ce,le]}),t[83]=L,t[84]=te,t[85]=ce,t[86]=le,t[87]=ue):ue=t[87];let U;t[88]!==n||t[89]!==e.isComposerOwned?(U=e.isComposerOwned?n:{},t[88]=n,t[89]=e.isComposerOwned,t[90]=U):U=t[90];let W;t[91]!==e.renderSettings||t[92]!==c?(W=e.renderSettings?{width:c?360:288}:void 0,t[91]=e.renderSettings,t[92]=c,t[93]=W):W=t[93];let G=c?`models`:`settings`,me=e.renderSettings?c?`composer-models-enter`:`composer-effort-enter`:void 0,K;t[94]!==C?.snapshot||t[95]!==w||t[96]!==I||t[97]!==z||t[98]!==e||t[99]!==j||t[100]!==c||t[101]!==D?(K=e.renderSettings&&!c?e.renderSettings(z??D,()=>l(!0)):(0,Q.jsxs)(Q.Fragment,{children:[e.renderSettings?(0,Q.jsx)(`div`,{className:`px-2 pt-2`,children:(0,Q.jsxs)(_,{variant:`ghost-muted`,size:`sm`,onClick:()=>l(!1),children:[(0,Q.jsx)(_e,{}),` Model settings`]})}):null,(0,Q.jsx)(dt,{environmentId:e.environmentId,activeInstanceId:w,model:e.model,...e.selectedModels===void 0?{}:{selectedModels:e.selectedModels},...e.onToggleModel?{onToggleModel:(t,n)=>{e.disabled||e.onToggleModel?.(t,n)}}:{},lockedProvider:e.lockedProvider,lockedContinuationGroupKey:e.lockedContinuationGroupKey??null,instanceEntries:e.instanceEntries,...e.keybindings?{keybindings:e.keybindings}:{},modelOptionsByInstance:e.modelOptionsByInstance,terminalOpen:e.terminalOpen??!1,onRequestClose:()=>j(!1),...e.onOpenProviderSetup?{onOpenProviderSetup:e.onOpenProviderSetup}:{},...e.getModelDisabledReason?{getModelDisabledReason:e.getModelDisabledReason}:{},onInstanceModelChange:I}),e.selectedModels===void 0?(0,Q.jsx)(ft,{provider:C?.snapshot??null}):null]}),t[94]=C?.snapshot,t[95]=w,t[96]=I,t[97]=z,t[98]=e,t[99]=j,t[100]=c,t[101]=D,t[102]=K):K=t[102];let q;t[103]!==G||t[104]!==me||t[105]!==K?(q=(0,Q.jsx)(ae,{children:(0,Q.jsx)(`div`,{className:me,children:K},G)}),t[103]=G,t[104]=me,t[105]=K,t[106]=q):q=t[106];let J;t[107]!==W||t[108]!==q?(J=(0,Q.jsx)(`div`,{ref:u,className:`max-w-[calc(100vw-2rem)] transition-[width] duration-200 ease-out motion-reduce:transition-none`,style:W,children:q}),t[107]=W,t[108]=q,t[109]=J):J=t[109];let Y;t[110]!==U||t[111]!==J?(Y=(0,Q.jsx)(de,{...U,align:`start`,className:`before:hidden`,padding:`none`,children:J}),t[110]=U,t[111]=J,t[112]=Y):Y=t[112];let ge;return t[113]!==R||t[114]!==ne||t[115]!==H||t[116]!==ue||t[117]!==Y?(ge=(0,Q.jsxs)(R,{open:ne,onOpenChange:H,children:[ue,Y]}),t[113]=R,t[114]=ne,t[115]=H,t[116]=ue,t[117]=Y,t[118]=ge):ge=t[118],ge});function mt(e){return e instanceof Element&&e.closest(`[data-model-picker-content]`)}function ht(e){return e.label}function gt(e){return e.label}function _t(e){return e.entry?(0,Q.jsx)(he,{driverKind:e.entry.driverKind,displayName:e.entry.displayName,accentColor:e.entry.accentColor,className:`size-4 rounded-full bg-(--chat-composer-glass-surface,var(--background)) ring-2 ring-(--chat-composer-glass-surface,var(--background))`,iconClassName:`size-4`},`${e.instanceId}:${e.model}`):null}export{Xe as a,Je as i,it as n,Ye as o,Qe as r,we as s,pt as t};
|
|
2
|
-
//# sourceMappingURL=ProviderModelPicker-CpgHpUCG.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{Ll as n,Oh as r,Xb as i,kh as a,ma as o,mh as s,or as c,t as l,wx as u}from"./utils-DmS758az.js";import{t as d}from"./plus-Cr075-cy.js";import{t as f}from"./x-CSwbgjBe.js";import{a as p,c as m,o as h,s as g,t as _}from"./select-BiARKKgd.js";import{t as v}from"./textarea-DZLyhzuZ.js";import{t as y}from"./input-u5qjnfMr.js";import{a as b}from"./settingsLayout-BzyY4qHt.js";import{Ea as x}from"./main-D9z9rMK1.js";import{t as S}from"./draft-input-BrEXLyuj.js";var C=e(t(),1),w=u(),T=e(o(),1);function E(e){let t=(0,w.c)(16),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({configured:a,placeholder:r,onCommit:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a!==void 0&&a,s=o?`Stored secret, enter a new value to replace`:r??`Not set`,c;t[5]!==i||t[6]!==s?(c={...i,type:`password`,autoComplete:`off`,spellCheck:!1,placeholder:s},t[5]=i,t[6]=s,t[7]=c):c=t[7];let l=c;if(n){let e;t[8]!==o||t[9]!==n?(e=e=>{o&&e===``||n(e)},t[8]=o,t[9]=n,t[10]=e):e=t[10];let r;return t[11]!==l||t[12]!==e?(r=(0,T.jsx)(S,{...l,onCommit:e}),t[11]=l,t[12]=e,t[13]=r):r=t[13],r}let u;return t[14]===l?u=t[15]:(u=(0,T.jsx)(y,{...l}),t[14]=l,t[15]=u),u}function D(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/[-_]+/g,` `).replace(/^./,e=>e.toUpperCase())}function O(e){return a(e)??r(e)}function k(e,t){let n=O(e)?.[t];return typeof n==`string`?n:void 0}function A(e){return O(e)?.providerSettingsForm??{}}function j(e){return r(e.settingsSchema)?.providerSettingsFormSchema??{}}function M(e){let t=s(e)(void 0);return i(t)&&typeof t.value==`boolean`?t.value:void 0}function N(e,t){let r=e.driverKind===`acpRegistry`&&B(t,`source`)===`local`,i=j(e),a=new Map((i.order??[]).map((e,t)=>[e,t])),o=a.size;return Object.keys(e.settingsSchema.fields).map((e,t)=>({key:e,index:t})).toSorted((e,t)=>(a.get(e.key)??o+e.index)-(a.get(t.key)??o+t.index)).flatMap(({key:t})=>{let i=e.settingsSchema.fields[t],a=A(i);if(a.hidden||r&&t!==`source`&&t!==`commandPath`)return[];let o=k(i,`title`),s=k(i,`description`);return[{key:t,control:a.control??`text`,label:r&&t===`commandPath`?`Executable`:o??D(t),...r&&t===`commandPath`?{description:`Executable name or path on this environment.`}:s===void 0?{}:{description:s},...r&&t===`commandPath`?{placeholder:`e.g. dsh`}:a.placeholder===void 0?{}:{placeholder:a.placeholder},clearWhenEmpty:a.clearWhenEmpty??`omit`,...n(i)?{secret:!0}:{},...a.control===`switch`?{defaultBooleanValue:M(i)}:{},...a.control===`select`&&a.options?{options:a.options}:{}}]})}var P=0,F=e=>({id:`provider-argument-${P++}`,value:e});function I(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}function L(e){let t=(0,w.c)(21),{value:n,onChange:r}=e,i=typeof n==`object`&&n?n.commandArgs:void 0,a;t[0]===i?a=t[1]:(a=Array.isArray(i)?i.filter(z):[],t[0]=i,t[1]=a);let o=a,s;t[2]===o?s=t[3]:(s=()=>o.map(F),t[2]=o,t[3]=s);let[l,u]=(0,C.useState)(s),p=(0,C.useRef)(l),m=(0,C.useRef)(o),h=(0,C.useRef)(void 0),g,_;t[4]===o?(g=t[5],_=t[6]):(g=()=>{let e=m.current,t=h.current;if(m.current=o,h.current=void 0,I(e,o)||t!==void 0&&I(t,o))return;let n=o.map(F);p.current=n,u(n)},_=[o],t[4]=o,t[5]=g,t[6]=_),(0,C.useEffect)(g,_);let v;t[7]!==r||t[8]!==n?(v=e=>{p.current=e,u(e);let t=e.map(R);h.current=t;let i=typeof n==`object`&&n?{...n}:{};r({...i,commandArgs:t})},t[7]=r,t[8]=n,t[9]=v):v=t[9];let y=v,x;t[10]===y?x=t[11]:(x=()=>y([...p.current,F(``)]),t[10]=y,t[11]=x);let E;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,T.jsx)(d,{}),t[12]=E):E=t[12];let D;t[13]===x?D=t[14]:(D=(0,T.jsxs)(c,{type:`button`,size:`sm`,variant:`outline`,onClick:x,children:[E,`Add argument`]}),t[13]=x,t[14]=D);let O;t[15]!==l||t[16]!==y?(O=l.length>0?(0,T.jsx)(`div`,{className:`mt-3 min-w-0 space-y-2 pb-2`,children:l.map((e,t)=>(0,T.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,T.jsx)(S,{size:`sm`,font:`mono`,value:e.value,onCommit:t=>y(p.current.map(n=>n.id===e.id?{...n,value:t}:n)),"aria-label":`Argument ${t+1}`,spellCheck:!1}),(0,T.jsx)(c,{type:`button`,size:`icon-micro`,variant:`ghost-destructive`,onClick:()=>y(p.current.filter(t=>t.id!==e.id)),"aria-label":`Remove argument ${t+1}`,children:(0,T.jsx)(f,{})})]},e.id))}):null,t[15]=l,t[16]=y,t[17]=O):O=t[17];let k;return t[18]!==D||t[19]!==O?(k=(0,T.jsx)(b,{title:`Arguments`,description:`One literal argument per row, in launch order.`,control:D,children:O}),t[18]=D,t[19]=O,t[20]=k):k=t[20],k}function R(e){return e.value}function z(e){return typeof e==`string`}function B(e,t){if(typeof e!=`object`||!e)return``;let n=e[t];return typeof n==`string`?n:``}function V(e,t,n=!1){if(typeof e!=`object`||!e)return n;let r=e[t];return typeof r==`boolean`?r:n}function H(e,t,n){let r=typeof e==`object`&&e?{...e}:{};if(typeof n==`boolean`){let e=t.defaultBooleanValue??!1;return t.clearWhenEmpty===`omit`&&n===e?delete r[t.key]:r[t.key]=n,Object.keys(r).length>0?r:void 0}let i=n.trim();return t.clearWhenEmpty===`omit`&&i.length===0?delete r[t.key]:r[t.key]=n,Object.keys(r).length>0?r:void 0}function U(e){let t=(0,w.c)(31),{field:n,value:r,inputId:i,size:a,className:o,onChange:s}=e,c;t[0]===n.options?c=t[1]:(c=n.options??[],t[0]=n.options,t[1]=c);let l=c,u=l[0]?.value??``,d;t[2]!==u||t[3]!==n.key||t[4]!==r?(d=B(r,n.key)||u,t[2]=u,t[3]=n.key,t[4]=r,t[5]=d):d=t[5];let f=d,p;t[6]!==f||t[7]!==l?(p=l.find(e=>e.value===f)?.label??f,t[6]=f,t[7]=l,t[8]=p):p=t[8];let v=p,y;t[9]!==u||t[10]!==n||t[11]!==s||t[12]!==r?(y=e=>{typeof e==`string`&&s(H(r,n,e===u?``:e))},t[9]=u,t[10]=n,t[11]=s,t[12]=r,t[13]=y):y=t[13];let b;t[14]===v?b=t[15]:(b=(0,T.jsx)(m,{children:v}),t[14]=v,t[15]=b);let x;t[16]!==o||t[17]!==n.label||t[18]!==i||t[19]!==a||t[20]!==b?(x=(0,T.jsx)(g,{id:i,size:a,className:o,"aria-label":n.label,children:b}),t[16]=o,t[17]=n.label,t[18]=i,t[19]=a,t[20]=b,t[21]=x):x=t[21];let S;t[22]===l?S=t[23]:(S=l.map(W),t[22]=l,t[23]=S);let C;t[24]===S?C=t[25]:(C=(0,T.jsx)(h,{align:`start`,alignItemWithTrigger:!1,children:S}),t[24]=S,t[25]=C);let E;return t[26]!==f||t[27]!==y||t[28]!==x||t[29]!==C?(E=(0,T.jsxs)(_,{value:f,onValueChange:y,children:[x,C]}),t[26]=f,t[27]=y,t[28]=x,t[29]=C,t[30]=E):E=t[30],E}function W(e){return(0,T.jsx)(p,{value:e.value,children:e.label},e.value)}function G(e){let t=(0,w.c)(4);if(e.variant===`card`){let n;return t[0]===e.children?n=t[1]:(n=(0,T.jsx)(`div`,{children:e.children}),t[0]=e.children,t[1]=n),n}let n;return t[2]===e.children?n=t[3]:(n=(0,T.jsx)(`div`,{className:`grid gap-1.5`,children:e.children}),t[2]=e.children,t[3]=n),n}function K(e){let t=(0,w.c)(108),{field:n,value:r,idPrefix:i,variant:a,onChange:o}=e,s=`${i}-${n.key}`,c=a===`dialog`?`text-2xs text-muted-foreground`:`mt-1 block text-xs text-muted-foreground`,u;t[0]===n.label?u=t[1]:(u=(0,T.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:n.label}),t[0]=n.label,t[1]=u);let d=u,f;t[2]!==c||t[3]!==n.description?(f=n.description?(0,T.jsx)(`span`,{className:c,children:n.description}):null,t[2]=c,t[3]=n.description,t[4]=f):f=t[4];let p=f;if(a===`settings`){let e=n.description?`${s}-description`:void 0,i;t[5]!==e||t[6]!==n||t[7]!==s||t[8]!==o||t[9]!==r?(i=n.control===`switch`?(0,T.jsx)(x,{checked:V(r,n.key,n.defaultBooleanValue),onCheckedChange:e=>o(H(r,n,!!e)),"aria-label":n.label,"aria-describedby":e}):n.control===`select`?(0,T.jsx)(U,{field:n,value:r,inputId:s,size:`sm`,className:`w-full max-w-full @min-[32rem]/settings-row:w-56`,onChange:o}):n.control===`textarea`?(0,T.jsx)(v,{id:s,"aria-describedby":e,className:`w-full max-w-full @min-[32rem]/settings-row:w-[min(24rem,50cqw)]`,value:B(r,n.key),onChange:e=>o(H(r,n,e.target.value)),placeholder:n.placeholder,spellCheck:!1}):n.secret?(0,T.jsx)(E,{id:s,"aria-describedby":e,size:`sm`,className:`w-full max-w-full @min-[32rem]/settings-row:w-56`,configured:B(r,n.key).length>0,value:``,onCommit:e=>o(H(r,n,e))}):(0,T.jsx)(S,{id:s,"aria-describedby":e,size:`sm`,className:`w-full max-w-full @min-[32rem]/settings-row:w-56`,type:n.control===`password`?`password`:void 0,autoComplete:n.control===`password`?`off`:void 0,value:B(r,n.key),placeholder:n.placeholder,onCommit:e=>{o(H(r,n,e))},spellCheck:!1}),t[5]=e,t[6]=n,t[7]=s,t[8]=o,t[9]=r,t[10]=i):i=t[10];let a=i,c;t[11]!==n.control||t[12]!==n.label||t[13]!==s?(c=n.control===`switch`?n.label:(0,T.jsx)(`label`,{htmlFor:s,children:n.label}),t[11]=n.control,t[12]=n.label,t[13]=s,t[14]=c):c=t[14];let l;t[15]!==e||t[16]!==n.description?(l=n.description?(0,T.jsx)(`span`,{id:e,children:n.description}):void 0,t[15]=e,t[16]=n.description,t[17]=l):l=t[17];let u;return t[18]!==a||t[19]!==c||t[20]!==l?(u=(0,T.jsx)(b,{title:c,description:l,control:a}),t[18]=a,t[19]=c,t[20]=l,t[21]=u):u=t[21],u}if(n.control===`switch`){let e;t[22]!==p||t[23]!==d?(e=(0,T.jsxs)(`div`,{className:`min-w-0`,children:[d,p]}),t[22]=p,t[23]=d,t[24]=e):e=t[24];let i;t[25]!==n.defaultBooleanValue||t[26]!==n.key||t[27]!==r?(i=V(r,n.key,n.defaultBooleanValue),t[25]=n.defaultBooleanValue,t[26]=n.key,t[27]=r,t[28]=i):i=t[28];let s;t[29]!==n||t[30]!==o||t[31]!==r?(s=e=>o(H(r,n,!!e)),t[29]=n,t[30]=o,t[31]=r,t[32]=s):s=t[32];let c;t[33]!==n.label||t[34]!==i||t[35]!==s?(c=(0,T.jsx)(x,{checked:i,onCheckedChange:s,"aria-label":n.label}),t[33]=n.label,t[34]=i,t[35]=s,t[36]=c):c=t[36];let l;t[37]!==e||t[38]!==c?(l=(0,T.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[e,c]}),t[37]=e,t[38]=c,t[39]=l):l=t[39];let u;return t[40]!==l||t[41]!==a?(u=(0,T.jsx)(G,{variant:a,children:l}),t[40]=l,t[41]=a,t[42]=u):u=t[42],u}if(n.control===`select`){let e=a===`card`&&`block`,i;t[43]===e?i=t[44]:(i=l(e),t[43]=e,t[44]=i);let c=a===`card`&&`mt-1.5`,u;t[45]===c?u=t[46]:(u=l(`w-full`,c),t[45]=c,t[46]=u);let f;t[47]!==n||t[48]!==s||t[49]!==o||t[50]!==u||t[51]!==r?(f=(0,T.jsx)(U,{field:n,value:r,inputId:s,size:`sm`,className:u,onChange:o}),t[47]=n,t[48]=s,t[49]=o,t[50]=u,t[51]=r,t[52]=f):f=t[52];let m;t[53]!==p||t[54]!==s||t[55]!==d||t[56]!==i||t[57]!==f?(m=(0,T.jsxs)(`label`,{htmlFor:s,className:i,children:[d,f,p]}),t[53]=p,t[54]=s,t[55]=d,t[56]=i,t[57]=f,t[58]=m):m=t[58];let h;return t[59]!==m||t[60]!==a?(h=(0,T.jsx)(G,{variant:a,children:m}),t[59]=m,t[60]=a,t[61]=h):h=t[61],h}if(n.control===`textarea`){let e=a===`card`&&`block`,i;t[62]===e?i=t[63]:(i=l(e),t[62]=e,t[63]=i);let c=a===`card`&&`mt-1.5`,u;t[64]===c?u=t[65]:(u=l(c),t[64]=c,t[65]=u);let f;t[66]!==n.key||t[67]!==r?(f=B(r,n.key),t[66]=n.key,t[67]=r,t[68]=f):f=t[68];let m;t[69]!==n||t[70]!==o||t[71]!==r?(m=e=>o(H(r,n,e.target.value)),t[69]=n,t[70]=o,t[71]=r,t[72]=m):m=t[72];let h;t[73]!==n.placeholder||t[74]!==s||t[75]!==u||t[76]!==f||t[77]!==m?(h=(0,T.jsx)(v,{id:s,className:u,value:f,onChange:m,placeholder:n.placeholder,spellCheck:!1}),t[73]=n.placeholder,t[74]=s,t[75]=u,t[76]=f,t[77]=m,t[78]=h):h=t[78];let g;t[79]!==p||t[80]!==s||t[81]!==d||t[82]!==i||t[83]!==h?(g=(0,T.jsxs)(`label`,{htmlFor:s,className:i,children:[d,h,p]}),t[79]=p,t[80]=s,t[81]=d,t[82]=i,t[83]=h,t[84]=g):g=t[84];let _;return t[85]!==g||t[86]!==a?(_=(0,T.jsx)(G,{variant:a,children:g}),t[85]=g,t[86]=a,t[87]=_):_=t[87],_}let m=n.control===`password`?`password`:void 0,h=n.secret?E:S,g=n.secret?E:y,_=a===`card`&&`block`,C;t[88]===_?C=t[89]:(C=l(_),t[88]=_,t[89]=C);let D;t[90]!==h||t[91]!==g||t[92]!==n||t[93]!==s||t[94]!==o||t[95]!==m||t[96]!==r||t[97]!==a?(D=a===`card`?(0,T.jsx)(h,{id:s,size:`sm`,className:`mt-1.5`,type:n.secret?void 0:m,autoComplete:!n.secret&&n.control===`password`?`off`:void 0,value:B(r,n.key),onCommit:e=>o(H(r,n,e)),placeholder:n.placeholder,spellCheck:!1}):(0,T.jsx)(g,{id:s,type:n.secret?void 0:m,autoComplete:!n.secret&&n.control===`password`?`off`:void 0,value:B(r,n.key),onChange:e=>o(H(r,n,e.target.value)),placeholder:n.placeholder,spellCheck:!1}),t[90]=h,t[91]=g,t[92]=n,t[93]=s,t[94]=o,t[95]=m,t[96]=r,t[97]=a,t[98]=D):D=t[98];let O;t[99]!==p||t[100]!==s||t[101]!==d||t[102]!==C||t[103]!==D?(O=(0,T.jsxs)(`label`,{htmlFor:s,className:C,children:[d,D,p]}),t[99]=p,t[100]=s,t[101]=d,t[102]=C,t[103]=D,t[104]=O):O=t[104];let k;return t[105]!==O||t[106]!==a?(k=(0,T.jsx)(G,{variant:a,children:O}),t[105]=O,t[106]=a,t[107]=k):k=t[107],k}function q(e){let t=(0,w.c)(24),{definition:n,value:r,idPrefix:i,variant:a,onChange:o}=e,s;t[0]!==n||t[1]!==r?(s=N(n,r),t[0]=n,t[1]=r,t[2]=s):s=t[2];let c=s,l;t[3]!==n.driverKind||t[4]!==r?(l=n.driverKind===`acpRegistry`&&B(r,`source`)===`local`,t[3]=n.driverKind,t[4]=r,t[5]=l):l=t[5];let u=l;if(c.length===0)return null;let d;if(t[6]!==c||t[7]!==i||t[8]!==o||t[9]!==r||t[10]!==a){let e;t[12]!==i||t[13]!==o||t[14]!==r||t[15]!==a?(e=e=>(0,T.jsx)(K,{field:e,value:r,idPrefix:i,variant:a,onChange:o},e.key),t[12]=i,t[13]=o,t[14]=r,t[15]=a,t[16]=e):e=t[16],d=c.map(e),t[6]=c,t[7]=i,t[8]=o,t[9]=r,t[10]=a,t[11]=d}else d=t[11];let f;t[17]!==u||t[18]!==o||t[19]!==r?(f=u?(0,T.jsx)(L,{value:r,onChange:o}):null,t[17]=u,t[18]=o,t[19]=r,t[20]=f):f=t[20];let p;return t[21]!==d||t[22]!==f?(p=(0,T.jsxs)(T.Fragment,{children:[d,f]}),t[21]=d,t[22]=f,t[23]=p):p=t[23],p}export{N as n,E as r,q as t};
|
|
2
|
-
//# sourceMappingURL=ProviderSettingsForm-CaNO8FYK.js.map
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{Bo as n,Gn as r,Im as i,Jn as a,P as o,Qn as s,Wn as c,Xn as l,Zn as u,ar as d,er as ee,k as f,ma as p,or as m,t as h,vs as te}from"./utils-DmS758az.js";import{t as ne}from"./chevron-down-DHV04o66.js";import{t as g}from"./chevron-right-NbahR9_s.js";import{t as re}from"./columns-2-D1kdFD9w.js";import{t as ie}from"./folder-tree-CIpeR87A.js";import{t as ae}from"./info-BHB-83EA.js";import{t as oe}from"./message-square-off-BstjdZP9.js";import{t as se}from"./pilcrow-DMiXqMTk.js";import{t as ce}from"./rows-3-Bhc8vjss.js";import{t as le}from"./text-wrap-C8SwAUbc.js";import{t as _}from"./triangle-alert-BiHUyRl3.js";import{L as v}from"./runtime-CCr9UADV.js";import{M as ue}from"./runtime-BVgeNXTV.js";import{a as y,c as de,n as b,t as x,u as fe}from"./tooltip-Df-4YKs5.js";import{i as pe}from"./toast-Bm36EaG6.js";import{a as me,n as he,r as ge,t as _e}from"./DiffFileTree-BhSPT6m_.js";import{K as ve,s as ye,v as be}from"./useSettings-CckatJFa.js";import{n as xe}from"./query-CK8MOmXr.js";import{t as S}from"./use-atom-command-CiEeUGsC.js";import{a as Se,c as Ce,d as we,i as Te,l as Ee,s as De,u as C}from"./diffRendering-QVeYVRDU.js";import{C as Oe,D as ke,E as Ae,I as je,N as Me,O as Ne,P as Pe,T as Fe,w as Ie}from"./PanelLayoutControls-CCKUTh1H.js";import{t as Le}from"./DiffCommentAnnotation-DDBZcMFv.js";import{t as Re}from"./checkbox-CIeee0-J.js";import{n as ze,t as w}from"./toggle-group-_C7nJPTT.js";import{n as Be,r as Ve,t as He}from"./collapsible-C3qenpEI.js";import{c as Ue,o as We}from"./RenderErrorBoundary-D21mPr47.js";import{r as T}from"./pullRequests-KhjrMCa0.js";import{M as Ge}from"./pullRequestDetail.logic-CE7fVOsp.js";import{i as Ke,n as qe,r as Je,t as Ye}from"./pullRequestReviewStore-BHEIYvsP.js";import{Da as Xe,qa as Ze}from"./main-D9z9rMK1.js";var E=e(t(),1),Qe=fe(),$e=new Set([`pnpm-lock.yaml`,`yarn.lock`,`package-lock.json`,`bun.lockb`,`Cargo.lock`,`go.sum`,`composer.lock`,`Gemfile.lock`]),et=new Set([`__snapshots__`,`__generated__`,`dist`,`build`,`vendor`]),tt=new Set([`__tests__`,`tests`,`test`]),nt=[`.ts`,`.tsx`,`.js`,`.jsx`,`.mjs`,`.cjs`];function rt(e){let t=e.split(`/`),n=t.at(-1)??``;return $e.has(n)||n.endsWith(`.snap`)||n.endsWith(`.min.js`)||n.endsWith(`.min.css`)||/\.generated\./.test(n)||t.slice(0,-1).some(e=>et.has(e))?`generated`:/\.(?:test|spec)\./.test(n)||t.slice(0,-1).some(e=>tt.has(e))?`test`:`source`}function D(e){let t=e.lastIndexOf(`.`);return t>e.lastIndexOf(`/`)?e.slice(0,t):e}function O(e){return D(e.split(`/`).at(-1)??``)}function k(e,t){let n=e.split(`/`).slice(0,-1);for(let e of t.split(`/`))e!==`.`&&e!==``&&(e===`..`?n.pop():n.push(e));return n.join(`/`)}var A=/(?:\bfrom|\bimport|\brequire\s*\()\s*\(?\s*["']([^"']+)["']/g;function j(e,t,n,r){let i=new Set;for(let a of t){A.lastIndex=0;let t=A.exec(a);for(;t!==null;){let o=t[1]??``,s=o.startsWith(`.`)?k(e,o):o,c=nt.find(e=>s.endsWith(e)),l=c===void 0?s:s.slice(0,-c.length),u=n.get(l)??n.get(`${l}/index`)??r.get(O(l));u!==void 0&&u!==e&&i.add(u),t=A.exec(a)}}return i}function it(e,t){let n=new Set(e),r=[],i=[...e].sort((e,t)=>e.localeCompare(t));for(;n.size>0;){let e=i.filter(e=>n.has(e)),a=e.find(e=>[...t.get(e)??[]].every(e=>!n.has(e)))??e[0];n.delete(a),r.push(a)}return r}function M(e){return(e.split(`/`).at(-1)??``).replace(/\.(?:test|spec)\..*$/,``).replace(/\.[^.]+$/,``)}function at(e){let t=new Map;for(let n of e)t.set(C(n),n);let n=new Map;for(let e of t.keys())n.set(e,rt(e));let r=[...t.keys()].filter(e=>n.get(e)===`source`),i=new Map,a=new Set,o=new Map;for(let e of r){i.set(D(e),e);let t=O(e);o.has(t)&&a.add(t),o.set(t,e)}for(let e of a)o.delete(e);let s=new Map;for(let e of r){let n=t.get(e);s.set(e,j(e,[...n.additionLines,...n.deletionLines],i,o))}let c=it(r,s),l=new Map;c.forEach((e,t)=>{let n=O(e);l.has(n)||l.set(n,t)});let u=[...t.keys()].filter(e=>n.get(e)===`test`).sort((e,t)=>(l.get(M(e))??2**53-1)-(l.get(M(t))??2**53-1)||e.localeCompare(t)),d=[...t.keys()].filter(e=>n.get(e)===`generated`).sort((e,t)=>e.localeCompare(t));return[...c,...u,...d].map(e=>t.get(e))}function ot(e,t,n){return e.hunks.some(e=>t===`left`?n>=e.deletionStart&&n<e.deletionStart+e.deletionCount:n>=e.additionStart&&n<e.additionStart+e.additionCount)}function st(e,t,n){let r=t===`folded`;return n.has(e)?!r:r}function ct(e,t,n,r){if(st(e,n,r)===t)return r;let i=new Set(r);return i.has(e)?i.delete(e):i.add(e),i}function lt(e){return e===null?null:new Map(e.files.map(e=>[e.path,e.state]))}function ut(e){return e===`viewed`}function dt(e){return e===`dismissed`}function ft(e,t,n){return n.get(e)??ut(t?.get(e))}function N(e,t,n){return e.reduce((e,r)=>ft(r,t,n)?e+1:e,0)}function P(e,t,n,r){if(t===null||e.size===0)return e;let i=new Map(e);for(let[a,o]of e)n.has(a)||(r.has(a)||ut(t.get(a))===o)&&i.delete(a);return i.size===e.size?e:i}function pt(e,t,n){let r=new Map(e);for(let{path:e,viewed:i}of t)n.has(e)&&r.get(e)===i&&r.delete(e);return r.size===e.size?e:r}function F(e){return[...e].map(([e,t])=>({path:e,viewed:t}))}var mt=400,I=new Map;function ht(e){let{environmentId:t,reference:n,enabled:r,paths:i}=e,a=xe(r?T.filesViewed({environmentId:t,input:n}):null),o=a.refresh,s=(0,E.useMemo)(()=>lt(a.data),[a.data]),c=a.data?.truncated===!0,l=a.error,[u,d]=(0,E.useState)(I),ee=S(T.setFilesViewed,{reportFailure:!1}),f=(0,E.useRef)(new Map),p=(0,E.useRef)(new Map),m=(0,E.useRef)(0),h=(0,E.useRef)(null),te=`${t} ${n.projectId} ${n.repository} ${n.number}`,ne=(0,E.useRef)(te),g=(0,E.useRef)(new Map),re=(0,E.useRef)(s);re.current=s,(0,E.useEffect)(()=>{let e=new Set([...f.current.keys(),...p.current.keys()]),t=new Set;for(let[n,r]of g.current)e.has(n)||r===s||(t.add(n),g.current.delete(n));d(n=>P(n,s,e,t))},[s]);let ie=(0,E.useCallback)(()=>{h.current=null;let e=F(f.current);if(e.length===0)return;f.current=new Map;let r=ne.current,i=++m.current;for(let t of e)p.current.set(t.path,i);ee({environmentId:t,input:{...n,files:e}}).then(t=>{let n=e.map(e=>e.path).filter(e=>p.current.get(e)===i);for(let e of n)p.current.delete(e);if(ne.current===r){if(t._tag===`Failure`){let r=new Set(n.filter(e=>!f.current.has(e)));d(t=>pt(t,e,r)),r.size>0&&!v(t)&&pe.add({type:`error`,title:`Could not update viewed files`});return}for(let e of n)g.current.set(e,re.current);o()}})},[t,n,o,ee]),ae=(0,E.useRef)(ie);ae.current=ie,(0,E.useEffect)(()=>{let e=ae.current;return ne.current=te,()=>{h.current!==null&&(clearTimeout(h.current),e()),f.current=new Map,p.current=new Map,g.current=new Map,d(I)}},[te]);let oe=(0,E.useRef)(o);oe.current=o;let se=(0,E.useCallback)(()=>oe.current(),[]),ce=(0,E.useCallback)((e,t)=>{d(n=>new Map(n).set(e,t)),f.current.set(e,t),h.current!==null&&clearTimeout(h.current),h.current=setTimeout(()=>ae.current(),mt)},[]),le=(0,E.useCallback)(e=>ft(e,s,u),[u,s]),_=(0,E.useCallback)(e=>!u.has(e)&&dt(s?.get(e)),[u,s]),ue=(0,E.useMemo)(()=>N(i,s,u),[u,i,s]);return(0,E.useMemo)(()=>({enabled:r,isViewed:le,isStale:_,setViewed:ce,viewedCount:ue,truncated:c,error:l,refresh:se}),[r,l,_,le,se,ce,c,ue])}var L=e(p(),1),gt=10,_t=`t3code.pullRequestFileTreeOpen`,vt=`
|
|
2
|
-
[data-diffs-header] [data-additions-count],
|
|
3
|
-
[data-diffs-header] [data-deletions-count] {
|
|
4
|
-
display: none !important;
|
|
5
|
-
}`,R=[];function yt({scrollerRef:e,environmentId:t,reference:p,detail:v,selectedCommitOid:fe,onSelectedCommitChange:$e,pendingFinding:et,fixFindingLabel:tt=`Fix in a thread`,onFixFinding:nt,onAddToAgentSelection:rt,onRefresh:D,refreshToken:O=0,revealRequest:k=null}){let{resolvedTheme:A}=ve(),j=ye(),[it,M]=(0,E.useState)(()=>new Set),[lt,ut]=(0,E.useState)(gt),[dt,ft]=(0,E.useState)(null),N=dt??(j.diffFilesCollapsed?`folded`:`expanded`),P=j.diffLayout,pt=be(),[F,mt]=(0,E.useState)(j.wordWrap),[I,yt]=(0,E.useState)(j.diffIgnoreWhitespace),[bt,xt]=te(_t,!1,i),[St,z]=(0,E.useState)(null),[B,V]=(0,E.useState)(null),[Ct,wt]=(0,E.useState)(!1),[Tt,Et]=(0,E.useState)(!1),[Dt,Ot]=(0,E.useState)({key:``,cursor:null,slices:R}),kt=(0,E.useRef)(new Map),[At,jt]=(0,E.useState)(null),H=qe(p),U=fe,W=U===null?H:`${H}@${U}`;(0,E.useEffect)(()=>{V(null),z(null),M(new Set),ft(null),ut(gt),Et(!1),Ot({key:W,cursor:null,slices:R}),kt.current.clear()},[W]);let G=Dt.key===W?Dt.slices:R,K=Dt.key===W?Dt.cursor:null,q=xe(T.diff({environmentId:t,input:{...p,...K===null?{}:{cursor:K},...U===null?{}:{commit:U}}}));(0,E.useEffect)(()=>{let e=q.data;e!==null&&Ot(t=>{let n=t.key===W?t.slices:R,r={cursor:K,patch:e.patch,truncated:e.truncated,nextCursor:e.nextCursor,omittedFileStats:e.omittedFileStats??[]},i=n.findIndex(e=>e.cursor===K);if(i===-1)return{key:W,cursor:K,slices:[...n,r]};let a=n[i];return a!==void 0&&a.patch===r.patch&&a.truncated===r.truncated&&a.nextCursor===r.nextCursor&&a.omittedFileStats.length===r.omittedFileStats.length&&a.omittedFileStats.every((e,t)=>{let n=r.omittedFileStats[t];return n!==void 0&&n.path===e.path&&n.additions===e.additions&&n.deletions===e.deletions})?t:{key:W,cursor:K,slices:[...n.slice(0,i),r]}})},[K,q.data,W]);let Mt=n(T.diff({environmentId:t,input:{...p,...U===null?{}:{commit:U}}})),Nt=H,Pt=Je(p),Ft=Ke(e=>e.addComment),It=Ke(e=>e.removeComment),Lt=S(T.replyToThread,{reportFailure:!1}),Rt=S(T.setThreadResolution,{reportFailure:!1}),zt=S(T.updateComment,{reportFailure:!1}),Bt=S(T.threadComments,{reportFailure:!1}),Vt=S(T.diffFileContents),Ht=(0,E.useMemo)(()=>Me(Vt,{environmentId:t,reference:p,commit:U,cacheKey:`pull-request:${H}:${v.updatedAt}:${U??`all`}`}),[U,v.updatedAt,t,Vt,p,H]),J=(0,E.useMemo)(()=>{let e=v.capabilities.review,t=v.viewerPermissions;return{inlineComment:e.inlineComment&&t.comment,reply:e.reply&&t.comment,resolve:e.resolve&&t.resolve}},[v.capabilities.review,v.viewerPermissions]),Ut=J.inlineComment&&U===null,Y=(0,E.useMemo)(()=>G.map(e=>{let t=`pull-request:${W}:${A}:${I}:${e.cursor??`first`}:${Se(e.patch)}`,n=kt.current.get(t);if(n)return n;let r=Ce(e.patch,t,{compactPartialHunkOffsets:!0,ignoreWhitespace:I});return r&&kt.current.set(t,r),r}),[G,A,W,I]),X=(0,E.useMemo)(()=>Y.flatMap(e=>e?.kind===`files`?at(e.files):[]),[Y]),Wt=(0,E.useMemo)(()=>X.map(e=>C(e)),[X]),Gt=v.capabilities.viewedFiles,Z=ht({environmentId:t,reference:p,enabled:Gt!==void 0,paths:Wt}),{setViewed:Kt,refresh:qt,enabled:Jt,isViewed:Yt,isStale:Xt}=Z,Zt=(0,E.useRef)(O);(0,E.useEffect)(()=>{Zt.current!==O&&(Zt.current=O,Ot({key:W,cursor:null,slices:R}),Mt(),qt())},[O,W,Mt,qt]);let Q=G.at(-1)?.nextCursor??null,Qt=G.some(e=>e.truncated)||Y.some(e=>e?.kind===`raw`),$t=(0,E.useMemo)(()=>{let e=new Set;if(U!==null)return e;for(let t of X){let n=C(t);for(let r of v.reviewThreads)r.path===n&&r.line!==null&&ot(t,r.side,r.line)&&e.add(r.id)}return e},[U,v.reviewThreads,X]),en=(0,E.useMemo)(()=>X.map(e=>{let t=Te(e),n=C(e),r=new Map,i=(e,t)=>{let n=`${e}:${t}`,i=r.get(n);if(i)return i;let a={side:e,line:t,threads:[],pending:[],draft:!1};return r.set(n,a),a};for(let e of v.reviewThreads)e.path===n&&e.line!==null&&$t.has(e.id)&&i(e.side,e.line).threads.push(e);if(U===null)for(let e of Pt){if(e.path!==n)continue;let t=Fe(e.position);i(t.side,t.line).pending.push(e)}if(B?.fileKey===t){let e=Fe(B.position);i(e.side,e.line).draft=!0}let a=[...r.values()].map(e=>({side:Ae(e.side),lineNumber:e.line,metadata:{threads:e.threads,pending:e.pending,draft:e.draft}}));return{fileKey:t,path:n,fileDiff:e,annotations:a,annotationsVersion:Se(a.map(({side:e,lineNumber:t,metadata:n})=>`${e}:${t}:${n.draft?`d`:``}:${n.pending.map(e=>`${e.id}:${e.body}`).join(`,`)}:${n.threads.map(e=>`${e.id}:${e.isResolved?`r`:``}:${e.isOutdated?`o`:``}:${e.comments.map(e=>`${e.id}:${e.author?.login??``}:${e.createdAt}:${e.body}:${(e.reactions??[]).map(e=>`${e.content}:${e.count}:${e.viewerHasReacted?`v`:``}`).join(`,`)}`).join(`;`)}`).join(`,`)}`).join(`|`))}}),[U,v.reviewThreads,B,X,Pt,$t]),$=(0,E.useMemo)(()=>en.map(({fileKey:e,path:t,fileDiff:n,annotations:r,annotationsVersion:i})=>{let a=st(e,N,it),o=Jt?`e${Yt(t)?`v`:``}${Xt(t)?`s`:``}`:``;return{id:e,type:`diff`,fileDiff:n,annotations:r,collapsed:a,version:Se(`${a?`1`:`0`}:${o}:${i}`)}}),[en,Jt,N,Yt,Xt,it]),tn=(0,E.useMemo)(()=>new Map(G.flatMap(e=>e.omittedFileStats.map(e=>[e.path,e]))),[G]),nn=(0,E.useMemo)(()=>new Map(Y.flatMap(e=>e?.kind===`files`?e.files.map((t,n)=>[Te(t),De([e.sourceFiles[n]??t])]):[])),[Y]),rn=(0,E.useMemo)(()=>$.map(e=>e.id),[$]),an=(0,E.useMemo)(()=>new Set($.filter(e=>e.collapsed===!0).map(e=>e.id)),[$]),on=ge(rn,an),sn=(0,E.useMemo)(()=>he(X),[X]),cn=Q!==null&&Q!==K&&!q.isPending&&q.error===null,ln=(0,E.useCallback)(()=>{Q!==null&&Ot(e=>({...e,cursor:Q}))},[Q]),[un,dn]=(0,E.useState)(null);(0,E.useEffect)(()=>{if(un===null||!cn)return;let e=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&ln()},{rootMargin:`240px`});return e.observe(un),()=>e.disconnect()},[cn,ln,un]);let fn=(0,E.useCallback)(e=>M(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),[]),pn=(0,E.useCallback)((e,t,n)=>{Kt(t,n),M(t=>ct(e,n,N,t))},[N,Kt]),mn=me(At,W),hn=(0,E.useCallback)(e=>{let t=$.find(t=>C(t.fileDiff)===e);t!==void 0&&(t.collapsed===!0&&fn(t.id),mn(t.id))},[$,mn,fn]),gn=(0,E.useRef)(null);(0,E.useEffect)(()=>{if(k!==null&&gn.current!==k.nonce){if(!$.some(e=>C(e.fileDiff)===k.path)){cn&&ln();return}gn.current=k.nonce,hn(k.path)}},[cn,$,ln,hn,k]);let _n=()=>{ft(ge(rn,an)?`expanded`:`folded`),M(new Set)},vn=(0,E.useMemo)(()=>v.commits.toSorted((e,t)=>Date.parse(t.committedDate)-Date.parse(e.committedDate)),[v.commits]),yn=(0,E.useCallback)((e,t)=>{if(!e||!Ut)return;let n=t.item;if(n.type!==`diff`)return;let r=X.find(e=>Te(e)===n.id);if(!r)return;let i=C(r),a=we(r),s=Y.flatMap(e=>e?.kind===`files`?e.sourceFiles:[]).find(e=>C(e)===i),c=e.endSide??e.side,l=(s&&o(s,e.end,c))??o(r,e.end,c);l!==null&&V({fileKey:n.id,path:i,oldPath:a===i?null:a,position:l,range:e})},[Ut,X,Y]),bn=(0,E.useCallback)((e,t,n)=>{let r=X.find(t=>Te(t)===e.fileKey),i=r===void 0?null:f({id:`pull-request-selection:${e.fileKey}:${e.range.start}:${e.range.end}`,sectionId:`pull-request:${v.number}`,sectionTitle:`PR #${v.number} review`,filePath:e.path,fileDiff:r,range:e.range,text:t});V(null),z(null),i!==null&&n(i)},[v.number,X]),xn=(0,E.useCallback)(()=>Q===null?null:(0,L.jsx)(`div`,{ref:dn,className:`flex items-center justify-center gap-2 py-2 text-xs text-muted-foreground`,children:q.error===null?q.isPending?`Loading more files...`:null:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`span`,{children:`The rest of this diff could not be loaded.`}),(0,L.jsx)(m,{size:`xs`,variant:`outline`,onClick:()=>q.refresh(),children:`Retry`})]})}),[Q,q.error,q.isPending,q.refresh]),Sn=(0,E.useCallback)(e=>{let t=e.collapsed===!0;return(0,L.jsx)(m,{size:`icon-micro`,variant:`ghost-muted`,"aria-expanded":!t,"aria-label":t?`Expand diff`:`Collapse diff`,className:`mr-1`,onClick:t=>{t.stopPropagation(),fn(e.id)},children:(0,L.jsx)(de,{className:`size-4`,icon:t?Qe.ChevronRight:Qe.ChevronDown})})},[fn]),Cn=(0,E.useRef)(Z);Cn.current=Z;let wn=(0,E.useRef)(pn);wn.current=pn;let Tn=(0,E.useCallback)(e=>{if(e.type!==`diff`)return null;let{additions:t,deletions:n}=nn.get(e.id)??De([e.fileDiff]),r=C(e.fileDiff);if(t===0&&n===0){let e=tn.get(r);e&&({additions:t,deletions:n}=e)}let i=(0,L.jsx)(We,{additions:t,deletions:n,className:`font-mono text-2xs`}),a=Cn.current;if(!a.enabled)return i;let o=a.isViewed(r),s=a.isStale(r);return(0,L.jsxs)(`span`,{className:`flex items-center gap-3`,children:[i,(0,L.jsxs)(`label`,{"data-viewed-toggle":``,className:`flex cursor-pointer select-none items-center gap-1.5 text-2xs text-muted-foreground`,onClick:e=>e.stopPropagation(),children:[(0,L.jsx)(Re,{"aria-label":s?`Changed`:`Viewed`,checked:o,onCheckedChange:t=>wn.current(e.id,r,t===!0)}),s?(0,L.jsxs)(x,{children:[(0,L.jsx)(y,{render:(0,L.jsx)(`span`,{className:`text-warning-foreground`}),children:`Changed`}),(0,L.jsx)(b,{side:`bottom`,children:`This file has been pushed to since you marked it viewed.`})]}):(0,L.jsx)(`span`,{className:`@max-xs:hidden`,children:`Viewed`})]})]})},[tn,nn]),En=(0,E.useMemo)(()=>({diffStyle:P===`split`?`split`:`unified`,lineDiffType:`none`,overflow:F?`wrap`:`scroll`,theme:Ee(A),preferredHighlighter:Xe,themeType:A,stickyHeaders:!0,loadDiffFiles:Ht,enableGutterUtility:Ut&&B===null,enableLineSelection:Ut&&B===null,onGutterUtilityClick:yn,onLineSelectionEnd:yn}),[P,F,A,Ht,Ut,B,yn]),Dn=(0,E.useCallback)(async(e,t)=>{if(Ct)return!1;wt(!0);let n=await t();return wt(!1),n._tag===`Failure`?(pe.add({type:`error`,title:e}),!1):(D(),!0)},[D,Ct]),On=(0,E.useCallback)(e=>(0,L.jsx)(Ie,{thread:e,workspaceRoot:v.workspaceRoot,canReply:J.reply,canResolve:J.resolve&&Ne(v,e),canReact:v.capabilities.reactions===!0,environmentId:t,reference:p,pending:Ct,fixPending:et===Ge({kind:`thread`,thread:e}),fixLabel:tt,...nt?{onFix:()=>nt({kind:`thread`,thread:e})}:{},onLoadMore:async n=>{let r=await Bt({environmentId:t,input:{...p,threadId:e.id,cursor:n}});return r._tag===`Failure`?(pe.add({type:`error`,title:`More comments could not be loaded`}),null):r.value},onReply:n=>Dn(`Reply could not be posted`,()=>Lt({environmentId:t,input:{...p,threadId:e.id,body:n}})),canEditComment:e=>ke(v,{author:e.author,kind:`review-comment`,canEdit:e.canEdit}),onEditComment:(e,n)=>Dn(`The comment could not be saved`,()=>zt({environmentId:t,input:{...p,commentId:e,kind:`review-comment`,body:n}})),onToggleResolved:()=>void Dn(`The conversation could not be updated`,()=>Rt({environmentId:t,input:{...p,threadId:e.id,resolved:!e.isResolved}})),onReacted:D},`${p.projectId}#${p.number}:${e.id}`),[v,t,tt,Bt,D,nt,et,p,Lt,J.reply,J.resolve,Dn,Rt,Ct,zt]),kn=(0,E.useCallback)(e=>(0,L.jsxs)(`div`,{className:`py-1 font-sans text-foreground`,children:[e.metadata.threads.map(On),e.metadata.pending.map(e=>(0,L.jsx)(Oe,{comment:e,onRemove:()=>It(Nt,e.id)},e.id)),e.metadata.draft&&B?(0,L.jsx)(Le,{kind:`draft`,rangeLabel:`${B.path}:${Fe(B.position).line}`,text:``,submitLabel:`Add to review`,...rt?{secondaryAction:{label:`Add to agent`,onAction:e=>bn(B,e,t=>rt({comment:t,request:e}))}}:{},onCancel:()=>{V(null),z(null)},onComment:e=>{Ft(Nt,{id:Ye(),path:B.path,...B.oldPath===null?{}:{oldPath:B.oldPath},position:B.position,body:e}),V(null),z(null)}}):null]}),[Ft,B,bn,rt,It,On,Nt]),An=vn.find(e=>e.oid===U);(0,E.useEffect)(()=>{U!==null&&An===void 0&&$e(null)},[U,$e,An]);let jn=An?An.messageHeadline:`All commits`,Mn=e=>{yt(e),V(null),z(null)},Nn=(0,L.jsxs)(`div`,{className:`@container flex h-10 min-h-10 shrink-0 items-center justify-between gap-2 border-b border-border/60 bg-background px-4 text-xs text-muted-foreground`,children:[(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-3`,children:[vn.length>0?(0,L.jsxs)(c,{children:[(0,L.jsxs)(d,{render:(0,L.jsx)(m,{size:`xs`,variant:`secondary`}),className:`min-w-0 max-w-64`,"aria-label":`Diff scope: ${jn}`,children:[(0,L.jsx)(`span`,{className:`truncate`,children:jn}),(0,L.jsx)(ne,{className:`size-3.5 shrink-0 opacity-70`})]}),(0,L.jsxs)(l,{align:`start`,className:`max-w-[min(28rem,calc(100vw-2rem))]`,children:[(0,L.jsxs)(u,{value:U??`all`,onValueChange:e=>$e(e===`all`?null:e),children:[(0,L.jsx)(s,{value:`all`,closeOnClick:!0,children:(0,L.jsx)(`span`,{children:`All commits`})}),vn.slice(0,lt).map(e=>(0,L.jsx)(s,{value:e.oid,closeOnClick:!0,children:(0,L.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,L.jsxs)(x,{children:[(0,L.jsx)(y,{render:(0,L.jsx)(`span`,{className:`min-w-0 truncate`,children:e.messageHeadline})}),(0,L.jsx)(b,{side:`top`,children:e.messageHeadline})]}),(0,L.jsx)(`span`,{className:`ml-auto shrink-0 font-mono text-xs text-muted-foreground`,children:e.oid.slice(0,7)})]})},e.oid))]}),vn.length>lt?(0,L.jsx)(a,{closeOnClick:!1,onClick:()=>ut(e=>e+gt),children:(0,L.jsxs)(`span`,{className:`text-muted-foreground`,children:[`Show more (`,vn.length-lt,` left)`]})}):null]})]}):null,(0,L.jsxs)(Ue,{children:[(0,L.jsxs)(`span`,{className:`shrink-0 tabular-nums`,children:[X.length,` `,X.length===1?`file`:`files`,Q===null?``:`+`]}),Z.enabled&&X.length>0?(0,L.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1 tabular-nums`,children:[(0,L.jsxs)(`span`,{className:`shrink-0`,children:[Z.viewedCount,` / `,X.length]}),(0,L.jsx)(`span`,{className:`truncate`,children:Gt===`environment`?`viewed in ${ue}`:`viewed`}),Gt===`environment`?(0,L.jsxs)(x,{children:[(0,L.jsx)(y,{render:(0,L.jsx)(`span`,{className:`flex shrink-0 items-center`}),children:(0,L.jsx)(ae,{"aria-label":`These ticks are kept here, not on the host`,className:`text-muted-foreground size-3.5`})}),(0,L.jsx)(b,{side:`bottom`,children:`This host keeps no shared record of which files you have read, so these ticks are kept by this environment. They follow you between the apps connected to it, but the host's own web UI will not show them.`})]}):null,Z.error===null?null:(0,L.jsxs)(x,{children:[(0,L.jsx)(y,{render:(0,L.jsx)(`span`,{className:`flex shrink-0 items-center`}),children:(0,L.jsx)(_,{"aria-label":`Your ticks could not be read`,className:`size-3.5 text-warning-foreground`})}),(0,L.jsxs)(b,{side:`bottom`,children:[`The boxes below are whatever was last read, and empty if nothing has been read yet. `,Z.error]})]}),Z.truncated?(0,L.jsxs)(x,{children:[(0,L.jsx)(y,{render:(0,L.jsx)(`span`,{className:`flex shrink-0 items-center`}),children:(0,L.jsx)(_,{"aria-label":`This count covers only part of the change`,className:`size-3.5 text-warning-foreground`})}),(0,L.jsx)(b,{side:`bottom`,children:`This change has more files than the host will report ticks for in one read, so the count is short and some boxes below start empty.`})]}):null]}):null,Qt?(0,L.jsxs)(x,{children:[(0,L.jsx)(y,{render:(0,L.jsx)(`span`,{className:`flex shrink-0 items-center`}),children:(0,L.jsx)(_,{"aria-label":`Some of this diff was not shown`,className:`size-3.5 text-warning-foreground`})}),(0,L.jsx)(b,{side:`bottom`,children:`The host withheld part of this diff — a binary file, or a change too large to inline.`})]}):null,U!==null&&J.inlineComment?(0,L.jsxs)(x,{children:[(0,L.jsx)(y,{render:(0,L.jsx)(`span`,{className:`flex shrink-0 items-center`}),children:(0,L.jsx)(oe,{"aria-label":`Line comments are written from the whole change`,className:`size-3.5`})}),(0,L.jsx)(b,{side:`bottom`,children:`A comment is anchored to the whole change, so switch to All commits to write one.`})]}):null]})]}),(0,L.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[(0,L.jsxs)(c,{children:[(0,L.jsxs)(x,{children:[(0,L.jsx)(y,{render:(0,L.jsx)(d,{render:(0,L.jsx)(m,{size:`icon-sm`,variant:`ghost`}),className:`@lg:hidden`,"aria-label":`Diff options`}),children:(0,L.jsx)(Ze,{className:`size-3.5`})}),(0,L.jsx)(b,{side:`top`,children:`Diff options`})]}),(0,L.jsxs)(l,{align:`end`,children:[(0,L.jsx)(r,{checked:I,onCheckedChange:e=>Mn(e),children:`Hide whitespace changes`}),(0,L.jsx)(r,{checked:F,onCheckedChange:e=>mt(e),children:`Wrap lines`}),(0,L.jsx)(ee,{}),(0,L.jsxs)(u,{value:P,onValueChange:e=>{(e===`stacked`||e===`split`)&&pt({diffLayout:e})},children:[(0,L.jsx)(s,{value:`stacked`,closeOnClick:!0,children:`Stacked`}),(0,L.jsx)(s,{value:`split`,closeOnClick:!0,children:`Split`})]})]})]}),(0,L.jsxs)(`div`,{className:`hidden items-center gap-1 @lg:flex`,children:[(0,L.jsxs)(x,{children:[(0,L.jsx)(y,{render:(0,L.jsx)(w,{"aria-label":I?`Show whitespace changes`:`Hide whitespace changes`,variant:`ghost`,size:`sm`,pressed:I,onPressedChange:e=>Mn(!!e)}),children:(0,L.jsx)(se,{className:`size-3.5`})}),(0,L.jsx)(b,{side:`top`,children:I?`Show whitespace changes`:`Hide whitespace changes`})]}),(0,L.jsxs)(ze,{"aria-label":`Diff layout`,className:`shrink-0`,variant:`segmented`,value:[P],onValueChange:e=>{let t=e[0];(t===`stacked`||t===`split`)&&pt({diffLayout:t})},children:[(0,L.jsx)(w,{"aria-label":`Stacked diff view`,value:`stacked`,children:(0,L.jsx)(ce,{className:`size-3.5`})}),(0,L.jsx)(w,{"aria-label":`Split diff view`,value:`split`,children:(0,L.jsx)(re,{className:`size-3.5`})})]}),(0,L.jsxs)(x,{children:[(0,L.jsx)(y,{render:(0,L.jsx)(w,{"aria-label":F?`Disable diff line wrapping`:`Enable diff line wrapping`,variant:`ghost`,size:`sm`,pressed:F,onPressedChange:e=>{mt(!!e)}}),children:(0,L.jsx)(le,{className:`size-3.5`})}),(0,L.jsx)(b,{side:`top`,children:F?`Disable line wrapping`:`Enable line wrapping`})]})]}),rn.length>0?(0,L.jsx)(m,{type:`button`,size:`icon-sm`,variant:`ghost`,"aria-label":on?`Expand all files`:`Collapse all files`,onClick:_n,children:(0,L.jsx)(de,{className:`size-3.5`,icon:on?Qe.ChevronsUpDown:Qe.ChevronsDownUp})}):null,rn.length>0?(0,L.jsxs)(x,{children:[(0,L.jsx)(y,{render:(0,L.jsx)(w,{"aria-label":bt?`Hide file tree`:`Show file tree`,variant:`ghost`,size:`sm`,pressed:bt,onPressedChange:e=>xt(!!e)}),children:(0,L.jsx)(ie,{className:`size-3.5`})}),(0,L.jsx)(b,{side:`top`,children:bt?`Hide file tree`:`Show file tree`})]}):null]})]}),Pn=t=>(0,L.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[Nn,(0,L.jsx)(`div`,{ref:e,className:`min-h-0 flex-1 overflow-auto`,children:t})]});if(q.isPending&&G.length===0)return Pn((0,L.jsx)(je,{label:`Loading pull request diff...`}));if(q.error&&G.length===0)return Pn((0,L.jsx)(`p`,{className:`px-4 py-5 text-sm text-muted-foreground`,children:q.error}));let Fn=Q===null?Y.flatMap(e=>e?.kind===`raw`?[e]:[]):[];if(X.length===0&&Fn.length>0)return Pn((0,L.jsx)(`div`,{className:`space-y-4 px-4 py-5`,children:Fn.map(e=>(0,L.jsxs)(`div`,{className:`space-y-2`,children:[(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.reason}),(0,L.jsx)(`pre`,{className:`whitespace-pre-wrap break-words font-mono text-xs`,children:e.text})]},`${e.reason}:${e.text.slice(0,64)}`))}));if($.length===0&&Q===null)return Pn((0,L.jsx)(`p`,{className:`px-4 py-5 text-sm text-muted-foreground`,children:U===null?`This pull request has no file changes.`:`This commit has no file changes.`}));let In=v.reviewThreads.filter(e=>!$t.has(e.id)),Ln=new Map;for(let e of In){let t=Ln.get(e.path);t?t.push(e):Ln.set(e.path,[e])}let Rn=Fn.length===0?null:(0,L.jsx)(`div`,{className:`space-y-4 border-t border-border/60 px-4 py-5`,children:Fn.map(e=>(0,L.jsxs)(`div`,{className:`space-y-2`,children:[(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.reason}),(0,L.jsx)(`pre`,{className:`whitespace-pre-wrap break-words font-mono text-xs`,children:e.text})]},`${e.reason}:${e.text.slice(0,64)}`))});return(0,L.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[Nn,Ln.size>0?(0,L.jsx)(`div`,{className:`shrink-0 border-b border-border/60`,children:(0,L.jsxs)(He,{open:Tt,onOpenChange:Et,children:[(0,L.jsx)(`h2`,{children:(0,L.jsxs)(Ve,{className:`flex w-full items-center gap-1.5 px-4 py-2 text-left text-xs text-muted-foreground`,children:[(0,L.jsx)(`span`,{children:Q===null?`Conversations not on the current diff`:`Conversations not on the diff loaded so far`}),(0,L.jsx)(g,{"aria-hidden":!0,className:h(`size-3.5 transition-transform`,Tt&&`rotate-90`)}),(0,L.jsx)(`span`,{"aria-hidden":!0,className:`tabular-nums`,children:In.length}),(0,L.jsx)(`span`,{className:`sr-only`,children:In.length===1?`1 conversation`:`${In.length} conversations`})]})}),(0,L.jsx)(Be,{children:(0,L.jsx)(`div`,{className:`max-h-64 space-y-3 overflow-auto px-4 pb-3`,children:[...Ln].map(([e,t])=>(0,L.jsxs)(`div`,{children:[(0,L.jsxs)(x,{children:[(0,L.jsx)(y,{render:(0,L.jsx)(`p`,{className:`truncate px-3 text-xs text-muted-foreground`,children:e})}),(0,L.jsx)(b,{side:`top`,children:e})]}),(0,L.jsx)(`div`,{className:`mt-1 space-y-2`,children:t.map(e=>(0,L.jsxs)(`div`,{children:[e.line===null?null:(0,L.jsxs)(`p`,{className:`px-3 text-xs text-muted-foreground`,children:[`Line `,e.line]}),On(e)]},e.id))})]},e))})})]})}):null,(0,L.jsxs)(`div`,{className:`flex min-h-0 flex-1 overflow-hidden`,children:[(0,L.jsx)(`div`,{className:`relative min-h-0 min-w-0 flex-1`,onClickCapture:e=>{let t=e.nativeEvent.composedPath?.()??[];for(let e of t)if(e instanceof HTMLElement){if(e instanceof HTMLButtonElement||e instanceof HTMLAnchorElement||e.hasAttribute(`data-viewed-toggle`))return;if(e.hasAttribute(`data-diffs-header`)){let t=e.querySelector(`[data-title]`)?.textContent?.trim();if(t===void 0||t===``)return;let n=$.find(e=>C(e.fileDiff)===t);n!==void 0&&fn(n.id);return}}},children:(0,L.jsx)(Pe,{className:`@container h-full overflow-auto [scrollbar-gutter:stable]`,containerRef:e,viewerRef:jt,items:$,selectedLines:St,onSelectedLinesChange:z,options:En,renderCodeViewFooter:xn,renderHeaderPrefix:Sn,renderHeaderMetadata:Tn,renderAnnotation:kn,onRevealSearchMatch:e=>M(t=>ct(e.id,!1,N,t)),unsafeCSSExtra:vt})}),bt?(0,L.jsx)(`aside`,{className:`flex w-[min(20rem,40%)] min-w-48 shrink-0 border-l border-border/60`,children:(0,L.jsx)(_e,{ariaLabel:`Pull request #${v.number} files`,entries:sn,onSelectFile:hn,footer:Q===null?null:(0,L.jsx)(`div`,{className:`shrink-0 border-t border-border/60 p-2`,children:(0,L.jsx)(m,{type:`button`,size:`xs`,variant:`outline`,className:`w-full`,disabled:q.isPending,onClick:q.error===null?ln:()=>q.refresh(),children:q.error===null?q.isPending?`Loading more files...`:`Load more files`:`Retry`})})})}):null]}),Rn]})}export{yt as default};
|
|
6
|
-
//# sourceMappingURL=PullRequestCodeTab-DwqL4aAJ.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{ma as n,t as r,wx as i}from"./utils-DmS758az.js";import{a,n as o,t as s}from"./tooltip-Df-4YKs5.js";var c=i(),l=e(t(),1),u=e(n(),1),d=`abcdefghjkmnpqrstuvwxyz23456789`;function f(e){let t=2166136261;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=Math.imul(t,16777619);let n=()=>(t=Math.imul(t^t>>>13,2246822507),t=Math.imul(t^t>>>16,3266489909),d[Math.abs(t)%31]??`x`);return Array.from(e,e=>e===`@`||e===`.`||e===`-`||e===`_`?e:n()).join(``)}function p(e){let t=(0,c.c)(17),[n,i]=(0,l.useState)(!1),d;t[0]===e.value?d=t[1]:(d=e.value?.trim(),t[0]=e.value,t[1]=d);let p=d,h;t[2]===p?h=t[3]:(h=p?f(p):``,t[2]=p,t[3]=h);let g=h;if(!p)return null;let _=n?`text-muted-foreground`:`select-none text-muted-foreground blur-xs`,v;t[4]!==e.className||t[5]!==_?(v=r(`min-w-0 cursor-pointer rounded-sm font-mono text-2xs leading-normal transition hover:text-foreground`,_,e.className),t[4]=e.className,t[5]=_,t[6]=v):v=t[6];let y;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(y=()=>i(m),t[7]=y):y=t[7];let b=n?p:g,x;t[8]!==e.ariaLabel||t[9]!==v||t[10]!==b?(x=(0,u.jsx)(a,{render:(0,u.jsx)(`button`,{type:`button`,className:v,onClick:y,"aria-label":e.ariaLabel,children:b})}),t[8]=e.ariaLabel,t[9]=v,t[10]=b,t[11]=x):x=t[11];let S=n?e.hideTooltip:e.revealTooltip,C;t[12]===S?C=t[13]:(C=(0,u.jsx)(o,{side:`top`,children:S}),t[12]=S,t[13]=C);let w;return t[14]!==x||t[15]!==C?(w=(0,u.jsxs)(s,{children:[x,C]}),t[14]=x,t[15]=C,t[16]=w):w=t[16],w}function m(e){return!e}export{f as n,p as t};
|
|
2
|
-
//# sourceMappingURL=RedactedSensitiveText-citJBx4E.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{Bt as n,Gc as r,Jn as i,Mt as a,Un as o,Vo as s,Vt as c,Wn as l,Xn as u,al as d,ar as f,er as p,fm as m,ma as h,or as g,qt as _,t as v,wx as y}from"./utils-DmS758az.js";import{t as b}from"./chevron-down-DHV04o66.js";import{t as x}from"./clock-3-SBiWJYHb.js";import{t as S}from"./copy-CoM62e83.js";import{t as C}from"./inbox-48iST-IJ.js";import{t as w}from"./pencil-CnxrJI7X.js";import{t as T}from"./play-Bvcnzkvl.js";import{t as E}from"./plus-Cr075-cy.js";import{t as D}from"./trash-2-CiyAV2xI.js";import{L as ee,Pt as O,U as te}from"./runtime-CCr9UADV.js";import{C as k}from"./entities-DNKDCsf2.js";import{a as ne,n as A,t as j}from"./tooltip-Df-4YKs5.js";import{a as M,c as N,o as P,s as F,t as I}from"./select-BiARKKgd.js";import{t as L}from"./link-YLDgrmSN.js";import{i as R,p as z}from"./toast-Bm36EaG6.js";import{C as B,S as re,et as V,f as H}from"./useSettings-CckatJFa.js";import{f as U,t as ie}from"./server-B26doYv6.js";import{n as ae}from"./session-CQXL-cTI.js";import{n as oe}from"./query-CK8MOmXr.js";import{t as W}from"./use-atom-command-CiEeUGsC.js";import{n as se}from"./toastHelpers-Dsph6LwL.js";import{h as ce,i as G,m as K,u as q}from"./queries-Cn1FJB1_.js";import{a as J}from"./timestampFormat-wac2e_Jz.js";import{t as le}from"./textarea-DZLyhzuZ.js";import{n as ue,t as Y}from"./toggle-group-_C7nJPTT.js";import{a as de,c as X,l as Z,n as fe,o as pe,r as me,s as he,t as ge}from"./combobox-DixSlhgy.js";import{t as _e}from"./input-u5qjnfMr.js";import{n as ve}from"./scroll-area-CsrtHuL8.js";import{a as ye,c as be,i as xe,n as Se,o as Ce,r as we,s as Te,t as Ee}from"./dialog-DhJeevKt.js";import{a as De,i as Oe,o as ke,r as Ae,t as je}from"./empty-uoiaKPHo.js";import{n as Me}from"./EnvironmentMachineIcon-DMZGa766.js";import{_ as Ne,a as Pe,i as Fe,n as Ie,s as Le,u as Re,z as ze}from"./settingsLayout-BzyY4qHt.js";import{n as Be}from"./primaryCloudLinkState-N7pLty-_.js";import{a as Ve,i as He,n as Ue,r as We,s as Ge,t as Ke}from"./scheduledTasksSettings.logic-ozIaTRfT.js";import{Do as qe,Ea as Je,Ia as Ye,Ti as Xe,Vo as Ze,cn as Qe,xn as $e}from"./main-D9z9rMK1.js";import{t as et}from"./ProviderModelPicker-CpgHpUCG.js";var tt=y(),Q=e(t(),1),$=e(h(),1);function nt(e){let t=(0,tt.c)(69),{items:n,filteredItems:r,value:i,query:a,resultsQuery:o,onQueryChange:s,open:c,onOpenChange:l,onSelectItem:u,hasNextPage:d,isFetchingNextPage:f,onLoadNext:p,statusText:m,originControl:h,popupProps:g,renderItem:_,getItemType:y,children:b}=e,x=(0,Q.useRef)(null),S=(0,Q.useId)(),C=(0,Q.useRef)(null),w=(0,Q.useRef)(null),T;t[0]===l?T=t[1]:(T=e=>{w.current=null,e||(x.current=null),l(e)},t[0]=l,t[1]=T);let E=T,[D,ee]=(0,Q.useState)(!1),[O,te]=(0,Q.useState)(!1),k;t[2]!==d||t[3]!==f||t[4]!==p?(k=()=>{d&&!f&&p()},t[2]=d,t[3]=f,t[4]=p,t[5]=k):k=t[5];let M=k,N;t[6]!==M||t[7]!==d||t[8]!==f||t[9]!==c?(N=()=>{let e=C.current;if(!e)return;let t=w.current;w.current=e.scrollTop,c&&d&&!f&&ce({previousScrollTop:t,scrollTop:e.scrollTop,scrollHeight:e.scrollHeight,clientHeight:e.clientHeight})&&M()},t[6]=M,t[7]=d,t[8]=f,t[9]=c,t[10]=N):N=t[10];let P=N,F=(0,Q.useRef)(null),I;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(I=()=>{let e=F.current?.getScrollableNode?.();if(!(e instanceof HTMLElement))return;C.current=e;let t=Math.max(0,e.scrollHeight-e.clientHeight);ee(e.scrollTop>1),te(t-e.scrollTop>1)},t[11]=I):I=t[11];let L=I,R,z;t[12]===c?(R=t[13],z=t[14]):(R=()=>{if(!c)return;let e=0,t=requestAnimationFrame(()=>{L(),e=requestAnimationFrame(L)});return()=>{cancelAnimationFrame(t),cancelAnimationFrame(e)}},z=[c,L],t[12]=c,t[13]=R,t[14]=z),(0,Q.useLayoutEffect)(R,z);let B=(0,Q.useRef)(null),re,V;t[15]!==c||t[16]!==o?(re=()=>{if(!c){B.current=null;return}B.current!==o&&(B.current=o,F.current?.scrollToOffset?.({offset:0,animated:!1}))},V=[o,c],t[15]=c,t[16]=o,t[17]=re,t[18]=V):(re=t[17],V=t[18]),(0,Q.useEffect)(re,V);let H;t[19]===c?H=t[20]:(H=(e,t)=>{x.current=typeof e==`string`?e:null,!(!c||t.index<0||t.reason!==`keyboard`)&&F.current?.scrollIndexIntoView?.({index:t.index,animated:!1})},t[19]=c,t[20]=H);let U;t[21]===s?U=t[22]:(U=e=>s(e.target.value),t[21]=s,t[22]=U);let ie;t[23]!==r||t[24]!==u?(ie=e=>{if(e.key!==`Enter`||e.nativeEvent.isComposing||e.keyCode===229)return;let t=x.current;t!==null&&r.includes(t)&&(e.preventBaseUIHandler?.(),e.preventDefault(),e.stopPropagation(),x.current=null,u(t))},t[23]=r,t[24]=u,t[25]=ie):ie=t[25];let ae;t[26]!==a||t[27]!==U||t[28]!==ie?(ae=(0,$.jsx)(he,{placeholder:`Search refs...`,value:a,onChange:U,onKeyDown:ie}),t[26]=a,t[27]=U,t[28]=ie,t[29]=ae):ae=t[29];let oe;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,$.jsx)(fe,{children:`No refs found.`}),t[30]=oe):oe=t[30];let W;t[31]===y?W=t[32]:(W=y?{getItemType:y}:{},t[31]=y,t[32]=W);let se;t[33]===_?se=t[34]:(se=e=>{let{item:t,index:n}=e;return _(t,n)},t[33]=_,t[34]=se);let G;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(G=()=>{L(),w.current=C.current?.scrollTop??null},t[35]=G):G=t[35];let K;t[36]===P?K=t[37]:(K=()=>{L(),P()},t[36]=P,t[37]=K);let q;t[38]!==O||t[39]!==D?(q=v(`max-h-56 scrollbar-gutter-stable overflow-x-hidden overscroll-y-contain ps-1 pe-0 pt-2 pb-1`,ve({top:D,bottom:O})),t[38]=O,t[39]=D,t[40]=q):q=t[40];let J;t[41]!==r||t[42]!==W||t[43]!==se||t[44]!==K||t[45]!==q?(J=(0,$.jsx)(`div`,{className:`relative min-h-0 w-full max-h-56 flex-1 overflow-hidden`,children:(0,$.jsx)(de,{className:`size-full min-w-0`,children:(0,$.jsx)($e,{ref:F,data:r,keyExtractor:rt,...W,renderItem:se,estimatedItemSize:28,drawDistance:336,onLayout:G,onScroll:K,className:q})})}),t[41]=r,t[42]=W,t[43]=se,t[44]=K,t[45]=q,t[46]=J):J=t[46];let le;t[47]!==h||t[48]!==S?(le=h?(0,$.jsxs)(j,{children:[(0,$.jsx)(ne,{render:(0,$.jsxs)(`label`,{htmlFor:S,className:`flex cursor-pointer items-center justify-between gap-3 border-t border-border/60 px-3 py-2 text-xs`,children:[(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5 font-medium text-muted-foreground`,children:[(0,$.jsx)(Ye,{"aria-hidden":`true`,className:`size-3 shrink-0`}),(0,$.jsx)(`span`,{className:`truncate`,children:`Start from origin`})]}),(0,$.jsx)(Je,{id:S,checked:h.checked,size:`sm`,"aria-label":`Start worktree from origin`,onCheckedChange:e=>h.onCheckedChange(!!e)})]})}),(0,$.jsx)(A,{side:`top`,className:`max-w-72 whitespace-normal`,children:`Creates the worktree from the latest matching branch on origin instead of your local branch.`})]}):null,t[47]=h,t[48]=S,t[49]=le):le=t[49];let ue;t[50]===m?ue=t[51]:(ue=m?(0,$.jsx)(X,{children:m}):null,t[50]=m,t[51]=ue);let Y;t[52]!==J||t[53]!==le||t[54]!==ue?(Y=(0,$.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden`,children:[oe,J,le,ue]}),t[52]=J,t[53]=le,t[54]=ue,t[55]=Y):Y=t[55];let Z;t[56]!==g||t[57]!==ae||t[58]!==Y?(Z=(0,$.jsxs)(pe,{...g,children:[ae,Y]}),t[56]=g,t[57]=ae,t[58]=Y,t[59]=Z):Z=t[59];let me;return t[60]!==b||t[61]!==r||t[62]!==E||t[63]!==n||t[64]!==c||t[65]!==Z||t[66]!==H||t[67]!==i?(me=(0,$.jsxs)(ge,{items:n,filteredItems:r,autoHighlight:!0,virtualized:!0,onItemHighlighted:H,onOpenChange:E,open:c,value:i,children:[b,Z]}),t[60]=b,t[61]=r,t[62]=E,t[63]=n,t[64]=c,t[65]=Z,t[66]=H,t[67]=i,t[68]=me):me=t[68],me}function rt(e){return e}function it(e){let t=(0,tt.c)(15),{branch:n,projectCwd:r,index:i,value:a,disabled:o,onClick:s,onContextMenu:c}=e,l=n.name,u=n.worktreePath&&r&&n.worktreePath!==r,d=n.current?`current`:u?`worktree`:n.isRemote?`remote`:n.isDefault?`default`:null,f=a??l,p;t[0]===l?p=t[1]:(p=(0,$.jsx)(Qe,{value:l,className:`flex-1`}),t[0]=l,t[1]=p);let m;t[2]===d?m=t[3]:(m=d&&(0,$.jsx)(`span`,{className:`shrink-0 text-3xs text-muted-foreground/45`,children:d}),t[2]=d,t[3]=m);let h;t[4]!==p||t[5]!==m?(h=(0,$.jsxs)(`div`,{className:`flex w-full min-w-0 items-center justify-between gap-2`,children:[p,m]}),t[4]=p,t[5]=m,t[6]=h):h=t[6];let g;return t[7]!==o||t[8]!==i||t[9]!==l||t[10]!==s||t[11]!==c||t[12]!==f||t[13]!==h?(g=(0,$.jsx)(me,{disabled:o,hideIndicator:!0,index:i,value:f,onClick:s,onContextMenu:c,children:h},l),t[7]=o,t[8]=i,t[9]=l,t[10]=s,t[11]=c,t[12]=f,t[13]=h,t[14]=g):g=t[14],g}function at(e,t){if(e.url!==null)return{address:e.url,copyable:!0,note:null};if(t===null)return{address:e.path,copyable:!1,note:`Link this environment to P4 Connect for a public URL.`};let n=new URL(e.path,t);return{address:n.href,copyable:!0,note:O(n.hostname)?`Only this computer can call this address. Link P4 Connect for a public URL.`:`Works wherever this environment's address is reachable, for example over Tailscale or your own proxy. Link P4 Connect for a public URL.`}}function ot(e){let t=(0,tt.c)(58),{environmentId:n,cwd:r,value:i,onValueChange:a,startFromOrigin:o,onStartFromOriginChange:s,disabled:c,id:l}=e,u=c!==void 0&&c,[d,f]=(0,Q.useState)(!1),[p,m]=(0,Q.useState)(``),h;t[0]===p?h=t[1]:(h=p.trim(),t[0]=p,t[1]=h);let _=(0,Q.useDeferredValue)(h),v;t[2]===_?v=t[3]:(v=K(_),t[2]=_,t[3]=v);let y;t[4]!==r||t[5]!==n||t[6]!==v?(y={environmentId:n,cwd:r,query:v},t[4]=r,t[5]=n,t[6]=v,t[7]=y):y=t[7];let x=G(y),S;t[8]!==r||t[9]!==n||t[10]!==i?(S=r&&i?q.listRefs({environmentId:n,input:{cwd:r,query:i,limit:10}}):null,t[8]=r,t[9]=n,t[10]=i,t[11]=S):S=t[11];let C=oe(S),w;t[12]!==x.refs||t[13]!==C||t[14]!==i?(w=x.refs.find(e=>e.name===i)??C.data?.refs.find(e=>e.name===i),t[12]=x.refs,t[13]=C,t[14]=i,t[15]=w):w=t[15];let T=w,E=i||null,D=T?T.isRemote===!0:null,ee;t[16]!==o||t[17]!==E||t[18]!==D?(ee=Ne({activeWorktreePath:null,effectiveEnvMode:`worktree`,resolvedActiveBranch:E,resolvedActiveBranchIsRemote:D,startFromOrigin:o}),t[16]=o,t[17]=E,t[18]=D,t[19]=ee):ee=t[19];let O=ee,te;t[20]===x.refs?te=t[21]:(te=new Map(x.refs.map(st)),t[20]=x.refs,t[21]=te);let k=te,ne;t[22]===k?ne=t[23]:(ne=[...k.keys()],t[22]=k,t[23]=ne);let A=ne,j=x.data?.nextCursor!=null,M=x.error??(x.isPending&&x.data===null?`Loading refs...`:x.isFetchingNextPage?`Loading more refs...`:j?`Showing ${x.refs.length} of ${x.data?.totalCount} refs`:null),N;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(N=e=>{f(e),e||m(``)},t[24]=N):N=t[24];let P=N,F=i||null,I=d&&!u,L;t[25]===a?L=t[26]:(L=e=>{a(e),P(!1)},t[25]=a,t[26]=L);let R;t[27]!==s||t[28]!==o?(R={checked:o,onCheckedChange:s},t[27]=s,t[28]=o,t[29]=R):R=t[29];let z;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(z={align:`start`,side:`bottom`,className:`flex w-80 flex-col`},t[30]=z):z=t[30];let B;t[31]!==k||t[32]!==r||t[33]!==a?(B=(e,t)=>{let n=k.get(e);return n?(0,$.jsx)(it,{branch:n,projectCwd:r,index:t,onClick:()=>{a(n.name),P(!1)}}):null},t[31]=k,t[32]=r,t[33]=a,t[34]=B):B=t[34];let re=u||!r,V;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,$.jsx)(g,{variant:`outline`,size:`sm`}),t[35]=V):V=t[35];let H;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,$.jsx)(qe,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[36]=H):H=t[36];let U;t[37]===O?U=t[38]:(U=(0,$.jsx)(Qe,{value:O,className:`flex-1 text-left`}),t[37]=O,t[38]=U);let ie;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,$.jsx)(b,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[39]=ie):ie=t[39];let ae;t[40]!==l||t[41]!==re||t[42]!==U?(ae=(0,$.jsxs)(Z,{id:l,disabled:re,render:V,className:`w-full justify-between `,children:[H,U,ie]}),t[40]=l,t[41]=re,t[42]=U,t[43]=ae):ae=t[43];let W;return t[44]!==x.isFetchingNextPage||t[45]!==x.loadNext||t[46]!==_||t[47]!==j||t[48]!==A||t[49]!==p||t[50]!==M||t[51]!==F||t[52]!==I||t[53]!==L||t[54]!==R||t[55]!==B||t[56]!==ae?(W=(0,$.jsx)(nt,{items:A,filteredItems:A,value:F,query:p,resultsQuery:_,onQueryChange:m,open:I,onOpenChange:P,onSelectItem:L,hasNextPage:j,isFetchingNextPage:x.isFetchingNextPage,onLoadNext:x.loadNext,statusText:M,originControl:R,popupProps:z,renderItem:B,children:ae}),t[44]=x.isFetchingNextPage,t[45]=x.loadNext,t[46]=_,t[47]=j,t[48]=A,t[49]=p,t[50]=M,t[51]=F,t[52]=I,t[53]=L,t[54]=R,t[55]=B,t[56]=ae,t[57]=W):W=t[57],W}function st(e){return[e.name,e]}var ct=[1,2,3,4,5,6,0],lt=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],ut=[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],dt={worktree:`Create a new worktree`,root:`Use the project checkout`,existing_worktree:`Use a specific checkout`},ft={editingId:null,title:``,prompt:``,enabled:!0,scheduleMode:`fixed`,intervalMinutes:`15`,timeOfDay:`09:00`,weekdays:new Set([1,2,3,4,5]),projectId:``,threadId:``,workspaceMode:`worktree`,baseRef:`main`,startFromOrigin:!0,existingWorktreePath:``,modelKey:``,runtimeMode:`full-access`,interactionMode:`default`,baseModelSelection:null,signatureEnabled:!1,...Ke,signatureSecret:``,maxDeliveryAgeMinutes:``};function pt(e){let t=(0,tt.c)(11),{label:n,hint:r,htmlFor:i,children:a}=e,o;t[0]===n?o=t[1]:(o=(0,$.jsx)(`span`,{children:n}),t[0]=n,t[1]=o);let s;t[2]===r?s=t[3]:(s=r?(0,$.jsx)(`span`,{className:`font-normal text-2xs text-muted-foreground/80`,children:r}):null,t[2]=r,t[3]=s);let c;t[4]!==i||t[5]!==o||t[6]!==s?(c=(0,$.jsxs)(Xe,{className:`flex items-baseline justify-between`,htmlFor:i,children:[o,s]}),t[4]=i,t[5]=o,t[6]=s,t[7]=c):c=t[7];let l;return t[8]!==a||t[9]!==c?(l=(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[c,a]}),t[8]=a,t[9]=c,t[10]=l):l=t[10],l}function mt(e){let t=e.indexOf(`:`);return t<=0||t===e.length-1?null:{instanceId:m.make(e.slice(0,t)),model:e.slice(t+1)}}function ht(e){if(e.type===`webhook`)return`On webhook`;if(e.type===`interval`){let t=e.everyMs/6e4;return Number.isInteger(t)?`Every ${t} min`:`Every ${Math.round(e.everyMs/1e3)} sec`}let t=e.weekdays??[];return`${t.length===0?`Daily`:t.length===5&&t.every(e=>e>=1&&e<=5)?`Weekdays`:t.map(e=>lt[e]).join(`, `)} at ${e.timeOfDay}`}function gt(e){if(!e)return`Not scheduled`;let t=new Date(e).getTime()-Date.now();if(t<=0){let t=J(e);return t?t.suffix?`${t.value} ${t.suffix}`:t.value:`Not scheduled`}let n=Math.ceil(t/6e4);if(n<2)return`in under a minute`;if(n<60)return`in ${n}m`;let r=Math.round(n/60);return r<24?`in ${r}h`:`in ${Math.round(r/24)}d`}var _t={accepted:`Ran`,dispatch_failed:`Run failed`,rejected_signature:`Bad signature`,disabled:`Task paused`,rate_limited:`Rate limited`,expired:`Too old`};function vt(e){return e===`accepted`?`success`:e===`disabled`||e===`rate_limited`||e===`expired`?`warning`:`error`}function yt(e){return e===`failed`?`error`:e===`succeeded`?`success`:e===`running`?`info`:`outline`}function bt(e){let t=(0,tt.c)(29),{scope:n,environments:r,connectedEnvironments:i,environment:a}=ze(),o;t[0]!==e.environmentId||t[1]!==e.threadId?(o=()=>e.threadId&&e.environmentId?{environmentId:e.environmentId,task:null}:null,t[0]=e.environmentId,t[1]=e.threadId,t[2]=o):o=t[2];let[c,l]=(0,Q.useState)(o),u;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=(e,t)=>{l({environmentId:e,task:t})},t[3]=u):u=t[3];let d=u,f=a??i[0],p;t[4]===f?.environmentId?p=t[5]:(p=U.upsertScheduledTask.permissionAtom(f?.environmentId??null),t[4]=f?.environmentId,t[5]=p);let m=s(p),h=!f||!m,_;t[6]===f?_=t[7]:(_=()=>f&&l({environmentId:f.environmentId,task:null}),t[6]=f,t[7]=_);let v;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsx)(E,{className:`size-3`}),t[8]=v):v=t[8];let y;t[9]!==h||t[10]!==_?(y=(0,$.jsxs)(g,{size:`xs`,variant:`ghost-muted`,disabled:h,onClick:_,children:[v,`New task`]}),t[9]=h,t[10]=_,t[11]=y):y=t[11];let b;t[12]!==f?.environmentId||t[13]!==r||t[14]!==n.kind||t[15]!==n.message||t[16]!==e.environmentId||t[17]!==e.taskId?(b=n.kind===`unavailable`?(0,$.jsx)(Le,{title:`Unavailable selection`,children:(0,$.jsx)(Pe,{title:n.message})}):r.length===0?(0,$.jsx)(je,{children:(0,$.jsxs)(Oe,{children:[(0,$.jsx)(De,{variant:`icon`,children:(0,$.jsx)(x,{})}),(0,$.jsx)(ke,{children:`No environments available`}),(0,$.jsx)(Ae,{children:`Connect an environment to manage scheduled tasks.`})]})}):(0,$.jsx)(`div`,{className:`space-y-8`,children:r.map(t=>(0,$.jsx)(xt,{environment:t,showEnvironmentHeading:r.length>1,taskId:(e.environmentId??f?.environmentId)===t.environmentId?e.taskId:void 0,onEdit:d},`${t.environmentId}:${e.taskId??``}`))}),t[12]=f?.environmentId,t[13]=r,t[14]=n.kind,t[15]=n.message,t[16]=e.environmentId,t[17]=e.taskId,t[18]=b):b=t[18];let S;t[19]!==y||t[20]!==b?(S=(0,$.jsx)(Le,{title:`Scheduled tasks`,variant:`plain`,headerAction:y,children:b}),t[19]=y,t[20]=b,t[21]=S):S=t[21];let C;t[22]!==c||t[23]!==e.projectId||t[24]!==e.threadId?(C=c?(0,$.jsx)(kt,{initialThreadId:e.threadId,initialProjectId:e.projectId,initialEnvironmentId:c.environmentId,task:c.task,onClose:()=>l(null)},`${c.environmentId}:${c.task?.id??`new`}`):null,t[22]=c,t[23]=e.projectId,t[24]=e.threadId,t[25]=C):C=t[25];let w;return t[26]!==S||t[27]!==C?(w=(0,$.jsxs)(Fe,{children:[S,C]}),t[26]=S,t[27]=C,t[28]=w):w=t[28],w}function xt(e){let t=(0,tt.c)(13),{environment:n,showEnvironmentHeading:r,taskId:i,onEdit:a}=e,{scope:o}=ze(),s=n.connection.phase===`connected`&&n.serverConfig!==null,c;t[0]!==s||t[1]!==n.environmentId?(c=s?U.scheduledTasksLive({environmentId:n.environmentId,input:{}}):null,t[0]=s,t[1]=n.environmentId,t[2]=c):c=t[2];let l=oe(c),u=l.data?.tasks.filter(e=>Ue(o,n.environmentId,e.projectId)),f=u?.find(e=>e.id===i),p=(0,Q.useRef)(!1);(0,Q.useEffect)(()=>{!p.current&&f&&(p.current=!0,a(n.environmentId,f))},[n.environmentId,f,a]),Re(6e4);let m=Le,h=n.label,g=!r,_;t[3]===n.serverConfig?_=t[4]:(_=d(n.serverConfig),t[3]=n.serverConfig,t[4]=_);let v;t[5]===_?v=t[6]:(v=(0,$.jsx)(Me,{kind:_,className:`size-3.5`}),t[5]=_,t[6]=v);let y=s?l.error?(0,$.jsx)(Pe,{title:`Could not load scheduled tasks`,description:l.error}):u?(0,$.jsxs)($.Fragment,{children:[i&&!f?(0,$.jsx)(Pe,{title:`Task unavailable`,description:`This task no longer exists or is outside the selected project scope.`,role:`status`}):null,u.length===0?(0,$.jsx)(Pe,{title:`No scheduled tasks`,description:`No tasks match this environment and project selection.`}):u.map(e=>(0,$.jsx)(St,{environmentId:n.environmentId,task:e,onEdit:()=>a(n.environmentId,e)},e.id))]}):(0,$.jsx)(Pe,{title:`Loading scheduled tasks…`,role:`status`}):(0,$.jsx)(Pe,{title:`Environment disconnected`,description:`Reconnect ${n.label} to view its scheduled tasks.`}),b;return t[7]!==m||t[8]!==n.label||t[9]!==g||t[10]!==v||t[11]!==y?(b=(0,$.jsx)(m,{title:h,hideTitle:g,icon:v,children:y}),t[7]=m,t[8]=n.label,t[9]=g,t[10]=v,t[11]=y,t[12]=b):b=t[12],b}function St(e){let t=(0,tt.c)(77),{environmentId:n,task:r,onEdit:a}=e,c;t[0]===n?c=t[1]:(c=U.upsertScheduledTask.permissionAtom(n),t[0]=n,t[1]=c);let d=s(c),[m,h]=(0,Q.useState)(!1),[_,v]=(0,Q.useState)(!1),y=r.schedule.type===`webhook`,b;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(b={label:`scheduled task enabled`},t[2]=b):b=t[2];let x=W(U.setScheduledTaskEnabled,b),S;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(S={label:`scheduled task run now`},t[3]=S):S=t[3];let E=W(U.runScheduledTaskNow,S),O;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(O={label:`scheduled task delete`},t[4]=O):O=t[4];let k=W(U.deleteScheduledTask,O),ne;t[5]!==m||t[6]!==n||t[7]!==k||t[8]!==E||t[9]!==r.enabled||t[10]!==r.id||t[11]!==x?(ne=async e=>{if(m||!ae(n,`orchestration:operate`))return;h(!0);let t=e===`toggle`?await x({environmentId:n,input:{id:r.id,enabled:!r.enabled}}):e===`run`?await E({environmentId:n,input:{id:r.id}}):await k({environmentId:n,input:{id:r.id}});h(!1),t._tag===`Failure`&&!ee(t)&&R.add(se({type:`error`,title:`Could not update scheduled task`,description:String(te(t))}))},t[5]=m,t[6]=n,t[7]=k,t[8]=E,t[9]=r.enabled,t[10]=r.id,t[11]=x,t[12]=ne):ne=t[12];let A=ne,j=r.title,M;t[13]===r.prompt?M=t[14]:(M=(0,$.jsx)(`span`,{className:`line-clamp-2`,children:r.prompt}),t[13]=r.prompt,t[14]=M);let N;t[15]===r.schedule?N=t[16]:(N=ht(r.schedule),t[15]=r.schedule,t[16]=N);let P;t[17]!==y||t[18]!==r.enabled||t[19]!==r.nextRunAt?(P=r.enabled?y?`Listening`:r.nextRunAt?`Next run ${gt(r.nextRunAt)}`:`Not scheduled`:`Paused`,t[17]=y,t[18]=r.enabled,t[19]=r.nextRunAt,t[20]=P):P=t[20];let F;t[21]!==N||t[22]!==P?(F=(0,$.jsxs)(`span`,{children:[N,` ·`,` `,P]}),t[21]=N,t[22]=P,t[23]=F):F=t[23];let I;t[24]===r.lastRunStatus?I=t[25]:(I=r.lastRunStatus===`never`?null:(0,$.jsx)(o,{variant:yt(r.lastRunStatus),children:r.lastRunStatus}),t[24]=r.lastRunStatus,t[25]=I);let L;t[26]===r.lastRunError?L=t[27]:(L=r.lastRunError?(0,$.jsx)(`span`,{className:`text-destructive`,children:r.lastRunError}):null,t[26]=r.lastRunError,t[27]=L);let z;t[28]!==F||t[29]!==I||t[30]!==L?(z=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[F,I,L]}),t[28]=F,t[29]=I,t[30]=L,t[31]=z):z=t[31];let B=m||!d,re=`Enable ${r.title}`,V;t[32]===A?V=t[33]:(V=()=>void A(`toggle`),t[32]=A,t[33]=V);let H;t[34]!==B||t[35]!==re||t[36]!==V||t[37]!==r.enabled?(H=(0,$.jsx)(Je,{checked:r.enabled,disabled:B,"aria-label":re,onCheckedChange:V}),t[34]=B,t[35]=re,t[36]=V,t[37]=r.enabled,t[38]=H):H=t[38];let ie=m||!d,oe=`Actions for ${r.title}`,ce;t[39]!==ie||t[40]!==oe?(ce=(0,$.jsx)(g,{size:`icon-sm`,variant:`ghost`,disabled:ie,"aria-label":oe}),t[39]=ie,t[40]=oe,t[41]=ce):ce=t[41];let G;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,$.jsx)(Ze,{className:`size-4`}),t[42]=G):G=t[42];let K;t[43]===ce?K=t[44]:(K=(0,$.jsx)(f,{render:ce,children:G}),t[43]=ce,t[44]=K);let q;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,$.jsx)(w,{}),t[45]=q):q=t[45];let J;t[46]===a?J=t[47]:(J=(0,$.jsxs)(i,{onClick:a,children:[q,`Edit`]}),t[46]=a,t[47]=J);let le;t[48]!==A||t[49]!==y?(le=y?(0,$.jsxs)(i,{onClick:()=>v(!0),children:[(0,$.jsx)(C,{}),`Deliveries`]}):(0,$.jsxs)(i,{onClick:()=>void A(`run`),children:[(0,$.jsx)(T,{}),`Run now`]}),t[48]=A,t[49]=y,t[50]=le):le=t[50];let ue;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(ue=(0,$.jsx)(p,{}),t[51]=ue):ue=t[51];let Y;t[52]===A?Y=t[53]:(Y=()=>void A(`delete`),t[52]=A,t[53]=Y);let de;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(de=(0,$.jsx)(D,{}),t[54]=de):de=t[54];let X;t[55]===Y?X=t[56]:(X=(0,$.jsxs)(i,{onClick:Y,children:[de,`Delete`]}),t[55]=Y,t[56]=X);let Z;t[57]!==J||t[58]!==le||t[59]!==X?(Z=(0,$.jsxs)(u,{align:`end`,children:[J,le,ue,X]}),t[57]=J,t[58]=le,t[59]=X,t[60]=Z):Z=t[60];let fe;t[61]!==K||t[62]!==Z?(fe=(0,$.jsxs)(l,{children:[K,Z]}),t[61]=K,t[62]=Z,t[63]=fe):fe=t[63];let pe;t[64]!==_||t[65]!==n||t[66]!==r?(pe=_?(0,$.jsx)(Ct,{environmentId:n,task:r,onClose:()=>v(!1)}):null,t[64]=_,t[65]=n,t[66]=r,t[67]=pe):pe=t[67];let me;t[68]!==H||t[69]!==fe||t[70]!==pe?(me=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[H,fe,pe]}),t[68]=H,t[69]=fe,t[70]=pe,t[71]=me):me=t[71];let he;return t[72]!==z||t[73]!==me||t[74]!==M||t[75]!==r.title?(he=(0,$.jsx)(Pe,{title:j,description:M,status:z,control:me}),t[72]=z,t[73]=me,t[74]=M,t[75]=r.title,t[76]=he):he=t[76],he}function Ct(e){let t=(0,tt.c)(38),{environmentId:n,task:r,onClose:i}=e,a;t[0]!==n||t[1]!==r.id?(a=U.scheduledTaskWebhookDeliveries({environmentId:n,input:{id:r.id}}),t[0]=n,t[1]=r.id,t[2]=a):a=t[2];let s=oe(a),[c,l]=(0,Q.useState)(null),u;t[3]!==n||t[4]!==c||t[5]!==r.id?(u=c===null?null:U.scheduledTaskWebhookDelivery({environmentId:n,input:{id:r.id,deliveryId:c}}),t[3]=n,t[4]=c,t[5]=r.id,t[6]=u):u=t[6];let d=oe(u),f=s.data?.deliveries??null,p=d.data?.delivery??null,m=c===null?s.error:d.error,h;t[7]===i?h=t[8]:(h=e=>{e||i()},t[7]=i,t[8]=h);let _;t[9]===r.title?_=t[10]:(_=(0,$.jsxs)(be,{children:[`Deliveries · `,r.title]}),t[9]=r.title,t[10]=_);let v;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsx)(we,{children:`Recent requests to this task's webhook URL.`}),t[11]=v):v=t[11];let y;t[12]===_?y=t[13]:(y=(0,$.jsxs)(ye,{children:[_,v]}),t[12]=_,t[13]=y);let b;t[14]===m?b=t[15]:(b=m?(0,$.jsx)(`p`,{className:`text-sm text-destructive`,children:m}):null,t[14]=m,t[15]=b);let x;t[16]!==f||t[17]!==p||t[18]!==c||t[19]!==d.error?(x=c!==null&&p===null&&d.error===null?(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,role:`status`,children:`Loading delivery…`}):p?(0,$.jsxs)(`div`,{className:`space-y-4`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-sm`,children:[(0,$.jsx)(o,{variant:vt(p.outcome),children:_t[p.outcome]}),(0,$.jsxs)(`span`,{children:[p.method,` · `,gt(p.receivedAt)]}),p.signatureVerified?(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:`Signature verified`}):null]}),p.error?(0,$.jsx)(`p`,{className:`text-sm text-destructive`,children:p.error}):null,(0,$.jsx)(Tt,{title:`Prompt sent to the agent`,children:p.renderedPrompt??`No run was started for this request.`}),p.missingFields.length>0?(0,$.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Empty placeholders: `,p.missingFields.join(`, `)]}):null,(0,$.jsx)(Tt,{title:`Headers`,children:Object.entries(p.headers).map(wt).join(`
|
|
2
|
-
`)}),p.query?(0,$.jsx)(Tt,{title:`Query`,children:p.query}):null,(0,$.jsx)(Tt,{title:p.bodyTruncated?`Body (truncated)`:`Body`,children:p.body||`(empty)`})]}):c===null?f===null?(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,role:`status`,children:`Loading deliveries…`}):f.length===0?(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No requests yet.`}):(0,$.jsx)(`ul`,{className:`divide-y divide-border`,children:f.map(e=>(0,$.jsx)(`li`,{children:(0,$.jsxs)(`button`,{type:`button`,className:`flex w-full flex-wrap items-center gap-2 py-2 text-left text-sm hover:bg-accent/40`,onClick:()=>l(e.id),children:[(0,$.jsx)(o,{variant:vt(e.outcome),children:_t[e.outcome]}),(0,$.jsx)(`span`,{children:e.method}),(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:gt(e.receivedAt)}),e.missingFields.length>0?(0,$.jsxs)(`span`,{className:`text-muted-foreground`,children:[e.missingFields.length,` empty placeholder`,e.missingFields.length===1?``:`s`]}):null]})},e.id))}):null,t[16]=f,t[17]=p,t[18]=c,t[19]=d.error,t[20]=x):x=t[20];let S;t[21]!==b||t[22]!==x?(S=(0,$.jsxs)(Ce,{children:[b,x]}),t[21]=b,t[22]=x,t[23]=S):S=t[23];let C;t[24]!==s.isPending||t[25]!==s.refresh||t[26]!==c?(C=c===null?(0,$.jsx)(g,{variant:`outline`,size:`sm`,disabled:s.isPending,onClick:s.refresh,children:`Refresh`}):(0,$.jsx)(g,{variant:`outline`,size:`sm`,onClick:()=>l(null),children:`Back`}),t[24]=s.isPending,t[25]=s.refresh,t[26]=c,t[27]=C):C=t[27];let w;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,$.jsx)(Se,{render:(0,$.jsx)(g,{size:`sm`}),children:`Done`}),t[28]=w):w=t[28];let T;t[29]===C?T=t[30]:(T=(0,$.jsxs)(xe,{children:[C,w]}),t[29]=C,t[30]=T);let E;t[31]!==T||t[32]!==y||t[33]!==S?(E=(0,$.jsxs)(Te,{className:`max-w-2xl`,children:[y,S,T]}),t[31]=T,t[32]=y,t[33]=S,t[34]=E):E=t[34];let D;return t[35]!==E||t[36]!==h?(D=(0,$.jsx)(Ee,{open:!0,onOpenChange:h,children:E}),t[35]=E,t[36]=h,t[37]=D):D=t[37],D}function wt(e){let[t,n]=e;return`${t}: ${n}`}function Tt(e){let t=(0,tt.c)(7),{title:n,children:r}=e,i;t[0]===n?i=t[1]:(i=(0,$.jsx)(Xe,{children:n}),t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=(0,$.jsx)(`pre`,{className:`max-h-64 overflow-auto rounded-md bg-muted p-2 text-xs whitespace-pre-wrap break-all`,children:r}),t[2]=r,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function Et(e){let t=(0,tt.c)(40),{environmentId:n,task:r}=e,i;t[0]===n?i=t[1]:(i=U.rotateScheduledTaskWebhookToken.permissionAtom(n),t[0]=n,t[1]=i);let a=s(i),o=B(n),c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c={target:`webhook URL`},t[2]=c):c=t[2];let{copyToClipboard:l,isCopied:u}=z(c),d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d={label:`scheduled task rotate webhook token`},t[3]=d):d=t[3];let f=W(U.rotateScheduledTaskWebhookToken,d),[p,m]=(0,Q.useState)(!1),h=r?.webhook;if(!r||!h){let e;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`The URL appears after you save.`}),t[4]=e):e=t[4],e}let _;t[5]!==h||t[6]!==o?(_=at(h,o),t[5]=h,t[6]=o,t[7]=_):_=t[7];let{address:v,copyable:y,note:b}=_,x;t[8]!==n||t[9]!==f||t[10]!==r?(x=async()=>{if(!(await V(`Rotate this webhook URL?
|
|
3
|
-
The current URL stops working.`,{variant:`destructive`})??window.confirm(`Rotate this webhook URL? The current URL stops working.`)))return;m(!0);let e=await f({environmentId:n,input:{id:r.id}});m(!1),e._tag===`Failure`&&!ee(e)&&R.add(se({type:`error`,title:`Could not rotate webhook URL`,description:String(te(e))}))},t[8]=n,t[9]=f,t[10]=r,t[11]=x):x=t[11];let C=x,w;t[12]===v?w=t[13]:(w=(0,$.jsx)(_e,{readOnly:!0,"aria-label":`Webhook URL`,value:v,onFocus:Dt}),t[12]=v,t[13]=w);let T=!y,E;t[14]!==l||t[15]!==v?(E=()=>l(v,void 0),t[14]=l,t[15]=v,t[16]=E):E=t[16];let D;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,$.jsx)(S,{}),t[17]=D):D=t[17];let O=u?`Copied`:`Copy`,k;t[18]!==O||t[19]!==T||t[20]!==E?(k=(0,$.jsxs)(g,{size:`sm`,variant:`outline`,type:`button`,disabled:T,onClick:E,children:[D,O]}),t[18]=O,t[19]=T,t[20]=E,t[21]=k):k=t[21];let ne=p||!a,A;t[22]===C?A=t[23]:(A=()=>void C(),t[22]=C,t[23]=A);let j;t[24]!==ne||t[25]!==A?(j=(0,$.jsx)(g,{size:`sm`,variant:`outline`,type:`button`,disabled:ne,onClick:A,children:`Rotate`}),t[24]=ne,t[25]=A,t[26]=j):j=t[26];let M;t[27]!==k||t[28]!==j||t[29]!==w?(M=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[w,k,j]}),t[27]=k,t[28]=j,t[29]=w,t[30]=M):M=t[30];let N;t[31]===b?N=t[32]:(N=b===null?null:(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:b}),t[31]=b,t[32]=N);let P;t[33]!==h.url||t[34]!==n?(P=h.url===null?null:(0,$.jsx)(Ot,{environmentId:n}),t[33]=h.url,t[34]=n,t[35]=P):P=t[35];let F;return t[36]!==M||t[37]!==N||t[38]!==P?(F=(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[M,N,P]}),t[36]=M,t[37]=N,t[38]=P,t[39]=F):F=t[39],F}function Dt(e){return e.currentTarget.select()}function Ot(e){let t=(0,tt.c)(3),{environmentId:n}=e,r=Be();if(r.target?.environmentId!==n||r.data===null)return null;let i=r.data.holdWebhooksWhileOffline?`Held for up to 24 hours while this environment is offline. `:`Forwarded live. Requests fail while this environment is offline. `,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(L,{to:`/settings/connections`,className:`underline underline-offset-2`,children:`Change in Connections`}),t[0]=a):a=t[0];let o;return t[1]===i?o=t[2]:(o=(0,$.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[i,a]}),t[1]=i,t[2]=o),o}function kt(e){let t=(0,tt.c)(203),{initialEnvironmentId:i,initialThreadId:o,initialProjectId:l,task:u,onClose:f}=e,{scope:p,connectedEnvironments:m}=ze(),[h,v]=(0,Q.useState)(i),y=re(h),b=y?.connection.phase===`connected`&&y.serverConfig!==null,x;t[0]!==b||t[1]!==h?(x=b?U.scheduledTasksLive({environmentId:h,input:{}}):null,t[0]=b,t[1]=h,t[2]=x):x=t[2];let S=oe(x),C=k(),w;if(t[3]!==C||t[4]!==h||t[5]!==p){let e;t[7]!==h||t[8]!==p?(e=e=>e.environmentId===h&&Ue(p,h,e.id),t[7]=h,t[8]=p,t[9]=e):e=t[9],w=C.filter(e),t[3]=C,t[4]=h,t[5]=p,t[6]=w}else w=t[6];let T=w,E=H(h),D=s(U.providersValueAtom(h))??ie,O;t[10]===h?O=t[11]:(O=U.upsertScheduledTask.permissionAtom(h),t[10]=h,t[11]=O);let ne=s(O),A;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(A={label:`scheduled task upsert`},t[12]=A):A=t[12];let j=W(U.upsertScheduledTask,A),L;t[13]!==l||t[14]!==o||t[15]!==T[0]?.id||t[16]!==u?(L=()=>u?Ve(u):{...ft,projectId:l??T[0]?.id??``,threadId:o??``},t[13]=l,t[14]=o,t[15]=T[0]?.id,t[16]=u,t[17]=L):L=t[17];let[R,z]=(0,Q.useState)(L),[B,V]=(0,Q.useState)(!1),se=(0,Q.useRef)(!1),ce;t[18]!==R.editingId||t[19]!==S.data?(ce=R.editingId!==null&&S.data!==null&&!S.data.tasks.some(e=>e.id===R.editingId),t[18]=R.editingId,t[19]=S.data,t[20]=ce):ce=t[20];let G=ce,K;t[21]!==R.editingId||t[22]!==u||t[23]!==S.data?(K=S.data?S.data.tasks.find(e=>e.id===R.editingId)??null:u,t[21]=R.editingId,t[22]=u,t[23]=S.data,t[24]=K):K=t[24];let q=K,J=R.projectId||T[0]?.id||``,de;if(t[25]!==T||t[26]!==J){let e;t[28]===J?e=t[29]:(e=e=>e.id===J,t[28]=J,t[29]=e),de=T.find(e),t[25]=T,t[26]=J,t[27]=de}else de=t[27];let X=de;X?.id;let Z;t[30]!==D||t[31]!==X?.id||t[32]!==E?(Z=_(n(c(D),E,X?.id??null)),t[30]=D,t[31]=X?.id,t[32]=E,t[33]=Z):Z=t[33];let fe=Z,pe=fe[0],me;t[34]===R.modelKey?me=t[35]:(me=R.modelKey?mt(R.modelKey):null,t[34]=R.modelKey,t[35]=me);let he=me,ge;t[36]!==he||t[37]!==fe||t[38]!==X||t[39]!==E?(ge=he&&fe.some(e=>e.instanceId===he.instanceId&&e.enabled)?he:He(E,X??null,fe),t[36]=he,t[37]=fe,t[38]=X,t[39]=E,t[40]=ge):ge=t[40];let ve=ge,De=ve?.instanceId??pe?.instanceId??``,Oe=ve?.model??``,ke;t[41]!==De||t[42]!==Oe||t[43]!==D||t[44]!==E?(ke=a(E,D,De,Oe),t[41]=De,t[42]=Oe,t[43]=D,t[44]=E,t[45]=ke):ke=t[45];let Ae=ke,je=Pt,Ne;t[46]!==ve||t[47]!==b||t[48]!==R||t[49]!==G||t[50]!==h||t[51]!==q||t[52]!==f||t[53]!==T||t[54]!==B||t[55]!==J||t[56]!==S.data||t[57]!==j?(Ne=async()=>{if(!ae(h,`orchestration:operate`)||se.current||B||G||!b||S.data===null)return;let e=ve;if(!R.title.trim()||!R.prompt.trim()||!T.some(e=>e.id===J)||e===null){je(`Scheduled task is incomplete`,`Add a title, prompt, project, and model.`);return}let t=We(R);if(t===null){je(`Invalid age limit`,`Enter whole minutes from 1 to ${r}, or leave it blank.`);return}if(t.type===`webhook`&&t.signature&&(!t.signature.header||!t.signature.secret&&!(q?.schedule.type===`webhook`&&q.webhook?.hasSecret))){je(`Signing secret is required`,`Enter the signature header and secret.`);return}if(t.type===`interval`&&(!Number.isSafeInteger(t.everyMs)||t.everyMs<6e4)){je(`Invalid interval`,`Enter an interval of at least one minute.`);return}if(R.workspaceMode===`existing_worktree`&&!R.existingWorktreePath.trim()){je(`Checkout path is required`,`Enter the path of the checkout to run in.`);return}let n=R.baseModelSelection!==null&&R.baseModelSelection.instanceId===e.instanceId&&R.baseModelSelection.model===e.model?R.baseModelSelection:e,i=R.workspaceMode===`root`?{type:`root`}:R.workspaceMode===`existing_worktree`?{type:`existing_worktree`,worktreePath:R.existingWorktreePath.trim()}:{type:`worktree`,baseRef:R.baseRef.trim()||`main`,startFromOrigin:R.startFromOrigin},a={...R.editingId?{id:R.editingId,requireExisting:!0}:{},title:R.title.trim(),prompt:R.prompt.trim(),enabled:R.enabled,schedule:t,projectId:J,threadId:R.threadId?R.threadId:null,workspaceStrategy:i,modelSelection:n,runtimeMode:R.runtimeMode,interactionMode:R.interactionMode,creationSource:`web`};se.current=!0,V(!0);let o=await j({environmentId:h,input:a});if(V(!1),o._tag===`Failure`){se.current=!1,ee(o)||je(`Could not save scheduled task`,te(o));return}f()},t[46]=ve,t[47]=b,t[48]=R,t[49]=G,t[50]=h,t[51]=q,t[52]=f,t[53]=T,t[54]=B,t[55]=J,t[56]=S.data,t[57]=j,t[58]=Ne):Ne=t[58];let Pe=Ne,Fe;t[59]!==f||t[60]!==B?(Fe=e=>{!e&&!B&&f()},t[59]=f,t[60]=B,t[61]=Fe):Fe=t[61];let Le=R.editingId?`Edit task`:`New task`,Re;t[62]===Le?Re=t[63]:(Re=(0,$.jsx)(be,{children:Le}),t[62]=Le,t[63]=Re);let Be;t[64]===Symbol.for(`react.memo_cache_sentinel`)?(Be=(0,$.jsx)(we,{children:`Run a prompt automatically — on an interval, at a fixed time, or when a webhook is called.`}),t[64]=Be):Be=t[64];let Ke;t[65]===Re?Ke=t[66]:(Ke=(0,$.jsxs)(ye,{children:[Re,Be]}),t[65]=Re,t[66]=Ke);let qe;t[67]===b?qe=t[68]:(qe=b?null:(0,$.jsx)(`p`,{className:`text-sm text-destructive`,children:`Reconnect this environment before saving.`}),t[67]=b,t[68]=qe);let Ye=u!==null||B,Ze;t[69]===m?Ze=t[70]:(Ze=e=>{let t=m.find(t=>t.environmentId===e);t&&(v(t.environmentId),z(Nt))},t[69]=m,t[70]=Ze);let Qe=y?.serverConfig??null,$e;t[71]===Qe?$e=t[72]:($e=d(Qe),t[71]=Qe,t[72]=$e);let nt;t[73]===$e?nt=t[74]:(nt=(0,$.jsx)(Me,{kind:$e,className:`size-4`}),t[73]=$e,t[74]=nt);let rt=y?.label??`Unavailable environment`,it;t[75]!==nt||t[76]!==rt?(it=(0,$.jsx)(F,{id:`scheduled-task-environment`,size:`sm`,children:(0,$.jsx)(N,{children:(0,$.jsxs)(`span`,{className:`flex items-center gap-2`,children:[nt,rt]})})}),t[75]=nt,t[76]=rt,t[77]=it):it=t[77];let at;t[78]===m?at=t[79]:(at=m.map(Mt),t[78]=m,t[79]=at);let st;t[80]===at?st=t[81]:(st=(0,$.jsx)(P,{children:at}),t[80]=at,t[81]=st);let lt;t[82]!==h||t[83]!==Ye||t[84]!==Ze||t[85]!==it||t[86]!==st?(lt=(0,$.jsx)(pt,{label:`Runs on`,htmlFor:`scheduled-task-environment`,children:(0,$.jsxs)(I,{value:h,disabled:Ye,onValueChange:Ze,children:[it,st]})}),t[82]=h,t[83]=Ye,t[84]=Ze,t[85]=it,t[86]=st,t[87]=lt):lt=t[87];let ut;t[88]===S.error?ut=t[89]:(ut=S.error?(0,$.jsx)(`p`,{className:`text-sm text-destructive`,role:`status`,children:S.error}):null,t[88]=S.error,t[89]=ut);let ht;t[90]===G?ht=t[91]:(ht=G?(0,$.jsx)(`p`,{className:`text-xs text-destructive`,role:`status`,children:`This scheduled task no longer exists.`}):null,t[90]=G,t[91]=ht);let gt;t[92]===Symbol.for(`react.memo_cache_sentinel`)?(gt=e=>z(t=>({...t,title:e.target.value})),t[92]=gt):gt=t[92];let _t;t[93]===R.title?_t=t[94]:(_t=(0,$.jsx)(pt,{label:`Name`,htmlFor:`scheduled-task-title`,children:(0,$.jsx)(_e,{id:`scheduled-task-title`,placeholder:`e.g. Check for Sentry issues`,value:R.title,onChange:gt})}),t[93]=R.title,t[94]=_t);let vt;t[95]===Symbol.for(`react.memo_cache_sentinel`)?(vt=e=>z(t=>({...t,projectId:e??``})),t[95]=vt):vt=t[95];let yt=X?.title,bt;t[96]===yt?bt=t[97]:(bt=(0,$.jsx)(F,{size:`sm`,id:`scheduled-task-project`,children:(0,$.jsx)(N,{placeholder:`Select a project`,children:yt})}),t[96]=yt,t[97]=bt);let xt;t[98]===T?xt=t[99]:(xt=T.map(jt),t[98]=T,t[99]=xt);let St;t[100]===xt?St=t[101]:(St=(0,$.jsx)(P,{children:xt}),t[100]=xt,t[101]=St);let Ct;t[102]!==J||t[103]!==bt||t[104]!==St?(Ct=(0,$.jsx)(pt,{label:`Project`,htmlFor:`scheduled-task-project`,children:(0,$.jsxs)(I,{value:J,onValueChange:vt,children:[bt,St]})}),t[102]=J,t[103]=bt,t[104]=St,t[105]=Ct):Ct=t[105];let wt;t[106]===Symbol.for(`react.memo_cache_sentinel`)?(wt=e=>z(t=>({...t,workspaceMode:e})),t[106]=wt):wt=t[106];let Tt=dt[R.workspaceMode],Dt;t[107]===Tt?Dt=t[108]:(Dt=(0,$.jsx)(F,{size:`sm`,id:`scheduled-task-workspace`,children:(0,$.jsx)(N,{children:Tt})}),t[107]=Tt,t[108]=Dt);let Ot;t[109]===Symbol.for(`react.memo_cache_sentinel`)?(Ot=(0,$.jsxs)(P,{children:[(0,$.jsx)(M,{value:`worktree`,children:`Create a new worktree`}),(0,$.jsx)(M,{value:`root`,children:`Use the project checkout`}),(0,$.jsx)(M,{value:`existing_worktree`,children:`Use a specific checkout`})]}),t[109]=Ot):Ot=t[109];let kt;t[110]!==R.workspaceMode||t[111]!==Dt?(kt=(0,$.jsx)(pt,{label:`Workspace`,htmlFor:`scheduled-task-workspace`,children:(0,$.jsxs)(I,{value:R.workspaceMode,onValueChange:wt,children:[Dt,Ot]})}),t[110]=R.workspaceMode,t[111]=Dt,t[112]=kt):kt=t[112];let Ft;t[113]!==Ct||t[114]!==kt?(Ft=(0,$.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[Ct,kt]}),t[113]=Ct,t[114]=kt,t[115]=Ft):Ft=t[115];let It;t[116]!==b||t[117]!==R.baseRef||t[118]!==R.startFromOrigin||t[119]!==R.workspaceMode||t[120]!==h||t[121]!==B||t[122]!==X?.workspaceRoot||t[123]!==J?(It=R.workspaceMode===`worktree`?(0,$.jsx)(pt,{label:`Base branch`,htmlFor:`scheduled-task-base-ref`,children:(0,$.jsx)(ot,{id:`scheduled-task-base-ref`,environmentId:h,cwd:X?.workspaceRoot??null,value:R.baseRef,onValueChange:e=>z(t=>({...t,baseRef:e})),startFromOrigin:R.startFromOrigin,onStartFromOriginChange:e=>z(t=>({...t,startFromOrigin:e})),disabled:B||!b},`${h}:${J}`)}):null,t[116]=b,t[117]=R.baseRef,t[118]=R.startFromOrigin,t[119]=R.workspaceMode,t[120]=h,t[121]=B,t[122]=X?.workspaceRoot,t[123]=J,t[124]=It):It=t[124];let Lt;t[125]!==R.existingWorktreePath||t[126]!==R.workspaceMode?(Lt=R.workspaceMode===`existing_worktree`?(0,$.jsx)(pt,{label:`Checkout path`,htmlFor:`scheduled-task-checkout`,children:(0,$.jsx)(_e,{id:`scheduled-task-checkout`,value:R.existingWorktreePath,placeholder:`/path/to/checkout`,onChange:e=>z(t=>({...t,existingWorktreePath:e.target.value}))})}):null,t[125]=R.existingWorktreePath,t[126]=R.workspaceMode,t[127]=Lt):Lt=t[127];let Rt;t[128]===Symbol.for(`react.memo_cache_sentinel`)?(Rt=e=>z(t=>({...t,prompt:e.target.value})),t[128]=Rt):Rt=t[128];let zt;t[129]===R.prompt?zt=t[130]:(zt=(0,$.jsx)(pt,{label:`Prompt`,htmlFor:`scheduled-task-prompt`,children:(0,$.jsx)(le,{id:`scheduled-task-prompt`,className:`max-h-64 overflow-y-auto`,placeholder:`What should the agent do each time this runs?`,value:R.prompt,onChange:Rt})}),t[129]=R.prompt,t[130]=zt);let Bt=B||!b,Vt;t[131]===Symbol.for(`react.memo_cache_sentinel`)?(Vt=(e,t)=>z(n=>({...n,modelKey:`${e}:${t}`})),t[131]=Vt):Vt=t[131];let Ht;t[132]!==De||t[133]!==Oe||t[134]!==h||t[135]!==fe||t[136]!==Ae||t[137]!==Bt?(Ht=(0,$.jsx)(pt,{label:`Model`,children:(0,$.jsx)(`div`,{children:(0,$.jsx)(et,{environmentId:h,disabled:Bt,activeInstanceId:De,model:Oe,lockedProvider:null,instanceEntries:fe,modelOptionsByInstance:Ae,isComposerOwned:!1,triggerClassName:Ie,onInstanceModelChange:Vt})})}),t[132]=De,t[133]=Oe,t[134]=h,t[135]=fe,t[136]=Ae,t[137]=Bt,t[138]=Ht):Ht=t[138];let Ut;t[139]===u?Ut=t[140]:(Ut=u?.schedule.type===`interval`&&u.schedule.everyMs<6e4?(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,role:`status`,children:`This task uses a legacy interval below one minute. Saving updates it to at least one minute.`}):null,t[139]=u,t[140]=Ut);let Wt;t[141]===Symbol.for(`react.memo_cache_sentinel`)?(Wt=(0,$.jsx)(Xe,{children:`Schedule`}),t[141]=Wt):Wt=t[141];let Gt;t[142]===R.scheduleMode?Gt=t[143]:(Gt=[R.scheduleMode],t[142]=R.scheduleMode,t[143]=Gt);let Kt,qt,Jt,Yt;t[144]===Symbol.for(`react.memo_cache_sentinel`)?(Kt=e=>{let t=e[0];(t===`fixed`||t===`interval`||t===`webhook`)&&z(e=>({...e,scheduleMode:t,prompt:t===`webhook`&&!e.prompt.trim()?Ge:e.prompt}))},qt=(0,$.jsx)(Y,{value:`fixed`,children:`At a time`}),Jt=(0,$.jsx)(Y,{value:`interval`,children:`Every interval`}),Yt=(0,$.jsx)(Y,{value:`webhook`,children:`On webhook`}),t[144]=Kt,t[145]=qt,t[146]=Jt,t[147]=Yt):(Kt=t[144],qt=t[145],Jt=t[146],Yt=t[147]);let Xt;t[148]===Gt?Xt=t[149]:(Xt=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[Wt,(0,$.jsxs)(ue,{"aria-label":`Schedule type`,value:Gt,onValueChange:Kt,children:[qt,Jt,Yt]})]}),t[148]=Gt,t[149]=Xt);let Zt;t[150]!==R.intervalMinutes||t[151]!==R.maxDeliveryAgeMinutes||t[152]!==R.scheduleMode||t[153]!==R.signatureEnabled||t[154]!==R.signatureEncoding||t[155]!==R.signatureHeader||t[156]!==R.signaturePrefix||t[157]!==R.signatureSecret||t[158]!==R.timeOfDay||t[159]!==R.weekdays||t[160]!==h||t[161]!==q?(Zt=R.scheduleMode===`webhook`?(0,$.jsxs)(`div`,{className:`space-y-4`,children:[(0,$.jsx)(Et,{environmentId:h,task:q}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Each request runs the prompt. Use {{body.path}}, {{headers.name}}, {{query.name}}, {{body}} or {{request}} in the prompt; only what it names reaches the agent.`}),(0,$.jsx)(pt,{label:`Skip requests older than`,hint:`minutes, optional`,htmlFor:`scheduled-task-max-age`,children:(0,$.jsx)(_e,{id:`scheduled-task-max-age`,type:`number`,nativeInput:!0,min:1,max:r,placeholder:`Run every request`,value:R.maxDeliveryAgeMinutes,onChange:e=>z(t=>({...t,maxDeliveryAgeMinutes:e.target.value}))})}),(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,$.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,$.jsx)(Xe,{htmlFor:`scheduled-task-signature`,children:`Require signature`}),(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Reject requests without a valid HMAC-SHA256 signature of the body.`})]}),(0,$.jsx)(Je,{id:`scheduled-task-signature`,checked:R.signatureEnabled,onCheckedChange:e=>z(t=>({...t,signatureEnabled:e}))})]}),R.signatureEnabled?(0,$.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,$.jsx)(pt,{label:`Header`,htmlFor:`scheduled-task-signature-header`,children:(0,$.jsx)(_e,{id:`scheduled-task-signature-header`,value:R.signatureHeader,onChange:e=>z(t=>({...t,signatureHeader:e.target.value}))})}),(0,$.jsx)(pt,{label:`Prefix`,htmlFor:`scheduled-task-signature-prefix`,children:(0,$.jsx)(_e,{id:`scheduled-task-signature-prefix`,value:R.signaturePrefix,placeholder:`None`,onChange:e=>z(t=>({...t,signaturePrefix:e.target.value}))})}),(0,$.jsx)(pt,{label:`Encoding`,htmlFor:`scheduled-task-signature-encoding`,children:(0,$.jsxs)(I,{value:R.signatureEncoding,onValueChange:e=>z(t=>({...t,signatureEncoding:e===`base64`?`base64`:`hex`})),children:[(0,$.jsx)(F,{size:`sm`,id:`scheduled-task-signature-encoding`,children:(0,$.jsx)(N,{children:R.signatureEncoding})}),(0,$.jsxs)(P,{children:[(0,$.jsx)(M,{value:`hex`,children:`hex`}),(0,$.jsx)(M,{value:`base64`,children:`base64`})]})]})}),(0,$.jsx)(pt,{label:`Secret`,htmlFor:`scheduled-task-signature-secret`,children:(0,$.jsx)(_e,{id:`scheduled-task-signature-secret`,type:`password`,autoComplete:`off`,value:R.signatureSecret,placeholder:q?.schedule.type===`webhook`&&q.webhook?.hasSecret?`Unchanged`:`Shared secret`,onChange:e=>z(t=>({...t,signatureSecret:e.target.value}))})})]}):null]}):R.scheduleMode===`fixed`?(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(Xe,{htmlFor:`scheduled-task-time`,children:`Run at`}),(0,$.jsx)(_e,{type:`time`,id:`scheduled-task-time`,nativeInput:!0,className:`w-32`,value:R.timeOfDay,onChange:e=>z(t=>({...t,timeOfDay:e.target.value}))}),(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`on`})]}),(0,$.jsx)(ue,{multiple:!0,variant:`outline`,size:`sm`,"aria-label":`Days to run`,value:[...R.weekdays].map(String),onValueChange:e=>{e.length!==0&&z(t=>({...t,weekdays:new Set(e.map(Number))}))},children:ct.map(At)})]}):(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(Xe,{htmlFor:`scheduled-task-interval`,children:`Run every`}),(0,$.jsx)(_e,{type:`number`,id:`scheduled-task-interval`,nativeInput:!0,min:1,step:`any`,className:`w-24`,value:R.intervalMinutes,onChange:e=>z(t=>({...t,intervalMinutes:e.target.value}))}),(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`minutes`})]}),t[150]=R.intervalMinutes,t[151]=R.maxDeliveryAgeMinutes,t[152]=R.scheduleMode,t[153]=R.signatureEnabled,t[154]=R.signatureEncoding,t[155]=R.signatureHeader,t[156]=R.signaturePrefix,t[157]=R.signatureSecret,t[158]=R.timeOfDay,t[159]=R.weekdays,t[160]=h,t[161]=q,t[162]=Zt):Zt=t[162];let Qt;t[163]!==Ut||t[164]!==Xt||t[165]!==Zt?(Qt=(0,$.jsxs)(`div`,{className:`space-y-3`,children:[Ut,Xt,Zt]}),t[163]=Ut,t[164]=Xt,t[165]=Zt,t[166]=Qt):Qt=t[166];let $t;t[167]===Symbol.for(`react.memo_cache_sentinel`)?($t=(0,$.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,$.jsx)(Xe,{htmlFor:`scheduled-task-enabled`,children:`Enabled`}),(0,$.jsx)(`p`,{id:`scheduled-task-enabled-description`,className:`text-sm text-muted-foreground`,children:`Disabled tasks stay saved but do not run.`})]}),t[167]=$t):$t=t[167];let en;t[168]===Symbol.for(`react.memo_cache_sentinel`)?(en=e=>z(t=>({...t,enabled:e})),t[168]=en):en=t[168];let tn;t[169]===R.enabled?tn=t[170]:(tn=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[$t,(0,$.jsx)(Je,{id:`scheduled-task-enabled`,"aria-describedby":`scheduled-task-enabled-description`,checked:R.enabled,onCheckedChange:en})]}),t[169]=R.enabled,t[170]=tn);let nn;t[171]!==B||t[172]!==qe||t[173]!==lt||t[174]!==ut||t[175]!==ht||t[176]!==_t||t[177]!==Ft||t[178]!==It||t[179]!==Lt||t[180]!==zt||t[181]!==Ht||t[182]!==Qt||t[183]!==tn?(nn=(0,$.jsx)(Ce,{children:(0,$.jsxs)(`fieldset`,{disabled:B,className:`space-y-5`,children:[qe,lt,ut,ht,_t,Ft,It,Lt,zt,Ht,Qt,tn]})}),t[171]=B,t[172]=qe,t[173]=lt,t[174]=ut,t[175]=ht,t[176]=_t,t[177]=Ft,t[178]=It,t[179]=Lt,t[180]=zt,t[181]=Ht,t[182]=Qt,t[183]=tn,t[184]=nn):nn=t[184];let rn;t[185]===B?rn=t[186]:(rn=(0,$.jsx)(Se,{render:(0,$.jsx)(g,{variant:`outline`,size:`sm`,disabled:B}),children:`Cancel`}),t[185]=B,t[186]=rn);let an=!ne||B||G||!b||!S.data,on;t[187]===Pe?on=t[188]:(on=()=>void Pe(),t[187]=Pe,t[188]=on);let sn=R.editingId?`Save task`:`Create task`,cn;t[189]!==an||t[190]!==on||t[191]!==sn?(cn=(0,$.jsx)(g,{size:`sm`,disabled:an,onClick:on,children:sn}),t[189]=an,t[190]=on,t[191]=sn,t[192]=cn):cn=t[192];let ln;t[193]!==rn||t[194]!==cn?(ln=(0,$.jsxs)(xe,{children:[rn,cn]}),t[193]=rn,t[194]=cn,t[195]=ln):ln=t[195];let un;t[196]!==Ke||t[197]!==nn||t[198]!==ln?(un=(0,$.jsxs)(Te,{className:`max-w-xl`,children:[Ke,nn,ln]}),t[196]=Ke,t[197]=nn,t[198]=ln,t[199]=un):un=t[199];let dn;return t[200]!==Fe||t[201]!==un?(dn=(0,$.jsx)(Ee,{open:!0,onOpenChange:Fe,children:un}),t[200]=Fe,t[201]=un,t[202]=dn):dn=t[202],dn}function At(e){return(0,$.jsx)(Y,{value:String(e),"aria-label":lt[e],children:ut[e]},e)}function jt(e){return(0,$.jsx)(M,{value:e.id,children:e.title},e.id)}function Mt(e){return(0,$.jsxs)(M,{value:e.environmentId,children:[(0,$.jsx)(Me,{kind:d(e.serverConfig),className:`size-4`}),e.label]},e.environmentId)}function Nt(e){return{...e,projectId:``,modelKey:``,baseModelSelection:null,baseRef:`main`,startFromOrigin:!0,existingWorktreePath:``}}function Pt(e,t){R.add(se({type:`error`,title:e,description:t instanceof Error?t.message:String(t)}))}export{it as a,nt as i,gt as n,ht as r,bt as t};
|
|
4
|
-
//# sourceMappingURL=ScheduledTasksSettings-BXOG7dPV.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{ma as t,wx as n}from"./utils-DmS758az.js";import{P as r}from"./settingsLayout-BzyY4qHt.js";import{Ea as i}from"./main-D9z9rMK1.js";var a=n(),o=e(t(),1);function s(e){let t=(0,a.c)(8),n,s,c;t[0]===e?(n=t[1],s=t[2],c=t[3]):({settingKeys:c,checked:n,...s}=e,t[0]=e,t[1]=n,t[2]=s,t[3]=c);let l=r(c),u=!l&&n,d;return t[4]!==l||t[5]!==s||t[6]!==u?(d=(0,o.jsx)(i,{...s,mixed:l,checked:u}),t[4]=l,t[5]=s,t[6]=u,t[7]=d):d=t[7],d}export{s as t};
|
|
2
|
-
//# sourceMappingURL=ScopedSwitch-2MBm4Srn.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{$o as n,Go as r,Jo as i,Lo as a,Pb as o,Un as s,Vo as c,Wo as l,cy as u,la as d,m_ as f,ma as p,or as m,ps as h,t as g,wx as _}from"./utils-DmS758az.js";import{t as v}from"./server-Le_hLOlf.js";import{t as y}from"./smartphone-zkhAIn1Q.js";import{D as b,F as x,L as S,O as C,U as w,d as T,f as E,h as D,m as O,pn as k,r as ee}from"./runtime-CCr9UADV.js";import{i as A}from"./toast-Bm36EaG6.js";import{t as j}from"./use-atom-command-CiEeUGsC.js";import{t as M}from"./skeleton-CtSxs1y1.js";import{i as te,r as ne}from"./dist-CxgL3edJ.js";import{a as N,i as P,o as F,r as I,t as L}from"./empty-uoiaKPHo.js";import{n as re,r as ie,t as ae}from"./collapsible-C3qenpEI.js";import{Ia as oe}from"./main-D9z9rMK1.js";var R=e(d(),1),z=_(),B=e(t(),1),V=i(u(k,ee.contextEffect.pipe(f(e=>o(e,k))))),H=T(V),U=C(),W=x(V,{label:`web:managed-relay:deregister-environment`,scheduler:U,concurrency:{mode:`serial`,key:e=>e.accountId},execute:(e,t)=>E(t,e)}),G=r(h([])).pipe(l,n(`managed-relay:web:environments:null`)),K=r(h([])).pipe(l,n(`managed-relay:web:devices:null`));function se(){let e=(0,z.c)(14),t=c(O)?.accountId??null,n;e[0]===t?n=e[1]:(n=t?H.environmentsAtom(t):G,e[0]=t,e[1]=n);let r=c(n),i;e[2]===r?i=e[3]:(i=D(r),e[2]=r,e[3]=i);let o=i,s,l;e[4]!==o.error||e[5]!==o.errorTraceId?(s=()=>{o.error&&console.error(`[t3-cloud] Relay environment listing failed`,{message:o.error,traceId:o.errorTraceId})},l=[o.error,o.errorTraceId],e[4]=o.error,e[5]=o.errorTraceId,e[6]=s,e[7]=l):(s=e[6],l=e[7]),(0,B.useEffect)(s,l);let u;e[8]===t?u=e[9]:(u=()=>{t&&H.refreshEnvironments(a,t)},e[8]=t,e[9]=u);let d=u,f;return e[10]!==t||e[11]!==d||e[12]!==o?(f={...o,accountId:t,refresh:d},e[10]=t,e[11]=d,e[12]=o,e[13]=f):f=e[13],f}function q(){let e=(0,z.c)(14),t=c(O)?.accountId??null,n;e[0]===t?n=e[1]:(n=t?H.devicesAtom(t):K,e[0]=t,e[1]=n);let r=c(n),i;e[2]===r?i=e[3]:(i=D(r),e[2]=r,e[3]=i);let o=i,s,l;e[4]!==o.error||e[5]!==o.errorTraceId?(s=()=>{o.error&&console.error(`[t3-cloud] Relay device listing failed`,{message:o.error,traceId:o.errorTraceId})},l=[o.error,o.errorTraceId],e[4]=o.error,e[5]=o.errorTraceId,e[6]=s,e[7]=l):(s=e[6],l=e[7]),(0,B.useEffect)(s,l);let u;e[8]===t?u=e[9]:(u=()=>{t&&H.refreshDevices(a,t)},e[8]=t,e[9]=u);let d=u,f;return e[10]!==t||e[11]!==d||e[12]!==o?(f={...o,accountId:t,refresh:d},e[10]=t,e[11]=d,e[12]=o,e[13]=f):f=e[13],f}var ce=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`}),le=[[`notifyOnApproval`,`approvals`],[`notifyOnInput`,`input requests`],[`notifyOnCompletion`,`completions`],[`notifyOnFailure`,`failures`]];function ue(e){return`${e.platform===`android`?`Android`:e.iosMajorVersion===null?`iOS`:`iOS ${e.iosMajorVersion}`}${e.appVersion?` · P4 Code ${e.appVersion}`:``}`}function de(e){if(!e.notifications.enabled)return`Push notifications are disabled on this device.`;let t=le.flatMap(([t,n])=>e.notifications[t]?[n]:[]);return t.length>0?`Alerts enabled for ${t.join(`, `)}.`:`Push notifications are enabled, but no alert types are selected.`}function fe(e){let t=new Date(e);return Number.isNaN(t.getTime())?`Update time unavailable`:`Updated ${ce.format(t)}`}var J=e(p(),1);function Y(e){let t=(0,z.c)(18),{action:n,children:r,className:i,description:a,title:o}=e,s;t[0]===i?s=t[1]:(s=g(`w-full min-w-0 text-foreground`,i),t[0]=i,t[1]=s);let c;t[2]===o?c=t[3]:(c=(0,J.jsx)(`h2`,{className:`text-base leading-6 font-semibold`,children:o}),t[2]=o,t[3]=c);let l;t[4]===a?l=t[5]:(l=a?(0,J.jsx)(`p`,{className:`mt-1 max-w-[34rem] text-xs leading-4.5 text-muted-foreground sm:min-h-9`,children:a}):null,t[4]=a,t[5]=l);let u;t[6]!==c||t[7]!==l?(u=(0,J.jsxs)(`div`,{className:`min-w-0`,children:[c,l]}),t[6]=c,t[7]=l,t[8]=u):u=t[8];let d;t[9]===n?d=t[10]:(d=n?(0,J.jsx)(`div`,{className:`shrink-0`,children:n}):null,t[9]=n,t[10]=d);let f;t[11]!==u||t[12]!==d?(f=(0,J.jsxs)(`header`,{className:`flex flex-col gap-3 pb-4 sm:flex-row sm:items-center sm:justify-between sm:gap-4 sm:pr-8`,children:[u,d]}),t[11]=u,t[12]=d,t[13]=f):f=t[13];let p;return t[14]!==r||t[15]!==s||t[16]!==f?(p=(0,J.jsxs)(`div`,{className:s,children:[f,r]}),t[14]=r,t[15]=s,t[16]=f,t[17]=p):p=t[17],p}function X(e){let t=(0,z.c)(7),{className:n,disabled:r,isPending:i,onClick:a}=e,o=r!==void 0&&r||i,s;t[0]===i?s=t[1]:(s=(0,J.jsx)(oe,{"aria-hidden":`true`,size:`sm`,refreshing:i}),t[0]=i,t[1]=s);let c;return t[2]!==n||t[3]!==a||t[4]!==o||t[5]!==s?(c=(0,J.jsxs)(m,{size:`sm`,variant:`outline`,className:n,disabled:o,onClick:a,children:[s,`Refresh`]}),t[2]=n,t[3]=a,t[4]=o,t[5]=s,t[6]=c):c=t[6],c}function Z(e){let t=(0,z.c)(12),{children:n,className:r,icon:i}=e,a;t[0]===r?a=t[1]:(a=g(`border-t py-4 first:border-t-0`,r),t[0]=r,t[1]=a);let o;t[2]===i?o=t[3]:(o=(0,J.jsx)(`div`,{"aria-hidden":`true`,className:`flex size-8 shrink-0 items-center justify-center rounded-lg border bg-muted/32 text-muted-foreground`,children:i}),t[2]=i,t[3]=o);let s;t[4]===n?s=t[5]:(s=(0,J.jsx)(`div`,{className:`min-w-0 flex-1`,children:n}),t[4]=n,t[5]=s);let c;t[6]!==o||t[7]!==s?(c=(0,J.jsxs)(`div`,{className:`flex items-start gap-3`,children:[o,s]}),t[6]=o,t[7]=s,t[8]=c):c=t[8];let l;return t[9]!==a||t[10]!==c?(l=(0,J.jsx)(`li`,{className:a,children:c}),t[9]=a,t[10]=c,t[11]=l):l=t[11],l}var pe=[`primary`,`secondary`];function Q(e){let t=(0,z.c)(4),{enabled:n,label:r}=e,i=n?`success`:`outline`,a=n?`On`:`Off`,o;return t[0]!==r||t[1]!==i||t[2]!==a?(o=(0,J.jsxs)(s,{variant:i,children:[r,`: `,a]}),t[0]=r,t[1]=i,t[2]=a,t[3]=o):o=t[3],o}function me(e){let t=(0,z.c)(32),{device:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,J.jsx)(y,{className:`size-4`}),t[0]=r):r=t[0];let i;t[1]===n.label?i=t[2]:(i=(0,J.jsx)(`h3`,{className:`truncate text-sm leading-4.5 font-medium text-foreground`,children:n.label}),t[1]=n.label,t[2]=i);let a;t[3]===n?a=t[4]:(a=ue(n),t[3]=n,t[4]=a);let o;t[5]===a?o=t[6]:(o=(0,J.jsx)(`p`,{className:`text-xs leading-4.5 text-muted-foreground`,children:a}),t[5]=a,t[6]=o);let s;t[7]!==i||t[8]!==o?(s=(0,J.jsxs)(`div`,{className:`min-w-0`,children:[i,o]}),t[7]=i,t[8]=o,t[9]=s):s=t[9];let c;t[10]===n.updatedAt?c=t[11]:(c=fe(n.updatedAt),t[10]=n.updatedAt,t[11]=c);let l;t[12]===c?l=t[13]:(l=(0,J.jsx)(`p`,{className:`shrink-0 text-2xs leading-4 text-muted-foreground/75`,children:c}),t[12]=c,t[13]=l);let u;t[14]!==s||t[15]!==l?(u=(0,J.jsxs)(`div`,{className:`flex flex-col gap-0.5 sm:flex-row sm:items-start sm:justify-between sm:gap-3`,children:[s,l]}),t[14]=s,t[15]=l,t[16]=u):u=t[16];let d;t[17]===n.notifications.enabled?d=t[18]:(d=(0,J.jsx)(Q,{enabled:n.notifications.enabled,label:`Push notifications`}),t[17]=n.notifications.enabled,t[18]=d);let f;t[19]===n.liveActivities.enabled?f=t[20]:(f=(0,J.jsx)(Q,{enabled:n.liveActivities.enabled,label:`Live Activities`}),t[19]=n.liveActivities.enabled,t[20]=f);let p;t[21]!==f||t[22]!==d?(p=(0,J.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:[d,f]}),t[21]=f,t[22]=d,t[23]=p):p=t[23];let m;t[24]===n?m=t[25]:(m=de(n),t[24]=n,t[25]=m);let h;t[26]===m?h=t[27]:(h=(0,J.jsx)(`p`,{className:`mt-1.5 text-xs leading-4.5 text-muted-foreground/80`,children:m}),t[26]=m,t[27]=h);let g;return t[28]!==p||t[29]!==h||t[30]!==u?(g=(0,J.jsxs)(Z,{icon:r,children:[u,p,h]}),t[28]=p,t[29]=h,t[30]=u,t[31]=g):g=t[31],g}function he(){let e=(0,z.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,J.jsx)(`div`,{"aria-label":`Loading mobile clients`,className:`divide-y border-t`,role:`status`,children:pe.map(ge)}),e[0]=t):t=e[0],t}function ge(e){return(0,J.jsx)(`div`,{className:`py-4`,children:(0,J.jsxs)(`div`,{className:`flex gap-3`,children:[(0,J.jsx)(M,{shape:`card`,className:`size-8 shrink-0`}),(0,J.jsxs)(`div`,{className:`flex-1 space-y-2`,children:[(0,J.jsx)(M,{className:`h-3.5 w-36`}),(0,J.jsx)(M,{className:`h-3 w-28`}),(0,J.jsxs)(`div`,{className:`flex gap-2`,children:[(0,J.jsx)(M,{className:`h-4.5 w-28`}),(0,J.jsx)(M,{className:`h-4.5 w-24`})]})]})]})},e)}function _e(){let e=(0,z.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,J.jsx)(N,{variant:`icon`,children:(0,J.jsx)(y,{})}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,J.jsxs)(L,{size:`compact`,children:[t,(0,J.jsxs)(P,{children:[(0,J.jsx)(F,{children:`No mobile clients`}),(0,J.jsx)(I,{children:`Install P4 Code on your phone and sign in to P4 Connect to get push notifications and Live Activities.`})]})]}),e[1]=n):n=e[1],n}function ve(){let e=(0,z.c)(18),t=q(),n;e[0]===t.data?n=e[1]:(n=t.data??[],e[0]=t.data,e[1]=n);let r=n,i=!t.accountId||t.data===null&&!t.error,a=t.error!==null&&t.data===null,o;e[2]!==t.isPending||e[3]!==t.refresh?(o=(0,J.jsx)(X,{isPending:t.isPending,onClick:t.refresh}),e[2]=t.isPending,e[3]=t.refresh,e[4]=o):o=e[4];let s;e[5]!==t.error||e[6]!==t.refresh?(s=t.error?(0,J.jsxs)(`div`,{className:`mb-4 flex flex-col gap-3 border-t border-destructive/35 py-3 text-xs sm:flex-row sm:items-center sm:justify-between`,role:`alert`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`p`,{className:`font-medium text-destructive-foreground`,children:`Could not load mobile clients`}),(0,J.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:t.error})]}),(0,J.jsx)(m,{size:`xs`,variant:`outline`,onClick:t.refresh,children:`Try again`})]}):null,e[5]=t.error,e[6]=t.refresh,e[7]=s):s=e[7];let c;e[8]!==r||e[9]!==a||e[10]!==i?(c=i?(0,J.jsx)(he,{}):a?null:r.length>0?(0,J.jsx)(`ul`,{className:`border-t`,children:r.map(ye)}):(0,J.jsx)(`div`,{className:`border-t`,children:(0,J.jsx)(_e,{})}),e[8]=r,e[9]=a,e[10]=i,e[11]=c):c=e[11];let l;e[12]!==s||e[13]!==c?(l=(0,J.jsxs)(`div`,{children:[s,c]}),e[12]=s,e[13]=c,e[14]=l):l=e[14];let u;return e[15]!==o||e[16]!==l?(u=(0,J.jsx)(Y,{title:`Mobile clients`,description:`Mobile devices that get notifications from your environments.`,action:o,children:l}),e[15]=o,e[16]=l,e[17]=u):u=e[17],u}function ye(e){return(0,J.jsx)(me,{device:e},e.deviceId)}var be=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`});function xe(e){let t=new Date(e);return Number.isNaN(t.getTime())?`Link date unavailable`:`Linked ${be.format(t)}`}function Se(e){return e.endpoint.providerKind===`cloudflare_tunnel`?`Managed tunnel`:`Activity publishing only`}function Ce(e){let t=(0,z.c)(46),{environment:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,J.jsx)(v,{className:`size-4`}),t[0]=r):r=t[0];let i=e.confirmationOpen,a=e.onConfirmationChange,o;t[1]===n.label?o=t[2]:(o=(0,J.jsx)(`h3`,{className:`truncate text-sm leading-4.5 font-medium text-foreground`,children:n.label}),t[1]=n.label,t[2]=o);let s;t[3]===n.linkedAt?s=t[4]:(s=xe(n.linkedAt),t[3]=n.linkedAt,t[4]=s);let c;t[5]===n?c=t[6]:(c=Se(n),t[5]=n,t[6]=c);let l;t[7]!==s||t[8]!==c?(l=(0,J.jsxs)(`p`,{className:`mt-1 text-xs leading-4.5 text-muted-foreground`,children:[s,` · `,c]}),t[7]=s,t[8]=c,t[9]=l):l=t[9];let u;t[10]!==o||t[11]!==l?(u=(0,J.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[o,l]}),t[10]=o,t[11]=l,t[12]=u):u=t[12];let d;t[13]===e.mutationPending?d=t[14]:(d=(0,J.jsx)(ie,{render:(0,J.jsx)(m,{size:`sm`,variant:`destructive-outline`,disabled:e.mutationPending,children:`Deregister`})}),t[13]=e.mutationPending,t[14]=d);let f;t[15]!==u||t[16]!==d?(f=(0,J.jsxs)(`div`,{className:`flex items-start gap-4`,children:[u,d]}),t[15]=u,t[16]=d,t[17]=f):f=t[17];let p=`Confirm deregistration of ${n.label}`,h;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,J.jsx)(`h4`,{className:`text-sm leading-4.5 font-semibold text-foreground`,children:`Deregister server`}),t[18]=h):h=t[18];let g;t[19]===n.label?g=t[20]:(g=(0,J.jsxs)(`p`,{className:`mt-1 text-xs leading-4.5 text-muted-foreground`,children:[`“`,n.label,`” will be removed from this account.`]}),t[19]=n.label,t[20]=g);let _;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,J.jsx)(`p`,{className:`mt-4 max-w-xl text-xs leading-4.5 text-muted-foreground`,children:`P4 Connect access will be revoked, any managed tunnel will be removed, and a host space will become available. Local connections on your devices are not changed.`}),t[21]=_):_=t[21];let y;t[22]===e?y=t[23]:(y=()=>e.onConfirmationChange(!1),t[22]=e,t[23]=y);let b;t[24]!==e.mutationPending||t[25]!==y?(b=(0,J.jsx)(m,{size:`sm`,variant:`ghost`,disabled:e.mutationPending,onClick:y,children:`Cancel`}),t[24]=e.mutationPending,t[25]=y,t[26]=b):b=t[26];let x;t[27]!==n||t[28]!==e?(x=()=>e.onDeregister(n),t[27]=n,t[28]=e,t[29]=x):x=t[29];let S=e.mutationPending?`Deregistering…`:`Deregister`,C;t[30]!==e.mutationPending||t[31]!==x||t[32]!==S?(C=(0,J.jsx)(m,{size:`sm`,variant:`destructive`,disabled:e.mutationPending,onClick:x,children:S}),t[30]=e.mutationPending,t[31]=x,t[32]=S,t[33]=C):C=t[33];let w;t[34]!==b||t[35]!==C?(w=(0,J.jsxs)(`div`,{className:`mt-4 flex justify-end gap-2`,children:[b,C]}),t[34]=b,t[35]=C,t[36]=w):w=t[36];let T;t[37]!==p||t[38]!==g||t[39]!==w?(T=(0,J.jsx)(re,{children:(0,J.jsx)(`div`,{className:`pt-3`,children:(0,J.jsxs)(`div`,{className:`rounded-lg border border-input bg-muted/32 px-5 py-4 shadow-xs/5`,role:`group`,"aria-label":p,children:[h,g,_,w]})})}),t[37]=p,t[38]=g,t[39]=w,t[40]=T):T=t[40];let E;return t[41]!==e.confirmationOpen||t[42]!==e.onConfirmationChange||t[43]!==T||t[44]!==f?(E=(0,J.jsx)(Z,{icon:r,children:(0,J.jsxs)(ae,{open:i,onOpenChange:a,children:[f,T]})}),t[41]=e.confirmationOpen,t[42]=e.onConfirmationChange,t[43]=T,t[44]=f,t[45]=E):E=t[45],E}function we(){let e=(0,z.c)(41),t=se(),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},e[0]=n):n=e[0];let r=j(W,n),[i,a]=(0,B.useState)(null),[o,s]=(0,B.useState)(null),c=(0,B.useRef)(!1),l;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(l={accountId:null,linkedAtById:new Map},e[1]=l):l=e[1];let[u,d]=(0,B.useState)(l),f;e[2]!==r||e[3]!==t?(f=async e=>{let n=t.accountId;if(!n||c.current)return;c.current=!0,a(e.environmentId);let i=await r({accountId:n,environmentId:e.environmentId});if(c.current=!1,a(null),i._tag===`Success`){s(null),d(t=>{let r=new Map(t.accountId===n?t.linkedAtById:[]);return r.set(e.environmentId,e.linkedAt),{accountId:n,linkedAtById:r}}),t.refresh(),A.add({type:`success`,title:`Server deregistered`,description:`P4 Connect access was revoked and a host space is now available.`});return}if(S(i))return;let o=w(i),l=o instanceof Error?o.message:`Could not deregister the server.`,u=b(o);console.error(`[t3-connect] Could not deregister environment`,{environmentId:e.environmentId,message:l,traceId:u,cause:o}),A.add({type:`error`,title:`Could not deregister server`,description:l,data:u?{secondaryActionProps:{children:`Copy trace ID`,onClick:()=>void navigator.clipboard?.writeText(u)}}:void 0})},e[2]=r,e[3]=t,e[4]=f):f=e[4];let p=f,m;e[5]!==t.accountId||e[6]!==u.accountId||e[7]!==u.linkedAtById?(m=u.accountId===t.accountId?u.linkedAtById:new Map,e[5]=t.accountId,e[6]=u.accountId,e[7]=u.linkedAtById,e[8]=m):m=e[8];let h=m,g,_,y,x,C,T;if(e[9]!==o||e[10]!==i||e[11]!==t.accountId||e[12]!==t.data||e[13]!==t.error||e[14]!==t.isPending||e[15]!==t.refresh||e[16]!==p||e[17]!==h){let n;e[24]===h?n=e[25]:(n=e=>h.get(e.environmentId)!==e.linkedAt,e[24]=h,e[25]=n);let r=(t.data??[]).filter(n),a=!t.accountId||t.data===null&&!t.error;g=Y,x=`P4 Connect`,C=`Environments registered to your account. Connections on this device are managed in Settings.`;let c=i!==null;e[26]!==t.isPending||e[27]!==t.refresh||e[28]!==c?(T=(0,J.jsx)(X,{disabled:c,isPending:t.isPending,onClick:t.refresh}),e[26]=t.isPending,e[27]=t.refresh,e[28]=c,e[29]=T):T=e[29],e[30]===t.error?_=e[31]:(_=t.error?(0,J.jsxs)(`div`,{className:`mb-4 border-t border-destructive/35 py-3 text-xs`,role:`alert`,children:[(0,J.jsx)(`p`,{className:`font-medium text-destructive-foreground`,children:`Could not load P4 Connect environments`}),(0,J.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:t.error})]}):null,e[30]=t.error,e[31]=_),y=a?(0,J.jsx)(`p`,{className:`border-t py-4 text-xs text-muted-foreground`,role:`status`,children:`Loading environments…`}):r.length>0?(0,J.jsx)(`ul`,{className:`border-t`,children:r.map(e=>(0,J.jsx)(Ce,{environment:e,confirmationOpen:o===e.environmentId,mutationPending:i!==null,onConfirmationChange:t=>s(t?e.environmentId:null),onDeregister:e=>void p(e)},e.environmentId))}):t.error?null:(0,J.jsx)(`div`,{className:`border-t`,children:(0,J.jsxs)(L,{size:`compact`,children:[(0,J.jsx)(N,{variant:`icon`,children:(0,J.jsx)(v,{})}),(0,J.jsxs)(P,{children:[(0,J.jsx)(F,{children:`No P4 Connect environments`}),(0,J.jsx)(I,{children:`Link an environment from its local Settings to make it available through P4 Connect.`})]})]})}),e[9]=o,e[10]=i,e[11]=t.accountId,e[12]=t.data,e[13]=t.error,e[14]=t.isPending,e[15]=t.refresh,e[16]=p,e[17]=h,e[18]=g,e[19]=_,e[20]=y,e[21]=x,e[22]=C,e[23]=T}else g=e[18],_=e[19],y=e[20],x=e[21],C=e[22],T=e[23];let E;e[32]!==_||e[33]!==y?(E=(0,J.jsxs)(`div`,{children:[_,y]}),e[32]=_,e[33]=y,e[34]=E):E=e[34];let D;return e[35]!==g||e[36]!==x||e[37]!==C||e[38]!==T||e[39]!==E?(D=(0,J.jsx)(g,{title:x,description:C,action:T,children:E}),e[35]=g,e[36]=x,e[37]=C,e[38]=T,e[39]=E,e[40]=D):D=e[40],D}var $=[{label:`Mobile clients`,url:`mobile-clients`,icon:(0,J.jsx)(y,{className:`size-4`}),content:(0,J.jsx)(ve,{})},{label:`P4 Connect`,url:`t3-connect`,icon:(0,J.jsx)(v,{className:`size-4`}),content:(0,J.jsx)(we,{})}];function Te(){let e=(0,z.c)(8),t=te(),{isSignedIn:n}=ne(),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={},e[0]=r):r=e[0];let[i,a]=(0,B.useState)(r),o;e[1]===t?o=e[2]:(o=()=>{let e=(e,t)=>a(n=>({...n,[e]:t}));t.openUserProfile({__experimental_startPath:`/t3-connect`,customPages:$.map(t=>({label:t.label,url:t.url,mount:n=>e(`content:${t.url}`,n),unmount:()=>e(`content:${t.url}`,void 0),mountIcon:n=>e(`icon:${t.url}`,n),unmountIcon:()=>e(`icon:${t.url}`,void 0)}))})},e[1]=t,e[2]=o);let s=o,c;e[3]===i?c=e[4]:(c=$.flatMap(e=>{let t=i[`content:${e.url}`],n=i[`icon:${e.url}`];return[t?(0,R.createPortal)(e.content,t,`content:${e.url}`):null,n?(0,R.createPortal)(e.icon,n,`icon:${e.url}`):null]}),e[3]=i,e[4]=c);let l=c,u=n?s:null,d;return e[5]!==l||e[6]!==u?(d={open:u,portals:l},e[5]=l,e[6]=u,e[7]=d):d=e[7],d}export{Te as n,$ as t};
|
|
2
|
-
//# sourceMappingURL=T3ConnectAccountPages-C6qHq26m.js.map
|