@kaitranntt/ccs 7.50.0 → 7.51.0-dev.4

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 (285) hide show
  1. package/README.md +109 -4
  2. package/config/base-iflow.settings.json +4 -4
  3. package/dist/api/services/index.d.ts +2 -2
  4. package/dist/api/services/index.d.ts.map +1 -1
  5. package/dist/api/services/index.js +2 -1
  6. package/dist/api/services/index.js.map +1 -1
  7. package/dist/api/services/profile-reader.d.ts.map +1 -1
  8. package/dist/api/services/profile-reader.js +13 -0
  9. package/dist/api/services/profile-reader.js.map +1 -1
  10. package/dist/api/services/profile-types.d.ts +9 -0
  11. package/dist/api/services/profile-types.d.ts.map +1 -1
  12. package/dist/api/services/profile-writer.d.ts +8 -2
  13. package/dist/api/services/profile-writer.d.ts.map +1 -1
  14. package/dist/api/services/profile-writer.js +83 -8
  15. package/dist/api/services/profile-writer.js.map +1 -1
  16. package/dist/auth/account-context.d.ts +11 -0
  17. package/dist/auth/account-context.d.ts.map +1 -1
  18. package/dist/auth/account-context.js +42 -8
  19. package/dist/auth/account-context.js.map +1 -1
  20. package/dist/auth/auth-commands.d.ts.map +1 -1
  21. package/dist/auth/auth-commands.js +9 -0
  22. package/dist/auth/auth-commands.js.map +1 -1
  23. package/dist/auth/commands/create-command-env.d.ts +3 -0
  24. package/dist/auth/commands/create-command-env.d.ts.map +1 -0
  25. package/dist/auth/commands/create-command-env.js +55 -0
  26. package/dist/auth/commands/create-command-env.js.map +1 -0
  27. package/dist/auth/commands/create-command.d.ts.map +1 -1
  28. package/dist/auth/commands/create-command.js +136 -30
  29. package/dist/auth/commands/create-command.js.map +1 -1
  30. package/dist/auth/commands/list-command.d.ts.map +1 -1
  31. package/dist/auth/commands/list-command.js +5 -1
  32. package/dist/auth/commands/list-command.js.map +1 -1
  33. package/dist/auth/commands/show-command.d.ts.map +1 -1
  34. package/dist/auth/commands/show-command.js +1 -0
  35. package/dist/auth/commands/show-command.js.map +1 -1
  36. package/dist/auth/commands/types.d.ts +3 -0
  37. package/dist/auth/commands/types.d.ts.map +1 -1
  38. package/dist/auth/commands/types.js +24 -0
  39. package/dist/auth/commands/types.js.map +1 -1
  40. package/dist/auth/profile-detector.d.ts.map +1 -1
  41. package/dist/auth/profile-detector.js +8 -0
  42. package/dist/auth/profile-detector.js.map +1 -1
  43. package/dist/auth/profile-registry.d.ts +2 -0
  44. package/dist/auth/profile-registry.d.ts.map +1 -1
  45. package/dist/auth/profile-registry.js +45 -7
  46. package/dist/auth/profile-registry.js.map +1 -1
  47. package/dist/ccs.js +156 -4
  48. package/dist/ccs.js.map +1 -1
  49. package/dist/cliproxy/account-safety.d.ts.map +1 -1
  50. package/dist/cliproxy/account-safety.js +4 -0
  51. package/dist/cliproxy/account-safety.js.map +1 -1
  52. package/dist/cliproxy/antigravity-responsibility.d.ts +36 -0
  53. package/dist/cliproxy/antigravity-responsibility.d.ts.map +1 -0
  54. package/dist/cliproxy/antigravity-responsibility.js +171 -0
  55. package/dist/cliproxy/antigravity-responsibility.js.map +1 -0
  56. package/dist/cliproxy/auth/auth-types.d.ts +2 -0
  57. package/dist/cliproxy/auth/auth-types.d.ts.map +1 -1
  58. package/dist/cliproxy/auth/oauth-handler.d.ts.map +1 -1
  59. package/dist/cliproxy/auth/oauth-handler.js +18 -0
  60. package/dist/cliproxy/auth/oauth-handler.js.map +1 -1
  61. package/dist/cliproxy/config/env-builder.d.ts.map +1 -1
  62. package/dist/cliproxy/config/env-builder.js +116 -8
  63. package/dist/cliproxy/config/env-builder.js.map +1 -1
  64. package/dist/cliproxy/config/generator.d.ts +3 -1
  65. package/dist/cliproxy/config/generator.d.ts.map +1 -1
  66. package/dist/cliproxy/config/generator.js +26 -8
  67. package/dist/cliproxy/config/generator.js.map +1 -1
  68. package/dist/cliproxy/executor/index.d.ts.map +1 -1
  69. package/dist/cliproxy/executor/index.js +30 -0
  70. package/dist/cliproxy/executor/index.js.map +1 -1
  71. package/dist/cliproxy/model-catalog.d.ts.map +1 -1
  72. package/dist/cliproxy/model-catalog.js +4 -10
  73. package/dist/cliproxy/model-catalog.js.map +1 -1
  74. package/dist/cliproxy/model-config.d.ts.map +1 -1
  75. package/dist/cliproxy/model-config.js +12 -11
  76. package/dist/cliproxy/model-config.js.map +1 -1
  77. package/dist/cliproxy/model-id-normalizer.d.ts +17 -2
  78. package/dist/cliproxy/model-id-normalizer.d.ts.map +1 -1
  79. package/dist/cliproxy/model-id-normalizer.js +54 -7
  80. package/dist/cliproxy/model-id-normalizer.js.map +1 -1
  81. package/dist/cliproxy/services/variant-config-adapter.d.ts +4 -35
  82. package/dist/cliproxy/services/variant-config-adapter.d.ts.map +1 -1
  83. package/dist/cliproxy/services/variant-config-adapter.js +11 -34
  84. package/dist/cliproxy/services/variant-config-adapter.js.map +1 -1
  85. package/dist/cliproxy/services/variant-service.d.ts +5 -1
  86. package/dist/cliproxy/services/variant-service.d.ts.map +1 -1
  87. package/dist/cliproxy/services/variant-service.js +19 -9
  88. package/dist/cliproxy/services/variant-service.js.map +1 -1
  89. package/dist/cliproxy/services/variant-settings.d.ts.map +1 -1
  90. package/dist/cliproxy/services/variant-settings.js +5 -3
  91. package/dist/cliproxy/services/variant-settings.js.map +1 -1
  92. package/dist/cliproxy/sync/profile-mapper.d.ts.map +1 -1
  93. package/dist/cliproxy/sync/profile-mapper.js +14 -2
  94. package/dist/cliproxy/sync/profile-mapper.js.map +1 -1
  95. package/dist/commands/api-command.d.ts +2 -0
  96. package/dist/commands/api-command.d.ts.map +1 -1
  97. package/dist/commands/api-command.js +45 -10
  98. package/dist/commands/api-command.js.map +1 -1
  99. package/dist/commands/cliproxy/auth-subcommand.d.ts.map +1 -1
  100. package/dist/commands/cliproxy/auth-subcommand.js +5 -2
  101. package/dist/commands/cliproxy/auth-subcommand.js.map +1 -1
  102. package/dist/commands/cliproxy/help-subcommand.d.ts.map +1 -1
  103. package/dist/commands/cliproxy/help-subcommand.js +1 -0
  104. package/dist/commands/cliproxy/help-subcommand.js.map +1 -1
  105. package/dist/commands/cliproxy/variant-subcommand.d.ts +15 -0
  106. package/dist/commands/cliproxy/variant-subcommand.d.ts.map +1 -1
  107. package/dist/commands/cliproxy/variant-subcommand.js +144 -15
  108. package/dist/commands/cliproxy/variant-subcommand.js.map +1 -1
  109. package/dist/commands/help-command.d.ts.map +1 -1
  110. package/dist/commands/help-command.js +34 -2
  111. package/dist/commands/help-command.js.map +1 -1
  112. package/dist/config/migration-manager.d.ts.map +1 -1
  113. package/dist/config/migration-manager.js +19 -0
  114. package/dist/config/migration-manager.js.map +1 -1
  115. package/dist/config/unified-config-loader.d.ts +11 -1
  116. package/dist/config/unified-config-loader.d.ts.map +1 -1
  117. package/dist/config/unified-config-loader.js +127 -59
  118. package/dist/config/unified-config-loader.js.map +1 -1
  119. package/dist/config/unified-config-types.d.ts +16 -0
  120. package/dist/config/unified-config-types.d.ts.map +1 -1
  121. package/dist/config/unified-config-types.js +8 -1
  122. package/dist/config/unified-config-types.js.map +1 -1
  123. package/dist/delegation/headless-executor.d.ts.map +1 -1
  124. package/dist/delegation/headless-executor.js +4 -1
  125. package/dist/delegation/headless-executor.js.map +1 -1
  126. package/dist/management/instance-manager.d.ts +1 -0
  127. package/dist/management/instance-manager.d.ts.map +1 -1
  128. package/dist/management/instance-manager.js +14 -8
  129. package/dist/management/instance-manager.js.map +1 -1
  130. package/dist/management/profile-context-sync-lock.d.ts +14 -0
  131. package/dist/management/profile-context-sync-lock.d.ts.map +1 -0
  132. package/dist/management/profile-context-sync-lock.js +174 -0
  133. package/dist/management/profile-context-sync-lock.js.map +1 -0
  134. package/dist/management/shared-manager.d.ts +18 -0
  135. package/dist/management/shared-manager.d.ts.map +1 -1
  136. package/dist/management/shared-manager.js +145 -6
  137. package/dist/management/shared-manager.js.map +1 -1
  138. package/dist/targets/droid-adapter.d.ts +2 -4
  139. package/dist/targets/droid-adapter.d.ts.map +1 -1
  140. package/dist/targets/droid-adapter.js +20 -10
  141. package/dist/targets/droid-adapter.js.map +1 -1
  142. package/dist/targets/droid-command-router.d.ts +26 -0
  143. package/dist/targets/droid-command-router.d.ts.map +1 -0
  144. package/dist/targets/droid-command-router.js +240 -0
  145. package/dist/targets/droid-command-router.js.map +1 -0
  146. package/dist/targets/droid-config-manager.d.ts +9 -1
  147. package/dist/targets/droid-config-manager.d.ts.map +1 -1
  148. package/dist/targets/droid-config-manager.js +134 -6
  149. package/dist/targets/droid-config-manager.js.map +1 -1
  150. package/dist/targets/droid-provider.d.ts +40 -0
  151. package/dist/targets/droid-provider.d.ts.map +1 -0
  152. package/dist/targets/droid-provider.js +140 -0
  153. package/dist/targets/droid-provider.js.map +1 -0
  154. package/dist/targets/droid-reasoning-runtime.d.ts +14 -0
  155. package/dist/targets/droid-reasoning-runtime.d.ts.map +1 -0
  156. package/dist/targets/droid-reasoning-runtime.js +42 -0
  157. package/dist/targets/droid-reasoning-runtime.js.map +1 -0
  158. package/dist/targets/index.d.ts +2 -0
  159. package/dist/targets/index.d.ts.map +1 -1
  160. package/dist/targets/index.js +4 -1
  161. package/dist/targets/index.js.map +1 -1
  162. package/dist/targets/target-adapter.d.ts +6 -0
  163. package/dist/targets/target-adapter.d.ts.map +1 -1
  164. package/dist/targets/target-resolver.d.ts.map +1 -1
  165. package/dist/targets/target-resolver.js +6 -3
  166. package/dist/targets/target-resolver.js.map +1 -1
  167. package/dist/types/config.d.ts +7 -0
  168. package/dist/types/config.d.ts.map +1 -1
  169. package/dist/types/config.js.map +1 -1
  170. package/dist/ui/assets/accounts-Cs_Uohn7.js +1 -0
  171. package/dist/ui/assets/{alert-dialog-YcmZPFim.js → alert-dialog-cRwDSggu.js} +1 -1
  172. package/dist/ui/assets/api-C73W2Hb1.js +1 -0
  173. package/dist/ui/assets/auth-section-DgF431PH.js +1 -0
  174. package/dist/ui/assets/backups-section-9V2yDu_e.js +1 -0
  175. package/dist/ui/assets/{checkbox-Cfg9kbJX.js → checkbox-BeoeEcEZ.js} +1 -1
  176. package/dist/ui/assets/cliproxy-DAlyh7zw.js +3 -0
  177. package/dist/ui/assets/cliproxy-control-panel-CE4y4VDk.js +1 -0
  178. package/dist/ui/assets/{confirm-dialog-CRcV2Yc4.js → confirm-dialog-COTT5ztZ.js} +1 -1
  179. package/dist/ui/assets/copilot-Cm5PT0v6.js +3 -0
  180. package/dist/ui/assets/cursor-DYhCaKbC.js +1 -0
  181. package/dist/ui/assets/droid-eTM2_tVh.js +2 -0
  182. package/dist/ui/assets/{form-utils-C-pVd1--.js → form-utils-Cn_Uld6y.js} +1 -1
  183. package/dist/ui/assets/globalenv-section-Dzt_ECFK.js +1 -0
  184. package/dist/ui/assets/health-Bk8Cj2vi.js +1 -0
  185. package/dist/ui/assets/icons-kPbuhVdj.js +1 -0
  186. package/dist/ui/assets/index-BXDW5hxG.js +1 -0
  187. package/dist/ui/assets/index-CKnNRLzv.js +1 -0
  188. package/dist/ui/assets/index-Ck953xpy.css +1 -0
  189. package/dist/ui/assets/index-D1Gx_G_A.js +1 -0
  190. package/dist/ui/assets/index-hlYFfpDN.js +47 -0
  191. package/dist/ui/assets/index-jqDLGaO4.js +1 -0
  192. package/dist/ui/assets/proxy-status-widget-D-PfDCn1.js +1 -0
  193. package/dist/ui/assets/{radix-ui-DKgfU5rd.js → radix-ui-BR1vy4kf.js} +3 -3
  194. package/dist/ui/assets/{separator-CdOKc0gJ.js → separator-CjXUYlSy.js} +1 -1
  195. package/dist/ui/assets/shared-C9EvhZ8u.js +8 -0
  196. package/dist/ui/assets/{switch-B2ALi24E.js → switch-DFLN6xA0.js} +1 -1
  197. package/dist/ui/assets/{tanstack-5ndrQy-j.js → tanstack-e99Cjjy2.js} +1 -1
  198. package/dist/ui/assets/updates-FcpGeTFg.js +1 -0
  199. package/dist/ui/index.html +6 -6
  200. package/dist/utils/shell-executor.d.ts +5 -0
  201. package/dist/utils/shell-executor.d.ts.map +1 -1
  202. package/dist/utils/shell-executor.js +22 -3
  203. package/dist/utils/shell-executor.js.map +1 -1
  204. package/dist/web-server/model-pricing.d.ts.map +1 -1
  205. package/dist/web-server/model-pricing.js +114 -22
  206. package/dist/web-server/model-pricing.js.map +1 -1
  207. package/dist/web-server/routes/account-route-helpers.d.ts +20 -0
  208. package/dist/web-server/routes/account-route-helpers.d.ts.map +1 -0
  209. package/dist/web-server/routes/account-route-helpers.js +34 -0
  210. package/dist/web-server/routes/account-route-helpers.js.map +1 -0
  211. package/dist/web-server/routes/account-routes.d.ts.map +1 -1
  212. package/dist/web-server/routes/account-routes.js +160 -27
  213. package/dist/web-server/routes/account-routes.js.map +1 -1
  214. package/dist/web-server/routes/cliproxy-auth-routes.d.ts.map +1 -1
  215. package/dist/web-server/routes/cliproxy-auth-routes.js +58 -24
  216. package/dist/web-server/routes/cliproxy-auth-routes.js.map +1 -1
  217. package/dist/web-server/routes/cliproxy-stats-routes.d.ts.map +1 -1
  218. package/dist/web-server/routes/cliproxy-stats-routes.js +22 -3
  219. package/dist/web-server/routes/cliproxy-stats-routes.js.map +1 -1
  220. package/dist/web-server/routes/config-routes.d.ts.map +1 -1
  221. package/dist/web-server/routes/config-routes.js +73 -0
  222. package/dist/web-server/routes/config-routes.js.map +1 -1
  223. package/dist/web-server/routes/droid-routes.d.ts +3 -0
  224. package/dist/web-server/routes/droid-routes.d.ts.map +1 -0
  225. package/dist/web-server/routes/droid-routes.js +61 -0
  226. package/dist/web-server/routes/droid-routes.js.map +1 -0
  227. package/dist/web-server/routes/index.d.ts.map +1 -1
  228. package/dist/web-server/routes/index.js +3 -0
  229. package/dist/web-server/routes/index.js.map +1 -1
  230. package/dist/web-server/routes/profile-routes.d.ts +2 -0
  231. package/dist/web-server/routes/profile-routes.d.ts.map +1 -1
  232. package/dist/web-server/routes/profile-routes.js +86 -6
  233. package/dist/web-server/routes/profile-routes.js.map +1 -1
  234. package/dist/web-server/routes/route-helpers.d.ts +2 -1
  235. package/dist/web-server/routes/route-helpers.d.ts.map +1 -1
  236. package/dist/web-server/routes/route-helpers.js +20 -1
  237. package/dist/web-server/routes/route-helpers.js.map +1 -1
  238. package/dist/web-server/routes/settings-routes.d.ts.map +1 -1
  239. package/dist/web-server/routes/settings-routes.js +168 -39
  240. package/dist/web-server/routes/settings-routes.js.map +1 -1
  241. package/dist/web-server/routes/variant-routes.d.ts +2 -0
  242. package/dist/web-server/routes/variant-routes.d.ts.map +1 -1
  243. package/dist/web-server/routes/variant-routes.js +50 -6
  244. package/dist/web-server/routes/variant-routes.js.map +1 -1
  245. package/dist/web-server/services/compatible-cli-docs-registry.d.ts +23 -0
  246. package/dist/web-server/services/compatible-cli-docs-registry.d.ts.map +1 -0
  247. package/dist/web-server/services/compatible-cli-docs-registry.js +81 -0
  248. package/dist/web-server/services/compatible-cli-docs-registry.js.map +1 -0
  249. package/dist/web-server/services/compatible-cli-json-file-service.d.ts +41 -0
  250. package/dist/web-server/services/compatible-cli-json-file-service.d.ts.map +1 -0
  251. package/dist/web-server/services/compatible-cli-json-file-service.js +205 -0
  252. package/dist/web-server/services/compatible-cli-json-file-service.js.map +1 -0
  253. package/dist/web-server/services/compatible-cli-types.d.ts +82 -0
  254. package/dist/web-server/services/compatible-cli-types.d.ts.map +1 -0
  255. package/dist/web-server/services/compatible-cli-types.js +3 -0
  256. package/dist/web-server/services/compatible-cli-types.js.map +1 -0
  257. package/dist/web-server/services/droid-dashboard-service.d.ts +29 -0
  258. package/dist/web-server/services/droid-dashboard-service.d.ts.map +1 -0
  259. package/dist/web-server/services/droid-dashboard-service.js +238 -0
  260. package/dist/web-server/services/droid-dashboard-service.js.map +1 -0
  261. package/dist/web-server/shared-routes.d.ts.map +1 -1
  262. package/dist/web-server/shared-routes.js +350 -52
  263. package/dist/web-server/shared-routes.js.map +1 -1
  264. package/lib/hooks/websearch-transformer.cjs +78 -52
  265. package/package.json +4 -2
  266. package/scripts/maintainability-check.js +163 -0
  267. package/dist/ui/assets/accounts-DIqClJ7z.js +0 -1
  268. package/dist/ui/assets/api-BWyCgbMh.js +0 -1
  269. package/dist/ui/assets/auth-section-Amm4rwiS.js +0 -1
  270. package/dist/ui/assets/backups-section-DmAsqMfq.js +0 -1
  271. package/dist/ui/assets/cliproxy-B-q7RjS2.js +0 -3
  272. package/dist/ui/assets/cliproxy-control-panel-BliRTkbb.js +0 -1
  273. package/dist/ui/assets/copilot-EarFqUyJ.js +0 -3
  274. package/dist/ui/assets/cursor-Dbe4Wtw2.js +0 -1
  275. package/dist/ui/assets/globalenv-section-CBp73q9k.js +0 -1
  276. package/dist/ui/assets/health-Cvr359ff.js +0 -1
  277. package/dist/ui/assets/icons-DGASzt3M.js +0 -1
  278. package/dist/ui/assets/index-8n-yIlea.js +0 -47
  279. package/dist/ui/assets/index-B5aulDs4.js +0 -1
  280. package/dist/ui/assets/index-BBCDm6dS.css +0 -1
  281. package/dist/ui/assets/index-CLBNUja8.js +0 -1
  282. package/dist/ui/assets/index-Cp8K9_TQ.js +0 -1
  283. package/dist/ui/assets/index-DTDftvd-.js +0 -1
  284. package/dist/ui/assets/proxy-status-widget-C0G0aOCW.js +0 -1
  285. package/dist/ui/assets/shared-zsUXmES2.js +0 -1
