ryco-cli 0.1.23 → 0.1.24

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 (269) hide show
  1. package/dist/bin.cjs +228 -88
  2. package/dist/bin.mjs +230 -90
  3. package/dist/client/assets/AccountSettings-ApnDA1f-.js +1 -0
  4. package/dist/client/assets/AiFocusSettings-CNmGHEcA.js +1 -0
  5. package/dist/client/assets/{AnimatedHeight-D9bpLPqe.js → AnimatedHeight-i0YhvlGD.js} +1 -1
  6. package/dist/client/assets/AppearanceSettings-BG8W4DP0.js +1 -0
  7. package/dist/client/assets/BranchToolbar.logic-AgPy06Mx.js +1 -0
  8. package/dist/client/assets/BrowserPanel-BWztlNuL.js +1 -0
  9. package/dist/client/assets/ChatRightPanel-a6UOHNMm.js +194 -0
  10. package/dist/client/assets/ChatThreadRouteView-CWoBLzR_.js +1 -0
  11. package/dist/client/assets/CommandPaletteDialog-B2iKWCUi.js +1 -0
  12. package/dist/client/assets/CompositeRoot-C1G-Ejus.js +1 -0
  13. package/dist/client/assets/ComputerUseSettings-CPwWoHWj.js +1 -0
  14. package/dist/client/assets/ConnectionsSettings-CPMkuxza.js +7 -0
  15. package/dist/client/assets/ContextHandoffEndpointLabel-BildLLDY.js +4 -0
  16. package/dist/client/assets/DiagnosticsSettings-DvnNz2AZ.js +2 -0
  17. package/dist/client/assets/DialogHandle-8o3kfoiI.js +1 -0
  18. package/dist/client/assets/DialogPopup-CLw6NCkW.js +1 -0
  19. package/dist/client/assets/DialogRoot-SKkIuQHA.js +1 -0
  20. package/dist/client/assets/DialogTitle-DCHX74Tz.js +1 -0
  21. package/dist/client/assets/DialogTrigger-Bl_fcIV2.js +1 -0
  22. package/dist/client/assets/DialogViewport-DVDl03yd.js +1 -0
  23. package/dist/client/assets/DraftChatThreadRouteView-CEDYjbKq.js +1 -0
  24. package/dist/client/assets/{ExternalIdentityWeb.logic-pjD4pCDd.js → ExternalIdentityWeb.logic-arHvT6AX.js} +1 -1
  25. package/dist/client/assets/GlassSurface-GY6owikG.js +1 -0
  26. package/dist/client/assets/HostedConnectionControls-COUhSe9x.js +1 -0
  27. package/dist/client/assets/HostedHubRoot-BTWc0XoQ.js +2 -0
  28. package/dist/client/assets/HostedNativeAuthorizationRoute-DZhYxv--.js +2 -0
  29. package/dist/client/assets/HostedRelayTrustNotice-Bl6On0Yi.js +1 -0
  30. package/dist/client/assets/IntegrationsSettingsPanel-n9owMZf-.js +2 -0
  31. package/dist/client/assets/KeybindingsSettings-CPtXx-W2.js +7 -0
  32. package/dist/client/assets/LazyBrowserPanel-SUIBB7B4.js +2 -0
  33. package/dist/client/assets/McpServersSettings-BWIUud0Z.js +6 -0
  34. package/dist/client/assets/MobileSheet-NTayGHF6.js +1 -0
  35. package/dist/client/assets/NodeSecuritySettings-BFifrshE.js +1 -0
  36. package/dist/client/assets/OpinionatedPluginsSettings-D7WuuNWZ.js +1 -0
  37. package/dist/client/assets/PhoneGetAppInterstitial-R0cqI17q.js +1 -0
  38. package/dist/client/assets/PhoneHome-FqWvnJP_.js +1 -0
  39. package/dist/client/assets/PhoneSettingsSurface-w5PJnoBc.js +2 -0
  40. package/dist/client/assets/ProviderModelPicker-dwWhl7Uf.js +1 -0
  41. package/dist/client/assets/ProvidersSettingsPanel-Ww1ch3xA.js +1 -0
  42. package/dist/client/assets/QuitShortcutFeedback-CklL3jMd.js +1 -0
  43. package/dist/client/assets/RedactedSensitiveText-CLPBtvH1.js +1 -0
  44. package/dist/client/assets/RootAppShell-BdQCs2XJ.js +7 -0
  45. package/dist/client/assets/Separator-CpYBhf-I.js +1 -0
  46. package/dist/client/assets/SettingsDialog-DeMzEeCP.js +2 -0
  47. package/dist/client/assets/SettingsPanels-ZxNz9ZfL.js +3 -0
  48. package/dist/client/assets/SettingsPanels.editor-9pSZP875.js +1 -0
  49. package/dist/client/assets/SourceControlSettings-C1F3Brcn.js +1 -0
  50. package/dist/client/assets/StatisticsPage-C7v-6CTr.js +1 -0
  51. package/dist/client/assets/StatisticsPanel-CeIjiBm8.js +1 -0
  52. package/dist/client/assets/StatisticsSettingsLink-5s_violW.js +1 -0
  53. package/dist/client/assets/{ThreadTerminalDrawer-DcZk76Y9.js → ThreadTerminalDrawer-CHZ60lPI.js} +11 -11
  54. package/dist/client/assets/{ThreadWorkspacePanel-Shhau2BD.js → ThreadWorkspacePanel-Ct5kMcuY.js} +17 -17
  55. package/dist/client/assets/activity-BMBx2Fu0.js +1 -0
  56. package/dist/client/assets/alert-CXnC_RJc.js +1 -0
  57. package/dist/client/assets/{appChrome-CiOQzE1d.js → appChrome-BzM66lXM.js} +1 -1
  58. package/dist/client/assets/arrow-left-CymyVbCi.js +1 -0
  59. package/dist/client/assets/arrow-right-9wyq4YVq.js +1 -0
  60. package/dist/client/assets/arrow-up-right-mfU38K6p.js +1 -0
  61. package/dist/client/assets/authorization-CjOFkg7b.js +1 -0
  62. package/dist/client/assets/badge-Dg7mXiOh.js +1 -0
  63. package/dist/client/assets/bot-BR3RyOWP.js +1 -0
  64. package/dist/client/assets/{capabilities-BTd0MRtv.js → capabilities-C8sxDbKT.js} +1 -1
  65. package/dist/client/assets/chart-column-CcRi3pAd.js +1 -0
  66. package/dist/client/assets/chevron-right-CuUjBsQV.js +1 -0
  67. package/dist/client/assets/clipboard-copy-ezz8rnaT.js +1 -0
  68. package/dist/client/assets/data-list-ZLhzdlED.js +1 -0
  69. package/dist/client/assets/desktopWorkspace-P28r2lN2.js +1 -0
  70. package/dist/client/assets/download-BA9L9tK9.js +1 -0
  71. package/dist/client/assets/editorPreferences-DeKdSV3s.js +1 -0
  72. package/dist/client/assets/empty-3NpXLnAM.js +1 -0
  73. package/dist/client/assets/group-D5qBdsaB.js +1 -0
  74. package/dist/client/assets/hostedConnectionCoordinator-CLV-JD1S.js +1 -0
  75. package/dist/client/assets/{hostedPairing-PogXRAb7.js → hostedPairing-B_ylEEDa.js} +1 -1
  76. package/dist/client/assets/hubRoutes-EWJ3Gdod.js +1 -0
  77. package/dist/client/assets/{index-D5j6WG7w.js → index-DxCd1PgA.js} +2 -2
  78. package/dist/client/assets/input-DrOL1KPS.js +1 -0
  79. package/dist/client/assets/kbd-rWDjJnWX.js +1 -0
  80. package/dist/client/assets/key-round-D2DtQ7aS.js +1 -0
  81. package/dist/client/assets/layers-DtSJWmwy.js +1 -0
  82. package/dist/client/assets/log-out-YAp9fsOg.js +1 -0
  83. package/dist/client/assets/{logging-DfaR8ACp.js → logging-BuUPX1SP.js} +1 -1
  84. package/dist/client/assets/main-BbtLAX7M.js +9 -0
  85. package/dist/client/assets/{main-CRk9p9SC.css → main-D4CtFNPY.css} +1 -1
  86. package/dist/client/assets/monitor-OyD484tI.js +1 -0
  87. package/dist/client/assets/palette-D18VboLH.js +1 -0
  88. package/dist/client/assets/play-d3KUi4G6.js +1 -0
  89. package/dist/client/assets/primary-D_D7eLwT.js +2 -0
  90. package/dist/client/assets/{providerDriverMeta-Cl-ADdmZ.js → providerDriverMeta-DNTocCcU.js} +1 -1
  91. package/dist/client/assets/providerModels-bFbEIfL9.js +1 -0
  92. package/dist/client/assets/{qr-code-Bun4dpvz.js → qr-code-Bk1kdf_k.js} +1 -1
  93. package/dist/client/assets/qr-code-MAZkoKtL.js +1 -0
  94. package/dist/client/assets/radio-group-D-VCGinX.js +2 -0
  95. package/dist/client/assets/refresh-cw-DY3_Ph-S.js +1 -0
  96. package/dist/client/assets/runtime-Djy96GJd.js +17 -0
  97. package/dist/client/assets/save-ugJXuJRM.js +1 -0
  98. package/dist/client/assets/scroll-area-BMnGzd2a.js +1 -0
  99. package/dist/client/assets/scrollEdges-QLSFwGSQ.js +1 -0
  100. package/dist/client/assets/separator-BwUYkCkX.js +1 -0
  101. package/dist/client/assets/settingsLayout-C6SUmJVB.js +1 -0
  102. package/dist/client/assets/sheet-DLy4aeVa.js +1 -0
  103. package/dist/client/assets/shield-Zq_ygsnJ.js +1 -0
  104. package/dist/client/assets/shield-alert-DfUhTI4-.js +1 -0
  105. package/dist/client/assets/shield-check-CO4SMhAs.js +1 -0
  106. package/dist/client/assets/sidebar-DNnW-a2V.js +1 -0
  107. package/dist/client/assets/sidebarProjectFolders-ygpaKZM6.js +4 -0
  108. package/dist/client/assets/sidebarStatusText-CawrXnx0.js +1 -0
  109. package/dist/client/assets/skeleton-DRm4_OvB.js +1 -0
  110. package/dist/client/assets/smartphone-O2VACDhU.js +1 -0
  111. package/dist/client/assets/sparkles-isHutYWU.js +1 -0
  112. package/dist/client/assets/src-BSuAGqhK.js +14 -0
  113. package/dist/client/assets/star-7UHEnC3x.js +1 -0
  114. package/dist/client/assets/{switch-COrEGDkz.js → switch-DD1qVLgN.js} +9 -9
  115. package/dist/client/assets/toastHelpers-CSQRKo4F.js +1 -0
  116. package/dist/client/assets/toggle-CaKBNe6W.js +1 -0
  117. package/dist/client/assets/toggle-group-UeFeTI3u.js +1 -0
  118. package/dist/client/assets/tokenModePresentation-DV56ekA4.js +1 -0
  119. package/dist/client/assets/tooltip-DXvXxL37.js +1 -0
  120. package/dist/client/assets/unplug-DisTpujT.js +1 -0
  121. package/dist/client/assets/useAppSidebarCollapsed-CaAsLi1q.js +1 -0
  122. package/dist/client/assets/useBaseUiId-CJN4MvrU.js +1 -0
  123. package/dist/client/assets/useLabelableId-BsDFG9Oj.js +1 -0
  124. package/dist/client/assets/useNavigate-cLfxn_9L.js +1 -0
  125. package/dist/client/assets/usePhoneThreadActions-rekHL1Mi.js +1 -0
  126. package/dist/client/assets/usePopupViewport-kXU31P6l.js +1 -0
  127. package/dist/client/assets/useScrollLock-DjMxrUJe.js +1 -0
  128. package/dist/client/assets/{useStatistics-DfLU9_Qu.js → useStatistics-BYP-9CmW.js} +15 -15
  129. package/dist/client/assets/useTriggerFocusGuards-DuAm2B8C.js +1 -0
  130. package/dist/client/assets/useValueChanged-DreFjrMK.js +1 -0
  131. package/dist/client/assets/user-round-DctamWV6.js +1 -0
  132. package/dist/client/assets/{vscode-icons-Dgo7Sslf.js → vscode-icons-Dw-LGJAv.js} +1 -1
  133. package/dist/client/assets/{workspaceMetadataProjection-UiprkDbH.js → workspaceMetadataProjection-BL4sEIL2.js} +1 -1
  134. package/dist/client/assets/wrench-Ds8eZerZ.js +1 -0
  135. package/dist/client/index.html +1 -1
  136. package/dist/resource-monitor/ryco-resource-monitor +0 -0
  137. package/dist/resource-monitor/ryco-resource-monitor.exe +0 -0
  138. package/dist/resource-monitor/win32-arm64/ryco-resource-monitor.exe +0 -0
  139. package/dist/resource-monitor/win32-x64/ryco-resource-monitor.exe +0 -0
  140. package/package.json +1 -1
  141. package/dist/client/assets/AccountSettings-DGvZzAqN.js +0 -1
  142. package/dist/client/assets/AiFocusSettings-D8wZfNES.js +0 -1
  143. package/dist/client/assets/AppearanceSettings-BFo6g6_s.js +0 -1
  144. package/dist/client/assets/BranchToolbar.logic-CmO2U1U7.js +0 -1
  145. package/dist/client/assets/BrowserPanel-r6is5C3e.js +0 -1
  146. package/dist/client/assets/ChatRightPanel-BewXBRFZ.js +0 -194
  147. package/dist/client/assets/ChatThreadRouteView-CC_6FmHd.js +0 -1
  148. package/dist/client/assets/CommandPaletteDialog-ftA_Xg2G.js +0 -1
  149. package/dist/client/assets/CompositeRoot-arlgwzfX.js +0 -1
  150. package/dist/client/assets/ComputerUseSettings-V-oMtddy.js +0 -1
  151. package/dist/client/assets/ConnectionsSettings-BrFvrRjz.js +0 -7
  152. package/dist/client/assets/ContextHandoffEndpointLabel-CPeU4K5A.js +0 -4
  153. package/dist/client/assets/DiagnosticsSettings-Dk3JaIOU.js +0 -2
  154. package/dist/client/assets/DialogHandle-00ZXxxpz.js +0 -1
  155. package/dist/client/assets/DialogPopup-mazVJKyB.js +0 -1
  156. package/dist/client/assets/DialogRoot-CWlzx19Z.js +0 -1
  157. package/dist/client/assets/DialogTitle-CKaEtTky.js +0 -1
  158. package/dist/client/assets/DialogTrigger-CiElTNmo.js +0 -1
  159. package/dist/client/assets/DialogViewport-a5beR5bY.js +0 -1
  160. package/dist/client/assets/DraftChatThreadRouteView-DMwnSfgh.js +0 -1
  161. package/dist/client/assets/FloatingPortalLite-DWdtHKob.js +0 -1
  162. package/dist/client/assets/GlassSurface-BqfxDYiR.js +0 -1
  163. package/dist/client/assets/HostedConnectionControls-BmJd89CC.js +0 -1
  164. package/dist/client/assets/HostedHubRoot-CRIiJ67A.js +0 -2
  165. package/dist/client/assets/HostedNativeAuthorizationRoute-DcksCt9n.js +0 -2
  166. package/dist/client/assets/HostedRelayTrustNotice-C9pl5h2a.js +0 -1
  167. package/dist/client/assets/IntegrationsSettingsPanel-BnfjyLrM.js +0 -2
  168. package/dist/client/assets/KeybindingsSettings-CkW7lzvz.js +0 -7
  169. package/dist/client/assets/LazyBrowserPanel-C6uMUmoV.js +0 -2
  170. package/dist/client/assets/McpServersSettings-BdXgS-Pm.js +0 -6
  171. package/dist/client/assets/MobileSheet-D19YdeQ9.js +0 -1
  172. package/dist/client/assets/NodeSecuritySettings-BfcBgtEg.js +0 -1
  173. package/dist/client/assets/OpinionatedPluginsSettings-YY54IT7P.js +0 -1
  174. package/dist/client/assets/PhoneGetAppInterstitial-9r6NwJP8.js +0 -1
  175. package/dist/client/assets/PhoneHome-DnEJp0bU.js +0 -1
  176. package/dist/client/assets/PhoneSettingsSurface-NKJrLCxU.js +0 -2
  177. package/dist/client/assets/ProviderModelPicker-CYGv-4fE.js +0 -1
  178. package/dist/client/assets/ProvidersSettingsPanel-DsXHij4h.js +0 -1
  179. package/dist/client/assets/QuitShortcutFeedback-BVyYaNtd.js +0 -1
  180. package/dist/client/assets/RedactedSensitiveText-D8j7kpow.js +0 -1
  181. package/dist/client/assets/RootAppShell-D7c8sbA0.js +0 -7
  182. package/dist/client/assets/Separator-Bn8l1oSK.js +0 -1
  183. package/dist/client/assets/SettingsDialog-BlPX1mT8.js +0 -2
  184. package/dist/client/assets/SettingsPanels-CeuvwIV_.js +0 -3
  185. package/dist/client/assets/SettingsPanels.editor-CLJJeKLI.js +0 -1
  186. package/dist/client/assets/SourceControlSettings-D-GeZ6PW.js +0 -1
  187. package/dist/client/assets/StatisticsPage-poomFDoQ.js +0 -1
  188. package/dist/client/assets/StatisticsPanel-DbGgCCpZ.js +0 -1
  189. package/dist/client/assets/StatisticsSettingsLink-Brc9--O7.js +0 -1
  190. package/dist/client/assets/activity-Dy-wOS-S.js +0 -1
  191. package/dist/client/assets/alert-4WZo8oMe.js +0 -1
  192. package/dist/client/assets/arrow-left-gLRAasih.js +0 -1
  193. package/dist/client/assets/arrow-right-CAK2t4QL.js +0 -1
  194. package/dist/client/assets/arrow-up-right-DP0hmMEB.js +0 -1
  195. package/dist/client/assets/authorization-K_UCP_xh.js +0 -1
  196. package/dist/client/assets/badge-CYDyJZRJ.js +0 -1
  197. package/dist/client/assets/bot-CCrx5oCt.js +0 -1
  198. package/dist/client/assets/button-QrCU0tNP.js +0 -1
  199. package/dist/client/assets/chart-column-BvK6lSzG.js +0 -1
  200. package/dist/client/assets/chevron-down-yka18-iP.js +0 -1
  201. package/dist/client/assets/chevron-right-CHyIXx5W.js +0 -1
  202. package/dist/client/assets/clamp-D0kAXd-u.js +0 -1
  203. package/dist/client/assets/clipboard-copy-DfdkWOiT.js +0 -1
  204. package/dist/client/assets/copy-riIPLkKV.js +0 -1
  205. package/dist/client/assets/data-list-CsiYTho5.js +0 -1
  206. package/dist/client/assets/download-B0lbSdq5.js +0 -1
  207. package/dist/client/assets/editorPreferences-Cf2Smgu1.js +0 -1
  208. package/dist/client/assets/empty-CHk0OiOB.js +0 -1
  209. package/dist/client/assets/group-DfFZdj79.js +0 -1
  210. package/dist/client/assets/hostedConnectionCoordinator-DZh1yVqz.js +0 -1
  211. package/dist/client/assets/input-BAC5Cd3b.js +0 -1
  212. package/dist/client/assets/kbd-CMUW8K7b.js +0 -1
  213. package/dist/client/assets/key-round-Cm6itp2V.js +0 -1
  214. package/dist/client/assets/layers-DoDpJao_.js +0 -1
  215. package/dist/client/assets/loader-circle-D0CNb5GI.js +0 -1
  216. package/dist/client/assets/log-out-BuoOiS45.js +0 -1
  217. package/dist/client/assets/main-DaXSCt8g.js +0 -9
  218. package/dist/client/assets/monitor-Dyigmrl2.js +0 -1
  219. package/dist/client/assets/palette-kIM_geXk.js +0 -1
  220. package/dist/client/assets/play-Dh8XDMnw.js +0 -1
  221. package/dist/client/assets/primary-DjXNHNGV.js +0 -2
  222. package/dist/client/assets/providerModels-dpugJUmV.js +0 -1
  223. package/dist/client/assets/qr-code-CkI1p05P.js +0 -1
  224. package/dist/client/assets/radio-group-Hh0oQGyf.js +0 -2
  225. package/dist/client/assets/react-dom-x9LNwWQc.js +0 -1
  226. package/dist/client/assets/refresh-cw-MqmsC7V0.js +0 -1
  227. package/dist/client/assets/runtime-L56puJDA.js +0 -17
  228. package/dist/client/assets/save-BSB81i-r.js +0 -1
  229. package/dist/client/assets/scroll-area-DCGCzd6v.js +0 -1
  230. package/dist/client/assets/scrollEdges-DIzjkUJG.js +0 -1
  231. package/dist/client/assets/separator-YeH3P39x.js +0 -1
  232. package/dist/client/assets/settingsLayout-CmNqO2kB.js +0 -1
  233. package/dist/client/assets/settingsSections.logic-Bg960p_I.js +0 -1
  234. package/dist/client/assets/sheet-CTbjQ5Bv.js +0 -1
  235. package/dist/client/assets/shield-DlqCO-0N.js +0 -1
  236. package/dist/client/assets/shield-alert-BrZ-Rb8N.js +0 -1
  237. package/dist/client/assets/shield-check-DHxdM6te.js +0 -1
  238. package/dist/client/assets/sidebar-4cwEndEB.js +0 -1
  239. package/dist/client/assets/sidebarProjectFolders-C7WDwUYJ.js +0 -4
  240. package/dist/client/assets/sidebarStatusText-Cq_MMykN.js +0 -1
  241. package/dist/client/assets/skeleton-BlostfCS.js +0 -1
  242. package/dist/client/assets/smartphone-OaA-Xj_d.js +0 -1
  243. package/dist/client/assets/sparkles-BXwkPX2M.js +0 -1
  244. package/dist/client/assets/src-gDjuIvMO.js +0 -14
  245. package/dist/client/assets/star-BjaAYD-x.js +0 -1
  246. package/dist/client/assets/toast-C_F1LeME.js +0 -1
  247. package/dist/client/assets/toggle-BPNEBXg_.js +0 -1
  248. package/dist/client/assets/toggle-group-BC1zJ9xi.js +0 -1
  249. package/dist/client/assets/tokenModePresentation-DUJ8DMTy.js +0 -1
  250. package/dist/client/assets/tooltip-iy3_osu5.js +0 -1
  251. package/dist/client/assets/triangle-alert-YXqtFxD6.js +0 -1
  252. package/dist/client/assets/unplug-e3z4rXgY.js +0 -1
  253. package/dist/client/assets/useAppSidebarCollapsed-mtvJ7qbW.js +0 -1
  254. package/dist/client/assets/useLabelableId-NJQsKdL6.js +0 -1
  255. package/dist/client/assets/useNavigate-2tVq4iZ2.js +0 -1
  256. package/dist/client/assets/usePhoneThreadActions-97AsVVIR.js +0 -1
  257. package/dist/client/assets/usePopupViewport-8OM2irPK.js +0 -1
  258. package/dist/client/assets/usePositioner-0Kb-C4al.js +0 -1
  259. package/dist/client/assets/useRenderElement-D0HVF5g_.js +0 -1
  260. package/dist/client/assets/useRouter-CcIDS3PN.js +0 -1
  261. package/dist/client/assets/useScrollLock-AUqaSAkf.js +0 -1
  262. package/dist/client/assets/useSwipeDismiss-CcW-GPO_.js +0 -1
  263. package/dist/client/assets/useTriggerFocusGuards-ChBvppef.js +0 -1
  264. package/dist/client/assets/useValueChanged-CThCTn4h.js +0 -1
  265. package/dist/client/assets/user-round-evbX_eto.js +0 -1
  266. package/dist/client/assets/utils-5-6TOrS1.js +0 -1
  267. package/dist/client/assets/visuallyHidden-BRaogTVF.js +0 -1
  268. package/dist/client/assets/wrench-mA--bcId.js +0 -1
  269. package/dist/client/assets/x-_SjFRYll.js +0 -1
