ima2-gen 3.15.1 → 3.16.0

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 (764) hide show
  1. package/CHANGELOG.md +11 -1
  2. package/README.md +7 -6
  3. package/bin/commands/grok.js +150 -64
  4. package/bin/commands/service.js +5 -4
  5. package/bin/ima2.js +3 -3
  6. package/bin/lib/doctor-providers.js +6 -1
  7. package/bin/lib/doctor-runtime.js +1 -1
  8. package/config.js +0 -9
  9. package/docs/API.md +7 -7
  10. package/docs/API.zh-CN.md +7 -7
  11. package/docs/API.zh-TW.md +7 -7
  12. package/docs/CLI.md +9 -8
  13. package/docs/CLI.zh-CN.md +8 -8
  14. package/docs/CLI.zh-TW.md +8 -8
  15. package/docs/README.ko.md +5 -6
  16. package/docs/README.zh-CN.md +6 -5
  17. package/docs/README.zh-TW.md +6 -5
  18. package/docs/migration/runtime-test-inventory.md +4 -6
  19. package/lib/agentPlannerModel.js +17 -16
  20. package/lib/capabilities.js +3 -2
  21. package/lib/errors/providerMap.js +13 -0
  22. package/lib/grokImageCore.js +9 -16
  23. package/lib/grokImagePlanner.js +15 -3
  24. package/lib/grokRuntime.js +47 -16
  25. package/lib/grokVideoAdapter.js +23 -7
  26. package/lib/grokVideoPoll.js +3 -3
  27. package/lib/grokVideoShared.js +6 -13
  28. package/lib/promptBuilder/router.js +22 -6
  29. package/lib/providers/adapters/grokExecution.js +15 -14
  30. package/lib/providers/adapters/grokMultimodeOperations.js +9 -7
  31. package/lib/providers/adapters/grokOperations.js +19 -12
  32. package/lib/providers/execution/admission.js +20 -4
  33. package/lib/providers/registry.js +1 -1
  34. package/lib/runtimeContext.js +0 -12
  35. package/lib/videoExtendI2vOperation.js +5 -1
  36. package/lib/xaiAuth.js +369 -0
  37. package/lib/xaiDeviceLogin.js +157 -0
  38. package/package.json +2 -4
  39. package/routes/auth.js +18 -26
  40. package/routes/grok.js +25 -19
  41. package/routes/health.js +4 -5
  42. package/routes/models.js +12 -26
  43. package/routes/quota.js +2 -1
  44. package/routes/video.js +7 -2
  45. package/routes/videoExtended.js +37 -24
  46. package/server.js +7 -58
  47. package/skills/ima2/SKILL.md +2 -2
  48. package/ui/dist/.vite/manifest.json +56 -56
  49. package/ui/dist/assets/{AgentWorkspace-CLJDCRMQ.js → AgentWorkspace-DlLaTsPK.js} +1 -1
  50. package/ui/dist/assets/{App-DkvU6Sex.js → App-BfpvLzSs.js} +4 -4
  51. package/ui/dist/assets/{AssetGenWorkspace-BepUrz23.js → AssetGenWorkspace-C8eIs-bS.js} +2 -2
  52. package/ui/dist/assets/{AssetsWorkspace-IipC1FdD.js → AssetsWorkspace-BcbAM8uC.js} +1 -1
  53. package/ui/dist/assets/{CardNewsWorkspace-ZXDwYz4l.js → CardNewsWorkspace-CM5hwbRV.js} +1 -1
  54. package/ui/dist/assets/{GenerationRequestLogPanel-BL2C0DcW.js → GenerationRequestLogPanel-CTs8OymS.js} +1 -1
  55. package/ui/dist/assets/{HomeWorkspace-DFfrwS9a.js → HomeWorkspace-KGUtIZyG.js} +1 -1
  56. package/ui/dist/assets/{KeyingPanel-BQkEMTe9.js → KeyingPanel-D8ZHmWcC.js} +1 -1
  57. package/ui/dist/assets/{NodeCanvas-5u8IO1MA.js → NodeCanvas-D2N3m-1s.js} +1 -1
  58. package/ui/dist/assets/{PromptBuilderPanel-DNt7LHMi.js → PromptBuilderPanel-BolZnOa7.js} +1 -1
  59. package/ui/dist/assets/{PromptImportDialog-Bl-SB4mK.js → PromptImportDialog-DBpe7Vkj.js} +2 -2
  60. package/ui/dist/assets/{PromptImportDiscoverySection-DdZAdRMW.js → PromptImportDiscoverySection-Dk6v6lUZ.js} +1 -1
  61. package/ui/dist/assets/{PromptImportFolderSection-DLHQKl9T.js → PromptImportFolderSection-BE7Nfq9Y.js} +1 -1
  62. package/ui/dist/assets/{PromptLibraryPanel-PLWyvEz1.js → PromptLibraryPanel-Qdujpb4L.js} +2 -2
  63. package/ui/dist/assets/{SettingsWorkspace-Etfeu2IF.js → SettingsWorkspace-Dm4wezu_.js} +1 -1
  64. package/ui/dist/assets/{SpriteRecipeWorkspace-D7H5seOM.js → SpriteRecipeWorkspace-D9do9V7F.js} +1 -1
  65. package/ui/dist/assets/index-CfGRmfFv.js +22 -0
  66. package/ui/dist/assets/{index-BAkbTbUC.js → index-CfrOcJIe.js} +3 -3
  67. package/ui/dist/assets/{pptxgen.es-Apxh5DQ9.js → pptxgen.es-BLI_YKez.js} +1 -1
  68. package/ui/dist/assets/{promptBuilderStore-prvdLIUP.js → promptBuilderStore-BMiudG9n.js} +1 -1
  69. package/ui/dist/assets/useAgentDialogFocus-CCj5EYE9.js +1 -0
  70. package/ui/dist/index.html +1 -1
  71. package/lib/grokProxyLauncher.js +0 -279
  72. package/node_modules/array-flatten/LICENSE +0 -21
  73. package/node_modules/array-flatten/README.md +0 -43
  74. package/node_modules/array-flatten/array-flatten.js +0 -64
  75. package/node_modules/array-flatten/package.json +0 -39
  76. package/node_modules/bundle-name/index.js +0 -5
  77. package/node_modules/bundle-name/license +0 -9
  78. package/node_modules/bundle-name/package.json +0 -45
  79. package/node_modules/bundle-name/readme.md +0 -23
  80. package/node_modules/bytes/History.md +0 -97
  81. package/node_modules/bytes/LICENSE +0 -23
  82. package/node_modules/bytes/Readme.md +0 -152
  83. package/node_modules/bytes/index.js +0 -170
  84. package/node_modules/bytes/package.json +0 -42
  85. package/node_modules/call-bind-apply-helpers/.eslintrc +0 -17
  86. package/node_modules/call-bind-apply-helpers/.github/FUNDING.yml +0 -12
  87. package/node_modules/call-bind-apply-helpers/.nycrc +0 -9
  88. package/node_modules/call-bind-apply-helpers/CHANGELOG.md +0 -30
  89. package/node_modules/call-bind-apply-helpers/LICENSE +0 -21
  90. package/node_modules/call-bind-apply-helpers/README.md +0 -62
  91. package/node_modules/call-bind-apply-helpers/actualApply.d.ts +0 -1
  92. package/node_modules/call-bind-apply-helpers/actualApply.js +0 -10
  93. package/node_modules/call-bind-apply-helpers/applyBind.d.ts +0 -19
  94. package/node_modules/call-bind-apply-helpers/applyBind.js +0 -10
  95. package/node_modules/call-bind-apply-helpers/functionApply.d.ts +0 -1
  96. package/node_modules/call-bind-apply-helpers/functionApply.js +0 -4
  97. package/node_modules/call-bind-apply-helpers/functionCall.d.ts +0 -1
  98. package/node_modules/call-bind-apply-helpers/functionCall.js +0 -4
  99. package/node_modules/call-bind-apply-helpers/index.d.ts +0 -64
  100. package/node_modules/call-bind-apply-helpers/index.js +0 -15
  101. package/node_modules/call-bind-apply-helpers/package.json +0 -85
  102. package/node_modules/call-bind-apply-helpers/reflectApply.d.ts +0 -3
  103. package/node_modules/call-bind-apply-helpers/reflectApply.js +0 -4
  104. package/node_modules/call-bind-apply-helpers/test/index.js +0 -63
  105. package/node_modules/call-bind-apply-helpers/tsconfig.json +0 -9
  106. package/node_modules/call-bound/.eslintrc +0 -13
  107. package/node_modules/call-bound/.github/FUNDING.yml +0 -12
  108. package/node_modules/call-bound/.nycrc +0 -9
  109. package/node_modules/call-bound/CHANGELOG.md +0 -42
  110. package/node_modules/call-bound/LICENSE +0 -21
  111. package/node_modules/call-bound/README.md +0 -53
  112. package/node_modules/call-bound/index.d.ts +0 -94
  113. package/node_modules/call-bound/index.js +0 -19
  114. package/node_modules/call-bound/package.json +0 -99
  115. package/node_modules/call-bound/test/index.js +0 -61
  116. package/node_modules/call-bound/tsconfig.json +0 -10
  117. package/node_modules/commander/LICENSE +0 -22
  118. package/node_modules/commander/Readme.md +0 -1149
  119. package/node_modules/commander/esm.mjs +0 -16
  120. package/node_modules/commander/index.js +0 -24
  121. package/node_modules/commander/lib/argument.js +0 -149
  122. package/node_modules/commander/lib/command.js +0 -2662
  123. package/node_modules/commander/lib/error.js +0 -39
  124. package/node_modules/commander/lib/help.js +0 -709
  125. package/node_modules/commander/lib/option.js +0 -367
  126. package/node_modules/commander/lib/suggestSimilar.js +0 -101
  127. package/node_modules/commander/package-support.json +0 -16
  128. package/node_modules/commander/package.json +0 -82
  129. package/node_modules/commander/typings/esm.d.mts +0 -3
  130. package/node_modules/commander/typings/index.d.ts +0 -1045
  131. package/node_modules/content-type/HISTORY.md +0 -29
  132. package/node_modules/content-type/LICENSE +0 -22
  133. package/node_modules/content-type/README.md +0 -94
  134. package/node_modules/content-type/index.js +0 -225
  135. package/node_modules/content-type/package.json +0 -42
  136. package/node_modules/cookie/LICENSE +0 -24
  137. package/node_modules/cookie/README.md +0 -317
  138. package/node_modules/cookie/SECURITY.md +0 -25
  139. package/node_modules/cookie/index.js +0 -335
  140. package/node_modules/cookie/package.json +0 -44
  141. package/node_modules/default-browser/index.d.ts +0 -29
  142. package/node_modules/default-browser/index.js +0 -34
  143. package/node_modules/default-browser/license +0 -9
  144. package/node_modules/default-browser/package.json +0 -54
  145. package/node_modules/default-browser/readme.md +0 -24
  146. package/node_modules/default-browser/windows.js +0 -57
  147. package/node_modules/default-browser-id/index.js +0 -25
  148. package/node_modules/default-browser-id/license +0 -9
  149. package/node_modules/default-browser-id/package.json +0 -41
  150. package/node_modules/default-browser-id/readme.md +0 -19
  151. package/node_modules/define-lazy-prop/index.d.ts +0 -31
  152. package/node_modules/define-lazy-prop/index.js +0 -18
  153. package/node_modules/define-lazy-prop/license +0 -9
  154. package/node_modules/define-lazy-prop/package.json +0 -51
  155. package/node_modules/define-lazy-prop/readme.md +0 -55
  156. package/node_modules/depd/History.md +0 -103
  157. package/node_modules/depd/LICENSE +0 -22
  158. package/node_modules/depd/Readme.md +0 -280
  159. package/node_modules/depd/index.js +0 -538
  160. package/node_modules/depd/lib/browser/index.js +0 -77
  161. package/node_modules/depd/package.json +0 -45
  162. package/node_modules/destroy/LICENSE +0 -23
  163. package/node_modules/destroy/README.md +0 -63
  164. package/node_modules/destroy/index.js +0 -209
  165. package/node_modules/destroy/package.json +0 -48
  166. package/node_modules/dunder-proto/.eslintrc +0 -5
  167. package/node_modules/dunder-proto/.github/FUNDING.yml +0 -12
  168. package/node_modules/dunder-proto/.nycrc +0 -13
  169. package/node_modules/dunder-proto/CHANGELOG.md +0 -24
  170. package/node_modules/dunder-proto/LICENSE +0 -21
  171. package/node_modules/dunder-proto/README.md +0 -54
  172. package/node_modules/dunder-proto/get.d.ts +0 -5
  173. package/node_modules/dunder-proto/get.js +0 -30
  174. package/node_modules/dunder-proto/package.json +0 -76
  175. package/node_modules/dunder-proto/set.d.ts +0 -5
  176. package/node_modules/dunder-proto/set.js +0 -35
  177. package/node_modules/dunder-proto/test/get.js +0 -34
  178. package/node_modules/dunder-proto/test/index.js +0 -4
  179. package/node_modules/dunder-proto/test/set.js +0 -50
  180. package/node_modules/dunder-proto/tsconfig.json +0 -9
  181. package/node_modules/ee-first/LICENSE +0 -22
  182. package/node_modules/ee-first/README.md +0 -80
  183. package/node_modules/ee-first/index.js +0 -95
  184. package/node_modules/ee-first/package.json +0 -29
  185. package/node_modules/encodeurl/LICENSE +0 -22
  186. package/node_modules/encodeurl/README.md +0 -109
  187. package/node_modules/encodeurl/index.js +0 -60
  188. package/node_modules/encodeurl/package.json +0 -40
  189. package/node_modules/es-define-property/.eslintrc +0 -13
  190. package/node_modules/es-define-property/.github/FUNDING.yml +0 -12
  191. package/node_modules/es-define-property/.nycrc +0 -9
  192. package/node_modules/es-define-property/CHANGELOG.md +0 -29
  193. package/node_modules/es-define-property/LICENSE +0 -21
  194. package/node_modules/es-define-property/README.md +0 -49
  195. package/node_modules/es-define-property/index.d.ts +0 -3
  196. package/node_modules/es-define-property/index.js +0 -14
  197. package/node_modules/es-define-property/package.json +0 -81
  198. package/node_modules/es-define-property/test/index.js +0 -56
  199. package/node_modules/es-define-property/tsconfig.json +0 -10
  200. package/node_modules/es-errors/.eslintrc +0 -5
  201. package/node_modules/es-errors/.github/FUNDING.yml +0 -12
  202. package/node_modules/es-errors/CHANGELOG.md +0 -40
  203. package/node_modules/es-errors/LICENSE +0 -21
  204. package/node_modules/es-errors/README.md +0 -55
  205. package/node_modules/es-errors/eval.d.ts +0 -3
  206. package/node_modules/es-errors/eval.js +0 -4
  207. package/node_modules/es-errors/index.d.ts +0 -3
  208. package/node_modules/es-errors/index.js +0 -4
  209. package/node_modules/es-errors/package.json +0 -80
  210. package/node_modules/es-errors/range.d.ts +0 -3
  211. package/node_modules/es-errors/range.js +0 -4
  212. package/node_modules/es-errors/ref.d.ts +0 -3
  213. package/node_modules/es-errors/ref.js +0 -4
  214. package/node_modules/es-errors/syntax.d.ts +0 -3
  215. package/node_modules/es-errors/syntax.js +0 -4
  216. package/node_modules/es-errors/test/index.js +0 -19
  217. package/node_modules/es-errors/tsconfig.json +0 -49
  218. package/node_modules/es-errors/type.d.ts +0 -3
  219. package/node_modules/es-errors/type.js +0 -4
  220. package/node_modules/es-errors/uri.d.ts +0 -3
  221. package/node_modules/es-errors/uri.js +0 -4
  222. package/node_modules/es-object-atoms/.eslintrc +0 -16
  223. package/node_modules/es-object-atoms/.github/FUNDING.yml +0 -12
  224. package/node_modules/es-object-atoms/CHANGELOG.md +0 -37
  225. package/node_modules/es-object-atoms/LICENSE +0 -21
  226. package/node_modules/es-object-atoms/README.md +0 -63
  227. package/node_modules/es-object-atoms/RequireObjectCoercible.d.ts +0 -3
  228. package/node_modules/es-object-atoms/RequireObjectCoercible.js +0 -11
  229. package/node_modules/es-object-atoms/ToObject.d.ts +0 -7
  230. package/node_modules/es-object-atoms/ToObject.js +0 -10
  231. package/node_modules/es-object-atoms/index.d.ts +0 -3
  232. package/node_modules/es-object-atoms/index.js +0 -4
  233. package/node_modules/es-object-atoms/isObject.d.ts +0 -3
  234. package/node_modules/es-object-atoms/isObject.js +0 -6
  235. package/node_modules/es-object-atoms/package.json +0 -80
  236. package/node_modules/es-object-atoms/test/index.js +0 -38
  237. package/node_modules/es-object-atoms/tsconfig.json +0 -6
  238. package/node_modules/escape-html/LICENSE +0 -24
  239. package/node_modules/escape-html/Readme.md +0 -43
  240. package/node_modules/escape-html/index.js +0 -78
  241. package/node_modules/escape-html/package.json +0 -24
  242. package/node_modules/etag/HISTORY.md +0 -83
  243. package/node_modules/etag/LICENSE +0 -22
  244. package/node_modules/etag/README.md +0 -159
  245. package/node_modules/etag/index.js +0 -131
  246. package/node_modules/etag/package.json +0 -47
  247. package/node_modules/forwarded/HISTORY.md +0 -21
  248. package/node_modules/forwarded/LICENSE +0 -22
  249. package/node_modules/forwarded/README.md +0 -57
  250. package/node_modules/forwarded/index.js +0 -90
  251. package/node_modules/forwarded/package.json +0 -45
  252. package/node_modules/function-bind/.eslintrc +0 -21
  253. package/node_modules/function-bind/.github/FUNDING.yml +0 -12
  254. package/node_modules/function-bind/.github/SECURITY.md +0 -3
  255. package/node_modules/function-bind/.nycrc +0 -13
  256. package/node_modules/function-bind/CHANGELOG.md +0 -136
  257. package/node_modules/function-bind/LICENSE +0 -20
  258. package/node_modules/function-bind/README.md +0 -46
  259. package/node_modules/function-bind/implementation.js +0 -84
  260. package/node_modules/function-bind/index.js +0 -5
  261. package/node_modules/function-bind/package.json +0 -87
  262. package/node_modules/function-bind/test/.eslintrc +0 -9
  263. package/node_modules/function-bind/test/index.js +0 -252
  264. package/node_modules/get-intrinsic/.eslintrc +0 -42
  265. package/node_modules/get-intrinsic/.github/FUNDING.yml +0 -12
  266. package/node_modules/get-intrinsic/.nycrc +0 -9
  267. package/node_modules/get-intrinsic/CHANGELOG.md +0 -186
  268. package/node_modules/get-intrinsic/LICENSE +0 -21
  269. package/node_modules/get-intrinsic/README.md +0 -71
  270. package/node_modules/get-intrinsic/index.js +0 -378
  271. package/node_modules/get-intrinsic/package.json +0 -97
  272. package/node_modules/get-intrinsic/test/GetIntrinsic.js +0 -274
  273. package/node_modules/get-proto/.eslintrc +0 -10
  274. package/node_modules/get-proto/.github/FUNDING.yml +0 -12
  275. package/node_modules/get-proto/.nycrc +0 -9
  276. package/node_modules/get-proto/CHANGELOG.md +0 -21
  277. package/node_modules/get-proto/LICENSE +0 -21
  278. package/node_modules/get-proto/Object.getPrototypeOf.d.ts +0 -5
  279. package/node_modules/get-proto/Object.getPrototypeOf.js +0 -6
  280. package/node_modules/get-proto/README.md +0 -50
  281. package/node_modules/get-proto/Reflect.getPrototypeOf.d.ts +0 -3
  282. package/node_modules/get-proto/Reflect.getPrototypeOf.js +0 -4
  283. package/node_modules/get-proto/index.d.ts +0 -5
  284. package/node_modules/get-proto/index.js +0 -27
  285. package/node_modules/get-proto/package.json +0 -81
  286. package/node_modules/get-proto/test/index.js +0 -68
  287. package/node_modules/get-proto/tsconfig.json +0 -9
  288. package/node_modules/gopd/.eslintrc +0 -16
  289. package/node_modules/gopd/.github/FUNDING.yml +0 -12
  290. package/node_modules/gopd/CHANGELOG.md +0 -45
  291. package/node_modules/gopd/LICENSE +0 -21
  292. package/node_modules/gopd/README.md +0 -40
  293. package/node_modules/gopd/gOPD.d.ts +0 -1
  294. package/node_modules/gopd/gOPD.js +0 -4
  295. package/node_modules/gopd/index.d.ts +0 -5
  296. package/node_modules/gopd/index.js +0 -15
  297. package/node_modules/gopd/package.json +0 -77
  298. package/node_modules/gopd/test/index.js +0 -36
  299. package/node_modules/gopd/tsconfig.json +0 -9
  300. package/node_modules/has-symbols/.eslintrc +0 -11
  301. package/node_modules/has-symbols/.github/FUNDING.yml +0 -12
  302. package/node_modules/has-symbols/.nycrc +0 -9
  303. package/node_modules/has-symbols/CHANGELOG.md +0 -91
  304. package/node_modules/has-symbols/LICENSE +0 -21
  305. package/node_modules/has-symbols/README.md +0 -46
  306. package/node_modules/has-symbols/index.d.ts +0 -3
  307. package/node_modules/has-symbols/index.js +0 -14
  308. package/node_modules/has-symbols/package.json +0 -111
  309. package/node_modules/has-symbols/shams.d.ts +0 -3
  310. package/node_modules/has-symbols/shams.js +0 -45
  311. package/node_modules/has-symbols/test/index.js +0 -22
  312. package/node_modules/has-symbols/test/shams/core-js.js +0 -29
  313. package/node_modules/has-symbols/test/shams/get-own-property-symbols.js +0 -29
  314. package/node_modules/has-symbols/test/tests.js +0 -58
  315. package/node_modules/has-symbols/tsconfig.json +0 -10
  316. package/node_modules/hasown/.github/FUNDING.yml +0 -12
  317. package/node_modules/hasown/.nycrc +0 -13
  318. package/node_modules/hasown/CHANGELOG.md +0 -51
  319. package/node_modules/hasown/LICENSE +0 -21
  320. package/node_modules/hasown/README.md +0 -40
  321. package/node_modules/hasown/eslint.config.mjs +0 -6
  322. package/node_modules/hasown/index.d.ts +0 -4
  323. package/node_modules/hasown/index.js +0 -8
  324. package/node_modules/hasown/package.json +0 -92
  325. package/node_modules/hasown/tsconfig.json +0 -6
  326. package/node_modules/http-errors/HISTORY.md +0 -186
  327. package/node_modules/http-errors/LICENSE +0 -23
  328. package/node_modules/http-errors/README.md +0 -169
  329. package/node_modules/http-errors/index.js +0 -290
  330. package/node_modules/http-errors/package.json +0 -54
  331. package/node_modules/inherits/LICENSE +0 -16
  332. package/node_modules/inherits/README.md +0 -42
  333. package/node_modules/inherits/inherits.js +0 -9
  334. package/node_modules/inherits/inherits_browser.js +0 -27
  335. package/node_modules/inherits/package.json +0 -29
  336. package/node_modules/ipaddr.js/LICENSE +0 -19
  337. package/node_modules/ipaddr.js/README.md +0 -233
  338. package/node_modules/ipaddr.js/ipaddr.min.js +0 -1
  339. package/node_modules/ipaddr.js/lib/ipaddr.js +0 -673
  340. package/node_modules/ipaddr.js/lib/ipaddr.js.d.ts +0 -68
  341. package/node_modules/ipaddr.js/package.json +0 -35
  342. package/node_modules/is-docker/cli.js +0 -5
  343. package/node_modules/is-docker/index.d.ts +0 -13
  344. package/node_modules/is-docker/index.js +0 -29
  345. package/node_modules/is-docker/license +0 -9
  346. package/node_modules/is-docker/package.json +0 -44
  347. package/node_modules/is-docker/readme.md +0 -27
  348. package/node_modules/is-inside-container/cli.js +0 -5
  349. package/node_modules/is-inside-container/index.d.ts +0 -13
  350. package/node_modules/is-inside-container/index.js +0 -23
  351. package/node_modules/is-inside-container/license +0 -9
  352. package/node_modules/is-inside-container/package.json +0 -51
  353. package/node_modules/is-inside-container/readme.md +0 -36
  354. package/node_modules/is-wsl/index.d.ts +0 -15
  355. package/node_modules/is-wsl/index.js +0 -36
  356. package/node_modules/is-wsl/license +0 -9
  357. package/node_modules/is-wsl/package.json +0 -58
  358. package/node_modules/is-wsl/readme.md +0 -21
  359. package/node_modules/math-intrinsics/.eslintrc +0 -16
  360. package/node_modules/math-intrinsics/.github/FUNDING.yml +0 -12
  361. package/node_modules/math-intrinsics/CHANGELOG.md +0 -24
  362. package/node_modules/math-intrinsics/LICENSE +0 -21
  363. package/node_modules/math-intrinsics/README.md +0 -50
  364. package/node_modules/math-intrinsics/abs.d.ts +0 -1
  365. package/node_modules/math-intrinsics/abs.js +0 -4
  366. package/node_modules/math-intrinsics/constants/maxArrayLength.d.ts +0 -3
  367. package/node_modules/math-intrinsics/constants/maxArrayLength.js +0 -4
  368. package/node_modules/math-intrinsics/constants/maxSafeInteger.d.ts +0 -3
  369. package/node_modules/math-intrinsics/constants/maxSafeInteger.js +0 -5
  370. package/node_modules/math-intrinsics/constants/maxValue.d.ts +0 -3
  371. package/node_modules/math-intrinsics/constants/maxValue.js +0 -5
  372. package/node_modules/math-intrinsics/floor.d.ts +0 -1
  373. package/node_modules/math-intrinsics/floor.js +0 -4
  374. package/node_modules/math-intrinsics/isFinite.d.ts +0 -3
  375. package/node_modules/math-intrinsics/isFinite.js +0 -12
  376. package/node_modules/math-intrinsics/isInteger.d.ts +0 -3
  377. package/node_modules/math-intrinsics/isInteger.js +0 -16
  378. package/node_modules/math-intrinsics/isNaN.d.ts +0 -1
  379. package/node_modules/math-intrinsics/isNaN.js +0 -6
  380. package/node_modules/math-intrinsics/isNegativeZero.d.ts +0 -3
  381. package/node_modules/math-intrinsics/isNegativeZero.js +0 -6
  382. package/node_modules/math-intrinsics/max.d.ts +0 -1
  383. package/node_modules/math-intrinsics/max.js +0 -4
  384. package/node_modules/math-intrinsics/min.d.ts +0 -1
  385. package/node_modules/math-intrinsics/min.js +0 -4
  386. package/node_modules/math-intrinsics/mod.d.ts +0 -3
  387. package/node_modules/math-intrinsics/mod.js +0 -9
  388. package/node_modules/math-intrinsics/package.json +0 -86
  389. package/node_modules/math-intrinsics/pow.d.ts +0 -1
  390. package/node_modules/math-intrinsics/pow.js +0 -4
  391. package/node_modules/math-intrinsics/round.d.ts +0 -1
  392. package/node_modules/math-intrinsics/round.js +0 -4
  393. package/node_modules/math-intrinsics/sign.d.ts +0 -3
  394. package/node_modules/math-intrinsics/sign.js +0 -11
  395. package/node_modules/math-intrinsics/test/index.js +0 -192
  396. package/node_modules/math-intrinsics/tsconfig.json +0 -3
  397. package/node_modules/methods/HISTORY.md +0 -29
  398. package/node_modules/methods/LICENSE +0 -24
  399. package/node_modules/methods/README.md +0 -51
  400. package/node_modules/methods/index.js +0 -69
  401. package/node_modules/methods/package.json +0 -36
  402. package/node_modules/mime/.npmignore +0 -0
  403. package/node_modules/mime/CHANGELOG.md +0 -164
  404. package/node_modules/mime/LICENSE +0 -21
  405. package/node_modules/mime/README.md +0 -90
  406. package/node_modules/mime/cli.js +0 -8
  407. package/node_modules/mime/mime.js +0 -108
  408. package/node_modules/mime/package.json +0 -44
  409. package/node_modules/mime/src/build.js +0 -53
  410. package/node_modules/mime/src/test.js +0 -60
  411. package/node_modules/mime/types.json +0 -1
  412. package/node_modules/ms/index.js +0 -162
  413. package/node_modules/ms/license.md +0 -21
  414. package/node_modules/ms/package.json +0 -38
  415. package/node_modules/ms/readme.md +0 -59
  416. package/node_modules/object-inspect/.eslintrc +0 -53
  417. package/node_modules/object-inspect/.github/FUNDING.yml +0 -12
  418. package/node_modules/object-inspect/.nycrc +0 -13
  419. package/node_modules/object-inspect/CHANGELOG.md +0 -424
  420. package/node_modules/object-inspect/LICENSE +0 -21
  421. package/node_modules/object-inspect/example/all.js +0 -23
  422. package/node_modules/object-inspect/example/circular.js +0 -6
  423. package/node_modules/object-inspect/example/fn.js +0 -5
  424. package/node_modules/object-inspect/example/inspect.js +0 -10
  425. package/node_modules/object-inspect/index.js +0 -544
  426. package/node_modules/object-inspect/package-support.json +0 -20
  427. package/node_modules/object-inspect/package.json +0 -105
  428. package/node_modules/object-inspect/readme.markdown +0 -84
  429. package/node_modules/object-inspect/test/bigint.js +0 -58
  430. package/node_modules/object-inspect/test/browser/dom.js +0 -15
  431. package/node_modules/object-inspect/test/circular.js +0 -16
  432. package/node_modules/object-inspect/test/deep.js +0 -12
  433. package/node_modules/object-inspect/test/element.js +0 -53
  434. package/node_modules/object-inspect/test/err.js +0 -48
  435. package/node_modules/object-inspect/test/fakes.js +0 -29
  436. package/node_modules/object-inspect/test/fn.js +0 -76
  437. package/node_modules/object-inspect/test/global.js +0 -17
  438. package/node_modules/object-inspect/test/has.js +0 -15
  439. package/node_modules/object-inspect/test/holes.js +0 -15
  440. package/node_modules/object-inspect/test/indent-option.js +0 -271
  441. package/node_modules/object-inspect/test/inspect.js +0 -139
  442. package/node_modules/object-inspect/test/lowbyte.js +0 -12
  443. package/node_modules/object-inspect/test/number.js +0 -58
  444. package/node_modules/object-inspect/test/quoteStyle.js +0 -26
  445. package/node_modules/object-inspect/test/toStringTag.js +0 -40
  446. package/node_modules/object-inspect/test/undef.js +0 -12
  447. package/node_modules/object-inspect/test/values.js +0 -261
  448. package/node_modules/object-inspect/test-core-js.js +0 -26
  449. package/node_modules/object-inspect/util.inspect.js +0 -1
  450. package/node_modules/on-finished/HISTORY.md +0 -98
  451. package/node_modules/on-finished/LICENSE +0 -23
  452. package/node_modules/on-finished/README.md +0 -162
  453. package/node_modules/on-finished/index.js +0 -234
  454. package/node_modules/on-finished/package.json +0 -39
  455. package/node_modules/open/index.d.ts +0 -158
  456. package/node_modules/open/index.js +0 -366
  457. package/node_modules/open/license +0 -9
  458. package/node_modules/open/node_modules/wsl-utils/index.d.ts +0 -21
  459. package/node_modules/open/node_modules/wsl-utils/index.js +0 -57
  460. package/node_modules/open/node_modules/wsl-utils/license +0 -9
  461. package/node_modules/open/node_modules/wsl-utils/package.json +0 -46
  462. package/node_modules/open/node_modules/wsl-utils/readme.md +0 -50
  463. package/node_modules/open/package.json +0 -68
  464. package/node_modules/open/readme.md +0 -183
  465. package/node_modules/open/xdg-open +0 -1267
  466. package/node_modules/parseurl/HISTORY.md +0 -58
  467. package/node_modules/parseurl/LICENSE +0 -24
  468. package/node_modules/parseurl/README.md +0 -133
  469. package/node_modules/parseurl/index.js +0 -158
  470. package/node_modules/parseurl/package.json +0 -40
  471. package/node_modules/progrok/LICENSE +0 -21
  472. package/node_modules/progrok/README.md +0 -331
  473. package/node_modules/progrok/THIRD_PARTY_NOTICES.md +0 -13
  474. package/node_modules/progrok/dist/index.js +0 -1626
  475. package/node_modules/progrok/dist/index.js.map +0 -1
  476. package/node_modules/progrok/dist/public/app.js +0 -529
  477. package/node_modules/progrok/dist/public/index.html +0 -47
  478. package/node_modules/progrok/dist/public/style.css +0 -392
  479. package/node_modules/progrok/node_modules/accepts/HISTORY.md +0 -243
  480. package/node_modules/progrok/node_modules/accepts/LICENSE +0 -23
  481. package/node_modules/progrok/node_modules/accepts/README.md +0 -140
  482. package/node_modules/progrok/node_modules/accepts/index.js +0 -238
  483. package/node_modules/progrok/node_modules/accepts/package.json +0 -47
  484. package/node_modules/progrok/node_modules/body-parser/HISTORY.md +0 -686
  485. package/node_modules/progrok/node_modules/body-parser/LICENSE +0 -23
  486. package/node_modules/progrok/node_modules/body-parser/README.md +0 -476
  487. package/node_modules/progrok/node_modules/body-parser/index.js +0 -156
  488. package/node_modules/progrok/node_modules/body-parser/lib/read.js +0 -205
  489. package/node_modules/progrok/node_modules/body-parser/lib/types/json.js +0 -243
  490. package/node_modules/progrok/node_modules/body-parser/lib/types/raw.js +0 -101
  491. package/node_modules/progrok/node_modules/body-parser/lib/types/text.js +0 -121
  492. package/node_modules/progrok/node_modules/body-parser/lib/types/urlencoded.js +0 -299
  493. package/node_modules/progrok/node_modules/body-parser/package.json +0 -55
  494. package/node_modules/progrok/node_modules/content-disposition/HISTORY.md +0 -60
  495. package/node_modules/progrok/node_modules/content-disposition/LICENSE +0 -22
  496. package/node_modules/progrok/node_modules/content-disposition/README.md +0 -142
  497. package/node_modules/progrok/node_modules/content-disposition/index.js +0 -458
  498. package/node_modules/progrok/node_modules/content-disposition/package.json +0 -44
  499. package/node_modules/progrok/node_modules/cookie-signature/History.md +0 -42
  500. package/node_modules/progrok/node_modules/cookie-signature/Readme.md +0 -42
  501. package/node_modules/progrok/node_modules/cookie-signature/index.js +0 -51
  502. package/node_modules/progrok/node_modules/cookie-signature/package.json +0 -18
  503. package/node_modules/progrok/node_modules/debug/.coveralls.yml +0 -1
  504. package/node_modules/progrok/node_modules/debug/.eslintrc +0 -11
  505. package/node_modules/progrok/node_modules/debug/.npmignore +0 -9
  506. package/node_modules/progrok/node_modules/debug/.travis.yml +0 -14
  507. package/node_modules/progrok/node_modules/debug/CHANGELOG.md +0 -362
  508. package/node_modules/progrok/node_modules/debug/LICENSE +0 -19
  509. package/node_modules/progrok/node_modules/debug/Makefile +0 -50
  510. package/node_modules/progrok/node_modules/debug/README.md +0 -312
  511. package/node_modules/progrok/node_modules/debug/component.json +0 -19
  512. package/node_modules/progrok/node_modules/debug/karma.conf.js +0 -70
  513. package/node_modules/progrok/node_modules/debug/node.js +0 -1
  514. package/node_modules/progrok/node_modules/debug/node_modules/ms/index.js +0 -152
  515. package/node_modules/progrok/node_modules/debug/node_modules/ms/license.md +0 -21
  516. package/node_modules/progrok/node_modules/debug/node_modules/ms/package.json +0 -37
  517. package/node_modules/progrok/node_modules/debug/node_modules/ms/readme.md +0 -51
  518. package/node_modules/progrok/node_modules/debug/package.json +0 -49
  519. package/node_modules/progrok/node_modules/debug/src/browser.js +0 -185
  520. package/node_modules/progrok/node_modules/debug/src/debug.js +0 -202
  521. package/node_modules/progrok/node_modules/debug/src/index.js +0 -10
  522. package/node_modules/progrok/node_modules/debug/src/inspector-log.js +0 -15
  523. package/node_modules/progrok/node_modules/debug/src/node.js +0 -248
  524. package/node_modules/progrok/node_modules/express/History.md +0 -3676
  525. package/node_modules/progrok/node_modules/express/LICENSE +0 -24
  526. package/node_modules/progrok/node_modules/express/Readme.md +0 -260
  527. package/node_modules/progrok/node_modules/express/index.js +0 -11
  528. package/node_modules/progrok/node_modules/express/lib/application.js +0 -661
  529. package/node_modules/progrok/node_modules/express/lib/express.js +0 -116
  530. package/node_modules/progrok/node_modules/express/lib/middleware/init.js +0 -43
  531. package/node_modules/progrok/node_modules/express/lib/middleware/query.js +0 -47
  532. package/node_modules/progrok/node_modules/express/lib/request.js +0 -525
  533. package/node_modules/progrok/node_modules/express/lib/response.js +0 -1179
  534. package/node_modules/progrok/node_modules/express/lib/router/index.js +0 -673
  535. package/node_modules/progrok/node_modules/express/lib/router/layer.js +0 -181
  536. package/node_modules/progrok/node_modules/express/lib/router/route.js +0 -230
  537. package/node_modules/progrok/node_modules/express/lib/utils.js +0 -304
  538. package/node_modules/progrok/node_modules/express/lib/view.js +0 -182
  539. package/node_modules/progrok/node_modules/express/package.json +0 -102
  540. package/node_modules/progrok/node_modules/finalhandler/HISTORY.md +0 -216
  541. package/node_modules/progrok/node_modules/finalhandler/LICENSE +0 -22
  542. package/node_modules/progrok/node_modules/finalhandler/README.md +0 -147
  543. package/node_modules/progrok/node_modules/finalhandler/SECURITY.md +0 -25
  544. package/node_modules/progrok/node_modules/finalhandler/index.js +0 -341
  545. package/node_modules/progrok/node_modules/finalhandler/package.json +0 -47
  546. package/node_modules/progrok/node_modules/fresh/HISTORY.md +0 -70
  547. package/node_modules/progrok/node_modules/fresh/LICENSE +0 -23
  548. package/node_modules/progrok/node_modules/fresh/README.md +0 -119
  549. package/node_modules/progrok/node_modules/fresh/index.js +0 -137
  550. package/node_modules/progrok/node_modules/fresh/package.json +0 -46
  551. package/node_modules/progrok/node_modules/iconv-lite/Changelog.md +0 -162
  552. package/node_modules/progrok/node_modules/iconv-lite/LICENSE +0 -21
  553. package/node_modules/progrok/node_modules/iconv-lite/README.md +0 -156
  554. package/node_modules/progrok/node_modules/iconv-lite/encodings/dbcs-codec.js +0 -555
  555. package/node_modules/progrok/node_modules/iconv-lite/encodings/dbcs-data.js +0 -176
  556. package/node_modules/progrok/node_modules/iconv-lite/encodings/index.js +0 -22
  557. package/node_modules/progrok/node_modules/iconv-lite/encodings/internal.js +0 -188
  558. package/node_modules/progrok/node_modules/iconv-lite/encodings/sbcs-codec.js +0 -72
  559. package/node_modules/progrok/node_modules/iconv-lite/encodings/sbcs-data-generated.js +0 -451
  560. package/node_modules/progrok/node_modules/iconv-lite/encodings/sbcs-data.js +0 -174
  561. package/node_modules/progrok/node_modules/iconv-lite/encodings/tables/big5-added.json +0 -122
  562. package/node_modules/progrok/node_modules/iconv-lite/encodings/tables/cp936.json +0 -264
  563. package/node_modules/progrok/node_modules/iconv-lite/encodings/tables/cp949.json +0 -273
  564. package/node_modules/progrok/node_modules/iconv-lite/encodings/tables/cp950.json +0 -177
  565. package/node_modules/progrok/node_modules/iconv-lite/encodings/tables/eucjp.json +0 -182
  566. package/node_modules/progrok/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +0 -1
  567. package/node_modules/progrok/node_modules/iconv-lite/encodings/tables/gbk-added.json +0 -55
  568. package/node_modules/progrok/node_modules/iconv-lite/encodings/tables/shiftjis.json +0 -125
  569. package/node_modules/progrok/node_modules/iconv-lite/encodings/utf16.js +0 -177
  570. package/node_modules/progrok/node_modules/iconv-lite/encodings/utf7.js +0 -290
  571. package/node_modules/progrok/node_modules/iconv-lite/lib/bom-handling.js +0 -52
  572. package/node_modules/progrok/node_modules/iconv-lite/lib/extend-node.js +0 -217
  573. package/node_modules/progrok/node_modules/iconv-lite/lib/index.d.ts +0 -24
  574. package/node_modules/progrok/node_modules/iconv-lite/lib/index.js +0 -153
  575. package/node_modules/progrok/node_modules/iconv-lite/lib/streams.js +0 -121
  576. package/node_modules/progrok/node_modules/iconv-lite/package.json +0 -46
  577. package/node_modules/progrok/node_modules/media-typer/HISTORY.md +0 -22
  578. package/node_modules/progrok/node_modules/media-typer/LICENSE +0 -22
  579. package/node_modules/progrok/node_modules/media-typer/README.md +0 -81
  580. package/node_modules/progrok/node_modules/media-typer/index.js +0 -270
  581. package/node_modules/progrok/node_modules/media-typer/package.json +0 -26
  582. package/node_modules/progrok/node_modules/merge-descriptors/HISTORY.md +0 -21
  583. package/node_modules/progrok/node_modules/merge-descriptors/LICENSE +0 -23
  584. package/node_modules/progrok/node_modules/merge-descriptors/README.md +0 -49
  585. package/node_modules/progrok/node_modules/merge-descriptors/index.js +0 -60
  586. package/node_modules/progrok/node_modules/merge-descriptors/package.json +0 -39
  587. package/node_modules/progrok/node_modules/mime-db/HISTORY.md +0 -507
  588. package/node_modules/progrok/node_modules/mime-db/LICENSE +0 -23
  589. package/node_modules/progrok/node_modules/mime-db/README.md +0 -100
  590. package/node_modules/progrok/node_modules/mime-db/db.json +0 -8519
  591. package/node_modules/progrok/node_modules/mime-db/index.js +0 -12
  592. package/node_modules/progrok/node_modules/mime-db/package.json +0 -60
  593. package/node_modules/progrok/node_modules/mime-types/HISTORY.md +0 -397
  594. package/node_modules/progrok/node_modules/mime-types/LICENSE +0 -23
  595. package/node_modules/progrok/node_modules/mime-types/README.md +0 -113
  596. package/node_modules/progrok/node_modules/mime-types/index.js +0 -188
  597. package/node_modules/progrok/node_modules/mime-types/package.json +0 -44
  598. package/node_modules/progrok/node_modules/negotiator/HISTORY.md +0 -108
  599. package/node_modules/progrok/node_modules/negotiator/LICENSE +0 -24
  600. package/node_modules/progrok/node_modules/negotiator/README.md +0 -203
  601. package/node_modules/progrok/node_modules/negotiator/index.js +0 -82
  602. package/node_modules/progrok/node_modules/negotiator/lib/charset.js +0 -169
  603. package/node_modules/progrok/node_modules/negotiator/lib/encoding.js +0 -184
  604. package/node_modules/progrok/node_modules/negotiator/lib/language.js +0 -179
  605. package/node_modules/progrok/node_modules/negotiator/lib/mediaType.js +0 -294
  606. package/node_modules/progrok/node_modules/negotiator/package.json +0 -42
  607. package/node_modules/progrok/node_modules/path-to-regexp/LICENSE +0 -21
  608. package/node_modules/progrok/node_modules/path-to-regexp/Readme.md +0 -35
  609. package/node_modules/progrok/node_modules/path-to-regexp/index.js +0 -158
  610. package/node_modules/progrok/node_modules/path-to-regexp/package.json +0 -30
  611. package/node_modules/progrok/node_modules/raw-body/LICENSE +0 -22
  612. package/node_modules/progrok/node_modules/raw-body/README.md +0 -223
  613. package/node_modules/progrok/node_modules/raw-body/index.d.ts +0 -87
  614. package/node_modules/progrok/node_modules/raw-body/index.js +0 -336
  615. package/node_modules/progrok/node_modules/raw-body/package.json +0 -47
  616. package/node_modules/progrok/node_modules/send/HISTORY.md +0 -538
  617. package/node_modules/progrok/node_modules/send/LICENSE +0 -23
  618. package/node_modules/progrok/node_modules/send/README.md +0 -327
  619. package/node_modules/progrok/node_modules/send/SECURITY.md +0 -24
  620. package/node_modules/progrok/node_modules/send/index.js +0 -1142
  621. package/node_modules/progrok/node_modules/send/package.json +0 -62
  622. package/node_modules/progrok/node_modules/serve-static/HISTORY.md +0 -493
  623. package/node_modules/progrok/node_modules/serve-static/LICENSE +0 -25
  624. package/node_modules/progrok/node_modules/serve-static/README.md +0 -257
  625. package/node_modules/progrok/node_modules/serve-static/index.js +0 -209
  626. package/node_modules/progrok/node_modules/serve-static/package.json +0 -42
  627. package/node_modules/progrok/node_modules/type-is/HISTORY.md +0 -259
  628. package/node_modules/progrok/node_modules/type-is/LICENSE +0 -23
  629. package/node_modules/progrok/node_modules/type-is/README.md +0 -170
  630. package/node_modules/progrok/node_modules/type-is/index.js +0 -266
  631. package/node_modules/progrok/node_modules/type-is/package.json +0 -45
  632. package/node_modules/progrok/package.json +0 -52
  633. package/node_modules/progrok/skills/progrok/SKILL.md +0 -293
  634. package/node_modules/proxy-addr/HISTORY.md +0 -161
  635. package/node_modules/proxy-addr/LICENSE +0 -22
  636. package/node_modules/proxy-addr/README.md +0 -139
  637. package/node_modules/proxy-addr/index.js +0 -327
  638. package/node_modules/proxy-addr/package.json +0 -47
  639. package/node_modules/qs/.editorconfig +0 -46
  640. package/node_modules/qs/.github/FUNDING.yml +0 -12
  641. package/node_modules/qs/.github/SECURITY.md +0 -11
  642. package/node_modules/qs/.github/THREAT_MODEL.md +0 -78
  643. package/node_modules/qs/.nycrc +0 -13
  644. package/node_modules/qs/CHANGELOG.md +0 -822
  645. package/node_modules/qs/LICENSE.md +0 -29
  646. package/node_modules/qs/README.md +0 -758
  647. package/node_modules/qs/dist/qs.js +0 -141
  648. package/node_modules/qs/eslint.config.mjs +0 -57
  649. package/node_modules/qs/lib/formats.js +0 -23
  650. package/node_modules/qs/lib/index.js +0 -11
  651. package/node_modules/qs/lib/parse.js +0 -403
  652. package/node_modules/qs/lib/stringify.js +0 -363
  653. package/node_modules/qs/lib/utils.js +0 -342
  654. package/node_modules/qs/package.json +0 -94
  655. package/node_modules/qs/test/empty-keys-cases.js +0 -267
  656. package/node_modules/qs/test/parse.js +0 -1703
  657. package/node_modules/qs/test/stringify.js +0 -1448
  658. package/node_modules/qs/test/utils.js +0 -432
  659. package/node_modules/range-parser/HISTORY.md +0 -56
  660. package/node_modules/range-parser/LICENSE +0 -23
  661. package/node_modules/range-parser/README.md +0 -84
  662. package/node_modules/range-parser/index.js +0 -162
  663. package/node_modules/range-parser/package.json +0 -44
  664. package/node_modules/run-applescript/index.d.ts +0 -66
  665. package/node_modules/run-applescript/index.js +0 -37
  666. package/node_modules/run-applescript/license +0 -9
  667. package/node_modules/run-applescript/package.json +0 -42
  668. package/node_modules/run-applescript/readme.md +0 -78
  669. package/node_modules/safe-buffer/LICENSE +0 -21
  670. package/node_modules/safe-buffer/README.md +0 -584
  671. package/node_modules/safe-buffer/index.d.ts +0 -187
  672. package/node_modules/safe-buffer/index.js +0 -65
  673. package/node_modules/safe-buffer/package.json +0 -51
  674. package/node_modules/safer-buffer/LICENSE +0 -21
  675. package/node_modules/safer-buffer/Porting-Buffer.md +0 -268
  676. package/node_modules/safer-buffer/Readme.md +0 -156
  677. package/node_modules/safer-buffer/dangerous.js +0 -58
  678. package/node_modules/safer-buffer/package.json +0 -34
  679. package/node_modules/safer-buffer/safer.js +0 -77
  680. package/node_modules/safer-buffer/tests.js +0 -406
  681. package/node_modules/setprototypeof/LICENSE +0 -13
  682. package/node_modules/setprototypeof/README.md +0 -31
  683. package/node_modules/setprototypeof/index.d.ts +0 -2
  684. package/node_modules/setprototypeof/index.js +0 -17
  685. package/node_modules/setprototypeof/package.json +0 -38
  686. package/node_modules/setprototypeof/test/index.js +0 -24
  687. package/node_modules/side-channel/.editorconfig +0 -9
  688. package/node_modules/side-channel/.eslintrc +0 -12
  689. package/node_modules/side-channel/.github/FUNDING.yml +0 -12
  690. package/node_modules/side-channel/.nycrc +0 -13
  691. package/node_modules/side-channel/CHANGELOG.md +0 -110
  692. package/node_modules/side-channel/LICENSE +0 -21
  693. package/node_modules/side-channel/README.md +0 -61
  694. package/node_modules/side-channel/index.d.ts +0 -14
  695. package/node_modules/side-channel/index.js +0 -43
  696. package/node_modules/side-channel/package.json +0 -85
  697. package/node_modules/side-channel/test/index.js +0 -104
  698. package/node_modules/side-channel/tsconfig.json +0 -9
  699. package/node_modules/side-channel-list/.editorconfig +0 -9
  700. package/node_modules/side-channel-list/.eslintrc +0 -11
  701. package/node_modules/side-channel-list/.github/FUNDING.yml +0 -12
  702. package/node_modules/side-channel-list/.nycrc +0 -13
  703. package/node_modules/side-channel-list/CHANGELOG.md +0 -36
  704. package/node_modules/side-channel-list/LICENSE +0 -21
  705. package/node_modules/side-channel-list/README.md +0 -62
  706. package/node_modules/side-channel-list/index.d.ts +0 -13
  707. package/node_modules/side-channel-list/index.js +0 -111
  708. package/node_modules/side-channel-list/list.d.ts +0 -14
  709. package/node_modules/side-channel-list/package.json +0 -77
  710. package/node_modules/side-channel-list/test/index.js +0 -154
  711. package/node_modules/side-channel-list/tsconfig.json +0 -9
  712. package/node_modules/side-channel-map/.editorconfig +0 -9
  713. package/node_modules/side-channel-map/.eslintrc +0 -11
  714. package/node_modules/side-channel-map/.github/FUNDING.yml +0 -12
  715. package/node_modules/side-channel-map/.nycrc +0 -13
  716. package/node_modules/side-channel-map/CHANGELOG.md +0 -22
  717. package/node_modules/side-channel-map/LICENSE +0 -21
  718. package/node_modules/side-channel-map/README.md +0 -62
  719. package/node_modules/side-channel-map/index.d.ts +0 -15
  720. package/node_modules/side-channel-map/index.js +0 -68
  721. package/node_modules/side-channel-map/package.json +0 -80
  722. package/node_modules/side-channel-map/test/index.js +0 -114
  723. package/node_modules/side-channel-map/tsconfig.json +0 -9
  724. package/node_modules/side-channel-weakmap/.editorconfig +0 -9
  725. package/node_modules/side-channel-weakmap/.eslintrc +0 -12
  726. package/node_modules/side-channel-weakmap/.github/FUNDING.yml +0 -12
  727. package/node_modules/side-channel-weakmap/.nycrc +0 -13
  728. package/node_modules/side-channel-weakmap/CHANGELOG.md +0 -28
  729. package/node_modules/side-channel-weakmap/LICENSE +0 -21
  730. package/node_modules/side-channel-weakmap/README.md +0 -62
  731. package/node_modules/side-channel-weakmap/index.d.ts +0 -15
  732. package/node_modules/side-channel-weakmap/index.js +0 -84
  733. package/node_modules/side-channel-weakmap/package.json +0 -87
  734. package/node_modules/side-channel-weakmap/test/index.js +0 -114
  735. package/node_modules/side-channel-weakmap/tsconfig.json +0 -9
  736. package/node_modules/statuses/HISTORY.md +0 -87
  737. package/node_modules/statuses/LICENSE +0 -23
  738. package/node_modules/statuses/README.md +0 -139
  739. package/node_modules/statuses/codes.json +0 -65
  740. package/node_modules/statuses/index.js +0 -146
  741. package/node_modules/statuses/package.json +0 -49
  742. package/node_modules/toidentifier/HISTORY.md +0 -9
  743. package/node_modules/toidentifier/LICENSE +0 -21
  744. package/node_modules/toidentifier/README.md +0 -61
  745. package/node_modules/toidentifier/index.js +0 -32
  746. package/node_modules/toidentifier/package.json +0 -38
  747. package/node_modules/unpipe/HISTORY.md +0 -4
  748. package/node_modules/unpipe/LICENSE +0 -22
  749. package/node_modules/unpipe/README.md +0 -43
  750. package/node_modules/unpipe/index.js +0 -69
  751. package/node_modules/unpipe/package.json +0 -27
  752. package/node_modules/utils-merge/.npmignore +0 -9
  753. package/node_modules/utils-merge/LICENSE +0 -20
  754. package/node_modules/utils-merge/README.md +0 -34
  755. package/node_modules/utils-merge/index.js +0 -23
  756. package/node_modules/utils-merge/package.json +0 -40
  757. package/node_modules/vary/HISTORY.md +0 -39
  758. package/node_modules/vary/LICENSE +0 -22
  759. package/node_modules/vary/README.md +0 -101
  760. package/node_modules/vary/index.js +0 -149
  761. package/node_modules/vary/package.json +0 -43
  762. package/ui/dist/assets/index-DYtUJ4t0.js +0 -22
  763. package/ui/dist/assets/useAgentDialogFocus-B2snKbzK.js +0 -1
  764. package/vendor/progrok-0.2.0.tgz +0 -0