@@ -17,4 +17,4 @@ import{c as P}from"./react-vendor-CNOkPC89.js";var xe=e=>e.type==="checkbox",_e=
17
17
  newResult[${$}] = ${Z}.value;
18
18
  }
19
19
 
20
- `)}O.write("payload.value = newResult;"),O.write("return payload;");const z=O.compile();return(R,Z)=>z(m,R,Z)};let s;const i=Le,a=!yr.jitless,_=a&&vn.value,y=t.catchall;let k;e._zod.parse=(m,O)=>{k??(k=n.value);const I=m.value;return i(I)?a&&_&&O?.async===!1&&O.jitless!==!0?(s||(s=o(t.shape)),m=s(m,O),y?Or([],I,m,O,k,e):m):r(m,O):(m.issues.push({expected:"object",code:"invalid_type",input:I,inst:e}),m)}});function Ht(e,t,r,n){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const o=e.filter(s=>!ze(s));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(s=>s.issues.map(i=>me(i,n,ge())))}),t)}const Yo=f("$ZodUnion",(e,t)=>{M.init(e,t),S(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),S(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),S(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),S(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>vt(s.source)).join("|")})$`)}});const r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(o,s)=>{if(r)return n(o,s);let i=!1;const a=[];for(const p of t.options){const _=p._zod.run({value:o.value,issues:[]},s);if(_ instanceof Promise)a.push(_),i=!0;else{if(_.issues.length===0)return _;a.push(_)}}return i?Promise.all(a).then(p=>Ht(p,o,e,s)):Ht(a,o,e,s)}}),Qo=f("$ZodIntersection",(e,t)=>{M.init(e,t),e._zod.parse=(r,n)=>{const o=r.value,s=t.left._zod.run({value:o,issues:[]},n),i=t.right._zod.run({value:o,issues:[]},n);return s instanceof Promise||i instanceof Promise?Promise.all([s,i]).then(([p,_])=>Gt(r,p,_)):Gt(r,s,i)}});function at(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Oe(e)&&Oe(t)){const r=Object.keys(t),n=Object.keys(e).filter(s=>r.indexOf(s)!==-1),o={...e,...t};for(const s of n){const i=at(e[s],t[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};o[s]=i.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let n=0;n<e.length;n++){const o=e[n],s=t[n],i=at(o,s);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};r.push(i.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Gt(e,t,r){if(t.issues.length&&e.issues.push(...t.issues),r.issues.length&&e.issues.push(...r.issues),ze(e))return e;const n=at(t.value,r.value);if(!n.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(n.mergeErrorPath)}`);return e.value=n.data,e}const es=f("$ZodEnum",(e,t)=>{M.init(e,t);const r=gn(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(o=>yn.has(typeof o)).map(o=>typeof o=="string"?We(o):o.toString()).join("|")})$`),e._zod.parse=(o,s)=>{const i=o.value;return n.has(i)||o.issues.push({code:"invalid_value",values:r,input:i,inst:e}),o}}),ts=f("$ZodTransform",(e,t)=>{M.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new vr(e.constructor.name);const o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(i=>(r.value=i,r));if(o instanceof Promise)throw new Ze;return r.value=o,r}});function Xt(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const rs=f("$ZodOptional",(e,t)=>{M.init(e,t),e._zod.optin="optional",e._zod.optout="optional",S(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),S(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${vt(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>Xt(s,r.value)):Xt(o,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}}),ns=f("$ZodNullable",(e,t)=>{M.init(e,t),S(e._zod,"optin",()=>t.innerType._zod.optin),S(e._zod,"optout",()=>t.innerType._zod.optout),S(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${vt(r.source)}|null)$`):void 0}),S(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)}),os=f("$ZodDefault",(e,t)=>{M.init(e,t),e._zod.optin="optional",S(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)return r.value=t.defaultValue,r;const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>Yt(s,t)):Yt(o,t)}});function Yt(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const ss=f("$ZodPrefault",(e,t)=>{M.init(e,t),e._zod.optin="optional",S(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,n))}),is=f("$ZodNonOptional",(e,t)=>{M.init(e,t),S(e._zod,"values",()=>{const r=t.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),e._zod.parse=(r,n)=>{const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>Qt(s,e)):Qt(o,e)}});function Qt(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const us=f("$ZodCatch",(e,t)=>{M.init(e,t),S(e._zod,"optin",()=>t.innerType._zod.optin),S(e._zod,"optout",()=>t.innerType._zod.optout),S(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>(r.value=s.value,s.issues.length&&(r.value=t.catchValue({...r,error:{issues:s.issues.map(i=>me(i,n,ge()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=t.catchValue({...r,error:{issues:o.issues.map(s=>me(s,n,ge()))},input:r.value}),r.issues=[]),r)}}),cs=f("$ZodPipe",(e,t)=>{M.init(e,t),S(e._zod,"values",()=>t.in._zod.values),S(e._zod,"optin",()=>t.in._zod.optin),S(e._zod,"optout",()=>t.out._zod.optout),S(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){const s=t.out._zod.run(r,n);return s instanceof Promise?s.then(i=>Te(i,t.in,n)):Te(s,t.in,n)}const o=t.in._zod.run(r,n);return o instanceof Promise?o.then(s=>Te(s,t.out,n)):Te(o,t.out,n)}});function Te(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}const as=f("$ZodReadonly",(e,t)=>{M.init(e,t),S(e._zod,"propValues",()=>t.innerType._zod.propValues),S(e._zod,"values",()=>t.innerType._zod.values),S(e._zod,"optin",()=>t.innerType?._zod?.optin),S(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(er):er(o)}});function er(e){return e.value=Object.freeze(e.value),e}const ls=f("$ZodCustom",(e,t)=>{ue.init(e,t),M.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{const n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(s=>tr(s,r,n,e));tr(o,r,n,e)}});function tr(e,t,r,n){if(!e){const o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),t.issues.push(Ve(o))}}var rr;class fs{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){const n=r[0];if(this._map.set(t,n),n&&typeof n=="object"&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,t)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){const r=t._zod.parent;if(r){const n={...this.get(r)??{}};delete n.id;const o={...n,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function ds(){return new fs}(rr=globalThis).__zod_globalRegistry??(rr.__zod_globalRegistry=ds());const Ce=globalThis.__zod_globalRegistry;function hs(e,t){return new e({type:"string",...b(t)})}function ps(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...b(t)})}function nr(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...b(t)})}function _s(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...b(t)})}function gs(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...b(t)})}function ms(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...b(t)})}function vs(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...b(t)})}function ys(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...b(t)})}function ws(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...b(t)})}function bs(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...b(t)})}function ks(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...b(t)})}function zs(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...b(t)})}function Zs(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...b(t)})}function $s(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...b(t)})}function As(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...b(t)})}function Es(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...b(t)})}function Fs(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...b(t)})}function Ds(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...b(t)})}function Os(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...b(t)})}function Vs(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...b(t)})}function xs(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...b(t)})}function Ss(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...b(t)})}function Is(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...b(t)})}function Ps(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...b(t)})}function Ts(e,t){return new e({type:"string",format:"date",check:"string_format",...b(t)})}function Cs(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...b(t)})}function Rs(e,t){return new e({type:"string",format:"duration",check:"string_format",...b(t)})}function Us(e){return new e({type:"unknown"})}function js(e,t){return new e({type:"never",...b(t)})}function Vr(e,t){return new ao({check:"max_length",...b(t),maximum:e})}function Me(e,t){return new lo({check:"min_length",...b(t),minimum:e})}function xr(e,t){return new fo({check:"length_equals",...b(t),length:e})}function Ls(e,t){return new ho({check:"string_format",format:"regex",...b(t),pattern:e})}function Ns(e){return new po({check:"string_format",format:"lowercase",...b(e)})}function Ms(e){return new _o({check:"string_format",format:"uppercase",...b(e)})}function Bs(e,t){return new go({check:"string_format",format:"includes",...b(t),includes:e})}function Ws(e,t){return new mo({check:"string_format",format:"starts_with",...b(t),prefix:e})}function qs(e,t){return new vo({check:"string_format",format:"ends_with",...b(t),suffix:e})}function $e(e){return new yo({check:"overwrite",tx:e})}function Js(e){return $e(t=>t.normalize(e))}function Ks(){return $e(e=>e.trim())}function Hs(){return $e(e=>e.toLowerCase())}function Gs(){return $e(e=>e.toUpperCase())}function Xs(){return $e(e=>mn(e))}function Ys(e,t,r){return new e({type:"array",element:t,...b(r)})}function Qs(e,t,r){return new e({type:"custom",check:"custom",fn:t,...b(r)})}function ei(e){const t=ti(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(Ve(n,r.value,t._zod.def));else{const o=n;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=r.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),r.issues.push(Ve(o))}},e(r.value,r)));return t}function ti(e,t){const r=new ue({check:"custom",...b(t)});return r._zod.check=e,r}const ri=f("ZodISODateTime",(e,t)=>{So.init(e,t),C.init(e,t)});function ni(e){return Ps(ri,e)}const oi=f("ZodISODate",(e,t)=>{Io.init(e,t),C.init(e,t)});function si(e){return Ts(oi,e)}const ii=f("ZodISOTime",(e,t)=>{Po.init(e,t),C.init(e,t)});function ui(e){return Cs(ii,e)}const ci=f("ZodISODuration",(e,t)=>{To.init(e,t),C.init(e,t)});function ai(e){return Rs(ci,e)}const li=(e,t)=>{Zr.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>Dn(e,r)},flatten:{value:r=>Fn(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,ct,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,ct,2)}},isEmpty:{get(){return e.issues.length===0}}})},Q=f("ZodError",li,{Parent:Error}),fi=Je(Q),di=Ke(Q),hi=He(Q),pi=Ge(Q),_i=xn(Q),gi=Sn(Q),mi=In(Q),vi=Pn(Q),yi=Tn(Q),wi=Cn(Q),bi=Rn(Q),ki=Un(Q),W=f("ZodType",(e,t)=>(M.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(ye(t,{checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]})),e.clone=(r,n)=>he(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.parse=(r,n)=>fi(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>hi(e,r,n),e.parseAsync=async(r,n)=>di(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>pi(e,r,n),e.spa=e.safeParseAsync,e.encode=(r,n)=>_i(e,r,n),e.decode=(r,n)=>gi(e,r,n),e.encodeAsync=async(r,n)=>mi(e,r,n),e.decodeAsync=async(r,n)=>vi(e,r,n),e.safeEncode=(r,n)=>yi(e,r,n),e.safeDecode=(r,n)=>wi(e,r,n),e.safeEncodeAsync=async(r,n)=>bi(e,r,n),e.safeDecodeAsync=async(r,n)=>ki(e,r,n),e.refine=(r,n)=>e.check(du(r,n)),e.superRefine=r=>e.check(hu(r)),e.overwrite=r=>e.check($e(r)),e.optional=()=>ir(e),e.nullable=()=>ur(e),e.nullish=()=>ir(ur(e)),e.nonoptional=r=>su(e,r),e.array=()=>Wi(e),e.or=r=>Ki([e,r]),e.and=r=>Gi(e,r),e.transform=r=>cr(e,Qi(r)),e.default=r=>ru(e,r),e.prefault=r=>ou(e,r),e.catch=r=>uu(e,r),e.pipe=r=>cr(e,r),e.readonly=()=>lu(e),e.describe=r=>{const n=e.clone();return Ce.add(n,{description:r}),n},Object.defineProperty(e,"description",{get(){return Ce.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return Ce.get(e);const n=e.clone();return Ce.add(n,r[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Sr=f("_ZodString",(e,t)=>{wt.init(e,t),W.init(e,t);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...n)=>e.check(Ls(...n)),e.includes=(...n)=>e.check(Bs(...n)),e.startsWith=(...n)=>e.check(Ws(...n)),e.endsWith=(...n)=>e.check(qs(...n)),e.min=(...n)=>e.check(Me(...n)),e.max=(...n)=>e.check(Vr(...n)),e.length=(...n)=>e.check(xr(...n)),e.nonempty=(...n)=>e.check(Me(1,...n)),e.lowercase=n=>e.check(Ns(n)),e.uppercase=n=>e.check(Ms(n)),e.trim=()=>e.check(Ks()),e.normalize=(...n)=>e.check(Js(...n)),e.toLowerCase=()=>e.check(Hs()),e.toUpperCase=()=>e.check(Gs()),e.slugify=()=>e.check(Xs())}),zi=f("ZodString",(e,t)=>{wt.init(e,t),Sr.init(e,t),e.email=r=>e.check(ps(Zi,r)),e.url=r=>e.check(ys($i,r)),e.jwt=r=>e.check(Is(ji,r)),e.emoji=r=>e.check(ws(Ai,r)),e.guid=r=>e.check(nr(or,r)),e.uuid=r=>e.check(_s(Re,r)),e.uuidv4=r=>e.check(gs(Re,r)),e.uuidv6=r=>e.check(ms(Re,r)),e.uuidv7=r=>e.check(vs(Re,r)),e.nanoid=r=>e.check(bs(Ei,r)),e.guid=r=>e.check(nr(or,r)),e.cuid=r=>e.check(ks(Fi,r)),e.cuid2=r=>e.check(zs(Di,r)),e.ulid=r=>e.check(Zs(Oi,r)),e.base64=r=>e.check(Vs(Ci,r)),e.base64url=r=>e.check(xs(Ri,r)),e.xid=r=>e.check($s(Vi,r)),e.ksuid=r=>e.check(As(xi,r)),e.ipv4=r=>e.check(Es(Si,r)),e.ipv6=r=>e.check(Fs(Ii,r)),e.cidrv4=r=>e.check(Ds(Pi,r)),e.cidrv6=r=>e.check(Os(Ti,r)),e.e164=r=>e.check(Ss(Ui,r)),e.datetime=r=>e.check(ni(r)),e.date=r=>e.check(si(r)),e.time=r=>e.check(ui(r)),e.duration=r=>e.check(ai(r))});function bu(e){return hs(zi,e)}const C=f("ZodStringFormat",(e,t)=>{T.init(e,t),Sr.init(e,t)}),Zi=f("ZodEmail",(e,t)=>{Zo.init(e,t),C.init(e,t)}),or=f("ZodGUID",(e,t)=>{ko.init(e,t),C.init(e,t)}),Re=f("ZodUUID",(e,t)=>{zo.init(e,t),C.init(e,t)}),$i=f("ZodURL",(e,t)=>{$o.init(e,t),C.init(e,t)}),Ai=f("ZodEmoji",(e,t)=>{Ao.init(e,t),C.init(e,t)}),Ei=f("ZodNanoID",(e,t)=>{Eo.init(e,t),C.init(e,t)}),Fi=f("ZodCUID",(e,t)=>{Fo.init(e,t),C.init(e,t)}),Di=f("ZodCUID2",(e,t)=>{Do.init(e,t),C.init(e,t)}),Oi=f("ZodULID",(e,t)=>{Oo.init(e,t),C.init(e,t)}),Vi=f("ZodXID",(e,t)=>{Vo.init(e,t),C.init(e,t)}),xi=f("ZodKSUID",(e,t)=>{xo.init(e,t),C.init(e,t)}),Si=f("ZodIPv4",(e,t)=>{Co.init(e,t),C.init(e,t)}),Ii=f("ZodIPv6",(e,t)=>{Ro.init(e,t),C.init(e,t)}),Pi=f("ZodCIDRv4",(e,t)=>{Uo.init(e,t),C.init(e,t)}),Ti=f("ZodCIDRv6",(e,t)=>{jo.init(e,t),C.init(e,t)}),Ci=f("ZodBase64",(e,t)=>{Lo.init(e,t),C.init(e,t)}),Ri=f("ZodBase64URL",(e,t)=>{Mo.init(e,t),C.init(e,t)}),Ui=f("ZodE164",(e,t)=>{Bo.init(e,t),C.init(e,t)}),ji=f("ZodJWT",(e,t)=>{qo.init(e,t),C.init(e,t)}),Li=f("ZodUnknown",(e,t)=>{Jo.init(e,t),W.init(e,t)});function sr(){return Us(Li)}const Ni=f("ZodNever",(e,t)=>{Ko.init(e,t),W.init(e,t)});function Mi(e){return js(Ni,e)}const Bi=f("ZodArray",(e,t)=>{Ho.init(e,t),W.init(e,t),e.element=t.element,e.min=(r,n)=>e.check(Me(r,n)),e.nonempty=r=>e.check(Me(1,r)),e.max=(r,n)=>e.check(Vr(r,n)),e.length=(r,n)=>e.check(xr(r,n)),e.unwrap=()=>e.element});function Wi(e,t){return Ys(Bi,e,t)}const qi=f("ZodObject",(e,t)=>{Xo.init(e,t),W.init(e,t),S(e,"shape",()=>t.shape),e.keyof=()=>Xi(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:sr()}),e.loose=()=>e.clone({...e._zod.def,catchall:sr()}),e.strict=()=>e.clone({...e._zod.def,catchall:Mi()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>zn(e,r),e.safeExtend=r=>Zn(e,r),e.merge=r=>$n(e,r),e.pick=r=>bn(e,r),e.omit=r=>kn(e,r),e.partial=(...r)=>An(Ir,e,r[0]),e.required=(...r)=>En(Pr,e,r[0])});function ku(e,t){const r={type:"object",shape:e??{},...b(t)};return new qi(r)}const Ji=f("ZodUnion",(e,t)=>{Yo.init(e,t),W.init(e,t),e.options=t.options});function Ki(e,t){return new Ji({type:"union",options:e,...b(t)})}const Hi=f("ZodIntersection",(e,t)=>{Qo.init(e,t),W.init(e,t)});function Gi(e,t){return new Hi({type:"intersection",left:e,right:t})}const lt=f("ZodEnum",(e,t)=>{es.init(e,t),W.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(n,o)=>{const s={};for(const i of n)if(r.has(i))s[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new lt({...t,checks:[],...b(o),entries:s})},e.exclude=(n,o)=>{const s={...t.entries};for(const i of n)if(r.has(i))delete s[i];else throw new Error(`Key ${i} not found in enum`);return new lt({...t,checks:[],...b(o),entries:s})}});function Xi(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new lt({type:"enum",entries:r,...b(t)})}const Yi=f("ZodTransform",(e,t)=>{ts.init(e,t),W.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new vr(e.constructor.name);r.addIssue=s=>{if(typeof s=="string")r.issues.push(Ve(s,r.value,t));else{const i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=r.value),i.inst??(i.inst=e),r.issues.push(Ve(i))}};const o=t.transform(r.value,r);return o instanceof Promise?o.then(s=>(r.value=s,r)):(r.value=o,r)}});function Qi(e){return new Yi({type:"transform",transform:e})}const Ir=f("ZodOptional",(e,t)=>{rs.init(e,t),W.init(e,t),e.unwrap=()=>e._zod.def.innerType});function ir(e){return new Ir({type:"optional",innerType:e})}const eu=f("ZodNullable",(e,t)=>{ns.init(e,t),W.init(e,t),e.unwrap=()=>e._zod.def.innerType});function ur(e){return new eu({type:"nullable",innerType:e})}const tu=f("ZodDefault",(e,t)=>{os.init(e,t),W.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function ru(e,t){return new tu({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():br(t)}})}const nu=f("ZodPrefault",(e,t)=>{ss.init(e,t),W.init(e,t),e.unwrap=()=>e._zod.def.innerType});function ou(e,t){return new nu({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():br(t)}})}const Pr=f("ZodNonOptional",(e,t)=>{is.init(e,t),W.init(e,t),e.unwrap=()=>e._zod.def.innerType});function su(e,t){return new Pr({type:"nonoptional",innerType:e,...b(t)})}const iu=f("ZodCatch",(e,t)=>{us.init(e,t),W.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function uu(e,t){return new iu({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const cu=f("ZodPipe",(e,t)=>{cs.init(e,t),W.init(e,t),e.in=t.in,e.out=t.out});function cr(e,t){return new cu({type:"pipe",in:e,out:t})}const au=f("ZodReadonly",(e,t)=>{as.init(e,t),W.init(e,t),e.unwrap=()=>e._zod.def.innerType});function lu(e){return new au({type:"readonly",innerType:e})}const fu=f("ZodCustom",(e,t)=>{ls.init(e,t),W.init(e,t)});function du(e,t={}){return Qs(fu,e,t)}function hu(e){return ei(e)}export{Zr as $,wu as a,Yr as b,ku as c,bu as d,gu as e,pn as o,yu as p,vu as s,mu as u};
20
+ `)}O.write("payload.value = newResult;"),O.write("return payload;");const z=O.compile();return(R,Z)=>z(m,R,Z)};let s;const i=Le,a=!yr.jitless,_=a&&vn.value,y=t.catchall;let k;e._zod.parse=(m,O)=>{k??(k=n.value);const I=m.value;return i(I)?a&&_&&O?.async===!1&&O.jitless!==!0?(s||(s=o(t.shape)),m=s(m,O),y?Or([],I,m,O,k,e):m):r(m,O):(m.issues.push({expected:"object",code:"invalid_type",input:I,inst:e}),m)}});function Ht(e,t,r,n){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const o=e.filter(s=>!ze(s));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(s=>s.issues.map(i=>me(i,n,ge())))}),t)}const Yo=f("$ZodUnion",(e,t)=>{M.init(e,t),S(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),S(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),S(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),S(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>vt(s.source)).join("|")})$`)}});const r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(o,s)=>{if(r)return n(o,s);let i=!1;const a=[];for(const p of t.options){const _=p._zod.run({value:o.value,issues:[]},s);if(_ instanceof Promise)a.push(_),i=!0;else{if(_.issues.length===0)return _;a.push(_)}}return i?Promise.all(a).then(p=>Ht(p,o,e,s)):Ht(a,o,e,s)}}),Qo=f("$ZodIntersection",(e,t)=>{M.init(e,t),e._zod.parse=(r,n)=>{const o=r.value,s=t.left._zod.run({value:o,issues:[]},n),i=t.right._zod.run({value:o,issues:[]},n);return s instanceof Promise||i instanceof Promise?Promise.all([s,i]).then(([p,_])=>Gt(r,p,_)):Gt(r,s,i)}});function at(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Oe(e)&&Oe(t)){const r=Object.keys(t),n=Object.keys(e).filter(s=>r.indexOf(s)!==-1),o={...e,...t};for(const s of n){const i=at(e[s],t[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};o[s]=i.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let n=0;n<e.length;n++){const o=e[n],s=t[n],i=at(o,s);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};r.push(i.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Gt(e,t,r){if(t.issues.length&&e.issues.push(...t.issues),r.issues.length&&e.issues.push(...r.issues),ze(e))return e;const n=at(t.value,r.value);if(!n.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(n.mergeErrorPath)}`);return e.value=n.data,e}const es=f("$ZodEnum",(e,t)=>{M.init(e,t);const r=gn(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(o=>yn.has(typeof o)).map(o=>typeof o=="string"?We(o):o.toString()).join("|")})$`),e._zod.parse=(o,s)=>{const i=o.value;return n.has(i)||o.issues.push({code:"invalid_value",values:r,input:i,inst:e}),o}}),ts=f("$ZodTransform",(e,t)=>{M.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new vr(e.constructor.name);const o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(i=>(r.value=i,r));if(o instanceof Promise)throw new Ze;return r.value=o,r}});function Xt(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const rs=f("$ZodOptional",(e,t)=>{M.init(e,t),e._zod.optin="optional",e._zod.optout="optional",S(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),S(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${vt(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>Xt(s,r.value)):Xt(o,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}}),ns=f("$ZodNullable",(e,t)=>{M.init(e,t),S(e._zod,"optin",()=>t.innerType._zod.optin),S(e._zod,"optout",()=>t.innerType._zod.optout),S(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${vt(r.source)}|null)$`):void 0}),S(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)}),os=f("$ZodDefault",(e,t)=>{M.init(e,t),e._zod.optin="optional",S(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)return r.value=t.defaultValue,r;const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>Yt(s,t)):Yt(o,t)}});function Yt(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const ss=f("$ZodPrefault",(e,t)=>{M.init(e,t),e._zod.optin="optional",S(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,n))}),is=f("$ZodNonOptional",(e,t)=>{M.init(e,t),S(e._zod,"values",()=>{const r=t.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),e._zod.parse=(r,n)=>{const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>Qt(s,e)):Qt(o,e)}});function Qt(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const us=f("$ZodCatch",(e,t)=>{M.init(e,t),S(e._zod,"optin",()=>t.innerType._zod.optin),S(e._zod,"optout",()=>t.innerType._zod.optout),S(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>(r.value=s.value,s.issues.length&&(r.value=t.catchValue({...r,error:{issues:s.issues.map(i=>me(i,n,ge()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=t.catchValue({...r,error:{issues:o.issues.map(s=>me(s,n,ge()))},input:r.value}),r.issues=[]),r)}}),cs=f("$ZodPipe",(e,t)=>{M.init(e,t),S(e._zod,"values",()=>t.in._zod.values),S(e._zod,"optin",()=>t.in._zod.optin),S(e._zod,"optout",()=>t.out._zod.optout),S(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){const s=t.out._zod.run(r,n);return s instanceof Promise?s.then(i=>Te(i,t.in,n)):Te(s,t.in,n)}const o=t.in._zod.run(r,n);return o instanceof Promise?o.then(s=>Te(s,t.out,n)):Te(o,t.out,n)}});function Te(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}const as=f("$ZodReadonly",(e,t)=>{M.init(e,t),S(e._zod,"propValues",()=>t.innerType._zod.propValues),S(e._zod,"values",()=>t.innerType._zod.values),S(e._zod,"optin",()=>t.innerType?._zod?.optin),S(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(er):er(o)}});function er(e){return e.value=Object.freeze(e.value),e}const ls=f("$ZodCustom",(e,t)=>{ue.init(e,t),M.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{const n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(s=>tr(s,r,n,e));tr(o,r,n,e)}});function tr(e,t,r,n){if(!e){const o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),t.issues.push(Ve(o))}}var rr;class fs{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){const n=r[0];if(this._map.set(t,n),n&&typeof n=="object"&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,t)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){const r=t._zod.parent;if(r){const n={...this.get(r)??{}};delete n.id;const o={...n,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function ds(){return new fs}(rr=globalThis).__zod_globalRegistry??(rr.__zod_globalRegistry=ds());const Ce=globalThis.__zod_globalRegistry;function hs(e,t){return new e({type:"string",...b(t)})}function ps(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...b(t)})}function nr(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...b(t)})}function _s(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...b(t)})}function gs(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...b(t)})}function ms(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...b(t)})}function vs(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...b(t)})}function ys(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...b(t)})}function ws(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...b(t)})}function bs(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...b(t)})}function ks(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...b(t)})}function zs(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...b(t)})}function Zs(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...b(t)})}function $s(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...b(t)})}function As(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...b(t)})}function Es(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...b(t)})}function Fs(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...b(t)})}function Ds(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...b(t)})}function Os(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...b(t)})}function Vs(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...b(t)})}function xs(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...b(t)})}function Ss(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...b(t)})}function Is(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...b(t)})}function Ps(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...b(t)})}function Ts(e,t){return new e({type:"string",format:"date",check:"string_format",...b(t)})}function Cs(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...b(t)})}function Rs(e,t){return new e({type:"string",format:"duration",check:"string_format",...b(t)})}function Us(e){return new e({type:"unknown"})}function js(e,t){return new e({type:"never",...b(t)})}function Vr(e,t){return new ao({check:"max_length",...b(t),maximum:e})}function Me(e,t){return new lo({check:"min_length",...b(t),minimum:e})}function xr(e,t){return new fo({check:"length_equals",...b(t),length:e})}function Ls(e,t){return new ho({check:"string_format",format:"regex",...b(t),pattern:e})}function Ns(e){return new po({check:"string_format",format:"lowercase",...b(e)})}function Ms(e){return new _o({check:"string_format",format:"uppercase",...b(e)})}function Bs(e,t){return new go({check:"string_format",format:"includes",...b(t),includes:e})}function Ws(e,t){return new mo({check:"string_format",format:"starts_with",...b(t),prefix:e})}function qs(e,t){return new vo({check:"string_format",format:"ends_with",...b(t),suffix:e})}function $e(e){return new yo({check:"overwrite",tx:e})}function Js(e){return $e(t=>t.normalize(e))}function Ks(){return $e(e=>e.trim())}function Hs(){return $e(e=>e.toLowerCase())}function Gs(){return $e(e=>e.toUpperCase())}function Xs(){return $e(e=>mn(e))}function Ys(e,t,r){return new e({type:"array",element:t,...b(r)})}function Qs(e,t,r){return new e({type:"custom",check:"custom",fn:t,...b(r)})}function ei(e){const t=ti(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(Ve(n,r.value,t._zod.def));else{const o=n;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=r.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),r.issues.push(Ve(o))}},e(r.value,r)));return t}function ti(e,t){const r=new ue({check:"custom",...b(t)});return r._zod.check=e,r}const ri=f("ZodISODateTime",(e,t)=>{So.init(e,t),C.init(e,t)});function ni(e){return Ps(ri,e)}const oi=f("ZodISODate",(e,t)=>{Io.init(e,t),C.init(e,t)});function si(e){return Ts(oi,e)}const ii=f("ZodISOTime",(e,t)=>{Po.init(e,t),C.init(e,t)});function ui(e){return Cs(ii,e)}const ci=f("ZodISODuration",(e,t)=>{To.init(e,t),C.init(e,t)});function ai(e){return Rs(ci,e)}const li=(e,t)=>{Zr.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>Dn(e,r)},flatten:{value:r=>Fn(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,ct,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,ct,2)}},isEmpty:{get(){return e.issues.length===0}}})},Q=f("ZodError",li,{Parent:Error}),fi=Je(Q),di=Ke(Q),hi=He(Q),pi=Ge(Q),_i=xn(Q),gi=Sn(Q),mi=In(Q),vi=Pn(Q),yi=Tn(Q),wi=Cn(Q),bi=Rn(Q),ki=Un(Q),W=f("ZodType",(e,t)=>(M.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(ye(t,{checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]})),e.clone=(r,n)=>he(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.parse=(r,n)=>fi(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>hi(e,r,n),e.parseAsync=async(r,n)=>di(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>pi(e,r,n),e.spa=e.safeParseAsync,e.encode=(r,n)=>_i(e,r,n),e.decode=(r,n)=>gi(e,r,n),e.encodeAsync=async(r,n)=>mi(e,r,n),e.decodeAsync=async(r,n)=>vi(e,r,n),e.safeEncode=(r,n)=>yi(e,r,n),e.safeDecode=(r,n)=>wi(e,r,n),e.safeEncodeAsync=async(r,n)=>bi(e,r,n),e.safeDecodeAsync=async(r,n)=>ki(e,r,n),e.refine=(r,n)=>e.check(du(r,n)),e.superRefine=r=>e.check(hu(r)),e.overwrite=r=>e.check($e(r)),e.optional=()=>ir(e),e.nullable=()=>ur(e),e.nullish=()=>ir(ur(e)),e.nonoptional=r=>su(e,r),e.array=()=>Wi(e),e.or=r=>Ki([e,r]),e.and=r=>Gi(e,r),e.transform=r=>cr(e,Qi(r)),e.default=r=>ru(e,r),e.prefault=r=>ou(e,r),e.catch=r=>uu(e,r),e.pipe=r=>cr(e,r),e.readonly=()=>lu(e),e.describe=r=>{const n=e.clone();return Ce.add(n,{description:r}),n},Object.defineProperty(e,"description",{get(){return Ce.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return Ce.get(e);const n=e.clone();return Ce.add(n,r[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Sr=f("_ZodString",(e,t)=>{wt.init(e,t),W.init(e,t);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...n)=>e.check(Ls(...n)),e.includes=(...n)=>e.check(Bs(...n)),e.startsWith=(...n)=>e.check(Ws(...n)),e.endsWith=(...n)=>e.check(qs(...n)),e.min=(...n)=>e.check(Me(...n)),e.max=(...n)=>e.check(Vr(...n)),e.length=(...n)=>e.check(xr(...n)),e.nonempty=(...n)=>e.check(Me(1,...n)),e.lowercase=n=>e.check(Ns(n)),e.uppercase=n=>e.check(Ms(n)),e.trim=()=>e.check(Ks()),e.normalize=(...n)=>e.check(Js(...n)),e.toLowerCase=()=>e.check(Hs()),e.toUpperCase=()=>e.check(Gs()),e.slugify=()=>e.check(Xs())}),zi=f("ZodString",(e,t)=>{wt.init(e,t),Sr.init(e,t),e.email=r=>e.check(ps(Zi,r)),e.url=r=>e.check(ys($i,r)),e.jwt=r=>e.check(Is(ji,r)),e.emoji=r=>e.check(ws(Ai,r)),e.guid=r=>e.check(nr(or,r)),e.uuid=r=>e.check(_s(Re,r)),e.uuidv4=r=>e.check(gs(Re,r)),e.uuidv6=r=>e.check(ms(Re,r)),e.uuidv7=r=>e.check(vs(Re,r)),e.nanoid=r=>e.check(bs(Ei,r)),e.guid=r=>e.check(nr(or,r)),e.cuid=r=>e.check(ks(Fi,r)),e.cuid2=r=>e.check(zs(Di,r)),e.ulid=r=>e.check(Zs(Oi,r)),e.base64=r=>e.check(Vs(Ci,r)),e.base64url=r=>e.check(xs(Ri,r)),e.xid=r=>e.check($s(Vi,r)),e.ksuid=r=>e.check(As(xi,r)),e.ipv4=r=>e.check(Es(Si,r)),e.ipv6=r=>e.check(Fs(Ii,r)),e.cidrv4=r=>e.check(Ds(Pi,r)),e.cidrv6=r=>e.check(Os(Ti,r)),e.e164=r=>e.check(Ss(Ui,r)),e.datetime=r=>e.check(ni(r)),e.date=r=>e.check(si(r)),e.time=r=>e.check(ui(r)),e.duration=r=>e.check(ai(r))});function bu(e){return hs(zi,e)}const C=f("ZodStringFormat",(e,t)=>{T.init(e,t),Sr.init(e,t)}),Zi=f("ZodEmail",(e,t)=>{Zo.init(e,t),C.init(e,t)}),or=f("ZodGUID",(e,t)=>{ko.init(e,t),C.init(e,t)}),Re=f("ZodUUID",(e,t)=>{zo.init(e,t),C.init(e,t)}),$i=f("ZodURL",(e,t)=>{$o.init(e,t),C.init(e,t)}),Ai=f("ZodEmoji",(e,t)=>{Ao.init(e,t),C.init(e,t)}),Ei=f("ZodNanoID",(e,t)=>{Eo.init(e,t),C.init(e,t)}),Fi=f("ZodCUID",(e,t)=>{Fo.init(e,t),C.init(e,t)}),Di=f("ZodCUID2",(e,t)=>{Do.init(e,t),C.init(e,t)}),Oi=f("ZodULID",(e,t)=>{Oo.init(e,t),C.init(e,t)}),Vi=f("ZodXID",(e,t)=>{Vo.init(e,t),C.init(e,t)}),xi=f("ZodKSUID",(e,t)=>{xo.init(e,t),C.init(e,t)}),Si=f("ZodIPv4",(e,t)=>{Co.init(e,t),C.init(e,t)}),Ii=f("ZodIPv6",(e,t)=>{Ro.init(e,t),C.init(e,t)}),Pi=f("ZodCIDRv4",(e,t)=>{Uo.init(e,t),C.init(e,t)}),Ti=f("ZodCIDRv6",(e,t)=>{jo.init(e,t),C.init(e,t)}),Ci=f("ZodBase64",(e,t)=>{Lo.init(e,t),C.init(e,t)}),Ri=f("ZodBase64URL",(e,t)=>{Mo.init(e,t),C.init(e,t)}),Ui=f("ZodE164",(e,t)=>{Bo.init(e,t),C.init(e,t)}),ji=f("ZodJWT",(e,t)=>{qo.init(e,t),C.init(e,t)}),Li=f("ZodUnknown",(e,t)=>{Jo.init(e,t),W.init(e,t)});function sr(){return Us(Li)}const Ni=f("ZodNever",(e,t)=>{Ko.init(e,t),W.init(e,t)});function Mi(e){return js(Ni,e)}const Bi=f("ZodArray",(e,t)=>{Ho.init(e,t),W.init(e,t),e.element=t.element,e.min=(r,n)=>e.check(Me(r,n)),e.nonempty=r=>e.check(Me(1,r)),e.max=(r,n)=>e.check(Vr(r,n)),e.length=(r,n)=>e.check(xr(r,n)),e.unwrap=()=>e.element});function Wi(e,t){return Ys(Bi,e,t)}const qi=f("ZodObject",(e,t)=>{Xo.init(e,t),W.init(e,t),S(e,"shape",()=>t.shape),e.keyof=()=>Xi(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:sr()}),e.loose=()=>e.clone({...e._zod.def,catchall:sr()}),e.strict=()=>e.clone({...e._zod.def,catchall:Mi()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>zn(e,r),e.safeExtend=r=>Zn(e,r),e.merge=r=>$n(e,r),e.pick=r=>bn(e,r),e.omit=r=>kn(e,r),e.partial=(...r)=>An(Ir,e,r[0]),e.required=(...r)=>En(Pr,e,r[0])});function ku(e,t){const r={type:"object",shape:e??{},...b(t)};return new qi(r)}const Ji=f("ZodUnion",(e,t)=>{Yo.init(e,t),W.init(e,t),e.options=t.options});function Ki(e,t){return new Ji({type:"union",options:e,...b(t)})}const Hi=f("ZodIntersection",(e,t)=>{Qo.init(e,t),W.init(e,t)});function Gi(e,t){return new Hi({type:"intersection",left:e,right:t})}const lt=f("ZodEnum",(e,t)=>{es.init(e,t),W.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(n,o)=>{const s={};for(const i of n)if(r.has(i))s[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new lt({...t,checks:[],...b(o),entries:s})},e.exclude=(n,o)=>{const s={...t.entries};for(const i of n)if(r.has(i))delete s[i];else throw new Error(`Key ${i} not found in enum`);return new lt({...t,checks:[],...b(o),entries:s})}});function Xi(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new lt({type:"enum",entries:r,...b(t)})}const Yi=f("ZodTransform",(e,t)=>{ts.init(e,t),W.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new vr(e.constructor.name);r.addIssue=s=>{if(typeof s=="string")r.issues.push(Ve(s,r.value,t));else{const i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=r.value),i.inst??(i.inst=e),r.issues.push(Ve(i))}};const o=t.transform(r.value,r);return o instanceof Promise?o.then(s=>(r.value=s,r)):(r.value=o,r)}});function Qi(e){return new Yi({type:"transform",transform:e})}const Ir=f("ZodOptional",(e,t)=>{rs.init(e,t),W.init(e,t),e.unwrap=()=>e._zod.def.innerType});function ir(e){return new Ir({type:"optional",innerType:e})}const eu=f("ZodNullable",(e,t)=>{ns.init(e,t),W.init(e,t),e.unwrap=()=>e._zod.def.innerType});function ur(e){return new eu({type:"nullable",innerType:e})}const tu=f("ZodDefault",(e,t)=>{os.init(e,t),W.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function ru(e,t){return new tu({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():br(t)}})}const nu=f("ZodPrefault",(e,t)=>{ss.init(e,t),W.init(e,t),e.unwrap=()=>e._zod.def.innerType});function ou(e,t){return new nu({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():br(t)}})}const Pr=f("ZodNonOptional",(e,t)=>{is.init(e,t),W.init(e,t),e.unwrap=()=>e._zod.def.innerType});function su(e,t){return new Pr({type:"nonoptional",innerType:e,...b(t)})}const iu=f("ZodCatch",(e,t)=>{us.init(e,t),W.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function uu(e,t){return new iu({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const cu=f("ZodPipe",(e,t)=>{cs.init(e,t),W.init(e,t),e.in=t.in,e.out=t.out});function cr(e,t){return new cu({type:"pipe",in:e,out:t})}const au=f("ZodReadonly",(e,t)=>{as.init(e,t),W.init(e,t),e.unwrap=()=>e._zod.def.innerType});function lu(e){return new au({type:"readonly",innerType:e})}const fu=f("ZodCustom",(e,t)=>{ls.init(e,t),W.init(e,t)});function du(e,t={}){return Qs(fu,e,t)}function hu(e){return ei(e)}export{Zr as $,Xi as _,wu as a,Yr as b,ku as c,bu as d,gu as e,pn as o,yu as p,vu as s,mu as u};
@@ -0,0 +1 @@
1
+ import{j as e}from"./radix-ui-BR1vy4kf.js";import{r as m}from"./react-vendor-CNOkPC89.js";import{bd as C,be as w,a as G,bf as y,b6 as S,b8 as k,n as R,d as x,I as j}from"./index-hlYFfpDN.js";import{S as A}from"./switch-DFLN6xA0.js";import{R as N,a3 as D,u as L,ah as T,a1 as I}from"./icons-kPbuhVdj.js";import"./tanstack-e99Cjjy2.js";import"./notifications-B2HqRBj7.js";import"./utils-CzKF5WmX.js";import"./form-utils-Cn_Uld6y.js";import"./code-highlight-BRUf_pqB.js";function _(){const{state:s}=C(),n=w(),[o,r]=m.useState(""),[c,g]=m.useState(""),u=m.useCallback(async()=>{try{n.setGlobalEnvLoading(!0),n.setGlobalEnvError(null);const a=await fetch("/api/global-env");if(!a.ok)throw new Error("Failed to load Global Env config");const l=await a.json();n.setGlobalEnvConfig(l)}catch(a){n.setGlobalEnvError(a.message)}finally{n.setGlobalEnvLoading(!1)}},[n]),i=m.useCallback(async a=>{const l=s.globalEnvConfig;if(!l)return;const f={...l,...a};n.setGlobalEnvConfig(f);try{n.setGlobalEnvSaving(!0),n.setGlobalEnvError(null);const d=await fetch("/api/global-env",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(f)});if(!d.ok){const E=await d.json();throw new Error(E.error||"Failed to save")}const v=await d.json();n.setGlobalEnvConfig(v.config),n.setGlobalEnvSuccess(!0),setTimeout(()=>n.setGlobalEnvSuccess(!1),1500)}catch(d){n.setGlobalEnvConfig(l),n.setGlobalEnvError(d.message)}finally{n.setGlobalEnvSaving(!1)}},[s.globalEnvConfig,n]),h=m.useCallback(()=>{if(!o.trim()||!s.globalEnvConfig)return;const a={...s.globalEnvConfig.env,[o.trim()]:c};i({env:a}),r(""),g("")},[o,c,s.globalEnvConfig,i]),b=m.useCallback(a=>{if(!s.globalEnvConfig)return;const l={...s.globalEnvConfig.env};delete l[a],i({env:l})},[s.globalEnvConfig,i]);return{config:s.globalEnvConfig,loading:s.globalEnvLoading,saving:s.globalEnvSaving,error:s.globalEnvError,success:s.globalEnvSuccess,newEnvKey:o,setNewEnvKey:r,newEnvValue:c,setNewEnvValue:g,fetchConfig:u,saveConfig:i,addEnvVar:h,removeEnvVar:b}}function $(){const{t:s}=G(),{config:n,loading:o,saving:r,error:c,success:g,newEnvKey:u,setNewEnvKey:i,newEnvValue:h,setNewEnvValue:b,fetchConfig:a,saveConfig:l,addEnvVar:f,removeEnvVar:d}=_(),{fetchRawConfig:v}=y();m.useEffect(()=>{a(),v()},[a,v]);const E=()=>{l({enabled:!n?.enabled})};return o?e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsxs("div",{className:"flex items-center gap-3 text-muted-foreground",children:[e.jsx(N,{className:"w-5 h-5 animate-spin"}),e.jsx("span",{children:s("settings.loading")})]})}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:`absolute left-5 right-5 top-20 z-10 transition-all duration-200 ease-out ${c||g?"opacity-100 translate-y-0":"opacity-0 -translate-y-2 pointer-events-none"}`,children:[c&&e.jsxs(S,{variant:"destructive",className:"py-2 shadow-lg",children:[e.jsx(D,{className:"h-4 w-4"}),e.jsx(k,{children:c})]}),g&&e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-md border border-green-200 bg-green-50 text-green-700 shadow-lg dark:border-green-900/50 dark:bg-green-900/90 dark:text-green-300",children:[e.jsx(L,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"text-sm font-medium",children:s("settings.saved")})]})]}),e.jsx(R,{className:"flex-1",children:e.jsxs("div",{className:"p-5 space-y-6",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:s("settingsGlobalEnv.description")}),e.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-muted/50",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:n?.enabled?s("settingsGlobalEnv.enabled"):s("settingsGlobalEnv.disabled")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:n?.enabled?s("settingsGlobalEnv.enabledDesc"):s("settingsGlobalEnv.disabledDesc")})]}),e.jsx(A,{checked:n?.enabled??!0,onCheckedChange:E})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-base font-medium",children:s("settingsGlobalEnv.envVars")}),n?.env&&Object.keys(n.env).length>0?e.jsx("div",{className:"space-y-2",children:Object.entries(n.env).map(([t,p])=>e.jsxs("div",{className:"flex items-center gap-2 p-3 rounded-lg border bg-background",children:[e.jsx("code",{className:"flex-1 font-mono text-sm truncate",children:t}),e.jsx("span",{className:"text-muted-foreground",children:"="}),e.jsx("code",{className:"font-mono text-sm px-2 py-1 bg-muted rounded",children:p}),e.jsx(x,{variant:"ghost",size:"sm",onClick:()=>d(t),disabled:r,className:"h-8 w-8 p-0 text-destructive hover:text-destructive hover:bg-destructive/10",children:e.jsx(T,{className:"w-4 h-4"})})]},t))}):e.jsx("div",{className:"p-4 rounded-lg border border-dashed text-center text-muted-foreground",children:e.jsx("p",{children:s("settingsGlobalEnv.noneConfigured")})}),e.jsxs("div",{className:"p-4 rounded-lg border bg-muted/30",children:[e.jsx("h4",{className:"text-sm font-medium mb-3",children:s("settingsGlobalEnv.addNew")}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(j,{value:u,onChange:t=>i(t.target.value.toUpperCase()),placeholder:s("settingsGlobalEnv.keyName"),className:"flex-1 font-mono text-sm h-9",disabled:r}),e.jsx("span",{className:"flex items-center text-muted-foreground",children:"="}),e.jsx(j,{value:h,onChange:t=>b(t.target.value),placeholder:s("settingsGlobalEnv.value"),className:"flex-1 font-mono text-sm h-9",disabled:r}),e.jsxs(x,{size:"sm",onClick:f,disabled:r||!u.trim(),className:"h-9",children:[e.jsx(I,{className:"w-4 h-4 mr-1"}),s("settingsGlobalEnv.add")]})]})]}),e.jsxs("div",{className:"p-4 rounded-lg border bg-muted/30",children:[e.jsx("h4",{className:"text-sm font-medium mb-3",children:s("settingsGlobalEnv.quickAdd")}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[[{key:"DISABLE_BUG_COMMAND",value:"1"},{key:"DISABLE_ERROR_REPORTING",value:"1"},{key:"DISABLE_TELEMETRY",value:"1"}].map(({key:t,value:p})=>!n?.env?.[t]&&e.jsxs(x,{variant:"outline",size:"sm",onClick:()=>{i(t),b(p)},className:"text-xs font-mono",children:["+ ",t]},t)),n?.env&&["DISABLE_BUG_COMMAND","DISABLE_ERROR_REPORTING","DISABLE_TELEMETRY"].every(t=>n.env[t])&&e.jsx("span",{className:"text-sm text-muted-foreground",children:s("settingsGlobalEnv.allConfigured")})]})]})]})]})}),e.jsx("div",{className:"p-4 border-t bg-background",children:e.jsxs(x,{variant:"outline",size:"sm",onClick:()=>{a(),v()},disabled:o||r,className:"w-full",children:[e.jsx(N,{className:`w-4 h-4 mr-2 ${o?"animate-spin":""}`}),s("settings.refresh")]})})]})}export{$ as default};
@@ -0,0 +1 @@
1
+ import{j as e}from"./radix-ui-BR1vy4kf.js";import{a as N,c as l,d as g,M as k,N as C,O as S,B as R,S as h}from"./index-hlYFfpDN.js";import{u as W,a as E,b as O}from"./tanstack-e99Cjjy2.js";import{t as p}from"./notifications-B2HqRBj7.js";import{r as j}from"./react-vendor-CNOkPC89.js";import{aL as y,C as P,N as I,m as M,Z as T,g as H,U as $,c as A,aM as z,q as F,I as B,R as q}from"./icons-kPbuhVdj.js";import"./utils-CzKF5WmX.js";import"./form-utils-Cn_Uld6y.js";import"./code-highlight-BRUf_pqB.js";const D={sm:{dimension:80,strokeWidth:6,fontSize:"text-lg",labelSize:"text-[10px]"},md:{dimension:120,strokeWidth:8,fontSize:"text-3xl",labelSize:"text-xs"},lg:{dimension:160,strokeWidth:10,fontSize:"text-4xl",labelSize:"text-sm"}},L={ok:{stroke:"#22C55E",glow:"rgba(34, 197, 94, 0.4)"},warning:{stroke:"#EAB308",glow:"rgba(234, 179, 8, 0.4)"},error:{stroke:"#EF4444",glow:"rgba(239, 68, 68, 0.4)"}};function G({passed:s,total:t,status:a,size:r="md"}){const{t:i}=N(),o=D[r],c=L[a],n=t>0?Math.round(s/t*100):0,d=(o.dimension-o.strokeWidth)/2,u=2*Math.PI*d,f=u-n/100*u,x=o.dimension/2;return e.jsxs("div",{className:"relative inline-flex items-center justify-center",children:[e.jsxs("svg",{width:o.dimension,height:o.dimension,className:"transform -rotate-90",style:{filter:`drop-shadow(0 0 8px ${c.glow})`},children:[e.jsx("circle",{cx:x,cy:x,r:d,fill:"none",stroke:"currentColor",strokeWidth:o.strokeWidth,className:"text-muted/30"}),e.jsx("circle",{cx:x,cy:x,r:d,fill:"none",stroke:c.stroke,strokeWidth:o.strokeWidth,strokeLinecap:"round",strokeDasharray:u,strokeDashoffset:f,className:"transition-all duration-1000 ease-out"}),n>0&&e.jsx("circle",{cx:x+d*Math.cos(n/100*2*Math.PI-Math.PI/2),cy:x+d*Math.sin(n/100*2*Math.PI-Math.PI/2),r:o.strokeWidth/2,fill:c.stroke,className:"animate-pulse",style:{filter:`drop-shadow(0 0 4px ${c.glow})`}})]}),e.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[e.jsx("span",{className:l("font-mono font-bold tracking-tight",o.fontSize),children:n}),e.jsx("span",{className:l("font-mono uppercase tracking-widest text-muted-foreground",o.labelSize),children:i("health.healthLabel")})]})]})}function b({label:s,value:t,color:a,bgColor:r}){return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:l("w-2 h-2 rounded-full animate-pulse",r)}),e.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:s}),e.jsx("span",{className:l("font-mono font-bold text-sm",a),children:t})]})}function K({total:s,passed:t,warnings:a,errors:r,info:i}){const{t:o}=N(),c=t/s*100,n=a/s*100,d=r/s*100,u=i/s*100;return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"h-2 rounded-full overflow-hidden bg-muted/50 flex",children:[d>0&&e.jsx("div",{className:"h-full bg-red-500 transition-all duration-500",style:{width:`${d}%`}}),n>0&&e.jsx("div",{className:"h-full bg-yellow-500 transition-all duration-500",style:{width:`${n}%`}}),u>0&&e.jsx("div",{className:"h-full bg-blue-500 transition-all duration-500",style:{width:`${u}%`}}),c>0&&e.jsx("div",{className:"h-full bg-green-500 transition-all duration-500",style:{width:`${c}%`}})]}),e.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:o("health.checks")}),e.jsx("span",{className:"font-mono font-bold text-lg",children:s})]}),e.jsxs("div",{className:"flex items-center gap-4 flex-wrap",children:[e.jsx(b,{label:"OK",value:t,color:"text-green-500",bgColor:"bg-green-500"}),e.jsx(b,{label:"WARN",value:a,color:"text-yellow-500",bgColor:"bg-yellow-500"}),e.jsx(b,{label:"ERR",value:r,color:"text-red-500",bgColor:"bg-red-500"}),e.jsx(b,{label:"INFO",value:i,color:"text-blue-500",bgColor:"bg-blue-500"})]})]})]})}function Q(){return W({queryKey:["health"],queryFn:async()=>(await fetch("/api/health")).json(),refetchInterval:3e4})}function U(){const s=E();return O({mutationFn:async t=>{const a=await fetch(`/api/health/fix/${t}`,{method:"POST"}),r=await a.json();if(!a.ok)throw new Error(r.message);return r},onSuccess:t=>{s.invalidateQueries({queryKey:["health"]}),p.success(t.message)},onError:t=>{p.error(t.message)}})}const Z={ok:{dot:"bg-green-500",label:"OK",labelColor:"text-green-500"},warning:{dot:"bg-yellow-500",label:"WARN",labelColor:"text-yellow-500"},error:{dot:"bg-red-500",label:"ERR",labelColor:"text-red-500"},info:{dot:"bg-blue-500",label:"INFO",labelColor:"text-blue-500"}};function J({check:s}){const{t}=N(),a=U(),r=Z[s.status],[i,o]=j.useState(!1),c=s.details||s.fix,n=d=>{navigator.clipboard.writeText(d),p.success(t("health.copied"))};return c?e.jsx(k,{open:i,onOpenChange:o,children:e.jsxs("div",{className:l("group rounded-lg border transition-all duration-150",i?"border-border bg-muted/30":"border-transparent hover:border-border/50 hover:bg-muted/50"),children:[e.jsx(C,{asChild:!0,children:e.jsxs("button",{className:"w-full flex items-center gap-3 px-3 py-2 text-left",children:[e.jsxs("div",{className:"relative flex items-center justify-center w-4 h-4",children:[e.jsx("div",{className:l("w-2 h-2 rounded-full",r.dot)}),s.status!=="ok"&&e.jsx("div",{className:l("absolute w-2 h-2 rounded-full animate-ping opacity-75",r.dot)})]}),e.jsx("span",{className:"flex-1 text-sm font-medium truncate",children:s.name}),e.jsxs("span",{className:l("font-mono text-xs font-semibold",r.labelColor),children:["[",r.label,"]"]}),e.jsx(P,{className:l("w-4 h-4 text-muted-foreground transition-transform duration-200",i&&"rotate-90")})]})}),e.jsx(S,{children:e.jsxs("div",{className:"px-3 pb-3 pt-1 space-y-2 ml-7",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:s.message}),s.details&&e.jsx("pre",{className:"text-xs font-mono text-muted-foreground bg-background/50 rounded p-2 overflow-x-auto border border-border/50",children:s.details}),s.fix&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"flex-1 flex items-center gap-2 bg-background/50 rounded px-2 py-1.5 border border-border/50",children:[e.jsx(I,{className:"w-3 h-3 text-muted-foreground shrink-0"}),e.jsx("code",{className:"text-xs font-mono flex-1 truncate",children:s.fix}),e.jsx(g,{variant:"ghost",size:"sm",onClick:()=>s.fix&&n(s.fix),className:"h-5 w-5 p-0",children:e.jsx(M,{className:"w-3 h-3"})})]}),s.fixable&&s.status!=="ok"&&e.jsxs(g,{size:"sm",onClick:()=>a.mutate(s.id),disabled:a.isPending,className:"h-7 px-3 text-xs",children:[e.jsx(y,{className:"w-3 h-3 mr-1"}),t("health.applyFix")]})]})]})})]})}):e.jsxs("div",{className:l("group flex items-center gap-3 px-3 py-2 rounded-lg","hover:bg-muted/50 transition-colors duration-150","border border-transparent hover:border-border/50"),children:[e.jsxs("div",{className:"relative flex items-center justify-center w-4 h-4",children:[e.jsx("div",{className:l("w-2 h-2 rounded-full",r.dot)}),s.status!=="ok"&&e.jsx("div",{className:l("absolute w-2 h-2 rounded-full animate-ping opacity-75",r.dot)})]}),e.jsx("span",{className:"flex-1 text-sm font-medium truncate",children:s.name}),e.jsxs("span",{className:l("font-mono text-xs font-semibold",r.labelColor),children:["[",r.label,"]"]}),s.fixable&&s.status!=="ok"&&e.jsxs(g,{size:"sm",variant:"ghost",onClick:()=>a.mutate(s.id),disabled:a.isPending,className:"h-6 px-2 text-xs opacity-0 group-hover:opacity-100 transition-opacity",children:[e.jsx(y,{className:"w-3 h-3 mr-1"}),t("health.fix")]})]})}const V={Monitor:z,Settings:A,Users:$,Shield:H,Zap:T};function X({group:s,defaultOpen:t=!0}){const[a,r]=j.useState(t),i=V[s.icon]||z,o=s.checks.filter(m=>m.status==="ok").length,c=s.checks.length,n=s.checks.some(m=>m.status==="error"),d=s.checks.some(m=>m.status==="warning"),u=Math.round(o/c*100),f=n?"text-red-500":d?"text-yellow-500":"text-green-500",x=n?"bg-red-500":d?"bg-yellow-500":"bg-green-500";return e.jsx(k,{open:a,onOpenChange:r,children:e.jsxs("div",{className:l("rounded-lg border transition-all duration-200",n?"border-red-500/30":d?"border-yellow-500/30":"border-border"),children:[e.jsx(C,{asChild:!0,children:e.jsxs("button",{className:l("w-full flex items-center gap-3 p-3 text-left rounded-lg","hover:bg-muted/50 transition-colors duration-150",a&&"rounded-b-none border-b border-border/50"),children:[e.jsx("div",{className:l("p-1.5 rounded-md",n?"bg-red-500/10 text-red-500":d?"bg-yellow-500/10 text-yellow-500":"bg-muted text-muted-foreground"),children:e.jsx(i,{className:"w-4 h-4"})}),e.jsx("span",{className:"flex-1 text-sm font-semibold",children:s.name}),!a&&e.jsx("div",{className:"flex items-center gap-2",children:e.jsx("div",{className:"w-16 h-1.5 rounded-full bg-muted overflow-hidden",children:e.jsx("div",{className:l("h-full transition-all duration-500",x),style:{width:`${u}%`}})})}),e.jsxs("span",{className:l("font-mono text-xs font-semibold",f),children:[o,"/",c]}),e.jsx(F,{className:l("w-4 h-4 text-muted-foreground transition-transform duration-200",a&&"rotate-180")})]})}),e.jsx(S,{children:e.jsx("div",{className:"p-2 space-y-0.5",children:s.checks.map(m=>e.jsx(J,{check:m},m.id))})})]})})}function Y(s){return s.errors>0?"error":s.warnings>0?"warning":"ok"}function _(s,t){const a=Math.floor((Date.now()-s)/1e3);if(a<5)return t("health.justNow");if(a<60)return t("health.secondsAgo",{count:a});const r=Math.floor(a/60);if(r<60)return t("health.minutesAgo",{count:r});const i=Math.floor(r/60);return t("health.hoursAgo",{count:i})}function ee(s){return[...s].sort((t,a)=>{const r=t.checks.filter(n=>n.status==="error").length,i=a.checks.filter(n=>n.status==="error").length,o=t.checks.filter(n=>n.status==="warning").length,c=a.checks.filter(n=>n.status==="warning").length;return r!==i?i-r:c-o})}function se(){return e.jsxs("div",{className:"font-mono text-sm text-muted-foreground flex items-center gap-2",children:[e.jsx("span",{className:"text-green-500",children:"$"}),e.jsx("span",{children:"ccs doctor"})]})}function te(){return e.jsxs("div",{className:"p-6 max-w-6xl mx-auto space-y-6",children:[e.jsx("div",{className:"rounded-xl border bg-gradient-to-br from-background to-muted/20 p-6",children:e.jsxs("div",{className:"flex items-center gap-6",children:[e.jsx(h,{className:"w-[120px] h-[120px] rounded-full"}),e.jsxs("div",{className:"flex-1 space-y-3",children:[e.jsx(h,{className:"h-5 w-48"}),e.jsx(h,{className:"h-8 w-64"}),e.jsx(h,{className:"h-4 w-32"})]})]})}),e.jsx(h,{className:"h-16 w-full rounded-lg"}),e.jsx("div",{className:"space-y-3",children:[1,2,3,4].map(s=>e.jsx(h,{className:"h-20 rounded-lg"},s))})]})}function xe(){const{t:s}=N(),{data:t,isLoading:a,refetch:r,dataUpdatedAt:i}=Q(),o=i,[c,n]=j.useState(0);j.useEffect(()=>{const m=setInterval(()=>n(v=>v+1),1e3);return()=>clearInterval(m)},[]);const d=()=>{navigator.clipboard.writeText("ccs doctor"),p.success(s("health.copied"))},u=()=>{r(),p.info(s("health.refreshing"))};if(a&&!t)return e.jsx(te,{});const f=t?Y(t.summary):"ok",x=t?.groups?ee(t.groups):[];return e.jsxs("div",{className:"p-6 max-w-6xl mx-auto space-y-6",children:[e.jsxs("div",{className:l("relative overflow-hidden rounded-xl border p-6","bg-gradient-to-br from-background via-background to-muted/30"),children:[e.jsx("div",{className:"absolute inset-0 opacity-[0.02] pointer-events-none",style:{backgroundImage:"repeating-linear-gradient(0deg, transparent, transparent 2px, currentColor 2px, currentColor 3px)"}}),e.jsx("div",{className:"absolute inset-0 opacity-[0.03] pointer-events-none",children:e.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(circle at 1px 1px, currentColor 1px, transparent 0)",backgroundSize:"24px 24px"}})}),e.jsxs("div",{className:"relative flex flex-col md:flex-row items-start md:items-center gap-6",children:[t&&e.jsx("div",{className:"shrink-0",children:e.jsx(G,{passed:t.summary.passed,total:t.summary.total-t.summary.info,status:f,size:"md"})}),e.jsxs("div",{className:"flex-1 space-y-3",children:[e.jsx(se,{}),e.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[e.jsx("h1",{className:"text-2xl font-bold font-mono tracking-tight",children:s("health.systemHealth")}),t?.version&&e.jsx(R,{variant:"outline",className:"font-mono text-xs bg-muted/50",children:s("health.build",{version:t.version})})]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx(B,{className:"w-4 h-4 text-muted-foreground"}),e.jsx("span",{className:"text-muted-foreground",children:s("health.lastScan")}),e.jsx("span",{className:"font-mono",children:o?_(o,s):"--"}),e.jsx("span",{className:"text-muted-foreground",children:"|"}),e.jsx("span",{className:"text-muted-foreground",children:s("health.autoRefresh")}),e.jsx("span",{className:"font-mono text-green-500",children:"30s"})]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsxs(g,{variant:"outline",size:"sm",onClick:d,className:"gap-2 font-mono text-xs",children:[e.jsx(I,{className:"w-3 h-3"}),"ccs doctor",e.jsx(M,{className:"w-3 h-3 opacity-50"})]}),e.jsxs(g,{variant:"outline",size:"sm",onClick:u,disabled:a,className:"gap-2",children:[e.jsx(q,{className:l("w-4 h-4",a&&"animate-spin")}),e.jsx("span",{className:"hidden sm:inline",children:s("health.refresh")}),e.jsx("kbd",{className:"hidden md:inline-flex h-5 items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground",children:"R"})]})]})]})]}),t&&e.jsx("div",{className:"rounded-lg border bg-card p-4",children:e.jsx(K,{total:t.summary.total,passed:t.summary.passed,warnings:t.summary.warnings,errors:t.summary.errors,info:t.summary.info})}),x.length>0&&e.jsx("div",{className:"space-y-3",children:x.map((m,v)=>e.jsx(X,{group:m,defaultOpen:v<2||m.checks.some(w=>w.status==="error"||w.status==="warning")},m.id))}),e.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground border-t pt-4",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("span",{children:[s("health.version")," ",e.jsx("span",{className:"font-mono",children:t?.version??"--"})]}),e.jsxs("span",{children:[s("health.platform")," ",e.jsx("span",{className:"font-mono",children:typeof navigator<"u"?navigator.platform:"linux"})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-green-500 animate-pulse"}),e.jsx("span",{children:s("health.liveMonitoring")})]})]})]})}export{xe as HealthPage};
@@ -0,0 +1 @@
1
+ import{r as y}from"./react-vendor-CNOkPC89.js";const M=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),_=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,c,o)=>o?o.toUpperCase():c.toLowerCase()),s=t=>{const e=_(t);return e.charAt(0).toUpperCase()+e.slice(1)},k=(...t)=>t.filter((e,c,o)=>!!e&&e.trim()!==""&&o.indexOf(e)===c).join(" ").trim(),x=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};var v={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const m=y.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:c=2,absoluteStrokeWidth:o,className:d="",children:h,iconNode:r,...n},i)=>y.createElement("svg",{ref:i,...v,width:e,height:e,stroke:t,strokeWidth:o?Number(c)*24/Number(e):c,className:k("lucide",d),...!h&&!x(n)&&{"aria-hidden":"true"},...n},[...r.map(([p,l])=>y.createElement(p,l)),...Array.isArray(h)?h:[h]]));const a=(t,e)=>{const c=y.forwardRef(({className:o,...d},h)=>y.createElement(m,{ref:h,iconNode:e,className:k(`lucide-${M(s(t))}`,`lucide-${t}`,o),...d}));return c.displayName=s(t),c};const g=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],A2=a("activity",g);const f=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],C2=a("archive",f);const w=[["path",{d:"M17 7 7 17",key:"15tmo1"}],["path",{d:"M17 17H7V7",key:"1org7z"}]],j2=a("arrow-down-left",w);const N=[["path",{d:"m7 7 10 10",key:"1fmybs"}],["path",{d:"M17 7v10H7",key:"6fjiku"}]],H2=a("arrow-down-right",N);const $=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],V2=a("arrow-down",$);const u=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],L2=a("arrow-left",u);const z=[["path",{d:"m16 3 4 4-4 4",key:"1x1c3m"}],["path",{d:"M20 7H4",key:"zbl0bi"}],["path",{d:"m8 21-4-4 4-4",key:"h9nckh"}],["path",{d:"M4 17h16",key:"g4d7ey"}]],S2=a("arrow-right-left",z);const b=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],P2=a("arrow-right",b);const q=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],B2=a("arrow-up-right",q);const A=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],R2=a("arrow-up",A);const C=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],E2=a("book-open",C);const j=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],F2=a("bot",j);const H=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],D2=a("box",H);const V=[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M9 13a4.5 4.5 0 0 0 3-4",key:"10igwf"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M12 13h4",key:"1ku699"}],["path",{d:"M12 18h6a2 2 0 0 1 2 2v1",key:"105ag5"}],["path",{d:"M12 8h8",key:"1lhi5i"}],["path",{d:"M16 8V5a2 2 0 0 1 2-2",key:"u6izg6"}],["circle",{cx:"16",cy:"13",r:".5",key:"ry7gng"}],["circle",{cx:"18",cy:"3",r:".5",key:"1aiba7"}],["circle",{cx:"20",cy:"21",r:".5",key:"yhc1fs"}],["circle",{cx:"20",cy:"8",r:".5",key:"1e43v0"}]],U2=a("brain-circuit",V);const L=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],O2=a("brain",L);const S=[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]],G2=a("bug",S);const P=[["path",{d:"M16 14v2.2l1.6 1",key:"fo4ql5"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]],W2=a("calendar-clock",P);const B=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],Z2=a("calendar",B);const R=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],T2=a("chart-column",R);const E=[["path",{d:"M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z",key:"pzmjnu"}],["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}]],I2=a("chart-pie",E);const F=[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]],K2=a("check-check",F);const D=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],X2=a("check",D);const U=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],J2=a("chevron-down",U);const O=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Q2=a("chevron-left",O);const G=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Y2=a("chevron-right",G);const W=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],a0=a("chevron-up",W);const Z=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],e0=a("circle-alert",Z);const T=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],t0=a("circle-check-big",T);const I=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],c0=a("circle-check",I);const K=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],o0=a("circle-question-mark",K);const X=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],h0=a("circle-x",X);const J=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],y0=a("circle",J);const Q=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],d0=a("clock",Q);const Y=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],n0=a("cloud",Y);const a1=[["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"}]],s0=a("code-xml",a1);const e1=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],k0=a("code",e1);const t1=[["circle",{cx:"8",cy:"8",r:"6",key:"3yglwk"}],["path",{d:"M18.09 10.37A6 6 0 1 1 10.34 18",key:"t5s6rm"}],["path",{d:"M7 6h1v4",key:"1obek4"}],["path",{d:"m16.71 13.88.7.71-2.82 2.82",key:"1rbuyh"}]],r0=a("coins",t1);const c1=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],i0=a("copy",c1);const o1=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],p0=a("cpu",o1);const h1=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],l0=a("database",h1);const y1=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],M0=a("dollar-sign",y1);const d1=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],_0=a("download",d1);const n1=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],x0=a("ellipsis",n1);const s1=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],v0=a("external-link",s1);const k1=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],m0=a("eye-off",k1);const r1=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],g0=a("eye",r1);const i1=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]],f0=a("file-braces",i1);const p1=[["path",{d:"M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35",key:"1wthlu"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m5 16-3 3 3 3",key:"331omg"}],["path",{d:"m9 22 3-3-3-3",key:"lsp7cz"}]],w0=a("file-code-corner",p1);const l1=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],N0=a("file-code",l1);const M1=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]],$0=a("file-down",M1);const _1=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],u0=a("file-exclamation-point",_1);const x1=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],z0=a("file-text",x1);const v1=[["path",{d:"M10 10.5 8 13l2 2.5",key:"m4t9c1"}],["path",{d:"m14 10.5 2 2.5-2 2.5",key:"14w2eb"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2z",key:"1u1bxd"}]],b0=a("folder-code",v1);const m1=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],q0=a("folder-open",m1);const g1=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],A0=a("folder",g1);const f1=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],C0=a("gauge",f1);const w1=[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]],j0=a("git-branch",w1);const N1=[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]],H0=a("github",N1);const $1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],V0=a("globe",$1);const u1=[["circle",{cx:"12",cy:"9",r:"1",key:"124mty"}],["circle",{cx:"19",cy:"9",r:"1",key:"1ruzo2"}],["circle",{cx:"5",cy:"9",r:"1",key:"1a8b28"}],["circle",{cx:"12",cy:"15",r:"1",key:"1e56xg"}],["circle",{cx:"19",cy:"15",r:"1",key:"1a92ep"}],["circle",{cx:"5",cy:"15",r:"1",key:"5r1jwy"}]],L0=a("grip-horizontal",u1);const z1=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],S0=a("grip-vertical",z1);const b1=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]],P0=a("heart",b1);const q1=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],B0=a("house",q1);const A1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],R0=a("info",A1);const C1=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],E0=a("key-round",C1);const j1=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],F0=a("key",j1);const H1=[["path",{d:"M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z",key:"1pdavp"}],["path",{d:"M20.054 15.987H3.946",key:"14rxg9"}]],D0=a("laptop",H1);const V1=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],U0=a("layers",V1);const L1=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],O0=a("link-2",L1);const S1=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],G0=a("loader-circle",S1);const P1=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],W0=a("lock",P1);const B1=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],Z0=a("log-out",B1);const R1=[["path",{d:"M11 6a13 13 0 0 0 8.4-2.8A1 1 0 0 1 21 4v12a1 1 0 0 1-1.6.8A13 13 0 0 0 11 14H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z",key:"q8bfy3"}],["path",{d:"M6 14a12 12 0 0 0 2.4 7.2 2 2 0 0 0 3.2-2.4A8 8 0 0 1 10 14",key:"1853fq"}],["path",{d:"M8 6v8",key:"15ugcq"}]],T0=a("megaphone",R1);const E1=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],I0=a("monitor",E1);const F1=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],K0=a("moon",F1);const D1=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],X0=a("network",D1);const U1=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],J0=a("package",U1);const O1=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],Q0=a("panel-left",O1);const G1=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],Y0=a("pause",G1);const W1=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],aa=a("pencil",W1);const Z1=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],ea=a("play",Z1);const T1=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],ta=a("plus",T1);const I1=[["path",{d:"M18.36 6.64A9 9 0 0 1 20.77 15",key:"dxknvb"}],["path",{d:"M6.16 6.16a9 9 0 1 0 12.68 12.68",key:"1x7qb5"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],ca=a("power-off",I1);const K1=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],oa=a("power",K1);const X1=[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],ha=a("radio",X1);const J1=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],ya=a("refresh-cw",J1);const Q1=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],da=a("rotate-ccw",Q1);const Y1=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],na=a("rotate-cw",Y1);const a2=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],sa=a("save",a2);const e2=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],ka=a("search",e2);const t2=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],ra=a("server",t2);const c2=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],ia=a("settings-2",c2);const o2=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],pa=a("settings",o2);const h2=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],la=a("shield-alert",h2);const y2=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Ma=a("shield-check",y2);const d2=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],_a=a("shield",d2);const n2=[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]],xa=a("sliders-horizontal",n2);const s2=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],va=a("sparkles",s2);const k2=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],ma=a("square-terminal",k2);const r2=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],ga=a("square",r2);const i2=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],fa=a("star",i2);const p2=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],wa=a("sun",p2);const l2=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Na=a("terminal",l2);const M2=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],$a=a("trash-2",M2);const _2=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],ua=a("trending-up",_2);const x2=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],za=a("triangle-alert",x2);const v2=[["path",{d:"m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71",key:"yqzxt4"}],["path",{d:"m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71",key:"4qinb0"}],["line",{x1:"8",x2:"8",y1:"2",y2:"5",key:"1041cp"}],["line",{x1:"2",x2:"5",y1:"8",y2:"8",key:"14m1p5"}],["line",{x1:"16",x2:"16",y1:"19",y2:"22",key:"rzdirn"}],["line",{x1:"19",x2:"22",y1:"16",y2:"16",key:"ox905f"}]],ba=a("unlink",v2);const m2=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],qa=a("user",m2);const g2=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],Aa=a("users",g2);const f2=[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]],Ca=a("wand-sparkles",f2);const w2=[["path",{d:"M2 6c.6.5 1.2 1 2.5 1C7 7 7 5 9.5 5c2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"knzxuh"}],["path",{d:"M2 12c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"2jd2cc"}],["path",{d:"M2 18c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"rd2r6e"}]],ja=a("waves",w2);const N2=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],Ha=a("wifi-off",N2);const $2=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],Va=a("wifi",$2);const u2=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],La=a("wrench",u2);const z2=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Sa=a("x",z2);const b2=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Pa=a("zap",b2);export{L0 as $,A2 as A,E2 as B,Y2 as C,ha as D,m0 as E,q0 as F,C0 as G,B0 as H,p0 as I,R0 as J,F0 as K,G0 as L,K0 as M,Na as N,k0 as O,Q0 as P,B2 as Q,ya as R,ma as S,za as T,Aa as U,j2 as V,Ha as W,Sa as X,z0 as Y,Pa as Z,u0 as _,T2 as a,ia as a0,ta as a1,va as a2,e0 as a3,O2 as a4,ra as a5,C2 as a6,N0 as a7,Q2 as a8,W0 as a9,w0 as aA,U2 as aB,xa as aC,A0 as aD,aa as aE,K2 as aF,ba as aG,O0 as aH,ja as aI,S2 as aJ,U0 as aK,La as aL,I0 as aM,F2 as aN,W2 as aO,T0 as aP,J0 as aQ,n0 as aR,D0 as aS,D2 as aT,G2 as aU,$0 as aV,na as aW,ga as aX,V2 as aY,R2 as aZ,M0 as aa,l0 as ab,H2 as ac,Z2 as ad,r0 as ae,ua as af,I2 as ag,$a as ah,sa as ai,ka as aj,Ca as ak,s0 as al,P2 as am,f0 as an,L2 as ao,la as ap,_0 as aq,fa as ar,X0 as as,b0 as at,x0 as au,o0 as av,j0 as aw,oa as ax,ca as ay,Ma as az,H0 as b,pa as c,wa as d,g0 as e,Va as f,_a as g,P0 as h,t0 as i,y0 as j,X2 as k,E0 as l,i0 as m,v0 as n,qa as o,Z0 as p,J2 as q,a0 as r,V0 as s,d0 as t,c0 as u,h0 as v,ea as w,Y0 as x,S0 as y,da as z};
@@ -0,0 +1 @@
1
+ import{j as e}from"./radix-ui-BR1vy4kf.js";import{r as c}from"./react-vendor-CNOkPC89.js";import{bd as F,be as U,a as A,I as K,bf as _,b6 as z,b8 as B,n as q,d as T}from"./index-hlYFfpDN.js";import{S as D}from"./switch-DFLN6xA0.js";import{N as Y,k as J,r as Q,q as X,n as Z,R as y,a3 as V,u as ee,aQ as se}from"./icons-kPbuhVdj.js";import"./tanstack-e99Cjjy2.js";import"./notifications-B2HqRBj7.js";import"./utils-CzKF5WmX.js";import"./form-utils-Cn_Uld6y.js";import"./code-highlight-BRUf_pqB.js";function te(){const{state:s}=F(),t=U(),[o,g]=c.useState(""),[r,d]=c.useState(""),[x,p]=c.useState(!1),[j,f]=c.useState(!1),S=c.useCallback(async()=>{try{t.setWebSearchLoading(!0),t.setWebSearchError(null);const a=await fetch("/api/websearch");if(!a.ok)throw new Error("Failed to load WebSearch config");const n=await a.json();t.setWebSearchConfig(n)}catch(a){t.setWebSearchError(a.message)}finally{t.setWebSearchLoading(!1)}},[t]),v=c.useCallback(async()=>{try{t.setWebSearchStatusLoading(!0);const a=await fetch("/api/websearch/status");if(!a.ok)throw new Error("Failed to load status");const n=await a.json();t.setWebSearchStatus(n)}catch{}finally{t.setWebSearchStatusLoading(!1)}},[t]),b=c.useCallback(async a=>{const n=s.webSearchConfig;if(!n)return;const w={...n,...a};t.setWebSearchConfig(w);try{t.setWebSearchSaving(!0),t.setWebSearchError(null);const l=await fetch("/api/websearch",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(w)});if(!l.ok){const k=await l.json();throw new Error(k.error||"Failed to save")}const i=await l.json();t.setWebSearchConfig(i.websearch),t.setWebSearchSuccess(!0),setTimeout(()=>t.setWebSearchSuccess(!1),1500)}catch(l){t.setWebSearchConfig(n),t.setWebSearchError(l.message)}finally{t.setWebSearchSaving(!1)}},[s.webSearchConfig,t]);c.useEffect(()=>{s.webSearchConfig&&(g(s.webSearchConfig.providers?.gemini?.model??"gemini-2.5-flash"),d(s.webSearchConfig.providers?.opencode?.model??"opencode/grok-code"))},[s.webSearchConfig]);const C=c.useCallback(async()=>{const a=s.webSearchConfig?.providers?.gemini?.model??"gemini-2.5-flash";if(o!==a){const n=s.webSearchConfig?.providers||{};await b({providers:{...n,gemini:{...n.gemini,model:o}}}),p(!0),setTimeout(()=>p(!1),2e3)}},[o,s.webSearchConfig,b]),h=c.useCallback(async()=>{const a=s.webSearchConfig?.providers?.opencode?.model??"opencode/grok-code";if(r!==a){const n=s.webSearchConfig?.providers||{};await b({providers:{...n,opencode:{...n.opencode,model:r}}}),f(!0),setTimeout(()=>f(!1),2e3)}},[r,s.webSearchConfig,b]);return{config:s.webSearchConfig,status:s.webSearchStatus,loading:s.webSearchLoading,statusLoading:s.webSearchStatusLoading,saving:s.webSearchSaving,error:s.webSearchError,success:s.webSearchSuccess,geminiModelInput:o,setGeminiModelInput:g,opencodeModelInput:r,setOpencodeModelInput:d,geminiModelSaved:x,opencodeModelSaved:j,fetchConfig:S,fetchStatus:v,saveConfig:b,saveGeminiModel:C,saveOpencodeModel:h}}function H({name:s,label:t,badge:o,badgeColor:g,enabled:r,installed:d,statusLoading:x,saving:p,onToggle:j,modelInput:f,setModelInput:S,onModelBlur:v,modelSaved:b,modelPlaceholder:C,showHint:h,setShowHint:a,installCmd:n,docsUrl:w,hintColor:l}){const{t:i}=A(),k=g==="green"?"bg-green-500/10 text-green-600":g==="blue"?"bg-blue-500/10 text-blue-600":"bg-purple-500/10 text-purple-600",W=l==="amber"?"bg-amber-50 dark:bg-amber-900/20 text-amber-700 dark:text-amber-300":l==="blue"?"bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300":"bg-purple-50 dark:bg-purple-900/20 text-purple-700 dark:text-purple-300",E=l==="amber"?"bg-amber-100 dark:bg-amber-900/40":l==="blue"?"bg-blue-100 dark:bg-blue-900/40":"bg-purple-100 dark:bg-purple-900/40",M=l==="amber"?"text-amber-600 dark:text-amber-400":l==="blue"?"text-blue-600 dark:text-blue-400":"text-purple-600 dark:text-purple-400",G=s==="opencode"?"OpenCode":s.charAt(0).toUpperCase()+s.slice(1);return e.jsxs("div",{className:`rounded-lg border transition-colors ${r?"border-primary border-l-4":"border-border"}`,children:[e.jsxs("div",{className:"flex items-center justify-between p-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Y,{className:`w-5 h-5 ${r?"text-primary":"text-muted-foreground"}`}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("p",{className:"font-mono font-medium",children:s}),e.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded font-medium ${k}`,children:o}),d?e.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-green-500/10 text-green-600 font-medium",children:i("settingsWebsearch.installed")}):e.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-amber-500/10 text-amber-600 font-medium",children:i("settingsWebsearch.notInstalled")})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t})]})]}),e.jsx(D,{checked:r,onCheckedChange:j,disabled:p||!d})]}),r&&f!==void 0&&S&&v&&e.jsx("div",{className:"px-4 pb-4 pt-0",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("label",{className:"text-sm text-muted-foreground whitespace-nowrap",children:i("settingsWebsearch.model")}),e.jsx(K,{value:f,onChange:I=>S(I.target.value),onBlur:v,placeholder:C,className:"h-8 text-sm font-mono",disabled:p}),b&&e.jsxs("span",{className:"flex items-center gap-1 text-green-600 dark:text-green-400 text-xs animate-in fade-in duration-200",children:[e.jsx(J,{className:"w-3.5 h-3.5"}),i("settings.saved")]})]})}),!d&&!x&&e.jsxs("div",{className:"px-4 pb-4 pt-0 border-t border-border/50",children:[e.jsxs("button",{onClick:()=>a(!h),className:`flex items-center gap-2 text-sm hover:underline w-full py-2 ${M}`,children:[h?e.jsx(Q,{className:"w-4 h-4"}):e.jsx(X,{className:"w-4 h-4"}),i("settingsWebsearch.howInstall",{name:G})]}),h&&e.jsxs("div",{className:`mt-2 p-3 rounded-md text-sm ${W}`,children:[e.jsxs("p",{className:"mb-2",children:[i("settingsWebsearch.installGlobally")," ",i(o==="GROK_API_KEY"?"settingsWebsearch.requiresKey":"settingsWebsearch.freeTier"),":"]}),e.jsx("code",{className:`text-sm px-2 py-1 rounded font-mono block mb-2 ${E}`,children:n}),e.jsxs("a",{href:w,target:"_blank",rel:"noopener noreferrer",className:"hover:underline inline-flex items-center gap-1",children:[e.jsx(Z,{className:"w-3 h-3"}),i("settingsWebsearch.viewDocs")]})]})]})]})}function be(){const{t:s}=A(),{config:t,status:o,loading:g,statusLoading:r,saving:d,error:x,success:p,geminiModelInput:j,setGeminiModelInput:f,opencodeModelInput:S,setOpencodeModelInput:v,geminiModelSaved:b,opencodeModelSaved:C,fetchConfig:h,fetchStatus:a,saveConfig:n,saveGeminiModel:w,saveOpencodeModel:l}=te(),{fetchRawConfig:i}=_(),[k,W]=c.useState(!1),[E,M]=c.useState(!1),[G,I]=c.useState(!1);c.useEffect(()=>{h(),a(),i()},[h,a,i]);const N=t?.providers?.gemini?.enabled??!1,O=t?.providers?.grok?.enabled??!1,L=t?.providers?.opencode?.enabled??!1,R=()=>{const m=t?.providers||{},u=m.gemini?.enabled??!1;n({enabled:!u||O||L,providers:{...m,gemini:{...m.gemini,enabled:!u}}})},$=()=>{const m=t?.providers||{},u=m.grok?.enabled??!1;n({enabled:N||!u||L,providers:{...m,grok:{...m.grok,enabled:!u}}})},P=()=>{const m=t?.providers||{},u=m.opencode?.enabled??!1;n({enabled:N||O||!u,providers:{...m,opencode:{...m.opencode,enabled:!u}}})};return g?e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsxs("div",{className:"flex items-center gap-3 text-muted-foreground",children:[e.jsx(y,{className:"w-5 h-5 animate-spin"}),e.jsx("span",{children:s("settings.loading")})]})}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:`absolute left-5 right-5 top-20 z-10 transition-all duration-200 ease-out ${x||p?"opacity-100 translate-y-0":"opacity-0 -translate-y-2 pointer-events-none"}`,children:[x&&e.jsxs(z,{variant:"destructive",className:"py-2 shadow-lg",children:[e.jsx(V,{className:"h-4 w-4"}),e.jsx(B,{children:x})]}),p&&e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-md border border-green-200 bg-green-50 text-green-700 shadow-lg dark:border-green-900/50 dark:bg-green-900/90 dark:text-green-300",children:[e.jsx(ee,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"text-sm font-medium",children:s("settings.saved")})]})]}),e.jsx(q,{className:"flex-1",children:e.jsxs("div",{className:"p-5 space-y-6",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:s("settingsWebsearch.description")}),e.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-muted/50",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:s(N?"settingsWebsearch.enabled":"settingsWebsearch.disabled")}),r?e.jsx("p",{className:"text-sm text-muted-foreground",children:s("settingsWebsearch.checking")}):o?.readiness?e.jsx("p",{className:"text-sm text-muted-foreground",children:o.readiness.message}):null]}),e.jsx(T,{variant:"ghost",size:"sm",onClick:a,disabled:r,children:e.jsx(y,{className:`w-4 h-4 ${r?"animate-spin":""}`})})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-base font-medium",children:s("settingsWebsearch.providers")}),!o?.geminiCli&&!o?.opencodeCli&&!o?.grokCli&&!r&&e.jsxs("div",{className:"flex flex-col items-center justify-center p-8 border-2 border-dashed rounded-lg text-center bg-muted/30",children:[e.jsx(se,{className:"w-12 h-12 text-muted-foreground mb-3 opacity-30"}),e.jsx("p",{className:"font-medium text-foreground mb-1",children:s("settingsWebsearch.noneConfigured")}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:s("settingsWebsearch.noneConfiguredHint")}),e.jsxs(T,{variant:"outline",size:"sm",onClick:a,children:[e.jsx(y,{className:"w-4 h-4 mr-2"}),s("settingsWebsearch.checkProviders")]})]}),e.jsx(H,{name:"gemini",label:"Google Gemini CLI (1000 req/day free)",badge:"FREE",badgeColor:"green",enabled:N,installed:o?.geminiCli?.installed??!1,statusLoading:r,saving:d,onToggle:R,modelInput:j,setModelInput:f,onModelBlur:w,modelSaved:b,modelPlaceholder:"gemini-2.5-flash",showHint:k,setShowHint:W,installCmd:"npm install -g @google/gemini-cli",docsUrl:"https://github.com/google-gemini/gemini-cli",hintColor:"amber"}),e.jsx(H,{name:"opencode",label:"OpenCode (web search via Zen)",badge:"FREE",badgeColor:"green",enabled:L,installed:o?.opencodeCli?.installed??!1,statusLoading:r,saving:d,onToggle:P,modelInput:S,setModelInput:v,onModelBlur:l,modelSaved:C,modelPlaceholder:"opencode/grok-code",showHint:E,setShowHint:M,installCmd:"curl -fsSL https://opencode.ai/install | bash",docsUrl:"https://github.com/sst/opencode",hintColor:"purple"}),e.jsx(H,{name:"grok",label:"xAI Grok CLI (web + X search)",badge:"GROK_API_KEY",badgeColor:"blue",enabled:O,installed:o?.grokCli?.installed??!1,statusLoading:r,saving:d,onToggle:$,showHint:G,setShowHint:I,installCmd:"npm install -g @vibe-kit/grok-cli",docsUrl:"https://github.com/superagent-ai/grok-cli",hintColor:"blue"})]})]})}),e.jsx("div",{className:"p-4 border-t bg-background",children:e.jsxs(T,{variant:"outline",size:"sm",onClick:()=>{h(),i()},disabled:g||d,className:"w-full",children:[e.jsx(y,{className:`w-4 h-4 mr-2 ${g?"animate-spin":""}`}),s("settings.refresh")]})})]})}export{be as default};
@@ -0,0 +1 @@
1
+ import{j as e}from"./radix-ui-BR1vy4kf.js";import{r as o}from"./react-vendor-CNOkPC89.js";import{a as q,b6 as J,b8 as X,d as I,n as Y,L as A,r as R,s as M,t as K,v as B,w as E,I as F}from"./index-hlYFfpDN.js";import{S as Q}from"./switch-DFLN6xA0.js";import{R as $,a3 as Z,u as ee,a4 as se,J as te,q as re}from"./icons-kPbuhVdj.js";import"./tanstack-e99Cjjy2.js";import"./notifications-B2HqRBj7.js";import"./utils-CzKF5WmX.js";import"./form-utils-Cn_Uld6y.js";import"./code-highlight-BRUf_pqB.js";const z={mode:"auto",tier_defaults:{opus:"high",sonnet:"medium",haiku:"low"},show_warnings:!0},U=1e4;function ie(){const[t,i]=o.useState(null),[b,d]=o.useState(!0),[_,N]=o.useState(!1),[p,g]=o.useState(null),[P,y]=o.useState(!1),f=o.useRef(void 0),w=o.useRef(!1),k=o.useCallback(async()=>{const r=new AbortController,c=setTimeout(()=>r.abort(),U);try{d(!0),g(null);const n=await fetch("/api/thinking",{signal:r.signal});if(clearTimeout(c),!n.ok)throw n.headers.get("content-type")?.includes("text/html")?new Error(`Server error (${n.status})`):new Error("Failed to load Thinking config");const m=await n.json();i(m.config||z),f.current=m.lastModified,w.current=!0}catch(n){clearTimeout(c),n.name==="AbortError"?g("Request timeout - please try again"):g(n.message)}finally{d(!1)}return()=>r.abort()},[]),l=o.useCallback(async r=>{if(!w.current||t===null){g("Cannot save settings before they load. Click Refresh and try again.");return}const c=t,n={...c,...r.mode!==void 0?{mode:r.mode}:{},...r.tier_defaults!==void 0?{tier_defaults:r.tier_defaults}:{},...r.show_warnings!==void 0?{show_warnings:r.show_warnings}:{}};r.clear_override||r.override===null?delete n.override:r.override!==void 0&&(n.override=r.override),r.clear_provider_overrides||r.provider_overrides===null?delete n.provider_overrides:r.provider_overrides!==void 0&&(n.provider_overrides=r.provider_overrides),i(n);const m=new AbortController,h=setTimeout(()=>m.abort(),U);try{N(!0),g(null);const x={...n,lastModified:f.current},u=await fetch("/api/thinking",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(x),signal:m.signal});if(clearTimeout(h),!u.ok){if(u.headers.get("content-type")?.includes("text/html"))throw new Error(`Server error (${u.status})`);const s=await u.json();throw u.status===409?new Error("Config changed by another session. Refreshing..."):new Error(s.error||"Failed to save")}const v=await u.json();i(v.config),f.current=v.lastModified,y(!0),setTimeout(()=>y(!1),1500)}catch(x){clearTimeout(h),i(c),x.name==="AbortError"?g("Request timeout - please try again"):(g(x.message),x.message.includes("another session")&&setTimeout(()=>k(),1e3))}finally{N(!1)}},[t,k]),T=o.useCallback(r=>{l({mode:r})},[l]),C=o.useCallback((r,c)=>{const n=t?.tier_defaults||z.tier_defaults;l({tier_defaults:{...n,[r]:c}})},[t,l]),S=o.useCallback(r=>{l({show_warnings:r})},[l]),D=o.useCallback(r=>{if(r===void 0){l({override:null,clear_override:!0});return}l({override:r,clear_override:!1})},[l]),L=o.useCallback((r,c,n)=>{const m=t?.provider_overrides||{},h=m[r]||{};if(n===void 0){const{[c]:x,...u}=h,v=Object.keys(u).length>0?u:void 0,{[r]:O,...s}=m,a=v?{...s,[r]:v}:s;l({provider_overrides:Object.keys(a).length>0?a:null,clear_provider_overrides:Object.keys(a).length===0})}else l({provider_overrides:{...m,[r]:{...h,[c]:n}},clear_provider_overrides:!1})},[t,l]);return{config:t||z,loading:b,saving:_,error:p,success:P,fetchConfig:k,saveConfig:l,setMode:T,setTierDefault:C,setShowWarnings:S,setOverride:D,setProviderOverride:L}}const H=[{value:"minimal",label:"Minimal (512 tokens)"},{value:"low",label:"Low (1K tokens)"},{value:"medium",label:"Medium (8K tokens)"},{value:"high",label:"High (24K tokens)"},{value:"xhigh",label:"Extra High (32K tokens)"},{value:"auto",label:"Auto (dynamic)"}],ne=[{value:"__none__",label:"None (use CLI flags only)"},...H,{value:"__custom__",label:"Custom budget (number)"},{value:"off",label:"Off (disable thinking)"}],ae=["agy","gemini","codex"],G=0,V=1e5;function ve(){const{t}=q(),{config:i,loading:b,saving:d,error:_,success:N,fetchConfig:p,setMode:g,setTierDefault:P,setShowWarnings:y,setOverride:f,setProviderOverride:w}=ie(),[k,l]=o.useState(null),[T,C]=o.useState(""),[S,D]=o.useState([]),[L,r]=o.useState(null),c=o.useMemo(()=>Array.from(new Set([...ae,...Object.keys(i.provider_overrides??{}),...S])),[S,i.provider_overrides]),n=i.override===void 0?"__none__":typeof i.override=="number"||/^\d+$/.test(String(i.override))?"__custom__":String(i.override),m=typeof i.override=="number"||/^\d+$/.test(String(i.override??""))?String(i.override):"",h=L??m,x=Object.keys(i.provider_overrides??{}).length>0,u=k??x;o.useEffect(()=>{p()},[p]);const v=()=>{const s=T.trim().toLowerCase();s&&(c.includes(s)||D(a=>[...a,s]),C(""),l(!0))},O=()=>{const s=h.trim();if(!s){f(void 0);return}const a=Number.parseInt(s,10);Number.isNaN(a)||a<G||a>V||!/^\d+$/.test(s)||f(a)};return b?e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsxs("div",{className:"flex items-center gap-3 text-muted-foreground",children:[e.jsx($,{className:"w-5 h-5 animate-spin"}),e.jsx("span",{children:t("settings.loading")})]})}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:`absolute left-5 right-5 top-20 z-10 transition-all duration-200 ease-out ${_||N?"opacity-100 translate-y-0":"opacity-0 -translate-y-2 pointer-events-none"}`,children:[_&&e.jsx(J,{variant:"destructive",className:"py-2 shadow-lg",children:e.jsxs("div",{className:"flex items-center justify-between w-full",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Z,{className:"h-4 w-4"}),e.jsx(X,{children:_})]}),e.jsxs(I,{variant:"outline",size:"sm",onClick:p,className:"h-7 px-2 text-xs border-destructive/50 hover:bg-destructive/10",children:[e.jsx($,{className:"w-3 h-3 mr-1"}),t("sharedPage.retry")]})]})}),N&&e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-md border border-green-200 bg-green-50 text-green-700 shadow-lg dark:border-green-900/50 dark:bg-green-900/90 dark:text-green-300",children:[e.jsx(ee,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"text-sm font-medium",children:t("settings.saved")})]})]}),e.jsx(Y,{className:"flex-1",children:e.jsxs("div",{className:"p-5 space-y-6",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(se,{className:"w-5 h-5 text-primary"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t("settingsThinking.description")})]}),e.jsxs("div",{className:"flex items-start gap-2 p-3 rounded-lg bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800",children:[e.jsx(te,{className:"w-4 h-4 text-blue-600 dark:text-blue-400 shrink-0 mt-0.5"}),e.jsxs("div",{className:"text-sm text-blue-700 dark:text-blue-300",children:[e.jsx("p",{className:"font-medium",children:t("settingsThinking.supportedProviders")}),e.jsxs("ul",{className:"mt-1 space-y-0.5 text-blue-600 dark:text-blue-400",children:[e.jsxs("li",{children:[t("settingsThinking.supportLine1Prefix")," ",e.jsx("strong",{children:"agy"}),","," ",e.jsx("strong",{children:"gemini"})," ",t("settingsThinking.supportLine1Suffix")]}),e.jsxs("li",{children:[t("settingsThinking.supportLine2Prefix")," ",e.jsx("strong",{children:"codex"})," ",t("settingsThinking.supportLine2SuffixPrefix"),e.jsx("code",{children:"--effort"}),t("settingsThinking.supportLine2SuffixPostfix")]}),e.jsxs("li",{children:[t("settingsThinking.supportLine3Prefix")," ",e.jsx("code",{children:"-high"}),t("settingsThinking.supportLine3Suffix")]})]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-base font-medium",children:t("settingsThinking.modeTitle")}),e.jsx("div",{className:"space-y-2",children:["auto","off","manual"].map(s=>e.jsxs("div",{className:`flex items-center justify-between p-4 rounded-lg cursor-pointer transition-colors ${i.mode===s?"bg-primary/10 border border-primary/30":"bg-muted/50 hover:bg-muted/80"} ${d?"opacity-70 pointer-events-none":""}`,onClick:()=>{d||g(s)},children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium capitalize",children:s}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[s==="auto"&&t("settingsThinking.modeAutoDesc"),s==="off"&&t("settingsThinking.modeOffDesc"),s==="manual"&&t("settingsThinking.modeManualDesc")]})]}),e.jsx("div",{className:`w-4 h-4 rounded-full border-2 ${i.mode===s?"bg-primary border-primary":"border-muted-foreground/50"}`})]},s))})]}),i.mode==="auto"&&e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-base font-medium",children:t("settingsThinking.tierDefaults")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t("settingsThinking.tierDefaultsDesc")}),e.jsx("div",{className:"space-y-3",children:["opus","sonnet","haiku"].map(s=>e.jsxs("div",{className:"flex items-center gap-4 p-3 rounded-lg bg-muted/30",children:[e.jsx(A,{className:"w-20 capitalize font-medium",children:s}),e.jsxs(R,{value:i.tier_defaults[s],onValueChange:a=>P(s,a),disabled:d,children:[e.jsx(M,{className:"flex-1",children:e.jsx(K,{})}),e.jsx(B,{children:H.map(a=>e.jsx(E,{value:a.value,children:a.label},a.value))})]})]},s))})]}),i.mode==="manual"&&e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-base font-medium",children:t("settingsThinking.persistentOverride")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t("settingsThinking.persistentOverrideDesc")}),e.jsxs(R,{value:n,onValueChange:s=>{if(s==="__none__"){f(void 0);return}if(s==="__custom__"){h||r("8192");return}r(null),f(s)},disabled:d,children:[e.jsx(M,{children:e.jsx(K,{})}),e.jsx(B,{children:ne.map(s=>e.jsx(E,{value:s.value,children:s.label},s.value))})]}),n==="__custom__"&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(F,{type:"number",min:G,max:V,value:h,onChange:s=>r(s.target.value),onBlur:O,disabled:d,placeholder:t("settingsThinking.enterCustomBudget")}),e.jsx(I,{type:"button",size:"sm",variant:"outline",onClick:O,disabled:d,children:t("settingsThinking.apply")})]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Range: ",G," to ",V]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("button",{type:"button",className:"flex items-center gap-2 text-base font-medium w-full text-left",onClick:()=>l(s=>!(s??x)),disabled:d,children:[e.jsx(re,{className:`w-4 h-4 transition-transform ${u?"rotate-0":"-rotate-90"}`}),t("settingsThinking.providerOverrides",{count:Object.keys(i.provider_overrides??{}).length})]}),u&&e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:t("settingsThinking.providerOverridesDesc")}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(F,{value:T,onChange:s=>C(s.target.value),disabled:d,placeholder:t("settingsThinking.addProviderPlaceholder")}),e.jsx(I,{type:"button",size:"sm",variant:"outline",onClick:v,disabled:d,children:t("settingsGlobalEnv.add")})]}),c.map(s=>e.jsxs("div",{className:"space-y-2 p-3 rounded-lg bg-muted/30",children:[e.jsx(A,{className:"capitalize font-medium text-sm",children:s}),e.jsx("div",{className:"grid grid-cols-3 gap-2",children:["opus","sonnet","haiku"].map(a=>{const W=i.provider_overrides?.[s]?.[a]||"__default__";return e.jsxs("div",{className:"space-y-1",children:[e.jsx(A,{className:"text-xs text-muted-foreground capitalize",children:a}),e.jsxs(R,{value:W,onValueChange:j=>w(s,a,j==="__default__"?void 0:j),disabled:d,children:[e.jsx(M,{className:"h-8 text-xs",children:e.jsx(K,{})}),e.jsxs(B,{children:[e.jsx(E,{value:"__default__",children:t("cursorPage.default")}),H.map(j=>e.jsx(E,{value:j.value,children:j.label},j.value))]})]})]},a)})})]},s))]})]}),e.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-muted/50",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:t("settingsThinking.showWarnings")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t("settingsThinking.showWarningsDesc")})]}),e.jsx(Q,{checked:i.show_warnings??!0,onCheckedChange:y,disabled:d})]}),e.jsxs("div",{className:"p-4 rounded-lg border bg-muted/30",children:[e.jsx("h4",{className:"text-sm font-medium mb-2",children:t("settingsThinking.cliEnvOverride")}),e.jsxs("p",{className:"text-sm text-muted-foreground mb-2",children:["Override per session with flags or"," ",e.jsx("code",{className:"px-1.5 py-0.5 rounded bg-muted",children:"CCS_THINKING"})," env var. Priority: flag > env > config."]}),e.jsxs("div",{className:"space-y-1 text-sm font-mono text-muted-foreground",children:[e.jsx("p",{children:"ccs gemini --thinking high"}),e.jsx("p",{children:"ccs codex --effort xhigh"}),e.jsx("p",{children:'CCS_THINKING=high ccs codex "debug this"'}),e.jsx("p",{children:"ccs config thinking --mode auto"})]})]})]})}),e.jsx("div",{className:"p-4 border-t bg-background",children:e.jsxs(I,{variant:"outline",size:"sm",onClick:p,disabled:b||d,className:"w-full",children:[e.jsx($,{className:`w-4 h-4 mr-2 ${b?"animate-spin":""}`}),t("settings.refresh")]})})]})}export{ve as default};