@p4code/cli 0.9.8 → 0.9.10

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.
Files changed (303) hide show
  1. package/dist/bin.mjs +1 -1
  2. package/dist/{binCli-CLYknQ8Q.mjs → binCli-CYcCQdSE.mjs} +1901 -1664
  3. package/dist/client/.vite/manifest.json +2018 -2000
  4. package/dist/client/assets/{2NI2N5EU-D0DC_qzC.js → 2NI2N5EU-CTGx9SqE.js} +2 -2
  5. package/dist/client/assets/{4UO7MD6I-CUZSFvTG.js → 4UO7MD6I-BjVL6foo.js} +2 -2
  6. package/dist/client/assets/{5B3SVYGG-5ibYwkgG.js → 5B3SVYGG-Cs9CtCwM.js} +2 -2
  7. package/dist/client/assets/{5GK6JWQ2-DEtRbsDS.js → 5GK6JWQ2-uCqJ5b6P.js} +2 -2
  8. package/dist/client/assets/{5N7A7DKN-CwQP1dKj.js → 5N7A7DKN-D8xYxzg8.js} +2 -2
  9. package/dist/client/assets/{5OC2THR4-BriFYPQx.js → 5OC2THR4-B4_z8HL_.js} +2 -2
  10. package/dist/client/assets/{5S6HY5KT-BBNxENgt.js → 5S6HY5KT-BQM1ruT_.js} +2 -2
  11. package/dist/client/assets/{6IMQ5BUJ-xl7U-rLA.js → 6IMQ5BUJ-CkYA1m9F.js} +2 -2
  12. package/dist/client/assets/{6OLKWJ4F-BGGDxoUW.js → 6OLKWJ4F-B7EL2QRF.js} +2 -2
  13. package/dist/client/assets/{74OO7NKP-9vkDTl8T.js → 74OO7NKP-3i4AYzMo.js} +2 -2
  14. package/dist/client/assets/{75O6YZUN-B9ocscUs.js → 75O6YZUN-CFk80U2S.js} +2 -2
  15. package/dist/client/assets/{77XECAW3-DQ3S_7U7.js → 77XECAW3-DUjtpBc8.js} +2 -2
  16. package/dist/client/assets/{ABYRPUBD-DFu3UszL.js → ABYRPUBD-BobiH6Ib.js} +2 -2
  17. package/dist/client/assets/AlertDialogRoot-BDlDnUeW.js +2 -0
  18. package/dist/client/assets/{AnimatedHeight-DEH7bEtg.js → AnimatedHeight-Baj5Pa60.js} +2 -2
  19. package/dist/client/assets/{AuthSurfaceShell-DDlvsg4m.js → AuthSurfaceShell-PCmsqp7T.js} +2 -2
  20. package/dist/client/assets/{BB2UYUI2-DzdR7ZyB.js → BB2UYUI2-DnxMKjgT.js} +2 -2
  21. package/dist/client/assets/{BUM34MOA-LkeHTV8a.js → BUM34MOA-DNTynUxx.js} +2 -2
  22. package/dist/client/assets/{CEQABKGZ-BX1CWous.js → CEQABKGZ-veHxvA1u.js} +2 -2
  23. package/dist/client/assets/{CXAC5362-DMlUWuvv.js → CXAC5362-BynYY6uD.js} +2 -2
  24. package/dist/client/assets/ChatGptUsageButton-D-N8-zk6.js +2 -0
  25. package/dist/client/assets/ChatMarkdown-fdsQ0rQe.js +48 -0
  26. package/dist/client/assets/{CheckboxIndicator-DSA5Ujdj.js → CheckboxIndicator-CvUY7aCo.js} +2 -2
  27. package/dist/client/assets/{ClippedText-DlUFaCzw.js → ClippedText-Bz4usJaN.js} +2 -2
  28. package/dist/client/assets/CodexSetupSection.logic-lS_hYW7M.js +2 -0
  29. package/dist/client/assets/{ComboboxClear-DkaA60b7.js → ComboboxClear-BWxvz8Y9.js} +2 -2
  30. package/dist/client/assets/{ComboboxGroupLabel-AEuoHUH8.js → ComboboxGroupLabel-B9uepPCe.js} +2 -2
  31. package/dist/client/assets/{CommandBlock-BUHVWYBr.js → CommandBlock-BFdf6yDf.js} +2 -2
  32. package/dist/client/assets/{ComposerPromptEditor-zRTz5xec.js → ComposerPromptEditor--x6yGPiW.js} +11 -11
  33. package/dist/client/assets/{CompositeRoot-38NDvFsA.js → CompositeRoot-XnJ7Nzli.js} +2 -2
  34. package/dist/client/assets/{ConnectionDiagnosisDetails-WKkRENJB.js → ConnectionDiagnosisDetails-BiLziJiH.js} +2 -2
  35. package/dist/client/assets/{ConnectionStatusDot-B-U5Wv6b.js → ConnectionStatusDot-CpPwqzkK.js} +2 -2
  36. package/dist/client/assets/{DRLTVNUE-CNkbJcIE.js → DRLTVNUE-BOhroau_.js} +2 -2
  37. package/dist/client/assets/{DYY6UVD2-Csqmb0Yg.js → DYY6UVD2-Bpmvecid.js} +2 -2
  38. package/dist/client/assets/{DevicePanel-B3G_KDJN.js → DevicePanel-BgToYlYg.js} +2 -2
  39. package/dist/client/assets/{DeviceSetup-DqTJRSli.js → DeviceSetup-CJ3rjcDw.js} +2 -2
  40. package/dist/client/assets/{DialogTitle-Bz-7IYD8.js → DialogTitle-DdTujj5B.js} +2 -2
  41. package/dist/client/assets/{DiffCommentAnnotation-C3_yEiAB.js → DiffCommentAnnotation-BkAROMry.js} +2 -2
  42. package/dist/client/assets/{DiffFileTree-BJxoYt-I.js → DiffFileTree-ERgpSLaE.js} +2 -2
  43. package/dist/client/assets/DiffPanel-DwPk2swZ.js +2 -0
  44. package/dist/client/assets/{DiffWorkerPoolProvider-DPfZNt42.js → DiffWorkerPoolProvider-BrhQktrm.js} +3 -3
  45. package/dist/client/assets/{EmbeddedDesign-CsCt-RW1.js → EmbeddedDesign-DpSkJYii.js} +5 -5
  46. package/dist/client/assets/{EnvironmentMachineIcon-CKfntUmE.js → EnvironmentMachineIcon-BrGxJPP_.js} +2 -2
  47. package/dist/client/assets/{ExpandableText-DGu2RH_j.js → ExpandableText-auxbX5_6.js} +2 -2
  48. package/dist/client/assets/{FNOVOB4O-CH8BTfJM.js → FNOVOB4O-Mdzaj7g-.js} +2 -2
  49. package/dist/client/assets/{FieldControl-DAh0lUDV.js → FieldControl-DfaF5AW8.js} +2 -2
  50. package/dist/client/assets/{FileDiff-C1enHrMi.js → FileDiff-sbzjIw4Y.js} +2 -2
  51. package/dist/client/assets/{FilePreviewPanel-67DQ3_gp.js → FilePreviewPanel-BOnzRmKq.js} +4 -4
  52. package/dist/client/assets/{FoldedSettingsSection-CILGGC6I.js → FoldedSettingsSection-DN1s3P5h.js} +2 -2
  53. package/dist/client/assets/{FormContext-BdrDIRv0.js → FormContext-B_ZMFN7l.js} +2 -2
  54. package/dist/client/assets/{HDGCDEEZ-Ox1-cFjL.js → HDGCDEEZ-Ylftf3gZ.js} +2 -2
  55. package/dist/client/assets/{HSJLKHB7-BEBG51eo.js → HSJLKHB7-BQqIHFzA.js} +2 -2
  56. package/dist/client/assets/{Icons-C-FXpOud.js → Icons-BP6jlahF.js} +2 -2
  57. package/dist/client/assets/Input-B9nob0l2.js +2 -0
  58. package/dist/client/assets/JZOYTAAL-5fSSCfug.js +1 -0
  59. package/dist/client/assets/{K3MD6TGW-DhfhwRRq.js → K3MD6TGW-C-WMFQa2.js} +2 -2
  60. package/dist/client/assets/{K7RP3OMA-DdE8zx2_.js → K7RP3OMA-Bv01V4PC.js} +2 -2
  61. package/dist/client/assets/{KeybindingsSettings.logic-Ddu7cDVA.js → KeybindingsSettings.logic-CkmobJKX.js} +2 -2
  62. package/dist/client/assets/{LHDIQX7Q-_CTEfstz.js → LHDIQX7Q-NSQFT8t0.js} +2 -2
  63. package/dist/client/assets/{LUXOKEGN-BZTFKFlr.js → LUXOKEGN-URYU7c_t.js} +2 -2
  64. package/dist/client/assets/{MathTypeset-hiZgZUOa.js → MathTypeset-vloBebae.js} +2 -2
  65. package/dist/client/assets/{N3JZAHOW-CC607oJ3.js → N3JZAHOW-B9_qgeJe.js} +2 -2
  66. package/dist/client/assets/{NUIALGQ3-YZiFnb1D.js → NUIALGQ3-CgK-ZGa2.js} +2 -2
  67. package/dist/client/assets/{NoProjectsHero-BaAbresy.js → NoProjectsHero-Bkfsk4qc.js} +2 -2
  68. package/dist/client/assets/{O65XPQGZ-CJWG3hrr.js → O65XPQGZ-DcczmOOs.js} +2 -2
  69. package/dist/client/assets/{O7XIQ6OM-CO58SxOd.js → O7XIQ6OM-DBN8Ta1r.js} +2 -2
  70. package/dist/client/assets/{OFQON5FD-ZVCn5Afz.js → OFQON5FD-BAqD2M9W.js} +2 -2
  71. package/dist/client/assets/{P4ConnectAccountPages-nuGk_jH6.js → P4ConnectAccountPages-kTztZndM.js} +2 -2
  72. package/dist/client/assets/{P4ConnectSidebarSignIn-DMU_ZGur.js → P4ConnectSidebarSignIn-BLFNWeXr.js} +2 -2
  73. package/dist/client/assets/{PJQHF43J-Dyo99try.js → PJQHF43J-D1TwOPBO.js} +2 -2
  74. package/dist/client/assets/PanelLayoutControls-BL3qZRW6.js +216 -0
  75. package/dist/client/assets/{PierreEntryIcon-BGnGqbZS.js → PierreEntryIcon-CcaKUQ_5.js} +2 -2
  76. package/dist/client/assets/{PopoverHandle-BGTDdU32.js → PopoverHandle-Bf0PlJ6j.js} +2 -2
  77. package/dist/client/assets/PreviewPanel-CF9KdCOZ.js +2 -0
  78. package/dist/client/assets/{ProjectDefaultsSettings-B8-DHhbT.js → ProjectDefaultsSettings-DC9sqe1A.js} +2 -2
  79. package/dist/client/assets/ProjectFavicon-6uv-3a7b.js +3 -0
  80. package/dist/client/assets/{ProjectIconPickerDialog-D_7XapzM.js → ProjectIconPickerDialog-DrNrdWag.js} +2 -2
  81. package/dist/client/assets/{ProjectMonogram-BRycZjMZ.js → ProjectMonogram-BJooqIM-.js} +2 -2
  82. package/dist/client/assets/{ProviderAuthTerminal-ejODeZci.js → ProviderAuthTerminal-BdestvKT.js} +2 -2
  83. package/dist/client/assets/ProviderModelPicker-Dx26TqdI.js +2 -0
  84. package/dist/client/assets/{ProviderSettingsForm-TxiFYWfI.js → ProviderSettingsForm-B1ZiIcrJ.js} +2 -2
  85. package/dist/client/assets/PullRequestCodeTab-5JEE8HsL.js +6 -0
  86. package/dist/client/assets/{RHNBAITX-B2MpzGNB.js → RHNBAITX-AZ9q_QDP.js} +2 -2
  87. package/dist/client/assets/{ReadOnlySourcePreview-Clh1I7db.js → ReadOnlySourcePreview-CSK6ee05.js} +2 -2
  88. package/dist/client/assets/{RenderErrorBoundary-UQ8iqwRx.js → RenderErrorBoundary-ImTUJEbS.js} +3 -3
  89. package/dist/client/assets/{SLD4V6NK-DDlJ2xA8.js → SLD4V6NK-uXoZZAB2.js} +2 -2
  90. package/dist/client/assets/{ScheduledTasksSettings-VxM8-W1a.js → ScheduledTasksSettings-BDkh7pCI.js} +4 -4
  91. package/dist/client/assets/{ScopedSwitch-B9HsEBfG.js → ScopedSwitch-IyBzdLBa.js} +2 -2
  92. package/dist/client/assets/{ScrollAreaCorner-DaAMqe_x.js → ScrollAreaCorner-Bstf_gNQ.js} +2 -2
  93. package/dist/client/assets/{SecretInput-Dfsqp38C.js → SecretInput-BTBcl8SC.js} +2 -2
  94. package/dist/client/assets/{SelectScrollUpArrow-CBbON2Cr.js → SelectScrollUpArrow-BAwxXUi-.js} +2 -2
  95. package/dist/client/assets/SelfImproveSettingsSection-DGcoA36F.js +2 -0
  96. package/dist/client/assets/{SettingsPanels-D16J4fBs.js → SettingsPanels-BfzvtrNj.js} +7 -7
  97. package/dist/client/assets/{SettingsPanels.logic-DLPcHVw0.js → SettingsPanels.logic-xcOt84aX.js} +2 -2
  98. package/dist/client/assets/{SettingsScopeNotice-CLuK5ZOQ.js → SettingsScopeNotice-BSIkX2D-.js} +2 -2
  99. package/dist/client/assets/{SidebarStageBackdrop-Bgae69g1.js → SidebarStageBackdrop-D7me9VdP.js} +2 -2
  100. package/dist/client/assets/{T3PCR2KE-DQ6cSkUG.js → T3PCR2KE-B4buGw24.js} +2 -2
  101. package/dist/client/assets/{TKWO2OVW-DlInq0TH.js → TKWO2OVW-B2GIBRnj.js} +2 -2
  102. package/dist/client/assets/{TSHNXIZL-DL8cfasx.js → TSHNXIZL-CwVvoBmu.js} +2 -2
  103. package/dist/client/assets/{ThemeEditorPanel-Dhd_0CzC.js → ThemeEditorPanel-Z1t7Xzva.js} +2 -2
  104. package/dist/client/assets/ThreadTerminalDrawer-CnO3UVOq.js +5 -0
  105. package/dist/client/assets/{TooltipViewport-UaR0JZsl.js → TooltipViewport-CEOeTVyb.js} +2 -2
  106. package/dist/client/assets/{UQJE5E4I-WMwM-nEH.js → UQJE5E4I-Bzqu0vVG.js} +2 -2
  107. package/dist/client/assets/{USNYFO5S-D-mgcpxb.js → USNYFO5S-C4Z9b1ks.js} +2 -2
  108. package/dist/client/assets/{Virtualizer-CUj2Cqvm.js → Virtualizer-saguDIDi.js} +2 -2
  109. package/dist/client/assets/{WEVWDWVA-CiAqWYrx.js → WEVWDWVA-C5c2236d.js} +2 -2
  110. package/dist/client/assets/{WorkspaceBreadcrumb-D8GTBuA5.js → WorkspaceBreadcrumb-CQH9TmFi.js} +2 -2
  111. package/dist/client/assets/{WorkspacePageContainer-BKXvWv-9.js → WorkspacePageContainer-E5ZuTsSl.js} +2 -2
  112. package/dist/client/assets/{WorkspacePageHeader-zMZD9Zz8.js → WorkspacePageHeader-DGopnQZ2.js} +2 -2
  113. package/dist/client/assets/{X5RFHQXM-YS48_sFp.js → X5RFHQXM-NygNPjev.js} +2 -2
  114. package/dist/client/assets/{X62E3GBT-C444MNd3.js → X62E3GBT-qvvfx8FL.js} +2 -2
  115. package/dist/client/assets/{XBNEOJTC-0O1bjE8y.js → XBNEOJTC-DAgGRRGR.js} +2 -2
  116. package/dist/client/assets/{YHV2MVVZ-Coy_OiWg.js → YHV2MVVZ-PIsz4H0c.js} +2 -2
  117. package/dist/client/assets/{YURCZMG2-Lc2Tv_HR.js → YURCZMG2-CAQz8Kb8.js} +2 -2
  118. package/dist/client/assets/{YVG2LODB-CWUTdxUc.js → YVG2LODB-Crh6Gk8v.js} +2 -2
  119. package/dist/client/assets/_chat-BO5aRu-j.js +45 -0
  120. package/dist/client/assets/{_chat.design-CajRPBez.js → _chat.design-1RXhKj_3.js} +2 -2
  121. package/dist/client/assets/{_chat.index-OsM078CN.js → _chat.index-ij31rX59.js} +2 -2
  122. package/dist/client/assets/{_chat.new-BI8wuTGQ.js → _chat.new-QYOVVQAv.js} +2 -2
  123. package/dist/client/assets/_chat.pull-requests-B8-W4w8K.js +2 -0
  124. package/dist/client/assets/{alert-RktpFBv6.js → alert-CqueYfb9.js} +2 -2
  125. package/dist/client/assets/{assetUrls-COCOS1bm.js → assetUrls-5u2VAW_2.js} +2 -2
  126. package/dist/client/assets/assets-dVntMNKj.js +2 -0
  127. package/dist/client/assets/{browserHistoryStore-CBcm7bje.js → browserHistoryStore-AwPHr-9a.js} +2 -2
  128. package/dist/client/assets/{browserLinkTarget-D-M5yQc0.js → browserLinkTarget-CUvZuS7D.js} +2 -2
  129. package/dist/client/assets/{checkbox-vIS3kn6A.js → checkbox-BPr09F_k.js} +2 -2
  130. package/dist/client/assets/{color-picker-vozMHo5G.js → color-picker-roKqOkuS.js} +2 -2
  131. package/dist/client/assets/{combobox-CzEFd5LA.js → combobox-CEzOq8mg.js} +2 -2
  132. package/dist/client/assets/{command-CLf9yckl.js → command-i_eKJj3B.js} +2 -2
  133. package/dist/client/assets/{connect-agent-BUjhhqbv.js → connect-agent-BJCTM1nf.js} +2 -2
  134. package/dist/client/assets/{connect-BoLhf5rG.js → connect-wndN2LD9.js} +2 -2
  135. package/dist/client/assets/{design-LeaOcSZl.js → design-Cve-RO6N.js} +2 -2
  136. package/dist/client/assets/device-ZhgWJyBN.js +2 -0
  137. package/dist/client/assets/{dialog-B69qrNtB.js → dialog-CKG1aUT3.js} +2 -2
  138. package/dist/client/assets/{diffRendering-DU37Uneg.js → diffRendering-Dyda4rX5.js} +2 -2
  139. package/dist/client/assets/{dist-CtnQm06p.js → dist-DP18jjts.js} +3 -3
  140. package/dist/client/assets/{draft-input-BUsvwNIU.js → draft-input-DvNQZghL.js} +2 -2
  141. package/dist/client/assets/{duoViewer-CPd6U9x5.js → duoViewer-BnfAzuzK.js} +2 -2
  142. package/dist/client/assets/{dynamic-DDiw9bBP.js → dynamic-DXn8DtfU.js} +2 -2
  143. package/dist/client/assets/{embeddedScripts-DjnGPWZd.js → embeddedScripts-BMILAsdP.js} +2 -2
  144. package/dist/client/assets/{empty-B1FuCXoG.js → empty-D6SdnsPw.js} +2 -2
  145. package/dist/client/assets/entities-DCgQUDZp.js +2 -0
  146. package/dist/client/assets/{fileLinks-DzCsEQpS.js → fileLinks-BlBUc4i_.js} +2 -2
  147. package/dist/client/assets/{fileTreeExpansion-eHhwnC6l.js → fileTreeExpansion-B8yevc-B.js} +2 -2
  148. package/dist/client/assets/{getDiffFileInput-eC26FmPf.js → getDiffFileInput-dJd1H35Q.js} +2 -2
  149. package/dist/client/assets/{guideRunStore-CugTzRRn.js → guideRunStore-DksWd_Oc.js} +2 -2
  150. package/dist/client/assets/{htmlRender-CcVnPpcS.js → htmlRender-hlYiIm7u.js} +2 -2
  151. package/dist/client/assets/{index-CZlF3wQ9.js → index-Bxk_RxGw.js} +3 -3
  152. package/dist/client/assets/{input-group-CevCumL6.js → input-group-APyqVexM.js} +2 -2
  153. package/dist/client/assets/{input-D8R-9BO3.js → input-yNgBXsRj.js} +2 -2
  154. package/dist/client/assets/{kbd-Fy-v90ND.js → kbd-Cr4XEhSh.js} +2 -2
  155. package/dist/client/assets/{keybindings-DMghyE3A.js → keybindings-hzk4_Sgu.js} +2 -2
  156. package/dist/client/assets/{lazy-BA6aXmZc.js → lazy-DILJj7Gd.js} +4 -4
  157. package/dist/client/assets/{lazyRouteComponent-DVNAnyiv.js → lazyRouteComponent-tnhWsSYX.js} +2 -2
  158. package/dist/client/assets/{link-ci_EPfAz.js → link-CmpZDWcG.js} +2 -2
  159. package/dist/client/assets/{linkedPrompt-CPHt2jcO.js → linkedPrompt-CE3amDef.js} +2 -2
  160. package/dist/client/assets/main-CVSzIqPv.js +37 -0
  161. package/dist/client/assets/{mediaReference-CZmbKByR.js → mediaReference-DMJ5Zay3.js} +2 -2
  162. package/dist/client/assets/{mediaSource-DX6oP8x9.js → mediaSource-UIArIbzY.js} +2 -2
  163. package/dist/client/assets/{number-field-CmK8oJMM.js → number-field-DcRWl9B0.js} +2 -2
  164. package/dist/client/assets/{observeResize-YxzDUnDW.js → observeResize-DjqKtKLK.js} +2 -2
  165. package/dist/client/assets/{onboarding-eClefFKp.js → onboarding-pqbI8W1U.js} +2 -2
  166. package/dist/client/assets/openFileInPreview-x34grdQ6.js +2 -0
  167. package/dist/client/assets/{p4ProjectFile-BC2tSEs4.js → p4ProjectFile-xLwkLebE.js} +2 -2
  168. package/dist/client/assets/{pair-BUZJqgA1.js → pair-C4lVdDUz.js} +2 -2
  169. package/dist/client/assets/{pendingSendStore-C5UcT8R0.js → pendingSendStore-BoFRcmy5.js} +2 -2
  170. package/dist/client/assets/{phoneViewer-fmWF20qy.js → phoneViewer-Cotavx5y.js} +2 -2
  171. package/dist/client/assets/{pierre-icons-DlYshDSm.js → pierre-icons-CBskVugi.js} +2 -2
  172. package/dist/client/assets/{popover-CtJuJW_f.js → popover-DVeZET9D.js} +2 -2
  173. package/dist/client/assets/{preview-D-Cm6hTR.js → preview-Bw-Ffmn4.js} +2 -2
  174. package/dist/client/assets/{preview-DtLn0r5X.js → preview-oweHYD4S.js} +2 -2
  175. package/dist/client/assets/{previewMiniPlayerStore-BQgCK2RM.js → previewMiniPlayerStore-DrP4x3Ce.js} +2 -2
  176. package/dist/client/assets/primary-CIcP7bEP.js +2 -0
  177. package/dist/client/assets/primaryCloudLinkState-Dwi-D0I7.js +2 -0
  178. package/dist/client/assets/projectFilesQueryState-02nlfyzQ.js +2 -0
  179. package/dist/client/assets/{projectScriptEditor-CwMYFrgO.js → projectScriptEditor-CIDcf-KL.js} +2 -2
  180. package/dist/client/assets/{providerSkills-DRtgduYo.js → providerSkills-DTVLY34_.js} +2 -2
  181. package/dist/client/assets/{pullRequestDetail.logic-CqcRjGbR.js → pullRequestDetail.logic-BLe7zsLi.js} +4 -4
  182. package/dist/client/assets/{pullRequestIcons-Bk_-BZhA.js → pullRequestIcons-DyEIFm1n.js} +2 -2
  183. package/dist/client/assets/{pullRequestReviewStore-Br0qNCn2.js → pullRequestReviewStore-B55CEHY9.js} +2 -2
  184. package/dist/client/assets/pullRequests-mcrrz3SF.js +2 -0
  185. package/dist/client/assets/queries-ByCVdESa.js +2 -0
  186. package/dist/client/assets/query-D-IVadFI.js +2 -0
  187. package/dist/client/assets/{radio-group-CQTaM9n2.js → radio-group-DIOJb--u.js} +2 -2
  188. package/dist/client/assets/{renderScheduler-fJB2sQwM.js → renderScheduler-CNepEPa2.js} +2 -2
  189. package/dist/client/assets/{rightPanelStore-C5nnGDev.js → rightPanelStore-CRQRe1Cp.js} +2 -2
  190. package/dist/client/assets/runtime-CZnPVuwS.js +3 -0
  191. package/dist/client/assets/runtime-DEFP_0P0.js +6 -0
  192. package/dist/client/assets/{runtimeModeConfig-Htoh7tJb.js → runtimeModeConfig-BAFMgMrE.js} +2 -2
  193. package/dist/client/assets/{scheduledTasksSettings.logic-DRYrMw8R.js → scheduledTasksSettings.logic-CTJ1Zr8Z.js} +3 -3
  194. package/dist/client/assets/{scroll-area-DJaTwtcr.js → scroll-area-DTOm0CbX.js} +2 -2
  195. package/dist/client/assets/{select-BFALokxW.js → select-CML8G0wN.js} +2 -2
  196. package/dist/client/assets/{selfImproveFindings-H2XgphDi.js → selfImproveFindings-DuRaHmql.js} +2 -2
  197. package/dist/client/assets/server-BuS35bSu.js +2 -0
  198. package/dist/client/assets/session-DIw-RcNy.js +2 -0
  199. package/dist/client/assets/session-logic-B5D2SdWr.js +26 -0
  200. package/dist/client/assets/{settings-BkLvGwfm.js → settings-CTpjG14a.js} +2 -2
  201. package/dist/client/assets/{settings.appearance-OuApP6hX.js → settings.appearance-Cq56uRT4.js} +2 -2
  202. package/dist/client/assets/settings.archived-D2NDpNIY.js +2 -0
  203. package/dist/client/assets/{settings.computer-use-DbtSE70m.js → settings.computer-use-J2r1Wt55.js} +2 -2
  204. package/dist/client/assets/settings.connections-DDjl99g3.js +2 -0
  205. package/dist/client/assets/{settings.data-controls-DqM0dqdr.js → settings.data-controls-Kotba8vC.js} +2 -2
  206. package/dist/client/assets/settings.decisions-DghPRQ02.js +2 -0
  207. package/dist/client/assets/{settings.designs-BIB7y5ry.js → settings.designs-D-0dwYo4.js} +2 -2
  208. package/dist/client/assets/settings.diagnostics-C1H_Oj2r.js +2 -0
  209. package/dist/client/assets/{settings.general-D73jxwiz.js → settings.general-c-32Nudd.js} +2 -2
  210. package/dist/client/assets/settings.integrations-BBvK_SX4.js +2 -0
  211. package/dist/client/assets/{settings.keybindings-DMI2SOqT.js → settings.keybindings-BIfUzprR.js} +2 -2
  212. package/dist/client/assets/{settings.open-source-licenses-QRv0v3-V.js → settings.open-source-licenses-wmlqchzJ.js} +2 -2
  213. package/dist/client/assets/settings.plugins-C1PnlzX1.js +5 -0
  214. package/dist/client/assets/{settings.projects-r-irj-Zr.js → settings.projects-BmJITbPY.js} +4 -4
  215. package/dist/client/assets/settings.providers-ELxTJwWk.js +3 -0
  216. package/dist/client/assets/{settings.scheduled-tasks-RWniN8Lw.js → settings.scheduled-tasks-BGGcs-KK.js} +2 -2
  217. package/dist/client/assets/{settings.snap-shot-D6hiK4XK.js → settings.snap-shot-CvbNcoJx.js} +2 -2
  218. package/dist/client/assets/{settings.source-control-GPOjx565.js → settings.source-control-k2lVK3Ho.js} +2 -2
  219. package/dist/client/assets/{settings.storage-CZsmFyZ8.js → settings.storage-CxA7PNjV.js} +2 -2
  220. package/dist/client/assets/settingsLayout-BWJVQUbK.js +3 -0
  221. package/dist/client/assets/{sidebar-BDFu5cf2.js → sidebar-DMJE0zUg.js} +2 -2
  222. package/dist/client/assets/{sidebarProjectGrouping-CURnoavN.js → sidebarProjectGrouping-CPb438r8.js} +2 -2
  223. package/dist/client/assets/{skeleton-CIpn5ufH.js → skeleton-eiJFH0l9.js} +2 -2
  224. package/dist/client/assets/{sourceControl-DjMIOzv1.js → sourceControl-DzD_N8hv.js} +2 -2
  225. package/dist/client/assets/{sourceControlClients-C2uvUFSM.js → sourceControlClients-BG_kFh61.js} +2 -2
  226. package/dist/client/assets/{spinner-t32AzjJr.js → spinner-H4tz4lLc.js} +2 -2
  227. package/dist/client/assets/{terminal-links-D6dqW3h9.js → terminal-links-D7Hzce_h.js} +2 -2
  228. package/dist/client/assets/{terminalSessions-DoRkjVz9.js → terminalSessions-BxTpBnAL.js} +2 -2
  229. package/dist/client/assets/{textarea-EVmRNBWL.js → textarea-CkmpNgx5.js} +2 -2
  230. package/dist/client/assets/{themePalette-01TQqdkx.js → themePalette-pZ7Ys_kT.js} +3 -3
  231. package/dist/client/assets/toast-rcFdQept.js +2 -0
  232. package/dist/client/assets/{toggle-Dqrwe7LT.js → toggle-BDixfqRe.js} +2 -2
  233. package/dist/client/assets/{toggle-group-DS75Gx6B.js → toggle-group-DV__8G6T.js} +2 -2
  234. package/dist/client/assets/{tooltip-B1rLXiVx.js → tooltip-DsRaXpYk.js} +2 -2
  235. package/dist/client/assets/{uiStateStore-_K2mvZYL.js → uiStateStore-DKTSAGd0.js} +2 -2
  236. package/dist/client/assets/{usage-DwGF-B0Q.js → usage-C-EgFB5m.js} +2 -2
  237. package/dist/client/assets/{usageAccess-YanE4PaX.js → usageAccess-BXUmTDe1.js} +2 -2
  238. package/dist/client/assets/{usageFormat-Bgm6YXnR.js → usageFormat-xrTYBhxI.js} +2 -2
  239. package/dist/client/assets/{usageShortcuts-D6H92HUx.js → usageShortcuts-CQcKqXkw.js} +2 -2
  240. package/dist/client/assets/{use-atom-command-BT7sz8Lx.js → use-atom-command-BETKz9Hv.js} +2 -2
  241. package/dist/client/assets/{useAriaLabelledBy-CCDZPAYX.js → useAriaLabelledBy-DVTboZ71.js} +2 -2
  242. package/dist/client/assets/useHandleNewThread-BoN4NqHy.js +2 -0
  243. package/dist/client/assets/{useLocation-CDlqpnf6.js → useLocation--dLSTvwv.js} +2 -2
  244. package/dist/client/assets/{useNavigate-mNhNGdvJ.js → useNavigate-DAhzXpNZ.js} +2 -2
  245. package/dist/client/assets/{useNavigateBack-zj9tpAPV.js → useNavigateBack-ClmMPFha.js} +2 -2
  246. package/dist/client/assets/{useP4ConnectAuthPrompt-CkJyw_jV.js → useP4ConnectAuthPrompt-BXoWBt0U.js} +2 -2
  247. package/dist/client/assets/{useParams-CZ_VOC6E.js → useParams-D_0yPfYl.js} +2 -2
  248. package/dist/client/assets/{usePermissionStatus-DFE8UnJC.js → usePermissionStatus-BGxDZxHH.js} +2 -2
  249. package/dist/client/assets/{usePullRequestActions-CVcuaade.js → usePullRequestActions-D0-24Gox.js} +2 -2
  250. package/dist/client/assets/{useRegisterFieldControl-gW7DDA6v.js → useRegisterFieldControl-DnspXZl4.js} +2 -2
  251. package/dist/client/assets/{useScopedModelAvailability-BCNsRHrC.js → useScopedModelAvailability-C44gQf2k.js} +2 -2
  252. package/dist/client/assets/useSettings-4JwtKUFC.js +3 -0
  253. package/dist/client/assets/utils-D19Exirm.js +37 -0
  254. package/dist/client/assets/vcsRefInvalidation-aUafFWy3.js +2 -0
  255. package/dist/client/assets/{welcome-CfpSLEhO.js → welcome-DORffgtg.js} +2 -2
  256. package/dist/client/index.html +1 -1
  257. package/dist/{renderer-B3Ia4LBS.mjs → renderer-DNRW9Bfa.mjs} +2 -2
  258. package/dist/{runtime-DvE0t3kv.mjs → runtime-KPwu-Er9.mjs} +89 -3
  259. package/package.json +1 -1
  260. package/dist/client/assets/AlertDialogRoot-Dxu9crTa.js +0 -2
  261. package/dist/client/assets/ChatGptUsageButton-CXEX1qrn.js +0 -2
  262. package/dist/client/assets/ChatMarkdown-yTbjRmgo.js +0 -48
  263. package/dist/client/assets/CodexSetupSection.logic-D3odRubx.js +0 -2
  264. package/dist/client/assets/DiffPanel-Bfxdj8td.js +0 -2
  265. package/dist/client/assets/Input-DWhR3WLZ.js +0 -2
  266. package/dist/client/assets/JZOYTAAL-K5yyV5fj.js +0 -1
  267. package/dist/client/assets/PanelLayoutControls-CwJW9Vo-.js +0 -216
  268. package/dist/client/assets/PreviewPanel-C914U2vc.js +0 -2
  269. package/dist/client/assets/ProjectFavicon-Bnd4lTxL.js +0 -3
  270. package/dist/client/assets/ProviderModelPicker-BigVoJfZ.js +0 -2
  271. package/dist/client/assets/PullRequestCodeTab-D99_acmK.js +0 -6
  272. package/dist/client/assets/ThreadTerminalDrawer-Bga-TMJR.js +0 -5
  273. package/dist/client/assets/_chat-BWNTWBCr.js +0 -45
  274. package/dist/client/assets/_chat.pull-requests-Alx1g9Xh.js +0 -2
  275. package/dist/client/assets/assets-B36wSN1M.js +0 -2
  276. package/dist/client/assets/device-D9IuUJmU.js +0 -2
  277. package/dist/client/assets/entities-Cd_YDhEa.js +0 -2
  278. package/dist/client/assets/main-om7hc1qE.js +0 -37
  279. package/dist/client/assets/openFileInPreview-H9M5FxLy.js +0 -2
  280. package/dist/client/assets/primary-CuSE-Dwp.js +0 -2
  281. package/dist/client/assets/primaryCloudLinkState-BsKyx6nh.js +0 -2
  282. package/dist/client/assets/projectFilesQueryState-FiXJc2AO.js +0 -2
  283. package/dist/client/assets/pullRequests-C9YbqDXl.js +0 -2
  284. package/dist/client/assets/queries-DMkaYL1H.js +0 -2
  285. package/dist/client/assets/query-B1dBedyO.js +0 -2
  286. package/dist/client/assets/runtime-B6yGAVz4.js +0 -6
  287. package/dist/client/assets/runtime-BhGr1QCf.js +0 -3
  288. package/dist/client/assets/server-Dc9414wM.js +0 -2
  289. package/dist/client/assets/session-B6T_Arzf.js +0 -2
  290. package/dist/client/assets/session-logic-BaSoFnqy.js +0 -26
  291. package/dist/client/assets/settings.archived-DLycLGH2.js +0 -2
  292. package/dist/client/assets/settings.connections-D8EmrGJK.js +0 -2
  293. package/dist/client/assets/settings.decisions-BNBjCRqL.js +0 -2
  294. package/dist/client/assets/settings.diagnostics-CZPZhIn-.js +0 -2
  295. package/dist/client/assets/settings.integrations-Vq3IT0_R.js +0 -2
  296. package/dist/client/assets/settings.plugins-Ddb8m4nE.js +0 -5
  297. package/dist/client/assets/settings.providers-Ce4kHZsP.js +0 -3
  298. package/dist/client/assets/settingsLayout-CthOqZyP.js +0 -3
  299. package/dist/client/assets/toast-UFTwkJWj.js +0 -2
  300. package/dist/client/assets/useHandleNewThread-nNF3Xnbt.js +0 -2
  301. package/dist/client/assets/useSettings-BAP_yCCK.js +0 -3
  302. package/dist/client/assets/utils-Dv1DrWoz.js +0 -37
  303. package/dist/client/assets/vcsRefInvalidation-BI3mMuIW.js +0 -2
