@p4code/cli 0.8.11 → 0.8.13

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 (336) hide show
  1. package/dist/bin.mjs +1 -1
  2. package/dist/{binCli-DY9l0jFs.mjs → binCli-B9aQxlIK.mjs} +1865 -1492
  3. package/dist/client/.vite/manifest.json +2144 -2145
  4. package/dist/client/assets/AlertDialogRoot-DvQNG7Nt.js +2 -0
  5. package/dist/client/assets/{AnimatedHeight-D-OJUoBJ.js → AnimatedHeight-CH-N3JTc.js} +2 -2
  6. package/dist/client/assets/{AuthSurfaceShell-B_P0_qZ6.js → AuthSurfaceShell-CJdXkxyH.js} +2 -2
  7. package/dist/client/assets/{CSPContext-D8hlJ4eS.js → CSPContext-4VAD2_gc.js} +2 -2
  8. package/dist/client/assets/{ChatGptUsageButton-fMcoYEDa.js → ChatGptUsageButton-7u9uPgbK.js} +2 -2
  9. package/dist/client/assets/ChatMarkdown-C22JFyYa.js +65 -0
  10. package/dist/client/assets/CheckboxIndicator-ClY0P0ol.js +2 -0
  11. package/dist/client/assets/CodexSetupSection.logic-CEAT7YdZ.js +2 -0
  12. package/dist/client/assets/{CollapsiblePanel-kfl4yLKn.js → CollapsiblePanel-Cubscn-a.js} +2 -2
  13. package/dist/client/assets/ComboboxClear-qTthzuJh.js +2 -0
  14. package/dist/client/assets/{CommandBlock-BI3ZCXsB.js → CommandBlock-CWt29kmi.js} +2 -2
  15. package/dist/client/assets/{ComposerPromptEditor-BkRvKIiZ.js → ComposerPromptEditor-Bt_L4smq.js} +44 -44
  16. package/dist/client/assets/{CompositeRoot-B9Xvst63.js → CompositeRoot-DUqf78yV.js} +2 -2
  17. package/dist/client/assets/{ConnectionStatusDot-DtKQQSMi.js → ConnectionStatusDot-cdpNRZhA.js} +2 -2
  18. package/dist/client/assets/{DevicePanel-B_jOvmeL.js → DevicePanel-CZm-f5TC.js} +2 -2
  19. package/dist/client/assets/{DeviceSetup-BXjqCO_9.js → DeviceSetup-BdrkGme6.js} +2 -2
  20. package/dist/client/assets/{DialogTitle-BzKEBo4W.js → DialogTitle-CQU6s1Wy.js} +2 -2
  21. package/dist/client/assets/{DiffCommentAnnotation-D_1Iw0oL.js → DiffCommentAnnotation-B-XoYYxb.js} +2 -2
  22. package/dist/client/assets/{DiffFileTree-D6386u9x.js → DiffFileTree-CwTkSU3R.js} +2 -2
  23. package/dist/client/assets/DiffPanel-BCI9XXpF.js +2 -0
  24. package/dist/client/assets/{DiffWorkerPoolProvider-Cw5WeG1t.js → DiffWorkerPoolProvider-OPZsOibX.js} +3 -3
  25. package/dist/client/assets/{EmbeddedDesign-Drkomo9K.js → EmbeddedDesign-DwRAPHYl.js} +4 -4
  26. package/dist/client/assets/{EnvironmentMachineIcon-COX4G5YJ.js → EnvironmentMachineIcon-DCdlTSYU.js} +2 -2
  27. package/dist/client/assets/{ExpandableText-BHihVj6x.js → ExpandableText-BtdwzlFy.js} +3 -3
  28. package/dist/client/assets/{FieldControl-CIaYJhnp.js → FieldControl-BI2gK4Z0.js} +2 -2
  29. package/dist/client/assets/{FileDiff-FK4mtyx3.js → FileDiff-BkJG5QAe.js} +2 -2
  30. package/dist/client/assets/{FilePreviewPanel-ncsuf7iX.js → FilePreviewPanel-CURtQAD1.js} +4 -4
  31. package/dist/client/assets/{FoldedSettingsSection-CRlh3-BO.js → FoldedSettingsSection-B9B8i8Gg.js} +2 -2
  32. package/dist/client/assets/{FormContext-DTtr4Y3v.js → FormContext-Bgwez2tv.js} +2 -2
  33. package/dist/client/assets/{Icons-BFyKltvl.js → Icons-B5JVkp3z.js} +2 -2
  34. package/dist/client/assets/Input-BQRZG5rU.js +2 -0
  35. package/dist/client/assets/{KeybindingsSettings.logic-_oQM9Dzv.js → KeybindingsSettings.logic-6lVDnd1N.js} +2 -2
  36. package/dist/client/assets/{NoProjectsHero-8d3l2unf.js → NoProjectsHero-CkhVaJk9.js} +2 -2
  37. package/dist/client/assets/PanelLayoutControls-CxuV0JO3.js +216 -0
  38. package/dist/client/assets/{PierreEntryIcon-DtlkLdir.js → PierreEntryIcon-CPG-jnaN.js} +2 -2
  39. package/dist/client/assets/PopoverHandle-CBT8hFut.js +2 -0
  40. package/dist/client/assets/PreviewPanel-Doh1peEu.js +2 -0
  41. package/dist/client/assets/ProjectDefaultsSettings-DfhAk0_Y.js +2 -0
  42. package/dist/client/assets/{ProjectFavicon-YdOZ4g5-.js → ProjectFavicon-DUW6Bo66.js} +3 -3
  43. package/dist/client/assets/{ProjectIconPickerDialog-C23nnU1a.js → ProjectIconPickerDialog-C613hnVY.js} +2 -2
  44. package/dist/client/assets/{ProjectMonogram-BMGWdmjv.js → ProjectMonogram-B9iJhcVp.js} +2 -2
  45. package/dist/client/assets/{ProviderAuthTerminal-YztsMr2F.js → ProviderAuthTerminal-eq346NX_.js} +2 -2
  46. package/dist/client/assets/{ProviderModelPicker-S_tiGeLH.js → ProviderModelPicker-DPb-88ui.js} +2 -2
  47. package/dist/client/assets/{ProviderSettingsForm-C3nbCFfS.js → ProviderSettingsForm-DTYqzs8W.js} +2 -2
  48. package/dist/client/assets/PullRequestCodeTab-BBz0FfLD.js +6 -0
  49. package/dist/client/assets/{ReadOnlySourcePreview-BNe8pyVf.js → ReadOnlySourcePreview-CkeeLVAm.js} +2 -2
  50. package/dist/client/assets/{RenderErrorBoundary-DEgVmtJL.js → RenderErrorBoundary-mfAvIiFU.js} +2 -2
  51. package/dist/client/assets/{ScheduledTasksSettings-CISo4C7r.js → ScheduledTasksSettings-BMUE9M9Z.js} +2 -2
  52. package/dist/client/assets/{ScopedSwitch-eWB5GlaA.js → ScopedSwitch-BKOdsllO.js} +2 -2
  53. package/dist/client/assets/{ScrollAreaCorner-SeZ1sx-t.js → ScrollAreaCorner-CoeXGFSL.js} +2 -2
  54. package/dist/client/assets/{SecretInput-D0DyMDSw.js → SecretInput-CROqj1gF.js} +2 -2
  55. package/dist/client/assets/SelectScrollUpArrow-SDOpV3nj.js +2 -0
  56. package/dist/client/assets/{SettingsPanels-DA7lXl0N.js → SettingsPanels-BHhMJaVc.js} +6 -6
  57. package/dist/client/assets/{SettingsPanels.logic-lCZaJhKM.js → SettingsPanels.logic-BwmY39Sq.js} +2 -2
  58. package/dist/client/assets/{SettingsScopeNotice-BAtVWG0d.js → SettingsScopeNotice-DAPsshab.js} +2 -2
  59. package/dist/client/assets/{T3ConnectAccountPages-nabxuL18.js → T3ConnectAccountPages-CDuVbE2z.js} +2 -2
  60. package/dist/client/assets/{T3ConnectSidebarSignIn-CSVR5Zot.js → T3ConnectSidebarSignIn-BSQHp-Xq.js} +2 -2
  61. package/dist/client/assets/{ThemeEditorPanel-BMtL4rIt.js → ThemeEditorPanel-BiuI7Uiy.js} +3 -3
  62. package/dist/client/assets/ThreadTerminalDrawer-B8n6TAqv.js +5 -0
  63. package/dist/client/assets/TooltipViewport-BKD6QABG.js +2 -0
  64. package/dist/client/assets/{Virtualizer-Bi8p4Z6E.js → Virtualizer-CTnacEby.js} +2 -2
  65. package/dist/client/assets/{WorkspaceBreadcrumb-B0Ap9wKu.js → WorkspaceBreadcrumb-BmVcurpi.js} +2 -2
  66. package/dist/client/assets/{WorkspacePageContainer-COKQZB3N.js → WorkspacePageContainer-BSjVd7h4.js} +2 -2
  67. package/dist/client/assets/{WorkspacePageHeader-BDzzcsWQ.js → WorkspacePageHeader-BLYOcS9Z.js} +2 -2
  68. package/dist/client/assets/_chat-z348gvgF.js +45 -0
  69. package/dist/client/assets/{_chat.index-k4jctzPr.js → _chat.index-CBbUzaK7.js} +2 -2
  70. package/dist/client/assets/{_chat.new-BlFtqZqt.js → _chat.new-7TTfcDf1.js} +2 -2
  71. package/dist/client/assets/_chat.pull-requests-BE7Q2lUu.js +2 -0
  72. package/dist/client/assets/{abnfDiagram-VCTEODGH-BVKlsgtX.js → abnfDiagram-VCTEODGH-HaXM7twL.js} +2 -2
  73. package/dist/client/assets/{alert-B2wk0CaO.js → alert-5swcxUBm.js} +2 -2
  74. package/dist/client/assets/architecture-7GRP2DOG-CiMEl2LX.js +1 -0
  75. package/dist/client/assets/{architectureDiagram-5GKGNRK7-zBJWGViu.js → architectureDiagram-5GKGNRK7-BhWXFsXS.js} +2 -2
  76. package/dist/client/assets/assets-DXnV2oRj.js +2 -0
  77. package/dist/client/assets/{blockDiagram-I7D4REHJ-BdiAAtHi.js → blockDiagram-I7D4REHJ-D213N9iF.js} +2 -2
  78. package/dist/client/assets/{browserHistoryStore-CqGVWa5a.js → browserHistoryStore-DURO3U2L.js} +2 -2
  79. package/dist/client/assets/{browserLinkTarget-CINrbcxi.js → browserLinkTarget-DcGx3A8F.js} +2 -2
  80. package/dist/client/assets/{c4Diagram-7LVT6UL2-CqnmSo8f.js → c4Diagram-7LVT6UL2-58POuQV-.js} +2 -2
  81. package/dist/client/assets/channel-CDbYAV2D.js +2 -0
  82. package/dist/client/assets/{checkbox-DU_a7ZnJ.js → checkbox-1tz9neVf.js} +2 -2
  83. package/dist/client/assets/{chunk-4HAMMTFA-BpyojyCk.js → chunk-4HAMMTFA-Bcwcw8Wz.js} +2 -2
  84. package/dist/client/assets/{chunk-75Z2AOVW-LBmwoUvq.js → chunk-75Z2AOVW-BaYdZ0Fq.js} +2 -2
  85. package/dist/client/assets/{chunk-DU6HZSFF-zhv2Vnfx.js → chunk-DU6HZSFF-B6TRgw4-.js} +2 -2
  86. package/dist/client/assets/{chunk-F27PBJKO-K5uPeDhv.js → chunk-F27PBJKO-B5arSwg6.js} +2 -2
  87. package/dist/client/assets/{chunk-GMAD6QVW-CAAu3Cn5.js → chunk-GMAD6QVW-XeNCd3gb.js} +2 -2
  88. package/dist/client/assets/{chunk-GVQU2GXP-Br_UAx49.js → chunk-GVQU2GXP-CWVbbWh7.js} +2 -2
  89. package/dist/client/assets/{chunk-IMKFNOWR-Kqfxrrdn.js → chunk-IMKFNOWR-Cb-yxIAE.js} +2 -2
  90. package/dist/client/assets/{chunk-L3NEJ4N5-D1cWO7rm.js → chunk-L3NEJ4N5-Di7nZhzu.js} +2 -2
  91. package/dist/client/assets/{chunk-OSK3NFVY-BiMJbcHf.js → chunk-OSK3NFVY-DcqBXKUK.js} +2 -2
  92. package/dist/client/assets/{chunk-P2QGCYS3-BuGzzo3g.js → chunk-P2QGCYS3-DJ1kMiTY.js} +2 -2
  93. package/dist/client/assets/{chunk-POPQ4Y6H-C_w0mNLk.js → chunk-POPQ4Y6H-Ba9RYr-b.js} +2 -2
  94. package/dist/client/assets/{chunk-PWAF6VOD-CJFd7LKC.js → chunk-PWAF6VOD-D4Ch07S8.js} +2 -2
  95. package/dist/client/assets/{chunk-SHT3W25Y-Beev3ZeU.js → chunk-SHT3W25Y-BafMUZgc.js} +2 -2
  96. package/dist/client/assets/{chunk-SVP7TREG-BqpBEmtK.js → chunk-SVP7TREG-CsEVe0s3.js} +2 -2
  97. package/dist/client/assets/{chunk-TICWLB2K-B0vIU1Au.js → chunk-TICWLB2K-D3tgdZlp.js} +2 -2
  98. package/dist/client/assets/classDiagram-ZZMXUADV-Cdtwlmxc.js +2 -0
  99. package/dist/client/assets/classDiagram-v2-VYDZK3BY-Cdtwlmxc.js +2 -0
  100. package/dist/client/assets/{color-picker-CYOS1hwQ.js → color-picker-N6f_Hu7P.js} +2 -2
  101. package/dist/client/assets/{combobox-CZradSHe.js → combobox-B07cVaQY.js} +2 -2
  102. package/dist/client/assets/{command-BB0IyhBc.js → command-B70eQIps.js} +2 -2
  103. package/dist/client/assets/{connect-DGwXUKTk.js → connect-Vt7wlrih.js} +2 -2
  104. package/dist/client/assets/{connect-agent-DFwOzcLG.js → connect-agent-CX70rAkF.js} +2 -2
  105. package/dist/client/assets/{cynefin-OW5HDTMX-BjcFswd0.js → cynefin-OW5HDTMX-CU8HnD4F.js} +1 -1
  106. package/dist/client/assets/{cynefinDiagram-5FMLGOSQ-BDWLg5Tt.js → cynefinDiagram-5FMLGOSQ-Cvc6_oYZ.js} +2 -2
  107. package/dist/client/assets/{dagre-GXQ25YYZ-DZpVjkDw.js → dagre-GXQ25YYZ-Bx5buWLS.js} +2 -2
  108. package/dist/client/assets/device-BgvBRE7C.js +2 -0
  109. package/dist/client/assets/{diagram-S7CK7UJ4-BpVs-kYJ.js → diagram-S7CK7UJ4-CPZrAy0P.js} +2 -2
  110. package/dist/client/assets/{diagram-UQ7AKVKN-EN7yKI08.js → diagram-UQ7AKVKN-kBtSnHpL.js} +2 -2
  111. package/dist/client/assets/{diagram-VSXAHHWV-B2oljv94.js → diagram-VSXAHHWV-DQP2q1tS.js} +2 -2
  112. package/dist/client/assets/{diagram-VX7I27RA-BIl0lJ6d.js → diagram-VX7I27RA-DRUN0yEk.js} +2 -2
  113. package/dist/client/assets/{diagram-Z3DM3KII-B8uoK-O5.js → diagram-Z3DM3KII-D4WMsQZZ.js} +2 -2
  114. package/dist/client/assets/{dialog-x5a5g_fa.js → dialog-DmneyTGi.js} +2 -2
  115. package/dist/client/assets/{diffRendering-DeZLcalP.js → diffRendering-iR2meoVj.js} +2 -2
  116. package/dist/client/assets/{discovery-list-Bn1UyUNL.js → discovery-list-ZGkddsst.js} +2 -2
  117. package/dist/client/assets/{dist-Bd1WIVAz.js → dist-vr51zfzA.js} +3 -3
  118. package/dist/client/assets/{draft-input-CwXvLRjL.js → draft-input-DHZ1J7B_.js} +2 -2
  119. package/dist/client/assets/{duoViewer-BZ7rNqkx.js → duoViewer-DTVry3xd.js} +2 -2
  120. package/dist/client/assets/{dynamic-BMz3CcWG.js → dynamic-CuoX2JEO.js} +2 -2
  121. package/dist/client/assets/{ebnfDiagram-PWID7BFC-BQcQotuk.js → ebnfDiagram-PWID7BFC-BNUtunQw.js} +2 -2
  122. package/dist/client/assets/{embeddedScripts-Cek5ppgQ.js → embeddedScripts-BMvBWRz_.js} +2 -2
  123. package/dist/client/assets/{empty-C-FrtXzi.js → empty-hFNkAHps.js} +2 -2
  124. package/dist/client/assets/entities-7B8nzlQw.js +2 -0
  125. package/dist/client/assets/{environments-Dm2_6Uan.js → environments-DYIXXf7q.js} +2 -2
  126. package/dist/client/assets/{erDiagram-RLTQ6QDP-Y5XhNz9b.js → erDiagram-RLTQ6QDP-DHjjowZq.js} +2 -2
  127. package/dist/client/assets/eventmodeling-NTZA5JFV-DNKqiuCf.js +1 -0
  128. package/dist/client/assets/{fileLinks-1xYacDKI.js → fileLinks-BYi-XNUG.js} +2 -2
  129. package/dist/client/assets/{fileTreeExpansion-B24BhRqA.js → fileTreeExpansion-DIOxQqDo.js} +2 -2
  130. package/dist/client/assets/flowDiagram-HODETNUW-CbOoDtR7.js +1 -0
  131. package/dist/client/assets/{ganttDiagram-EL5Y4UJY-DqWb0OUJ.js → ganttDiagram-EL5Y4UJY-DEPOqoj0.js} +2 -2
  132. package/dist/client/assets/{getDiffFileInput-CCYVAWRm.js → getDiffFileInput-DMj15wpy.js} +2 -2
  133. package/dist/client/assets/{gitGraph-4MIJSDKK-5lcY1dZk.js → gitGraph-4MIJSDKK-BGKW_zhb.js} +1 -1
  134. package/dist/client/assets/{gitGraphDiagram-WWUBYQGX-BJKz_rGI.js → gitGraphDiagram-WWUBYQGX-7UhsI5zi.js} +2 -2
  135. package/dist/client/assets/{guideRunStore-BhlldU3q.js → guideRunStore-BEkwZ9H7.js} +2 -2
  136. package/dist/client/assets/{htmlRender-Egw4Y-80.js → htmlRender-BxVc1PlI.js} +2 -2
  137. package/dist/client/assets/{index-Dc7GC03y.js → index-C_MVyH59.js} +3 -3
  138. package/dist/client/assets/{info-A6RAGUB7-BWnMlmF7.js → info-A6RAGUB7-jvyzx_4e.js} +1 -1
  139. package/dist/client/assets/{infoDiagram-27XIBGKW-DKW68xDy.js → infoDiagram-27XIBGKW-lTTpu3as.js} +2 -2
  140. package/dist/client/assets/{input-DhWmPSxf.js → input-RqvQJ9gh.js} +2 -2
  141. package/dist/client/assets/{input-group-D4qHaxH8.js → input-group-BFtrsedw.js} +2 -2
  142. package/dist/client/assets/{ishikawaDiagram-5VMMS53U-dRMCvDN0.js → ishikawaDiagram-5VMMS53U-DlrQNGG9.js} +2 -2
  143. package/dist/client/assets/{journeyDiagram-3NMN7TZE-CAxCpgF5.js → journeyDiagram-3NMN7TZE-Buy9e-fU.js} +2 -2
  144. package/dist/client/assets/{kanban-definition-UXKFOSKX-BaSkJW47.js → kanban-definition-UXKFOSKX-1KgAXH0g.js} +2 -2
  145. package/dist/client/assets/{kbd-I5TavBvc.js → kbd-BnsXAHsc.js} +2 -2
  146. package/dist/client/assets/{keybindings-B3kvDAJC.js → keybindings-BtHOXkP-.js} +2 -2
  147. package/dist/client/assets/{lazyRouteComponent-ZmKiS4iU.js → lazyRouteComponent-T0YE6Rn9.js} +2 -2
  148. package/dist/client/assets/{line-B59oA22i.js → line-DUV1hs6X.js} +2 -2
  149. package/dist/client/assets/{link-DQB3a7WC.js → link-gKYnbTYT.js} +2 -2
  150. package/dist/client/assets/{linkedPrompt-Cqfqh2Aq.js → linkedPrompt-Da8rJho3.js} +2 -2
  151. package/dist/client/assets/main-Bh6Hj0_-.js +30 -0
  152. package/dist/client/assets/{main-Ch-SjebX.css → main-CoSpTpWL.css} +1 -1
  153. package/dist/client/assets/{mediaReference-DRC-8GdL.js → mediaReference-CLlAiRVc.js} +2 -2
  154. package/dist/client/assets/{mediaSource-DWSwwPfV.js → mediaSource-BTCWn94E.js} +2 -2
  155. package/dist/client/assets/{mermaid-parser.core-DcamukpZ.js → mermaid-parser.core-CsBuWV4-.js} +4 -4
  156. package/dist/client/assets/{mermaid.core-C6GXL70P.js → mermaid.core-BcICv5EB.js} +5 -5
  157. package/dist/client/assets/{mindmap-definition-YA3MSWOX-CEVz3xGI.js → mindmap-definition-YA3MSWOX-BqCqe4io.js} +2 -2
  158. package/dist/client/assets/number-field-DIYUxout.js +2 -0
  159. package/dist/client/assets/{observeResize-Cpph8C0G.js → observeResize-D9ECzP-D.js} +2 -2
  160. package/dist/client/assets/{onboarding-CLIRA2Sa.js → onboarding-COQ6KgRG.js} +2 -2
  161. package/dist/client/assets/{openFileInPreview-uS9Qgrru.js → openFileInPreview-BhRAqg63.js} +2 -2
  162. package/dist/client/assets/{p4ProjectFile-CIYnqKbl.js → p4ProjectFile-z5Hlq99W.js} +2 -2
  163. package/dist/client/assets/{packet-AYTQ26CC-B9XAEihD.js → packet-AYTQ26CC-BYCaPqFA.js} +1 -1
  164. package/dist/client/assets/{pair-DTfs9_4K.js → pair-BDKjGij-.js} +2 -2
  165. package/dist/client/assets/{pegDiagram-XKGWAZYB-tcLsMhrs.js → pegDiagram-XKGWAZYB-CqCw5Z-L.js} +2 -2
  166. package/dist/client/assets/{phoneViewer-wYjPQP4U.js → phoneViewer-DLSM0QXE.js} +2 -2
  167. package/dist/client/assets/{pie-WAS4IAKB-B3ig0TFp.js → pie-WAS4IAKB-BfOlqQx1.js} +1 -1
  168. package/dist/client/assets/{pieDiagram-E7YTZNPT-uaJgfQOp.js → pieDiagram-E7YTZNPT-DZpCrUQF.js} +2 -2
  169. package/dist/client/assets/{pierre-icons-Dav7jMBk.js → pierre-icons-BG7vd34x.js} +2 -2
  170. package/dist/client/assets/{popover-Bc0WvoPP.js → popover-DE9WCm99.js} +2 -2
  171. package/dist/client/assets/{preview-IWIgXHdy.js → preview-Cl-7ojv-.js} +2 -2
  172. package/dist/client/assets/{preview-C4lGbDhm.js → preview-bd-MGMMz.js} +2 -2
  173. package/dist/client/assets/{previewMiniPlayerStore-CTOOyQLc.js → previewMiniPlayerStore-Bz1T9oVV.js} +2 -2
  174. package/dist/client/assets/primary-BwHoAoya.js +2 -0
  175. package/dist/client/assets/primaryCloudLinkState-DtOYGRkF.js +2 -0
  176. package/dist/client/assets/projectFilesQueryState-BP_JvI7-.js +2 -0
  177. package/dist/client/assets/projectScriptEditor-BGLshibY.js +2 -0
  178. package/dist/client/assets/{providerSkills-C7CtJefh.js → providerSkills-DxYtwoxJ.js} +2 -2
  179. package/dist/client/assets/{pullRequestDetail.logic-DGX-Sd8d.js → pullRequestDetail.logic-C_aVDAY_.js} +4 -4
  180. package/dist/client/assets/{pullRequestIcons-BaQbmCBu.js → pullRequestIcons-D5Yo5Zsn.js} +2 -2
  181. package/dist/client/assets/{pullRequestReviewStore-wpVYihKr.js → pullRequestReviewStore-DaEzt1m1.js} +2 -2
  182. package/dist/client/assets/{pullRequests-BbD7hNlR.js → pullRequests-D0no1PZS.js} +2 -2
  183. package/dist/client/assets/{quadrantDiagram-AXDQQJYC-BOFUpnyi.js → quadrantDiagram-AXDQQJYC-BTtuOXlL.js} +2 -2
  184. package/dist/client/assets/queries-DkmaXOL-.js +2 -0
  185. package/dist/client/assets/query-Bd5_Y_Vy.js +2 -0
  186. package/dist/client/assets/{radar-RG4KPBEZ--djmIj49.js → radar-RG4KPBEZ-BiJgnIUY.js} +1 -1
  187. package/dist/client/assets/radio-group-CBunNtTU.js +2 -0
  188. package/dist/client/assets/{railroad-74A4TZTK-DMMw049f.js → railroad-74A4TZTK-C0CA0mcr.js} +1 -1
  189. package/dist/client/assets/railroad-abnf-HS5TGJTU-BtC_0p6z.js +1 -0
  190. package/dist/client/assets/railroad-ebnf-LZEXJU2U-IeTBC6cs.js +1 -0
  191. package/dist/client/assets/railroad-peg-WCYAUIDC-DLoLKYq3.js +1 -0
  192. package/dist/client/assets/{railroadDiagram-O6MQD6OU-Df9rhhFk.js → railroadDiagram-O6MQD6OU-WczOSoF4.js} +2 -2
  193. package/dist/client/assets/{renderScheduler-b0pOdWwc.js → renderScheduler-BLjFSKnt.js} +2 -2
  194. package/dist/client/assets/{requirementDiagram-BXWQKSXE-BtGYMd7U.js → requirementDiagram-BXWQKSXE-B3qCIQP5.js} +2 -2
  195. package/dist/client/assets/{rightPanelStore-37-59X44.js → rightPanelStore-6-YhsfkE.js} +2 -2
  196. package/dist/client/assets/runtime-Bni_zt6P.js +2 -0
  197. package/dist/client/assets/runtime-D8mKjOP-.js +6 -0
  198. package/dist/client/assets/{runtimeModeConfig-DF8wod3s.js → runtimeModeConfig-C3q8YqVA.js} +2 -2
  199. package/dist/client/assets/{sankeyDiagram-P5KCCOFB-D7_y-s_u.js → sankeyDiagram-P5KCCOFB-e2-j7ERe.js} +2 -2
  200. package/dist/client/assets/{scheduledTasksSettings.logic-CvvQA-b7.js → scheduledTasksSettings.logic-BNC897-_.js} +3 -3
  201. package/dist/client/assets/{scroll-area-BDT5qfX2.js → scroll-area-Davaj52_.js} +2 -2
  202. package/dist/client/assets/{select-BQxcmO_1.js → select-B47XfaxQ.js} +2 -2
  203. package/dist/client/assets/{sequenceDiagram-WJ2MYXX4-AuXrX-b5.js → sequenceDiagram-WJ2MYXX4-DG7-8UJk.js} +2 -2
  204. package/dist/client/assets/server-CaLEm3Wt.js +2 -0
  205. package/dist/client/assets/{session-Bc1P10r_.js → session-2CRBJwS7.js} +2 -2
  206. package/dist/client/assets/{session-logic-BNtU33qU.js → session-logic-BLOBsHEA.js} +4 -4
  207. package/dist/client/assets/{settings-CZSrxmjf.js → settings-BIwaDm1N.js} +2 -2
  208. package/dist/client/assets/settings.appearance-ToUM8fHh.js +2 -0
  209. package/dist/client/assets/settings.archived-Cq_qclay.js +2 -0
  210. package/dist/client/assets/{settings.computer-use-BAzpb53_.js → settings.computer-use-BEghs16L.js} +2 -2
  211. package/dist/client/assets/settings.connections-C_LVk0gJ.js +2 -0
  212. package/dist/client/assets/{settings.data-controls-DIkcwUy1.js → settings.data-controls-BaTil8NB.js} +2 -2
  213. package/dist/client/assets/{settings.decisions-BN9ozN_A.js → settings.decisions-JTbMt08J.js} +2 -2
  214. package/dist/client/assets/settings.diagnostics-ByG62ZGs.js +2 -0
  215. package/dist/client/assets/settings.general-BT78z_Cn.js +2 -0
  216. package/dist/client/assets/{settings.integrations-CT3opViE.js → settings.integrations-C3jj2T1d.js} +2 -2
  217. package/dist/client/assets/{settings.keybindings-BBTkicWk.js → settings.keybindings-CeqZWQEi.js} +2 -2
  218. package/dist/client/assets/{settings.open-source-licenses-C_hoYTwe.js → settings.open-source-licenses-BAFwkfI8.js} +2 -2
  219. package/dist/client/assets/settings.plugins-D5l1ZPSB.js +5 -0
  220. package/dist/client/assets/settings.projects-Cqx1zAvs.js +4 -0
  221. package/dist/client/assets/settings.providers-CS55UrI1.js +3 -0
  222. package/dist/client/assets/settings.scheduled-tasks-CFJTEOb1.js +2 -0
  223. package/dist/client/assets/{settings.snap-shot-D-zJVnjT.js → settings.snap-shot-E3AITJyC.js} +2 -2
  224. package/dist/client/assets/{settings.source-control-DIU1xRUy.js → settings.source-control-CWWy9E3b.js} +2 -2
  225. package/dist/client/assets/{settings.storage-DRxTKEjG.js → settings.storage-BnUI1rFT.js} +2 -2
  226. package/dist/client/assets/{settingsLayout-Cbpy7Mfz.js → settingsLayout-DHc6oKfL.js} +3 -3
  227. package/dist/client/assets/{sidebar-D5nBG54l.js → sidebar-BkujXU9U.js} +2 -2
  228. package/dist/client/assets/{sidebarProjectGrouping-DXnDcqLY.js → sidebarProjectGrouping-DD4nu9RX.js} +2 -2
  229. package/dist/client/assets/{skeleton-oZHFXSZp.js → skeleton-C6_D5JUu.js} +2 -2
  230. package/dist/client/assets/{sortable.esm-Boen_E7K.js → sortable.esm-BAEGChD3.js} +2 -2
  231. package/dist/client/assets/{sourceControl-DE9QO1yg.js → sourceControl-BAghu6LN.js} +2 -2
  232. package/dist/client/assets/{spinner-Bnjv_L8F.js → spinner-CpLstN6u.js} +2 -2
  233. package/dist/client/assets/{standalone-page-Davc_MrS.js → standalone-page-7vaVYOp-.js} +2 -2
  234. package/dist/client/assets/{stateDiagram-D77RDMKH-EwB2WAAm.js → stateDiagram-D77RDMKH-CpZF58eW.js} +2 -2
  235. package/dist/client/assets/stateDiagram-v2-MP3YSRHH-DewOo-MV.js +2 -0
  236. package/dist/client/assets/{swimlanes-42K2YHIH-RngRFsjR.js → swimlanes-42K2YHIH-D1b49puG.js} +2 -2
  237. package/dist/client/assets/swimlanesDiagram-VR7AAH4N-d9EGwk-5.js +9 -0
  238. package/dist/client/assets/{terminal-links-BT70vIBN.js → terminal-links-CjmSI9gV.js} +2 -2
  239. package/dist/client/assets/{terminalSessions-Cj-MqjH8.js → terminalSessions-Q2t1JYPS.js} +2 -2
  240. package/dist/client/assets/{textarea-B8WPFAr0.js → textarea-DKdxwZZC.js} +2 -2
  241. package/dist/client/assets/{themePalette-CdoksNDx.js → themePalette-7p_LOU3J.js} +3 -3
  242. package/dist/client/assets/{threadSort-DD61dseb.js → threadSort-C5oCCRfj.js} +2 -2
  243. package/dist/client/assets/{timeline-definition-24CTP7MA-BfIggpP3.js → timeline-definition-24CTP7MA-89AJY6KO.js} +2 -2
  244. package/dist/client/assets/toast-DhMYg_gN.js +2 -0
  245. package/dist/client/assets/{toggle-DLuCM2ny.js → toggle-BshAsXT6.js} +2 -2
  246. package/dist/client/assets/{toggle-group-RZD18_sD.js → toggle-group-ZNzhUvHt.js} +2 -2
  247. package/dist/client/assets/tooltip-Cq9yz15d.js +2 -0
  248. package/dist/client/assets/{treeView-Q6P3EWNA-BjKaOr9u.js → treeView-Q6P3EWNA-CqNF2YcW.js} +1 -1
  249. package/dist/client/assets/{treemap-WGGIJYW6-ffFPsmk1.js → treemap-WGGIJYW6-LJa3ZEYA.js} +1 -1
  250. package/dist/client/assets/usage-CJVyABbK.js +2 -0
  251. package/dist/client/assets/{usageAccess-CGcVLBtI.js → usageAccess-CieOJbVm.js} +2 -2
  252. package/dist/client/assets/{usageFormat-B-HlJYM5.js → usageFormat-BEGhDYfU.js} +2 -2
  253. package/dist/client/assets/{usageShortcuts-CUsmDt-0.js → usageShortcuts-DxuByyhD.js} +2 -2
  254. package/dist/client/assets/{use-atom-command-Dz_yqN35.js → use-atom-command-x4GQBtio.js} +2 -2
  255. package/dist/client/assets/{useAriaLabelledBy-DZIzyiAY.js → useAriaLabelledBy-u5efXUxw.js} +2 -2
  256. package/dist/client/assets/{useHandleNewThread-DjevdE0U.js → useHandleNewThread-CReGBX6y.js} +2 -2
  257. package/dist/client/assets/{useLocation-UcmQE5FC.js → useLocation-B3ir4ben.js} +2 -2
  258. package/dist/client/assets/useNavigate-DRqH9NhA.js +2 -0
  259. package/dist/client/assets/{useNavigateBack-B0y76gBs.js → useNavigateBack-XQd0WINI.js} +2 -2
  260. package/dist/client/assets/{useParams-DdYFF9g9.js → useParams-Cil-ZIwd.js} +2 -2
  261. package/dist/client/assets/{usePermissionStatus-C01enB4u.js → usePermissionStatus-C4aMrLLP.js} +2 -2
  262. package/dist/client/assets/{usePullRequestActions-BKpChcp1.js → usePullRequestActions-BL4mjngC.js} +3 -3
  263. package/dist/client/assets/{useRegisterFieldControl-Bmw-33lq.js → useRegisterFieldControl-75QESVfk.js} +2 -2
  264. package/dist/client/assets/{useScopedModelAvailability-mUid6EfJ.js → useScopedModelAvailability-CBOIiaXC.js} +2 -2
  265. package/dist/client/assets/useSettings-Dx076NWT.js +3 -0
  266. package/dist/client/assets/{useT3ConnectAuthPrompt-C7Dm8xCm.js → useT3ConnectAuthPrompt-1zTdZLsH.js} +2 -2
  267. package/dist/client/assets/utils-BEVyjoxo.js +37 -0
  268. package/dist/client/assets/vcsRefInvalidation-46AnO9mr.js +2 -0
  269. package/dist/client/assets/{vennDiagram-4TSXK5OY-Bw5_1h9Y.js → vennDiagram-4TSXK5OY-CvvE7gMp.js} +2 -2
  270. package/dist/client/assets/{wardley-WFR3VGLG-BzzHb86M.js → wardley-WFR3VGLG-Ca8Qzkpo.js} +1 -1
  271. package/dist/client/assets/{wardleyDiagram-VM6X3IG4-RCSx0hV5.js → wardleyDiagram-VM6X3IG4-BBSNgSMI.js} +2 -2
  272. package/dist/client/assets/{welcome-RXSMyzlx.js → welcome-B3wsq5wK.js} +2 -2
  273. package/dist/client/assets/{xychartDiagram-S5SC5T6Z-CcISZM46.js → xychartDiagram-S5SC5T6Z-D8OhWe48.js} +2 -2
  274. package/dist/client/index.html +1 -1
  275. package/dist/{renderer-C4obs87z.mjs → renderer-C4CdFj__.mjs} +2 -2
  276. package/dist/{runtime-2Dbe0RYi.mjs → runtime-CCVFqL3Y.mjs} +78 -4
  277. package/package.json +1 -1
  278. package/dist/client/assets/AlertDialogRoot-Bb5-VhZe.js +0 -2
  279. package/dist/client/assets/ChatMarkdown-B7b91JUl.js +0 -65
  280. package/dist/client/assets/CheckboxIndicator-BzFOZwIv.js +0 -2
  281. package/dist/client/assets/CodexSetupSection.logic-CeUTTu-x.js +0 -2
  282. package/dist/client/assets/ComboboxClear-Di7TLMMS.js +0 -2
  283. package/dist/client/assets/DiffPanel-D6VVj6BF.js +0 -2
  284. package/dist/client/assets/Input-DoZ73vNO.js +0 -2
  285. package/dist/client/assets/PanelLayoutControls-3fTyX_SN.js +0 -216
  286. package/dist/client/assets/PopoverHandle-D2swQJBt.js +0 -2
  287. package/dist/client/assets/PreviewPanel-Ca3_DPh_.js +0 -2
  288. package/dist/client/assets/ProjectDefaultsSettings-B--7QlKN.js +0 -2
  289. package/dist/client/assets/PullRequestCodeTab-BdP3_tNe.js +0 -6
  290. package/dist/client/assets/SelectScrollUpArrow-CAd5YEsi.js +0 -2
  291. package/dist/client/assets/ThreadTerminalDrawer-CLfVfvoq.js +0 -5
  292. package/dist/client/assets/TooltipViewport-Wc_QpRGI.js +0 -2
  293. package/dist/client/assets/_chat-D-Gcj0-9.js +0 -45
  294. package/dist/client/assets/_chat.pull-requests-DrLHGpqx.js +0 -2
  295. package/dist/client/assets/architecture-7GRP2DOG-BNBr3Sao.js +0 -1
  296. package/dist/client/assets/assets-BhchpDuq.js +0 -2
  297. package/dist/client/assets/channel-CfHDq-fp.js +0 -2
  298. package/dist/client/assets/classDiagram-ZZMXUADV-Cm99q1tS.js +0 -2
  299. package/dist/client/assets/classDiagram-v2-VYDZK3BY-Cm99q1tS.js +0 -2
  300. package/dist/client/assets/device-BEgZIK7u.js +0 -2
  301. package/dist/client/assets/entities-DPIZFvN7.js +0 -2
  302. package/dist/client/assets/eventmodeling-NTZA5JFV-B7plRWX7.js +0 -1
  303. package/dist/client/assets/flowDiagram-HODETNUW-BEpQPBfI.js +0 -1
  304. package/dist/client/assets/main-CxOeqlhD.js +0 -30
  305. package/dist/client/assets/number-field-N4gbrhyd.js +0 -2
  306. package/dist/client/assets/primary-CRkgnOCY.js +0 -2
  307. package/dist/client/assets/primaryCloudLinkState-B_VNTJYL.js +0 -2
  308. package/dist/client/assets/projectFilesQueryState-U08pztRu.js +0 -2
  309. package/dist/client/assets/projectScriptEditor-D8mxKLOb.js +0 -2
  310. package/dist/client/assets/queries-BVPZtaQA.js +0 -2
  311. package/dist/client/assets/query-CpOQgkic.js +0 -2
  312. package/dist/client/assets/radio-group-CfHe3q1m.js +0 -2
  313. package/dist/client/assets/railroad-abnf-HS5TGJTU-BJdCwb3O.js +0 -1
  314. package/dist/client/assets/railroad-ebnf-LZEXJU2U-a9vhoAEG.js +0 -1
  315. package/dist/client/assets/railroad-peg-WCYAUIDC-Cyo-vXW_.js +0 -1
  316. package/dist/client/assets/runtime-Bc4kgQim.js +0 -2
  317. package/dist/client/assets/runtime-DZfpb67Q.js +0 -6
  318. package/dist/client/assets/server-LJ0-FVGH.js +0 -2
  319. package/dist/client/assets/settings.appearance-B_LipS5_.js +0 -2
  320. package/dist/client/assets/settings.archived-B_h3CK_T.js +0 -2
  321. package/dist/client/assets/settings.connections-Bv37N8Tm.js +0 -2
  322. package/dist/client/assets/settings.diagnostics-DuoGRNGf.js +0 -2
  323. package/dist/client/assets/settings.general-B-Bt2-nG.js +0 -2
  324. package/dist/client/assets/settings.plugins-DafKnC5Q.js +0 -5
  325. package/dist/client/assets/settings.projects-r2ZcxKud.js +0 -4
  326. package/dist/client/assets/settings.providers-jbZijXPV.js +0 -3
  327. package/dist/client/assets/settings.scheduled-tasks-C0d4wkYE.js +0 -2
  328. package/dist/client/assets/stateDiagram-v2-MP3YSRHH-CcnJHQ4a.js +0 -2
  329. package/dist/client/assets/swimlanesDiagram-VR7AAH4N-CrkPrysy.js +0 -9
  330. package/dist/client/assets/toast-DYfY2t_z.js +0 -2
  331. package/dist/client/assets/tooltip-924Ikq0L.js +0 -2
  332. package/dist/client/assets/usage-CRK5JZJm.js +0 -2
  333. package/dist/client/assets/useNavigate-Dvl9uiuL.js +0 -2
  334. package/dist/client/assets/useSettings-DCI8Hv09.js +0 -3
  335. package/dist/client/assets/utils-CRwA5SKO.js +0 -37
  336. package/dist/client/assets/vcsRefInvalidation-3pHpDJC2.js +0 -2
