@p4code/cli 0.8.31 → 0.8.32
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-CJxvJzbR.mjs → binCli-BS733BXG.mjs} +247 -73
- package/dist/client/.vite/manifest.json +2221 -2221
- package/dist/client/assets/AlertDialogRoot-gCZMGgw9.js +2 -0
- package/dist/client/assets/{AnimatedHeight-N_bbjpO0.js → AnimatedHeight-CF-2TJ2y.js} +2 -2
- package/dist/client/assets/{AuthSurfaceShell-CgYhpT9f.js → AuthSurfaceShell-QiZ7Fio5.js} +2 -2
- package/dist/client/assets/{CSPContext-Bchqn4Z4.js → CSPContext-BrBN2jLZ.js} +2 -2
- package/dist/client/assets/{ChatGptUsageButton-DgX5jPaE.js → ChatGptUsageButton-BawFqJFy.js} +2 -2
- package/dist/client/assets/{ChatMarkdown-DG8q7VMD.js → ChatMarkdown-Ddq8N5Pt.js} +4 -4
- package/dist/client/assets/{CheckboxIndicator-C27GMhZi.js → CheckboxIndicator-Cnknf-Kf.js} +2 -2
- package/dist/client/assets/{ClippedText-gxEyECp8.js → ClippedText-Dj3uJchI.js} +2 -2
- package/dist/client/assets/{CodexSetupSection.logic-D6jywL3c.js → CodexSetupSection.logic-CQjm4KgX.js} +2 -2
- package/dist/client/assets/{ComboboxClear-BU2zssbU.js → ComboboxClear-CQwzC_c6.js} +2 -2
- package/dist/client/assets/{ComboboxGroupLabel-BOqTaS8V.js → ComboboxGroupLabel-ByhgWB6k.js} +2 -2
- package/dist/client/assets/{CommandBlock-Bl59WSdA.js → CommandBlock-C1TNh1aK.js} +2 -2
- package/dist/client/assets/{ComposerPromptEditor-Docpl1DT.js → ComposerPromptEditor-ILuiCg0V.js} +54 -54
- package/dist/client/assets/{CompositeRoot-DHfFZgBC.js → CompositeRoot-Dw7CUw_h.js} +2 -2
- package/dist/client/assets/{ConnectionStatusDot-BzysNXvb.js → ConnectionStatusDot-BMAnD6fx.js} +2 -2
- package/dist/client/assets/{DesignPageTile-BVOnXVkp.js → DesignPageTile-Blp3j4pb.js} +2 -2
- package/dist/client/assets/{DevicePanel-WtIdRhFw.js → DevicePanel-DvQaA35w.js} +2 -2
- package/dist/client/assets/{DeviceSetup-CHZDTHUd.js → DeviceSetup-DKsXIZ-i.js} +2 -2
- package/dist/client/assets/{DialogTitle-4VgvC45v.js → DialogTitle-DO8wNz_M.js} +2 -2
- package/dist/client/assets/{DiffCommentAnnotation-DgOiyt7Z.js → DiffCommentAnnotation-C8PC7OpK.js} +2 -2
- package/dist/client/assets/{DiffFileTree-C2oGHe27.js → DiffFileTree-C7DU5LPH.js} +2 -2
- package/dist/client/assets/{DiffPanel-DPrR8Qs5.js → DiffPanel-ChTAkyLv.js} +2 -2
- package/dist/client/assets/{DiffWorkerPoolProvider-Dmv8oWFH.js → DiffWorkerPoolProvider-DgSyhIgr.js} +2 -2
- package/dist/client/assets/{EmbeddedDesign-CjSpgNcP.js → EmbeddedDesign-2lyTE7DK.js} +2 -2
- package/dist/client/assets/{EnvironmentMachineIcon-Brb19vmz.js → EnvironmentMachineIcon-DGhfQksr.js} +2 -2
- package/dist/client/assets/{ExpandableText-XtyFV-c_.js → ExpandableText-Pc3rE_yW.js} +2 -2
- package/dist/client/assets/{FieldControl-wrjTWyrJ.js → FieldControl-ARIcqLzr.js} +2 -2
- package/dist/client/assets/{FileDiff-C4ZDhTn8.js → FileDiff-BmnyAzoE.js} +2 -2
- package/dist/client/assets/{FilePreviewPanel-bLnvHX8B.js → FilePreviewPanel-cA2W4Rul.js} +3 -3
- package/dist/client/assets/{FoldedSettingsSection-CHR7h1G5.js → FoldedSettingsSection-DFVEbDHa.js} +2 -2
- package/dist/client/assets/{FormContext-Coi3SJqc.js → FormContext-BrID1ioM.js} +2 -2
- package/dist/client/assets/{Icons-Cq5M4QzB.js → Icons-Ddevc3gx.js} +2 -2
- package/dist/client/assets/Input-DUO0btsQ.js +2 -0
- package/dist/client/assets/{KeybindingsSettings.logic-6i6ZOa5z.js → KeybindingsSettings.logic-syA5tOXE.js} +2 -2
- package/dist/client/assets/{NoProjectsHero-GJ38wnNe.js → NoProjectsHero-DteDEVXK.js} +2 -2
- package/dist/client/assets/{P4ConnectAccountPages-D7Ar154E.js → P4ConnectAccountPages-DNsNO72W.js} +2 -2
- package/dist/client/assets/{P4ConnectSidebarSignIn-CUYAtZDx.js → P4ConnectSidebarSignIn-CCSRsOHV.js} +2 -2
- package/dist/client/assets/{PanelLayoutControls-BE1UZnqX.js → PanelLayoutControls-BfOcYLV_.js} +4 -4
- package/dist/client/assets/{PierreEntryIcon-DYysiIHP.js → PierreEntryIcon-CZSFlc29.js} +2 -2
- package/dist/client/assets/{PopoverHandle-CCHSPl9b.js → PopoverHandle-Fh0T2lgZ.js} +2 -2
- package/dist/client/assets/{PreviewPanel-C5cXvzpC.js → PreviewPanel-BOlR7nxg.js} +2 -2
- package/dist/client/assets/{ProjectDefaultsSettings-TXDWst62.js → ProjectDefaultsSettings-CeJNtS_2.js} +2 -2
- package/dist/client/assets/{ProjectFavicon-ICrHszWR.js → ProjectFavicon-qT5hWPuq.js} +3 -3
- package/dist/client/assets/{ProjectIconPickerDialog-Ba7hOqYY.js → ProjectIconPickerDialog-DFizZxrO.js} +2 -2
- package/dist/client/assets/{ProjectMonogram-B-2KfzJL.js → ProjectMonogram-BIhk1YTm.js} +2 -2
- package/dist/client/assets/{ProviderAuthTerminal-Jips16Bn.js → ProviderAuthTerminal-CGIBlp18.js} +2 -2
- package/dist/client/assets/{ProviderModelPicker-XnkpbcR8.js → ProviderModelPicker-DmTpqH-1.js} +2 -2
- package/dist/client/assets/{ProviderSettingsForm-IKIOes-H.js → ProviderSettingsForm-CGGiFito.js} +2 -2
- package/dist/client/assets/{PullRequestCodeTab-BfyP5rAG.js → PullRequestCodeTab-D_kLFUG-.js} +2 -2
- package/dist/client/assets/{ReadOnlySourcePreview-DBnxKhBT.js → ReadOnlySourcePreview-BMiQe1Lg.js} +2 -2
- package/dist/client/assets/{RenderErrorBoundary-Bl-OUl5k.js → RenderErrorBoundary-C0kFBk2V.js} +2 -2
- package/dist/client/assets/{ScheduledTasksSettings-C7ATNVHr.js → ScheduledTasksSettings--d2IHc0N.js} +2 -2
- package/dist/client/assets/{ScopedSwitch-BOKobbKr.js → ScopedSwitch-CGUJ2axV.js} +2 -2
- package/dist/client/assets/{ScrollAreaCorner-BIznaLk6.js → ScrollAreaCorner-rul6gwU9.js} +2 -2
- package/dist/client/assets/{SecretInput-C79TLohk.js → SecretInput-B0-1jamL.js} +2 -2
- package/dist/client/assets/{SelectScrollUpArrow-Cfi9Iziv.js → SelectScrollUpArrow-B1Cpt8Xi.js} +2 -2
- package/dist/client/assets/{SettingsPanels-C1KZy78u.js → SettingsPanels-9vnfPGhh.js} +2 -2
- package/dist/client/assets/{SettingsPanels.logic-B1Q6568q.js → SettingsPanels.logic-DuGA_Vtl.js} +2 -2
- package/dist/client/assets/{SettingsScopeNotice-euPyqysz.js → SettingsScopeNotice-D-W1Rrih.js} +2 -2
- package/dist/client/assets/{ThemeEditorPanel-CUd0Ycbm.js → ThemeEditorPanel-ViqKo5Pz.js} +2 -2
- package/dist/client/assets/{ThreadTerminalDrawer-DSRbySPW.js → ThreadTerminalDrawer-BZjKvCY4.js} +3 -3
- package/dist/client/assets/{TooltipViewport-DdG9rZd5.js → TooltipViewport-8hYwjAeo.js} +2 -2
- package/dist/client/assets/{Virtualizer-BIhFPLk7.js → Virtualizer-DW_9TOUV.js} +2 -2
- package/dist/client/assets/{WorkspaceBreadcrumb-CALMpobe.js → WorkspaceBreadcrumb-BdJSw-_r.js} +2 -2
- package/dist/client/assets/{WorkspacePageContainer-CiVT-7R2.js → WorkspacePageContainer-Dw8KJBJ2.js} +2 -2
- package/dist/client/assets/{WorkspacePageHeader-FKxEatch.js → WorkspacePageHeader-Bs1ZibxA.js} +2 -2
- package/dist/client/assets/{_chat-DhGy3zID.js → _chat-zHqzPoIC.js} +35 -35
- package/dist/client/assets/{_chat.design-t19d-9uy.js → _chat.design-BKFWZrif.js} +2 -2
- package/dist/client/assets/{_chat.index-KQDv-fuK.js → _chat.index-sREjixAX.js} +2 -2
- package/dist/client/assets/{_chat.new-RJprGiOy.js → _chat.new-Rp3b8Rku.js} +2 -2
- package/dist/client/assets/{_chat.pull-requests-CLVk83_X.js → _chat.pull-requests-CHm-J7nT.js} +2 -2
- package/dist/client/assets/{abnfDiagram-VCTEODGH-t5z1wnJG.js → abnfDiagram-VCTEODGH-nID8H4Ws.js} +2 -2
- package/dist/client/assets/{alert-61HmGaFS.js → alert-BeUU9Jmh.js} +2 -2
- package/dist/client/assets/architecture-7GRP2DOG-DyfYOPfc.js +1 -0
- package/dist/client/assets/{architectureDiagram-5GKGNRK7-DcOIRpxq.js → architectureDiagram-5GKGNRK7-ADmd_9R9.js} +2 -2
- package/dist/client/assets/{assets-CrSjo2kD.js → assets-BAm5fonQ.js} +2 -2
- package/dist/client/assets/{blockDiagram-I7D4REHJ-BCRVXJ_x.js → blockDiagram-I7D4REHJ-CWC3ppcV.js} +2 -2
- package/dist/client/assets/{browserHistoryStore-D1yDZcmo.js → browserHistoryStore-WB7aqbFT.js} +2 -2
- package/dist/client/assets/{browserLinkTarget-COQ2EK0x.js → browserLinkTarget-CfxBH-bb.js} +2 -2
- package/dist/client/assets/{c4Diagram-7LVT6UL2-DvlzZJ5f.js → c4Diagram-7LVT6UL2-BnPLBOS3.js} +2 -2
- package/dist/client/assets/channel-BF0vQ6gt.js +2 -0
- package/dist/client/assets/{checkbox-CmtFeke_.js → checkbox-fCF41UNu.js} +2 -2
- package/dist/client/assets/{chunk-4HAMMTFA-CQxPGvDf.js → chunk-4HAMMTFA-BMmUIm4M.js} +2 -2
- package/dist/client/assets/{chunk-75Z2AOVW-ByoE3ygp.js → chunk-75Z2AOVW-BLOF0vWA.js} +2 -2
- package/dist/client/assets/{chunk-DU6HZSFF-CxJhFL2x.js → chunk-DU6HZSFF-DcvsSVYK.js} +2 -2
- package/dist/client/assets/{chunk-F27PBJKO-C3hjOOOZ.js → chunk-F27PBJKO-Cn6gVHWw.js} +2 -2
- package/dist/client/assets/{chunk-GMAD6QVW-C3RS9FjC.js → chunk-GMAD6QVW-Rc6dmWYa.js} +2 -2
- package/dist/client/assets/{chunk-GVQU2GXP-CU4SkxJJ.js → chunk-GVQU2GXP-CCfnXEDn.js} +2 -2
- package/dist/client/assets/{chunk-IMKFNOWR-D_UNCo9G.js → chunk-IMKFNOWR-hKP_ARqC.js} +2 -2
- package/dist/client/assets/{chunk-L3NEJ4N5-CDfxiw1c.js → chunk-L3NEJ4N5-UoQ2XFY5.js} +2 -2
- package/dist/client/assets/{chunk-OSK3NFVY-NYgnlZSq.js → chunk-OSK3NFVY-M6M-pt1u.js} +2 -2
- package/dist/client/assets/{chunk-P2QGCYS3-BPZ-Bmpx.js → chunk-P2QGCYS3-Cd8cJ8M5.js} +2 -2
- package/dist/client/assets/{chunk-POPQ4Y6H-Cypzc9-c.js → chunk-POPQ4Y6H-BxePkVhI.js} +2 -2
- package/dist/client/assets/{chunk-PWAF6VOD-Db0WrtMq.js → chunk-PWAF6VOD-Bi5LpKG7.js} +2 -2
- package/dist/client/assets/{chunk-SHT3W25Y-D3molYj2.js → chunk-SHT3W25Y-BrG-a748.js} +2 -2
- package/dist/client/assets/{chunk-SVP7TREG-DgoMAGEz.js → chunk-SVP7TREG-CF1wf42R.js} +2 -2
- package/dist/client/assets/{chunk-TICWLB2K-spQbgY0o.js → chunk-TICWLB2K-BclYZT-J.js} +2 -2
- package/dist/client/assets/classDiagram-ZZMXUADV-BO63eAEb.js +2 -0
- package/dist/client/assets/classDiagram-v2-VYDZK3BY-BO63eAEb.js +2 -0
- package/dist/client/assets/{color-picker-ChpGy00s.js → color-picker-CDX0WEH1.js} +2 -2
- package/dist/client/assets/{combobox-Ch68LcDn.js → combobox-JHKSWXnT.js} +2 -2
- package/dist/client/assets/{command-BrqzJdSJ.js → command-Cn2EdEQc.js} +2 -2
- package/dist/client/assets/{composer-logic-BnxD8s0P.js → composer-logic-BOY4DYDR.js} +2 -2
- package/dist/client/assets/{composerDraftUploads-xCoYO41C.js → composerDraftUploads-ZMfUcbzB.js} +2 -2
- package/dist/client/assets/{connect-Bi0gWecR.js → connect-CxYiAJyx.js} +2 -2
- package/dist/client/assets/{connect-agent-C5_77Z12.js → connect-agent-DjA6Xdxq.js} +2 -2
- package/dist/client/assets/{cynefin-OW5HDTMX-VdrFQn-0.js → cynefin-OW5HDTMX-BmT_i5v2.js} +1 -1
- package/dist/client/assets/{cynefinDiagram-5FMLGOSQ-DrYOTpUv.js → cynefinDiagram-5FMLGOSQ-BtGOm4FD.js} +2 -2
- package/dist/client/assets/{dagre-GXQ25YYZ-D3a8EWau.js → dagre-GXQ25YYZ-BR5caQju.js} +2 -2
- package/dist/client/assets/{design-CVZ_2BzE.js → design-DafZtWVO.js} +2 -2
- package/dist/client/assets/{device-CRTuVO6r.js → device-DoBfKmlF.js} +2 -2
- package/dist/client/assets/{diagram-S7CK7UJ4-Mk5il6gg.js → diagram-S7CK7UJ4-G9md-5MD.js} +2 -2
- package/dist/client/assets/{diagram-UQ7AKVKN-CJj53e2L.js → diagram-UQ7AKVKN-CIfR4KNl.js} +2 -2
- package/dist/client/assets/{diagram-VSXAHHWV-BWgbywkR.js → diagram-VSXAHHWV-DuhvRzdY.js} +2 -2
- package/dist/client/assets/{diagram-VX7I27RA-DMf1k563.js → diagram-VX7I27RA-M9PQMscl.js} +2 -2
- package/dist/client/assets/{diagram-Z3DM3KII-DIxFk_Cz.js → diagram-Z3DM3KII-Cf9vEi4s.js} +2 -2
- package/dist/client/assets/{dialog-C-AXHdu2.js → dialog-D2TxWkVz.js} +2 -2
- package/dist/client/assets/{diffRendering-CM-KgrTj.js → diffRendering-Ddvz1xVy.js} +2 -2
- package/dist/client/assets/{discovery-list-BLwegNxU.js → discovery-list-ifxatYrP.js} +2 -2
- package/dist/client/assets/{dist-BkonGG_P.js → dist-CSj3DTUP.js} +3 -3
- package/dist/client/assets/{draft-input-f9kP93zT.js → draft-input-CPdCbcdo.js} +2 -2
- package/dist/client/assets/{duoViewer-Cp8TdqB1.js → duoViewer-D58mDyrn.js} +2 -2
- package/dist/client/assets/{dynamic-CqVCRX0A.js → dynamic-DDInnlY3.js} +2 -2
- package/dist/client/assets/{ebnfDiagram-PWID7BFC-Bq87OZKi.js → ebnfDiagram-PWID7BFC-CdnGU8S4.js} +2 -2
- package/dist/client/assets/{embeddedScripts-DUXU_2UT.js → embeddedScripts-Cnp_hNd7.js} +2 -2
- package/dist/client/assets/{empty-BGBD5hOV.js → empty-D2w_I0ra.js} +2 -2
- package/dist/client/assets/{entities-BFEUS0MV.js → entities-DYcBueIQ.js} +2 -2
- package/dist/client/assets/{erDiagram-RLTQ6QDP-BDEnYaI_.js → erDiagram-RLTQ6QDP-EL8h6pNS.js} +2 -2
- package/dist/client/assets/eventmodeling-NTZA5JFV-BGNyLRLr.js +1 -0
- package/dist/client/assets/{fileLinks-C_OGOAy0.js → fileLinks-Bvwcm27g.js} +2 -2
- package/dist/client/assets/{fileTreeExpansion-DbdTJigr.js → fileTreeExpansion-CKv7X50W.js} +4 -2
- package/dist/client/assets/flowDiagram-HODETNUW-D4h5Y9DU.js +1 -0
- package/dist/client/assets/{ganttDiagram-EL5Y4UJY-op3QCfWU.js → ganttDiagram-EL5Y4UJY-BeWGgKDe.js} +2 -2
- package/dist/client/assets/{getDiffFileInput-BPDHiYWE.js → getDiffFileInput-DkBmRBXx.js} +2 -2
- package/dist/client/assets/{gitGraph-4MIJSDKK-EJna0WOL.js → gitGraph-4MIJSDKK-tAuinbUz.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-WWUBYQGX-BLrezOEV.js → gitGraphDiagram-WWUBYQGX-BRgTxcdk.js} +2 -2
- package/dist/client/assets/{guideRunStore-Pua8pC4c.js → guideRunStore-VBGcCjdB.js} +2 -2
- package/dist/client/assets/{htmlRender-BXRxD1K0.js → htmlRender-CKceuC_c.js} +2 -2
- package/dist/client/assets/{index-DOBP-EJG.js → index-DT_x2Wmm.js} +3 -3
- package/dist/client/assets/{info-A6RAGUB7-8rXbMaiz.js → info-A6RAGUB7-CLddhXSv.js} +1 -1
- package/dist/client/assets/{infoDiagram-27XIBGKW-C12oaC7k.js → infoDiagram-27XIBGKW-Ck2KMNXn.js} +2 -2
- package/dist/client/assets/{input-CyLVEbfy.js → input-B-f6_0Yh.js} +2 -2
- package/dist/client/assets/{input-group-BpHzF9lc.js → input-group-6imEZqDF.js} +2 -2
- package/dist/client/assets/{ishikawaDiagram-5VMMS53U-W3kXC0zb.js → ishikawaDiagram-5VMMS53U-CVV4V2Va.js} +2 -2
- package/dist/client/assets/{journeyDiagram-3NMN7TZE-BT8uaxDi.js → journeyDiagram-3NMN7TZE-_ZWFV8C3.js} +2 -2
- package/dist/client/assets/{kanban-definition-UXKFOSKX-B7ND7-SD.js → kanban-definition-UXKFOSKX-Drxpl4IC.js} +2 -2
- package/dist/client/assets/{kbd-BCESLLdc.js → kbd-BWzNfkcE.js} +2 -2
- package/dist/client/assets/{keybindings-D2lV30Mz.js → keybindings-BpfREAW_.js} +2 -2
- package/dist/client/assets/{lazyRouteComponent-Cbf8_a0u.js → lazyRouteComponent-D-AmGefV.js} +2 -2
- package/dist/client/assets/{line-CaFh5vaw.js → line-DUegkqb4.js} +2 -2
- package/dist/client/assets/{link-DATjtH5q.js → link-fhNuP7xH.js} +2 -2
- package/dist/client/assets/{linkedPrompt-DedAQve-.js → linkedPrompt-vtw7tk3j.js} +2 -2
- package/dist/client/assets/main-BnBtmv6q.css +2 -0
- package/dist/client/assets/{main-BaHshvYq.js → main-o79tG0ak.js} +8 -8
- package/dist/client/assets/{mediaReference-O3GJrEIU.js → mediaReference-CrN4zeyb.js} +2 -2
- package/dist/client/assets/{mediaSource-DuaFWKv4.js → mediaSource-C3ROG2-i.js} +2 -2
- package/dist/client/assets/{mermaid-parser.core-B85FdVeQ.js → mermaid-parser.core-CqsSH_Vs.js} +4 -4
- package/dist/client/assets/{mermaid.core-BfgiEgiv.js → mermaid.core-C2amTgJW.js} +5 -5
- package/dist/client/assets/{mindmap-definition-YA3MSWOX-C27kuSH9.js → mindmap-definition-YA3MSWOX-C3Dc0dsB.js} +2 -2
- package/dist/client/assets/{number-field-CkcbPdEw.js → number-field-D8sgB2t5.js} +2 -2
- package/dist/client/assets/{observeResize-D4IgTUH5.js → observeResize-CFQCO46z.js} +2 -2
- package/dist/client/assets/{onboarding-Cjovq1W5.js → onboarding-lF9A0Lvr.js} +2 -2
- package/dist/client/assets/{openFileInPreview-lTkgJAnn.js → openFileInPreview-CUQFiuq4.js} +2 -2
- package/dist/client/assets/{p4ProjectFile-CElYjkWE.js → p4ProjectFile-wQ_DI6PZ.js} +2 -2
- package/dist/client/assets/{packet-AYTQ26CC-CWaYauqZ.js → packet-AYTQ26CC-DYEisiXm.js} +1 -1
- package/dist/client/assets/{pair-Bvr3POUi.js → pair-DzXZOQrw.js} +2 -2
- package/dist/client/assets/{pegDiagram-XKGWAZYB-B3kDVFHS.js → pegDiagram-XKGWAZYB-PyAqWngL.js} +2 -2
- package/dist/client/assets/{pendingSendStore-GVfJAspD.js → pendingSendStore-IZrHrdvI.js} +2 -2
- package/dist/client/assets/{phoneViewer-K_yf0qA-.js → phoneViewer-C4wQJita.js} +2 -2
- package/dist/client/assets/{pie-WAS4IAKB-C-AkuoFA.js → pie-WAS4IAKB-BiZuzafo.js} +1 -1
- package/dist/client/assets/{pieDiagram-E7YTZNPT-CZcM-75b.js → pieDiagram-E7YTZNPT-DJ6cQBTw.js} +2 -2
- package/dist/client/assets/{pierre-icons-B7EEc0An.js → pierre-icons-BnQ4J8dG.js} +2 -2
- package/dist/client/assets/{popover-DSpvkDFi.js → popover-CFnxwxV8.js} +2 -2
- package/dist/client/assets/{preview-D0D5go_r.js → preview-B3PdThjm.js} +2 -2
- package/dist/client/assets/{preview-B6BR8ksI.js → preview-CchO6ZxQ.js} +2 -2
- package/dist/client/assets/{previewMiniPlayerStore-BkcmyfQf.js → previewMiniPlayerStore-DhWJVpLX.js} +2 -2
- package/dist/client/assets/{primary-KFQ3FtJ7.js → primary-DHkJeZE5.js} +2 -2
- package/dist/client/assets/{primaryCloudLinkState-BNae8QE-.js → primaryCloudLinkState-CQGqUe5Z.js} +2 -2
- package/dist/client/assets/{projectFilesQueryState-DYM4LICj.js → projectFilesQueryState-CK8V3D_H.js} +2 -2
- package/dist/client/assets/{projectScriptEditor-OsyI37w0.js → projectScriptEditor-Dnq8wkNa.js} +2 -2
- package/dist/client/assets/{providerSkills-BmIipPix.js → providerSkills-dqx0wFDy.js} +2 -2
- package/dist/client/assets/{pullRequestDetail.logic-CqDZ5g0j.js → pullRequestDetail.logic-DS1SYAn0.js} +2 -2
- package/dist/client/assets/{pullRequestIcons-Cf6S2cR8.js → pullRequestIcons-B2iTt9H1.js} +2 -2
- package/dist/client/assets/{pullRequestReviewStore-CQxQgiFQ.js → pullRequestReviewStore-DQXty7CX.js} +2 -2
- package/dist/client/assets/{pullRequests-CSBkKZN_.js → pullRequests-Djl75ZaK.js} +2 -2
- package/dist/client/assets/{quadrantDiagram-AXDQQJYC-L_HgCOzl.js → quadrantDiagram-AXDQQJYC-CroWwkQp.js} +2 -2
- package/dist/client/assets/{queries-CPW8n8P2.js → queries-H1IDPhJo.js} +2 -2
- package/dist/client/assets/{query-BaUS26f1.js → query-CrtXKOxk.js} +2 -2
- package/dist/client/assets/{radar-RG4KPBEZ-CivxkEmZ.js → radar-RG4KPBEZ-LeplYTz7.js} +1 -1
- package/dist/client/assets/{radio-group-znYoQ5jv.js → radio-group-CqNTRY1A.js} +2 -2
- package/dist/client/assets/{railroad-74A4TZTK-EW5ap3Uk.js → railroad-74A4TZTK-Dx-JHdmS.js} +1 -1
- package/dist/client/assets/railroad-abnf-HS5TGJTU-BZvFsNPH.js +1 -0
- package/dist/client/assets/railroad-ebnf-LZEXJU2U-BWlDZ7xc.js +1 -0
- package/dist/client/assets/railroad-peg-WCYAUIDC--JkOWmP3.js +1 -0
- package/dist/client/assets/{railroadDiagram-O6MQD6OU-91r4kx_C.js → railroadDiagram-O6MQD6OU-Cng7FrK3.js} +2 -2
- package/dist/client/assets/{renderScheduler-BeK99gYq.js → renderScheduler-Bri4egpt.js} +2 -2
- package/dist/client/assets/{requirementDiagram-BXWQKSXE-ewjTPAQv.js → requirementDiagram-BXWQKSXE-CRqEhIuH.js} +2 -2
- package/dist/client/assets/{rightPanelStore-D_BFsdvo.js → rightPanelStore-C24EACg1.js} +2 -2
- package/dist/client/assets/{runtime-BD3Q-gPo.js → runtime-BoS3svRr.js} +3 -3
- package/dist/client/assets/{runtime-CYS_HmDu.js → runtime-dibyMnpt.js} +2 -2
- package/dist/client/assets/{runtimeModeConfig-NDts48yX.js → runtimeModeConfig-Cq4qBBQz.js} +2 -2
- package/dist/client/assets/{sankeyDiagram-P5KCCOFB-AaDNrvur.js → sankeyDiagram-P5KCCOFB-DxCT5kbi.js} +2 -2
- package/dist/client/assets/{scheduledTasksSettings.logic-B5btE2kZ.js → scheduledTasksSettings.logic-CT0e8Q4B.js} +2 -2
- package/dist/client/assets/{scroll-area-1mTt9e_w.js → scroll-area-DXW_WIUB.js} +2 -2
- package/dist/client/assets/{select-C3qtJHHz.js → select-DkBs5u_m.js} +2 -2
- package/dist/client/assets/{sequenceDiagram-WJ2MYXX4-oEk1pEy7.js → sequenceDiagram-WJ2MYXX4-B_7vBMwW.js} +2 -2
- package/dist/client/assets/{server-DbZyg5DS.js → server-c3qBJcFf.js} +2 -2
- package/dist/client/assets/{session-CZ54Pt8a.js → session-DSU6Gpmh.js} +2 -2
- package/dist/client/assets/{session-logic-Dl5ZfweX.js → session-logic-B-TC6OqT.js} +2 -2
- package/dist/client/assets/{settings-U7xJrpYG.js → settings-bJ7fyuMB.js} +2 -2
- package/dist/client/assets/{settings.appearance-BAL1SlyQ.js → settings.appearance-mzc4rmPF.js} +2 -2
- package/dist/client/assets/settings.archived-DZUfUaK5.js +2 -0
- package/dist/client/assets/{settings.computer-use-CFQ7AMzB.js → settings.computer-use-CoAdDyer.js} +2 -2
- package/dist/client/assets/{settings.connections-BQ9kTua7.js → settings.connections-e2VpNXnS.js} +2 -2
- package/dist/client/assets/{settings.data-controls-DjjJ5kF4.js → settings.data-controls-Z-hHwSxC.js} +2 -2
- package/dist/client/assets/{settings.decisions-BJjTL0fp.js → settings.decisions-CemF3lRg.js} +2 -2
- package/dist/client/assets/{settings.designs-CVHQqx3n.js → settings.designs-ChPt6dw4.js} +2 -2
- package/dist/client/assets/{settings.diagnostics-BPt4kWXo.js → settings.diagnostics-BZsZUfG4.js} +2 -2
- package/dist/client/assets/{settings.general-2-cxXxzq.js → settings.general-BfcLUlDK.js} +2 -2
- package/dist/client/assets/{settings.integrations-DWLVwJhz.js → settings.integrations-bMySZ3xQ.js} +2 -2
- package/dist/client/assets/{settings.keybindings-CEI48kYu.js → settings.keybindings-lEwh5VVT.js} +2 -2
- package/dist/client/assets/{settings.open-source-licenses-CSHAwMa-.js → settings.open-source-licenses-hbi_Eida.js} +2 -2
- package/dist/client/assets/{settings.plugins-B2qYws_x.js → settings.plugins-uQgo5kKH.js} +2 -2
- package/dist/client/assets/{settings.projects-mqMUluFy.js → settings.projects-BX00Ds_W.js} +3 -3
- package/dist/client/assets/{settings.providers-CVn9TdT6.js → settings.providers-ChCjhFPm.js} +3 -3
- package/dist/client/assets/{settings.scheduled-tasks-CGCW7jt4.js → settings.scheduled-tasks-BPdgliUI.js} +2 -2
- package/dist/client/assets/{settings.snap-shot-BwlI37um.js → settings.snap-shot-CUiI3kp9.js} +2 -2
- package/dist/client/assets/{settings.source-control-CKO1wLGw.js → settings.source-control-DnXvsfKg.js} +2 -2
- package/dist/client/assets/{settings.storage-D9B95lPl.js → settings.storage-CITIJQBP.js} +2 -2
- package/dist/client/assets/{settingsLayout-BUXF2u92.js → settingsLayout-CMZkPLAK.js} +2 -2
- package/dist/client/assets/{sidebar-tYIa3_8M.js → sidebar-DlxUoXMx.js} +2 -2
- package/dist/client/assets/{sidebarProjectGrouping-Bq3Z5shR.js → sidebarProjectGrouping-Dw7JdLLE.js} +2 -2
- package/dist/client/assets/{skeleton-C5tu1gWo.js → skeleton-D4aDYk5u.js} +2 -2
- package/dist/client/assets/{sourceControl-DrtWBs3V.js → sourceControl-Cla5zUd3.js} +2 -2
- package/dist/client/assets/{sourceControlClients-B9NhKGf6.js → sourceControlClients-C4s3TVIY.js} +2 -2
- package/dist/client/assets/{spinner-DU7w6Tl0.js → spinner-FYgwMJ6T.js} +2 -2
- package/dist/client/assets/{standalone-page-C5ckzQAC.js → standalone-page-CKUVIQ1e.js} +2 -2
- package/dist/client/assets/{stateDiagram-D77RDMKH-Nv8b020l.js → stateDiagram-D77RDMKH-DcD8HmfB.js} +2 -2
- package/dist/client/assets/stateDiagram-v2-MP3YSRHH-B14Nnvlu.js +2 -0
- package/dist/client/assets/{swimlanes-42K2YHIH-BHEi83oj.js → swimlanes-42K2YHIH-BlBkmfsT.js} +2 -2
- package/dist/client/assets/swimlanesDiagram-VR7AAH4N-D10Jhf1N.js +9 -0
- package/dist/client/assets/{terminal-links-DaRIZ_ri.js → terminal-links-ZQCDiM-O.js} +2 -2
- package/dist/client/assets/{terminalSessions-DvEfRw4m.js → terminalSessions-Dxo8abTt.js} +2 -2
- package/dist/client/assets/{textarea-CAyj7_Hj.js → textarea-CBtjBVW3.js} +2 -2
- package/dist/client/assets/{themePalette-B0pJNxta.js → themePalette-tRVivgCl.js} +2 -2
- package/dist/client/assets/{timeline-definition-24CTP7MA-DCGMxN2J.js → timeline-definition-24CTP7MA-DJ6DOYfi.js} +2 -2
- package/dist/client/assets/{toast-BDoYTcO9.js → toast-45xHk8t0.js} +2 -2
- package/dist/client/assets/{toggle-BdizphFv.js → toggle-CBuoGytK.js} +2 -2
- package/dist/client/assets/{toggle-group-DAQh9V2C.js → toggle-group-C1HL5vwX.js} +2 -2
- package/dist/client/assets/{tooltip-DguVraEa.js → tooltip-CGIYdVkV.js} +2 -2
- package/dist/client/assets/{treeView-Q6P3EWNA-DLsS087V.js → treeView-Q6P3EWNA-bTdGasLu.js} +1 -1
- package/dist/client/assets/{treemap-WGGIJYW6-DZcq234F.js → treemap-WGGIJYW6-daOCp2lU.js} +1 -1
- package/dist/client/assets/{uiStateStore-VU84hC1r.js → uiStateStore-C20vhoIi.js} +2 -2
- package/dist/client/assets/{usage-BjbKwEBL.js → usage-CfPnKiRu.js} +2 -2
- package/dist/client/assets/{usageAccess-DeusmFu4.js → usageAccess-JgjzTgv_.js} +2 -2
- package/dist/client/assets/{usageFormat-bv0-SbBE.js → usageFormat-BXO14RVw.js} +2 -2
- package/dist/client/assets/{usageShortcuts-Dx5czWNh.js → usageShortcuts-DSDNMPfj.js} +2 -2
- package/dist/client/assets/{use-atom-command-DWENi-Kq.js → use-atom-command-D-h097sl.js} +2 -2
- package/dist/client/assets/{useAriaLabelledBy-CvM07jd7.js → useAriaLabelledBy-CiJdbReS.js} +2 -2
- package/dist/client/assets/{useHandleNewThread-BevNhAvp.js → useHandleNewThread-CgAzOCNO.js} +2 -2
- package/dist/client/assets/{useLocation-CsUjfT4f.js → useLocation-CX6-ZBHr.js} +2 -2
- package/dist/client/assets/useNavigate-hIX0aKyk.js +2 -0
- package/dist/client/assets/{useNavigateBack-CpakkPiu.js → useNavigateBack-CURt1gqJ.js} +2 -2
- package/dist/client/assets/{useP4ConnectAuthPrompt-Dos10UY-.js → useP4ConnectAuthPrompt-YijczhP3.js} +2 -2
- package/dist/client/assets/{useParams-BmGuCYQD.js → useParams-Ck_hBeVd.js} +2 -2
- package/dist/client/assets/{usePermissionStatus-DxuVlxCI.js → usePermissionStatus-CBGpzeTh.js} +2 -2
- package/dist/client/assets/{usePullRequestActions-B1gYq--s.js → usePullRequestActions-DErc7uKF.js} +2 -2
- package/dist/client/assets/{useRegisterFieldControl-D9BX_Pej.js → useRegisterFieldControl-B6t05DZf.js} +2 -2
- package/dist/client/assets/{useScopedModelAvailability-UwO2vexH.js → useScopedModelAvailability-BKL9M4Zi.js} +2 -2
- package/dist/client/assets/{useSettings-BaZP4LTG.js → useSettings-CF52Llff.js} +2 -2
- package/dist/client/assets/{utils-CyMIjIQl.js → utils-DPab5G1h.js} +2 -2
- package/dist/client/assets/{vcsRefInvalidation-AWZHImpO.js → vcsRefInvalidation-DToXD8si.js} +2 -2
- package/dist/client/assets/{vennDiagram-4TSXK5OY-DoNr7ggz.js → vennDiagram-4TSXK5OY-BZhmnQ7w.js} +2 -2
- package/dist/client/assets/{wardley-WFR3VGLG-C0-g8Z0r.js → wardley-WFR3VGLG-B2T_T_mo.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-VM6X3IG4-CE5djs04.js → wardleyDiagram-VM6X3IG4-C8cIQYgo.js} +2 -2
- package/dist/client/assets/{welcome-BB-0eAGm.js → welcome-BmripdEM.js} +2 -2
- package/dist/client/assets/{xychartDiagram-S5SC5T6Z-CuLm0sO7.js → xychartDiagram-S5SC5T6Z-BHFfxI75.js} +2 -2
- package/dist/client/index.html +1 -1
- package/dist/{renderer-A818pKS0.mjs → renderer-Cl5-TVgQ.mjs} +2 -2
- package/dist/resource-monitor/darwin-arm64/p4-resource-monitor +0 -0
- package/dist/{runtime-chxDiILq.mjs → runtime-AFwhp7fW.mjs} +3 -2
- package/package.json +1 -1
- package/dist/client/assets/AlertDialogRoot-BSccQInP.js +0 -2
- package/dist/client/assets/Input-Ffzotn9J.js +0 -2
- package/dist/client/assets/architecture-7GRP2DOG-DgOy0dfB.js +0 -1
- package/dist/client/assets/channel-BIESPbx4.js +0 -2
- package/dist/client/assets/classDiagram-ZZMXUADV-C1C1MJdp.js +0 -2
- package/dist/client/assets/classDiagram-v2-VYDZK3BY-C1C1MJdp.js +0 -2
- package/dist/client/assets/eventmodeling-NTZA5JFV-B1YZgpjy.js +0 -1
- package/dist/client/assets/flowDiagram-HODETNUW-CFvVv1a2.js +0 -1
- package/dist/client/assets/main-BjxTXt02.css +0 -2
- package/dist/client/assets/railroad-abnf-HS5TGJTU-BbAwy8JJ.js +0 -1
- package/dist/client/assets/railroad-ebnf-LZEXJU2U-DPSsaf9m.js +0 -1
- package/dist/client/assets/railroad-peg-WCYAUIDC-Dl-4IH_W.js +0 -1
- package/dist/client/assets/settings.archived-BV2WO97K.js +0 -2
- package/dist/client/assets/stateDiagram-v2-MP3YSRHH-C4UghKIZ.js +0 -2
- package/dist/client/assets/swimlanesDiagram-VR7AAH4N-sqiR-R0o.js +0 -9
- package/dist/client/assets/useNavigate-JwBJSn8e.js +0 -2
package/dist/client/assets/{usePermissionStatus-DxuVlxCI.js → usePermissionStatus-CBGpzeTh.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{Ad as n,BE as r,lr as i,mE as a}from"./utils-
|
|
2
|
-
//# sourceMappingURL=usePermissionStatus-
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{Ad as n,BE as r,lr as i,mE as a}from"./utils-DPab5G1h.js";var o=r(),s=e(a(),1);function c(e){let t=(0,o.c)(7),{permissions:r,busy:a}=e,c=a!==void 0&&a,l;if(t[0]!==c||t[1]!==r){let e;t[3]===c?e=t[4]:(e=e=>(0,s.jsxs)(`div`,{className:`flex items-center gap-3 rounded-lg border px-3 py-2`,children:[e.icon,(0,s.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,s.jsx)(`p`,{className:`font-medium`,children:e.title}),(0,s.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.description})]}),e.granted?(0,s.jsxs)(`span`,{role:`status`,className:`flex items-center gap-1 text-xs text-success`,children:[(0,s.jsx)(n,{className:`size-4`,"aria-hidden":`true`}),`Allowed`]}):(0,s.jsx)(i,{size:`xs`,variant:`outline`,disabled:c,onClick:e.onAllow,children:`Allow`})]},e.id),t[3]=c,t[4]=e),l=r.map(e),t[0]=c,t[1]=r,t[2]=l}else l=t[2];let u;return t[5]===l?u=t[6]:(u=(0,s.jsx)(`div`,{className:`space-y-2`,children:l}),t[5]=l,t[6]=u),u}function l(e){let t=(0,o.c)(9),n,r,a,c;t[0]===e?(n=t[1],r=t[2],a=t[3],c=t[4]):({ready:r,busy:a,children:c,...n}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=a,t[4]=c);let l=a!==void 0&&a,u=c===void 0?`Continue`:c,d=!r||l,f;return t[5]!==u||t[6]!==n||t[7]!==d?(f=(0,s.jsx)(i,{...n,disabled:d,children:u}),t[5]=u,t[6]=n,t[7]=d,t[8]=f):f=t[8],f}var u=e(t(),1);function d(e,t,n){let r=(0,o.c)(12),i=n===void 0||n,[a,s]=(0,u.useState)(t),[c,l]=(0,u.useState)(null),d=(0,u.useEffectEvent)(e),f;r[0]!==d||r[1]!==i?(f=()=>{if(!i)return;let e=!1,t=!1,n=async()=>{if(!(e||t||document.visibilityState===`hidden`)){t=!0;try{let t=await d();e||(s(t),l(null))}catch{e||l(`Could not check permissions. We'll try again automatically.`)}t=!1}};n();let r=window.setInterval(()=>void n(),1500);return window.addEventListener(`focus`,n),document.addEventListener(`visibilitychange`,n),()=>{e=!0,window.clearInterval(r),window.removeEventListener(`focus`,n),document.removeEventListener(`visibilitychange`,n)}},r[0]=d,r[1]=i,r[2]=f):f=r[2];let p;r[3]===i?p=r[4]:(p=[i],r[3]=i,r[4]=p),(0,u.useEffect)(f,p);let m;r[5]!==c||r[6]!==a?(m=e=>c===null&&e.every(e=>a[e]),r[5]=c,r[6]=a,r[7]=m):m=r[7];let h;return r[8]!==c||r[9]!==a||r[10]!==m?(h={status:a,error:c,isReady:m},r[8]=c,r[9]=a,r[10]=m,r[11]=h):h=r[11],h}export{c as n,l as r,d as t};
|
|
2
|
+
//# sourceMappingURL=usePermissionStatus-CBGpzeTh.js.map
|
package/dist/client/assets/{usePullRequestActions-B1gYq--s.js → usePullRequestActions-DErc7uKF.js}
RENAMED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{$o as n,BE as r,Cs as i,D as a,Es as o,P_ as s,RT as c,S_ as l,Vc as u,Yo as d,Ys as f,_w as p,k_ as m,vs as h}from"./utils-CyMIjIQl.js";import{M as g,N as _,W as v}from"./runtime-BD3Q-gPo.js";import{a as y,i as b}from"./vcsRefInvalidation-AWZHImpO.js";import{w as ee}from"./entities-BFEUS0MV.js";import{t as te}from"./runtime-CYS_HmDu.js";import{i as x}from"./toast-BDoYTcO9.js";import{O as S,f as C,s as w}from"./useSettings-BaZP4LTG.js";import{i as T,n as E}from"./session-CZ54Pt8a.js";import{n as D}from"./query-BaUS26f1.js";import{t as O}from"./use-atom-command-DWENi-Kq.js";import{d as k,l as A,u as j}from"./queries-CPW8n8P2.js";import{t as M}from"./sourceControl-DrtWBs3V.js";import{C as N,r as P}from"./pullRequests-CSBkKZN_.js";import{R as F,b as ne,y as re}from"./pullRequestDetail.logic-CqDZ5g0j.js";import{n as ie}from"./useHandleNewThread-BevNhAvp.js";import{c as ae,f as I,i as L,s as R}from"./p4ProjectFile-CElYjkWE.js";import{t as z}from"./sidebarProjectGrouping-Bq3Z5shR.js";var B=e(t(),1),V=r();function H(e){return{pullRequestResolution:_(e,{label:`environment-data:git:resolve-pull-request`,tag:u.gitResolvePullRequest}),preparePullRequestThread:g(e,{label:`environment-data:git:prepare-pull-request-thread`,tag:u.gitPreparePullRequestThread,scheduler:y,concurrency:b})}}var U=H(te),W={init:`init`,pull:`pull`,publishRepository:`publish_repository`,runStackedAction:`run_change_request`,preparePullRequestThread:`prepare_pull_request_thread`};function G(e){let t=T(e.scope.environmentId,m),r=W[e.kind],a=n(A.stateAtom(e.scope)),o=a.operation===r,c=(0,B.useCallback)(()=>{A.resetError(d,e.scope,r)},[e.scope,r]),l=(0,B.useCallback)(async(...t)=>{if(e.scope.environmentId===null||!E(e.scope.environmentId,`source-control:write`))return h(p(new s({requiredScope:m,message:`This connection cannot change source control.`})));let n=async()=>{let n=await e.action(...t);return i(n)&&e.onSuccess?.(),n};return e.managedExternally===!0?n():A.track(d,e.scope,{operation:r,label:e.label},n)},[e.action,e.label,e.managedExternally,e.onSuccess,e.scope,r]);return{isAllowed:t,error:o?a.error:null,isPending:o&&a.isRunning,resetError:c,run:l}}function K(e){return e.environmentId===null||e.cwd===null?null:{environmentId:e.environmentId,cwd:e.cwd}}function q(e,t){let r=(0,V.c)(6),i;r[0]===e?i=r[1]:(i=A.stateAtom(e),r[0]=e,r[1]=i);let a=n(i),o;return r[2]!==t||r[3]!==a.isRunning||r[4]!==a.operation?(o=a.isRunning&&a.operation!==null&&t.some(e=>W[e]===a.operation),r[2]=t,r[3]=a.isRunning,r[4]=a.operation,r[5]=o):o=r[5],o}function J(e){let t=(0,V.c)(7),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},t[0]=n):n=t[0];let r=O(j.init,n),i;t[1]!==r||t[2]!==e?(i=async()=>{let t=K(e);return t===null?h(p(new k({operation:`init`,environmentId:e.environmentId,cwd:e.cwd}))):r({environmentId:t.environmentId,input:{cwd:t.cwd}})},t[1]=r,t[2]=e,t[3]=i):i=t[3];let a=i,o;return t[4]!==a||t[5]!==e?(o={kind:`init`,label:`Initializing repository`,scope:e,action:a},t[4]=a,t[5]=e,t[6]=o):o=t[6],G(o)}function oe(e){let t=(0,V.c)(11),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},t[0]=n):n=t[0];let r=O(j.pull,n),i;t[1]!==e.cwd||t[2]!==e.environmentId?(i=e.environmentId!==null&&e.cwd!==null?j.status({environmentId:e.environmentId,input:{cwd:e.cwd}}):null,t[1]=e.cwd,t[2]=e.environmentId,t[3]=i):i=t[3];let a=D(i),o;t[4]!==r||t[5]!==e?(o=async()=>{let t=K(e);return t===null?h(p(new k({operation:`pull`,environmentId:e.environmentId,cwd:e.cwd}))):r({environmentId:t.environmentId,input:{cwd:t.cwd}})},t[4]=r,t[5]=e,t[6]=o):o=t[6];let s=o,c;return t[7]!==s||t[8]!==e||t[9]!==a.refresh?(c={kind:`pull`,label:`Pulling latest changes...`,scope:e,action:s,onSuccess:a.refresh},t[7]=s,t[8]=e,t[9]=a.refresh,t[10]=c):c=t[10],G(c)}function se(e){let t=(0,V.c)(13),n;t[0]===e?n=t[1]:(n=A.runStackedAction(e),t[0]=e,t[1]=n);let r;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(r={reportFailure:!1},t[2]=r):r=t[2];let i=O(n,r),a;t[3]!==e.cwd||t[4]!==e.environmentId?(a=e.environmentId!==null&&e.cwd!==null?j.status({environmentId:e.environmentId,input:{cwd:e.cwd}}):null,t[3]=e.cwd,t[4]=e.environmentId,t[5]=a):a=t[5];let o=D(a),s;t[6]!==i||t[7]!==e?(s=async t=>K(e)===null?h(p(new k({operation:`run_change_request`,environmentId:e.environmentId,cwd:e.cwd}))):i(t),t[6]=i,t[7]=e,t[8]=s):s=t[8];let c=s,l;return t[9]!==c||t[10]!==e||t[11]!==o.refresh?(l={kind:`runStackedAction`,label:`Running source control action`,scope:e,action:c,onSuccess:o.refresh,managedExternally:!0},t[9]=c,t[10]=e,t[11]=o.refresh,t[12]=l):l=t[12],G(l)}function ce(e){let t=(0,V.c)(11),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},t[0]=n):n=t[0];let r=O(M.publishRepository,n),i;t[1]!==e.cwd||t[2]!==e.environmentId?(i=e.environmentId!==null&&e.cwd!==null?j.status({environmentId:e.environmentId,input:{cwd:e.cwd}}):null,t[1]=e.cwd,t[2]=e.environmentId,t[3]=i):i=t[3];let a=D(i),o;t[4]!==r||t[5]!==e?(o=async t=>{let n=K(e);return n===null?h(p(new k({operation:`publish_repository`,environmentId:e.environmentId,cwd:e.cwd}))):r({environmentId:n.environmentId,input:{cwd:n.cwd,...t}})},t[4]=r,t[5]=e,t[6]=o):o=t[6];let s=o,c;return t[7]!==s||t[8]!==e||t[9]!==a.refresh?(c={kind:`publishRepository`,label:`Publishing repository`,scope:e,action:s,onSuccess:a.refresh},t[7]=s,t[8]=e,t[9]=a.refresh,t[10]=c):c=t[10],G(c)}function Y(e){let t=(0,V.c)(7),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},t[0]=n):n=t[0];let r=O(U.preparePullRequestThread,n),i;t[1]!==r||t[2]!==e?(i=async t=>{let n=K(e);return n===null?h(p(new k({operation:`prepare_pull_request_thread`,environmentId:e.environmentId,cwd:e.cwd}))):t.mode===`worktree`&&t.threadId!==void 0&&!E(n.environmentId,`orchestration:operate`)?h(p(new s({requiredScope:l,message:`This connection cannot change threads.`}))):r({environmentId:n.environmentId,input:{cwd:n.cwd,reference:t.reference,mode:t.mode,...t.threadId?{threadId:t.threadId}:{}}})},t[1]=r,t[2]=e,t[3]=i):i=t[3];let a=i,o;return t[4]!==a||t[5]!==e?(o={kind:`preparePullRequestThread`,label:`Preparing pull request thread`,scope:e,action:a},t[4]=a,t[5]=e,t[6]=o):o=t[6],G(o)}function X(e){return e.environmentId===null||e.cwd===null||e.reference===null?null:c(o(d.get(U.pullRequestResolution({environmentId:e.environmentId,input:{cwd:e.cwd,reference:e.reference}}))))}function le(e){let t=(0,V.c)(12),n;t[0]!==e.cwd||t[1]!==e.environmentId||t[2]!==e.reference?(n=e.environmentId!==null&&e.cwd!==null&&e.reference!==null?U.pullRequestResolution({environmentId:e.environmentId,input:{cwd:e.cwd,reference:e.reference}}):null,t[0]=e.cwd,t[1]=e.environmentId,t[2]=e.reference,t[3]=n):n=t[3];let r=D(n),i;t[4]===e?i=t[5]:(i=X(e),t[4]=e,t[5]=i);let a=i,o=r.data??a,s=r.isPending&&a===null,c;return t[6]!==r.error||t[7]!==r.isPending||t[8]!==r.refresh||t[9]!==o||t[10]!==s?(c={data:o,error:r.error,isPending:s,isFetching:r.isPending,refresh:r.refresh},t[6]=r.error,t[7]=r.isPending,t[8]=r.refresh,t[9]=o,t[10]=s,t[11]=c):c=t[11],c}function ue(e,t){let n=(0,V.c)(10),r;n[0]===t?r=n[1]:(r=e=>L(e,t).settings.pullRequestMergeMethod,n[0]=t,n[1]=r);let i=C(e,r),a=w(de),o=w(I),s=ee(),c=S(),l;return n[2]!==e||n[3]!==o||n[4]!==a||n[5]!==c||n[6]!==i||n[7]!==t||n[8]!==s?(l=()=>{if(i!=null)return i;if(Object.keys(a).length===0)return;let n=s.find(n=>n.environmentId===e&&n.id===t);if(!n)return;let r=z({projects:s,settings:o,primaryEnvironmentId:c}).get(ae(n))??R(n,o);return a[r]},n[2]=e,n[3]=o,n[4]=a,n[5]=c,n[6]=i,n[7]=t,n[8]=s,n[9]=l):l=n[9],l}function de(e){return e.pullRequestMergeMethodOverrides}var fe={merge:`Merge requested`,ready:`Marked ready for review`,draft:`Converted to draft`,close:`Pull request closed`,reopen:`Pull request reopened`,"update-branch":`Branch updated with the base branch`,"enable-auto-merge":`Auto-merge enabled`,"disable-auto-merge":`Auto-merge disabled`,revert:`Revert pull request opened`,"delete-branch":`Branch deleted`,"approve-workflows":`Workflows approved`},pe={merge:`Could not merge this pull request`,ready:`Could not mark this ready for review`,draft:`Could not convert this to a draft`,close:`Could not close this pull request`,reopen:`Could not reopen this pull request`,"update-branch":`Could not update this branch`,"enable-auto-merge":`Could not enable auto-merge`,"disable-auto-merge":`Could not disable auto-merge`,revert:`Could not open a revert pull request`,"delete-branch":`Could not delete this branch`,"approve-workflows":`Could not approve workflows`},Z={merge:`The host refused the merge. Check that you have write access, that the checks it requires have passed, and that the branch is not conflicting.`,ready:`The host refused it. Check that you have write access to this repository.`,draft:`The host refused it. Check that you have write access to this repository.`,close:`The host refused it. Check that you have write access, or that you opened it.`,reopen:`The host refused it. Check that you have write access, and that the branch still exists.`,"update-branch":`The host refused it. Check that you have write access, and that the base branch has not diverged in a way the host cannot merge.`,"enable-auto-merge":`The host refused it. Check that auto-merge is enabled for this repository and that you have write access.`,"disable-auto-merge":`The host refused it. Check that you have write access to this repository.`,revert:`The host refused it. Check that you have write access and that this pull request was merged on the host.`,"delete-branch":`The host refused it. Check that you have write access to the source repository and that the branch has not moved since this page loaded.`,"approve-workflows":`The host refused it. Check that you have Actions write access and that these workflow runs are still awaiting approval.`};function me({environmentId:e,reference:t,onSuccess:n,resolveMergeMethod:r}){let i=O(P.runAction,{reportFailure:!1}),[a,o]=(0,B.useState)(!1),s=(0,B.useRef)(!1);return{actionPending:a,perform:async(a,c)=>{if(!(s.current||t===null)){s.current=!0,o(!0);try{let o=await i({environmentId:e,input:{...t,action:a,...c?{mergeMethod:c}:r?{resolveMergeMethod:r}:{}}});if(o._tag===`Failure`)throw v(o);x.add({type:`success`,title:fe[a]}),n?.(a)}catch(e){x.add({type:`error`,title:pe[a],description:F(e,Z[a])})}finally{s.current=!1,o(!1)}}}}}function Q(e){let t=O(P.runAction,{reportFailure:!1}),n=(0,B.useRef)(new Set),[r,i]=(0,B.useState)(()=>new Set);return{close:(0,B.useCallback)(async r=>{let a=r.filter(e=>{let t=N(e);return e.state!==`open`||n.current.has(t)?!1:(n.current.add(t),!0)});if(a.length===0)return;i(new Set(n.current));let o=0,s=[];await Promise.all(a.map(async r=>{try{let n=await t({environmentId:r.environmentId,input:{projectId:r.projectId,host:r.host,repository:r.repository,number:r.number,action:`close`}});if(n._tag===`Failure`)throw v(n);o++,e(r)}catch(e){s.push(`#${r.number}: ${F(e,Z.close)}`)}finally{n.current.delete(N(r)),i(new Set(n.current))}})),x.add({type:s.length>0?`error`:`success`,title:s.length>0?`Closed ${o} of ${a.length} pull requests`:`Closed ${o} pull request${o===1?``:`s`}`,...s.length>0?{description:s.slice(0,3).join(`
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{$o as n,BE as r,Cs as i,D as a,Es as o,P_ as s,RT as c,S_ as l,Vc as u,Yo as d,Ys as f,_w as p,k_ as m,vs as h}from"./utils-DPab5G1h.js";import{M as g,N as _,W as v}from"./runtime-BoS3svRr.js";import{a as y,i as b}from"./vcsRefInvalidation-DToXD8si.js";import{w as ee}from"./entities-DYcBueIQ.js";import{t as te}from"./runtime-dibyMnpt.js";import{i as x}from"./toast-45xHk8t0.js";import{O as S,f as C,s as w}from"./useSettings-CF52Llff.js";import{i as T,n as E}from"./session-DSU6Gpmh.js";import{n as D}from"./query-CrtXKOxk.js";import{t as O}from"./use-atom-command-D-h097sl.js";import{d as k,l as A,u as j}from"./queries-H1IDPhJo.js";import{t as M}from"./sourceControl-Cla5zUd3.js";import{C as N,r as P}from"./pullRequests-Djl75ZaK.js";import{R as F,b as ne,y as re}from"./pullRequestDetail.logic-DS1SYAn0.js";import{n as ie}from"./useHandleNewThread-CgAzOCNO.js";import{c as ae,f as I,i as L,s as R}from"./p4ProjectFile-wQ_DI6PZ.js";import{t as z}from"./sidebarProjectGrouping-Dw7JdLLE.js";var B=e(t(),1),V=r();function H(e){return{pullRequestResolution:_(e,{label:`environment-data:git:resolve-pull-request`,tag:u.gitResolvePullRequest}),preparePullRequestThread:g(e,{label:`environment-data:git:prepare-pull-request-thread`,tag:u.gitPreparePullRequestThread,scheduler:y,concurrency:b})}}var U=H(te),W={init:`init`,pull:`pull`,publishRepository:`publish_repository`,runStackedAction:`run_change_request`,preparePullRequestThread:`prepare_pull_request_thread`};function G(e){let t=T(e.scope.environmentId,m),r=W[e.kind],a=n(A.stateAtom(e.scope)),o=a.operation===r,c=(0,B.useCallback)(()=>{A.resetError(d,e.scope,r)},[e.scope,r]),l=(0,B.useCallback)(async(...t)=>{if(e.scope.environmentId===null||!E(e.scope.environmentId,`source-control:write`))return h(p(new s({requiredScope:m,message:`This connection cannot change source control.`})));let n=async()=>{let n=await e.action(...t);return i(n)&&e.onSuccess?.(),n};return e.managedExternally===!0?n():A.track(d,e.scope,{operation:r,label:e.label},n)},[e.action,e.label,e.managedExternally,e.onSuccess,e.scope,r]);return{isAllowed:t,error:o?a.error:null,isPending:o&&a.isRunning,resetError:c,run:l}}function K(e){return e.environmentId===null||e.cwd===null?null:{environmentId:e.environmentId,cwd:e.cwd}}function q(e,t){let r=(0,V.c)(6),i;r[0]===e?i=r[1]:(i=A.stateAtom(e),r[0]=e,r[1]=i);let a=n(i),o;return r[2]!==t||r[3]!==a.isRunning||r[4]!==a.operation?(o=a.isRunning&&a.operation!==null&&t.some(e=>W[e]===a.operation),r[2]=t,r[3]=a.isRunning,r[4]=a.operation,r[5]=o):o=r[5],o}function J(e){let t=(0,V.c)(7),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},t[0]=n):n=t[0];let r=O(j.init,n),i;t[1]!==r||t[2]!==e?(i=async()=>{let t=K(e);return t===null?h(p(new k({operation:`init`,environmentId:e.environmentId,cwd:e.cwd}))):r({environmentId:t.environmentId,input:{cwd:t.cwd}})},t[1]=r,t[2]=e,t[3]=i):i=t[3];let a=i,o;return t[4]!==a||t[5]!==e?(o={kind:`init`,label:`Initializing repository`,scope:e,action:a},t[4]=a,t[5]=e,t[6]=o):o=t[6],G(o)}function oe(e){let t=(0,V.c)(11),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},t[0]=n):n=t[0];let r=O(j.pull,n),i;t[1]!==e.cwd||t[2]!==e.environmentId?(i=e.environmentId!==null&&e.cwd!==null?j.status({environmentId:e.environmentId,input:{cwd:e.cwd}}):null,t[1]=e.cwd,t[2]=e.environmentId,t[3]=i):i=t[3];let a=D(i),o;t[4]!==r||t[5]!==e?(o=async()=>{let t=K(e);return t===null?h(p(new k({operation:`pull`,environmentId:e.environmentId,cwd:e.cwd}))):r({environmentId:t.environmentId,input:{cwd:t.cwd}})},t[4]=r,t[5]=e,t[6]=o):o=t[6];let s=o,c;return t[7]!==s||t[8]!==e||t[9]!==a.refresh?(c={kind:`pull`,label:`Pulling latest changes...`,scope:e,action:s,onSuccess:a.refresh},t[7]=s,t[8]=e,t[9]=a.refresh,t[10]=c):c=t[10],G(c)}function se(e){let t=(0,V.c)(13),n;t[0]===e?n=t[1]:(n=A.runStackedAction(e),t[0]=e,t[1]=n);let r;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(r={reportFailure:!1},t[2]=r):r=t[2];let i=O(n,r),a;t[3]!==e.cwd||t[4]!==e.environmentId?(a=e.environmentId!==null&&e.cwd!==null?j.status({environmentId:e.environmentId,input:{cwd:e.cwd}}):null,t[3]=e.cwd,t[4]=e.environmentId,t[5]=a):a=t[5];let o=D(a),s;t[6]!==i||t[7]!==e?(s=async t=>K(e)===null?h(p(new k({operation:`run_change_request`,environmentId:e.environmentId,cwd:e.cwd}))):i(t),t[6]=i,t[7]=e,t[8]=s):s=t[8];let c=s,l;return t[9]!==c||t[10]!==e||t[11]!==o.refresh?(l={kind:`runStackedAction`,label:`Running source control action`,scope:e,action:c,onSuccess:o.refresh,managedExternally:!0},t[9]=c,t[10]=e,t[11]=o.refresh,t[12]=l):l=t[12],G(l)}function ce(e){let t=(0,V.c)(11),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},t[0]=n):n=t[0];let r=O(M.publishRepository,n),i;t[1]!==e.cwd||t[2]!==e.environmentId?(i=e.environmentId!==null&&e.cwd!==null?j.status({environmentId:e.environmentId,input:{cwd:e.cwd}}):null,t[1]=e.cwd,t[2]=e.environmentId,t[3]=i):i=t[3];let a=D(i),o;t[4]!==r||t[5]!==e?(o=async t=>{let n=K(e);return n===null?h(p(new k({operation:`publish_repository`,environmentId:e.environmentId,cwd:e.cwd}))):r({environmentId:n.environmentId,input:{cwd:n.cwd,...t}})},t[4]=r,t[5]=e,t[6]=o):o=t[6];let s=o,c;return t[7]!==s||t[8]!==e||t[9]!==a.refresh?(c={kind:`publishRepository`,label:`Publishing repository`,scope:e,action:s,onSuccess:a.refresh},t[7]=s,t[8]=e,t[9]=a.refresh,t[10]=c):c=t[10],G(c)}function Y(e){let t=(0,V.c)(7),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},t[0]=n):n=t[0];let r=O(U.preparePullRequestThread,n),i;t[1]!==r||t[2]!==e?(i=async t=>{let n=K(e);return n===null?h(p(new k({operation:`prepare_pull_request_thread`,environmentId:e.environmentId,cwd:e.cwd}))):t.mode===`worktree`&&t.threadId!==void 0&&!E(n.environmentId,`orchestration:operate`)?h(p(new s({requiredScope:l,message:`This connection cannot change threads.`}))):r({environmentId:n.environmentId,input:{cwd:n.cwd,reference:t.reference,mode:t.mode,...t.threadId?{threadId:t.threadId}:{}}})},t[1]=r,t[2]=e,t[3]=i):i=t[3];let a=i,o;return t[4]!==a||t[5]!==e?(o={kind:`preparePullRequestThread`,label:`Preparing pull request thread`,scope:e,action:a},t[4]=a,t[5]=e,t[6]=o):o=t[6],G(o)}function X(e){return e.environmentId===null||e.cwd===null||e.reference===null?null:c(o(d.get(U.pullRequestResolution({environmentId:e.environmentId,input:{cwd:e.cwd,reference:e.reference}}))))}function le(e){let t=(0,V.c)(12),n;t[0]!==e.cwd||t[1]!==e.environmentId||t[2]!==e.reference?(n=e.environmentId!==null&&e.cwd!==null&&e.reference!==null?U.pullRequestResolution({environmentId:e.environmentId,input:{cwd:e.cwd,reference:e.reference}}):null,t[0]=e.cwd,t[1]=e.environmentId,t[2]=e.reference,t[3]=n):n=t[3];let r=D(n),i;t[4]===e?i=t[5]:(i=X(e),t[4]=e,t[5]=i);let a=i,o=r.data??a,s=r.isPending&&a===null,c;return t[6]!==r.error||t[7]!==r.isPending||t[8]!==r.refresh||t[9]!==o||t[10]!==s?(c={data:o,error:r.error,isPending:s,isFetching:r.isPending,refresh:r.refresh},t[6]=r.error,t[7]=r.isPending,t[8]=r.refresh,t[9]=o,t[10]=s,t[11]=c):c=t[11],c}function ue(e,t){let n=(0,V.c)(10),r;n[0]===t?r=n[1]:(r=e=>L(e,t).settings.pullRequestMergeMethod,n[0]=t,n[1]=r);let i=C(e,r),a=w(de),o=w(I),s=ee(),c=S(),l;return n[2]!==e||n[3]!==o||n[4]!==a||n[5]!==c||n[6]!==i||n[7]!==t||n[8]!==s?(l=()=>{if(i!=null)return i;if(Object.keys(a).length===0)return;let n=s.find(n=>n.environmentId===e&&n.id===t);if(!n)return;let r=z({projects:s,settings:o,primaryEnvironmentId:c}).get(ae(n))??R(n,o);return a[r]},n[2]=e,n[3]=o,n[4]=a,n[5]=c,n[6]=i,n[7]=t,n[8]=s,n[9]=l):l=n[9],l}function de(e){return e.pullRequestMergeMethodOverrides}var fe={merge:`Merge requested`,ready:`Marked ready for review`,draft:`Converted to draft`,close:`Pull request closed`,reopen:`Pull request reopened`,"update-branch":`Branch updated with the base branch`,"enable-auto-merge":`Auto-merge enabled`,"disable-auto-merge":`Auto-merge disabled`,revert:`Revert pull request opened`,"delete-branch":`Branch deleted`,"approve-workflows":`Workflows approved`},pe={merge:`Could not merge this pull request`,ready:`Could not mark this ready for review`,draft:`Could not convert this to a draft`,close:`Could not close this pull request`,reopen:`Could not reopen this pull request`,"update-branch":`Could not update this branch`,"enable-auto-merge":`Could not enable auto-merge`,"disable-auto-merge":`Could not disable auto-merge`,revert:`Could not open a revert pull request`,"delete-branch":`Could not delete this branch`,"approve-workflows":`Could not approve workflows`},Z={merge:`The host refused the merge. Check that you have write access, that the checks it requires have passed, and that the branch is not conflicting.`,ready:`The host refused it. Check that you have write access to this repository.`,draft:`The host refused it. Check that you have write access to this repository.`,close:`The host refused it. Check that you have write access, or that you opened it.`,reopen:`The host refused it. Check that you have write access, and that the branch still exists.`,"update-branch":`The host refused it. Check that you have write access, and that the base branch has not diverged in a way the host cannot merge.`,"enable-auto-merge":`The host refused it. Check that auto-merge is enabled for this repository and that you have write access.`,"disable-auto-merge":`The host refused it. Check that you have write access to this repository.`,revert:`The host refused it. Check that you have write access and that this pull request was merged on the host.`,"delete-branch":`The host refused it. Check that you have write access to the source repository and that the branch has not moved since this page loaded.`,"approve-workflows":`The host refused it. Check that you have Actions write access and that these workflow runs are still awaiting approval.`};function me({environmentId:e,reference:t,onSuccess:n,resolveMergeMethod:r}){let i=O(P.runAction,{reportFailure:!1}),[a,o]=(0,B.useState)(!1),s=(0,B.useRef)(!1);return{actionPending:a,perform:async(a,c)=>{if(!(s.current||t===null)){s.current=!0,o(!0);try{let o=await i({environmentId:e,input:{...t,action:a,...c?{mergeMethod:c}:r?{resolveMergeMethod:r}:{}}});if(o._tag===`Failure`)throw v(o);x.add({type:`success`,title:fe[a]}),n?.(a)}catch(e){x.add({type:`error`,title:pe[a],description:F(e,Z[a])})}finally{s.current=!1,o(!1)}}}}}function Q(e){let t=O(P.runAction,{reportFailure:!1}),n=(0,B.useRef)(new Set),[r,i]=(0,B.useState)(()=>new Set);return{close:(0,B.useCallback)(async r=>{let a=r.filter(e=>{let t=N(e);return e.state!==`open`||n.current.has(t)?!1:(n.current.add(t),!0)});if(a.length===0)return;i(new Set(n.current));let o=0,s=[];await Promise.all(a.map(async r=>{try{let n=await t({environmentId:r.environmentId,input:{projectId:r.projectId,host:r.host,repository:r.repository,number:r.number,action:`close`}});if(n._tag===`Failure`)throw v(n);o++,e(r)}catch(e){s.push(`#${r.number}: ${F(e,Z.close)}`)}finally{n.current.delete(N(r)),i(new Set(n.current))}})),x.add({type:s.length>0?`error`:`success`,title:s.length>0?`Closed ${o} of ${a.length} pull requests`:`Closed ${o} pull request${o===1?``:`s`}`,...s.length>0?{description:s.slice(0,3).join(`
|
|
2
2
|
`)}:{}})},[e,t]),closingKeys:r}}var $=new Map;function he(e){let t=(0,V.c)(21),{environmentId:n,detail:r}=e,i=ie(),o=r?.workspaceRoot??null,s;t[0]!==n||t[1]!==o?(s={environmentId:n,cwd:o},t[0]=n,t[1]=o,t[2]=s):s=t[2];let c=Y(s),[l,u]=(0,B.useState)(null),d;t[3]===i?d=t[4]:(d=async(e,t,n)=>{let r=n??await i(e).then(xe,be);if(r===null)return null;let o=a.getState();if(t===null)return r;let s=o.getComposerDraft(r.draftId),c=s?.reviewComments??[],l=re({prompt:s?.prompt??``,lastHandoffPrompt:$.get(r.draftId)},t.prompt);return $.set(r.draftId,t.prompt),o.setPrompt(r.draftId,l),o.setReviewComments(r.draftId,ne(c,t.reviewComments??[])),r},t[3]=i,t[4]=d);let p=d,m;t[5]!==r||t[6]!==n||t[7]!==l||t[8]!==p?(m=async(e,t)=>{if(!r||l!==null)return;u(e);let i=f(n,r.projectId),a=await p(i,t);if(u(null),a===null){x.add({type:`error`,title:`Could not open a thread`,description:`Try again from the project, or open a thread first.`});return}x.add({type:`success`,title:`Asked in a thread`,description:t.prompt.length>0?`The question is in the composer — read it over, then send.`:`The pull request is in the composer — type your question, then send.`})},t[5]=r,t[6]=n,t[7]=l,t[8]=p,t[9]=m):m=t[9];let h=m,g;t[10]!==r||t[11]!==n||t[12]!==l||t[13]!==i||t[14]!==p||t[15]!==c?(g=async(e,t,a)=>{let o=a===void 0?`worktree`:a;if(!r||l!==null)return;u(e);let s=x.add({type:`loading`,title:`Preparing the pull request checkout...`}),d=f(n,r.projectId),m=await i(d).then(ye,ve);if(m===null){u(null),x.update(s,{type:`error`,title:`Could not open a thread for the checkout`,description:`Try again from the project, or open a thread first.`});return}let h=await c.run({reference:r.url,mode:o,threadId:m.threadId});if(h._tag===`Failure`){u(null);let e=c.error instanceof Error?c.error.message:null;x.update(s,{type:`error`,title:`Could not prepare the pull request checkout`,...e?{description:e}:{}});return}if(!await i(d,{branch:h.value.branch,worktreePath:h.value.worktreePath,envMode:h.value.worktreePath===null?`local`:`worktree`}).then(_e,ge)){u(null),x.update(s,{type:`error`,title:`Checked out, but the thread stayed where it was`,description:`The checkout is ready on \`${h.value.branch}\`. Point a thread at it from the branch picker, then ask again.`});return}u(null);let g={type:`warning`,title:`Checked out, but not on the latest commits`,description:`The checkout could not be moved onto the pull request's latest commits, so the code there is older than the pull request. Uncommitted work or local commits keep it where it is.`};if(t===null){x.update(s,h.value.isOnPullRequestHead?{type:`success`,title:o===`local`?`Checked out here`:`Checked out`,description:o===`local`?`This repository is on the pull request's branch, with a thread open on it.`:`The pull request is in its own worktree, with a thread open on it.`}:g);return}await p(d,t,m),x.update(s,h.value.isOnPullRequestHead?{type:`success`,title:`Checkout ready`,description:`The task is in the composer — read it over, then send.`}:g)},t[10]=r,t[11]=n,t[12]=l,t[13]=i,t[14]=p,t[15]=c,t[16]=g):g=t[16];let _=g,v;return t[17]!==l||t[18]!==h||t[19]!==_?(v={handoff:l,startAsk:h,startHandoff:_},t[17]=l,t[18]=h,t[19]=_,t[20]=v):v=t[20],v}function ge(){return!1}function _e(e){return e!==null}function ve(){return null}function ye(e){return e}function be(){return null}function xe(e){return e}export{X as a,le as c,J as d,oe as f,he as i,q as l,Q as n,se as o,ue as r,Y as s,me as t,ce as u};
|
|
3
|
-
//# sourceMappingURL=usePullRequestActions-
|
|
3
|
+
//# sourceMappingURL=usePullRequestActions-DErc7uKF.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{za as n,zn as r}from"./utils-
|
|
2
|
-
//# sourceMappingURL=useRegisterFieldControl-
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{za as n,zn as r}from"./utils-DPab5G1h.js";var i=e(t());function a(e,t,a,o,s=!0){let{registerFieldControl:c}=r(),l=i.useRef(null);l.current||=Symbol(),n(()=>{let n=l.current;if(n&&s)return c(n,{controlRef:e,getValue:o,id:t,value:a}),()=>{c(n,void 0)}},[e,s,o,t,c,a])}export{a as t};
|
|
2
|
+
//# sourceMappingURL=useRegisterFieldControl-B6t05DZf.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{BE as e,Ht as t,Nt as n,Vt as r}from"./utils-
|
|
2
|
-
//# sourceMappingURL=useScopedModelAvailability-
|
|
1
|
+
import{BE as e,Ht as t,Nt as n,Vt as r}from"./utils-DPab5G1h.js";import{E as i,i as a}from"./useSettings-CF52Llff.js";import{B as o}from"./settingsLayout-CMZkPLAK.js";var s=e();function c(e,c){let l=(0,s.c)(5),{targets:u}=o(),{environments:d}=i(),f;return l[0]!==c||l[1]!==d||l[2]!==e||l[3]!==u?(f=(i,o)=>{let s=c.find(e=>e.instanceId===i);for(let c of u){let l=d.find(e=>e.environmentId===c.environmentId),u=l?.serverConfig;if(!u)continue;let f=r(t(u.providers),c.settings,c.projectId).find(e=>e.instanceId===i),p=n(a(c.settings,e),u.providers).get(i);if(!f?.enabled||!f.isAvailable||f.driverKind!==s?.driverKind||!p?.some(e=>e.slug===o&&!e.isUnavailable))return`This model is unavailable on ${l?.label??`a selected environment`}. Select that environment to choose its model separately.`}return null},l[0]=c,l[1]=d,l[2]=e,l[3]=u,l[4]=f):f=l[4],f}export{c as t};
|
|
2
|
+
//# sourceMappingURL=useScopedModelAvailability-BKL9M4Zi.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{$o as n,Ah as r,BE as i,Bb as a,Bg as o,Cs as s,Db as c,Ds as l,Eb as u,Es as d,Gy as f,HT as p,Hs as ee,I_ as te,Ib as ne,LT as re,Lb as ie,Nx as ae,Ny as oe,O_ as se,Oh as ce,Oy as le,Pb as ue,Pv as de,Qy as fe,RT as m,Rg as pe,Sl as me,Th as he,Vy as ge,Xy as _e,Yo as ve,bh as ye,bl as be,c_ as xe,cb as Se,ds as h,eT as g,es as Ce,gb as we,gh as Te,hh as Ee,iS as De,iT as _,ib as Oe,jc as ke,kh as Ae,ks as je,l_ as Me,lb as Ne,lh as Pe,nT as v,nb as Fe,oS as Ie,oh as Le,ph as Re,rs as y,s_ as ze,ts as Be,uh as Ve,yl as He,z_ as Ue,zb as We}from"./utils-CyMIjIQl.js";import{At as Ge,E as Ke,I as qe,R as Je,Sn as Ye,T as Xe,W as Ze,_t as b}from"./runtime-BD3Q-gPo.js";import{Et as Qe,St as $e,T as et,t as tt}from"./runtime-CYS_HmDu.js";import{i as x}from"./toast-BDoYTcO9.js";import{f as S,h as C,m as nt,u as rt}from"./server-DbZyg5DS.js";import{i as it,n as at,s as ot,t as st}from"./session-CZ54Pt8a.js";import{t as w}from"./use-atom-command-DWENi-Kq.js";import{B as ct,C as lt,M as ut,N as dt,O as ft,P as pt,S as mt,_ as ht,b as gt,c as _t,i as T,n as vt,o as yt,r as bt,y as xt,z as St}from"./themePalette-B0pJNxta.js";var E=e(t(),1),D=i();function Ct(e,t){if(e.size!==t.size)return!1;for(let[n,r]of e)if(t.get(n)!==r)return!1;return!0}function wt(e){let t=Be(t=>y(n=>{let r=n(e.catalogValueAtom).entries.get(t);if(r===void 0)return null;let i=re(d(n(e.stateAtom(t))),()=>Ye);return{entry:r,connection:r.unsupportedReason===void 0?Qe(i):{phase:`unsupported`,error:r.unsupportedReason,traceId:null},serverConfig:n(e.serverConfigValueAtom(t))}}).pipe(h(`environment-presentation:${t}`))),n=new Map;return{presentationAtom:t,presentationsAtom:y(r=>{let i=new Map;for(let n of r(e.catalogValueAtom).entries.keys()){let e=r(t(n));e!==null&&i.set(n,e)}return Ct(n,i)||(n=i),n}).pipe(h(`environment-presentations`))}}function Tt(e,t){return{environmentId:e,environmentLabel:t.entry.target.label,displayUrl:$e(t.entry)??``,isRelayManaged:Ge(t.entry),isEnabled:t.entry.enabled,connectionState:t.connection.phase,connectionError:t.connection.error,connectionErrorTraceId:t.connection.traceId}}function Et(e){let t=y(t=>{let n=[...t(e.catalogValueAtom).entries.keys()],r=m(t.self());return r!==null&&r.length===n.length&&n.every((e,t)=>e===r[t])?r:n}),n=y(t=>{let n=[...t(e.catalogValueAtom).entries].map(([e,t])=>({environmentId:e,label:t.target.label})),r=m(t.self());return r!==null&&r.length===n.length&&n.every((e,t)=>e.environmentId===r[t]?.environmentId&&e.label===r[t]?.label)?r:n}),r=Be(t=>y(n=>{let r=n(e.presentationAtom(t));if(r===null)return null;let i=Tt(t,r),a=m(n.self());return a!==null&&a.environmentId===i.environmentId&&a.environmentLabel===i.environmentLabel&&a.displayUrl===i.displayUrl&&a.isRelayManaged===i.isRelayManaged&&a.isEnabled===i.isEnabled&&a.connectionState===i.connectionState&&a.connectionError===i.connectionError&&a.connectionErrorTraceId===i.connectionErrorTraceId?a:i})),i=y(t=>{let n=[];for(let i of t(e.catalogValueAtom).entries.keys()){let e=t(r(i));e!==null&&n.push(e)}let i=m(t.self());return i!==null&&i.length===n.length&&n.every((e,t)=>e===i[t])?i:n}).pipe(h(`environment-connection-summaries`));return{environmentIdsAtom:t,connectedEnvironmentIdsAtom:y(e=>{let n=e(t).filter(t=>e(r(t))?.connectionState===`connected`),i=m(e.self());return i!==null&&i.length===n.length&&n.every((e,t)=>e===i[t])?i:n}),identitiesAtom:n,environmentsAtom:i,machineByIdAtom:y(n=>{let r=new Map(n(t).map(t=>[t,me(n(e.presentationAtom(t))?.serverConfig??null)])),i=m(n.self());return i!==null&&Ct(i,r)?i:r}),pullRequestsSupportedAtom:y(n=>n(t).some(t=>n(e.presentationAtom(t))?.serverConfig?.environment.capabilities.pullRequests===!0))}}var Dt=wt({catalogValueAtom:C.catalogValueAtom,stateAtom:C.stateAtom,serverConfigValueAtom:S.configValueAtom}),Ot=Et({catalogValueAtom:C.catalogValueAtom,presentationAtom:Dt.presentationAtom}),kt=y(null).pipe(h(`web-environment-presentation:empty`));function At(e){let t=(0,D.c)(5),r=n(C.catalogValueAtom),i;t[0]===e?i=t[1]:(i=e===null?kt:Dt.presentationAtom(e),t[0]=e,t[1]=i);let a=n(i),o;return t[2]!==r.isReady||t[3]!==a?(o={isReady:r.isReady,presentation:a},t[2]=r.isReady,t[3]=a,t[4]=o):o=t[4],o}var jt={status:`idle`},O=jt,k=null,A=[],j=0,Mt=new Set;function M(e){O=e;for(let e of Mt)e()}function Nt(e){k?.resolve(e);for(let t of A)t.resolve(e);k=null,A=[]}function Pt(){return O}function Ft(e){return Mt.add(e),()=>{Mt.delete(e)}}function It(){j+=1;let e=!0;return()=>{e&&(e=!1,j=Math.max(0,j-1),j===0&&(Nt(!1),M(jt)))}}function Lt(e,t){if(j!==0)return new Promise(n=>{let r={message:e,variant:t?.variant??`default`,resolve:n};if(k||O.status===`closing`){A.push(r);return}k=r,M({status:`confirming`,message:e,variant:r.variant})})}function Rt(){return O.status!==`idle`||k!==null||A.length>0}function zt(e){if(O.status!==`confirming`||!k)return;let t=k;k=null,t.resolve(e),M({status:`closing`,message:O.message,variant:O.variant})}function Bt(){if(O.status!==`closing`)return;let e=A.shift();if(!e){M(jt);return}k=e,M({status:`confirming`,message:e.message,variant:e.variant})}var Vt={Ctrl:`⌃`,Alt:`⌥`,Shift:`⇧`,Super:`⌘`,CmdOrCtrl:`⌘`};function Ht(e,t=navigator.platform){let n=e.split(`+`),r=n.pop()??``;return ke(t)?`${n.map(e=>Vt[e]??e).join(``)}${r}`:[...n.map(e=>e===`CmdOrCtrl`?`Ctrl`:e===`Super`?`Meta`:e),r].join(`+`)}var Ut=`http://www.w3.org/2000/svg`,Wt={archive:[{tag:`rect`,attrs:{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`}},{tag:`path`,attrs:{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`}},{tag:`path`,attrs:{d:`M10 12h4`}}],check:[{tag:`path`,attrs:{d:`M20 6 9 17l-5-5`}}],timer:[{tag:`line`,attrs:{x1:`10`,x2:`14`,y1:`2`,y2:`2`}},{tag:`line`,attrs:{x1:`12`,x2:`15`,y1:`14`,y2:`11`}},{tag:`circle`,attrs:{cx:`12`,cy:`14`,r:`8`}}],"chevron-right":[{tag:`path`,attrs:{d:`m9 19 7-7-7-7`}}],"circle-check":[{tag:`circle`,attrs:{cx:`12`,cy:`12`,r:`10`}},{tag:`path`,attrs:{d:`m9 12 2 2 4-4`}}],clock:[{tag:`path`,attrs:{d:`M12 6v6l4 2`}},{tag:`circle`,attrs:{cx:`12`,cy:`12`,r:`10`}}],pencil:[{tag:`path`,attrs:{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`}},{tag:`path`,attrs:{d:`m15 5 4 4`}}],copy:[{tag:`rect`,attrs:{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`}},{tag:`path`,attrs:{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`}}],folder:[{tag:`path`,attrs:{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`}}],"git-branch":[{tag:`line`,attrs:{x1:`6`,x2:`6`,y1:`3`,y2:`15`}},{tag:`circle`,attrs:{cx:`18`,cy:`6`,r:`3`}},{tag:`circle`,attrs:{cx:`6`,cy:`18`,r:`3`}},{tag:`path`,attrs:{d:`M18 9a9 9 0 0 1-9 9`}}],eye:[{tag:`path`,attrs:{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`}},{tag:`circle`,attrs:{cx:`12`,cy:`12`,r:`3`}}],"eye-off":[{tag:`path`,attrs:{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`}},{tag:`path`,attrs:{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`}},{tag:`path`,attrs:{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`}},{tag:`path`,attrs:{d:`m2 2 20 20`}}],"app-window":[{tag:`rect`,attrs:{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`}},{tag:`path`,attrs:{d:`M10 4v4`}},{tag:`path`,attrs:{d:`M2 8h20`}},{tag:`path`,attrs:{d:`M6 4v4`}}],"arrow-up-right":[{tag:`path`,attrs:{d:`M7 7h10v10`}},{tag:`path`,attrs:{d:`M7 17 17 7`}}],"external-link":[{tag:`path`,attrs:{d:`M15 3h6v6`}},{tag:`path`,attrs:{d:`M10 14 21 3`}},{tag:`path`,attrs:{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`}}],link:[{tag:`path`,attrs:{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`}},{tag:`path`,attrs:{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`}}],list:[{tag:`path`,attrs:{d:`M3 5h.01`}},{tag:`path`,attrs:{d:`M3 12h.01`}},{tag:`path`,attrs:{d:`M3 19h.01`}},{tag:`path`,attrs:{d:`M8 5h13`}},{tag:`path`,attrs:{d:`M8 12h13`}},{tag:`path`,attrs:{d:`M8 19h13`}}],share:[{tag:`path`,attrs:{d:`M12 2v13`}},{tag:`path`,attrs:{d:`m16 6-4-4-4 4`}},{tag:`path`,attrs:{d:`M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8`}}],x:[{tag:`path`,attrs:{d:`M18 6 6 18`}},{tag:`path`,attrs:{d:`m6 6 12 12`}}],hash:[{tag:`line`,attrs:{x1:`4`,x2:`20`,y1:`9`,y2:`9`}},{tag:`line`,attrs:{x1:`4`,x2:`20`,y1:`15`,y2:`15`}},{tag:`line`,attrs:{x1:`10`,x2:`8`,y1:`3`,y2:`21`}},{tag:`line`,attrs:{x1:`16`,x2:`14`,y1:`3`,y2:`21`}}],"mail-open":[{tag:`path`,attrs:{d:`M21.2 8.4c.5.38.8.97.8 1.6v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V10a2 2 0 0 1 .8-1.6l8-6a2 2 0 0 1 2.4 0l8 6Z`}},{tag:`path`,attrs:{d:`m22 10-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 10`}}],"message-square-plus":[{tag:`path`,attrs:{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`}},{tag:`path`,attrs:{d:`M12 8v6`}},{tag:`path`,attrs:{d:`M9 11h6`}}],pin:[{tag:`path`,attrs:{d:`M12 17v5`}},{tag:`path`,attrs:{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`}}],"pin-off":[{tag:`path`,attrs:{d:`M12 17v5`}},{tag:`path`,attrs:{d:`M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89`}},{tag:`path`,attrs:{d:`m2 2 20 20`}},{tag:`path`,attrs:{d:`M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11`}}],"refresh-cw":[{tag:`path`,attrs:{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`}},{tag:`path`,attrs:{d:`M21 3v5h-5`}},{tag:`path`,attrs:{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`}},{tag:`path`,attrs:{d:`M8 16H3v5`}}],settings:[{tag:`path`,attrs:{d:`M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.38a2 2 0 0 0-.73-2.73l-.15-.09a2 2 0 0 1-1-1.74v-.51a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z`}},{tag:`circle`,attrs:{cx:`12`,cy:`12`,r:`3`}}],"folder-tree":[{tag:`path`,attrs:{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`}},{tag:`path`,attrs:{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`}},{tag:`path`,attrs:{d:`M3 5a2 2 0 0 0 2 2h3`}},{tag:`path`,attrs:{d:`M3 3v13a2 2 0 0 0 2 2h3`}}],trash:[{tag:`path`,attrs:{d:`M3 6h18`}},{tag:`path`,attrs:{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`}},{tag:`path`,attrs:{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`}},{tag:`line`,attrs:{x1:`10`,x2:`10`,y1:`11`,y2:`17`}},{tag:`line`,attrs:{x1:`14`,x2:`14`,y1:`11`,y2:`17`}}]};function Gt(e,t){let n=Wt[e];if(!n||typeof document.createElementNS!=`function`)return null;let r=document.createElementNS(Ut,`svg`);r.setAttribute(`xmlns`,Ut),r.setAttribute(`viewBox`,`0 0 24 24`),r.setAttribute(`fill`,`none`),r.setAttribute(`stroke`,`currentColor`),r.setAttribute(`stroke-width`,`2`),r.setAttribute(`stroke-linecap`,`round`),r.setAttribute(`stroke-linejoin`,`round`),r.setAttribute(`class`,t===`destructive`?`size-4.5 shrink-0 sm:size-4`:`size-4.5 shrink-0 text-muted-foreground sm:size-4`);for(let e of n){let t=document.createElementNS(Ut,e.tag);for(let[n,r]of Object.entries(e.attrs))t.setAttribute(n,r);r.appendChild(t)}return r}function Kt(e,t,n){let r=e.getBoundingClientRect(),i=Math.min(Math.max(4,t),Math.max(4,window.innerWidth-r.width-4)),a=Math.min(Math.max(4,n),Math.max(4,window.innerHeight-r.height-4));e.style.left=`${i}px`,e.style.top=`${a}px`}function qt(e,t){if(typeof Node<`u`&&e instanceof Node)return t.some(t=>t.contains(e));if(!e||typeof e!=`object`)return!1;let n=e;for(;n&&typeof n==`object`;){if(t.includes(n))return!0;n=n.parent}return!1}var N=null;function Jt(){return N!==null}function Yt(){N?.(),N=null}function Xt(e,t){return new Promise(n=>{let r=document.activeElement instanceof HTMLElement?document.activeElement:null,i=[],a=[],o=!1,s=!1,c=()=>l(null),l=e=>{if(o)return;o=!0,N===c&&(N=null),document.removeEventListener(`keydown`,u),document.removeEventListener(`pointerdown`,d,!0),document.removeEventListener(`contextmenu`,f,!0);let t=qt(document.activeElement,i);for(let e of i)e.remove();t&&r?.isConnected&&r.focus({preventScroll:!0}),n(e)},u=e=>{e.key===`Escape`&&(e.preventDefault(),l(null))},d=e=>{s&&!qt(e.target,i)&&l(null)},f=e=>{s&&!qt(e.target,i)&&(e.preventDefault(),l(null))},p=e=>{for(;i.length>e;)a.pop()?.setAttribute(`aria-expanded`,`false`),i.pop()?.remove()},ee=(e,t,n,r,o)=>{p(r);let c=document.createElement(`div`);c.className=`dropdown-glass fixed z-[10000] min-w-56 max-w-sm overflow-hidden rounded-lg bg-clip-padding text-popover-foreground outline-none`,c.style.cssText=`position:fixed;z-index:10000;min-width:14rem;max-width:24rem;overflow:hidden;border-radius:var(--radius-lg);background-clip:padding-box;color:var(--contrast-popover-foreground);outline:none;pointer-events:auto;`,c.style.left=`${t}px`,c.style.top=`${n}px`,c.dataset.level=String(r);let u=document.createElement(`div`);u.className=`max-h-[calc(100vh-0.5rem)] min-w-0 max-w-sm overflow-y-auto overflow-x-hidden p-1`,u.style.cssText=`max-height:calc(100vh - 0.5rem);min-width:0;max-width:24rem;overflow-x:hidden;overflow-y:auto;padding:0.25rem;`;for(let t of e){if(t.separatorBefore===!0&&u.children.length>0){let e=document.createElement(`div`);e.className=`mx-2 my-1 h-px bg-border`,e.style.cssText=`height:1px;margin:0.25rem 0.5rem;background:var(--contrast-border);`,e.dataset.contextMenuSeparator=`true`,e.setAttribute(`role`,`separator`),u.appendChild(e)}if(t.header===!0){let e=document.createElement(`div`);e.className=`px-2 py-1.5 font-medium text-muted-foreground text-xs`,e.textContent=t.label,u.appendChild(e);continue}let e=Array.isArray(t.children)&&t.children.length>0,n=!e&&(t.destructive===!0||t.id===`delete`),a=document.createElement(`button`);a.type=`button`;let o=t.disabled===!0;a.disabled=o;let c=`flex w-full cursor-default select-none items-center gap-2 rounded-sm px-2 py-1 text-left outline-none transition-colors sm:min-h-7 sm:text-sm min-h-8 text-base`;if(a.className=o?`${c} pointer-events-none cursor-not-allowed text-muted-foreground opacity-64`:n?`${c} text-destructive-foreground hover:bg-destructive/10 hover:text-destructive-foreground`:`${c} text-foreground hover:bg-accent hover:text-accent-foreground`,a.style.cssText=`display:flex;width:100%;min-height:1.75rem;align-items:center;gap:0.5rem;border:0;border-radius:var(--radius-sm);background:transparent;padding:0.25rem 0.5rem;color:var(--contrast-foreground);font-family:var(--font-sans,system-ui,sans-serif);font-size:0.875rem;line-height:1.25rem;text-align:left;cursor:default;`,n&&(a.style.color=`var(--destructive-foreground)`),o&&(a.style.color=`var(--contrast-muted-foreground)`,a.style.opacity=`0.64`,a.style.pointerEvents=`none`),typeof t.checked==`boolean`){a.setAttribute(`role`,`menuitemradio`),a.setAttribute(`aria-checked`,t.checked?`true`:`false`);let e=t.checked?Gt(`check`,`neutral`):null;if(e)a.appendChild(e);else{let e=document.createElement(`span`);e.className=`size-4.5 shrink-0 sm:size-4`,e.style.cssText=`display:inline-block;width:1rem;height:1rem;flex-shrink:0;`,e.setAttribute(`aria-hidden`,`true`),a.appendChild(e)}}else if(typeof t.icon==`string`){let e=Gt(t.icon,n?`destructive`:`neutral`);e&&a.appendChild(e)}let d=document.createElement(`span`);if(d.className=`min-w-0 flex-1 truncate`,d.textContent=t.label,a.appendChild(d),typeof t.accelerator==`string`){let e=document.createElement(`span`);e.className=`ms-6 shrink-0 text-muted-foreground text-xs tracking-widest`,e.style.cssText=`margin-inline-start:1.5rem;flex-shrink:0;color:var(--contrast-muted-foreground);font-size:0.75rem;letter-spacing:0.1em;`,e.textContent=Ht(t.accelerator),e.setAttribute(`aria-hidden`,`true`),a.setAttribute(`aria-keyshortcuts`,t.accelerator.replace(`CmdOrCtrl`,ke(navigator.platform)?`Meta`:`Control`)),a.appendChild(e)}if(e){a.setAttribute(`aria-haspopup`,`menu`),a.setAttribute(`aria-expanded`,`false`);let e=Gt(`chevron-right`,`neutral`);e&&(e.setAttribute(`class`,`-me-0.5 ms-auto size-4.5 shrink-0 text-muted-foreground opacity-80 sm:size-4`),e.setAttribute(`aria-hidden`,`true`),e.dataset.contextMenuChevron=`true`,a.appendChild(e))}if(!o){let o=!1,c=!1,u=()=>{let e=o||c;a.style.background=e?n?`color-mix(in srgb, var(--destructive) 10%, transparent)`:`var(--accent)`:`transparent`,a.style.color=e?n?`var(--destructive-foreground)`:`var(--contrast-accent-foreground)`:n?`var(--destructive-foreground)`:`var(--contrast-foreground)`};if(a.addEventListener(`mouseenter`,()=>{a.focus({preventScroll:!0}),o=!0,u()}),a.addEventListener(`mouseleave`,()=>{o=!1,u()}),a.addEventListener(`focus`,()=>{c=!0,u()}),a.addEventListener(`blur`,()=>{c=!1,u()}),e){let e=(e=!1)=>{let n=a.getBoundingClientRect(),o=n.right+4,s=n.top;ee(t.children,o,s,r+1,a),a.setAttribute(`aria-expanded`,`true`);let c=i[r+1];if(!c)return;let l=c.getBoundingClientRect();l.right>window.innerWidth&&Kt(c,n.left-l.width-4,n.top),e&&[...c.querySelectorAll(`button`)].find(e=>!e.disabled)?.focus()};a.addEventListener(`mouseenter`,()=>{e()}),a.addEventListener(`click`,t=>{t.preventDefault(),e(!0)})}else a.addEventListener(`mouseenter`,()=>{p(r+1)}),a.addEventListener(`click`,()=>{s&&l(t.id)})}u.appendChild(a)}c.appendChild(u),c.addEventListener(`mouseenter`,()=>{p(r+1)}),document.body.appendChild(c),i[r]=c,a[r]=o,requestAnimationFrame(()=>{Kt(c,t,n)})};document.addEventListener(`keydown`,u),document.addEventListener(`pointerdown`,d,!0),document.addEventListener(`contextmenu`,f,!0),ee(e,t?.x??0,t?.y??0,0),N&&N(),N=c,requestAnimationFrame(()=>{s=!0})})}var Zt=`p4code:client-settings:v1`;function Qt(){return typeof window<`u`}function $t(){return Qt()?l(Zt,Le):null}function en(e){Qt()&&je(Zt,e,Le)}var tn;function nn(){return{dialogs:{pickFolder:async e=>window.desktopBridge?window.desktopBridge.pickFolder(e):null,confirm:async(e,t)=>Lt(e,t)??!1},shell:{openExternal:async e=>{if(window.desktopBridge){if(!await window.desktopBridge.openExternal(e))throw Error(`Unable to open link.`);return}window.open(e,`_blank`,`noopener,noreferrer`)},openSystemSettings:async e=>{if(!window.desktopBridge?.openSystemSettings||!await window.desktopBridge.openSystemSettings(e))throw Error(`Unable to open System Settings.`)}},contextMenu:{show:async(e,t)=>window.desktopBridge?window.desktopBridge.showContextMenu(e,t):Xt(e,t),close:async()=>{window.desktopBridge||Yt()}},persistence:{getClientSettings:async()=>window.desktopBridge?window.desktopBridge.getClientSettings():$t(),setClientSettings:async e=>{if(window.desktopBridge)return window.desktopBridge.setClientSettings(e);en(e)}}}}function rn(){return nn()}function an(){if(typeof window<`u`)return tn||(tn=rn(),tn)}function on(){let e=an();if(!e)throw Error(`Local API not found`);return e}var P=`p4code:theme`,sn=`(prefers-color-scheme: dark)`,F={theme:`system`,resolvedTheme:`light`,systemDark:!1,followSystem:!0,appearanceMode:`system`,themeHalves:null};function cn(){return I()}function ln(){return typeof window>`u`?{}:un()}function I(){if(typeof window>`u`)return null;try{return ft(window.localStorage.getItem(T))}catch{return null}}function un(){try{let e=JSON.parse(window.localStorage.getItem(`p4code:theme-halves:v1`)??`null`);if(typeof e!=`object`||!e)return{};let t={};for(let n of[`light`,`dark`]){let r=e[n];typeof r==`string`&&(t[n]=r)}return t}catch{return{}}}function dn(e){return`${e?.light??``}|${e?.dark??``}`}var fn=`theme-color`,pn=`meta[name="${fn}"][data-dynamic-theme-color="true"]`,L=class extends f()(`ThemeStorageError`,{operation:oe([`read`,`write`]),storageKey:ge,theme:we(yt),cause:le()}){get message(){return`Failed to ${this.operation} theme preference for ${this.storageKey}.`}},mn=Ne(L),hn=class extends f()(`DesktopThemeSyncError`,{theme:yt,cause:le()}){get message(){return`Failed to sync the ${this.theme} theme to the desktop shell.`}},gn=Ne(hn),R=[],z=null,_n=!0,B=null,V=null,H=null;function U(){_n=!0;for(let e of R)e()}function vn(){return typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(sn).matches}function yn(e){if(typeof window>`u`)return e===`system`;try{let e=window.localStorage.getItem(bt);if(e===`true`)return!0;if(e===`false`)return!1}catch{}return e===`system`}function bn(e){return e===`light`||e===`dark`||e===`system`}function W(e){if(typeof window<`u`)try{let e=window.localStorage.getItem(vt);if(bn(e))return e}catch{}return yn(e)?`system`:xt(e)??`light`}function xn(e){if(typeof window<`u`)try{window.localStorage.setItem(vt,e)}catch(e){throw new L({operation:`write`,storageKey:vt,cause:e})}}function Sn(){if(typeof window>`u`)return F.theme;let e;try{e=window.localStorage.getItem(P)}catch(e){throw new L({operation:`read`,storageKey:P,cause:e})}return e!==null&<(e)?e:F.theme}function Cn(e){if(typeof window<`u`)try{window.localStorage.setItem(P,e),H=null}catch(t){throw new L({operation:`write`,storageKey:P,theme:e,cause:t})}}function G(){if(H!==null)return F.theme;try{return Sn()}catch(e){let t=mn(e)?e:new L({operation:`read`,storageKey:P,cause:e});return H=t,console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...b(t)}),F.theme}}function wn(){let e=document.querySelector(pn);return e||(e=document.createElement(`meta`),e.name=fn,e.setAttribute(`data-dynamic-theme-color`,`true`),document.head.append(e),e)}function Tn(e){let t=e?.trim().toLowerCase();return!t||t===`transparent`||t===`rgba(0, 0, 0, 0)`||t===`rgba(0 0 0 / 0)`?null:e?.trim()??null}function En(){return document.querySelector(`main[data-slot='sidebar-inset']`)??document.querySelector(`[data-slot='sidebar-inner']`)??document.body}function Dn(){if(typeof document>`u`||typeof getComputedStyle>`u`)return;let e=getComputedStyle(document.documentElement),t=document.documentElement.dataset.themeId?Tn(e.getPropertyValue(`--app-chrome-background`)):null,n=Tn(getComputedStyle(En()).backgroundColor),r=Tn(getComputedStyle(document.body).backgroundColor),i=t??n??r;if(!i)return;document.documentElement.style.backgroundColor=i,document.body.style.backgroundColor=i;let a=document.querySelectorAll(`meta[name="${fn}"]`);if(a.length===0){wn().setAttribute(`content`,i);return}for(let e of a)e.setAttribute(`content`,i)}function K(e,{suppressTransitions:t=!1,preservePreview:n=!0}={}){if(typeof document>`u`||typeof window>`u`||n&&document.documentElement.dataset?.themeId===`__preview`)return;let r=W(e),i=r===`system`,a=i?vn():!1,o=I();if(V?.theme===e&&V.systemDark===a&&V.followSystem===i&&V.appearanceMode===r&&dn(V.themeHalves)===dn(o)){kn(e,i,r);return}t&&document.documentElement.classList.add(`no-transitions`);let s=dt(e,a,i,r,o);_t(pt(e,o,s),s),document.documentElement.classList.toggle(`dark`,s===`dark`),V={theme:e,systemDark:a,followSystem:i,appearanceMode:r,themeHalves:o},Dn(),kn(e,i,r),t&&(document.documentElement.offsetHeight,requestAnimationFrame(()=>{document.documentElement.classList.remove(`no-transitions`)}))}async function On(e,t,n,r,i=I()){try{await e.setTheme(ut(t,n,r,i))}catch(e){throw new hn({theme:t,cause:e})}}function kn(e,t,n){if(typeof window>`u`)return;let r=window.desktopBridge,i=I(),a=ut(e,t,n,i);r&&typeof r.setTheme==`function`&&B!==a&&(B=a,On(r,e,t,n,i).catch(t=>{let n=gn(t)?t:new hn({theme:e,cause:t});console.error(n.message,{theme:n.theme,...b(n)}),B===a&&(B=null)}))}typeof document<`u`&&typeof window<`u`&&K(G());function An(){if(typeof window>`u`)return F;if(!_n&&z)return z;_n=!1;let e=G(),t=W(e),n=t===`system`,r=n?vn():!1,i=I(),a=dt(e,r,n,t,i);return z&&z.theme===e&&z.resolvedTheme===a&&z.systemDark===r&&z.followSystem===n&&z.appearanceMode===t&&dn(z.themeHalves)===dn(i)||(z={theme:e,resolvedTheme:a,systemDark:r,followSystem:n,appearanceMode:t,themeHalves:i}),z}function jn(){return F}function Mn(){let e=G();W(e)===`system`&&K(e,{suppressTransitions:!0}),U()}function Nn(e){e.key===P?(H=null,K(G(),{suppressTransitions:!0}),U()):e.key===`p4code:theme-follow-system`||e.key===`p4code:theme-appearance-mode`||e.key===`p4code:theme-halves:v1`?(K(G(),{suppressTransitions:!0}),U()):(e.key===`p4code:themes:v1`||e.key===null)&&(e.key===null&&(H=null),mt(),V=null,K(G(),{suppressTransitions:!0}),U())}var Pn=null;function Fn(e){if(typeof window>`u`)return()=>{};if(R.push(e),!Pn){let e=typeof window.matchMedia==`function`?window.matchMedia(sn):null;e?.addEventListener(`change`,Mn),window.addEventListener(`storage`,Nn),Pn=()=>{e?.removeEventListener(`change`,Mn),window.removeEventListener(`storage`,Nn)}}return()=>{R=R.filter(t=>t!==e),R.length===0&&(Pn?.(),Pn=null)}}function In(){let e=(0,E.useSyncExternalStore)(Fn,An,jn),{theme:t,resolvedTheme:n}=e,r=(0,E.useCallback)(e=>{if(typeof window>`u`)return!1;try{xn(W(G()));let t=window.localStorage.getItem(T);window.localStorage.removeItem(T);try{Cn(e)}catch(e){if(t!==null)try{window.localStorage.setItem(T,t)}catch{}throw e}}catch(t){let n=mn(t)?t:new L({operation:`write`,storageKey:P,theme:e,cause:t});return console.error(n.message,{operation:n.operation,storageKey:n.storageKey,theme:e,...b(n)}),!1}return K(e,{suppressTransitions:!0}),U(),!0},[]),i=(0,E.useCallback)(e=>{if(typeof window>`u`)return!1;try{xn(e)}catch(e){let t=mn(e)?e:new L({operation:`write`,storageKey:vt,cause:e});return console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...b(t)}),!1}return H=null,K(G(),{suppressTransitions:!0}),U(),!0},[]),a=(0,E.useCallback)(e=>{let n=W(t),r=e?`system`:n===`system`?xt(t)??`light`:n;return i(r)},[i,t]),o=(0,E.useCallback)((e,t)=>{if(typeof window>`u`)return!1;try{let n={...un()};t===null?delete n[e]:n[e]=t,n.light===void 0&&n.dark===void 0?window.localStorage.removeItem(T):window.localStorage.setItem(T,JSON.stringify(n))}catch(e){let t=new L({operation:`write`,storageKey:T,cause:e});return console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...b(t)}),!1}return K(G(),{suppressTransitions:!0}),U(),!0},[]),s=(0,E.useCallback)(()=>{if(typeof window>`u`)return!1;try{window.localStorage.removeItem(T)}catch(e){let t=new L({operation:`write`,storageKey:T,cause:e});return console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...b(t)}),!1}return K(G(),{suppressTransitions:!0}),U(),!0},[]),c=(0,E.useCallback)(({preservePreview:e=!1}={})=>{typeof window<`u`&&(V=null,K(G(),{suppressTransitions:!0,preservePreview:e}),U())},[]);return(0,E.useEffect)(()=>{K(t)},[e.appearanceMode,t]),{theme:t,setTheme:r,setAppearanceMode:i,setFollowSystem:a,setThemeHalf:o,clearThemeHalves:s,refreshTheme:c,followSystem:e.followSystem,appearanceMode:e.appearanceMode,resolvedTheme:n,themeHalves:e.themeHalves}}var Ln=fe(Se(_e)),Rn=a(e=>{let t=e.replace(/("(?:[^"\\]|\\.)*")|\/\/[^\n]*/g,(e,t)=>t?e:``);return t=t.replace(/("(?:[^"\\]|\\.)*")|\/\*[\s\S]*?\*\//g,(e,t)=>t?e:``),t=t.replace(/("(?:[^"\\]|\\.)*")|,(\s*[}\]])/g,(e,t,n)=>t?e:n??``),Ln(t).pipe(Ie(e=>e.issue))}),zn=new ue(Rn,We());ie().pipe(ne(We({space:2})));var Bn=e=>ge.pipe(Fe(e,zn)),Vn={performance:{profile:`performance`,automaticGitFetchInterval:v(15),providerHealthRefreshInterval:g(1),hostPowerMonitorActiveInterval:v(30),hostPowerMonitorIdleInterval:g(2),idleClientTtl:v(45),pauseWhenHostLocked:!0,pauseWhenHostLowPower:!1,pauseWhenClientLowPower:!1,pauseWhenOnBattery:!1},balanced:{profile:`balanced`,automaticGitFetchInterval:Pe,providerHealthRefreshInterval:Ee,hostPowerMonitorActiveInterval:v(30),hostPowerMonitorIdleInterval:g(5),idleClientTtl:v(45),pauseWhenHostLocked:!0,pauseWhenHostLowPower:!0,pauseWhenClientLowPower:!0,pauseWhenOnBattery:!1},"battery-saver":{profile:`battery-saver`,automaticGitFetchInterval:v(0),providerHealthRefreshInterval:g(15),hostPowerMonitorActiveInterval:g(1),hostPowerMonitorIdleInterval:g(10),idleClientTtl:v(45),pauseWhenHostLocked:!0,pauseWhenHostLowPower:!0,pauseWhenClientLowPower:!0,pauseWhenOnBattery:!0}};function q(e){return Vn[e]}function Hn(e){return e.profile===`custom`?e.baseProfile??`balanced`:e.profile}function Un(e){let t=Hn(e),n=Vn[t],r=e.profile===`custom`?e.overrides:{};return{profile:t,automaticGitFetchInterval:r.automaticGitFetchInterval??n.automaticGitFetchInterval,providerHealthRefreshInterval:r.providerHealthRefreshInterval??n.providerHealthRefreshInterval,hostPowerMonitorActiveInterval:r.hostPowerMonitorActiveInterval??n.hostPowerMonitorActiveInterval,hostPowerMonitorIdleInterval:r.hostPowerMonitorIdleInterval??n.hostPowerMonitorIdleInterval,idleClientTtl:r.idleClientTtl??n.idleClientTtl,pauseWhenHostLocked:r.pauseWhenHostLocked??n.pauseWhenHostLocked,pauseWhenHostLowPower:r.pauseWhenHostLowPower??n.pauseWhenHostLowPower,pauseWhenClientLowPower:r.pauseWhenClientLowPower??n.pauseWhenClientLowPower,pauseWhenOnBattery:r.pauseWhenOnBattery??n.pauseWhenOnBattery}}function J(e,t){return _(e)===_(t)}function Wn(e,t){return J(e.automaticGitFetchInterval,t.automaticGitFetchInterval)&&J(e.providerHealthRefreshInterval,t.providerHealthRefreshInterval)&&J(e.hostPowerMonitorActiveInterval,t.hostPowerMonitorActiveInterval)&&J(e.hostPowerMonitorIdleInterval,t.hostPowerMonitorIdleInterval)&&J(e.idleClientTtl,t.idleClientTtl)&&e.pauseWhenHostLocked===t.pauseWhenHostLocked&&e.pauseWhenHostLowPower===t.pauseWhenHostLowPower&&e.pauseWhenClientLowPower===t.pauseWhenClientLowPower&&e.pauseWhenOnBattery===t.pauseWhenOnBattery}function Gn(e){if(e.profile!==`custom`)return{schemaVersion:1,profile:e.profile,overrides:{}};let t=Un(e),n=[Hn(e),`balanced`,`performance`,`battery-saver`];for(let e of n)if(Wn(t,Vn[e]))return{schemaVersion:1,profile:e,overrides:{}};let r=Hn(e),i=Vn[r];return{schemaVersion:1,profile:`custom`,baseProfile:r,overrides:{...J(t.automaticGitFetchInterval,i.automaticGitFetchInterval)?{}:{automaticGitFetchInterval:t.automaticGitFetchInterval},...J(t.providerHealthRefreshInterval,i.providerHealthRefreshInterval)?{}:{providerHealthRefreshInterval:t.providerHealthRefreshInterval},...J(t.hostPowerMonitorActiveInterval,i.hostPowerMonitorActiveInterval)?{}:{hostPowerMonitorActiveInterval:t.hostPowerMonitorActiveInterval},...J(t.hostPowerMonitorIdleInterval,i.hostPowerMonitorIdleInterval)?{}:{hostPowerMonitorIdleInterval:t.hostPowerMonitorIdleInterval},...J(t.idleClientTtl,i.idleClientTtl)?{}:{idleClientTtl:t.idleClientTtl},...t.pauseWhenHostLocked===i.pauseWhenHostLocked?{}:{pauseWhenHostLocked:t.pauseWhenHostLocked},...t.pauseWhenHostLowPower===i.pauseWhenHostLowPower?{}:{pauseWhenHostLowPower:t.pauseWhenHostLowPower},...t.pauseWhenClientLowPower===i.pauseWhenClientLowPower?{}:{pauseWhenClientLowPower:t.pauseWhenClientLowPower},...t.pauseWhenOnBattery===i.pauseWhenOnBattery?{}:{pauseWhenOnBattery:t.pauseWhenOnBattery}}}}function Kn(e){let t={schemaVersion:1,profile:Ve,overrides:{}},n=e.backgroundActivity.profile===t.profile&&e.backgroundActivity.baseProfile===void 0&&Object.keys(e.backgroundActivity.overrides).length===0,r=e.backgroundActivityProfile,i=r!==`balanced`||_(e.automaticGitFetchInterval)!==_(Pe)||_(e.providerHealthRefreshInterval)!==_(Ee);return Un(n&&i?{schemaVersion:1,profile:_(e.automaticGitFetchInterval)===_(q(r).automaticGitFetchInterval)&&_(e.providerHealthRefreshInterval)===_(q(r).providerHealthRefreshInterval)?r:`custom`,baseProfile:r,overrides:{..._(e.automaticGitFetchInterval)===_(q(r).automaticGitFetchInterval)?{}:{automaticGitFetchInterval:e.automaticGitFetchInterval},..._(e.providerHealthRefreshInterval)===_(q(r).providerHealthRefreshInterval)?{}:{providerHealthRefreshInterval:e.providerHealthRefreshInterval}}}:e.backgroundActivity)}function qn(e){let t=Kn(e);return Gn({schemaVersion:1,profile:`custom`,baseProfile:t.profile,overrides:{automaticGitFetchInterval:t.automaticGitFetchInterval,providerHealthRefreshInterval:t.providerHealthRefreshInterval,hostPowerMonitorActiveInterval:t.hostPowerMonitorActiveInterval,hostPowerMonitorIdleInterval:t.hostPowerMonitorIdleInterval,idleClientTtl:t.idleClientTtl,pauseWhenHostLocked:t.pauseWhenHostLocked,pauseWhenHostLowPower:t.pauseWhenHostLowPower,pauseWhenClientLowPower:t.pauseWhenClientLowPower,pauseWhenOnBattery:t.pauseWhenOnBattery}})}var Jn=Bn(ye);Oe(Jn);function Yn(e,t){let n=e.providerInstances[t.instanceId];return n===void 0?he(t.instanceId):r(n)}var Xn=[`codex`,`claudeAgent`,`cursor`,`grok`,`muse`,`pi`,`opencode`,`antigravity`].map(e=>ze.make(e));function Zn(e,t,n){let r=[...Xn.map(e=>[Me(e),e]),...n?.includeConfiguredInstances===!0?Object.entries(e).flatMap(([e,t])=>Xn.includes(t.driver)?[[xe.make(e),t.driver]]:[]):[]].find(([e,n])=>t(e,n));if(r===void 0)return null;let[i,a]=r,s=n?.defaultModelSelection,c=e[i]?.config;return s?.instanceId===i&&ee(c?.customModels).some(e=>e.slug===s.model)?s:{instanceId:i,model:o[a]??pe[a]??`gpt-6-luna`}}function Qn(e,t,n){let r=e.sourceControlWriterModelSelection;if(!r||!Ae(e,n,r.instanceId))return e.textGenerationModelSelection;if(t===void 0)return r;let i=t.find(e=>e.instanceId===r.instanceId);return i?.enabled===!0&&He(i)&&be(i)?r:e.textGenerationModelSelection}function $n(e,t,n){let r=e.reviewGuideModelSelection;if(r&&Ae(e,n,r.instanceId)){let e=t?.find(e=>e.instanceId===r.instanceId);if(t===void 0||e?.enabled===!0&&He(e)&&be(e))return r}return Qn(e,t,n)}function er(e,t={}){return{favorites:e.favorites??t.favorites??[],providerModelPreferences:e.providerModelPreferences??t.providerModelPreferences??{}}}function tr(e,t){let n=e.favorites===null&&(t.favorites?.length??0)>0?t.favorites:void 0,r=e.providerModelPreferences===null&&Object.keys(t.providerModelPreferences??{}).length>0?t.providerModelPreferences:void 0;return n===void 0&&r===void 0?null:{migrateModelPreferences:{...n===void 0?{}:{favorites:n},...r===void 0?{}:{providerModelPreferences:r}}}}var nr=new Set([`continueThreadsAfterServerUpdate`,`sidebarAutoSettleAfterDays`,`sidebarAutoSettleOnMerge`,`autoResumeLimitedThreads`,`snoozeLimitedThreads`,`newWorktreesStartFromOrigin`,`sourceControlWritingStyle`,`textGenerationModelSelection`]);function rr(e){let t={},n={};for(let[r,i]of Object.entries(e))nr.has(r)?t[r]=i:n[r]=i;return{sharedPatch:t,localPatch:n}}function ir(e,t,n,r=n,i=!1){let a=e.textGenerationModelSelection?.instanceId??r?.textGenerationModelSelection.instanceId;return!i&&e.textGenerationModelSelection&&(!n||a!==void 0&&(r?.providerInstances[a]?.driver??a)!==(n.providerInstances[a]?.driver??a)||!Yn(n,{...n.textGenerationModelSelection,...e.textGenerationModelSelection}))&&(e=c(e,[`textGenerationModelSelection`])),t?.threadRestartContinuation===!0?e:c(e,[`continueThreadsAfterServerUpdate`])}function ar(e){return e.connection.phase===`connected`&&e.serverConfig?.environment.capabilities.threadAutoSettlement===!0}function or(e){let t=e.atom(de(Ke.pipe(De(e=>Ue(e.state)))),{initialValue:Xe});return{stateAtom:t,stateValueAtom:y(e=>re(d(e(t)),()=>Xe)).pipe(h(`relay-environment-discovery-value`)),refresh:qe(e,{label:`relay-environment-discovery:refresh`,concurrency:{mode:`singleFlight`,key:()=>`refresh`},execute:e=>Ke.pipe(ae(e=>e.refresh))})}}var sr=or(tt);function cr(e,t){return{...t,environmentId:e,label:t.entry.target.label,displayUrl:$e(t.entry),relayManaged:Ge(t.entry)}}function lr(){let e=(0,D.c)(7),t=n(C.catalogValueAtom),r=n(C.networkStatusValueAtom),i=n(Dt.presentationsAtom),a;e[0]===i?a=e[1]:(a=[...i.entries()].map(ur),e[0]=i,e[1]=a);let o=a,s;return e[2]!==t.isReady||e[3]!==o||e[4]!==r||e[5]!==i?(s={isReady:t.isReady,networkStatus:r,environments:o,presentationById:i},e[2]=t.isReady,e[3]=o,e[4]=r,e[5]=i,e[6]=s):s=e[6],s}function ur(e){let[t,n]=e;return cr(t,n)}function dr(){return n(nt)}function fr(e){let t=(0,D.c)(3),{presentation:n}=At(e),r;return t[0]!==e||t[1]!==n?(r=e===null||n===null?null:cr(e,n),t[0]=e,t[1]=n,t[2]=r):r=t[2],r}function pr(){return fr(dr())}function mr(e){let t=(0,D.c)(2),n=ot(e),r;return t[0]===n?r=t[1]:(r=p(n)?n.value.httpBaseUrl:null,t[0]=n,t[1]=r),r}function hr(){return n(sr.stateValueAtom)}function gr(){return n(Ot.environmentIdsAtom)}function _r(){return n(Ot.identitiesAtom)}function vr(){return n(Ot.pullRequestsSupportedAtom)}var yr=`[CLIENT_SETTINGS]`,br=new Set,xr=new Set,Sr=Re,Y=`pending`,X=null,Cr=0,wr=Promise.resolve(),Tr=0;function Er(){for(let e of br)e()}function Dr(){for(let e of xr)e()}function Z(){return Sr}function Or(e){Sr=e,Er()}function kr(e){Y!==e&&(Y=e,Dr())}function Ar(e){return br.add(e),Q().catch(()=>void 0),()=>{br.delete(e)}}function jr(){return Y===`ready`}function Mr(){return Y}function Nr(e){return xr.add(e),Q().catch(()=>void 0),()=>{xr.delete(e)}}async function Q(){if(Y===`ready`)return;if(X)return X;let e=Cr;kr(Y===`failed`||Y===`retrying`?`retrying`:`pending`);let t=(async()=>{try{let t=await on().persistence.getClientSettings();if(e!==Cr)return;t&&Or({...Re,...t}),kr(`ready`)}catch(t){throw e===Cr&&kr(`failed`),console.error(`${yr} hydrate failed`,{operation:`hydrate`,...b(t)}),t}})().finally(()=>{X===t&&(X=null)});return X=t,X}var Pr=e=>on().persistence.setClientSettings(e);function Fr(e){let t=wr.then(e);return wr=t.then(()=>void 0,()=>void 0),t}function Ir(e,t=Pr){let n=Y!==`ready`||Tr>0;return n?Tr+=1:Or({...Z(),...e}),Fr(async()=>{if(n)try{Y!==`ready`&&await Q(),Or({...Z(),...e})}finally{--Tr}await t(Z())}).catch(e=>{console.error(`${yr} persist failed`,{operation:`persist`,...b(e)})})}async function Lr(e,t=Pr){return Fr(async()=>{for(Y!==`ready`&&await Q();;){let n=Z(),r=e(n);if(await t(r),Z()===n)return Or(r),r}})}var Rr=new Set(u(ye.fields));function zr(e){let t={},n={};for(let[r,i]of Object.entries(e))Rr.has(r)?t[r]=i:n[r]=i;return{serverPatch:t,clientPatch:n}}function Br(){return Z()}function Vr(){return Q()}function Hr(){return(0,E.useSyncExternalStore)(Nr,jr,Ur)}function Ur(){return!1}function Wr(){return(0,E.useSyncExternalStore)(Nr,Mr,Gr)}function Gr(){return`pending`}function $(){return(0,E.useSyncExternalStore)(Ar,Z,Kr)}function Kr(){return Re}function qr(e,t){return{...t,...e,...er(e,t)}}var Jr=new Set;function Yr(e,t){let n=(0,D.c)(8),r=$(),i=Hr(),a;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={reportFailure:!1},n[0]=a):a=n[0];let o=w(S.updateSettings,a),s,c;n[1]!==r||n[2]!==e||n[3]!==i||n[4]!==o||n[5]!==t?(s=()=>{if(!e||!t||!i||Jr.has(e))return;let n=tr(t,r);n&&(Jr.add(e),o({environmentId:e,input:{patch:n}}).finally(()=>Jr.delete(e)))},c=[r,e,i,o,t],n[1]=r,n[2]=e,n[3]=i,n[4]=o,n[5]=t,n[6]=s,n[7]=c):(s=n[6],c=n[7]),(0,E.useEffect)(s,c)}function Xr(e,t){let n=(0,D.c)(6),r=$(),i;n[0]!==r||n[1]!==e?(i=qr(e,r),n[0]=r,n[1]=e,n[2]=i):i=n[2];let a=i,o;return n[3]!==a||n[4]!==t?(o=t?t(a):a,n[3]=a,n[4]=t,n[5]=o):o=n[5],o}function Zr(e){let t=(0,D.c)(3),n=$(),r;return t[0]!==e||t[1]!==n?(r=e?e(n):n,t[0]=e,t[1]=n,t[2]=r):r=t[2],r}function Qr(e){return e.settingsHydrated?e.paletteThemeActive&&!e.paletteThemeAllowsArtwork&&e.mode===`artwork`?`pill`:e.mode:`none`}function $r(){let e=(0,D.c)(7),t=Hr(),n=$().environmentIdentificationMode,{resolvedTheme:r,theme:i,themeHalves:a}=In(),o=(0,E.useSyncExternalStore)(St,gt,ei),s;if(e[0]!==n||e[1]!==o||e[2]!==r||e[3]!==t||e[4]!==i||e[5]!==a){let c=pt(i,a,r),l=ht(c);s=Qr({mode:n,settingsHydrated:t,paletteThemeActive:o!==null||l!==null,paletteThemeAllowsArtwork:o??ct(c)}),e[0]=n,e[1]=o,e[2]=r,e[3]=t,e[4]=i,e[5]=a,e[6]=s}else s=e[6];return s}function ei(){return null}async function ti(e,t){return(e.favorites===null||e.providerModelPreferences===null)&&await Vr(),{...tr(e,Br()),...t}}function ni(e){let t=(0,D.c)(6),r;t[0]===e?r=t[1]:(r=e?S.settingsValueAtom(e):ii,t[0]=e,t[1]=r);let i=n(r),a=w(S.updateSettings,`model preferences update`),o;return t[2]!==e||t[3]!==a||t[4]!==i?(o=async t=>{if(!e||!i)return;let n;try{n=await ti(i,t)}catch{x.add({type:`error`,title:`Model preferences not saved`,description:`Could not load saved model preferences. Try again.`});return}return a({environmentId:e,input:{patch:n}})},t[2]=e,t[3]=a,t[4]=i,t[5]=o):o=t[5],o}function ri(e){let t=(0,E.use)(Ce),n=(0,E.useRef)(new Map),r=ni(e);return(0,E.useCallback)(async(i,a)=>{if(!e)return;let o=S.settingsValueAtom(e),c=t.get(o);if(!c)return;if(c.favorites===null)try{await Vr()}catch{x.add({type:`error`,title:`Favorites not saved`,description:`Could not load saved model preferences. Try again.`});return}let l=t.get(o)??c,u=er(l,Br()).favorites,d=JSON.stringify([e,i,a]),f=n.current.get(d),p={favorite:!(f&&(f.pending||f.settings.favorites===l.favorites)?f.favorite:u.some(e=>e.provider===i&&e.model===a)),settings:l,pending:!0};n.current.set(d,p);try{let e=await r({setModelFavorites:[{provider:i,model:a,favorite:p.favorite}]});e&&s(e)&&t.get(o)?.favorites===l.favorites&&(p.pending=!1)}finally{p.pending&&n.current.get(d)===p&&(f&&!f.pending&&t.get(o)?.favorites===f.settings.favorites?n.current.set(d,f):n.current.delete(d))}},[e,t,r])}var ii=y(null);function ai(e){let t=(0,D.c)(5),r;t[0]===e?r=t[1]:(r=e?S.settingsValueAtom(e):ii,t[0]=e,t[1]=r);let i=n(r),a=$();Yr(e,i);let o=i??Te,s;return t[2]!==a||t[3]!==o?(s=er(o,a),t[2]=a,t[3]=o,t[4]=s):s=t[4],s}function oi(e,t){let r=(0,D.c)(2),i;r[0]===e?i=r[1]:(i=S.settingsValueAtom(e),r[0]=e,r[1]=i);let a=n(i);return Yr(e,a),Xr(a??Te,t)}function si(e){let t=(0,D.c)(4),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},t[0]=n):n=t[0];let r=w(S.mutateProviderInstance,n),i;return t[1]!==e||t[2]!==r?(i=(t,n)=>r({environmentId:e,input:{patch:n===void 0?{}:n,providerInstanceMutation:t}}),t[1]=e,t[2]=r,t[3]=i):i=t[3],i}function ci(e){let t=pr(),r=n(rt);return Yr(t?.environmentId??null,t?.serverConfig?.settings??null),Xr(r,e)}var li=`This setting is saved on a server, and the hosted app is not anchored to one. Change it from the desktop app or from the server's own address.`;function ui(){let e=(0,D.c)(2),t=pr(),n;return e[0]===t?n=e[1]:(n=t!==null||!et(),e[0]=t,e[1]=n),n}function di(e){let t=(0,D.c)(3),r=e!==void 0&&e,{environments:i}=lr(),a;return t[0]!==i||t[1]!==r?(a=y(e=>i.filter(ar).flatMap(t=>{let n=e(st.sessionStateAtom(t.environmentId));if(r&&n._tag===`Initial`)return[t.environmentId];let i=n._tag===`Failure`?null:m(d(n));return i!==null&&te(i,`settings:write`)?[t.environmentId]:[]})),t[0]=i,t[1]=r,t[2]=a):a=t[2],n(a)}function fi(e){let t=(0,D.c)(10);it(e,se);let n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={label:`server settings update`,reportFailure:!1},t[0]=n):n=t[0];let r=w(S.updateSettings,n),{environments:i}=lr(),a;t[1]!==i||t[2]!==r?(a=async e=>{let t=await r(e);if(t._tag===`Failure`&&!Je(t)){let n=i.find(t=>t.environmentId===e.environmentId)?.label??e.environmentId,r=Ze(t);x.add({type:`error`,title:`Setting not saved`,description:`Could not save on ${n}: ${r instanceof Error?r.message:`The save failed. Try reconnecting and saving again.`}`})}return t},t[1]=i,t[2]=r,t[3]=a):a=t[3];let o=a,s=di(!0),c;return t[4]!==e||t[5]!==i||t[6]!==r||t[7]!==o||t[8]!==s?(c=t=>{let{serverPatch:n,clientPatch:a}=zr(t),c=e===null||ce(n).every(t=>at(e,t));if(Object.keys(n).length>0&&!c&&x.add({type:`warning`,title:`Setting not saved`,description:`This connection lacks permission to change settings on ${i.find(t=>t.environmentId===e)?.label??`the selected environment`}.`}),Object.keys(n).length>0&&c){let{sharedPatch:t,localPatch:a}=rr(n),c=_i;if(Object.keys(a).length>0&&(e?o({environmentId:e,input:{patch:a}}):c()),Object.keys(t).length>0){let n=i.find(t=>t.environmentId===e)?.serverConfig?.settings,a=new Set(s);e&&a.add(e);let o=[],l=[];for(let r of a){let a=i.find(e=>e.environmentId===r),s=ir(t,a?.serverConfig?.environment.capabilities,a?.serverConfig?.settings,n,r===e);if(Object.keys(s).length!==0){if(ve.get(st.sessionStateAtom(r))._tag!==`Initial`&&!ce(t).every(e=>at(r,e))){l.push(a?.label??r);continue}o.push({environmentId:r,input:{patch:s}})}}o.length===0?c(l.length>0?`This connection lacks permission to change settings on ${l.join(`, `)}.`:a.size>0?`Update older servers to save this setting.`:void 0):Promise.all(o.map(async e=>({label:i.find(t=>t.environmentId===e.environmentId)?.label??e.environmentId,result:await r(e)}))).then(pi)}}Object.keys(a).length>0&&Ir(a)},t[4]=e,t[5]=i,t[6]=r,t[7]=o,t[8]=s,t[9]=c):c=t[9],c}function pi(e){let t=e.flatMap(gi);if(t.length===0)return;let n=e.filter(hi).map(mi);x.add({type:`error`,title:n.length>0?`Setting saved on some environments`:`Setting not saved`,description:[...t,...n.length>0?[`Saved on ${n.join(`, `)}.`]:[]].join(`
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{$o as n,Ah as r,BE as i,Bb as a,Bg as o,Cs as s,Db as c,Ds as l,Eb as u,Es as d,Gy as f,HT as p,Hs as ee,I_ as te,Ib as ne,LT as re,Lb as ie,Nx as ae,Ny as oe,O_ as se,Oh as ce,Oy as le,Pb as ue,Pv as de,Qy as fe,RT as m,Rg as pe,Sl as me,Th as he,Vy as ge,Xy as _e,Yo as ve,bh as ye,bl as be,c_ as xe,cb as Se,ds as h,eT as g,es as Ce,gb as we,gh as Te,hh as Ee,iS as De,iT as _,ib as Oe,jc as ke,kh as Ae,ks as je,l_ as Me,lb as Ne,lh as Pe,nT as v,nb as Fe,oS as Ie,oh as Le,ph as Re,rs as y,s_ as ze,ts as Be,uh as Ve,yl as He,z_ as Ue,zb as We}from"./utils-DPab5G1h.js";import{At as Ge,E as Ke,I as qe,R as Je,Sn as Ye,T as Xe,W as Ze,_t as b}from"./runtime-BoS3svRr.js";import{Et as Qe,St as $e,T as et,t as tt}from"./runtime-dibyMnpt.js";import{i as x}from"./toast-45xHk8t0.js";import{f as S,h as C,m as nt,u as rt}from"./server-c3qBJcFf.js";import{i as it,n as at,s as ot,t as st}from"./session-DSU6Gpmh.js";import{t as w}from"./use-atom-command-D-h097sl.js";import{B as ct,C as lt,M as ut,N as dt,O as ft,P as pt,S as mt,_ as ht,b as gt,c as _t,i as T,n as vt,o as yt,r as bt,y as xt,z as St}from"./themePalette-tRVivgCl.js";var E=e(t(),1),D=i();function Ct(e,t){if(e.size!==t.size)return!1;for(let[n,r]of e)if(t.get(n)!==r)return!1;return!0}function wt(e){let t=Be(t=>y(n=>{let r=n(e.catalogValueAtom).entries.get(t);if(r===void 0)return null;let i=re(d(n(e.stateAtom(t))),()=>Ye);return{entry:r,connection:r.unsupportedReason===void 0?Qe(i):{phase:`unsupported`,error:r.unsupportedReason,traceId:null},serverConfig:n(e.serverConfigValueAtom(t))}}).pipe(h(`environment-presentation:${t}`))),n=new Map;return{presentationAtom:t,presentationsAtom:y(r=>{let i=new Map;for(let n of r(e.catalogValueAtom).entries.keys()){let e=r(t(n));e!==null&&i.set(n,e)}return Ct(n,i)||(n=i),n}).pipe(h(`environment-presentations`))}}function Tt(e,t){return{environmentId:e,environmentLabel:t.entry.target.label,displayUrl:$e(t.entry)??``,isRelayManaged:Ge(t.entry),isEnabled:t.entry.enabled,connectionState:t.connection.phase,connectionError:t.connection.error,connectionErrorTraceId:t.connection.traceId}}function Et(e){let t=y(t=>{let n=[...t(e.catalogValueAtom).entries.keys()],r=m(t.self());return r!==null&&r.length===n.length&&n.every((e,t)=>e===r[t])?r:n}),n=y(t=>{let n=[...t(e.catalogValueAtom).entries].map(([e,t])=>({environmentId:e,label:t.target.label})),r=m(t.self());return r!==null&&r.length===n.length&&n.every((e,t)=>e.environmentId===r[t]?.environmentId&&e.label===r[t]?.label)?r:n}),r=Be(t=>y(n=>{let r=n(e.presentationAtom(t));if(r===null)return null;let i=Tt(t,r),a=m(n.self());return a!==null&&a.environmentId===i.environmentId&&a.environmentLabel===i.environmentLabel&&a.displayUrl===i.displayUrl&&a.isRelayManaged===i.isRelayManaged&&a.isEnabled===i.isEnabled&&a.connectionState===i.connectionState&&a.connectionError===i.connectionError&&a.connectionErrorTraceId===i.connectionErrorTraceId?a:i})),i=y(t=>{let n=[];for(let i of t(e.catalogValueAtom).entries.keys()){let e=t(r(i));e!==null&&n.push(e)}let i=m(t.self());return i!==null&&i.length===n.length&&n.every((e,t)=>e===i[t])?i:n}).pipe(h(`environment-connection-summaries`));return{environmentIdsAtom:t,connectedEnvironmentIdsAtom:y(e=>{let n=e(t).filter(t=>e(r(t))?.connectionState===`connected`),i=m(e.self());return i!==null&&i.length===n.length&&n.every((e,t)=>e===i[t])?i:n}),identitiesAtom:n,environmentsAtom:i,machineByIdAtom:y(n=>{let r=new Map(n(t).map(t=>[t,me(n(e.presentationAtom(t))?.serverConfig??null)])),i=m(n.self());return i!==null&&Ct(i,r)?i:r}),pullRequestsSupportedAtom:y(n=>n(t).some(t=>n(e.presentationAtom(t))?.serverConfig?.environment.capabilities.pullRequests===!0))}}var Dt=wt({catalogValueAtom:C.catalogValueAtom,stateAtom:C.stateAtom,serverConfigValueAtom:S.configValueAtom}),Ot=Et({catalogValueAtom:C.catalogValueAtom,presentationAtom:Dt.presentationAtom}),kt=y(null).pipe(h(`web-environment-presentation:empty`));function At(e){let t=(0,D.c)(5),r=n(C.catalogValueAtom),i;t[0]===e?i=t[1]:(i=e===null?kt:Dt.presentationAtom(e),t[0]=e,t[1]=i);let a=n(i),o;return t[2]!==r.isReady||t[3]!==a?(o={isReady:r.isReady,presentation:a},t[2]=r.isReady,t[3]=a,t[4]=o):o=t[4],o}var jt={status:`idle`},O=jt,k=null,A=[],j=0,Mt=new Set;function M(e){O=e;for(let e of Mt)e()}function Nt(e){k?.resolve(e);for(let t of A)t.resolve(e);k=null,A=[]}function Pt(){return O}function Ft(e){return Mt.add(e),()=>{Mt.delete(e)}}function It(){j+=1;let e=!0;return()=>{e&&(e=!1,j=Math.max(0,j-1),j===0&&(Nt(!1),M(jt)))}}function Lt(e,t){if(j!==0)return new Promise(n=>{let r={message:e,variant:t?.variant??`default`,resolve:n};if(k||O.status===`closing`){A.push(r);return}k=r,M({status:`confirming`,message:e,variant:r.variant})})}function Rt(){return O.status!==`idle`||k!==null||A.length>0}function zt(e){if(O.status!==`confirming`||!k)return;let t=k;k=null,t.resolve(e),M({status:`closing`,message:O.message,variant:O.variant})}function Bt(){if(O.status!==`closing`)return;let e=A.shift();if(!e){M(jt);return}k=e,M({status:`confirming`,message:e.message,variant:e.variant})}var Vt={Ctrl:`⌃`,Alt:`⌥`,Shift:`⇧`,Super:`⌘`,CmdOrCtrl:`⌘`};function Ht(e,t=navigator.platform){let n=e.split(`+`),r=n.pop()??``;return ke(t)?`${n.map(e=>Vt[e]??e).join(``)}${r}`:[...n.map(e=>e===`CmdOrCtrl`?`Ctrl`:e===`Super`?`Meta`:e),r].join(`+`)}var Ut=`http://www.w3.org/2000/svg`,Wt={archive:[{tag:`rect`,attrs:{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`}},{tag:`path`,attrs:{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`}},{tag:`path`,attrs:{d:`M10 12h4`}}],check:[{tag:`path`,attrs:{d:`M20 6 9 17l-5-5`}}],timer:[{tag:`line`,attrs:{x1:`10`,x2:`14`,y1:`2`,y2:`2`}},{tag:`line`,attrs:{x1:`12`,x2:`15`,y1:`14`,y2:`11`}},{tag:`circle`,attrs:{cx:`12`,cy:`14`,r:`8`}}],"chevron-right":[{tag:`path`,attrs:{d:`m9 19 7-7-7-7`}}],"circle-check":[{tag:`circle`,attrs:{cx:`12`,cy:`12`,r:`10`}},{tag:`path`,attrs:{d:`m9 12 2 2 4-4`}}],clock:[{tag:`path`,attrs:{d:`M12 6v6l4 2`}},{tag:`circle`,attrs:{cx:`12`,cy:`12`,r:`10`}}],pencil:[{tag:`path`,attrs:{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`}},{tag:`path`,attrs:{d:`m15 5 4 4`}}],copy:[{tag:`rect`,attrs:{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`}},{tag:`path`,attrs:{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`}}],folder:[{tag:`path`,attrs:{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`}}],"git-branch":[{tag:`line`,attrs:{x1:`6`,x2:`6`,y1:`3`,y2:`15`}},{tag:`circle`,attrs:{cx:`18`,cy:`6`,r:`3`}},{tag:`circle`,attrs:{cx:`6`,cy:`18`,r:`3`}},{tag:`path`,attrs:{d:`M18 9a9 9 0 0 1-9 9`}}],eye:[{tag:`path`,attrs:{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`}},{tag:`circle`,attrs:{cx:`12`,cy:`12`,r:`3`}}],"eye-off":[{tag:`path`,attrs:{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`}},{tag:`path`,attrs:{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`}},{tag:`path`,attrs:{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`}},{tag:`path`,attrs:{d:`m2 2 20 20`}}],"app-window":[{tag:`rect`,attrs:{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`}},{tag:`path`,attrs:{d:`M10 4v4`}},{tag:`path`,attrs:{d:`M2 8h20`}},{tag:`path`,attrs:{d:`M6 4v4`}}],"arrow-up-right":[{tag:`path`,attrs:{d:`M7 7h10v10`}},{tag:`path`,attrs:{d:`M7 17 17 7`}}],"external-link":[{tag:`path`,attrs:{d:`M15 3h6v6`}},{tag:`path`,attrs:{d:`M10 14 21 3`}},{tag:`path`,attrs:{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`}}],link:[{tag:`path`,attrs:{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`}},{tag:`path`,attrs:{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`}}],list:[{tag:`path`,attrs:{d:`M3 5h.01`}},{tag:`path`,attrs:{d:`M3 12h.01`}},{tag:`path`,attrs:{d:`M3 19h.01`}},{tag:`path`,attrs:{d:`M8 5h13`}},{tag:`path`,attrs:{d:`M8 12h13`}},{tag:`path`,attrs:{d:`M8 19h13`}}],share:[{tag:`path`,attrs:{d:`M12 2v13`}},{tag:`path`,attrs:{d:`m16 6-4-4-4 4`}},{tag:`path`,attrs:{d:`M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8`}}],x:[{tag:`path`,attrs:{d:`M18 6 6 18`}},{tag:`path`,attrs:{d:`m6 6 12 12`}}],hash:[{tag:`line`,attrs:{x1:`4`,x2:`20`,y1:`9`,y2:`9`}},{tag:`line`,attrs:{x1:`4`,x2:`20`,y1:`15`,y2:`15`}},{tag:`line`,attrs:{x1:`10`,x2:`8`,y1:`3`,y2:`21`}},{tag:`line`,attrs:{x1:`16`,x2:`14`,y1:`3`,y2:`21`}}],"mail-open":[{tag:`path`,attrs:{d:`M21.2 8.4c.5.38.8.97.8 1.6v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V10a2 2 0 0 1 .8-1.6l8-6a2 2 0 0 1 2.4 0l8 6Z`}},{tag:`path`,attrs:{d:`m22 10-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 10`}}],"message-square-plus":[{tag:`path`,attrs:{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`}},{tag:`path`,attrs:{d:`M12 8v6`}},{tag:`path`,attrs:{d:`M9 11h6`}}],pin:[{tag:`path`,attrs:{d:`M12 17v5`}},{tag:`path`,attrs:{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`}}],"pin-off":[{tag:`path`,attrs:{d:`M12 17v5`}},{tag:`path`,attrs:{d:`M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89`}},{tag:`path`,attrs:{d:`m2 2 20 20`}},{tag:`path`,attrs:{d:`M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11`}}],"refresh-cw":[{tag:`path`,attrs:{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`}},{tag:`path`,attrs:{d:`M21 3v5h-5`}},{tag:`path`,attrs:{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`}},{tag:`path`,attrs:{d:`M8 16H3v5`}}],settings:[{tag:`path`,attrs:{d:`M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.38a2 2 0 0 0-.73-2.73l-.15-.09a2 2 0 0 1-1-1.74v-.51a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z`}},{tag:`circle`,attrs:{cx:`12`,cy:`12`,r:`3`}}],"folder-tree":[{tag:`path`,attrs:{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`}},{tag:`path`,attrs:{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`}},{tag:`path`,attrs:{d:`M3 5a2 2 0 0 0 2 2h3`}},{tag:`path`,attrs:{d:`M3 3v13a2 2 0 0 0 2 2h3`}}],trash:[{tag:`path`,attrs:{d:`M3 6h18`}},{tag:`path`,attrs:{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`}},{tag:`path`,attrs:{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`}},{tag:`line`,attrs:{x1:`10`,x2:`10`,y1:`11`,y2:`17`}},{tag:`line`,attrs:{x1:`14`,x2:`14`,y1:`11`,y2:`17`}}]};function Gt(e,t){let n=Wt[e];if(!n||typeof document.createElementNS!=`function`)return null;let r=document.createElementNS(Ut,`svg`);r.setAttribute(`xmlns`,Ut),r.setAttribute(`viewBox`,`0 0 24 24`),r.setAttribute(`fill`,`none`),r.setAttribute(`stroke`,`currentColor`),r.setAttribute(`stroke-width`,`2`),r.setAttribute(`stroke-linecap`,`round`),r.setAttribute(`stroke-linejoin`,`round`),r.setAttribute(`class`,t===`destructive`?`size-4.5 shrink-0 sm:size-4`:`size-4.5 shrink-0 text-muted-foreground sm:size-4`);for(let e of n){let t=document.createElementNS(Ut,e.tag);for(let[n,r]of Object.entries(e.attrs))t.setAttribute(n,r);r.appendChild(t)}return r}function Kt(e,t,n){let r=e.getBoundingClientRect(),i=Math.min(Math.max(4,t),Math.max(4,window.innerWidth-r.width-4)),a=Math.min(Math.max(4,n),Math.max(4,window.innerHeight-r.height-4));e.style.left=`${i}px`,e.style.top=`${a}px`}function qt(e,t){if(typeof Node<`u`&&e instanceof Node)return t.some(t=>t.contains(e));if(!e||typeof e!=`object`)return!1;let n=e;for(;n&&typeof n==`object`;){if(t.includes(n))return!0;n=n.parent}return!1}var N=null;function Jt(){return N!==null}function Yt(){N?.(),N=null}function Xt(e,t){return new Promise(n=>{let r=document.activeElement instanceof HTMLElement?document.activeElement:null,i=[],a=[],o=!1,s=!1,c=()=>l(null),l=e=>{if(o)return;o=!0,N===c&&(N=null),document.removeEventListener(`keydown`,u),document.removeEventListener(`pointerdown`,d,!0),document.removeEventListener(`contextmenu`,f,!0);let t=qt(document.activeElement,i);for(let e of i)e.remove();t&&r?.isConnected&&r.focus({preventScroll:!0}),n(e)},u=e=>{e.key===`Escape`&&(e.preventDefault(),l(null))},d=e=>{s&&!qt(e.target,i)&&l(null)},f=e=>{s&&!qt(e.target,i)&&(e.preventDefault(),l(null))},p=e=>{for(;i.length>e;)a.pop()?.setAttribute(`aria-expanded`,`false`),i.pop()?.remove()},ee=(e,t,n,r,o)=>{p(r);let c=document.createElement(`div`);c.className=`dropdown-glass fixed z-[10000] min-w-56 max-w-sm overflow-hidden rounded-lg bg-clip-padding text-popover-foreground outline-none`,c.style.cssText=`position:fixed;z-index:10000;min-width:14rem;max-width:24rem;overflow:hidden;border-radius:var(--radius-lg);background-clip:padding-box;color:var(--contrast-popover-foreground);outline:none;pointer-events:auto;`,c.style.left=`${t}px`,c.style.top=`${n}px`,c.dataset.level=String(r);let u=document.createElement(`div`);u.className=`max-h-[calc(100vh-0.5rem)] min-w-0 max-w-sm overflow-y-auto overflow-x-hidden p-1`,u.style.cssText=`max-height:calc(100vh - 0.5rem);min-width:0;max-width:24rem;overflow-x:hidden;overflow-y:auto;padding:0.25rem;`;for(let t of e){if(t.separatorBefore===!0&&u.children.length>0){let e=document.createElement(`div`);e.className=`mx-2 my-1 h-px bg-border`,e.style.cssText=`height:1px;margin:0.25rem 0.5rem;background:var(--contrast-border);`,e.dataset.contextMenuSeparator=`true`,e.setAttribute(`role`,`separator`),u.appendChild(e)}if(t.header===!0){let e=document.createElement(`div`);e.className=`px-2 py-1.5 font-medium text-muted-foreground text-xs`,e.textContent=t.label,u.appendChild(e);continue}let e=Array.isArray(t.children)&&t.children.length>0,n=!e&&(t.destructive===!0||t.id===`delete`),a=document.createElement(`button`);a.type=`button`;let o=t.disabled===!0;a.disabled=o;let c=`flex w-full cursor-default select-none items-center gap-2 rounded-sm px-2 py-1 text-left outline-none transition-colors sm:min-h-7 sm:text-sm min-h-8 text-base`;if(a.className=o?`${c} pointer-events-none cursor-not-allowed text-muted-foreground opacity-64`:n?`${c} text-destructive-foreground hover:bg-destructive/10 hover:text-destructive-foreground`:`${c} text-foreground hover:bg-accent hover:text-accent-foreground`,a.style.cssText=`display:flex;width:100%;min-height:1.75rem;align-items:center;gap:0.5rem;border:0;border-radius:var(--radius-sm);background:transparent;padding:0.25rem 0.5rem;color:var(--contrast-foreground);font-family:var(--font-sans,system-ui,sans-serif);font-size:0.875rem;line-height:1.25rem;text-align:left;cursor:default;`,n&&(a.style.color=`var(--destructive-foreground)`),o&&(a.style.color=`var(--contrast-muted-foreground)`,a.style.opacity=`0.64`,a.style.pointerEvents=`none`),typeof t.checked==`boolean`){a.setAttribute(`role`,`menuitemradio`),a.setAttribute(`aria-checked`,t.checked?`true`:`false`);let e=t.checked?Gt(`check`,`neutral`):null;if(e)a.appendChild(e);else{let e=document.createElement(`span`);e.className=`size-4.5 shrink-0 sm:size-4`,e.style.cssText=`display:inline-block;width:1rem;height:1rem;flex-shrink:0;`,e.setAttribute(`aria-hidden`,`true`),a.appendChild(e)}}else if(typeof t.icon==`string`){let e=Gt(t.icon,n?`destructive`:`neutral`);e&&a.appendChild(e)}let d=document.createElement(`span`);if(d.className=`min-w-0 flex-1 truncate`,d.textContent=t.label,a.appendChild(d),typeof t.accelerator==`string`){let e=document.createElement(`span`);e.className=`ms-6 shrink-0 text-muted-foreground text-xs tracking-widest`,e.style.cssText=`margin-inline-start:1.5rem;flex-shrink:0;color:var(--contrast-muted-foreground);font-size:0.75rem;letter-spacing:0.1em;`,e.textContent=Ht(t.accelerator),e.setAttribute(`aria-hidden`,`true`),a.setAttribute(`aria-keyshortcuts`,t.accelerator.replace(`CmdOrCtrl`,ke(navigator.platform)?`Meta`:`Control`)),a.appendChild(e)}if(e){a.setAttribute(`aria-haspopup`,`menu`),a.setAttribute(`aria-expanded`,`false`);let e=Gt(`chevron-right`,`neutral`);e&&(e.setAttribute(`class`,`-me-0.5 ms-auto size-4.5 shrink-0 text-muted-foreground opacity-80 sm:size-4`),e.setAttribute(`aria-hidden`,`true`),e.dataset.contextMenuChevron=`true`,a.appendChild(e))}if(!o){let o=!1,c=!1,u=()=>{let e=o||c;a.style.background=e?n?`color-mix(in srgb, var(--destructive) 10%, transparent)`:`var(--accent)`:`transparent`,a.style.color=e?n?`var(--destructive-foreground)`:`var(--contrast-accent-foreground)`:n?`var(--destructive-foreground)`:`var(--contrast-foreground)`};if(a.addEventListener(`mouseenter`,()=>{a.focus({preventScroll:!0}),o=!0,u()}),a.addEventListener(`mouseleave`,()=>{o=!1,u()}),a.addEventListener(`focus`,()=>{c=!0,u()}),a.addEventListener(`blur`,()=>{c=!1,u()}),e){let e=(e=!1)=>{let n=a.getBoundingClientRect(),o=n.right+4,s=n.top;ee(t.children,o,s,r+1,a),a.setAttribute(`aria-expanded`,`true`);let c=i[r+1];if(!c)return;let l=c.getBoundingClientRect();l.right>window.innerWidth&&Kt(c,n.left-l.width-4,n.top),e&&[...c.querySelectorAll(`button`)].find(e=>!e.disabled)?.focus()};a.addEventListener(`mouseenter`,()=>{e()}),a.addEventListener(`click`,t=>{t.preventDefault(),e(!0)})}else a.addEventListener(`mouseenter`,()=>{p(r+1)}),a.addEventListener(`click`,()=>{s&&l(t.id)})}u.appendChild(a)}c.appendChild(u),c.addEventListener(`mouseenter`,()=>{p(r+1)}),document.body.appendChild(c),i[r]=c,a[r]=o,requestAnimationFrame(()=>{Kt(c,t,n)})};document.addEventListener(`keydown`,u),document.addEventListener(`pointerdown`,d,!0),document.addEventListener(`contextmenu`,f,!0),ee(e,t?.x??0,t?.y??0,0),N&&N(),N=c,requestAnimationFrame(()=>{s=!0})})}var Zt=`p4code:client-settings:v1`;function Qt(){return typeof window<`u`}function $t(){return Qt()?l(Zt,Le):null}function en(e){Qt()&&je(Zt,e,Le)}var tn;function nn(){return{dialogs:{pickFolder:async e=>window.desktopBridge?window.desktopBridge.pickFolder(e):null,confirm:async(e,t)=>Lt(e,t)??!1},shell:{openExternal:async e=>{if(window.desktopBridge){if(!await window.desktopBridge.openExternal(e))throw Error(`Unable to open link.`);return}window.open(e,`_blank`,`noopener,noreferrer`)},openSystemSettings:async e=>{if(!window.desktopBridge?.openSystemSettings||!await window.desktopBridge.openSystemSettings(e))throw Error(`Unable to open System Settings.`)}},contextMenu:{show:async(e,t)=>window.desktopBridge?window.desktopBridge.showContextMenu(e,t):Xt(e,t),close:async()=>{window.desktopBridge||Yt()}},persistence:{getClientSettings:async()=>window.desktopBridge?window.desktopBridge.getClientSettings():$t(),setClientSettings:async e=>{if(window.desktopBridge)return window.desktopBridge.setClientSettings(e);en(e)}}}}function rn(){return nn()}function an(){if(typeof window<`u`)return tn||(tn=rn(),tn)}function on(){let e=an();if(!e)throw Error(`Local API not found`);return e}var P=`p4code:theme`,sn=`(prefers-color-scheme: dark)`,F={theme:`system`,resolvedTheme:`light`,systemDark:!1,followSystem:!0,appearanceMode:`system`,themeHalves:null};function cn(){return I()}function ln(){return typeof window>`u`?{}:un()}function I(){if(typeof window>`u`)return null;try{return ft(window.localStorage.getItem(T))}catch{return null}}function un(){try{let e=JSON.parse(window.localStorage.getItem(`p4code:theme-halves:v1`)??`null`);if(typeof e!=`object`||!e)return{};let t={};for(let n of[`light`,`dark`]){let r=e[n];typeof r==`string`&&(t[n]=r)}return t}catch{return{}}}function dn(e){return`${e?.light??``}|${e?.dark??``}`}var fn=`theme-color`,pn=`meta[name="${fn}"][data-dynamic-theme-color="true"]`,L=class extends f()(`ThemeStorageError`,{operation:oe([`read`,`write`]),storageKey:ge,theme:we(yt),cause:le()}){get message(){return`Failed to ${this.operation} theme preference for ${this.storageKey}.`}},mn=Ne(L),hn=class extends f()(`DesktopThemeSyncError`,{theme:yt,cause:le()}){get message(){return`Failed to sync the ${this.theme} theme to the desktop shell.`}},gn=Ne(hn),R=[],z=null,_n=!0,B=null,V=null,H=null;function U(){_n=!0;for(let e of R)e()}function vn(){return typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(sn).matches}function yn(e){if(typeof window>`u`)return e===`system`;try{let e=window.localStorage.getItem(bt);if(e===`true`)return!0;if(e===`false`)return!1}catch{}return e===`system`}function bn(e){return e===`light`||e===`dark`||e===`system`}function W(e){if(typeof window<`u`)try{let e=window.localStorage.getItem(vt);if(bn(e))return e}catch{}return yn(e)?`system`:xt(e)??`light`}function xn(e){if(typeof window<`u`)try{window.localStorage.setItem(vt,e)}catch(e){throw new L({operation:`write`,storageKey:vt,cause:e})}}function Sn(){if(typeof window>`u`)return F.theme;let e;try{e=window.localStorage.getItem(P)}catch(e){throw new L({operation:`read`,storageKey:P,cause:e})}return e!==null&<(e)?e:F.theme}function Cn(e){if(typeof window<`u`)try{window.localStorage.setItem(P,e),H=null}catch(t){throw new L({operation:`write`,storageKey:P,theme:e,cause:t})}}function G(){if(H!==null)return F.theme;try{return Sn()}catch(e){let t=mn(e)?e:new L({operation:`read`,storageKey:P,cause:e});return H=t,console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...b(t)}),F.theme}}function wn(){let e=document.querySelector(pn);return e||(e=document.createElement(`meta`),e.name=fn,e.setAttribute(`data-dynamic-theme-color`,`true`),document.head.append(e),e)}function Tn(e){let t=e?.trim().toLowerCase();return!t||t===`transparent`||t===`rgba(0, 0, 0, 0)`||t===`rgba(0 0 0 / 0)`?null:e?.trim()??null}function En(){return document.querySelector(`main[data-slot='sidebar-inset']`)??document.querySelector(`[data-slot='sidebar-inner']`)??document.body}function Dn(){if(typeof document>`u`||typeof getComputedStyle>`u`)return;let e=getComputedStyle(document.documentElement),t=document.documentElement.dataset.themeId?Tn(e.getPropertyValue(`--app-chrome-background`)):null,n=Tn(getComputedStyle(En()).backgroundColor),r=Tn(getComputedStyle(document.body).backgroundColor),i=t??n??r;if(!i)return;document.documentElement.style.backgroundColor=i,document.body.style.backgroundColor=i;let a=document.querySelectorAll(`meta[name="${fn}"]`);if(a.length===0){wn().setAttribute(`content`,i);return}for(let e of a)e.setAttribute(`content`,i)}function K(e,{suppressTransitions:t=!1,preservePreview:n=!0}={}){if(typeof document>`u`||typeof window>`u`||n&&document.documentElement.dataset?.themeId===`__preview`)return;let r=W(e),i=r===`system`,a=i?vn():!1,o=I();if(V?.theme===e&&V.systemDark===a&&V.followSystem===i&&V.appearanceMode===r&&dn(V.themeHalves)===dn(o)){kn(e,i,r);return}t&&document.documentElement.classList.add(`no-transitions`);let s=dt(e,a,i,r,o);_t(pt(e,o,s),s),document.documentElement.classList.toggle(`dark`,s===`dark`),V={theme:e,systemDark:a,followSystem:i,appearanceMode:r,themeHalves:o},Dn(),kn(e,i,r),t&&(document.documentElement.offsetHeight,requestAnimationFrame(()=>{document.documentElement.classList.remove(`no-transitions`)}))}async function On(e,t,n,r,i=I()){try{await e.setTheme(ut(t,n,r,i))}catch(e){throw new hn({theme:t,cause:e})}}function kn(e,t,n){if(typeof window>`u`)return;let r=window.desktopBridge,i=I(),a=ut(e,t,n,i);r&&typeof r.setTheme==`function`&&B!==a&&(B=a,On(r,e,t,n,i).catch(t=>{let n=gn(t)?t:new hn({theme:e,cause:t});console.error(n.message,{theme:n.theme,...b(n)}),B===a&&(B=null)}))}typeof document<`u`&&typeof window<`u`&&K(G());function An(){if(typeof window>`u`)return F;if(!_n&&z)return z;_n=!1;let e=G(),t=W(e),n=t===`system`,r=n?vn():!1,i=I(),a=dt(e,r,n,t,i);return z&&z.theme===e&&z.resolvedTheme===a&&z.systemDark===r&&z.followSystem===n&&z.appearanceMode===t&&dn(z.themeHalves)===dn(i)||(z={theme:e,resolvedTheme:a,systemDark:r,followSystem:n,appearanceMode:t,themeHalves:i}),z}function jn(){return F}function Mn(){let e=G();W(e)===`system`&&K(e,{suppressTransitions:!0}),U()}function Nn(e){e.key===P?(H=null,K(G(),{suppressTransitions:!0}),U()):e.key===`p4code:theme-follow-system`||e.key===`p4code:theme-appearance-mode`||e.key===`p4code:theme-halves:v1`?(K(G(),{suppressTransitions:!0}),U()):(e.key===`p4code:themes:v1`||e.key===null)&&(e.key===null&&(H=null),mt(),V=null,K(G(),{suppressTransitions:!0}),U())}var Pn=null;function Fn(e){if(typeof window>`u`)return()=>{};if(R.push(e),!Pn){let e=typeof window.matchMedia==`function`?window.matchMedia(sn):null;e?.addEventListener(`change`,Mn),window.addEventListener(`storage`,Nn),Pn=()=>{e?.removeEventListener(`change`,Mn),window.removeEventListener(`storage`,Nn)}}return()=>{R=R.filter(t=>t!==e),R.length===0&&(Pn?.(),Pn=null)}}function In(){let e=(0,E.useSyncExternalStore)(Fn,An,jn),{theme:t,resolvedTheme:n}=e,r=(0,E.useCallback)(e=>{if(typeof window>`u`)return!1;try{xn(W(G()));let t=window.localStorage.getItem(T);window.localStorage.removeItem(T);try{Cn(e)}catch(e){if(t!==null)try{window.localStorage.setItem(T,t)}catch{}throw e}}catch(t){let n=mn(t)?t:new L({operation:`write`,storageKey:P,theme:e,cause:t});return console.error(n.message,{operation:n.operation,storageKey:n.storageKey,theme:e,...b(n)}),!1}return K(e,{suppressTransitions:!0}),U(),!0},[]),i=(0,E.useCallback)(e=>{if(typeof window>`u`)return!1;try{xn(e)}catch(e){let t=mn(e)?e:new L({operation:`write`,storageKey:vt,cause:e});return console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...b(t)}),!1}return H=null,K(G(),{suppressTransitions:!0}),U(),!0},[]),a=(0,E.useCallback)(e=>{let n=W(t),r=e?`system`:n===`system`?xt(t)??`light`:n;return i(r)},[i,t]),o=(0,E.useCallback)((e,t)=>{if(typeof window>`u`)return!1;try{let n={...un()};t===null?delete n[e]:n[e]=t,n.light===void 0&&n.dark===void 0?window.localStorage.removeItem(T):window.localStorage.setItem(T,JSON.stringify(n))}catch(e){let t=new L({operation:`write`,storageKey:T,cause:e});return console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...b(t)}),!1}return K(G(),{suppressTransitions:!0}),U(),!0},[]),s=(0,E.useCallback)(()=>{if(typeof window>`u`)return!1;try{window.localStorage.removeItem(T)}catch(e){let t=new L({operation:`write`,storageKey:T,cause:e});return console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...b(t)}),!1}return K(G(),{suppressTransitions:!0}),U(),!0},[]),c=(0,E.useCallback)(({preservePreview:e=!1}={})=>{typeof window<`u`&&(V=null,K(G(),{suppressTransitions:!0,preservePreview:e}),U())},[]);return(0,E.useEffect)(()=>{K(t)},[e.appearanceMode,t]),{theme:t,setTheme:r,setAppearanceMode:i,setFollowSystem:a,setThemeHalf:o,clearThemeHalves:s,refreshTheme:c,followSystem:e.followSystem,appearanceMode:e.appearanceMode,resolvedTheme:n,themeHalves:e.themeHalves}}var Ln=fe(Se(_e)),Rn=a(e=>{let t=e.replace(/("(?:[^"\\]|\\.)*")|\/\/[^\n]*/g,(e,t)=>t?e:``);return t=t.replace(/("(?:[^"\\]|\\.)*")|\/\*[\s\S]*?\*\//g,(e,t)=>t?e:``),t=t.replace(/("(?:[^"\\]|\\.)*")|,(\s*[}\]])/g,(e,t,n)=>t?e:n??``),Ln(t).pipe(Ie(e=>e.issue))}),zn=new ue(Rn,We());ie().pipe(ne(We({space:2})));var Bn=e=>ge.pipe(Fe(e,zn)),Vn={performance:{profile:`performance`,automaticGitFetchInterval:v(15),providerHealthRefreshInterval:g(1),hostPowerMonitorActiveInterval:v(30),hostPowerMonitorIdleInterval:g(2),idleClientTtl:v(45),pauseWhenHostLocked:!0,pauseWhenHostLowPower:!1,pauseWhenClientLowPower:!1,pauseWhenOnBattery:!1},balanced:{profile:`balanced`,automaticGitFetchInterval:Pe,providerHealthRefreshInterval:Ee,hostPowerMonitorActiveInterval:v(30),hostPowerMonitorIdleInterval:g(5),idleClientTtl:v(45),pauseWhenHostLocked:!0,pauseWhenHostLowPower:!0,pauseWhenClientLowPower:!0,pauseWhenOnBattery:!1},"battery-saver":{profile:`battery-saver`,automaticGitFetchInterval:v(0),providerHealthRefreshInterval:g(15),hostPowerMonitorActiveInterval:g(1),hostPowerMonitorIdleInterval:g(10),idleClientTtl:v(45),pauseWhenHostLocked:!0,pauseWhenHostLowPower:!0,pauseWhenClientLowPower:!0,pauseWhenOnBattery:!0}};function q(e){return Vn[e]}function Hn(e){return e.profile===`custom`?e.baseProfile??`balanced`:e.profile}function Un(e){let t=Hn(e),n=Vn[t],r=e.profile===`custom`?e.overrides:{};return{profile:t,automaticGitFetchInterval:r.automaticGitFetchInterval??n.automaticGitFetchInterval,providerHealthRefreshInterval:r.providerHealthRefreshInterval??n.providerHealthRefreshInterval,hostPowerMonitorActiveInterval:r.hostPowerMonitorActiveInterval??n.hostPowerMonitorActiveInterval,hostPowerMonitorIdleInterval:r.hostPowerMonitorIdleInterval??n.hostPowerMonitorIdleInterval,idleClientTtl:r.idleClientTtl??n.idleClientTtl,pauseWhenHostLocked:r.pauseWhenHostLocked??n.pauseWhenHostLocked,pauseWhenHostLowPower:r.pauseWhenHostLowPower??n.pauseWhenHostLowPower,pauseWhenClientLowPower:r.pauseWhenClientLowPower??n.pauseWhenClientLowPower,pauseWhenOnBattery:r.pauseWhenOnBattery??n.pauseWhenOnBattery}}function J(e,t){return _(e)===_(t)}function Wn(e,t){return J(e.automaticGitFetchInterval,t.automaticGitFetchInterval)&&J(e.providerHealthRefreshInterval,t.providerHealthRefreshInterval)&&J(e.hostPowerMonitorActiveInterval,t.hostPowerMonitorActiveInterval)&&J(e.hostPowerMonitorIdleInterval,t.hostPowerMonitorIdleInterval)&&J(e.idleClientTtl,t.idleClientTtl)&&e.pauseWhenHostLocked===t.pauseWhenHostLocked&&e.pauseWhenHostLowPower===t.pauseWhenHostLowPower&&e.pauseWhenClientLowPower===t.pauseWhenClientLowPower&&e.pauseWhenOnBattery===t.pauseWhenOnBattery}function Gn(e){if(e.profile!==`custom`)return{schemaVersion:1,profile:e.profile,overrides:{}};let t=Un(e),n=[Hn(e),`balanced`,`performance`,`battery-saver`];for(let e of n)if(Wn(t,Vn[e]))return{schemaVersion:1,profile:e,overrides:{}};let r=Hn(e),i=Vn[r];return{schemaVersion:1,profile:`custom`,baseProfile:r,overrides:{...J(t.automaticGitFetchInterval,i.automaticGitFetchInterval)?{}:{automaticGitFetchInterval:t.automaticGitFetchInterval},...J(t.providerHealthRefreshInterval,i.providerHealthRefreshInterval)?{}:{providerHealthRefreshInterval:t.providerHealthRefreshInterval},...J(t.hostPowerMonitorActiveInterval,i.hostPowerMonitorActiveInterval)?{}:{hostPowerMonitorActiveInterval:t.hostPowerMonitorActiveInterval},...J(t.hostPowerMonitorIdleInterval,i.hostPowerMonitorIdleInterval)?{}:{hostPowerMonitorIdleInterval:t.hostPowerMonitorIdleInterval},...J(t.idleClientTtl,i.idleClientTtl)?{}:{idleClientTtl:t.idleClientTtl},...t.pauseWhenHostLocked===i.pauseWhenHostLocked?{}:{pauseWhenHostLocked:t.pauseWhenHostLocked},...t.pauseWhenHostLowPower===i.pauseWhenHostLowPower?{}:{pauseWhenHostLowPower:t.pauseWhenHostLowPower},...t.pauseWhenClientLowPower===i.pauseWhenClientLowPower?{}:{pauseWhenClientLowPower:t.pauseWhenClientLowPower},...t.pauseWhenOnBattery===i.pauseWhenOnBattery?{}:{pauseWhenOnBattery:t.pauseWhenOnBattery}}}}function Kn(e){let t={schemaVersion:1,profile:Ve,overrides:{}},n=e.backgroundActivity.profile===t.profile&&e.backgroundActivity.baseProfile===void 0&&Object.keys(e.backgroundActivity.overrides).length===0,r=e.backgroundActivityProfile,i=r!==`balanced`||_(e.automaticGitFetchInterval)!==_(Pe)||_(e.providerHealthRefreshInterval)!==_(Ee);return Un(n&&i?{schemaVersion:1,profile:_(e.automaticGitFetchInterval)===_(q(r).automaticGitFetchInterval)&&_(e.providerHealthRefreshInterval)===_(q(r).providerHealthRefreshInterval)?r:`custom`,baseProfile:r,overrides:{..._(e.automaticGitFetchInterval)===_(q(r).automaticGitFetchInterval)?{}:{automaticGitFetchInterval:e.automaticGitFetchInterval},..._(e.providerHealthRefreshInterval)===_(q(r).providerHealthRefreshInterval)?{}:{providerHealthRefreshInterval:e.providerHealthRefreshInterval}}}:e.backgroundActivity)}function qn(e){let t=Kn(e);return Gn({schemaVersion:1,profile:`custom`,baseProfile:t.profile,overrides:{automaticGitFetchInterval:t.automaticGitFetchInterval,providerHealthRefreshInterval:t.providerHealthRefreshInterval,hostPowerMonitorActiveInterval:t.hostPowerMonitorActiveInterval,hostPowerMonitorIdleInterval:t.hostPowerMonitorIdleInterval,idleClientTtl:t.idleClientTtl,pauseWhenHostLocked:t.pauseWhenHostLocked,pauseWhenHostLowPower:t.pauseWhenHostLowPower,pauseWhenClientLowPower:t.pauseWhenClientLowPower,pauseWhenOnBattery:t.pauseWhenOnBattery}})}var Jn=Bn(ye);Oe(Jn);function Yn(e,t){let n=e.providerInstances[t.instanceId];return n===void 0?he(t.instanceId):r(n)}var Xn=[`codex`,`claudeAgent`,`cursor`,`grok`,`muse`,`pi`,`opencode`,`antigravity`].map(e=>ze.make(e));function Zn(e,t,n){let r=[...Xn.map(e=>[Me(e),e]),...n?.includeConfiguredInstances===!0?Object.entries(e).flatMap(([e,t])=>Xn.includes(t.driver)?[[xe.make(e),t.driver]]:[]):[]].find(([e,n])=>t(e,n));if(r===void 0)return null;let[i,a]=r,s=n?.defaultModelSelection,c=e[i]?.config;return s?.instanceId===i&&ee(c?.customModels).some(e=>e.slug===s.model)?s:{instanceId:i,model:o[a]??pe[a]??`gpt-6-luna`}}function Qn(e,t,n){let r=e.sourceControlWriterModelSelection;if(!r||!Ae(e,n,r.instanceId))return e.textGenerationModelSelection;if(t===void 0)return r;let i=t.find(e=>e.instanceId===r.instanceId);return i?.enabled===!0&&He(i)&&be(i)?r:e.textGenerationModelSelection}function $n(e,t,n){let r=e.reviewGuideModelSelection;if(r&&Ae(e,n,r.instanceId)){let e=t?.find(e=>e.instanceId===r.instanceId);if(t===void 0||e?.enabled===!0&&He(e)&&be(e))return r}return Qn(e,t,n)}function er(e,t={}){return{favorites:e.favorites??t.favorites??[],providerModelPreferences:e.providerModelPreferences??t.providerModelPreferences??{}}}function tr(e,t){let n=e.favorites===null&&(t.favorites?.length??0)>0?t.favorites:void 0,r=e.providerModelPreferences===null&&Object.keys(t.providerModelPreferences??{}).length>0?t.providerModelPreferences:void 0;return n===void 0&&r===void 0?null:{migrateModelPreferences:{...n===void 0?{}:{favorites:n},...r===void 0?{}:{providerModelPreferences:r}}}}var nr=new Set([`continueThreadsAfterServerUpdate`,`sidebarAutoSettleAfterDays`,`sidebarAutoSettleOnMerge`,`autoResumeLimitedThreads`,`snoozeLimitedThreads`,`newWorktreesStartFromOrigin`,`sourceControlWritingStyle`,`textGenerationModelSelection`]);function rr(e){let t={},n={};for(let[r,i]of Object.entries(e))nr.has(r)?t[r]=i:n[r]=i;return{sharedPatch:t,localPatch:n}}function ir(e,t,n,r=n,i=!1){let a=e.textGenerationModelSelection?.instanceId??r?.textGenerationModelSelection.instanceId;return!i&&e.textGenerationModelSelection&&(!n||a!==void 0&&(r?.providerInstances[a]?.driver??a)!==(n.providerInstances[a]?.driver??a)||!Yn(n,{...n.textGenerationModelSelection,...e.textGenerationModelSelection}))&&(e=c(e,[`textGenerationModelSelection`])),t?.threadRestartContinuation===!0?e:c(e,[`continueThreadsAfterServerUpdate`])}function ar(e){return e.connection.phase===`connected`&&e.serverConfig?.environment.capabilities.threadAutoSettlement===!0}function or(e){let t=e.atom(de(Ke.pipe(De(e=>Ue(e.state)))),{initialValue:Xe});return{stateAtom:t,stateValueAtom:y(e=>re(d(e(t)),()=>Xe)).pipe(h(`relay-environment-discovery-value`)),refresh:qe(e,{label:`relay-environment-discovery:refresh`,concurrency:{mode:`singleFlight`,key:()=>`refresh`},execute:e=>Ke.pipe(ae(e=>e.refresh))})}}var sr=or(tt);function cr(e,t){return{...t,environmentId:e,label:t.entry.target.label,displayUrl:$e(t.entry),relayManaged:Ge(t.entry)}}function lr(){let e=(0,D.c)(7),t=n(C.catalogValueAtom),r=n(C.networkStatusValueAtom),i=n(Dt.presentationsAtom),a;e[0]===i?a=e[1]:(a=[...i.entries()].map(ur),e[0]=i,e[1]=a);let o=a,s;return e[2]!==t.isReady||e[3]!==o||e[4]!==r||e[5]!==i?(s={isReady:t.isReady,networkStatus:r,environments:o,presentationById:i},e[2]=t.isReady,e[3]=o,e[4]=r,e[5]=i,e[6]=s):s=e[6],s}function ur(e){let[t,n]=e;return cr(t,n)}function dr(){return n(nt)}function fr(e){let t=(0,D.c)(3),{presentation:n}=At(e),r;return t[0]!==e||t[1]!==n?(r=e===null||n===null?null:cr(e,n),t[0]=e,t[1]=n,t[2]=r):r=t[2],r}function pr(){return fr(dr())}function mr(e){let t=(0,D.c)(2),n=ot(e),r;return t[0]===n?r=t[1]:(r=p(n)?n.value.httpBaseUrl:null,t[0]=n,t[1]=r),r}function hr(){return n(sr.stateValueAtom)}function gr(){return n(Ot.environmentIdsAtom)}function _r(){return n(Ot.identitiesAtom)}function vr(){return n(Ot.pullRequestsSupportedAtom)}var yr=`[CLIENT_SETTINGS]`,br=new Set,xr=new Set,Sr=Re,Y=`pending`,X=null,Cr=0,wr=Promise.resolve(),Tr=0;function Er(){for(let e of br)e()}function Dr(){for(let e of xr)e()}function Z(){return Sr}function Or(e){Sr=e,Er()}function kr(e){Y!==e&&(Y=e,Dr())}function Ar(e){return br.add(e),Q().catch(()=>void 0),()=>{br.delete(e)}}function jr(){return Y===`ready`}function Mr(){return Y}function Nr(e){return xr.add(e),Q().catch(()=>void 0),()=>{xr.delete(e)}}async function Q(){if(Y===`ready`)return;if(X)return X;let e=Cr;kr(Y===`failed`||Y===`retrying`?`retrying`:`pending`);let t=(async()=>{try{let t=await on().persistence.getClientSettings();if(e!==Cr)return;t&&Or({...Re,...t}),kr(`ready`)}catch(t){throw e===Cr&&kr(`failed`),console.error(`${yr} hydrate failed`,{operation:`hydrate`,...b(t)}),t}})().finally(()=>{X===t&&(X=null)});return X=t,X}var Pr=e=>on().persistence.setClientSettings(e);function Fr(e){let t=wr.then(e);return wr=t.then(()=>void 0,()=>void 0),t}function Ir(e,t=Pr){let n=Y!==`ready`||Tr>0;return n?Tr+=1:Or({...Z(),...e}),Fr(async()=>{if(n)try{Y!==`ready`&&await Q(),Or({...Z(),...e})}finally{--Tr}await t(Z())}).catch(e=>{console.error(`${yr} persist failed`,{operation:`persist`,...b(e)})})}async function Lr(e,t=Pr){return Fr(async()=>{for(Y!==`ready`&&await Q();;){let n=Z(),r=e(n);if(await t(r),Z()===n)return Or(r),r}})}var Rr=new Set(u(ye.fields));function zr(e){let t={},n={};for(let[r,i]of Object.entries(e))Rr.has(r)?t[r]=i:n[r]=i;return{serverPatch:t,clientPatch:n}}function Br(){return Z()}function Vr(){return Q()}function Hr(){return(0,E.useSyncExternalStore)(Nr,jr,Ur)}function Ur(){return!1}function Wr(){return(0,E.useSyncExternalStore)(Nr,Mr,Gr)}function Gr(){return`pending`}function $(){return(0,E.useSyncExternalStore)(Ar,Z,Kr)}function Kr(){return Re}function qr(e,t){return{...t,...e,...er(e,t)}}var Jr=new Set;function Yr(e,t){let n=(0,D.c)(8),r=$(),i=Hr(),a;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={reportFailure:!1},n[0]=a):a=n[0];let o=w(S.updateSettings,a),s,c;n[1]!==r||n[2]!==e||n[3]!==i||n[4]!==o||n[5]!==t?(s=()=>{if(!e||!t||!i||Jr.has(e))return;let n=tr(t,r);n&&(Jr.add(e),o({environmentId:e,input:{patch:n}}).finally(()=>Jr.delete(e)))},c=[r,e,i,o,t],n[1]=r,n[2]=e,n[3]=i,n[4]=o,n[5]=t,n[6]=s,n[7]=c):(s=n[6],c=n[7]),(0,E.useEffect)(s,c)}function Xr(e,t){let n=(0,D.c)(6),r=$(),i;n[0]!==r||n[1]!==e?(i=qr(e,r),n[0]=r,n[1]=e,n[2]=i):i=n[2];let a=i,o;return n[3]!==a||n[4]!==t?(o=t?t(a):a,n[3]=a,n[4]=t,n[5]=o):o=n[5],o}function Zr(e){let t=(0,D.c)(3),n=$(),r;return t[0]!==e||t[1]!==n?(r=e?e(n):n,t[0]=e,t[1]=n,t[2]=r):r=t[2],r}function Qr(e){return e.settingsHydrated?e.paletteThemeActive&&!e.paletteThemeAllowsArtwork&&e.mode===`artwork`?`pill`:e.mode:`none`}function $r(){let e=(0,D.c)(7),t=Hr(),n=$().environmentIdentificationMode,{resolvedTheme:r,theme:i,themeHalves:a}=In(),o=(0,E.useSyncExternalStore)(St,gt,ei),s;if(e[0]!==n||e[1]!==o||e[2]!==r||e[3]!==t||e[4]!==i||e[5]!==a){let c=pt(i,a,r),l=ht(c);s=Qr({mode:n,settingsHydrated:t,paletteThemeActive:o!==null||l!==null,paletteThemeAllowsArtwork:o??ct(c)}),e[0]=n,e[1]=o,e[2]=r,e[3]=t,e[4]=i,e[5]=a,e[6]=s}else s=e[6];return s}function ei(){return null}async function ti(e,t){return(e.favorites===null||e.providerModelPreferences===null)&&await Vr(),{...tr(e,Br()),...t}}function ni(e){let t=(0,D.c)(6),r;t[0]===e?r=t[1]:(r=e?S.settingsValueAtom(e):ii,t[0]=e,t[1]=r);let i=n(r),a=w(S.updateSettings,`model preferences update`),o;return t[2]!==e||t[3]!==a||t[4]!==i?(o=async t=>{if(!e||!i)return;let n;try{n=await ti(i,t)}catch{x.add({type:`error`,title:`Model preferences not saved`,description:`Could not load saved model preferences. Try again.`});return}return a({environmentId:e,input:{patch:n}})},t[2]=e,t[3]=a,t[4]=i,t[5]=o):o=t[5],o}function ri(e){let t=(0,E.use)(Ce),n=(0,E.useRef)(new Map),r=ni(e);return(0,E.useCallback)(async(i,a)=>{if(!e)return;let o=S.settingsValueAtom(e),c=t.get(o);if(!c)return;if(c.favorites===null)try{await Vr()}catch{x.add({type:`error`,title:`Favorites not saved`,description:`Could not load saved model preferences. Try again.`});return}let l=t.get(o)??c,u=er(l,Br()).favorites,d=JSON.stringify([e,i,a]),f=n.current.get(d),p={favorite:!(f&&(f.pending||f.settings.favorites===l.favorites)?f.favorite:u.some(e=>e.provider===i&&e.model===a)),settings:l,pending:!0};n.current.set(d,p);try{let e=await r({setModelFavorites:[{provider:i,model:a,favorite:p.favorite}]});e&&s(e)&&t.get(o)?.favorites===l.favorites&&(p.pending=!1)}finally{p.pending&&n.current.get(d)===p&&(f&&!f.pending&&t.get(o)?.favorites===f.settings.favorites?n.current.set(d,f):n.current.delete(d))}},[e,t,r])}var ii=y(null);function ai(e){let t=(0,D.c)(5),r;t[0]===e?r=t[1]:(r=e?S.settingsValueAtom(e):ii,t[0]=e,t[1]=r);let i=n(r),a=$();Yr(e,i);let o=i??Te,s;return t[2]!==a||t[3]!==o?(s=er(o,a),t[2]=a,t[3]=o,t[4]=s):s=t[4],s}function oi(e,t){let r=(0,D.c)(2),i;r[0]===e?i=r[1]:(i=S.settingsValueAtom(e),r[0]=e,r[1]=i);let a=n(i);return Yr(e,a),Xr(a??Te,t)}function si(e){let t=(0,D.c)(4),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},t[0]=n):n=t[0];let r=w(S.mutateProviderInstance,n),i;return t[1]!==e||t[2]!==r?(i=(t,n)=>r({environmentId:e,input:{patch:n===void 0?{}:n,providerInstanceMutation:t}}),t[1]=e,t[2]=r,t[3]=i):i=t[3],i}function ci(e){let t=pr(),r=n(rt);return Yr(t?.environmentId??null,t?.serverConfig?.settings??null),Xr(r,e)}var li=`This setting is saved on a server, and the hosted app is not anchored to one. Change it from the desktop app or from the server's own address.`;function ui(){let e=(0,D.c)(2),t=pr(),n;return e[0]===t?n=e[1]:(n=t!==null||!et(),e[0]=t,e[1]=n),n}function di(e){let t=(0,D.c)(3),r=e!==void 0&&e,{environments:i}=lr(),a;return t[0]!==i||t[1]!==r?(a=y(e=>i.filter(ar).flatMap(t=>{let n=e(st.sessionStateAtom(t.environmentId));if(r&&n._tag===`Initial`)return[t.environmentId];let i=n._tag===`Failure`?null:m(d(n));return i!==null&&te(i,`settings:write`)?[t.environmentId]:[]})),t[0]=i,t[1]=r,t[2]=a):a=t[2],n(a)}function fi(e){let t=(0,D.c)(10);it(e,se);let n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={label:`server settings update`,reportFailure:!1},t[0]=n):n=t[0];let r=w(S.updateSettings,n),{environments:i}=lr(),a;t[1]!==i||t[2]!==r?(a=async e=>{let t=await r(e);if(t._tag===`Failure`&&!Je(t)){let n=i.find(t=>t.environmentId===e.environmentId)?.label??e.environmentId,r=Ze(t);x.add({type:`error`,title:`Setting not saved`,description:`Could not save on ${n}: ${r instanceof Error?r.message:`The save failed. Try reconnecting and saving again.`}`})}return t},t[1]=i,t[2]=r,t[3]=a):a=t[3];let o=a,s=di(!0),c;return t[4]!==e||t[5]!==i||t[6]!==r||t[7]!==o||t[8]!==s?(c=t=>{let{serverPatch:n,clientPatch:a}=zr(t),c=e===null||ce(n).every(t=>at(e,t));if(Object.keys(n).length>0&&!c&&x.add({type:`warning`,title:`Setting not saved`,description:`This connection lacks permission to change settings on ${i.find(t=>t.environmentId===e)?.label??`the selected environment`}.`}),Object.keys(n).length>0&&c){let{sharedPatch:t,localPatch:a}=rr(n),c=_i;if(Object.keys(a).length>0&&(e?o({environmentId:e,input:{patch:a}}):c()),Object.keys(t).length>0){let n=i.find(t=>t.environmentId===e)?.serverConfig?.settings,a=new Set(s);e&&a.add(e);let o=[],l=[];for(let r of a){let a=i.find(e=>e.environmentId===r),s=ir(t,a?.serverConfig?.environment.capabilities,a?.serverConfig?.settings,n,r===e);if(Object.keys(s).length!==0){if(ve.get(st.sessionStateAtom(r))._tag!==`Initial`&&!ce(t).every(e=>at(r,e))){l.push(a?.label??r);continue}o.push({environmentId:r,input:{patch:s}})}}o.length===0?c(l.length>0?`This connection lacks permission to change settings on ${l.join(`, `)}.`:a.size>0?`Update older servers to save this setting.`:void 0):Promise.all(o.map(async e=>({label:i.find(t=>t.environmentId===e.environmentId)?.label??e.environmentId,result:await r(e)}))).then(pi)}}Object.keys(a).length>0&&Ir(a)},t[4]=e,t[5]=i,t[6]=r,t[7]=o,t[8]=s,t[9]=c):c=t[9],c}function pi(e){let t=e.flatMap(gi);if(t.length===0)return;let n=e.filter(hi).map(mi);x.add({type:`error`,title:n.length>0?`Setting saved on some environments`:`Setting not saved`,description:[...t,...n.length>0?[`Saved on ${n.join(`, `)}.`]:[]].join(`
|
|
2
2
|
`)})}function mi(e){let{label:t}=e;return t}function hi(e){let{result:t}=e;return t._tag===`Success`}function gi(e){let{label:t,result:n}=e;if(n._tag!==`Failure`||Je(n))return[];let r=Ze(n);return[`Could not save on ${t}: ${r instanceof Error?r.message:`The save failed. Try reconnecting and saving again.`}`]}function _i(e){let t=e===void 0?li:e;return x.add({type:`warning`,title:`Setting not saved`,description:t})}function vi(e){return fi(e)}function yi(){return fi(pr()?.environmentId??null)}function bi(){return xi}function xi(e){return Ir(e)}export{It as $,hr as A,Bn as B,mr as C,pr as D,lr as E,Hn as F,Dn as G,cn as H,q as I,an as J,In as K,Gn as L,Zn as M,$n as N,dr as O,Qn as P,Pt as Q,qn as R,fr as S,gr as T,ln as U,W as V,Sn as W,Bt as X,Jt as Y,Rt as Z,ri as _,Ir as a,vi as b,Hr as c,ai as d,Lt as et,oi as f,ui as g,ci as h,qr as i,At as it,sr as j,vr as k,Wr as l,si as m,Vr as n,Ft as nt,Lr as o,Yr as p,on as q,Br as r,Dt as rt,Zr as s,li as t,zt as tt,$r as u,bi as v,_r as w,yi as x,ni as y,Kn as z};
|
|
3
|
-
//# sourceMappingURL=useSettings-
|
|
3
|
+
//# sourceMappingURL=useSettings-CF52Llff.js.map
|