@@ -1,6 +1,6 @@
1
1
  {
2
- "_App-DkvU6Sex.js": {
3
- "file": "assets/App-DkvU6Sex.js",
2
+ "_App-BfpvLzSs.js": {
3
+ "file": "assets/App-BfpvLzSs.js",
4
4
  "name": "App",
5
5
  "isDynamicEntry": true,
6
6
  "imports": [
@@ -17,7 +17,7 @@
17
17
  "src/components/card-news/CardNewsWorkspace.tsx",
18
18
  "src/components/agent/AgentWorkspace.tsx",
19
19
  "src/components/assets/AssetsWorkspace.tsx",
20
- "_AssetGenWorkspace-BepUrz23.js",
20
+ "_AssetGenWorkspace-C8eIs-bS.js",
21
21
  "src/components/home/HomeWorkspace.tsx",
22
22
  "src/components/PromptLibraryPanel.tsx"
23
23
  ]
@@ -26,14 +26,14 @@
26
26
  "file": "assets/AssetGenWorkspace-B7tTK0Sx.css",
27
27
  "src": "_AssetGenWorkspace-B7tTK0Sx.css"
28
28
  },
29
- "_AssetGenWorkspace-BepUrz23.js": {
30
- "file": "assets/AssetGenWorkspace-BepUrz23.js",
29
+ "_AssetGenWorkspace-C8eIs-bS.js": {
30
+ "file": "assets/AssetGenWorkspace-C8eIs-bS.js",
31
31
  "name": "AssetGenWorkspace",
32
32
  "isDynamicEntry": true,
33
33
  "imports": [
34
34
  "index.html",
35
- "_App-DkvU6Sex.js",
36
- "_KeyingPanel-BQkEMTe9.js"
35
+ "_App-BfpvLzSs.js",
36
+ "_KeyingPanel-D8ZHmWcC.js"
37
37
  ],
38
38
  "dynamicImports": [
39
39
  "src/components/assetgen/SpriteRecipeWorkspace.tsx"
@@ -42,13 +42,13 @@
42
42
  "assets/AssetGenWorkspace-B7tTK0Sx.css"
43
43
  ]
44
44
  },
45
- "_KeyingPanel-BQkEMTe9.js": {
46
- "file": "assets/KeyingPanel-BQkEMTe9.js",
45
+ "_KeyingPanel-D8ZHmWcC.js": {
46
+ "file": "assets/KeyingPanel-D8ZHmWcC.js",
47
47
  "name": "KeyingPanel",
48
48
  "imports": [
49
49
  "index.html",
50
- "_App-DkvU6Sex.js",
51
- "_useAgentDialogFocus-B2snKbzK.js"
50
+ "_App-BfpvLzSs.js",
51
+ "_useAgentDialogFocus-CCj5EYE9.js"
52
52
  ]
53
53
  },
54
54
  "__vite-browser-external": {
@@ -57,34 +57,34 @@
57
57
  "src": "__vite-browser-external",
58
58
  "isDynamicEntry": true
59
59
  },
60
- "_promptBuilderStore-prvdLIUP.js": {
61
- "file": "assets/promptBuilderStore-prvdLIUP.js",
60
+ "_promptBuilderStore-BMiudG9n.js": {
61
+ "file": "assets/promptBuilderStore-BMiudG9n.js",
62
62
  "name": "promptBuilderStore",
63
63
  "imports": [
64
- "_App-DkvU6Sex.js"
64
+ "_App-BfpvLzSs.js"
65
65
  ]
66
66
  },
67
- "_useAgentDialogFocus-B2snKbzK.js": {
68
- "file": "assets/useAgentDialogFocus-B2snKbzK.js",
67
+ "_useAgentDialogFocus-CCj5EYE9.js": {
68
+ "file": "assets/useAgentDialogFocus-CCj5EYE9.js",
69
69
  "name": "useAgentDialogFocus",
70
70
  "imports": [
71
- "_App-DkvU6Sex.js"
71
+ "_App-BfpvLzSs.js"
72
72
  ]
73
73
  },
74
74
  "index.html": {
75
- "file": "assets/index-DYtUJ4t0.js",
75
+ "file": "assets/index-CfGRmfFv.js",
76
76
  "name": "index",
77
77
  "src": "index.html",
78
78
  "isEntry": true,
79
79
  "dynamicImports": [
80
- "_App-DkvU6Sex.js"
80
+ "_App-BfpvLzSs.js"
81
81
  ],
82
82
  "css": [
83
83
  "assets/index-D0NhOovz.css"
84
84
  ]
85
85
  },
86
86
  "node_modules/pptxgenjs/dist/pptxgen.es.js": {
87
- "file": "assets/pptxgen.es-Apxh5DQ9.js",
87
+ "file": "assets/pptxgen.es-BLI_YKez.js",
88
88
  "name": "pptxgen.es",
89
89
  "src": "node_modules/pptxgenjs/dist/pptxgen.es.js",
90
90
  "isDynamicEntry": true,
@@ -98,36 +98,36 @@
98
98
  ]
99
99
  },
100
100
  "src/components/GenerationRequestLogPanel.tsx": {
101
- "file": "assets/GenerationRequestLogPanel-BL2C0DcW.js",
101
+ "file": "assets/GenerationRequestLogPanel-CTs8OymS.js",
102
102
  "name": "GenerationRequestLogPanel",
103
103
  "src": "src/components/GenerationRequestLogPanel.tsx",
104
104
  "isDynamicEntry": true,
105
105
  "imports": [
106
106
  "index.html",
107
- "_App-DkvU6Sex.js"
107
+ "_App-BfpvLzSs.js"
108
108
  ]
109
109
  },
110
110
  "src/components/NodeCanvas.tsx": {
111
- "file": "assets/NodeCanvas-5u8IO1MA.js",
111
+ "file": "assets/NodeCanvas-D2N3m-1s.js",
112
112
  "name": "NodeCanvas",
113
113
  "src": "src/components/NodeCanvas.tsx",
114
114
  "isDynamicEntry": true,
115
115
  "imports": [
116
116
  "index.html",
117
- "_App-DkvU6Sex.js"
117
+ "_App-BfpvLzSs.js"
118
118
  ],
119
119
  "css": [
120
120
  "assets/NodeCanvas-BnuhLJ6X.css"
121
121
  ]
122
122
  },
123
123
  "src/components/PromptImportDialog.tsx": {
124
- "file": "assets/PromptImportDialog-Bl-SB4mK.js",
124
+ "file": "assets/PromptImportDialog-DBpe7Vkj.js",
125
125
  "name": "PromptImportDialog",
126
126
  "src": "src/components/PromptImportDialog.tsx",
127
127
  "isDynamicEntry": true,
128
128
  "imports": [
129
129
  "index.html",
130
- "_App-DkvU6Sex.js"
130
+ "_App-BfpvLzSs.js"
131
131
  ],
132
132
  "dynamicImports": [
133
133
  "src/components/PromptImportDiscoverySection.tsx",
@@ -135,130 +135,130 @@
135
135
  ]
136
136
  },
137
137
  "src/components/PromptImportDiscoverySection.tsx": {
138
- "file": "assets/PromptImportDiscoverySection-DdZAdRMW.js",
138
+ "file": "assets/PromptImportDiscoverySection-Dk6v6lUZ.js",
139
139
  "name": "PromptImportDiscoverySection",
140
140
  "src": "src/components/PromptImportDiscoverySection.tsx",
141
141
  "isDynamicEntry": true,
142
142
  "imports": [
143
143
  "index.html",
144
- "_App-DkvU6Sex.js"
144
+ "_App-BfpvLzSs.js"
145
145
  ]
146
146
  },
147
147
  "src/components/PromptImportFolderSection.tsx": {
148
- "file": "assets/PromptImportFolderSection-DLHQKl9T.js",
148
+ "file": "assets/PromptImportFolderSection-BE7Nfq9Y.js",
149
149
  "name": "PromptImportFolderSection",
150
150
  "src": "src/components/PromptImportFolderSection.tsx",
151
151
  "isDynamicEntry": true,
152
152
  "imports": [
153
153
  "index.html",
154
- "_App-DkvU6Sex.js"
154
+ "_App-BfpvLzSs.js"
155
155
  ]
156
156
  },
157
157
  "src/components/PromptLibraryPanel.tsx": {
158
- "file": "assets/PromptLibraryPanel-PLWyvEz1.js",
158
+ "file": "assets/PromptLibraryPanel-Qdujpb4L.js",
159
159
  "name": "PromptLibraryPanel",
160
160
  "src": "src/components/PromptLibraryPanel.tsx",
161
161
  "isDynamicEntry": true,
162
162
  "imports": [
163
163
  "index.html",
164
- "_App-DkvU6Sex.js"
164
+ "_App-BfpvLzSs.js"
165
165
  ],
166
166
  "dynamicImports": [
167
167
  "src/components/PromptImportDialog.tsx"
168
168
  ]
169
169
  },
170
170
  "src/components/SettingsWorkspace.tsx": {
171
- "file": "assets/SettingsWorkspace-Etfeu2IF.js",
171
+ "file": "assets/SettingsWorkspace-Dm4wezu_.js",
172
172
  "name": "SettingsWorkspace",
173
173
  "src": "src/components/SettingsWorkspace.tsx",
174
174
  "isDynamicEntry": true,
175
175
  "imports": [
176
176
  "index.html",
177
- "_App-DkvU6Sex.js",
178
- "_promptBuilderStore-prvdLIUP.js"
177
+ "_App-BfpvLzSs.js",
178
+ "_promptBuilderStore-BMiudG9n.js"
179
179
  ]
180
180
  },
181
181
  "src/components/agent/AgentWorkspace.tsx": {
182
- "file": "assets/AgentWorkspace-CLJDCRMQ.js",
182
+ "file": "assets/AgentWorkspace-DlLaTsPK.js",
183
183
  "name": "AgentWorkspace",
184
184
  "src": "src/components/agent/AgentWorkspace.tsx",
185
185
  "isDynamicEntry": true,
186
186
  "imports": [
187
187
  "index.html",
188
- "_App-DkvU6Sex.js",
189
- "_useAgentDialogFocus-B2snKbzK.js"
188
+ "_App-BfpvLzSs.js",
189
+ "_useAgentDialogFocus-CCj5EYE9.js"
190
190
  ]
191
191
  },
192
192
  "src/components/assetgen/SpriteRecipeWorkspace.tsx": {
193
- "file": "assets/SpriteRecipeWorkspace-D7H5seOM.js",
193
+ "file": "assets/SpriteRecipeWorkspace-D9do9V7F.js",
194
194
  "name": "SpriteRecipeWorkspace",
195
195
  "src": "src/components/assetgen/SpriteRecipeWorkspace.tsx",
196
196
  "isDynamicEntry": true,
197
197
  "imports": [
198
198
  "index.html",
199
- "_App-DkvU6Sex.js",
200
- "_AssetGenWorkspace-BepUrz23.js",
201
- "_KeyingPanel-BQkEMTe9.js",
202
- "_useAgentDialogFocus-B2snKbzK.js"
199
+ "_App-BfpvLzSs.js",
200
+ "_AssetGenWorkspace-C8eIs-bS.js",
201
+ "_KeyingPanel-D8ZHmWcC.js",
202
+ "_useAgentDialogFocus-CCj5EYE9.js"
203
203
  ]
204
204
  },
205
205
  "src/components/assets/AssetsWorkspace.tsx": {
206
- "file": "assets/AssetsWorkspace-IipC1FdD.js",
206
+ "file": "assets/AssetsWorkspace-BcbAM8uC.js",
207
207
  "name": "AssetsWorkspace",
208
208
  "src": "src/components/assets/AssetsWorkspace.tsx",
209
209
  "isDynamicEntry": true,
210
210
  "imports": [
211
211
  "index.html",
212
- "_App-DkvU6Sex.js",
213
- "_KeyingPanel-BQkEMTe9.js",
214
- "_useAgentDialogFocus-B2snKbzK.js"
212
+ "_App-BfpvLzSs.js",
213
+ "_KeyingPanel-D8ZHmWcC.js",
214
+ "_useAgentDialogFocus-CCj5EYE9.js"
215
215
  ],
216
216
  "css": [
217
217
  "assets/AssetsWorkspace-BdptASFf.css"
218
218
  ]
219
219
  },
220
220
  "src/components/canvas-mode/index.ts": {
221
- "file": "assets/index-BAkbTbUC.js",
221
+ "file": "assets/index-CfrOcJIe.js",
222
222
  "name": "index",
223
223
  "src": "src/components/canvas-mode/index.ts",
224
224
  "isDynamicEntry": true,
225
225
  "imports": [
226
226
  "index.html",
227
- "_App-DkvU6Sex.js"
227
+ "_App-BfpvLzSs.js"
228
228
  ],
229
229
  "dynamicImports": [
230
230
  "node_modules/pptxgenjs/dist/pptxgen.es.js"
231
231
  ]
232
232
  },
233
233
  "src/components/card-news/CardNewsWorkspace.tsx": {
234
- "file": "assets/CardNewsWorkspace-ZXDwYz4l.js",
234
+ "file": "assets/CardNewsWorkspace-CM5hwbRV.js",
235
235
  "name": "CardNewsWorkspace",
236
236
  "src": "src/components/card-news/CardNewsWorkspace.tsx",
237
237
  "isDynamicEntry": true,
238
238
  "imports": [
239
239
  "index.html",
240
- "_App-DkvU6Sex.js"
240
+ "_App-BfpvLzSs.js"
241
241
  ]
242
242
  },
243
243
  "src/components/home/HomeWorkspace.tsx": {
244
- "file": "assets/HomeWorkspace-DFfrwS9a.js",
244
+ "file": "assets/HomeWorkspace-KGUtIZyG.js",
245
245
  "name": "HomeWorkspace",
246
246
  "src": "src/components/home/HomeWorkspace.tsx",
247
247
  "isDynamicEntry": true,
248
248
  "imports": [
249
249
  "index.html",
250
- "_App-DkvU6Sex.js"
250
+ "_App-BfpvLzSs.js"
251
251
  ]
252
252
  },
253
253
  "src/components/prompt-builder/PromptBuilderPanel.tsx": {
254
- "file": "assets/PromptBuilderPanel-DNt7LHMi.js",
254
+ "file": "assets/PromptBuilderPanel-BolZnOa7.js",
255
255
  "name": "PromptBuilderPanel",
256
256
  "src": "src/components/prompt-builder/PromptBuilderPanel.tsx",
257
257
  "isDynamicEntry": true,
258
258
  "imports": [
259
259
  "index.html",
260
- "_App-DkvU6Sex.js",
261
- "_promptBuilderStore-prvdLIUP.js"
260
+ "_App-BfpvLzSs.js",
261
+ "_promptBuilderStore-BMiudG9n.js"
262
262
  ]
263
263
  }
264
264
  }
@@ -1,3 +1,3 @@
1
- import{f as m,j as t}from"./index-DYtUJ4t0.js";import{q as Nt,T as Fe,u as x,i as we,R as ye,X as Ct,a as E}from"./App-DkvU6Sex.js";import{u as de}from"./useAgentDialogFocus-B2snKbzK.js";async function B(e,n){const a=await Nt(e,n);if(!a.ok){const s=await a.json().catch(()=>({})),r=s.error,l=typeof r=="string"?r:r?.message??`Request failed: ${a.status}`,o=new Error(l);throw o.status=a.status,o.code=typeof r=="object"?r?.code:s.code,o}return await a.json()}function kt(e){return e.filename?`/generated/${e.filename}`:typeof e.url=="string"&&e.url?e.url:typeof e.thumb=="string"&&e.thumb?e.thumb:null}function Ge(e){const n=kt(e);if(!n)return null;const a=e.filename??e.canvasEditableFilename??"current-image.png";return{id:`current-${a}`,filename:a,url:n,thumbUrl:e.thumb??n,prompt:e.prompt??e.userPrompt??null,revisedPrompt:e.revisedPrompt??null,createdAt:e.createdAt??Date.now()}}async function Re(e){const n=e?`?selectedSessionId=${encodeURIComponent(e)}`:"";return B(`/api/agent/sessions${n}`)}async function $e(e){const n=e.currentImage?Ge(e.currentImage):null;return B("/api/agent/sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:e.title,currentImage:n,webSearchEnabled:e.webSearchEnabled??!0})})}async function ce(e,n){return B(`/api/agent/sessions/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})}async function It(e){return B(`/api/agent/sessions/${encodeURIComponent(e)}`,{method:"DELETE"})}async function At(e,n,a){return B(`/api/agent/sessions/${encodeURIComponent(e)}/queue`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:n,options:a})})}async function Tt(e){return B(`/api/agent/queue/${encodeURIComponent(e)}/cancel`,{method:"POST"})}async function Lt(e){return B(`/api/agent/queue/${encodeURIComponent(e)}/retry`,{method:"POST"})}const _e=Fe,Mt=Fe,Et={provider:"oauth",model:"gpt-5.6-luna",quality:"medium",size:"1024x1024",format:"png",moderation:"low",reasoningEffort:"none",webSearchEnabled:!0,generationStrategy:"auto",variants:1,maxAutoVariants:_e,parallelism:2};function Pe(e){return{...Et,...e??{}}}function De(e){const{width:n,height:a}=e;return n>=1280?"desktop-three-pane":a<560&&n<1280?n>=768?"tablet-stacked":"mobile-chat-image-sheet":n>=960&&a>=560?"desktop-rail":n>=768&&a>=700?"tablet-stacked":"mobile-chat-image-sheet"}function qt(){return typeof window>"u"?1440:window.innerWidth}function Be(){return typeof window>"u"?900:window.innerHeight}function Rt(){if(typeof window>"u"||typeof document>"u")return 1440;const e=document.querySelector('.app[data-ui-mode="agent"] .sidebar');if(!e)return window.innerWidth;const n=window.getComputedStyle(e);if(n.display==="none"||n.visibility==="hidden")return window.innerWidth;const a=e.getBoundingClientRect().width;return Math.max(0,window.innerWidth-a)}function $t(){const[e,n]=m.useState(()=>De({width:qt(),height:Be()}));return m.useEffect(()=>{const a=()=>n(De({width:Rt(),height:Be()}));return a(),window.addEventListener("resize",a),()=>window.removeEventListener("resize",a)},[]),e}function C({size:e=16,children:n}){return t.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:n})}function Ue(e){return t.jsxs(C,{...e,children:[t.jsx("path",{d:"M12 5v14"}),t.jsx("path",{d:"M5 12h14"})]})}function Pt(e){return t.jsxs(C,{...e,children:[t.jsx("circle",{cx:"11",cy:"11",r:"7"}),t.jsx("path",{d:"M21 21l-4.3-4.3"})]})}function O(e){return t.jsxs(C,{...e,children:[t.jsx("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"}),t.jsx("circle",{cx:"8",cy:"10",r:"1.5"}),t.jsx("path",{d:"M21 16l-5-5L5 19"})]})}function ge(e){return t.jsxs(C,{...e,children:[t.jsx("path",{d:"M18 6L6 18"}),t.jsx("path",{d:"M6 6l12 12"})]})}function Dt(e){return t.jsxs(C,{...e,children:[t.jsx("path",{d:"M22 2L11 13"}),t.jsx("path",{d:"M22 2l-7 20-4-9-9-4 20-7z"})]})}function Bt(e){return t.jsx(C,{...e,children:t.jsx("path",{d:"M21.4 11.1l-9.2 9.1a6 6 0 0 1-8.5-8.5l9.2-9.2a4 4 0 0 1 5.7 5.7l-9.2 9.2a2 2 0 0 1-2.8-2.8l8.5-8.5"})})}function Ot(e){return t.jsxs(C,{...e,children:[t.jsx("circle",{cx:"12",cy:"12",r:"10"}),t.jsx("path",{d:"M2 12h20"}),t.jsx("path",{d:"M12 2a15.3 15.3 0 0 1 0 20"}),t.jsx("path",{d:"M12 2a15.3 15.3 0 0 0 0 20"})]})}function He(e){return t.jsxs(C,{...e,children:[t.jsx("path",{d:"M4 6h16"}),t.jsx("path",{d:"M4 12h16"}),t.jsx("path",{d:"M4 18h16"})]})}function zt(e){return t.jsxs(C,{...e,children:[t.jsx("path",{d:"M19 12H5"}),t.jsx("path",{d:"M12 19l-7-7 7-7"})]})}function Wt(e){return t.jsxs(C,{...e,children:[t.jsx("path",{d:"M8 6h13"}),t.jsx("path",{d:"M8 12h13"}),t.jsx("path",{d:"M8 18h13"}),t.jsx("circle",{cx:"3",cy:"6",r:"1"}),t.jsx("circle",{cx:"3",cy:"12",r:"1"}),t.jsx("circle",{cx:"3",cy:"18",r:"1"})]})}function Kt(e){return t.jsxs(C,{...e,children:[t.jsx("path",{d:"M3 6h18"}),t.jsx("path",{d:"M8 6V4h8v2"}),t.jsx("path",{d:"M19 6l-1 14H6L5 6"})]})}function Qt(e){return t.jsxs(C,{...e,children:[t.jsx("path",{d:"M12 20h9"}),t.jsx("path",{d:"M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4 12.5-12.5z"})]})}function Ve(e){return t.jsx(C,{...e,children:t.jsx("path",{d:"M6 9l6 6 6-6"})})}function Ne(e){return t.jsx(C,{...e,children:t.jsx("path",{d:"M9 6l6 6-6 6"})})}function Ft(e){return t.jsxs(C,{...e,children:[t.jsx("path",{d:"M4 8h16"}),t.jsx("circle",{cx:"9",cy:"8",r:"2.5"}),t.jsx("path",{d:"M4 16h16"}),t.jsx("circle",{cx:"15",cy:"16",r:"2.5"})]})}const Oe=[{name:"question",display:"/question",aliases:["question","ask","q"],descriptionKey:"agent.slashDesc_question"},{name:"variants",display:"/variants <N>",aliases:["variants","variant","v","n"],descriptionKey:"agent.slashDesc_variants",hasValue:!0},{name:"generate",display:"/generate <N>",aliases:["generate","gen","g"],descriptionKey:"agent.slashDesc_generate",hasValue:!0},{name:"parallelism",display:"/parallelism <N>",aliases:["parallelism","parallel","p"],descriptionKey:"agent.slashDesc_parallelism",hasValue:!0},{name:"help",display:"/help",aliases:["help","h"],descriptionKey:"agent.slashDesc_help"}];function Je(e){const n=e.toLowerCase();return n?Oe.filter(a=>a.aliases.some(s=>s.startsWith(n))):Oe}function Gt({listboxId:e,query:n,highlightIndex:a,onSelect:s,onHighlightChange:r}){const{t:l}=x(),o=Je(n);return o.length===0?null:t.jsx("ul",{id:e,className:"slash-command-menu",role:"listbox","aria-label":l("agent.slashCommands"),children:o.map((d,c)=>t.jsxs("li",{id:`${e}-opt-${c}`,role:"option","aria-selected":c===a,className:`slash-command-menu__item${c===a?" is-highlighted":""}`,onMouseDown:i=>i.preventDefault(),onClick:()=>s(d),onMouseEnter:()=>r(c),children:[t.jsx("span",{className:"slash-command-menu__name",children:d.display}),t.jsx("span",{className:"slash-command-menu__desc",children:l(d.descriptionKey)})]},d.name))})}function Ut(e){return Array.from(e).filter(n=>n.type.startsWith("image/"))}function Ht(e){return Array.from(e.clipboardData?.items??[]).filter(n=>n.kind==="file"&&n.type.startsWith("image/")).map(n=>n.getAsFile()).filter(n=>!!n)}function Vt({webSearchEnabled:e,insertedPrompt:n,onWebSearchChange:a,onAttachFiles:s,onSend:r}){const{t:l}=x(),[o,d]=m.useState(""),[c,i]=m.useState(0),[g,u]=m.useState(!1),p=m.useRef(null),f=m.useRef(null),b=m.useId(),v=o.trim().length>0,w=o.trimStart().match(/^\/([a-z]*)$/i),q=w!==null,G=q&&!g,U=w?.[1]??"",T=Je(U),z=G&&T.length>0,A=T.length>0?Math.min(c,T.length-1):0,he=z?`${b}-opt-${A}`:void 0;m.useEffect(()=>{i(0),u(!1)},[U]),m.useEffect(()=>{q&&u(!1)},[q]),m.useEffect(()=>{n?.text&&d(j=>j.trim()?`${j.trim()}
1
+ import{f as m,j as t}from"./index-CfGRmfFv.js";import{q as Nt,T as Fe,u as x,i as we,R as ye,X as Ct,a as E}from"./App-BfpvLzSs.js";import{u as de}from"./useAgentDialogFocus-CCj5EYE9.js";async function B(e,n){const a=await Nt(e,n);if(!a.ok){const s=await a.json().catch(()=>({})),r=s.error,l=typeof r=="string"?r:r?.message??`Request failed: ${a.status}`,o=new Error(l);throw o.status=a.status,o.code=typeof r=="object"?r?.code:s.code,o}return await a.json()}function kt(e){return e.filename?`/generated/${e.filename}`:typeof e.url=="string"&&e.url?e.url:typeof e.thumb=="string"&&e.thumb?e.thumb:null}function Ge(e){const n=kt(e);if(!n)return null;const a=e.filename??e.canvasEditableFilename??"current-image.png";return{id:`current-${a}`,filename:a,url:n,thumbUrl:e.thumb??n,prompt:e.prompt??e.userPrompt??null,revisedPrompt:e.revisedPrompt??null,createdAt:e.createdAt??Date.now()}}async function Re(e){const n=e?`?selectedSessionId=${encodeURIComponent(e)}`:"";return B(`/api/agent/sessions${n}`)}async function $e(e){const n=e.currentImage?Ge(e.currentImage):null;return B("/api/agent/sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:e.title,currentImage:n,webSearchEnabled:e.webSearchEnabled??!0})})}async function ce(e,n){return B(`/api/agent/sessions/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})}async function It(e){return B(`/api/agent/sessions/${encodeURIComponent(e)}`,{method:"DELETE"})}async function At(e,n,a){return B(`/api/agent/sessions/${encodeURIComponent(e)}/queue`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:n,options:a})})}async function Tt(e){return B(`/api/agent/queue/${encodeURIComponent(e)}/cancel`,{method:"POST"})}async function Lt(e){return B(`/api/agent/queue/${encodeURIComponent(e)}/retry`,{method:"POST"})}const _e=Fe,Mt=Fe,Et={provider:"oauth",model:"gpt-5.6-luna",quality:"medium",size:"1024x1024",format:"png",moderation:"low",reasoningEffort:"none",webSearchEnabled:!0,generationStrategy:"auto",variants:1,maxAutoVariants:_e,parallelism:2};function Pe(e){return{...Et,...e??{}}}function De(e){const{width:n,height:a}=e;return n>=1280?"desktop-three-pane":a<560&&n<1280?n>=768?"tablet-stacked":"mobile-chat-image-sheet":n>=960&&a>=560?"desktop-rail":n>=768&&a>=700?"tablet-stacked":"mobile-chat-image-sheet"}function qt(){return typeof window>"u"?1440:window.innerWidth}function Be(){return typeof window>"u"?900:window.innerHeight}function Rt(){if(typeof window>"u"||typeof document>"u")return 1440;const e=document.querySelector('.app[data-ui-mode="agent"] .sidebar');if(!e)return window.innerWidth;const n=window.getComputedStyle(e);if(n.display==="none"||n.visibility==="hidden")return window.innerWidth;const a=e.getBoundingClientRect().width;return Math.max(0,window.innerWidth-a)}function $t(){const[e,n]=m.useState(()=>De({width:qt(),height:Be()}));return m.useEffect(()=>{const a=()=>n(De({width:Rt(),height:Be()}));return a(),window.addEventListener("resize",a),()=>window.removeEventListener("resize",a)},[]),e}function C({size:e=16,children:n}){return t.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:n})}function Ue(e){return t.jsxs(C,{...e,children:[t.jsx("path",{d:"M12 5v14"}),t.jsx("path",{d:"M5 12h14"})]})}function Pt(e){return t.jsxs(C,{...e,children:[t.jsx("circle",{cx:"11",cy:"11",r:"7"}),t.jsx("path",{d:"M21 21l-4.3-4.3"})]})}function O(e){return t.jsxs(C,{...e,children:[t.jsx("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"}),t.jsx("circle",{cx:"8",cy:"10",r:"1.5"}),t.jsx("path",{d:"M21 16l-5-5L5 19"})]})}function ge(e){return t.jsxs(C,{...e,children:[t.jsx("path",{d:"M18 6L6 18"}),t.jsx("path",{d:"M6 6l12 12"})]})}function Dt(e){return t.jsxs(C,{...e,children:[t.jsx("path",{d:"M22 2L11 13"}),t.jsx("path",{d:"M22 2l-7 20-4-9-9-4 20-7z"})]})}function Bt(e){return t.jsx(C,{...e,children:t.jsx("path",{d:"M21.4 11.1l-9.2 9.1a6 6 0 0 1-8.5-8.5l9.2-9.2a4 4 0 0 1 5.7 5.7l-9.2 9.2a2 2 0 0 1-2.8-2.8l8.5-8.5"})})}function Ot(e){return t.jsxs(C,{...e,children:[t.jsx("circle",{cx:"12",cy:"12",r:"10"}),t.jsx("path",{d:"M2 12h20"}),t.jsx("path",{d:"M12 2a15.3 15.3 0 0 1 0 20"}),t.jsx("path",{d:"M12 2a15.3 15.3 0 0 0 0 20"})]})}function He(e){return t.jsxs(C,{...e,children:[t.jsx("path",{d:"M4 6h16"}),t.jsx("path",{d:"M4 12h16"}),t.jsx("path",{d:"M4 18h16"})]})}function zt(e){return t.jsxs(C,{...e,children:[t.jsx("path",{d:"M19 12H5"}),t.jsx("path",{d:"M12 19l-7-7 7-7"})]})}function Wt(e){return t.jsxs(C,{...e,children:[t.jsx("path",{d:"M8 6h13"}),t.jsx("path",{d:"M8 12h13"}),t.jsx("path",{d:"M8 18h13"}),t.jsx("circle",{cx:"3",cy:"6",r:"1"}),t.jsx("circle",{cx:"3",cy:"12",r:"1"}),t.jsx("circle",{cx:"3",cy:"18",r:"1"})]})}function Kt(e){return t.jsxs(C,{...e,children:[t.jsx("path",{d:"M3 6h18"}),t.jsx("path",{d:"M8 6V4h8v2"}),t.jsx("path",{d:"M19 6l-1 14H6L5 6"})]})}function Qt(e){return t.jsxs(C,{...e,children:[t.jsx("path",{d:"M12 20h9"}),t.jsx("path",{d:"M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4 12.5-12.5z"})]})}function Ve(e){return t.jsx(C,{...e,children:t.jsx("path",{d:"M6 9l6 6 6-6"})})}function Ne(e){return t.jsx(C,{...e,children:t.jsx("path",{d:"M9 6l6 6-6 6"})})}function Ft(e){return t.jsxs(C,{...e,children:[t.jsx("path",{d:"M4 8h16"}),t.jsx("circle",{cx:"9",cy:"8",r:"2.5"}),t.jsx("path",{d:"M4 16h16"}),t.jsx("circle",{cx:"15",cy:"16",r:"2.5"})]})}const Oe=[{name:"question",display:"/question",aliases:["question","ask","q"],descriptionKey:"agent.slashDesc_question"},{name:"variants",display:"/variants <N>",aliases:["variants","variant","v","n"],descriptionKey:"agent.slashDesc_variants",hasValue:!0},{name:"generate",display:"/generate <N>",aliases:["generate","gen","g"],descriptionKey:"agent.slashDesc_generate",hasValue:!0},{name:"parallelism",display:"/parallelism <N>",aliases:["parallelism","parallel","p"],descriptionKey:"agent.slashDesc_parallelism",hasValue:!0},{name:"help",display:"/help",aliases:["help","h"],descriptionKey:"agent.slashDesc_help"}];function Je(e){const n=e.toLowerCase();return n?Oe.filter(a=>a.aliases.some(s=>s.startsWith(n))):Oe}function Gt({listboxId:e,query:n,highlightIndex:a,onSelect:s,onHighlightChange:r}){const{t:l}=x(),o=Je(n);return o.length===0?null:t.jsx("ul",{id:e,className:"slash-command-menu",role:"listbox","aria-label":l("agent.slashCommands"),children:o.map((d,c)=>t.jsxs("li",{id:`${e}-opt-${c}`,role:"option","aria-selected":c===a,className:`slash-command-menu__item${c===a?" is-highlighted":""}`,onMouseDown:i=>i.preventDefault(),onClick:()=>s(d),onMouseEnter:()=>r(c),children:[t.jsx("span",{className:"slash-command-menu__name",children:d.display}),t.jsx("span",{className:"slash-command-menu__desc",children:l(d.descriptionKey)})]},d.name))})}function Ut(e){return Array.from(e).filter(n=>n.type.startsWith("image/"))}function Ht(e){return Array.from(e.clipboardData?.items??[]).filter(n=>n.kind==="file"&&n.type.startsWith("image/")).map(n=>n.getAsFile()).filter(n=>!!n)}function Vt({webSearchEnabled:e,insertedPrompt:n,onWebSearchChange:a,onAttachFiles:s,onSend:r}){const{t:l}=x(),[o,d]=m.useState(""),[c,i]=m.useState(0),[g,u]=m.useState(!1),p=m.useRef(null),f=m.useRef(null),b=m.useId(),v=o.trim().length>0,w=o.trimStart().match(/^\/([a-z]*)$/i),q=w!==null,G=q&&!g,U=w?.[1]??"",T=Je(U),z=G&&T.length>0,A=T.length>0?Math.min(c,T.length-1):0,he=z?`${b}-opt-${A}`:void 0;m.useEffect(()=>{i(0),u(!1)},[U]),m.useEffect(()=>{q&&u(!1)},[q]),m.useEffect(()=>{n?.text&&d(j=>j.trim()?`${j.trim()}
2
2
 
3
3
  ${n.text}`:n.text)},[n]);const H=()=>{const j=o.trim();j&&(r(j),d(""))},V=j=>{d(`/${j.name} `),p.current?.focus()},J=j=>{const M=Ht(j);M.length!==0&&(j.preventDefault(),s(M))};return t.jsxs("div",{className:"agent-composer",children:[z&&t.jsx(Gt,{listboxId:b,query:U,highlightIndex:A,onSelect:V,onHighlightChange:i}),t.jsx("textarea",{ref:p,value:o,"aria-autocomplete":"list","aria-haspopup":"listbox","aria-label":l("agent.composerPlaceholder"),...z?{"aria-controls":b}:{},"aria-activedescendant":he,autoCapitalize:"off",autoCorrect:"off",placeholder:l("agent.composerPlaceholder"),onChange:j=>d(j.target.value),onPaste:J,onKeyDown:j=>{if(j.key==="Enter"&&(j.metaKey||j.ctrlKey)){j.preventDefault(),H();return}if(z)switch(j.key){case"Tab":{j.preventDefault(),V(T[A]);return}case"ArrowDown":{j.preventDefault(),i((A+1)%T.length);return}case"ArrowUp":{j.preventDefault(),i((A-1+T.length)%T.length);return}case"Enter":{j.preventDefault(),V(T[A]);return}case"Escape":{j.preventDefault(),u(!0);return}}}}),t.jsx("input",{ref:f,type:"file",accept:"image/png,image/jpeg,image/webp",multiple:!0,hidden:!0,onChange:j=>{const M=Ut(j.target.files??[]);M.length>0&&s(M),j.target.value=""}}),t.jsxs("div",{className:"agent-composer__actions",children:[t.jsx("button",{type:"button",onClick:()=>f.current?.click(),"aria-label":l("agent.attachReference"),title:l("agent.attachReference"),children:t.jsx(Bt,{size:16})}),t.jsx("button",{type:"button",className:e?"is-active":"","aria-pressed":e,onClick:()=>a(!e),"aria-label":l("agent.webSearch"),title:l("agent.webSearch"),children:t.jsx(Ot,{size:16})}),t.jsxs("button",{type:"button",className:"agent-composer__send",onClick:H,disabled:!v,"aria-label":l("agent.send"),children:[t.jsx(Dt,{size:16}),t.jsx("span",{children:l("agent.send")})]})]})]})}function Q({src:e,alt:n,className:a,fallbackClassName:s,iconSize:r=18}){const[l,o]=m.useState(!1);return!e||l?t.jsx("span",{className:s??"agent-image-fallback","aria-label":n,role:"img",children:t.jsx(O,{size:r})}):we(e)?t.jsx("video",{className:a,src:e,preload:"metadata",playsInline:!0,muted:!0,onError:()=>o(!0),"aria-label":n}):t.jsx("img",{className:a,src:e,alt:n,onError:()=>o(!0)})}const F=m.forwardRef(function({image:n,selected:a=!1,compact:s=!1,onSelect:r},l){const{t:o}=x(),d=`${o("agent.mediaSelect")}: ${n.prompt??n.filename}`,c=`${s?"agent-result-thumb agent-result-thumb--compact":"agent-result-thumb"}${a?" is-selected":""}`;return t.jsx("button",{ref:l,type:"button",className:c,"aria-label":d,"aria-current":a?"true":void 0,onClick:()=>r(n.id),title:o("agent.mediaSelect"),children:t.jsx(Q,{src:n.thumbUrl??n.url,alt:n.prompt??o("agent.imageAlt"),iconSize:s?14:18})})});function Jt({turn:e,imagesById:n,currentImageId:a,onImageSelect:s}){const{t:r}=x(),l=e.role==="user"?r("agent.user"):e.status==="error"?r("agent.errorRole"):r("agent.assistant"),o=e.imageIds??[],d=e.status==="streaming"?" is-streaming":e.status==="error"?" is-error":"",c=`agent-message agent-message--${e.role}${d}`;return t.jsxs("article",{className:c,"aria-busy":e.status==="streaming"?"true":void 0,children:[t.jsx("div",{className:"agent-message__role",children:l}),t.jsx("p",{children:e.text}),o.length>0?t.jsx("div",{className:"agent-message__images",children:o.map(i=>{const g=n[i];return g?t.jsx(F,{image:g,selected:i===a,compact:!1,onSelect:s},i):null})}):null]})}const Xt=["ima2.get_image_context","ima2.web_search","ima2.generate_image","ima2.generate_video","ima2.get_generation_errors"];function Yt(e){return e.replace(/\s+/g," ").trim()||"tool"}function Zt(e){if(e.toolCalls?.length)return e.toolCalls;const n=Yt(e.text);return Xt.filter(a=>n.includes(a)).map((a,s)=>({id:`${e.id}-fallback-${s}`,name:a,status:e.status==="error"?"error":e.status==="streaming"?"running":"complete",outputSummary:n,imageIds:a==="ima2.generate_image"||a==="ima2.generate_video"?e.imageIds??[]:[],webFindingIds:a==="ima2.web_search"?e.webFindingIds??[]:[]}))}function Xe(e){return!e||e<0?null:e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}const en={"ima2.get_image_context":"agent.toolLabel.getImageContext","ima2.web_search":"agent.toolLabel.webSearch","ima2.generate_image":"agent.toolLabel.generateImage","ima2.generate_video":"agent.toolLabel.generateVideo","ima2.get_generation_errors":"agent.toolLabel.getGenerationErrors"};function Ye(e){return en[e]??null}const tn=72;function nn(e,n=tn){const a=(e??"").replace(/\s+/g," ").trim();if(!a)return null;if(a.length<=n)return a;const s=a.slice(0,n),r=s.lastIndexOf(" ");return`${(r>n*.6?s.slice(0,r):s).trimEnd()}…`}function an({call:e,imagesById:n,currentImageId:a,onImageSelect:s}){const{t:r}=x(),l=e.imageIds??[],o=Xe(e.durationMs),[d,c]=m.useState({input:!1,output:!1}),i=(g,u)=>t.jsxs("dd",{className:d[g]?"is-expanded":void 0,children:[t.jsx("span",{children:u}),t.jsx("button",{type:"button",onClick:()=>c(p=>({...p,[g]:!p[g]})),children:r(d[g]?"agent.toolsShowLess":"agent.toolsShowMore")})]});return t.jsxs("div",{className:"agent-tool-call-details",children:[t.jsxs("dl",{children:[t.jsxs("div",{children:[t.jsx("dt",{children:r("agent.toolInput")}),i("input",e.inputSummary??"-")]}),t.jsxs("div",{children:[t.jsx("dt",{children:r("agent.toolOutput")}),i("output",e.errorMessage??e.outputSummary??"-")]}),e.requestId?t.jsxs("div",{children:[t.jsx("dt",{children:r("agent.requestId")}),t.jsx("dd",{children:e.requestId})]}):null,o?t.jsxs("div",{children:[t.jsx("dt",{children:r("agent.duration")}),t.jsx("dd",{children:o})]}):null]}),l.length>0?t.jsx("div",{className:"agent-tool-call-details__artifacts","aria-label":r("agent.toolArtifacts"),children:l.map(g=>{const u=n[g];return u?t.jsx(F,{image:u,selected:g===a,compact:!0,onSelect:s},g):null})}):null]})}function sn({call:e,imagesById:n,currentImageId:a,onImageSelect:s}){const{t:r}=x(),l=m.useId(),[o,d]=m.useState(!1),c=Xe(e.durationMs),i=Ye(e.name),g=i?r(i):e.name,u=nn(e.status==="error"?e.errorMessage??e.inputSummary:e.inputSummary),p=r(`agent.toolStatus.${e.status}`);return t.jsxs("li",{className:`agent-tool-call-row agent-tool-call-row--${e.status}`,children:[t.jsxs("button",{type:"button",className:"agent-tool-call-row__toggle","aria-expanded":o,"aria-controls":l,"aria-busy":e.status==="running"?"true":void 0,onClick:()=>d(f=>!f),children:[t.jsx("span",{className:"agent-tool-call-row__status","aria-hidden":"true"}),t.jsx("span",{className:"agent-tool-call-row__name",children:g}),t.jsx("span",{className:"agent-sr-only",children:p}),e.imageIds?.length?t.jsx("span",{className:"agent-tool-call-row__meta",children:r("agent.toolImageCount",{count:e.imageIds.length})}):null,c?t.jsx("span",{className:"agent-tool-call-row__meta agent-tool-call-row__meta--duration",children:c}):null,o?t.jsx(Ve,{size:13}):t.jsx(Ne,{size:13}),u?t.jsx("span",{className:"agent-tool-call-row__preview",title:u,children:u}):null]}),t.jsx("div",{id:l,hidden:!o,children:t.jsx(an,{call:e,imagesById:n,currentImageId:a,onImageSelect:s})})]})}function rn(e){const n=[],a=new Set;let s=!1;const r=[];for(const l of e){const o=Zt(l);n.push(...o);for(const d of l.imageIds??[])a.add(d);for(const d of o)for(const c of d.imageIds??[])a.add(c);l.status==="streaming"&&(s=!0);for(const d of o)r.includes(d.name)||r.push(d.name)}return{toolCalls:n,imageIds:[...a],isStreaming:s,names:r}}function ln({turns:e,imagesById:n,currentImageId:a,onImageSelect:s}){const{t:r}=x(),l=m.useId(),[o,d]=m.useState(!1),{toolCalls:c,imageIds:i,isStreaming:g,names:u}=m.useMemo(()=>rn(e),[e]),p=r(o?"agent.toolCollapse":"agent.toolExpand"),f=m.useMemo(()=>u.map(v=>{const w=Ye(v);return w?r(w):v}).join(" · ")||r("agent.toolGroup"),[u,r]);return t.jsxs("article",{className:`agent-message agent-message--tool is-collapsible${g?" is-streaming":""}`,"aria-busy":g?"true":void 0,children:[t.jsx("div",{className:"agent-message__tool-summary",children:t.jsx("button",{type:"button",className:"agent-message__tool-toggle","aria-expanded":o,"aria-controls":l,"aria-label":`${p}: ${f}`,onClick:()=>d(b=>!b),children:t.jsxs("span",{className:"agent-message__tool-summary-line",children:[t.jsx("span",{className:"agent-message__tool-dot","aria-hidden":"true"}),t.jsx("span",{className:"agent-message__role",children:r("agent.toolGroup")}),t.jsx("span",{className:"agent-message__tool-label",children:f}),i.length>0?t.jsx("span",{className:"agent-message__tool-count",children:r("agent.toolImageCount",{count:i.length})}):null,c.length>0?t.jsx("span",{className:"agent-message__tool-count",children:r("agent.toolCallCount",{count:c.length})}):null,o?t.jsx(Ve,{size:14}):t.jsx(Ne,{size:14})]})})}),t.jsxs("div",{id:l,className:"agent-message__tool-details",hidden:!o,children:[c.length>0?t.jsx("ul",{className:"agent-tool-call-list",children:c.map(b=>t.jsx(sn,{call:b,imagesById:n,currentImageId:a,onImageSelect:s},b.id))}):null,i.length>0?t.jsx("div",{className:"agent-message__tool-thumbs",children:i.map(b=>{const v=n[b];return v?t.jsx(F,{image:v,selected:b===a,compact:!0,onSelect:s},b):null})}):null]})]})}function on(e){return e.role!=="tool"&&(e.text.trim().length>0||(e.imageIds?.length??0)>0)}function cn({turns:e,imagesById:n,currentImageId:a,onImageSelect:s}){const{t:r}=x(),l=e.filter(u=>u.role==="tool"),o=e.filter(on),d=e.some(u=>u.status==="streaming"),c=e.some(u=>u.status==="error"),i=d?" is-streaming":c?" is-error":"",g=r(c?"agent.errorRole":"agent.assistant");return t.jsxs("article",{className:`agent-message agent-message--assistant-run${i}`,"aria-busy":d?"true":void 0,children:[t.jsxs("div",{className:"agent-run__header",children:[t.jsx("div",{className:"agent-message__role",children:g}),l.length>0?t.jsx("div",{className:"agent-run__header-tool",children:t.jsx(ln,{turns:l,imagesById:n,currentImageId:a,onImageSelect:s})}):null]}),o.length>0?t.jsx("ol",{className:"agent-run__steps","aria-label":g,children:o.map(u=>{const p=u.imageIds??[],f=u.status==="streaming"?" is-streaming":u.status==="error"?" is-error":"";return t.jsxs("li",{className:`agent-run__step${f}`,children:[t.jsx("span",{className:"agent-run__step-marker","aria-hidden":"true"}),t.jsxs("div",{className:"agent-run__step-body",children:[u.text.trim().length>0?t.jsx("p",{children:u.text}):null,p.length>0?t.jsx("div",{className:"agent-message__images",children:p.map(b=>{const v=n[b];return v?t.jsx(F,{image:v,selected:b===a,compact:!1,onSelect:s},b):null})}):null]})]},u.id)})}):null]})}function un(e){const n=[];let a=[];const s=()=>{a.length!==0&&(n.push({kind:"run",turns:a,key:`run-${a[0].id}`}),a=[])};for(const r of e)r.role==="user"?(s(),n.push({kind:"single",turn:r})):a.push(r);return s(),n}function dn({turns:e,imagesById:n,currentImageId:a,onImageSelect:s}){const{t:r}=x(),l=m.useRef(null),o=m.useRef(!0),[d,c]=m.useState(!1),i=m.useMemo(()=>un(e),[e]),g=m.useCallback(()=>{const p=l.current;p&&(o.current=p.scrollHeight-p.scrollTop-p.clientHeight<=120,o.current&&c(!1))},[]),u=m.useCallback(()=>{const p=l.current;p&&(p.scrollTo({top:p.scrollHeight,behavior:"smooth"}),o.current=!0,c(!1))},[]);return m.useEffect(()=>{const p=l.current;p&&(o.current?p.scrollTop=p.scrollHeight:c(!0))},[e.length]),t.jsxs("div",{className:"agent-message-list-wrap",children:[t.jsxs("div",{ref:l,className:"agent-message-list",role:"log","aria-label":r("agent.workspace"),onScroll:g,children:[e.length===0?t.jsx("div",{className:"agent-message-list__empty",children:r("agent.emptyChat")}):null,i.map(p=>p.kind==="run"?t.jsx(cn,{turns:p.turns,imagesById:n,currentImageId:a,onImageSelect:s},p.key):t.jsx(Jt,{turn:p.turn,imagesById:n,currentImageId:a,onImageSelect:s},p.turn.id))]}),d?t.jsx("button",{type:"button",className:"agent-message-list__jump",onClick:u,children:r("agent.emptyJumpLatest")}):null]})}const ue=[{value:"gpt-5.6-luna",shortLabel:"5.6l",fullLabel:"GPT-5.6 Luna",provider:"oauth"},{value:"gpt-5.6-terra",shortLabel:"5.6t",fullLabel:"GPT-5.6 Terra",provider:"oauth"},{value:"gpt-5.6-sol",shortLabel:"5.6s",fullLabel:"GPT-5.6 Sol",provider:"oauth"},{value:"gpt-5.5",shortLabel:"5.5",fullLabel:"GPT-5.5",provider:"oauth"},{value:"gpt-5.4",shortLabel:"5.4",fullLabel:"GPT-5.4",provider:"oauth"},{value:"gpt-5.4-mini",shortLabel:"5.4m",fullLabel:"GPT-5.4 mini",provider:"oauth"},{value:"grok-4.6",shortLabel:"4.6",fullLabel:"Grok 4.6",provider:"grok"},{value:"grok-4.5",shortLabel:"4.5",fullLabel:"Grok 4.5",provider:"grok"},{value:"grok-4.3",shortLabel:"4.3",fullLabel:"Grok 4.3",provider:"grok"}];function gn(e){return ue.find(n=>n.value===e.model)??ue.find(n=>n.provider===e.provider)??ue[0]}function Ze({settings:e,onChange:n,onOpenModelTab:a}){const{t:s}=x(),[r,l]=m.useState(!1),o=m.useRef(null),d=gn(e),c=ye.find(i=>i.value===e.reasoningEffort)??ye[0];return m.useEffect(()=>{if(!r)return;const i=u=>{o.current?.contains(u.target)||l(!1)},g=u=>{u.key==="Escape"&&l(!1)};return window.addEventListener("pointerdown",i),window.addEventListener("keydown",g),()=>{window.removeEventListener("pointerdown",i),window.removeEventListener("keydown",g)}},[r]),t.jsxs("div",{ref:o,className:"image-model-select image-model-select--sidebar agent-model-select",children:[t.jsxs("button",{type:"button",className:"image-model-select__trigger image-model-select__trigger--pill","aria-haspopup":"menu","aria-expanded":r,"aria-label":s("sidebar.quickSettingsAria",{model:d.shortLabel,effort:c.shortLabel}),onClick:()=>l(i=>!i),children:[t.jsxs("span",{className:"image-model-select__trigger-top",children:[t.jsx("span",{className:"image-model-select__trigger-model",children:d.shortLabel}),t.jsx("span",{className:"image-model-select__trigger-chevron","aria-hidden":"true",children:"▾"})]}),t.jsx("span",{className:"image-model-select__trigger-effort",children:c.shortLabel})]}),a?t.jsx("button",{type:"button",className:"agent-model-select__open-tab",onClick:a,"aria-label":s("agent.modelTabView"),title:s("agent.modelTabView"),children:t.jsx(Ne,{size:13})}):null,r?t.jsxs("div",{className:"image-model-select__menu agent-model-select__menu",role:"menu","aria-label":s("sidebar.quickSettingsMenu"),children:[t.jsxs("div",{className:"image-model-select__section",role:"group","aria-label":s("agent.model"),children:[t.jsx("div",{className:"image-model-select__section-title",children:s("agent.model")}),ue.map(i=>t.jsxs("button",{type:"button",className:`image-model-select__item${i.value===d.value?" is-active":""}`,role:"menuitemradio","aria-checked":i.value===d.value,onClick:()=>{n({model:i.value,provider:i.provider}),l(!1)},children:[t.jsx("span",{children:i.shortLabel}),t.jsx("small",{children:i.fullLabel})]},i.value))]}),t.jsxs("div",{className:"image-model-select__section",role:"group","aria-label":s("sidebar.reasoningLabel"),children:[t.jsx("div",{className:"image-model-select__section-title",children:s("sidebar.reasoningLabel")}),ye.map(i=>t.jsxs("button",{type:"button",className:`image-model-select__item${i.value===e.reasoningEffort?" is-active":""}`,role:"menuitemradio","aria-checked":i.value===e.reasoningEffort,onClick:()=>{n({reasoningEffort:i.value}),l(!1)},children:[t.jsx("span",{children:i.shortLabel}),t.jsx("small",{children:s(i.fullLabelKey)})]},i.value))]})]}):null]})}function hn(e,n){if(!e)return null;const a=Math.max(0,Math.floor((n-e)/1e3));return`${String(Math.floor(a/60)).padStart(2,"0")}:${String(a%60).padStart(2,"0")}`}function mn({progress:e,queueSummary:n,onQueueOpen:a,onRetry:s}){const{t:r}=x(),[l,o]=m.useState(Date.now());m.useEffect(()=>{if(!e?.startedAt)return;o(Date.now());const p=window.setInterval(()=>o(Date.now()),1e3);return()=>window.clearInterval(p)},[e?.startedAt]);const d=n?.activeCount??(e?.queuedCount??0)+(e?.runningCount??0),c=n?.failedCount??e?.failedCount??0;if(!e?.active&&!n)return null;const i=e?.status==="queued"?"agent.progressQueued":e?.progressStage==="downloading"?"agent.progressDownloading":e?.status==="running"||e?.progressStage==="requesting"||e?.progressStage==="polling"?"agent.progressGenerating":e?.status==="error"?"agent.progressFailed":"agent.progressPlanning",g=hn(e?.startedAt,l),u=e?.jobKind?r("agent.progressJob",{kind:r(`agent.mediaKind.${e.jobKind}`),count:e.variantCount??1}):null;return t.jsxs("div",{className:`agent-run-status agent-run-status--${e?.status??"idle"}`,role:"status","aria-live":"polite",children:[e?.active?t.jsx("span",{className:"agent-run-status__indicator","aria-hidden":"true"}):null,e?.active?t.jsx("span",{className:"agent-run-status__label",children:r(i)}):null,u?t.jsx("span",{className:"agent-run-status__meta",children:u}):null,g?t.jsx("time",{className:"agent-run-status__elapsed",dateTime:`PT${Math.floor((l-(e?.startedAt??l))/1e3)}S`,children:g}):null,e?.status==="error"&&e.lastError?t.jsx("span",{className:"agent-run-status__meta",children:e.lastError}):null,e?.status==="error"&&s?t.jsx("button",{type:"button",className:"agent-run-status__retry",onClick:s,children:r("agent.retryQueue")}):null,t.jsx("button",{type:"button",className:"agent-run-status__queue",onClick:a,disabled:!a,children:r("agent.queueSummary",{active:d,failed:c})})]})}function pn({status:e,compacted:n=!1}){const{t:a}=x(),s=a(e==="generating"?"agent.statusGenerating":e==="reconnecting"?"agent.statusReconnecting":"agent.statusReady");return t.jsxs("span",{className:`agent-status agent-status--${e}`,"aria-live":e==="ready"?void 0:"polite",children:[e==="generating"?t.jsx("span",{className:"agent-status__dot","aria-hidden":"true"}):null,t.jsx("span",{children:s}),n?t.jsx("em",{children:a("agent.compacted")}):null]})}function fn({session:e,turns:n,imagesById:a,currentImageId:s,runtimeStatus:r,runProgress:l,settings:o,insertedPrompt:d,onSettingsChange:c,onOpenModelTab:i,onWebSearchChange:g,onAttachFiles:u,onImageSelect:p,onSend:f,onRetryRun:b}){const{t:v}=x();return t.jsxs("section",{className:"agent-chat","aria-label":v("agent.chat"),children:[t.jsxs("header",{className:"agent-pane-header",children:[t.jsxs("div",{className:"agent-pane-header__title",children:[t.jsx("span",{children:v("agent.chat")}),t.jsx("strong",{children:e?.title??v("agent.newSession")})]}),t.jsxs("div",{className:"agent-pane-header__actions",children:[o&&c?t.jsx(Ze,{settings:o,onChange:c,onOpenModelTab:i}):null,t.jsx(pn,{status:r,compacted:e?.compacted})]})]}),t.jsx(dn,{turns:n,imagesById:a,currentImageId:s,onImageSelect:p}),t.jsx(mn,{progress:l,onRetry:b}),t.jsx(Vt,{webSearchEnabled:e?.webSearchEnabled??!1,insertedPrompt:d,onWebSearchChange:g,onAttachFiles:u,onSend:f})]})}const xn=["image","refs","web","memory"];function bn({activeTab:e,onChange:n}){const{t:a}=x(),s={image:a("agent.imageTab"),refs:a("agent.refsTab"),web:a("agent.webTab"),memory:a("agent.memoryTab")};return t.jsx("div",{className:"agent-context-tabs",role:"tablist","aria-label":a("agent.contextTabs"),children:xn.map(r=>t.jsx("button",{type:"button",role:"tab","aria-selected":e===r,className:e===r?"active":"",onClick:()=>n(r),children:s[r]},r))})}function jn({activeTab:e,currentImage:n}){const{t:a}=x();return e==="refs"?t.jsx("div",{className:"agent-tab-empty",children:a("agent.noRefs")}):e==="web"?t.jsx("div",{className:"agent-tab-empty",children:a("agent.noWeb")}):e==="memory"?t.jsxs("ul",{className:"agent-memory-list",children:[t.jsx("li",{children:a("agent.memoryItemStyle")}),t.jsx("li",{children:a("agent.memoryItemSubject")})]}):t.jsxs("dl",{className:"agent-image-meta",children:[t.jsxs("div",{children:[t.jsx("dt",{children:a("agent.filename")}),t.jsx("dd",{children:n?.filename??"-"})]}),t.jsxs("div",{children:[t.jsx("dt",{children:a("agent.prompt")}),t.jsx("dd",{children:n?.prompt??n?.revisedPrompt??"-"})]})]})}function yn(e){const n=Math.max(0,Math.round(e));return`${Math.floor(n/60)}:${String(n%60).padStart(2,"0")}`}function et({image:e}){const{t:n}=x(),[a,s]=m.useState("loading"),[r,l]=m.useState(null),[o,d]=m.useState(0),c=g=>{const u=g.currentTarget.duration;l(Number.isFinite(u)?u:null),s("ready")},i=()=>{s("loading"),l(null),d(g=>g+1)};return t.jsxs("div",{className:"agent-video-preview",children:[a==="loading"?t.jsx("div",{className:"agent-video-preview__skeleton",role:"status",children:n("agent.mediaLoading")}):null,a==="error"?t.jsxs("div",{className:"agent-video-preview__error",role:"alert",children:[t.jsx(O,{size:34}),t.jsx("span",{children:n("agent.mediaLoadFailed")}),t.jsx("button",{type:"button",onClick:i,children:n("agent.mediaRetry")})]}):t.jsx("video",{src:e.url,controls:!0,playsInline:!0,preload:"metadata","aria-label":e.prompt??n("agent.mediaVideoLabel"),onLoadedMetadata:c,onError:()=>s("error")},o),t.jsxs("div",{className:"agent-video-preview__toolbar",children:[t.jsx("span",{children:r==null?n("agent.mediaDurationUnknown"):n("agent.mediaDuration",{duration:yn(r)})}),t.jsx("a",{href:e.url,download:e.filename,children:n("agent.mediaDownload")})]})]})}function tt({currentImage:e,images:n,activeTab:a,onTabChange:s,onImageSelect:r,headerAction:l}){const{t:o}=x(),d=m.useRef({}),c=m.useMemo(()=>n.findIndex(u=>u.id===e?.id),[e?.id,n]);m.useEffect(()=>{e?.id&&d.current[e.id]?.scrollIntoView({block:"nearest",inline:"nearest"})},[e?.id]);const i=m.useCallback(u=>{const p=n[u];p&&r(p.id)},[n,r]),g=m.useCallback(u=>{if(n.length===0)return;const p=c>=0?c:0;let f=null;(u.key==="ArrowLeft"||u.key==="ArrowUp")&&(f=Math.max(0,p-1)),(u.key==="ArrowRight"||u.key==="ArrowDown")&&(f=Math.min(n.length-1,p+1)),u.key==="Home"&&(f=0),u.key==="End"&&(f=n.length-1),!(f===null||f===p)&&(u.preventDefault(),i(f))},[c,n.length,i]);return t.jsxs("section",{className:"agent-image","aria-label":o("agent.imagePane"),children:[t.jsxs("header",{className:"agent-pane-header",children:[t.jsxs("div",{className:"agent-pane-header__title",children:[t.jsx("span",{children:o("agent.imagePane")}),t.jsx("strong",{children:o("agent.currentImage")})]}),l]}),t.jsx("div",{className:"agent-image__preview",tabIndex:n.length>1?0:void 0,onKeyDown:g,"aria-label":n.length>1?o("agent.variants"):void 0,children:e?we(e.url)?t.jsx(et,{image:e},e.id):t.jsx(Q,{src:e.url,alt:e.prompt??o("agent.imageAlt"),fallbackClassName:"agent-image__empty",iconSize:34}):t.jsxs("div",{className:"agent-image__empty",children:[t.jsx(O,{size:34}),t.jsx("span",{children:o("agent.noImage")})]})}),t.jsx("div",{className:"agent-image__variants","aria-label":o("agent.variants"),onKeyDown:g,children:n.map(u=>t.jsx(F,{ref:p=>{d.current[u.id]=p},image:u,selected:u.id===e?.id,onSelect:r},u.id))}),t.jsx(bn,{activeTab:a,onChange:s}),t.jsx(jn,{activeTab:a,currentImage:e})]})}function vn({open:e,currentImage:n,images:a,activeTab:s,onTabChange:r,onImageSelect:l,onClose:o}){const{t:d}=x(),c=m.useCallback(()=>o(),[o]),i=de(e,c);return e?t.jsxs("div",{className:"agent-dialog agent-dialog--image",role:"presentation",children:[t.jsx("button",{type:"button",className:"agent-dialog__backdrop",onClick:o,"aria-label":d("agent.closeImage")}),t.jsx("section",{ref:i,className:"agent-image-sheet",role:"dialog","aria-modal":"true","aria-label":d("agent.imagePane"),children:t.jsx(tt,{currentImage:n,images:a,activeTab:s,onTabChange:r,onImageSelect:l,headerAction:t.jsx("button",{type:"button",onClick:o,"aria-label":d("agent.closeImage"),children:t.jsx(ge,{size:17})})})})]}):null}function Sn(e){return e.status==="queued"?`#${e.position}`:e.status==="succeeded"?String(e.resultImageIds.length):""}function _n(e,n){if(!e)return"-";const a=Math.max(1,Math.round((Date.now()-e)/1e3));if(a<60)return n(a,"second");const s=Math.round(a/60);return s<60?n(s,"minute"):n(Math.round(s/60),"hour")}function wn(e){return!e.errorCode&&!e.errorClass&&!e.errorMessage?null:Ct({code:e.errorCode,errorClass:e.errorClass,rawCode:e.errorRawCode,message:e.errorMessage})}function Nn(e,n){return e?.errorClass?e.spec.cardKey?n(`${e.spec.cardKey}.title`):e.spec.toastKey?n(e.spec.toastKey):null:null}function Cn({item:e,onCancel:n,onRetry:a}){const{t:s}=x(),r=e.status==="queued"||e.status==="running",l=e.status==="failed"||e.status==="canceled",o=e.plan.plannedVariants||e.plan.prompts.length||1,d=e.plan.plannedParallelism||e.options.parallelism,c=Sn(e),i=_n(e.createdAt,(u,p)=>s("agent.queueTimeAgo",{value:u,unit:s(`agent.queueTimeUnit.${p}`)})),g=Nn(wn(e),s);return t.jsxs("div",{className:`agent-queue-row agent-queue-row--${e.status}`,children:[t.jsxs("div",{className:"agent-queue-row__main",children:[t.jsx("strong",{children:e.prompt}),t.jsx("span",{className:`agent-queue-row__badge agent-queue-row__badge--${e.status}`,children:s(`agent.queueStatus.${e.status}`)}),t.jsx("span",{children:[c,g,s("agent.queuePlanSummary",{variants:o,parallel:d}),i].filter(Boolean).join(" · ")}),e.plan.reason||e.errorCode||e.errorMessage?t.jsxs("details",{className:"agent-queue-row__details",children:[t.jsx("summary",{children:s("agent.queueDetails")}),e.plan.reason?t.jsx("small",{children:e.plan.reason}):null,e.errorCode?t.jsx("small",{children:e.errorCode}):null,e.errorMessage?t.jsx("small",{children:e.errorMessage}):null]}):null]}),t.jsxs("div",{className:"agent-queue-row__actions",children:[r?t.jsx("button",{type:"button",onClick:()=>n(e.id),children:s("agent.cancelQueue")}):null,l?t.jsx("button",{type:"button",onClick:()=>a(e.id),children:s("agent.retryQueue")}):null]})]})}function nt({items:e,summary:n,onCancel:a,onRetry:s}){const{t:r}=x(),l=r("agent.queueAnnouncement",{running:n?.runningCount??0,queued:n?.queuedCount??0,failed:e.filter(o=>o.status==="failed").length});return t.jsxs("section",{className:"agent-sidebar-section","aria-label":r("agent.queue"),children:[t.jsx("header",{children:t.jsxs("div",{children:[t.jsx("span",{children:r("agent.queue")}),t.jsxs("strong",{children:[n?.runningCount??0," ",r("agent.runningShort")," · ",n?.queuedCount??0," ",r("agent.queuedShort")]})]})}),t.jsxs("div",{className:"agent-queue-list",children:[t.jsx("span",{className:"agent-sr-only","aria-live":"polite","aria-atomic":"true",children:l}),e.length===0?t.jsx("div",{className:"agent-tab-empty",children:r("agent.queueEmpty")}):e.map(o=>t.jsx(Cn,{item:o,onCancel:a,onRetry:s},o.id))]})]})}function kn({open:e,items:n,summary:a,onCancel:s,onRetry:r,onClose:l}){const{t:o}=x(),d=m.useCallback(()=>l(),[l]),c=de(e,d);return e?t.jsxs("div",{className:"agent-dialog agent-dialog--queue",role:"presentation",children:[t.jsx("button",{type:"button",className:"agent-dialog__backdrop",onClick:l,"aria-label":o("agent.topbarCloseQueue")}),t.jsxs("section",{ref:c,className:"agent-queue-sheet",role:"dialog","aria-modal":"true","aria-label":o("agent.topbarQueueSheet"),children:[t.jsxs("header",{children:[t.jsx("strong",{children:o("agent.topbarQueueSheet")}),t.jsx("button",{type:"button",onClick:l,"aria-label":o("agent.topbarCloseQueue"),children:t.jsx(ge,{size:17})})]}),t.jsx(nt,{items:n,summary:a,onCancel:s,onRetry:r})]})]}):null}function at({mode:e,onInsert:n}){const{t:a}=x(),s=E(i=>i.promptLibrary),r=E(i=>i.promptLibraryLoading),l=E(i=>i.loadPromptLibrary),[o,d]=m.useState("");m.useEffect(()=>{l()},[l]);const c=m.useMemo(()=>{const i=o.trim().toLowerCase();return s.prompts.filter(g=>{const u=g.tags.map(p=>p.toLowerCase());return e==="forms"&&!u.includes("agent:form")?!1:i?g.name.toLowerCase().includes(i)||g.text.toLowerCase().includes(i)||u.some(p=>p.includes(i)):!0})},[s.prompts,e,o]);return t.jsxs("section",{className:"agent-sidebar-section","aria-label":a(e==="forms"?"agent.forms":"agent.promptLibrary"),children:[t.jsx("header",{children:t.jsxs("div",{children:[t.jsx("span",{children:a(e==="forms"?"agent.forms":"agent.promptLibrary")}),t.jsx("strong",{children:c.length})]})}),t.jsxs("label",{className:"agent-sidebar-search",children:[t.jsx("span",{children:a("promptLibrary.search")}),t.jsx("input",{value:o,onChange:i=>d(i.target.value),placeholder:a("promptLibrary.search")})]}),t.jsxs("div",{className:"agent-prompt-library-list",children:[r?t.jsx("div",{className:"agent-tab-empty",children:a("common.loading")}):null,!r&&c.length===0?t.jsx("div",{className:"agent-tab-empty",children:a(e==="forms"?"agent.noForms":"promptLibrary.empty")}):null,c.map(i=>t.jsxs("article",{className:"agent-prompt-library-row",children:[t.jsx("strong",{children:i.name||a("promptLibrary.untitled")}),t.jsx("p",{children:i.text}),t.jsx("button",{type:"button",onClick:()=>n(i.text),children:a("agent.insertPrompt")})]},i.id))]})]})}function In({onInsert:e}){return t.jsx(at,{mode:"forms",onInsert:e})}function ne({label:e,value:n,options:a,onChange:s}){return t.jsxs("div",{className:"agent-settings-grid__field",children:[t.jsx("span",{children:e}),t.jsx("div",{className:"agent-segment-control",role:"group","aria-label":e,children:a.map(r=>t.jsx("button",{type:"button","aria-pressed":r.value===n,onClick:()=>s(r.value),children:r.label},r.value))})]})}function ve({label:e,value:n,max:a,onChange:s}){return t.jsxs("div",{className:"agent-settings-grid__field",children:[t.jsx("span",{children:e}),t.jsxs("div",{className:"agent-stepper",role:"group","aria-label":e,children:[t.jsx("button",{type:"button","aria-label":`${e} -`,disabled:n<=1,onClick:()=>s(Math.max(1,n-1)),children:"-"}),t.jsx("output",{"aria-live":"polite",children:n}),t.jsx("button",{type:"button","aria-label":`${e} +`,disabled:n>=a,onClick:()=>s(Math.min(a,n+1)),children:"+"})]})]})}function An({settings:e,onChange:n}){const{t:a}=x();return t.jsxs("section",{className:"agent-settings-grid","aria-label":a("agent.quality"),children:[t.jsx(ne,{label:a("agent.generationStrategy"),value:e.generationStrategy,options:[{value:"auto",label:a("agent.generationStrategyAuto")},{value:"manual",label:a("agent.generationStrategyManual")}],onChange:s=>n({generationStrategy:s})}),t.jsx(ne,{label:a("agent.quality"),value:e.quality,options:[{value:"low",label:"low"},{value:"medium",label:"medium"},{value:"high",label:"high"}],onChange:s=>n({quality:s})}),t.jsx(ne,{label:a("agent.size"),value:e.size,options:[{value:"1024x1024",label:"1:1"},{value:"1536x1024",label:"3:2"},{value:"1024x1536",label:"2:3"},{value:"2048x2048",label:"2K"}],onChange:s=>n({size:s})}),t.jsx(ne,{label:a("agent.format"),value:e.format,options:[{value:"png",label:"PNG"},{value:"jpeg",label:"JPEG"},{value:"webp",label:"WebP"}],onChange:s=>n({format:s})}),t.jsx(ne,{label:a("agent.moderation"),value:e.moderation,options:[{value:"auto",label:"auto"},{value:"low",label:"low"}],onChange:s=>n({moderation:s})}),e.generationStrategy==="manual"?t.jsx(ve,{label:a("agent.variantsCount"),value:e.variants,max:_e,onChange:s=>n({variants:s})}):t.jsx(ve,{label:a("agent.maxAutoVariants"),value:e.maxAutoVariants,max:_e,onChange:s=>n({maxAutoVariants:s})}),t.jsx(ve,{label:a("agent.parallelism"),value:e.parallelism,max:Mt,onChange:s=>n({parallelism:s})})]})}const D=["image","library","forms","quality","model","queue"];function Tn({activeTab:e,onChange:n}){const{t:a}=x(),s=m.useRef({}),r=m.useCallback(l=>{const o=D.indexOf(e),d=o>=0?o:0;let c=null;if((l.key==="ArrowRight"||l.key==="ArrowDown")&&(c=(d+1)%D.length),(l.key==="ArrowLeft"||l.key==="ArrowUp")&&(c=(d-1+D.length)%D.length),l.key==="Home"&&(c=0),l.key==="End"&&(c=D.length-1),c===null)return;l.preventDefault();const i=D[c];n(i),s.current[i]?.focus()},[e,n]);return t.jsx("div",{className:"agent-sidebar-tabs",role:"tablist","aria-label":a("agent.rightSidebar"),children:D.map(l=>t.jsx("button",{type:"button",role:"tab",id:`agent-sidebar-tab-${l}`,ref:o=>{s.current[l]=o},"aria-controls":`agent-sidebar-panel-${l}`,className:e===l?"active":"","aria-selected":e===l,tabIndex:e===l?0:-1,onKeyDown:r,onClick:()=>n(l),children:a(`agent.sidebarTabs.${l}`)},l))})}function ze({currentImage:e,images:n,contextTab:a,sidebarTab:s,queueItems:r,runSummary:l,settings:o,onContextTabChange:d,onSidebarTabChange:c,onImageSelect:i,onSettingsChange:g,onInsertPrompt:u,onCancelQueue:p,onRetryQueue:f}){const{t:b}=x(),v=w=>({id:`agent-sidebar-panel-${w}`,role:"tabpanel","aria-labelledby":`agent-sidebar-tab-${w}`});return t.jsxs(t.Fragment,{children:[t.jsx(Tn,{activeTab:s,onChange:c}),s==="image"?t.jsx("div",{...v("image"),className:"agent-sidebar-panel",children:t.jsx(tt,{currentImage:e,images:n,activeTab:a,onTabChange:d,onImageSelect:i})}):null,s==="library"?t.jsx("div",{...v("library"),className:"agent-sidebar-panel",children:t.jsx(at,{mode:"library",onInsert:u})}):null,s==="forms"?t.jsx("div",{...v("forms"),className:"agent-sidebar-panel",children:t.jsx(In,{onInsert:u})}):null,s==="quality"?t.jsxs("section",{...v("quality"),className:"agent-sidebar-panel agent-sidebar-section","aria-label":b("agent.quality"),children:[t.jsx("header",{children:t.jsxs("div",{children:[t.jsx("span",{children:b("agent.quality")}),t.jsx("strong",{children:o.generationStrategy==="auto"?b("agent.generationStrategyAuto"):b("agent.generationStrategyManual")})]})}),t.jsx(An,{settings:o,onChange:g})]}):null,s==="model"?t.jsxs("section",{...v("model"),className:"agent-sidebar-panel agent-sidebar-section","aria-label":b("agent.modelSettings"),children:[t.jsx("header",{children:t.jsxs("div",{children:[t.jsx("span",{children:b("agent.modelSettings")}),t.jsx("strong",{children:o.model})]})}),t.jsx(Ze,{settings:o,onChange:g})]}):null,s==="queue"?t.jsx("div",{...v("queue"),className:"agent-sidebar-panel",children:t.jsx(nt,{items:r,summary:l,onCancel:p,onRetry:f})}):null]})}const Ln=()=>{};function We({overlay:e,onClose:n,...a}){const{t:s}=x(),r=de(e===!0,n??Ln,{modal:!1});return e?t.jsxs("section",{ref:r,id:"agent-tools-panel",className:"agent-right-sidebar agent-right-sidebar--overlay",role:"dialog","aria-labelledby":"agent-tools-panel-title",children:[t.jsxs("header",{className:"agent-right-sidebar__overlay-header",children:[t.jsx("h2",{id:"agent-tools-panel-title",tabIndex:-1,"data-autofocus":!0,children:s("agent.toolsPanel")}),t.jsx("button",{type:"button",onClick:n,"aria-label":s("agent.closeTools"),children:t.jsx(ge,{size:17})})]}),t.jsx(ze,{...a})]}):t.jsx("aside",{className:"agent-right-sidebar",children:t.jsx(ze,{...a})})}function st({summary:e}){const{t:n}=x();if(!e||e.status==="idle")return null;const a=e.status==="running"?n("agent.sessionRunning"):e.status==="queued"?n("agent.sessionQueued",{count:e.queuedCount}):n("agent.sessionError");return t.jsxs("span",{className:`agent-session-spinner agent-session-spinner--${e.status}`,"data-motion-essential":!0,"aria-label":a,title:a,children:[t.jsx("span",{"aria-hidden":"true"}),e.queuedCount>0?t.jsx("em",{children:e.queuedCount}):null]})}function Mn(e){const n=Math.max(1,Math.round((Date.now()-e)/6e4));if(n<60)return`${n}m`;const a=Math.round(n/60);return a<24?`${a}h`:`${Math.round(a/24)}d`}function En({sessions:e,selectedId:n,imagesById:a,runSummaryBySession:s={},onSelect:r,onRename:l,onDelete:o}){const{t:d}=x();return t.jsx("div",{className:"agent-session-list",children:e.map(c=>{const i=c.lastImageId?a[c.lastImageId]:null;return t.jsxs("div",{className:`agent-session-row${c.id===n?" is-active":""}`,children:[t.jsxs("button",{type:"button","aria-current":c.id===n?"page":void 0,onClick:()=>r(c.id),children:[t.jsx("span",{className:"agent-session-row__thumb",children:i?t.jsx(Q,{src:i.thumbUrl??i.url,alt:"",iconSize:17}):t.jsx(O,{size:17})}),t.jsxs("span",{className:"agent-session-row__body",children:[t.jsx("strong",{children:c.title}),t.jsxs("span",{children:[d("agent.imageCount",{count:c.imageCount})," · ",Mn(c.updatedAt)]})]}),t.jsxs("span",{className:"agent-session-row__badges",children:[t.jsx(st,{summary:s[c.id]}),c.webSearchEnabled?t.jsx("em",{title:d("agent.web"),children:"W"}):null,c.compacted?t.jsx("em",{title:d("agent.compacted"),children:"C"}):null]})]}),t.jsxs("div",{className:"agent-session-row__actions",children:[t.jsx("button",{type:"button",onClick:()=>l(c.id),"aria-label":d("agent.renameSession"),title:d("agent.renameSession"),children:t.jsx(Qt,{size:14})}),t.jsx("button",{type:"button",onClick:()=>o(c.id),"aria-label":d("agent.deleteSession"),title:d("agent.deleteSession"),children:t.jsx(Kt,{size:14})})]})]},c.id)})})}function qn({open:e,sessions:n,selectedId:a,imagesById:s,runSummaryBySession:r,onClose:l,onCreate:o,onSelect:d,onRename:c,onDelete:i}){const{t:g}=x(),[u,p]=m.useState(""),f=m.useCallback(()=>l(),[l]),b=de(e,f),v=m.useMemo(()=>{const w=u.trim().toLowerCase();return w?n.filter(q=>q.title.toLowerCase().includes(w)):n},[u,n]);return e?t.jsxs("div",{className:"agent-dialog agent-dialog--drawer",role:"presentation",children:[t.jsx("button",{type:"button",className:"agent-dialog__backdrop",onClick:l,"aria-label":g("agent.closeSessions")}),t.jsxs("section",{ref:b,className:"agent-session-drawer",role:"dialog","aria-modal":"true","aria-label":g("agent.sessions"),children:[t.jsxs("header",{children:[t.jsx("strong",{children:g("agent.sessions")}),t.jsx("button",{type:"button",onClick:l,"aria-label":g("agent.closeSessions"),children:t.jsx(ge,{size:17})})]}),t.jsxs("button",{type:"button",className:"agent-sessions__create",onClick:o,children:[t.jsx(Ue,{size:16}),t.jsx("span",{children:g("agent.newSession")})]}),t.jsxs("label",{className:"agent-sessions__search",children:[t.jsx(Pt,{size:15}),t.jsx("input",{value:u,onChange:w=>p(w.target.value),placeholder:g("agent.sessionSearch")})]}),t.jsx(En,{sessions:v,selectedId:a,imagesById:s,runSummaryBySession:r,onSelect:d,onRename:c,onDelete:i})]})]}):null}function Rn({sessions:e,selectedId:n,imagesById:a,runSummaryBySession:s={},onCreate:r,onSelect:l,onOpenDrawer:o}){const{t:d}=x();return t.jsxs("aside",{className:"agent-rail","aria-label":d("agent.sessions"),children:[t.jsx("button",{type:"button",onClick:o,"aria-label":d("agent.openSessions"),title:d("agent.openSessions"),children:t.jsx(He,{size:17})}),t.jsx("button",{type:"button",onClick:r,"aria-label":d("agent.newSession"),title:d("agent.newSession"),children:t.jsx(Ue,{size:17})}),t.jsx("div",{className:"agent-rail__sessions",children:e.map(c=>{const i=c.lastImageId?a[c.lastImageId]:null,g=`${c.title} — ${d("agent.imageCount",{count:c.imageCount})}`;return t.jsxs("button",{type:"button",className:c.id===n?"is-active":"",onClick:()=>l(c.id),title:g,"aria-label":g,"aria-current":c.id===n?"true":void 0,children:[i?t.jsx(Q,{src:i.thumbUrl??i.url,alt:"",iconSize:17}):t.jsx(O,{size:17}),t.jsx(st,{summary:s[c.id]}),c.compacted?t.jsx("span",{"aria-label":d("agent.compacted")}):null]},c.id)})})]})}function $n({currentImage:e,images:n,onImageSelect:a,onOpenPanel:s,toolsPanelOpen:r}){const{t:l}=x(),o=m.useRef({}),d=m.useMemo(()=>n.findIndex(g=>g.id===e?.id),[e?.id,n]);m.useEffect(()=>{e?.id&&o.current[e.id]?.scrollIntoView({block:"nearest",inline:"nearest"})},[e?.id]);const c=m.useCallback(g=>{const u=n[g];u&&a(u.id)},[n,a]),i=m.useCallback(g=>{if(n.length===0)return;const u=d>=0?d:0;let p=null;(g.key==="ArrowLeft"||g.key==="ArrowUp")&&(p=Math.max(0,u-1)),(g.key==="ArrowRight"||g.key==="ArrowDown")&&(p=Math.min(n.length-1,u+1)),g.key==="Home"&&(p=0),g.key==="End"&&(p=n.length-1),!(p===null||p===u)&&(g.preventDefault(),c(p))},[d,n.length,c]);return t.jsxs("section",{className:"agent-stage","aria-label":l("agent.imagePane"),children:[t.jsxs("header",{className:"agent-pane-header",children:[t.jsxs("div",{className:"agent-pane-header__title",children:[t.jsx("span",{children:l("agent.imagePane")}),t.jsx("strong",{children:l("agent.currentImage")})]}),t.jsx("button",{type:"button",className:"agent-stage__tools",onClick:s,"aria-expanded":r===!0,"aria-controls":"agent-tools-panel","aria-label":l(r?"agent.closeTools":"agent.openTools"),title:l(r?"agent.closeTools":"agent.openTools"),children:t.jsx(Ft,{size:16})})]}),t.jsx("div",{className:"agent-stage__viewport",tabIndex:n.length>1?0:void 0,onKeyDown:i,"aria-label":n.length>1?l("agent.variants"):void 0,children:e?we(e.url)?t.jsx(et,{image:e},e.id):t.jsx(Q,{src:e.url,alt:e.prompt??l("agent.imageAlt"),fallbackClassName:"agent-stage__empty",iconSize:34}):t.jsxs("div",{className:"agent-stage__empty",children:[t.jsx(O,{size:34}),t.jsx("span",{children:l("agent.noImage")}),t.jsx("small",{children:l("agent.stageEmptyHint")})]})}),t.jsxs("div",{className:"agent-stage__caption",children:[t.jsx("strong",{children:e?.filename??"-"}),t.jsx("span",{children:e?.prompt??e?.revisedPrompt??""})]}),t.jsx("div",{className:"agent-stage__filmstrip","aria-label":l("agent.variants"),onKeyDown:i,children:n.map(g=>t.jsx(F,{ref:u=>{o.current[g.id]=u},image:g,selected:g.id===e?.id,onSelect:a},g.id))})]})}function Ke({layoutMode:e,session:n,currentImage:a,activeJobCount:s,onOpenSessions:r,onOpenImage:l,onOpenQueue:o}){const{t:d}=x(),c=E(g=>g.setUIMode),i=e==="mobile-chat-image-sheet";return t.jsxs("header",{className:"agent-topbar",children:[t.jsxs("button",{type:"button",className:"agent-topbar__back",onClick:()=>c("classic"),"aria-label":d("agent.topbarBackToStudio"),title:d("agent.topbarBackToStudio"),children:[t.jsx(zt,{size:18}),t.jsx("span",{children:d("agent.topbarStudio")})]}),t.jsx("button",{type:"button",className:"agent-topbar__icon",onClick:r,"aria-label":d("agent.openSessions"),title:d("agent.openSessions"),children:t.jsx(He,{size:18})}),t.jsxs("div",{className:"agent-topbar__title",children:[t.jsx("span",{children:d("agent.title")}),t.jsx("strong",{children:n?.title??d("agent.newSession")})]}),i?t.jsxs("div",{className:"agent-topbar__actions",children:[t.jsxs("button",{type:"button",className:"agent-topbar__queue",onClick:o,"aria-label":d("agent.topbarOpenQueue",{count:s}),title:d("agent.topbarOpenQueue",{count:s}),children:[t.jsx(Wt,{size:17}),t.jsx("span",{children:s})]}),t.jsx("button",{type:"button",className:"agent-topbar__image",onClick:l,"aria-label":d("agent.openImage"),title:d("agent.openImage"),children:a?t.jsx(Q,{src:a.thumbUrl??a.url,alt:"",iconSize:18}):t.jsx(O,{size:18})})]}):null]})}async function Pn({sessionId:e,files:n,importLocalImageToHistory:a,applyWorkspace:s}){for(const r of n){const l=await a(r),o=l?Ge(l):null;if(!o)continue;const d=await ce(e,{currentImage:o});s(d)}}const Ce="agent-local-",Dn=`${Ce}pending-`;let Qe=0;function ke(e){return Qe+=1,`${Ce}${e}-${Date.now()}-${Qe}`}function rt(e){return e.id.startsWith(Ce)}function ie(e){return e.id.startsWith(Dn)}function Bn(e,n){return{id:ke("user"),role:"user",text:e,imageIds:[],webFindingIds:[],status:"complete",createdAt:n}}function On(e,n){return{id:ke("pending"),role:"assistant",text:e,imageIds:[],webFindingIds:[],status:"streaming",createdAt:n}}function zn(e){return{id:ke("error"),role:"assistant",text:e,imageIds:[],webFindingIds:[],status:"error",createdAt:Date.now()}}function Wn({turns:e,queueItems:n,runSummary:a,localPendingCount:s}){const r=n.filter(d=>d.status==="failed").length,l=Kn(n),o=l?Qn(l):{};if(a?.status==="error"&&a.lastError)return{active:!0,status:"error",labelKey:"runError",queuedCount:a.queuedCount,runningCount:a.runningCount,failedCount:r,lastError:a.lastError};if(a?.status==="queued")return{active:!0,status:"queued",labelKey:"pendingQueued",queuedCount:a.queuedCount,runningCount:a.runningCount,failedCount:r,...o};if(a?.status==="running"){const d=l?.startedAt??l?.createdAt??null,c=e.some(i=>!rt(i)&&i.role==="tool"&&(!d||(i.createdAt??0)>=d));return{active:!0,status:c?"running":"planning",labelKey:c?"pendingGenerating":"pendingPlanning",queuedCount:a.queuedCount,runningCount:a.runningCount,failedCount:r,...o}}return s>0?{active:!0,status:"planning",labelKey:"pendingPlanning",queuedCount:a?.queuedCount??0,runningCount:a?.runningCount??0,failedCount:r}:null}function Kn(e){return[...e].filter(n=>n.status==="running"||n.status==="queued").sort((n,a)=>n.status!==a.status?n.status==="running"?-1:1:(n.startedAt??n.createdAt)-(a.startedAt??a.createdAt))[0]??null}function Qn(e){return{startedAt:e.startedAt??null,progressStage:e.progressStage??null,jobKind:e.plan.mode==="video"||e.plan.videoParams?"video":"image",variantCount:e.plan.plannedVariants||e.plan.prompts.length||1}}function Se(){return{sessions:[],turnsBySession:{},imagesById:{},imageIdsBySession:{},selectedSessionId:null,currentImageId:null,allowedTools:["ima2.get_image_context","ima2.web_search","ima2.generate_image","ima2.generate_video","ima2.get_generation_errors"],manifest:null,queueBySession:{},runSummaryBySession:{}}}function Fn(e){const n=e.filename.endsWith(".mp4");return{image:e.url,url:e.url,filename:e.filename,thumb:e.thumbUrl??void 0,prompt:e.prompt??void 0,revisedPrompt:e.revisedPrompt??null,createdAt:e.createdAt,mediaType:n?"video":"image",kind:"agent"}}function Gn(e,n,a){return{...e,turnsBySession:{...e.turnsBySession,[n]:[...e.turnsBySession[n]??[],...a]}}}function Un(e,n,a,s){const r=e.turnsBySession[n]??[];return{...e,turnsBySession:{...e.turnsBySession,[n]:[...r.filter(l=>l.id!==a),zn(s)]}}}function Hn(e,n,a){const s={...n.turnsBySession};for(const[r,l]of Object.entries(e.turnsBySession)){const o=s[r]??[],d=new Set(o.map(g=>g.id)),c=Math.max(0,...o.map(g=>g.createdAt??0)),i=l.filter(g=>a.has(g.id)||d.has(g.id)?!1:rt(g)||g.status==="streaming"?!0:(g.createdAt??0)>=c);i.length>0&&(s[r]=[...o,...i])}return{...n,turnsBySession:s}}function Yn(){const{t:e}=x(),n=$t(),a=E(h=>h.currentImage),s=E(h=>h.importLocalImageToHistory),r=E(h=>h.addHistoryItem),l=E(h=>h.selectHistory),o=E(h=>h.showToast),d=m.useRef(!1),c=m.useRef(0),i=m.useRef(0),g=m.useRef(null),[u,p]=m.useState(()=>Se()),[f,b]=m.useState(null),[v,w]=m.useState("image"),[q,G]=m.useState("image"),[U,T]=m.useState(null),[z,A]=m.useState(!1),[he,H]=m.useState(!1),[V,J]=m.useState(!1),[j,M]=m.useState(!1),[lt,R]=m.useState("reconnecting"),[me,pe]=m.useState(null),W=m.useCallback(h=>h instanceof Error?h.message:String(h),[]),ot=m.useCallback(()=>M(!1),[]),it=m.useCallback(()=>M(h=>!h),[]),L=m.useCallback(h=>{o(e("agent.workspaceActionFailed",{reason:W(h)}),!0)},[W,o,e]),X=m.useCallback(h=>{p({...Se(),...h}),b(h.selectedSessionId??null)},[]),ae=m.useCallback((h,y)=>{const S={...Se(),...h};p(_=>Hn(_,S,y)),b(h.selectedSessionId??null)},[]),$=m.useCallback(h=>{c.current+=1,X(h)},[X]),ct=m.useCallback((h,y)=>{c.current+=1,ae(h,y)},[ae]),ut=()=>{i.current+=1,R("generating")},dt=()=>{i.current=Math.max(0,i.current-1),i.current===0&&R("ready")},se=m.useCallback(async h=>{const y=++c.current;R("reconnecting"),pe(null);const S=await Re(h);if(y!==c.current)return;if(S.sessions.length>0){X(S),R("ready");return}const _=await $e({title:e("agent.newSession"),currentImage:a});y===c.current&&(X(_),R("ready"))},[X,a,e]),Ie=m.useCallback(async h=>{const y=++c.current,S=await Re(h);y===c.current&&(ae(S,new Set),R("ready"))},[ae]);m.useEffect(()=>{d.current||(d.current=!0,se().catch(h=>{pe(W(h)),R("reconnecting")}))},[W,se]);const Y=u.sessions.find(h=>h.id===f)??null,Z=u.currentImageId?u.imagesById[u.currentImageId]??null:null,re=f?(u.imageIdsBySession[f]??[]).map(h=>u.imagesById[h]).filter(h=>!!h):[],fe=Y?u.turnsBySession[Y.id]??[]:[],gt=fe.filter(ie).length,ht=fe.filter(h=>!ie(h)),K=f?u.queueBySession[f]??[]:[],k=f?u.runSummaryBySession[f]:void 0,mt=K.filter(h=>h.status==="queued"||h.status==="running").length,pt=Wn({turns:fe,queueItems:K,runSummary:k,localPendingCount:gt}),ee=Pe(Y?.generationSettings),ft=lt==="reconnecting"?"reconnecting":i.current>0||k?.status==="queued"||k?.status==="running"?"generating":"ready",xt=n!=="mobile-chat-image-sheet",xe=n==="desktop-three-pane"||n==="desktop-rail",Ae=n==="tablet-stacked"||n==="mobile-chat-image-sheet",bt=n==="desktop-three-pane"||n==="desktop-rail";m.useEffect(()=>{const h=Object.keys(u.imagesById);if(!g.current){(h.length>0||u.sessions.length>0)&&(g.current=new Set(h));return}const y=g.current,S=h.filter(N=>!y.has(N)).map(N=>u.imagesById[N]).filter(N=>!!N);if(S.length===0)return;for(const N of h)y.add(N);const _=S.map(Fn);for(const N of _)r(N);const P=_.reduce((N,I)=>(I.createdAt??0)>(N.createdAt??0)?I:N);l(P)},[u.imagesById,u.sessions.length,r,l]),m.useEffect(()=>{p(h=>{if(i.current>0)return h;let y=!1;const S={...h.turnsBySession};for(const[_,P]of Object.entries(S)){if(P.filter(ie).length===0)continue;const I=h.runSummaryBySession[_];I?.status==="queued"||I?.status==="running"||(S[_]=P.filter(je=>!ie(je)),y=!0)}return y?{...h,turnsBySession:S}:h})},[u.turnsBySession,u.runSummaryBySession]),m.useEffect(()=>{if(!f)return;const h=k?.status==="queued"||k?.status==="running",y=window.setInterval(()=>{Ie(f).catch(()=>R("reconnecting"))},h?1500:4e3);return()=>window.clearInterval(y)},[Ie,f,k?.queuedCount,k?.runningCount,k?.status]);const Te=h=>{A(!1),J(!1),se(h).catch(L)},Le=()=>{$e({title:e("agent.newSession"),currentImage:null}).then($).catch(L)},jt=h=>{const y=u.sessions.find(_=>_.id===h),S=window.prompt(e("agent.renameSession"),y?.title??"");S?.trim()&&ce(h,{title:S.trim()}).then($).catch(L)},yt=h=>{const y=u.sessions.find(S=>S.id===h);!y||!window.confirm(e("agent.deleteConfirm",{title:y.title}))||It(h).then($).catch(L)},le=h=>{if(!f)return;const y=Pe({...ee,...h});p(S=>({...S,sessions:S.sessions.map(_=>_.id===f?{..._,generationSettings:y,webSearchEnabled:y.webSearchEnabled}:_)})),ce(f,{generationSettings:h}).then($).catch(L)},vt=h=>{le({webSearchEnabled:h})},te=h=>{if(!f||u.currentImageId===h)return;const y=f;p(S=>({...S,currentImageId:h})),ce(y,{currentImageId:h}).then($).catch(L)},Me=h=>{T({id:Date.now(),text:h})},be=h=>{Tt(h).then($).catch(L)},oe=h=>{Lt(h).then($).catch(L)},Ee=k?.status==="error"?K.find(h=>h.status==="failed")?.id:void 0,St=Ee?()=>oe(Ee):void 0,_t=h=>{!f||h.length===0||Pn({sessionId:f,files:h,importLocalImageToHistory:s,applyWorkspace:$}).catch(L)},wt=h=>{if(!f)return;const y=f,S=Date.now(),_=Bn(h,S),P=On(e("agent.pending"),S+1),N=new Set([_.id]);ut(),p(I=>Gn(I,y,[_,P])),At(y,h,ee).then(I=>ct(I.workspace,N)).catch(I=>{const qe=W(I);p(je=>Un(je,y,P.id,qe)),L(I)}).finally(dt)};return me?t.jsxs("main",{className:`agent-workspace agent-workspace--${n} agent-workspace--boot-error`,"data-layout":n,"aria-label":e("agent.workspace"),children:[Ae?t.jsx(Ke,{layoutMode:n,session:null,currentImage:null,activeJobCount:0,onOpenSessions:()=>{},onOpenImage:()=>{},onOpenQueue:()=>{}}):null,t.jsxs("section",{className:"agent-workspace__boot-error",role:"alert",children:[t.jsx("strong",{children:e("agent.bootFailed")}),t.jsx("span",{title:me,children:me}),t.jsx("button",{type:"button",onClick:()=>{se().catch(h=>pe(W(h)))},children:e("agent.bootRetry")})]})]}):t.jsxs("main",{className:`agent-workspace agent-workspace--${n}${xe&&j?" agent-workspace--tools-docked":""}`,"data-layout":n,"aria-label":e("agent.workspace"),children:[bt?t.jsx("div",{className:"agent-session-rail-wrap",children:t.jsx(Rn,{sessions:u.sessions,selectedId:f??"",imagesById:u.imagesById,runSummaryBySession:u.runSummaryBySession,onCreate:Le,onSelect:Te,onOpenDrawer:()=>A(!0)})}):null,Ae?t.jsx(Ke,{layoutMode:n,session:Y,currentImage:Z,activeJobCount:mt,onOpenSessions:()=>A(!0),onOpenImage:()=>H(!0),onOpenQueue:()=>J(!0)}):null,t.jsxs("div",{className:"agent-workspace__body",children:[t.jsx(fn,{session:Y,turns:ht,imagesById:u.imagesById,currentImageId:u.currentImageId,runtimeStatus:ft,runProgress:pt,settings:ee,insertedPrompt:U,onSettingsChange:le,onOpenModelTab:()=>{G("model"),M(!0)},onWebSearchChange:vt,onAttachFiles:_t,onImageSelect:te,onSend:wt,onRetryRun:St}),xe?t.jsx($n,{currentImage:Z,images:re,onImageSelect:te,onOpenPanel:it,toolsPanelOpen:j}):xt?t.jsx(We,{currentImage:Z,images:re,contextTab:v,sidebarTab:q,queueItems:K,runSummary:k,settings:ee,onContextTabChange:w,onSidebarTabChange:G,onImageSelect:te,onSettingsChange:le,onInsertPrompt:Me,onCancelQueue:be,onRetryQueue:oe}):null,xe&&j?t.jsx(We,{overlay:!0,onClose:ot,currentImage:Z,images:re,contextTab:v,sidebarTab:q,queueItems:K,runSummary:k,settings:ee,onContextTabChange:w,onSidebarTabChange:G,onImageSelect:te,onSettingsChange:le,onInsertPrompt:Me,onCancelQueue:be,onRetryQueue:oe}):null]}),t.jsx(qn,{open:z,sessions:u.sessions,selectedId:f??"",imagesById:u.imagesById,runSummaryBySession:u.runSummaryBySession,onClose:()=>A(!1),onCreate:Le,onSelect:Te,onRename:jt,onDelete:yt}),t.jsx(vn,{open:he,currentImage:Z,images:re,activeTab:v,onTabChange:w,onImageSelect:te,onClose:()=>H(!1)}),t.jsx(kn,{open:V,items:K,summary:k,onCancel:be,onRetry:oe,onClose:()=>J(!1)})]})}export{Yn as AgentWorkspace};