@@ -1,2 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{$a as n,$i as r,Ca as i,Eo as a,Fa as o,Ia as s,Ln as c,ME as l,Na as u,Nn as d,Pn as f,Pp as p,Qa as m,Ra as h,Sa as g,To as _,Va as v,Wa as y,Xa as b,Ya as x,Za as S,br as ee,cE as C,ea as te,fa as w,ia as T,io as ne,ja as E,ma as D,na as O,no as k,pa as A,sa as j,sp as M,t as N,ta as re,vo as ie,wa as P,wo as ae,zn as F}from"./utils-CRwA5SKO.js";import{t as oe}from"./useRegisterFieldControl-Bmw-33lq.js";import{t as se}from"./FormContext-DTtr4Y3v.js";import{a as ce}from"./CSPContext-D8hlJ4eS.js";var I=e(t());function le(){let[,e]=I.useState({});return I.useCallback(()=>{e({})},[])}var ue=I.createContext(void 0);function de(){let e=I.useContext(ue);if(e===void 0)throw Error(a(43));return e}var L={inputValue:()=>null,value:()=>null,...F},fe=new Map;function R(e,t){let n=JSON.stringify({locale:e,options:t}),r=fe.get(n);if(r)return r;let i=new Intl.NumberFormat(e,t);return fe.set(n,i),i}function z(e,t,n){return e==null?``:R(t,n).format(e)}function pe(e,t,n){return z(e,t,{...n,maximumFractionDigits:20})}var B=[`零`,`〇`,`一`,`二`,`三`,`四`,`五`,`六`,`七`,`八`,`九`],me={零:`0`,〇:`0`,一:`1`,二:`2`,三:`3`,四:`4`,五:`5`,六:`6`,七:`7`,八:`8`,九:`9`},he=[`٠`,`١`,`٢`,`٣`,`٤`,`٥`,`٦`,`٧`,`٨`,`٩`],V=[`۰`,`۱`,`۲`,`۳`,`۴`,`۵`,`۶`,`۷`,`۸`,`۹`],H=[`0`,`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`],ge=[`%`,`٪`,`%`,`﹪`],_e=[`‰`,`؉`],ve=[`−`,`-`,`‒`,`–`,`—`,`﹣`],U=[`+`,`﹢`],ye=RegExp(`[${he.join(``)}]`,`g`),W=RegExp(`[${V.join(``)}]`,`g`),be=RegExp(`[${H.join(``)}]`,`g`),xe=RegExp(`[${B.join(``)}]`,`g`),G=RegExp(`[${ge.join(``)}]`),K=RegExp(`[${_e.join(``)}]`),Se=/[٠١٢٣٤٥٦٧٨٩]/,Ce=/[۰۱۲۳۴۵۶۷۸۹]/,we=/[零〇一二三四五六七八九]/,Te=RegExp(`[${H.join(``)}]`),Ee=[`.`,`,`,`.`,`,`,`٫`,`٬`],De=/\p{Zs}/u,Oe=[`+`,...U],ke=[`-`,...ve],q=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),Ae=e=>e.replace(/[-\\\]^]/g,e=>`\\${e}`),je=e=>`[${e.map(Ae).join(``)}]`,Me=je([`-`].concat(ve)),Ne=je([`+`].concat(U)),Pe=new RegExp(Me,`gu`),J=new RegExp(Ne,`gu`),Y=new RegExp(Me),X=new RegExp(Ne);function Fe(e,t){let n=R(e,t).formatToParts(11111.1),r={};return n.forEach(e=>{r[e.type]=e.value}),R(e).formatToParts(.1).forEach(e=>{e.type===`decimal`&&(r[e.type]=e.value)}),r}function Z(e,t,n){if(e==null)return null;let r=String(e).replace(/\p{Cf}/gu,``).trim();r=r.replace(Pe,`-`).replace(J,`+`);let i=!1,a=r.match(/([+-])\s*$/);a&&(a[1]===`-`&&(i=!0),r=r.replace(/([+-])\s*$/,``));let o=r.match(/^\s*([+-])/);o&&(o[1]===`-`&&(i=!0),r=r.replace(/^\s*[+-]/,``));let s=t;s===void 0&&(Se.test(r)||Ce.test(r)?s=`ar`:we.test(r)&&(s=`zh`));let{group:c,decimal:l,currency:u}=Fe(s,n),d=R(s,n).formatToParts(1).filter(e=>e.type===`unit`).map(e=>q(e.value)),f=d.length?new RegExp(d.join(`|`),`g`):null,p=null;c&&(p=/\p{Zs}/u.test(c)?/\p{Zs}/gu:c===`'`||c===`’`?/['’]/g:new RegExp(q(c),`g`));let m=[{regex:c?p:null,replacement:``},{regex:l?new RegExp(q(l),`g`):null,replacement:`.`},{regex:/./g,replacement:`.`},{regex:/,/g,replacement:``},{regex:/٫/g,replacement:`.`},{regex:/٬/g,replacement:``},{regex:u?new RegExp(q(u),`g`):null,replacement:``},{regex:f,replacement:``},{regex:ye,replacement:e=>String(he.indexOf(e))},{regex:W,replacement:e=>String(V.indexOf(e))},{regex:be,replacement:e=>String(H.indexOf(e))},{regex:xe,replacement:e=>me[e]}].reduce((e,{regex:t,replacement:n})=>t?e.replace(t,n):e,r),h=m.lastIndexOf(`.`);if(h!==-1&&(m=`${m.slice(0,h).replace(/\./g,``)}.${m.slice(h+1).replace(/\./g,``)}`),/^[-+]?Infinity$/i.test(r)||/[∞]/.test(r))return null;let g=(i?`-`:``)+m,_=parseFloat(g),v=n?.style,y=v===`unit`&&n?.unit===`percent`,b=G.test(e)||v===`percent`;return K.test(e)?_/=1e3:!y&&b&&(_/=100),Number.isNaN(_)?null:_}var Ie=1e-10;function Le(e){let t=R(`en-US`).resolvedOptions(),n=e?.minimumFractionDigits??t.minimumFractionDigits??0;return{maximumFractionDigits:Math.max(e?.maximumFractionDigits??t.maximumFractionDigits??20,n),minimumFractionDigits:n}}function Re(e,t){if(!Number.isFinite(e))return e;let n=Math.min(Math.max(t,0),20);return Number(e.toFixed(n))}function Q(e,t){let{maximumFractionDigits:n}=Le(t);return Re(e,n)}function ze(e,t,n,r=`directional`){if(n===0)return e;let i=Math.abs(n),a=Math.sign(n),o=i*Ie*a,s=r===`nearest`?n:i,c=(e-t+o)/s,l;return l=r===`nearest`?Math.round(c):a>0?Math.floor(c):Math.ceil(c),t+l*(r===`nearest`?n:i)}function Be(e,{step:t,minWithDefault:n,maxWithDefault:r,minWithZeroDefault:i,format:a,snapOnStep:o,small:s,clamp:c}){if(e===null)return e;let l=c?ce(e,n,r):e;if(t!=null&&o){if(t===0)return Q(l,a);let e=i;return!s&&n!==-(2**53-1)&&(e=n),Q(ze(l,e,t,s?`nearest`:`directional`),a)}return Q(l,a)}var $=e(C()),Ve=I.forwardRef(function(e,t){let{id:n,min:a,max:l,smallStep:u=.1,step:f=1,largeStep:p=10,required:m=!1,disabled:h=!1,readOnly:g=!1,form:_,name:y,defaultValue:b,value:x,onValueChange:S,onValueCommitted:ee,allowWheelScrub:C=!1,snapOnStep:w=!1,allowOutOfRange:D=!1,format:k,locale:A,render:M,className:N,inputRef:P,style:F,...oe}=e,{setDirty:se,validityData:ce,disabled:de,setFilled:fe,invalid:R,name:pe,state:B,validation:me,shouldValidateOnChange:he}=c(),V=de||h,H=pe??y,ve=f===`any`?1:f,[U,ye]=I.useState(!1),W=a??-(2**53-1),be=l??2**53-1,xe=a??0,G=k?.style,K=I.useRef(null),Se=ae(P,me.inputRef),Ce=d({id:n}),[we,Te]=v({controlled:x,default:b,name:`NumberField`,state:`value`}),q=we??null,Ae=O(q);o(()=>{fe(q!==null)},[fe,q]);let je=le(),Me=O(k),Ne=I.useRef(!1),Pe=s((e,t)=>{Ne.current=!1,ee?.(e,t)}),J=I.useRef(!0),Y=I.useRef(null),[X,Z]=I.useState(()=>x===void 0?z(q,A,k):He(q,A,k)),[Ie,Le]=I.useState(`numeric`),Re=s(()=>{let{decimal:e,group:t,currency:n,literal:r}=Fe(A,k),i=new Set;Ee.forEach(e=>i.add(e)),e&&i.add(e),t&&(i.add(t),De.test(t)&&i.add(` `));let a=G===`percent`||G===`unit`&&k?.unit===`percent`,o=G===`percent`||G===`unit`&&k?.unit===`permille`;return a&&ge.forEach(e=>i.add(e)),o&&_e.forEach(e=>i.add(e)),G===`currency`&&n&&i.add(n),r&&(Array.from(r).forEach(e=>i.add(e)),De.test(r)&&i.add(` `)),Oe.forEach(e=>i.add(e)),W<0&&ke.forEach(e=>i.add(e)),i}),Q=s(e=>e?.altKey?u:e?.shiftKey?p:ve),ze=s((e,t)=>{let n=t.event,r=t.direction,i=t.reason,a=!D||i!==`input-change`&&i!==`input-blur`&&i!==`input-paste`&&i!==`input-clear`&&i!==`none`,o=Be(e,{step:r?Q(n)*r:void 0,format:Me.current,minWithDefault:W,maxWithDefault:be,minWithZeroDefault:xe,snapOnStep:w,small:n?.altKey??!1,clamp:a}),s=t.reason===`input-change`||t.reason===`input-clear`||t.reason===`input-blur`||t.reason===`input-paste`||t.reason===`none`,c=o!==q||s&&(e!==q||J.current===!1);if(c){if(Y.current=o,S?.(o,t),t.isCanceled)return c;Te(o),se(o!==ce.initialValue),Ne.current=!0}return J.current&&Z(z(o,A,k)),je(),c}),Ve=s((e,{direction:t,currentValue:n,event:r,reason:o})=>{let s=n??Ae.current,c=typeof s==`number`?s+e*t:Math.max(0,a??0);return ze(c,i(o,r,void 0,{direction:t}))});o(function(){if(!J.current)return;let e=x===void 0?z(q,A,k):He(q,A,k);e!==X&&Z(e)}),o(function(){if(!E)return;let e=`text`;W>=0&&(e=`decimal`),Le(e)},[W,G]),I.useEffect(function(){let e=K.current;if(V||g||!C||!e)return;function t(e){if(e.ctrlKey||j(re(K.current))!==K.current)return;e.preventDefault(),J.current=!0;let t=Q(e)??1;Ve(t,{direction:e.deltaY>0?-1:1,event:e,reason:`wheel`})}return T(e,`wheel`,t)},[C,Ve,V,g,Q]);let Ue=I.useMemo(()=>({...B,disabled:V,readOnly:g,required:m,value:q,inputValue:X,scrubbing:U}),[B,V,g,m,q,X,U]),We=I.useMemo(()=>({inputRef:K,inputValue:X,value:q,minWithDefault:W,maxWithDefault:be,disabled:V,readOnly:g,id:Ce,setValue:ze,incrementValue:Ve,getStepAmount:Q,allowInputSyncRef:J,formatOptionsRef:Me,valueRef:Ae,lastChangedValueRef:Y,hasPendingCommitRef:Ne,name:H,required:m,invalid:R,inputMode:Ie,getAllowedNonNumericKeys:Re,min:a,max:l,setInputValue:Z,locale:A,isScrubbing:U,setIsScrubbing:ye,state:Ue,onValueCommitted:Pe}),[K,X,q,W,be,V,g,Ce,ze,Ve,Q,Me,Ae,H,m,R,Ie,Re,a,l,Z,A,U,Ue,Pe]),Ge=ie(`div`,e,{ref:t,state:Ue,props:oe,stateAttributesMapping:L});return(0,$.jsxs)(ue.Provider,{value:We,children:[Ge,(0,$.jsx)(`input`,{...me.getInputValidationProps({onFocus(){K.current?.focus()},onChange(e){if(e.nativeEvent.defaultPrevented||V||g){e.preventBaseUIHandler?.();return}let t=e.currentTarget.valueAsNumber,n=Number.isNaN(t)?null:t,r=i(ne,e.nativeEvent);se(n!==ce.initialValue),ze(n,r),he()&&me.commit(n)}}),ref:Se,type:`number`,form:_,name:H,value:q??``,min:a,max:l,step:f,disabled:V,required:m,"aria-hidden":!0,tabIndex:-1,style:H?te:r,suppressHydrationWarning:!0})]})});function He(e,t,n){return n?.maximumFractionDigits!=null||n?.minimumFractionDigits!=null?z(e,t,n):pe(e,t,n)}var Ue=I.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{state:o}=de();return ie(`div`,e,{ref:t,state:o,props:[{role:`group`},a],stateAttributesMapping:L})}),We=0,Ge=class e extends A{static create(){return new e}start(e,t){this.clear(),this.currentId=setInterval(()=>{t()},e)}clear=()=>{this.currentId!==We&&(clearInterval(this.currentId),this.currentId=We)}};function Ke(){let e=_(Ge.create).current;return g(e.disposeEffect),e}var qe=60,Je=400,Ye=8,Xe=50,Ze=3;function Qe(e){return e===`touch`||e===`pen`}function $e(e){let{disabled:t,readOnly:n=!1,tick:r,onStop:i,tickDelay:a=qe,startDelay:o=Je,scrollDistance:c=Ye,elementRef:l}=e,u=D(),d=Ke(),f=D(),p=I.useRef(!1),m=I.useRef(0),g=I.useRef({x:0,y:0}),_=I.useRef(!1),v=I.useRef(!1),y=I.useRef(``),b=I.useRef(()=>{}),x=s(()=>{f.clear(),u.clear(),d.clear(),b.current(),m.current=0});function S(e){x();let t=l.current;if(!t)return;let n=h(t);function s(e){e.preventDefault()}if(b.current=T(n,`contextmenu`,s),T(n,`pointerup`,e=>{p.current=!1,x(),i?.(e)},{once:!0}),!r(e)){x();return}u.start(o,()=>{d.start(a,()=>{r(e)||x()})})}return I.useEffect(()=>()=>x(),[x]),{pointerHandlers:{onTouchStart(){_.current=!0},onTouchEnd(){_.current=!1},onPointerDown(e){let r=!e.button||e.button===0;e.defaultPrevented||!r||t||n||(y.current=e.pointerType,v.current=!1,p.current=!0,g.current={x:e.clientX,y:e.clientY},Qe(e.pointerType)?f.start(Xe,()=>{let t=m.current;m.current=0,p.current&&t<Ze?(S(e.nativeEvent),v.current=!0):(v.current=!1,x())}):(e.preventDefault(),S(e.nativeEvent)))},onPointerUp(e){Qe(e.pointerType)&&(p.current=!1)},onPointerMove(e){if(t||n||!Qe(e.pointerType)||!p.current)return;m.current!=null&&(m.current+=1);let{x:r,y:i}=g.current,a=r-e.clientX,o=i-e.clientY;a**2+o**2>c**2&&x()},onMouseEnter(e){e.defaultPrevented||t||n||!p.current||_.current||Qe(y.current)||S(e.nativeEvent)},onMouseLeave(){_.current||x()},onMouseUp(){_.current||x()}},shouldSkipClick:s(e=>e.defaultPrevented?!0:Qe(y.current)?v.current:e.detail!==0)}}function et(e){return e===`touch`||e===`pen`}function tt(e){let{allowInputSyncRef:t,disabled:n,formatOptionsRef:r,getStepAmount:a,id:o,incrementValue:s,inputRef:c,inputValue:l,isIncrement:u,locale:d,readOnly:f,setValue:p,valueRef:m,lastChangedValueRef:h,onValueCommitted:g}=e,_=u?x:y;function v(e){t.current=!0;let n=Z(l,d,r.current);n!==null&&(m.current=n,p(n,i(_,e,void 0,{direction:u?1:-1})))}let{pointerHandlers:b,shouldSkipClick:S}=$e({disabled:n||f,elementRef:c,tickDelay:60,startDelay:400,scrollDistance:8,tick(e){let t=a(e)??1;return s(t,{direction:u?1:-1,event:e,reason:_})},onStop(e){let t=h.current??m.current;g(t,P(_,e))}});return{disabled:n,"aria-readonly":f||void 0,"aria-label":u?`Increase`:`Decrease`,"aria-controls":o,tabIndex:-1,style:{WebkitUserSelect:`none`,userSelect:`none`},...b,onClick(e){let t=n||f;if(e.defaultPrevented||t||S(e))return;v(e.nativeEvent);let r=a(e)??1,i=m.current;s(r,{direction:u?1:-1,event:e.nativeEvent,reason:_});let o=h.current??m.current;o!==i&&g(o,P(_,e.nativeEvent))},onPointerDown(e){let t=!e.button||e.button===0;e.defaultPrevented||f||!t||n||(v(e.nativeEvent),et(e.pointerType)||c.current?.focus(),b.onPointerDown(e))}}}var nt=I.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,style:o,...s}=e,{allowInputSyncRef:c,disabled:l,formatOptionsRef:d,getStepAmount:f,id:p,incrementValue:m,inputRef:h,inputValue:g,locale:_,maxWithDefault:v,readOnly:y,setValue:b,state:x,value:S,valueRef:ee,lastChangedValueRef:C,onValueCommitted:te}=de(),w=i||l||S!=null&&S>=v,T=tt({isIncrement:!0,inputRef:h,inputValue:g,disabled:w,readOnly:y,id:p,setValue:b,getStepAmount:f,incrementValue:m,allowInputSyncRef:c,formatOptionsRef:d,valueRef:ee,locale:_,lastChangedValueRef:C,onValueCommitted:te}),{getButtonProps:ne,buttonRef:E}=u({disabled:w,native:a,focusableWhenDisabled:!0}),D=I.useMemo(()=>({...x,disabled:w}),[x,w]);return ie(`button`,e,{ref:[t,E],state:D,props:[T,s,ne],stateAttributesMapping:L})}),rt=I.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,style:o,...s}=e,{allowInputSyncRef:c,disabled:l,formatOptionsRef:d,getStepAmount:f,id:p,incrementValue:m,inputRef:h,inputValue:g,minWithDefault:_,readOnly:v,setValue:y,state:b,value:x,valueRef:S,locale:ee,lastChangedValueRef:C,onValueCommitted:te}=de(),w=i||l||x!=null&&x<=_,T=tt({isIncrement:!1,inputRef:h,inputValue:g,disabled:w,readOnly:v,id:p,setValue:y,getStepAmount:f,incrementValue:m,allowInputSyncRef:c,formatOptionsRef:d,valueRef:S,locale:ee,lastChangedValueRef:C,onValueCommitted:te}),{getButtonProps:ne,buttonRef:E}=u({disabled:w,native:a,focusableWhenDisabled:!0}),D=I.useMemo(()=>({...b,disabled:w}),[b,w]);return ie(`button`,e,{ref:[t,E],state:D,props:[T,s,ne],stateAttributesMapping:L})}),it={...F,...L},at=new Set([`Backspace`,`Delete`,`ArrowLeft`,`ArrowRight`,`Tab`,`Enter`,`Escape`]),ot=I.forwardRef(function(e,t){let{render:r,className:a,style:o,...s}=e,{allowInputSyncRef:l,disabled:u,formatOptionsRef:d,getAllowedNonNumericKeys:p,getStepAmount:h,id:g,incrementValue:_,inputMode:v,inputValue:y,max:x,min:C,name:te,readOnly:T,required:ne,setValue:E,state:D,setInputValue:O,locale:A,inputRef:j,value:M,onValueCommitted:N,lastChangedValueRef:re,hasPendingCommitRef:ae,valueRef:F}=de(),{clearErrors:ce}=se(),{validationMode:le,setTouched:ue,setFocused:L,invalid:fe,shouldValidateOnChange:R,validation:B}=c(),{labelId:me}=f(),he=I.useRef(!1),V=I.useRef(!1);return oe(j,g,M),ee(M,e=>{let t=R();if(ce(te),t&&B.commit(M),!(e===M||t)){if(V.current){V.current=!1;return}B.commit(M,!0)}}),ie(`input`,e,{ref:[t,j],state:D,props:[{id:g,required:ne,disabled:u,readOnly:T,inputMode:v,value:y,type:`text`,autoComplete:`off`,autoCorrect:`off`,spellCheck:`false`,"aria-roledescription":`Number field`,"aria-invalid":fe||void 0,"aria-labelledby":me,suppressHydrationWarning:!0,onFocus(e){if(e.defaultPrevented||T||u||(L(!0),he.current))return;he.current=!0;let t=e.currentTarget,n=t.value.length;t.setSelectionRange(n,n)},onBlur(e){if(e.defaultPrevented||T||u)return;ue(!0),L(!1);let t=!l.current,n=ae.current;if(l.current=!0,y.trim()===``){E(null,i(m,e.nativeEvent)),le===`onBlur`&&B.commit(null),N(null,P(m,e.nativeEvent));return}let r=d.current,a=Z(y,A,r);if(a===null)return;let o=r?.maximumFractionDigits!=null||r?.minimumFractionDigits!=null,s=r?.maximumFractionDigits,c=o&&typeof s==`number`?Number(a.toFixed(s)):a,f=P(b,e.nativeEvent),p=M!==c,h=t||p||n;le===`onBlur`&&B.commit(c),p&&(V.current=!0,E(c,i(b,e.nativeEvent))),h&&N(c,f);let g=z(c,A,r);(o||a!==M||y!==pe(a,A,r))&&y!==g&&O(g)},onChange(e){if(e.nativeEvent.defaultPrevented)return;l.current=!1;let t=e.currentTarget.value;if(t.trim()===``){O(t),E(null,i(m,e.nativeEvent));return}let n=p();if(!Array.from(t).every(e=>{let t=e>=`0`&&e<=`9`,r=Se.test(e),i=we.test(e),a=Ce.test(e),o=Te.test(e),s=Y.test(e);return t||r||i||a||o||s||n.has(e)}))return;let r=Z(t,A,d.current);O(t),r!==null&&E(r,i(S,e.nativeEvent))},onKeyDown(e){if(e.defaultPrevented||T||u)return;let t=e.nativeEvent;l.current=!0;let n=p(),r=n.has(e.key),{decimal:a,currency:o,percentSign:s}=Fe(A,d.current),c=e.currentTarget.selectionStart,f=e.currentTarget.selectionEnd,m=c===0&&f===y.length,g=e=>c!=null&&f!=null&&e>=c&&e<f;if(Y.test(e.key)&&Array.from(n).some(e=>Y.test(e||``))){let e=y.search(Pe),t=e!=null&&e!==-1&&g(e);r=!(Y.test(y)||X.test(y))||m||t}if(X.test(e.key)&&Array.from(n).some(e=>X.test(e||``))){let e=y.search(J),t=e!=null&&e!==-1&&g(e);r=!(Y.test(y)||X.test(y))||m||t}[a,o,s].forEach(t=>{if(e.key===t){let e=y.indexOf(t),n=g(e);r=!y.includes(t)||m||n}});let v=e.key>=`0`&&e.key<=`9`,b=Se.test(e.key),S=we.test(e.key),ee=Ce.test(e.key),te=Te.test(e.key),ne=at.has(e.key);if(e.which===229||e.altKey||e.ctrlKey||e.metaKey||r||v||b||te||S||ee||ne)return;let D=Z(y,A,d.current),O=h(e)??1;w(e);let j=P(k,t);e.key===`ArrowUp`?(_(O,{direction:1,currentValue:D,event:t,reason:k}),N(re.current??F.current,j)):e.key===`ArrowDown`?(_(O,{direction:-1,currentValue:D,event:t,reason:k}),N(re.current??F.current,j)):e.key===`Home`&&C!=null?(E(C,i(k,t)),N(re.current??F.current,j)):e.key===`End`&&x!=null&&(E(x,i(k,t)),N(re.current??F.current,j))},onPaste(e){if(e.defaultPrevented||T||u)return;e.preventDefault();let t=(e.clipboardData||window.Clipboard).getData(`text/plain`),r=Z(t,A,d.current);r!==null&&(l.current=!1,E(r,i(n,e.nativeEvent)),O(t))}},B.getValidationProps(),s],stateAttributesMapping:it})}),st=l();function ct(e){let t=(0,st.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({id:r,className:n,size:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?`default`:a,s=I.useId(),c=r??s,l;t[5]===n?l=t[6]:(l=N(`flex w-full flex-col items-start gap-2`,n),t[5]=n,t[6]=l);let u;return t[7]!==c||t[8]!==i||t[9]!==o||t[10]!==l?(u=(0,$.jsx)(Ve,{className:l,"data-size":o,"data-slot":`number-field`,id:c,...i}),t[7]=c,t[8]=i,t[9]=o,t[10]=l,t[11]=u):u=t[11],u}function lt(e){let t=(0,st.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,shape:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`default`:i,o=a===`pill`&&`overflow-hidden rounded-xl before:rounded-xl`,s=a===`soft`&&`rounded-lg border-transparent bg-accent shadow-none before:hidden dark:bg-accent`,c;t[4]!==n||t[5]!==o||t[6]!==s?(c=N(`relative flex w-full justify-between rounded-lg border border-input bg-background not-dark:bg-clip-padding text-base text-foreground shadow-xs/5 ring-ring/24 transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] not-data-disabled:not-focus-within:not-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)] focus-within:border-ring focus-within:ring-[3px] focus-within:ring-inset has-aria-invalid:border-destructive/36 has-autofill:bg-foreground/4 focus-within:has-aria-invalid:border-destructive/64 focus-within:has-aria-invalid:ring-destructive/48 data-disabled:pointer-events-none data-disabled:opacity-64 sm:text-sm dark:bg-input/32 dark:has-autofill:bg-foreground/8 dark:has-aria-invalid:ring-destructive/24 dark:not-data-disabled:not-focus-within:not-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/6%)] [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0 [[data-disabled],:focus-within,[aria-invalid]]:shadow-none`,o,s,n),t[4]=n,t[5]=o,t[6]=s,t[7]=c):c=t[7];let l;return t[8]!==r||t[9]!==c?(l=(0,$.jsx)(Ue,{className:c,"data-slot":`number-field-group`,...r}),t[8]=r,t[9]=c,t[10]=l):l=t[10],l}function ut(e){let t=(0,st.c)(9),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=N(`relative flex shrink-0 cursor-pointer items-center justify-center rounded-s-[calc(var(--radius-lg)-1px)] in-data-[size=sm]:px-[calc(--spacing(2.5)-1px)] in-data-[size=compact]:w-8 in-data-[size=compact]:px-0 px-[calc(--spacing(3)-1px)] transition-colors pointer-coarse:after:absolute pointer-coarse:after:size-full pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 hover:bg-accent`,n),t[3]=n,t[4]=i);let a;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(M,{}),t[5]=a):a=t[5];let o;return t[6]!==r||t[7]!==i?(o=(0,$.jsx)(rt,{className:i,"data-slot":`number-field-decrement`,...r,children:a}),t[6]=r,t[7]=i,t[8]=o):o=t[8],o}function dt(e){let t=(0,st.c)(9),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=N(`relative flex shrink-0 cursor-pointer items-center justify-center rounded-e-[calc(var(--radius-lg)-1px)] in-data-[size=sm]:px-[calc(--spacing(2.5)-1px)] in-data-[size=compact]:w-8 in-data-[size=compact]:px-0 px-[calc(--spacing(3)-1px)] transition-colors pointer-coarse:after:absolute pointer-coarse:after:size-full pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 hover:bg-accent`,n),t[3]=n,t[4]=i);let a;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(p,{}),t[5]=a):a=t[5];let o;return t[6]!==r||t[7]!==i?(o=(0,$.jsx)(nt,{className:i,"data-slot":`number-field-increment`,...r,children:a}),t[6]=r,t[7]=i,t[8]=o):o=t[8],o}function ft(e){let t=(0,st.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=N(`h-8.5 in-data-[size=compact]:h-8 in-data-[size=compact]:px-0 in-data-[size=compact]:leading-8 sm:in-data-[size=compact]:h-8 sm:in-data-[size=compact]:leading-8 in-data-[size=lg]:h-9.5 in-data-[size=sm]:h-7.5 w-full min-w-0 grow bg-transparent in-data-[size=sm]:px-[calc(--spacing(2.5)-1px)] px-[calc(--spacing(3)-1px)] text-center tabular-nums in-data-[size=lg]:leading-9.5 in-data-[size=sm]:leading-7.5 leading-8.5 outline-none [transition:background-color_5000000s_ease-in-out_0s] sm:h-7.5 sm:in-data-[size=lg]:h-8.5 sm:in-data-[size=sm]:h-6.5 sm:in-data-[size=lg]:leading-8.5 sm:in-data-[size=sm]:leading-8.5 sm:leading-7.5`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,$.jsx)(ot,{className:i,"data-slot":`number-field-input`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}export{ft as a,dt as i,ut as n,lt as r,ct as t};
2
- //# sourceMappingURL=number-field-N4gbrhyd.js.map
@@ -1,2 +0,0 @@
1
- import{$o as e,BS as t,Dx as n,Dy as r,Fy as i,Go as a,ME as o,MT as s,My as c,Nl as l,Ol as u,RS as ee,Ss as d,Sy as f,Yo as p,ag as m,dS as h,is as g,kw as _,rb as v,rs as y,ss as b,ub as x,zy as S}from"./utils-CRwA5SKO.js";import{b as C,n as w,w as T}from"./runtime-DZfpb67Q.js";import{Dt as E,Tt as D}from"./runtime-Bc4kgQim.js";var te=r([`fetch-session-state`,`exchange-bootstrap-credential`,`fetch-environment-descriptor`,`create-pairing-credential`,`list-pairing-links`,`revoke-pairing-link`,`list-client-sessions`,`revoke-client-session`,`revoke-other-client-sessions`]),O=class e extends S()(`PrimaryEnvironmentRequestError`,{operation:te,status:c,pairingLinkId:x(i),sessionId:x(i),cause:f()}){static fromCause(t){let n=ne(t.cause)??500;return new e({operation:t.operation,status:n,...t.pairingLinkId===void 0?{}:{pairingLinkId:t.pairingLinkId},...t.sessionId===void 0?{}:{sessionId:t.sessionId},cause:t.cause})}get message(){return`Primary environment request failed during ${this.operation} (HTTP ${this.status}).`}},k=v(O),A=class extends S()(`PrimaryEnvironmentPairingCredentialRejectedError`,{providedLength:c,cause:f()}){get message(){return`Invalid pairing token. Check the token and try again.`}};v(A);var j=class extends S()(`PrimaryEnvironmentAuthSessionTimeoutError`,{timeoutMs:c,elapsedMs:c}){get message(){return`Timed out waiting for authenticated session after bootstrap.`}},M=class extends S()(`PrimaryEnvironmentPairingCredentialRequiredError`,{providedLength:c}){get message(){return`Enter a pairing token to continue.`}},N=v(l),P=null,F=null,I=!1,L=2e3,R=100;function z(){return D(new URL(window.location.href))}function B(){let e=new URL(window.location.href),t=E(e);t.toString()!==e.toString()&&window.history.replaceState({},document.title,t.toString())}function V(){let e=z();return e?(B(),e):null}function H(){let e=(window.desktopBridge?.getLocalEnvironmentBootstraps()??[]).find(e=>e.id===u);return typeof e?.bootstrapToken==`string`&&e.bootstrapToken.length>0?e.bootstrapToken:null}async function U(){return X(async()=>{try{return await w(C.pipe(n(e=>e.auth.session({headers:{}}))))}catch(e){throw O.fromCause({operation:`fetch-session-state`,cause:e})}})}function ne(e){return N(e)?W(e):m(e)&&e.response!==void 0?e.response.status:null}function W(e){switch(e._tag){case`EnvironmentRequestInvalidError`:return 400;case`EnvironmentAuthInvalidError`:return 401;case`EnvironmentScopeRequiredError`:case`EnvironmentOperationForbiddenError`:return 403;case`EnvironmentResourceNotFoundError`:return 404;case`EnvironmentInternalError`:return 500}}async function G(e){return X(async()=>{try{return await w(C.pipe(n(t=>t.auth.browserSession({payload:{credential:e}}))))}catch(t){throw N(t)&&t._tag===`EnvironmentAuthInvalidError`&&t.reason===`invalid_credential`?new A({providedLength:e.length,cause:t}):O.fromCause({operation:`exchange-bootstrap-credential`,cause:t})}})}async function K(){let e=Date.now();for(;;){let t=await U();if(t.authenticated)return t;let n=Date.now()-e;if(n>=L)throw new j({timeoutMs:L,elapsedMs:n});await Z(R)}}var q=new Set([502,503,504]),J=15e3,Y=500;async function X(e){let t=Date.now();for(;;)try{return await e()}catch(e){if(!re(e)||Date.now()-t>=J)throw e;await Z(Y)}}function Z(e){return new Promise(t=>{setTimeout(t,e)})}function re(e){return k(e)?q.has(e.status):e instanceof TypeError||e instanceof DOMException&&e.name===`AbortError`}async function Q(e){let t=await U();if(t.authenticated&&!e)return{status:`authenticated`};let n=e??H();if(!n)return{status:`requires-auth`,auth:t.auth};try{return await G(n),await K(),{status:`authenticated`}}catch(e){return{status:`requires-auth`,auth:t.auth,errorMessage:e instanceof Error?e.message:`Authentication failed.`}}}async function ie(e){let t=e.trim();if(!t)throw new M({providedLength:e.length});F=null,await G(t),await K(),F={status:`authenticated`},P=null,I=!1,B()}async function ae(e){let t=e?.label?.trim();try{return await w(C.pipe(n(n=>n.auth.pairingCredential({headers:{},payload:{...t?{label:t}:{},...e?.scopes?{scopes:e.scopes}:{}}}))))}catch(e){throw O.fromCause({operation:`create-pairing-credential`,cause:e})}}async function oe(e){try{await w(C.pipe(n(t=>t.auth.revokePairingLink({headers:{},payload:{id:e}}))))}catch(t){throw O.fromCause({operation:`revoke-pairing-link`,pairingLinkId:e,cause:t})}}async function se(e){try{await w(C.pipe(n(t=>t.auth.revokeClient({headers:{},payload:{sessionId:e}}))))}catch(t){throw O.fromCause({operation:`revoke-client-session`,sessionId:e,cause:t})}}async function ce(){try{return(await w(C.pipe(n(e=>e.auth.revokeOtherClients({headers:{}}))))).revokedCount}catch(e){throw O.fromCause({operation:`revoke-other-client-sessions`,cause:e})}}async function le(){if(window.location.pathname.replace(/\/+$/,``)===`/pair`?z()&&(I=!0):I=!1,I)return{status:`requires-auth`,auth:(await U()).auth};let e=V(),t=P;if(e)F=null;else{if(t)return t;if(F?.status===`authenticated`)return F}let n=t?t.catch(()=>void 0).then(()=>(F=null,Q(e))):Q(e);return P=n,n.then(e=>(P===n&&e.status===`authenticated`&&(F=e),e)).finally(()=>{P===n&&(P=null)})}var ue=o(),$=e(t(()=>T()?ee(null):h(U))).pipe(g({staleTime:5e3,revalidateOnMount:!0}),y(3e5),b(`primary-environment:session`));function de(){a.refresh($)}function fe(){let e=(0,ue.c)(8),t=p($),n=pe,r=null;if(t._tag===`Failure`){let n;e[0]===t.cause?n=e[1]:(n=_(t.cause),e[0]=t.cause,e[1]=n);let i=n;r=i instanceof Error?i.message:`Could not read environment session.`}let i;e[2]===t?i=e[3]:(i=s(d(t)),e[2]=t,e[3]=i);let a;return e[4]!==r||e[5]!==t.waiting||e[6]!==i?(a={data:i,error:r,isPending:t.waiting,refresh:n},e[4]=r,e[5]=t.waiting,e[6]=i,e[7]=a):a=e[7],a}function pe(){de()}export{ce as a,B as c,le as i,ie as l,ae as n,se as o,z as r,oe as s,fe as t};
2
- //# sourceMappingURL=primary-CRkgnOCY.js.map
@@ -1,2 +0,0 @@
1
- import{$o as e,Bw as t,Bx as n,Dy as r,EC as i,FT as a,Fl as o,Fy as s,Go as c,Il as l,JS as u,Lc as d,Ll as ee,ME as te,MT as ne,Ml as re,Pl as ie,Qo as f,Qx as p,Ss as m,Tv as ae,Uy as oe,VS as h,Xx as se,Yo as ce,Zo as le,_u as g,aT as ue,b_ as de,bx as fe,eC as pe,eS as _,ec as v,fS as y,fx as me,is as he,jl as ge,kl as b,kw as x,ly as S,ns as C,rb as w,rs as T,ss as E,ub as D,xs as O,yv as k,zy as A}from"./utils-CRwA5SKO.js";import{$ as j,Nn as M,Z as N,dt as P,mn as F,o as I,r as L,s as _e,v as R}from"./runtime-DZfpb67Q.js";import"./runtime-Bc4kgQim.js";import{o as ve}from"./environments-Dm2_6Uan.js";import{i as ye,n as z}from"./session-Bc1P10r_.js";var be=te(),xe=class extends A()(`RelayClientInstallConfirmationConflictError`,{requestedVersion:s,activeVersion:s,activeDialogStatus:r([`confirming`,`installing`,`closing`]),activeInstallStage:D(b)}){get message(){return`Cannot confirm relay client installation ${this.requestedVersion}; installation ${this.activeVersion} has dialog status ${this.activeDialogStatus}.`}},B={status:`idle`},V=B,H=null,U=new Set;function W(e){V=e;for(let e of U)e()}function Se(){return V}function Ce(e){return U.add(e),()=>{U.delete(e)}}function we(e){if(V.status!==`idle`){let t=V.status===`closing`?V.view:V;return Promise.reject(new xe({requestedVersion:e,activeVersion:t.version,activeDialogStatus:V.status,...t.status===`installing`?{activeInstallStage:t.stage}:{}}))}return W({status:`confirming`,version:e}),new Promise(e=>{H=e})}function Te(e){if(V.status!==`confirming`||!H)return;let t=H;H=null,W(e?{status:`installing`,version:V.version,stage:`checking`}:{status:`closing`,view:V}),t(e)}function Ee(e){V.status===`installing`&&e.type===`progress`&&W({...V,stage:e.stage})}function De(){H?.(!1),H=null,(V.status===`confirming`||V.status===`installing`)&&W({status:`closing`,view:V})}function Oe(){V.status===`closing`&&W(B)}function G(){return _e().relayUrl}var K=class extends t(`CloudEnvironmentLinkError`){},q=e=>t=>new K({message:e,cause:t});function ke(e){return n(function*(){let t=yield*P,n=yield*t.run(e,N(d.cloudGetRelayClientStatus,{})).pipe(_(q(`Could not check relay client availability.`)));if(n.status===`available`)return;if(n.status===`unsupported`)return yield*new K({message:`P4 Code cannot install the relay client automatically on ${n.platform}-${n.arch}.`});if(!(yield*u({try:()=>we(n.version),catch:q(`Could not confirm relay client installation.`)})))return yield*new K({message:`Relay client installation was cancelled.`});let r=yield*t.runStream(e,j(d.cloudInstallRelayClient,{}).pipe(ae(e=>h(()=>Ee(e))))).pipe(k,_(q(`Could not install the relay client.`)),fe(h(De)));if(a(r)||r.value.type!==`complete`)return yield*new K({message:`The relay client install completed without a final status.`});let i=r.value.status;if(i.status!==`available`)return yield*new K({message:i.status===`unsupported`?`P4 Code cannot install the relay client automatically on ${i.platform}-${i.arch}.`:`The relay client is still unavailable after installation.`})})}var Ae=w(oe([re,ee,o,ie,l,ge]));function J(e){return t=>{let n=t._tag===`ManagedRelayRequestFailedError`?t:void 0,r=n?.traceId,i=n?M(n):null;return new K({message:i?`${e}: ${i}`:e,cause:t,...r?{traceId:r}:{}})}}function Y(e){return Ae(e)?e:typeof e!=`object`||!e?null:`cause`in e?Y(e.cause):null}var X=e=>t=>{let n=Y(t);return new K({message:n?`${e.replace(/[.:]$/,``)}: ${n.message}`:e,cause:t})};function je(e){let t=new URL(e);return{localHttpHost:`127.0.0.1`,localHttpPort:Number(t.port||(t.protocol===`https:`?443:80))}}var Me=`cloudflare_tunnel`;function Ne(e){return e.link.environmentId===e.expectedEnvironmentId?e.link.endpoint.providerKind===e.expectedProviderKind?pe:new K({message:`Relay returned credentials for a different endpoint provider.`}):new K({message:`Relay returned credentials for a different environment.`})}function Pe(e){return n(function*(){return yield*(yield*v(e.target.httpBaseUrl)).connect.linkState({headers:{}}).pipe(_(X(`Could not read environment cloud link state.`)))}).pipe(y(R))}function Fe(e){return n(function*(){let t=yield*v(e.target.httpBaseUrl),{target:n,...r}=e;return yield*t.connect.preferences({headers:{},payload:r}).pipe(_(X(`Could not update environment cloud preferences.`)))}).pipe(y(R))}function Ie(e){return n(function*(){yield*(yield*v(e.target.httpBaseUrl)).connect.unlink({headers:{}}).pipe(_(X(`Could not unlink the environment from cloud.`))),G()&&e.clerkToken&&(yield*(yield*F).unlinkEnvironment({clerkToken:e.clerkToken,environmentId:S.make(e.target.environmentId)}).pipe(me(e=>se(`Could not revoke cloud environment link after local unlink.`,{cause:e}))))}).pipe(y(R))}var Z=`manual`;function Le(e){return n(function*(){let t=G();if(!t)return yield*new K({message:`P4CODE_RELAY_URL is not configured.`});let n=(e.mode??`managed`)===`managed`,r=n?Me:Z,i=yield*F,a=yield*v(e.target.httpBaseUrl);n&&(yield*ke(S.make(e.target.environmentId)));let o=yield*i.createEnvironmentLinkChallenge({clerkToken:e.clerkToken,payload:{notificationsEnabled:!0,liveActivitiesEnabled:!0,managedTunnelsEnabled:n}}).pipe(_(J(`${t}/v1/client/environment-link-challenges failed`))),s=yield*a.connect.linkProof({headers:{},payload:{challenge:o.challenge,relayIssuer:t,endpoint:{httpBaseUrl:e.target.httpBaseUrl,wsBaseUrl:e.target.wsBaseUrl,providerKind:r},origin:je(e.target.httpBaseUrl)}}).pipe(_(X(`Could not obtain environment link proof.`))),c=yield*i.linkEnvironment({clerkToken:e.clerkToken,payload:{proof:s,notificationsEnabled:!0,liveActivitiesEnabled:!0,managedTunnelsEnabled:n}}).pipe(_(J(`${t}/v1/client/environment-links failed`)));yield*Ne({expectedEnvironmentId:e.target.environmentId,expectedProviderKind:r,link:c}),yield*a.connect.relayConfig({headers:{},payload:{relayUrl:t,relayIssuer:c.relayIssuer,cloudUserId:c.cloudUserId,environmentCredential:c.environmentCredential,cloudMintPublicKey:c.cloudMintPublicKey,endpointRuntime:c.endpointRuntime}}).pipe(_(X(`Could not configure environment relay access.`)))}).pipe(y(R))}var Re=C(i(g,L.contextEffect.pipe(p(e=>ue(e,g))))),Q=le(e=>{let t=JSON.parse(e);return Re.atom(Pe({target:t})).pipe(he({staleTime:5e3,revalidateOnMount:!0}),T(3e5),E(`primary-cloud-link:${t.environmentId}`))}),ze=e(O(null)).pipe(f,E(`primary-cloud-link:null`));function $(e){return JSON.stringify(e)}function Be(e){e&&z(S.make(e.environmentId),`relay:read`)&&c.refresh(Q($(e)))}function Ve(e){if(!z(S.make(e.environmentId),`relay:read`))return null;let t=c.get(Q($(e)));return t._tag===`Success`?t.value:null}function He(){let e=(0,be.c)(17),t=ve(),n=ye(t?.environmentId??null,de),r;e[0]===t?r=e[1]:(r=t?.entry.target._tag===`PrimaryConnectionTarget`?{environmentId:t.environmentId,label:t.label,httpBaseUrl:t.entry.target.httpBaseUrl,wsBaseUrl:t.entry.target.wsBaseUrl}:null,e[0]=t,e[1]=r);let i=r,a;e[2]!==n||e[3]!==i?(a=i&&I()&&n?Q($(i)):ze,e[2]=n,e[3]=i,e[4]=a):a=e[4];let o=ce(a),s;e[5]===i?s=e[6]:(s=()=>{Be(i)},e[5]=i,e[6]=s);let c=s,l=null;if(o._tag===`Failure`){let t;e[7]===o.cause?t=e[8]:(t=x(o.cause),e[7]=o.cause,e[8]=t);let n=t;l=n instanceof Error?n.message:`Could not read P4 Connect link state.`}let u;e[9]===o?u=e[10]:(u=o._tag===`Failure`?null:ne(m(o)),e[9]=o,e[10]=u);let d;return e[11]!==l||e[12]!==c||e[13]!==o.waiting||e[14]!==u||e[15]!==i?(d={data:u,error:l,isPending:o.waiting,refresh:c,target:i},e[11]=l,e[12]=c,e[13]=o.waiting,e[14]=u,e[15]=i,e[16]=d):d=e[16],d}export{Fe as a,Te as c,Ie as i,Ce as l,He as n,Oe as o,Le as r,Se as s,Ve as t};
2
- //# sourceMappingURL=primaryCloudLinkState-B_VNTJYL.js.map
@@ -1,2 +0,0 @@
1
- import{$o as e,Go as t,Jo as n,ME as r,MT as i,PT as a,Ss as o,Yo as s,kg as c,kw as l,nl as u,rb as d,ss as f,vs as p}from"./utils-CRwA5SKO.js";import{L as m}from"./runtime-DZfpb67Q.js";import{s as h}from"./vcsRefInvalidation-3pHpDJC2.js";import{W as g}from"./entities-DPIZFvN7.js";import{o as _}from"./queries-BVPZtaQA.js";var v=r(),y=``,b=e(p(!1)),x=e(p(!1)).pipe(f(`project-file-query:empty`));function S(e,t,n){return g.optimisticFile({environmentId:e,cwd:t,relativePath:n})}var C=new Map;function w(e){let t=C.get(e);C.delete(e),t?.()}function T(e,t,n){return g.listEntries({environmentId:e,input:{cwd:t,...n===void 0?{}:{directoryPath:n}}})}function E(e,t,n){return g.readFile({environmentId:e,input:{cwd:t,relativePath:n??y}})}function D(e,t,n){return g.readConfiguration({environmentId:e,input:{cwd:t,relativePath:n}})}function O(e,n,r,i){let a=S(e,n,r);C.has(a)||C.set(a,t.mount(a)),t.set(a,{confirmedAgainst:void 0,data:{relativePath:r,contents:i,byteLength:new TextEncoder().encode(i).byteLength,truncated:!1}})}function k(e,n,r){return t.get(S(e,n,r))?.data??null}function A(e,n,r){let i=k(e,n,r);if(i)return i.contents;let s=t.get(E(e,n,r));return a(o(s))?.contents}function j(e,n,r){let i=t.get(S(e,n,r));return i?.confirmedAgainst===void 0?i?.data??null:null}function M(e,n,r,i){let a=S(e,n,r),o=t.get(a);if(o?.data.contents!==i)return!1;let s=E(e,n,r),c={...o,confirmedAgainst:t.get(s)};return t.set(a,c),w(a),t.refresh(s),m(t,s,{reportDefect:!1,reportFailure:!1}).then(async i=>{if(r===`p4.json`||r===`t3.json`){let r=D(e,n,u);t.refresh(r),await m(t,r,{reportDefect:!1,reportFailure:!1})}i._tag===`Success`&&t.get(a)===c&&t.set(a,null)}),!0}function N(e,n,r,i){return r===null?i:t.get(S(e,n,r))?.data??i}function P(e){return e._tag===`Failure`?l(e.cause):null}function F(e){return e===null?null:e instanceof Error?e.message:`Workspace query failed.`}var I=d(c);function L(e,t,r){let a=(0,v.c)(19),c=h(e),{canReadFiles:l}=c,u;a[0]!==l||a[1]!==t||a[2]!==r||a[3]!==e?(u=l?T(e,t,r):b,a[0]=l,a[1]=t,a[2]=r,a[3]=e,a[4]=u):u=a[4];let d=u,f=s(d),p=n(d),m;a[5]===p?m=a[6]:(m=()=>p(),a[5]=p,a[6]=m);let g=m,_;a[7]===f?_=a[8]:(_=i(o(f)),a[7]=f,a[8]=_);let y;a[9]!==l||a[10]!==c.error||a[11]!==c.isPending||a[12]!==f?(y=c.isPending?null:l?F(P(f)):c.error??`This connection cannot read host files.`,a[9]=l,a[10]=c.error,a[11]=c.isPending,a[12]=f,a[13]=y):y=a[13];let x=c.isPending||f.waiting,S;return a[14]!==g||a[15]!==_||a[16]!==y||a[17]!==x?(S={data:_,error:y,isPending:x,refresh:g},a[14]=g,a[15]=_,a[16]=y,a[17]=x,a[18]=S):S=a[18],S}function R(e,t,n,r,i){let a=(0,v.c)(16),o;a[0]===i?.imageOnly?o=a[1]:(o=i?.imageOnly?{imageOnly:!0}:{},a[0]=i?.imageOnly,a[1]=o);let s;a[2]!==t||a[3]!==e||a[4]!==n||a[5]!==o?(s={environmentId:e,cwd:t,query:n,kind:`file`,...o},a[2]=t,a[3]=e,a[4]=n,a[5]=o,a[6]=s):s=a[6];let c;a[7]===Symbol.for(`react.memo_cache_sentinel`)?(c={allowEmptyQuery:!0},a[7]=c):c=a[7];let l=_(s,r,c),u;a[8]!==l.entries||a[9]!==l.isPending?(u=l.isPending?[]:l.entries,a[8]=l.entries,a[9]=l.isPending,a[10]=u):u=a[10];let d;return a[11]!==l.error||a[12]!==l.isPending||a[13]!==l.searchedQuery||a[14]!==u?(d={entries:u,error:l.error,isPending:l.isPending,matchedQuery:l.searchedQuery},a[11]=l.error,a[12]=l.isPending,a[13]=l.searchedQuery,a[14]=u,a[15]=d):d=a[15],d}function z(e,t,r,a,c){let l=(0,v.c)(36),d=a===void 0||a,f=c!==void 0&&c,p=h(e),{canReadFiles:m}=p,g=d,_;l[0]!==m||l[1]!==f||l[2]!==t||l[3]!==d||l[4]!==e||l[5]!==r?(_=d&&m?f&&r!==null?D(e,t,r):E(e,t,r):x,l[0]=m,l[1]=f,l[2]=t,l[3]=d,l[4]=e,l[5]=r,l[6]=_):_=l[6];let b=_,C=s(b),w=n(b),T;l[7]===w?T=l[8]:(T=()=>w(),l[7]=w,l[8]=T);let O=T,k;l[9]===C?k=l[10]:(k=i(o(C)),l[9]=C,l[10]=k);let A=k,j=A?.relativePath??r??y,M;l[11]!==t||l[12]!==e||l[13]!==j?(M=S(e,t,j),l[11]=t,l[12]=e,l[13]=j,l[14]=M):M=l[14];let N=s(M),L=f?u:y,R;l[15]!==t||l[16]!==e||l[17]!==L?(R=S(e,t,L),l[15]=t,l[16]=e,l[17]=L,l[18]=R):R=l[18];let z=s(R),B=r===null?null:f?z??N:N,V,H,U;if(l[19]!==m||l[20]!==A||l[21]!==p.error||l[22]!==p.isPending||l[23]!==g||l[24]!==B?.data||l[25]!==C){let e=P(C);V=I(e)?e:null,U=m?B?.data??A:null,H=!g||p.isPending?null:m?F(e):p.error??`This connection cannot read host files.`,l[19]=m,l[20]=A,l[21]=p.error,l[22]=p.isPending,l[23]=g,l[24]=B?.data,l[25]=C,l[26]=V,l[27]=H,l[28]=U}else V=l[26],H=l[27],U=l[28];let W=g&&(p.isPending||C.waiting),G=V?.failure===`path_not_file`,K;return l[29]!==V||l[30]!==O||l[31]!==H||l[32]!==W||l[33]!==G||l[34]!==U?(K={data:U,error:H,isPending:W,readError:V,isNotFile:G,refresh:O},l[29]=V,l[30]=O,l[31]=H,l[32]=W,l[33]=G,l[34]=U,l[35]=K):K=l[35],K}export{E as a,N as c,R as d,z as f,A as i,O as l,k as n,j as o,D as r,S as s,M as t,L as u};
2
- //# sourceMappingURL=projectFilesQueryState-U08pztRu.js.map
@@ -1,2 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{Ef as n,Lg as r,ME as i,Qy as a,S_ as o,Vm as s,cE as c,g_ as l,if as u,in as d,jp as f,nl as p,sd as m,sr as h,zf as g}from"./utils-CRwA5SKO.js";import{R as ee,W as te}from"./runtime-DZfpb67Q.js";import{i as _,n as v}from"./session-Bc1P10r_.js";import{t as ne}from"./textarea-B8WPFAr0.js";import{t as y}from"./input-DhWmPSxf.js";import{a as re,c as ie,i as b,o as ae,r as oe,s as x,t as se}from"./dialog-x5a5g_fa.js";import{D as S,O as ce}from"./keybindings-B3kvDAJC.js";import{i as le,o as ue,t as de}from"./popover-Bc0WvoPP.js";import{f as C}from"./projectFilesQueryState-U08pztRu.js";import{t as w}from"./p4ProjectFile-CIYnqKbl.js";import{l as fe}from"./KeybindingsSettings.logic-_oQM9Dzv.js";import{Ar as pe,Fr as me,Ir as he,La as T,Mr as ge,Ni as E,Nr as _e,Pr as ve,jr as ye}from"./main-CxOeqlhD.js";function D(e,t){let n=e.projectSettingsOverrides[t.id]?.defaultProjectScripts;if(n!==void 0)return n;if(e.projectSettingsFolded)return e.defaultProjectScripts;let r=e.projectScriptOverrides[t.id];return r===null?e.defaultProjectScripts:r??(t.scripts.length>0?t.scripts:e.defaultProjectScripts)}function O(e){return e.worktreePath??e.project.cwd}function k(e){let t={P4CODE_PROJECT_ROOT:e.project.cwd};return e.worktreePath&&(t.P4CODE_WORKTREE_PATH=e.worktreePath),e.extraEnv?{...t,...e.extraEnv}:t}function A(e){let t=[...e.runOnWorktreeCreate?[`setup`]:[],...e.runOnSettle?[`on settle`]:[]];return t.length===0?e.name:`${e.name} (${t.join(`, `)})`}var j=e(t(),1),M=i(),N=`Invalid keybinding.`,P=a(r);function F(e){let t=e?.trim()??``;return t.length>0?t:null}function I(e){let t=F(e.keybinding);if(!t)return null;if(e.command===null)throw Error(N);let n=P({key:t,command:e.command});if(n._tag===`None`)throw Error(N);return n.value}function L(e,t){if(t===null)return null;for(let n=e.length-1;n>=0;--n){let r=e[n];if(!r||r.command!==t)continue;let i=[];r.shortcut.modKey&&i.push(`mod`),r.shortcut.ctrlKey&&i.push(`ctrl`),r.shortcut.metaKey&&i.push(`meta`),r.shortcut.altKey&&i.push(`alt`),r.shortcut.shiftKey&&i.push(`shift`);let a=r.shortcut.key===` `?`space`:r.shortcut.key===`escape`?`esc`:r.shortcut.key;return i.push(a),i.join(`+`)}return null}var R=[];function z(e,t){let n=(0,M.c)(8),r=C(e,t??``,p,t!==null,!0),i=r.data&&!r.data.truncated?r.data.contents:null,a=r.isPending,o;bb0:{if(i===null){let e=a?`loading`:`missing`,t;n[0]===e?t=n[1]:(t={status:e,file:null,scripts:R},n[0]=e,n[1]=t),o=t;break bb0}let e;n[2]===i?e=n[3]:(e=w(i),n[2]=i,n[3]=e);let t=e;if(t===null){let e;n[4]===Symbol.for(`react.memo_cache_sentinel`)?(e={status:`invalid`,file:null,scripts:R},n[4]=e):e=n[4],o=e;break bb0}let r=t.scripts??R,s;n[5]!==t||n[6]!==r?(s={status:`valid`,file:t,scripts:r},n[5]=t,n[6]=r,n[7]=s):s=n[7],o=s}return o}function B(e,t){return z(e,t).scripts}var V=e(c(),1),be=[{id:`play`,label:`Play`},{id:`test`,label:`Test`},{id:`lint`,label:`Lint`},{id:`configure`,label:`Configure`},{id:`build`,label:`Build`},{id:`debug`,label:`Debug`}];function H(e){let t=(0,M.c)(12),{icon:r,className:i}=e,a=i===void 0?`size-3.5`:i;if(r===`test`){let e;return t[0]===a?e=t[1]:(e=(0,V.jsx)(u,{className:a}),t[0]=a,t[1]=e),e}if(r===`lint`){let e;return t[2]===a?e=t[3]:(e=(0,V.jsx)(g,{className:a}),t[2]=a,t[3]=e),e}if(r===`configure`){let e;return t[4]===a?e=t[5]:(e=(0,V.jsx)(s,{className:a}),t[4]=a,t[5]=e),e}if(r===`build`){let e;return t[6]===a?e=t[7]:(e=(0,V.jsx)(n,{className:a}),t[6]=a,t[7]=e),e}if(r===`debug`){let e;return t[8]===a?e=t[9]:(e=(0,V.jsx)(m,{className:a}),t[8]=a,t[9]=e),e}let o;return t[10]===a?o=t[11]:(o=(0,V.jsx)(f,{className:a}),t[10]=a,t[11]=o),o}var U={name:``,command:``,icon:`play`,runOnWorktreeCreate:!1,waitForSetup:!1,runOnSettle:!1,keybinding:null,previewUrl:null,autoOpenPreview:!1};function W(e,t){return{scriptId:e.id,initial:{name:e.name,command:e.command,icon:e.icon,runOnWorktreeCreate:e.runOnWorktreeCreate,waitForSetup:e.runOnWorktreeCreate&&e.async===!1,runOnSettle:e.runOnSettle??!1,keybinding:L(t,S(e.id)),previewUrl:e.previewUrl??null,autoOpenPreview:e.autoOpenPreview??!1}}}function G({environmentId:e,editScope:t=l,request:n,scripts:r,onSubmit:i,onDelete:a,onClose:s}){let c=_(e,t),u=_(e,o),f=j.useId(),[p,m]=(0,j.useState)(``),[g,C]=(0,j.useState)(``),[w,D]=(0,j.useState)(`play`),[O,k]=d(!c),[A,M]=(0,j.useState)(!1),[N,P]=(0,j.useState)(!1),[F,L]=(0,j.useState)(!1),[R,z]=(0,j.useState)(``),[B,U]=(0,j.useState)(``),[W,G]=(0,j.useState)(!1),[K,q]=(0,j.useState)(null),[xe,J]=d(!c),[Se,Y]=(0,j.useState)(null),X=(0,j.useRef)(null),Ce=n!==null,Z=n?.scriptId!=null,Q=n!==null&&Se===n;(0,j.useLayoutEffect)(()=>()=>{X.current?.request===n&&(X.current=null)},[n]),(0,j.useEffect)(()=>{n&&(m(n.initial.name),C(n.initial.command),D(n.initial.icon),k(!1),M(n.initial.runOnWorktreeCreate),P(n.initial.waitForSetup),L(n.initial.runOnSettle),z(n.initial.keybinding??``),U(n.initial.previewUrl??``),G(n.initial.autoOpenPreview),q(n.error??null),Y(null))},[n,k]);let $=()=>{X.current=null,Y(null),k(!1),s()};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(se,{open:Ce,onOpenChange:e=>{e||$()},children:(0,V.jsxs)(x,{children:[(0,V.jsxs)(re,{children:[(0,V.jsx)(ie,{children:Z?`Edit Action`:`Add Action`}),(0,V.jsx)(oe,{children:`Actions are project-scoped commands you can run from the top bar or keybindings.`})]}),(0,V.jsx)(ae,{children:(0,V.jsx)(`form`,{id:f,onSubmit:async a=>{if(a.preventDefault(),!n||X.current!==null)return;if(!v(e,t)){q(`This connection cannot change project actions.`);return}let s=(R.trim()||null)!==(n.initial.keybinding?.trim()||null),c=v(e,o);if(s&&!c){q(`This connection cannot change keyboard shortcuts.`);return}let l=p.trim(),u=g.trim();if(l.length===0){q(`Name is required.`);return}if(u.length===0){q(`Command is required.`);return}q(null);let d;try{let e=n.scriptId??ce(l,r.map(e=>e.id)),t=I({keybinding:R,command:S(e)}),i=B.trim();d={name:l,command:u,icon:w,runOnWorktreeCreate:A,waitForSetup:A&&N,runOnSettle:F,...n.scriptId===null&&c||s?{keybinding:t?.key??null}:{},previewUrl:i.length>0?i:null,autoOpenPreview:i.length>0&&W}}catch(e){q(e instanceof Error?e.message:`Failed to save action.`);return}let f={request:n};X.current=f,Y(n),k(!1);try{let e=await i(n.scriptId,d);if(X.current===f){if(e._tag===`Failure`){if(!ee(e)){let t=te(e);q(t instanceof Error?t.message:`Failed to save action.`)}}else $()}}catch(e){X.current===f&&q(e instanceof Error?e.message:`Failed to save action.`)}X.current===f&&(X.current=null,Y(null))},children:(0,V.jsxs)(`fieldset`,{className:`space-y-4`,disabled:Q||!c,children:[(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsx)(E,{htmlFor:`script-name`,children:`Name`}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsxs)(de,{onOpenChange:k,open:O,children:[(0,V.jsx)(ue,{render:(0,V.jsx)(h,{type:`button`,variant:`outline`,className:`size-9 shrink-0`,"aria-label":`Choose icon`}),children:(0,V.jsx)(H,{icon:w,className:`size-4.5`})}),(0,V.jsx)(le,{align:`start`,children:(0,V.jsx)(`div`,{className:`grid grid-cols-3 gap-2`,children:be.map(e=>{let t=e.id===w;return(0,V.jsxs)(`button`,{type:`button`,className:`relative flex flex-col items-center gap-2 rounded-md border px-2 py-2 text-xs dark:border-transparent ${t?`border-primary/70 bg-primary/10 ring-inset dark:ring-1 dark:ring-primary/30`:`border-border/70 hover:bg-accent/60 dark:bg-white/[0.035]`}`,onClick:()=>{D(e.id),k(!1)},children:[(0,V.jsx)(H,{icon:e.id,className:`size-4`}),(0,V.jsx)(`span`,{children:e.label})]},e.id)})})})]}),(0,V.jsx)(y,{id:`script-name`,autoFocus:!0,placeholder:`Test`,value:p,onChange:e=>m(e.target.value)})]})]}),(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsx)(E,{htmlFor:`script-keybinding`,children:`Keybinding`}),(0,V.jsx)(y,{disabled:!u,id:`script-keybinding`,placeholder:`Press shortcut`,value:R,readOnly:!0,onKeyDown:n=>{if(!v(e,t)||!v(e,`settings:write`)||n.key===`Tab`)return;if(n.preventDefault(),n.key===`Backspace`||n.key===`Delete`){z(``);return}let r=fe(n,navigator.platform);r&&z(r)}}),(0,V.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Press a shortcut. Use `,(0,V.jsx)(`code`,{children:`Backspace`}),` to clear. Shortcuts are environment-wide. Projects using the same action share its shortcut.`]})]}),(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsx)(E,{htmlFor:`script-command`,children:`Command`}),(0,V.jsx)(ne,{id:`script-command`,placeholder:`bun test`,value:g,onChange:e=>C(e.target.value)})]}),(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsx)(E,{htmlFor:`script-preview-url`,children:`Preview URL (optional)`}),(0,V.jsx)(y,{id:`script-preview-url`,placeholder:`http://localhost:5173`,value:B,onChange:e=>U(e.target.value)}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Open this URL in the in-app preview when this action runs.`})]}),(0,V.jsxs)(`label`,{className:`flex items-center justify-between gap-3 rounded-md border border-border/70 px-3 py-2 text-sm dark:border-transparent dark:bg-white/[0.035]`,children:[(0,V.jsx)(`span`,{children:`Run automatically on worktree creation`}),(0,V.jsx)(T,{checked:A,onCheckedChange:e=>M(!!e)})]}),(0,V.jsxs)(`label`,{className:`flex items-center justify-between gap-3 rounded-md border border-border/70 px-3 py-2 text-sm dark:border-transparent dark:bg-white/[0.035] ${A?``:`opacity-60`}`,children:[(0,V.jsx)(`span`,{children:`Wait for it to finish before the agent starts`}),(0,V.jsx)(T,{checked:N,disabled:!A,onCheckedChange:e=>P(!!e)})]}),(0,V.jsxs)(`label`,{className:`flex items-center justify-between gap-3 rounded-md border border-border/70 px-3 py-2 text-sm dark:border-transparent dark:bg-white/[0.035]`,children:[(0,V.jsx)(`span`,{children:`Run in the thread's worktree when the thread settles`}),(0,V.jsx)(T,{checked:F,onCheckedChange:e=>L(!!e)})]}),(0,V.jsxs)(`label`,{className:`flex items-center justify-between gap-3 rounded-md border border-border/70 px-3 py-2 text-sm dark:border-transparent dark:bg-white/[0.035] ${B.trim().length===0?`opacity-60`:``}`,children:[(0,V.jsx)(`span`,{children:`Open preview automatically when this action runs`}),(0,V.jsx)(T,{checked:W,disabled:B.trim().length===0,onCheckedChange:e=>G(!!e)})]}),K&&(0,V.jsx)(`p`,{className:`text-sm text-destructive`,children:K})]})})}),(0,V.jsxs)(b,{variant:`bare`,children:[Z&&(0,V.jsx)(h,{type:`button`,variant:`destructive-outline`,className:`mr-auto`,disabled:Q||!c,onClick:()=>J(!0),children:`Delete`}),(0,V.jsx)(h,{type:`button`,variant:`outline`,onClick:$,children:`Cancel`}),(0,V.jsx)(h,{form:f,type:`submit`,disabled:Q||!c,children:Q?`Saving…`:Z?`Save changes`:`Save action`})]})]})}),(0,V.jsx)(pe,{open:xe&&c,onOpenChange:J,children:(0,V.jsxs)(me,{children:[(0,V.jsxs)(ve,{children:[(0,V.jsxs)(he,{children:[`Delete action "`,p,`"?`]}),(0,V.jsx)(ge,{children:`This action cannot be undone.`})]}),(0,V.jsxs)(_e,{children:[(0,V.jsx)(ye,{render:(0,V.jsx)(h,{variant:`outline`}),children:`Cancel`}),(0,V.jsx)(h,{variant:`destructive`,disabled:Q||!c,onClick:()=>{if(n?.scriptId){if(!v(e,t)){q(`This connection cannot change project actions.`);return}J(!1),$(),a(n.scriptId)}},children:`Delete action`})]})]})})]})}export{B as a,L as c,k as d,D as f,W as i,O as l,G as n,z as o,H as r,I as s,U as t,A as u};
2
- //# sourceMappingURL=projectScriptEditor-D8mxKLOb.js.map
@@ -1,2 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{$o as n,$y as r,Ax as i,BS as a,BT as o,Bx as s,By as c,Cv as l,Dx as u,Dy as d,FT as f,Fy as p,Go as m,HS as h,Jb as g,K_ as _,Kb as v,Lc as y,ME as b,MT as x,My as ee,N_ as te,Ov as ne,P_ as re,Qo as ie,Qy as ae,RS as S,RT as oe,Ss as C,Sx as se,Sy as ce,Uy as le,VS as ue,WS as de,W_ as fe,Xw as pe,Xx as w,Yo as me,Z_ as he,Zo as T,bx as ge,cv as _e,dl as ve,dw as ye,eC as be,fl as xe,fx as E,gC as Se,gv as Ce,hv as we,il as Te,iu as D,jy as O,kw as Ee,ly as k,mS as De,ms as Oe,nb as ke,nv as Ae,nx as A,pC as je,qw as Me,rs as Ne,rv as j,sS as Pe,ss as M,sv as Fe,tx as N,us as Ie,vw as Le,wT as Re,yT as ze,ys as Be,yy as Ve,zT as P,zy as F}from"./utils-CRwA5SKO.js";import{F as He,I as Ue,J as We,M as I,N as L,P as R,Z as Ge,_t as z,et as Ke,it as qe,ot as Je,pt as Ye,qt as Xe,st as Ze,tt as Qe}from"./runtime-DZfpb67Q.js";import{a as B,i as V,n as $e,r as et,s as tt,t as nt}from"./vcsRefInvalidation-3pHpDJC2.js";import{U as rt,W as it}from"./entities-DPIZFvN7.js";import{t as H}from"./runtime-Bc4kgQim.js";import{n as U}from"./query-CpOQgkic.js";var W=b(),at=ke(c([Ve(k),Te.fields.query])),ot=ae(at);function st(e,t){return JSON.stringify([[...e].sort((e,t)=>e.localeCompare(t)),t])}function ct(e){return ot(e)}function lt(e){return JSON.stringify([e.environmentId,e.threadId])}function ut(e){return T(t=>n(n=>{let r=ct(t);if(f(r))return{matches:[],isLoading:!1};let[i,a]=r.value,o=[],s=!1;for(let t of i){let r=n(e.getSearchAtom(t,a));s||=r.waiting;let i=x(C(r));i!==null&&o.push(...i.matches.map(e=>({...e,environmentId:t})))}return{matches:o,isLoading:s}}).pipe(M(`${e.labelPrefix}:${t}`)))}var G=e(t(),1);function dt(e){return{v2:{dispatchCommand:I(e,{label:`environment-data:orchestration-v2:dispatch-command`,tag:D.dispatchCommand}),threadProjection:L(e,{label:`environment-data:orchestration-v2:thread-projection`,tag:D.getThreadProjection,staleTimeMs:0,idleTtlMs:0}),shell:R(e,{label:`environment-data:orchestration-v2:shell`,tag:D.subscribeShell}),thread:R(e,{label:`environment-data:orchestration-v2:thread`,tag:D.subscribeThread,idleTtlMs:0})},turnDiff:L(e,{label:`environment-data:orchestration:turn-diff`,tag:D.getTurnDiff}),workflowScript:L(e,{label:`environment-data:orchestration:workflow-script`,tag:D.getWorkflowScript,staleTimeMs:3e5,idleTtlMs:3e5}),stopWorkflow:I(e,{label:`environment-data:orchestration:stop-workflow`,tag:D.stopWorkflow}),rankUserInput:I(e,{label:`environment-data:orchestration:rank-user-input`,tag:y.userInputRank,concurrency:{mode:`singleFlight`,key:({environmentId:e,input:t})=>JSON.stringify([e,t])}}),turnItem:L(e,{label:`environment-data:orchestration:turn-item`,tag:D.getTurnItem,staleTimeMs:6e4,idleTtlMs:6e4}),fullThreadDiff:L(e,{label:`environment-data:orchestration:full-thread-diff`,tag:D.getFullThreadDiff}),threadFind:L(e,{label:`environment-data:orchestration:thread-find`,tag:D.searchThread,staleTimeMs:0,idleTtlMs:0}),threadFindProgressive:R(e,{label:`environment-data:orchestration:thread-find-progressive`,tag:D.searchThreadStream,completeWhen:e=>e.complete!==!1,idleTtlMs:0}),threadSearch:L(e,{label:`environment-data:orchestration:thread-search`,tag:D.searchThreads,staleTimeMs:3e4,idleTtlMs:6e4}),archivedShellSnapshot:L(e,{label:`environment-data:orchestration:archived-shell-snapshot`,tag:D.getArchivedShellSnapshot})}}var K=dt(H),ft=96;function pt(e){let t=e.at(-1);return e.length>1&&t?.waiting===!0&&f(C(t))}function mt({previousScrollTop:e,scrollTop:t,scrollHeight:n,clientHeight:r,distanceThreshold:i=ft}){return e===null||t<=e?!1:n-t-r<=i}var ht=`[0-9a-f]{8}`,gt=RegExp(`^(?:p4c[-/]${ht}|t3code(?:[-/]${ht}|\\/[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}))$`);function _t(e){let t=e.indexOf(`/`);return t<=0||t===e.length-1?e:e.slice(t+1)}function vt(e){return gt.test(e.trim().toLowerCase())}function yt(e){return e.trim().replace(/[ \t\n\r\f\v]+/g,`-`)}var bt={hasUpstream:!1,aheadCount:0,behindCount:0,aheadOfDefaultCount:0,pr:null};function q(e,t){return{...e,...t??bt}}function xt(e){return{hasUpstream:e.hasUpstream,aheadCount:e.aheadCount,behindCount:e.behindCount,...e.aheadOfDefaultCount===void 0?{}:{aheadOfDefaultCount:e.aheadOfDefaultCount},pr:e.pr}}function St(e){return{isRepo:e.isRepo,...e.sourceControlProvider?{sourceControlProvider:e.sourceControlProvider}:{},hasPrimaryRemote:e.hasPrimaryRemote,isDefaultRef:e.isDefaultRef,refName:e.refName,hasWorkingTreeChanges:e.hasWorkingTreeChanges,workingTree:e.workingTree,...e.branchChanges?{branchChanges:e.branchChanges}:{}}}function Ct(e,t){switch(t._tag){case`snapshot`:return q(t.local,t.remote);case`localUpdated`:return q(t.local,e?xt(e):null);case`remoteUpdated`:return q(e===null?{isRepo:!0,hasPrimaryRemote:!1,isDefaultRef:!1,refName:null,hasWorkingTreeChanges:!1,workingTree:{files:[],insertions:0,deletions:0}}:St(e),t.remote)}}var wt=d([`refresh_status`,`run_change_request`,`pull`,`switch_ref`,`create_ref`,`create_worktree`,`init`,`publish_repository`,`prepare_pull_request_thread`]),J=class extends F()(`VcsActionUnavailableError`,{operation:wt,environmentId:O(k),cwd:O(p)}){get message(){return`Source control operation '${this.operation.replaceAll(`_`,` `)}' is unavailable.`}},Tt=class extends F()(`VcsActionRemoteFailureError`,{actionId:p,transportActionId:p,action:xe,environmentId:k,cwd:p,phase:O(ve),remoteMessageLength:ee}){get message(){let e=this.phase===null?`execution`:this.phase;return`Source control action '${this.action}' failed during ${e}.`}},Et=class extends F()(`VcsActionMissingTerminalEventError`,{actionId:p,transportActionId:p,action:xe,environmentId:k,cwd:p}){get message(){return`Source control action '${this.action}' ended without a terminal result.`}},Dt=class extends F()(`VcsActionTargetKeyParseError`,{keyLength:ee,cause:ce()}){get message(){return`Invalid source control action target key (${this.keyLength} characters).`}};le([Tt,Et]);var Y=Object.freeze({isRunning:!1,operation:null,actionId:null,action:null,currentLabel:null,currentPhaseLabel:null,hookName:null,lastOutputLine:null,phaseStartedAtMs:null,hookStartedAtMs:null,error:null}),Ot=()=>g(v()),kt=0,At=r(c([k,p])),X=T(e=>n(Y).pipe(ie,M(`vcs-action:${e}`))),jt=n(Y).pipe(ie,M(`vcs-action:null`));function Z(e){return e.environmentId===null||e.cwd===null?null:JSON.stringify([e.environmentId,e.cwd])}function Mt(e){try{let[t,n]=At(JSON.parse(e));return{environmentId:t,cwd:n}}catch(t){throw new Dt({keyLength:e.length,cause:t})}}function Nt(e){let t=Z(e);return t===null?jt:X(t)}function Pt(){return kt+=1,`local-vcs-action:${kt}`}function Ft(e){let t=e.actionId??Pt(),n=Ot();return{...Y,isRunning:!0,operation:e.operation,actionId:t,currentLabel:e.label,currentPhaseLabel:e.label,phaseStartedAtMs:n}}function It(e,t,n){return{...Y,operation:e,actionId:t,error:n instanceof Error?n.message:`Source control action failed.`}}function Lt(e,t){let n=JSON.stringify([e.environmentId,e.cwd]);return`${n.length}:${n}${t}`}function Rt(e,t,n,r){return r.actionId!==t||r.cwd!==e.cwd?null:{...r,actionId:n}}function zt(e,t){return a(()=>{let n=null;return e.pipe(Ce(e=>{let r=Rt(t.target,t.transportActionId,t.actionId,e);return r===null?be:((r.kind===`action_finished`||r.kind===`action_failed`)&&(n=r),t.onProgress(r))}),u(()=>n?.kind===`action_finished`?S(n.result):n?.kind===`action_failed`?se(new Tt({actionId:t.actionId,transportActionId:t.transportActionId,action:n.action,environmentId:t.target.environmentId,cwd:t.target.cwd,phase:n.phase,remoteMessageLength:n.message.length})):se(new Et({actionId:t.actionId,transportActionId:t.transportActionId,action:t.action,environmentId:t.target.environmentId,cwd:t.target.cwd}))))})}function Bt(e,t){if(e.actionId!==t.actionId)return e;let n=Ot();switch(t.kind){case`action_started`:return{...e,isRunning:!0,actionId:t.actionId,action:t.action,operation:`run_change_request`,phaseStartedAtMs:n,hookStartedAtMs:null,hookName:null,lastOutputLine:null,error:null};case`phase_started`:return{...e,isRunning:!0,actionId:t.actionId,action:t.action,operation:`run_change_request`,currentLabel:t.label,currentPhaseLabel:t.label,phaseStartedAtMs:n,hookStartedAtMs:null,hookName:null,lastOutputLine:null,error:null};case`hook_started`:return{...e,isRunning:!0,actionId:t.actionId,action:t.action,operation:`run_change_request`,currentLabel:`Running ${t.hookName}...`,hookName:t.hookName,hookStartedAtMs:n,lastOutputLine:null,error:null};case`hook_output`:return{...e,isRunning:!0,actionId:t.actionId,action:t.action,operation:`run_change_request`,lastOutputLine:t.text,error:null};case`hook_finished`:return{...e,isRunning:!0,actionId:t.actionId,action:t.action,operation:`run_change_request`,currentLabel:e.currentPhaseLabel,hookName:null,hookStartedAtMs:null,lastOutputLine:null,error:null};case`action_finished`:return{...e,isRunning:!0,actionId:t.actionId,action:t.action,operation:`run_change_request`,error:null};case`action_failed`:return{...e,isRunning:!0,actionId:t.actionId,action:t.action,operation:`run_change_request`,error:t.message}}}function Vt(e){let t=new Map,n=n=>{let r=Z(n),i=r??JSON.stringify([`vcs-action-target:unavailable`,n.environmentId,n.cwd]),a=t.get(i);if(a!==void 0)return a;let o=r===null?null:Mt(r),s=r===null?jt:X(r),c=Ue(e,{label:`vcs-action:run-stacked:${i}`,scheduler:B,concurrency:{mode:`serial`,key:()=>i},execute:(t,r)=>{if(o===null)return se(new J({operation:`run_change_request`,environmentId:n.environmentId,cwd:n.cwd}));let i=Lt(o,t.actionId);r.set(s,Ft({operation:`run_change_request`,label:`Running source control action`,actionId:t.actionId}));let a={actionId:i,cwd:o.cwd,action:t.action,...t.commitMessage?{commitMessage:t.commitMessage}:{},...t.featureBranch?{featureBranch:!0}:{},...t.filePaths?.length?{filePaths:[...t.filePaths]}:{},...t.threadId===void 0?{}:{threadId:t.threadId},...t.projectId===void 0?{}:{projectId:t.projectId}},c=ue(()=>{r.get(s).actionId===t.actionId&&r.set(s,Y)});return zt(Ze(o.environmentId,Ke(y.gitRunStackedAction,a)),{target:o,transportActionId:i,actionId:t.actionId,action:t.action,onProgress:e=>ue(()=>{let n=r.get(s);if(n.actionId===t.actionId&&(r.set(s,Bt(n,e)),t.onProgress!==void 0))try{t.onProgress(e)}catch{}})}).pipe(De(We,{authorize:(t,n,i)=>qe(e,n).authorize(r,t,i)}),ge(nt(r,o)),h(()=>c),de(e=>ue(()=>{let n=r.get(s);n.actionId===t.actionId&&n.isRunning&&r.set(s,It(`run_change_request`,t.actionId,e))})),Pe(()=>c))}});return t.set(i,c),c},r=(e,t,n)=>{let r=Z(t);if(r===null)return;let i=X(r);e.set(i,n(e.get(i)))};return{stateAtom:Nt,runStackedAction:e=>n(e),track:async(e,t,n,r)=>{let i=Z(t);if(i===null)return Oe(ye(new J({operation:n.operation,environmentId:t.environmentId,cwd:t.cwd})));let a=X(i),o=Ft(n);e.set(a,o);let s=await r();return e.get(a).actionId===o.actionId&&(Be(s)||Le(s.cause)?e.set(a,Y):e.get(a).actionId===o.actionId&&e.set(a,It(n.operation,o.actionId,Ee(s.cause)))),s},resetError:(e,t,n)=>{r(e,t,e=>!e.isRunning&&e.operation===n?Y:e)}}}var Ht=100,Ut=3e4,Wt=1e4,Gt=je(`1 second`).pipe(Se(({duration:e})=>S(Me(e,pe(30)))));function Kt(e){return e.query===void 0&&e.cursor===void 0&&e.includeMatchingRemoteRefs===void 0&&e.refKind===void 0&&e.limit===Ht}var qt=i(`CachedVcsRefsState.commitRefresh`)(function*(e,t,n){return yield*et(n.environmentId,s(function*(){let r=$e({environmentId:n.environmentId}),i=e.get(r);if(i.revision!==n.expectedRevision)return!1;let a=i.persistedCacheReadable;return n.persist&&(a||=yield*t.clearVcsRefs(n.environmentId).pipe(A(!0),E(e=>w(`Could not recover invalidated cached Git refs.`).pipe(N({environmentId:n.environmentId,cwd:n.cwd,...z(e)}),A(!1)))),yield*t.saveVcsRefs(n.environmentId,n.cwd,n.refs).pipe(E(e=>w(`Could not persist cached Git refs.`).pipe(N({environmentId:n.environmentId,cwd:n.cwd,...z(e)})))),a!==i.persistedCacheReadable&&e.update(r,e=>e.revision===n.expectedRevision?{...e,persistedCacheReadable:a}:e)),!0}))}),Jt=i(`CachedVcsRefsState.makeChanges`)(function*(e,t,n,r=!0){let a=yield*Ye,s=yield*Xe,c=a.target.environmentId,u=Kt(e),d=u&&r?yield*s.loadVcsRefs(c,e.cwd).pipe(E(t=>w(`Could not load cached Git refs.`).pipe(N({environmentId:c,cwd:e.cwd,...z(t)}),A(P())))):P(),f=i(`CachedVcsRefsState.refresh`)(function*(){let r=yield*Ge(y.vcsListRefs,e).pipe(De(Ye,a)),i=s.saveVcsRefs(c,e.cwd,r).pipe(E(t=>w(`Could not persist cached Git refs.`).pipe(N({environmentId:c,cwd:e.cwd,...z(t)}))));return t===void 0||n===void 0?(u&&(yield*i),o(r)):(yield*qt(n,s,{environmentId:c,cwd:e.cwd,refs:r,expectedRevision:t,persist:u}))?o(r):P()}),p=j(S(d)).pipe(Ae(e=>oe(e,{onNone:()=>ze,onSome:Re}))),m=_(j(re(a.state)),te(a.state)).pipe(Fe(e=>e.phase===`connected`?e.generation:null),fe,l(t=>t===null?he:j(f().pipe(de(t=>w(`Could not refresh Git refs.`).pipe(N({environmentId:c,cwd:e.cwd,...z(t)}))))).pipe(we(Gt),Ae(e=>oe(e,{onNone:()=>ze,onSome:Re})))));return _(p,m)});function Yt(e,t,n,r){return Je(e,ne(s(function*(){return yield*Jt(t,n,yield*Ie,r)})))}function Xt(e){let t=T(t=>{let[n,r]=JSON.parse(t);return e.atom(e=>{let t=e($e({environmentId:n}));return Yt(n,r,t.revision,t.persistedCacheReadable)}).pipe(Ne(Ut),M(`environment-data:vcs:list-refs:${t}`))}),n=e=>t(JSON.stringify([e.environmentId,e.input])),r=(e,t)=>nt(t,{environmentId:e.environmentId,cwd:e.input.cwd});return{listRefs:n,status:He(e,{label:`environment-data:vcs:status`,idleTtlMs:Wt,subscribe:e=>Qe(y.subscribeVcsStatus,e).pipe(_e(()=>null,(e,t)=>{let n=Ct(e,t);return[n,[n]]}))}),pull:I(e,{label:`environment-data:vcs:pull`,tag:y.vcsPull,scheduler:B,concurrency:V,onSettled:r}),refreshStatus:I(e,{label:`environment-data:vcs:refresh-status`,tag:y.vcsRefreshStatus,scheduler:B,concurrency:V,onSettled:r}),createWorktree:I(e,{label:`environment-data:vcs:create-worktree`,tag:y.vcsCreateWorktree,scheduler:B,concurrency:V,onSettled:r}),worktreeSetup:R(e,{label:`environment-data:vcs:worktree-setup`,tag:y.subscribeWorktreeSetup,idleTtlMs:Wt}),cancelWorktreeSetup:I(e,{label:`environment-data:vcs:cancel-worktree-setup`,tag:y.worktreeSetupCancel}),removeWorktree:I(e,{label:`environment-data:vcs:remove-worktree`,tag:y.vcsRemoveWorktree,scheduler:B,concurrency:V,onSettled:r}),createRef:I(e,{label:`environment-data:vcs:create-ref`,tag:y.vcsCreateRef,scheduler:B,concurrency:V,onSettled:r}),switchRef:I(e,{label:`environment-data:vcs:switch-ref`,tag:y.vcsSwitchRef,scheduler:B,concurrency:V,onSettled:r}),init:I(e,{label:`environment-data:vcs:init`,tag:y.vcsInit,scheduler:B,concurrency:V,onSettled:r})}}var Zt=Xt(H),Qt=Vt(H),$t=120,en=80,tn=120,nn=500,rn=200,an=100,on=[],sn=[],cn=[],Q=[void 0],ln=Object.freeze([]),un=n({matches:ln,isLoading:!1}).pipe(M(`web:thread-search:empty`)),dn=ut({getSearchAtom:(e,t)=>K.threadSearch({environmentId:e,input:{query:t}}),labelPrefix:`web:thread-search`});function $(e,t){let n=(0,W.c)(4),[r,i]=(0,G.useState)(e),a,o;return n[0]!==t||n[1]!==e?(a=()=>{let n=window.setTimeout(()=>{i(e)},t);return()=>{window.clearTimeout(n)}},o=[t,e],n[0]=t,n[1]=e,n[2]=a,n[3]=o):(a=n[2],o=n[3]),(0,G.useEffect)(a,o),r}function fn(e,t){let n=(0,W.c)(11),r;n[0]===t?r=n[1]:(r=t.trim(),n[0]=t,n[1]=r);let i=r,a=$(i,rn),o=e.length>0&&i.length>=2,s=o&&i===a?a:null,c;n[2]!==e||n[3]!==s?(c=s===null?null:st(e,s),n[2]=e,n[3]=s,n[4]=c):c=n[4];let l=c,u;n[5]===l?u=n[6]:(u=l===null?un:dn(l),n[5]=l,n[6]=u);let d=me(u),f=o&&i!==a,p=f?ln:d.matches,m=s??``,h=o&&(f||d.isLoading),g;return n[7]!==p||n[8]!==m||n[9]!==h?(g={matches:p,query:m,isPending:h},n[7]=p,n[8]=m,n[9]=h,n[10]=g):g=n[10],g}function pn(e){let t=e.query?.trim()??``,r=e.environmentId!==null&&e.cwd!==null?JSON.stringify([e.environmentId,e.cwd,t]):null,[i,a]=(0,G.useState)({targetKey:r,cursors:Q}),o=i.targetKey===r?i.cursors:Q,s=(0,G.useMemo)(()=>e.environmentId!==null&&e.cwd!==null?o.map(n=>Zt.listRefs({environmentId:e.environmentId,input:{cwd:e.cwd,...t.length>0?{query:t}:{},...n===void 0?{}:{cursor:n},limit:an}})):[],[o,t,e.cwd,e.environmentId]),c=(0,G.useMemo)(()=>n(e=>s.map(t=>e(t))).pipe(M(`web:vcs-ref-pages:${r??`empty`}`)),[s,r]),l=me(c),u=l.flatMap(e=>{let t=x(C(e));return t===null?[]:[t]}),d=new Map;for(let e of u)for(let t of e.refs)d.set(t.name,t);let f=u[0]??null,p=u.at(-1)??null,h=f===null||p===null?null:{refs:[...d.values()],isRepo:f.isRepo,hasPrimaryRemote:f.hasPrimaryRemote,nextCursor:p.nextCursor,totalCount:Math.max(...u.map(e=>e.totalCount))},g=l.find(e=>e._tag===`Failure`),_=pt(l),v=g?._tag===`Failure`?(()=>{let e=Ee(g.cause);return e instanceof Error&&e.message.trim().length>0?e.message:`Failed to load refs.`})():null,y=(0,G.useCallback)(()=>{let e=s[0];a({targetKey:r,cursors:Q}),e!==void 0&&m.refresh(e)},[s,r]),b=(0,G.useCallback)(()=>{r!==null&&h?.nextCursor!==null&&h?.nextCursor!==void 0&&a(e=>{let t=e.targetKey===r?e.cursors:Q;return t.includes(h.nextCursor)?{targetKey:r,cursors:t}:{targetKey:r,cursors:[...t,h.nextCursor]}})},[h?.nextCursor,r]);return{data:h,refs:h?.refs??on,error:v,isPending:l.some(e=>e.waiting),isFetchingNextPage:_,refresh:y,loadNext:b}}function mn(e,t){return e.environmentId===t.environmentId&&e.cwd===t.cwd&&e.query===t.query&&e.kind===t.kind&&e.imageOnly===t.imageOnly}function hn(e,t,n){let r=(0,W.c)(32),i=n?.allowEmptyQuery===!0,a;r[0]===e.query?a=r[1]:(a=e.query==null?null:e.query.trim(),r[0]=e.query,r[1]=a);let o;r[2]!==a||r[3]!==e.cwd||r[4]!==e.environmentId||r[5]!==e.imageOnly||r[6]!==e.kind?(o={environmentId:e.environmentId,cwd:e.cwd,query:a,kind:e.kind,imageOnly:e.imageOnly},r[2]=a,r[3]=e.cwd,r[4]=e.environmentId,r[5]=e.imageOnly,r[6]=e.kind,r[7]=o):o=r[7];let s=o,c=$(s,$t),l=tt(c.environmentId),{canReadFiles:u}=l,d,f,p;r[8]!==i||r[9]!==u||r[10]!==c.cwd||r[11]!==c.environmentId||r[12]!==c.imageOnly||r[13]!==c.kind||r[14]!==c.query||r[15]!==t?(d=c.environmentId!==null&&c.cwd!==null&&c.query!==null&&(i||c.query.length>0)?{environmentId:c.environmentId,input:{cwd:c.cwd,query:c.query,limit:t,...c.kind?{kind:c.kind}:{},...c.imageOnly?{imageOnly:!0}:{}}}:null,f=U,p=u&&d!==null?it.searchEntries(d):null,r[8]=i,r[9]=u,r[10]=c.cwd,r[11]=c.environmentId,r[12]=c.imageOnly,r[13]=c.kind,r[14]=c.query,r[15]=t,r[16]=d,r[17]=f,r[18]=p):(d=r[16],f=r[17],p=r[18]);let m=f(p),h=d!==null,g=m.data?.entries??sn,_=!h||l.isPending?null:u?m.error:l.error??`This connection cannot search host files.`,v;r[19]!==c||r[20]!==l.isPending||r[21]!==h||r[22]!==s||r[23]!==m.isPending?(v=!mn(s,c)||h&&(l.isPending||m.isPending),r[19]=c,r[20]=l.isPending,r[21]=h,r[22]=s,r[23]=m.isPending,r[24]=v):v=r[24];let y=c.query??``,b=m.data?.truncated??!1,x;return r[25]!==m.refresh||r[26]!==g||r[27]!==_||r[28]!==v||r[29]!==y||r[30]!==b?(x={entries:g,error:_,isPending:v,searchedQuery:y,truncated:b,refresh:m.refresh},r[25]=m.refresh,r[26]=g,r[27]=_,r[28]=v,r[29]=y,r[30]=b,r[31]=x):x=r[31],x}function gn(e){return hn(e,en)}function _n(e){let t=(0,W.c)(20),n=e.environmentId!==null&&e.cwd!==null,r=tt(e.environmentId),i=n&&r.canReadFiles,a=n&&r.isPending,o=e.query,s;t[0]===o?s=t[1]:(s=o.trim(),t[0]=o,t[1]=s);let c=s.length>0,l=$(o,tn),u;t[2]!==i||t[3]!==l||t[4]!==c||t[5]!==e.caseSensitive||t[6]!==e.cwd||t[7]!==e.environmentId||t[8]!==e.useRegex||t[9]!==e.wholeWord?(u=i&&e.environmentId!==null&&e.cwd!==null&&c&&l.trim().length>0?rt({environmentId:e.environmentId,input:{cwd:e.cwd,query:l,limit:nn,caseSensitive:e.caseSensitive,wholeWord:e.wholeWord,useRegex:e.useRegex}}):null,t[2]=i,t[3]=l,t[4]=c,t[5]=e.caseSensitive,t[6]=e.cwd,t[7]=e.environmentId,t[8]=e.useRegex,t[9]=e.wholeWord,t[10]=u):u=t[10];let d=U(u),f=d.data?.matches??cn,p=!n||a?null:i?d.error:r.error??`This connection cannot search host files.`,m=a||i&&c&&(o!==l||d.isPending),h=d.data?.truncated??!1,g=e.useRegex&&d.data?.regexFallbackError!==void 0,_;return t[11]!==i||t[12]!==c||t[13]!==a||t[14]!==f||t[15]!==p||t[16]!==m||t[17]!==h||t[18]!==g?(_={canReadFiles:i,isCheckingAccess:a,matches:f,error:p,isPending:m,hasQuery:c,truncated:h,invalidRegex:g},t[11]=i,t[12]=c,t[13]=a,t[14]=f,t[15]=p,t[16]=m,t[17]=h,t[18]=g,t[19]=_):_=t[19],_}function vn(e,t){let n=t?.enabled!==!1&&e.environmentId!==null&&e.threadId!==null&&e.fromTurnCount!==null&&e.toTurnCount!==null,r=n&&e.fromTurnCount===0?{environmentId:e.environmentId,input:{threadId:e.threadId,toTurnCount:e.toTurnCount,ignoreWhitespace:e.ignoreWhitespace}}:null,i=n&&e.fromTurnCount!==0?{environmentId:e.environmentId,input:{threadId:e.threadId,fromTurnCount:e.fromTurnCount,toTurnCount:e.toTurnCount,ignoreWhitespace:e.ignoreWhitespace}}:null,a=U(r===null?null:K.fullThreadDiff(r)),o=U(i===null?null:K.turnDiff(i));return r===null?o:a}function yn(e){let t=(0,W.c)(2),n;return t[0]===e?n=t[1]:(n=e===null?null:K.turnItem({environmentId:e.environmentId,input:{threadId:e.threadId,itemId:e.itemId,revision:e.revision}}),t[0]=e,t[1]=n),U(n)}export{lt as _,_n as a,yn as c,J as d,_t as f,K as g,mt as h,pn as i,Qt as l,yt as m,gn as n,hn as o,vt as p,$ as r,fn as s,vn as t,Zt as u};
2
- //# sourceMappingURL=queries-BVPZtaQA.js.map
@@ -1,2 +0,0 @@
1
- import{$o as e,Jo as t,ME as n,MT as r,Ss as i,Yo as a,kw as o,mw as s,ss as c,vs as l}from"./utils-CRwA5SKO.js";var u=n(),d=e(l(!1)).pipe(c(`web-environment-query:empty`));function f(e){let t=o(e);return t instanceof Error&&t.message.trim().length>0?t.message:`The environment request failed.`}function p(e){let n=(0,u.c)(20),o=e??d,c=a(o),l=t(o),p;n[0]===c?p=n[1]:(p=r(i(c)),n[0]=c,n[1]=p);let m;n[2]!==c._tag||n[3]!==c.previousSuccess||n[4]!==c.timestamp?(m=c._tag===`Success`?c.timestamp:c._tag===`Failure`?r(c.previousSuccess)?.timestamp??0:0,n[2]=c._tag,n[3]=c.previousSuccess,n[4]=c.timestamp,n[5]=m):m=n[5];let h;n[6]!==c._tag||n[7]!==c.cause?(h=c._tag===`Failure`?f(c.cause):null,n[6]=c._tag,n[7]=c.cause,n[8]=h):h=n[8];let g;n[9]!==c._tag||n[10]!==c.cause?(g=c._tag===`Failure`?r(s(c.cause)):null,n[9]=c._tag,n[10]=c.cause,n[11]=g):g=n[11];let _=e!==null&&c.waiting,v=c._tag===`Success`,y;return n[12]!==l||n[13]!==p||n[14]!==m||n[15]!==h||n[16]!==g||n[17]!==_||n[18]!==v?(y={data:p,dataUpdatedAt:m,error:h,failure:g,isPending:_,isSuccess:v,refresh:l},n[12]=l,n[13]=p,n[14]=m,n[15]=h,n[16]=g,n[17]=_,n[18]=v,n[19]=y):y=n[19],y}export{p as n,f as t};
2
- //# sourceMappingURL=query-CpOQgkic.js.map
@@ -1,2 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{$i as n,Ca as r,Co as i,Dn as a,Eo as o,Fa as s,Gr as c,Ia as l,Ln as u,ME as d,Na as f,Nn as p,Pn as m,Ra as h,So as g,Ta as ee,Va as te,_o as _,br as ne,cE as v,ca as re,ea as y,ga as b,io as ie,mr as ae,t as x,vo as S,wo as C,ya as w,zn as T}from"./utils-CRwA5SKO.js";import{n as oe,t as E}from"./CompositeRoot-B9Xvst63.js";import{t as se}from"./useRegisterFieldControl-Bmw-33lq.js";import{t as ce}from"./FormContext-DTtr4Y3v.js";import{t as le}from"./useAriaLabelledBy-DZIzyiAY.js";import{t as ue}from"./FieldItemContext-Bn6xBVJg.js";var D=e(v()),O=e(t()),k=O.createContext({legendId:void 0,setLegendId:()=>{},disabled:void 0});function de(e=!1){let t=O.useContext(k);if(!t&&!e)throw Error(o(86));return t}var A=function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.disabled=`data-disabled`,e.readonly=`data-readonly`,e.required=`data-required`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),j={checked(e){return e?{[A.checked]:``}:{[A.unchecked]:``}},..._,...T},M=O.createContext(void 0);function N(){return O.useContext(M)}var P=O.createContext(void 0);function F(){let e=O.useContext(P);if(e===void 0)throw Error(o(52));return e}var I=O.forwardRef(function(e,t){let{render:o,className:c,disabled:d=!1,readOnly:te=!1,required:_=!1,"aria-labelledby":ne,value:v,inputRef:re,nativeButton:b=!1,id:x,style:w,...T}=e,E=N(),{disabled:se,readOnly:ce,required:k,form:de,checkedValue:A,touched:M=!1,validation:F,name:I}=E??{},L=E?.setCheckedValue??i,fe=E?.setTouched??i,R=E?.registerControlRef??i,z=E?.registerInputRef??i,{setDirty:B,validityData:V,setTouched:H,setFilled:U,state:W,disabled:G}=u(),K=ue(),{labelId:pe,getDescriptionProps:me}=m(),q=G||K.disabled||se||d,J=ce||te,Y=k||_,he=de,X=E?A===v:v===``,Z=O.useRef(null),Q=O.useRef(null),ge=l(e=>{e&&R(e,q)}),_e=C(re,Q,z);s(()=>{Q.current?.checked&&U(!0)},[U]),s(()=>{if(Q.current){if(q&&X){z(null);return}Z.current&&R(Z.current,q),z(Q.current)}},[X,q,R,z]);let ve=ee(),ye=p({id:x,implicit:!1,controlRef:Z}),be=b?void 0:ye,xe=le(ne,pe,Q,!b,be),Se={role:`radio`,"aria-checked":X,"aria-required":Y||void 0,"aria-readonly":J||void 0,"aria-labelledby":xe,[oe]:X?``:void 0,id:b?ye:ve,onKeyDown(e){e.key===`Enter`&&e.preventDefault()},onClick(e){if(e.defaultPrevented||q||J)return;e.preventDefault();let t=Q.current;t&&t.dispatchEvent(new(h(t)).PointerEvent(`click`,{bubbles:!0,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey}))},onFocus(e){e.defaultPrevented||q||J||!M||(Q.current?.click(),fe(!1))}},{getButtonProps:Ce,buttonRef:we}=f({disabled:q,native:b}),Te={type:`radio`,ref:_e,form:he,id:be,name:I,tabIndex:-1,style:I?y:n,"aria-hidden":!0,...v===void 0?g:{value:a(v)},disabled:q,checked:X,required:Y,readOnly:J,onChange(e){if(e.nativeEvent.defaultPrevented||q||J||v===void 0)return;let t=r(ie,e.nativeEvent);t.isCanceled||(H(!0),B(v!==V.initialValue),U(!0),L(v,t))},onFocus(){Z.current?.focus()}},$=O.useMemo(()=>({...W,required:Y,disabled:q,readOnly:J,checked:X}),[W,q,J,X,Y]),Ee=$,De=E!==void 0,Oe=[t,Z,we,ge],ke=[Se,me,F?.getValidationProps??g,T,Ce],Ae=S(`span`,e,{enabled:!De,state:$,ref:Oe,props:ke,stateAttributesMapping:j});return(0,D.jsxs)(P.Provider,{value:Ee,children:[De?(0,D.jsx)(ae,{tag:`span`,render:o,className:c,style:w,state:$,refs:Oe,props:ke,stateAttributesMapping:j}):Ae,(0,D.jsx)(`input`,{...Te,suppressHydrationWarning:!0})]})}),L=O.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a=!1,...o}=e,s=F(),c=s.checked,{mounted:l,transitionStatus:u,setMounted:d}=w(c),f={...s,transitionStatus:u},p=O.useRef(null),m=a||l,h=S(`span`,e,{ref:[t,p],state:f,props:o,stateAttributesMapping:j});return b({open:c,ref:p,onComplete(){c||d(!1)}}),m?h:null}),fe=[c],R=O.forwardRef(function(e,t){let{render:n,className:r,disabled:i,readOnly:a,required:o,onValueChange:s,value:c,defaultValue:d,form:f,name:p,inputRef:h,id:g,style:_,...v}=e,{setTouched:y,setFocused:b,shouldValidateOnChange:ie,validationMode:ae,name:x,disabled:S,state:C,validation:w,setDirty:oe,setFilled:le,validityData:ue}=u(),{labelId:k}=m(),{clearErrors:A}=ce(),j=de(!0),N=S||i,P=x??p,F=ee(g),[I,L]=te({controlled:c,default:d,name:`RadioGroup`,state:`value`}),[R,z]=O.useState(!1),B=l((e,t)=>{s?.(e,t),!t.isCanceled&&L(e)}),V=O.useRef(null),H=O.useRef(null),U=O.useRef(null);function W(e){let t;return h&&(typeof h==`function`?t=h(e):h.current=e),H.current=e,w.inputRef.current=e,t}let G=l((e,t=!1)=>{if(e){if(t){V.current===e&&(V.current=null);return}V.current??=e}}),K=l(e=>{if(!e||e.disabled)return;U.current||=e;let t=H.current;if(e.checked||t==null||t.disabled)return W(e)});se(V,F,I??null),ne(I,()=>{A(P),oe(I!==ue.initialValue),le(I!=null),ie()?w.commit(I):w.commit(I,!0);let e=U.current;I==null&&e&&!e.disabled&&W(e)});let pe=v[`aria-labelledby`]??k??j?.legendId,me={...C,disabled:N??!1,required:o??!1,readOnly:a??!1},q=O.useMemo(()=>({...C,checkedValue:I,disabled:N,form:f,validation:w,name:P,readOnly:a,registerControlRef:G,registerInputRef:K,required:o,setCheckedValue:B,setTouched:z,touched:R}),[I,N,f,w,C,P,a,G,K,o,B,z,R]),J={role:`radiogroup`,"aria-required":o||void 0,"aria-disabled":N||void 0,"aria-readonly":a||void 0,"aria-labelledby":pe,onFocus(){b(!0)},onBlur(e){re(e.currentTarget,e.relatedTarget)||(y(!0),b(!1),ae===`onBlur`&&w.commit(I))},onKeyDownCapture(e){e.key.startsWith(`Arrow`)&&(y(!0),z(!0),b(!0))}};return(0,D.jsx)(M.Provider,{value:q,children:(0,D.jsx)(E,{render:n,className:r,style:_,state:me,props:[J,w.getValidationProps,v],refs:[t],stateAttributesMapping:T,enableHomeAndEndKeys:!1,modifierKeys:fe})})}),z=d();function B(e){let t=(0,z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=x(`flex flex-col gap-3`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,D.jsx)(R,{className:i,"data-slot":`radio-group`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function V(e){let t=(0,z.c)(9),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=x(`relative inline-flex size-4.5 shrink-0 items-center justify-center rounded-full border border-input bg-background not-dark:bg-clip-padding shadow-xs/5 outline-none transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-full not-data-disabled:not-data-checked:not-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)] focus-visible:outline-2 focus-visible:outline-solid focus-visible:-outline-offset-2 focus-visible:outline-ring aria-invalid:border-destructive/36 focus-visible:aria-invalid:border-destructive/64 focus-visible:aria-invalid:outline-destructive/48 data-disabled:opacity-64 sm:size-4 dark:not-data-checked:bg-input/32 dark:focus-visible:aria-invalid:outline-destructive/24 dark:not-data-disabled:not-data-checked:not-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/6%)] [[data-disabled],[data-checked],[aria-invalid]]:shadow-none`,n),t[3]=n,t[4]=i);let a;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,D.jsx)(L,{className:`-inset-px absolute flex size-4.5 items-center justify-center rounded-full before:size-2 before:rounded-full before:bg-primary-foreground data-unchecked:hidden data-checked:bg-primary sm:size-4 sm:before:size-1.5 in-[[data-slot=radio]:focus-visible]:inset-shadow-[0_0_0_3px_var(--background)] in-[[data-slot=radio]:focus-visible]:outline-2 in-[[data-slot=radio]:focus-visible]:outline-solid in-[[data-slot=radio]:focus-visible]:-outline-offset-2 in-[[data-slot=radio]:focus-visible]:outline-inherit`,"data-slot":`radio-indicator`}),t[5]=a):a=t[5];let o;return t[6]!==r||t[7]!==i?(o=(0,D.jsx)(I,{className:i,"data-slot":`radio`,...r,children:a}),t[6]=r,t[7]=i,t[8]=o):o=t[8],o}export{I as i,B as n,L as r,V as t};
2
- //# sourceMappingURL=radio-group-CfHe3q1m.js.map
@@ -1 +0,0 @@
1
- import"./chunk-FOHPRMQF-DzxwRta7.js";import{m as e}from"./mermaid-parser.core-DcamukpZ.js";export{e as createRailroadAbnfServices};
@@ -1 +0,0 @@
1
- import"./chunk-FOHPRMQF-DzxwRta7.js";import{f as e}from"./mermaid-parser.core-DcamukpZ.js";export{e as createRailroadEbnfServices};
@@ -1 +0,0 @@
1
- import"./chunk-FOHPRMQF-DzxwRta7.js";import{u as e}from"./mermaid-parser.core-DcamukpZ.js";export{e as createRailroadPegServices};