@@ -0,0 +1 @@
1
+ import{i as e,t}from"./react-SIfiwpqq.js";import{Kt as n,n as r}from"./primary-D_D7eLwT.js";import{$r as i,T as a,b as o}from"./src-BSuAGqhK.js";import{$i as s,Ea as c,Ki as l,Nr as u,Or as d,Wi as f,Xi as p,_l as m,al as ee,ar as te,b as h,bl as g,gl as ne,hl as re,kr as ie,p as _,u as v,y,zr as ae}from"./runtime-Djy96GJd.js";import{t as oe}from"./switch-DD1qVLgN.js";import{t as b}from"./compiler-runtime-qmuS0Svy.js";import{a as x,c as se,n as ce,o as S,s as C}from"./badge-Dg7mXiOh.js";import{r as le,y as w}from"./RootAppShell-BdQCs2XJ.js";import{t as ue}from"./sparkles-isHutYWU.js";import{t as de}from"./refresh-cw-DY3_Ph-S.js";import{t as T}from"./toastHelpers-CSQRKo4F.js";import{i as E,n as fe,r as D}from"./settingsLayout-C6SUmJVB.js";import{t as O}from"./ProviderModelPicker-dwWhl7Uf.js";var pe=[`Thread titles`,`Project or repository names`,`Branch names`,`Bucketed creation and activity age`,`Running, approval, input, queue, failure, and delivery state`,`Pull request or linked issue title and state`,`Up to 600 characters from the latest user request`],k=[{value:0,label:`Manual only`},{value:3e5,label:`Every 5 minutes`},{value:6e5,label:`Every 10 minutes`},{value:18e5,label:`Every 30 minutes`},{value:36e5,label:`Every hour`},{value:216e5,label:`Every 6 hours`},{value:864e5,label:`Every 24 hours`}];function A(e){return{...e.enabled===void 0?{}:{aiFocusEnabled:e.enabled},...e.refreshIntervalMs===void 0?{}:{aiFocusRefreshIntervalMs:e.refreshIntervalMs}}}function me(e){return e.map(e=>{let t=e.serverConfig,n=t?.environment.capabilities.threadPriorityRanking===!0,r=t?.settings.inboxPriorityModelSelection??null,i=t?r??t.settings.textGenerationModelSelection:null,a=i===null?null:t?.providers.find(e=>e.instanceId===i.instanceId)??null;return{...e,supported:n,inherited:r===null,effectiveModelSelection:i,effectiveProvider:a}})}function j(e,t){let n=e.find(e=>e.instanceId===t);return!!(n&&n.enabled&&n.installed&&n.availability!==`unavailable`&&n.status!==`disabled`&&n.status!==`error`)}function M(e){if(e.selection!==null&&!j(e.serverConfig.providers,e.selection.instanceId))throw Error(`That provider instance is not available on this environment.`);return{inboxPriorityModelSelection:e.selection}}var N=b(),P=e(t(),1),F=m();function he(e){return e instanceof Error?e.message:`An unexpected error occurred.`}function ge(e){let t=(0,N.c)(12),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,F.jsx)(w,{className:`size-3.5`}),t[0]=n):n=t[0];let r;t[1]===e.value?r=t[2]:(r=e.value?.toString()??`off`,t[1]=e.value,t[2]=r);let i;t[3]===e?i=t[4]:(i=t=>{let n=t===`off`?null:Number(t);(n===null||a.includes(n))&&e.onChange(n)},t[3]=e,t[4]=i);let o=e.value===null?`Off`:`After ${e.value} ${e.value===1?`day`:`days`}`,s;t[5]===o?s=t[6]:(s=(0,F.jsx)(C,{className:`w-48`,"aria-label":`Auto-settle inactive tasks`,children:(0,F.jsx)(se,{children:o})}),t[5]=o,t[6]=s);let c;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,F.jsxs)(S,{align:`end`,alignItemWithTrigger:!1,children:[(0,F.jsx)(x,{hideIndicator:!0,value:`off`,children:`Off`}),a.map(I)]}),t[7]=c):c=t[7];let l;return t[8]!==r||t[9]!==i||t[10]!==s?(l=(0,F.jsx)(E,{owner:`client`,title:`Housekeeping`,icon:n,children:(0,F.jsx)(D,{title:`Auto-settle inactive tasks`,description:`Move inactive tasks to Settled after their last message or turn. Running work, queued messages, pending input, open pull requests, and tasks kept active are protected.`,control:(0,F.jsxs)(ce,{value:r,onValueChange:i,children:[s,c]})})}),t[8]=r,t[9]=i,t[10]=s,t[11]=l):l=t[11],l}function I(e){return(0,F.jsxs)(x,{hideIndicator:!0,value:String(e),children:[`After `,e,` `,e===1?`day`:`days`]},e)}function _e(){let e=(0,N.c)(2),[t,n]=(0,P.useState)(L),r,i;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>y(()=>{n(v())}),i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),(0,P.useEffect)(r,i),t}function L(){return v()}function R({row:e}){let[t,n]=(0,P.useState)(!1),r=e.serverConfig;if(!r||!e.effectiveModelSelection)return null;let i={...r.settings,...o},a=e.effectiveModelSelection,c=s(p(r.providers)),d=f(i,r.providers,a.instanceId,a.model),m=async t=>{n(!0);try{let n=M({serverConfig:r,selection:t});await h(e.environmentId,n)}catch(t){u.add(T({type:`error`,title:`Could not update ${e.label}`,description:he(t)}))}finally{n(!1)}};return(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:[(0,F.jsx)(O,{activeInstanceId:a.instanceId,model:a.model,lockedProvider:null,instanceEntries:c,modelOptionsByInstance:d,compact:!0,disabled:t||!e.connected,...e.connected?{}:{disabledReason:`Connect this environment to change its model.`},onInstanceModelChange:(e,t)=>{m(l({...i,textGenerationModelSelection:g(e,t)},r.providers))}}),e.inherited?null:(0,F.jsx)(ae,{size:`xs`,variant:`ghost`,disabled:t||!e.connected,onClick:()=>void m(null),children:`Use text model`})]})}function z(e){let t=(0,N.c)(6),{row:n}=e,r=n.effectiveProvider?.displayName??n.effectiveProvider?.driver??null,i=n.connected?n.supported?n.inherited?`Inherits the text-generation model${r?` (${r})`:``}.`:`Uses a separate model for Inbox ranking.`:`This node version does not support AI Focus ranking. Other supported nodes still work.`:`Offline — ranking waits for an existing connection.`,a;t[0]===n?a=t[1]:(a=n.supported?(0,F.jsx)(R,{row:n}):void 0,t[0]=n,t[1]=a);let o;return t[2]!==n.label||t[3]!==i||t[4]!==a?(o=(0,F.jsx)(D,{title:n.label,description:i,control:a}),t[2]=n.label,t[3]=i,t[4]=a,t[5]=o):o=t[5],o}function B(){let e=(0,N.c)(59),t=re(),n=ne(),a=d(),{updateSettings:o}=ie(),s=ee(),l;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=r(),e[0]=l):l=e[0];let f=l,p=te(Se),m=_e(),[h,g]=(0,P.useState)(!1);f?.environmentId,f?.label;let _;bb0:{if(t===`node`&&n){let t=n.connected&&n.canManage!==!1,r;e[1]!==t||e[2]!==n.environmentId||e[3]!==n.nodeLabel||e[4]!==n.serverConfig?(r=me([{environmentId:n.environmentId,label:n.nodeLabel,connected:t,serverConfig:n.serverConfig}]),e[1]=t,e[2]=n.environmentId,e[3]=n.nodeLabel,e[4]=n.serverConfig,e[5]=r):r=e[5],_=r;break bb0}let r;if(e[6]!==m||e[7]!==s||e[8]!==p){let t=new Map;f?.environmentId&&t.set(f.environmentId,{label:f.label,config:s});for(let e of m){if(t.has(e.environmentId))continue;let n=p[e.environmentId];t.set(e.environmentId,{label:n?.descriptor?.label??e.knownEnvironment.label,config:n?.serverConfig??null})}for(let[e,n]of Object.entries(p)){let r=i.make(e);t.has(r)||t.set(r,{label:n.descriptor?.label??`Saved environment`,config:n.serverConfig})}r=me([...t].map(xe)),e[6]=m,e[7]=s,e[8]=p,e[9]=r}else r=e[9];_=r}let v=_,y;e[10]===v?y=e[11]:(y=async()=>{g(!0);let e=await le(),t=e.failures;t.length>0?u.add(T({type:`error`,title:`AI Focus refresh failed`,description:t.map(e=>{let{environmentId:t,error:n}=e;return`${v.find(e=>e.environmentId===t)?.label??`Environment`}: ${he(n)}`}).join(` · `)})):u.add(T({type:`success`,title:e.attempted.length>0?`AI Focus refreshed`:`No connected supported nodes`,description:e.attempted.length>0?`Updated ${e.succeeded.length} environment${e.succeeded.length===1?``:`s`}.`:`Connect a supported node to rank its Inbox.`})),g(!1)},e[10]=v,e[11]=y);let b=y,x;e[12]===o?x=e[13]:(x=e=>o({sidebarAutoSettleAfterDays:e}),e[12]=o,e[13]=x);let w;e[14]!==a.sidebarAutoSettleAfterDays||e[15]!==x?(w=(0,F.jsx)(ge,{value:a.sidebarAutoSettleAfterDays,onChange:x}),e[14]=a.sidebarAutoSettleAfterDays,e[15]=x,e[16]=w):w=e[16];let O;e[17]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,F.jsx)(ue,{className:`size-3.5`}),e[17]=O):O=e[17];let j;e[18]===o?j=e[19]:(j=e=>o(A({enabled:e})),e[18]=o,e[19]=j);let M;e[20]!==a.aiFocusEnabled||e[21]!==j?(M=(0,F.jsx)(D,{title:`Prioritize the Inbox`,description:`Create a Focus section from pinned, actionable, and model-ranked threads. Focused threads are removed from Active, never duplicated.`,control:(0,F.jsx)(oe,{"aria-label":`Enable AI Focus`,checked:a.aiFocusEnabled,onCheckedChange:j})}),e[20]=a.aiFocusEnabled,e[21]=j,e[22]=M):M=e[22];let I=String(a.aiFocusRefreshIntervalMs),L;e[23]===o?L=e[24]:(L=e=>{let t=Number(e);o(A({refreshIntervalMs:t}))},e[23]=o,e[24]=L);let R;e[25]===a.aiFocusRefreshIntervalMs?R=e[26]:(R=k.find(e=>e.value===a.aiFocusRefreshIntervalMs)?.label??`Every 10 minutes`,e[25]=a.aiFocusRefreshIntervalMs,e[26]=R);let z;e[27]===R?z=e[28]:(z=(0,F.jsx)(C,{className:`w-48`,"aria-label":`AI Focus refresh interval`,children:(0,F.jsx)(se,{children:R})}),e[27]=R,e[28]=z);let B;e[29]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,F.jsx)(S,{align:`end`,alignItemWithTrigger:!1,children:k.map(be)}),e[29]=B):B=e[29];let V;e[30]!==z||e[31]!==I||e[32]!==L?(V=(0,F.jsxs)(ce,{value:I,onValueChange:L,children:[z,B]}),e[30]=z,e[31]=I,e[32]=L,e[33]=V):V=e[33];let H;e[34]===b?H=e[35]:(H=()=>void b(),e[34]=b,e[35]=H);let U=h?`size-4 animate-spin`:`size-4`,W;e[36]===U?W=e[37]:(W=(0,F.jsx)(de,{className:U}),e[36]=U,e[37]=W);let G;e[38]!==h||e[39]!==H||e[40]!==W?(G=(0,F.jsx)(ae,{size:`icon-sm`,variant:`outline`,"aria-label":`Refresh AI Focus now`,disabled:h,onClick:H,children:W}),e[38]=h,e[39]=H,e[40]=W,e[41]=G):G=e[41];let K;e[42]!==V||e[43]!==G?(K=(0,F.jsx)(D,{title:`Refresh rankings`,description:`Automatic checks use only nodes that are already connected. Manual-only never starts a connection.`,control:(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[V,G]})}),e[42]=V,e[43]=G,e[44]=K):K=e[44];let q;e[45]!==K||e[46]!==M?(q=(0,F.jsxs)(E,{owner:`client`,title:`AI Focus`,icon:O,children:[M,K]}),e[45]=K,e[46]=M,e[47]=q):q=e[47];let J;e[48]===v?J=e[49]:(J=v.length>0?v.map(ye):(0,F.jsx)(D,{title:`No environments available`,description:`Connect a node to configure its Inbox ranking model.`}),e[48]=v,e[49]=J);let Y;e[50]===J?Y=e[51]:(Y=(0,F.jsx)(E,{owner:`node`,title:`Models`,children:J}),e[50]=J,e[51]=Y);let X;e[52]===Symbol.for(`react.memo_cache_sentinel`)?(X=(0,F.jsx)(c,{className:`size-3.5`}),e[52]=X):X=e[52];let Z;e[53]===Symbol.for(`react.memo_cache_sentinel`)?(Z=(0,F.jsx)(`p`,{className:`mb-3 text-xs text-muted-foreground`,children:`Ranking sends only this bounded metadata from each environment. It does not send full chat history, file contents, or message responses.`}),e[53]=Z):Z=e[53];let Q;e[54]===Symbol.for(`react.memo_cache_sentinel`)?(Q=(0,F.jsx)(E,{owner:`node`,title:`Data sent to the selected model`,icon:X,children:(0,F.jsxs)(`div`,{className:`px-5 py-4`,children:[Z,(0,F.jsx)(`ul`,{className:`grid gap-1.5 text-xs text-foreground/80 sm:grid-cols-2`,children:pe.map(ve)})]})}),e[54]=Q):Q=e[54];let $;return e[55]!==q||e[56]!==Y||e[57]!==w?($=(0,F.jsxs)(fe,{children:[w,q,Y,Q]}),e[55]=q,e[56]=Y,e[57]=w,e[58]=$):$=e[58],$}function ve(e){return(0,F.jsxs)(`li`,{className:`flex gap-2`,children:[(0,F.jsx)(`span`,{"aria-hidden":!0,className:`text-muted-foreground`,children:`•`}),(0,F.jsx)(`span`,{children:e})]},e)}function ye(e){return(0,F.jsx)(z,{row:e},e.environmentId)}function be(e){return(0,F.jsx)(x,{hideIndicator:!0,value:String(e.value),children:e.label},e.value)}function xe(e){let[t,r]=e;return{environmentId:t,label:r.label,connected:_(t)!==null&&n(t).phase===`connected`,serverConfig:r.config}}function Se(e){return e.byId}export{B as AiFocusSettings};
@@ -1 +1 @@
1
- import{i as e,t}from"./react-SIfiwpqq.js";import{ia as n}from"./runtime-L56puJDA.js";import{t as r}from"./compiler-runtime-qmuS0Svy.js";var i=r(),a=e(t(),1),o=n(),s=250;function c(e){let t=(0,i.c)(17),{children:n}=e,r=(0,a.useRef)(null),c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c={height:null,isClipping:!1},t[0]=c):c=t[0];let[d,f]=(0,a.useState)(c),p;t[1]===d.isClipping?p=t[2]:(p=()=>{if(!d.isClipping)return;let e=window.setTimeout(()=>{f(u)},s);return()=>window.clearTimeout(e)},t[1]=d.isClipping,t[2]=p);let m;t[3]!==d.height||t[4]!==d.isClipping?(m=[d.height,d.isClipping],t[3]=d.height,t[4]=d.isClipping,t[5]=m):m=t[5],(0,a.useEffect)(p,m);let h,g;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(h=()=>{let e=r.current;if(!e)return;let t=null,n=null,i=()=>{let t=Math.ceil(e.scrollHeight||e.getBoundingClientRect().height);f(e=>e.height===t?e:{height:t,isClipping:e.height!==null})},a=()=>{t!==null&&(window.cancelAnimationFrame(t),t=null),n!==null&&(window.cancelAnimationFrame(n),n=null)},o=()=>{a(),i(),t=window.requestAnimationFrame(()=>{t=null,i(),n=window.requestAnimationFrame(()=>{n=null,i()})})};o();let s=new ResizeObserver(o);return s.observe(e),()=>{s.disconnect(),a()}},g=[],t[6]=h,t[7]=g):(h=t[6],g=t[7]),(0,a.useLayoutEffect)(h,g);let _;t[8]!==d.height||t[9]!==d.isClipping?(_=d.height===null?void 0:{height:d.height,overflow:d.isClipping?`hidden`:`visible`},t[8]=d.height,t[9]=d.isClipping,t[10]=_):_=t[10];let v;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(v=e=>{e.target===e.currentTarget&&e.propertyName===`height`&&f(l)},t[11]=v):v=t[11];let y;t[12]===n?y=t[13]:(y=(0,o.jsx)(`div`,{ref:r,children:n}),t[12]=n,t[13]=y);let b;return t[14]!==_||t[15]!==y?(b=(0,o.jsx)(`div`,{"data-slot":`animated-height`,className:`transition-[height] duration-200 ease-out motion-reduce:transition-none`,style:_,onTransitionEnd:v,children:y}),t[14]=_,t[15]=y,t[16]=b):b=t[16],b}function l(e){return e.isClipping?{...e,isClipping:!1}:e}function u(e){return e.isClipping?{...e,isClipping:!1}:e}export{c as t};
1
+ import{i as e,t}from"./react-SIfiwpqq.js";import{_l as n}from"./runtime-Djy96GJd.js";import{t as r}from"./compiler-runtime-qmuS0Svy.js";var i=r(),a=e(t(),1),o=n(),s=250;function c(e){let t=(0,i.c)(17),{children:n}=e,r=(0,a.useRef)(null),c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c={height:null,isClipping:!1},t[0]=c):c=t[0];let[d,f]=(0,a.useState)(c),p;t[1]===d.isClipping?p=t[2]:(p=()=>{if(!d.isClipping)return;let e=window.setTimeout(()=>{f(u)},s);return()=>window.clearTimeout(e)},t[1]=d.isClipping,t[2]=p);let m;t[3]!==d.height||t[4]!==d.isClipping?(m=[d.height,d.isClipping],t[3]=d.height,t[4]=d.isClipping,t[5]=m):m=t[5],(0,a.useEffect)(p,m);let h,g;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(h=()=>{let e=r.current;if(!e)return;let t=null,n=null,i=()=>{let t=Math.ceil(e.scrollHeight||e.getBoundingClientRect().height);f(e=>e.height===t?e:{height:t,isClipping:e.height!==null})},a=()=>{t!==null&&(window.cancelAnimationFrame(t),t=null),n!==null&&(window.cancelAnimationFrame(n),n=null)},o=()=>{a(),i(),t=window.requestAnimationFrame(()=>{t=null,i(),n=window.requestAnimationFrame(()=>{n=null,i()})})};o();let s=new ResizeObserver(o);return s.observe(e),()=>{s.disconnect(),a()}},g=[],t[6]=h,t[7]=g):(h=t[6],g=t[7]),(0,a.useLayoutEffect)(h,g);let _;t[8]!==d.height||t[9]!==d.isClipping?(_=d.height===null?void 0:{height:d.height,overflow:d.isClipping?`hidden`:`visible`},t[8]=d.height,t[9]=d.isClipping,t[10]=_):_=t[10];let v;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(v=e=>{e.target===e.currentTarget&&e.propertyName===`height`&&f(l)},t[11]=v):v=t[11];let y;t[12]===n?y=t[13]:(y=(0,o.jsx)(`div`,{ref:r,children:n}),t[12]=n,t[13]=y);let b;return t[14]!==_||t[15]!==y?(b=(0,o.jsx)(`div`,{"data-slot":`animated-height`,className:`transition-[height] duration-200 ease-out motion-reduce:transition-none`,style:_,onTransitionEnd:v,children:y}),t[14]=_,t[15]=y,t[16]=b):b=t[16],b}function l(e){return e.isClipping?{...e,isClipping:!1}:e}function u(e){return e.isClipping?{...e,isClipping:!1}:e}export{c as t};
@@ -0,0 +1 @@
1
+ import{i as e,t}from"./react-SIfiwpqq.js";import{Ca as n,Da as r,Ma as i,Na as a,Nr as o,Vr as s,_l as c,zr as l}from"./runtime-Djy96GJd.js";import{A as u,Dt as d,F as f,I as p,M as m,N as h,P as g,Yn as _,dt as v,ht as y,j as b,lt as x,st as S,t as C,ut as w,vt as T,yt as E}from"./switch-DD1qVLgN.js";import{t as D}from"./compiler-runtime-qmuS0Svy.js";import{t as O}from"./badge-Dg7mXiOh.js";import{K as k,X as A}from"./ContextHandoffEndpointLabel-BildLLDY.js";import{t as j}from"./clipboard-copy-ezz8rnaT.js";import{t as ee}from"./download-BA9L9tK9.js";import{t as te}from"./palette-D18VboLH.js";import{t as M}from"./input-DrOL1KPS.js";import{_ as N,a as P,b as F,f as ne,i as re,l as I,m as L,o as ie,p as ae,u as oe,y as se}from"./appearancePreferences-nFx4MHoI.js";import{C as ce,S as le,_ as R,a as ue,b as de,c as fe,d as pe,f as me,g as z,h as he,i as ge,l as _e,m as B,o as ve,p as ye,r as V,s as H,t as U,u as be,v as xe,x as W,y as Se}from"./useTheme-CVNauCtz.js";import{n as Ce,r as we,t as Te}from"./toggle-group-UeFeTI3u.js";import{i as G,n as K,r as q,t as J}from"./settingsLayout-C6SUmJVB.js";import{It as Ee}from"./main-BbtLAX7M.js";var Y={name:`baseline`,size:24,node:[[`path`,{d:`M4 20h16`,key:`14thso`}],[`path`,{d:`m6 16 6-12 6 12`,key:`1b4byz`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}]]};Y.node;var X=a(Y),De={name:`code-xml`,size:24,node:[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]],aliases:[`code-2`]};De.node;var Oe=a(De),ke={name:`gauge`,size:24,node:[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]};ke.node;var Ae=a(ke),je={name:`radius`,size:24,node:[[`path`,{d:`M20.34 17.52a10 10 0 1 0-2.82 2.82`,key:`fydyku`}],[`circle`,{cx:`19`,cy:`19`,r:`2`,key:`17f5cg`}],[`path`,{d:`m13.41 13.41 4.18 4.18`,key:`1gqbwc`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]};je.node;var Me=a(je),Ne={name:`type`,size:24,node:[[`path`,{d:`M12 4v16`,key:`1654pz`}],[`path`,{d:`M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2`,key:`e0r10z`}],[`path`,{d:`M9 20h6`,key:`s66wpe`}]]};Ne.node;var Pe=a(Ne),Fe={name:`upload`,size:24,node:[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]};Fe.node;var Ie=a(Fe),Z=e(t(),1),Q=D(),Le=`.rycotheme.json`,Re=/[^a-z0-9-_]+/gi;function ze(e){let t=(e.name||e.id).trim().replace(Re,`-`).replace(/^-+|-+$/g,``);return`${t.length>0?t:e.id||`theme`}${Le}`}function Be(e){let t={id:e.id,name:e.name};return e.description&&(t.description=e.description),e.light&&(t.light={...e.light}),e.dark&&(t.dark={...e.dark}),JSON.stringify(t,null,2)}function Ve(e){let t;try{t=JSON.parse(e)}catch(e){throw Error(`Could not parse theme JSON: ${e instanceof Error?e.message:`invalid JSON`}`,{cause:e})}if(!ye(t))throw Error(`Theme JSON does not match the schema (need string id/name and string-only light/dark tokens).`);let n={id:t.id,name:t.name,builtIn:!1};return t.description&&(n.description=t.description),t.light&&(n.light={...t.light}),t.dark&&(n.dark={...t.dark}),n}function He(e,t=`rename`){let n=Ve(e);if(!be().find(e=>e.id===n.id))return ge(n),{theme:n,action:`added`};if(pe(n.id)||t===`rename`){let e={...n,id:_e(n.id)};return ge(e),{theme:e,action:`renamed`}}return de(n.id,n),{theme:n,action:`replaced`}}typeof TextEncoder>`u`||new TextEncoder,typeof TextDecoder>`u`||new TextDecoder;async function Ue(e){let t=Be(e);if(typeof navigator>`u`||!navigator.clipboard)throw Error(`Clipboard API not available in this environment.`);await navigator.clipboard.writeText(t)}function We(e){if(typeof document>`u`||typeof URL>`u`||typeof Blob>`u`)throw Error(`Download not supported in this environment.`);let t=new Blob([Be(e)],{type:`application/json`}),n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=ze(e),r.rel=`noopener`,document.body.append(r),r.click(),r.remove(),URL.revokeObjectURL(n)}async function Ge(e,t={}){let n=He(await e.text(),t.collision??`rename`);return t.activate&&(Se(n.theme.id),ue(n.theme)),n}var $=c();function Ke(e,t,n){return e<t?t:e>n?n:e}function qe(e){let t=e.trim().replace(/^#/,``),n;if(t.length===3)n=t.split(``).map(e=>`${e}${e}`).join(``);else if(t.length===6)n=t;else return null;return/^[0-9a-fA-F]{6}$/.test(n)?{r:Number.parseInt(n.slice(0,2),16),g:Number.parseInt(n.slice(2,4),16),b:Number.parseInt(n.slice(4,6),16)}:null}function Je({r:e,g:t,b:n}){let r=e=>Ke(Math.round(e),0,255).toString(16).padStart(2,`0`);return`#${r(e)}${r(t)}${r(n)}`}function Ye({r:e,g:t,b:n}){let r=e/255,i=t/255,a=n/255,o=Math.max(r,i,a),s=o-Math.min(r,i,a),c=0;s!==0&&(c=o===r?60*((i-a)/s%6):o===i?60*((a-r)/s+2):60*((r-i)/s+4)),c<0&&(c+=360);let l=o===0?0:s/o;return{h:c,s:l,v:o}}function Xe({h:e,s:t,v:n}){let r=n*t,i=(e%360+360)%360/60,a=r*(1-Math.abs(i%2-1)),o=0,s=0,c=0;i<1?[o,s,c]=[r,a,0]:i<2?[o,s,c]=[a,r,0]:i<3?[o,s,c]=[0,r,a]:i<4?[o,s,c]=[0,a,r]:i<5?[o,s,c]=[a,0,r]:[o,s,c]=[r,0,a];let l=n-r;return{r:(o+l)*255,g:(s+l)*255,b:(c+l)*255}}function Ze(e){let t=(0,Q.c)(71),{value:n,onChange:r,children:i,side:a,align:o,ariaLabel:c,triggerClassName:l}=e,u=a===void 0?`bottom`:a,d=o===void 0?`start`:o,f;t[0]===n?f=t[1]:(f=()=>{let e=qe(n);return e?Ye(e):{h:0,s:0,v:0}},t[0]=n,t[1]=f);let[p,m]=(0,Z.useState)(f),[h,g]=(0,Z.useState)(n),[_,y]=(0,Z.useState)(!1),b=(0,Z.useRef)(null),S=(0,Z.useRef)(null),C=(0,Z.useRef)(r),T=(0,Z.useRef)(p.h),E;t[2]===r?E=t[3]:(E=()=>{C.current=r},t[2]=r,t[3]=E),(0,Z.useEffect)(E);let D,O;t[4]===p.h?(D=t[5],O=t[6]):(D=()=>{T.current=p.h},O=[p.h],t[4]=p.h,t[5]=D,t[6]=O),(0,Z.useEffect)(D,O);let k;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(k=()=>{if(b.current=null,S.current===null)return;let e=S.current;S.current=null,C.current(e)},t[7]=k):k=t[7];let A=k,j;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(j=e=>{S.current=e,b.current===null&&(b.current=requestAnimationFrame(A))},t[8]=j):j=t[8];let ee=j,te,N;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(N=()=>()=>{if(b.current!==null&&(cancelAnimationFrame(b.current),b.current=null),S.current!==null){let e=S.current;S.current=null,C.current(e)}},te=[],t[9]=te,t[10]=N):(te=t[9],N=t[10]),(0,Z.useEffect)(N,te);let P;t[11]===p?P=t[12]:(P=Je(Xe(p)),t[11]=p,t[12]=P);let F=P,ne,re;t[13]!==F||t[14]!==n?(ne=()=>{if(n.toLowerCase()===F.toLowerCase())return;let e=qe(n);if(!e)return;let t=Ye(e);m(e=>({h:t.s===0?e.h:t.h,s:t.s,v:t.v})),g(n)},re=[n,F],t[13]=F,t[14]=n,t[15]=ne,t[16]=re):(ne=t[15],re=t[16]),(0,Z.useEffect)(ne,re);let I=(0,Z.useRef)(null),L;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(L=e=>{let t=I.current;if(!t)return;let n=t.getBoundingClientRect(),r=Ke(e.clientX-n.left,0,n.width),i=Ke(e.clientY-n.top,0,n.height),a=n.width===0?0:r/n.width,o=n.height===0?0:1-i/n.height;m(e=>{let t={h:e.h,s:a,v:o},n=Je(Xe(t));return g(n),S.current=n,b.current===null&&(b.current=requestAnimationFrame(A)),t})},t[17]=L):L=t[17];let ie=L,ae;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(ae=e=>{e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),ie(e)},t[18]=ae):ae=t[18];let oe=ae,se;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(se=e=>{e.currentTarget.hasPointerCapture(e.pointerId)&&ie(e)},t[19]=se):se=t[19];let ce=se,le=(0,Z.useRef)(null),R;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(R=e=>{let t=le.current;if(!t)return;let n=t.getBoundingClientRect(),r=Ke(e.clientX-n.left,0,n.width),i=n.width===0?0:r/n.width*360;m(e=>{let t={h:i,s:e.s,v:e.v},n=Je(Xe(t));return g(n),S.current=n,b.current===null&&(b.current=requestAnimationFrame(A)),t})},t[20]=R):R=t[20];let ue=R,de;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(de=e=>{e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),ue(e)},t[21]=de):de=t[21];let fe=de,pe;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(pe=e=>{e.currentTarget.hasPointerCapture(e.pointerId)&&ue(e)},t[22]=pe):pe=t[22];let me=pe,z;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(z=e=>{g(e);let t=qe(e.startsWith(`#`)?e:`#${e}`);if(!t)return;let n=Ye(t),r={h:n.s===0?T.current:n.h,s:n.s,v:n.v};m(r),ee(Je(t))},t[23]=z):z=t[23];let he=z,ge=`${p.h/360*100}%`,_e=`${p.s*100}%`,B=`${(1-p.v)*100}%`,ve=`hsl(${p.h} 100% 50%)`,ye;t[24]===l?ye=t[25]:(ye=s(`relative size-5 shrink-0 cursor-pointer overflow-hidden rounded-sm border border-border/80 outline-none transition-shadow focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background`,l),t[24]=l,t[25]=ye);let V;t[26]!==c||t[27]!==i||t[28]!==ye?(V=(0,$.jsx)(v,{"aria-label":c,className:ye,children:i}),t[26]=c,t[27]=i,t[28]=ye,t[29]=V):V=t[29];let H;t[30]===p.s?H=t[31]:(H=Math.round(p.s*100),t[30]=p.s,t[31]=H);let U;t[32]===ve?U=t[33]:(U={backgroundColor:ve},t[32]=ve,t[33]=U);let be;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(be=(0,$.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute inset-0`,style:{background:`linear-gradient(to right, rgba(255,255,255,1), rgba(255,255,255,0))`}}),t[34]=be):be=t[34];let xe;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(xe=(0,$.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute inset-0`,style:{background:`linear-gradient(to top, rgba(0,0,0,1), rgba(0,0,0,0))`}}),t[35]=xe):xe=t[35];let W;t[36]!==_e||t[37]!==B?(W=(0,$.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute size-3 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-white shadow-[0_0_0_1px_rgba(0,0,0,0.4)]`,style:{left:_e,top:B}}),t[36]=_e,t[37]=B,t[38]=W):W=t[38];let Se;t[39]!==H||t[40]!==U||t[41]!==W?(Se=(0,$.jsxs)(`div`,{ref:I,role:`slider`,"aria-label":`Saturation and value`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":H,tabIndex:0,className:`relative h-36 w-full cursor-crosshair touch-none select-none overflow-hidden rounded-md outline-none focus-visible:ring-2 focus-visible:ring-ring/40`,style:U,onPointerDown:oe,onPointerMove:ce,children:[be,xe,W]}),t[39]=H,t[40]=U,t[41]=W,t[42]=Se):Se=t[42];let Ce;t[43]===p.h?Ce=t[44]:(Ce=Math.round(p.h),t[43]=p.h,t[44]=Ce);let we;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(we={background:`linear-gradient(to right, hsl(0 100% 50%), hsl(60 100% 50%), hsl(120 100% 50%), hsl(180 100% 50%), hsl(240 100% 50%), hsl(300 100% 50%), hsl(360 100% 50%))`},t[45]=we):we=t[45];let Te;t[46]===ge?Te=t[47]:(Te=(0,$.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute top-1/2 size-3 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-white shadow-[0_0_0_1px_rgba(0,0,0,0.4)]`,style:{left:ge}}),t[46]=ge,t[47]=Te);let G;t[48]!==Ce||t[49]!==Te?(G=(0,$.jsx)(`div`,{ref:le,role:`slider`,"aria-label":`Hue`,"aria-valuemin":0,"aria-valuemax":360,"aria-valuenow":Ce,tabIndex:0,className:`relative h-3 w-full cursor-ew-resize touch-none select-none overflow-hidden rounded-full outline-none focus-visible:ring-2 focus-visible:ring-ring/40`,style:we,onPointerDown:fe,onPointerMove:me,children:Te}),t[48]=Ce,t[49]=Te,t[50]=G):G=t[50];let K;t[51]===F?K=t[52]:(K=(0,$.jsx)(`span`,{"aria-hidden":!0,className:`size-7 shrink-0 rounded-md border border-border/60`,style:{backgroundColor:F}}),t[51]=F,t[52]=K);let q;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(q=e=>he(e.currentTarget.value),t[53]=q):q=t[53];let J;t[54]===h?J=t[55]:(J=(0,$.jsx)(M,{value:h,size:`sm`,nativeInput:!0,onChange:q,spellCheck:!1,className:`font-mono text-xs`,"aria-label":`Hex value`}),t[54]=h,t[55]=J);let Ee;t[56]!==K||t[57]!==J?(Ee=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[K,J]}),t[56]=K,t[57]=J,t[58]=Ee):Ee=t[58];let Y;t[59]!==Se||t[60]!==G||t[61]!==Ee?(Y=(0,$.jsxs)(`div`,{className:`space-y-3`,children:[Se,G,Ee]}),t[59]=Se,t[60]=G,t[61]=Ee,t[62]=Y):Y=t[62];let X;t[63]!==d||t[64]!==u||t[65]!==Y?(X=(0,$.jsx)(w,{side:u,align:d,className:`w-64`,children:Y}),t[63]=d,t[64]=u,t[65]=Y,t[66]=X):X=t[66];let De;return t[67]!==_||t[68]!==V||t[69]!==X?(De=(0,$.jsxs)(x,{open:_,onOpenChange:y,children:[V,X]}),t[67]=_,t[68]=V,t[69]=X,t[70]=De):De=t[70],De}var Qe=[{value:`stacked`,label:`Unified`,description:`Removed and added lines together in one column.`},{value:`split`,label:`Split`,description:`Compare the original and updated code side by side.`}];function $e(e){let t=(0,Q.c)(16),{number:n,kind:r,children:i}=e,a;t[0]===r?a=t[1]:(a=r?{backgroundColor:`color-mix(in srgb, var(--background) 92%, var(--${r===`added`?`success`:`destructive`}))`}:void 0,t[0]=r,t[1]=a);let o;t[2]===n?o=t[3]:(o=(0,$.jsx)(`span`,{className:`w-7 shrink-0 select-none text-center text-muted-foreground/60`,children:n}),t[2]=n,t[3]=o);let s=r===`added`?`var(--success)`:`var(--destructive)`,c;t[4]===s?c=t[5]:(c={color:s},t[4]=s,t[5]=c);let l=r===`added`?`+`:r===`removed`?`−`:` `,u;t[6]!==c||t[7]!==l?(u=(0,$.jsx)(`span`,{className:`w-4 shrink-0`,style:c,children:l}),t[6]=c,t[7]=l,t[8]=u):u=t[8];let d;t[9]===i?d=t[10]:(d=(0,$.jsx)(`span`,{children:i}),t[9]=i,t[10]=d);let f;return t[11]!==a||t[12]!==o||t[13]!==u||t[14]!==d?(f=(0,$.jsxs)(`div`,{className:`flex whitespace-pre leading-6`,style:a,children:[o,u,d]}),t[11]=a,t[12]=o,t[13]=u,t[14]=d,t[15]=f):f=t[15],f}function et(e){let t=(0,Q.c)(10),{layout:n}=e,r,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(`span`,{children:`greeting.ts`}),i=(0,$.jsx)(`span`,{className:`text-success`,children:`+1`}),t[0]=r,t[1]=i):(r=t[0],i=t[1]);let a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsxs)(`div`,{className:`flex justify-between border-b border-border bg-muted/30 px-3 py-2`,children:[r,(0,$.jsxs)(`span`,{children:[i,` `,(0,$.jsx)(`span`,{className:`text-destructive`,children:`−1`})]})]}),t[2]=a):a=t[2];let o=n===`split`&&`grid grid-cols-2 divide-x divide-border`,c;t[3]===o?c=t[4]:(c=s(`min-h-32 py-3`,o),t[3]=o,t[4]=c);let l;t[5]===n?l=t[6]:(l=n===`split`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`overflow-hidden`,children:[(0,$.jsx)($e,{number:1,children:`// Greeting`}),(0,$.jsx)($e,{number:2,kind:`removed`,children:`hello("world");`}),(0,$.jsx)($e,{number:3,children:``})]}),(0,$.jsxs)(`div`,{className:`overflow-hidden`,children:[(0,$.jsx)($e,{number:1,children:`// Greeting`}),(0,$.jsx)($e,{number:2,kind:`added`,children:`hello("Ryco");`}),(0,$.jsx)($e,{number:3,children:``})]})]}):(0,$.jsxs)(`div`,{children:[(0,$.jsx)($e,{number:1,children:`// Greeting`}),(0,$.jsx)($e,{number:2,kind:`removed`,children:`hello("world");`}),(0,$.jsx)($e,{number:2,kind:`added`,children:`hello("Ryco");`}),(0,$.jsx)($e,{number:3,children:``})]}),t[5]=n,t[6]=l);let u;return t[7]!==c||t[8]!==l?(u=(0,$.jsxs)(`div`,{"aria-hidden":`true`,className:`overflow-hidden rounded-lg border border-border bg-background text-left font-mono text-[10px] text-foreground`,children:[a,(0,$.jsx)(`div`,{className:c,children:l})]}),t[7]=c,t[8]=l,t[9]=u):u=t[9],u}function tt(){let e=(0,Q.c)(6),[t,n]=we(),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(`p`,{className:`px-4 pt-4 text-xs text-muted-foreground`,children:`Choose how code changes appear in the diff viewer. You can also switch from its toolbar.`}),e[0]=r):r=e[0];let a;e[1]!==t||e[2]!==n?(a=Qe.map(e=>(0,$.jsxs)(`button`,{type:`button`,"aria-pressed":t===e.value,"aria-label":`${e.label} diff style`,onClick:()=>n(e.value),className:s(`min-w-0 rounded-xl border p-3 text-left transition-colors focus-visible:outline-2 focus-visible:outline-ring`,t===e.value?`border-primary bg-muted/40`:`border-border hover:bg-muted/20`),children:[(0,$.jsx)(et,{layout:e.value}),(0,$.jsxs)(`span`,{className:`mt-3 flex items-center justify-between text-sm font-medium`,children:[e.label,t===e.value&&(0,$.jsx)(i,{"aria-hidden":`true`,className:`size-4`})]}),(0,$.jsx)(`span`,{className:`mt-1 block text-xs text-muted-foreground`,children:e.description})]},e.value)),e[1]=t,e[2]=n,e[3]=a):a=e[3];let o;return e[4]===a?o=e[5]:(o=(0,$.jsxs)(G,{title:`Diff style`,children:[r,(0,$.jsx)(`div`,{role:`group`,"aria-label":`Diff style`,className:`grid gap-4 p-4 lg:grid-cols-2`,children:a})]}),e[4]=a,e[5]=o),o}function nt(e){let t=(0,Q.c)(22),{theme:n,variant:r,compact:i}=e,a=i!==void 0&&i,o;t[0]!==n||t[1]!==r?(o=Object.fromEntries(Object.entries(z(xe(n,r))).map(it)),t[0]=n,t[1]=r,t[2]=o):o=t[2];let s=o,c;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsxs)(`div`,{className:`flex w-[26%] flex-col gap-2 border-r border-[var(--sidebar-border)] bg-[var(--sidebar)] p-[4%]`,children:[(0,$.jsx)(`span`,{className:`font-semibold`,children:`Ryco`}),(0,$.jsx)(`span`,{className:`h-1.5 w-4/5 rounded bg-[var(--muted-foreground)] opacity-40`}),(0,$.jsx)(`span`,{className:`h-3 rounded bg-[var(--sidebar-accent)]`}),(0,$.jsx)(`span`,{className:`h-1.5 w-3/4 rounded bg-[var(--muted-foreground)] opacity-25`}),(0,$.jsx)(`span`,{className:`h-1.5 w-4/5 rounded bg-[var(--muted-foreground)] opacity-25`})]}),t[3]=c):c=t[3];let l;t[4]===a?l=t[5]:(l=a?(0,$.jsx)(`div`,{className:`h-3 w-2/3 shrink-0 self-end rounded bg-[var(--secondary)]`}):(0,$.jsx)(`div`,{className:`self-end rounded bg-[var(--secondary)] px-2 py-1`,children:`Build something great`}),t[4]=a,t[5]=l);let u;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,$.jsx)(`div`,{className:`h-1.5 w-4/5 rounded bg-[var(--muted-foreground)] opacity-40`}),t[6]=u):u=t[6];let d;t[7]===a?d=t[8]:(d=a?(0,$.jsx)(`div`,{className:`h-1.5 w-2/3 rounded bg-[var(--muted-foreground)] opacity-25`}):(0,$.jsxs)(`div`,{className:`rounded border border-[var(--border)] bg-[var(--card)] p-2 font-mono`,children:[(0,$.jsx)(`span`,{style:{color:`var(--info)`},children:`const `}),`theme =`,` `,(0,$.jsx)(`span`,{style:{color:`var(--success)`},children:`"ryco"`}),`;`,(0,$.jsx)(`br`,{}),(0,$.jsx)(`span`,{style:{color:`var(--muted-foreground)`},children:`// Make it yours`})]}),t[7]=a,t[8]=d);let f;t[9]===a?f=t[10]:(f=a?(0,$.jsx)(`span`,{className:`h-1 w-1/2 rounded bg-[var(--muted-foreground)] opacity-30`}):(0,$.jsx)(`span`,{style:{color:`var(--muted-foreground)`},children:`Ask anything…`}),t[9]=a,t[10]=f);let p;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(`span`,{className:`size-3 rounded-full bg-[var(--primary)]`}),t[11]=p):p=t[11];let m;t[12]===f?m=t[13]:(m=(0,$.jsxs)(`div`,{className:`mt-auto flex items-center justify-between rounded-md border border-[var(--input)] px-2 py-1.5`,children:[f,p]}),t[12]=f,t[13]=m);let h;t[14]!==l||t[15]!==d||t[16]!==m?(h=(0,$.jsxs)(`div`,{className:`flex aspect-[16/9] text-[9px] leading-relaxed`,children:[c,(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-2 p-[4%]`,children:[l,u,d,m]})]}),t[14]=l,t[15]=d,t[16]=m,t[17]=h):h=t[17];let g;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,$.jsx)(`div`,{className:`flex h-2`,children:[`sidebar`,`background`,`primary`,`info`,`success`,`warning`,`destructive`].map(rt)}),t[18]=g):g=t[18];let _;return t[19]!==s||t[20]!==h?(_=(0,$.jsxs)(`div`,{"aria-hidden":`true`,style:s,className:`w-full overflow-hidden rounded-lg border border-[var(--border)] bg-[var(--background)] text-[var(--foreground)]`,children:[h,g]}),t[19]=s,t[20]=h,t[21]=_):_=t[21],_}function rt(e){return(0,$.jsx)(`span`,{className:`flex-1`,style:{backgroundColor:`var(--${e})`}},e)}function it(e){let[t,n]=e;return[`--${t}`,n]}var at=[{title:`Surfaces`,tokens:[`background`,`app-chrome-background`,`foreground`,`card`,`card-foreground`,`popover`,`popover-foreground`]},{title:`Brand & focus`,tokens:[`primary`,`primary-foreground`,`ring`]},{title:`Neutrals`,tokens:[`secondary`,`secondary-foreground`,`muted`,`muted-foreground`,`accent`,`accent-foreground`]},{title:`Status`,tokens:[`destructive`,`destructive-foreground`,`info`,`info-foreground`,`success`,`success-foreground`,`warning`,`warning-foreground`]},{title:`Borders & inputs`,tokens:[`border`,`input`]},{title:`Scrollbars`,tokens:[`scrollbar-thumb`,`scrollbar-thumb-hover`,`scrollbar-thumb-thin`,`scrollbar-thumb-thin-hover`]}],ot=new Set(W),st=null,ct=null;function lt(e){if(typeof document>`u`||document.body===void 0||!e)return`#000000`;st||(st=document.createElement(`div`),st.style.position=`absolute`,st.style.visibility=`hidden`,st.style.pointerEvents=`none`,document.body.append(st)),st.style.color=``,st.style.color=e;let t=getComputedStyle(st).color;ct||=document.createElement(`canvas`),ct.width=1,ct.height=1;let n=ct.getContext(`2d`,{willReadFrequently:!0});if(!n)return`#000000`;n.clearRect(0,0,1,1);try{n.fillStyle=t}catch{return`#000000`}n.fillRect(0,0,1,1);let r=n.getImageData(0,0,1,1).data;return`#${[r[0],r[1],r[2]].map(e=>(e??0).toString(16).padStart(2,`0`)).join(``)}`}function ut(e,t,n,r){let i={...e[t]};return r.length===0?delete i[n]:i[n]=r,t===`light`?{...e,light:i}:{...e,dark:i}}function dt(e,t){return{...e,name:t}}function ft(e,t){let n={...e};return t.length===0?delete n.description:n.description=t,n}function pt(e){return V.includes(e)}function mt(e){let t=(0,Q.c)(124),{source:n,draft:r,onDraftChange:i,onSave:a,onCancel:o,resolvedVariant:s}=e,[c,d]=(0,Z.useState)(`form`),[_,v]=(0,Z.useState)(s),y;t[0]===r?y=t[1]:(y=()=>JSON.stringify(r,null,2),t[0]=r,t[1]=y);let[x,C]=(0,Z.useState)(y),[w,T]=(0,Z.useState)(null),[E,D]=(0,Z.useState)(!1),O;t[2]===n?O=t[3]:(O=JSON.stringify(n),t[2]=n,t[3]=O);let k;t[4]===r?k=t[5]:(k=JSON.stringify(r),t[4]=r,t[5]=k);let A=O!==k,j;t[6]===r?j=t[7]:(j=()=>{ue(r)},t[6]=r,t[7]=j);let ee;t[8]!==r||t[9]!==s?(ee=[r,s],t[8]=r,t[9]=s,t[10]=ee):ee=t[10],(0,Z.useEffect)(j,ee);let te,N;t[11]!==r||t[12]!==c?(te=()=>{c===`form`&&C(JSON.stringify(r,null,2))},N=[r,c],t[11]=r,t[12]=c,t[13]=te,t[14]=N):(te=t[13],N=t[14]),(0,Z.useEffect)(te,N);let P;t[15]!==r||t[16]!==i?(P=e=>{i(dt(r,e))},t[15]=r,t[16]=i,t[17]=P):P=t[17];let F=P,ne;t[18]!==r||t[19]!==i?(ne=e=>{i(ft(r,e))},t[18]=r,t[19]=i,t[20]=ne):ne=t[20];let re=ne,I;t[21]!==r||t[22]!==i||t[23]!==_?(I=(e,t)=>{i(ut(r,_,e,t))},t[21]=r,t[22]=i,t[23]=_,t[24]=I):I=t[24];let L=I,ie;t[25]===i?ie=t[26]:(ie=e=>{C(e);let t;try{t=JSON.parse(e)}catch(e){let t=e;T(t instanceof Error?t.message:`Invalid JSON`);return}if(!ye(t)){T(`Invalid theme schema. Need string id/name and string-only light/dark tokens.`);return}T(null),i(t)},t[25]=i,t[26]=ie);let ae=ie,oe;t[27]!==A||t[28]!==o?(oe=()=>{if(A){D(!0);return}o()},t[27]=A,t[28]=o,t[29]=oe):oe=t[29];let se=oe,R,de,fe;if(t[30]!==r.dark||t[31]!==r.light||t[32]!==_){fe=(_===`dark`?r.dark:r.light)??{};let e;t[36]===_?e=t[37]:(e=(_===`dark`?ce.dark:ce.light)??{},t[36]=_,t[37]=e),R=e,de=Object.entries(fe).filter(_t),t[30]=r.dark,t[31]=r.light,t[32]=_,t[33]=R,t[34]=de,t[35]=fe}else R=t[33],de=t[34],fe=t[35];let pe=de,me=ht,z=me(r.light)||me(r.dark),he;t[38]!==r.name||t[39]!==z||t[40]!==w?(he=w!==null||r.name.trim().length===0||z,t[38]=r.name,t[39]=z,t[40]=w,t[41]=he):he=t[41];let ge=he,_e;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(_e=(0,$.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:`Editing`}),t[42]=_e):_e=t[42];let B=r.name||`Untitled`,ve;t[43]!==r.name||t[44]!==B?(ve=(0,$.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground`,title:r.name,children:B}),t[43]=r.name,t[44]=B,t[45]=ve):ve=t[45];let V;t[46]===A?V=t[47]:(V=A?(0,$.jsx)(`span`,{className:`rounded-sm bg-warning/16 px-1.5 py-0.5 text-[10px] font-medium text-warning-foreground`,children:`Unsaved`}):null,t[46]=A,t[47]=V);let H;t[48]===se?H=t[49]:(H=(0,$.jsx)(l,{size:`sm`,variant:`outline`,onClick:se,children:`Cancel`}),t[48]=se,t[49]=H);let U;t[50]!==a||t[51]!==ge?(U=(0,$.jsx)(l,{size:`sm`,onClick:a,disabled:ge,children:`Save`}),t[50]=a,t[51]=ge,t[52]=U):U=t[52];let be;t[53]!==H||t[54]!==U?(be=(0,$.jsxs)(`div`,{className:`ms-auto flex items-center gap-2`,children:[H,U]}),t[53]=H,t[54]=U,t[55]=be):be=t[55];let xe;t[56]!==ve||t[57]!==V||t[58]!==be?(xe=(0,$.jsxs)(`div`,{className:`sticky top-0 z-10 flex flex-wrap items-center gap-2 border-b border-border/60 bg-muted/72 px-4 py-2 backdrop-blur-sm sm:px-5`,children:[_e,ve,V,be]}),t[56]=ve,t[57]=V,t[58]=be,t[59]=xe):xe=t[59];let W;t[60]===c?W=t[61]:(W=[c],t[60]=c,t[61]=W);let Se,we,G;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(Se=e=>{let t=e[0];(t===`form`||t===`json`)&&d(t)},we=(0,$.jsx)(Te,{value:`form`,"aria-label":`Form editor`,className:`px-3 sm:px-3`,children:`Form`}),G=(0,$.jsx)(Te,{value:`json`,"aria-label":`JSON editor`,className:`px-3 sm:px-3`,children:`JSON`}),t[62]=Se,t[63]=we,t[64]=G):(Se=t[62],we=t[63],G=t[64]);let K;t[65]===W?K=t[66]:(K=(0,$.jsxs)(Ce,{value:W,variant:`outline`,size:`sm`,onValueChange:Se,children:[we,G]}),t[65]=W,t[66]=K);let q;t[67]===_?q=t[68]:(q=[_],t[67]=_,t[68]=q);let J,Ee,Y;t[69]===Symbol.for(`react.memo_cache_sentinel`)?(J=e=>{let t=e[0];(t===`light`||t===`dark`)&&v(t)},Ee=(0,$.jsx)(Te,{value:`light`,"aria-label":`Light variant`,className:`px-3 sm:px-3`,children:`Light`}),Y=(0,$.jsx)(Te,{value:`dark`,"aria-label":`Dark variant`,className:`px-3 sm:px-3`,children:`Dark`}),t[69]=J,t[70]=Ee,t[71]=Y):(J=t[69],Ee=t[70],Y=t[71]);let X;t[72]===q?X=t[73]:(X=(0,$.jsxs)(Ce,{value:q,variant:`outline`,size:`sm`,onValueChange:J,children:[Ee,Y]}),t[72]=q,t[73]=X);let De;t[74]!==K||t[75]!==X?(De=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[K,X]}),t[74]=K,t[75]=X,t[76]=De):De=t[76];let Oe;t[77]===Symbol.for(`react.memo_cache_sentinel`)?(Oe=(0,$.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:`Name`}),t[77]=Oe):Oe=t[77];let ke;t[78]===F?ke=t[79]:(ke=e=>F(e.currentTarget.value),t[78]=F,t[79]=ke);let Ae;t[80]===r.name?Ae=t[81]:(Ae=r.name.trim().length===0||void 0,t[80]=r.name,t[81]=Ae);let je;t[82]!==r.name||t[83]!==ke||t[84]!==Ae?(je=(0,$.jsxs)(`label`,{className:`space-y-1.5`,children:[Oe,(0,$.jsx)(M,{value:r.name,nativeInput:!0,onChange:ke,"aria-invalid":Ae})]}),t[82]=r.name,t[83]=ke,t[84]=Ae,t[85]=je):je=t[85];let Me;t[86]===Symbol.for(`react.memo_cache_sentinel`)?(Me=(0,$.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:`Description`}),t[86]=Me):Me=t[86];let Ne=r.description??``,Pe;t[87]===re?Pe=t[88]:(Pe=e=>re(e.currentTarget.value),t[87]=re,t[88]=Pe);let Fe;t[89]!==Ne||t[90]!==Pe?(Fe=(0,$.jsxs)(`label`,{className:`space-y-1.5`,children:[Me,(0,$.jsx)(M,{value:Ne,nativeInput:!0,onChange:Pe,placeholder:`Optional, shown under the picker.`})]}),t[89]=Ne,t[90]=Pe,t[91]=Fe):Fe=t[91];let Ie;t[92]!==je||t[93]!==Fe?(Ie=(0,$.jsxs)(`div`,{className:`mt-4 grid gap-3 sm:grid-cols-[minmax(0,1fr)_minmax(0,1fr)]`,children:[je,Fe]}),t[92]=je,t[93]=Fe,t[94]=Ie):Ie=t[94];let Le;t[95]!==ae||t[96]!==L||t[97]!==R||t[98]!==w||t[99]!==x||t[100]!==c||t[101]!==pe||t[102]!==fe?(Le=c===`form`?(0,$.jsxs)(`div`,{className:`mt-5 space-y-5`,children:[at.map(e=>(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(`h4`,{className:`text-[11px] font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:e.title}),(0,$.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:e.tokens.map(e=>{let t=fe[e]??``,n=R[e]??``,r=le(e);return r?(0,$.jsx)(vt,{token:e,kind:r,value:t,inherited:n,onChange:t=>L(e,t)},e):null})})]},e.title)),pe.length>0?(0,$.jsxs)(`p`,{className:`text-xs text-warning-foreground`,children:[pe.length,` token`,pe.length===1?``:`s`,` not in the allow-list will be ignored on save.`]}):null]}):(0,$.jsxs)(`div`,{className:`mt-5 space-y-2`,children:[(0,$.jsx)(S,{value:x,size:`sm`,className:`font-mono text-xs`,spellCheck:!1,rows:18,onChange:e=>ae(e.currentTarget.value),"aria-invalid":w!==null||void 0}),w?(0,$.jsx)(`p`,{className:`text-xs text-destructive-foreground`,children:w}):(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground/80`,children:`Edit the JSON directly. Save is disabled while the schema is invalid.`})]}),t[95]=ae,t[96]=L,t[97]=R,t[98]=w,t[99]=x,t[100]=c,t[101]=pe,t[102]=fe,t[103]=Le):Le=t[103];let Re;t[104]!==De||t[105]!==Ie||t[106]!==Le?(Re=(0,$.jsxs)(`div`,{className:`px-4 py-4 sm:px-5`,children:[De,Ie,Le]}),t[104]=De,t[105]=Ie,t[106]=Le,t[107]=Re):Re=t[107];let ze;t[108]===Symbol.for(`react.memo_cache_sentinel`)?(ze=(0,$.jsx)(p,{children:`Discard your changes?`}),t[108]=ze):ze=t[108];let Be;t[109]===n.name?Be=t[110]:(Be=(0,$.jsxs)(g,{children:[ze,(0,$.jsxs)(m,{children:[`You have unsaved edits to `,n.name,`. Discarding will revert any token changes you made.`]})]}),t[109]=n.name,t[110]=Be);let Ve;t[111]===Symbol.for(`react.memo_cache_sentinel`)?(Ve=(0,$.jsx)(b,{render:(0,$.jsx)(l,{variant:`outline`}),children:`Keep editing`}),t[111]=Ve):Ve=t[111];let He;t[112]===o?He=t[113]:(He=(0,$.jsxs)(h,{children:[Ve,(0,$.jsx)(l,{variant:`destructive`,onClick:()=>{D(!1),o()},children:`Discard changes`})]}),t[112]=o,t[113]=He);let Ue;t[114]!==Be||t[115]!==He?(Ue=(0,$.jsxs)(f,{children:[Be,He]}),t[114]=Be,t[115]=He,t[116]=Ue):Ue=t[116];let We;t[117]!==E||t[118]!==Ue?(We=(0,$.jsx)(u,{open:E,onOpenChange:D,children:Ue}),t[117]=E,t[118]=Ue,t[119]=We):We=t[119];let Ge;return t[120]!==xe||t[121]!==Re||t[122]!==We?(Ge=(0,$.jsxs)(`div`,{className:`border-t border-border/60 bg-muted/24`,children:[xe,Re,We]}),t[120]=xe,t[121]=Re,t[122]=We,t[123]=Ge):Ge=t[123],Ge}function ht(e){return Object.entries(e??{}).some(gt)}function gt(e){let[t,n]=e;if(typeof n!=`string`||n.length===0)return!1;let r=le(t);return r?!B(r,n):!1}function _t(e){let[t]=e;return!ot.has(t)}function vt(e){let t=(0,Q.c)(12),{token:n,kind:r,value:i,inherited:a,onChange:o}=e,c=i.length>0,l=r===`font-family`&&`sm:col-span-2`,u;t[0]===l?u=t[1]:(u=s(`rounded-md border border-border/60 bg-background px-2 py-1.5`,l),t[0]=l,t[1]=u);let d;t[2]!==a||t[3]!==r||t[4]!==o||t[5]!==c||t[6]!==n||t[7]!==i?(d=r===`color`?(0,$.jsx)(xt,{token:n,value:i,inherited:a,overridden:c,onChange:o}):r===`opacity`?(0,$.jsx)(St,{token:n,value:i,inherited:a,overridden:c,onChange:o}):r===`length`?(0,$.jsx)(Ct,{token:n,value:i,inherited:a,overridden:c,onChange:o}):(0,$.jsx)(Tt,{token:n,value:i,inherited:a,overridden:c,onChange:o}),t[2]=a,t[3]=r,t[4]=o,t[5]=c,t[6]=n,t[7]=i,t[8]=d):d=t[8];let f;return t[9]!==u||t[10]!==d?(f=(0,$.jsx)(`div`,{className:u,children:d}),t[9]=u,t[10]=d,t[11]=f):f=t[11],f}function yt(e){let t=(0,Q.c)(6),{token:r,onChange:i}=e,a=`Reset --${r}`,o;t[0]===i?o=t[1]:(o=()=>i(``),t[0]=i,t[1]=o);let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsx)(n,{className:`size-3.5`,"aria-hidden":!0}),t[2]=s):s=t[2];let c;return t[3]!==a||t[4]!==o?(c=(0,$.jsx)(l,{size:`icon-xs`,variant:`ghost`,"aria-label":a,onClick:o,className:`text-muted-foreground`,children:s}),t[3]=a,t[4]=o,t[5]=c):c=t[5],c}function bt(e){let t=(0,Q.c)(6),{token:n,overridden:r}=e,i=r?`text-foreground`:`text-muted-foreground/70`,a;t[0]===i?a=t[1]:(a=s(`truncate font-mono text-[11px]`,i),t[0]=i,t[1]=a);let o=`--${n}`,c;return t[2]!==a||t[3]!==o||t[4]!==n?(c=(0,$.jsxs)(`span`,{className:a,title:o,children:[`--`,n]}),t[2]=a,t[3]=o,t[4]=n,t[5]=c):c=t[5],c}function xt(e){let t=(0,Q.c)(41),{token:n,value:r,inherited:i,overridden:a,onChange:o}=e,s=r||i,c,l,u,d,f;if(t[0]!==s||t[1]!==r){u=he(s);let e;t[7]===r?e=t[8]:(e=r.length>0&&!me(r),t[7]=r,t[8]=e),l=e,f=`flex items-center gap-2`,c=Ze,d=lt(u),t[0]=s,t[1]=r,t[2]=c,t[3]=l,t[4]=u,t[5]=d,t[6]=f}else c=t[2],l=t[3],u=t[4],d=t[5],f=t[6];let p;t[9]===o?p=t[10]:(p=e=>o(e),t[9]=o,t[10]=p);let m=`Pick a color for --${n}`,h=l?`transparent`:u||`transparent`,g;t[11]===h?g=t[12]:(g=(0,$.jsx)(`span`,{className:`pointer-events-none absolute inset-0`,style:{backgroundColor:h},"aria-hidden":!0}),t[11]=h,t[12]=g);let _;t[13]!==c||t[14]!==d||t[15]!==p||t[16]!==m||t[17]!==g?(_=(0,$.jsx)(c,{value:d,onChange:p,ariaLabel:m,children:g}),t[13]=c,t[14]=d,t[15]=p,t[16]=m,t[17]=g,t[18]=_):_=t[18];let v;t[19]!==a||t[20]!==n?(v=(0,$.jsx)(bt,{token:n,overridden:a}),t[19]=a,t[20]=n,t[21]=v):v=t[21];let y=i||`inherit default`,b=l||void 0,x;t[22]===o?x=t[23]:(x=e=>o(e.currentTarget.value),t[22]=o,t[23]=x);let S;t[24]!==b||t[25]!==x||t[26]!==y||t[27]!==r?(S=(0,$.jsx)(M,{value:r,nativeInput:!0,unstyled:!0,size:`sm`,className:`border-0 bg-transparent p-0 shadow-none focus-within:shadow-none`,placeholder:y,"aria-invalid":b,onChange:x}),t[24]=b,t[25]=x,t[26]=y,t[27]=r,t[28]=S):S=t[28];let C;t[29]!==S||t[30]!==v?(C=(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[v,S]}),t[29]=S,t[30]=v,t[31]=C):C=t[31];let w;t[32]!==o||t[33]!==a||t[34]!==n?(w=a?(0,$.jsx)(yt,{token:n,onChange:o}):null,t[32]=o,t[33]=a,t[34]=n,t[35]=w):w=t[35];let T;return t[36]!==C||t[37]!==w||t[38]!==f||t[39]!==_?(T=(0,$.jsxs)(`div`,{className:f,children:[_,C,w]}),t[36]=C,t[37]=w,t[38]=f,t[39]=_,t[40]=T):T=t[40],T}function St(e){let t=(0,Q.c)(31),{token:n,value:r,inherited:i,overridden:a,onChange:o}=e,s=Number(r||i),c;t[0]===s?c=t[1]:(c=Number.isFinite(s)?Math.min(1,Math.max(0,s)):0,t[0]=s,t[1]=c);let l=c,u;t[2]===r?u=t[3]:(u=r.length>0&&!B(`opacity`,r),t[2]=r,t[3]=u);let d=u,f;t[4]!==a||t[5]!==n?(f=(0,$.jsx)(bt,{token:n,overridden:a}),t[4]=a,t[5]=n,t[6]=f):f=t[6];let p;t[7]===o?p=t[8]:(p=e=>o(e.currentTarget.value),t[7]=o,t[8]=p);let m=`--${n} value`,h;t[9]!==l||t[10]!==p||t[11]!==m?(h=(0,$.jsx)(`input`,{type:`range`,min:0,max:1,step:.005,value:l,onChange:p,"aria-label":m,className:`h-7.5 flex-1 accent-primary cursor-pointer`}),t[9]=l,t[10]=p,t[11]=m,t[12]=h):h=t[12];let g=i||`0`,_=d||void 0,v;t[13]===o?v=t[14]:(v=e=>o(e.currentTarget.value),t[13]=o,t[14]=v);let y;t[15]!==g||t[16]!==_||t[17]!==v||t[18]!==r?(y=(0,$.jsx)(`div`,{className:`w-20 shrink-0`,children:(0,$.jsx)(M,{value:r,nativeInput:!0,type:`number`,min:0,max:1,step:.005,size:`sm`,placeholder:g,"aria-invalid":_,onChange:v})}),t[15]=g,t[16]=_,t[17]=v,t[18]=r,t[19]=y):y=t[19];let b;t[20]!==o||t[21]!==a||t[22]!==n?(b=a?(0,$.jsx)(yt,{token:n,onChange:o}):null,t[20]=o,t[21]=a,t[22]=n,t[23]=b):b=t[23];let x;t[24]!==y||t[25]!==b||t[26]!==h?(x=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[h,y,b]}),t[24]=y,t[25]=b,t[26]=h,t[27]=x):x=t[27];let S;return t[28]!==x||t[29]!==f?(S=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[f,x]}),t[28]=x,t[29]=f,t[30]=S):S=t[30],S}function Ct(e){let t=(0,Q.c)(67),{token:n,value:r,inherited:i,overridden:a,onChange:o}=e,s,c,l,u,d;if(t[0]!==i||t[1]!==o||t[2]!==a||t[3]!==n||t[4]!==r){d=Symbol.for(`react.early_return_sentinel`);bb0:{l=R(r),c=R(i);let e=c?pt(c.unit):!1,f=l?pt(l.unit):!1;if(r.length>0&&!f||r.length===0&&i.length>0&&!e){let e;t[10]===r?e=t[11]:(e=r.length>0&&!B(`length`,r),t[10]=r,t[11]=e);let s=e,c;t[12]!==a||t[13]!==n?(c=(0,$.jsx)(bt,{token:n,overridden:a}),t[12]=a,t[13]=n,t[14]=c):c=t[14];let l=i||`e.g. 1rem`,u=s||void 0,f;t[15]===o?f=t[16]:(f=e=>o(e.currentTarget.value),t[15]=o,t[16]=f);let p;t[17]!==l||t[18]!==u||t[19]!==f||t[20]!==r?(p=(0,$.jsx)(M,{value:r,nativeInput:!0,size:`sm`,placeholder:l,"aria-invalid":u,onChange:f}),t[17]=l,t[18]=u,t[19]=f,t[20]=r,t[21]=p):p=t[21];let m;t[22]!==o||t[23]!==a||t[24]!==n?(m=a?(0,$.jsx)(yt,{token:n,onChange:o}):null,t[22]=o,t[23]=a,t[24]=n,t[25]=m):m=t[25];let h;t[26]!==p||t[27]!==m?(h=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[p,m]}),t[26]=p,t[27]=m,t[28]=h):h=t[28];let g;t[29]!==h||t[30]!==c?(g=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[c,h]}),t[29]=h,t[30]=c,t[31]=g):g=t[31],d=g;break bb0}s=l?String(l.number):``,u=l&&pt(l.unit)?l.unit:c&&pt(c.unit)?c.unit:`rem`}t[0]=i,t[1]=o,t[2]=a,t[3]=n,t[4]=r,t[5]=s,t[6]=c,t[7]=l,t[8]=u,t[9]=d}else s=t[5],c=t[6],l=t[7],u=t[8],d=t[9];if(d!==Symbol.for(`react.early_return_sentinel`))return d;let f=u,p=c?String(c.number):``,m;t[32]!==o||t[33]!==f?(m=e=>{let t=e.trim();if(t.length===0){o(``);return}let n=Number(t);Number.isFinite(n)&&o(`${n}${f}`)},t[32]=o,t[33]=f,t[34]=m):m=t[34];let h=m,g;t[35]!==o||t[36]!==c||t[37]!==l?(g=e=>{if(l){o(`${l.number}${e}`);return}c&&o(`${c.number}${e}`)},t[35]=o,t[36]=c,t[37]=l,t[38]=g):g=t[38];let _=g,v;t[39]!==a||t[40]!==n?(v=(0,$.jsx)(bt,{token:n,overridden:a}),t[39]=a,t[40]=n,t[41]=v):v=t[41];let y=n===`font-size-base`?1:.05,b;t[42]===h?b=t[43]:(b=e=>h(e.currentTarget.value),t[42]=h,t[43]=b);let x;t[44]!==p||t[45]!==s||t[46]!==y||t[47]!==b?(x=(0,$.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,$.jsx)(M,{value:s,nativeInput:!0,type:`number`,step:y,size:`sm`,placeholder:p,onChange:b})}),t[44]=p,t[45]=s,t[46]=y,t[47]=b,t[48]=x):x=t[48];let S;t[49]===_?S=t[50]:(S=e=>_(e.currentTarget.value),t[49]=_,t[50]=S);let C=`--${n} unit`,w;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(w=V.map(wt),t[51]=w):w=t[51];let T;t[52]!==C||t[53]!==S||t[54]!==f?(T=(0,$.jsx)(`select`,{value:f,onChange:S,"aria-label":C,className:`h-7.5 rounded-md border border-input bg-background px-2 text-sm outline-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/24 sm:h-6.5 sm:text-xs`,children:w}),t[52]=C,t[53]=S,t[54]=f,t[55]=T):T=t[55];let E;t[56]!==o||t[57]!==a||t[58]!==n?(E=a?(0,$.jsx)(yt,{token:n,onChange:o}):null,t[56]=o,t[57]=a,t[58]=n,t[59]=E):E=t[59];let D;t[60]!==T||t[61]!==E||t[62]!==x?(D=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[x,T,E]}),t[60]=T,t[61]=E,t[62]=x,t[63]=D):D=t[63];let O;return t[64]!==D||t[65]!==v?(O=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[v,D]}),t[64]=D,t[65]=v,t[66]=O):O=t[66],O}function wt(e){return(0,$.jsx)(`option`,{value:e,children:e},e)}function Tt(e){let t=(0,Q.c)(25),{token:n,value:r,inherited:i,overridden:a,onChange:o}=e,s=r||i,c;t[0]===r?c=t[1]:(c=r.length>0&&!B(`font-family`,r),t[0]=r,t[1]=c);let l=c,u;t[2]!==a||t[3]!==n?(u=(0,$.jsx)(bt,{token:n,overridden:a}),t[2]=a,t[3]=n,t[4]=u):u=t[4];let d=i||`system-ui, sans-serif`,f=s||void 0,p;t[5]===f?p=t[6]:(p={fontFamily:f},t[5]=f,t[6]=p);let m=l||void 0,h;t[7]===o?h=t[8]:(h=e=>o(e.currentTarget.value),t[7]=o,t[8]=h);let g;t[9]!==d||t[10]!==p||t[11]!==m||t[12]!==h||t[13]!==r?(g=(0,$.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,$.jsx)(M,{value:r,nativeInput:!0,size:`sm`,placeholder:d,style:p,"aria-invalid":m,onChange:h})}),t[9]=d,t[10]=p,t[11]=m,t[12]=h,t[13]=r,t[14]=g):g=t[14];let _;t[15]!==o||t[16]!==a||t[17]!==n?(_=a?(0,$.jsx)(yt,{token:n,onChange:o}):null,t[15]=o,t[16]=a,t[17]=n,t[18]=_):_=t[18];let v;t[19]!==g||t[20]!==_?(v=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[g,_]}),t[19]=g,t[20]=_,t[21]=v):v=t[21];let y;return t[22]!==v||t[23]!==u?(y=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[u,v]}),t[22]=v,t[23]=u,t[24]=y):y=t[24],y}var Et=[{value:`system`,label:`System`},{value:`light`,label:`Light`},{value:`dark`,label:`Dark`}],Dt={default:1,light:.92,medium:.84,high:.78,glass:.72};function Ot({surface:e=`node`}={}){let t=e===`hub`,{theme:n,setTheme:i,resolvedTheme:a,activeThemeId:c,setActiveTheme:v}=U(),[x,S]=(0,Z.useState)(null),[C,w]=(0,Z.useState)(null),[D,te]=(0,Z.useState)(null),[M,I]=(0,Z.useState)(()=>L()),[ce,le]=(0,Z.useState)(0),R=(0,Z.useRef)(null),me=be(),z=(0,Z.useMemo)(()=>x!==null&&C!==null?{source:fe(x),draft:C}:null,[C,x,ce]),he=D?fe(D):null,B=(0,Z.useCallback)(()=>le(e=>e+1),[]);(0,Z.useEffect)(()=>{if(typeof window>`u`)return;let e=e=>{e.key===`ryco:appearance-preferences`&&I(L())};return window.addEventListener(`storage`,e),()=>window.removeEventListener(`storage`,e)},[]);let ye=(0,Z.useCallback)((e,t)=>{F(e,t),ae(),I(L())},[]),V=(0,Z.useCallback)(e=>{se(e),ae(),I(L())},[]),xe=(0,Z.useCallback)(()=>{se(`primaryColorMode`),se(`primaryColor`),ae(),I(L())},[]),W=(0,Z.useCallback)(e=>{F(`primaryColorMode`,e?`custom`:`theme`),ae(),I(L())},[]),Ce=(0,Z.useCallback)(e=>{F(`primaryColor`,e),F(`primaryColorMode`,`custom`),ae(),I(L())},[]),we=(0,Z.useCallback)(e=>{if(pe(e.id)){let t=H(e);ge(t),Se(t.id),v(t.id),S(t.id),w(t),B();return}v(e.id),S(e.id),w(e)},[B,v]),Te=(0,Z.useCallback)(e=>{let t=H(e);ge(t),v(t.id),S(t.id),w(t),B()},[B,v]),Y=(0,Z.useCallback)(()=>{let e={id:_e(`new`),name:`New theme`,builtIn:!1};ge(e),v(e.id),S(e.id),w(e),B()},[B,v]),De=(0,Z.useCallback)(()=>{z&&(de(z.source.id,z.draft),z.source.id===z.draft.id?ue(z.draft):v(z.draft.id),S(null),w(null),B())},[z,B,v]),ke=(0,Z.useCallback)(()=>{z&&ue(z.source),S(null),w(null)},[z]),je=(0,Z.useCallback)(()=>{D&&(x===D&&(S(null),w(null)),ve(D),te(null),B())},[x,D,B]),Ne=(0,Z.useCallback)(e=>{try{We(e)}catch(e){o.add({type:`error`,title:`Could not export theme`,description:e instanceof Error?e.message:`Download failed.`})}},[]),Fe=(0,Z.useCallback)(async e=>{try{await Ue(e),o.add({type:`success`,title:`Copied theme JSON`,description:`${e.name} is ready to paste.`})}catch(e){o.add({type:`error`,title:`Could not copy theme`,description:e instanceof Error?e.message:`Clipboard write failed.`})}},[]),Q=(0,Z.useCallback)(()=>{R.current?.click()},[]),Le=(0,Z.useCallback)(async e=>{let t=e.target.files?.[0];if(e.target.value=``,t)try{let e=await Ge(t,{collision:`rename`,activate:!0});v(e.theme.id),B(),o.add({type:`success`,title:`Imported "${e.theme.name}"`,description:e.action===`renamed`?`An existing theme used the same id, so it was imported as "${e.theme.id}".`:`Theme imported and activated.`})}catch(e){o.add({type:`error`,title:`Could not import theme`,description:e instanceof Error?e.message:`Invalid theme file.`})}},[B,v]);return(0,$.jsxs)(K,{children:[(0,$.jsx)(G,{title:`Color mode`,children:(0,$.jsx)(`div`,{className:`grid grid-cols-3 gap-3 p-4`,role:`group`,"aria-label":`Color mode`,children:Et.map(e=>(0,$.jsxs)(`button`,{type:`button`,"aria-pressed":n===e.value,onClick:()=>i(e.value),className:s(`min-w-0 rounded-xl border p-2 text-sm transition-colors focus-visible:outline-2 focus-visible:outline-ring`,n===e.value?`border-primary bg-muted/40`:`border-border hover:bg-muted/30`),children:[(0,$.jsxs)(`div`,{className:`relative overflow-hidden rounded-lg`,children:[(0,$.jsx)(nt,{compact:!0,theme:fe(c),variant:e.value===`dark`?`dark`:`light`}),e.value===`system`&&(0,$.jsx)(`div`,{className:`absolute inset-0 [clip-path:inset(0_0_0_50%)]`,children:(0,$.jsx)(nt,{compact:!0,theme:fe(c),variant:`dark`})})]}),(0,$.jsx)(`span`,{className:`mt-2 block font-medium`,children:e.label})]},e.value))})}),(0,$.jsx)(G,{title:`Theme palette`,headerAction:(0,$.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,$.jsx)(`input`,{ref:R,type:`file`,accept:`.json,application/json`,className:`sr-only`,onChange:Le,"aria-hidden":!0,tabIndex:-1}),(0,$.jsxs)(l,{size:`xs`,variant:`ghost`,onClick:Y,"aria-label":`Create a new theme`,title:`Create a new theme`,className:`text-muted-foreground`,children:[(0,$.jsx)(Ee,{className:`size-3.5`}),`New`]}),(0,$.jsxs)(l,{size:`xs`,variant:`ghost`,onClick:Q,"aria-label":`Import a theme from file`,title:`Import a theme from disk`,className:`text-muted-foreground`,children:[(0,$.jsx)(Ie,{className:`size-3.5`}),`Import`]})]}),children:(0,$.jsx)(`div`,{role:`radiogroup`,"aria-label":`Theme palette`,className:`grid grid-cols-2 gap-4 p-4`,children:me.map(e=>{let t=e.id===c,n=x===e.id;return(0,$.jsxs)(Z.Fragment,{children:[(0,$.jsxs)(`div`,{role:`radio`,"aria-checked":t,tabIndex:t?0:-1,onClick:()=>v(e.id),onKeyDown:t=>{let n=t.key===`ArrowRight`||t.key===`ArrowDown`?1:t.key===`ArrowLeft`||t.key===`ArrowUp`?-1:0;if(n){t.preventDefault();let r=(me.findIndex(t=>t.id===e.id)+n+me.length)%me.length;v(me[r].id),(t.currentTarget.parentElement?.querySelectorAll(`[role="radio"]`))?.item(r).focus()}(t.key===` `||t.key===`Enter`)&&(t.preventDefault(),v(e.id))},className:s(`flex cursor-pointer flex-wrap items-center gap-3 rounded-xl border p-3 outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset`,t?`border-primary`:`border-border`,t?`bg-muted/40`:`hover:bg-muted/24`),children:[(0,$.jsx)(nt,{theme:e,variant:a}),(0,$.jsx)(`span`,{"aria-hidden":!0,className:s(`relative flex size-4 shrink-0 items-center justify-center rounded-full border-2 transition-colors`,t?`border-primary`:`border-muted-foreground/40`),children:t?(0,$.jsx)(`span`,{className:`size-2 rounded-full bg-primary`,"aria-hidden":!0}):null}),(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,$.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground`,title:e.name,children:e.name}),(0,$.jsx)(O,{variant:`outline`,size:`sm`,children:e.builtIn?`Built-in`:`Custom`})]}),e.description?(0,$.jsx)(`span`,{className:`truncate text-xs text-muted-foreground/80`,title:e.description,children:e.description}):null]}),(0,$.jsx)(`div`,{onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),children:(0,$.jsxs)(y,{children:[(0,$.jsx)(d,{render:(0,$.jsx)(l,{size:`icon-xs`,variant:`ghost`,"aria-label":`Theme actions for ${e.name}`,children:(0,$.jsx)(A,{className:`size-4`})})}),(0,$.jsxs)(E,{align:`end`,children:[!e.builtIn&&(0,$.jsxs)(T,{onClick:()=>we(e),children:[(0,$.jsx)(_,{}),` Edit`]}),(0,$.jsxs)(T,{onClick:()=>Te(e),children:[(0,$.jsx)(r,{}),` Duplicate`]}),(0,$.jsxs)(T,{onClick:()=>Ne(e),children:[(0,$.jsx)(ee,{}),` Export`]}),(0,$.jsxs)(T,{onClick:()=>void Fe(e),children:[(0,$.jsx)(j,{}),` Copy JSON`]}),!e.builtIn&&(0,$.jsxs)(T,{onClick:()=>te(e.id),children:[(0,$.jsx)(k,{}),` Delete`]})]})]})})]}),n&&z?(0,$.jsx)(`div`,{className:`col-span-full`,children:(0,$.jsx)(mt,{source:z.source,draft:z.draft,onDraftChange:e=>w(e),onSave:De,onCancel:ke,resolvedVariant:a})}):null]},e.id)})})}),!t&&(0,$.jsx)(tt,{}),(0,$.jsxs)(G,{title:`Typography`,children:[(0,$.jsx)(q,{title:`Interface font`,description:`Normal app text, navigation, dialogs, and controls.`,resetAction:N(`fontFamilySans`)?(0,$.jsx)(J,{label:`interface font`,onClick:()=>V(`fontFamilySans`)}):null,control:(0,$.jsx)(kt,{ariaLabel:`Interface font`,icon:(0,$.jsx)(Pe,{className:`size-3.5`}),options:P,value:M.fontFamilySans,sample:`The quick brown fox`,onChange:e=>ye(`fontFamilySans`,e)})}),t?null:(0,$.jsx)(q,{title:`Code font`,description:`Code blocks, diffs, file paths, and terminal surfaces.`,resetAction:N(`fontFamilyMono`)?(0,$.jsx)(J,{label:`code font`,onClick:()=>V(`fontFamilyMono`)}):null,control:(0,$.jsx)(kt,{ariaLabel:`Code font`,icon:(0,$.jsx)(Oe,{className:`size-3.5`}),options:re,value:M.fontFamilyMono,sample:`const answer = 42`,onChange:e=>ye(`fontFamilyMono`,e)})}),(0,$.jsx)(q,{title:`Text size`,description:`Scale the interface independently from the active theme.`,resetAction:N(`fontSizeBase`)?(0,$.jsx)(J,{label:`text size`,onClick:()=>V(`fontSizeBase`)}):null,control:(0,$.jsx)(jt,{ariaLabel:`Text size`,icon:(0,$.jsx)(X,{className:`size-3.5`}),options:ie,value:M.fontSizeBase,onChange:e=>ye(`fontSizeBase`,e),preview:(0,$.jsx)(`span`,{className:`flex h-9 min-w-14 items-center justify-center rounded-md border border-border/70 bg-background px-2 font-semibold text-foreground shadow-xs/5`,children:(0,$.jsx)(`span`,{style:{fontSize:M.fontSizeBase},children:`Aa`})})})})]}),(0,$.jsxs)(G,{title:`Interface`,children:[t?null:(0,$.jsx)(q,{title:`Corner radius`,description:`Adjust rounding for panels, buttons, inputs, and menus globally.`,resetAction:N(`radius`)?(0,$.jsx)(J,{label:`corner radius`,onClick:()=>V(`radius`)}):null,control:(0,$.jsx)(jt,{ariaLabel:`Corner radius`,icon:(0,$.jsx)(Me,{className:`size-3.5`}),options:oe,value:M.radius,onChange:e=>ye(`radius`,e),preview:(0,$.jsxs)(`span`,{className:`grid h-9 min-w-14 grid-cols-2 gap-1 rounded-md border border-border/70 bg-background p-1.5 shadow-xs/5`,children:[(0,$.jsx)(`span`,{className:`border border-primary/55 bg-primary/15`,style:{borderRadius:M.radius}}),(0,$.jsx)(`span`,{className:`border border-muted-foreground/30 bg-muted`,style:{borderRadius:M.radius}})]})})}),(0,$.jsx)(q,{title:`Primary color`,description:`Theme palettes control buttons by default; enable a custom color to pin one app accent.`,resetAction:N(`primaryColorMode`)||N(`primaryColor`)?(0,$.jsx)(J,{label:`primary color`,onClick:xe}):null,control:(0,$.jsx)(At,{mode:M.primaryColorMode,value:M.primaryColor,onModeChange:W,onColorChange:Ce})}),(0,$.jsx)(q,{title:`Transparency`,description:`Adjust glass and floating surfaces like dialogs, menus, popups, and toasts.`,resetAction:N(`surfaceTransparency`)?(0,$.jsx)(J,{label:`transparency`,onClick:()=>V(`surfaceTransparency`)}):null,control:(0,$.jsx)(jt,{ariaLabel:`Transparency`,icon:(0,$.jsx)(Ae,{className:`size-3.5`}),options:ne,value:M.surfaceTransparency,onChange:e=>ye(`surfaceTransparency`,e),preview:(0,$.jsx)(`span`,{className:`relative h-9 min-w-14 overflow-hidden rounded-md border border-border/70 bg-[linear-gradient(135deg,var(--color-sky-500)_0_20%,var(--color-emerald-500)_20%_40%,var(--color-amber-500)_40%_60%,var(--color-fuchsia-500)_60%_80%,var(--color-slate-500)_80%_100%)] p-1.5 shadow-xs/5`,children:(0,$.jsx)(`span`,{className:`block h-full rounded border border-border/70 bg-popover`,style:{opacity:Dt[M.surfaceTransparency]??Dt.default}})})})})]}),(0,$.jsx)(u,{open:D!==null,onOpenChange:e=>{e||te(null)},children:(0,$.jsxs)(f,{children:[(0,$.jsxs)(g,{children:[(0,$.jsx)(p,{children:`Delete custom theme?`}),(0,$.jsx)(m,{children:he?`"${he.name}" will be removed permanently. This action cannot be undone.`:`This action cannot be undone.`})]}),(0,$.jsxs)(h,{children:[(0,$.jsx)(b,{render:(0,$.jsx)(l,{variant:`outline`}),children:`Cancel`}),(0,$.jsx)(l,{variant:`destructive`,onClick:je,children:`Delete theme`})]})]})})]})}function kt(e){let t=(0,Q.c)(43),{ariaLabel:n,icon:r,options:i,value:a,sample:o,onChange:c}=e,l;if(t[0]!==i||t[1]!==a){let e;t[3]===a?e=t[4]:(e=e=>e.value===a,t[3]=a,t[4]=e),l=i.findIndex(e),t[0]=i,t[1]=a,t[2]=l}else l=t[2];let u=Math.max(0,l),d=i[u]??i[0],f;t[5]===r?f=t[6]:(f=(0,$.jsx)(`span`,{className:`inline-flex size-7 shrink-0 items-center justify-center rounded-md border border-border/70 bg-muted/60 text-muted-foreground`,children:r}),t[5]=r,t[6]=f);let p=d?.value??a,m;t[7]===p?m=t[8]:(m={fontFamily:p},t[7]=p,t[8]=m);let h=d?.label??a,g;t[9]!==m||t[10]!==h?(g=(0,$.jsx)(`span`,{className:`block truncate text-sm font-semibold text-foreground`,style:m,children:h}),t[9]=m,t[10]=h,t[11]=g):g=t[11];let _=d?.description??`Custom`,v;t[12]===_?v=t[13]:(v=(0,$.jsx)(`span`,{className:`block truncate text-[11px] text-muted-foreground`,children:_}),t[12]=_,t[13]=v);let y;t[14]!==g||t[15]!==v?(y=(0,$.jsxs)(`span`,{className:`min-w-0`,children:[g,v]}),t[14]=g,t[15]=v,t[16]=y):y=t[16];let b;t[17]!==f||t[18]!==y?(b=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[f,y]}),t[17]=f,t[18]=y,t[19]=b):b=t[19];let x=d?.value??a,S;t[20]===x?S=t[21]:(S={fontFamily:x},t[20]=x,t[21]=S);let C;t[22]!==o||t[23]!==S?(C=(0,$.jsx)(`span`,{className:`flex h-9 min-w-30 max-w-44 items-center justify-start truncate rounded-md border border-border/70 bg-background px-2 text-xs text-foreground shadow-xs/5`,style:S,title:o,children:o}),t[22]=o,t[23]=S,t[24]=C):C=t[24];let w;t[25]!==b||t[26]!==C?(w=(0,$.jsxs)(`div`,{className:`mb-2 flex min-h-9 items-center justify-between gap-3`,children:[b,C]}),t[25]=b,t[26]=C,t[27]=w):w=t[27];let T;if(t[28]!==n||t[29]!==c||t[30]!==i||t[31]!==u){let e;t[33]!==n||t[34]!==c||t[35]!==u?(e=(e,t)=>{let r=t===u;return(0,$.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":r,"aria-label":`Use ${e.label} for ${n.toLowerCase()}`,title:`${e.label} (${e.description})`,onClick:()=>c(e.value),className:s(`min-h-12 min-w-0 rounded-md border px-2 py-1.5 text-left outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring`,r?`border-primary bg-primary/8 text-foreground ring-1 ring-primary/35`:`border-border/70 text-muted-foreground hover:border-foreground/25 hover:bg-muted/45`),children:[(0,$.jsx)(`span`,{className:`block truncate text-[12px] font-semibold leading-4`,style:{fontFamily:e.value},children:e.label}),(0,$.jsx)(`span`,{className:`block truncate text-[10px] leading-3 opacity-75`,children:e.description})]},e.value)},t[33]=n,t[34]=c,t[35]=u,t[36]=e):e=t[36],T=i.map(e),t[28]=n,t[29]=c,t[30]=i,t[31]=u,t[32]=T}else T=t[32];let E;t[37]!==n||t[38]!==T?(E=(0,$.jsx)(`div`,{role:`radiogroup`,"aria-label":n,className:`grid grid-cols-2 gap-1.5 sm:grid-cols-3`,children:T}),t[37]=n,t[38]=T,t[39]=E):E=t[39];let D;return t[40]!==w||t[41]!==E?(D=(0,$.jsxs)(`div`,{className:`w-full sm:w-96`,children:[w,E]}),t[40]=w,t[41]=E,t[42]=D):D=t[42],D}function At(e){let t=(0,Q.c)(48),{mode:n,value:r,onModeChange:i,onColorChange:a}=e,o=n===`custom`,c;t[0]===r?c=t[1]:(c=/^#[0-9a-f]{6}$/i.test(r)?r.toLowerCase():I[0].value,t[0]=r,t[1]=c);let l=c,u;t[2]===l?u=t[3]:(u=I.find(e=>e.value===l),t[2]=l,t[3]=u);let d=u,f=o&&!d?`border-primary bg-primary/8 text-foreground ring-1 ring-primary/35`:`border-border/70 text-muted-foreground hover:border-foreground/25 hover:bg-muted/45`,p=!o&&`cursor-not-allowed opacity-55 hover:border-border/70 hover:bg-transparent`,m;t[4]!==f||t[5]!==p?(m=s(`h-12 w-full rounded-md border px-2 py-1.5 text-left shadow-none`,f,p),t[4]=f,t[5]=p,t[6]=m):m=t[6];let h=m,g;t[7]===l?g=t[8]:(g=(0,$.jsx)(`span`,{"aria-hidden":!0,className:`size-5 shrink-0 rounded-full border border-black/10 shadow-xs dark:border-white/20`,style:{backgroundColor:l}}),t[7]=l,t[8]=g);let _;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,$.jsx)(`span`,{className:`block truncate text-[12px] font-semibold leading-4`,children:`Custom`}),t[9]=_):_=t[9];let v;t[10]===l?v=t[11]:(v=(0,$.jsxs)(`span`,{className:`min-w-0`,children:[_,(0,$.jsx)(`span`,{className:`block truncate font-mono text-[10px] leading-3 opacity-75`,children:l})]}),t[10]=l,t[11]=v);let y;t[12]!==g||t[13]!==v?(y=(0,$.jsxs)(`span`,{className:`flex size-full min-w-0 items-center gap-2`,children:[g,v]}),t[12]=g,t[13]=v,t[14]=y):y=t[14];let b=y,x;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsx)(`span`,{className:`inline-flex size-7 shrink-0 items-center justify-center rounded-md border border-border/70 bg-muted/60 text-muted-foreground`,children:(0,$.jsx)(te,{className:`size-3.5`})}),t[15]=x):x=t[15];let S=o?d?.label??`Custom`:`Theme color`,w;t[16]===S?w=t[17]:(w=(0,$.jsx)(`span`,{className:`block truncate text-sm font-semibold text-foreground`,children:S}),t[16]=S,t[17]=w);let T=o?l:`Active palette`,E;t[18]===T?E=t[19]:(E=(0,$.jsx)(`span`,{className:`block truncate text-[11px] text-muted-foreground`,children:T}),t[18]=T,t[19]=E);let D;t[20]!==w||t[21]!==E?(D=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[x,(0,$.jsxs)(`span`,{className:`min-w-0`,children:[w,E]})]}),t[20]=w,t[21]=E,t[22]=D):D=t[22];let O;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,$.jsx)(`span`,{children:`Use theme`}),t[23]=O):O=t[23];let k=!o,A;t[24]===i?A=t[25]:(A=e=>i(!e),t[24]=i,t[25]=A);let j;t[26]!==k||t[27]!==A?(j=(0,$.jsxs)(`label`,{className:`flex h-9 shrink-0 items-center gap-2 rounded-md border border-border/70 bg-background px-2 text-xs text-muted-foreground shadow-xs/5`,children:[O,(0,$.jsx)(C,{checked:k,onCheckedChange:A,"aria-label":`Use theme primary color`})]}),t[26]=k,t[27]=A,t[28]=j):j=t[28];let ee;t[29]!==D||t[30]!==j?(ee=(0,$.jsxs)(`div`,{className:`mb-2 flex min-h-9 items-center justify-between gap-3`,children:[D,j]}),t[29]=D,t[30]=j,t[31]=ee):ee=t[31];let M;t[32]!==o||t[33]!==l||t[34]!==a?(M=I.map(e=>{let t=l===e.value;return(0,$.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":o&&t,"aria-label":`Use ${e.label} as primary color`,title:`${e.label} (${e.value})`,onClick:()=>a(e.value),disabled:!o,className:s(`flex min-h-12 min-w-0 items-center gap-2 rounded-md border px-2 py-1.5 text-left outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring`,o&&t?`border-primary bg-primary/8 text-foreground ring-1 ring-primary/35`:`border-border/70 text-muted-foreground hover:border-foreground/25 hover:bg-muted/45`,!o&&`cursor-not-allowed opacity-55 hover:border-border/70 hover:bg-transparent`),children:[(0,$.jsx)(`span`,{"aria-hidden":!0,className:`size-5 shrink-0 rounded-full border border-black/10 shadow-xs dark:border-white/20`,style:{backgroundColor:e.value}}),(0,$.jsxs)(`span`,{className:`min-w-0`,children:[(0,$.jsx)(`span`,{className:`block truncate text-[12px] font-semibold leading-4`,children:e.label}),(0,$.jsx)(`span`,{className:`block truncate text-[10px] leading-3 opacity-75`,children:e.description})]})]},e.value)}),t[32]=o,t[33]=l,t[34]=a,t[35]=M):M=t[35];let N;t[36]!==o||t[37]!==h||t[38]!==b||t[39]!==l||t[40]!==a?(N=o?(0,$.jsx)(Ze,{value:l,onChange:a,ariaLabel:`Pick custom primary color`,triggerClassName:h,children:b}):(0,$.jsx)(`button`,{type:`button`,disabled:!0,"aria-label":`Pick custom primary color`,className:h,children:b}),t[36]=o,t[37]=h,t[38]=b,t[39]=l,t[40]=a,t[41]=N):N=t[41];let P;t[42]!==M||t[43]!==N?(P=(0,$.jsxs)(`div`,{role:`radiogroup`,"aria-label":`Primary color`,className:`grid grid-cols-2 gap-1.5 sm:grid-cols-4`,children:[M,N]}),t[42]=M,t[43]=N,t[44]=P):P=t[44];let F;return t[45]!==ee||t[46]!==P?(F=(0,$.jsxs)(`div`,{className:`w-full sm:w-96`,children:[ee,P]}),t[45]=ee,t[46]=P,t[47]=F):F=t[47],F}function jt(e){let t=(0,Q.c)(50),{ariaLabel:n,icon:r,options:i,value:a,onChange:o,preview:c}=e,l;if(t[0]!==i||t[1]!==a){let e;t[3]===a?e=t[4]:(e=e=>e.value===a,t[3]=a,t[4]=e),l=i.findIndex(e),t[0]=i,t[1]=a,t[2]=l}else l=t[2];let u=Math.max(0,l),d=i[u]??i[0],f=i.length>1?u/(i.length-1)*100:0,p;t[5]===r?p=t[6]:(p=(0,$.jsx)(`span`,{className:`inline-flex size-7 shrink-0 items-center justify-center rounded-md border border-border/70 bg-muted/60 text-muted-foreground`,children:r}),t[5]=r,t[6]=p);let m=d?.label??a,h;t[7]===m?h=t[8]:(h=(0,$.jsx)(`span`,{className:`block truncate text-sm font-semibold text-foreground`,children:m}),t[7]=m,t[8]=h);let g=d?.description??a,_;t[9]===g?_=t[10]:(_=(0,$.jsx)(`span`,{className:`block truncate text-[11px] text-muted-foreground`,children:g}),t[9]=g,t[10]=_);let v;t[11]!==h||t[12]!==_?(v=(0,$.jsxs)(`span`,{className:`min-w-0`,children:[h,_]}),t[11]=h,t[12]=_,t[13]=v):v=t[13];let y;t[14]!==p||t[15]!==v?(y=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[p,v]}),t[14]=p,t[15]=v,t[16]=y):y=t[16];let b;t[17]!==c||t[18]!==y?(b=(0,$.jsxs)(`div`,{className:`mb-2 flex min-h-9 items-center justify-between gap-3`,children:[y,c]}),t[17]=c,t[18]=y,t[19]=b):b=t[19];let x;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(x=s(`h-5 w-full cursor-pointer appearance-none bg-transparent outline-none`,`[&::-webkit-slider-runnable-track]:h-1.5 [&::-webkit-slider-runnable-track]:rounded-full`,`[&::-webkit-slider-thumb]:mt-[-5px] [&::-webkit-slider-thumb]:size-4 [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:border-2 [&::-webkit-slider-thumb]:border-background [&::-webkit-slider-thumb]:bg-primary [&::-webkit-slider-thumb]:shadow-sm`,`[&::-moz-range-track]:h-1.5 [&::-moz-range-track]:rounded-full [&::-moz-range-track]:border-0`,`[&::-moz-range-thumb]:size-4 [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:border-2 [&::-moz-range-thumb]:border-background [&::-moz-range-thumb]:bg-primary [&::-moz-range-thumb]:shadow-sm`,`focus-visible:[&::-webkit-slider-thumb]:ring-2 focus-visible:[&::-webkit-slider-thumb]:ring-ring focus-visible:[&::-moz-range-thumb]:ring-2 focus-visible:[&::-moz-range-thumb]:ring-ring`),t[20]=x):x=t[20];let S=Math.max(0,i.length-1),C=`linear-gradient(to right, var(--color-primary) 0%, var(--color-primary) ${f}%, color-mix(in srgb, var(--color-muted-foreground) 18%, transparent) ${f}%, color-mix(in srgb, var(--color-muted-foreground) 18%, transparent) 100%)`,w;t[21]===C?w=t[22]:(w={background:C,borderRadius:`999px`},t[21]=C,t[22]=w);let T;t[23]!==o||t[24]!==i?(T=e=>{let t=i[Number(e.currentTarget.value)];t&&o(t.value)},t[23]=o,t[24]=i,t[25]=T):T=t[25];let E;t[26]!==n||t[27]!==u||t[28]!==S||t[29]!==w||t[30]!==T?(E=(0,$.jsx)(`input`,{"aria-label":n,className:x,max:S,min:0,step:1,type:`range`,value:u,style:w,onChange:T}),t[26]=n,t[27]=u,t[28]=S,t[29]=w,t[30]=T,t[31]=E):E=t[31];let D=`repeat(${i.length}, minmax(0, 1fr))`,O;t[32]===D?O=t[33]:(O={gridTemplateColumns:D},t[32]=D,t[33]=O);let k;if(t[34]!==n||t[35]!==o||t[36]!==i||t[37]!==u){let e;t[39]!==n||t[40]!==o||t[41]!==u?(e=(e,t)=>{let r=t===u;return(0,$.jsxs)(`button`,{type:`button`,"aria-label":`Set ${n.toLowerCase()} to ${e.label}`,title:`${e.label} (${e.description})`,onClick:()=>o(e.value),className:s(`flex min-h-7 min-w-0 flex-col items-center justify-start gap-1 rounded-md px-1 py-1 text-center outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring`,r?`text-foreground`:`text-muted-foreground hover:bg-muted/50`),children:[(0,$.jsx)(`span`,{className:s(`size-1.5 rounded-full`,r?`bg-primary`:`bg-muted-foreground/35`),"aria-hidden":!0}),(0,$.jsx)(`span`,{className:`max-w-full truncate text-[10px] leading-none`,children:e.label})]},e.value)},t[39]=n,t[40]=o,t[41]=u,t[42]=e):e=t[42],k=i.map(e),t[34]=n,t[35]=o,t[36]=i,t[37]=u,t[38]=k}else k=t[38];let A;t[43]!==O||t[44]!==k?(A=(0,$.jsx)(`div`,{className:`mt-1.5 grid gap-1`,style:O,children:k}),t[43]=O,t[44]=k,t[45]=A):A=t[45];let j;return t[46]!==E||t[47]!==A||t[48]!==b?(j=(0,$.jsxs)(`div`,{className:`w-full sm:w-96`,children:[b,E,A]}),t[46]=E,t[47]=A,t[48]=b,t[49]=j):j=t[49],j}export{Ot as AppearanceSettingsPanel};
@@ -0,0 +1 @@
1
+ import{i as e,t}from"./react-SIfiwpqq.js";import"./primary-D_D7eLwT.js";import{Ki as n}from"./src-BSuAGqhK.js";import{Hn as r,Jn as i,Kn as a,Ml as o,Un as s,Vn as c,Wn as l,Xn as u,Yn as d,Zn as f,er as p,p as m,qn as h,y as g}from"./runtime-Djy96GJd.js";import{Sn as _,xn as v}from"./switch-DD1qVLgN.js";import{t as y}from"./compiler-runtime-qmuS0Svy.js";var b=y(),x=e(t(),1);function S(e){let t=(0,b.c)(13),n=d(e),{environmentId:i,cwd:s,query:c,enabled:f,limit:p,staleTime:m}=e,g,_;t[0]!==s||t[1]!==i||t[2]!==p?(g=()=>{if(i===null||s===null)return;let e={environmentId:i,cwd:s,...p===void 0?{}:{limit:p}};return u(e),()=>a(e)},_=[i,s,p],t[0]=s,t[1]=i,t[2]=p,t[3]=g,t[4]=_):(g=t[3],_=t[4]),(0,x.useEffect)(g,_);let v,y;t[5]!==s||t[6]!==f||t[7]!==i||t[8]!==p||t[9]!==c||t[10]!==m?(v=()=>{h({environmentId:i,cwd:s,query:c,...f===void 0?{}:{enabled:f},...p===void 0?{}:{limit:p},...m===void 0?{}:{staleTime:m}})},y=[i,s,c,f,p,m],t[5]=s,t[6]=f,t[7]=i,t[8]=p,t[9]=c,t[10]=m,t[11]=v,t[12]=y):(v=t[11],y=t[12]),(0,x.useEffect)(v,y);let S=o(l(n));return n===null?r:S}function C(e){let t=i(e),n=(0,x.useSyncExternalStore)(g,()=>e.environmentId===null?null:m(e.environmentId),()=>null),r=(0,x.useRef)(e);r.current=e,(0,x.useEffect)(()=>{let e=r.current,t=e.environmentId===null?void 0:p(e.environmentId,n?.client??null);return f(e,t??null)},[t,n]);let a=o(s(t));return t===null?c:a}function w(e){let t=e.trim().replace(/\.git$/i,``).replace(/\/+$/,``);if(!t||/^[a-z]:[\\/]/i.test(t)||t.startsWith(`\\\\`))return null;if(!t.includes(`://`)){let e=/^(?:[^@/]+@)?([^:/]+):(.+)$/.exec(t);return e?.[1]&&e[2]?`https://${e[1]}/${e[2].replace(/^\/+/,``)}`:null}try{let e=new URL(t.replace(/^(ssh|git|http):\/\//i,`https://`).replace(/^ssh:/i,`https:`));return!e.hostname||e.pathname===`/`||e.pathname===``?null:`https://${e.hostname}${e.pathname}`}catch{return null}}function T(e){if(!e)return null;let t=[e.locator?.remoteUrl,...(e.remotes??[]).map(e=>e.url)];for(let e of t){if(!e)continue;let t=w(e);if(t)return t}return null}n([`local`,`worktree`]);function E(e){let t=_(e.runtimeLabel),n=_(e.savedLabel);return e.isPrimary?[t,n].find(e=>e?!v(e):!1)??`This device`:t??n??e.environmentId}function D(e){let{activeWorktreePath:t,hasServerThread:n,draftThreadEnvMode:r}=e;return n?t?`worktree`:`local`:t?`local`:r===`worktree`?`worktree`:`local`}function O(e){let{nextWorktreePath:t,currentWorktreePath:n,effectiveEnvMode:r}=e;return t||r===`worktree`&&!n?`worktree`:`local`}function k(e){let{envMode:t,activeWorktreePath:n,activeThreadBranch:r,currentGitBranch:i}=e;return t===`worktree`&&!n?r??i:i??r}function A(e){let{activeProjectCwd:t,activeWorktreePath:n,refName:r}=e;if(r.worktreePath)return{checkoutCwd:r.worktreePath,nextWorktreePath:r.worktreePath===t?null:r.worktreePath,reuseExistingWorktree:!0};let i=n!==null&&r.isDefault?null:n;return{checkoutCwd:i??t,nextWorktreePath:i,reuseExistingWorktree:!1}}function j(e){let{itemValue:t,normalizedQuery:n,createBranchItemValue:r,checkoutPullRequestItemValue:i}=e;if(n.length===0||r&&t===r||i&&t===i)return!0;let a=e.searchTextByItemValue?.get(t);return a===void 0?t.toLowerCase().includes(n):a.toLowerCase().includes(n)}export{D as a,C as c,O as i,S as l,A as n,E as o,k as r,j as s,T as t};
@@ -0,0 +1 @@
1
+ import{i as e,t}from"./react-SIfiwpqq.js";import{Ut as n}from"./primary-D_D7eLwT.js";import{Ca as r,Ta as i,_l as a,tr as o,zr as s}from"./runtime-Djy96GJd.js";import{Jn as c,Qn as l,lr as u}from"./switch-DD1qVLgN.js";import{t as d}from"./compiler-runtime-qmuS0Svy.js";import{t as f}from"./arrow-left-CymyVbCi.js";import{t as p}from"./arrow-right-9wyq4YVq.js";import{t as m}from"./star-7UHEnC3x.js";import{It as h}from"./main-BbtLAX7M.js";var g=d(),_=e(t(),1),v=a();function y(e){let t=(0,g.c)(14),{tab:n,width:r}=e,i=(0,_.useRef)(null),[a,o]=(0,_.useState)(null),s=window.desktopBridge?.browser,c=n.presentation===`window`,l,u;t[0]!==c||t[1]!==n.id?(l=()=>{if(!s||!i.current||c)return;let e=crypto.randomUUID(),t=0,r=!1,a=``,l=0,u=()=>{if(t=0,r||!i.current)return;let c=i.current.getBoundingClientRect(),d=![...document.querySelectorAll(`[role="dialog"], [role="alertdialog"], [data-slot="popover-popup"], [role="menu"]`)].some(e=>!e.contains(i.current))&&document.visibilityState===`visible`&&c.width>=1&&c.height>=1&&c.left>=0&&c.top>=0&&c.left<innerWidth&&c.top<innerHeight&&!i.current.closest(`[inert], [aria-hidden="true"]`),f={owner:e,tab:d?n.id:null,x:Math.max(0,c.left),y:Math.max(0,c.top),width:Math.max(1,Math.min(c.width,innerWidth-c.left)),height:Math.max(1,Math.min(c.height,innerHeight-c.top))},p=JSON.stringify(f);p!==a&&(a=p,s.surface(f).catch(e=>{r||o(e instanceof Error?e.message:`Browser surface unavailable.`)})),performance.now()<l&&(t=requestAnimationFrame(u))},d=()=>{!t&&!r&&(t=requestAnimationFrame(u))},f=()=>{l=performance.now()+500,d()},p=new ResizeObserver(d);p.observe(i.current);let m=new MutationObserver(d);return m.observe(document.body,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`inert`,`aria-hidden`,`data-state`]}),window.addEventListener(`resize`,f),document.addEventListener(`scroll`,d,!0),document.addEventListener(`visibilitychange`,d),document.addEventListener(`transitionrun`,f,!0),f(),()=>{r=!0,cancelAnimationFrame(t),p.disconnect(),m.disconnect(),window.removeEventListener(`resize`,f),document.removeEventListener(`scroll`,d,!0),document.removeEventListener(`visibilitychange`,d),document.removeEventListener(`transitionrun`,f,!0),s.surface({owner:e,tab:null,x:0,y:0,width:1,height:1}).catch(b)}},u=[s,n.id,c],t[0]=c,t[1]=n.id,t[2]=l,t[3]=u):(l=t[2],u=t[3]),(0,_.useEffect)(l,u);let d=r??`100%`,f;t[4]===d?f=t[5]:(f={width:d,maxWidth:`100%`,height:`100%`},t[4]=d,t[5]=f);let p;t[6]!==a||t[7]!==n.id||t[8]!==n.title||t[9]!==n.url?(p=s?a?(0,v.jsx)(`p`,{role:`alert`,className:`p-4 text-sm text-destructive`,children:a}):null:(0,v.jsx)(`iframe`,{title:n.title||`Browser preview`,src:n.url,sandbox:`allow-scripts allow-forms`,referrerPolicy:`no-referrer`,className:`size-full border-0`},n.id+n.url),t[6]=a,t[7]=n.id,t[8]=n.title,t[9]=n.url,t[10]=p):p=t[10];let m;return t[11]!==f||t[12]!==p?(m=(0,v.jsx)(`div`,{className:`flex min-h-0 flex-1 justify-center overflow-hidden bg-muted/30`,children:(0,v.jsx)(`div`,{ref:i,className:`relative min-h-0 bg-white`,style:f,children:p})}),t[11]=f,t[12]=p,t[13]=m):m=t[13],m}function b(){}var x=n(e=>({native:{tabs:[]},fallback:[],selected:{},setNative:t=>e({native:t}),select:(t,n)=>e(e=>({selected:{...e.selected,[t]:n}})),openFallback:(t,n)=>{let r=crypto.randomUUID();return e(e=>({fallback:[...e.fallback,{id:r,project:n,url:t,title:new URL(t).host,loading:!1,canGoBack:!1,canGoForward:!1,zoom:1,presentation:`panel`,error:null}],selected:{...e.selected,[n]:r}})),r},closeFallback:t=>e(e=>({fallback:e.fallback.filter(e=>e.id!==t)})),navigateFallback:(t,n)=>e(e=>({fallback:e.fallback.map(e=>e.id===t?{...e,url:n,title:new URL(n).host}:e)}))})),S=0,C,w=0;function T(e){let t=window.desktopBridge?.browser;(0,_.useEffect)(()=>{if(t){if(S++===0){let e=++w,n=!1;C=t.onState(e=>{n=!0,x.getState().setNative(e)}),t.getState().then(t=>{!n&&S&&e===w&&x.getState().setNative(t)}).catch(()=>{})}return()=>{--S===0&&(w++,C?.(),C=void 0)}}},[t]);let n=x(e=>t?e.native.tabs:e.fallback),r=x(t=>t.selected[e]),i=n.filter(t=>t.project===e||t.project===``);return{tabs:i,selected:i.find(e=>e.id===r)??i[0]??null,api:t}}function E(e,t){return JSON.stringify([e,t])}function D(e){let t=e.trim(),n=new URL(/^[a-z][a-z\d+.-]*:\/\//iu.test(t)?t:`http://${t}`);if(![`http:`,`https:`].includes(n.protocol)||n.username||n.password||!n.hostname)throw Error(`Enter an HTTP(S) URL without embedded credentials.`);return n.href}function O({environmentId:e,cwd:t}){let n=E(e,t),{tabs:a,selected:d,api:g}=T(n),b=(0,_.useRef)(null),[S,C]=(0,_.useState)(``),[w,O]=(0,_.useState)(null),[k,A]=(0,_.useState)(!1),[j,M]=(0,_.useState)(!1),[N,P]=(0,_.useState)(null),F;try{let n=window.desktopBridge?.getLocalEnvironmentBootstrap()?.httpBaseUrl,r=e?o(e):null;n&&r&&new URL(n).origin===new URL(r).origin&&(F=t??void 0)}catch{}let[I,L]=(0,_.useState)([]),[R,z]=(0,_.useState)(!1),B=(0,_.useRef)({generation:0}).current,[V,H]=(0,_.useState)([]),U=j?null:d,W=U===null;(0,_.useEffect)(()=>g?.onFocusAddress(e=>{e===U?.id&&(b.current?.focus(),b.current?.select())}),[g,U?.id]),(0,_.useEffect)(()=>{C(U?.url??``)},[U?.id,U?.url]),(0,_.useEffect)(()=>{M(!1);try{let e=JSON.parse(localStorage.getItem(`ryco:browser-sites:${n}`)??`[]`);H(Array.isArray(e)?e.filter(e=>typeof e==`string`).slice(0,20):[])}catch{H([])}},[n]);let G=async e=>{O(null);try{await e()}catch(e){O(e instanceof Error?e.message:`Browser request failed.`)}},K=(0,_.useCallback)(async()=>{if(!g)return;let e=++B.generation;z(!0);try{let t=await g.discover(F);e===B.generation&&L(t)}catch(t){e===B.generation&&O(t instanceof Error?t.message:`Discovery failed.`)}finally{e===B.generation&&z(!1)}},[g,F,B]);(0,_.useEffect)(()=>(L([]),W&&g&&K(),()=>{B.generation++}),[W,g,K,B,n]);let q=async e=>{let t=D(e);A(!0);try{if(g){let e=await g.open({url:t,project:n});x.getState().select(n,e)}else x.getState().openFallback(t,n);M(!1)}finally{A(!1)}},J=(e,t={})=>{g&&U&&G(()=>g.command({...t,action:e,tab:U.id}))};return(0,v.jsxs)(`section`,{className:`flex min-h-0 flex-1 flex-col`,"aria-label":`Project browser`,children:[(0,v.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1 overflow-x-auto border-b p-1`,role:`tablist`,"aria-label":`Browser tabs`,children:[a.map(e=>(0,v.jsxs)(`div`,{className:`flex min-w-0 max-w-44 shrink-0 items-center rounded bg-muted/40`,children:[(0,v.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":U?.id===e.id,className:`flex min-w-0 items-center gap-1.5 px-2 py-1.5 text-xs`,onClick:()=>{x.getState().select(n,e.id),M(!1)},children:[e.loading?(0,v.jsx)(i,{className:`size-3 shrink-0 animate-spin`}):(0,v.jsx)(l,{className:`size-3 shrink-0`}),(0,v.jsx)(`span`,{className:`truncate`,children:e.title||e.url||`Loading…`})]}),(0,v.jsx)(`button`,{type:`button`,"aria-label":`Close ${e.title||`browser tab`}`,className:`p-1 text-muted-foreground hover:text-foreground`,onClick:()=>void G(()=>g?g.command({action:`close`,tab:e.id}):Promise.resolve(x.getState().closeFallback(e.id))),children:(0,v.jsx)(r,{className:`size-3`})})]},e.id)),(0,v.jsx)(s,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,"aria-label":`New browser tab`,onClick:()=>{M(!0),C(``)},children:(0,v.jsx)(h,{className:`size-3.5`})})]}),(0,v.jsxs)(`form`,{className:`flex shrink-0 items-center gap-1 border-b p-2`,onSubmit:e=>{e.preventDefault(),G(async()=>{if(U){let e=D(S);g?await g.command({action:`navigate`,tab:U.id,url:e}):x.getState().navigateFallback(U.id,e)}else await q(S)})},children:[(0,v.jsx)(s,{type:`button`,variant:`ghost`,size:`icon`,className:`size-7`,"aria-label":`Back`,disabled:!g||!U?.canGoBack,onClick:()=>J(`back`),children:(0,v.jsx)(f,{className:`size-3.5`})}),(0,v.jsx)(s,{type:`button`,variant:`ghost`,size:`icon`,className:`size-7`,"aria-label":`Forward`,disabled:!g||!U?.canGoForward,onClick:()=>J(`forward`),children:(0,v.jsx)(p,{className:`size-3.5`})}),(0,v.jsx)(s,{type:`button`,variant:`ghost`,size:`icon`,className:`size-7`,"aria-label":U?.loading?`Stop loading`:`Reload`,disabled:!g||!U,onClick:()=>J(U?.loading?`stop`:`reload`),children:U?.loading?(0,v.jsx)(r,{className:`size-3.5`}):(0,v.jsx)(c,{className:`size-3.5`})}),(0,v.jsx)(`input`,{ref:b,"aria-label":`Browser address`,className:`h-8 min-w-0 flex-1 rounded-md border bg-background px-2 text-xs`,placeholder:`Enter a URL or localhost:3000`,value:S,onChange:e=>C(e.target.value),onFocus:e=>e.currentTarget.select()}),(0,v.jsx)(s,{type:`submit`,size:`sm`,variant:`outline`,disabled:k,children:`Go`}),(0,v.jsx)(s,{type:`button`,size:`icon`,variant:`ghost`,className:`size-7`,disabled:!U?.url,"aria-label":`Save project URL`,"aria-pressed":!!(U&&V.includes(U.url)),onClick:()=>{if(!U?.url)return;let e=V.includes(U.url)?V.filter(e=>e!==U.url):[U.url,...V].slice(0,20);try{localStorage.setItem(`ryco:browser-sites:${n}`,JSON.stringify(e)),H(e)}catch{O(`Could not save this URL.`)}},children:(0,v.jsx)(m,{className:`size-3.5`})})]}),U?(0,v.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2 border-b px-2 py-1 text-[11px] text-muted-foreground`,children:[(0,v.jsxs)(`select`,{"aria-label":`Browser viewport`,className:`bg-background`,value:N??`auto`,onChange:e=>P(e.target.value===`auto`?null:Number(e.target.value)),children:[(0,v.jsx)(`option`,{value:`auto`,children:`Responsive`}),(0,v.jsx)(`option`,{value:`390`,children:`Phone · 390px`}),(0,v.jsx)(`option`,{value:`768`,children:`Tablet · 768px`}),(0,v.jsx)(`option`,{value:`1280`,children:`Desktop · 1280px`})]}),g?(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(`select`,{"aria-label":`Browser zoom`,className:`bg-background`,value:U.zoom,onChange:e=>J(`zoom`,{zoom:Number(e.target.value)}),children:[.5,.75,1,1.25,1.5,2].map(e=>(0,v.jsxs)(`option`,{value:e,children:[e*100,`%`]},e))}),(0,v.jsx)(`button`,{type:`button`,onClick:()=>J(`devtools`),children:`DevTools`}),(0,v.jsx)(`button`,{type:`button`,onClick:()=>J(`popout`),children:`Pop out`}),(0,v.jsx)(`button`,{type:`button`,onClick:()=>void G(()=>window.desktopBridge?.computerUse?.stop()??Promise.resolve()),children:`Stop agent`})]}):(0,v.jsx)(`span`,{children:`Web preview · sites may restrict embedding`}),(0,v.jsxs)(`a`,{href:U.url,target:`_blank`,rel:`noreferrer`,className:`ml-auto inline-flex items-center gap-1`,"aria-label":`Open in external browser`,children:[(0,v.jsx)(u,{className:`size-3`}),`External`]})]}):null,w||U?.error?(0,v.jsx)(`p`,{role:`alert`,className:`border-b p-2 text-xs text-destructive`,children:w??U?.error}):null,U?U.presentation===`window`?(0,v.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-3 text-sm`,children:[(0,v.jsx)(`p`,{children:`This tab is open in a separate window.`}),(0,v.jsx)(s,{variant:`outline`,onClick:()=>J(`dock`),children:`Bring back into Ryco`})]}):(0,v.jsx)(y,{tab:U,width:N}):(0,v.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto p-5`,children:[(0,v.jsx)(l,{className:`mb-3 size-7 text-muted-foreground`}),(0,v.jsx)(`h3`,{className:`text-sm font-semibold`,children:`Your project, live`}),(0,v.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Enter an address above, or choose a site below. Agents can use these same tabs through Ryco Browser.`}),(0,v.jsx)(`p`,{className:`mt-2 truncate text-[11px] text-muted-foreground`,title:t??void 0,children:t??`No project selected`}),V.length?(0,v.jsxs)(`div`,{className:`mt-5`,children:[(0,v.jsx)(`h4`,{className:`mb-2 text-xs font-medium`,children:`Saved for this project`}),V.map(e=>(0,v.jsx)(`button`,{type:`button`,className:`block w-full truncate rounded px-2 py-2 text-left text-xs hover:bg-accent`,onClick:()=>void G(()=>q(e)),children:e},e))]}):null,(0,v.jsxs)(`div`,{className:`mt-5 flex items-center justify-between`,children:[(0,v.jsx)(`h4`,{className:`text-xs font-medium`,children:`Services on this computer`}),(0,v.jsx)(s,{variant:`ghost`,size:`sm`,disabled:!g||R,onClick:()=>void K(),children:R?`Finding…`:`Refresh`})]}),g?!I.length&&!R?(0,v.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:`No local HTTP services found. Start your project’s dev server, then refresh.`}):I.map(e=>(0,v.jsxs)(`button`,{type:`button`,disabled:k,className:`mt-1 flex w-full items-center justify-between rounded border border-border/60 px-3 py-2 text-left text-xs hover:bg-accent`,onClick:()=>void G(()=>q(e.url)),children:[(0,v.jsx)(`span`,{children:e.url}),(0,v.jsxs)(`span`,{className:`text-muted-foreground`,children:[e.projectMatch?`This project · `:``,e.process]})]},e.url)):(0,v.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:`Local port discovery is available in Ryco desktop. For remote projects, enter a reachable or forwarded URL.`}),k?(0,v.jsx)(`p`,{role:`status`,className:`mt-3 text-xs`,children:`Opening page…`}):null]})]})}export{O as BrowserPanel};