@@ -1,2 +0,0 @@
1
- import{a as e,r as t,t as n}from"./react-BUfh6y28.js";import{n as r,t as i}from"./jsx-runtime-DJeoFXNw.js";import{Bm as a,Co as o,D as s,Ga as c,Gi as l,Gp as u,Ha as d,Hi as f,Jy as p,Kd as m,Ki as h,Ld as g,Lm as _,Lr as v,Ma as y,Mo as b,Oa as x,Oo as S,Pr as C,Qs as w,Sa as T,Va as E,Wa as D,Wu as O,aa as ee,ba as k,bt as te,db as A,di as j,dr as M,fa as N,gl as ne,ha as P,ia as F,id as re,ji as I,jo as L,jr as ie,kb as ae,ko as oe,la as R,ma as z,pa as se,pr as ce,qf as le,rh as ue,sa as B,sb as V,t as H,ua as U,wa as de,wi as fe,wo as W,ya as pe,yu as me,za as he,zd as ge}from"./utils-Dv1DrWoz.js";import{jn as _e}from"./runtime-B6yGAVz4.js";import{S as ve,d as ye,f as be,l as G,m as xe,u as Se}from"./TooltipViewport-UaR0JZsl.js";import{t as Ce}from"./spinner-t32AzjJr.js";import{t as we}from"./useParams-CZ_VOC6E.js";var Te=ae(ne),Ee=ae(me);function De(e){return Ee(e)&&(e.reason===`thread_not_empty`||e.reason===`thread_not_side_chat`)}function Oe(e){return Te(e)&&e.bootstrapThreadDisposition===`deleted`}function ke(e){return Te(e)&&e.bootstrapThreadDisposition===`not-created`}var Ae=[/\bSocketCloseError\b/i,/\bSocketOpenError\b/i,/\bSocket is not connected\b/i,/Unable to connect to the P4 server WebSocket\./i,RegExp(`\\b(?:is not connected|disconnected|stopped responding|could not establish a WebSocket connection)\\.(?: ${(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`))(_e)})?$`,`i`),/\bClientProtocolError\b/i,/\bRpcClientError\b/i,/\bping timeout\b/i];function je(e){if(typeof e!=`string`)return!1;let t=e.trim();return t.length!==0&&Ae.some(e=>e.test(t))}function Me(e){return je(e)?null:e??null}var K=e(n()),Ne=K.createContext(void 0);function Pe(){let e=K.useContext(Ne);if(!e)throw Error(b(73));return e}var Fe=0;function Ie(e){return Fe+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${Fe}`}function Le(e,t){if(typeof e==`string`)return{description:e};if(typeof e==`function`){let n=e(t);return typeof n==`string`?{description:n}:n}return e}function Re(e){let t=new Map,n=0,r=0;return e.forEach((e,i)=>{let a=e.transitionStatus===`ending`;t.set(e.id,{value:e,domIndex:i,visibleIndex:a?-1:n,offsetY:r}),r+=e.height||0,a||(n+=1)}),t}var ze=e=>e.toastMetadata,q={toasts:I(e=>e.toasts),isEmpty:I(e=>e.toasts.length===0),toast:I(ze,(e,t)=>e.get(t)?.value),toastIndex:I(ze,(e,t)=>e.get(t)?.domIndex??-1),toastOffsetY:I(ze,(e,t)=>e.get(t)?.offsetY??0),toastVisibleIndex:I(ze,(e,t)=>e.get(t)?.visibleIndex??-1),hovering:I(e=>e.hovering),focused:I(e=>e.focused),expanded:I(e=>e.hovering||e.focused),expandedOrOutOfFocus:I(e=>e.hovering||e.focused||!e.isWindowFocused),prevFocusElement:I(e=>e.prevFocusElement)},Be=class extends fe{timers=new Map;areTimersPaused=!1;constructor(e){super({...e,toastMetadata:Re(e.toasts)},{},q)}setFocused(e){this.set(`focused`,e)}setHovering(e){this.set(`hovering`,e)}setIsWindowFocused(e){this.set(`isWindowFocused`,e)}setPrevFocusElement(e){this.set(`prevFocusElement`,e)}setViewport=e=>{this.set(`viewport`,e)};disposeEffect=()=>()=>{this.timers.forEach(e=>{e.timeout?.clear()}),this.timers.clear()};removeToast(e,t={}){let n=q.toastIndex(this.state,e);if(n===-1)return;let r=this.state.toasts[n];t.skipOnRemove||r?.onRemove?.();let i=[...this.state.toasts];i.splice(n,1),this.setToasts(i)}addToast=e=>{let{timeout:t,limit:n}=this.state,r=e.id||Ie(`toast`);if(e.id){let t=q.toast(this.state,e.id);if(t){if(t.transitionStatus===`ending`)this.removeToast(e.id,{skipOnRemove:!0});else{let{id:t,transitionStatus:n,...r}=e;return this.updateToastInternal(e.id,r,{resetTimer:!0,markUpdated:!0}),e.id}}}let i={...e,id:r,updateKey:0,transitionStatus:`starting`},a=[i,...this.state.toasts],o=a.filter(e=>e.transitionStatus!==`ending`);if(o.length>n){let e=o.length-n,t=o.slice(-e),r=new Set(t.map(e=>e.id));this.setToasts(a.map(e=>{let t=r.has(e.id);return e.limited===t?e:{...e,limited:t}}))}else this.setToasts(a.map(e=>e.limited?{...e,limited:!1}:e));let s=i.timeout??t;return i.type!==`loading`&&s>0&&this.scheduleTimer(r,s,()=>this.closeToast(r)),q.expandedOrOutOfFocus(this.state)&&this.pauseTimers(),r};updateToast=(e,t)=>{this.updateToastInternal(e,t,{markUpdated:!0})};updateToastInternal=(e,t,n={})=>{let{timeout:r,toasts:i}=this.state,a=q.toast(this.state,e)??null;if(!a||a.transitionStatus===`ending`)return;let o={...a,...t,...n.markUpdated&&{updateKey:(a.updateKey??0)+1}};this.setToasts(i.map(t=>t.id===e?o:t));let s=o.timeout??r,c=a?.timeout??r,l=Object.hasOwn(t,`timeout`),u=o.transitionStatus!==`ending`&&o.type!==`loading`&&s>0,d=this.timers.has(e),f=c!==s,p=a?.type===`loading`;if(!u&&d)this.timers.get(e)?.timeout?.clear(),this.timers.delete(e);else if(u&&(!d||f||l||p||n.resetTimer)){let t=this.timers.get(e);t&&(t.timeout?.clear(),this.timers.delete(e)),this.scheduleTimer(e,s,()=>this.closeToast(e)),q.expandedOrOutOfFocus(this.state)&&this.pauseTimers()}};closeToast=e=>{let t=e===void 0,{limit:n,toasts:r}=this.state,i;if(t)i=r,this.timers.forEach(e=>{e.timeout?.clear()}),this.timers.clear();else{let t=q.toast(this.state,e);if(!t)return;i=[t];let n=this.timers.get(e);n?.timeout&&(n.timeout.clear(),this.timers.delete(e))}let a=0,o=r.map(r=>{if(t||r.id===e)return{...r,transitionStatus:`ending`,height:0};if(r.transitionStatus===`ending`)return r;let i=a>=n;return a+=1,r.limited===i?r:{...r,limited:i}}),s={toasts:o,toastMetadata:Re(o)};(t||r.length===1)&&(s.hovering=!1,s.focused=!1),this.update(s),i.forEach(e=>{e.transitionStatus!==`ending`&&e.onClose?.()}),this.handleFocusManagement(e)};promiseToast=(e,t)=>{let n=Le(t.loading),r=this.addToast({...n,type:`loading`}),i=e.then(e=>{let n=Le(t.success,e);return this.updateToast(r,{...n,type:`success`,timeout:n.timeout}),e}).catch(e=>{let n=Le(t.error,e);return this.updateToast(r,{...n,type:`error`,timeout:n.timeout}),Promise.reject(e)});return{}.hasOwnProperty.call(t,`setPromise`)&&t.setPromise(i),i};pauseTimers(){this.areTimersPaused||(this.areTimersPaused=!0,this.timers.forEach(e=>{if(e.timeout){e.timeout.clear();let t=Date.now()-e.start,n=e.delay-t;e.remaining=n>0?n:0}}))}resumeTimers(){this.areTimersPaused&&(this.areTimersPaused=!1,this.timers.forEach((e,t)=>{e.remaining=e.remaining>0?e.remaining:e.delay,e.timeout??=pe.create(),e.timeout.start(e.remaining,()=>{this.timers.delete(t),e.callback()}),e.start=Date.now()}))}restoreFocusToPrevElement(){this.state.prevFocusElement?.focus({preventScroll:!0})}handleDocumentPointerDown=e=>{if(e.pointerType!==`touch`)return;let t=P(e);z(this.state.viewport,t)||(this.resumeTimers(),this.update({hovering:!1,focused:!1}))};scheduleTimer(e,t,n){let r=Date.now(),i=!q.expandedOrOutOfFocus(this.state),a=i?pe.create():void 0;a?.start(t,()=>{this.timers.delete(e),n()}),this.timers.set(e,{timeout:a,start:i?r:0,delay:t,remaining:t,callback:n})}setToasts(e){let t={toasts:e,toastMetadata:Re(e)};e.length===0&&(t.hovering=!1,t.focused=!1),this.update(t)}handleFocusManagement(e){let t=se(B(this.state.viewport));if(!this.state.viewport||!z(this.state.viewport,t)||!N(t))return;if(e===void 0){this.restoreFocusToPrevElement();return}let n=q.toasts(this.state),r=q.toastIndex(this.state,e),i=null,a=r+1;for(;a<n.length;){if(n[a].transitionStatus!==`ending`){i=n[a];break}a+=1}if(!i)for(a=r-1;a>=0;){if(n[a].transitionStatus!==`ending`){i=n[a];break}--a}i?i.ref?.current?.focus():this.restoreFocusToPrevElement()}},J=e(i()),Ve=function(e){let{children:t,timeout:n=5e3,limit:r=3,toastManager:i}=e,a=L(()=>new Be({timeout:n,limit:r,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return x(a.disposeEffect),K.useEffect(function(){if(i)return i[` subscribe`](({action:e,options:t})=>{let n=t.id;e===`promise`&&t.promise?a.promiseToast(t.promise,t):e===`update`&&n?a.updateToast(n,t):e===`close`?a.closeToast(n):a.addToast(t)})},[a,i]),a.useSyncedValues({timeout:n,limit:r}),(0,J.jsx)(Ne.Provider,{value:a,children:t})},He=function(e){return e.frontmostHeight=`--toast-frontmost-height`,e}({}),Ue=K.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,s=Pe(),c=k(),l=K.useRef(!1),u=K.useRef(!1),d=K.useRef(!1),f=s.useState(`isEmpty`),p=s.useState(`toasts`),m=s.useState(`focused`),h=s.useState(`expanded`),g=s.useState(`prevFocusElement`),_=p[0]?.height??0,v=K.useMemo(()=>p.some(e=>e.transitionStatus===`ending`),[p]),y=K.useMemo(()=>p.filter(e=>e.priority===`high`),[p]);K.useEffect(()=>{let e=s.state.viewport;if(!e)return;function t(t){f||t.key===`F6`&&P(t)!==e&&(t.preventDefault(),s.setPrevFocusElement(se(B(e))),e?.focus({preventScroll:!0}),s.pauseTimers(),s.setFocused(!0))}let n=D(e);return U(n,`keydown`,t)},[s,f]),K.useEffect(()=>{let e=s.state.viewport;if(!e||f)return;let t=D(e);function n(e){P(e)===t&&(s.setIsWindowFocused(!1),s.pauseTimers())}function r(n){if(n.relatedTarget)return;let r=P(n),i=se(B(e));r!==t&&z(e,r)&&N(i)||s.resumeTimers(),c.start(0,()=>s.setIsWindowFocused(!0))}return R(U(t,`blur`,n,!0),U(t,`focus`,r,!0))},[s,c,f]),K.useEffect(()=>{let e=s.state.viewport;if(!e||f)return;let t=B(e);return U(t,`pointerdown`,s.handleDocumentPointerDown,!0)},[f,s]);function b(e){let t=s.state.viewport;t&&(l.current=!0,e.relatedTarget===t?p[0]?.ref?.current?.focus():s.restoreFocusToPrevElement())}function x(e){e.key===`Tab`&&e.shiftKey&&P(e.nativeEvent)===s.state.viewport&&(e.preventDefault(),s.restoreFocusToPrevElement(),s.resumeTimers())}function S(){let e=s.state.toasts.some(e=>e.transitionStatus===`ending`);s.state.isWindowFocused&&!e&&!d.current&&u.current&&(s.resumeTimers(),s.setHovering(!1),u.current=!1)}K.useEffect(S,[v,s]);function C(){s.pauseTimers(),s.setHovering(!0),u.current=!1}function w(){v||d.current?u.current=!0:(s.resumeTimers(),s.setHovering(!1))}function T(e){e.pointerType===`touch`&&(d.current=!0)}function E(e){e.pointerType===`touch`&&(d.current=!1,S())}function O(){l.current?l.current=!1:m||N(se(B(s.state.viewport)))&&(s.setFocused(!0),s.pauseTimers())}function te(e){m&&!z(s.state.viewport,e.relatedTarget)&&(s.setFocused(!1),s.resumeTimers())}let A={tabIndex:-1,role:`region`,"aria-live":`polite`,"aria-atomic":!1,"aria-relevant":`additions text`,"aria-label":`Notifications`,onMouseEnter:C,onMouseMove:C,onMouseLeave:w,onFocus:O,onBlur:te,onKeyDown:x,onClick:O,onPointerDown:T,onPointerUp:E,onPointerCancel:E},j={expanded:h},M=W(`div`,e,{ref:[t,s.setViewport],state:j,props:[A,{style:{[He.frontmostHeight]:_?`${_}px`:void 0}},o,{children:(0,J.jsxs)(K.Fragment,{children:[!f&&g&&(0,J.jsx)(F,{onFocus:b}),a,!f&&g&&(0,J.jsx)(F,{onFocus:b})]})}]});return(0,J.jsxs)(K.Fragment,{children:[!f&&g&&(0,J.jsx)(F,{onFocus:b}),M,!m&&y.length>0&&(0,J.jsx)(`div`,{style:ee,children:y.map(e=>(0,J.jsxs)(`div`,{role:`alert`,"aria-atomic":!0,children:[(0,J.jsx)(`div`,{children:e.title}),(0,J.jsx)(`div`,{children:e.description})]},e.id))})]})}),We=e(de()),Ge=K.createContext(void 0);function Ke(){let e=K.useContext(Ge);if(!e)throw Error(b(66));return e}var Y=function(e){return e.index=`--toast-index`,e.offsetY=`--toast-offset-y`,e.height=`--toast-height`,e.swipeMovementX=`--toast-swipe-movement-x`,e.swipeMovementY=`--toast-swipe-movement-y`,e}({});function qe(e,t,n){switch(e){case`up`:return-n;case`down`:return n;case`left`:return-t;case`right`:return t;default:return 0}}function Je(e){let t=D(e).getComputedStyle(e).transform,n=0,r=0,i=1;if(t&&t!==`none`){let e=t.match(/matrix(?:3d)?\(([^)]+)\)/);if(e){let t=e[1].split(`, `).map(parseFloat);t.length===6?(n=t[4],r=t[5],i=Math.sqrt(t[0]*t[0]+t[1]*t[1])):t.length===16&&(n=t[12],r=t[13],i=t[0])}}return{x:n,y:r,scale:i}}var Ye={...o,swipeDirection(e){return e?{"data-swipe-direction":e}:null}},Xe=40,Ze=10,X=.5,Qe=1,$e=`${f},${l}`,et=K.forwardRef(function(e,t){let{toast:n,render:r,className:i,swipeDirection:a=[`down`,`right`],style:o,...s}=e,c=n.positionerProps?.anchor!==void 0,l=[];c||(l=Array.isArray(a)?a:[a]);let u=l.length>0,f=Pe(),[p,m]=K.useState(void 0),[h,g]=K.useState(!1),[_,y]=K.useState(!1),[b,x]=K.useState(!1),[S,C]=K.useState({x:0,y:0}),[w,D]=K.useState({x:0,y:0,scale:1}),[O,ee]=K.useState(),[k,te]=K.useState(),[A,j]=K.useState(null),M=K.useRef(null),N=K.useRef({x:0,y:0}),ne=K.useRef({x:0,y:0,scale:1}),F=K.useRef(void 0),re=K.useRef(0),I=K.useRef(!1),L=K.useRef({x:0,y:0}),ie=K.useRef(!1),ae=K.useRef({x:0,y:0}),oe=K.useRef(null),R=K.useRef(null),ce=f.useState(`toastIndex`,n.id),le=f.useState(`toastVisibleIndex`,n.id),ue=f.useState(`toastOffsetY`,n.id),V=f.useState(`focused`),H=f.useState(`expanded`);T({open:n.transitionStatus!==`ending`,ref:M,onComplete(){n.transitionStatus===`ending`&&f.removeToast(n.id)}});let de=d((e=!1)=>{let t=M.current;if(!t)return;let r=t.style.height;t.style.height=`auto`;let i=t.offsetHeight;t.style.height=r;function a(){f.updateToastInternal(n.id,{ref:M,height:i,...n.transitionStatus===`starting`?{transitionStatus:void 0}:{}})}e?We.flushSync(a):a()});E(de,[de]);function fe(e){ae.current=e,C(e)}E(()=>()=>{R.current?.abort()},[]);function pe(e,t){let n=e,r=t;return!l.includes(`left`)&&!l.includes(`right`)?n=e>0?e**X:-(Math.abs(e)**X):(!l.includes(`right`)&&e>0&&(n=e**X),!l.includes(`left`)&&e<0&&(n=-(Math.abs(e)**X))),!l.includes(`up`)&&!l.includes(`down`)?r=t>0?t**X:-(Math.abs(t)**X):(!l.includes(`down`)&&t>0&&(r=t**X),!l.includes(`up`)&&t<0&&(r=-(Math.abs(t)**X))),{x:n,y:r}}let me=d(e=>{if(e.pointerId!==oe.current)return;oe.current=null,R.current?.abort(),R.current=null,g(!1),y(!1),j(null);let t=ne.current;if(e.type===`pointercancel`||I.current){fe({x:t.x,y:t.y}),m(void 0);return}let r=!1,i=ae.current,a=i.x-t.x,o=i.y-t.y,s;for(let e of l){switch(e){case`right`:a>Xe&&(r=!0,s=`right`);break;case`left`:a<-40&&(r=!0,s=`left`);break;case`down`:o>Xe&&(r=!0,s=`down`);break;case`up`:o<-40&&(r=!0,s=`up`)}if(r)break}r?(m(s),x(!0),f.closeToast(n.id)):(fe({x:t.x,y:t.y}),m(void 0))});function he(e){if(e.button!==0)return;e.pointerType===`touch`&&f.pauseTimers();let t=P(e.nativeEvent);if(t&&t.closest(`button,a,input,textarea,[role="button"],${$e}`))return;if(I.current=!1,F.current=void 0,re.current=0,oe.current=e.pointerId,N.current={x:e.clientX,y:e.clientY},L.current=N.current,M.current){let e=Je(M.current);ne.current=e,D(e),fe({x:e.x,y:e.y})}f.setHovering(!0),g(!0),y(!1),j(null),ie.current=!0;let n=M.current;if(n){R.current?.abort();let t=new AbortController;R.current=t;let r=B(n);r.addEventListener(`pointerup`,me,{signal:t.signal}),r.addEventListener(`pointercancel`,me,{signal:t.signal}),n.setPointerCapture?.(e.pointerId)}}function ge(e){if(e.pointerId!==oe.current)return;e.preventDefault(),ie.current&&=(N.current={x:e.clientX,y:e.clientY},!1);let{clientY:t,clientX:n,movementX:r,movementY:i}=e;(i<0&&t>L.current.y||i>0&&t<L.current.y)&&(L.current={x:L.current.x,y:t}),(r<0&&n>L.current.x||r>0&&n<L.current.x)&&(L.current={x:n,y:L.current.y});let a=n-N.current.x,o=t-N.current.y,s=t-L.current.y,c=n-L.current.x;if(!_&&Math.sqrt(a*a+o*o)>=Qe&&(y(!0),A===null)){let e=l.includes(`left`)||l.includes(`right`),t=l.includes(`up`)||l.includes(`down`);e&&t&&j(Math.abs(a)>Math.abs(o)?`horizontal`:`vertical`)}let u;if(!F.current)A===`vertical`?o>0?u=`down`:o<0&&(u=`up`):A===`horizontal`?a>0?u=`right`:a<0&&(u=`left`):u=Math.abs(a)>=Math.abs(o)?a>0?`right`:`left`:o>0?`down`:`up`,u&&l.includes(u)&&(F.current=u,re.current=qe(u,a,o),m(u));else{let e=F.current,t=qe(e,c,s);t>Xe?(I.current=!1,m(e)):!(l.includes(`left`)&&l.includes(`right`))&&!(l.includes(`up`)&&l.includes(`down`))&&re.current-t>=Ze&&(I.current=!0)}let d=pe(a,o),f=ne.current.x,p=ne.current.y;A===`horizontal`?(l.includes(`left`)||l.includes(`right`))&&(f+=d.x):(A===`vertical`||(l.includes(`left`)||l.includes(`right`))&&(f+=d.x),(l.includes(`up`)||l.includes(`down`))&&(p+=d.y)),fe({x:f,y:p})}function _e(e){if(e.key===`Escape`){if(!M.current||!z(M.current,se(B(M.current))))return;f.closeToast(n.id)}}K.useEffect(()=>{if(!u)return;let e=M.current;if(!e)return;function t(t){z(e,P(t))&&t.preventDefault()}return U(e,`touchmove`,t,{passive:!1})},[u]);function ve(){if(!h&&S.x===w.x&&S.y===w.y&&!b)return{[Y.swipeMovementX]:`0px`,[Y.swipeMovementY]:`0px`};let e=S.x-w.x,t=S.y-w.y;return{transition:h?`none`:void 0,transform:h?`translateX(${S.x}px) translateY(${S.y}px) scale(${w.scale})`:void 0,[Y.swipeMovementX]:`${e}px`,[Y.swipeMovementY]:`${t}px`}}let ye=n.priority===`high`,be={role:ye?`alertdialog`:`dialog`,tabIndex:0,"aria-modal":!1,"aria-labelledby":O,"aria-describedby":k,"aria-hidden":ye&&!V?!0:void 0,onPointerDown:u?he:void 0,onPointerMove:u?ge:void 0,onPointerUp:u?me:void 0,onPointerCancel:u?me:void 0,onKeyDown:_e,inert:v(n.limited),style:{...ve(),[Y.index]:n.transitionStatus===`ending`?ce:le,[Y.offsetY]:`${ue}px`,[Y.height]:n.height?`${n.height}px`:void 0}},G=K.useMemo(()=>({rootRef:M,toast:n,titleId:O,setTitleId:ee,descriptionId:k,setDescriptionId:te,swiping:h,swipeDirection:p,recalculateHeight:de,index:ce,visibleIndex:le,expanded:H}),[n,O,k,h,p,de,ce,le,H]),xe={transitionStatus:n.transitionStatus,expanded:H,limited:n.limited||!1,type:n.type,swiping:G.swiping,swipeDirection:G.swipeDirection},Se=W(`div`,e,{ref:[t,G.rootRef],state:xe,stateAttributesMapping:Ye,props:[be,s]});return(0,J.jsx)(Ge.Provider,{value:G,children:Se})}),tt=K.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{visibleIndex:o,expanded:s,recalculateHeight:c}=Ke(),l=K.useRef(null);return E(()=>{let e=l.current;if(!e||(c(),typeof ResizeObserver!=`function`||typeof MutationObserver!=`function`))return;let t=new ResizeObserver(()=>c(!0)),n=new MutationObserver(()=>c(!0));return t.observe(e),n.observe(e,{childList:!0,subtree:!0,characterData:!0}),()=>{t.disconnect(),n.disconnect()}},[c]),W(`div`,e,{ref:[t,l],state:{expanded:s,behind:o>0},props:a})}),nt=K.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,children:o,...s}=e,{toast:c,setDescriptionId:l}=Ke(),u=o??c.description,d=!!u,f=y(a);E(()=>{if(d)return l(f),()=>{l(void 0)}},[d,f,l]);let p={type:c.type},m=W(`p`,e,{ref:t,state:p,props:{...s,id:f,children:u}});return d?m:null}),rt=K.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,children:o,...s}=e,{toast:c,setTitleId:l}=Ke(),u=o??c.title,d=!!u,f=y(a);E(()=>{if(d)return l(f),()=>{l(void 0)}},[d,f,l]);let p={type:c.type},m=W(`h2`,e,{ref:t,state:p,props:{...s,id:f,children:u}});return d?m:null}),it=K.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a,nativeButton:o=!0,...s}=e,c=Pe(),{toast:l}=Ke(),u=c.useState(`expanded`),[d,f]=K.useState(!1),{getButtonProps:p,buttonRef:m}=he({disabled:a,native:o}),h={type:l.type};return W(`button`,e,{ref:[t,m],state:h,props:[{"aria-hidden":!u&&!d,onClick(){c.closeToast(l.id)},onFocus(){f(!0)},onBlur(){f(!1)}},s,p]})}),at=K.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a,nativeButton:o=!0,...s}=e,{toast:c}=Ke(),l=c.actionProps?.children??s.children,u=!!l,{getButtonProps:d,buttonRef:f}=he({disabled:a,native:o}),p={type:c.type},m=W(`button`,e,{ref:[t,f],state:p,props:[s,c.actionProps,d,{children:l}]});return u?m:null}),ot=Se,st=K.createContext(void 0);function ct(){let e=K.useContext(st);if(e===void 0)throw Error(b(84));return e}var lt=K.forwardRef(function(e,t){let{toast:n,...r}=e,i=Pe(),a=n.positionerProps??S,{render:o,className:s,anchor:l=a.anchor,positionMethod:u=a.positionMethod??`absolute`,side:d=a.side??`top`,align:f=a.align??`center`,sideOffset:p=a.sideOffset??0,alignOffset:m=a.alignOffset??0,collisionBoundary:g=a.collisionBoundary??`clipping-ancestors`,collisionPadding:_=a.collisionPadding??5,arrowPadding:v=a.arrowPadding??5,sticky:y=a.sticky??!1,disableAnchorTracking:b=a.disableAnchorTracking??!1,collisionAvoidance:x=a.collisionAvoidance??h,style:w,...T}=r,[E,D]=K.useState(null),O=i.useState(`toastIndex`,n.id),ee=i.useState(`toastVisibleIndex`,n.id),k=c(l)?l:null,te=j({open:!0,onOpenChange:oe,elements:{floating:E,reference:k}}),A=C({anchor:k,positionMethod:u,floatingRootContext:te,mounted:!0,side:d,sideOffset:p,align:f,alignOffset:m,collisionBoundary:g,collisionPadding:_,sticky:y,arrowPadding:v,disableAnchorTracking:b,keepMounted:!0,collisionAvoidance:x}),M=K.useMemo(()=>({side:A.side,align:A.align,anchorHidden:A.anchorHidden}),[A.side,A.align,A.anchorHidden]),N=ie(e,M,{styles:{...A.positionerStyles,[Y.index]:n.transitionStatus===`ending`?O:ee},transitionStatus:n.transitionStatus,props:T,refs:[t,D]});return(0,J.jsx)(st.Provider,{value:A,children:N})}),ut=K.forwardRef(function(e,t){let{className:n,render:r,style:i,...a}=e,{arrowRef:o,side:s,align:c,arrowUncentered:l,arrowStyles:u}=ct();return W(`div`,e,{state:{side:s,align:c,uncentered:l},ref:[t,o],props:[{style:u,"aria-hidden":!0},a]})});function dt(){let e=K.useContext(Ne);if(!e)throw Error(b(73));let t=e.useState(`toasts`);return K.useMemo(()=>({toasts:t,add:e.addToast,close:e.closeToast,update:e.updateToast,promise:e.promiseToast}),[t,e])}function ft(){let e=new Set;function t(t){e.forEach(e=>e(t))}return{" subscribe":function(t){return e.add(t),()=>{e.delete(t)}},add(e){let n=e.id||Ie(`toast`);return t({action:`add`,options:{...e,id:n,transitionStatus:`starting`}}),n},close(e){t({action:`close`,options:{id:e}})},update(e,n){t({action:`update`,options:{...n,id:e}})},promise(e,n){let r=e;return t({action:`promise`,options:{...n,promise:e,setPromise(e){r=e}}}),r}}}var pt=t({Action:()=>at,Arrow:()=>ut,Close:()=>it,Content:()=>tt,Description:()=>nt,Portal:()=>ot,Positioner:()=>lt,Provider:()=>Ve,Root:()=>et,Title:()=>rt,Viewport:()=>Ue,createToastManager:()=>ft,useToastManager:()=>dt});function mt(){let e=[],t=0,n=new Set,r=new Map,i=new Map,a=new Map,o=new Map,s=new Set,c=()=>n.forEach(e=>e()),l=e=>{clearTimeout(r.get(e)),r.delete(e);let t=a.get(e);t!==void 0&&(i.set(e,Math.max(0,(i.get(e)??0)-(Date.now()-t))),a.delete(e))},u=t=>{let n=e.find(e=>e.id===t);n&&(l(t),i.delete(t),o.delete(t),e=e.filter(e=>e.id!==t),c(),n.onDismiss?.())},d=e=>{s.size||o.get(e)?.size||r.has(e)||!i.has(e)||(a.set(e,Date.now()),r.set(e,setTimeout(()=>u(e),i.get(e))))},f=n=>{let r=n.id??`notification-${++t}`;l(r);let a={...n,id:r};e=[...e.filter(e=>e.id!==r),a];let o=n.durationMs??8e3;return o>0?i.set(r,o):i.delete(r),d(r),c(),r},p=(e,t)=>{let n=o.get(e)??new Set;n.add(t),o.set(e,n),l(e)},m=(e,t)=>{o.get(e)?.delete(t),d(e)};return{show:f,dismiss:u,pause:p,resume:m,getSnapshot:()=>e,subscribe:e=>(n.add(e),()=>{n.delete(e)}),setPaused:(t,n)=>{n?s.add(t):s.delete(t);for(let t of e)s.size?l(t.id):d(t.id)},performAction:async(t,n)=>{let r=e.find(e=>e.id===t),i=r?.actions?.find(e=>e.id===n);if(!r||!i||r.pendingActionId)return;let a={...r,pendingActionId:n};p(t,`action`),e=e.map(e=>e===r?a:e),c();try{await i.run(),e.includes(a)&&u(t)}catch(t){e.includes(a)&&f({...r,title:i.failureTitle??`Could not complete action`,description:t instanceof Error?t.message:`Please try again.`,tone:`error`})}finally{m(t,`action`)}}}}var Z=mt(),Q=r(),ht={archive:re,clock:m,pin:u,trash:_};function gt(){let e=(0,Q.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[0]=t):t=e[0],(0,K.useEffect)(_t,t),null}function _t(){let e=!0,t=new Set,n=()=>{let n=Z.getSnapshot();for(let e of t)n.some(t=>t.id===e)||(t.delete(e),$.close(`shared:${e}`));for(let r of n){let n=r.icon&&r.tone!==`error`?ht[r.icon]:null,i=r.actions??[],a=i.find(yt),o=e=>({children:e.label,disabled:!!r.pendingActionId,onClick:()=>{Z.performAction(r.id,e.id)}}),s={title:r.title,description:r.description??null,type:r.tone??`info`,timeout:0,onClose:()=>{e&&Z.getSnapshot().includes(r)&&Z.dismiss(r.id)},actionProps:{children:null},data:{sharedToastId:r.id,leadingIcon:n?(0,J.jsx)(n,{className:`size-4`}):void 0,additionalActions:i.filter(e=>e!==a).map(e=>({id:e.id,props:o(e)})),...a?{secondaryActionProps:o(a)}:{},hideCopyButton:!0}};t.has(r.id)?$.update(`shared:${r.id}`,s):(t.add(r.id),$.add({...s,id:`shared:${r.id}`}))}},r=Z.subscribe(n),i=vt;return document.addEventListener(`visibilitychange`,i),i(),n(),()=>{e=!1,r(),document.removeEventListener(`visibilitychange`,i),Z.setPaused(`web-hidden`,!1);for(let e of t)$.close(`shared:${e}`)}}function vt(){return Z.setPaused(`web-hidden`,document.hidden)}function yt(e){return e.primary}var bt=class extends A()(`ClipboardApiUnavailableError`,{target:V}){get message(){return`Clipboard API is unavailable while copying ${this.target}.`}},xt=class extends A()(`ClipboardWriteError`,{target:V,cause:p()}){get message(){return`Failed to copy ${this.target} to the clipboard.`}},St=class extends A()(`ClipboardReadUnavailableError`,{target:V}){get message(){return`Clipboard API is unavailable while reading ${this.target}.`}},Ct=class extends A()(`ClipboardReadError`,{target:V,cause:p()}){get message(){return`Failed to read ${this.target} from the clipboard.`}};function wt(e,t){if(typeof document>`u`||typeof document.execCommand!=`function`)return!1;let n=document.createElement(`textarea`);n.value=e,n.setAttribute(`readonly`,``),n.setAttribute(`aria-hidden`,`true`),n.style.position=`fixed`,n.style.top=`0`,n.style.left=`0`,n.style.opacity=`0`,n.style.fontSize=`16px`;let r=document.activeElement,i=n=>{if(t&&n.clipboardData){n.clipboardData.setData(`text/plain`,e);for(let[e,r]of Object.entries(t))n.clipboardData.setData(e,r);n.preventDefault()}};document.body.appendChild(n),n.addEventListener(`copy`,i);try{return n.focus({preventScroll:!0}),n.select(),n.setSelectionRange(0,e.length),document.execCommand(`copy`)}catch{return!1}finally{n.removeEventListener(`copy`,i),n.remove();let e=r?.focus;typeof e==`function`&&e.call(r)}}async function Tt(e,t=`text`,n){if(typeof window>`u`)throw new bt({target:t});if(!e)return!1;n&&=Object.fromEntries(Object.entries(n).filter(([e])=>e!==`text/plain`));let r=n?.[O];if(r&&(n={...n,"text/html":te(e,r,n?.[`text/html`])}),typeof navigator>`u`||!navigator.clipboard?.writeText){if(wt(e,n))return!0;throw new bt({target:t})}try{if(n&&typeof ClipboardItem<`u`&&navigator.clipboard.write)try{return await navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([e],{type:`text/plain`}),...Object.fromEntries(Object.entries(n).map(([e,t])=>[e,new Blob([t],{type:e})]))})]),!0}catch{let t=n[`text/html`];if(t)try{return await navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([e],{type:`text/plain`}),"text/html":new Blob([t],{type:`text/html`})})]),!0}catch{}}return await navigator.clipboard.writeText(e),!0}catch(e){throw new xt({target:t,cause:e})}}async function Et(e=`text`){if(typeof window>`u`||typeof navigator>`u`||!navigator.clipboard?.readText)throw new St({target:e});try{return await navigator.clipboard.readText()}catch(t){throw new Ct({target:e,cause:t})}}function Dt({timeout:e=2e3,target:t=`text`,onCopy:n,onError:r,extraFlavors:i}={}){let[a,o]=K.useState(!1),s=K.useRef(null),c=K.useRef(n),l=K.useRef(r),u=K.useRef(t),d=K.useRef(e);c.current=n,l.current=r;let f=K.useRef(i);u.current=t,d.current=e,f.current=i;let p=K.useCallback((e,t)=>{Tt(e,u.current,f.current).then(e=>{e&&(s.current&&clearTimeout(s.current),o(!0),c.current?.(t),d.current!==0&&(s.current=setTimeout(()=>{o(!1),s.current=null},d.current)))},e=>{console.error(e),l.current?.(e,t)})},[]);return K.useEffect(()=>()=>{s.current&&clearTimeout(s.current)},[]),{copyToClipboard:p,isCopied:a}}function Ot(e){return e===`live`}function kt(e){return e.draftThreadExists||e.serverThreadExists&&!e.serverThreadDeleted?`ready`:e.bootstrapComplete?`missing`:`loading`}function At(e){return{environmentId:e.environmentId,threadId:e.threadId}}function jt(e){return{draftId:e}}function Mt(e){return!e.environmentId||!e.threadId?null:w(e.environmentId,e.threadId)}function Nt(e){return e.environmentId&&e.threadId?{kind:`server`,threadRef:w(e.environmentId,e.threadId)}:e.draftId?{kind:`draft`,draftId:e.draftId}:null}function Pt(e,t){return e?.kind===`server`?e.threadRef:e?.kind!==`draft`||!t?.promotedTo?null:t.promotedTo}function Ft(e){if(typeof e!=`object`||!e||!(`children`in e))return!1;let t=e.children;return t!=null&&t!==!1&&t!==``}function It(e,t){return t<=1?!1:e>0}function Lt(e){let t=0,n=0,r=0,i=0,a=e.map(e=>{let a=Rt(e.height);if(e.transitionStatus===`ending`){let r={toast:e,visibleIndex:t,offsetY:n};return n+=a,t+=1,r}let o={toast:e,visibleIndex:r,offsetY:i};return n+=a,t+=1,i+=a,r+=1,o});return{frontmostHeight:Rt(e.find(e=>e.transitionStatus!==`ending`)?.height),items:a}}function Rt(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?e:0}function zt(e,t){if(e?.threadRef)return t!==null&&e.threadRef.environmentId===t.environmentId&&e.threadRef.threadId===t.threadId;let n=e?.threadId;return!n||t?.threadId===n}var $=ft(),Bt=ft(),Vt=new Map,Ht={error:g,info:le,loading:Ce,success:ge,warning:a},Ut=180;function Wt(e,t){if(e===`error`&&typeof t==`string`&&!(t.length<Ut))return`line-clamp-4`}function Gt(e,t,n){n?.(),e.close(t)}function Kt(e){let t=(0,Q.c)(3),{onClick:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,J.jsx)(ue,{}),t[0]=r):r=t[0];let i;return t[1]===n?i=t[2]:(i=(0,J.jsx)(M,{size:`icon-xs`,variant:`ghost`,"aria-label":`Dismiss notification`,"data-slot":`toast-close`,onClick:n,children:r}),t[1]=n,t[2]=i),i}function qt(e){let t=(0,Q.c)(13),{text:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={target:`error-message`},t[0]=r):r=t[0];let{copyToClipboard:i,isCopied:a}=Dt(r),o=a?`Copied error`:`Copy error`,s;t[1]!==i||t[2]!==n?(s=()=>i(n),t[1]=i,t[2]=n,t[3]=s):s=t[3];let c=a&&`text-success`,l;t[4]===c?l=t[5]:(l=H(`size-3`,c),t[4]=c,t[5]=l);let u=a?ye:ve,d;t[6]!==l||t[7]!==u?(d=(0,J.jsx)(G,{className:l,icon:u}),t[6]=l,t[7]=u,t[8]=d):d=t[8];let f;return t[9]!==o||t[10]!==s||t[11]!==d?(f=(0,J.jsx)(M,{size:`icon-micro`,variant:`ghost-muted`,"aria-label":o,className:`[--control-icon-color:currentColor] rounded-md text-muted-foreground/80 hover:bg-transparent hover:text-muted-foreground`,onClick:s,children:d}),t[9]=o,t[10]=s,t[11]=d,t[12]=f):f=t[12],f}var Jt=`mt-2 max-h-40 min-h-0 overflow-y-auto overscroll-contain pr-0.5 select-text`;function Yt(e){let t=(0,Q.c)(13),{children:n,labels:r}=e,[i,a]=(0,K.useState)(!1),o=r.expand??`Show details`,s=r.collapse??`Hide details`,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=()=>a(Xt),t[0]=c):c=t[0];let l=i?xe:be,u;t[1]===l?u=t[2]:(u=(0,J.jsx)(G,{className:`size-3.5 shrink-0 opacity-80`,icon:l,strokeWidth:2.25}),t[1]=l,t[2]=u);let d=i?s:o,f;t[3]!==i||t[4]!==u||t[5]!==d?(f=(0,J.jsxs)(`button`,{"aria-expanded":i,className:`inline-flex cursor-pointer items-center gap-1 rounded-md py-0.5 text-left text-xs font-medium text-muted-foreground transition-colors hover:text-foreground`,onClick:c,type:`button`,children:[u,d]}),t[3]=i,t[4]=u,t[5]=d,t[6]=f):f=t[6];let p;t[7]!==n||t[8]!==i?(p=i?(0,J.jsx)(`div`,{className:Jt,children:n}):null,t[7]=n,t[8]=i,t[9]=p):p=t[9];let m;return t[10]!==f||t[11]!==p?(m=(0,J.jsxs)(`div`,{className:`min-w-0`,children:[f,p]}),t[10]=f,t[11]=p,t[12]=m):m=t[12],m}function Xt(e){return!e}function Zt(e){let t=(0,Q.c)(36),{toastData:n,toastDescription:r,toastType:i}=e,a=n?.expandableContent,o;t[0]===n?.expandableLabels?o=t[1]:(o=n?.expandableLabels??{},t[0]=n?.expandableLabels,t[1]=o);let s=o,c=n?.expandableDescriptionTrigger??!1,l;t[2]!==r||t[3]!==i?(l=H(`min-w-0 select-text wrap-break-word text-muted-foreground`,Wt(i,r)),t[2]=r,t[3]=i,t[4]=l):l=t[4];let u=l,[d,f]=(0,K.useState)(!1);if(!a){let e;return t[5]===u?e=t[6]:(e=(0,J.jsx)(nt,{className:u,"data-slot":`toast-description`}),t[5]=u,t[6]=e),e}if(!c){let e;t[7]===u?e=t[8]:(e=(0,J.jsx)(nt,{className:u,"data-slot":`toast-description`}),t[7]=u,t[8]=e);let n;t[9]!==a||t[10]!==s?(n=(0,J.jsx)(Yt,{labels:s,children:a}),t[9]=a,t[10]=s,t[11]=n):n=t[11];let r;return t[12]!==e||t[13]!==n?(r=(0,J.jsxs)(J.Fragment,{children:[e,n]}),t[12]=e,t[13]=n,t[14]=r):r=t[14],r}let p=s.expand??`Show details`,m=s.collapse??`Hide details`,h;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(h=()=>f(Qt),t[15]=h):h=t[15];let g=h,_;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(_=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),g())},t[16]=_):_=t[16];let v=_,y=d?m:p,b;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(b=H(`group flex min-w-0 w-full cursor-pointer select-none items-start gap-1.5 rounded-sm text-left outline-none ring-offset-background`,`transition-colors hover:bg-muted/40`,`focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background`),t[17]=b):b=t[17];let x;t[18]!==r||t[19]!==i?(x=H(`min-w-0 select-none wrap-break-word text-muted-foreground`,Wt(i,r),`underline-offset-2 decoration-muted-foreground/60 group-hover:underline`),t[18]=r,t[19]=i,t[20]=x):x=t[20];let S;t[21]===x?S=t[22]:(S=(0,J.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,J.jsx)(nt,{className:x,"data-slot":`toast-description`})}),t[21]=x,t[22]=S);let C=d?xe:be,w;t[23]===C?w=t[24]:(w=(0,J.jsx)(G,{"aria-hidden":!0,className:`mt-0.5 size-3.5 shrink-0 text-muted-foreground opacity-80`,icon:C,strokeWidth:2.25}),t[23]=C,t[24]=w);let T;t[25]!==d||t[26]!==w||t[27]!==y||t[28]!==S?(T=(0,J.jsxs)(`div`,{"aria-label":y,"aria-expanded":d,className:b,onClick:g,onKeyDown:v,role:`button`,tabIndex:0,children:[S,w]}),t[25]=d,t[26]=w,t[27]=y,t[28]=S,t[29]=T):T=t[29];let E;t[30]!==a||t[31]!==d?(E=d?(0,J.jsx)(`div`,{className:Jt,children:a}):null,t[30]=a,t[31]=d,t[32]=E):E=t[32];let D;return t[33]!==T||t[34]!==E?(D=(0,J.jsxs)(J.Fragment,{children:[T,E]}),t[33]=T,t[34]=E,t[35]=D):D=t[35],D}function Qt(e){return!e}function $t(e){let t=e.type?Ht[e.type]:null,n=e.type===`error`&&typeof e.description==`string`&&!e.data?.hideCopyButton?e.description:null,r=(e.data?.additionalActions?.length??0)>0,i=e.data?.secondaryActionProps!==void 0;return{Icon:t,copyErrorText:n,hasTrailingControls:n!==null||Ft(e.actionProps)||r||i}}function en(e){let t=(0,Q.c)(32),{Icon:n,copyErrorText:r,actionProps:i,hasTrailingControls:a,toastData:o,toastDescription:s,toastType:c}=e,l;t[0]===o?.additionalActions?l=t[1]:(l=o?.additionalActions??[],t[0]=o?.additionalActions,t[1]=l);let u=l,d=o?.secondaryActionProps,f=o?.leadingIcon,p;t[2]===d?p=t[3]:(p=d??{},t[2]=d,t[3]=p);let m,h;t[4]===p?(m=t[5],h=t[6]):({className:m,...h}=p,t[4]=p,t[5]=m,t[6]=h);let g;t[7]!==n||t[8]!==f?(g=f?(0,J.jsx)(`div`,{className:`flex h-lh w-4 shrink-0 items-center justify-center`,"data-slot":`toast-icon`,children:f}):n?(0,J.jsx)(`div`,{className:`[&>svg]:h-lh [&>svg]:w-4 [&_svg]:pointer-events-none [&_svg]:shrink-0`,"data-slot":`toast-icon`,children:(0,J.jsx)(n,{className:`in-data-[type=error]:text-destructive in-data-[type=info]:text-info in-data-[type=success]:text-success in-data-[type=warning]:text-warning in-data-[type=loading]:opacity-80`})}):null,t[7]=n,t[8]=f,t[9]=g):g=t[9];let _;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,J.jsx)(rt,{className:`min-w-0 wrap-break-word font-medium`,"data-slot":`toast-title`}),t[10]=_):_=t[10];let v;t[11]===g?v=t[12]:(v=(0,J.jsxs)(`div`,{className:`flex min-w-0 gap-2`,children:[g,_]}),t[11]=g,t[12]=v);let y;t[13]!==o||t[14]!==s||t[15]!==c?(y=(0,J.jsx)(Zt,{toastData:o,toastDescription:s,toastType:c}),t[13]=o,t[14]=s,t[15]=c,t[16]=y):y=t[16];let b;t[17]!==v||t[18]!==y?(b=(0,J.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col gap-0.5`,children:[v,y]}),t[17]=v,t[18]=y,t[19]=b):b=t[19];let x;t[20]!==i||t[21]!==u||t[22]!==r||t[23]!==a||t[24]!==m||t[25]!==d||t[26]!==h||t[27]!==o?.sharedToastId?(x=a?(0,J.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[r===null?null:(0,J.jsx)(qt,{text:r}),u.map(tn),d?(0,J.jsx)(M,{...h,className:m,size:`xs`,type:`button`,variant:o?.sharedToastId?`solid-neutral`:`soft`}):null,Ft(i)?(0,J.jsx)(at,{className:H(ce({size:`xs`,variant:`solid-neutral`}),`shrink-0`),"data-slot":`toast-action`,children:i?.children}):null]}):null,t[20]=i,t[21]=u,t[22]=r,t[23]=a,t[24]=m,t[25]=d,t[26]=h,t[27]=o?.sharedToastId,t[28]=x):x=t[28];let S;return t[29]!==b||t[30]!==x?(S=(0,J.jsxs)(J.Fragment,{children:[b,x]}),t[29]=b,t[30]=x,t[31]=S):S=t[31],S}function tn(e){let{id:t,props:n}=e,{className:r,...i}=n;return(0,K.createElement)(M,{...i,className:r,key:t,size:`xs`,type:`button`,variant:`soft`})}function nn(){let e=(0,Q.c)(6),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={strict:!1,select:rn},e[0]=t):t=e[0];let n=we(t),r;e[1]===n?r=e[2]:(r=e=>n?.kind===`draft`?e.getDraftSession(n.draftId):null,e[1]=n,e[2]=r);let i=s(r),a;bb0:{if(n?.kind===`server`){a=n.threadRef;break bb0}if(n?.kind===`draft`&&i){let t;e[3]!==i.environmentId||e[4]!==i.threadId?(t={environmentId:i.environmentId,threadId:i.threadId},e[3]=i.environmentId,e[4]=i.threadId,e[5]=t):t=e[5],a=t;break bb0}a=null}return a}function rn(e){return Nt(e)}function an(e){let t=(0,Q.c)(4),{toastId:n,dismissAfterVisibleMs:r}=e,i,a;return t[0]!==r||t[1]!==n?(i=()=>{if(!r||r<=0||typeof window>`u`||typeof document>`u`)return;let e=Vt.get(n)??r,t=null,i=null,a=!1,o=()=>{i!==null&&(window.clearTimeout(i),i=null)},s=()=>{a||(a=!0,Vt.delete(n),$.close(n))},c=()=>{t!==null&&(e=Math.max(0,e-(Date.now()-t)),t=null,o(),Vt.set(n,e))},l=()=>{a||t!==null||(e<=0?s():(t=Date.now(),o(),i=window.setTimeout(()=>{e=0,t=null,s()},e)))},u=()=>{document.visibilityState===`visible`&&document.hasFocus()?l():c()};return u(),document.addEventListener(`visibilitychange`,u),window.addEventListener(`focus`,u),window.addEventListener(`blur`,u),()=>{document.removeEventListener(`visibilitychange`,u),window.removeEventListener(`focus`,u),window.removeEventListener(`blur`,u),c(),o()}},a=[r,n],t[0]=r,t[1]=n,t[2]=i,t[3]=a):(i=t[2],a=t[3]),(0,K.useEffect)(i,a),null}function on(e){let t=(0,Q.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({children:n,position:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`top-center`:i,o;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,J.jsx)(gt,{}),t[4]=o):o=t[4];let s;t[5]===a?s=t[6]:(s=(0,J.jsx)(sn,{position:a}),t[5]=a,t[6]=s);let c;return t[7]!==n||t[8]!==r||t[9]!==s?(c=(0,J.jsxs)(Ve,{toastManager:$,...r,children:[o,n,s]}),t[7]=n,t[8]=r,t[9]=s,t[10]=c):c=t[10],c}function sn(e){let t=(0,Q.c)(19),{position:n}=e,{toasts:r}=dt(),i=nn(),a;t[0]===n?a=t[1]:(a=n.startsWith(`top`),t[0]=n,t[1]=a);let o=a,s;t[2]===i?s=t[3]:(s=e=>zt(e.data,i),t[2]=i,t[3]=s);let c=Lt(r.filter(s)),l,u;t[4]===r?(l=t[5],u=t[6]):(l=()=>{let e=new Set(r.map(cn));for(let t of Vt.keys())e.has(t)||Vt.delete(t)},u=[r],t[4]=r,t[5]=l,t[6]=u),(0,K.useEffect)(l,u);let d=pt,f=pt,p;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(p=H(`fixed z-100 mx-auto flex w-[calc(100%-var(--toast-inset)*2)] max-w-90 [--toast-header-offset:var(--workspace-topbar-height)] [--toast-inset:--spacing(4)] sm:[--toast-inset:--spacing(8)]`,`data-[position*=top]:top-[calc(var(--toast-inset)+var(--toast-header-offset))]`,`data-[position*=bottom]:bottom-(--toast-inset)`,`data-[position*=left]:left-(--toast-inset)`,`data-[position*=right]:right-(--toast-inset)`,`data-[position*=center]:-translate-x-1/2 data-[position*=center]:left-1/2`),t[7]=p):p=t[7];let m=`${c.frontmostHeight}px`,h;t[8]===m?h=t[9]:(h={"--toast-frontmost-height":m},t[8]=m,t[9]=h);let g=h,_=c.items.map(e=>{let{toast:t,visibleIndex:r,offsetY:i}=e,a=It(r,c.items.length),s=$t(t);return(0,J.jsxs)(et,{className:H(`dropdown-glass absolute z-[calc(9999-var(--toast-index))] w-full overflow-visible select-none rounded-xl text-popover-foreground shadow-lg shadow-black/10 [transition:transform_.5s_cubic-bezier(.22,1,.36,1),opacity_.5s,height_.15s] motion-reduce:transition-none`,`data-[position*=right]:right-0 data-[position*=right]:left-auto`,`data-[position*=left]:right-auto data-[position*=left]:left-0`,`data-[position*=center]:right-0 data-[position*=center]:left-0`,`data-[position*=top]:top-0 data-[position*=top]:bottom-auto data-[position*=top]:origin-top`,`data-[position*=bottom]:top-auto data-[position*=bottom]:bottom-0 data-[position*=bottom]:origin-bottom`,`after:absolute after:left-0 after:h-[calc(var(--toast-gap)+1px)] after:w-full`,`data-[position*=top]:after:top-full`,`data-[position*=bottom]:after:bottom-full`,r>0?`not-data-expanded:[--toast-calc-height:var(--toast-frontmost-height)] data-expanded:[--toast-calc-height:max(var(--toast-frontmost-height,var(--toast-height)),var(--toast-height))]`:`[--toast-calc-height:max(var(--toast-frontmost-height,var(--toast-height)),var(--toast-height))]`,`[--toast-gap:--spacing(3)] [--toast-peek:--spacing(3)] [--toast-scale:calc(max(0,1-(var(--toast-index)*.1)))] [--toast-shrink:calc(1-var(--toast-scale))]`,r>0?`not-data-expanded:h-(--toast-calc-height) data-expanded:h-auto`:`h-auto`,`data-[position*=top]:[--toast-calc-offset-y:calc(var(--toast-offset-y)+var(--toast-index)*var(--toast-gap)+var(--toast-swipe-movement-y))]`,`data-[position*=bottom]:[--toast-calc-offset-y:calc(var(--toast-offset-y)*-1+var(--toast-index)*var(--toast-gap)*-1+var(--toast-swipe-movement-y))]`,`data-[position*=top]:transform-[translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)+(var(--toast-index)*var(--toast-peek))+(var(--toast-shrink)*var(--toast-calc-height))))_scale(var(--toast-scale))]`,`data-[position*=bottom]:transform-[translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)-(var(--toast-index)*var(--toast-peek))-(var(--toast-shrink)*var(--toast-calc-height))))_scale(var(--toast-scale))]`,`data-limited:opacity-0`,`data-position:data-expanded:transform-[translateX(var(--toast-swipe-movement-x))_translateY(var(--toast-calc-offset-y))]`,`data-[position*=top]:data-starting-style:transform-[translateY(calc(-100%-var(--toast-inset)))]`,`data-[position*=bottom]:data-starting-style:transform-[translateY(calc(100%+var(--toast-inset)))]`,`data-[position*=top]:data-[position*=right]:data-starting-style:transform-[translateX(calc(100%+var(--toast-inset)))_translateY(var(--toast-calc-offset-y))]`,`data-ending-style:opacity-0`,`data-ending-style:not-data-limited:not-data-swipe-direction:transform-[translateY(calc(var(--toast-calc-offset-y)-100%-var(--toast-inset)))]`,`data-ending-style:data-[swipe-direction=left]:transform-[translateX(calc(var(--toast-swipe-movement-x)-100%-var(--toast-inset)))_translateY(var(--toast-calc-offset-y))]`,`data-ending-style:data-[swipe-direction=right]:transform-[translateX(calc(var(--toast-swipe-movement-x)+100%+var(--toast-inset)))_translateY(var(--toast-calc-offset-y))]`,`data-ending-style:data-[swipe-direction=up]:transform-[translateY(calc(var(--toast-swipe-movement-y)-100%-var(--toast-inset)))]`,`data-ending-style:data-[swipe-direction=down]:transform-[translateY(calc(var(--toast-swipe-movement-y)+100%+var(--toast-inset)))]`,`data-expanded:data-ending-style:data-[swipe-direction=left]:transform-[translateX(calc(var(--toast-swipe-movement-x)-100%-var(--toast-inset)))_translateY(var(--toast-calc-offset-y))]`,`data-expanded:data-ending-style:data-[swipe-direction=right]:transform-[translateX(calc(var(--toast-swipe-movement-x)+100%+var(--toast-inset)))_translateY(var(--toast-calc-offset-y))]`,`data-expanded:data-ending-style:data-[swipe-direction=up]:transform-[translateY(calc(var(--toast-swipe-movement-y)-100%-var(--toast-inset)))]`,`data-expanded:data-ending-style:data-[swipe-direction=down]:transform-[translateY(calc(var(--toast-swipe-movement-y)+100%+var(--toast-inset)))]`),"data-position":n,onPointerEnter:()=>{t.data?.sharedToastId&&Z.pause(t.data.sharedToastId,`pointer`)},onPointerLeave:()=>{t.data?.sharedToastId&&Z.resume(t.data.sharedToastId,`pointer`)},onFocusCapture:()=>{t.data?.sharedToastId&&Z.pause(t.data.sharedToastId,`focus`)},onBlurCapture:e=>{t.data?.sharedToastId&&!e.currentTarget.contains(e.relatedTarget)&&Z.resume(t.data.sharedToastId,`focus`)},style:{"--toast-index":r,"--toast-offset-y":`${i}px`},swipeDirection:n.includes(`center`)?[o?`up`:`down`]:n.includes(`left`)?[`left`,o?`up`:`down`]:[`right`,o?`up`:`down`],toast:t,children:[(0,J.jsx)(an,{dismissAfterVisibleMs:t.data?.dismissAfterVisibleMs,toastId:t.id}),(0,J.jsxs)(tt,{className:H(`pointer-events-auto flex min-h-0 items-center justify-between gap-2 overflow-y-visible py-3 pr-2 pl-3.5 text-sm transition-opacity duration-250 [overflow-x:clip] data-expanded:opacity-100`,a&&`not-data-expanded:pointer-events-none not-data-expanded:opacity-0`),children:[(0,J.jsx)(en,{...s,actionProps:t.actionProps,toastData:t.data,toastDescription:t.description,toastType:t.type}),(0,J.jsx)(Kt,{onClick:()=>{let e=t.data?.sharedToastId;e?Z.dismiss(e):Gt($,t.id,t.data?.onClose)}})]})]},t.id)}),v;t[10]!==n||t[11]!==g||t[12]!==_||t[13]!==f.Viewport||t[14]!==p?(v=(0,J.jsx)(f.Viewport,{className:p,"data-position":n,"data-slot":`toast-viewport`,style:g,children:_}),t[10]=n,t[11]=g,t[12]=_,t[13]=f.Viewport,t[14]=p,t[15]=v):v=t[15];let y;return t[16]!==v||t[17]!==d.Portal?(y=(0,J.jsx)(d.Portal,{"data-slot":`toast-portal`,children:v}),t[16]=v,t[17]=d.Portal,t[18]=y):y=t[18],y}function cn(e){return e.id}function ln(e){let t=(0,Q.c)(7),n,r;t[0]===e?(n=t[1],r=t[2]):({children:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,J.jsx)(un,{}),t[3]=i):i=t[3];let a;return t[4]!==n||t[5]!==r?(a=(0,J.jsxs)(Ve,{toastManager:Bt,...r,children:[n,i]}),t[4]=n,t[5]=r,t[6]=a):a=t[6],a}function un(){let e=(0,Q.c)(7),{toasts:t}=dt(),n=nn(),r;if(e[0]!==n||e[1]!==t){let i;e[3]===n?i=e[4]:(i=e=>zt(e.data,n),e[3]=n,e[4]=i),r=t.filter(i).map(dn),e[0]=n,e[1]=t,e[2]=r}else r=e[2];let i;return e[5]===r?i=e[6]:(i=(0,J.jsx)(ot,{"data-slot":`toast-portal-anchored`,children:(0,J.jsx)(Ue,{className:`outline-none`,"data-slot":`toast-viewport-anchored`,children:r})}),e[5]=r,e[6]=i),i}function dn(e){let t=e.data?.tooltipStyle??!1,n=e.positionerProps,r=$t(e);return n?.anchor?(0,J.jsx)(lt,{className:`z-100 max-w-[min(--spacing(64),var(--available-width))]`,"data-slot":`toast-positioner`,sideOffset:n.sideOffset??4,toast:e,children:(0,J.jsx)(et,{className:H(`dropdown-glass relative overflow-visible text-balance text-popover-foreground text-xs shadow-xl shadow-black/25 transition-[scale,opacity] data-ending-style:scale-98 data-starting-style:scale-98 data-ending-style:opacity-0 data-starting-style:opacity-0`,t?`rounded-md`:`rounded-lg`),"data-slot":`toast-popup`,toast:e,children:t?(0,J.jsx)(tt,{className:`pointer-events-auto px-2 py-1`,children:(0,J.jsx)(rt,{"data-slot":`toast-title`})}):(0,J.jsxs)(tt,{className:`pointer-events-auto flex min-h-0 items-center justify-between gap-1.5 overflow-y-visible py-3 pr-2 pl-3.5 text-sm [overflow-x:clip]`,children:[(0,J.jsx)(en,{...r,actionProps:e.actionProps,toastData:e.data,toastDescription:e.description,toastType:e.type}),(0,J.jsx)(Kt,{onClick:()=>Gt(Bt,e.id,e.data?.onClose)})]})})},e.id):null}export{Oe as _,jt as a,Pt as c,Nt as d,Et as f,Me as g,Z as h,$ as i,Mt as l,Tt as m,on as n,At as o,Dt as p,Bt as r,Ot as s,ln as t,kt as u,ke as v,De as y};
2
- //# sourceMappingURL=toast-UFTwkJWj.js.map
@@ -1,2 +0,0 @@
1
- import{a as e,t}from"./react-BUfh6y28.js";import{n}from"./jsx-runtime-DJeoFXNw.js";import{$s as r,C as i,D as a,Oh as o,Qs as s,Zo as c,Zs as l,c as u,g as d,i as f,ll as p,s as m,ts as h}from"./utils-Dv1DrWoz.js";import{L as g,R as _}from"./runtime-B6yGAVz4.js";import{D as v,S as y,d as b,f as ee,l as te,u as ne}from"./entities-Cd_YDhEa.js";import{$ as x,hn as S,on as C}from"./runtime-BhGr1QCf.js";import{a as w,t as re}from"./useParams-CZ_VOC6E.js";import{d as T}from"./toast-UFTwkJWj.js";import{s as E}from"./useSettings-BAP_yCCK.js";import{n as D}from"./server-Dc9414wM.js";import{p as ie}from"./session-logic-BaSoFnqy.js";import{a as O,i as k,n as A,o as j}from"./threadSort-Bd2rijEy.js";import{c as M,r as N}from"./projectFilesQueryState-FiXJc2AO.js";import{d as P,f as ae,i as oe,r as se,s as ce,t as F}from"./p4ProjectFile-BC2tSEs4.js";import{r as I,t as L}from"./uiStateStore-_K2mvZYL.js";var R=e(t(),1),z=n(),B=`[data-thread-item], [data-thread-selection-safe]`,V=3,H=160;function U(e){let t=(0,z.c)(6),[n,r]=R.useState(null),[i,a]=R.useState(e),o,s;t[0]!==e||t[1]!==n?(o=()=>{if(e){a(!0);return}if(n===null)return;if(typeof IntersectionObserver>`u`){a(!0);return}let t=n.closest(`[data-slot="scroll-area-viewport"]`),r=new IntersectionObserver(e=>{let[t]=e;return a(t?.isIntersecting===!0)},{root:t,rootMargin:`${H}px 0px`});return r.observe(n),()=>r.disconnect()},s=[e,n],t[0]=e,t[1]=n,t[2]=o,t[3]=s):(o=t[2],s=t[3]),R.useEffect(o,s);let c=e||i,l;return t[4]===c?l=t[5]:(l={leaseLiveStatus:c,rowRef:r},t[4]=c,t[5]=l),l}function W(e,t){let n=R.useRef(null);return e!==null&&t!==null&&(n.current={key:e,value:t}),t===null?e!==null&&n.current?.key===e?n.current.value:null:t}function G(e,t,n,r){let i=e.indexOf(t),a=e.indexOf(n);return i===-1||a===-1?[]:e.slice(Math.min(i,a),Math.max(i,a)+1).filter(r)}async function K(e){let t=new Set,n=null;for(let r of e.entries){let i=await e.delete(r,t);if(i!==null){if(i._tag===`Failure`){if(_(i))break;n??=i}else t.add(r.threadKey)}}return{deletedThreadKeys:t,firstFailure:n}}async function q(e){let t=[],n=[];for(let r of e.entries){let i=!1,a=await e.archive(r,()=>{i=!0});if((i||a._tag===`Success`)&&t.push(r.threadKey),a._tag===`Success`)continue;let o=a;if(i)n.push(o);else return{archivedThreadKeys:t,mutationFailure:o,followupFailures:n}}return{archivedThreadKeys:t,mutationFailure:null,followupFailures:n}}function J(e){return[{id:`mark-unread`,label:`Mark unread (${e.count})`},{id:`archive`,label:`Archive (${e.count})`,disabled:e.hasRunningThread},{id:`delete`,label:`Delete (${e.count})`,destructive:!0}]}function Y(e){return e.lineage.relationshipToParent===`subagent`}function le(e,t){let n=x(e);return e.filter(e=>e.archivedAt===null&&!Y(e)&&n(e)&&(t===null||t.has(`${e.environmentId}:${e.projectId}`)))}var ue={"Pending Approval":5,"Awaiting Input":4,Working:3,Connecting:3,Waiting:2.5,"Plan Ready":2,Completed:1};function de(e){let t=e.setTimeoutFn??globalThis.setTimeout,n=e.clearTimeoutFn??globalThis.clearTimeout,r=!1,i=null,a=()=>{i!==null&&(n(i),i=null)};return{sync:n=>{n?r||i!==null||(i=t(()=>{i=null,r=!0,e.onVisibilityChange(!0)},e.delayMs)):(a(),r&&(r=!1,e.onVisibilityChange(!1)))},dispose:()=>{a()}}}function fe(){let e=(0,z.c)(5),[t,n]=R.useState(!1),r=R.useRef(null),i,a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>{let e=de({delayMs:200,onVisibilityChange:e=>{n(e)},setTimeoutFn:window.setTimeout.bind(window),clearTimeoutFn:window.clearTimeout.bind(window)});return r.current=e,()=>{e.dispose(),r.current=null}},a=[],e[0]=i,e[1]=a):(i=e[0],a=e[1]),R.useEffect(i,a);let o;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=e=>{r.current?.sync(e)},e[2]=o):o=e[2];let s=o,c;return e[3]===t?c=e[4]:(c={showThreadJumpHints:t,updateThreadJumpHintsVisibility:s},e[3]=t,e[4]=c),c}function pe(e,t){return e===void 0?t:e??void 0}function me(e){if(!e.latestRun?.completedAt)return!1;let t=Date.parse(e.latestRun.completedAt);if(Number.isNaN(t)||!e.lastVisitedAt)return!1;let n=Date.parse(e.lastVisitedAt);return Number.isNaN(n)?!0:t>n}function he(e){return e===null||!e.closest(B)}function ge(e){return e>1}function _e(e,t){return e===null||!(`closest`in e)||typeof e.closest!=`function`?null:e.closest(t)}function ve(e){return typeof e!=`object`||!e?!1:_e(e,`a[href]`)!==null||_e(`parentElement`in e&&e.parentElement!==null&&typeof e.parentElement==`object`?e.parentElement:null,`a[href]`)!==null}function ye(e){let{getId:t,getPreferenceIds:n,items:r,preferredIds:i}=e;if(i.length===0)return[...r];let a=new Map;for(let[e,i]of r.entries()){let r=n?.(i)??[t(i)];for(let t of new Set(r)){let n=a.get(t);n?n.push(e):a.set(t,[e])}}let o=new Set,s=i.flatMap(e=>{let t=a.get(e)?.find(e=>!o.has(e));return t===void 0?[]:(o.add(t),[r[t]])}),c=r.filter((e,t)=>!o.has(t));return[...s,...c]}function be(e,t=V){return e.slice(0,Math.max(0,t))}function xe(e){let{currentThreadId:t,direction:n,threadIds:r}=e;if(r.length===0)return null;if(t===null)return n===`previous`?r.at(-1)??null:r[0]??null;let i=r.indexOf(t);return i===-1?null:n===`previous`?i>0?r[i-1]??null:null:i<r.length-1?r[i+1]??null:null}function Se(e){return e.button===2||e.isMac&&e.button===0&&e.ctrlKey}function Ce(e){return e.hasPendingApprovals||e.pendingSubagentRequest===`approval`?`approval`:e.hasPendingUserInput||e.pendingSubagentRequest===`user_input`?`input`:e.runtime!==null&&[`preparing`,`queued`,`starting`,`running`,`waiting`].includes(e.runtime.status)?`working`:e.runtime?.status===`idle`?`waiting`:e.runtime?.status===`failed`?e.runtime.lastErrorClass===`usage_limit`?`limited`:`failed`:`ready`}function we(e,t){let n=O(e,t),r=n.filter(e=>e.pinnedAt!=null);return r.length===0?n:[...k(r),...n.filter(e=>e.pinnedAt==null)]}function Te(e,t){let n=u(t);if(n.length===0)return!1;let r=u(S(e).join(` `));return n.split(` `).every(e=>r.includes(e))}function Ee(e){let{thread:t}=e;return t.hasPendingApprovals||t.pendingSubagentRequest===`approval`?{label:`Pending Approval`,colorClass:`text-amber-600 dark:text-amber-300/90`,dotClass:`bg-amber-500 dark:bg-amber-300/90`,pulse:!1}:t.hasPendingUserInput||t.pendingSubagentRequest===`user_input`?{label:`Awaiting Input`,colorClass:`text-indigo-600 dark:text-indigo-300/90`,dotClass:`bg-indigo-500 dark:bg-indigo-300/90`,pulse:!1}:t.runtime?.status===`running`||t.runtime?.status===`waiting`?{label:`Working`,colorClass:`text-sky-600 dark:text-sky-300/80`,dotClass:`bg-sky-500 dark:bg-sky-300/80`,pulse:!0}:t.runtime?.status===`preparing`||t.runtime?.status===`starting`||t.runtime?.status===`queued`?{label:`Connecting`,colorClass:`text-sky-600 dark:text-sky-300/80`,dotClass:`bg-sky-500 dark:bg-sky-300/80`,pulse:!0}:C(t.pendingBackgroundTasks??[])?{label:`Waiting`,colorClass:`text-sidebar-muted-foreground`,dotClass:`bg-sidebar-muted-foreground`,pulse:!1}:!t.hasPendingUserInput&&t.interactionMode===`plan`&&ie(t.latestRun,t.runtime)&&t.hasActionableProposedPlan?{label:`Plan Ready`,colorClass:`text-violet-600 dark:text-violet-300/90`,dotClass:`bg-violet-500 dark:bg-violet-300/90`,pulse:!1}:me(t)?{label:`Completed`,colorClass:`text-emerald-600 dark:text-emerald-300/90`,dotClass:`bg-emerald-500 dark:bg-emerald-300/90`,pulse:!1}:null}function De(e){let t=null;for(let n of e)n!==null&&(t===null||ue[n.label]>ue[t.label])&&(t=n);return t}function Oe(e,t){return t.projectExpanded?t.isThreadListExpanded||e.length<=t.previewCount?e:e.slice(0,t.previewCount):[]}function ke(e){let{deletedThreadId:t,deletedThreadIds:n,sortOrder:r,threads:i}=e,a=i.find(e=>e.id===t);return a?O(i.filter(e=>e.projectId===a.projectId&&e.id!==t&&!n?.has(e.id)),r)[0]?.id??null:null}function Ae(e,t,n){return t.length>0?t.reduce((e,t)=>Math.max(e,A(t,n)),-1/0):n===`created_at`?j(e.createdAt)??-1/0:j(e.updatedAt??e.createdAt)??-1/0}function X(e,t,n,r){return t===`manual`?[...e]:e.map(e=>({project:e,timestamp:Ae(e,n(e),t)})).sort((e,t)=>(t.timestamp===e.timestamp?0:t.timestamp>e.timestamp?1:-1)||r(e.project,t.project)).map(({project:e})=>e)}function je(e,t,n){let r=new Map;for(let e of t){let t=r.get(e.projectId)??[];t.push(e),r.set(e.projectId,t)}return X(e,n,e=>r.get(e.id)??[],(e,t)=>e.title.localeCompare(t.title)||e.id.localeCompare(t.id))}function Me(e,t,n){let r=new Map(e.flatMap(e=>e.memberProjectRefs.map(t=>[`${t.environmentId}\0${t.projectId}`,e.projectKey]))),i=new Map;for(let e of t){if(e.archivedAt!==null)continue;let t=r.get(`${e.environmentId}\0${e.projectId}`);if(!t)continue;let n=i.get(t);n?n.push(e):i.set(t,[e])}return X(e,n,e=>i.get(e.projectKey)??[],(e,t)=>e.title.localeCompare(t.title)||e.projectKey.localeCompare(t.projectKey))}function Ne(e,t,n){return Me(e,le(t,null),n)}function Pe(e,t,n){let r=(e,t)=>`${e}\u0000${t}`,i=new Map;for(let e of t){if(e.archivedAt!==null)continue;let t=r(e.environmentId,e.projectId),n=i.get(t)??[];n.push(e),i.set(t,n)}return X(e,n,e=>i.get(r(e.environmentId,e.id))??[],(e,t)=>e.title.localeCompare(t.title)||e.environmentId.localeCompare(t.environmentId)||e.id.localeCompare(t.id))}function Z(e){return e.envMode!==`local`&&e.newWorktreesStartFromOrigin}function Fe(e){return e.projectDefaultSelection??(e.carrySourceDraftId===e.destinationDraftId?null:e.carrySelection)}function Ie(e){let t=e?.activeProvider;return e?.modelSelectionExplicit===!0&&t!=null&&e.modelSelectionByProvider[t]!==void 0}function Le(e){return e.activeThread?l(e.activeThread.environmentId,e.activeThread.projectId):e.activeDraftThread?l(e.activeDraftThread.environmentId,e.activeDraftThread.projectId):e.defaultProjectRef}async function Re(e){let t=Le(e);return t?(await e.handleNewThread(t),!0):!1}async function ze(e,t){let n=await g(c,N(e,t,p),{reportDefect:!1,reportFailure:!1}),r=M(e,t,p,M(e,t,n._tag===`Success`?n.value.relativePath:p,n._tag===`Success`?n.value:null));return r===null||r.truncated?null:F(r.contents)}function Q(e){return{...e?.branch===void 0?{}:{branch:e.branch},...e?.worktreePath===void 0?{}:{worktreePath:e.worktreePath},...e?.envMode===void 0?{}:{envMode:e.envMode},...e?.startFromOrigin===void 0?{}:{startFromOrigin:e.startFromOrigin}}}function $(){let e=(0,z.c)(7),t=h(D),n=E(ae),c=w(),l;e[0]===c.state.matches?l=e[1]:(l=()=>{let e=c.state.matches[c.state.matches.length-1]?.params??{};return T(e)},e[0]=c.state.matches,e[1]=l);let u=l,p;return e[2]!==t||e[3]!==u||e[4]!==n||e[5]!==c?(p=(e,l)=>{let p=ne(),h=t.get(e.environmentId)?.settings??o,{getComposerDraft:g,getDraftSessionByLogicalProjectKey:_,getDraftSession:v,getDraftThread:y,applyStickyState:x,setDraftThreadContext:S,setLogicalProjectDraftThreadId:C,setModelSelection:w}=a.getState(),re=c.state.location.href,T=()=>c.state.location.href!==re,E=u(),D=E?.kind===`server`?b(E.threadRef):null,ie=E?.kind===`draft`?v(E.draftId):null,O=E?g(E.kind===`server`?E.threadRef:E.draftId):null,k=O?.activeProvider??null,A=(k?O?.modelSelectionByProvider[k]??null:null)??D?.modelSelection??null,j=O?.interactionMode??D?.interactionMode??ie?.interactionMode??null,M=p.find(t=>t.id===e.projectId&&t.environmentId===e.environmentId),N=()=>T()||M!==void 0&&te(e)===null,P=oe(h,M?.id??null,M),ae=P.settings.defaultModelSelection,F=P.settings.defaultRuntimeMode,I=e=>Fe({projectDefaultSelection:ae??null,carrySelection:A,carrySourceDraftId:E?.kind===`draft`?E.draftId:null,destinationDraftId:e}),L=async()=>{let n=M!==void 0&&P.settings.defaultThreadEnvMode===null?await ze(M.environmentId,M.workspaceRoot):null;return se({projectSettings:oe(h,M?.id??null,M,n),workspaceRoot:M?.workspaceRoot??null,newProjectsRoot:t.get(e.environmentId)?.newProjectsRoot,projectHasThreads:ee().some(t=>t.environmentId===e.environmentId&&t.projectId===e.projectId)})},R=M?ce(M,n):r(e),z=l?.branch!==void 0,B=l?.worktreePath!==void 0,V=l?.envMode!==void 0,H=l?.startFromOrigin!==void 0,U=_(R),W=U?s(U.environmentId,U.threadId):null,G=U!==null&&U.promotedTo==null&&W!==null&&b(W)===null?U:null;W&&G===null&&i(W);let K=G&&!d(g(G.draftId))?G:null,q=E?E.kind===`server`?y(E.threadRef):v(E.draftId):null;if(K)return(async()=>{let t=E?.kind===`draft`&&E.draftId===K.draftId,n=z||B||V||H,r=null;if(n)r=Q(l);else if(!t){let e=await L();if(N())return null;let t=u(),n=t?.kind===`draft`&&t.draftId===K.draftId,i=W!==null&&b(W)!==null,a=_(R)?.draftId!==K.draftId,o=d(g(K.draftId));if(n||i||a||o)return null;r={branch:null,worktreePath:null,envMode:e,startFromOrigin:Z({envMode:e,newWorktreesStartFromOrigin:P.settings.newWorktreesStartFromOrigin})}}if(r&&S(K.draftId,{...r,...t?{}:{runtimeMode:F},...j?{interactionMode:j}:{}}),!Ie(g(K.draftId))){x(K.draftId);let e=I(K.draftId);e&&w(K.draftId,e,{replaceOptions:!0})}C(R,e,K.draftId,{threadId:K.threadId,...r,...t?{}:{runtimeMode:F},...j?{interactionMode:j}:{}});let i={draftId:K.draftId,threadId:K.threadId},a=u();return a?.kind===`draft`&&a.draftId===K.draftId||await c.navigate({to:`/draft/$draftId`,params:{draftId:K.draftId},replace:l?.replace??!1}),i})();if(q&&E?.kind===`draft`&&q.logicalProjectKey===R&&q.promotedTo==null&&!d(g(E.draftId)))return(z||B||V||H)&&S(E.draftId,Q(l)),C(R,e,E.draftId,{threadId:q.threadId,createdAt:q.createdAt,runtimeMode:q.runtimeMode,interactionMode:q.interactionMode,...Q(l)}),Promise.resolve({draftId:E.draftId,threadId:q.threadId});let J=f(),Y=m(),le=new Date().toISOString();return(async()=>{let t=l?.envMode??await L();if(N())return null;let n=_(R);if(n&&n.draftId!==U?.draftId&&b(s(n.environmentId,n.threadId))===null)return C(R,e,n.draftId,{threadId:n.threadId,createdAt:n.createdAt,runtimeMode:n.runtimeMode,interactionMode:n.interactionMode,...Q(l)}),await c.navigate({to:`/draft/$draftId`,params:{draftId:n.draftId},replace:l?.replace??!1}),{draftId:n.draftId,threadId:n.threadId};C(R,e,J,{threadId:Y,createdAt:le,branch:l?.branch??null,worktreePath:l?.worktreePath??null,envMode:t,startFromOrigin:l?.startFromOrigin??Z({envMode:t,newWorktreesStartFromOrigin:P.settings.newWorktreesStartFromOrigin}),runtimeMode:F,...j?{interactionMode:j}:{}}),x(J);let r=I(J);return r&&w(J,r,{replaceOptions:!0}),await c.navigate({to:`/draft/$draftId`,params:{draftId:J},replace:l?.replace??!1}),{draftId:J,threadId:Y}})()},e[2]=t,e[3]=u,e[4]=n,e[5]=c,e[6]=p):p=e[6],p}function Be(){let e=(0,z.c)(16),t=I(We),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={strict:!1,select:Ue},e[0]=n):n=e[0];let r=re(n),i=r?.kind===`server`?r.threadRef:null,o=r?.kind===`draft`?r.draftId:null,s=v(i),c=a(He),u;e[1]!==c||e[2]!==r?(u=()=>r?r.kind===`server`?c(r.threadRef):a.getState().getDraftSession(r.draftId):null,e[1]=c,e[2]=r,e[3]=u):u=e[3];let d=a(u),f=y(),p;e[4]!==t||e[5]!==f?(p=ye({items:f,preferredIds:t,getId:P,getPreferenceIds:Ve}),e[4]=t,e[5]=f,e[6]=p):p=e[6];let m=p,h=$(),g;e[7]===m[0]?g=e[8]:(g=m[0]?l(m[0].environmentId,m[0].id):null,e[7]=m[0],e[8]=g);let _;return e[9]!==d||e[10]!==s||e[11]!==h||e[12]!==o||e[13]!==i||e[14]!==g?(_={activeDraftThread:d,activeThread:s,defaultProjectRef:g,handleNewThread:h,routeDraftId:o,routeThreadRef:i},e[9]=d,e[10]=s,e[11]=h,e[12]=o,e[13]=i,e[14]=g,e[15]=_):_=e[15],_}function Ve(e){return[P(e),L(e.workspaceRoot)]}function He(e){return e.getDraftThread}function Ue(e){return T(e)}function We(e){return e.projectOrder}export{W as A,Ee as C,Pe as D,je as E,fe as M,Ne as O,pe as S,Me as T,xe as _,Le as a,G as b,J as c,be as d,Se as f,Te as g,ye as h,Z as i,U as j,we as k,K as l,ge as m,$ as n,Re as o,ve as p,Ie as r,q as s,Be as t,ke as u,De as v,he as w,Ce as x,Oe as y};
2
- //# sourceMappingURL=useHandleNewThread-nNF3Xnbt.js.map
@@ -1,3 +0,0 @@
1
- import{a as e,t}from"./react-BUfh6y28.js";import{n}from"./jsx-runtime-DJeoFXNw.js";import{$x as r,$y as i,Bg as a,Bh as o,Dh as s,ES as c,El as l,F_ as u,I_ as d,Ib as f,Jy as p,Kb as ee,Kh as te,L_ as ne,Nh as re,Ob as ie,Oh as ae,Ol as oe,Os as se,Pc as ce,Qv as le,ST as m,Sb as ue,Th as de,Tl as fe,Ts as pe,Wh as me,Ws as he,Zo as ge,_h as _e,as as h,ax as ve,bT as g,bh as ye,cE as be,db as xe,ex as Se,f_ as Ce,gb as we,iE as _,js as Te,kb as Ee,ks as De,m_ as Oe,ns as ke,nv as Ae,nx as je,ox as Me,ps as v,qb as Ne,qh as Pe,rE as Fe,rs as Ie,rx as Le,sb as Re,ts as y,uv as ze,vb as Be,wS as Ve,wT as b,wb as He,xh as Ue}from"./utils-Dv1DrWoz.js";import{At as We,E as Ge,I as Ke,R as qe,Sn as Je,T as Ye,W as Xe,_t as x}from"./runtime-B6yGAVz4.js";import{Dt as Ze,T as Qe,jt as $e,t as et}from"./runtime-BhGr1QCf.js";import{i as S}from"./toast-UFTwkJWj.js";import{f as C,h as w,m as tt,u as nt}from"./server-Dc9414wM.js";import{i as rt,n as it,s as at,t as ot}from"./session-B6T_Arzf.js";import{t as st}from"./use-atom-command-BT7sz8Lx.js";import{D as ct,M as lt,N as ut,P as dt,S as ft,c as pt,i as T,n as E,o as mt,r as ht,x as gt,y as _t}from"./themePalette-01TQqdkx.js";var D=e(t(),1),O=n();function vt(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 yt(e){let t=Ie(t=>h(n=>{let r=n(e.catalogValueAtom).entries.get(t);if(r===void 0)return null;let i=Fe(se(n(e.stateAtom(t))),()=>Je);return{entry:r,connection:r.unsupportedReason===void 0?i===Je&&r.enabled?{phase:`connecting`,error:null,traceId:null}:$e(i):{phase:`unsupported`,error:r.unsupportedReason,traceId:null},serverConfig:n(e.serverConfigValueAtom(t))}}).pipe(v(`environment-presentation:${t}`))),n=new Map;return{presentationAtom:t,presentationsAtom:h(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 vt(n,i)||(n=i),n}).pipe(v(`environment-presentations`))}}function bt(e,t){return{environmentId:e,environmentLabel:t.entry.target.label,displayUrl:Ze(t.entry)??``,isRelayManaged:We(t.entry),isEnabled:t.entry.enabled,connectionState:t.connection.phase,connectionError:t.connection.error,connectionErrorTraceId:t.connection.traceId}}function xt(e){let t=h(t=>{let n=[...t(e.catalogValueAtom).entries.keys()],r=_(t.self());return r!==null&&r.length===n.length&&n.every((e,t)=>e===r[t])?r:n}),n=h(t=>{let n=[...t(e.catalogValueAtom).entries].map(([e,t])=>({environmentId:e,label:t.target.label})),r=_(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=Ie(t=>h(n=>{let r=n(e.presentationAtom(t));if(r===null)return null;let i=bt(t,r),a=_(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=h(t=>{let n=[];for(let i of t(e.catalogValueAtom).entries.keys()){let e=t(r(i));e!==null&&n.push(e)}let i=_(t.self());return i!==null&&i.length===n.length&&n.every((e,t)=>e===i[t])?i:n}).pipe(v(`environment-connection-summaries`));return{environmentIdsAtom:t,connectedEnvironmentIdsAtom:h(e=>{let n=e(t).filter(t=>e(r(t))?.connectionState===`connected`),i=_(e.self());return i!==null&&i.length===n.length&&n.every((e,t)=>e===i[t])?i:n}),identitiesAtom:n,environmentsAtom:i,machineByIdAtom:h(n=>{let r=new Map(n(t).map(t=>[t,oe(n(e.presentationAtom(t))?.serverConfig??null)])),i=_(n.self());return i!==null&&vt(i,r)?i:r}),pullRequestsSupportedAtom:h(n=>n(t).some(t=>n(e.presentationAtom(t))?.serverConfig?.environment.capabilities.pullRequests===!0))}}var St=yt({catalogValueAtom:w.catalogValueAtom,stateAtom:w.stateAtom,serverConfigValueAtom:C.configValueAtom}),Ct=xt({catalogValueAtom:w.catalogValueAtom,presentationAtom:St.presentationAtom}),wt=h(null).pipe(v(`web-environment-presentation:empty`));function Tt(e){let t=(0,O.c)(5),n=y(w.catalogValueAtom),r;t[0]===e?r=t[1]:(r=e===null?wt:St.presentationAtom(e),t[0]=e,t[1]=r);let i=y(r),a;return t[2]!==n.isReady||t[3]!==i?(a={isReady:n.isReady,presentation:i},t[2]=n.isReady,t[3]=i,t[4]=a):a=t[4],a}var Et={status:`idle`},k=Et,A=null,j=[],M=0,Dt=new Set;function N(e){k=e;for(let e of Dt)e()}function Ot(e){A?.resolve(e);for(let t of j)t.resolve(e);A=null,j=[]}function kt(){return k}function At(e){return Dt.add(e),()=>{Dt.delete(e)}}function jt(){M+=1;let e=!0;return()=>{e&&(e=!1,M=Math.max(0,M-1),M===0&&(Ot(!1),N(Et)))}}function Mt(e,t){if(M!==0)return new Promise(n=>{let r={message:e,variant:t?.variant??`default`,resolve:n};A||k.status===`closing`?j.push(r):(A=r,N({status:`confirming`,message:e,variant:r.variant}))})}function Nt(){return k.status!==`idle`||A!==null||j.length>0}function Pt(e){if(k.status!==`confirming`||!A)return;let t=A;A=null,t.resolve(e),N({status:`closing`,message:k.message,variant:k.variant})}function Ft(){if(k.status!==`closing`)return;let e=j.shift();e?(A=e,N({status:`confirming`,message:e.message,variant:e.variant})):N(Et)}var It={Ctrl:`⌃`,Alt:`⌥`,Shift:`⇧`,Super:`⌘`,CmdOrCtrl:`⌘`};function Lt(e,t=navigator.platform){let n=e.split(`+`),r=n.pop()??``;return ce(t)?`${n.map(e=>It[e]??e).join(``)}${r}`:[...n.map(e=>e===`CmdOrCtrl`?`Ctrl`:e===`Super`?`Meta`:e),r].join(`+`)}var Rt=`http://www.w3.org/2000/svg`,zt={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 Bt(e,t){let n=zt[e];if(!n||typeof document.createElementNS!=`function`)return null;let r=document.createElementNS(Rt,`svg`);r.setAttribute(`xmlns`,Rt),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(Rt,e.tag);for(let[n,r]of Object.entries(e.attrs))t.setAttribute(n,r);r.appendChild(t)}return r}function Vt(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 Ht(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 P=null;function Ut(){return P!==null}function Wt(){P?.(),P=null}function Gt(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,P===c&&(P=null),document.removeEventListener(`keydown`,u),document.removeEventListener(`pointerdown`,d,!0),document.removeEventListener(`contextmenu`,f,!0);let t=Ht(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&&!Ht(e.target,i)&&l(null)},f=e=>{s&&!Ht(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?Bt(`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=Bt(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=Lt(t.accelerator),e.setAttribute(`aria-hidden`,`true`),a.setAttribute(`aria-keyshortcuts`,t.accelerator.replace(`CmdOrCtrl`,ce(navigator.platform)?`Meta`:`Control`)),a.appendChild(e)}if(e){a.setAttribute(`aria-haspopup`,`menu`),a.setAttribute(`aria-expanded`,`false`);let e=Bt(`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&&Vt(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(()=>{Vt(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),P&&P(),P=c,requestAnimationFrame(()=>{s=!0})})}var Kt=`p4code:client-settings:v1`;function qt(){return typeof window<`u`}function Jt(){return qt()?De(Kt,_e):null}function Yt(e){qt()&&Te(Kt,e,_e)}var Xt;function Zt(){return{dialogs:{pickFolder:async e=>window.desktopBridge?window.desktopBridge.pickFolder(e):null,confirm:async(e,t)=>Mt(e,t)??!1},shell:{openExternal:async e=>{if(window.desktopBridge){if(!await window.desktopBridge.openExternal(e))throw Error(`Unable to open link.`)}else 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):Gt(e,t),close:async()=>{window.desktopBridge||Wt()}},persistence:{getClientSettings:async()=>window.desktopBridge?window.desktopBridge.getClientSettings():Jt(),setClientSettings:async e=>{if(window.desktopBridge)return window.desktopBridge.setClientSettings(e);Yt(e)}}}}function Qt(){return Zt()}function $t(){if(typeof window<`u`)return Xt||(Xt=Qt(),Xt)}function en(){let e=$t();if(!e)throw Error(`Local API not found`);return e}var F=`p4code:theme`,tn=`(prefers-color-scheme: dark)`,I={theme:`system`,resolvedTheme:`light`,systemDark:!1,followSystem:!0,appearanceMode:`system`,themeHalves:null};function nn(){return L()}function rn(){return typeof window>`u`?{}:an()}function L(){if(typeof window>`u`)return null;try{return ct(window.localStorage.getItem(T))}catch{return null}}function an(){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 on(e){return`${e?.light??``}|${e?.dark??``}`}var sn=`theme-color`,cn=`meta[name="${sn}"][data-dynamic-theme-color="true"]`,R=class extends xe()(`ThemeStorageError`,{operation:i([`read`,`write`]),storageKey:Re,theme:f(mt),cause:p()}){get message(){return`Failed to ${this.operation} theme preference for ${this.storageKey}.`}},ln=Ee(R),un=class extends xe()(`DesktopThemeSyncError`,{theme:mt,cause:p()}){get message(){return`Failed to sync the ${this.theme} theme to the desktop shell.`}},dn=Ee(un),z=[],B=null,fn=!0,pn=null,V=null,H=null;function U(){fn=!0;for(let e of z)e()}function mn(){return typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(tn).matches}function hn(e){if(typeof window>`u`)return e===`system`;try{let e=window.localStorage.getItem(ht);if(e===`true`)return!0;if(e===`false`)return!1}catch{}return e===`system`}function gn(e){return e===`light`||e===`dark`||e===`system`}function W(e){if(typeof window<`u`)try{let e=window.localStorage.getItem(E);if(gn(e))return e}catch{}return hn(e)?`system`:_t(e)??`light`}function _n(e){if(typeof window<`u`)try{window.localStorage.setItem(E,e)}catch(e){throw new R({operation:`write`,storageKey:E,cause:e})}}function vn(){if(typeof window>`u`)return I.theme;let e;try{e=window.localStorage.getItem(F)}catch(e){throw new R({operation:`read`,storageKey:F,cause:e})}return e!==null&&ft(e)?e:I.theme}function yn(e){if(typeof window<`u`)try{window.localStorage.setItem(F,e),H=null}catch(t){throw new R({operation:`write`,storageKey:F,theme:e,cause:t})}}function G(){if(H!==null)return I.theme;try{return vn()}catch(e){let t=ln(e)?e:new R({operation:`read`,storageKey:F,cause:e});return H=t,console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...x(t)}),I.theme}}function bn(){let e=document.querySelector(cn);return e||(e=document.createElement(`meta`),e.name=sn,e.setAttribute(`data-dynamic-theme-color`,`true`),document.head.append(e),e)}function xn(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 Sn(){return document.querySelector(`main[data-slot='sidebar-inset']`)??document.querySelector(`[data-slot='sidebar-inner']`)??document.body}function Cn(){if(typeof document>`u`||typeof getComputedStyle>`u`)return;let e=getComputedStyle(document.documentElement),t=document.documentElement.dataset.themeId?xn(e.getPropertyValue(`--app-chrome-background`)):null,n=xn(getComputedStyle(Sn()).backgroundColor),r=xn(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="${sn}"]`);if(a.length===0)bn().setAttribute(`content`,i);else 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?mn():!1,o=L();if(V?.theme===e&&V.systemDark===a&&V.followSystem===i&&V.appearanceMode===r&&on(V.themeHalves)===on(o)){Tn(e,i,r);return}t&&document.documentElement.classList.add(`no-transitions`);let s=ut(e,a,i,r,o);pt(dt(e,o,s),s),document.documentElement.classList.toggle(`dark`,s===`dark`),V={theme:e,systemDark:a,followSystem:i,appearanceMode:r,themeHalves:o},Cn(),Tn(e,i,r),t&&(document.documentElement.offsetHeight,requestAnimationFrame(()=>{document.documentElement.classList.remove(`no-transitions`)}))}async function wn(e,t,n,r,i=L()){try{await e.setTheme(lt(t,n,r,i))}catch(e){throw new un({theme:t,cause:e})}}function Tn(e,t,n){if(typeof window>`u`)return;let r=window.desktopBridge,i=L(),a=lt(e,t,n,i);r&&typeof r.setTheme==`function`&&pn!==a&&(pn=a,wn(r,e,t,n,i).catch(t=>{let n=dn(t)?t:new un({theme:e,cause:t});console.error(n.message,{theme:n.theme,...x(n)}),pn===a&&(pn=null)}))}typeof document<`u`&&typeof window<`u`&&K(G());function En(){if(typeof window>`u`)return I;if(!fn&&B)return B;fn=!1;let e=G(),t=W(e),n=t===`system`,r=n?mn():!1,i=L(),a=ut(e,r,n,t,i);return B&&B.theme===e&&B.resolvedTheme===a&&B.systemDark===r&&B.followSystem===n&&B.appearanceMode===t&&on(B.themeHalves)===on(i)||(B={theme:e,resolvedTheme:a,systemDark:r,followSystem:n,appearanceMode:t,themeHalves:i}),B}function Dn(){return I}function On(){let e=G();W(e)===`system`&&K(e,{suppressTransitions:!0}),U()}function kn(e){e.key===F?(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),gt(),V=null,K(G(),{suppressTransitions:!0}),U())}var An=null;function jn(e){if(typeof window>`u`)return()=>{};if(z.push(e),!An){let e=typeof window.matchMedia==`function`?window.matchMedia(tn):null;e?.addEventListener(`change`,On),window.addEventListener(`storage`,kn),An=()=>{e?.removeEventListener(`change`,On),window.removeEventListener(`storage`,kn)}}return()=>{z=z.filter(t=>t!==e),z.length===0&&(An?.(),An=null)}}function Mn(){let e=(0,D.useSyncExternalStore)(jn,En,Dn),{theme:t,resolvedTheme:n}=e,r=(0,D.useCallback)(e=>{if(typeof window>`u`)return!1;try{_n(W(G()));let t=window.localStorage.getItem(T);window.localStorage.removeItem(T);try{yn(e)}catch(e){if(t!==null)try{window.localStorage.setItem(T,t)}catch{}throw e}}catch(t){let n=ln(t)?t:new R({operation:`write`,storageKey:F,theme:e,cause:t});return console.error(n.message,{operation:n.operation,storageKey:n.storageKey,theme:e,...x(n)}),!1}return K(e,{suppressTransitions:!0}),U(),!0},[]),i=(0,D.useCallback)(e=>{if(typeof window>`u`)return!1;try{_n(e)}catch(e){let t=ln(e)?e:new R({operation:`write`,storageKey:E,cause:e});return console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...x(t)}),!1}return H=null,K(G(),{suppressTransitions:!0}),U(),!0},[]),a=(0,D.useCallback)(e=>{let n=W(t),r=e?`system`:n===`system`?_t(t)??`light`:n;return i(r)},[i,t]),o=(0,D.useCallback)((e,t)=>{if(typeof window>`u`)return!1;try{let n={...an()};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 R({operation:`write`,storageKey:T,cause:e});return console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...x(t)}),!1}return K(G(),{suppressTransitions:!0}),U(),!0},[]),s=(0,D.useCallback)(()=>{if(typeof window>`u`)return!1;try{window.localStorage.removeItem(T)}catch(e){let t=new R({operation:`write`,storageKey:T,cause:e});return console.error(t.message,{operation:t.operation,storageKey:t.storageKey,...x(t)}),!1}return K(G(),{suppressTransitions:!0}),U(),!0},[]),c=(0,D.useCallback)(({preservePreview:e=!1}={})=>{typeof window<`u`&&(V=null,K(G(),{suppressTransitions:!0,preservePreview:e}),U())},[]);return(0,D.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 Nn=Be(ie(we)),Pn=Me(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??``),Nn(t).pipe(c(e=>e.issue))}),Fn=new Se(Pn,ve());Le().pipe(je(ve({space:2})));var In=e=>Re.pipe(ue(e,Fn)),Ln={performance:{profile:`performance`,automaticGitFetchInterval:m(15),providerHealthRefreshInterval:g(1),hostPowerMonitorActiveInterval:m(30),hostPowerMonitorIdleInterval:g(2),idleClientTtl:m(45),pauseWhenHostLocked:!0,pauseWhenHostLowPower:!1,pauseWhenClientLowPower:!1,pauseWhenOnBattery:!1},balanced:{profile:`balanced`,automaticGitFetchInterval:ye,providerHealthRefreshInterval:s,hostPowerMonitorActiveInterval:m(30),hostPowerMonitorIdleInterval:g(5),idleClientTtl:m(45),pauseWhenHostLocked:!0,pauseWhenHostLowPower:!0,pauseWhenClientLowPower:!0,pauseWhenOnBattery:!1},"battery-saver":{profile:`battery-saver`,automaticGitFetchInterval:m(0),providerHealthRefreshInterval:g(15),hostPowerMonitorActiveInterval:g(1),hostPowerMonitorIdleInterval:g(10),idleClientTtl:m(45),pauseWhenHostLocked:!0,pauseWhenHostLowPower:!0,pauseWhenClientLowPower:!0,pauseWhenOnBattery:!0}};function q(e){return Ln[e]}function Rn(e){return e.profile===`custom`?e.baseProfile??`balanced`:e.profile}function zn(e){let t=Rn(e),n=Ln[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 b(e)===b(t)}function Bn(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 Vn(e){if(e.profile!==`custom`)return{schemaVersion:1,profile:e.profile,overrides:{}};let t=zn(e),n=[Rn(e),`balanced`,`performance`,`battery-saver`];for(let e of n)if(Bn(t,Ln[e]))return{schemaVersion:1,profile:e,overrides:{}};let r=Rn(e),i=Ln[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 Hn(e){let t={schemaVersion:1,profile:Ue,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`||b(e.automaticGitFetchInterval)!==b(ye)||b(e.providerHealthRefreshInterval)!==b(s);return zn(n&&i?{schemaVersion:1,profile:b(e.automaticGitFetchInterval)===b(q(r).automaticGitFetchInterval)&&b(e.providerHealthRefreshInterval)===b(q(r).providerHealthRefreshInterval)?r:`custom`,baseProfile:r,overrides:{...b(e.automaticGitFetchInterval)===b(q(r).automaticGitFetchInterval)?{}:{automaticGitFetchInterval:e.automaticGitFetchInterval},...b(e.providerHealthRefreshInterval)===b(q(r).providerHealthRefreshInterval)?{}:{providerHealthRefreshInterval:e.providerHealthRefreshInterval}}}:e.backgroundActivity)}function Un(e){let t=Hn(e);return Vn({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 Wn=In(re);He(Wn);function Gn(e,t){let n=e.providerInstances[t.instanceId];return n===void 0?o(t.instanceId):Pe(n)}var Kn=[`codex`,`claudeAgent`,`cursor`,`grok`,`muse`,`pi`,`opencode`,`antigravity`].map(e=>u.make(e));function qn(e,t,n){let r=[...Kn.map(e=>[ne(e),e]),...n?.includeConfiguredInstances===!0?Object.entries(e).flatMap(([e,t])=>Kn.includes(t.driver)?[[d.make(e),t.driver]]:[]):[]].find(([e,n])=>t(e,n));if(r===void 0)return null;let[i,a]=r,o=n?.defaultModelSelection,s=e[i]?.config;return o?.instanceId===i&&he(s?.customModels).some(e=>e.slug===o.model)?o:{instanceId:i,model:Oe[a]??Ce[a]??`gpt-6-luna`}}function Jn(e,t,n){let r=e.sourceControlWriterModelSelection;if(!r||!te(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&&fe(i)&&l(i)?r:e.textGenerationModelSelection}function Yn(e,t,n){let r=e.reviewGuideModelSelection;if(r&&te(e,n,r.instanceId)){let e=t?.find(e=>e.instanceId===r.instanceId);if(t===void 0||e?.enabled===!0&&fe(e)&&l(e))return r}return Jn(e,t,n)}function Xn(e,t={}){return{favorites:e.favorites??t.favorites??[],providerModelPreferences:e.providerModelPreferences??t.providerModelPreferences??{}}}function Zn(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 Qn=new Set([`continueThreadsAfterServerUpdate`,`autoResumeLimitedThreads`,`snoozeLimitedThreads`,`newWorktreesStartFromOrigin`,`sourceControlWritingStyle`,`textGenerationModelSelection`]);function $n(e){let t={},n={};for(let[r,i]of Object.entries(e))Qn.has(r)?t[r]=i:n[r]=i;return{sharedPatch:t,localPatch:n}}function er(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)||!Gn(n,{...n.textGenerationModelSelection,...e.textGenerationModelSelection}))&&(e=Ne(e,[`textGenerationModelSelection`])),t?.threadRestartContinuation===!0?e:Ne(e,[`continueThreadsAfterServerUpdate`])}function tr(e){return e.connection.phase===`connected`&&e.serverConfig!==null}function nr(e){let t=e.atom(le(Ge.pipe(Ve(e=>a(e.state)))),{initialValue:Ye});return{stateAtom:t,stateValueAtom:h(e=>Fe(se(e(t)),()=>Ye)).pipe(v(`relay-environment-discovery-value`)),refresh:Ke(e,{label:`relay-environment-discovery:refresh`,concurrency:{mode:`singleFlight`,key:()=>`refresh`},execute:e=>Ge.pipe(r(e=>e.refresh))})}}var rr=nr(et);function ir(e,t){return{...t,environmentId:e,label:t.entry.target.label,displayUrl:Ze(t.entry),relayManaged:We(t.entry)}}function ar(){let e=(0,O.c)(7),t=y(w.catalogValueAtom),n=y(w.networkStatusValueAtom),r=y(St.presentationsAtom),i;e[0]===r?i=e[1]:(i=[...r.entries()].map(or),e[0]=r,e[1]=i);let a=i,o;return e[2]!==t.isReady||e[3]!==a||e[4]!==n||e[5]!==r?(o={isReady:t.isReady,networkStatus:n,environments:a,presentationById:r},e[2]=t.isReady,e[3]=a,e[4]=n,e[5]=r,e[6]=o):o=e[6],o}function or(e){let[t,n]=e;return ir(t,n)}function sr(){return y(tt)}function cr(e){let t=(0,O.c)(3),{presentation:n}=Tt(e),r;return t[0]!==e||t[1]!==n?(r=e===null||n===null?null:ir(e,n),t[0]=e,t[1]=n,t[2]=r):r=t[2],r}function lr(){return cr(sr())}function ur(e){let t=(0,O.c)(2),n=at(e),r;return t[0]===n?r=t[1]:(r=be(n)?n.value.httpBaseUrl:null,t[0]=n,t[1]=r),r}function dr(){return y(rr.stateValueAtom)}function fr(){return y(Ct.environmentIdsAtom)}function pr(){return y(Ct.identitiesAtom)}function mr(){return y(Ct.pullRequestsSupportedAtom)}var hr=`[CLIENT_SETTINGS]`,gr=new Set,_r=new Set,vr=de,Y=`pending`,X=null,yr=0,br=Promise.resolve(),xr=0;function Sr(){for(let e of gr)e()}function Cr(){for(let e of _r)e()}function Z(){return vr}function wr(e){vr=e,Sr()}function Tr(e){Y!==e&&(Y=e,Cr())}function Er(e){return gr.add(e),Q().catch(()=>void 0),()=>{gr.delete(e)}}function Dr(){return Y===`ready`}function Or(){return Y}function kr(e){return _r.add(e),Q().catch(()=>void 0),()=>{_r.delete(e)}}async function Q(){if(Y===`ready`)return;if(X)return X;let e=yr;Tr(Y===`failed`||Y===`retrying`?`retrying`:`pending`);let t=(async()=>{try{let t=await en().persistence.getClientSettings();if(e!==yr)return;t&&wr({...de,...t}),Tr(`ready`)}catch(t){throw e===yr&&Tr(`failed`),console.error(`${hr} hydrate failed`,{operation:`hydrate`,...x(t)}),t}})().finally(()=>{X===t&&(X=null)});return X=t,X}var Ar=e=>en().persistence.setClientSettings(e);function jr(e){let t=br.then(e);return br=t.then(()=>void 0,()=>void 0),t}function Mr(e,t=Ar){let n=Y!==`ready`||xr>0;return n?xr+=1:wr({...Z(),...e}),jr(async()=>{if(n)try{Y!==`ready`&&await Q(),wr({...Z(),...e})}finally{--xr}await t(Z())}).catch(e=>{console.error(`${hr} persist failed`,{operation:`persist`,...x(e)})})}async function Nr(e,t=Ar){return jr(async()=>{for(Y!==`ready`&&await Q();;){let n=Z(),r=e(n);if(await t(r),Z()===n)return wr(r),r}})}var Pr=new Set(ee(re.fields));function Fr(e){let t={},n={};for(let[r,i]of Object.entries(e))Pr.has(r)?t[r]=i:n[r]=i;return{serverPatch:t,clientPatch:n}}function Ir(){return Z()}function Lr(){return Q()}function Rr(){return(0,D.useSyncExternalStore)(kr,Dr,zr)}function zr(){return!1}function Br(){return(0,D.useSyncExternalStore)(kr,Or,Vr)}function Vr(){return`pending`}function Hr(){return(0,D.useSyncExternalStore)(Er,Z,Ur)}function Ur(){return de}function Wr(e,t){return{...t,...e,...Xn(e,t)}}var Gr=new Set;function $(e,t){let n=(0,O.c)(8),r=Hr(),i=Rr(),a;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={reportFailure:!1},n[0]=a):a=n[0];let o=st(C.updateSettings,a),s,c;n[1]!==r||n[2]!==e||n[3]!==i||n[4]!==o||n[5]!==t?(s=()=>{if(!e||!t||!i||Gr.has(e))return;let n=Zn(t,r);n&&(Gr.add(e),o({environmentId:e,input:{patch:n}}).finally(()=>Gr.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,D.useEffect)(s,c)}function Kr(e,t){let n=(0,O.c)(6),r=Hr(),i;n[0]!==r||n[1]!==e?(i=Wr(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 qr(e){let t=(0,O.c)(3),n=Hr(),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}async function Jr(e,t){return(e.favorites===null||e.providerModelPreferences===null)&&await Lr(),{...Zn(e,Ir()),...t}}function Yr(e){let t=(0,O.c)(6),n;t[0]===e?n=t[1]:(n=e?C.settingsValueAtom(e):Zr,t[0]=e,t[1]=n);let r=y(n),i=st(C.updateSettings,`model preferences update`),a;return t[2]!==e||t[3]!==i||t[4]!==r?(a=async t=>{if(!e||!r)return;let n;try{n=await Jr(r,t)}catch{S.add({type:`error`,title:`Model preferences not saved`,description:`Could not load saved model preferences. Try again.`});return}return i({environmentId:e,input:{patch:n}})},t[2]=e,t[3]=i,t[4]=r,t[5]=a):a=t[5],a}function Xr(e){let t=(0,D.use)(ke),n=(0,D.useRef)(new Map),r=Yr(e);return(0,D.useCallback)(async(i,a)=>{if(!e)return;let o=C.settingsValueAtom(e),s=t.get(o);if(!s)return;if(s.favorites===null)try{await Lr()}catch{S.add({type:`error`,title:`Favorites not saved`,description:`Could not load saved model preferences. Try again.`});return}let c=t.get(o)??s,l=Xn(c,Ir()).favorites,u=JSON.stringify([e,i,a]),d=n.current.get(u),f={favorite:!(d&&(d.pending||d.settings.favorites===c.favorites)?d.favorite:l.some(e=>e.provider===i&&e.model===a)),settings:c,pending:!0};n.current.set(u,f);try{let e=await r({setModelFavorites:[{provider:i,model:a,favorite:f.favorite}]});e&&pe(e)&&t.get(o)?.favorites===c.favorites&&(f.pending=!1)}finally{f.pending&&n.current.get(u)===f&&(d&&!d.pending&&t.get(o)?.favorites===d.settings.favorites?n.current.set(u,d):n.current.delete(u))}},[e,t,r])}var Zr=h(null);function Qr(e){let t=(0,O.c)(5),n;t[0]===e?n=t[1]:(n=e?C.settingsValueAtom(e):Zr,t[0]=e,t[1]=n);let r=y(n),i=Hr();$(e,r);let a=r??ae,o;return t[2]!==i||t[3]!==a?(o=Xn(a,i),t[2]=i,t[3]=a,t[4]=o):o=t[4],o}function $r(e,t){let n=(0,O.c)(2),r;n[0]===e?r=n[1]:(r=C.settingsValueAtom(e),n[0]=e,n[1]=r);let i=y(r);return $(e,i),Kr(i??ae,t)}function ei(e){let t=(0,O.c)(4),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},t[0]=n):n=t[0];let r=st(C.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 ti(e){let t=lr(),n=y(nt);return $(t?.environmentId??null,t?.serverConfig?.settings??null),Kr(n,e)}var ni=`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 ri(){let e=(0,O.c)(2),t=lr(),n;return e[0]===t?n=e[1]:(n=t!==null||!Qe(),e[0]=t,e[1]=n),n}function ii(e){let t=(0,O.c)(3),n=e!==void 0&&e,{environments:r}=ar(),i;return t[0]!==r||t[1]!==n?(i=h(e=>r.filter(tr).flatMap(t=>{let r=e(ot.sessionStateAtom(t.environmentId));if(n&&r._tag===`Initial`)return[t.environmentId];let i=r._tag===`Failure`?null:_(se(r));return i!==null&&ze(i,`settings:write`)?[t.environmentId]:[]})),t[0]=r,t[1]=n,t[2]=i):i=t[2],y(i)}function ai(e){let t=(0,O.c)(10);rt(e,Ae);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=st(C.updateSettings,n),{environments:i}=ar(),a;t[1]!==i||t[2]!==r?(a=async e=>{let t=await r(e);if(t._tag===`Failure`&&!qe(t)){let n=i.find(t=>t.environmentId===e.environmentId)?.label??e.environmentId,r=Xe(t);S.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=ii(!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}=Fr(t),c=e===null||me(n).every(t=>it(e,t));if(Object.keys(n).length>0&&!c&&S.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}=$n(n),c=ui;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=er(t,a?.serverConfig?.environment.capabilities,a?.serverConfig?.settings,n,r===e);Object.keys(s).length!==0&&(ge.get(ot.sessionStateAtom(r))._tag!==`Initial`&&!me(t).every(e=>it(r,e))?l.push(a?.label??r):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(oi)}}Object.keys(a).length>0&&Mr(a)},t[4]=e,t[5]=i,t[6]=r,t[7]=o,t[8]=s,t[9]=c):c=t[9],c}function oi(e){let t=e.flatMap(li);if(t.length===0)return;let n=e.filter(ci).map(si);S.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
- `)})}function si(e){let{label:t}=e;return t}function ci(e){let{result:t}=e;return t._tag===`Success`}function li(e){let{label:t,result:n}=e;if(n._tag!==`Failure`||qe(n))return[];let r=Xe(n);return[`Could not save on ${t}: ${r instanceof Error?r.message:`The save failed. Try reconnecting and saving again.`}`]}function ui(e){let t=e===void 0?ni:e;return S.add({type:`warning`,title:`Setting not saved`,description:t})}function di(e){return ai(e)}function fi(){return ai(lr()?.environmentId??null)}function pi(){return mi}function mi(e){return Mr(e)}export{Mt as $,rr as A,W as B,pr as C,sr as D,lr as E,q as F,Mn as G,rn as H,Vn as I,Ut as J,en as K,Un as L,Yn as M,Jn as N,mr as O,Rn as P,jt as Q,Hn as R,ur as S,ar as T,vn as U,nn as V,Cn as W,Nt as X,Ft as Y,kt as Z,pi as _,Mr as a,fi as b,Rr as c,$r as d,Pt as et,$ as f,Xr as g,ri as h,Wr as i,Tt as it,qn as j,dr as k,Br as l,ti as m,Lr as n,St as nt,Nr as o,ei as p,$t as q,Ir as r,Ct as rt,qr as s,ni as t,At as tt,Qr as u,Yr as v,fr as w,cr as x,di as y,In as z};
3
- //# sourceMappingURL=useSettings-BAP_yCCK.js.map