@p4code/cli 0.9.15 → 0.9.17

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 (422) hide show
  1. package/dist/AcpMcpStdioBridge-Bv41U5Ym.mjs +3 -0
  2. package/dist/{AcpMcpStdioBridge-BPNHFfTr.mjs → AcpMcpStdioBridge-CvhQaaYj.mjs} +3 -3
  3. package/dist/{Effect-COOccdaU.mjs → Effect-_Rz7VLdg.mjs} +33 -2
  4. package/dist/{Schema-BXiVImR2.mjs → Schema-APnY3Ozr.mjs} +2 -2
  5. package/dist/{Stream-D2XZdzH6.mjs → Stream-CJtpwu3-.mjs} +2 -2
  6. package/dist/bin.mjs +2 -2
  7. package/dist/{binCli-06acKUH_.mjs → binCli-B298WI-F.mjs} +6254 -4331
  8. package/dist/claude-history-worker.mjs +1 -1
  9. package/dist/{claudeHistoryWorker-BJKXFgWC.mjs → claudeHistoryWorker-Dgk6e0nY.mjs} +2 -2
  10. package/dist/client/.vite/manifest.json +2296 -2067
  11. package/dist/client/assets/{2NI2N5EU-CzVcbH89.js → 2NI2N5EU-D4f5i1y_.js} +2 -2
  12. package/dist/client/assets/{4UO7MD6I-DS3UFSUE.js → 4UO7MD6I-RrpAQ0X1.js} +2 -2
  13. package/dist/client/assets/{5B3SVYGG-lbor_c4_.js → 5B3SVYGG-ClZSmzf_.js} +2 -2
  14. package/dist/client/assets/{5GK6JWQ2-DufacBFC.js → 5GK6JWQ2-B1md9I9Z.js} +2 -2
  15. package/dist/client/assets/{5N7A7DKN-B3iWX-TC.js → 5N7A7DKN-BQIARO23.js} +2 -2
  16. package/dist/client/assets/{5OC2THR4-DoDDWXtD.js → 5OC2THR4-351ZCzKk.js} +2 -2
  17. package/dist/client/assets/{5S6HY5KT-7n94quvm.js → 5S6HY5KT-DmJkK7tt.js} +2 -2
  18. package/dist/client/assets/{6IMQ5BUJ-CqcR9lZq.js → 6IMQ5BUJ-BpvNx_p4.js} +2 -2
  19. package/dist/client/assets/{6OLKWJ4F-BeCI6be_.js → 6OLKWJ4F-C2xPWRsp.js} +2 -2
  20. package/dist/client/assets/{74OO7NKP-XWvi4Kgp.js → 74OO7NKP--xC0IYpN.js} +2 -2
  21. package/dist/client/assets/{75O6YZUN-BbbGiqdI.js → 75O6YZUN-CK0ONIHW.js} +2 -2
  22. package/dist/client/assets/{77XECAW3-BVGMXOi_.js → 77XECAW3-BcsWkjLy.js} +2 -2
  23. package/dist/client/assets/{ABYRPUBD-D4oehH5y.js → ABYRPUBD-D3uBdyxY.js} +2 -2
  24. package/dist/client/assets/AlertDialogRoot-CPanDrss.js +2 -0
  25. package/dist/client/assets/{AnimatedHeight-DT585xP0.js → AnimatedHeight-CVfEvZ5q.js} +2 -2
  26. package/dist/client/assets/{AuthSurfaceShell-C312CXz7.js → AuthSurfaceShell-Cfzl0v4C.js} +2 -2
  27. package/dist/client/assets/{BB2UYUI2-BkFcdWkE.js → BB2UYUI2-BOnjWgZo.js} +2 -2
  28. package/dist/client/assets/{BUM34MOA-DK6xDbTB.js → BUM34MOA-B7RHMom2.js} +2 -2
  29. package/dist/client/assets/{CEQABKGZ-rLn9wSBN.js → CEQABKGZ-Cc9Oxare.js} +2 -2
  30. package/dist/client/assets/{CXAC5362-C1eQCQMX.js → CXAC5362-BNdOJTpr.js} +2 -2
  31. package/dist/client/assets/ChatGptUsageButton-xIp-6pmC.js +2 -0
  32. package/dist/client/assets/{ChatMarkdown-BUoR67CT.js → ChatMarkdown-Bueup3X5.js} +24 -24
  33. package/dist/client/assets/CheckboxIndicator-Bx7Oi3gX.js +2 -0
  34. package/dist/client/assets/ClippedText-CIorIVl7.js +2 -0
  35. package/dist/client/assets/CodexSetupSection.logic-C7e1n48R.js +2 -0
  36. package/dist/client/assets/ComboboxClear-HZ-hIKnq.js +2 -0
  37. package/dist/client/assets/ComboboxGroupLabel-DUYNaL5F.js +2 -0
  38. package/dist/client/assets/{CommandBlock-40eSIrOe.js → CommandBlock-4iMcWKQI.js} +2 -2
  39. package/dist/client/assets/CompositeRoot-BBK88_pH.js +2 -0
  40. package/dist/client/assets/ConnectAgentSurface-BWOV2eWU.js +2 -0
  41. package/dist/client/assets/{ConnectionStatusDot-7Tjfknn6.js → ConnectionStatusDot-ChSEZVFH.js} +2 -2
  42. package/dist/client/assets/DRACOLoader-DluumOSd.js +3 -0
  43. package/dist/client/assets/{DRLTVNUE-BPoomdQn.js → DRLTVNUE-DFsymRUq.js} +2 -2
  44. package/dist/client/assets/{DYY6UVD2-BVvdA84B.js → DYY6UVD2-CBGlYjYj.js} +2 -2
  45. package/dist/client/assets/DevicePanel-DbUlYPs5.js +2 -0
  46. package/dist/client/assets/DeviceSetup-DwoJ9gYG.js +2 -0
  47. package/dist/client/assets/DialogTitle-CZ-x-t6r.js +2 -0
  48. package/dist/client/assets/{DiffCommentAnnotation-C28NAT6f.js → DiffCommentAnnotation-I1NLNQ4a.js} +3 -3
  49. package/dist/client/assets/{DiffFileTree-DNP9E3To.js → DiffFileTree-D2Less6B.js} +2 -2
  50. package/dist/client/assets/DiffPanel-CbeaPGl7.js +2 -0
  51. package/dist/client/assets/{DiffWorkerPoolProvider-TgqbZJCv.js → DiffWorkerPoolProvider-Ed_Eu_5j.js} +3 -3
  52. package/dist/client/assets/{EmbeddedDesign-B4RMmwTG.css → EmbeddedDesign-2h_Gl1nY.css} +1 -1
  53. package/dist/client/assets/EmbeddedDesign-cg069GMG.js +22 -0
  54. package/dist/client/assets/{EnvironmentMachineIcon-B81Bujkx.js → EnvironmentMachineIcon-DX1kvIxN.js} +2 -2
  55. package/dist/client/assets/{ExpandableText-CViqRFUp.js → ExpandableText-DjawxN-Z.js} +2 -2
  56. package/dist/client/assets/{FNOVOB4O-CmMgcKnc.js → FNOVOB4O-CyUhwNfJ.js} +2 -2
  57. package/dist/client/assets/FieldControl-HtKPFtzy.js +2 -0
  58. package/dist/client/assets/{FileDiff-BnZVGRTP.js → FileDiff-B-y5La4j.js} +2 -2
  59. package/dist/client/assets/{FilePreviewPanel-BUTTBdpa.js → FilePreviewPanel-c9WvfrZ_.js} +6 -6
  60. package/dist/client/assets/{FoldedSettingsSection-CioXtXIT.js → FoldedSettingsSection-BJZLAjOM.js} +2 -2
  61. package/dist/client/assets/FormContext-CXpUoAJn.js +2 -0
  62. package/dist/client/assets/GLTFLoader-DL026JyV.js +3833 -0
  63. package/dist/client/assets/{HDGCDEEZ-BsN0BbNt.js → HDGCDEEZ-Bl6z86eT.js} +2 -2
  64. package/dist/client/assets/{HSJLKHB7-Bn8VFRt5.js → HSJLKHB7-Cfn1dqKq.js} +2 -2
  65. package/dist/client/assets/{Icons-D_LFMxsj.js → Icons-CnCqDzcX.js} +2 -2
  66. package/dist/client/assets/Input-DivTTwcy.js +2 -0
  67. package/dist/client/assets/IntervalSecondsField-BEYqyqtO.js +2 -0
  68. package/dist/client/assets/JZOYTAAL-5Iy_ls5m.js +1 -0
  69. package/dist/client/assets/{K3MD6TGW-BEaTend7.js → K3MD6TGW-DbKn4Q-g.js} +2 -2
  70. package/dist/client/assets/{K7RP3OMA-Ca837W6z.js → K7RP3OMA-C2LcLP3I.js} +2 -2
  71. package/dist/client/assets/KeybindingsSettings.logic-BBUqSPsh.js +2 -0
  72. package/dist/client/assets/{LHDIQX7Q-kLYZmy22.js → LHDIQX7Q-D15jphae.js} +2 -2
  73. package/dist/client/assets/{LUXOKEGN-C6-9ARpy.js → LUXOKEGN-a5epevQp.js} +2 -2
  74. package/dist/client/assets/LinkMachineSelect-BeDb1a2o.js +2 -0
  75. package/dist/client/assets/{MathTypeset-CO0wlzDm.js → MathTypeset-wh9NB-6n.js} +2 -2
  76. package/dist/client/assets/ModelLiveLayer-vM3B8fTs.js +3 -0
  77. package/dist/client/assets/{N3JZAHOW-BFAKVTw8.js → N3JZAHOW-CnXyo2Xv.js} +2 -2
  78. package/dist/client/assets/{NUIALGQ3-DJg3tvBl.js → NUIALGQ3-Be5ePBJU.js} +2 -2
  79. package/dist/client/assets/{NoProjectsHero-ClDVFY0-.js → NoProjectsHero-D-hOorzE.js} +2 -2
  80. package/dist/client/assets/{O65XPQGZ-C5dkxqix.js → O65XPQGZ-B6ecTWo6.js} +2 -2
  81. package/dist/client/assets/{O7XIQ6OM-BUT403yQ.js → O7XIQ6OM-DvY9hhop.js} +2 -2
  82. package/dist/client/assets/{OFQON5FD-BPK3FXUG.js → OFQON5FD-Csir9i2q.js} +2 -2
  83. package/dist/client/assets/P4ConnectAccountPages-0UQXNoHX.js +2 -0
  84. package/dist/client/assets/{P4ConnectSidebarSignIn-D7BBbl_u.js → P4ConnectSidebarSignIn-DNS-Ar_U.js} +2 -2
  85. package/dist/client/assets/{PJQHF43J-DrfICuu-.js → PJQHF43J-DDRN0fWF.js} +2 -2
  86. package/dist/client/assets/PanelLayoutControls-1wZHYpgc.js +216 -0
  87. package/dist/client/assets/PierreEntryIcon-C-UBRZGs.js +2 -0
  88. package/dist/client/assets/PopoverHandle-AuBayEmY.js +2 -0
  89. package/dist/client/assets/PreviewPanel-5UQIDtjs.js +2 -0
  90. package/dist/client/assets/ProjectDefaultsSettings-BuSgjMGJ.js +2 -0
  91. package/dist/client/assets/{ProjectFavicon-BbtNdeB8.js → ProjectFavicon-Rj7LmbUX.js} +3 -3
  92. package/dist/client/assets/ProjectIconPickerDialog-75VZboJk.js +2 -0
  93. package/dist/client/assets/{ProjectMonogram-CjAGnMXr.js → ProjectMonogram-o7ZBa1RK.js} +2 -2
  94. package/dist/client/assets/{ProviderAuthTerminal-83vDClUK.js → ProviderAuthTerminal-884jYkPg.js} +2 -2
  95. package/dist/client/assets/ProviderModelPicker-446NiacH.js +2 -0
  96. package/dist/client/assets/ProviderSettingsForm-CBS1Dlfm.js +2 -0
  97. package/dist/client/assets/PullRequestCodeTab-DQzL88wU.js +6 -0
  98. package/dist/client/assets/{RHNBAITX-CzAdLNMd.js → RHNBAITX-DkWE42El.js} +2 -2
  99. package/dist/client/assets/{ReadOnlySourcePreview-CRy5hHfx.js → ReadOnlySourcePreview-DwfiVQrm.js} +2 -2
  100. package/dist/client/assets/{RedactedSensitiveText-B-u4PB3I.js → RedactedSensitiveText-DCu9USVF.js} +2 -2
  101. package/dist/client/assets/{RenderErrorBoundary-BbxLD-66.js → RenderErrorBoundary-ZQ6mGx7s.js} +3 -3
  102. package/dist/client/assets/RightPanelResizeHandle-8oJQkwcU.js +2 -0
  103. package/dist/client/assets/RoomEnvironment-Iz7-KYrN.js +2 -0
  104. package/dist/client/assets/{SLD4V6NK-DIFaAadw.js → SLD4V6NK-DTdKN7s4.js} +2 -2
  105. package/dist/client/assets/ScheduledTasksSettings-BFBxrkf4.js +6 -0
  106. package/dist/client/assets/{ScopedSwitch-sSIKDf2q.js → ScopedSwitch-BC1gPotW.js} +2 -2
  107. package/dist/client/assets/ScrollAreaCorner-C2BGnFEt.js +2 -0
  108. package/dist/client/assets/{SecretInput-DxjaAnSE.js → SecretInput-CTGlsesz.js} +2 -2
  109. package/dist/client/assets/SelectScrollUpArrow-BCdPJCNh.js +2 -0
  110. package/dist/client/assets/SelfImproveSettingsSection-DrWeWHZ3.js +2 -0
  111. package/dist/client/assets/SettingsPanels-dLjfE4mE.js +46 -0
  112. package/dist/client/assets/SettingsPanels.logic-DmWR8tPG.js +2 -0
  113. package/dist/client/assets/{SettingsScopeNotice-B1JDmqM6.js → SettingsScopeNotice-C3QzVYEB.js} +2 -2
  114. package/dist/client/assets/{SidebarStageBackdrop-Bbv3JBlJ.js → SidebarStageBackdrop-B1pFHa1_.js} +2 -2
  115. package/dist/client/assets/{T3PCR2KE-CACWvOHn.js → T3PCR2KE-17rNrwIa.js} +2 -2
  116. package/dist/client/assets/{TKWO2OVW-DpiGaVko.js → TKWO2OVW-duPpJj5d.js} +2 -2
  117. package/dist/client/assets/{TSHNXIZL-Cs6g4gXN.js → TSHNXIZL-DU0_NvP6.js} +2 -2
  118. package/dist/client/assets/{ThemeEditorPanel-w-RJEK3t.js → ThemeEditorPanel-75j9OkFZ.js} +3 -3
  119. package/dist/client/assets/{ThreadDetailsItemsMenu-DEwUOoLt.js → ThreadDetailsItemsMenu-D9bVwLRx.js} +45 -45
  120. package/dist/client/assets/ThreadTerminalDrawer-CdfREoC-.js +5 -0
  121. package/dist/client/assets/TooltipProvider-BUHMH_xT.js +2 -0
  122. package/dist/client/assets/{UQJE5E4I-C2gKDRv_.js → UQJE5E4I-B6R9z_Jl.js} +2 -2
  123. package/dist/client/assets/{USNYFO5S-CQ8LfY6F.js → USNYFO5S-CoqkxDVj.js} +2 -2
  124. package/dist/client/assets/{Virtualizer-DsEq6qUF.js → Virtualizer-CmU5Fo0Z.js} +2 -2
  125. package/dist/client/assets/{WEVWDWVA-DK2GTAKk.js → WEVWDWVA-C_7PWsV9.js} +2 -2
  126. package/dist/client/assets/{WorkspaceBreadcrumb-BImJJpuo.js → WorkspaceBreadcrumb-wSY6JpgP.js} +2 -2
  127. package/dist/client/assets/{WorkspacePageContainer-BlYFBUKE.js → WorkspacePageContainer-Bv3Si0zJ.js} +2 -2
  128. package/dist/client/assets/{WorkspacePageHeader-B7O16593.js → WorkspacePageHeader-D35ZiFO-.js} +2 -2
  129. package/dist/client/assets/{X5RFHQXM-sPxDCIwv.js → X5RFHQXM-BUhlFLY4.js} +2 -2
  130. package/dist/client/assets/{X62E3GBT-DVWr270S.js → X62E3GBT-BpMRLXKj.js} +2 -2
  131. package/dist/client/assets/{XBNEOJTC-C4ZNtSrU.js → XBNEOJTC-BRtSarTS.js} +2 -2
  132. package/dist/client/assets/{YHV2MVVZ-aSYUfq9n.js → YHV2MVVZ-Csy6jL8n.js} +2 -2
  133. package/dist/client/assets/{YURCZMG2-fnxZxUja.js → YURCZMG2-BWgVyhae.js} +2 -2
  134. package/dist/client/assets/{YVG2LODB-DxaZKaXT.js → YVG2LODB-BaRjN-Cm.js} +2 -2
  135. package/dist/client/assets/_chat-3NFUtZzk.js +47 -0
  136. package/dist/client/assets/_chat.design-CPUGyCaX.js +2 -0
  137. package/dist/client/assets/{_chat.index-D1csjyRQ.js → _chat.index-BMWR9-dz.js} +2 -2
  138. package/dist/client/assets/_chat.new-CFxwzp_c.js +4 -0
  139. package/dist/client/assets/_chat.pull-requests-BeA7vnLo.js +2 -0
  140. package/dist/client/assets/alert-DNQ3Wqlu.js +2 -0
  141. package/dist/client/assets/{alert-dialog-BCq0Qme9.js → alert-dialog-BRZulAlJ.js} +2 -2
  142. package/dist/client/assets/{assetUrls-CpRsTTqn.js → assetUrls-C1PZWceM.js} +2 -2
  143. package/dist/client/assets/assets-DPxWpbK1.js +2 -0
  144. package/dist/client/assets/browserHistoryStore-or0m8nek.js +2 -0
  145. package/dist/client/assets/{browserLinkTarget-IOprEiHF.js → browserLinkTarget-DE8VZ118.js} +2 -2
  146. package/dist/client/assets/{checkbox-CGhJug34.js → checkbox-Cz3A131i.js} +2 -2
  147. package/dist/client/assets/{color-picker-CRaqqL5F.js → color-picker-BqJjpRIx.js} +2 -2
  148. package/dist/client/assets/combobox-D28ATySv.js +2 -0
  149. package/dist/client/assets/{command-06bu9QoQ.js → command-BjQ8TOGE.js} +2 -2
  150. package/dist/client/assets/{connect-7OV1IEwO.js → connect-CpfP9Azm.js} +2 -2
  151. package/dist/client/assets/connect-agent-19TQkO9t.js +2 -0
  152. package/dist/client/assets/design-Bz1IpqHZ.js +2 -0
  153. package/dist/client/assets/device-DuASmK9r.js +2 -0
  154. package/dist/client/assets/dialog-BJ3R7bWN.js +2 -0
  155. package/dist/client/assets/diffPanelStore-Yh6lox6N.js +2 -0
  156. package/dist/client/assets/{diffRendering-DAzPanqh.js → diffRendering-CeqwU9XS.js} +2 -2
  157. package/dist/client/assets/{dist-BuxsAlG0.js → dist-C2W3DEZU.js} +3 -3
  158. package/dist/client/assets/draco_decoder-DZ63_CFx.js +2 -0
  159. package/dist/client/assets/draco_decoder-Z1_iN-Ht.wasm +0 -0
  160. package/dist/client/assets/draco_wasm_wrapper-9cRAE0qV.js +2 -0
  161. package/dist/client/assets/draco_wasm_wrapper-fZCQGLGb.js +116 -0
  162. package/dist/client/assets/draft-input-D7yqLT1A.js +2 -0
  163. package/dist/client/assets/duoViewer-DQzDc4Z4.js +2 -0
  164. package/dist/client/assets/{dynamic-wBSCLNxy.js → dynamic-Dz4eLTaa.js} +3 -3
  165. package/dist/client/assets/{embeddedScripts-ZebptRJ0.js → embeddedScripts-DZ2Ii9dE.js} +2 -2
  166. package/dist/client/assets/empty-BwsFVBxJ.js +2 -0
  167. package/dist/client/assets/entities-CNmVqAZs.js +2 -0
  168. package/dist/client/assets/{fileLinks-BfcK2bJU.js → fileLinks-E3IIVHgM.js} +2 -2
  169. package/dist/client/assets/{fileTreeExpansion-DjiK1m5s.js → fileTreeExpansion-gTas243c.js} +2 -2
  170. package/dist/client/assets/{getDiffFileInput-XE3jyXxK.js → getDiffFileInput-CUXcOkYa.js} +2 -2
  171. package/dist/client/assets/{htmlRender-DGe3WaPg.js → htmlRender-DSw3CY7L.js} +2 -2
  172. package/dist/client/assets/hubAccess-CsZ8CNmg.js +2 -0
  173. package/dist/client/assets/image-up-f7X837EZ.js +2 -0
  174. package/dist/client/assets/{index-CurDuwfz.js → index-Bxj8VaXa.js} +3 -3
  175. package/dist/client/assets/{input-CQaedaQh.js → input-BwujRX3Y.js} +2 -2
  176. package/dist/client/assets/input-group-euoW8Z7h.js +2 -0
  177. package/dist/client/assets/{kbd-DQRicdHu.js → kbd-GiLKf_On.js} +2 -2
  178. package/dist/client/assets/keybindings-CCmLKtII.js +2 -0
  179. package/dist/client/assets/{lazy-DmPH_lNd.js → lazy-JsFnphfP.js} +4 -4
  180. package/dist/client/assets/{lazyRouteComponent-CE6uW_5p.js → lazyRouteComponent-DZOLCSfI.js} +2 -2
  181. package/dist/client/assets/{link-CKfckeju.js → link-ByE5ZkNW.js} +2 -2
  182. package/dist/client/assets/{linkedPrompt-68_t5vwh.js → linkedPrompt-Dv_ZP8G8.js} +2 -2
  183. package/dist/client/assets/main-D8lKEPYS.js +37 -0
  184. package/dist/client/assets/main-DIHqY9YX.css +2 -0
  185. package/dist/client/assets/{mediaReference-DQ6GIZY7.js → mediaReference-DKsJ-9R8.js} +2 -2
  186. package/dist/client/assets/mediaSource-CF8tZyds.js +2 -0
  187. package/dist/client/assets/meshopt_decoder.module-BE7cuDBs.js +2 -0
  188. package/dist/client/assets/modelScene-DxcxMNRA.js +3 -0
  189. package/dist/client/assets/number-field-CWsDuEfo.js +2 -0
  190. package/dist/client/assets/{observeResize-BbXolq6K.js → observeResize-BxfFu2qN.js} +2 -2
  191. package/dist/client/assets/onboarding-DbYQeYSX.js +2 -0
  192. package/dist/client/assets/openFileInPreview-BiuuqQ-l.js +2 -0
  193. package/dist/client/assets/orbit-CTbdaXs-.js +2 -0
  194. package/dist/client/assets/p4ProjectFile-CZQao9GZ.js +2 -0
  195. package/dist/client/assets/{pair-BpCo33SH.js → pair-JgOCPd7m.js} +2 -2
  196. package/dist/client/assets/pause-5XtmSS7L.js +2 -0
  197. package/dist/client/assets/{pendingSendStore-Ba--K6cH.js → pendingSendStore-Bf499-Oy.js} +2 -2
  198. package/dist/client/assets/phoneViewer-Bqeu_y-d.js +2 -0
  199. package/dist/client/assets/{pierre-icons-BdcegjLq.js → pierre-icons-tmWDDsbZ.js} +2 -2
  200. package/dist/client/assets/popover-D2KZg7__.js +2 -0
  201. package/dist/client/assets/preview-eatXH_DC.js +2 -0
  202. package/dist/client/assets/preview-rGycedjV.js +2 -0
  203. package/dist/client/assets/previewMiniPlayerStore-7pQoYbpL.js +2 -0
  204. package/dist/client/assets/primary-C0adlG4a.js +2 -0
  205. package/dist/client/assets/primaryCloudLinkState-DStOgXZ7.js +2 -0
  206. package/dist/client/assets/projectFilesQueryState-CXzO_JXd.js +2 -0
  207. package/dist/client/assets/projectScriptEditor-B9Q_BBbL.js +2 -0
  208. package/dist/client/assets/providerSkills-BYU6vU9U.js +2 -0
  209. package/dist/client/assets/pullRequestDetail.logic-CAA5BrcO.js +10 -0
  210. package/dist/client/assets/{pullRequestIcons-CbDg0o8q.js → pullRequestIcons-D0TNfVUp.js} +2 -2
  211. package/dist/client/assets/{pullRequestReviewStore-0WIH92NQ.js → pullRequestReviewStore-szmuenZj.js} +2 -2
  212. package/dist/client/assets/pullRequests-tu-Mn-gv.js +2 -0
  213. package/dist/client/assets/queries-BhrI_odm.js +2 -0
  214. package/dist/client/assets/query-DmYgeaGK.js +2 -0
  215. package/dist/client/assets/radio-group-YcYZQjQu.js +2 -0
  216. package/dist/client/assets/relay-DcCuBtiq.js +2 -0
  217. package/dist/client/assets/renderScheduler-BgdSr0UC.js +2 -0
  218. package/dist/client/assets/rightPanelStore-BpUwMEU6.js +2 -0
  219. package/dist/client/assets/runtime-DciS6GP9.js +7 -0
  220. package/dist/client/assets/{runtimeModeConfig-CRXk0H6e.js → runtimeModeConfig-B8OcO6E5.js} +2 -2
  221. package/dist/client/assets/{scheduledTasksSettings.logic-Dw_swg_M.js → scheduledTasksSettings.logic-Cnm8G_wO.js} +3 -3
  222. package/dist/client/assets/{scroll-area-Cm9XZdHp.js → scroll-area-D7wKdOM7.js} +2 -2
  223. package/dist/client/assets/select--26O8gr7.js +2 -0
  224. package/dist/client/assets/selfImproveFindings-CQHbA_SP.js +2 -0
  225. package/dist/client/assets/server-DKB_3xTN.js +2 -0
  226. package/dist/client/assets/session-D_OiLzln.js +2 -0
  227. package/dist/client/assets/session-logic-lUPcTQRy.js +26 -0
  228. package/dist/client/assets/{settings-Yvo1RMvg.js → settings-BDigjNQr.js} +2 -2
  229. package/dist/client/assets/{settings.appearance-ONDNW-gc.js → settings.appearance-pv_RhojI.js} +2 -2
  230. package/dist/client/assets/settings.archived-UHO0BqSp.js +2 -0
  231. package/dist/client/assets/settings.computer-use-C7FCVkB8.js +2 -0
  232. package/dist/client/assets/settings.connections-MCKul-Qb.js +2 -0
  233. package/dist/client/assets/settings.data-controls-DHSiH1XK.js +2 -0
  234. package/dist/client/assets/settings.decisions-DVAZFuiP.js +2 -0
  235. package/dist/client/assets/settings.designs-Cq_57Bul.js +2 -0
  236. package/dist/client/assets/settings.diagnostics-D3vvP_U2.js +2 -0
  237. package/dist/client/assets/{settings.general-Cf_bIbyH.js → settings.general-BVlKme_0.js} +2 -2
  238. package/dist/client/assets/settings.integrations-CfX639cu.js +2 -0
  239. package/dist/client/assets/settings.keybindings-C4ufqFiE.js +2 -0
  240. package/dist/client/assets/{settings.open-source-licenses-DlqO6HBa.js → settings.open-source-licenses-C7SQX7_o.js} +2 -2
  241. package/dist/client/assets/settings.plugins-JB-_3lB3.js +5 -0
  242. package/dist/client/assets/settings.projects-HbUqS8EQ.js +4 -0
  243. package/dist/client/assets/settings.providers-DDaicTRG.js +3 -0
  244. package/dist/client/assets/{settings.scheduled-tasks-BIaHEXVF.js → settings.scheduled-tasks-CsfZkMNc.js} +2 -2
  245. package/dist/client/assets/settings.secrets-DmkUTUBC.js +2 -0
  246. package/dist/client/assets/settings.snap-shot-CxBBb3GG.js +2 -0
  247. package/dist/client/assets/settings.source-control-Buh1svx1.js +2 -0
  248. package/dist/client/assets/settings.storage-BoCdHcfz.js +2 -0
  249. package/dist/client/assets/settingsLayout-EWRSNE9F.js +3 -0
  250. package/dist/client/assets/sidebar-B2McbSnM.js +2 -0
  251. package/dist/client/assets/{sidebarProjectGrouping-Cy06FqQF.js → sidebarProjectGrouping-ManvShfB.js} +2 -2
  252. package/dist/client/assets/skeleton-CfxEpnM8.js +2 -0
  253. package/dist/client/assets/sourceControl-2E-torWB.js +2 -0
  254. package/dist/client/assets/sourceControlClients-DTwwk4H6.js +2 -0
  255. package/dist/client/assets/spinner-DiQtYQvU.js +2 -0
  256. package/dist/client/assets/src-aYUfWMsw.js +15 -0
  257. package/dist/client/assets/{terminal-links-DkNuyYrs.js → terminal-links-DalIS_T6.js} +2 -2
  258. package/dist/client/assets/terminalSessions-BXRGhdwO.js +2 -0
  259. package/dist/client/assets/textarea-CgJxMEC6.js +2 -0
  260. package/dist/client/assets/{themePalette-1UQmJk98.js → themePalette-BAJL8JDR.js} +3 -3
  261. package/dist/client/assets/threadCheckpoints-A01VyLzN.js +2 -0
  262. package/dist/client/assets/toggle-fVPE0kyD.js +2 -0
  263. package/dist/client/assets/toggle-group-BQBgK4Fh.js +2 -0
  264. package/dist/client/assets/{tooltip-C7NAkYG3.js → tooltip-DDv-MvO4.js} +2 -2
  265. package/dist/client/assets/{uiStateStore-FYiLqqos.js → uiStateStore-Cyle2Grh.js} +2 -2
  266. package/dist/client/assets/usage-DfkVwFPy.js +2 -0
  267. package/dist/client/assets/usageAccess-DGGNF6kP.js +2 -0
  268. package/dist/client/assets/usageFormat-DvpnUmwI.js +2 -0
  269. package/dist/client/assets/{usageShortcuts-BJyp1xT6.js → usageShortcuts-BefcatkO.js} +2 -2
  270. package/dist/client/assets/{use-atom-command-BbFDhw_c.js → use-atom-command-Bfi4daMj.js} +2 -2
  271. package/dist/client/assets/{useAriaLabelledBy-BJnK5b5h.js → useAriaLabelledBy-DjrGw7Iw.js} +2 -2
  272. package/dist/client/assets/useHandleNewThread-idXLHXR7.js +2 -0
  273. package/dist/client/assets/{useLocation-NTw9A5XQ.js → useLocation-fNQqSFar.js} +2 -2
  274. package/dist/client/assets/{useNavigate-DV9bXnWr.js → useNavigate-DwXZ6yA7.js} +2 -2
  275. package/dist/client/assets/{useNavigateBack-D62rsj_4.js → useNavigateBack-mLGu4w8K.js} +2 -2
  276. package/dist/client/assets/{useP4ConnectAuthPrompt-Bj5GIxgy.js → useP4ConnectAuthPrompt-BXgvqiOd.js} +2 -2
  277. package/dist/client/assets/{useParams-jklHVL7l.js → useParams-qFbmBdAa.js} +2 -2
  278. package/dist/client/assets/{usePermissionStatus-DaCu90iN.js → usePermissionStatus-CTyZ03Js.js} +2 -2
  279. package/dist/client/assets/usePopupViewport-Dc46kF33.js +2 -0
  280. package/dist/client/assets/usePullRequestActions-DJ1WiiLA.js +3 -0
  281. package/dist/client/assets/useRegisterFieldControl-BL6Ml_ar.js +2 -0
  282. package/dist/client/assets/useRender-BP5vR6yH.js +2 -0
  283. package/dist/client/assets/{useScopedModelAvailability-hsJL85Tg.js → useScopedModelAvailability-CLTKL2Jf.js} +2 -2
  284. package/dist/client/assets/useSettings-CnHpxSBo.js +3 -0
  285. package/dist/client/assets/utils-CtzgibkN.js +24 -0
  286. package/dist/client/assets/vcsRefInvalidation-BewBnMos.js +2 -0
  287. package/dist/client/assets/welcome-BkJ7M2_8.js +2 -0
  288. package/dist/client/index.html +1 -1
  289. package/dist/{renderer-D9dDeERN.mjs → renderer-7PhJbGDm.mjs} +19 -4
  290. package/dist/{runtime-C3UJDGLb.mjs → runtime-Dbm6Vqjj.mjs} +511 -233
  291. package/package.json +1 -1
  292. package/dist/AcpMcpStdioBridge-CtXfvrFO.mjs +0 -3
  293. package/dist/client/assets/AlertDialogRoot-BI19p1Pb.js +0 -2
  294. package/dist/client/assets/ChatGptUsageButton-BldpBXxU.js +0 -2
  295. package/dist/client/assets/CheckboxIndicator-C4iAbUMh.js +0 -2
  296. package/dist/client/assets/ClippedText-TtLeyAVc.js +0 -2
  297. package/dist/client/assets/CodexSetupSection.logic-BO6ZAijp.js +0 -2
  298. package/dist/client/assets/ComboboxClear-CtNsa8Al.js +0 -2
  299. package/dist/client/assets/ComboboxGroupLabel-vQ7y8c50.js +0 -2
  300. package/dist/client/assets/CompositeRoot-CL7X20MU.js +0 -2
  301. package/dist/client/assets/ConnectAgentSurface-B_AYPHWs.js +0 -2
  302. package/dist/client/assets/DevicePanel-Cqexcbm2.js +0 -2
  303. package/dist/client/assets/DeviceSetup-Cdyw5Z9a.js +0 -2
  304. package/dist/client/assets/DialogTitle-CFYK6V6-.js +0 -2
  305. package/dist/client/assets/DiffPanel-CrswOKS6.js +0 -2
  306. package/dist/client/assets/EmbeddedDesign-Bdq5oAfI.js +0 -21
  307. package/dist/client/assets/FieldControl-95mCsa0m.js +0 -2
  308. package/dist/client/assets/FormContext-BcA1kdFD.js +0 -2
  309. package/dist/client/assets/Input-C9KIhPlP.js +0 -2
  310. package/dist/client/assets/JZOYTAAL-B8H2VC7A.js +0 -1
  311. package/dist/client/assets/KeybindingsSettings.logic-DwMUZYvv.js +0 -2
  312. package/dist/client/assets/LinkMachineSelect-BVNnYUBb.js +0 -2
  313. package/dist/client/assets/P4ConnectAccountPages-ChT866qO.js +0 -2
  314. package/dist/client/assets/PanelLayoutControls-DMUv135M.js +0 -216
  315. package/dist/client/assets/PierreEntryIcon-DLXDEcqA.js +0 -2
  316. package/dist/client/assets/PopoverHandle-D8JhsX32.js +0 -2
  317. package/dist/client/assets/PreviewPanel-D7YWnWZS.js +0 -2
  318. package/dist/client/assets/ProjectDefaultsSettings-BZSw74tU.js +0 -2
  319. package/dist/client/assets/ProjectIconPickerDialog-7vur_TCX.js +0 -2
  320. package/dist/client/assets/ProviderModelPicker-af7MWLPO.js +0 -2
  321. package/dist/client/assets/ProviderSettingsForm-B4N4tsxv.js +0 -2
  322. package/dist/client/assets/PullRequestCodeTab-B07M_QW4.js +0 -6
  323. package/dist/client/assets/RightPanelResizeHandle-BODMyZa6.js +0 -2
  324. package/dist/client/assets/ScheduledTasksSettings-BTi69FRq.js +0 -6
  325. package/dist/client/assets/ScrollAreaCorner-CsKGemsf.js +0 -2
  326. package/dist/client/assets/SelectScrollUpArrow-BMZtcPXM.js +0 -2
  327. package/dist/client/assets/SelfImproveSettingsSection-Dx6spJXh.js +0 -2
  328. package/dist/client/assets/SettingsPanels-DhuEF0_Y.js +0 -46
  329. package/dist/client/assets/SettingsPanels.logic-D5Fnq4gS.js +0 -2
  330. package/dist/client/assets/ThreadTerminalDrawer-CY2qHldP.js +0 -5
  331. package/dist/client/assets/TooltipProvider-Czzm7ro-.js +0 -2
  332. package/dist/client/assets/_chat-BeJoXsdK.js +0 -47
  333. package/dist/client/assets/_chat.design-AJz30uXq.js +0 -2
  334. package/dist/client/assets/_chat.new-IhhWgwNo.js +0 -4
  335. package/dist/client/assets/_chat.pull-requests-B84LUHIv.js +0 -2
  336. package/dist/client/assets/alert-D6MFRWZv.js +0 -2
  337. package/dist/client/assets/assets-Dh1LFwqL.js +0 -2
  338. package/dist/client/assets/browserHistoryStore-BVEWgOnh.js +0 -2
  339. package/dist/client/assets/combobox-5RzytEjd.js +0 -2
  340. package/dist/client/assets/connect-agent-B6pgZuy8.js +0 -2
  341. package/dist/client/assets/design-DSoix9e1.js +0 -2
  342. package/dist/client/assets/device-DQmQm4GC.js +0 -2
  343. package/dist/client/assets/dialog-DTVhbEqi.js +0 -2
  344. package/dist/client/assets/draft-input-BTetoXSt.js +0 -2
  345. package/dist/client/assets/duoViewer-DxmaOmHS.js +0 -2
  346. package/dist/client/assets/empty-B4h5DyMQ.js +0 -2
  347. package/dist/client/assets/entities-CWtNgawi.js +0 -2
  348. package/dist/client/assets/guideRunStore-CzF0q6A8.js +0 -2
  349. package/dist/client/assets/image-up-BN-uYqtM.js +0 -2
  350. package/dist/client/assets/input-group-BQ_2ox-w.js +0 -2
  351. package/dist/client/assets/keybindings-tgj8XFFz.js +0 -2
  352. package/dist/client/assets/main-B1sXOjZZ.js +0 -37
  353. package/dist/client/assets/main-CbkvDRKP.css +0 -2
  354. package/dist/client/assets/mediaSource-DfTsMdqm.js +0 -2
  355. package/dist/client/assets/number-field-xEi5ylvp.js +0 -2
  356. package/dist/client/assets/onboarding-CkdZxdNL.js +0 -2
  357. package/dist/client/assets/openFileInPreview-BHhDd-id.js +0 -2
  358. package/dist/client/assets/orbit-aOr6_vTe.js +0 -2
  359. package/dist/client/assets/p4ProjectFile-5VDI-yAx.js +0 -2
  360. package/dist/client/assets/pause-C-5l1Ug3.js +0 -2
  361. package/dist/client/assets/phoneViewer-C1aGY-h1.js +0 -2
  362. package/dist/client/assets/popover-BB2K1---.js +0 -2
  363. package/dist/client/assets/preview-B4_sjsUX.js +0 -2
  364. package/dist/client/assets/preview-DgXn94k5.js +0 -2
  365. package/dist/client/assets/previewMiniPlayerStore-DguWdL1f.js +0 -2
  366. package/dist/client/assets/primary-BDoRkJqU.js +0 -2
  367. package/dist/client/assets/primaryCloudLinkState-Cc0Xobh6.js +0 -2
  368. package/dist/client/assets/projectFilesQueryState-BdfD5cZ2.js +0 -2
  369. package/dist/client/assets/projectScriptEditor-faOsFlds.js +0 -2
  370. package/dist/client/assets/providerSkills-C8PrnHb-.js +0 -2
  371. package/dist/client/assets/pullRequestDetail.logic-kOhR5jr9.js +0 -10
  372. package/dist/client/assets/pullRequests-Cf9E2kW-.js +0 -2
  373. package/dist/client/assets/queries-Cl508kPw.js +0 -2
  374. package/dist/client/assets/query-D3KVoW9G.js +0 -2
  375. package/dist/client/assets/radio-group-BnZVD-CO.js +0 -2
  376. package/dist/client/assets/relay-Do9UB5iT.js +0 -2
  377. package/dist/client/assets/renderScheduler-DsjkE3rh.js +0 -3833
  378. package/dist/client/assets/rightPanelStore-DB1OP4MT.js +0 -2
  379. package/dist/client/assets/runtime-BBYIQ0f-.js +0 -7
  380. package/dist/client/assets/select-Cz_1ByI4.js +0 -2
  381. package/dist/client/assets/selfImproveFindings-DtoTFNL_.js +0 -2
  382. package/dist/client/assets/server-Dkj4NeYG.js +0 -2
  383. package/dist/client/assets/session-CBEVNHld.js +0 -2
  384. package/dist/client/assets/session-logic-DB_ei-pn.js +0 -26
  385. package/dist/client/assets/settings.archived-CjdyCMyi.js +0 -2
  386. package/dist/client/assets/settings.computer-use-97ffp9C_.js +0 -2
  387. package/dist/client/assets/settings.connections-w3qKRKGa.js +0 -2
  388. package/dist/client/assets/settings.data-controls-C8ozSexu.js +0 -2
  389. package/dist/client/assets/settings.decisions-BvR3_OTv.js +0 -2
  390. package/dist/client/assets/settings.designs-CB8PWHwW.js +0 -2
  391. package/dist/client/assets/settings.diagnostics-DdInPrq0.js +0 -2
  392. package/dist/client/assets/settings.integrations-pj9KVvtd.js +0 -2
  393. package/dist/client/assets/settings.keybindings-3diGciV1.js +0 -2
  394. package/dist/client/assets/settings.plugins-DpaJJH_J.js +0 -5
  395. package/dist/client/assets/settings.projects-Bfh3CJ1a.js +0 -4
  396. package/dist/client/assets/settings.providers-DNiEeQYT.js +0 -3
  397. package/dist/client/assets/settings.secrets-BSNXem5A.js +0 -2
  398. package/dist/client/assets/settings.snap-shot-Ds0ywKhE.js +0 -2
  399. package/dist/client/assets/settings.source-control-C41AVNSm.js +0 -2
  400. package/dist/client/assets/settings.storage-B-Hm5vEC.js +0 -2
  401. package/dist/client/assets/settingsLayout-BbEwQ6Fy.js +0 -3
  402. package/dist/client/assets/sidebar-B70J7v16.js +0 -2
  403. package/dist/client/assets/skeleton-BavPX8IL.js +0 -2
  404. package/dist/client/assets/sourceControl-De64nxc-.js +0 -2
  405. package/dist/client/assets/sourceControlClients-BofXnV5S.js +0 -2
  406. package/dist/client/assets/spinner-BiCpg0TU.js +0 -2
  407. package/dist/client/assets/terminalSessions-BLnAzTpE.js +0 -2
  408. package/dist/client/assets/textarea-DPWqoJRQ.js +0 -2
  409. package/dist/client/assets/threadCheckpoints-C5aLz9nv.js +0 -2
  410. package/dist/client/assets/toggle-DERKSGyC.js +0 -2
  411. package/dist/client/assets/toggle-group-DYSJFIn3.js +0 -2
  412. package/dist/client/assets/usage-CtcqAwlu.js +0 -2
  413. package/dist/client/assets/usageAccess-2Wks5kIN.js +0 -2
  414. package/dist/client/assets/usageFormat-BZJ9qCn4.js +0 -2
  415. package/dist/client/assets/useHandleNewThread-C6MtV3AM.js +0 -2
  416. package/dist/client/assets/usePopupViewport-D1lXH2SQ.js +0 -2
  417. package/dist/client/assets/usePullRequestActions-WFmep5Tm.js +0 -3
  418. package/dist/client/assets/useRegisterFieldControl-BtJcyaxh.js +0 -2
  419. package/dist/client/assets/useSettings-EYJbJzT3.js +0 -3
  420. package/dist/client/assets/utils-DjbLtxuo.js +0 -37
  421. package/dist/client/assets/vcsRefInvalidation-DkXoQApH.js +0 -2
  422. package/dist/client/assets/welcome-uKSqaFeK.js +0 -2
@@ -0,0 +1,2 @@
1
+ import{a as e,t}from"./react-BUfh6y28.js";import{t as n}from"./jsx-runtime-DJeoFXNw.js";import{Bn as r,Da as i,Gn as a,Ka as o,Na as s,Or as ee,To as te,Ua as c,Un as l,Va as u,Ya as d,ca as f,fo as p,ja as m,sa as h,wa as g}from"./utils-CtzgibkN.js";import{c as _,d as ne,f as v,i as re,n as ie,s as ae,u as oe}from"./useRender-BP5vR6yH.js";import{t as se}from"./useRegisterFieldControl-BL6Ml_ar.js";import{t as ce}from"./FormContext-CXpUoAJn.js";import{t as le}from"./useAriaLabelledBy-DjrGw7Iw.js";import{t as ue}from"./FieldItemContext-sr3mCd2v.js";var y=e(t()),b=y.createContext(void 0);function de(e=!0){let t=y.useContext(b);if(t===void 0&&!e)throw Error(v(3));return t}function fe(e){if(!e)return null;for(let t of e.elements){let e=t.tagName;if(e===`BUTTON`||e===`INPUT`){let e=t;if(e.type===`submit`)return e}}return null}var x=function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.indeterminate=`data-indeterminate`,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}({});function S(e){return y.useMemo(()=>({checked(t){return e.indeterminate?{}:t?{[x.checked]:``}:{[x.unchecked]:``}},...a}),[e.indeterminate])}var C=y.createContext(void 0);function w(){let e=y.useContext(C);if(e===void 0)throw Error(v(14));return e}var T=e(n()),pe=`data-parent`,me=y.forwardRef(function(e,t){let{checked:n,className:i,defaultChecked:a=!1,"aria-labelledby":te,disabled:g=!1,form:v,id:b,indeterminate:x=!1,inputRef:w,name:me,onCheckedChange:he,parent:E=!1,readOnly:D=!1,render:ge,required:O=!1,uncheckedValue:k,value:A,nativeButton:j=!1,style:_e,...ve}=e,{clearErrors:ye}=ce(),{disabled:be,name:xe,setDirty:Se,setFilled:M,setFocused:N,setTouched:Ce,state:P,validationMode:we,validityData:Te,shouldValidateOnChange:Ee,validation:De}=l(),Oe=ue(),{labelId:ke,controlId:Ae,registerControlId:F,getDescriptionProps:I}=r(),L=de(),R=L?.parent,z=R&&L.allValues,B=be||Oe.disabled||L?.disabled||g,V=xe??me,H=A??V,je=s(),Me=s(),U=Ae;z?U=E?Me:`${R.id}-${H}`:b&&(U=b);let W={};z&&(E?W=L.parent.getParentProps():H&&(W=L.parent.getChildProps(H)));let{checked:Ne=n,indeterminate:G=x,onCheckedChange:Pe,...Fe}=W,K=L?.value,Ie=L?.setValue,Le=L?.defaultValue,q=y.useRef(null),J=ne(()=>Symbol(`checkbox-control`)),Y=y.useRef(!1),{getButtonProps:Re,buttonRef:ze}=u({disabled:B,native:j}),X=L?.validation??De,[Z,Be]=d({controlled:H&&K&&!E?K.includes(H):Ne,default:H&&Le&&!E?Le.includes(H):a,name:`Checkbox`,state:`checked`});c(()=>{F!==_&&(Y.current=!0,F(J.current,U))},[U,F,J]),y.useEffect(()=>{let e=J.current;return()=>{Y.current&&F!==_&&(Y.current=!1,F(e,void 0))}},[F,J]),se(q,je,Z,void 0,!L);let Q=y.useRef(null),Ve=oe(w,Q,X.inputRef),He=le(te,ke,Q,!j,U??void 0);c(()=>{Q.current&&(Q.current.indeterminate=G,Z&&M(!0))},[Z,G,M]),ee(Z,()=>{(!L||E)&&(ye(V),M(Z),Se(Z!==Te.initialValue),Ee()?X.commit(Z):X.commit(Z,!0))});let Ue=re({checked:Z,disabled:B,form:v,name:E?void 0:V,id:j?void 0:U??void 0,required:O,ref:Ve,style:V?f:h,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(D){e.preventDefault();return}let t=e.currentTarget.checked,n=m(p,e.nativeEvent);if(Pe?.(t,n),he?.(t,n),!n.isCanceled&&(Be(t),H&&K&&Ie&&!E&&!z)){let e=t?[...K,H]:K.filter(e=>e!==H);Ie(e,n)}},onFocus(){q.current?.focus()}},A===void 0?ae:{value:(L?Z&&A:A)||``},I,L?X.getValidationProps:X.getInputValidationProps),We=z?!!Ne:Z,Ge=z&&G||x;y.useEffect(()=>{if(!R||!H)return;let e=R.disabledStatesRef.current;return e.set(H,B),()=>{e.delete(H)}},[R,B,H]);let $=y.useMemo(()=>({...P,checked:We,disabled:B,readOnly:D,required:O,indeterminate:Ge}),[P,We,B,D,O,Ge]),Ke=S($),qe=ie(`span`,e,{state:$,ref:[ze,q,t,L?.registerControlRef],props:[{id:j?U??void 0:je,role:`checkbox`,"aria-checked":G?`mixed`:Z,"aria-readonly":D||void 0,"aria-required":O||void 0,"aria-labelledby":He,[pe]:E?``:void 0,onFocus(){N(!0)},onBlur(){let e=Q.current;e&&(Ce(!0),N(!1),we===`onBlur`&&X.commit(L?K:e.checked))},onKeyDown(e){if(e.key!==`Enter`||(e.preventBaseUIHandler(),e.defaultPrevented))return;let t=Q.current?.form??null,n=e.currentTarget,r=e.nativeEvent,i=e.preventDefault,a=r.preventDefault,s=!1;e.preventDefault=()=>{s=!0,i.call(e)},r.preventDefault=()=>{s=!0,a.call(r)},a.call(r),o(n).queueMicrotask(()=>{e.preventDefault=i,r.preventDefault=a,s||fe(t)?.click()})},onClick(e){if(D||B)return;e.preventDefault();let t=Q.current;t&&t.dispatchEvent(new(o(t)).PointerEvent(`click`,{bubbles:!0,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey}))}},I,X.getValidationProps,ve,Fe,Re],stateAttributesMapping:Ke});return(0,T.jsxs)(C.Provider,{value:$,children:[qe,!Z&&!L&&V&&!E&&k!==void 0&&(0,T.jsx)(`input`,{type:`hidden`,form:v,name:V,value:k}),(0,T.jsx)(`input`,{...Ue,suppressHydrationWarning:!0})]})}),he=y.forwardRef(function(e,t){let{render:n,className:r,style:o,keepMounted:s=!1,...ee}=e,c=w(),l=c.checked||c.indeterminate,{mounted:u,transitionStatus:d,setMounted:f}=i(l),p=y.useRef(null),m={...c,transitionStatus:d};g({open:l,ref:p,onComplete(){l||f(!1)}});let h={...S(c),...te,...a},_=s||u,ne=ie(`span`,e,{ref:[t,p],state:m,stateAttributesMapping:h,props:ee});return _?ne:null});export{me as n,he as t};
2
+ //# sourceMappingURL=CheckboxIndicator-Bx7Oi3gX.js.map
@@ -0,0 +1,2 @@
1
+ import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import"./utils-CtzgibkN.js";import{g as i,m as a,n as o}from"./useRender-BP5vR6yH.js";import{a as s,i as c,l,n as u,o as d,r as f,s as p}from"./TooltipProvider-BUHMH_xT.js";import{t as m}from"./usePopupViewport-Dc46kF33.js";var h=e(t()),g=function(e){return e.popupWidth=`--popup-width`,e.popupHeight=`--popup-height`,e}({}),_={activationDirection:e=>e?{"data-activation-direction":e}:null},v=h.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...s}=e,u=l(),d=c(),f=u.useState(`instantType`),{children:p,state:h}=m({store:u,side:d.side,cssVars:g,children:a}),v={activationDirection:h.activationDirection,transitioning:h.transitioning,instant:f};return o(`div`,e,{state:v,ref:t,props:[s,{children:p}],stateAttributesMapping:_})}),y=n();function b(...e){return a(i(e))}var x=e(r(),1),S=p;function C(e){let t=(0,y.c)(2),n;return t[0]===e?n=t[1]:(n=(0,x.jsx)(d,{"data-slot":`tooltip-trigger`,...e}),t[0]=e,t[1]=n),n}function w(e){let t=(0,y.c)(28),n,r,i,a,o,c,l,d,p;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],c=t[6],l=t[7],d=t[8],p=t[9]):({className:i,positionerClassName:a,align:c,sideOffset:l,side:d,variant:p,anchor:n,children:r,...o}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=c,t[7]=l,t[8]=d,t[9]=p);let m=c===void 0?`center`:c,h=l===void 0?4:l,g=d===void 0?`top`:d,_=p===void 0?`default`:p,S;t[10]===a?S=t[11]:(S=b(`pointer-events-none z-[70] h-(--positioner-height) w-(--positioner-width) max-w-(--available-width) transition-[top,left,right,bottom,transform] data-instant:transition-none`,a),t[10]=a,t[11]=S);let C=_===`glass`?`dropdown-glass shadow-xl shadow-black/25 before:hidden`:`border bg-popover not-dark:bg-clip-padding shadow-md/5`,w;t[12]!==i||t[13]!==C?(w=b(`relative flex h-(--popup-height,auto) w-(--popup-width,auto) origin-(--transform-origin) text-balance rounded-md text-popover-foreground text-xs transition-[width,height,scale,opacity] before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-md)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] data-ending-style:scale-98 data-starting-style:scale-98 data-ending-style:opacity-0 data-starting-style:opacity-0 data-instant:duration-0 dark:before:shadow-[0_-1px_--theme(--color-white/6%)]`,C,i),t[12]=i,t[13]=C,t[14]=w):w=t[14];let T;t[15]===r?T=t[16]:(T=(0,x.jsx)(v,{className:`relative size-full overflow-clip px-(--viewport-inline-padding) py-1 [--viewport-inline-padding:--spacing(2)] data-instant:transition-none **:data-current:data-ending-style:opacity-0 **:data-current:data-starting-style:opacity-0 **:data-previous:data-ending-style:opacity-0 **:data-previous:data-starting-style:opacity-0 **:data-current:w-[calc(var(--popup-width)-2*var(--viewport-inline-padding)-2px)] **:data-previous:w-[calc(var(--popup-width)-2*var(--viewport-inline-padding)-2px)] **:data-previous:truncate **:data-current:opacity-100 **:data-previous:opacity-100 **:data-current:transition-opacity **:data-previous:transition-opacity`,"data-slot":`tooltip-viewport`,children:r}),t[15]=r,t[16]=T);let E;t[17]!==o||t[18]!==w||t[19]!==T?(E=(0,x.jsx)(u,{className:w,"data-slot":`tooltip-popup`,...o,children:T}),t[17]=o,t[18]=w,t[19]=T,t[20]=E):E=t[20];let D;return t[21]!==m||t[22]!==n||t[23]!==g||t[24]!==h||t[25]!==S||t[26]!==E?(D=(0,x.jsx)(s,{children:(0,x.jsx)(f,{align:m,anchor:n,className:S,"data-slot":`tooltip-positioner`,side:g,sideOffset:h,children:E})}),t[21]=m,t[22]=n,t[23]=g,t[24]=h,t[25]=S,t[26]=E,t[27]=D):D=t[27],D}var T=e=>!!(e&&e.scrollWidth>e.clientWidth);function E(e,t){let n=(0,y.c)(5),[r,i]=(0,h.useState)(!1),a;n[0]===e?a=n[1]:(a=()=>{let t=e.current;if(!t)return;let n=()=>i(T(t));n();let r=new ResizeObserver(n);return r.observe(t),()=>r.disconnect()},n[0]=e,n[1]=a);let o;return n[2]!==e||n[3]!==t?(o=[e,t],n[2]=e,n[3]=t,n[4]=o):o=n[4],(0,h.useLayoutEffect)(a,o),r}function D(e){let t=(0,y.c)(15),{children:n,full:r,className:i}=e,a=r===void 0?n:r,o=i===void 0?`design-truncate`:i,s=(0,h.useRef)(null),c=E(s,n),[l,u]=(0,h.useState)(!1),d=l&&c,f;t[0]===c?f=t[1]:(f=e=>u(e&&c),t[0]=c,t[1]=f);let p=c?0:void 0,m;t[2]!==o||t[3]!==p?(m=(0,x.jsx)(`span`,{ref:s,className:o,tabIndex:p}),t[2]=o,t[3]=p,t[4]=m):m=t[4];let g;t[5]!==n||t[6]!==m?(g=(0,x.jsx)(C,{render:m,children:n}),t[5]=n,t[6]=m,t[7]=g):g=t[7];let _;t[8]===a?_=t[9]:(_=(0,x.jsx)(w,{children:a}),t[8]=a,t[9]=_);let v;return t[10]!==d||t[11]!==f||t[12]!==g||t[13]!==_?(v=(0,x.jsxs)(S,{open:d,onOpenChange:f,children:[g,_]}),t[10]=d,t[11]=f,t[12]=g,t[13]=_,t[14]=v):v=t[14],v}function O(e){let t=(0,y.c)(12),{full:n,labelRef:r,render:i,children:a}=e,[o,s]=(0,h.useState)(!1),c;t[0]===r?c=t[1]:(c=e=>s(e&&T(r.current)),t[0]=r,t[1]=c);let l;t[2]!==a||t[3]!==i?(l=(0,x.jsx)(C,{render:i,children:a}),t[2]=a,t[3]=i,t[4]=l):l=t[4];let u;t[5]===n?u=t[6]:(u=(0,x.jsx)(w,{children:n}),t[5]=n,t[6]=u);let d;return t[7]!==o||t[8]!==c||t[9]!==l||t[10]!==u?(d=(0,x.jsxs)(S,{open:o,onOpenChange:c,children:[l,u]}),t[7]=o,t[8]=c,t[9]=l,t[10]=u,t[11]=d):d=t[11],d}export{C as a,w as i,O as n,b as o,S as r,D as t};
2
+ //# sourceMappingURL=ClippedText-CIorIVl7.js.map
@@ -0,0 +1,2 @@
1
+ import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{Al as i,Dl as a,Jo as o,au as s,l as c,mr as l,t as u}from"./utils-CtzgibkN.js";import{Cn as d,Fc as f,Oa as p,da as m,fh as h,ua as g,xn as _}from"./src-aYUfWMsw.js";import{Dr as v,Sr as y}from"./runtime-DciS6GP9.js";import{C as b,S as x,f as ee,k as te,q as S}from"./useSettings-CnHpxSBo.js";import{f as C}from"./server-DKB_3xTN.js";import{i as w,n as ne}from"./session-D_OiLzln.js";import{n as re}from"./query-DmYgeaGK.js";import{t as T}from"./use-atom-command-Bfi4daMj.js";import{n as E,t as D}from"./radio-group-YcYZQjQu.js";import{t as ie}from"./input-BwujRX3Y.js";import{a as O,c as k,i as A,r as j,s as M,t as ae}from"./dialog-BJ3R7bWN.js";import{S as N}from"./Icons-CnCqDzcX.js";import{t as P}from"./preview-eatXH_DC.js";import{S as F,t as oe}from"./ChatGptUsageButton-xIp-6pmC.js";import{t as I}from"./RedactedSensitiveText-DCu9USVF.js";import{a as se}from"./settingsLayout-EWRSNE9F.js";import{Do as L,Eo as ce,Mo as le,Oo as ue,Ra as de,jo as fe,ko as R,za as pe}from"./main-D8lKEPYS.js";var z=e(t(),1),B=n(),V=e(r(),1);function me(e){let t=(0,B.c)(7),n,r;t[0]===e?(n=t[1],r=t[2]):({children:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,V.jsx)(N,{className:`size-4 shrink-0`,"aria-hidden":`true`}),t[3]=i):i=t[3];let a=n??`Continue with ChatGPT`,o;return t[4]!==r||t[5]!==a?(o=(0,V.jsxs)(l,{...r,children:[i,a]}),t[4]=r,t[5]=a,t[6]=o):o=t[6],o}function he(e){let t=(0,B.c)(23),{open:n,methods:r,onClose:i,onSelect:a}=e,o=r.filter(_e),[s,c]=(0,z.useState)(null),l=s===`chatgpt-change-account`?s:o.find(e=>e.id===s)?.id??o[0]?.id??`chatgpt-change-account`,u=ae,d;t[0]===i?d=t[1]:(d=e=>{e||i()},t[0]=i,t[1]=d);let f=M,p;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,V.jsxs)(O,{children:[(0,V.jsx)(k,{children:`Reconnect ChatGPT`}),(0,V.jsx)(j,{children:`On OpenAI, sign in with the account you choose here.`})]}),t[2]=p):p=t[2];let m=E,h;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(h=e=>c(e),t[3]=h):h=t[3];let g=o.map(ge),_;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,V.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3 rounded-lg border px-3 py-3 text-sm`,children:[(0,V.jsx)(D,{value:`chatgpt-change-account`}),(0,V.jsx)(`span`,{className:`font-medium`,children:`Use a different account`})]}),t[4]=_):_=t[4];let v;t[5]!==m||t[6]!==l||t[7]!==h||t[8]!==g?(v=(0,V.jsx)(`div`,{className:`px-6 pb-6`,children:(0,V.jsxs)(m,{"aria-label":`ChatGPT account to connect`,value:l,onValueChange:h,children:[g,_]})}),t[5]=m,t[6]=l,t[7]=h,t[8]=g,t[9]=v):v=t[9];let y;t[10]!==a||t[11]!==l?(y=(0,V.jsx)(A,{children:(0,V.jsx)(me,{onClick:()=>a(l)})}),t[10]=a,t[11]=l,t[12]=y):y=t[12];let b;t[13]!==f||t[14]!==p||t[15]!==v||t[16]!==y?(b=(0,V.jsxs)(f,{children:[p,v,y]}),t[13]=f,t[14]=p,t[15]=v,t[16]=y,t[17]=b):b=t[17];let x;return t[18]!==u||t[19]!==n||t[20]!==d||t[21]!==b?(x=(0,V.jsx)(u,{open:n,onOpenChange:d,children:b}),t[18]=u,t[19]=n,t[20]=d,t[21]=b,t[22]=x):x=t[22],x}function ge(e){return(0,V.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3 rounded-lg border px-3 py-3 text-sm`,children:[(0,V.jsx)(D,{value:e.id}),(0,V.jsx)(`span`,{className:`min-w-0 break-all font-medium`,children:e.name})]},e.id)}function _e(e){return e.id.startsWith(`chatgpt-profile:`)}function ve(e){let t=(0,B.c)(58),{environmentId:n,onClose:r,renderSetup:i,onAccountCreated:a}=e,s=w(n,p),u=ee(n),d;t[0]===n?d=t[1]:(d=C.providersValueAtom(n),t[0]=n,t[1]=d);let f=o(d),h=T(C.updateSettings,`Add ChatGPT account`),[_,v]=(0,z.useState)(`Personal`),y;t[2]===_?y=t[3]:(y=_.trim(),t[2]=_,t[3]=y);let b=`ChatGPT - ${y}`,[x,te]=(0,z.useState)(null),[S,re]=(0,z.useState)(!1),E,D,O,k,A,j,M,N,P;if(t[4]!==b||t[5]!==n||t[6]!==x||t[7]!==_||t[8]!==a||t[9]!==r||t[10]!==S||t[11]!==f||t[12]!==i||t[13]!==u||t[14]!==h){let e=f?.find(e=>e.instanceId===x),o=F(e),s;t[24]!==b||t[25]!==n||t[26]!==_||t[27]!==a||t[28]!==r||t[29]!==S||t[30]!==u||t[31]!==h?(s=async()=>{if(S||!_.trim()||!ne(n,`providers:manage`))return;re(!0);let e=m.make(`codex_${c()}`);(await h({environmentId:n,input:{patch:{providerInstances:{...u.providerInstances,[e]:{driver:g.make(`codex`),displayName:b,enabled:!0,config:{enabled:!0,setupMode:`managed`}}}}}}))._tag===`Success`&&(a?(a(e,b),r()):te(e)),re(!1)},t[24]=b,t[25]=n,t[26]=_,t[27]=a,t[28]=r,t[29]=S,t[30]=u,t[31]=h,t[32]=s):s=t[32];let l=s;O=ae,M=!o,t[33]===r?N=t[34]:(N=e=>{e||r()},t[33]=r,t[34]=N),P=e=>{!e&&o&&r()},D=R,A=`wide`;let d=x?b:`Add ChatGPT account`;t[35]===d?j=t[36]:(j=(0,V.jsx)(L,{title:d,description:`Each account has its own Codex instance and sign-in. Choose the other account on the sign-in page.`}),t[35]=d,t[36]=j),E=ue,k=x?e?.setup?i(x,e):(0,V.jsx)(se,{title:`Codex runtime`,description:`Preparing managed setup.`}):(0,V.jsx)(`form`,{id:`add-codex-account`,onSubmit:e=>{e.preventDefault(),l()},children:(0,V.jsx)(se,{title:`Account name`,description:`Shown in the provider list and model picker.`,control:(0,V.jsx)(ie,{"aria-label":`Account name`,value:_,disabled:S,onChange:e=>v(e.target.value),placeholder:`e.g. Personal or Work`})})}),t[4]=b,t[5]=n,t[6]=x,t[7]=_,t[8]=a,t[9]=r,t[10]=S,t[11]=f,t[12]=i,t[13]=u,t[14]=h,t[15]=E,t[16]=D,t[17]=O,t[18]=k,t[19]=A,t[20]=j,t[21]=M,t[22]=N,t[23]=P}else E=t[15],D=t[16],O=t[17],k=t[18],A=t[19],j=t[20],M=t[21],N=t[22],P=t[23];let oe;t[37]!==E||t[38]!==k?(oe=(0,V.jsx)(E,{children:k}),t[37]=E,t[38]=k,t[39]=oe):oe=t[39];let I;t[40]!==s||t[41]!==x||t[42]!==_||t[43]!==r||t[44]!==S?(I=(0,V.jsx)(ce,{children:x?(0,V.jsx)(l,{variant:`outline`,onClick:r,children:`Finish later`}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(l,{variant:`outline`,disabled:S,onClick:r,children:`Cancel`}),(0,V.jsx)(l,{type:`submit`,form:`add-codex-account`,disabled:S||!_.trim()||!s,children:S?`Adding account…`:`Continue`})]})}),t[40]=s,t[41]=x,t[42]=_,t[43]=r,t[44]=S,t[45]=I):I=t[45];let le;t[46]!==D||t[47]!==I||t[48]!==A||t[49]!==j||t[50]!==oe?(le=(0,V.jsxs)(D,{size:A,children:[j,oe,I]}),t[46]=D,t[47]=I,t[48]=A,t[49]=j,t[50]=oe,t[51]=le):le=t[51];let de;return t[52]!==O||t[53]!==le||t[54]!==M||t[55]!==N||t[56]!==P?(de=(0,V.jsx)(O,{open:M,onOpenChange:N,onOpenChangeComplete:P,children:le}),t[52]=O,t[53]=le,t[54]=M,t[55]=N,t[56]=P,t[57]=de):de=t[57],de}var ye=f(_),be=f(d),xe=/^[A-Za-z0-9_./:\\-]+$/;function Se(e,t,n){return xe.test(e)&&(n===`windows`||!e.includes(`\\`))?e:n===`windows`?`& '${e.replaceAll(`'`,`''`)}'`:n===`darwin`||n===`linux`?e.startsWith(`~/`)||e.startsWith(`~\\`)?`~/'${e.slice(2).replaceAll(`'`,`'"'"'`)}'`:`'${e.replaceAll(`'`,`'"'"'`)}'`:t}function Ce(e){return e===void 0?`checking`:!e.enabled||e.status===`disabled`?`disabled`:!e.installed&&e.status===`warning`&&e.auth.status===`unknown`?`checking`:e.installed?e.auth.status===`unauthenticated`?`signIn`:e.status===`ready`?`ready`:`attention`:`install`}var H={checking:0,disabled:1,install:2,attention:3,signIn:4,ready:5};function U(e){let t=new Map;for(let n of e??[]){let e=t.get(n.driver);(e===void 0||H[Ce(n)]>H[Ce(e)])&&t.set(n.driver,n)}return t}var we={claudeAgent:{windows:`irm https://claude.ai/install.ps1 | iex`,posix:`curl -fsSL https://claude.ai/install.sh | bash`},codex:{windows:`irm https://chatgpt.com/codex/install.ps1 | iex`,posix:`curl -fsSL https://chatgpt.com/codex/install.sh | sh`}};function Te(e,t){let n=we[e];return t===`windows`?n.windows:n.posix}function Ee(e,t,n){let r=t.providerInstances[e.instanceId];if(e.driver===`claudeAgent`){let e=ye(r?.config??{});return`${Se(h(e)?e.value.binaryPath:`claude`,`claude`,n)} auth login`}if(e.driver===`codex`){let e=be(r?.config??{});return`${Se(h(e)?e.value.binaryPath:`codex`,`codex`,n)} login`}return e.driver}var De={disabled:{dot:`bg-muted-foreground/50`},error:{dot:`bg-destructive`},ready:{dot:`bg-success`},warning:{dot:`bg-warning`}};function W(e){if(!e)return{headline:`Checking provider status`,detail:`Waiting for the server to report installation and authentication details.`};if(!e.enabled||e.status===`disabled`)return{headline:`Disabled`,detail:e.message??`This provider is installed but disabled for new sessions in P4 Code.`};if(!e.installed)return{headline:`Not found`,detail:e.message??`CLI not detected on PATH.`};if(e.auth.status===`unauthenticated`){let t=e.auth.label??e.auth.type;return{headline:t?`Not authenticated · ${t}`:`Not authenticated`,detail:e.message??null}}if(e.status===`warning`)return{headline:`Needs attention`,detail:e.message??`The provider is installed, but the server could not fully verify it.`};if(e.status===`error`)return{headline:`Unavailable`,detail:e.message??`The provider failed its startup checks.`};if(e.auth.status===`authenticated`){let t=e.auth.label??e.auth.type;return{headline:t?`Authenticated · ${t}`:`Authenticated`,detail:e.message??null}}return{headline:`Available`,detail:e.message??null}}function Oe(e){if(!e)return null;let t=/^agy_acp_server_(\d{4})(\d{2})(\d{2})_\d+(?:_(\w+))?$/.exec(e);if(t){let[,e,n,r,i]=t;return`${e}-${n}-${r}${i?` ${i}`:``}`}return/^\d/.test(e)?`v${e}`:e}var ke={graceful:`Limited support`,unsupported:`Unsupported version`,broken:`Known broken version`};function Ae(e,t,n=!0){let r=t?.latestVersionStatus===`broken`||t?.latestVersionStatus===`unsupported`;if(n&&t&&(t.status===`graceful`||t.status===`unsupported`||t.status===`broken`)){let n=t.recommendedVersion,i=Oe(n)??t.recommendedRange;return{title:ke[t.status],detail:t.message??(i?`Use ${i} for full support.`:`Update for full support.`),updateCommand:n||r?null:e?.updateCommand??null,emphasis:t.status===`graceful`?`normal`:`strong`,targetVersion:n}}if(!e||e.status===`current`||e.status===`unknown`||r)return null;let i=`Update available`,a=e.latestVersion,o=Oe(a);return{title:i,detail:e.message??(o?`${i}: install ${o}.`:`${i}: install the latest provider version.`),updateCommand:e.updateCommand,emphasis:`normal`,targetVersion:null}}var je=()=>void 0;function Me(e){let t=(0,B.c)(11),[n,r]=(0,z.useState)(!1),i;t[0]===e.provider?i=t[1]:(i=Ce(e.provider),t[0]=e.provider,t[1]=i);let o=i,s=e.enabled&&o===`ready`,c=e.provider?.auth.status===`authenticated`,u=o===`checking`,d;t[2]===e.provider?d=t[3]:(d=W(e.provider),t[2]=e.provider,t[3]=d);let f=d,p;return t[4]!==c||t[5]!==u||t[6]!==s||t[7]!==f||t[8]!==e||t[9]!==n?(p=e.mode===`existing`&&e.presentation===`onboarding`?(0,V.jsx)(Ie,{title:e.displayName||e.provider?.displayName||`Codex`,description:s?e.provider?.auth.email?.trim()?(0,V.jsxs)(V.Fragment,{children:[`Signed in as`,` `,(0,V.jsx)(I,{value:e.provider.auth.email.trim(),ariaLabel:`Toggle account email visibility`,revealTooltip:`Click to reveal email`,hideTooltip:`Click to hide email`,className:`break-all`}),`.`]}):`Connected with your Codex CLI.`:u?`Checking your Codex CLI...`:e.provider?.installed?f.headline:`Code with your ChatGPT subscription.`,control:s?(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-xs font-medium text-success-foreground`,children:[(0,V.jsx)(a,{className:`size-3.5`}),`Ready`]}):u?(0,V.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Checking...`}):c?(0,V.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:f.headline}):(0,V.jsx)(me,{size:`sm`,disabled:e.readOnly,onClick:()=>{r(!0),e.onModeChange(`managed`)},children:`Continue with ChatGPT`}),secondaryControl:!c&&!s&&!u?(0,V.jsx)(l,{size:`sm`,variant:`ghost-muted`,onClick:()=>e.onModeChange(`existing`),children:`Use existing CLI`}):null}):e.mode===`existing`?null:e.provider?.setup===void 0?e.presentation===`onboarding`?(0,V.jsx)(Ie,{title:e.displayName||e.provider?.displayName||`Codex`,description:(0,V.jsx)(Fe,{}),control:(0,V.jsx)(l,{size:`sm`,variant:`outline`,className:`min-w-44`,disabled:!0,children:`Open sign-in page`}),secondaryControl:(0,V.jsx)(l,{size:`sm`,variant:`ghost-muted`,disabled:!0,children:`Cancel`})}):(0,V.jsx)(se,{title:`ChatGPT account`,description:`Preparing sign-in.`}):(0,V.jsx)(Pe,{...e,autoStart:n||e.autoStart===!0,onAutoStartConsumed:()=>{r(!1),e.onAutoStartConsumed?.()}},`${e.environmentId}:${e.instanceId}`),t[4]=c,t[5]=u,t[6]=s,t[7]=f,t[8]=e,t[9]=n,t[10]=p):p=t[10],p}function Ne(e){let t=(0,B.c)(9),{environmentId:n,onClose:r,onAccountCreated:i}=e,a=w(n,p),o;t[0]!==a||t[1]!==n||t[2]!==r?(o=(e,t)=>(0,V.jsx)(Pe,{environmentId:n,instanceId:e,provider:t,mode:`managed`,enabled:!0,readOnly:!a,autoStart:!0,onAutoStartConsumed:je,onModeChange:je,onSignInCancelled:r,allowExistingCli:!1},e),t[0]=a,t[1]=n,t[2]=r,t[3]=o):o=t[3];let s;return t[4]!==n||t[5]!==i||t[6]!==r||t[7]!==o?(s=(0,V.jsx)(ve,{environmentId:n,onClose:r,onAccountCreated:i,renderSetup:o}),t[4]=n,t[5]=i,t[6]=r,t[7]=o,t[8]=s):s=t[8],s}function Pe({environmentId:e,instanceId:t,provider:n,enabled:r,readOnly:i,onModeChange:o,autoStart:c,onAutoStartConsumed:d,allowExistingCli:f=!0,presentation:p,displayName:m,onSignInCancelled:h}){let g={environmentId:e,input:{instanceId:t}},_=re(C.providerAuthState(g)),ee=re(C.providerInstallState(g)),[w,ne]=(0,z.useState)(null),E=re(w?C.chatGptHandoffState(w):null),D=E.data?.phase===`auth`?E.data.state:_.data,[O,k]=(0,z.useState)(!1),[A,j]=(0,z.useState)(`chatgpt`),M=D?.methods?.find(e=>e.id===`chatgpt`)?.accountEmail,ae=D?.methods?.find(e=>e.id===A)?.accountEmail,N=D?.methods?.some(e=>e.id.startsWith(`chatgpt-profile:`)),F=D?.interaction?.type===`browser`?D.interaction.url:D?.authorizationUrl,L=ee.data,ce=b(e),ue=ce!==null&&P(new URL(ce).hostname),R={reportFailure:!1,reportDefect:!1},B=T(C.startProviderAuth,R),ge=T(C.refreshProviders,R),_e=T(C.completeProviderAuth,R),ve=T(C.cancelProviderAuth,R),ye=T(C.logoutProviderAuth,R),be=T(C.startProviderInstall,R),xe=T(C.cancelProviderInstall,R),Se=T(C.chatGptReconnectProfile,R),Ce=T(C.chatGptImportProfile,R),H=!w&&(!ue||window.desktopBridge?.receiveProviderAuthCallback!==void 0),U=H&&!window.desktopBridge?.receiveProviderAuthCallback,we=te(),Te=x(we),Ee=b(we),De=!ue&&we&&Te?.connection.phase===`connected`&&Ee&&P(new URL(Ee).hostname)&&(window.desktopBridge!==void 0||P(window.location.hostname))?we:null,W=new URL(window.location.href);W.pathname===`/welcome`&&(W.hash=`agents:${e}`),W.pathname===`/settings/providers`&&W.searchParams.set(`instanceId`,t);let Oe=U,ke=(0,z.useId)(),[Ae,je]=(0,z.useState)(!1),[Me,Ne]=(0,z.useState)({flowId:``,value:``}),Pe=Me.flowId===D?.flowId?Me.value:``,[G,Le]=(0,z.useState)(!1),[Re,ze]=(0,z.useState)(null),Be=(0,z.useRef)(!1),[Ve,He]=(0,z.useState)(null),K=(0,z.useRef)(null),Ue=(0,z.useRef)(!1),We=(0,z.useRef)(null),[Ge,Ke]=(0,z.useState)(!1),q=L?.installedVersion!=null,J=n?.auth.status===`authenticated`,qe=q&&L?.source!==`local`&&L?.version!=null&&L.version!==L.installedVersion,Je=Re!==null&&!J&&(D?.phase===`succeeded`||Re===`handoff`);(0,z.useEffect)(()=>{(J||D?.phase===`failed`||D?.phase===`cancelled`)&&ze(null)},[J,D?.phase]),(0,z.useEffect)(()=>{Re&&D?.phase===`succeeded`&&ge({environmentId:e,input:{instanceId:t}})},[Re,D?.phase,ge,e,t]);let Ye=c&&!Ge,Xe=Re===`sign-in`&&!J&&(D===null||D.phase===`idle`),Ze=Je||Xe||w!==null||D?.phase===`starting`||D?.phase===`waiting`||D?.phase===`verifying`,Y=L?.phase===`downloading`||L?.phase===`extracting`||L?.phase===`verifying`,X=Ye||Ze||G&&!Y,Z=i||!r||G||_.error!==null||ee.error!==null,Q=G||Ze||Y,$=(0,z.useCallback)(async(e,t)=>{if(Be.current)return!1;Be.current=!0,Le(!0),He(null);let n=!1;try{let r=await e();if(r._tag===`Failure`){if(!y(r)){let e=v(r);He(e instanceof Error?e.message:`Codex setup failed. Try again.`)}}else n=!0,t?.(r.value)}catch{He(`Codex setup failed. Try again.`)}return Be.current=!1,Le(!1),n},[]),Qe=(0,z.useId)(),$e=(0,z.useRef)(0),et=(0,z.useRef)(null),[tt,nt]=(0,z.useState)(!1),rt=(0,z.useCallback)(async n=>{let r=await $(()=>Ce({environmentId:e,input:{instanceId:t,profile:n}}));r&&(ze(`handoff`),ne(null)),nt(!r)},[$,Ce,e,t]);(0,z.useEffect)(()=>{if(!w||E.data?.phase!==`finished`)return;let e=w.input.attemptId;et.current!==e&&(et.current=e,rt(E.data.profile))},[w,E.data,rt]),(0,z.useEffect)(()=>{w&&(E.error||E.data?.phase===`auth`&&[`failed`,`cancelled`].includes(E.data.state.phase))&&(He(E.data?.phase===`auth`?E.data.state.message??`ChatGPT sign-in could not finish. Try again.`:`ChatGPT sign-in on the primary environment was interrupted. Try again.`),ne(null))},[w,E.data,E.error]);let it=(0,z.useCallback)(()=>(ze(null),w?(ne(null),Promise.resolve()):$(()=>ve({environmentId:e,input:{instanceId:t,flowId:D.flowId}}))),[w,$,ve,e,t,D]),at=(0,z.useCallback)(async(n=`chatgpt`)=>{if(Be.current)return;Ue.current=!0,nt(!1),j(n);let r=new URL(window.location.href);if(r.pathname===`/welcome`&&(r.hash=`agents:${e}`),r.pathname===`/settings/providers`&&r.searchParams.set(`instanceId`,t),De){let i=`${Qe}:${++$e.current}`;await $(()=>Se({environmentId:e,input:{instanceId:t,methodId:n}}),n=>ne({environmentId:De,input:{instanceId:t,environmentId:e,attemptId:i,returnUrl:r.toString(),profile:n}}))||(Ue.current=!1)}else await $(()=>B({environmentId:e,input:{instanceId:t,methodId:n,returnUrl:r.toString(),callbackMode:H?`client`:`server`}}),()=>ze(`sign-in`))||(Ue.current=!1)},[e,t,$,B,H,De,Se,Qe]),ot=(0,z.useCallback)(async(n=`chatgpt`)=>{Z||Q||(q&&!qe?await at(n):(K.current=n,await $(()=>be({environmentId:e,input:{instanceId:t}}))||(K.current=null)))},[Z,Q,q,qe,at,$,be,e,t]);(0,z.useEffect)(()=>{!c||Ge||Z||Q||L===null||!n?.setup?.canInstall||(Ke(!0),d(),ot())},[c,Ge,Z,Q,L,n?.setup?.canInstall,d,ot]),(0,z.useEffect)(()=>{if(!(!K.current||G||Y)){if(L?.phase===`failed`||L?.phase===`cancelled`)K.current=null;else if(q){let e=K.current;K.current=null,at(e)}}},[G,Y,L?.phase,q,at]);let st=(0,z.useRef)(null),ct=D?.flowId,lt=(0,z.useCallback)(async n=>{try{let r=window.desktopBridge?.receiveProviderAuthCallback;if(r&&H&&ct){if(st.current===n){await S().shell.openExternal(n);return}st.current=n;let i=await r(n);if(st.current!==n)return;st.current=null,await $(()=>_e({environmentId:e,input:{instanceId:t,flowId:ct,callbackUrl:i}}))}else await S().shell.openExternal(n)}catch{He(`Could not finish sign-in on this computer. Try again or paste the redirect URL below.`)}},[H,ct,$,_e,e,t]);(0,z.useEffect)(()=>{if(H&&F&&window.desktopBridge?.cancelProviderAuthCallback)return()=>{st.current===F&&(st.current=null),window.desktopBridge?.cancelProviderAuthCallback?.(F).catch(()=>void 0)}},[H,F]),(0,z.useEffect)(()=>{Ue.current&&D?.phase===`waiting`&&D.flowId&&F&&We.current!==D.flowId&&(We.current=D.flowId,Ue.current=!1,U||lt(F))},[D?.phase,D?.flowId,F,lt,U]);let ut=L?.phase===`downloading`?`Downloading ${(L.downloadedBytes/1e6).toFixed(1)}${L.totalBytes===null?``:` of ${(L.totalBytes/1e6).toFixed(1)}`} MB.`:L?.phase===`extracting`?`Installing Codex.`:L?.phase===`verifying`?`Checking Codex.`:q?`${L?.source===`local`?`Using your installed Codex`:`Managed by P4 Code`}${L?.installedVersion?` · v${L.installedVersion}`:``}.`:L?.message??`P4 Code downloads and manages Codex for you.`,dt=Je?`Finishing sign-in...`:Y?ut:X||D?.phase===`failed`||D?.phase===`cancelled`?D?.phase===`waiting`&&ae?`Continue as ${ae} on OpenAI.`:D?.message??`Finish signing in in your browser.`:J?n?.auth.email?.trim()?(0,V.jsxs)(V.Fragment,{children:[`Signed in as`,` `,(0,V.jsx)(I,{value:n.auth.email.trim(),ariaLabel:`Toggle account email visibility`,revealTooltip:`Click to reveal email`,hideTooltip:`Click to hide email`}),`.`]}):`Signed in with ChatGPT.`:M??`Use your ChatGPT subscription.`,ft=Oe&&F&&D?.flowId&&pe(W.toString())?de({authorizationUrl:F,returnUrl:W.toString(),environmentId:e,instanceId:t,flowId:D.flowId},!1):null,pt=(0,V.jsx)(l,{size:`sm`,variant:U?`default`:`outline`,className:p===`onboarding`?`min-w-44`:void 0,disabled:E.data?.phase===`finished`?G||!tt:!F||D?.phase!==`waiting`,onClick:()=>{E.data?.phase===`finished`?rt(E.data.profile):F&&lt(F)},children:Je?`Finishing sign-in...`:E.data?.phase===`finished`?tt?`Retry connection`:`Finishing sign-in...`:D?.phase===`waiting`?U?`Open ChatGPT sign-in`:`Open sign-in page`:p===`onboarding`?`Open sign-in page`:`Signing in...`}),mt=!w&&D?.phase===`waiting`&&F?(0,V.jsxs)(`div`,{className:`flex w-full flex-col gap-3 text-xs leading-relaxed text-muted-foreground`,children:[(0,V.jsx)(`p`,{children:`If sign-in doesn't return to P4 Code, paste the URL from the final localhost page.`}),(0,V.jsxs)(`form`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center`,onSubmit:n=>{if(n.preventDefault(),!D.flowId||!Pe.trim())return;let r=Pe.trim(),i=D.flowId;$(()=>_e({environmentId:e,input:{instanceId:t,flowId:i,callbackUrl:r}})).then(e=>{e&&Ne({flowId:i,value:``})})},children:[(0,V.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,V.jsx)(ie,{"aria-label":`ChatGPT sign-in redirect URL`,type:`password`,autoComplete:`off`,placeholder:`Paste the URL from the sign-in tab`,value:Pe,maxLength:16384,disabled:G||i,onChange:e=>Ne({flowId:D.flowId??``,value:e.target.value})})}),(0,V.jsx)(l,{variant:`outline`,type:`submit`,disabled:G||i||!Pe.trim(),children:`Connect`})]}),U?null:(0,V.jsx)(`div`,{children:(0,V.jsxs)(l,{size:`xs`,variant:`ghost-muted`,onClick:()=>void S().shell.openExternal(F),children:[`Try sign-in in your browser`,(0,V.jsx)(s,{className:`size-3.5`})]})}),ft?(0,V.jsxs)(`details`,{children:[(0,V.jsx)(`summary`,{className:`cursor-pointer`,children:`Other ways to connect`}),(0,V.jsx)(l,{className:`mt-2`,size:`sm`,variant:`outline`,render:(0,V.jsx)(`a`,{href:ft}),children:`Use P4 Code desktop for automatic return`})]}):null]}):null,ht=e=>mt?(0,V.jsx)(fe,{open:Ae,children:(0,V.jsx)(le,{children:(0,V.jsx)(`div`,{id:ke,className:u(`w-full border-t border-border/50 pt-3`,e),children:mt})})}):null,gt=Oe?mt:mt?(0,V.jsxs)(`div`,{className:`text-xs leading-relaxed text-muted-foreground`,children:[(0,V.jsx)(Fe,{label:`Having trouble signing in?`,expanded:Ae,controls:ke,onToggle:()=>je(e=>!e)}),ht(`mt-3`)]}):null,_t=(0,V.jsx)(he,{open:O,methods:D?.methods??[],onClose:()=>k(!1),onSelect:e=>{k(!1),ot(D?.methods?.some(t=>t.id===e)?e:`chatgpt-change-account`)}}),vt=D?.phase===`idle`&&D.message?.startsWith(`Signed out locally.`)?D.message:null;if(p===`onboarding`){let r=vt??Ve??(_.error||ee.error?`Could not read setup status. Reconnect and try again.`:L?.phase===`failed`?L.message:null);return(0,V.jsxs)(V.Fragment,{children:[_t,(0,V.jsxs)(Ie,{title:m||n?.displayName||`Codex`,description:Y?ut:J?n?.auth.email?.trim()?(0,V.jsxs)(V.Fragment,{children:[`Signed in as`,` `,(0,V.jsx)(I,{value:n.auth.email.trim(),ariaLabel:`Toggle account email visibility`,revealTooltip:`Click to reveal email`,hideTooltip:`Click to hide email`,className:`break-all`}),`.`]}):`Connected to ChatGPT.`:mt&&!Oe?(0,V.jsx)(Fe,{expanded:Ae,controls:ke,onToggle:()=>je(e=>!e)}):Ye||Xe||D?.phase===`starting`||D?.phase===`waiting`||G&&!Y?(0,V.jsx)(Fe,{}):X||D?.phase===`failed`||D?.phase===`cancelled`?dt:`Code with your ChatGPT subscription.`,control:J&&!Q?(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-xs font-medium text-success-foreground`,children:[(0,V.jsx)(a,{className:`size-3.5`}),`Ready`]}):X?pt:(0,V.jsx)(me,{size:`sm`,disabled:Z||Q||(q?!n?.setup?.canAuthenticate:!n?.setup?.canInstall),onClick:()=>{N?k(!0):ot()},children:Y||G?`Setting up...`:N?`Reconnect account`:`Continue with ChatGPT`}),secondaryControl:X&&!Je||Y?(0,V.jsx)(l,{size:`sm`,variant:`ghost-muted`,disabled:G||i,onClick:()=>{Ue.current=!1,K.current=null,w||X&&D?.flowId?it():L?.operationId&&$(()=>xe({environmentId:e,input:{instanceId:t,operationId:L.operationId}}))},children:`Cancel`}):!X&&!J&&N?(0,V.jsx)(l,{size:`sm`,variant:`ghost-muted`,disabled:Z||Q,onClick:()=>void ot(`chatgpt-change-account`),children:`Use a different account`}):!X&&!J&&f?(0,V.jsx)(l,{size:`sm`,variant:`ghost-muted`,disabled:i||Q,onClick:()=>o(`existing`),children:`Use existing CLI`}):null,children:[Oe?gt:ht(),r?(0,V.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:r}):null]})]})}return(0,V.jsxs)(`section`,{"aria-label":`Codex setup`,className:`divide-y divide-border/50`,children:[_t,(0,V.jsx)(se,{title:`ChatGPT account`,description:dt,control:(0,V.jsx)(`div`,{className:`flex max-w-88 flex-wrap items-center justify-end gap-2`,children:X?(0,V.jsxs)(V.Fragment,{children:[pt,!Je&&(0,V.jsx)(l,{size:`sm`,variant:`ghost`,disabled:G||i,onClick:()=>{(w||D?.flowId)&&(Ue.current=!1,it(),h?.())},children:`Cancel`})]}):Y?(0,V.jsx)(l,{size:`sm`,variant:`ghost`,disabled:G||i,onClick:()=>{L?.operationId&&(K.current=null,$(()=>xe({environmentId:e,input:{instanceId:t,operationId:L.operationId}})))},children:`Cancel`}):J?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(l,{size:`sm`,variant:`outline`,disabled:Z||Q,onClick:()=>k(!0),children:`Change account`}),(0,V.jsx)(l,{size:`sm`,variant:`ghost`,disabled:Z||Q,onClick:()=>void $(()=>ye(g)),children:`Disconnect`})]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(me,{size:`sm`,disabled:Z||Q||(q?!n?.setup?.canAuthenticate:!n?.setup?.canInstall),onClick:()=>{N?k(!0):ot()},children:G?`Setting up...`:N?`Reconnect account`:`Continue with ChatGPT`}),N?(0,V.jsx)(l,{size:`sm`,variant:`ghost`,disabled:Z||Q,onClick:()=>void ot(`chatgpt-change-account`),children:`Use a different account`}):null,f?(0,V.jsx)(l,{size:`sm`,variant:`ghost`,disabled:i||Q,onClick:()=>o(`existing`),children:`Use existing CLI`}):null]})})}),J?(0,V.jsx)(`div`,{className:`flex justify-end px-3 py-1 sm:px-4`,children:(0,V.jsx)(oe,{})}):null,vt?(0,V.jsx)(`p`,{role:`alert`,className:`px-3 py-2 text-xs text-muted-foreground sm:px-4`,children:vt}):null,gt?(0,V.jsx)(`div`,{className:`px-3 py-3 sm:px-4`,children:gt}):null,Ve||_.error||ee.error||L?.phase===`failed`?(0,V.jsx)(`p`,{role:`alert`,className:`px-3 py-2 text-xs text-destructive sm:px-4`,children:Ve??(L?.phase===`failed`?L.message:`Could not read Codex setup status. Reconnect and try again.`)}):null]})}function G(e){let t=(0,B.c)(20),{environmentId:n,instanceId:r,provider:i}=e,a;t[0]!==n||t[1]!==r?(a=C.providerInstallState({environmentId:n,input:{instanceId:r}}),t[0]=n,t[1]=r,t[2]=a):a=t[2];let o=re(a),s=o.data?.executablePath??``,c=o.error?`Could not read runtime path`:`Not installed`,l;t[3]!==s||t[4]!==c?(l=(0,V.jsx)(se,{title:`Binary path`,description:`Selected by P4 Code.`,control:(0,V.jsx)(`div`,{className:`w-full sm:w-80`,children:(0,V.jsx)(ie,{"aria-label":`Codex binary path`,value:s,title:s,placeholder:c,disabled:!0})})}),t[3]=s,t[4]=c,t[5]=l):l=t[5];let u=i?.runtimePaths?.homePath??``,d=i?.runtimePaths?.homePath,f;t[6]!==u||t[7]!==d?(f=(0,V.jsx)(se,{title:`CODEX_HOME path`,description:`Shared Codex config, sessions, and state.`,control:(0,V.jsx)(`div`,{className:`w-full sm:w-80`,children:(0,V.jsx)(ie,{"aria-label":`Codex home path`,value:u,title:d,placeholder:`Unavailable`,disabled:!0})})}),t[6]=u,t[7]=d,t[8]=f):f=t[8];let p=i?.runtimePaths?.shadowHomePath?`Account-specific home sharing the Codex state above.`:`This instance uses the shared Codex home directly.`,m=i?.runtimePaths?.shadowHomePath??``,h=i?.runtimePaths?.shadowHomePath??void 0,g=i?.runtimePaths?`Not used`:`Unavailable`,_;t[9]!==g||t[10]!==m||t[11]!==h?(_=(0,V.jsx)(`div`,{className:`w-full sm:w-80`,children:(0,V.jsx)(ie,{"aria-label":`Codex shadow home path`,value:m,title:h,placeholder:g,disabled:!0})}),t[9]=g,t[10]=m,t[11]=h,t[12]=_):_=t[12];let v;t[13]!==_||t[14]!==p?(v=(0,V.jsx)(se,{title:`Shadow home path`,description:p,control:_}),t[13]=_,t[14]=p,t[15]=v):v=t[15];let y;return t[16]!==v||t[17]!==l||t[18]!==f?(y=(0,V.jsxs)(V.Fragment,{children:[l,f,v]}),t[16]=v,t[17]=l,t[18]=f,t[19]=y):y=t[19],y}function Fe(e){let t=(0,B.c)(10),{label:n,expanded:r,controls:a,onToggle:o}=e,s=n===void 0?`Complete sign-in in your browser.`:n,c=r!==void 0&&r;if(!o){let e;return t[0]===s?e=t[1]:(e=(0,V.jsx)(`div`,{className:`leading-relaxed`,children:s}),t[0]=s,t[1]=e),e}let l=`size-3 shrink-0 ${c?`rotate-90`:``}`,u;t[2]===l?u=t[3]:(u=(0,V.jsx)(i,{"aria-hidden":!0,className:l}),t[2]=l,t[3]=u);let d;return t[4]!==a||t[5]!==c||t[6]!==s||t[7]!==o||t[8]!==u?(d=(0,V.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1.5 rounded-sm text-left leading-relaxed outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,"aria-label":`Having trouble signing in?`,"aria-expanded":c,"aria-controls":a,onClick:o,children:[s,u]}),t[4]=a,t[5]=c,t[6]=s,t[7]=o,t[8]=u,t[9]=d):d=t[9],d}function Ie(e){let t=(0,B.c)(21),{title:n,description:r,control:i,secondaryControl:a,children:o}=e,s;t[0]===o?s=t[1]:(s=z.Children.toArray(o),t[0]=o,t[1]=s);let c=s,l;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,V.jsx)(N,{className:`size-5 shrink-0 fill-foreground`}),t[2]=l):l=t[2];let u;t[3]===n?u=t[4]:(u=(0,V.jsx)(`h3`,{className:`text-sm font-medium`,children:n}),t[3]=n,t[4]=u);let d;t[5]===r?d=t[6]:(d=(0,V.jsx)(`div`,{className:`mt-0.5 text-xs leading-relaxed text-muted-foreground`,children:r}),t[5]=r,t[6]=d);let f;t[7]!==u||t[8]!==d?(f=(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[u,d]}),t[7]=u,t[8]=d,t[9]=f):f=t[9];let p;t[10]!==i||t[11]!==a?(p=i||a?(0,V.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center justify-end gap-2 has-[button]:w-full has-[button]:flex-col-reverse has-[button]:items-end sm:has-[button]:w-auto sm:has-[button]:flex-row sm:has-[button]:items-center`,children:[a,i]}):null,t[10]=i,t[11]=a,t[12]=p):p=t[12];let m;t[13]!==f||t[14]!==p?(m=(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[l,f,p]}),t[13]=f,t[14]=p,t[15]=m):m=t[15];let h;t[16]===c?h=t[17]:(h=c.length>0?(0,V.jsx)(`div`,{className:`ml-8 mt-2 flex flex-wrap items-center gap-2`,children:c}):null,t[16]=c,t[17]=h);let g;return t[18]!==m||t[19]!==h?(g=(0,V.jsxs)(`div`,{className:`rounded-lg border border-border bg-background px-4 py-4`,children:[m,h]}),t[18]=m,t[19]=h,t[20]=g):g=t[20],g}function Le(e){return typeof e==`object`&&e&&`setupMode`in e&&e.setupMode===`managed`?`managed`:`existing`}export{De as a,Oe as c,Ee as d,U as f,Me as i,Ce as l,Ne as n,W as o,me as p,G as r,Ae as s,Le as t,Te as u};
2
+ //# sourceMappingURL=CodexSetupSection.logic-C7e1n48R.js.map
@@ -0,0 +1,2 @@
1
+ import{a as e,t}from"./react-BUfh6y28.js";import{t as n}from"./jsx-runtime-DJeoFXNw.js";import{Bn as r,Co as i,Da as a,Di as o,Dn as s,Ea as c,Er as ee,Fa as te,Fi as l,Fn as u,Fr as d,Gn as f,Hi as p,Hn as ne,Hr as m,Ia as h,Ii as g,In as _,Ir as v,Ki as y,La as b,Li as x,Ln as S,Ma as C,Mn as w,Na as re,Ni as T,Nr as E,Oi as D,On as ie,Or as ae,Pn as oe,Pr as O,Ra as se,Rn as ce,Rr as le,Sa as k,So as A,Sr as ue,Tn as de,To as j,Ua as M,Un as fe,Va as N,Vn as P,Wa as F,Wn as pe,Xa as I,Ya as me,Za as he,_a as ge,ao as _e,ba as L,ca as ve,ci as ye,co as be,do as xe,eo as Se,fo as Ce,ga as we,ja as R,jn as z,jr as Te,kr as Ee,la as De,lo as Oe,oo as ke,pi as Ae,sa as je,si as Me,ua as Ne,vi as Pe,wa as Fe,xo as Ie,za as Le,zn as Re,zr as ze}from"./utils-CtzgibkN.js";import{c as Be,d as Ve,f as He,i as Ue,n as We,o as Ge,s as Ke,u as qe}from"./useRender-BP5vR6yH.js";import{t as Je}from"./useRegisterFieldControl-BL6Ml_ar.js";import{t as Ye}from"./FormContext-CXpUoAJn.js";var B=e(t()),Xe=B.createContext(void 0),Ze=B.createContext(void 0),Qe=B.createContext(void 0),$e=B.createContext(``);function et(){let e=B.useContext(Xe);if(!e)throw Error(He(22));return e}function tt(){let e=B.useContext(Ze);if(!e)throw Error(He(23));return e}function nt(){let e=B.useContext(Qe);if(!e)throw Error(He(24));return e}function rt(){return B.useContext($e)}var V={id:T(e=>e.id),labelId:T(e=>e.labelId),items:T(e=>e.items),selectedValue:T(e=>e.selectedValue),hasSelectionChips:T(e=>{let t=e.selectedValue;return Array.isArray(t)&&t.length>0}),hasSelectedValue:T(e=>{let{selectedValue:t,selectionMode:n}=e;return t==null?!1:n===`multiple`&&Array.isArray(t)?t.length>0:!0}),hasNullItemLabel:T((e,t)=>t?s(e.items):!1),open:T(e=>e.open),mounted:T(e=>e.mounted),forceMounted:T(e=>e.forceMounted),inline:T(e=>e.inline),activeIndex:T(e=>e.activeIndex),selectedIndex:T(e=>e.selectedIndex),isActive:T((e,t)=>e.activeIndex===t),isSelected:T((e,t)=>{let n=e.isItemEqualToValue,r=e.selectedValue;return Array.isArray(r)?r.some(e=>oe(t,e,n)):oe(t,r,n)}),transitionStatus:T(e=>e.transitionStatus),popupProps:T(e=>e.popupProps),inputProps:T(e=>e.inputProps),triggerProps:T(e=>e.triggerProps),itemProps:T(e=>e.itemProps),positionerElement:T(e=>e.positionerElement),listElement:T(e=>e.listElement),triggerElement:T(e=>e.triggerElement),inputElement:T(e=>e.inputElement),inputGroupElement:T(e=>e.inputGroupElement),popupSide:T(e=>e.popupSide),openMethod:T(e=>e.openMethod),inputInsidePopup:T(e=>e.inputInsidePopup),inputOwnsFormValue:T(e=>e.inputOwnsFormValue),selectionMode:T(e=>e.selectionMode),name:T(e=>e.name),form:T(e=>e.form),disabled:T(e=>e.disabled),readOnly:T(e=>e.readOnly),required:T(e=>e.required),grid:T(e=>e.grid),virtualized:T(e=>e.virtualized),itemToStringLabel:T(e=>e.itemToStringLabel),isItemEqualToValue:T(e=>e.isItemEqualToValue),modal:T(e=>e.modal),autoHighlight:T(e=>e.autoHighlight),submitOnItemClick:T(e=>e.submitOnItemClick)};function it(e,t){return(n,r)=>{if(n==null)return!1;let i=z(n,t);return e.contains(i,r)}}function at(e,t,n){return(r,i)=>{if(r==null)return!1;if(!i)return!0;let a=z(r,t),o=n==null?``:z(n,t);return o&&e.contains(o,i)&&o.length===i.length?!0:e.contains(a,i)}}var H=new Map;function ot(e={}){let t={usage:`search`,sensitivity:`base`,ignorePunctuation:!0,...e},n=`${st(e.locale)}|${JSON.stringify(t)}`,r=H.get(n);if(r)return r;let i=new Intl.Collator(e.locale,t),a={contains(e,t,n){if(!t)return!0;let r=z(e,n);for(let e=0;e<=r.length-t.length;e+=1)if(i.compare(r.slice(e,e+t.length),t)===0)return!0;return!1},startsWith(e,t,n){if(!t)return!0;let r=z(e,n);return i.compare(r.slice(0,t.length),t)===0},endsWith(e,t,n){if(!t)return!0;let r=z(e,n),a=t.length;return r.length>=a&&i.compare(r.slice(r.length-a),t)===0}};return H.set(n,a),a}function st(e){return Array.isArray(e)?e.map(e=>st(e)).join(`,`):e==null?``:String(e)}var ct=ot;function lt(e={}){let{multiple:t=!1,value:n,...r}=e,i=ot(r),a=B.useCallback((e,r,a)=>t?it(i,a)(e,r):at(i,a,n)(e,r),[i,n,t]);return B.useMemo(()=>({contains:a,startsWith:i.startsWith,endsWith:i.endsWith}),[a,i])}var ut=Symbol(`none`),dt={value:ut,index:-1},U=e(n());function ft(e){let{id:t,onOpenChangeComplete:n,defaultSelectedValue:r=null,selectedValue:i,onSelectedValueChange:s,defaultInputValue:c,inputValue:te,open:d,defaultOpen:f=!1,selectionMode:p=`none`,onItemHighlighted:ne,name:m,form:h,disabled:v=!1,readOnly:y=!1,required:b=!1,inputRef:x,grid:re=!1,items:T,filteredItems:E,filter:O,openOnInputClick:se=!0,autoHighlight:k=!1,keepHighlight:A=!1,highlightItemOnHover:ue=!0,loopFocus:de=!0,itemToStringLabel:j,itemToStringValue:N,isItemEqualToValue:P=u,virtualized:pe=!1,inline:I=!1,fillInputOnItemPress:he=!0,modal:_e=!1,limit:L=-1,autoComplete:xe=`list`,formAutoComplete:Se,locale:Te,submitOnItemClick:De=!1}=e,{clearErrors:Me}=Ye(),{setDirty:Ie,validityData:Le,shouldValidateOnChange:ze,setFilled:He,name:We,disabled:et,setTouched:tt,setFocused:nt,validationMode:rt,validation:H}=fe(),ot=le(),st=Re({id:t}),lt=ct({locale:Te}),[ft,pt]=B.useState(!1),[mt,ht]=B.useState(null),gt=B.useRef([]),_t=B.useRef([]),vt=B.useRef(null),W=B.useRef(null),yt=B.useRef(null),bt=B.useRef(null),xt=B.useRef(null),St=B.useRef(!0),Ct=B.useRef(!1),wt=B.useRef(null),Tt=B.useRef(null),Et=B.useRef(null),Dt=B.useRef(dt),Ot=B.useRef(null),kt=B.useRef([]),At=B.useRef([]),jt=et||v,Mt=We??m,G=p===`multiple`,K=p===`single`,Nt=te!==void 0||c!==void 0,Pt=T!==void 0,Ft=E!==void 0,q;q=k===`always`?`always`:k?`input-change`:!1;let[J,It]=me({controlled:i,default:G?r??Ge:r,name:`Combobox`,state:`selectedValue`}),Lt=B.useMemo(()=>O===null?()=>!0:O===void 0?K&&!ft?at(lt,j,J):it(lt,j):O,[O,K,J,ft,lt,j]),Rt=Ve(()=>Nt?c??``:K?z(J,j):``).current,[Y,zt]=me({controlled:te,default:Rt,name:`Combobox`,state:`inputValue`}),[X,Bt]=me({controlled:d,default:f,name:`Combobox`,state:`open`}),Vt=ie(T),Z=mt??(Y===``?``:String(Y).trim()),Ht=K?z(J,j):``,Ut=K&&!ft&&Z!==``&&Ht!==``&&Ht.length===Z.length&&lt.contains(Ht,Z),Wt=Ut?``:Z,Gt=Pt&&Ft&&Ut,Kt=B.useMemo(()=>T?Vt?T.flatMap(e=>e.items):T:Ge,[T,Vt]),qt=B.useMemo(()=>{if(E&&!Gt)return E;if(!T)return Ge;if(Vt){let e=T,t=[],n=0;for(let r of e){if(L>-1&&n>=L)break;let e=Wt===``?r.items:r.items.filter(e=>Lt(e,Wt,j));if(e.length===0)continue;let i=L>-1?L-n:1/0,a=e.slice(0,i);if(a.length>0){let e={...r,items:a};t.push(e),n+=a.length}}return t}if(Wt===``)return L>-1?Kt.slice(0,L):Kt;let e=[];for(let t of Kt){if(L>-1&&e.length>=L)break;Lt(t,Wt,j)&&e.push(t)}return e},[E,Gt,T,Vt,Wt,L,Lt,j,Kt]),Jt=B.useMemo(()=>Vt?qt.flatMap(e=>e.items):qt,[qt,Vt]),Q=Ve(()=>new o({id:st,labelId:void 0,selectedValue:J,open:X,filter:Lt,query:Z,items:T,selectionMode:p,listRef:gt,labelsRef:_t,popupRef:vt,emptyRef:xt,inputRef:W,startDismissRef:yt,endDismissRef:bt,keyboardActiveRef:St,chipsContainerRef:wt,clearRef:Tt,valuesRef:kt,allValuesRef:At,selectionEventRef:Et,name:Mt,form:h,disabled:jt,readOnly:y,required:b,grid:re,isGrouped:Vt,virtualized:pe,openOnInputClick:se,itemToStringLabel:j,isItemEqualToValue:P,modal:_e,autoHighlight:q,submitOnItemClick:De,hasInputValue:Nt,mounted:!1,forceMounted:!1,transitionStatus:`idle`,inline:I,activeIndex:null,selectedIndex:null,popupProps:{},inputProps:{},triggerProps:{},itemProps:Ke,positionerElement:null,listElement:null,triggerElement:null,inputElement:null,inputGroupElement:null,popupSide:null,openMethod:null,inputInsidePopup:!0,inputOwnsFormValue:p===`none`,onOpenChangeComplete:n||Be,setOpen:Be,setInputValue:Be,setSelectedValue:Be,setIndices:Be,onItemHighlighted:Be,handleSelection:Be,forceMount:Be,requestSubmit:Be})).current,Yt=p===`none`?Y:J,Xt=B.useMemo(()=>p===`none`?Yt:Array.isArray(J)?J.map(e=>w(e,N)):w(J,N),[Yt,N,p,J]),Zt=F(ne),Qt=F(n),$t=D(Q,V.activeIndex),en=D(Q,V.selectedIndex),tn=D(Q,V.positionerElement),nn=D(Q,V.listElement),rn=D(Q,V.triggerElement),an=D(Q,V.inputElement),on=D(Q,V.inputGroupElement),$=D(Q,V.inline),sn=D(Q,V.inputInsidePopup),cn=D(Q,V.inputOwnsFormValue),ln=Ne(rn),{mounted:un,setMounted:dn,transitionStatus:fn}=a(X),{openMethod:pn,triggerProps:mn}=ee(X),hn=F(()=>Xt);Je(sn?ln:W,st,Yt,hn);let gn=F(()=>{T?_t.current=Jt.map(e=>z(e,j)):Q.set(`forceMounted`,!0)}),_n=B.useRef(J);M(()=>{J!==_n.current&&gn()},[gn,J]);let vn=F(e=>{Q.update(e);let t=e.type||`none`;if(e.activeIndex!==void 0){if(e.activeIndex===null)Dt.current!==dt&&(Dt.current=dt,Zt(void 0,C(t,void 0,{index:-1})));else{let n=kt.current[e.activeIndex];Dt.current={value:n,index:e.activeIndex},Zt(n,C(t,void 0,{index:e.activeIndex}))}}}),yn=F((t,n)=>{if(Ct.current=n.reason===ke,e.onInputValueChange?.(t,n),!n.isCanceled){if(n.reason===`input-change`){let e=n.event,r=e.inputType;if(e.type===`compositionend`||r!=null&&r!==``&&r!==`insertReplacementText`){let e=t.trim()!==``;e&&pt(!0),Ot.current={hasQuery:e},e&&q&&Q.state.activeIndex==null&&Q.set(`activeIndex`,0)}}zt(t)}}),bn=F((t,n)=>{if(X!==t&&(n.reason===`escape-key`&&Pt&&Jt.length===0&&!Q.state.emptyRef.current&&n.allowPropagation(),e.onOpenChange?.(t,n),!n.isCanceled&&(t&&G&&sn&&!$&&mt!==null&&(pt(!1),ht(null),Y!==``&&yn(``,R(ke,n.event))),!t&&ft&&(K?($||ht(Z),Z===``&&pt(!1)):G&&($||ht(Z),sn&&vn({activeIndex:null}),(!sn||$)&&yn(``,R(ke,n.event)))),Bt(t),!t&&sn&&(n.reason===`focus-out`||n.reason===`outside-press`)&&(tt(!0),nt(!1),rt===`onBlur`)))){let e=p===`none`?Y:J;H.commit(e)}}),xn=F((e,t)=>{s?.(e,t),!t.isCanceled&&(It(e),(p===`none`&&vt.current&&he||K&&!Q.state.inputInsidePopup)&&yn(z(e,j),R(t.reason,t.event)),K&&e!=null&&t.reason!==`input-change`&&ft&&!$&&ht(Z))}),Sn=F((e,t)=>{let n=t;if(n===void 0){if($t===null)return;n=kt.current[$t]}let r=ge(e),i=Et.current??e;Et.current=null;let a=R(Oe,i),o=r?.closest(`a`)?.getAttribute(`href`);if(o)o.startsWith(`#`)&&bn(!1,a);else if(G){let e=Array.isArray(J)?J:[],t=ce(e,n,Q.state.isItemEqualToValue)?S(e,n,Q.state.isItemEqualToValue):[...e,n];if(xn(t,a),!(W.current&&W.current.value.trim()!==``))return;Q.state.inputInsidePopup?yn(``,R(ke,a.event)):bn(!1,a)}else xn(n,a),bn(!1,a)}),Cn=F(()=>{if(!Q.state.submitOnItemClick)return;let e=H.inputRef.current?.form??Q.state.inputElement?.form;e&&typeof e.requestSubmit==`function`&&e.requestSubmit()}),wn=F(()=>{if(dn(!1),Qt?.(!1),pt(!1),ht(null),vn(p===`none`?{activeIndex:null,selectedIndex:null}:{activeIndex:null}),G&&W.current&&W.current.value!==``&&!Ct.current&&yn(``,R(ke)),K){if(Q.state.inputInsidePopup)W.current&&W.current.value!==``&&yn(``,R(ke));else{let e=z(J,j);W.current&&W.current.value!==e&&yn(e,R(e===``?ke:Ce))}}}),Tn=B.useMemo(()=>$&&tn?{current:tn.closest(`[role="dialog"]`)}:vt,[$,tn]);Fe({enabled:!e.actionsRef,open:X,ref:Tn,onComplete(){X||wn()}}),B.useImperativeHandle(e.actionsRef,()=>({unmount:wn}),[wn]),M(function(){if(X||p===`none`)return;let e=T?Kt:At.current;if(G){let t=Array.isArray(J)?J:[],n=t[t.length-1],r=_(e,n,P);vn({selectedIndex:r===-1?null:r})}else{let t=_(e,J,P);vn({selectedIndex:t===-1?null:t})}},[X,J,T,p,Kt,G,P,vn]),M(()=>{T&&(kt.current=Jt,gt.current.length=Jt.length)},[T,Jt]),M(()=>{let e=Ot.current;if(e&&(e.hasQuery?q&&Q.set(`activeIndex`,0):q===`always`&&Q.set(`activeIndex`,0),Ot.current=null),!X&&!$)return;let t=Pt||Ft?Jt:kt.current,n=Q.state.activeIndex;if(n==null){if(q===`always`&&t.length>0){Q.set(`activeIndex`,0);return}Dt.current!==dt&&(Dt.current=dt,Q.state.onItemHighlighted(void 0,C(Ce,void 0,{index:-1})));return}if(n>=t.length){Dt.current!==dt&&(Dt.current=dt,Q.state.onItemHighlighted(void 0,C(Ce,void 0,{index:-1}))),Q.set(`activeIndex`,null);return}let r=t[n],i=Dt.current.value,a=i!==ut&&oe(r,i,Q.state.isItemEqualToValue);Dt.current.index===n&&a||(Dt.current={value:r,index:n},Q.state.onItemHighlighted(r,C(Ce,void 0,{index:n})))},[$t,q,Ft,Pt,Jt,$,X,Q]),M(()=>{He(p===`none`?String(Y)!==``:G?Array.isArray(J)&&J.length>0:J!=null)},[He,p,Y,J,G]),B.useEffect(()=>{Pt&&q&&Jt.length===0&&vn({activeIndex:null})},[Pt,q,Jt.length,vn]),ae(Z,()=>{X&&Z!==``&&Z!==String(Rt)&&pt(!0)}),ae(J,()=>{if(p!==`none`&&(Me(Mt),Ie(J!==Le.initialValue),ze()?H.commit(J):H.commit(J,!0),K&&!Nt&&!sn)){let e=z(J,j);Y!==e&&yn(e,R(Ce))}}),ae(Y,()=>{p===`none`&&(Me(Mt),Ie(Y!==Le.initialValue),ze()?H.commit(Y):H.commit(Y,!0))}),ae(T,()=>{if(!K||Nt||sn||ft)return;let e=z(J,j);Y!==e&&yn(e,R(Ce))});let En=Ae({open:$?!0:X,onOpenChange:bn,elements:{reference:sn?rn:an,floating:tn}}),Dn,On;$||(Dn=re?`grid`:`listbox`,On=X?`true`:`false`);let kn=B.useMemo(()=>{let e=an?.tagName===`INPUT`,t=an==null||e,n=t||X,r=t?{autoComplete:`off`,spellCheck:`false`,autoCorrect:`off`,autoCapitalize:`none`}:{};return n&&(r.role=`combobox`,r[`aria-expanded`]=On,r[`aria-haspopup`]=Dn,r[`aria-controls`]=X?nn?.id:void 0,r[`aria-autocomplete`]=xe),{reference:r,floating:{role:`presentation`}}},[an,X,On,Dn,nn?.id,xe]),An=g(En,{enabled:!y&&!jt&&se,event:`mousedown-only`,toggle:!1,touchOpenDelay:sn?0:100,reason:be}),jn=l(En,{enabled:!y&&!jt&&!$,outsidePressEvent:{mouse:`sloppy`,touch:`intentional`},bubbles:$?!0:void 0,outsidePress(e){let t=ge(e);return!we(rn,t)&&!we(Tt.current,t)&&!we(wt.current,t)&&!we(on,t)}}),Mn=ye(En,{enabled:!y&&!jt,id:st,listRef:gt,activeIndex:$t,selectedIndex:en,virtual:!0,loopFocus:de,allowEscape:de&&!q,focusItemOnOpen:ft||p===`none`&&!q?!1:`auto`,focusItemOnHover:ue,resetOnPointerLeave:!A,cols:re?2:1,orientation:re?`horizontal`:void 0,rtl:ot===`rtl`,disabledIndices:Ge,onNavigate(e,t){(t||X)&&fn!==`ending`&&vn(t?{activeIndex:e,type:St.current?`keyboard`:`pointer`}:{activeIndex:e})}}),Nn=B.useMemo(()=>Ue(Mn.reference,jn.reference,An.reference,kn.reference),[Mn.reference,jn.reference,An.reference,kn.reference]),Pn=B.useMemo(()=>Ue(Pe,Mn.floating,jn.floating,kn.floating),[Mn.floating,jn.floating,kn.floating]),Fn=B.useMemo(()=>{let e=Mn.item;return e?{...e,onFocus:void 0}:Ke},[Mn.item]);Ee(()=>{Q.update({inline:I,popupProps:Pn,inputProps:Nn,triggerProps:mn,itemProps:Fn,setOpen:bn,setInputValue:yn,setSelectedValue:xn,setIndices:vn,onItemHighlighted:Zt,handleSelection:Sn,forceMount:gn,requestSubmit:Cn})}),M(()=>{Q.update({id:st,selectedValue:J,open:X,mounted:un,transitionStatus:fn,items:T,inline:I,popupProps:Pn,inputProps:Nn,triggerProps:mn,openMethod:pn,itemProps:Fn,selectionMode:p,name:Mt,form:h,disabled:jt,readOnly:y,required:b,grid:re,isGrouped:Vt,virtualized:pe,onOpenChangeComplete:Qt,openOnInputClick:se,itemToStringLabel:j,modal:_e,autoHighlight:q,isItemEqualToValue:P,submitOnItemClick:De,hasInputValue:Nt,requestSubmit:Cn,inputOwnsFormValue:p===`none`&&(I||!Q.state.inputInsidePopup)})},[Q,st,J,X,un,fn,T,Pn,Nn,Fn,pn,mn,p,Mt,jt,y,b,H,re,Vt,pe,Qt,se,j,_e,P,De,Nt,I,Cn,q,h]);let In=qe(x,H.inputRef),Ln=B.useMemo(()=>({query:Z,hasItems:Pt,filteredItems:qt,flatFilteredItems:Jt}),[Z,Pt,qt,Jt]),Rn=B.useMemo(()=>Array.isArray(Yt)?``:w(Yt,N),[Yt,N]),zn=G&&Array.isArray(J)&&J.length>0,Bn=G||p===`none`&&cn?void 0:Mt,Vn=B.useMemo(()=>!G||!Array.isArray(J)||!Mt?null:J.map(e=>{let t=w(e,N);return(0,U.jsx)(`input`,{type:`hidden`,form:h,name:Mt,value:t},t)}),[G,J,h,Mt,N]),Hn=(0,U.jsxs)(B.Fragment,{children:[e.children,(0,U.jsx)(`input`,{...H.getInputValidationProps({onFocus(){sn?rn?.focus():(W.current||rn)?.focus()},onChange(e){if(e.nativeEvent.defaultPrevented||jt||y){e.preventBaseUIHandler?.();return}let t=e.currentTarget.value,n=R(Ce,e.nativeEvent);function r(){if(G)return;if(p===`none`){Ie(t!==Le.initialValue),yn(t,n),ze()&&H.commit(t);return}let e=kt.current.find(e=>w(e,N).toLowerCase()===t.toLowerCase()||z(e,j).toLowerCase()===t.toLowerCase());e!=null&&(Ie(e!==Le.initialValue),xn?.(e,n),ze()&&H.commit(e))}T?r():(gn(),queueMicrotask(r))}}),id:st&&Bn==null?`${st}-hidden-input`:void 0,form:h,name:Bn,autoComplete:Se,disabled:jt,required:b&&!zn,readOnly:y,value:Rn,ref:In,style:Bn?ve:je,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Vn]});return(0,U.jsx)(Xe.Provider,{value:Q,children:(0,U.jsx)(Ze.Provider,{value:En,children:(0,U.jsx)(Qe.Provider,{value:Ln,children:(0,U.jsx)($e.Provider,{value:Y,children:Hn})})})})}var pt={...A,...f,popupSide:e=>e?{"data-popup-side":e}:null,listEmpty:e=>e?{"data-list-empty":``}:null},mt=B.createContext(void 0);function ht(){return B.useContext(mt)}var gt=B.createContext(void 0);function _t(e){let t=B.useContext(gt);if(t===void 0&&!e)throw Error(He(21));return t}var vt=B.forwardRef(function(e,t){let n=et(),{buttonRef:r,getButtonProps:i}=N({native:!1}),a=qe(t,r);function o(e){n.state.setOpen(!1,R(he,e.nativeEvent,e.currentTarget))}let s=i({onClick:o});return(0,U.jsx)(`span`,{ref:a,...s,"aria-label":`Dismiss`,tabIndex:void 0,style:ve})}),W=B.forwardRef(function(e,t){let{render:n,className:i,disabled:a=!1,id:o,style:s,...c}=e,{state:ee,disabled:te,setTouched:l,setFocused:u,validationMode:d,validation:f}=fe(),{labelId:p}=r(),m=ht(),h=!!_t(!0),g=et(),{filteredItems:_}=nt(),v=rt(),y=le(),x=D(g,V.required),S=D(g,V.disabled),C=D(g,V.readOnly),w=D(g,V.name),T=D(g,V.form),E=D(g,V.selectionMode),ie=D(g,V.autoHighlight),ae=D(g,V.inputProps),oe=D(g,V.triggerProps),O=D(g,V.open),ce=D(g,V.mounted),k=D(g,V.selectedValue),A=D(g,V.popupSide),ue=D(g,V.positionerElement),j=D(g,V.id),M=D(g,V.inline),N=D(g,V.modal),I=!!ie,me=ce&&ue?A:null,he=te||S||a,ge=_.length===0,ve=h||M,ye=!ve||N,be=re(o??(ve?void 0:j)),xe=de(p,void 0),we=h?pe:ee,[z,Te]=B.useState(null),Ee=B.useRef(!1),De=B.useRef(null),Oe=B.useRef(!1),Ae=E===`none`&&!h,je=F(e=>{let t=h||g.state.inline;t&&!g.state.hasInputValue&&g.state.setInputValue(``,R(Ce)),g.update({inputElement:e,inputInsidePopup:t,inputOwnsFormValue:Ae})}),Me=h||!f?c:f.getValidationProps(c),Ne={...we,open:O,disabled:he,readOnly:C,popupSide:me,listEmpty:ge};function Pe(e){if(!m)return;let t,{highlightedChipIndex:n}=m,r=m.chipsRef.current.length,i=y===`rtl`,a=i?`ArrowRight`:`ArrowLeft`,o=i?`ArrowLeft`:`ArrowRight`;if(n!==void 0){if(e.key===a)e.preventDefault(),t=n>0?n-1:void 0;else if(e.key===o)e.preventDefault(),t=n<r-1?n+1:void 0;else if(e.key===`Backspace`||e.key===`Delete`){e.preventDefault();let r=n>=k.length-1?k.length-2:n;t=r>=0?r:void 0,g.state.setIndices({activeIndex:null,selectedIndex:null,type:`keyboard`})}return t}return e.key===a&&(e.currentTarget.selectionStart??0)===0&&k.length>0?(e.preventDefault(),t=r>0?r-1:void 0):e.key===`Backspace`&&e.currentTarget.value===``&&k.length>0&&(g.state.setIndices({activeIndex:null,selectedIndex:null,type:`keyboard`}),e.preventDefault()),t}let Fe=We(`input`,e,{state:Ne,ref:[t,g.state.inputRef,je],props:[ae,oe,{type:`text`,value:e.value??z??v,"aria-readonly":C||void 0,"aria-required":x||void 0,"aria-labelledby":xe,disabled:he,readOnly:C,required:E===`none`?x:void 0,form:T,...Ae&&w&&{name:w},id:be,onFocus(){if(u(!0),!M||!Oe.current)return;Oe.current=!1;let e=De.current;e!=null&&Object.hasOwn(g.state.valuesRef.current,e)&&g.state.setIndices({activeIndex:e})},onBlur(){l(!0),u(!1);let e=g.state.activeIndex;if(M&&e!==null&&ie!==`always`&&(De.current=e,Oe.current=!0,g.state.setIndices({activeIndex:null})),d===`onBlur`){let e=E===`none`?v:k;f.commit(e)}},onCompositionStart(e){b||(Ee.current=!0,Te(e.currentTarget.value))},onCompositionEnd(e){Ee.current=!1;let t=e.currentTarget.value;Te(null),g.state.setInputValue(t,R(_e,e.nativeEvent))},onChange(e){let t=e.nativeEvent.inputType,n=!t||t===`insertReplacementText`,r=Ee.current||!n;if(Ee.current){let t=e.currentTarget.value;Te(t),t===``&&!g.state.openOnInputClick&&!g.state.inputInsidePopup&&g.state.setOpen(!1,R(ke,e.nativeEvent));let n=t.trim(),i=I&&n!==``;!C&&!he&&n&&r&&(g.state.setOpen(!0,R(_e,e.nativeEvent)),I||g.state.setIndices({activeIndex:null,selectedIndex:null,type:g.state.keyboardActiveRef.current?`keyboard`:`pointer`})),O&&g.state.activeIndex!==null&&!i&&g.state.setIndices({activeIndex:null,selectedIndex:null,type:g.state.keyboardActiveRef.current?`keyboard`:`pointer`});return}g.state.setInputValue(e.currentTarget.value,R(_e,e.nativeEvent));let i=e.currentTarget.value===``,a=R(ke,e.nativeEvent);i&&!g.state.inputInsidePopup&&(E===`single`&&g.state.setSelectedValue(null,a),g.state.openOnInputClick||g.state.setOpen(!1,a));let o=e.currentTarget.value.trim();!C&&!he&&o&&r&&(g.state.setOpen(!0,R(_e,e.nativeEvent)),I||g.state.setIndices({activeIndex:null,selectedIndex:null,type:g.state.keyboardActiveRef.current?`keyboard`:`pointer`})),O&&g.state.activeIndex!==null&&!I&&g.state.setIndices({activeIndex:null,selectedIndex:null,type:g.state.keyboardActiveRef.current?`keyboard`:`pointer`})},onKeyDown(e){if(he||C||e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)return;g.state.keyboardActiveRef.current=!0;let t=e.currentTarget,n=t.scrollWidth-t.clientWidth,r=y===`rtl`;if(e.key===`Home`){L(e);let n=se&&r?t.value.length:0;t.setSelectionRange(n,n),t.scrollLeft=0;return}if(e.key===`End`){L(e);let i=se&&r?0:t.value.length;t.setSelectionRange(i,i),t.scrollLeft=r?-n:n;return}if(!ce&&e.key===`Escape`){let t=E===`multiple`&&Array.isArray(k)?k.length===0:k===null,n=R(Se,e.nativeEvent),r=E===`multiple`?[]:null;g.state.setInputValue(``,n),g.state.setSelectedValue(r,n),t||g.state.inline||n.isPropagationAllowed||e.stopPropagation();return}if(m&&e.key===`Backspace`&&t.value===``&&m.highlightedChipIndex===void 0&&Array.isArray(k)&&k.length>0){let t=m.chipsRef.current.length,n=t>0?t-1:k.length-1,r=k.filter((e,t)=>t!==n);g.state.setIndices({activeIndex:null,selectedIndex:null,type:g.state.keyboardActiveRef.current?`keyboard`:`pointer`}),g.state.setSelectedValue(r,R(Ce,e.nativeEvent));return}let i=m?.highlightedChipIndex!==void 0,a=Pe(e);if(m?.setHighlightedChipIndex(a),a===void 0?i&&g.state.inputRef.current?.focus():m?.chipsRef.current[a]?.focus(),e.which!==229&&e.key===`Enter`&&O){let t=g.state.activeIndex,n=e.nativeEvent;if(t===null){if(M)return;g.state.setOpen(!1,R(Ce,n));return}L(e);let r=g.state.listRef.current[t];r&&(g.state.selectionEventRef.current=n,r.click(),g.state.selectionEventRef.current=null)}},onPointerMove(){g.state.keyboardActiveRef.current=!1},onPointerDown(){g.state.keyboardActiveRef.current=!1}},Me],stateAttributesMapping:pt}),Ie=h?(0,U.jsx)(ne.Provider,{value:P,children:Fe}):Fe;return(0,U.jsxs)(B.Fragment,{children:[O&&ye&&(0,U.jsx)(vt,{ref:g.state.startDismissRef}),Ie]})}),yt=2,bt=B.forwardRef(function(e,t){let{render:n,className:i,nativeButton:a=!0,disabled:o=!1,id:s,style:c,...ee}=e,{state:te,disabled:l,setTouched:u,setFocused:d,validationMode:f,validation:p}=fe(),{labelId:ne}=r(),m=et(),{filteredItems:h}=nt(),_=D(m,V.selectionMode),v=D(m,V.disabled),y=D(m,V.readOnly),b=D(m,V.required),x=D(m,V.mounted),S=D(m,V.popupSide),C=D(m,V.positionerElement),w=D(m,V.listElement),re=D(m,V.triggerProps),T=D(m,V.triggerElement),E=D(m,V.inputInsidePopup),ie=D(m,V.id),ae=D(m,V.labelId),oe=D(m,V.open),O=D(m,V.selectedValue),se=D(m,V.activeIndex),ce=D(m,V.selectedIndex),le=D(m,V.hasSelectedValue),A=tt(),j=rt(),M=k(),P=l||v||o,pe=h.length===0,I=x&&C?S:null;Re({id:E?s:void 0});let me=E?s??ie:s,he=de(ne,ae),_e=B.useRef(``);function ve(e){_e.current=e.pointerType}let ye=A.useState(`domReferenceElement`);B.useEffect(()=>{E&&T&&T!==ye&&A.set(`domReferenceElement`,T)},[T,ye,A,E]);let{reference:be}=Me(A,{enabled:!oe&&!y&&!v&&_===`single`,listRef:m.state.labelsRef,activeIndex:se,selectedIndex:ce,onMatch(e){let t=m.state.valuesRef.current[e];t!==void 0&&m.state.setSelectedValue(t,R(`none`))}}),{reference:Se}=g(A,{enabled:!y&&!v,event:`mousedown`}),{buttonRef:Ce,getButtonProps:z}=N({native:a,disabled:P}),Te={...te,open:oe,disabled:P,popupSide:I,listEmpty:pe,placeholder:_!==`none`&&!le},Ee=F(e=>{m.set(`triggerElement`,e)});return We(`button`,e,{ref:[t,Ce,Ee],state:Te,props:[re,Se,be,{id:me,tabIndex:E?0:-1,role:E?`combobox`:void 0,"aria-expanded":oe?`true`:`false`,"aria-haspopup":E?`dialog`:`listbox`,"aria-controls":oe?w?.id:void 0,"aria-required":E&&b||void 0,"aria-labelledby":he,onPointerDown:ve,onPointerEnter:ve,onFocus(){d(!0),!(P||y)&&M.start(0,m.state.forceMount)},onBlur(e){if(!we(C,e.relatedTarget)&&(u(!0),d(!1),f===`onBlur`)){let e=_===`none`?j:O;p.commit(e)}},onMouseDown(e){if(P||y||(E||A.set(`domReferenceElement`,e.currentTarget),m.state.forceMount(),_e.current!==`touch`&&(m.state.inputRef.current?.focus(),E||e.preventDefault()),oe))return;let t=De(e.currentTarget);function n(e){if(!T)return;let t=ge(e),n=m.state.positionerElement,r=m.state.listElement;if(we(T,t)||we(n,t)||we(r,t)||t===T)return;let i=ue(T),a=e.clientX>=i.left-yt&&e.clientX<=i.right+yt,o=e.clientY>=i.top-yt&&e.clientY<=i.bottom+yt;a&&o||m.state.setOpen(!1,R(`cancel-open`,e))}E&&t.addEventListener(`mouseup`,n,{once:!0})},onKeyDown(e){P||y||(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(L(e),m.state.setOpen(!0,R(xe,e.nativeEvent)),m.state.inputRef.current?.focus())}},p?p.getValidationProps(ee):ee,z],stateAttributesMapping:pt})}),xt=B.createContext(null);function St(){return B.useContext(xt)}function Ct(e){let{children:t,items:n}=e,r=B.useMemo(()=>({items:n}),[n]);return(0,U.jsx)(xt.Provider,{value:r,children:t})}function wt(e){let{children:t}=e,{filteredItems:n}=nt(),r=St(),i=r?r.items:n;return i?(0,U.jsx)(B.Fragment,{children:i.map(t)}):null}var Tt=B.forwardRef(function(e,t){var n;let{render:r,className:i,style:a,children:o,...s}=e,c=et(),ee=tt(),te=!!_t(!0),{filteredItems:l,hasItems:u}=nt(),f=D(c,V.selectionMode),p=D(c,V.grid),ne=D(c,V.popupProps),m=D(c,V.virtualized),h=f===`multiple`,g=l.length===0,_=F(e=>{c.set(`positionerElement`,e)}),v=F(e=>{c.set(`listElement`,e)}),y=B.useMemo(()=>typeof o==`function`?n||=(0,U.jsx)(wt,{children:o}):o,[o]),b={empty:g},x=ee.useState(`floatingId`),S=We(`div`,e,{state:b,ref:[t,v,te?null:_],props:[ne,{children:y,tabIndex:-1,id:x,role:p?`grid`:`listbox`,"aria-multiselectable":h?`true`:void 0,onKeyDown(e){if(!(c.state.disabled||c.state.readOnly)&&e.key===`Enter`){let t=c.state.activeIndex;if(t==null)return;L(e);let n=e.nativeEvent,r=c.state.listRef.current[t];r&&(c.state.selectionEventRef.current=n,r.click(),c.state.selectionEventRef.current=null)}},onKeyDownCapture(){c.state.keyboardActiveRef.current=!0},onPointerMoveCapture(){c.state.keyboardActiveRef.current=!1}},s]});return m?S:(0,U.jsx)(d,{elementsRef:c.state.listRef,labelsRef:u?void 0:c.state.labelsRef,children:S})}),Et=e(c()),Dt=`⁠`;function Ot(e){let t=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT),n=null;for(;t.nextNode();){let e=t.currentNode;e.nodeValue!==``&&(n=e)}return n}function kt(){let e=k(),t=B.useRef(null);return B.useEffect(()=>{if(Le)return;let n=t.current;if(n==null)return;let r=Ot(n);if(r==null)return;let i=r.nodeValue??``,a=`${i}${Dt}`;return r.nodeValue=a,e.start(200,()=>{r.nodeValue===a&&(r.nodeValue=i)}),()=>{e.clear(),r.nodeValue===a&&(r.nodeValue=i)}},[t,e]),t}var At=B.createContext(void 0);function jt(){let e=B.useContext(At);if(e===void 0)throw Error(He(20));return e}var Mt=B.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=et(),a=D(i,V.mounted),o=D(i,V.forceMounted);return a||n||o?(0,U.jsx)(At.Provider,{value:n,children:(0,U.jsx)(p,{ref:t,...r})}):null}),G=B.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`bottom`,align:s=`center`,sideOffset:c=0,alignOffset:ee=0,collisionBoundary:te=`clipping-ancestors`,collisionPadding:l=5,arrowPadding:u=5,sticky:d=!1,disableAnchorTracking:f=!1,collisionAvoidance:p=y,style:ne,...m}=e,h=et(),{filteredItems:g}=nt(),_=tt(),b=jt(),x=D(h,V.modal),S=D(h,V.open),C=D(h,V.mounted),w=D(h,V.openMethod),re=D(h,V.positionerElement),T=D(h,V.triggerElement),ie=D(h,V.inputElement),ae=D(h,V.inputGroupElement),oe=D(h,V.inputInsidePopup),se=D(h,V.transitionStatus),ce=g.length===0,le=v({anchor:i??(oe?T:ae??ie),floatingRootContext:_,positionMethod:a,mounted:C,side:o,sideOffset:c,align:s,alignOffset:ee,arrowPadding:u,collisionBoundary:te,collisionPadding:l,sticky:d,disableAnchorTracking:f,keepMounted:b,collisionAvoidance:p,lazyFlip:!0});Te(S&&x,w===`touch`,re,T);let k={open:S,side:le.side,align:le.align,anchorHidden:le.anchorHidden,empty:ce};M(()=>{h.set(`popupSide`,le.side)},[h,le.side]);let A=F(e=>{h.set(`positionerElement`,e)}),ue=E(e,k,{styles:le.positionerStyles,transitionStatus:se,props:m,refs:[t,A],hidden:!C,inert:!S});return(0,U.jsxs)(gt.Provider,{value:le,children:[C&&x&&(0,U.jsx)(O,{inert:ze(!S),cutout:ae??ie??T}),ue]})}),K={...Ie,...j},Nt=B.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,c=et(),ee=_t(),te=tt(),{filteredItems:l}=nt(),u=D(c,V.mounted),d=D(c,V.open),f=D(c,V.openMethod),p=D(c,V.transitionStatus),ne=D(c,V.inputInsidePopup),h=D(c,V.inputElement),g=D(c,V.modal),_=l.length===0;Fe({open:d,ref:c.state.popupRef,onComplete(){d&&c.state.onOpenChangeComplete(!0)}});let v={open:d,side:ee.side,align:ee.align,anchorHidden:ee.anchorHidden,transitionStatus:p,empty:_},y=We(`div`,e,{state:v,ref:[t,c.state.popupRef],props:[{role:ne?`dialog`:`presentation`,tabIndex:-1,onFocus(e){let t=ge(e.nativeEvent);f!==`touch`&&(we(c.state.listElement,t)||t===e.currentTarget)&&c.state.inputRef.current?.focus()}},m(p),s],stateAttributesMapping:K}),b=a===void 0?ne?e=>e===`touch`?c.state.popupRef.current:h:!1:a,S;S=o??(ne?void 0:!1);let C=!ne||g;return(0,U.jsx)(x,{context:te,disabled:!u,modal:C,openInteractionType:f,initialFocus:b,returnFocus:S,getInsideElements:()=>[c.state.startDismissRef.current,c.state.endDismissRef.current],children:(0,U.jsxs)(B.Fragment,{children:[y,C&&(0,U.jsx)(vt,{ref:c.state.endDismissRef})]})})}),Pt=B.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e;return We(`span`,e,{ref:t,props:[{"aria-hidden":!0,children:`▼`},a]})}),Ft=B.createContext(void 0),q=B.createContext(!1);function J(){return B.useContext(q)}var It=B.memo(B.forwardRef(function(e,t){let{render:n,className:r,style:i,value:a=null,index:o,disabled:s=!1,nativeButton:c=!1,...ee}=e,l=B.useRef(!1),u=B.useRef(null),d=h({index:o,textRef:u,indexGuessBehavior:te.GuessFromOrder}),f=et(),p=J(),{flatFilteredItems:ne,hasItems:m}=nt(),g=D(f,V.open),v=D(f,V.selectionMode),y=D(f,V.readOnly),b=D(f,V.virtualized),x=D(f,V.isItemEqualToValue),S=v!==`none`,C=o??(b?_(ne,a,x):d.index),w=d.index!==-1,re=D(f,V.id),T=D(f,V.isActive,C),E=D(f,V.isSelected,a),ie=D(f,V.itemProps),ae=B.useRef(null),O=re!=null&&w?`${re}-${C}`:void 0,se=E&&S;M(()=>{if(!w||!b&&o==null)return;let e=f.state.listRef.current;return e[C]=ae.current,()=>{delete e[C]}},[w,b,C,o,f]),M(()=>{if(!w||m)return;let e=f.state.valuesRef.current;return e[C]=a,v!==`none`&&f.state.allValuesRef.current.push(a),()=>{delete e[C]}},[w,m,C,a,f,v]),M(()=>{if(!g){l.current=!1;return}if(!w||m)return;let e=f.state.selectedValue,t=Array.isArray(e)?e[e.length-1]:e;oe(a,t,x)&&f.set(`selectedIndex`,C)},[w,m,g,f,C,a,x]);let{getButtonProps:ce,buttonRef:le}=N({disabled:s,focusableWhenDisabled:!0,native:c,composite:!0}),k={disabled:s,selected:se,highlighted:T};function A(e){function t(){f.state.handleSelection(e,a)}f.state.submitOnItemClick?(Et.flushSync(t),f.state.requestSubmit()):t()}let ue={id:O,role:p?`gridcell`:`option`,"aria-selected":S?se:void 0,tabIndex:void 0,onPointerDownCapture(e){l.current=!0,e.preventDefault()},onMouseDown(e){e.preventDefault()},onClick(e){s||y||A(e.nativeEvent)},onMouseUp(e){let t=l.current;l.current=!1,!(s||y||e.button!==0||t||!T)&&A(e.nativeEvent)}},de=We(`div`,e,{ref:[le,t,d.ref,ae],state:k,props:[ie,ue,ee,ce]}),j=B.useMemo(()=>({selected:se,textRef:u}),[se,u]);return(0,U.jsx)(Ft.Provider,{value:j,children:de})})),Lt=B.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,{filteredItems:s}=nt(),c=et(),ee=kt(),te=s.length===0?a:null;return We(`div`,e,{ref:[t,c.state.emptyRef,ee],props:[{children:te,role:`status`,"aria-live":`polite`,"aria-atomic":!0},o]})}),Rt={...j,...i},Y=B.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:o=!0,keepMounted:s=!1,style:c,...ee}=e,{disabled:te}=fe(),l=et(),u=D(l,V.selectionMode),d=D(l,V.disabled),f=D(l,V.readOnly),p=D(l,V.open),ne=D(l,V.selectedValue),m=D(l,V.hasSelectionChips),h=rt(),g=!1;g=u===`none`?h!==``:u===`single`?ne!=null:m;let _=te||d||i,{buttonRef:v,getButtonProps:y}=N({native:o,disabled:_}),{mounted:b,transitionStatus:x,setMounted:S}=a(g),C={disabled:_,visible:g,open:p,transitionStatus:x};Fe({open:g,ref:l.state.clearRef,onComplete(){g||S(!1)}});let w=We(`button`,e,{state:C,ref:[t,v,l.state.clearRef],props:[{tabIndex:-1,children:`x`,onMouseDown(e){e.preventDefault()},onClick(e){if(_||f)return;let t=l.state.keyboardActiveRef;l.state.setInputValue(``,R(I,e.nativeEvent)),u===`none`?l.state.setIndices({activeIndex:null,type:t.current?`keyboard`:`pointer`}):(l.state.setSelectedValue(Array.isArray(ne)?[]:null,R(I,e.nativeEvent)),l.state.setIndices({activeIndex:null,selectedIndex:null,type:t.current?`keyboard`:`pointer`})),l.state.inputRef.current?.focus()}},ee,y],stateAttributesMapping:Rt});return s||b?w:null});export{Nt as a,kt as c,Ct as d,bt as f,ct as g,lt as h,Pt as i,Tt as l,ft as m,Lt as n,G as o,W as p,It as r,Mt as s,Y as t,wt as u};
2
+ //# sourceMappingURL=ComboboxClear-HZ-hIKnq.js.map
@@ -0,0 +1,2 @@
1
+ import{a as e,t}from"./react-BUfh6y28.js";import{t as n}from"./jsx-runtime-DJeoFXNw.js";import{Na as r,Ua as i}from"./utils-CtzgibkN.js";import{f as a,n as o}from"./useRender-BP5vR6yH.js";import{d as s}from"./ComboboxClear-HZ-hIKnq.js";var c=e(t()),l=c.createContext(void 0);function u(){let e=c.useContext(l);if(e===void 0)throw Error(a(18));return e}var d=e(n()),f=c.forwardRef(function(e,t){let{render:n,className:r,style:i,items:a,...u}=e,[f,p]=c.useState(),m=c.useMemo(()=>({labelId:f,setLabelId:p,items:a}),[f,p,a]),h=o(`div`,e,{ref:t,props:[{role:`group`,"aria-labelledby":f},u]}),g=(0,d.jsx)(l.Provider,{value:m,children:h});return a?(0,d.jsx)(s,{items:a,children:g}):g}),p=c.forwardRef(function(e,t){let{render:n,className:a,style:s,id:c,...l}=e,{setLabelId:d}=u(),f=r(c);return i(()=>(d(f),()=>{d(void 0)}),[f,d]),o(`div`,e,{ref:t,props:[{id:f},l]})});export{f as n,p as t};
2
+ //# sourceMappingURL=ComboboxGroupLabel-DUYNaL5F.js.map
@@ -1,2 +1,2 @@
1
- import{a as e}from"./react-BUfh6y28.js";import{n as t,t as n}from"./jsx-runtime-DJeoFXNw.js";import{mr as r,t as i}from"./utils-DjbLtxuo.js";import{C as a,f as o,u as s}from"./TooltipProvider-Czzm7ro-.js";import{m as c}from"./relay-Do9UB5iT.js";var l=t(),u=e(n(),1);function d(e){let t=(0,l.c)(19),{command:n,className:d,prominent:f}=e,p=f!==void 0&&f,m;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(m={timeout:1500,target:`command`},t[0]=m):m=t[0];let{copyToClipboard:h,isCopied:g}=c(m),_=p?`px-4 py-3.5 text-base`:`px-3 py-2.5 text-sm`,v;t[1]!==d||t[2]!==_?(v=i(`flex items-center justify-between gap-3 rounded-lg border border-border bg-muted/50 font-mono`,_,d),t[1]=d,t[2]=_,t[3]=v):v=t[3];let y;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,u.jsx)(`span`,{className:`mr-2 text-muted-foreground`,children:`$`}),t[4]=y):y=t[4];let b;t[5]===n?b=t[6]:(b=(0,u.jsxs)(`span`,{className:`min-w-0 truncate`,children:[y,n]}),t[5]=n,t[6]=b);let x;t[7]!==n||t[8]!==h?(x=()=>h(n,void 0),t[7]=n,t[8]=h,t[9]=x):x=t[9];let S=g?o:a,C;t[10]===S?C=t[11]:(C=(0,u.jsx)(s,{className:`size-3.5`,icon:S}),t[10]=S,t[11]=C);let w;t[12]!==x||t[13]!==C?(w=(0,u.jsx)(r,{size:`icon-xs`,variant:`ghost`,"aria-label":`Copy command`,onClick:x,children:C}),t[12]=x,t[13]=C,t[14]=w):w=t[14];let T;return t[15]!==w||t[16]!==v||t[17]!==b?(T=(0,u.jsxs)(`div`,{className:v,children:[b,w]}),t[15]=w,t[16]=v,t[17]=b,t[18]=T):T=t[18],T}export{d as t};
2
- //# sourceMappingURL=CommandBlock-40eSIrOe.js.map
1
+ import{a as e}from"./react-BUfh6y28.js";import{n as t,t as n}from"./jsx-runtime-DJeoFXNw.js";import{mr as r,t as i}from"./utils-CtzgibkN.js";import{C as a,f as o,u as s}from"./TooltipProvider-BUHMH_xT.js";import{m as c}from"./relay-DcCuBtiq.js";var l=t(),u=e(n(),1);function d(e){let t=(0,l.c)(19),{command:n,className:d,prominent:f}=e,p=f!==void 0&&f,m;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(m={timeout:1500,target:`command`},t[0]=m):m=t[0];let{copyToClipboard:h,isCopied:g}=c(m),_=p?`px-4 py-3.5 text-base`:`px-3 py-2.5 text-sm`,v;t[1]!==d||t[2]!==_?(v=i(`flex items-center justify-between gap-3 rounded-lg border border-border bg-muted/50 font-mono`,_,d),t[1]=d,t[2]=_,t[3]=v):v=t[3];let y;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,u.jsx)(`span`,{className:`mr-2 text-muted-foreground`,children:`$`}),t[4]=y):y=t[4];let b;t[5]===n?b=t[6]:(b=(0,u.jsxs)(`span`,{className:`min-w-0 truncate`,children:[y,n]}),t[5]=n,t[6]=b);let x;t[7]!==n||t[8]!==h?(x=()=>h(n,void 0),t[7]=n,t[8]=h,t[9]=x):x=t[9];let S=g?o:a,C;t[10]===S?C=t[11]:(C=(0,u.jsx)(s,{className:`size-3.5`,icon:S}),t[10]=S,t[11]=C);let w;t[12]!==x||t[13]!==C?(w=(0,u.jsx)(r,{size:`icon-xs`,variant:`ghost`,"aria-label":`Copy command`,onClick:x,children:C}),t[12]=x,t[13]=C,t[14]=w):w=t[14];let T;return t[15]!==w||t[16]!==v||t[17]!==b?(T=(0,u.jsxs)(`div`,{className:v,children:[b,w]}),t[15]=w,t[16]=v,t[17]=b,t[18]=T):T=t[18],T}export{d as t};
2
+ //# sourceMappingURL=CommandBlock-4iMcWKQI.js.map
@@ -0,0 +1,2 @@
1
+ import{a as e,t}from"./react-BUfh6y28.js";import{t as n}from"./jsx-runtime-DJeoFXNw.js";import{$i as r,Fr as i,Gr as a,Ha as o,Jr as s,Kr as c,Qi as l,Qr as u,Rr as d,Ur as f,Wa as p,Wr as m,Xi as h,Xr as g,Yi as _,Zi as v,Zr as y,_a as b,ea as x,ei as S,na as C,ni as w,qr as T,ra as E,ri as D,ta as O,ti as k}from"./utils-CtzgibkN.js";import{n as A,o as j,s as M,u as N}from"./useRender-BP5vR6yH.js";var P=e(t());function F(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}var I=`data-composite-item-active`,L=[];function R(e){let{itemSizes:t,cols:n=1,loopFocus:i=!0,onLoop:o,dense:u=!1,orientation:d=`both`,direction:A,highlightedIndex:j,onHighlightedIndexChange:M,rootRef:I,enableHomeAndEndKeys:R=!1,stopEventPropagation:B=!1,disabledIndices:V,modifierKeys:H=L}=e,[U,W]=P.useState(0),G=n>1,K=P.useRef(null),q=N(K,I),J=P.useRef([]),Y=P.useRef(!1),X=j??U,Z=p((e,t=!1)=>{if((M??W)(e),t){let t=J.current[e];D(K.current,t,A,d)}}),Q=p(e=>{if(e.size===0||Y.current)return;Y.current=!0;let t=Array.from(e.keys()),n=t.find(e=>e?.hasAttribute(`data-composite-item-active`))??null,r=n?t.indexOf(n):-1;r!==-1&&Z(r),D(K.current,n,A,d)}),ee=p((e,t,n)=>o?o?.(e,t,n,J):n),$=P.useMemo(()=>({"aria-orientation":d===`both`?void 0:d,ref:q,onFocus(e){let t=K.current,n=b(e.nativeEvent);t&&n!=null&&w(n)&&n.setSelectionRange(0,n.value.length??0)},onKeyDown(e){let p=R?s:m;if(!p.has(e.key)||z(e,H)||!K.current)return;let D=A===`rtl`,j=D?a:c,M={horizontal:j,vertical:f,both:j}[d],N=D?c:a,P={horizontal:N,vertical:T,both:N}[d],I=b(e.nativeEvent);if(I!=null&&w(I)&&!F(I)){let t=I.selectionStart,n=I.selectionEnd,r=I.value??``;if(t==null||e.shiftKey||t!==n||e.key!==P&&t<r.length||e.key!==M&&t>0)return}let L=X,U=O(J,V),W=x(J,V);if(G){let a=t||Array.from({length:J.current.length},()=>({width:1,height:1})),o=_(a,n,u),s=o.findIndex(e=>e!=null&&!E(J.current,e,V)),c=o.reduce((e,t,n)=>t!=null&&!E(J.current,t,V)?n:e,-1);L=o[r(o.map(e=>e==null?null:J.current[e]),{event:e,orientation:d,loopFocus:i,onLoop:ee,cols:n,disabledIndices:l([...V||J.current.map((e,t)=>E(J.current,t)?t:void 0),void 0],o),minIndex:s,maxIndex:c,prevIndex:v(X>W?U:X,a,o,n,e.key===`ArrowDown`?`bl`:e.key===`ArrowRight`?`tr`:`tl`),rtl:D})]}let q={horizontal:[j],vertical:[f],both:[j,f]}[d],Y={horizontal:[N],vertical:[T],both:[N,T]}[d],Q=G?p:{horizontal:R?y:g,vertical:R?k:S,both:p}[d];R&&(e.key===`Home`?L=U:e.key===`End`&&(L=W)),L===X&&(q.includes(e.key)||Y.includes(e.key))&&(i&&L===W&&q.includes(e.key)?(L=U,o&&(L=o(e,X,L,J))):i&&L===U&&Y.includes(e.key)?(L=W,o&&(L=o(e,X,L,J))):L=h(J.current,{startingIndex:L,decrement:Y.includes(e.key),disabledIndices:V})),L!==X&&!C(J.current,L)&&(B&&e.stopPropagation(),Q.has(e.key)&&e.preventDefault(),Z(L,!0),queueMicrotask(()=>{J.current[L]?.focus()}))}}),[n,u,A,V,J,R,X,G,t,i,o,ee,q,H,Z,d,B]);return P.useMemo(()=>({props:$,highlightedIndex:X,onHighlightedIndexChange:Z,elementsRef:J,disabledIndices:V,onMapChange:Q,relayKeyboardEvent:$.onKeyDown}),[$,X,Z,J,V,Q])}function z(e,t){for(let n of u.values())if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}var B=e(n());function V(e){let{render:t,className:n,style:r,refs:a=j,props:s=j,state:c=M,stateAttributesMapping:l,highlightedIndex:u,onHighlightedIndexChange:f,orientation:p,dense:m,itemSizes:h,loopFocus:g,onLoop:_,cols:v,enableHomeAndEndKeys:y,onMapChange:b,stopEventPropagation:x=!0,rootRef:S,disabledIndices:C,modifierKeys:w,highlightItemOnHover:T=!1,tag:E=`div`,...D}=e,{props:O,highlightedIndex:k,onHighlightedIndexChange:N,elementsRef:F,onMapChange:I,relayKeyboardEvent:L}=R({itemSizes:h,cols:v,loopFocus:g,onLoop:_,dense:m,orientation:p,highlightedIndex:u,onHighlightedIndexChange:f,rootRef:S,stopEventPropagation:x,enableHomeAndEndKeys:y,direction:d(),disabledIndices:C,modifierKeys:w}),z=A(E,e,{state:c,ref:a,props:[O,...s,D],stateAttributesMapping:l}),V=P.useMemo(()=>({highlightedIndex:k,onHighlightedIndexChange:N,highlightItemOnHover:T,relayKeyboardEvent:L}),[k,N,T,L]);return(0,B.jsx)(o.Provider,{value:V,children:(0,B.jsx)(i,{elementsRef:F,onMapChange:e=>{b?.(e),I(e)},children:z})})}export{I as n,V as t};
2
+ //# sourceMappingURL=CompositeRoot-BBK88_pH.js.map
@@ -0,0 +1,2 @@
1
+ import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{mr as i,ou as a,t as o}from"./utils-CtzgibkN.js";import{Au as s,Ca as c,Hc as l,Hd as u,hu as d,td as f,wa as p}from"./src-aYUfWMsw.js";import{B as m,nt as h}from"./runtime-DciS6GP9.js";import{t as g}from"./spinner-DiQtYQvU.js";import{i as _,n as ee}from"./radio-group-YcYZQjQu.js";import{t as te}from"./input-BwujRX3Y.js";import{t as v}from"./preview-eatXH_DC.js";import{r as ne,t as re}from"./alert-DNQ3Wqlu.js";import{t as y}from"./runtimeModeConfig-B8OcO6E5.js";import{t as b}from"./AuthSurfaceShell-Cfzl0v4C.js";var x=n(),S=e(t(),1),C=e(r(),1),w={"read-only":{label:`Read only`,description:`Read projects and threads. Cannot start, message or change anything.`,icon:a},...y};function ie(e){return v(new URL(`http://${e}`).hostname)}var T=`Could not reach this environment. Try again.`,E=l(c);function D(e){return m(h.pipe(s(e),f(e=>typeof e==`object`&&e&&`redirectTo`in e?{kind:`redirect`,url:e.redirectTo}:{kind:`ok`,value:e}),d(e=>u({kind:`error`,message:E(e)?e.message:T})))).catch(()=>({kind:`error`,message:T}))}function ae(){return Object.fromEntries(new URL(window.location.href).searchParams)}function oe(e,t){return e.csrfToken!==void 0&&(e.oneClickAccess??[]).includes(t)}function O(){let e=(0,x.c)(71),[t]=(0,S.useState)(ae),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={status:`loading`},e[0]=n):n=e[0];let[r,a]=(0,S.useState)(n),[o,s]=(0,S.useState)(`read-only`),[c,l]=(0,S.useState)(``),[u,d]=(0,S.useState)(``),[f,m]=(0,S.useState)(null),h,_;e[1]===t?(h=e[2],_=e[3]):(h=()=>{let e=!1;return D(e=>e.mcpOAuth.approval({payload:t})).then(t=>{e||(t.kind===`redirect`?window.location.replace(t.url):a(t.kind===`error`?{status:`invalid`,message:t.message}:{status:`ready`,details:t.value}))}),()=>{e=!0}},_=[t],e[1]=t,e[2]=h,e[3]=_),(0,S.useEffect)(h,_);let v;e[4]!==o||e[5]!==t||e[6]!==r.details||e[7]!==r.status||e[8]!==c?(v=async e=>{if(r.status!==`ready`)return;m(e),d(``);let{csrfToken:n}=r.details,i=e===`deny`?{_tag:`deny`}:n!==void 0&&oe(r.details,o)?{_tag:`browser-session`,access:o,csrfToken:n}:{_tag:`pairing-code`,access:o,code:c.trim()},a=await D(e=>e.mcpOAuth.decision({payload:{authorization:t,decision:i}}));a.kind===`redirect`?window.location.replace(a.url):(m(null),d(a.kind===`error`?a.message:`The sign-in could not continue.`))},e[4]=o,e[5]=t,e[6]=r.details,e[7]=r.status,e[8]=c,e[9]=v):v=e[9];let y=v;if(r.status===`loading`){let t;return e[10]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,C.jsxs)(b,{children:[(0,C.jsx)(k,{title:`Checking the sign-in request`,description:`One moment while this environment verifies the agent's request.`}),(0,C.jsx)(g,{className:`mt-6`,size:`lg`,tone:`muted`})]}),e[10]=t):t=e[10],t}if(r.status===`invalid`){let t;e[11]===r.message?t=e[12]:(t=(0,C.jsx)(k,{title:`This sign-in cannot continue`,description:r.message}),e[11]=r.message,e[12]=t);let n;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,C.jsx)(`p`,{className:`mt-4 text-sm text-muted-foreground`,children:`Close this page and start the sign-in again from your agent.`}),e[13]=n):n=e[13];let i;return e[14]===t?i=e[15]:(i=(0,C.jsxs)(b,{children:[t,n]}),e[14]=t,e[15]=i),i}let{details:w}=r,T;e[16]!==o||e[17]!==w?(T=oe(w,o),e[16]=o,e[17]=w,e[18]=T):T=e[18];let E=T,O;e[19]!==E||e[20]!==c||e[21]!==f?(O=f===null&&(E||c.trim().length>0),e[19]=E,e[20]=c,e[21]=f,e[22]=O):O=e[22];let A=O,j=`Connect ${w.clientName}`,M;e[23]===w.environmentHost?M=e[24]:(M=(0,C.jsxs)(C.Fragment,{children:[`This agent wants to use the threads in every project on`,` `,(0,C.jsx)(`span`,{className:`font-medium text-foreground`,children:w.environmentHost}),`.`]}),e[23]=w.environmentHost,e[24]=M);let N;e[25]!==j||e[26]!==M?(N=(0,C.jsx)(k,{title:j,description:M}),e[25]=j,e[26]=M,e[27]=N):N=e[27];let P;e[28]===w.redirectHost?P=e[29]:(P=(0,C.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:ie(w.redirectHost)?(0,C.jsxs)(C.Fragment,{children:[`The name is chosen by the agent. Approval returns to `,w.redirectHost,` on the computer that opened this page. Only approve a sign-in you just started.`]}):(0,C.jsxs)(C.Fragment,{children:[`The name is chosen by the agent. Approval gives access to whoever runs`,` `,(0,C.jsx)(`span`,{className:`font-medium text-foreground`,children:w.redirectHost}),`. Only approve a sign-in you just started there.`]})}),e[28]=w.redirectHost,e[29]=P);let F;e[30]!==A||e[31]!==y?(F=e=>{e.preventDefault(),A&&y(`approve`)},e[30]=A,e[31]=y,e[32]=F):F=e[32];let I;e[33]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,C.jsx)(`span`,{id:`connect-agent-access-label`,className:`text-sm font-medium`,children:`What it may do`}),e[33]=I):I=e[33];let L;e[34]===Symbol.for(`react.memo_cache_sentinel`)?(L=e=>s(e),e[34]=L):L=e[34];let R;e[35]===o?R=e[36]:(R=p.literals.map(e=>(0,C.jsx)(se,{access:e,selected:e===o},e)),e[35]=o,e[36]=R);let z;e[37]!==o||e[38]!==R?(z=(0,C.jsx)(ee,{"aria-labelledby":`connect-agent-access-label`,value:o,onValueChange:L,children:R}),e[37]=o,e[38]=R,e[39]=z):z=e[39];let B;e[40]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,C.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Beyond read only, it can start, message and stop threads, and none of them can run with more than the mode you pick.`}),e[40]=B):B=e[40];let V;e[41]===z?V=e[42]:(V=(0,C.jsxs)(`div`,{className:`space-y-2`,children:[I,z,B]}),e[41]=z,e[42]=V);let H;e[43]!==E||e[44]!==c||e[45]!==f?(H=E?null:(0,C.jsxs)(`div`,{className:`space-y-2`,children:[(0,C.jsx)(`label`,{className:`text-sm font-medium`,htmlFor:`connect-agent-pairing-code`,children:`Pairing code`}),(0,C.jsx)(te,{id:`connect-agent-pairing-code`,autoCapitalize:`none`,autoComplete:`one-time-code`,autoCorrect:`off`,disabled:f!==null,nativeInput:!0,onChange:e=>l(e.currentTarget.value),placeholder:`Paste a one-time pairing code`,spellCheck:!1,value:c}),(0,C.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Create one in Settings → Connections, or run `,(0,C.jsx)(`code`,{children:`p4c auth pairing create`}),` on this machine.`]})]}),e[43]=E,e[44]=c,e[45]=f,e[46]=H):H=e[46];let U;e[47]===u?U=e[48]:(U=u?(0,C.jsx)(re,{variant:`error`,children:(0,C.jsx)(ne,{children:u})}):null,e[47]=u,e[48]=U);let W=!A,G=f===`approve`?`Approving…`:`Approve`,K;e[49]!==W||e[50]!==G?(K=(0,C.jsx)(i,{disabled:W,type:`submit`,children:G}),e[49]=W,e[50]=G,e[51]=K):K=e[51];let q=f!==null,J;e[52]===y?J=e[53]:(J=()=>void y(`deny`),e[52]=y,e[53]=J);let Y=f===`deny`?`Denying…`:`Deny`,X;e[54]!==q||e[55]!==J||e[56]!==Y?(X=(0,C.jsx)(i,{disabled:q,onClick:J,type:`button`,variant:`outline`,children:Y}),e[54]=q,e[55]=J,e[56]=Y,e[57]=X):X=e[57];let Z;e[58]!==K||e[59]!==X?(Z=(0,C.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[K,X]}),e[58]=K,e[59]=X,e[60]=Z):Z=e[60];let Q;e[61]!==F||e[62]!==V||e[63]!==H||e[64]!==U||e[65]!==Z?(Q=(0,C.jsxs)(`form`,{className:`mt-6 space-y-5`,onSubmit:F,children:[V,H,U,Z]}),e[61]=F,e[62]=V,e[63]=H,e[64]=U,e[65]=Z,e[66]=Q):Q=e[66];let $;return e[67]!==Q||e[68]!==N||e[69]!==P?($=(0,C.jsxs)(b,{children:[N,P,Q]}),e[67]=Q,e[68]=N,e[69]=P,e[70]=$):$=e[70],$}function k(e){let t=(0,x.c)(8),{title:n,description:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,C.jsx)(`p`,{className:`text-3xs font-semibold tracking-widest text-primary uppercase`,children:`Agent sign-in`}),t[0]=i):i=t[0];let a;t[1]===n?a=t[2]:(a=(0,C.jsx)(`h1`,{className:`mt-2 text-2xl font-semibold tracking-tight sm:text-3xl`,children:n}),t[1]=n,t[2]=a);let o;t[3]===r?o=t[4]:(o=(0,C.jsx)(`p`,{className:`mt-2 text-sm leading-relaxed text-muted-foreground`,children:r}),t[3]=r,t[4]=o);let s;return t[5]!==a||t[6]!==o?(s=(0,C.jsxs)(C.Fragment,{children:[i,a,o]}),t[5]=a,t[6]=o,t[7]=s):s=t[7],s}function se(e){let t=(0,x.c)(19),{access:n,selected:r}=e,{label:i,description:a,icon:s}=w[n],c=r?`border-primary bg-background ring-2 ring-inset ring-primary/25 dark:border-transparent dark:bg-primary/10 dark:ring-1 dark:ring-primary/30`:`border-border bg-background hover:bg-muted/50 dark:border-transparent dark:bg-white/[0.035] dark:hover:bg-accent`,l;t[0]===c?l=t[1]:(l=o(`flex cursor-pointer items-start gap-3 rounded-lg border px-3 py-2.5 text-left outline-none transition-[background-color,border-color,box-shadow]`,`focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background`,c),t[0]=c,t[1]=l);let u=r?`text-primary`:`text-muted-foreground`,d;t[2]===u?d=t[3]:(d=o(`mt-0.5 size-4 shrink-0`,u),t[2]=u,t[3]=d);let f;t[4]!==s||t[5]!==d?(f=(0,C.jsx)(s,{"aria-hidden":!0,className:d}),t[4]=s,t[5]=d,t[6]=f):f=t[6];let p;t[7]===i?p=t[8]:(p=(0,C.jsx)(`span`,{className:`block text-sm font-medium text-foreground`,children:i}),t[7]=i,t[8]=p);let m;t[9]===a?m=t[10]:(m=(0,C.jsx)(`span`,{className:`block text-xs text-muted-foreground`,children:a}),t[9]=a,t[10]=m);let h;t[11]!==p||t[12]!==m?(h=(0,C.jsxs)(`span`,{className:`min-w-0`,children:[p,m]}),t[11]=p,t[12]=m,t[13]=h):h=t[13];let g;return t[14]!==n||t[15]!==l||t[16]!==f||t[17]!==h?(g=(0,C.jsxs)(_,{value:n,className:l,children:[f,h]}),t[14]=n,t[15]=l,t[16]=f,t[17]=h,t[18]=g):g=t[18],g}export{w as n,O as t};
2
+ //# sourceMappingURL=ConnectAgentSurface-BWOV2eWU.js.map
@@ -1,2 +1,2 @@
1
- import{a as e}from"./react-BUfh6y28.js";import{n as t,t as n}from"./jsx-runtime-DJeoFXNw.js";import{t as r}from"./utils-DjbLtxuo.js";import{a as i,n as a,t as o}from"./tooltip-C7NAkYG3.js";var s=t(),c=e(n(),1);function l(e){switch(e){case`connected`:return`bg-success`;case`connecting`:case`reconnecting`:return`bg-warning`;case`error`:return`bg-destructive`;default:return`bg-muted-foreground/40`}}function u(e){return e===`connecting`||e===`reconnecting`?`bg-warning/60 duration-2000`:null}function d(e){let t=(0,s.c)(21),{tooltipText:n,dotClassName:l,pingClassName:u}=e,d;t[0]===u?d=t[1]:(d=u?(0,c.jsx)(`span`,{className:r(`absolute inline-flex h-full w-full animate-status-ping rounded-full`,u)}):null,t[0]=u,t[1]=d);let f;t[2]===l?f=t[3]:(f=r(`relative inline-flex size-2 rounded-full`,l),t[2]=l,t[3]=f);let p;t[4]===f?p=t[5]:(p=(0,c.jsx)(`span`,{className:f}),t[4]=f,t[5]=p);let m;t[6]!==d||t[7]!==p?(m=(0,c.jsxs)(c.Fragment,{children:[d,p]}),t[6]=d,t[7]=p,t[8]=m):m=t[8];let h=m;if(!n){let e;return t[9]===h?e=t[10]:(e=(0,c.jsx)(`span`,{className:`relative flex size-3 shrink-0 items-center justify-center`,children:h}),t[9]=h,t[10]=e),e}let g;t[11]!==h||t[12]!==n?(g=(0,c.jsx)(`button`,{type:`button`,"aria-label":n,className:`relative flex size-3 shrink-0 cursor-help items-center justify-center rounded-full outline-hidden`,children:h}),t[11]=h,t[12]=n,t[13]=g):g=t[13];let _=g,v;t[14]===_?v=t[15]:(v=(0,c.jsx)(i,{render:_}),t[14]=_,t[15]=v);let y;t[16]===n?y=t[17]:(y=(0,c.jsx)(a,{side:`top`,className:`whitespace-pre-wrap`,children:n}),t[16]=n,t[17]=y);let b;return t[18]!==v||t[19]!==y?(b=(0,c.jsxs)(o,{children:[v,y]}),t[18]=v,t[19]=y,t[20]=b):b=t[20],b}export{l as n,u as r,d as t};
2
- //# sourceMappingURL=ConnectionStatusDot-7Tjfknn6.js.map
1
+ import{a as e}from"./react-BUfh6y28.js";import{n as t,t as n}from"./jsx-runtime-DJeoFXNw.js";import{t as r}from"./utils-CtzgibkN.js";import{a as i,n as a,t as o}from"./tooltip-DDv-MvO4.js";var s=t(),c=e(n(),1);function l(e){switch(e){case`connected`:return`bg-success`;case`connecting`:case`reconnecting`:return`bg-warning`;case`error`:return`bg-destructive`;default:return`bg-muted-foreground/40`}}function u(e){return e===`connecting`||e===`reconnecting`?`bg-warning/60 duration-2000`:null}function d(e){let t=(0,s.c)(21),{tooltipText:n,dotClassName:l,pingClassName:u}=e,d;t[0]===u?d=t[1]:(d=u?(0,c.jsx)(`span`,{className:r(`absolute inline-flex h-full w-full animate-status-ping rounded-full`,u)}):null,t[0]=u,t[1]=d);let f;t[2]===l?f=t[3]:(f=r(`relative inline-flex size-2 rounded-full`,l),t[2]=l,t[3]=f);let p;t[4]===f?p=t[5]:(p=(0,c.jsx)(`span`,{className:f}),t[4]=f,t[5]=p);let m;t[6]!==d||t[7]!==p?(m=(0,c.jsxs)(c.Fragment,{children:[d,p]}),t[6]=d,t[7]=p,t[8]=m):m=t[8];let h=m;if(!n){let e;return t[9]===h?e=t[10]:(e=(0,c.jsx)(`span`,{className:`relative flex size-3 shrink-0 items-center justify-center`,children:h}),t[9]=h,t[10]=e),e}let g;t[11]!==h||t[12]!==n?(g=(0,c.jsx)(`button`,{type:`button`,"aria-label":n,className:`relative flex size-3 shrink-0 cursor-help items-center justify-center rounded-full outline-hidden`,children:h}),t[11]=h,t[12]=n,t[13]=g):g=t[13];let _=g,v;t[14]===_?v=t[15]:(v=(0,c.jsx)(i,{render:_}),t[14]=_,t[15]=v);let y;t[16]===n?y=t[17]:(y=(0,c.jsx)(a,{side:`top`,className:`whitespace-pre-wrap`,children:n}),t[16]=n,t[17]=y);let b;return t[18]!==v||t[19]!==y?(b=(0,c.jsxs)(o,{children:[v,y]}),t[18]=v,t[19]=y,t[20]=b):b=t[20],b}export{l as n,u as r,d as t};
2
+ //# sourceMappingURL=ConnectionStatusDot-ChSEZVFH.js.map
@@ -0,0 +1,3 @@
1
+ import{H as e,T as t,c as n,f as r,l as i,p as a,v as o,w as s}from"./GLTFLoader-DL026JyV.js";var c=new WeakMap,l=class extends t{constructor(e){super(e),this.decoderPath=``,this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL=``,this.defaultAttributeIDs={position:`POSITION`,normal:`NORMAL`,color:`COLOR`,uv:`TEX_COORD`},this.defaultAttributeTypes={position:`Float32Array`,normal:`Float32Array`,color:`Float32Array`,uv:`Float32Array`}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,n,r){let i=new o(this.manager);i.setPath(this.path),i.setResponseType(`arraybuffer`),i.setRequestHeader(this.requestHeader),i.setWithCredentials(this.withCredentials),i.load(e,e=>{this.parse(e,t,r)},n,r)}parse(t,n,r=()=>{}){this.decodeDracoFile(t,n,null,null,e,r).catch(r)}decodeDracoFile(e,t,n,r,i=s,a=()=>{}){let o={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:r||this.defaultAttributeTypes,useUniqueIDs:!!n,vertexColorSpace:i};return this.decodeGeometry(e,o).then(t).catch(a)}decodeGeometry(e,t){let n=JSON.stringify(t);if(c.has(e)){let t=c.get(e);if(t.key===n)return t.promise;if(e.byteLength===0)throw Error(`THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.`)}let r,i=this.workerNextTaskID++,a=e.byteLength,o=this._getWorker(i,a).then(n=>(r=n,new Promise((n,a)=>{r._callbacks[i]={resolve:n,reject:a},r.postMessage({type:`decode`,id:i,taskConfig:t,buffer:e},[e])}))).then(e=>this._createGeometry(e.geometry));return o.catch(()=>!0).then(()=>{r&&i&&this._releaseTask(r,i)}),c.set(e,{key:n,promise:o}),o}_createGeometry(e){let t=new i;e.index&&t.setIndex(new n(e.index.array,1));for(let r=0;r<e.attributes.length;r++){let i=e.attributes[r],a=i.name,o=i.array,s=i.itemSize,c=new n(o,s);a===`color`&&(this._assignVertexColorSpace(c,i.vertexColorSpace),c.normalized=!(o instanceof Float32Array)),t.setAttribute(a,c)}return t}_assignVertexColorSpace(t,n){if(n!==`srgb`)return;let i=new r;for(let n=0,r=t.count;n<r;n++)i.fromBufferAttribute(t,n),a.colorSpaceToWorking(i,e),t.setXYZ(n,i.r,i.g,i.b)}_loadLibrary(e,t){let n=new o(this.manager);return n.setPath(this.decoderPath),n.setResponseType(t),n.setWithCredentials(this.withCredentials),new Promise((t,r)=>{n.load(e,t,void 0,r)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;let e=typeof WebAssembly!=`object`||this.decoderConfig.type===`js`,t=[];return e?t.push(this._loadLibrary(`draco_decoder.js`,`text`)):(t.push(this._loadLibrary(`draco_wasm_wrapper.js`,`text`)),t.push(this._loadLibrary(`draco_decoder.wasm`,`arraybuffer`))),this.decoderPending=Promise.all(t).then(t=>{let n=t[0];e||(this.decoderConfig.wasmBinary=t[1]);let r=u.toString(),i=[`/* draco decoder */`,n,``,`/* worker */`,r.substring(r.indexOf(`{`)+1,r.lastIndexOf(`}`))].join(`
2
+ `);this.workerSourceURL=URL.createObjectURL(new Blob([i]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){let e=new Worker(this.workerSourceURL);e._callbacks={},e._taskCosts={},e._taskLoad=0,e.postMessage({type:`init`,decoderConfig:this.decoderConfig}),e.onmessage=function(t){let n=t.data;switch(n.type){case`decode`:e._callbacks[n.id].resolve(n);break;case`error`:e._callbacks[n.id].reject(n);break;default:console.error(`THREE.DRACOLoader: Unexpected message, "`+n.type+`"`)}},this.workerPool.push(e)}else this.workerPool.sort(function(e,t){return e._taskLoad>t._taskLoad?-1:1});let n=this.workerPool[this.workerPool.length-1];return n._taskCosts[e]=t,n._taskLoad+=t,n})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log(`Task load: `,this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this.workerSourceURL!==``&&URL.revokeObjectURL(this.workerSourceURL),this}};function u(){let e,t;onmessage=function(r){let i=r.data;switch(i.type){case`init`:e=i.decoderConfig,t=new Promise(function(t){e.onModuleLoaded=function(e){t({draco:e})},DracoDecoderModule(e)});break;case`decode`:let r=i.buffer,a=i.taskConfig;t.then(e=>{let t=e.draco,o=new t.Decoder;try{let e=n(t,o,new Int8Array(r),a),s=e.attributes.map(e=>e.array.buffer);e.index&&s.push(e.index.array.buffer),self.postMessage({type:`decode`,id:i.id,geometry:e},s)}catch(e){console.error(e),self.postMessage({type:`error`,id:i.id,error:e.message})}finally{t.destroy(o)}})}};function n(e,t,n,a){let o=a.attributeIDs,s=a.attributeTypes,c,l,u=t.GetEncodedGeometryType(n);if(u===e.TRIANGULAR_MESH)c=new e.Mesh,l=t.DecodeArrayToMesh(n,n.byteLength,c);else if(u===e.POINT_CLOUD)c=new e.PointCloud,l=t.DecodeArrayToPointCloud(n,n.byteLength,c);else throw Error(`THREE.DRACOLoader: Unexpected geometry type.`);if(!l.ok()||c.ptr===0)throw Error(`THREE.DRACOLoader: Decoding failed: `+l.error_msg());let d={index:null,attributes:[]};for(let n in o){let r=self[s[n]],l,u;if(a.useUniqueIDs)u=o[n],l=t.GetAttributeByUniqueId(c,u);else{if(u=t.GetAttributeId(c,e[o[n]]),u===-1)continue;l=t.GetAttribute(c,u)}let f=i(e,t,c,n,r,l);n===`color`&&(f.vertexColorSpace=a.vertexColorSpace),d.attributes.push(f)}return u===e.TRIANGULAR_MESH&&(d.index=r(e,t,c)),e.destroy(c),d}function r(e,t,n){let r=n.num_faces()*3,i=r*4,a=e._malloc(i);t.GetTrianglesUInt32Array(n,i,a);let o=new Uint32Array(e.HEAPF32.buffer,a,r).slice();return e._free(a),{array:o,itemSize:1}}function i(e,t,n,r,i,o){let s=o.num_components(),c=n.num_points()*s,l=c*i.BYTES_PER_ELEMENT,u=a(e,i),d=e._malloc(l);t.GetAttributeDataArrayForAllPoints(n,o,u,l,d);let f=new i(e.HEAPF32.buffer,d,c).slice();return e._free(d),{name:r,array:f,itemSize:s}}function a(e,t){switch(t){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32}}}export{l as DRACOLoader};
3
+ //# sourceMappingURL=DRACOLoader-DluumOSd.js.map
@@ -1,6 +1,6 @@
1
- import{c as e,d as t,g as n,h as r,i,n as a,o,r as s,s as c}from"./6OLKWJ4F-BeCI6be_.js";import{f as l,g as u,m as d,r as f,s as p,t as m,u as ee,y as h}from"./77XECAW3-BVGMXOi_.js";import{o as te,r as ne}from"./DKTLEL5E-DciMwFJ1.js";import{PeleError as g,_ as re,m as _}from"./lazy-DmPH_lNd.js";function v(e){return e===32||e>=9&&e<=13||e>127&&/\s/.test(String.fromCharCode(e))}function y(){let e=1/0;return(t,n)=>{if(!t.startsWith(`accDescr`,n))return-1;let r=t.length,i=n+8;for(;i<r&&(t.charCodeAt(i)===32||t.charCodeAt(i)===9);)i++;if(t.charCodeAt(i)===58){for(i++;i<r;i++){let e=t.charCodeAt(i);if(e===10||e===13||e===37&&t.charCodeAt(i+1)===37)break}return i}for(;i<r&&v(t.charCodeAt(i));)i++;if(t.charCodeAt(i)!==123||i>=e)return-1;let a=t.indexOf(`}`,i+1);return a===-1&&(e=i),a+1||-1}}var b=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`,x={name:`TITLE`,pattern:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/y,first:`t`},S={name:`ACC_TITLE`,pattern:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/y,first:`a`},C={name:`ACC_DESCR`,pattern:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/y,first:`a`,scanner:y};function w(e,t){return{name:e,pattern:e,longer:t}}function T(e,t){return{...i(e),longer:[t]}}function E(e){return{name:e,pattern:/[A-Z_a-z][\w-]*/y,first:b+`_`}}function D(e){return{name:e,pattern:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/y,first:`"'`}}function O(e){return[{name:e+`_WHITESPACE`,pattern:/[\t \r\n]+/y,hidden:!0,first:` \r
1
+ import{c as e,d as t,g as n,h as r,i,n as a,o,r as s,s as c}from"./6OLKWJ4F-C2xPWRsp.js";import{f as l,g as u,m as d,r as f,s as p,t as m,u as ee,y as h}from"./77XECAW3-BcsWkjLy.js";import{o as te,r as ne}from"./DKTLEL5E-DciMwFJ1.js";import{PeleError as g,_ as re,m as _}from"./lazy-JsFnphfP.js";function v(e){return e===32||e>=9&&e<=13||e>127&&/\s/.test(String.fromCharCode(e))}function y(){let e=1/0;return(t,n)=>{if(!t.startsWith(`accDescr`,n))return-1;let r=t.length,i=n+8;for(;i<r&&(t.charCodeAt(i)===32||t.charCodeAt(i)===9);)i++;if(t.charCodeAt(i)===58){for(i++;i<r;i++){let e=t.charCodeAt(i);if(e===10||e===13||e===37&&t.charCodeAt(i+1)===37)break}return i}for(;i<r&&v(t.charCodeAt(i));)i++;if(t.charCodeAt(i)!==123||i>=e)return-1;let a=t.indexOf(`}`,i+1);return a===-1&&(e=i),a+1||-1}}var b=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`,x={name:`TITLE`,pattern:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/y,first:`t`},S={name:`ACC_TITLE`,pattern:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/y,first:`a`},C={name:`ACC_DESCR`,pattern:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/y,first:`a`,scanner:y};function w(e,t){return{name:e,pattern:e,longer:t}}function T(e,t){return{...i(e),longer:[t]}}function E(e){return{name:e,pattern:/[A-Z_a-z][\w-]*/y,first:b+`_`}}function D(e){return{name:e,pattern:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/y,first:`"'`}}function O(e){return[{name:e+`_WHITESPACE`,pattern:/[\t \r\n]+/y,hidden:!0,first:` \r
2
2
  `},{...s,name:e+`_YAML`,first:`-`},{...o,name:e+`_DIRECTIVE`,first:` %`},{...c,name:e+`_SINGLE_LINE_COMMENT`,first:` %`}]}function k(e){if(!e.includes(`\\`))return e.slice(1,-1);let t=e.length-1,n=``;for(let r=1;r<t;r++){let i=e[r];i===`\\`&&r+1<t?(i=e[++r],n+=i===`n`?`
3
3
  `:i===`r`?`\r`:i===`t`?` `:i):n+=i}return n}function A(i,o,s,c,l,u){let d=new r(a(i,o,`railroad`),o,`railroad`),f={$type:s,rules:[]};for(d.expect(0);;){let r=d.kind;if(r===c){let e=t(d.take()),n=e[0];f.title=(n===`"`||n===`'`)&&e.endsWith(n)?l(e):e}else if(r===c+1)f.accTitle=n(d.take());else if(r===c+2)f.accDescr=e(d.take());else break}for(;d.kind!==-1;)f.rules.push(u(d));return f}var ie=[];function j(e){let t=e,n=t.element??t.primary??t.suffix,r=t.alternatives??t.elements??(n?[n]:ie);if(t.base){r=[t.base];for(let e of t.postfixes)e.except&&r.push(e.except)}return r}var M=e=>({type:`terminal`,value:e}),N=e=>({type:`nonterminal`,name:e}),P=e=>({type:`special`,text:e}),F=e=>({type:`optional`,element:e}),I=(e,t,n=1/0)=>({type:`repetition`,element:e,min:t,max:n});function L(e){return e.length===1?e[0]:{type:`sequence`,elements:e}}function R(e){return e.length===1?e[0]:{type:`choice`,alternatives:e}}function z(e,t){return e.rules.map(e=>({name:e.name,definition:B(e.definition,j,t)}))}function B(e,t,n){let r=[e],i=[t(e)],a=[[]];for(;;){let e=r.length-1,o=a[e];if(o.length<i[e].length){let n=i[e][o.length];r.push(n),i.push(t(n)),a.push([])}else{let t=n(r[e],o);if(e===0)return t;r.pop(),i.pop(),a.pop(),a[e-1].push(t)}}}var V=`0123456789`,H={name:`ABNF_RULENAME`,pattern:/[A-Za-z][A-Za-z0-9-]*/y,first:b},U={name:`ABNF_COMMENT`,pattern:/;[^\n\r]*/y,hidden:!0,first:`;`},W=[T(`railroad-abnf-beta`,H),w(`=`),w(`;`,[U]),w(`/`),w(`(`),w(`)`),w(`[`),w(`]`),x,S,C,H,{name:`ABNF_STRING`,pattern:/"[^"]*"/y,first:`"`},{name:`ABNF_NUMVAL`,pattern:/%[xXdDbB][0-9A-Fa-f]+(?:-[0-9A-Fa-f]+|\.[0-9A-Fa-f]+)*/y,first:`%`},{name:`ABNF_REPEAT`,pattern:/[0-9]*\*[0-9]*/y,first:V+`*`},{name:`ABNF_EXACT_REPEAT`,pattern:/[0-9]+/y,first:V},...O(`ABNF`),U];function G(e,t,n,r){let i={$type:`AbnfConcatenation`,elements:[]};return t.alternatives.push(i),{alternation:t,concatenation:i,node:e,close:n,repeat:r}}function ae(e){let t=[],n=G(void 0,{$type:`AbnfAlternation`,alternatives:[]},-2,void 0);for(;;){let r=e.kind===14||e.kind===15?e.take():void 0,i,a=e.kind;switch(a){case 12:i={$type:`AbnfStringLiteral`,value:e.take().slice(1,-1)};break;case 13:i={$type:`AbnfNumVal`,value:e.take()};break;case 11:i={$type:`AbnfRuleName`,name:e.take()};break;case 4:case 6:{e.i++;let i={$type:`AbnfAlternation`,alternatives:[]};t.push(n),n=G({$type:a===4?`AbnfGroup`:`AbnfOptionalGroup`,element:i},i,a+1,r);continue}default:e.fail(`a string, a number, a name, or an opening bracket`)}for(;;){n.concatenation.elements.push(r===void 0?{$type:`AbnfElement`,primary:i}:{$type:`AbnfElement`,repeat:r,primary:i});let a=e.kind;if(a===n.close)e.i++,i=n.node,r=n.repeat,n=t.pop();else{if(a===3)e.i++,n.concatenation={$type:`AbnfConcatenation`,elements:[]},n.alternation.alternatives.push(n.concatenation);else if(a!==12&&a!==13&&a!==11&&a!==4&&a!==6&&a!==14&&a!==15){if(t.length===0)return n.alternation;e.fail(`token of type '${W[n.close].name}'`)}break}}}}function oe(e){return A(e,W,`RailroadAbnf`,8,e=>e.slice(1,-1),e=>{let t=e.expect(11);e.expect(1);let n=ae(e);return e.expect(2),{$type:`AbnfRule`,name:t,definition:n}})}function se(e,t){switch(e.$type){case`AbnfAlternation`:return R(t);case`AbnfConcatenation`:return L(t);case`AbnfElement`:{let n=e.repeat;if(!n)return t[0];let r=n.indexOf(`*`),i=r===-1,a=r>0||i?parseInt(n,10):0,o=i?a:r<n.length-1?parseInt(n.slice(r+1),10):1/0;return a===0&&o===1?F(t[0]):I(t[0],a,o)}case`AbnfStringLiteral`:case`AbnfNumVal`:return M(e.value);case`AbnfRuleName`:return N(e.name);case`AbnfGroup`:return t[0];case`AbnfOptionalGroup`:return F(t[0])}}var ce=e=>z(e,se);function le(e,t){if(e.charCodeAt(t)!==63)return-1;let n=!1;for(let r=t+1;r<e.length;r++){let t=e.charCodeAt(r);if(t===63)return n?r+1:-1;if(t===59)return-1;n||=!v(t)}return-1}var ue=E(`EBNF_ID`),de={name:`EBNF_SPECIAL_SEQUENCE`,pattern:/\?(?=[^?;]*[^?\s;][^?;]*\?)[^?;]*\?/y,first:`?`,scanner:()=>le},fe=O(`EBNF`),pe={name:`EBNF_ISO_COMMENT`,pattern:/\(\*[\s\S]*?\*\)/y,hidden:!0,first:`(`,opener:/\(\*/y},me=[T(`railroad-ebnf-beta`,ue),w(`::=`),w(`=`),w(`;`),w(`|`),w(`,`),w(`(`,[pe]),w(`)`),w(`[`),w(`]`),w(`{`),w(`}`),w(`?`,[de]),w(`*`),w(`+`),w(`-`,[fe[1]]),x,S,C,ue,D(`EBNF_STRING`),de,...fe,{name:`EBNF_BLOCK_COMMENT`,pattern:/\/\*[\s\S]*?\*\//y,hidden:!0,first:`/`,opener:/\/\*/y},pe];function he(e,t,n,r){let i={$type:`EbnfSequence`,elements:[]};return t.alternatives.push(i),{choice:t,sequence:i,term:void 0,node:e,close:n,except:r}}var ge=[`EbnfGroup`,`EbnfOptional`,`EbnfRepetition`];function _e(e){let t=[],n=he(void 0,{$type:`EbnfChoice`,alternatives:[]},-2,!1),r=!1;for(;;){let i,a=e.kind;switch(a){case 20:i={$type:`EbnfTerminal`,value:k(e.take())};break;case 19:i={$type:`EbnfNonTerminal`,name:e.take()};break;case 21:i={$type:`EbnfSpecial`,text:e.take().slice(1,-1).trim()};break;case 6:case 8:case 10:{e.i++;let i={$type:`EbnfChoice`,alternatives:[]};t.push(n),n=he({$type:ge[a-6>>1],element:i},i,a+1,r),r=!1;continue}default:e.fail(`a terminal, a name, or an opening bracket`)}for(;;){r?(n.term.postfixes.push({$type:`EbnfExceptionPostfix`,except:i}),r=!1):(n.term={$type:`EbnfTerm`,base:i,postfixes:[]},n.sequence.elements.push(n.term));let a=n.term.postfixes;for(;;){let t=e.kind;if(t===12)a.push({$type:`EbnfOptionalPostfix`,operator:e.take()});else if(t===13)a.push({$type:`EbnfZeroOrMorePostfix`,operator:e.take()});else if(t===14)a.push({$type:`EbnfOneOrMorePostfix`,operator:e.take()});else break}let o=e.kind;if(o===n.close)e.i++,i=n.node,r=n.except,n=t.pop();else{if(o===15)e.i++,r=!0;else if(o===5)e.i++;else if(o===4)e.i++,n.sequence={$type:`EbnfSequence`,elements:[]},n.choice.alternatives.push(n.sequence);else if(o!==20&&o!==19&&o!==21&&o!==6&&o!==8&&o!==10){if(t.length===0)return n.choice;e.fail(`token of type '${me[n.close].name}'`)}break}}}}function ve(e){return A(e,me,`RailroadEbnf`,16,k,e=>{let t=e.expect(19);e.accept(2)||e.expect(1);let n={$type:`EbnfRule`,name:t,definition:_e(e)};return e.expect(3),n})}function ye(e,t){switch(e.$type){case`EbnfChoice`:return R(t);case`EbnfSequence`:return L(t);case`EbnfTerm`:{let n=t[0],r=1;for(let i of e.postfixes)n=i.$type===`EbnfOptionalPostfix`?F(n):i.$type===`EbnfExceptionPostfix`?{type:`sequence`,elements:[n,M(`-`),t[r++]]}:I(n,+(i.$type===`EbnfOneOrMorePostfix`));return n}case`EbnfTerminal`:return M(e.value);case`EbnfNonTerminal`:return N(e.name);case`EbnfSpecial`:return P(e.text);case`EbnfGroup`:return t[0];case`EbnfOptional`:return F(t[0]);case`EbnfRepetition`:return I(t[0],0)}}var be=e=>z(e,ye),K=E(`RR_ID`),q=e=>w(e,[K]),xe=[T(`railroad-beta`,K),q(`nonterminal`),q(`zeroOrMore`),q(`oneOrMore`),q(`sequence`),q(`optional`),q(`terminal`),q(`special`),q(`choice`),w(`=`),w(`;`),w(`(`),w(`,`),w(`)`),x,S,C,K,D(`RR_STRING`),...O(`RR`),{name:`RR_BLOCK_COMMENT`,pattern:/\/\*[\s\S]*?\*\//y,hidden:!0,first:`/`,opener:/\/\*/y}];function J(e){e.i++,e.expect(11);let t=k(e.expect(18));return e.expect(13),t}function Se(e){return{$type:e,element:void 0}}function Ce(e){let t=[];for(;;){let n;switch(e.kind){case 6:n={$type:`RailroadTerminalExpr`,value:J(e)};break;case 1:n={$type:`RailroadNonTerminalExpr`,name:J(e)};break;case 7:n={$type:`RailroadSpecialExpr`,text:J(e)};break;case 4:n={$type:`RailroadSequenceExpr`,elements:[]};break;case 8:n={$type:`RailroadChoiceExpr`,alternatives:[]};break;case 5:n=Se(`RailroadOptionalExpr`);break;case 3:n=Se(`RailroadOneOrMoreExpr`);break;case 2:n=Se(`RailroadZeroOrMoreExpr`);break;default:e.fail(`an expression`)}if(`elements`in n||`alternatives`in n||`element`in n)e.i++,e.expect(11),t.push(n);else for(;;){let r=t[t.length-1];if(r===void 0)return n;if(`element`in r)r.element=n;else if((`elements`in r?r.elements:r.alternatives).push(n),e.accept(12))break;e.expect(13),t.pop(),n=r}}}function we(e){return A(e,xe,`Railroad`,14,k,e=>{let t=e.expect(17);e.expect(9);let n=Ce(e);return e.expect(10),{$type:`RailroadRule`,name:t,definition:n}})}function Te(e,t){switch(e.$type){case`RailroadTerminalExpr`:return M(e.value);case`RailroadNonTerminalExpr`:return N(e.name);case`RailroadSpecialExpr`:return P(e.text);case`RailroadSequenceExpr`:return L(t);case`RailroadChoiceExpr`:return R(t);case`RailroadOptionalExpr`:return F(t[0]);default:return I(t[0],+(e.$type===`RailroadOneOrMoreExpr`))}}var Ee=e=>z(e,Te),De=E(`PEG_ID`),Oe=[T(`railroad-peg-beta`,De),w(`<-`),w(`;`),w(`/`),w(`&`),w(`!`),w(`?`),w(`*`),w(`+`),w(`(`),w(`)`),w(`.`),x,S,C,De,D(`PEG_STRING`),...O(`PEG`),{name:`PEG_LINE_COMMENT`,pattern:/#[^\n\r]*/y,hidden:!0,first:`#`}];function ke(e,t,n){let r={$type:`PegSequence`,elements:[]};return t.alternatives.push(r),{choice:t,sequence:r,node:e,operator:n}}function Ae(e){let t=[],n=ke(void 0,{$type:`PegOrderedChoice`,alternatives:[]},void 0);for(;;){let r=e.kind===4||e.kind===5?e.take():void 0,i;switch(e.kind){case 16:i={$type:`PegLiteral`,value:k(e.take())};break;case 15:i={$type:`PegIdentifier`,name:e.take()};break;case 11:i={$type:`PegAny`,dot:e.take()};break;case 9:{e.i++;let i={$type:`PegOrderedChoice`,alternatives:[]};t.push(n),n=ke({$type:`PegGroup`,element:i},i,r);continue}default:e.fail(`a literal, a name, a dot, or an opening parenthesis`)}for(;;){let a={$type:`PegSuffix`,primary:i};(e.kind===6||e.kind===7||e.kind===8)&&(a.operator=e.take()),n.sequence.elements.push(r===void 0?{$type:`PegPrefix`,suffix:a}:{$type:`PegPrefix`,operator:r,suffix:a});let o=e.kind;if(o===10&&t.length>0)e.i++,i=n.node,r=n.operator,n=t.pop();else{if(o===3)e.i++,n.sequence={$type:`PegSequence`,elements:[]},n.choice.alternatives.push(n.sequence);else if(o!==4&&o!==5&&o!==16&&o!==15&&o!==11&&o!==9){if(t.length===0)return n.choice;e.fail(`token of type ')'`)}break}}}}function je(e){return A(e,Oe,`RailroadPeg`,12,k,e=>{let t=e.expect(15);e.expect(1);let n={$type:`PegRule`,name:t,definition:Ae(e)};return e.expect(2),n})}function Me(e){switch(e.type){case`terminal`:return`"${e.value}"`;case`nonterminal`:return e.name;case`special`:return e.text;default:return`(...)`}}function Ne(e,t){let n=t[0];switch(e.$type){case`PegOrderedChoice`:return R(t);case`PegSequence`:return L(t);case`PegPrefix`:return e.operator?P(e.operator+Me(n)):n;case`PegSuffix`:return e.operator?e.operator===`?`?F(n):I(n,+(e.operator===`+`)):n;case`PegLiteral`:return M(e.value);case`PegIdentifier`:return N(e.name);case`PegAny`:return P(e.dot);case`PegGroup`:return n}}var Pe=e=>z(e,Ne),Fe=class{type=`railroad`;notation=`railroad`;title;accTitle;accDescr;rules=[];byName=new Map;setTitle(e){this.title=e}setAccTitle(e){this.accTitle=e.replace(/^\s+/g,``)}setAccDescription(e){this.accDescr=e.replace(/\n\s+/g,`
4
4
  `)}addRule(e){this.rules.push(e),this.byName.set(e.name,e)}getRule(e){return this.byName.get(e)}},Ie=/^\s*railroad-(ebnf-|abnf-|peg-)?beta/i;function Le(e){let t=Ie.exec(e);if(t===null)return;let n=t[1]?.toLowerCase();return n===`ebnf-`?`ebnf`:n===`abnf-`?`abnf`:n===`peg-`?`peg`:`railroad`}function Re(e,t){switch(t){case`ebnf`:{let t=ve(e);return[t,be(t)]}case`abnf`:{let t=oe(e);return[t,ce(t)]}case`peg`:{let t=je(e);return[t,Pe(t)]}default:{let t=we(e);return[t,Ee(t)]}}}function ze(e,t,n){let[r,i]=Re(t,n);e.notation=n,r.accDescr&&e.setAccDescription(r.accDescr),r.accTitle&&e.setAccTitle(r.accTitle),r.title&&e.setTitle(r.title);for(let t of i)e.addRule(t)}function Be(e,t){let n=Le(e);if(n===void 0)throw new g(`No railroad diagram keyword found.`,`syntax`,{type:`railroad`});let r=new Fe;return t&&(r.title=t),ze(r,e,n),r}var Ve=12,He=6,Ue=18,Y=12,X=7;function Z(e,t,n,r){let i=e.railroad?.[t];return typeof i==`number`&&i>=0?Math.min(i,r):n}var We=/[\n\r\t]/g;function Q(e){return(e.includes(`¶ß`)?_(e.replace(/&/g,`&amp;`)):e).replace(We,e=>e===`
5
5
  `?`\\n`:e===`\r`?`\\r`:`\\t`)}function $(e,t){for(let n=t,r=e.length-1;n<r;n++,r--){let t=e[n];e[n]=e[r],e[r]=t}}function Ge(e){return Math.ceil(e/2)*2}function Ke(e,t,n,r,i){let a=i.height/2;return{kind:e,width:Math.max(Ge(i.measurer.width(t,i.size,r)+2*i.padding),i.height),up:a,down:a,kids:ie,text:t,id:n,reach:0}}function qe(e,t){if(t===1/0&&e<=1)return``;let n=e=>Number.isFinite(e)?String(e):`∞`;return e===t?n(e)+`×`:t===1/0?`≥`+n(e)+`×`:e===0?`≤`+n(t)+`×`:n(e)+`–`+n(t)+`×`}function Je(e,t,n,r){return Math.max(e+t.down+r.sep+n.up,2*r.arc)}function Ye(e,t){let n=Math.max(e.up+t.sep,2*t.arc);return{kind:5,width:e.width+4*t.arc,up:n,down:e.down,kids:[e],text:``,id:``,reach:n}}function Xe(e,t,n=1/0){let r=new Map,i=[[e,n]];for(let e=0;n!==1/0&&e<i.length;e++){let[n,a]=i[e];r.set(n,a);let o=n.type===`choice`||n.type===`optional`?4*t.arc:n.type===`repetition`?(n.min===0?6:2)*t.arc:n.type===`sequence`?6*t.arc:0;for(let e of j(n))i.push([e,Math.max(40,a-o)])}return B(e,j,(e,n)=>{let i=r.get(e)??1/0;switch(e.type){case`terminal`:{let n=Q(e.value);return Ke(0,/^ +$/.test(n)?`␣`.repeat(n.length):n,``,4,t)}case`nonterminal`:return Ke(1,Q(e.name),e.name,0,t);case`special`:return Ke(2,`? `+Q(e.text)+` ?`,``,2,t);case`sequence`:{let e=Math.max(0,n.length-1)*t.gap,r=0,a=0;for(let t of n)e+=t.width,r=Math.max(r,t.up),a=Math.max(a,t.down);let o={kind:3,width:e,up:r,down:a,kids:n,text:``,id:``,reach:0};if(e<=i||n.length<2)return o;let s=[],c=[],l=0,u=()=>{let e=0,t=0;for(let n of c)e=Math.max(e,n.up),t=Math.max(t,n.down);s.push({kind:3,width:l,up:e,down:t,kids:c,text:``,id:``,reach:0}),c=[],l=0};for(let e of n)c.length&&l+t.gap+e.width>Math.max(40,i-6*t.arc)&&u(),l+=(c.length?t.gap:0)+e.width,c.push(e);if(u(),s.length<2)return o;let d=0,f=0;for(let e=0;e<s.length;e++)d=Math.max(d,s[e].width),e&&(f+=s[e-1].down+Math.max(t.sep,2*t.arc)+s[e].up);return{kind:7,width:d+6*t.arc,up:s[0].up,down:f+s[s.length-1].down,kids:s,text:``,id:``,reach:0}}case`choice`:{let e=0,r=0;for(let i=0;i<n.length;i++)e=Math.max(e,n[i].width),i>0&&(r=Je(r,n[i-1],n[i],t));let i=n[n.length-1];return{kind:4,width:e+4*t.arc,up:n.length>0?n[0].up:0,down:i?r+i.down:0,kids:n,text:``,id:``,reach:0}}case`optional`:return Ye(n[0],t);case`repetition`:{let{min:r,max:i}=e,a=n[0];if(r===1&&i===1)return a;let o=qe(r,i),s=Math.max(a.down+t.sep,2*t.arc),c=o===``?0:Ge(t.measurer.width(o,Y,0)),l={kind:6,width:Math.max(a.width,c)+2*t.arc,up:a.up,down:s+(o===``?X/2+1:Y+6),kids:[a],text:o,id:``,reach:s};return r===0?Ye(l,t):l}}})}function Ze(e,t,n){return te(n,r=>Qe(e,t,n,r))}function Qe(e,t,n,r){let i=n.fontSize??16,a=Z(t,`fontSize`,0,200),o=a||Math.round(i*.875),s=a||i,c=Z(t,`padding`,-1,200),te=Math.round(o*1.5),g={measurer:n.measurer??re(n.fontFamily,n.fontFamilyMono),size:o,padding:c<0?12:c,height:Ge(te+(c<0?9:2*c)),gap:Math.min(Z(t,`horizontalSeparation`,16,500),r?12:1/0),sep:Z(t,`verticalSeparation`,10,500),arc:Math.min(Z(t,`arcRadius`,10,200),r?6:1/0)},_=t.railroad?.showMarkers===!1?0:Z(t,`markerRadius`,4,50),v=Z(t,`strokeWidth`,0,20),y=v>0?` stroke-width="${l(v)}"`:``,b=n.padding??8,{arc:x}=g,S=l(x),C=(e,t,n)=>`a${S},${S} 0 0 ${e} ${t}${S},${n}${S}`,w=C(1,``,``),T=C(0,``,``),E=C(0,``,`-`),D=C(1,``,`-`),O=C(0,`-`,``),k=C(0,`-`,`-`),A=p(e.title,!1,g.measurer,i,r?ne(n):4e3,1),ie=A.height>0?A.height+16:0,j=Math.round(s*1.5),M=o*.35,N=g.height/2,P=``,F=``,I=``,L=(e,t,n)=>{n>e&&(P+=`M${l(e)},${l(t)}H${l(n)}`)},R=(e,t,n)=>{let r=[e],i=[t,n];for(;r.length>0;){let e=r.pop(),t=i.pop(),n=i.pop(),a=e.kids,o=n+e.width;switch(e.kind){case 3:{let e=o;for(let n=a.length-1;n>=0;n--)e-=a[n].width,r.push(a[n]),i.push(e,t),n>0&&L(e-g.gap,t,e),e-=g.gap;break}case 7:{let e=n+2*x,s=r.length,c=0;L(n,t,e);for(let s=0;s<a.length;s++){let u=a[s],d=t+c;if(r.push(u),i.push(d,e),s+1<a.length){let r=a[s+1],i=c+u.down+Math.max(g.sep,2*x)+r.up,f=t+c+u.down+Math.max(g.sep,2*x)/2;P+=`M${l(e+u.width)},${l(d)}H${l(o-2*x)}V${l(f)}H${l(n+x)}V${l(t+i)}H${l(e)}`,F+=`M${l(e-X)},${l(t+i-X/2)}l${X},${X/2}l${-X},${X/2}z`,c=i}else P+=`M${l(e+u.width)},${l(d)}H${l(o-x)}V${l(t)}H${l(o)}`}$(r,s),$(i,2*s);break}case 4:{let s=e.width-4*x,c=n+x,u=o-x,d=r.length,f=0;for(let e=0;e<a.length;e++){let d=a[e];e>0&&(f=Je(f,a[e-1],d,g));let p=t+f,m=n+2*x+(s-d.width)/2,ee=e===a.length-1;e===0?(L(n,t,m),L(m+d.width,t,o)):P+=(ee?`M${l(n)},${l(t)}${w}V${l(p-x)}`:`M${l(c)},${l(p-x)}`)+T+(m>c+x?`H${l(m)}`:``)+`M${l(m+d.width)},${l(p)}`+(m>c+x?`H${l(u-x)}`:``)+E+(ee?`V${l(t+x)}${D}`:``),r.push(d),i.push(p,m)}$(r,d),$(i,2*d);break}case 5:{let s=a[0],c=n+2*x;L(n,t,c),L(c+s.width,t,o),P+=`M${l(n)},${l(t)}${E}V${l(t-e.reach+x)}${D}H${l(o-2*x)}${w}V${l(t-x)}${T}`,r.push(s),i.push(c,t);break}case 6:{let s=a[0],c=n+(e.width-s.width)/2,u=t+e.reach,d=n+e.width/2;L(n,t,c),L(c+s.width,t,o),P+=`M${l(n+x)},${l(t)}${O}V${l(u-x)}${T}H${l(o-x)}${E}V${l(t+x)}${k}`,F+=`M${l(d-X/2)},${l(u)}l${X},${-X/2}v${X}z`,e.text!==``&&(I+=`<text class="pele-edge-label pele-count" x="${l(d)}" y="${l(u+Y+3)}" font-size="${Y}" fill="var(--_m)">${h(e.text)}</text>`),r.push(s),i.push(c,t);break}default:{let r=e.text,i=r.startsWith(` `)||r.endsWith(` `)||r.includes(` `)?` xml:space="preserve"`:``,a=`<rect x="${l(n)}" y="${l(t-N)}" width="${l(e.width)}" height="${l(g.height)}"`,o=`<text x="${l(n+e.width/2)}" y="${l(t+M)}"${i}`;e.kind===0?I+=`<g class="pele-node pele-terminal">${a} rx="${l(N)}" fill="var(--_s)" stroke="var(--_b)"${y}/>${o} font-family="${ee}">${h(r)}</text></g>`:e.kind===1?I+=`<g class="pele-node pele-nonterminal" data-id="${f(e.id)}">${a} fill="var(--_bg)" stroke="var(--_b)"${y}${d}/>${o}>${h(r)}</text></g>`:I+=`<g class="pele-node pele-special">${a} fill="var(--_bg)" stroke="var(--_b)" stroke-dasharray="4 3"${y}${d}/>${o} font-style="italic"><tspan fill="var(--_m)">? </tspan>${h(r.slice(2,-2))}<tspan fill="var(--_m)"> ?</tspan></text></g>`}}}},z=``,B=A.width,V=b+ie,H=b+A.height;for(let t of e.rules){let e=Xe(t.definition,g,r?Math.max(80,(n.maxWidth??320)-2*b-4*_-2*Ve-1):1/0),i=Q(t.name),a=V+j+He+e.up,o=b+2*_,c=o+Ve,u=c+e.width+Ve;P=``,F=``,I=``,L(o,a,c),L(c+e.width,a,u),R(e,c,a);let d=_>0?`<circle class="pele-marker pele-start" cx="${l(b+_)}" cy="${l(a)}" r="${l(_)}" fill="var(--_l)"/><circle class="pele-marker pele-end" cx="${l(u+_)}" cy="${l(a)}" r="${l(_)}" fill="var(--_l)"/>`:``;z+=`<g class="pele-rule" data-id="${f(t.name)}"><text class="pele-rule-name" x="${l(b)}" y="${l(V+j/2+s*.35)}" font-size="${l(s)}" font-weight="var(--_hw)" text-anchor="start">${h(i)}</text><path class="pele-edge pele-track" d="${P}" fill="none" stroke="var(--_l)"${y}/>`+(F?`<path class="pele-marker" d="${F}" fill="var(--_l)"/>`:``)+d+I+`</g>`,B=Math.max(B,u+2*_-b,g.measurer.width(i,s,1)),H=a+e.down,V=H+g.sep+Ue}let U=Math.ceil(B+2*b),W=Math.ceil(H+b),G=m(A,U/2,b+A.height/2,` class="pele-title" font-weight="var(--_tw)"`)+(z?`<g class="pele-rules" transform="translate(0.5,0.5)" font-size="${l(o)}" text-anchor="middle">${z}</g>`:``);return{svg:u(`railroad`,U,W,i,n,e,G),width:U,height:W,links:[]}}var $e={type:`railroad`,parse:(e,t,n)=>Be(e,n),render:Ze};export{$e as railroad};
6
- //# sourceMappingURL=DRLTVNUE-BPoomdQn.js.map
6
+ //# sourceMappingURL=DRLTVNUE-DFsymRUq.js.map
@@ -1,6 +1,6 @@
1
- import{_ as e,c as t,f as n,g as r,h as i,i as a,m as o,n as s,r as c,s as l,t as u,v as d,y as f}from"./77XECAW3-BVGMXOi_.js";import{r as p}from"./DKTLEL5E-DciMwFJ1.js";import{t as m}from"./TSHNXIZL-Cs6g4gXN.js";import{i as h,o as ee,t as te}from"./5N7A7DKN-B3iWX-TC.js";import{n as ne,r as g,t as _}from"./CXAC5362-C1eQCQMX.js";import{PeleError as v,_ as re,g as y,n as b}from"./lazy-DmPH_lNd.js";var x=class{type=`kanban`;title;sections=[];getType=_;last;sectionLevel=0;misplaced;addNode(e,t,n,r,i){let a={id:t,level:e,label:n};if(i!==void 0){let e=i.includes(`
1
+ import{_ as e,c as t,f as n,g as r,h as i,i as a,m as o,n as s,r as c,s as l,t as u,v as d,y as f}from"./77XECAW3-BcsWkjLy.js";import{r as p}from"./DKTLEL5E-DciMwFJ1.js";import{t as m}from"./TSHNXIZL-DU0_NvP6.js";import{i as h,o as ee,t as te}from"./5N7A7DKN-BQIARO23.js";import{n as ne,r as g,t as _}from"./CXAC5362-BNdOJTpr.js";import{PeleError as v,_ as re,g as y,n as b}from"./lazy-JsFnphfP.js";var x=class{type=`kanban`;title;sections=[];getType=_;last;sectionLevel=0;misplaced;addNode(e,t,n,r,i){let a={id:t,level:e,label:n};if(i!==void 0){let e=i.includes(`
2
2
  `)?i+`
3
3
  `:`{
4
4
  `+i+`
5
5
  }`,t;try{t=b(e)}catch(e){throw new v(`Metadata of "${a.id}" is not valid YAML. ${e.message}`,`syntax`,{type:`kanban`})}if(typeof t==`object`&&t&&!Array.isArray(t)){let e=t.shape?String(t.shape):``;if(e!==e.toLowerCase()||e.includes(`_`))throw new v(`No such shape: ${e}. Shape names should be lowercase.`,`semantic`,{type:`kanban`});t.label&&(a.label=String(t.label)),t.icon&&(a.icon=String(t.icon)),t.assigned&&(a.assigned=String(t.assigned)),t.ticket&&(a.ticket=String(t.ticket)),t.priority&&(a.priority=String(t.priority))}}if(this.misplaced)throw new v(`Items without section detected, found section ("${this.misplaced.label}")`,`semantic`,{type:`kanban`});let o=this.sections;if(o.length===0&&(this.sectionLevel=e),this.last=a,e===this.sectionLevel){let e=a;e.items=[],o.push(e)}else o[o.length-1].items.push(a),e<this.sectionLevel&&(this.misplaced=a)}decorateNode(e){let t=this.last;!e||!t||(e.icon&&(t.icon=e.icon),e.class&&(t.cssClasses=e.class))}};function S(e,t){g(e,t,!0)}var C=12,w=8,T=10,E=8,ie=4,D=6,ae=new Map([[`very high`,`stroke="${t}"`],[`high`,`stroke="${t}" opacity="0.5"`],[`low`,`stroke="var(--_m)" opacity="0.5"`],[`very low`,`stroke="var(--_m)"`]]);function O(e,t,n,r,i,o=0){let s=l(e,t,n,r,i,o);if(s.width<=i)return s;let c=[],u=[],d=0,f=[],p=0,m=()=>{c.push(f),u.push(p),d=Math.max(d,p),f=[],p=0};for(let e=0;e<s.lines.length;e++)if(s.widths[e]<=i)f=s.lines[e],p=s.widths[e],m();else{for(let t of s.lines[e]){if(t.icon!==void 0||t.math){p>0&&p+t.width>i&&m(),f.push(t),p+=t.width;continue}let e=``,a=p;for(let o of t.text){let s=n.width(o,r,t.style);p>0&&p+s>i&&(e&&f.push({text:e,style:t.style,width:p-a}),m(),e=``,a=0),e+=o,p+=s}e&&f.push({text:e,style:t.style,width:p-a})}m()}let h={...s,lines:c,widths:u,width:d,height:c.length*s.lineHeight};return s.heights?a(h):h}function k(e,t,r,a,o,c=!1){let l=``;for(let p=0;p<e.lines.length;p++){let m=e.lines[p],h=r+i(e,p);if(m.length===1&&m[0].icon===void 0&&m[0].math===void 0)l+=`<text${d(a,m[0].style)} x="${n(t)}" y="${n(h+e.size*.35)}"${c?` text-anchor="end"`:``}>${f(m[0].text)}</text>`;else{let n=e.widths[p];l+=u(s(e,p),t+(c?-n:n)/2,h,a,o)}}return l}var A=e=>!!e&&y(e)!==``;function j(t,i,a){let s=a.fontSize??16,d=Math.round(s*.875),g=Math.round(s*1.5),_=Math.round(d*1.5),v=a.measurer??re(a.fontFamily),y=a.padding??8,b=a.icons,x=i.kanban??{},S=x.sectionWidth,j=d*1.25,M=0,N=(e,t,n)=>{if(e&&e.includes(`$$`))for(let r of l(e,!0,v,t,1/0).lines)for(let e of r)e.math&&(M=Math.max(M,e.math.width+n))};for(let e of t.sections){let t=v.width(String(e.items.length),d,0);N(e.label,s,2*w+8+t+12+(A(e.icon)?j+D:0));for(let t of e.items){let e=2*(w+T);N(t.label,d,e+(A(t.icon)?j+D:0)),N(t.ticket,d,e),N(t.assigned,d,e)}}let P=Math.max(typeof S==`number`&&S>0?Math.min(Math.max(S,80),2e3):200,Math.ceil(M)),F=a.maxWidth!==void 0&&a.maxWidth>0?a.maxWidth-2*y:1/0,I=t.sections.length,L=I*(P+C)-C<=F,R=L?Math.max(I,1):Math.max(1,Math.floor((F+C)/(P+C))),z=L?P:Math.max(Math.min(P,F),Math.min(Math.floor((F+C)/R)-C,P*2),Math.ceil(M)),oe=typeof x.ticketBaseUrl==`string`?x.ticketBaseUrl:``,B=z-2*w,V=B-2*T,H=[],U=t.sections,W=[],G=[],K=[],q=g,J=[];for(let e of U){let t=v.width(String(e.items.length),d,0),n=t+12+(A(e.icon)?j+D:0),r=O(e.label,!0,v,s,B-8-n,1);q=Math.max(q,r.height),G.push(t),W.push(r);let i=[],a=0;for(let t of e.items){let e=O(t.label,!0,v,d,V-(A(t.icon)?j+D:0)),n=O(t.ticket,!1,v,d,V),r=O(t.assigned,!1,v,d,V),o=n.width+r.width+8>V?n.height+r.height:Math.max(n.height,r.height),s=2*T+Math.max(e.height,_)+(o?ie+o:0);i.push({item:t,label:e,ticket:n,assigned:r,meta:o,height:s}),a+=s+E}K.push(i),J.push(a)}q+=2*w;let Y=[],X=[];for(let e=0,t=0;e<U.length;e+=R){let n=E;for(let t=e;t<Math.min(e+R,U.length);t++)n=Math.max(n,J[t]);X.push(t),Y.push(q+n),t+=q+n+C}let se=Y.length>0?X[X.length-1]+Y[Y.length-1]:0,Z=m(t.title,v,s,p(a)),ce=Z.height>0?Z.height+16:0,le=Math.max(Math.min(U.length,R)*(z+C)-C,0),Q=Math.max(le,Z.width),ue=y+(Q-le)/2,de=z-w-4,fe=``;for(let t=0;t<U.length;t++){let r=U[t],i=Math.floor(t/R),s=`<rect width="${z}" height="${n(Y[i])}" fill="var(--_s)"${o}/>`+k(W[t],w+4,w,` class="pele-cluster-label" font-weight="var(--_hw)"`,b)+`<text class="pele-count" x="${de}" y="${n(w+g/2+d*.35)}" text-anchor="end" font-size="${d}" fill="var(--_m)">${r.items.length}</text>`;A(r.icon)&&(s+=ne(r.icon,de-G[t]-D-j,w+(g-j)/2,j,b));let l=q;for(let r of K[t]){let t=r.item,i=(t.priority??``).trim().toLowerCase(),u=ae.get(i),p=`<rect width="${B}" height="${n(r.height)}" fill="var(--_bg)" stroke="var(--_b)"${o}/>`;u!==void 0&&(p+=`<path class="pele-priority" d="M2.5,5V${n(r.height-5)}" fill="none" ${u} stroke-width="3" stroke-linecap="round"/>`),p+=k(r.label,T,T,` class="pele-label"`,b),A(t.icon)&&(p+=ne(t.icon,B-T-j,T+(_-j)/2,j,b));let m=r.height-T;if(t.ticket){let e=m-r.meta,n=oe?h(te(oe.replace(`#TICKET#`,()=>t.ticket)),a):void 0;n===void 0?p+=k(r.ticket,T,e,` class="pele-ticket" fill="var(--_m)"`,b):(p+=`<a href="${f(n)}" target="_blank"${ee(a)}>`+k(r.ticket,T,e,` class="pele-ticket" fill="var(--_c)"`,b)+`</a>`,H.push({id:t.id,href:n,internal:!1}))}t.assigned&&(p+=k(r.assigned,B-T,m-r.assigned.height,` class="pele-assigned" fill="var(--_m)"`,b,!0)),s+=`<g class="pele-node pele-card${u===void 0?``:` pele-priority-`+i.replace(` `,`-`)}${e(t.cssClasses??``)}" data-id="${c(t.id)}" transform="translate(${w},${n(l)})" font-size="${d}">${p}</g>`,l+=r.height+E}fe+=`<g class="pele-cluster pele-column${e(r.cssClasses??``)}" data-id="${c(r.id)}" transform="translate(${n(ue+t%R*(z+C))},${n(y+ce+X[i])})">${s}</g>`}let $=Math.ceil(Q+2*y),pe=Math.ceil(se+ce+2*y),me=u(Z,$/2,y+Z.height/2,` class="pele-title" font-weight="var(--_tw)"`)+fe;return{svg:r(`kanban`,$,pe,s,a,{},me),width:$,height:pe,links:H}}var M={type:`kanban`,math:!0,parse(e,t,n){let r=new x;return r.title=n,S(e,r),r},render:j};export{M as kanban};
6
- //# sourceMappingURL=DYY6UVD2-BVvdA84B.js.map
6
+ //# sourceMappingURL=DYY6UVD2-CBGlYjYj.js.map
@@ -0,0 +1,2 @@
1
+ import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{Fl as i,Ju as a,Kd as o,Ol as s,Sf as c,Td as l,Tl as u,Ud as d,Uu as f,Vf as p,Xd as m,Zn as h,_f as g,ar as _,dd as v,fl as y,fr as b,if as x,ir as S,kl as C,mr as w,or as T,rp as E,rr as D,sr as O,t as k,tr as A,vf as j,yl as M}from"./utils-CtzgibkN.js";import{R as ee,U as te,u as N}from"./TooltipProvider-BUHMH_xT.js";import{a as P,c as F,o as I,s as ne,t as L}from"./select--26O8gr7.js";import{t as re}from"./spinner-DiQtYQvU.js";import{t as R}from"./query-DmYgeaGK.js";import{t as z}from"./use-atom-command-Bfi4daMj.js";import{u as ie}from"./rightPanelStore-BpUwMEU6.js";import{N as ae}from"./PanelLayoutControls-1wZHYpgc.js";import{a as B,n as V,t as H}from"./tooltip-DDv-MvO4.js";import{n as oe,t as se}from"./toggle-group-BQBgK4Fh.js";import{t as U}from"./input-BwujRX3Y.js";import{t as ce}from"./dialog-BJ3R7bWN.js";import{i as W,n as G,r as le,t as K}from"./device-DuASmK9r.js";import{t as ue}from"./hubAccess-CsZ8CNmg.js";import{c as de,r as fe,s as q,u as J}from"./DeviceSetup-DwoJ9gYG.js";import{i as Y}from"./previewMiniPlayerStore-7pQoYbpL.js";import{t as X}from"./discovery-list-VELXPQtS.js";import{Mo as pe,No as me,Po as he,jo as ge,ko as _e}from"./main-D8lKEPYS.js";import{_ as ve,g as ye,h as be,x as xe}from"./_chat-3NFUtZzk.js";var Z=e(t(),1),Q=n(),Se=class extends Error{status;constructor(e){super(`Screenshot capture failed (${e}). Try again.`),this.status=e}};async function Ce(e,t){let n=e.platform===`ios`?`serve-sim`:`serve-emu`,r=ue(`${e.access.httpBase}/vendor/${n}/api/screenshot?device=${encodeURIComponent(e.deviceId)}`,e.access),i=await fetch(r,{method:`POST`,credentials:e.access.credentials?`include`:`omit`,signal:AbortSignal.any([t,AbortSignal.timeout(2e4)])});if(!i.ok)throw new Se(i.status);let a=await i.blob();if(!a.size)throw Error(`The device returned an empty screenshot. Try again.`);return a}var $=e(r(),1);function we(e){let t=(0,Q.c)(71),{view:n,handle:r,controls:i}=e,o=i.detail?.settings,s=!r?.inputConnected,_=e.hostKind===`local`||e.hostKind===`ssh`,y=o?.appearance===`dark`?`light`:`dark`,T;t[0]===r?T=t[1]:(T=()=>r?.pressButton(`home`),t[0]=r,t[1]=T);let k;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,$.jsx)(f,{}),t[2]=k):k=t[2];let P;t[3]!==s||t[4]!==T?(P=(0,$.jsx)(De,{tooltipSide:`left`,label:`Home`,disabled:s,onClick:T,children:k}),t[3]=s,t[4]=T,t[5]=P):P=t[5];let F;t[6]!==i||t[7]!==r||t[8]!==s||t[9]!==e.platform||t[10]!==_||t[11]!==n.keyboard?.attached?(F=e.platform===`android`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(De,{tooltipSide:`left`,label:`Back`,disabled:s,onClick:()=>r?.pressButton(`back`),children:(0,$.jsx)(C,{})}),(0,$.jsx)(De,{tooltipSide:`left`,label:`Recents`,disabled:s,onClick:()=>r?.pressButton(`recents`),children:(0,$.jsx)(c,{})}),_?(0,$.jsxs)(h,{children:[(0,$.jsx)(b,{render:(0,$.jsx)(w,{size:`icon-sm`,variant:`ghost`,"aria-label":`Rotate device`,disabled:i.disabled}),children:(0,$.jsx)(x,{})}),(0,$.jsxs)(D,{side:`left`,children:[(0,$.jsx)(A,{onClick:()=>void i.act({type:`setOrientation`,value:`portrait`}),children:`Portrait`}),(0,$.jsx)(A,{onClick:()=>void i.act({type:`setOrientation`,value:`landscape_left`}),children:`Landscape`})]})]}):null]}):(0,$.jsx)(De,{tooltipSide:`left`,label:`Rotate device`,disabled:s||!!n.keyboard?.attached,onClick:()=>r?.rotate(),children:(0,$.jsx)(x,{})}),t[6]=i,t[7]=r,t[8]=s,t[9]=e.platform,t[10]=_,t[11]=n.keyboard?.attached,t[12]=F):F=t[12];let I;t[13]!==i||t[14]!==y||t[15]!==e.onTools||t[16]!==e.toolsOpen||t[17]!==_||t[18]!==o?.appearance||t[19]!==o?.textSize?(I=_?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Ee,{}),(0,$.jsx)(De,{tooltipSide:`left`,label:`Switch device to ${y} mode`,disabled:i.disabled||!o?.appearance,onClick:()=>void i.act({type:`setAppearance`,value:y}),children:(0,$.jsx)(N,{icon:o?.appearance===`dark`?te:ee})}),(0,$.jsxs)(h,{children:[(0,$.jsx)(b,{render:(0,$.jsx)(w,{size:`icon-sm`,variant:`ghost`,"aria-label":`Device text size`,title:`Device text size`,disabled:i.disabled||!o?.textSize}),children:(0,$.jsx)(p,{})}),(0,$.jsx)(D,{side:`left`,className:`min-w-40`,children:(0,$.jsx)(S,{value:o?.textSize??``,onValueChange:e=>{(e===`small`||e==="default"||e===`large`||e===`extra-large`)&&i.act({type:`setTextSize`,value:e})},children:[[`small`,`Small`],[`default`,`Default`],[`large`,`Large`],[`extra-large`,`Extra large`]].map(Te)})})]}),(0,$.jsx)(De,{tooltipSide:`left`,label:`Device tools`,pressed:e.toolsOpen,onClick:e.onTools,children:(0,$.jsx)(g,{})})]}):null,t[13]=i,t[14]=y,t[15]=e.onTools,t[16]=e.toolsOpen,t[17]=_,t[18]=o?.appearance,t[19]=o?.textSize,t[20]=I):I=t[20];let ne=e.screenshotPending?`Capturing screenshot`:`Save screenshot`,L=!n.streaming||e.screenshotPending,re;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,$.jsx)(u,{}),t[21]=re):re=t[21];let R;t[22]!==e.onScreenshot||t[23]!==ne||t[24]!==L?(R=(0,$.jsx)(De,{tooltipSide:`left`,label:ne,disabled:L,onClick:e.onScreenshot,children:re}),t[22]=e.onScreenshot,t[23]=ne,t[24]=L,t[25]=R):R=t[25];let z;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,$.jsx)(b,{render:(0,$.jsx)(w,{size:`icon-sm`,variant:`ghost`,"aria-label":`More device actions`,title:`More device actions`}),children:(0,$.jsx)(l,{})}),t[26]=z):z=t[26];let ie;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,$.jsx)(d,{}),t[27]=ie):ie=t[27];let ae;t[28]===e.onFloat?ae=t[29]:(ae=(0,$.jsxs)(A,{onClick:e.onFloat,children:[ie,`Float device over chat`]}),t[28]=e.onFloat,t[29]=ae);let B;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,$.jsx)(E,{}),t[30]=B):B=t[30];let V;t[31]===e.onClose?V=t[32]:(V=(0,$.jsxs)(A,{onClick:e.onClose,children:[B,`Close device panel`]}),t[31]=e.onClose,t[32]=V);let H;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,$.jsx)(O,{}),t[33]=H):H=t[33];let oe;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,$.jsx)(m,{}),t[34]=oe):oe=t[34];let se;t[35]===e.onPowerOff?se=t[36]:(se=(0,$.jsxs)(A,{variant:`destructive`,onClick:e.onPowerOff,children:[oe,`Power off device`]}),t[35]=e.onPowerOff,t[36]=se);let U;t[37]!==ae||t[38]!==V||t[39]!==se?(U=(0,$.jsxs)(h,{children:[z,(0,$.jsxs)(D,{side:`left`,align:`end`,children:[ae,V,H,se]})]}),t[37]=ae,t[38]=V,t[39]=se,t[40]=U):U=t[40];let ce;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(ce=(0,$.jsx)(Ee,{}),t[41]=ce):ce=t[41];let W=!n.streaming||!!n.phoneUnavailableReason,G=n.phoneUnavailableReason??void 0,le;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(le=(0,$.jsx)(M,{}),t[42]=le):le=t[42];let K;t[43]!==W||t[44]!==G||t[45]!==n.phone||t[46]!==n.showPhone?(K=(0,$.jsx)(De,{tooltipSide:`left`,label:`3D view`,pressed:n.phone,disabled:W,description:G,onClick:n.showPhone,children:le}),t[43]=W,t[44]=G,t[45]=n.phone,t[46]=n.showPhone,t[47]=K):K=t[47];let ue=!n.phone,de=!n.streaming,fe;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(fe=(0,$.jsx)(j,{}),t[48]=fe):fe=t[48];let q;t[49]!==ue||t[50]!==de||t[51]!==n.showFlat?(q=(0,$.jsx)(De,{tooltipSide:`left`,label:`Flat view`,pressed:ue,disabled:de,onClick:n.showFlat,children:fe}),t[49]=ue,t[50]=de,t[51]=n.showFlat,t[52]=q):q=t[52];let J;t[53]===n.keyboard?J=t[54]:(J=n.keyboard?(0,$.jsx)(De,{tooltipSide:`left`,label:n.keyboard.attached?`Detach Magic Keyboard`:`Attach Magic Keyboard`,pressed:n.keyboard.attached,onClick:n.keyboard.toggle,children:(0,$.jsx)(a,{})}):null,t[53]=n.keyboard,t[54]=J);let Y;t[55]!==n.phone||t[56]!==n.resetView?(Y=n.phone?(0,$.jsx)(De,{tooltipSide:`left`,label:`Restore 3D view`,onClick:n.resetView,children:(0,$.jsx)(v,{})}):null,t[55]=n.phone,t[56]=n.resetView,t[57]=Y):Y=t[57];let X;t[58]!==U||t[59]!==P||t[60]!==K||t[61]!==q||t[62]!==J||t[63]!==Y||t[64]!==F||t[65]!==I||t[66]!==R?(X=(0,$.jsxs)(`div`,{className:`pointer-events-auto flex shrink-0 flex-col items-center gap-1 overflow-y-auto rounded-full border border-border/50 bg-background/80 p-2 shadow-sm [scrollbar-width:none]`,children:[P,F,I,R,U,ce,K,q,J,Y]}),t[58]=U,t[59]=P,t[60]=K,t[61]=q,t[62]=J,t[63]=Y,t[64]=F,t[65]=I,t[66]=R,t[67]=X):X=t[67];let pe;return t[68]!==X||t[69]!==n.foldingControls?(pe=(0,$.jsxs)(`aside`,{"aria-label":`Device controls`,"data-layout":`rail`,className:`pointer-events-none absolute inset-y-0 right-0 z-10 flex w-14 flex-col items-center gap-2 overflow-y-auto [justify-content:safe_center] py-3 pr-2 [scrollbar-width:none]`,children:[X,n.foldingControls]}),t[68]=X,t[69]=n.foldingControls,t[70]=pe):pe=t[70],pe}function Te(e){let[t,n]=e;return(0,$.jsx)(_,{value:t,children:(0,$.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(`span`,{className:`flex-1`,children:n}),(0,$.jsx)(T,{})]})},t)}function Ee(){let e=(0,Q.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(`div`,{"aria-hidden":!0,className:`my-1 h-px w-5 shrink-0 bg-border/70`}),e[0]=t):t=e[0],t}function De(e){let t=(0,Q.c)(18),n=e.pressed?`secondary`:`ghost`,r;t[0]!==e.children||t[1]!==e.disabled||t[2]!==e.label||t[3]!==e.onClick||t[4]!==e.pressed||t[5]!==n?(r=(0,$.jsx)(w,{size:`icon-sm`,variant:n,"aria-label":e.label,"aria-pressed":e.pressed,disabled:e.disabled,onClick:e.onClick,children:e.children}),t[0]=e.children,t[1]=e.disabled,t[2]=e.label,t[3]=e.onClick,t[4]=e.pressed,t[5]=n,t[6]=r):r=t[6];let i=r,a;t[7]!==i||t[8]!==e.description||t[9]!==e.disabled||t[10]!==e.label?(a=e.disabled&&e.description?(0,$.jsx)(B,{render:(0,$.jsx)(`span`,{className:`inline-flex`,tabIndex:0,role:`group`,"aria-label":e.label}),children:i}):(0,$.jsx)(B,{render:i}),t[7]=i,t[8]=e.description,t[9]=e.disabled,t[10]=e.label,t[11]=a):a=t[11];let o=e.description??e.label,s;t[12]!==e.tooltipSide||t[13]!==o?(s=(0,$.jsx)(V,{side:e.tooltipSide,children:o}),t[12]=e.tooltipSide,t[13]=o,t[14]=s):s=t[14];let c;return t[15]!==a||t[16]!==s?(c=(0,$.jsxs)(H,{children:[a,s]}),t[15]=a,t[16]=s,t[17]=c):c=t[17],c}var Oe=[{value:`small`,label:`Small`},{value:`default`,label:`Default`},{value:`large`,label:`Large`},{value:`extra-large`,label:`Extra large`}],ke=[{value:`none`,label:`None`},{value:`grayscale`,label:`Grayscale`},{value:`red-green`,label:`Red / green (protanopia)`},{value:`green-red`,label:`Green / red (deuteranopia)`},{value:`blue-yellow`,label:`Blue / yellow (tritanopia)`}],Ae=[{value:`portrait`,label:`Portrait`},{value:`landscape_left`,label:`Landscape left`},{value:`portrait_upside_down`,label:`Upside down`},{value:`landscape_right`,label:`Landscape right`}],je=[{value:`camera`,label:`Camera`},{value:`microphone`,label:`Microphone`},{value:`photos`,label:`Photos`},{value:`contacts`,label:`Contacts`},{value:`calendar`,label:`Calendar`},{value:`reminders`,label:`Reminders`},{value:`location`,label:`Location`},{value:`notifications`,label:`Notifications`},{value:`motion`,label:`Motion`},{value:`media-library`,label:`Media library`},{value:`faceid`,label:`Face ID`}],Me=[{value:`camera`,label:`Camera`},{value:`microphone`,label:`Microphone`},{value:`photos`,label:`Photos`},{value:`contacts`,label:`Contacts`},{value:`calendar`,label:`Calendar`},{value:`location`,label:`Location`},{value:`notifications`,label:`Notifications`},{value:`motion`,label:`Physical activity`}],Ne=[{label:`San Francisco`,latitude:37.7749,longitude:-122.4194},{label:`New York`,latitude:40.7128,longitude:-74.006},{label:`London`,latitude:51.5074,longitude:-.1278},{label:`Stockholm`,latitude:59.3293,longitude:18.0686},{label:`Tokyo`,latitude:35.6762,longitude:139.6503}];function Pe(e){let t=(0,Q.c)(129),{device:n,controls:r}=e,{detail:i,pending:a,error:o,foregroundApp:s,disabled:c,act:l}=r,u=i?.settings,d=n.platform===`ios`,f;t[0]===e.className?f=t[1]:(f=k(`flex min-h-0 flex-col border-border bg-background text-sm`,e.className),t[0]=e.className,t[1]=f);let p;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(`span`,{className:`font-medium`,children:`Tools`}),t[2]=p):p=t[2];let m;t[3]===a?m=t[4]:(m=a?(0,$.jsx)(re,{size:`sm`}):null,t[3]=a,t[4]=m);let h;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,$.jsx)(E,{}),t[5]=h):h=t[5];let g;t[6]===e.onClose?g=t[7]:(g=(0,$.jsx)(w,{size:`icon-xs`,variant:`ghost-muted`,"aria-label":`Close tools`,className:`ml-auto`,onClick:e.onClose,children:h}),t[6]=e.onClose,t[7]=g);let _;t[8]!==m||t[9]!==g?(_=(0,$.jsxs)(`div`,{className:`flex h-9 shrink-0 items-center gap-2 border-b px-3`,children:[p,m,g]}),t[8]=m,t[9]=g,t[10]=_):_=t[10];let v;t[11]===o?v=t[12]:(v=o?(0,$.jsx)(`p`,{className:`border-b bg-destructive/10 px-3 py-2 text-xs text-destructive`,children:o}):null,t[11]=o,t[12]=v);let y;t[13]!==i||t[14]!==o?(y=i===null&&!o?(0,$.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-3 text-xs text-muted-foreground`,children:[(0,$.jsx)(re,{size:`sm`}),` Reading device settings…`]}):null,t[13]=i,t[14]=o,t[15]=y):y=t[15];let b;t[16]===e.hostDiagnostics?b=t[17]:(b=e.hostDiagnostics?(0,$.jsx)(Fe,{title:`Host diagnostics`,children:(0,$.jsx)(`p`,{className:`whitespace-pre-line text-xs text-muted-foreground`,children:e.hostDiagnostics})}):null,t[16]=e.hostDiagnostics,t[17]=b);let x=s?.id??`—`,S;t[18]===x?S=t[19]:(S=(0,$.jsx)(Ie,{label:`Foreground`,children:(0,$.jsx)(`span`,{className:`truncate font-mono text-xs`,children:x})}),t[18]=x,t[19]=S);let C;t[20]!==l||t[21]!==c||t[22]!==s?(C=s?(0,$.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,$.jsx)(w,{size:`xs`,variant:`outline`,disabled:c,onClick:()=>void l({type:`terminateApp`,appId:s.id}),children:`Terminate`}),(0,$.jsx)(w,{size:`xs`,variant:`outline`,disabled:c,onClick:()=>void l({type:`launchApp`,appId:s.id}),children:`Relaunch`})]}):null,t[20]=l,t[21]=c,t[22]=s,t[23]=C):C=t[23];let T;t[24]===l?T=t[25]:(T=e=>l({type:`openUrl`,url:e}),t[24]=l,t[25]=T);let D;t[26]!==c||t[27]!==T?(D=(0,$.jsx)(Be,{placeholder:`https://… or myapp://`,action:`Open`,disabled:c,onSubmit:T}),t[26]=c,t[27]=T,t[28]=D):D=t[28];let O=d?`Bundle ID to launch`:`Package name to launch`,A;t[29]===l?A=t[30]:(A=e=>l({type:`launchApp`,appId:e}),t[29]=l,t[30]=A);let j;t[31]!==c||t[32]!==O||t[33]!==A?(j=(0,$.jsx)(Be,{placeholder:O,action:`Launch`,disabled:c,onSubmit:A}),t[31]=c,t[32]=O,t[33]=A,t[34]=j):j=t[34];let M;t[35]!==S||t[36]!==C||t[37]!==D||t[38]!==j?(M=(0,$.jsxs)(Fe,{title:`App`,children:[S,C,D,j]}),t[35]=S,t[36]=C,t[37]=D,t[38]=j,t[39]=M):M=t[39];let ee=d?`Simulator`:`Emulator`,te;t[40]===u?te=t[41]:(te=u?.appearance?[u.appearance]:[],t[40]=u,t[41]=te);let N;t[42]===l?N=t[43]:(N=e=>{let t=e[0];(t===`light`||t===`dark`)&&l({type:`setAppearance`,value:t})},t[42]=l,t[43]=N);let P,F;t[44]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,$.jsx)(se,{value:`light`,children:`Light`}),F=(0,$.jsx)(se,{value:`dark`,children:`Dark`}),t[44]=P,t[45]=F):(P=t[44],F=t[45]);let I;t[46]!==c||t[47]!==te||t[48]!==N?(I=(0,$.jsx)(Ie,{label:`Appearance`,children:(0,$.jsxs)(oe,{"aria-label":`Appearance`,value:te,disabled:c,onValueChange:N,children:[P,F]})}),t[46]=c,t[47]=te,t[48]=N,t[49]=I):I=t[49];let ne=u?.textSize??null,L;t[50]===l?L=t[51]:(L=e=>l({type:`setTextSize`,value:e}),t[50]=l,t[51]=L);let R;t[52]!==c||t[53]!==ne||t[54]!==L?(R=(0,$.jsx)(Ie,{label:`Text size`,children:(0,$.jsx)(Re,{ariaLabel:`Text size`,value:ne,options:Oe,disabled:c,onChange:L})}),t[52]=c,t[53]=ne,t[54]=L,t[55]=R):R=t[55];let z;t[56]!==l||t[57]!==c||t[58]!==d||t[59]!==u?(z=d?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Ie,{label:`Liquid Glass`,children:(0,$.jsxs)(oe,{"aria-label":`Liquid Glass`,value:u?.liquidGlass?[u.liquidGlass]:[],disabled:c||u?.liquidGlass===void 0,onValueChange:e=>{let t=e[0];(t===`clear`||t===`tinted`)&&l({type:`setLiquidGlass`,value:t})},children:[(0,$.jsx)(se,{value:`clear`,children:`Clear`}),(0,$.jsx)(se,{value:`tinted`,children:`Tinted`})]})}),(0,$.jsx)(Ie,{label:`Color filter`,children:(0,$.jsx)(Re,{ariaLabel:`Color filter`,value:u?.colorFilter??null,options:ke,disabled:c,onChange:e=>l({type:`setColorFilter`,value:e})})})]}):(0,$.jsx)(Ie,{label:`Orientation`,children:(0,$.jsx)(Re,{ariaLabel:`Orientation`,value:null,placeholder:`Rotate to…`,options:Ae,disabled:c,onChange:e=>l({type:`setOrientation`,value:e})})}),t[56]=l,t[57]=c,t[58]=d,t[59]=u,t[60]=z):z=t[60];let ie=u?.reduceMotion,ae;t[61]===l?ae=t[62]:(ae=e=>l({type:`setToggle`,setting:`reduceMotion`,value:e}),t[61]=l,t[62]=ae);let B;t[63]!==c||t[64]!==ie||t[65]!==ae?(B=(0,$.jsx)(Le,{label:`Reduce Motion`,checked:ie,disabled:c,onChange:ae}),t[63]=c,t[64]=ie,t[65]=ae,t[66]=B):B=t[66];let V;t[67]!==l||t[68]!==c||t[69]!==d||t[70]!==u?.increaseContrast||t[71]!==u?.networkEnabled||t[72]!==u?.reduceTransparency||t[73]!==u?.showBorders||t[74]!==u?.voiceOver?(V=d?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Le,{label:`Increase Contrast`,checked:u?.increaseContrast,disabled:c,onChange:e=>l({type:`setToggle`,setting:`increaseContrast`,value:e})}),(0,$.jsx)(Le,{label:`Reduce Transparency`,checked:u?.reduceTransparency,disabled:c,onChange:e=>l({type:`setToggle`,setting:`reduceTransparency`,value:e})}),(0,$.jsx)(Le,{label:`Show Borders`,checked:u?.showBorders,disabled:c,onChange:e=>l({type:`setToggle`,setting:`showBorders`,value:e})}),(0,$.jsx)(Le,{label:`VoiceOver`,checked:u?.voiceOver,disabled:c,onChange:e=>l({type:`setToggle`,setting:`voiceOver`,value:e})})]}):(0,$.jsx)(Le,{label:`Network`,checked:u?.networkEnabled,disabled:c,onChange:e=>l({type:`setToggle`,setting:`networkEnabled`,value:e})}),t[67]=l,t[68]=c,t[69]=d,t[70]=u?.increaseContrast,t[71]=u?.networkEnabled,t[72]=u?.reduceTransparency,t[73]=u?.showBorders,t[74]=u?.voiceOver,t[75]=V):V=t[75];let H;t[76]!==ee||t[77]!==I||t[78]!==R||t[79]!==z||t[80]!==B||t[81]!==V?(H=(0,$.jsxs)(Fe,{title:ee,children:[I,R,z,B,V]}),t[76]=ee,t[77]=I,t[78]=R,t[79]=z,t[80]=B,t[81]=V,t[82]=H):H=t[82];let U=e.access===null,ce;t[83]===e?ce=t[84]:(ce=t=>(e.onAxOverlayChange(t),Promise.resolve()),t[83]=e,t[84]=ce);let W;t[85]!==e.axOverlay||t[86]!==U||t[87]!==ce?(W=(0,$.jsx)(Fe,{title:`Accessibility`,children:(0,$.jsx)(Le,{label:`Overlay element frames`,checked:e.axOverlay,disabled:U,onChange:ce})}),t[85]=e.axOverlay,t[86]=U,t[87]=ce,t[88]=W):W=t[88];let G,le;t[89]===l?(G=t[90],le=t[91]):(G=(e,t)=>l({type:`setLocation`,latitude:e,longitude:t}),le=()=>l({type:`clearLocation`}),t[89]=l,t[90]=G,t[91]=le);let K;t[92]!==c||t[93]!==d||t[94]!==G||t[95]!==le?(K=(0,$.jsx)(Ve,{disabled:c,canClear:d,onSet:G,onClear:le}),t[92]=c,t[93]=d,t[94]=G,t[95]=le,t[96]=K):K=t[96];let ue=d?je:Me,de=s?.id??``,fe;t[97]===l?fe=t[98]:(fe=(e,t,n)=>l({type:`setPermission`,appId:e,permission:t,decision:n}),t[97]=l,t[98]=fe);let q;t[99]!==c||t[100]!==d||t[101]!==ue||t[102]!==de||t[103]!==fe?(q=(0,$.jsx)(Ue,{permissions:ue,canReset:d,defaultAppId:de,disabled:c,onDecide:fe}),t[99]=c,t[100]=d,t[101]=ue,t[102]=de,t[103]=fe,t[104]=q):q=t[104];let J;t[105]!==l||t[106]!==c||t[107]!==s||t[108]!==d?(J=d?(0,$.jsxs)(Fe,{title:`Push notification`,children:[(0,$.jsx)(Be,{placeholder:`Alert text`,action:`Send`,disabled:c||!s,onSubmit:e=>s?l({type:`sendPush`,appId:s.id,payload:e}):Promise.resolve(!1)}),s?null:(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Open an app first.`})]}):null,t[105]=l,t[106]=c,t[107]=s,t[108]=d,t[109]=J):J=t[109];let Y;t[110]!==n||t[111]!==d||t[112]!==e.access?(Y=d&&e.access?(0,$.jsx)(Ge,{access:e.access,device:n}):null,t[110]=n,t[111]=d,t[112]=e.access,t[113]=Y):Y=t[113];let X;t[114]!==M||t[115]!==H||t[116]!==W||t[117]!==K||t[118]!==q||t[119]!==J||t[120]!==Y||t[121]!==v||t[122]!==y||t[123]!==b?(X=(0,$.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:[v,y,b,M,H,W,K,q,J,Y]}),t[114]=M,t[115]=H,t[116]=W,t[117]=K,t[118]=q,t[119]=J,t[120]=Y,t[121]=v,t[122]=y,t[123]=b,t[124]=X):X=t[124];let pe;return t[125]!==f||t[126]!==X||t[127]!==_?(pe=(0,$.jsxs)(`div`,{className:f,children:[_,X]}),t[125]=f,t[126]=X,t[127]=_,t[128]=pe):pe=t[128],pe}function Fe(e){let t=(0,Q.c)(5),n;t[0]===e.title?n=t[1]:(n=(0,$.jsx)(`h3`,{className:`text-xs font-medium text-muted-foreground`,children:e.title}),t[0]=e.title,t[1]=n);let r;return t[2]!==e.children||t[3]!==n?(r=(0,$.jsxs)(`section`,{className:`flex flex-col gap-2 border-b px-3 py-2.5 last:border-b-0`,children:[n,e.children]}),t[2]=e.children,t[3]=n,t[4]=r):r=t[4],r}function Ie(e){let t=(0,Q.c)(7),n;t[0]===e.label?n=t[1]:(n=(0,$.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:e.label}),t[0]=e.label,t[1]=n);let r;t[2]===e.children?r=t[3]:(r=(0,$.jsx)(`div`,{className:`flex min-w-0 items-center justify-end`,children:e.children}),t[2]=e.children,t[3]=r);let i;return t[4]!==n||t[5]!==r?(i=(0,$.jsxs)(`div`,{className:`flex min-h-7 items-center justify-between gap-3`,children:[n,r]}),t[4]=n,t[5]=r,t[6]=i):i=t[6],i}function Le(e){let t=(0,Q.c)(10),n=e.checked??!1,r=e.disabled||e.checked===void 0,i;t[0]===e?i=t[1]:(i=t=>void e.onChange(t),t[0]=e,t[1]=i);let a;t[2]!==e.label||t[3]!==n||t[4]!==r||t[5]!==i?(a=(0,$.jsx)(he,{size:`sm`,"aria-label":e.label,checked:n,disabled:r,onCheckedChange:i}),t[2]=e.label,t[3]=n,t[4]=r,t[5]=i,t[6]=a):a=t[6];let o;return t[7]!==e.label||t[8]!==a?(o=(0,$.jsx)(Ie,{label:e.label,children:a}),t[7]=e.label,t[8]=a,t[9]=o):o=t[9],o}function Re(e){let t=(0,Q.c)(25),n;if(t[0]!==e.options||t[1]!==e.value){let r;t[3]===e.value?r=t[4]:(r=t=>t.value===e.value,t[3]=e.value,t[4]=r),n=e.options.find(r),t[0]=e.options,t[1]=e.value,t[2]=n}else n=t[2];let r=n,i=e.value,a=e.disabled,o;t[5]===e?o=t[6]:(o=t=>{t!==null&&t!==e.value&&e.onChange(t)},t[5]=e,t[6]=o);let s;t[7]!==r||t[8]!==e.placeholder?(s=r?r.label:(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:e.placeholder??`Unknown`}),t[7]=r,t[8]=e.placeholder,t[9]=s):s=t[9];let c;t[10]===s?c=t[11]:(c=(0,$.jsx)(F,{children:s}),t[10]=s,t[11]=c);let l;t[12]!==e.ariaLabel||t[13]!==c?(l=(0,$.jsx)(ne,{size:`xs`,className:`w-40`,"aria-label":e.ariaLabel,children:c}),t[12]=e.ariaLabel,t[13]=c,t[14]=l):l=t[14];let u;t[15]===e.options?u=t[16]:(u=e.options.map(ze),t[15]=e.options,t[16]=u);let d;t[17]===u?d=t[18]:(d=(0,$.jsx)(I,{align:`end`,alignItemWithTrigger:!1,children:u}),t[17]=u,t[18]=d);let f;return t[19]!==e.disabled||t[20]!==e.value||t[21]!==o||t[22]!==l||t[23]!==d?(f=(0,$.jsxs)(L,{value:i,disabled:a,onValueChange:o,children:[l,d]}),t[19]=e.disabled,t[20]=e.value,t[21]=o,t[22]=l,t[23]=d,t[24]=f):f=t[24],f}function ze(e){return(0,$.jsx)(P,{value:e.value,children:e.label},e.value)}function Be(e){let t=(0,Q.c)(20),[n,r]=(0,Z.useState)(``),i;t[0]!==e||t[1]!==n?(i=()=>{let t=n.trim();t&&e.onSubmit(t).then(e=>{e&&r(``)})},t[0]=e,t[1]=n,t[2]=i):i=t[2];let a=i,o;t[3]===a?o=t[4]:(o=e=>{e.preventDefault(),a()},t[3]=a,t[4]=o);let s;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(s=e=>r(e.target.value),t[5]=s):s=t[5];let c;t[6]!==e.disabled||t[7]!==e.placeholder||t[8]!==n?(c=(0,$.jsx)(U,{size:`compact`,font:`mono`,className:`min-w-0 flex-1`,placeholder:e.placeholder,value:n,disabled:e.disabled,onChange:s}),t[6]=e.disabled,t[7]=e.placeholder,t[8]=n,t[9]=c):c=t[9];let l;t[10]!==e.disabled||t[11]!==n?(l=e.disabled||n.trim().length===0,t[10]=e.disabled,t[11]=n,t[12]=l):l=t[12];let u;t[13]!==e.action||t[14]!==l?(u=(0,$.jsx)(w,{type:`submit`,size:`xs`,variant:`outline`,disabled:l,children:e.action}),t[13]=e.action,t[14]=l,t[15]=u):u=t[15];let d;return t[16]!==o||t[17]!==c||t[18]!==u?(d=(0,$.jsxs)(`form`,{className:`flex gap-1.5`,onSubmit:o,children:[c,u]}),t[16]=o,t[17]=c,t[18]=u,t[19]=d):d=t[19],d}function Ve(e){let t=(0,Q.c)(40),[n,r]=(0,Z.useState)(``),[i,a]=(0,Z.useState)(``),o=Number(n),s=Number(i),c,l;t[0]!==n||t[1]!==i||t[2]!==o||t[3]!==s?(c={latitude:o,longitude:s},l=n.trim()!==``&&i.trim()!==``&&Math.abs(c.latitude)<=90&&Math.abs(c.longitude)<=180,t[0]=n,t[1]=i,t[2]=o,t[3]=s,t[4]=c,t[5]=l):(c=t[4],l=t[5]);let u=l,d;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(d=e=>r(e.target.value),t[6]=d):d=t[6];let f;t[7]!==n||t[8]!==e.disabled?(f=(0,$.jsx)(U,{size:`compact`,font:`mono`,className:`min-w-0 flex-1`,placeholder:`Latitude`,inputMode:`decimal`,value:n,disabled:e.disabled,onChange:d}),t[7]=n,t[8]=e.disabled,t[9]=f):f=t[9];let p;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(p=e=>a(e.target.value),t[10]=p):p=t[10];let m;t[11]!==i||t[12]!==e.disabled?(m=(0,$.jsx)(U,{size:`compact`,font:`mono`,className:`min-w-0 flex-1`,placeholder:`Longitude`,inputMode:`decimal`,value:i,disabled:e.disabled,onChange:p}),t[11]=i,t[12]=e.disabled,t[13]=m):m=t[13];let h;t[14]!==f||t[15]!==m?(h=(0,$.jsxs)(`div`,{className:`flex gap-1.5`,children:[f,m]}),t[14]=f,t[15]=m,t[16]=h):h=t[16];let g;t[17]===e?g=t[18]:(g=t=>{let n=Ne.find(e=>e.label===t);n&&(r(String(n.latitude)),a(String(n.longitude)),e.onSet(n.latitude,n.longitude))},t[17]=e,t[18]=g);let _;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,$.jsx)(ne,{size:`xs`,className:`w-32`,"aria-label":`Location preset`,children:(0,$.jsx)(F,{children:(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:`Preset…`})})}),t[19]=_):_=t[19];let v;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsx)(I,{align:`start`,alignItemWithTrigger:!1,children:Ne.map(He)}),t[20]=v):v=t[20];let y;t[21]!==e.disabled||t[22]!==g?(y=(0,$.jsxs)(L,{value:null,disabled:e.disabled,onValueChange:g,children:[_,v]}),t[21]=e.disabled,t[22]=g,t[23]=y):y=t[23];let b=e.disabled||!u,x;t[24]!==c.latitude||t[25]!==c.longitude||t[26]!==e?(x=()=>void e.onSet(c.latitude,c.longitude),t[24]=c.latitude,t[25]=c.longitude,t[26]=e,t[27]=x):x=t[27];let S;t[28]!==b||t[29]!==x?(S=(0,$.jsx)(w,{size:`xs`,variant:`outline`,disabled:b,onClick:x,children:`Set`}),t[28]=b,t[29]=x,t[30]=S):S=t[30];let C;t[31]===e?C=t[32]:(C=e.canClear?(0,$.jsx)(w,{size:`xs`,variant:`ghost`,disabled:e.disabled,onClick:()=>{r(``),a(``),e.onClear()},children:`Clear`}):null,t[31]=e,t[32]=C);let T;t[33]!==y||t[34]!==S||t[35]!==C?(T=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[y,S,C]}),t[33]=y,t[34]=S,t[35]=C,t[36]=T):T=t[36];let E;return t[37]!==T||t[38]!==h?(E=(0,$.jsxs)(Fe,{title:`Location`,children:[h,T]}),t[37]=T,t[38]=h,t[39]=E):E=t[39],E}function He(e){return(0,$.jsx)(P,{value:e.label,children:e.label},e.label)}function Ue(e){let t=(0,Q.c)(40),[n,r]=(0,Z.useState)(``),[i,a]=(0,Z.useState)(`camera`),o;t[0]!==n||t[1]!==e.defaultAppId?(o=n.trim()||e.defaultAppId,t[0]=n,t[1]=e.defaultAppId,t[2]=o):o=t[2];let s=o,c;t[3]!==i||t[4]!==e||t[5]!==s?(c=t=>void e.onDecide(s,i,t),t[3]=i,t[4]=e,t[5]=s,t[6]=c):c=t[6];let l=c,u=e.defaultAppId||`App ID`,d;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(d=e=>r(e.target.value),t[7]=d):d=t[7];let f;t[8]!==n||t[9]!==e.disabled||t[10]!==u?(f=(0,$.jsx)(U,{size:`compact`,font:`mono`,placeholder:u,value:n,disabled:e.disabled,onChange:d}),t[8]=n,t[9]=e.disabled,t[10]=u,t[11]=f):f=t[11];let p;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(p=e=>(a(e),Promise.resolve()),t[12]=p):p=t[12];let m;t[13]!==i||t[14]!==e.disabled||t[15]!==e.permissions?(m=(0,$.jsx)(Re,{ariaLabel:`Permission`,value:i,options:e.permissions,disabled:e.disabled,onChange:p}),t[13]=i,t[14]=e.disabled,t[15]=e.permissions,t[16]=m):m=t[16];let h=e.disabled||!s,g;t[17]===l?g=t[18]:(g=()=>l(`grant`),t[17]=l,t[18]=g);let _;t[19]!==h||t[20]!==g?(_=(0,$.jsx)(w,{size:`xs`,variant:`outline`,disabled:h,onClick:g,children:`Grant`}),t[19]=h,t[20]=g,t[21]=_):_=t[21];let v=e.disabled||!s,y;t[22]===l?y=t[23]:(y=()=>l(`revoke`),t[22]=l,t[23]=y);let b;t[24]!==v||t[25]!==y?(b=(0,$.jsx)(w,{size:`xs`,variant:`outline`,disabled:v,onClick:y,children:`Revoke`}),t[24]=v,t[25]=y,t[26]=b):b=t[26];let x;t[27]!==l||t[28]!==e.canReset||t[29]!==e.disabled||t[30]!==s?(x=e.canReset?(0,$.jsx)(w,{size:`xs`,variant:`ghost`,disabled:e.disabled||!s,onClick:()=>l(`reset`),children:`Reset`}):null,t[27]=l,t[28]=e.canReset,t[29]=e.disabled,t[30]=s,t[31]=x):x=t[31];let S;t[32]!==b||t[33]!==x||t[34]!==m||t[35]!==_?(S=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[m,_,b,x]}),t[32]=b,t[33]=x,t[34]=m,t[35]=_,t[36]=S):S=t[36];let C;return t[37]!==S||t[38]!==f?(C=(0,$.jsxs)(Fe,{title:`Permissions`,children:[f,S]}),t[37]=S,t[38]=f,t[39]=C):C=t[39],C}var We=100;function Ge(e){let t=(0,Q.c)(19),[n,r]=(0,Z.useState)(!1),i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=[],t[0]=i):i=t[0];let[a,o]=(0,Z.useState)(i),c,l;t[1]!==n||t[2]!==e.access||t[3]!==e.device.id||t[4]!==e.device.platform?(c=()=>{if(!n)return;let t=ye({access:e.access,platform:e.device.platform,deviceId:e.device.id},(e,t)=>{o(n=>{let r=t?[...e]:[...n,...e];return r.length>We?r.slice(-100):r})});return()=>{t(),o([])}},l=[n,e.access,e.device.id,e.device.platform],t[1]=n,t[2]=e.access,t[3]=e.device.id,t[4]=e.device.platform,t[5]=c,t[6]=l):(c=t[5],l=t[6]),(0,Z.useEffect)(c,l);let u=n&&`rotate-180`,d;t[7]===u?d=t[8]:(d=k(`ml-auto size-3.5 transition-transform`,u),t[7]=u,t[8]=d);let f;t[9]===d?f=t[10]:(f=(0,$.jsxs)(me,{className:`flex w-full items-center gap-1.5 border-b px-3 py-2.5 text-left text-xs font-medium text-muted-foreground`,children:[`Event log`,(0,$.jsx)(s,{className:d})]}),t[9]=d,t[10]=f);let p;t[11]===a?p=t[12]:(p=a.length===0?(0,$.jsx)(`li`,{className:`text-muted-foreground`,children:`No events yet.`}):a.map(Ke),t[11]=a,t[12]=p);let m;t[13]===p?m=t[14]:(m=(0,$.jsx)(pe,{children:(0,$.jsx)(`ol`,{className:`max-h-64 overflow-y-auto px-3 py-2 font-mono text-2xs leading-relaxed`,children:p})}),t[13]=p,t[14]=m);let h;return t[15]!==n||t[16]!==f||t[17]!==m?(h=(0,$.jsxs)(ge,{open:n,onOpenChange:r,children:[f,m]}),t[15]=n,t[16]=f,t[17]=m,t[18]=h):h=t[18],h}function Ke(e){return(0,$.jsxs)(`li`,{className:`flex gap-2`,children:[(0,$.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:e.timestamp.slice(11,19)}),(0,$.jsx)(`span`,{className:`truncate`,children:e.summary})]},e.id)}function qe(e){let t=(0,Q.c)(30),{environmentId:n,device:r,access:i,visible:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o={reportFailure:!1},t[0]=o):o=t[0];let s=z(K.detail,o),c;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(c={reportFailure:!1},t[1]=c):c=t[1];let l=z(K.action,c),[u,d]=(0,Z.useState)(null),[f,p]=(0,Z.useState)(!1),[m,h]=(0,Z.useState)(null),[g,_]=(0,Z.useState)(),v=(0,Z.useRef)(!1),y=(0,Z.useRef)(0),b=(0,Z.useRef)(null),x;t[2]!==r.hostId||t[3]!==r.id?(x={hostId:r.hostId,deviceId:r.id},t[2]=r.hostId,t[3]=r.id,t[4]=x):x=t[4];let S=x,C,w;t[5]!==n||t[6]!==s||t[7]!==S||t[8]!==a?(C=()=>{let e=y.current+=1;if(!a)return;let t={environmentId:n,input:S};return b.current=t,s(t).then(t=>{y.current===e&&(t._tag===`Success`?(d(t.value),h(null)):(d(null),h(R(t.cause))))}),()=>{b.current=null,y.current+=1}},w=[n,s,S,a],t[5]=n,t[6]=s,t[7]=S,t[8]=a,t[9]=C,t[10]=w):(C=t[9],w=t[10]),(0,Z.useEffect)(C,w);let T,E;t[11]!==i||t[12]!==r.id||t[13]!==r.platform||t[14]!==a?(T=()=>{if(!i||!a)return;let e=!0,t=ve({access:i,platform:r.platform,deviceId:r.id},t=>{e&&_(t)});return()=>{e=!1,t(),_(void 0)}},E=[i,r.id,r.platform,a],t[11]=i,t[12]=r.id,t[13]=r.platform,t[14]=a,t[15]=T,t[16]=E):(T=t[15],E=t[16]),(0,Z.useEffect)(T,E);let D=u!==null&&a,O;t[17]!==D||t[18]!==n||t[19]!==s||t[20]!==l||t[21]!==S?(O=async e=>{if(v.current||!D)return!1;v.current=!0;let t=y.current+=1;return p(!0),h(null),l({environmentId:n,input:{...S,...e}}).then(e=>{if(y.current!==t){let t=b.current;if(!t)return e._tag===`Success`;let n=y.current+=1;return s(t).then(t=>(y.current===n&&(t._tag===`Success`?(d(t.value),h(null)):(d(null),h(R(t.cause)))),e._tag===`Success`))}return e._tag===`Success`?d(e.value):h(R(e.cause)),e._tag===`Success`}).finally(()=>{v.current=!1,p(!1)})},t[17]=D,t[18]=n,t[19]=s,t[20]=l,t[21]=S,t[22]=O):O=t[22];let k=O,A=f||!u||!a,j=g===void 0?u?.foregroundApp??null:g,M;return t[23]!==k||t[24]!==u||t[25]!==m||t[26]!==f||t[27]!==A||t[28]!==j?(M={detail:u,pending:f,error:m,act:k,disabled:A,foregroundApp:j},t[23]=k,t[24]=u,t[25]=m,t[26]=f,t[27]=A,t[28]=j,t[29]=M):M=t[29],M}function Je(e){let t=(0,Q.c)(53),[n,r]=(0,Z.useState)(null),[i,a]=(0,Z.useState)(!1),[o,s]=(0,Z.useState)(!1),[c,l]=(0,Z.useState)(!1),[u,d]=(0,Z.useState)(null),f=(0,Z.useRef)(null),p=(0,Z.useRef)(null),m=le(e.environmentId,e.device.hostId),h=e.hostKind===`local`||e.hostKind===`ssh`,g=e.visible&&h,_;t[0]!==m||t[1]!==e||t[2]!==g?(_={...e,access:m,visible:g},t[0]=m,t[1]=e,t[2]=g,t[3]=_):_=t[3];let v=qe(_),y,b;t[4]!==m||t[5]!==e.visible?(y=()=>(m&&e.visible||f.current?.abort(),()=>{f.current?.abort(),p.current&&URL.revokeObjectURL(p.current),p.current=null}),b=[m,e.visible],t[4]=m,t[5]=e.visible,t[6]=y,t[7]=b):(y=t[6],b=t[7]),(0,Z.useEffect)(y,b);let x;t[8]!==m||t[9]!==e.device.id||t[10]!==e.device.name||t[11]!==e.device.platform||t[12]!==e.environmentId||t[13]!==e.visible?(x=()=>{if(!m||f.current||!e.visible)return;let t=new AbortController;return f.current=t,l(!0),d(null),Ce({access:m,platform:e.device.platform,deviceId:e.device.id},t.signal).then(n=>{if(t.signal.aborted)return;p.current&&URL.revokeObjectURL(p.current);let r=URL.createObjectURL(n);p.current=r;let i=document.createElement(`a`);i.href=r,i.download=`${e.device.name.replace(/[^a-z0-9-]/gi,`-`)}-${Date.now()}.png`,document.body.append(i),i.click(),i.remove()}).catch(n=>{t.signal.aborted||(n instanceof Se&&n.status===401&&G(e.environmentId),d(n instanceof Error?n.message:`Screenshot capture failed. Try again.`))}).finally(()=>{f.current===t&&(f.current=null,l(!1))})},t[8]=m,t[9]=e.device.id,t[10]=e.device.name,t[11]=e.device.platform,t[12]=e.environmentId,t[13]=e.visible,t[14]=x):x=t[14];let S=x,C;t[15]!==v||t[16]!==u||t[17]!==i?(C=u||v.error&&!i?(0,$.jsx)(`p`,{role:`alert`,className:`px-3 py-2 text-xs text-destructive`,children:u??v.error}):null,t[15]=v,t[16]=u,t[17]=i,t[18]=C):C=t[18];let w=`${e.hostLabel} · ${e.device.version}`,T;t[19]!==v||t[20]!==n||t[21]!==e.device.platform||t[22]!==e.hostKind||t[23]!==e.onClose||t[24]!==e.onFloat||t[25]!==e.onPowerOff||t[26]!==S||t[27]!==c||t[28]!==i?(T=t=>(0,$.jsx)(we,{platform:e.device.platform,hostKind:e.hostKind,handle:n,view:t,controls:v,screenshotPending:c,onScreenshot:()=>void S(),toolsOpen:i,onTools:()=>a(!i),onFloat:e.onFloat,onClose:e.onClose,onPowerOff:e.onPowerOff}),t[19]=v,t[20]=n,t[21]=e.device.platform,t[22]=e.hostKind,t[23]=e.onClose,t[24]=e.onFloat,t[25]=e.onPowerOff,t[26]=S,t[27]=c,t[28]=i,t[29]=T):T=t[29];let E;t[30]!==o||t[31]!==e.device.hostId||t[32]!==e.device.id||t[33]!==e.device.name||t[34]!==e.device.platform||t[35]!==e.environmentId||t[36]!==e.visible||t[37]!==w||t[38]!==T?(E=(0,$.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,$.jsx)(be,{environmentId:e.environmentId,platform:e.device.platform,deviceName:e.device.name,deviceDescription:w,deviceId:e.device.id,hostId:e.device.hostId,visible:e.visible,axOverlay:o,allowPhoneView:!0,onHandle:r,renderControls:T})}),t[30]=o,t[31]=e.device.hostId,t[32]=e.device.id,t[33]=e.device.name,t[34]=e.device.platform,t[35]=e.environmentId,t[36]=e.visible,t[37]=w,t[38]=T,t[39]=E):E=t[39];let D;t[40]!==C||t[41]!==E?(D=(0,$.jsxs)(`div`,{className:`relative flex min-h-0 min-w-0 flex-1 flex-col`,children:[C,E]}),t[40]=C,t[41]=E,t[42]=D):D=t[42];let O;t[43]!==m||t[44]!==o||t[45]!==v||t[46]!==e.device||t[47]!==e.hostDiagnostics||t[48]!==i?(O=i?(0,$.jsx)(Pe,{device:e.device,controls:v,hostDiagnostics:e.hostDiagnostics,access:m,axOverlay:o,onAxOverlayChange:s,onClose:()=>a(!1),className:`absolute inset-y-0 right-0 z-10 w-full max-w-72 border-l shadow-lg @[700px]:static @[700px]:w-72 @[700px]:shrink-0 @[700px]:shadow-none`}):null,t[43]=m,t[44]=o,t[45]=v,t[46]=e.device,t[47]=e.hostDiagnostics,t[48]=i,t[49]=O):O=t[49];let k;return t[50]!==O||t[51]!==D?(k=(0,$.jsxs)($.Fragment,{children:[D,O]}),t[50]=O,t[51]=D,t[52]=k):k=t[52],k}var Ye=e=>e===`ios`?`iOS Simulators`:`Android Emulators`,Xe=e=>`${e.hostId}\u0000${e.id}`;function Ze(e){let t=(0,Q.c)(87),{environmentId:n,threadId:r}=e.threadRef,{state:i,loaded:a,error:s,refresh:c}=W(n),l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l={reportFailure:!1},t[0]=l):l=t[0];let u=z(K.list,l),d=z(K.open),f=z(K.close),p=`${n}\u0000${r}`,[m,h]=(0,Z.useState)(null),g=m?.scope===p?m.pending:null,_=m?.scope===p?m.error:null,v;t[1]===g?v=t[2]:(v=g?Xe(g):null,t[1]=g,t[2]=v);let b=v,x=i.hostStatus===`disabled`,S,C;t[3]!==n||t[4]!==x||t[5]!==u||t[6]!==a||t[7]!==e.visible?(S=()=>{e.visible&&a&&!x&&u({environmentId:n,input:{}})},C=[n,u,a,e.visible,x],t[3]=n,t[4]=x,t[5]=u,t[6]=a,t[7]=e.visible,t[8]=S,t[9]=C):(S=t[8],C=t[9]),(0,Z.useEffect)(S,C);let T;if(t[10]!==e.surface.target||t[11]!==i.sessions||t[12]!==r){let n;t[14]===r?n=t[15]:(n=e=>e.threadId===r,t[14]=r,t[15]=n);let a=i.sessions.filter(n);T=e.surface.target?a.find(t=>t.deviceId===e.surface.target?.deviceId&&t.hostId===e.surface.target.hostId):void 0,t[10]=e.surface.target,t[11]=i.sessions,t[12]=r,t[13]=T}else T=t[13];let E=T,D,O,A,M,ee,te,N;if(t[16]!==E||t[17]!==f||t[18]!==n||t[19]!==x||t[20]!==u||t[21]!==a||t[22]!==d||t[23]!==_||t[24]!==g||t[25]!==b||t[26]!==e||t[27]!==c||t[28]!==p||t[29]!==i||t[30]!==s||t[31]!==r){O=Symbol.for(`react.early_return_sentinel`);bb0:{let l=E?i.devices.find(e=>e.hostId===E.hostId&&e.id===E.deviceId):void 0,m=at(i),v;t[39]===p?v=t[40]:(v=e=>{let t={scope:p,pending:e,error:null};return h(t),e=>h(n=>n===t?{...t,pending:null,error:e}:n)},t[39]=p,t[40]=v);let S=v,C;t[41]!==n||t[42]!==d||t[43]!==e.threadRef||t[44]!==S||t[45]!==i.devices||t[46]!==r?(C=async t=>{let a=i.devices.find(e=>Xe(e)===t);if(!a)return;let o=S(a),s=await d({environmentId:n,input:{threadId:r,hostId:a.hostId,deviceId:a.id,platform:a.platform}});s._tag===`Failure`?o(R(s.cause)):(ie.getState().openDevice(e.threadRef,{hostId:s.value.hostId,deviceId:s.value.deviceId,platform:a.platform,name:a.name}),o(null))},t[41]=n,t[42]=d,t[43]=e.threadRef,t[44]=S,t[45]=i.devices,t[46]=r,t[47]=C):C=t[47];let T=C,P=()=>{l&&(Y.getState().open(e.threadRef,{kind:`device`,hostId:l.hostId,deviceId:l.id,platform:l.platform,name:l.name}),ie.getState().close(e.threadRef))},F;t[48]!==E||t[49]!==f||t[50]!==n||t[51]!==e.surface.id||t[52]!==e.threadRef||t[53]!==S||t[54]!==r?(F=t=>{if(!t){ie.getState().closeSurface(e.threadRef,e.surface.id);return}if(!E)return;let i=S(null);f({environmentId:n,input:{threadId:r,hostId:E.hostId,deviceId:E.deviceId,shutdown:t}}).then(t=>{t._tag===`Failure`?i(R(t.cause)):ie.getState().closeSurface(e.threadRef,e.surface.id)})},t[48]=E,t[49]=f,t[50]=n,t[51]=e.surface.id,t[52]=e.threadRef,t[53]=S,t[54]=r,t[55]=F):F=t[55];let I=F,ne=i.bootingDevices?.filter(e=>e.threadId===r)??[],{ready:L,busy:z}=q(i),B=!l&&(g!==null||z||!a),V=a?null:s,H;t[56]!==i.hostStatus||t[57]!==i.hostStatusDetail||t[58]!==i.hostStatuses?(H=e=>{let t=i.hostStatuses[e.id],n=t?.detail??(e.kind===`local`?i.hostStatusDetail:void 0);return n&&(t?.status??i.hostStatus)===`ready`?[{hostId:e.id,label:e.label,detail:n}]:[]},t[56]=i.hostStatus,t[57]=i.hostStatusDetail,t[58]=i.hostStatuses,t[59]=H):H=t[59];let oe=i.hosts.flatMap(H),se=i.hosts.flatMap(tt);if(a&&(!i.onboardingCompleted||x)){let r;t[60]===e?r=t[61]:(r=t=>{t||e.onDismissSetup()},t[60]=e,t[61]=r);let a;t[62]!==n||t[63]!==i?(a=(0,$.jsx)(_e,{children:(0,$.jsx)(fe,{environmentId:n,state:i})}),t[62]=n,t[63]=i,t[64]=a):a=t[64];let o;t[65]!==e.visible||t[66]!==r||t[67]!==a?(o=(0,$.jsx)(ce,{open:e.visible,onOpenChange:r,children:a}),t[65]=e.visible,t[66]=r,t[67]=a,t[68]=o):o=t[68],O=o;break bb0}D=ae,N=e.mode,ee=`relative flex min-h-0 flex-1 flex-col`;let U;t[69]===n?U=t[70]:(U=e=>(0,$.jsx)(it,{label:e.label,detail:e.detail},`${n}\u0000${e.hostId}\u0000${e.detail}`),t[69]=n,t[70]=U);let W;t[71]!==n||t[72]!==i?(W=(0,$.jsx)(J,{state:i,environmentId:n}),t[71]=n,t[72]=i,t[73]=W):W=t[73];let G;t[74]===_?G=t[75]:(G=_?(0,$.jsx)(rt,{tone:`error`,onDismiss:()=>h(null),children:_}):null,t[74]=_,t[75]=G),te=(0,$.jsxs)(`div`,{className:k(`shrink-0 bg-background`,B&&`absolute inset-x-0 top-0 z-10 max-h-[40%] overflow-y-auto`),children:[(0,$.jsx)(`div`,{hidden:!!l,children:oe.map(U)}),W,ne.length>0?(0,$.jsxs)(`div`,{role:`status`,className:`border-b px-3 py-2 text-xs text-muted-foreground`,children:[`Starting `,ne.map(et).join(`, `),`… This can take a minute.`]}):null,G]}),A=`@container relative flex min-h-0 flex-1`,M=l&&E?(0,$.jsx)(Je,{environmentId:n,device:l,hostLabel:i.hosts.find(e=>e.id===l.hostId)?.label??`Device host`,hostKind:i.hosts.find(e=>e.id===l.hostId)?.kind,hostDiagnostics:oe.find(e=>{let{hostId:t}=e;return t===l.hostId})?.detail,visible:e.visible,onFloat:P,onClose:()=>I(!1),onPowerOff:()=>I(!0)},`${n}\u0000${Xe(l)}`):B?(0,$.jsx)(xe,{name:g?.name??`Devices`,description:g?`${i.hosts.find(e=>e.id===g.hostId)?.label??`Device host`} · ${g.version}`:``,stage:`opening`,message:V??(g?g.booted?`Opening device…`:`Starting device…`:i.hostStatus===`installing`?i.hostStatusDetail??`Installing device support…`:`Finding devices…`),error:V!==null,children:V===null?null:(0,$.jsx)(w,{size:`sm`,variant:`outline`,onClick:c,children:`Retry`})}):(0,$.jsx)(`div`,{className:`scrollbar-gutter-both flex size-full flex-col overflow-y-auto px-5 py-8 text-sm text-muted-foreground`,children:(0,$.jsxs)(`div`,{className:k(`mx-auto flex w-full max-w-xl flex-col gap-6`,m.length===0&&`my-auto items-center text-center`),children:[m.length===0?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(j,{className:`size-6 opacity-60`}),(0,$.jsx)(`p`,{className:`max-h-32 w-full max-w-sm overflow-y-auto whitespace-pre-line break-words`,tabIndex:i.hostStatus===`failed`?0:void 0,children:i.hostStatus===`failed`?i.hostStatusDetail??`The device hub failed to start.`:`No simulators or emulators were found on this environment.`})]}):null,L&&m.length>0?(0,$.jsx)(`div`,{className:`w-full space-y-6 text-left`,children:m.map(e=>(0,$.jsxs)(`section`,{className:`space-y-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,$.jsx)(j,{className:`size-4 shrink-0`}),(0,$.jsx)(`h3`,{className:`font-medium`,children:Ye(e.platform)})]}),(0,$.jsx)(X,{children:e.devices.map(e=>(0,$.jsxs)(`div`,{className:`flex items-center gap-3 px-3 py-3`,children:[(0,$.jsx)(`span`,{className:`grid size-8 shrink-0 place-items-center rounded-md border border-border/60`,children:(0,$.jsx)(j,{className:`size-4`})}),(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,$.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground`,children:e.name}),(0,$.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:`${i.hosts.find(t=>t.id===e.hostId)?.label} · ${e.version} · ${e.booted?`Running`:`Stopped`}`})]}),(0,$.jsxs)(w,{variant:`outline`,size:`sm`,disabled:b!==null,"aria-label":`${e.booted?`Open`:`Start`} ${e.name}`,onClick:()=>void T(Xe(e)),children:[b===Xe(e)?(0,$.jsx)(re,{size:`xs`}):e.booted?(0,$.jsx)(y,{}):(0,$.jsx)(o,{}),e.booted?`Open`:`Start`]})]},Xe(e)))})]},e.platform))}):null,L&&!de(i)&&!i.devices.some($e)&&!se.some(Qe)?(0,$.jsx)(`p`,{className:`max-w-sm text-xs`,children:`No Android virtual devices found. Create one in Android Studio's Device Manager, then refresh.`}):null,a&&!z?(0,$.jsx)(w,{className:m.length>0?`self-start`:`self-center`,variant:`outline`,size:`sm`,onClick:()=>void u({environmentId:n,input:{}}),children:`Refresh devices`}):null]})})}t[16]=E,t[17]=f,t[18]=n,t[19]=x,t[20]=u,t[21]=a,t[22]=d,t[23]=_,t[24]=g,t[25]=b,t[26]=e,t[27]=c,t[28]=p,t[29]=i,t[30]=s,t[31]=r,t[32]=D,t[33]=O,t[34]=A,t[35]=M,t[36]=ee,t[37]=te,t[38]=N}else D=t[32],O=t[33],A=t[34],M=t[35],ee=t[36],te=t[37],N=t[38];if(O!==Symbol.for(`react.early_return_sentinel`))return O;let P;t[76]!==A||t[77]!==M?(P=(0,$.jsx)(`div`,{className:A,children:M}),t[76]=A,t[77]=M,t[78]=P):P=t[78];let F;t[79]!==P||t[80]!==ee||t[81]!==te?(F=(0,$.jsxs)(`div`,{className:ee,children:[te,P]}),t[79]=P,t[80]=ee,t[81]=te,t[82]=F):F=t[82];let I;return t[83]!==D||t[84]!==F||t[85]!==N?(I=(0,$.jsx)(D,{mode:N,children:F}),t[83]=D,t[84]=F,t[85]=N,t[86]=I):I=t[86],I}function Qe(e){return e.platform===`android`}function $e(e){return e.platform===`android`}function et(e){return e.name}function tt(e){return e.platforms.filter(nt).map(t=>({...t,hostId:e.id,hostLabel:e.label}))}function nt(e){return!e.available}function rt(e){let t=(0,Q.c)(13),n=e.tone===`warning`?`bg-warning-surface text-warning-foreground`:`bg-destructive/5 text-destructive`,r;t[0]===n?r=t[1]:(r=k(`flex items-start gap-2 border-b px-3 py-2 text-xs`,n),t[0]=n,t[1]=r);let a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(i,{className:`mt-1 size-3.5 shrink-0`}),t[2]=a):a=t[2];let o;t[3]===e.children?o=t[4]:(o=(0,$.jsx)(`div`,{className:`max-h-32 min-w-0 flex-1 overflow-y-auto whitespace-pre-wrap break-words`,tabIndex:0,children:e.children}),t[3]=e.children,t[4]=o);let s=e.tone===`warning`?`Dismiss device warning`:`Dismiss device error`,c;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(E,{}),t[5]=c):c=t[5];let l;t[6]!==e.onDismiss||t[7]!==s?(l=(0,$.jsx)(w,{size:`icon-xs`,variant:`ghost`,"aria-label":s,onClick:e.onDismiss,children:c}),t[6]=e.onDismiss,t[7]=s,t[8]=l):l=t[8];let u;return t[9]!==r||t[10]!==o||t[11]!==l?(u=(0,$.jsxs)(`div`,{role:`alert`,className:r,children:[a,o,l]}),t[9]=r,t[10]=o,t[11]=l,t[12]=u):u=t[12],u}function it(e){let t=(0,Q.c)(6),[n,r]=(0,Z.useState)(!1);if(n)return null;let i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>r(!0),t[0]=i):i=t[0];let a;t[1]===e.label?a=t[2]:(a=(0,$.jsxs)(`p`,{className:`font-medium`,children:[`Device discovery warning · `,e.label]}),t[1]=e.label,t[2]=a);let o;return t[3]!==e.detail||t[4]!==a?(o=(0,$.jsxs)(rt,{tone:`warning`,onDismiss:i,children:[a,e.detail]}),t[3]=e.detail,t[4]=a,t[5]=o):o=t[5],o}function at(e){let t=[];for(let n of[`ios`,`android`]){let r=e.devices.filter(e=>e.platform===n).toSorted((e,t)=>Number(t.booted)-Number(e.booted)||e.name.localeCompare(t.name));r.length>0&&t.push({platform:n,devices:r})}return t}export{Ze as DevicePanel};
2
+ //# sourceMappingURL=DevicePanel-DbUlYPs5.js.map
@@ -0,0 +1,2 @@
1
+ import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{Dl as i,mr as a,t as o}from"./utils-CtzgibkN.js";import{ja as s}from"./src-aYUfWMsw.js";import{f as c,u as l,y as u}from"./TooltipProvider-BUHMH_xT.js";import{t as d}from"./spinner-DiQtYQvU.js";import{i as f,n as p}from"./session-D_OiLzln.js";import{t as m}from"./use-atom-command-Bfi4daMj.js";import{n as h}from"./dialog-BJ3R7bWN.js";import{t as g}from"./device-DuASmK9r.js";import{Ao as _,Do as v,Eo as ee,Oo as te,Po as y}from"./main-D8lKEPYS.js";var b=n(),x=e(t(),1),S=e(r(),1);function C(e){let t=(0,b.c)(15),{state:n,environmentId:r}=e,i=m(g.list),[o,s]=(0,x.useState)(null);if(n.hostStatus===`disabled`)return null;let c;if(t[0]!==r||t[1]!==o||t[2]!==i||t[3]!==n.hostStatuses||t[4]!==n.hosts||t[5]!==n.supportsHostRetry){let e;t[7]!==r||t[8]!==o||t[9]!==i||t[10]!==n.hostStatuses||t[11]!==n.supportsHostRetry?(e=e=>{let t=n.hostStatuses[e.id];if(!t||![`installing`,`starting`,`failed`].includes(t.status))return null;let c=t.status===`failed`;return(0,S.jsxs)(`div`,{role:c?`alert`:`status`,className:`flex items-start gap-3 rounded-md border border-border/60 px-3 py-2 text-xs`,children:[(0,S.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,S.jsx)(`p`,{className:`font-medium`,children:e.label}),(0,S.jsx)(`p`,{className:`whitespace-pre-wrap break-words text-muted-foreground`,children:t.detail??(c?`Device support could not start.`:t.status===`installing`?`Installing device tools…`:`Starting device tools…`)}),c?(0,S.jsx)(`p`,{className:`mt-1 text-muted-foreground`,children:`Check the host connection and network access, then retry. Your device settings are saved.`}):null]}),c&&n.supportsHostRetry?(0,S.jsx)(a,{size:`compact`,variant:`outline`,disabled:o!==null,onClick:()=>{s(e.id),i({environmentId:r,input:{retryHostId:e.id}}).finally(()=>s(null))},children:o===e.id?`Retrying…`:`Retry`}):null]},e.id)},t[7]=r,t[8]=o,t[9]=i,t[10]=n.hostStatuses,t[11]=n.supportsHostRetry,t[12]=e):e=t[12],c=n.hosts.map(e),t[0]=r,t[1]=o,t[2]=i,t[3]=n.hostStatuses,t[4]=n.hosts,t[5]=n.supportsHostRetry,t[6]=c}else c=t[6];let l;return t[13]===c?l=t[14]:(l=(0,S.jsx)(`div`,{className:`space-y-2`,children:c}),t[13]=c,t[14]=l),l}var w=e=>e===`ios`?`iOS`:`Android`,T=`Enable this environment to open simulators and emulators, whether they run here or on a remote device host.`,E=`Allow new agent sessions in this environment to start and control local and remote devices, with required tools set up automatically.`,D=e=>Object.values(e.hostStatuses).some(e=>e.status===`ready`&&e.androidDiscoveryIncomplete);function O(e){let t=Object.values(e.hostStatuses).map(e=>e.status),n=e.hostStatus===`ready`||t.includes(`ready`);return{ready:n,busy:!n&&[e.hostStatus,...t].some(e=>e===`installing`||e===`starting`)}}function k(e,t){let n=e.devices.some(e=>e.platform===t);if(t===`android`&&!n&&D(e))return{ready:!1,message:`The Android device list may be incomplete. Check the device host and try again.`};let r=e.hosts.flatMap(e=>e.platforms.filter(e=>e.platform===t).map(t=>({...t,host:e}))),i=r.filter(e=>e.available).map(e=>e.host);if(i.length===0)return{ready:!1,message:r[0]?.reason??`${w(t)} support was not detected.`};if(i.filter(t=>e.hostStatuses[t.id]?.status===`ready`||t.kind===`local`&&e.hostStatus===`ready`).length>0&&!n)return{ready:!1,message:t===`ios`?`Xcode is installed, but no iOS Simulator is available. Install a runtime in Xcode Settings → Components.`:`The Android SDK is installed, but no virtual device exists. Create one in Android Studio → Device Manager.`};let a=i.every(e=>e.kind!==`local`)?i[0]:void 0,o=a?` on ${a.label}`:``;return{ready:!0,message:a?.kind===`eas`?`${a.label} starts ${t===`ios`?`iOS Simulators`:`Android emulators`} in the cloud with EAS Simulator.`:t===`ios`?`Xcode and iOS Simulator are available${o}.`:`The Android SDK and Emulator are available${o}.`}}function A(e){let t=(0,b.c)(75),n=f(e.environmentId,s),r=m(g.configure),i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i={reportFailure:!1},t[0]=i):i=t[0];let c=m(g.list,i),[l,u]=(0,x.useState)(null),[d,w]=(0,x.useState)(0),D=e.state.hostStatus!==`disabled`,k;t[1]===e.state?k=t[2]:(k=O(e.state),t[1]=e.state,t[2]=k);let{ready:A,busy:j}=k,F;t[3]===e.state.hosts?F=t[4]:(F=e.state.hosts.some(ne),t[3]=e.state.hosts,t[4]=F);let I=F,L,R;t[5]!==D||t[6]!==c||t[7]!==e.environmentId?(L=()=>{D&&c({environmentId:e.environmentId,input:{}})},R=[D,c,e.environmentId],t[5]=D,t[6]=c,t[7]=e.environmentId,t[8]=L,t[9]=R):(L=t[8],R=t[9]),(0,x.useEffect)(L,R);let z;t[10]!==r||t[11]!==e?(z=async(t,n)=>{if(!p(e.environmentId,`settings:write`))return;u(t);let i=await r({environmentId:e.environmentId,input:n});u(null),t===`complete`&&i._tag===`Success`&&e.onComplete?.()},t[10]=r,t[11]=e,t[12]=z):z=t[12];let B=z,V;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(V=[`Device hub`,`Simulators`,`Agent access`],t[13]=V):V=t[13];let H;t[14]!==j||t[15]!==l||t[16]!==d?(H=e=>j||l!==null||e>d,t[14]=j,t[15]=l,t[16]=d,t[17]=H):H=t[17];let U;t[18]!==d||t[19]!==H?(U=(0,S.jsx)(v,{title:`Set up devices`,description:`Review what runs on this environment before using simulators and emulators.`,children:(0,S.jsx)(_,{steps:V,currentStep:d,onStepChange:w,isStepDisabled:H})}),t[18]=d,t[19]=H,t[20]=U):U=t[20];let W;t[21]!==e.environmentId||t[22]!==e.state?(W=(0,S.jsx)(C,{state:e.state,environmentId:e.environmentId}),t[21]=e.environmentId,t[22]=e.state,t[23]=W):W=t[23];let G;t[24]!==j||t[25]!==n||t[26]!==D||t[27]!==l||t[28]!==e.state||t[29]!==d||t[30]!==B?(G=d===0?(0,S.jsxs)(`section`,{className:`space-y-3 text-sm`,children:[(0,S.jsx)(`h3`,{className:`font-medium`,children:`Enable the device hub`}),(0,S.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,S.jsx)(`p`,{className:`text-muted-foreground`,children:T}),(0,S.jsx)(y,{checked:D,disabled:!n||j||l!==null,"aria-label":`Enable device hub`,onCheckedChange:e=>void B(`hub`,{enabled:!!e,...e?{}:{agentAccessEnabled:!1}})})]}),(0,S.jsx)(M,{state:e.state,pending:l===`hub`||j&&l!==`agent`})]}):null,t[24]=j,t[25]=n,t[26]=D,t[27]=l,t[28]=e.state,t[29]=d,t[30]=B,t[31]=G):G=t[31];let K;t[32]!==j||t[33]!==D||t[34]!==c||t[35]!==I||t[36]!==l||t[37]!==e.environmentId||t[38]!==e.state||t[39]!==d?(K=d===1||d===0&&D&&I?(0,S.jsxs)(`section`,{className:o(`space-y-3 text-sm`,d===0&&`mt-4`),children:[(0,S.jsx)(`h3`,{className:`font-medium`,children:`Check simulator support`}),(0,S.jsx)(N,{state:e.state,checking:l===`check`,disabled:!D||j||l!==null,onCheck:()=>{u(`check`),c({environmentId:e.environmentId,input:{}}).finally(()=>u(null))}})]}):null,t[32]=j,t[33]=D,t[34]=c,t[35]=I,t[36]=l,t[37]=e.environmentId,t[38]=e.state,t[39]=d,t[40]=K):K=t[40];let q;t[41]!==j||t[42]!==n||t[43]!==D||t[44]!==l||t[45]!==e.state||t[46]!==d||t[47]!==B?(q=d===2?(0,S.jsxs)(`section`,{className:`space-y-3 text-sm`,children:[(0,S.jsx)(`h3`,{className:`font-medium`,children:`Allow agent control`}),(0,S.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,S.jsx)(`p`,{className:`text-muted-foreground`,children:E}),(0,S.jsx)(y,{checked:e.state.agentAccessEnabled,disabled:!n||!D||j||l!==null,"aria-label":`Allow agents to control devices`,onCheckedChange:e=>void B(`agent`,{agentAccessEnabled:!!e})})]}),(0,S.jsx)(P,{state:e.state,pending:l===`agent`}),(0,S.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Leave this off to keep manual device controls without giving agents access.`})]}):null,t[41]=j,t[42]=n,t[43]=D,t[44]=l,t[45]=e.state,t[46]=d,t[47]=B,t[48]=q):q=t[48];let J;t[49]!==e.state.hostStatus||t[50]!==e.state.hostStatusDetail?(J=e.state.hostStatus===`failed`&&e.state.hostStatusDetail?(0,S.jsx)(`p`,{role:`alert`,className:`mt-3 text-xs text-destructive`,children:e.state.hostStatusDetail}):null,t[49]=e.state.hostStatus,t[50]=e.state.hostStatusDetail,t[51]=J):J=t[51];let Y;t[52]!==G||t[53]!==K||t[54]!==q||t[55]!==J||t[56]!==W?(Y=(0,S.jsxs)(te,{children:[W,G,K,q,J]}),t[52]=G,t[53]=K,t[54]=q,t[55]=J,t[56]=W,t[57]=Y):Y=t[57];let X;t[58]!==j||t[59]!==l||t[60]!==d?(X=d===0?(0,S.jsx)(h,{render:(0,S.jsx)(a,{variant:`outline`}),children:`Cancel`}):(0,S.jsx)(a,{variant:`outline`,disabled:j||l!==null,onClick:()=>w(d-1),children:`Back`}),t[58]=j,t[59]=l,t[60]=d,t[61]=X):X=t[61];let Z;t[62]!==n||t[63]!==l||t[64]!==A||t[65]!==d||t[66]!==B?(Z=d<2?(0,S.jsx)(a,{disabled:!A||l!==null,onClick:()=>w(d+1),children:`Continue`}):(0,S.jsx)(a,{disabled:!n||!A||l!==null,onClick:()=>void B(`complete`,{onboardingCompleted:!0}),children:l===`complete`?`Saving…`:`Done`}),t[62]=n,t[63]=l,t[64]=A,t[65]=d,t[66]=B,t[67]=Z):Z=t[67];let Q;t[68]!==X||t[69]!==Z?(Q=(0,S.jsxs)(ee,{children:[X,Z]}),t[68]=X,t[69]=Z,t[70]=Q):Q=t[70];let $;return t[71]!==Y||t[72]!==Q||t[73]!==U?($=(0,S.jsxs)(S.Fragment,{children:[U,Y,Q]}),t[71]=Y,t[72]=Q,t[73]=U,t[74]=$):$=t[74],$}function ne(e){return e.kind===`local`&&!e.platforms.some(j)}function j(e){return e.available}function M(e){let t=(0,b.c)(5),{state:n,pending:r,compact:a}=e,o=a!==void 0&&a;if(!r&&!O(n).ready)return null;let s;t[0]===r?s=t[1]:(s=r?(0,S.jsx)(d,{size:`xs`}):(0,S.jsx)(i,{className:`size-3 text-success`}),t[0]=r,t[1]=s);let c=r?n.hostStatus===`installing`?o?`Installing…`:`Installing device hub…`:n.hostStatus===`starting`?o?`Starting…`:`Starting device hub…`:o?`Updating…`:`Updating device hub…`:`Device hub is ready.`,l;return t[2]!==s||t[3]!==c?(l=(0,S.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[s,c]}),t[2]=s,t[3]=c,t[4]=l):l=t[4],l}function N(e){let t=(0,b.c)(20),n;t[0]===e.state?n=t[1]:(n=k(e.state,`ios`),t[0]=e.state,t[1]=n);let r;t[2]===n?r=t[3]:(r=(0,S.jsx)(I,{platform:`iOS`,status:n}),t[2]=n,t[3]=r);let i;t[4]===e.state?i=t[5]:(i=k(e.state,`android`),t[4]=e.state,t[5]=i);let o;t[6]===i?o=t[7]:(o=(0,S.jsx)(I,{platform:`Android`,status:i}),t[6]=i,t[7]=o);let s;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,S.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`You can use either platform. Fixing a missing platform does not block the other one.`}),t[8]=s):s=t[8];let c;t[9]===e.checking?c=t[10]:(c=e.checking?(0,S.jsx)(d,{size:`xs`}):null,t[9]=e.checking,t[10]=c);let l=e.checking?`Checking…`:`Check again`,u;t[11]!==e.disabled||t[12]!==e.onCheck||t[13]!==c||t[14]!==l?(u=(0,S.jsxs)(a,{size:`compact`,variant:`outline`,disabled:e.disabled,onClick:e.onCheck,children:[c,l]}),t[11]=e.disabled,t[12]=e.onCheck,t[13]=c,t[14]=l,t[15]=u):u=t[15];let f;return t[16]!==r||t[17]!==o||t[18]!==u?(f=(0,S.jsxs)(`div`,{className:`space-y-3`,children:[r,o,s,u]}),t[16]=r,t[17]=o,t[18]=u,t[19]=f):f=t[19],f}function P(e){let t=(0,b.c)(4);if(e.pending){let n=e.state.hostStatus===`installing`?e.compact?`Installing…`:`Installing agent tools…`:e.state.hostStatus===`starting`?e.compact?`Starting…`:`Starting agent tools…`:e.compact?`Updating…`:`Updating agent access…`,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,S.jsx)(d,{size:`xs`}),t[0]=r):r=t[0];let i;return t[1]===n?i=t[2]:(i=(0,S.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[r,n]}),t[1]=n,t[2]=i),i}if(e.state.agentAccessEnabled&&O(e.state).ready&&e.state.hosts.some(F)){let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,S.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,S.jsx)(i,{className:`size-3 text-success`}),`Agent tools are ready.`]}),t[3]=e):e=t[3],e}return null}function F(e){return e.agentDeviceInstalled}function I(e){let t=(0,b.c)(21),n=!e.compact&&`rounded-md border border-border/60 px-3 py-2`,r;t[0]===n?r=t[1]:(r=o(`flex gap-2`,n),t[0]=n,t[1]=r);let i=e.status.ready?`text-success`:`text-muted-foreground`,a;t[2]===i?a=t[3]:(a=o(`mt-0.5 size-4 shrink-0`,i),t[2]=i,t[3]=a);let s=e.status.ready?c:u,d;t[4]!==a||t[5]!==s?(d=(0,S.jsx)(l,{className:a,icon:s}),t[4]=a,t[5]=s,t[6]=d):d=t[6];let f=e.compact&&e.status.ready&&`flex items-center gap-2`,p;t[7]===f?p=t[8]:(p=o(f),t[7]=f,t[8]=p);let m;t[9]===e.platform?m=t[10]:(m=(0,S.jsx)(`p`,{className:`font-medium`,children:e.platform}),t[9]=e.platform,t[10]=m);let h=e.compact&&e.status.ready?`Ready`:e.status.message,g;t[11]===h?g=t[12]:(g=(0,S.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:h}),t[11]=h,t[12]=g);let _;t[13]!==g||t[14]!==p||t[15]!==m?(_=(0,S.jsxs)(`div`,{className:p,children:[m,g]}),t[13]=g,t[14]=p,t[15]=m,t[16]=_):_=t[16];let v;return t[17]!==r||t[18]!==_||t[19]!==d?(v=(0,S.jsxs)(`div`,{className:r,children:[d,_]}),t[17]=r,t[18]=_,t[19]=d,t[20]=v):v=t[20],v}export{E as a,D as c,I as i,k as l,M as n,T as o,A as r,O as s,P as t,C as u};
2
+ //# sourceMappingURL=DeviceSetup-DwoJ9gYG.js.map
@@ -0,0 +1,2 @@
1
+ import{a as e,t}from"./react-BUfh6y28.js";import{t as n}from"./jsx-runtime-DJeoFXNw.js";import{Ci as r,Ei as i,Fi as a,Hi as o,Jr as s,Li as c,Mr as l,Na as u,Ni as d,Pr as f,Si as p,To as m,Va as h,Za as g,_a as _,_i as v,bi as y,ga as b,gi as x,hi as S,ja as C,kr as w,mi as T,no as E,vi as D,wa as O,wi as k,xi as A,xo as j,yi as M,yo as N,zr as P}from"./utils-CtzgibkN.js";import{f as F,i as I,n as L,s as R}from"./useRender-BP5vR6yH.js";var z=e(t()),B=z.createContext(!1),V=z.createContext(void 0);function H(e){let t=z.useContext(V);if(e===!1&&t===void 0)throw Error(F(27));return t}var U={...j,...m},W=z.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,{store:s}=H(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`),d={open:c,transitionStatus:s.useState(`transitionStatus`)};return L(`div`,e,{state:d,ref:[s.context.backdropRef,t],stateAttributesMapping:U,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),G=z.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,...s}=e,{store:c}=H(),l=c.useState(`open`),{getButtonProps:u,buttonRef:d}=h({disabled:a,native:o}),f={disabled:a};function p(e){l&&c.setOpen(!1,C(g,e.nativeEvent))}return L(`button`,e,{state:f,ref:[t,d],props:[{onClick:p},s,u]})}),K=z.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,{store:s}=H(),c=u(a);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),L(`p`,e,{ref:t,props:[{id:c},o]})}),q=function(e){return e.nestedDialogs=`--nested-dialogs`,e}({}),ee=function(e){return e[e.open=N.open]=`open`,e[e.closed=N.closed]=`closed`,e[e.startingStyle=N.startingStyle]=`startingStyle`,e[e.endingStyle=N.endingStyle]=`endingStyle`,e.nested=`data-nested`,e.nestedDialogOpen=`data-nested-dialog-open`,e}({}),J=z.createContext(void 0);function Y(){let e=z.useContext(J);if(e===void 0)throw Error(F(26));return e}var X=e(n()),te={...j,...m,nestedDialogOpen(e){return e?{[ee.nestedDialogOpen]:``}:null}},ne=z.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...l}=e,{store:u}=H(),d=u.useState(`descriptionElementId`),f=u.useState(`disablePointerDismissal`),p=u.useState(`floatingRootContext`),m=u.useState(`popupProps`),h=u.useState(`modal`),g=u.useState(`mounted`),_=u.useState(`nested`),v=u.useState(`nestedOpenDialogCount`),y=u.useState(`open`),b=u.useState(`openMethod`),x=u.useState(`titleElementId`),S=u.useState(`transitionStatus`),C=u.useState(`role`),w=p.useState(`floatingId`),T=l.id??w;Y(),O({open:y,ref:u.context.popupRef,onComplete(){y&&u.context.onOpenChangeComplete?.(!0)}});function E(e){return e!==`touch`||u.context.popupRef.current}let k=o===void 0?E:o,A=v>0,j=u.useStateSetter(`popupElement`),M=L(`div`,e,{state:{open:y,nested:_,transitionStatus:S,nestedDialogOpen:A},props:[m,{id:T,"aria-labelledby":x??void 0,"aria-describedby":d??void 0,role:C,...D,hidden:!g,onKeyDown(e){s.has(e.key)&&e.stopPropagation()},style:{[q.nestedDialogs]:v}},l],ref:[t,u.context.popupRef,j],stateAttributesMapping:te});return(0,X.jsx)(c,{context:p,openInteractionType:b,disabled:!g,closeOnFocusOut:!f,initialFocus:k,returnFocus:a,modal:h!==!1,restoreFocus:`popup`,children:M})}),re=z.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=H(),a=i.useState(`mounted`),s=i.useState(`modal`),c=i.useState(`open`);return a||n?(0,X.jsx)(J.Provider,{value:n,children:(0,X.jsxs)(o,{ref:t,...r,children:[a&&s===!0&&(0,X.jsx)(f,{ref:i.context.internalBackdropRef,inert:P(!c)}),e.children]})}):null});function ie(e){let{store:t,parentContext:n,actionsRef:i,isDrawer:a}=e,o=t.useState(`open`);r(t,o),y(t);let{forceUnmount:s}=A(o,t),c=z.useCallback(()=>{t.setOpen(!1,C(E))},[t]);return z.useImperativeHandle(i,()=>({unmount:s,close:c}),[s,c]),{parentContext:n,isDrawer:a}}function ae({store:e,dialogRoot:t}){let{parentContext:n,isDrawer:r}=t,i=e.useState(`open`),o=e.useState(`disablePointerDismissal`),s=e.useState(`modal`),c=e.useState(`popupElement`),u=e.useState(`floatingRootContext`),[d,f]=z.useState(0),[m,h]=z.useState(0),g=d===0,v=a(u,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:s===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0||`touches`in t&&t.touches.length!==1)return!1;let n=_(t);if(g&&!o){let t=n;return s&&(e.context.internalBackdropRef.current||e.context.backdropRef.current)?e.context.internalBackdropRef.current===t||e.context.backdropRef.current===t||b(t,c)&&!t?.hasAttribute(`data-base-ui-portal`):!0}return!1},escapeKey:g});l(i&&s===!0,c),e.useContextCallback(`onNestedDialogOpen`,(e,t)=>{f(e),h(t)}),e.useContextCallback(`onNestedDialogClose`,()=>{f(0),h(0)}),z.useEffect(()=>(n?.onNestedDialogOpen&&i&&n.onNestedDialogOpen(d+1,m+ +!!r),n?.onNestedDialogClose&&!i&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&i&&n.onNestedDialogClose()}),[r,i,d,m,n]);let y=v.reference??R,x=v.trigger??R,S=z.useMemo(()=>I(D,v.floating),[v.floating]);return p(e,{activeTriggerProps:y,inactiveTriggerProps:x,popupProps:S,nestedOpenDialogCount:d,nestedOpenDrawerCount:m}),null}var oe={...x,modal:d(e=>e.modal),nested:d(e=>e.nested),nestedOpenDialogCount:d(e=>e.nestedOpenDialogCount),nestedOpenDrawerCount:d(e=>e.nestedOpenDrawerCount),disablePointerDismissal:d(e=>e.disablePointerDismissal),openMethod:d(e=>e.openMethod),descriptionElementId:d(e=>e.descriptionElementId),titleElementId:d(e=>e.titleElementId),viewportElement:d(e=>e.viewportElement),role:d(e=>e.role)},Z=class e extends i{constructor(e,t,n=!1){let r=new v,i=se(e);i.floatingRootContext=S(r,t,n),super(i,{popupRef:z.createRef(),backdropRef:z.createRef(),internalBackdropRef:z.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:r,onOpenChange:void 0,onOpenChangeComplete:void 0},oe)}setOpen=(e,t)=>{if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let n={open:e};M(n,e,t.trigger),this.update(n)};static useStore(t,n){return k(t,(t,r)=>new e(n,t,r),!0).store}};function se(e={}){return{...T(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e}}function Q(e,t=`dialog`){let{children:n,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:o,disablePointerDismissal:s=!1,modal:c=!0,actionsRef:l,handle:u,triggerId:d,defaultTriggerId:f=null}=e,p=t===`drawer`,m=t===`alert-dialog`,h=m?!0:c,g=m||s,_=m?`alertdialog`:`dialog`,v=H(!0),y={modal:h,disablePointerDismissal:g,nested:!!v,role:_},b=Z.useStore(u?.store,{open:i,openProp:r,activeTriggerId:f,triggerIdProp:d,...y});w(()=>{let e=r===void 0&&b.state.open===!1&&i===!0?{open:!0,activeTriggerId:f}:null;m?b.update(e?{...y,...e}:y):e&&b.update(e)}),b.useControlledProp(`openProp`,r),b.useControlledProp(`triggerIdProp`,d),b.useSyncedValues(y),b.useContextCallback(`onOpenChange`,a),b.useContextCallback(`onOpenChangeComplete`,o);let x=b.useState(`open`),S=b.useState(`mounted`),C=b.useState(`payload`),T=ie({store:b,actionsRef:l,parentContext:v?.store.context,isDrawer:p}),E=x||S,D=z.useMemo(()=>({store:b}),[b]);return(0,X.jsx)(B.Provider,{value:!1,children:(0,X.jsxs)(V.Provider,{value:D,children:[E&&(0,X.jsx)(ae,{store:b,dialogRoot:T}),typeof n==`function`?n({payload:C}):n]})})}function ce(e){return Q(e,z.useContext(B)?`drawer`:`dialog`)}var $=function(e){return e[e.open=N.open]=`open`,e[e.closed=N.closed]=`closed`,e[e.startingStyle=N.startingStyle]=`startingStyle`,e[e.endingStyle=N.endingStyle]=`endingStyle`,e.nested=`data-nested`,e.nestedDialogOpen=`data-nested-dialog-open`,e}({}),le={...j,...m,nested(e){return e?{[$.nested]:``}:null},nestedDialogOpen(e){return e?{[$.nestedDialogOpen]:``}:null}},ue=z.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,s=Y(),{store:c}=H(),l=c.useState(`open`),u=c.useState(`nested`),d=c.useState(`transitionStatus`),f=c.useState(`nestedOpenDialogCount`),p=c.useState(`mounted`),m=c.useStateSetter(`viewportElement`);return L(`div`,e,{enabled:s||p,state:{open:l,nested:u,transitionStatus:d,nestedDialogOpen:f>0},ref:[t,m],stateAttributesMapping:le,props:[{role:`presentation`,hidden:!p,style:{pointerEvents:l?void 0:`none`},children:a},o]})}),de=z.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,{store:s}=H(),c=u(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),L(`h2`,e,{ref:t,props:[{id:c},o]})});export{Z as a,K as c,H as d,Q as i,G as l,ue as n,re as o,ce as r,ne as s,de as t,W as u};
2
+ //# sourceMappingURL=DialogTitle-CZ-x-t6r.js.map