@ipul-labs/forge 1.22.0 → 1.35.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 (294) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +153 -78
  3. package/dist/apple-touch-icon.png +0 -0
  4. package/dist/assets/index-BmEuPeOG.js +27 -0
  5. package/dist/assets/index-CSH1OQYQ.css +1 -0
  6. package/dist/boot-check.js +98 -0
  7. package/dist/favicon.svg +8 -0
  8. package/dist/icon-192.png +0 -0
  9. package/dist/icon-512.png +0 -0
  10. package/dist/icon.svg +12 -0
  11. package/dist/index.html +33 -0
  12. package/dist/manifest.webmanifest +18 -0
  13. package/dist/theme-init.js +11 -0
  14. package/lib/bin/cli/analyze.d.ts.map +1 -1
  15. package/lib/bin/cli/analyze.js +3 -44
  16. package/lib/bin/cli/analyze.js.map +1 -1
  17. package/lib/bin/cli/apply.d.ts.map +1 -1
  18. package/lib/bin/cli/apply.js +2 -20
  19. package/lib/bin/cli/apply.js.map +1 -1
  20. package/lib/bin/cli/cifix.d.ts.map +1 -1
  21. package/lib/bin/cli/cifix.js +4 -28
  22. package/lib/bin/cli/cifix.js.map +1 -1
  23. package/lib/bin/cli/close.d.ts.map +1 -1
  24. package/lib/bin/cli/close.js +2 -33
  25. package/lib/bin/cli/close.js.map +1 -1
  26. package/lib/bin/cli/createIssue.d.ts.map +1 -1
  27. package/lib/bin/cli/createIssue.js +3 -12
  28. package/lib/bin/cli/createIssue.js.map +1 -1
  29. package/lib/bin/cli/doctor.d.ts.map +1 -1
  30. package/lib/bin/cli/doctor.js +3 -4
  31. package/lib/bin/cli/doctor.js.map +1 -1
  32. package/lib/bin/cli/init.js +1 -10
  33. package/lib/bin/cli/init.js.map +1 -1
  34. package/lib/bin/cli/issue.d.ts.map +1 -1
  35. package/lib/bin/cli/issue.js +3 -12
  36. package/lib/bin/cli/issue.js.map +1 -1
  37. package/lib/bin/cli/issues.d.ts.map +1 -1
  38. package/lib/bin/cli/issues.js +3 -12
  39. package/lib/bin/cli/issues.js.map +1 -1
  40. package/lib/bin/cli/merge.d.ts.map +1 -1
  41. package/lib/bin/cli/merge.js +4 -20
  42. package/lib/bin/cli/merge.js.map +1 -1
  43. package/lib/bin/cli/refine.d.ts.map +1 -1
  44. package/lib/bin/cli/refine.js +2 -26
  45. package/lib/bin/cli/refine.js.map +1 -1
  46. package/lib/bin/cli/repl.d.ts.map +1 -1
  47. package/lib/bin/cli/repl.js +4 -13
  48. package/lib/bin/cli/repl.js.map +1 -1
  49. package/lib/bin/cli/repos.d.ts.map +1 -1
  50. package/lib/bin/cli/repos.js +1 -11
  51. package/lib/bin/cli/repos.js.map +1 -1
  52. package/lib/bin/cli/resetPassword.d.ts +21 -0
  53. package/lib/bin/cli/resetPassword.d.ts.map +1 -0
  54. package/lib/bin/cli/resetPassword.js +69 -0
  55. package/lib/bin/cli/resetPassword.js.map +1 -0
  56. package/lib/bin/cli/resolution.d.ts.map +1 -1
  57. package/lib/bin/cli/resolution.js +2 -19
  58. package/lib/bin/cli/resolution.js.map +1 -1
  59. package/lib/bin/cli/serverClient.d.ts +2 -0
  60. package/lib/bin/cli/serverClient.d.ts.map +1 -1
  61. package/lib/bin/cli/serverClient.js +8 -4
  62. package/lib/bin/cli/serverClient.js.map +1 -1
  63. package/lib/bin/cli/session.d.ts.map +1 -1
  64. package/lib/bin/cli/session.js.map +1 -1
  65. package/lib/bin/cli/sessionStore.d.ts +1 -1
  66. package/lib/bin/cli/sessionStore.js +2 -2
  67. package/lib/bin/cli/sessionStore.js.map +1 -1
  68. package/lib/bin/cli/ship.d.ts.map +1 -1
  69. package/lib/bin/cli/ship.js +15 -23
  70. package/lib/bin/cli/ship.js.map +1 -1
  71. package/lib/bin/cli/update.d.ts.map +1 -1
  72. package/lib/bin/cli/update.js +34 -28
  73. package/lib/bin/cli/update.js.map +1 -1
  74. package/lib/bin/cli/updatePlan.d.ts +30 -0
  75. package/lib/bin/cli/updatePlan.d.ts.map +1 -0
  76. package/lib/bin/cli/updatePlan.js +50 -0
  77. package/lib/bin/cli/updatePlan.js.map +1 -0
  78. package/lib/bin/cli/utils.d.ts +3 -0
  79. package/lib/bin/cli/utils.d.ts.map +1 -1
  80. package/lib/bin/cli/utils.js +7 -23
  81. package/lib/bin/cli/utils.js.map +1 -1
  82. package/lib/bin/cli/validate.d.ts.map +1 -1
  83. package/lib/bin/cli/validate.js +3 -25
  84. package/lib/bin/cli/validate.js.map +1 -1
  85. package/lib/bin/cli/watch.d.ts.map +1 -1
  86. package/lib/bin/cli/watch.js +3 -12
  87. package/lib/bin/cli/watch.js.map +1 -1
  88. package/lib/bin/forge-agent.js +10 -22
  89. package/lib/bin/forge-agent.js.map +1 -1
  90. package/lib/server/app.d.ts +24 -0
  91. package/lib/server/app.d.ts.map +1 -0
  92. package/lib/server/app.js +58 -0
  93. package/lib/server/app.js.map +1 -0
  94. package/lib/server/forge/analyses/analysisStore.d.ts +53 -0
  95. package/lib/server/forge/analyses/analysisStore.d.ts.map +1 -0
  96. package/lib/server/forge/analyses/analysisStore.js +77 -0
  97. package/lib/server/forge/analyses/analysisStore.js.map +1 -0
  98. package/lib/server/forge/auth/apiTokens.d.ts +34 -0
  99. package/lib/server/forge/auth/apiTokens.d.ts.map +1 -0
  100. package/lib/server/forge/auth/apiTokens.js +44 -0
  101. package/lib/server/forge/auth/apiTokens.js.map +1 -0
  102. package/lib/server/forge/auth/auditLog.d.ts +36 -0
  103. package/lib/server/forge/auth/auditLog.d.ts.map +1 -0
  104. package/lib/server/forge/auth/auditLog.js +56 -0
  105. package/lib/server/forge/auth/auditLog.js.map +1 -0
  106. package/lib/server/forge/auth/authConfig.d.ts +13 -0
  107. package/lib/server/forge/auth/authConfig.d.ts.map +1 -0
  108. package/lib/server/forge/auth/authConfig.js +37 -0
  109. package/lib/server/forge/auth/authConfig.js.map +1 -0
  110. package/lib/server/forge/auth/createAuth.d.ts +130 -0
  111. package/lib/server/forge/auth/createAuth.d.ts.map +1 -0
  112. package/lib/server/forge/auth/createAuth.js +387 -0
  113. package/lib/server/forge/auth/createAuth.js.map +1 -0
  114. package/lib/server/forge/auth/middleware.d.ts +10 -0
  115. package/lib/server/forge/auth/middleware.d.ts.map +1 -0
  116. package/lib/server/forge/auth/middleware.js +22 -0
  117. package/lib/server/forge/auth/middleware.js.map +1 -0
  118. package/lib/server/forge/auth/oidc.d.ts +38 -0
  119. package/lib/server/forge/auth/oidc.d.ts.map +1 -0
  120. package/lib/server/forge/auth/oidc.js +63 -0
  121. package/lib/server/forge/auth/oidc.js.map +1 -0
  122. package/lib/server/forge/auth/passwords.d.ts +7 -0
  123. package/lib/server/forge/auth/passwords.d.ts.map +1 -0
  124. package/lib/server/forge/auth/passwords.js +28 -0
  125. package/lib/server/forge/auth/passwords.js.map +1 -0
  126. package/lib/server/forge/auth/resetPassword.d.ts +14 -0
  127. package/lib/server/forge/auth/resetPassword.d.ts.map +1 -0
  128. package/lib/server/forge/auth/resetPassword.js +29 -0
  129. package/lib/server/forge/auth/resetPassword.js.map +1 -0
  130. package/lib/server/forge/auth/roles.d.ts +7 -0
  131. package/lib/server/forge/auth/roles.d.ts.map +1 -0
  132. package/lib/server/forge/auth/roles.js +15 -0
  133. package/lib/server/forge/auth/roles.js.map +1 -0
  134. package/lib/server/forge/auth/sessions.d.ts +27 -0
  135. package/lib/server/forge/auth/sessions.d.ts.map +1 -0
  136. package/lib/server/forge/auth/sessions.js +37 -0
  137. package/lib/server/forge/auth/sessions.js.map +1 -0
  138. package/lib/server/forge/auth/testHarness.d.ts +104 -0
  139. package/lib/server/forge/auth/testHarness.d.ts.map +1 -0
  140. package/lib/server/forge/auth/testHarness.js +53 -0
  141. package/lib/server/forge/auth/testHarness.js.map +1 -0
  142. package/lib/server/forge/auth/tokenHash.d.ts +3 -0
  143. package/lib/server/forge/auth/tokenHash.d.ts.map +1 -0
  144. package/lib/server/forge/auth/tokenHash.js +4 -0
  145. package/lib/server/forge/auth/tokenHash.js.map +1 -0
  146. package/lib/server/forge/auth/users.d.ts +51 -0
  147. package/lib/server/forge/auth/users.d.ts.map +1 -0
  148. package/lib/server/forge/auth/users.js +118 -0
  149. package/lib/server/forge/auth/users.js.map +1 -0
  150. package/lib/server/forge/core/ForgeAgent.d.ts +43 -1
  151. package/lib/server/forge/core/ForgeAgent.d.ts.map +1 -1
  152. package/lib/server/forge/core/ForgeAgent.js +209 -61
  153. package/lib/server/forge/core/ForgeAgent.js.map +1 -1
  154. package/lib/server/forge/core/agentClient.d.ts +7 -23
  155. package/lib/server/forge/core/agentClient.d.ts.map +1 -1
  156. package/lib/server/forge/core/agentClient.js +10 -25
  157. package/lib/server/forge/core/agentClient.js.map +1 -1
  158. package/lib/server/forge/core/claudeClient.d.ts +24 -1
  159. package/lib/server/forge/core/claudeClient.d.ts.map +1 -1
  160. package/lib/server/forge/core/claudeClient.js +25 -7
  161. package/lib/server/forge/core/claudeClient.js.map +1 -1
  162. package/lib/server/forge/core/configStore.d.ts +11 -1
  163. package/lib/server/forge/core/configStore.d.ts.map +1 -1
  164. package/lib/server/forge/core/configStore.js +33 -2
  165. package/lib/server/forge/core/configStore.js.map +1 -1
  166. package/lib/server/forge/core/dependencyPaths.d.ts +19 -0
  167. package/lib/server/forge/core/dependencyPaths.d.ts.map +1 -0
  168. package/lib/server/forge/core/dependencyPaths.js +32 -0
  169. package/lib/server/forge/core/dependencyPaths.js.map +1 -0
  170. package/lib/server/forge/core/evidence.d.ts +43 -0
  171. package/lib/server/forge/core/evidence.d.ts.map +1 -0
  172. package/lib/server/forge/core/evidence.js +108 -0
  173. package/lib/server/forge/core/evidence.js.map +1 -0
  174. package/lib/server/forge/core/jobs.d.ts +2 -0
  175. package/lib/server/forge/core/jobs.d.ts.map +1 -1
  176. package/lib/server/forge/core/jobs.js +8 -0
  177. package/lib/server/forge/core/jobs.js.map +1 -1
  178. package/lib/server/forge/core/localRepo.d.ts +31 -10
  179. package/lib/server/forge/core/localRepo.d.ts.map +1 -1
  180. package/lib/server/forge/core/localRepo.js +48 -82
  181. package/lib/server/forge/core/localRepo.js.map +1 -1
  182. package/lib/server/forge/core/prompts.d.ts +3 -1
  183. package/lib/server/forge/core/prompts.d.ts.map +1 -1
  184. package/lib/server/forge/core/prompts.js +14 -5
  185. package/lib/server/forge/core/prompts.js.map +1 -1
  186. package/lib/server/forge/core/providers/azuredevops.d.ts +4 -2
  187. package/lib/server/forge/core/providers/azuredevops.d.ts.map +1 -1
  188. package/lib/server/forge/core/providers/azuredevops.js +12 -2
  189. package/lib/server/forge/core/providers/azuredevops.js.map +1 -1
  190. package/lib/server/forge/core/providers/base.d.ts +29 -4
  191. package/lib/server/forge/core/providers/base.d.ts.map +1 -1
  192. package/lib/server/forge/core/providers/base.js +21 -3
  193. package/lib/server/forge/core/providers/base.js.map +1 -1
  194. package/lib/server/forge/core/providers/github.d.ts +7 -7
  195. package/lib/server/forge/core/providers/github.d.ts.map +1 -1
  196. package/lib/server/forge/core/providers/github.js +13 -4
  197. package/lib/server/forge/core/providers/github.js.map +1 -1
  198. package/lib/server/forge/core/providers/gitlab.d.ts +20 -3
  199. package/lib/server/forge/core/providers/gitlab.d.ts.map +1 -1
  200. package/lib/server/forge/core/providers/gitlab.js +65 -5
  201. package/lib/server/forge/core/providers/gitlab.js.map +1 -1
  202. package/lib/server/forge/core/providers/types.d.ts +20 -0
  203. package/lib/server/forge/core/providers/types.d.ts.map +1 -1
  204. package/lib/server/forge/core/secretBox.d.ts +17 -0
  205. package/lib/server/forge/core/secretBox.d.ts.map +1 -0
  206. package/lib/server/forge/core/secretBox.js +74 -0
  207. package/lib/server/forge/core/secretBox.js.map +1 -0
  208. package/lib/server/forge/core/types.d.ts +7 -1
  209. package/lib/server/forge/core/types.d.ts.map +1 -1
  210. package/lib/server/forge/core/validator/clone.d.ts +5 -4
  211. package/lib/server/forge/core/validator/clone.d.ts.map +1 -1
  212. package/lib/server/forge/core/validator/clone.js +6 -86
  213. package/lib/server/forge/core/validator/clone.js.map +1 -1
  214. package/lib/server/forge/core/validator/cmd.d.ts.map +1 -1
  215. package/lib/server/forge/core/validator/cmd.js +4 -1
  216. package/lib/server/forge/core/validator/cmd.js.map +1 -1
  217. package/lib/server/forge/core/validator/projectType.d.ts.map +1 -1
  218. package/lib/server/forge/core/validator/projectType.js +2 -1
  219. package/lib/server/forge/core/validator/projectType.js.map +1 -1
  220. package/lib/server/forge/core/validator/runners/node.d.ts.map +1 -1
  221. package/lib/server/forge/core/validator/runners/node.js +6 -2
  222. package/lib/server/forge/core/validator/runners/node.js.map +1 -1
  223. package/lib/server/forge/core/validator.d.ts.map +1 -1
  224. package/lib/server/forge/core/validator.js +28 -22
  225. package/lib/server/forge/core/validator.js.map +1 -1
  226. package/lib/server/forge/core/workspaces.d.ts +70 -0
  227. package/lib/server/forge/core/workspaces.d.ts.map +1 -0
  228. package/lib/server/forge/core/workspaces.js +348 -0
  229. package/lib/server/forge/core/workspaces.js.map +1 -0
  230. package/lib/server/forge/db/database.d.ts +22 -0
  231. package/lib/server/forge/db/database.d.ts.map +1 -0
  232. package/lib/server/forge/db/database.js +71 -0
  233. package/lib/server/forge/db/database.js.map +1 -0
  234. package/lib/server/forge/db/migrations.d.ts +11 -0
  235. package/lib/server/forge/db/migrations.d.ts.map +1 -0
  236. package/lib/server/forge/db/migrations.js +87 -0
  237. package/lib/server/forge/db/migrations.js.map +1 -0
  238. package/lib/server/forge/routes.d.ts.map +1 -1
  239. package/lib/server/forge/routes.js +413 -163
  240. package/lib/server/forge/routes.js.map +1 -1
  241. package/lib/server/forge/sse.d.ts +10 -0
  242. package/lib/server/forge/sse.d.ts.map +1 -0
  243. package/lib/server/forge/sse.js +22 -0
  244. package/lib/server/forge/sse.js.map +1 -0
  245. package/lib/server/spa.d.ts +12 -0
  246. package/lib/server/spa.d.ts.map +1 -0
  247. package/lib/server/spa.js +23 -0
  248. package/lib/server/spa.js.map +1 -0
  249. package/lib/server.js +9 -24
  250. package/lib/server.js.map +1 -1
  251. package/lib/shared/events.d.ts +3 -0
  252. package/lib/shared/events.d.ts.map +1 -1
  253. package/lib/shared/events.js +3 -0
  254. package/lib/shared/events.js.map +1 -1
  255. package/lib/shared/packageRoot.d.ts +11 -0
  256. package/lib/shared/packageRoot.d.ts.map +1 -0
  257. package/lib/shared/packageRoot.js +23 -0
  258. package/lib/shared/packageRoot.js.map +1 -0
  259. package/lib/shared/project.d.ts +3 -0
  260. package/lib/shared/project.d.ts.map +1 -0
  261. package/lib/shared/project.js +3 -0
  262. package/lib/shared/project.js.map +1 -0
  263. package/package.json +24 -9
  264. package/lib/bin/cli/improve.d.ts +0 -2
  265. package/lib/bin/cli/improve.d.ts.map +0 -1
  266. package/lib/bin/cli/improve.js +0 -189
  267. package/lib/bin/cli/improve.js.map +0 -1
  268. package/lib/bin/cli/stats.d.ts +0 -2
  269. package/lib/bin/cli/stats.d.ts.map +0 -1
  270. package/lib/bin/cli/stats.js +0 -78
  271. package/lib/bin/cli/stats.js.map +0 -1
  272. package/lib/server/forge/core/k8s.d.ts +0 -18
  273. package/lib/server/forge/core/k8s.d.ts.map +0 -1
  274. package/lib/server/forge/core/k8s.js +0 -49
  275. package/lib/server/forge/core/k8s.js.map +0 -1
  276. package/lib/server/forge/core/openclawClient.d.ts +0 -61
  277. package/lib/server/forge/core/openclawClient.d.ts.map +0 -1
  278. package/lib/server/forge/core/openclawClient.js +0 -111
  279. package/lib/server/forge/core/openclawClient.js.map +0 -1
  280. package/lib/server/forge/core/quotaClient.d.ts +0 -48
  281. package/lib/server/forge/core/quotaClient.d.ts.map +0 -1
  282. package/lib/server/forge/core/quotaClient.js +0 -88
  283. package/lib/server/forge/core/quotaClient.js.map +0 -1
  284. package/lib/server/forge/core/selfImprove.d.ts +0 -43
  285. package/lib/server/forge/core/selfImprove.d.ts.map +0 -1
  286. package/lib/server/forge/core/selfImprove.js +0 -372
  287. package/lib/server/forge/core/selfImprove.js.map +0 -1
  288. package/lib/server/forge/core/telemetry.d.ts +0 -100
  289. package/lib/server/forge/core/telemetry.d.ts.map +0 -1
  290. package/lib/server/forge/core/telemetry.js +0 -273
  291. package/lib/server/forge/core/telemetry.js.map +0 -1
  292. package/scripts/fix-shebang.cjs +0 -11
  293. package/scripts/inject-readme.cjs +0 -23
  294. package/scripts/local-rollout.sh +0 -134
@@ -0,0 +1,27 @@
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function ee(e,t){return E(e.type,t,e.props)}function D(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function O(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var k=/\/+/g;function A(e,t){return typeof e==`object`&&e&&e.key!=null?O(``+e.key):t.toString(36)}function te(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function ne(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,ne(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+A(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(k,`$&/`)+`/`),ne(o,r,i,``,function(e){return e})):o!=null&&(D(o)&&(o=ee(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(k,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+A(a,u),c+=ne(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+A(a,u++),c+=ne(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return ne(te(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function re(e,t,n){if(e==null)return e;var r=[],i=0;return ne(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ie(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var j=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},M={map:re,forEach:function(e,t,n){re(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return re(e,function(){t++}),t},toArray:function(e){return re(e,function(e){return e})||[]},only:function(e){if(!D(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=M,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=D,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:ie}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,j)}catch(e){j(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.6`})),u=o(((e,t)=>{t.exports=l()})),d=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,D());else{var t=n(l);t!==null&&A(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function ee(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&A(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?D():S=!1}}}var D;if(typeof y==`function`)D=function(){y(ee)};else if(typeof MessageChannel<`u`){var O=new MessageChannel,k=O.port2;O.port1.onmessage=ee,D=function(){k.postMessage(null)}}else D=function(){_(ee,0)};function A(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,A(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,D()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),f=o(((e,t)=>{t.exports=d()})),p=o((e=>{var t=u();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.6`})),m=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=p()})),h=o((e=>{var t=f(),n=u(),r=m();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function d(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}var h=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),ee=Symbol.for(`react.memo`),D=Symbol.for(`react.lazy`),O=Symbol.for(`react.activity`),k=Symbol.for(`react.memo_cache_sentinel`),A=Symbol.iterator;function te(e){return typeof e!=`object`||!e?null:(e=A&&e[A]||e[`@@iterator`],typeof e==`function`?e:null)}var ne=Symbol.for(`react.client.reference`);function re(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ne?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case O:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ee:return t=e.displayName||null,t===null?re(e.type)||`Memo`:t;case D:t=e._payload,e=e._init;try{return re(e(t))}catch{}}return null}var ie=Array.isArray,j=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,M=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae={pending:!1,data:null,method:null,action:null},oe=[],se=-1;function ce(e){return{current:e}}function le(e){0>se||(e.current=oe[se],oe[se]=null,se--)}function N(e,t){se++,oe[se]=e.current,e.current=t}var ue=ce(null),de=ce(null),fe=ce(null),pe=ce(null);function me(e,t){switch(N(fe,t),N(de,e),N(ue,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}le(ue),N(ue,e)}function he(){le(ue),le(de),le(fe)}function ge(e){e.memoizedState!==null&&N(pe,e);var t=ue.current,n=Hd(t,e.type);t!==n&&(N(de,e),N(ue,n))}function _e(e){de.current===e&&(le(ue),le(de)),pe.current===e&&(le(pe),Qf._currentValue=ae)}var ve,ye;function be(e){if(ve===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ve=t&&t[1]||``,ye=-1<e.stack.indexOf(`
2
+ at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
3
+ `+ve+e+ye}var xe=!1;function Se(e,t){if(!e||xe)return``;xe=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,`name`,{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
4
+ `),l=s.split(`
5
+ `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
6
+ `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{xe=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?be(n):``}function Ce(e,t){switch(e.tag){case 26:case 27:case 5:return be(e.type);case 16:return be(`Lazy`);case 13:return e.child!==t&&t!==null?be(`Suspense Fallback`):be(`Suspense`);case 19:return be(`SuspenseList`);case 0:case 15:return Se(e.type,!1);case 11:return Se(e.type.render,!1);case 1:return Se(e.type,!0);case 31:return be(`Activity`);default:return``}}function we(e){try{var t=``,n=null;do t+=Ce(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
7
+ Error generating stack: `+e.message+`
8
+ `+e.stack}}var Te=Object.prototype.hasOwnProperty,Ee=t.unstable_scheduleCallback,De=t.unstable_cancelCallback,Oe=t.unstable_shouldYield,ke=t.unstable_requestPaint,Ae=t.unstable_now,je=t.unstable_getCurrentPriorityLevel,Me=t.unstable_ImmediatePriority,Ne=t.unstable_UserBlockingPriority,Pe=t.unstable_NormalPriority,Fe=t.unstable_LowPriority,Ie=t.unstable_IdlePriority,Le=t.log,Re=t.unstable_setDisableYieldValue,ze=null,Be=null;function Ve(e){if(typeof Le==`function`&&Re(e),Be&&typeof Be.setStrictMode==`function`)try{Be.setStrictMode(ze,e)}catch{}}var He=Math.clz32?Math.clz32:Ge,Ue=Math.log,We=Math.LN2;function Ge(e){return e>>>=0,e===0?32:31-(Ue(e)/We|0)|0}var Ke=256,qe=262144,Je=4194304;function Ye(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Xe(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Ye(n))):i=Ye(o):i=Ye(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ye(n))):i=Ye(o)):i=Ye(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Ze(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Qe(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function $e(){var e=Je;return Je<<=1,!(Je&62914560)&&(Je=4194304),e}function et(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function tt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function nt(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-He(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&rt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function rt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-He(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function it(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-He(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function at(e,t){var n=t&-t;return n=n&42?1:ot(n),(n&(e.suspendedLanes|t))===0?n:0}function ot(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function st(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function ct(){var e=M.p;return e===0?(e=window.event,e===void 0?32:mp(e.type)):e}function P(e,t){var n=M.p;try{return M.p=e,t()}finally{M.p=n}}var lt=Math.random().toString(36).slice(2),ut=`__reactFiber$`+lt,dt=`__reactProps$`+lt,ft=`__reactContainer$`+lt,pt=`__reactEvents$`+lt,mt=`__reactListeners$`+lt,ht=`__reactHandles$`+lt,gt=`__reactResources$`+lt,_t=`__reactMarker$`+lt;function vt(e){delete e[ut],delete e[dt],delete e[pt],delete e[mt],delete e[ht]}function yt(e){var t=e[ut];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ft]||n[ut]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=df(e);e!==null;){if(n=e[ut])return n;e=df(e)}return t}e=n,n=e.parentNode}return null}function bt(e){if(e=e[ut]||e[ft]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function xt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function St(e){var t=e[gt];return t||=e[gt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Ct(e){e[_t]=!0}var wt=new Set,Tt={};function Et(e,t){Dt(e,t),Dt(e+`Capture`,t)}function Dt(e,t){for(Tt[e]=t,e=0;e<t.length;e++)wt.add(t[e])}var Ot=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),kt={},At={};function F(e){return Te.call(At,e)?!0:Te.call(kt,e)?!1:Ot.test(e)?At[e]=!0:(kt[e]=!0,!1)}function jt(e,t,n){if(F(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function Mt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function Nt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Pt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Ft(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function It(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Lt(e){if(!e._valueTracker){var t=Ft(e)?`checked`:`value`;e._valueTracker=It(e,t,``+e[t])}}function Rt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Ft(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function zt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Bt=/[\n"\\]/g;function Vt(e){return e.replace(Bt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Ht(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Pt(t)):e.value!==``+Pt(t)&&(e.value=``+Pt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Wt(e,o,Pt(n)):Wt(e,o,Pt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Pt(s):e.removeAttribute(`name`)}function Ut(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Lt(e);return}n=n==null?``:``+Pt(n),t=t==null?n:``+Pt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Lt(e)}function Wt(e,t,n){t===`number`&&zt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Gt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Pt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Kt(e,t,n){if(t!=null&&(t=``+Pt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Pt(n)}function qt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ie(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Pt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Lt(e)}function Jt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Yt=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function Xt(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Yt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Zt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Xt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Xt(e,o,t[o])}function Qt(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var $t=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),en=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function tn(e){return en.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function nn(){}var rn=null;function an(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var on=null,sn=null;function cn(e){var t=bt(e);if(t&&(e=t.stateNode)){var n=e[dt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Ht(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Vt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[dt]||null;if(!a)throw Error(i(90));Ht(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Rt(r)}break a;case`textarea`:Kt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Gt(e,!!n.multiple,t,!1)}}}var ln=!1;function un(e,t,n){if(ln)return e(t,n);ln=!0;try{return e(t)}finally{if(ln=!1,(on!==null||sn!==null)&&(bu(),on&&(t=on,e=sn,sn=on=null,cn(t),e)))for(t=0;t<e.length;t++)cn(e[t])}}function dn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[dt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var I=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),fn=!1;if(I)try{var pn={};Object.defineProperty(pn,`passive`,{get:function(){fn=!0}}),window.addEventListener(`test`,pn,pn),window.removeEventListener(`test`,pn,pn)}catch{fn=!1}var mn=null,hn=null,gn=null;function _n(){if(gn)return gn;var e,t=hn,n=t.length,r,i=`value`in mn?mn.value:mn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return gn=i.slice(e,1<r?1-r:void 0)}function vn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function yn(){return!0}function bn(){return!1}function xn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?yn:bn,this.isPropagationStopped=bn,this}return h(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=yn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=yn)},persist:function(){},isPersistent:yn}),t}var Sn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Cn=xn(Sn),wn=h({},Sn,{view:0,detail:0}),Tn=xn(wn),En,Dn,On,kn=h({},wn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:L,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==On&&(On&&e.type===`mousemove`?(En=e.screenX-On.screenX,Dn=e.screenY-On.screenY):Dn=En=0,On=e),En)},movementY:function(e){return`movementY`in e?e.movementY:Dn}}),An=xn(kn),jn=xn(h({},kn,{dataTransfer:0})),Mn=xn(h({},wn,{relatedTarget:0})),Nn=xn(h({},Sn,{animationName:0,elapsedTime:0,pseudoElement:0})),Pn=xn(h({},Sn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Fn=xn(h({},Sn,{data:0})),In={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Ln={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},Rn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function zn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Rn[e])?!!t[e]:!1}function L(){return zn}var Bn=xn(h({},wn,{key:function(e){if(e.key){var t=In[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=vn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Ln[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:L,charCode:function(e){return e.type===`keypress`?vn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?vn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Vn=xn(h({},kn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Hn=xn(h({},wn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:L})),R=xn(h({},Sn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Un=xn(h({},kn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Wn=xn(h({},Sn,{newState:0,oldState:0})),Gn=[9,13,27,32],Kn=I&&`CompositionEvent`in window,qn=null;I&&`documentMode`in document&&(qn=document.documentMode);var z=I&&`TextEvent`in window&&!qn,Jn=I&&(!Kn||qn&&8<qn&&11>=qn),B=` `,Yn=!1;function Xn(e,t){switch(e){case`keyup`:return Gn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Zn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Qn=!1;function $n(e,t){switch(e){case`compositionend`:return Zn(t);case`keypress`:return t.which===32?(Yn=!0,B):null;case`textInput`:return e=t.data,e===B&&Yn?null:e;default:return null}}function er(e,t){if(Qn)return e===`compositionend`||!Kn&&Xn(e,t)?(e=_n(),gn=hn=mn=null,Qn=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Jn&&t.locale!==`ko`?null:t.data;default:return null}}var tr={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function nr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!tr[e.type]:t===`textarea`}function rr(e,t,n,r){on?sn?sn.push(r):sn=[r]:on=r,t=Ed(t,`onChange`),0<t.length&&(n=new Cn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var ir=null,ar=null;function or(e){yd(e,0)}function sr(e){if(Rt(xt(e)))return e}function cr(e,t){if(e===`change`)return t}var lr=!1;if(I){var ur;if(I){var dr=`oninput`in document;if(!dr){var fr=document.createElement(`div`);fr.setAttribute(`oninput`,`return;`),dr=typeof fr.oninput==`function`}ur=dr}else ur=!1;lr=ur&&(!document.documentMode||9<document.documentMode)}function pr(){ir&&(ir.detachEvent(`onpropertychange`,mr),ar=ir=null)}function mr(e){if(e.propertyName===`value`&&sr(ar)){var t=[];rr(t,ar,e,an(e)),un(or,t)}}function hr(e,t,n){e===`focusin`?(pr(),ir=t,ar=n,ir.attachEvent(`onpropertychange`,mr)):e===`focusout`&&pr()}function gr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return sr(ar)}function _r(e,t){if(e===`click`)return sr(t)}function vr(e,t){if(e===`input`||e===`change`)return sr(t)}function yr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var br=typeof Object.is==`function`?Object.is:yr;function xr(e,t){if(br(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Te.call(t,i)||!br(e[i],t[i]))return!1}return!0}function Sr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Cr(e,t){var n=Sr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Sr(n)}}function wr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?wr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Tr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=zt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=zt(e.document)}return t}function Er(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Dr=I&&`documentMode`in document&&11>=document.documentMode,Or=null,kr=null,Ar=null,jr=!1;function Mr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;jr||Or==null||Or!==zt(r)||(r=Or,`selectionStart`in r&&Er(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Ar&&xr(Ar,r)||(Ar=r,r=Ed(kr,`onSelect`),0<r.length&&(t=new Cn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Or)))}function Nr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Pr={animationend:Nr(`Animation`,`AnimationEnd`),animationiteration:Nr(`Animation`,`AnimationIteration`),animationstart:Nr(`Animation`,`AnimationStart`),transitionrun:Nr(`Transition`,`TransitionRun`),transitionstart:Nr(`Transition`,`TransitionStart`),transitioncancel:Nr(`Transition`,`TransitionCancel`),transitionend:Nr(`Transition`,`TransitionEnd`)},Fr={},Ir={};I&&(Ir=document.createElement(`div`).style,`AnimationEvent`in window||(delete Pr.animationend.animation,delete Pr.animationiteration.animation,delete Pr.animationstart.animation),`TransitionEvent`in window||delete Pr.transitionend.transition);function Lr(e){if(Fr[e])return Fr[e];if(!Pr[e])return e;var t=Pr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Ir)return Fr[e]=t[n];return e}var Rr=Lr(`animationend`),zr=Lr(`animationiteration`),Br=Lr(`animationstart`),Vr=Lr(`transitionrun`),Hr=Lr(`transitionstart`),Ur=Lr(`transitioncancel`),Wr=Lr(`transitionend`),Gr=new Map,Kr=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);Kr.push(`scrollEnd`);function qr(e,t){Gr.set(e,t),Et(t,[e])}var Jr=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Yr=[],Xr=0,Zr=0;function Qr(){for(var e=Xr,t=Zr=Xr=0;t<e;){var n=Yr[t];Yr[t++]=null;var r=Yr[t];Yr[t++]=null;var i=Yr[t];Yr[t++]=null;var a=Yr[t];if(Yr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&ni(n,i,a)}}function $r(e,t,n,r){Yr[Xr++]=e,Yr[Xr++]=t,Yr[Xr++]=n,Yr[Xr++]=r,Zr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function ei(e,t,n,r){return $r(e,t,n,r),ri(e)}function ti(e,t){return $r(e,null,null,t),ri(e)}function ni(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-He(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ri(e){if(50<du)throw du=0,fu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ii={};function ai(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function oi(e,t,n,r){return new ai(e,t,n,r)}function si(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ci(e,t){var n=e.alternate;return n===null?(n=oi(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function li(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ui(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)si(e)&&(s=1);else if(typeof e==`string`)s=Uf(e,n,ue.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case O:return e=oi(31,n,t,a),e.elementType=O,e.lanes=o,e;case y:return di(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=oi(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=oi(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=oi(19,n,t,a),e.elementType=E,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case ee:s=14;break a;case D:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=oi(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function di(e,t,n,r){return e=oi(7,e,r,t),e.lanes=n,e}function fi(e,t,n){return e=oi(6,e,null,t),e.lanes=n,e}function pi(e){var t=oi(18,null,null,0);return t.stateNode=e,t}function mi(e,t,n){return t=oi(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var V=new WeakMap;function H(e,t){if(typeof e==`object`&&e){var n=V.get(e);return n===void 0?(t={value:e,source:t,stack:we(t)},V.set(e,t),t):n}return{value:e,source:t,stack:we(t)}}var hi=[],gi=0,_i=null,vi=0,yi=[],bi=0,xi=null,Si=1,Ci=``;function wi(e,t){hi[gi++]=vi,hi[gi++]=_i,_i=e,vi=t}function Ti(e,t,n){yi[bi++]=Si,yi[bi++]=Ci,yi[bi++]=xi,xi=e;var r=Si;e=Ci;var i=32-He(r)-1;r&=~(1<<i),n+=1;var a=32-He(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Si=1<<32-He(t)+i|n<<i|r,Ci=a+e}else Si=1<<a|n<<i|r,Ci=e}function Ei(e){e.return!==null&&(wi(e,1),Ti(e,1,0))}function Di(e){for(;e===_i;)_i=hi[--gi],hi[gi]=null,vi=hi[--gi],hi[gi]=null;for(;e===xi;)xi=yi[--bi],yi[bi]=null,Ci=yi[--bi],yi[bi]=null,Si=yi[--bi],yi[bi]=null}function Oi(e,t){yi[bi++]=Si,yi[bi++]=Ci,yi[bi++]=xi,Si=t.id,Ci=t.overflow,xi=e}var ki=null,Ai=null,U=!1,ji=null,Mi=!1,Ni=Error(i(519));function Pi(e){throw Bi(H(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Ni}function Fi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[ut]=e,t[dt]=r,n){case`dialog`:Q(`cancel`,t),Q(`close`,t);break;case`iframe`:case`object`:case`embed`:Q(`load`,t);break;case`video`:case`audio`:for(n=0;n<_d.length;n++)Q(_d[n],t);break;case`source`:Q(`error`,t);break;case`img`:case`image`:case`link`:Q(`error`,t),Q(`load`,t);break;case`details`:Q(`toggle`,t);break;case`input`:Q(`invalid`,t),Ut(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Q(`invalid`,t);break;case`textarea`:Q(`invalid`,t),qt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Md(t.textContent,n)?(r.popover!=null&&(Q(`beforetoggle`,t),Q(`toggle`,t)),r.onScroll!=null&&Q(`scroll`,t),r.onScrollEnd!=null&&Q(`scrollend`,t),r.onClick!=null&&(t.onclick=nn),t=!0):t=!1,t||Pi(e,!0)}function Ii(e){for(ki=e.return;ki;)switch(ki.tag){case 5:case 31:case 13:Mi=!1;return;case 27:case 3:Mi=!0;return;default:ki=ki.return}}function Li(e){if(e!==ki)return!1;if(!U)return Ii(e),U=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Ud(e.type,e.memoizedProps)),n=!n),n&&Ai&&Pi(e),Ii(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ai=uf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ai=uf(e)}else t===27?(t=Ai,Zd(e.type)?(e=lf,lf=null,Ai=e):Ai=t):Ai=ki?cf(e.stateNode.nextSibling):null;return!0}function Ri(){Ai=ki=null,U=!1}function zi(){var e=ji;return e!==null&&(Zl===null?Zl=e:Zl.push.apply(Zl,e),ji=null),e}function Bi(e){ji===null?ji=[e]:ji.push(e)}var Vi=ce(null),Hi=null,Ui=null;function Wi(e,t,n){N(Vi,t._currentValue),t._currentValue=n}function Gi(e){e._currentValue=Vi.current,le(Vi)}function Ki(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function qi(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Ki(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Ki(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Ji(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;br(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===pe.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[Qf]:e.push(Qf))}a=a.return}e!==null&&qi(t,e,n,r),t.flags|=262144}function Yi(e){for(e=e.firstContext;e!==null;){if(!br(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Xi(e){Hi=e,Ui=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Zi(e){return $i(Hi,e)}function Qi(e,t){return Hi===null&&Xi(e),$i(e,t)}function $i(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Ui===null){if(e===null)throw Error(i(308));Ui=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ui=Ui.next=t;return n}var ea=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},ta=t.unstable_scheduleCallback,na=t.unstable_NormalPriority,ra={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ia(){return{controller:new ea,data:new Map,refCount:0}}function aa(e){e.refCount--,e.refCount===0&&ta(na,function(){e.controller.abort()})}var oa=null,sa=0,ca=0,la=null;function ua(e,t){if(oa===null){var n=oa=[];sa=0,ca=dd(),la={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return sa++,t.then(da,da),t}function da(){if(--sa===0&&oa!==null){la!==null&&(la.status=`fulfilled`);var e=oa;oa=null,ca=0,la=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function fa(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var pa=j.S;j.S=function(e,t){eu=Ae(),typeof t==`object`&&t&&typeof t.then==`function`&&ua(e,t),pa!==null&&pa(e,t)};var ma=ce(null);function ha(){var e=ma.current;return e===null?q.pooledCache:e}function ga(e,t){t===null?N(ma,ma.current):N(ma,t.pool)}function _a(){var e=ha();return e===null?null:{parent:ra._currentValue,pool:e}}var va=Error(i(460)),ya=Error(i(474)),ba=Error(i(542)),xa={then:function(){}};function Sa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Ca(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(nn,nn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Da(e),e;default:if(typeof t.status==`string`)t.then(nn,nn);else{if(e=q,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Da(e),e}throw Ta=t,va}}function wa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Ta=e,va):e}}var Ta=null;function Ea(){if(Ta===null)throw Error(i(459));var e=Ta;return Ta=null,e}function Da(e){if(e===va||e===ba)throw Error(i(483))}var Oa=null,ka=0;function Aa(e){var t=ka;return ka+=1,Oa===null&&(Oa=[]),Ca(Oa,e,t)}function ja(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Ma(e,t){throw t.$$typeof===g?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Na(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=ci(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=fi(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===D&&wa(i)===t.type)?(t=a(t,n.props),ja(t,n),t.return=e,t):(t=ui(n.type,n.key,n.props,null,e.mode,r),ja(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=mi(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=di(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=fi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=ui(t.type,t.key,t.props,null,e.mode,n),ja(n,t),n.return=e,n;case v:return t=mi(t,e.mode,n),t.return=e,t;case D:return t=wa(t),f(e,t,n)}if(ie(t)||te(t))return t=di(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Aa(t),n);if(t.$$typeof===C)return f(e,Qi(e,t),n);Ma(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case _:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case D:return n=wa(n),p(e,t,n,r)}if(ie(n)||te(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Aa(n),r);if(n.$$typeof===C)return p(e,t,Qi(e,n),r);Ma(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case _:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case D:return r=wa(r),m(e,t,n,r,i)}if(ie(r)||te(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Aa(r),i);if(r.$$typeof===C)return m(e,t,n,Qi(t,r),i);Ma(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),U&&wi(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return U&&wi(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),U&&wi(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),U&&wi(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return U&&wi(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),U&&wi(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===D&&wa(l)===r.type){n(e,r.sibling),c=a(r,o.props),ja(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=di(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=ui(o.type,o.key,o.props,null,e.mode,c),ja(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=mi(o,e.mode,c),c.return=e,e=c}return s(e);case D:return o=wa(o),b(e,r,o,c)}if(ie(o))return h(e,r,o,c);if(te(o)){if(l=te(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Aa(o),c);if(o.$$typeof===C)return b(e,r,Qi(e,o),c);Ma(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=fi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{ka=0;var i=b(e,t,n,r);return Oa=null,i}catch(t){if(t===va||t===ba)throw t;var a=oi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Pa=Na(!0),Fa=Na(!1),Ia=!1;function La(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ra(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function za(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ba(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,K&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ri(e),ni(e,null,n),t}return $r(e,r,t,n),ri(e)}function Va(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,it(e,n)}}function Ha(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ua=!1;function Wa(){if(Ua){var e=la;if(e!==null)throw e}}function Ga(e,t,n,r){Ua=!1;var i=e.updateQueue;Ia=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Y&f)===f:(r&f)===f){f!==0&&f===ca&&(Ua=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(m=g.payload,typeof m==`function`){d=m.call(_,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,f=typeof m==`function`?m.call(_,d,f):m,f==null)break a;d=h({},d,f);break a;case 2:Ia=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Gl|=o,e.lanes=o,e.memoizedState=d}}function Ka(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function qa(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ka(n[e],t)}var Ja=ce(null),Ya=ce(0);function Xa(e,t){e=Ul,N(Ya,e),N(Ja,t),Ul=e|t.baseLanes}function Za(){N(Ya,Ul),N(Ja,Ja.current)}function Qa(){Ul=Ya.current,le(Ja),le(Ya)}var $a=ce(null),eo=null;function to(e){var t=e.alternate;N(oo,oo.current&1),N($a,e),eo===null&&(t===null||Ja.current!==null||t.memoizedState!==null)&&(eo=e)}function no(e){N(oo,oo.current),N($a,e),eo===null&&(eo=e)}function ro(e){e.tag===22?(N(oo,oo.current),N($a,e),eo===null&&(eo=e)):io(e)}function io(){N(oo,oo.current),N($a,$a.current)}function ao(e){le($a),eo===e&&(eo=null),le(oo)}var oo=ce(0);function so(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||af(n)||of(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var co=0,W=null,G=null,lo=null,uo=!1,fo=!1,po=!1,mo=0,ho=0,go=null,_o=0;function vo(){throw Error(i(321))}function yo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!br(e[n],t[n]))return!1;return!0}function bo(e,t,n,r,i,a){return co=a,W=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,j.H=e===null||e.memoizedState===null?Ls:Rs,po=!1,a=n(r,i),po=!1,fo&&(a=So(t,n,r,i)),xo(e),a}function xo(e){j.H=Is;var t=G!==null&&G.next!==null;if(co=0,lo=G=W=null,uo=!1,ho=0,go=null,t)throw Error(i(300));e===null||tc||(e=e.dependencies,e!==null&&Yi(e)&&(tc=!0))}function So(e,t,n,r){W=e;var a=0;do{if(fo&&(go=null),ho=0,fo=!1,25<=a)throw Error(i(301));if(a+=1,lo=G=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}j.H=zs,o=t(n,r)}while(fo);return o}function Co(){var e=j.H,t=e.useState()[0];return t=typeof t.then==`function`?Ao(t):t,e=e.useState()[0],(G===null?null:G.memoizedState)!==e&&(W.flags|=1024),t}function wo(){var e=mo!==0;return mo=0,e}function To(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Eo(e){if(uo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}uo=!1}co=0,lo=G=W=null,fo=!1,ho=mo=0,go=null}function Do(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return lo===null?W.memoizedState=lo=e:lo=lo.next=e,lo}function Oo(){if(G===null){var e=W.alternate;e=e===null?null:e.memoizedState}else e=G.next;var t=lo===null?W.memoizedState:lo.next;if(t!==null)lo=t,G=e;else{if(e===null)throw W.alternate===null?Error(i(467)):Error(i(310));G=e,e={memoizedState:G.memoizedState,baseState:G.baseState,baseQueue:G.baseQueue,queue:G.queue,next:null},lo===null?W.memoizedState=lo=e:lo=lo.next=e}return lo}function ko(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ao(e){var t=ho;return ho+=1,go===null&&(go=[]),e=Ca(go,e,t),t=W,(lo===null?t.memoizedState:lo.next)===null&&(t=t.alternate,j.H=t===null||t.memoizedState===null?Ls:Rs),e}function jo(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Ao(e);if(e.$$typeof===C)return Zi(e)}throw Error(i(438,String(e)))}function Mo(e){var t=null,n=W.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=W.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=ko(),W.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=k;return t.index++,n}function No(e,t){return typeof t==`function`?t(e):t}function Po(e){return Fo(Oo(),G,e)}function Fo(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(co&f)===f:(Y&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===ca&&(d=!0);else if((co&p)===p){u=u.next,p===ca&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,W.lanes|=p,Gl|=p;f=u.action,po&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,W.lanes|=f,Gl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!br(o,e.memoizedState)&&(tc=!0,d&&(n=la,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Io(e){var t=Oo(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);br(o,t.memoizedState)||(tc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Lo(e,t,n){var r=W,a=Oo(),o=U;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!br((G||a).memoizedState,n);if(s&&(a.memoizedState=n,tc=!0),a=a.queue,cs(Bo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||lo!==null&&lo.memoizedState.tag&1){if(r.flags|=2048,rs(9,{destroy:void 0},zo.bind(null,r,a,n,t),null),q===null)throw Error(i(349));o||co&127||Ro(r,t,n)}return n}function Ro(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=W.updateQueue,t===null?(t=ko(),W.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function zo(e,t,n,r){t.value=n,t.getSnapshot=r,Vo(t)&&Ho(e)}function Bo(e,t,n){return n(function(){Vo(t)&&Ho(e)})}function Vo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!br(e,n)}catch{return!0}}function Ho(e){var t=ti(e,2);t!==null&&hu(t,e,2)}function Uo(e){var t=Do();if(typeof e==`function`){var n=e;if(e=n(),po){Ve(!0);try{n()}finally{Ve(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:e},t}function Wo(e,t,n,r){return e.baseState=n,Fo(e,G,typeof r==`function`?r:No)}function Go(e,t,n,r,a){if(Ns(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};j.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Ko(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Ko(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=j.T,o={};j.T=o;try{var s=n(i,r),c=j.S;c!==null&&c(o,s),qo(e,t,s)}catch(n){Yo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),j.T=a}}else try{a=n(i,r),qo(e,t,a)}catch(n){Yo(e,t,n)}}function qo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Jo(e,t,n)},function(n){return Yo(e,t,n)}):Jo(e,t,n)}function Jo(e,t,n){t.status=`fulfilled`,t.value=n,Xo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Ko(e,n)))}function Yo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Xo(t),t=t.next;while(t!==r)}e.action=null}function Xo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Zo(e,t){return t}function Qo(e,t){if(U){var n=q.formState;if(n!==null){a:{var r=W;if(U){if(Ai){b:{for(var i=Ai,a=Mi;i.nodeType!==8;){if(!a){i=null;break b}if(i=cf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Ai=cf(i.nextSibling),r=i.data===`F!`;break a}}Pi(r)}r=!1}r&&(t=n[0])}}return n=Do(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zo,lastRenderedState:t},n.queue=r,n=As.bind(null,W,r),r.dispatch=n,r=Uo(!1),a=Ms.bind(null,W,!1,r.queue),r=Do(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Go.bind(null,W,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function $o(e){return es(Oo(),G,e)}function es(e,t,n){if(t=Fo(e,t,Zo)[0],e=Po(No)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Ao(t)}catch(e){throw e===va?ba:e}else r=t;t=Oo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(W.flags|=2048,rs(9,{destroy:void 0},ts.bind(null,i,n),null)),[r,a,e]}function ts(e,t){e.action=t}function ns(e){var t=Oo(),n=G;if(n!==null)return es(t,n,e);Oo(),t=t.memoizedState,n=Oo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function rs(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=W.updateQueue,t===null&&(t=ko(),W.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function is(){return Oo().memoizedState}function as(e,t,n,r){var i=Do();W.flags|=e,i.memoizedState=rs(1|t,{destroy:void 0},n,r===void 0?null:r)}function os(e,t,n,r){var i=Oo();r=r===void 0?null:r;var a=i.memoizedState.inst;G!==null&&r!==null&&yo(r,G.memoizedState.deps)?i.memoizedState=rs(t,a,n,r):(W.flags|=e,i.memoizedState=rs(1|t,a,n,r))}function ss(e,t){as(8390656,8,e,t)}function cs(e,t){os(2048,8,e,t)}function ls(e){W.flags|=4;var t=W.updateQueue;if(t===null)t=ko(),W.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function us(e){var t=Oo().memoizedState;return ls({ref:t,nextImpl:e}),function(){if(K&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function ds(e,t){return os(4,2,e,t)}function fs(e,t){return os(4,4,e,t)}function ps(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ms(e,t,n){n=n==null?null:n.concat([e]),os(4,4,ps.bind(null,t,e),n)}function hs(){}function gs(e,t){var n=Oo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&yo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function _s(e,t){var n=Oo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&yo(t,r[1]))return r[0];if(r=e(),po){Ve(!0);try{e()}finally{Ve(!1)}}return n.memoizedState=[r,t],r}function vs(e,t,n){return n===void 0||co&1073741824&&!(Y&261930)?e.memoizedState=t:(e.memoizedState=n,e=mu(),W.lanes|=e,Gl|=e,n)}function ys(e,t,n,r){return br(n,t)?n:Ja.current===null?!(co&42)||co&1073741824&&!(Y&261930)?(tc=!0,e.memoizedState=n):(e=mu(),W.lanes|=e,Gl|=e,t):(e=vs(e,n,r),br(e,t)||(tc=!0),e)}function bs(e,t,n,r,i){var a=M.p;M.p=a!==0&&8>a?a:8;var o=j.T,s={};j.T=s,Ms(e,!1,t,n);try{var c=i(),l=j.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?js(e,t,fa(c,r),pu(e)):js(e,t,r,pu(e))}catch(n){js(e,t,{then:function(){},status:`rejected`,reason:n},pu())}finally{M.p=a,o!==null&&s.types!==null&&(o.types=s.types),j.T=o}}function xs(){}function Ss(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Cs(e).queue;bs(e,a,t,ae,n===null?xs:function(){return ws(e),n(r)})}function Cs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ae,baseState:ae,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:ae},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ws(e){var t=Cs(e);t.next===null&&(t=e.alternate.memoizedState),js(e,t.next.queue,{},pu())}function Ts(){return Zi(Qf)}function Es(){return Oo().memoizedState}function Ds(){return Oo().memoizedState}function Os(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=pu();e=za(n);var r=Ba(t,e,n);r!==null&&(hu(r,t,n),Va(r,t,n)),t={cache:ia()},e.payload=t;return}t=t.return}}function ks(e,t,n){var r=pu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ns(e)?Ps(t,n):(n=ei(e,t,n,r),n!==null&&(hu(n,e,r),Fs(n,t,r)))}function As(e,t,n){js(e,t,n,pu())}function js(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ns(e))Ps(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,br(s,o))return $r(e,t,i,0),q===null&&Qr(),!1}catch{}if(n=ei(e,t,i,r),n!==null)return hu(n,e,r),Fs(n,t,r),!0}return!1}function Ms(e,t,n,r){if(r={lane:2,revertLane:dd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ns(e)){if(t)throw Error(i(479))}else t=ei(e,n,r,2),t!==null&&hu(t,e,2)}function Ns(e){var t=e.alternate;return e===W||t!==null&&t===W}function Ps(e,t){fo=uo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Fs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,it(e,n)}}var Is={readContext:Zi,use:jo,useCallback:vo,useContext:vo,useEffect:vo,useImperativeHandle:vo,useLayoutEffect:vo,useInsertionEffect:vo,useMemo:vo,useReducer:vo,useRef:vo,useState:vo,useDebugValue:vo,useDeferredValue:vo,useTransition:vo,useSyncExternalStore:vo,useId:vo,useHostTransitionStatus:vo,useFormState:vo,useActionState:vo,useOptimistic:vo,useMemoCache:vo,useCacheRefresh:vo};Is.useEffectEvent=vo;var Ls={readContext:Zi,use:jo,useCallback:function(e,t){return Do().memoizedState=[e,t===void 0?null:t],e},useContext:Zi,useEffect:ss,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),as(4194308,4,ps.bind(null,t,e),n)},useLayoutEffect:function(e,t){return as(4194308,4,e,t)},useInsertionEffect:function(e,t){as(4,2,e,t)},useMemo:function(e,t){var n=Do();t=t===void 0?null:t;var r=e();if(po){Ve(!0);try{e()}finally{Ve(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Do();if(n!==void 0){var i=n(t);if(po){Ve(!0);try{n(t)}finally{Ve(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=ks.bind(null,W,e),[r.memoizedState,e]},useRef:function(e){var t=Do();return e={current:e},t.memoizedState=e},useState:function(e){e=Uo(e);var t=e.queue,n=As.bind(null,W,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:hs,useDeferredValue:function(e,t){return vs(Do(),e,t)},useTransition:function(){var e=Uo(!1);return e=bs.bind(null,W,e.queue,!0,!1),Do().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=W,a=Do();if(U){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),q===null)throw Error(i(349));Y&127||Ro(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,ss(Bo.bind(null,r,o,e),[e]),r.flags|=2048,rs(9,{destroy:void 0},zo.bind(null,r,o,n,t),null),n},useId:function(){var e=Do(),t=q.identifierPrefix;if(U){var n=Ci,r=Si;n=(r&~(1<<32-He(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=mo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=_o++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Ts,useFormState:Qo,useActionState:Qo,useOptimistic:function(e){var t=Do();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Ms.bind(null,W,!0,n),n.dispatch=t,[e,t]},useMemoCache:Mo,useCacheRefresh:function(){return Do().memoizedState=Os.bind(null,W)},useEffectEvent:function(e){var t=Do(),n={impl:e};return t.memoizedState=n,function(){if(K&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Rs={readContext:Zi,use:jo,useCallback:gs,useContext:Zi,useEffect:cs,useImperativeHandle:ms,useInsertionEffect:ds,useLayoutEffect:fs,useMemo:_s,useReducer:Po,useRef:is,useState:function(){return Po(No)},useDebugValue:hs,useDeferredValue:function(e,t){return ys(Oo(),G.memoizedState,e,t)},useTransition:function(){var e=Po(No)[0],t=Oo().memoizedState;return[typeof e==`boolean`?e:Ao(e),t]},useSyncExternalStore:Lo,useId:Es,useHostTransitionStatus:Ts,useFormState:$o,useActionState:$o,useOptimistic:function(e,t){return Wo(Oo(),G,e,t)},useMemoCache:Mo,useCacheRefresh:Ds};Rs.useEffectEvent=us;var zs={readContext:Zi,use:jo,useCallback:gs,useContext:Zi,useEffect:cs,useImperativeHandle:ms,useInsertionEffect:ds,useLayoutEffect:fs,useMemo:_s,useReducer:Io,useRef:is,useState:function(){return Io(No)},useDebugValue:hs,useDeferredValue:function(e,t){var n=Oo();return G===null?vs(n,e,t):ys(n,G.memoizedState,e,t)},useTransition:function(){var e=Io(No)[0],t=Oo().memoizedState;return[typeof e==`boolean`?e:Ao(e),t]},useSyncExternalStore:Lo,useId:Es,useHostTransitionStatus:Ts,useFormState:ns,useActionState:ns,useOptimistic:function(e,t){var n=Oo();return G===null?(n.baseState=e,[e,n.queue.dispatch]):Wo(n,G,e,t)},useMemoCache:Mo,useCacheRefresh:Ds};zs.useEffectEvent=us;function Bs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:h({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Vs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=pu(),i=za(r);i.payload=t,n!=null&&(i.callback=n),t=Ba(e,i,r),t!==null&&(hu(t,e,r),Va(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=pu(),i=za(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ba(e,i,r),t!==null&&(hu(t,e,r),Va(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=pu(),r=za(n);r.tag=2,t!=null&&(r.callback=t),t=Ba(e,r,n),t!==null&&(hu(t,e,n),Va(t,e,n))}};function Hs(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!xr(n,r)||!xr(i,a):!0}function Us(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Vs.enqueueReplaceState(t,t.state,null)}function Ws(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=h({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Gs(e){Jr(e)}function Ks(e){console.error(e)}function qs(e){Jr(e)}function Js(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Ys(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Xs(e,t,n){return n=za(n),n.tag=3,n.payload={element:null},n.callback=function(){Js(e,t)},n}function Zs(e){return e=za(e),e.tag=3,e}function Qs(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Ys(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Ys(t,n,r),typeof i!=`function`&&(ru===null?ru=new Set([this]):ru.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function $s(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Ji(t,n,a,!0),n=$a.current,n!==null){switch(n.tag){case 31:case 13:return eo===null?Du():n.alternate===null&&Wl===0&&(Wl=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===xa?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Gu(e,r,a)),!1;case 22:return n.flags|=65536,r===xa?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Gu(e,r,a)),!1}throw Error(i(435,n.tag))}return Gu(e,r,a),Du(),!1}if(U)return t=$a.current,t===null?(r!==Ni&&(t=Error(i(423),{cause:r}),Bi(H(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=H(r,n),a=Xs(e.stateNode,r,a),Ha(e,a),Wl!==4&&(Wl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Ni&&(e=Error(i(422),{cause:r}),Bi(H(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=H(o,n),Xl===null?Xl=[o]:Xl.push(o),Wl!==4&&(Wl=2),t===null)return!0;r=H(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Xs(n.stateNode,r,e),Ha(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(ru===null||!ru.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Zs(a),Qs(a,e,n,r),Ha(n,a),!1}n=n.return}while(n!==null);return!1}var ec=Error(i(461)),tc=!1;function nc(e,t,n,r){t.child=e===null?Fa(t,null,n,r):Pa(t,e.child,n,r)}function rc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Xi(t),r=bo(e,t,n,o,a,i),s=wo(),e!==null&&!tc?(To(e,t,i),Dc(e,t,i)):(U&&s&&Ei(t),t.flags|=1,nc(e,t,r,i),t.child)}function ic(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!si(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,ac(e,t,a,r,i)):(e=ui(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Oc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?xr:n,n(o,r)&&e.ref===t.ref)return Dc(e,t,i)}return t.flags|=1,e=ci(a,r),e.ref=t.ref,e.return=t,t.child=e}function ac(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(xr(a,r)&&e.ref===t.ref)if(tc=!1,t.pendingProps=r=a,Oc(e,i))e.flags&131072&&(tc=!0);else return t.lanes=e.lanes,Dc(e,t,i)}return pc(e,t,n,r,i)}function oc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return cc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ga(t,a===null?null:a.cachePool),a===null?Za():Xa(t,a),ro(t);else return r=t.lanes=536870912,cc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ga(t,null),Za(),io(t)):(ga(t,a.cachePool),Xa(t,a),io(t),t.memoizedState=null);return nc(e,t,i,n),t.child}function sc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function cc(e,t,n,r,i){var a=ha();return a=a===null?null:{parent:ra._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ga(t,null),Za(),ro(t),e!==null&&Ji(e,t,r,!0),t.childLanes=i,null}function lc(e,t){return t=Sc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function uc(e,t,n){return Pa(t,e.child,null,n),e=lc(t,t.pendingProps),e.flags|=2,ao(t),t.memoizedState=null,e}function dc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(U){if(r.mode===`hidden`)return e=lc(t,r),t.lanes=536870912,sc(null,e);if(no(t),(e=Ai)?(e=rf(e,Mi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:xi===null?null:{id:Si,overflow:Ci},retryLane:536870912,hydrationErrors:null},n=pi(e),n.return=t,t.child=n,ki=t,Ai=null)):e=null,e===null)throw Pi(t);return t.lanes=536870912,null}return lc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(no(t),a)if(t.flags&256)t.flags&=-257,t=uc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(tc||Ji(e,t,n,!1),a=(n&e.childLanes)!==0,tc||a){if(r=q,r!==null&&(s=at(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ti(e,s),hu(r,e,s),ec;Du(),t=uc(e,t,n)}else e=o.treeContext,Ai=cf(s.nextSibling),ki=t,U=!0,ji=null,Mi=!1,e!==null&&Oi(t,e),t=lc(t,r),t.flags|=4096;return t}return e=ci(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function fc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function pc(e,t,n,r,i){return Xi(t),n=bo(e,t,n,r,void 0,i),r=wo(),e!==null&&!tc?(To(e,t,i),Dc(e,t,i)):(U&&r&&Ei(t),t.flags|=1,nc(e,t,n,i),t.child)}function mc(e,t,n,r,i,a){return Xi(t),t.updateQueue=null,n=So(t,r,n,i),xo(e),r=wo(),e!==null&&!tc?(To(e,t,a),Dc(e,t,a)):(U&&r&&Ei(t),t.flags|=1,nc(e,t,n,a),t.child)}function hc(e,t,n,r,i){if(Xi(t),t.stateNode===null){var a=ii,o=n.contextType;typeof o==`object`&&o&&(a=Zi(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Vs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},La(t),o=n.contextType,a.context=typeof o==`object`&&o?Zi(o):ii,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Bs(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Vs.enqueueReplaceState(a,a.state,null),Ga(t,r,a,i),Wa(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Ws(n,s);a.props=c;var l=a.context,u=n.contextType;o=ii,typeof u==`object`&&u&&(o=Zi(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Us(t,a,r,o),Ia=!1;var f=t.memoizedState;a.state=f,Ga(t,r,a,i),Wa(),l=t.memoizedState,s||f!==l||Ia?(typeof d==`function`&&(Bs(t,n,d,r),l=t.memoizedState),(c=Ia||Hs(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Ra(e,t),o=t.memoizedProps,u=Ws(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ii,typeof l==`object`&&l&&(c=Zi(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Us(t,a,r,c),Ia=!1,f=t.memoizedState,a.state=f,Ga(t,r,a,i),Wa();var p=t.memoizedState;o!==d||f!==p||Ia||e!==null&&e.dependencies!==null&&Yi(e.dependencies)?(typeof s==`function`&&(Bs(t,n,s,r),p=t.memoizedState),(u=Ia||Hs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Yi(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,fc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Pa(t,e.child,null,i),t.child=Pa(t,null,n,i)):nc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Dc(e,t,i),e}function gc(e,t,n,r){return Ri(),t.flags|=256,nc(e,t,n,r),t.child}var _c={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function vc(e){return{baseLanes:e,cachePool:_a()}}function yc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Jl),e}function bc(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(oo.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(U){if(a?to(t):io(t),(e=Ai)?(e=rf(e,Mi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:xi===null?null:{id:Si,overflow:Ci},retryLane:536870912,hydrationErrors:null},n=pi(e),n.return=t,t.child=n,ki=t,Ai=null)):e=null,e===null)throw Pi(t);return of(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(io(t),a=t.mode,c=Sc({mode:`hidden`,children:c},a),r=di(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=vc(n),r.childLanes=yc(e,s,n),t.memoizedState=_c,sc(null,r)):(to(t),xc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(to(t),t.flags&=-257,t=Cc(e,t,n)):t.memoizedState===null?(io(t),c=r.fallback,a=t.mode,r=Sc({mode:`visible`,children:r.children},a),c=di(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Pa(t,e.child,null,n),r=t.child,r.memoizedState=vc(n),r.childLanes=yc(e,s,n),t.memoizedState=_c,t=sc(null,r)):(io(t),t.child=e.child,t.flags|=128,t=null);else if(to(t),of(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Bi({value:r,source:null,stack:null}),t=Cc(e,t,n)}else if(tc||Ji(e,t,n,!1),s=(n&e.childLanes)!==0,tc||s){if(s=q,s!==null&&(r=at(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,ti(e,r),hu(s,e,r),ec;af(c)||Du(),t=Cc(e,t,n)}else af(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Ai=cf(c.nextSibling),ki=t,U=!0,ji=null,Mi=!1,e!==null&&Oi(t,e),t=xc(t,r.children),t.flags|=4096);return t}return a?(io(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=ci(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=di(c,a,n,null),c.flags|=2):c=ci(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,sc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=vc(n):(a=c.cachePool,a===null?a=_a():(l=ra._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=yc(e,s,n),t.memoizedState=_c,sc(e.child,r)):(to(t),n=e.child,e=n.sibling,n=ci(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function xc(e,t){return t=Sc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Sc(e,t){return e=oi(22,e,null,t),e.lanes=0,e}function Cc(e,t,n){return Pa(t,e.child,null,n),e=xc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function wc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ki(e.return,t,n)}function Tc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Ec(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=oo.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,N(oo,o),nc(e,t,r,n),r=U?vi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&wc(e,n,t);else if(e.tag===19)wc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&so(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Tc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&so(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Tc(t,!0,n,null,a,r);break;case`together`:Tc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Dc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Gl|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Ji(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=ci(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ci(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Oc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&Yi(e))):!0}function kc(e,t,n){switch(t.tag){case 3:me(t,t.stateNode.containerInfo),Wi(t,ra,e.memoizedState.cache),Ri();break;case 27:case 5:ge(t);break;case 4:me(t,t.stateNode.containerInfo);break;case 10:Wi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,no(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(to(t),e=Dc(e,t,n),e===null?null:e.sibling):bc(e,t,n):(to(t),t.flags|=128,null);to(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Ji(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Ec(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),N(oo,oo.current),r)break;return null;case 22:return t.lanes=0,oc(e,t,n,t.pendingProps);case 24:Wi(t,ra,e.memoizedState.cache)}return Dc(e,t,n)}function Ac(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)tc=!0;else{if(!Oc(e,n)&&!(t.flags&128))return tc=!1,kc(e,t,n);tc=!!(e.flags&131072)}else tc=!1,U&&t.flags&1048576&&Ti(t,vi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=wa(t.elementType),t.type=e,typeof e==`function`)si(e)?(r=Ws(e,r),t.tag=1,t=hc(null,t,e,r,n)):(t.tag=0,t=pc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=rc(null,t,e,r,n);break a}else if(a===ee){t.tag=14,t=ic(null,t,e,r,n);break a}}throw t=re(e)||e,Error(i(306,t,``))}}return t;case 0:return pc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Ws(r,t.pendingProps),hc(e,t,r,a,n);case 3:a:{if(me(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Ra(e,t),Ga(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Wi(t,ra,r),r!==o.cache&&qi(t,[ra],n,!0),Wa(),r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=gc(e,t,r,n);break a}else if(r!==a){a=H(Error(i(424)),t),Bi(a),t=gc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Ai=cf(e.firstChild),ki=t,U=!0,ji=null,Mi=!0,n=Fa(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Ri(),r===a){t=Dc(e,t,n);break a}nc(e,t,r,n)}t=t.child}return t;case 26:return fc(e,t),e===null?(n=kf(t.type,null,t.pendingProps,null))?t.memoizedState=n:U||(n=t.type,e=t.pendingProps,r=Bd(fe.current).createElement(n),r[ut]=t,r[dt]=e,Pd(r,n,e),Ct(r),t.stateNode=r):t.memoizedState=kf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ge(t),e===null&&U&&(r=t.stateNode=ff(t.type,t.pendingProps,fe.current),ki=t,Mi=!0,a=Ai,Zd(t.type)?(lf=a,Ai=cf(r.firstChild)):Ai=a),nc(e,t,t.pendingProps.children,n),fc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&U&&((a=r=Ai)&&(r=tf(r,t.type,t.pendingProps,Mi),r===null?a=!1:(t.stateNode=r,ki=t,Ai=cf(r.firstChild),Mi=!1,a=!0)),a||Pi(t)),ge(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Ud(a,o)?r=null:s!==null&&Ud(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=bo(e,t,Co,null,null,n),Qf._currentValue=a),fc(e,t),nc(e,t,r,n),t.child;case 6:return e===null&&U&&((e=n=Ai)&&(n=nf(n,t.pendingProps,Mi),n===null?e=!1:(t.stateNode=n,ki=t,Ai=null,e=!0)),e||Pi(t)),null;case 13:return bc(e,t,n);case 4:return me(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Pa(t,null,r,n):nc(e,t,r,n),t.child;case 11:return rc(e,t,t.type,t.pendingProps,n);case 7:return nc(e,t,t.pendingProps,n),t.child;case 8:return nc(e,t,t.pendingProps.children,n),t.child;case 12:return nc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Wi(t,t.type,r.value),nc(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Xi(t),a=Zi(a),r=r(a),t.flags|=1,nc(e,t,r,n),t.child;case 14:return ic(e,t,t.type,t.pendingProps,n);case 15:return ac(e,t,t.type,t.pendingProps,n);case 19:return Ec(e,t,n);case 31:return dc(e,t,n);case 22:return oc(e,t,n,t.pendingProps);case 24:return Xi(t),r=Zi(ra),e===null?(a=ha(),a===null&&(a=q,o=ia(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},La(t),Wi(t,ra,a)):((e.lanes&n)!==0&&(Ra(e,t),Ga(t,null,null,n),Wa()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Wi(t,ra,r),r!==a.cache&&qi(t,[ra],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Wi(t,ra,r))),nc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function jc(e){e.flags|=4}function Mc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(wu())e.flags|=8192;else throw Ta=xa,ya}else e.flags&=-16777217}function Nc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Wf(t))if(wu())e.flags|=8192;else throw Ta=xa,ya}function Pc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:$e(),e.lanes|=t,Yl|=t)}function Fc(e,t){if(!U)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Ic(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Lc(e,t,n){var r=t.pendingProps;switch(Di(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ic(t),null;case 1:return Ic(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Gi(ra),he(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Li(t)?jc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,zi())),Ic(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(jc(t),o===null?(Ic(t),Mc(t,a,null,r,n)):(Ic(t),Nc(t,o))):o?o===e.memoizedState?(Ic(t),t.flags&=-16777217):(jc(t),Ic(t),Nc(t,o)):(e=e.memoizedProps,e!==r&&jc(t),Ic(t),Mc(t,a,e,r,n)),null;case 27:if(_e(t),n=fe.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&jc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Ic(t),null}e=ue.current,Li(t)?Fi(t,e):(e=ff(a,r,n),t.stateNode=e,jc(t))}return Ic(t),null;case 5:if(_e(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&jc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Ic(t),null}if(o=ue.current,Li(t))Fi(t,o);else{var s=Bd(fe.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[ut]=t,o[dt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Pd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&jc(t)}}return Ic(t),Mc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&jc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=fe.current,Li(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=ki,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[ut]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Md(e.nodeValue,n)),e||Pi(t,!0)}else e=Bd(e).createTextNode(r),e[ut]=t,t.stateNode=e}return Ic(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Li(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[ut]=t}else Ri(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ic(t),e=!1}else n=zi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(ao(t),t):(ao(t),null);if(t.flags&128)throw Error(i(558))}return Ic(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Li(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[ut]=t}else Ri(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ic(t),a=!1}else a=zi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(ao(t),t):(ao(t),null)}return ao(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Pc(t,t.updateQueue),Ic(t),null);case 4:return he(),e===null&&Sd(t.stateNode.containerInfo),Ic(t),null;case 10:return Gi(t.type),Ic(t),null;case 19:if(le(oo),r=t.memoizedState,r===null)return Ic(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Fc(r,!1);else{if(Wl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=so(e),o!==null){for(t.flags|=128,Fc(r,!1),e=o.updateQueue,t.updateQueue=e,Pc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)li(n,e),n=n.sibling;return N(oo,oo.current&1|2),U&&wi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ae()>tu&&(t.flags|=128,a=!0,Fc(r,!1),t.lanes=4194304)}else{if(!a)if(e=so(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Pc(t,e),Fc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!U)return Ic(t),null}else 2*Ae()-r.renderingStartTime>tu&&n!==536870912&&(t.flags|=128,a=!0,Fc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Ic(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ae(),e.sibling=null,n=oo.current,N(oo,a?n&1|2:n&1),U&&wi(t,r.treeForkCount),e);case 22:case 23:return ao(t),Qa(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Ic(t),t.subtreeFlags&6&&(t.flags|=8192)):Ic(t),n=t.updateQueue,n!==null&&Pc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&le(ma),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Gi(ra),Ic(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Rc(e,t){switch(Di(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Gi(ra),he(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return _e(t),null;case 31:if(t.memoizedState!==null){if(ao(t),t.alternate===null)throw Error(i(340));Ri()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ao(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Ri()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return le(oo),null;case 4:return he(),null;case 10:return Gi(t.type),null;case 22:case 23:return ao(t),Qa(),e!==null&&le(ma),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Gi(ra),null;case 25:return null;default:return null}}function zc(e,t){switch(Di(t),t.tag){case 3:Gi(ra),he();break;case 26:case 27:case 5:_e(t);break;case 4:he();break;case 31:t.memoizedState!==null&&ao(t);break;case 13:ao(t);break;case 19:le(oo);break;case 10:Gi(t.type);break;case 22:case 23:ao(t),Qa(),e!==null&&le(ma);break;case 24:Gi(ra)}}function Bc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Z(t,t.return,e)}}function Vc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Z(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Z(t,t.return,e)}}function Hc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{qa(t,n)}catch(t){Z(e,e.return,t)}}}function Uc(e,t,n){n.props=Ws(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Z(e,t,n)}}function Wc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Z(e,t,n)}}function Gc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Z(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Z(e,t,n)}else n.current=null}function Kc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Z(e,e.return,t)}}function qc(e,t,n){try{var r=e.stateNode;Fd(r,e.type,n,t),r[dt]=t}catch(t){Z(e,e.return,t)}}function Jc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zd(e.type)||e.tag===4}function Yc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Jc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Zd(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Xc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=nn));else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Xc(e,t,n),e=e.sibling;e!==null;)Xc(e,t,n),e=e.sibling}function Zc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Zc(e,t,n),e=e.sibling;e!==null;)Zc(e,t,n),e=e.sibling}function Qc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Pd(t,r,n),t[ut]=e,t[dt]=n}catch(t){Z(e,e.return,t)}}var $c=!1,el=!1,tl=!1,nl=typeof WeakSet==`function`?WeakSet:Set,rl=null;function il(e,t){if(e=e.containerInfo,Rd=sp,e=Tr(e),Er(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(zd={focusedElem:e,selectionRange:n},sp=!1,rl=t;rl!==null;)if(t=rl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,rl=e;else for(;rl!==null;){switch(t=rl,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Ws(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Z(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)ef(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:ef(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,rl=e;break}rl=t.return}}function al(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:bl(e,n),r&4&&Bc(5,n);break;case 1:if(bl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Z(n,n.return,e)}else{var i=Ws(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Z(n,n.return,e)}}r&64&&Hc(n),r&512&&Wc(n,n.return);break;case 3:if(bl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{qa(e,t)}catch(e){Z(n,n.return,e)}}break;case 27:t===null&&r&4&&Qc(n);case 26:case 5:bl(e,n),t===null&&r&4&&Kc(n),r&512&&Wc(n,n.return);break;case 12:bl(e,n);break;case 31:bl(e,n),r&4&&dl(e,n);break;case 13:bl(e,n),r&4&&fl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Ju.bind(null,n),sf(e,n))));break;case 22:if(r=n.memoizedState!==null||$c,!r){t=t!==null&&t.memoizedState!==null||el,i=$c;var a=el;$c=r,(el=t)&&!a?Sl(e,n,(n.subtreeFlags&8772)!=0):bl(e,n),$c=i,el=a}break;case 30:break;default:bl(e,n)}}function ol(e){var t=e.alternate;t!==null&&(e.alternate=null,ol(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&vt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var sl=null,cl=!1;function ll(e,t,n){for(n=n.child;n!==null;)ul(e,t,n),n=n.sibling}function ul(e,t,n){if(Be&&typeof Be.onCommitFiberUnmount==`function`)try{Be.onCommitFiberUnmount(ze,n)}catch{}switch(n.tag){case 26:el||Gc(n,t),ll(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:el||Gc(n,t);var r=sl,i=cl;Zd(n.type)&&(sl=n.stateNode,cl=!1),ll(e,t,n),pf(n.stateNode),sl=r,cl=i;break;case 5:el||Gc(n,t);case 6:if(r=sl,i=cl,sl=null,ll(e,t,n),sl=r,cl=i,sl!==null)if(cl)try{(sl.nodeType===9?sl.body:sl.nodeName===`HTML`?sl.ownerDocument.body:sl).removeChild(n.stateNode)}catch(e){Z(n,t,e)}else try{sl.removeChild(n.stateNode)}catch(e){Z(n,t,e)}break;case 18:sl!==null&&(cl?(e=sl,Qd(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Np(e)):Qd(sl,n.stateNode));break;case 4:r=sl,i=cl,sl=n.stateNode.containerInfo,cl=!0,ll(e,t,n),sl=r,cl=i;break;case 0:case 11:case 14:case 15:Vc(2,n,t),el||Vc(4,n,t),ll(e,t,n);break;case 1:el||(Gc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Uc(n,t,r)),ll(e,t,n);break;case 21:ll(e,t,n);break;case 22:el=(r=el)||n.memoizedState!==null,ll(e,t,n),el=r;break;default:ll(e,t,n)}}function dl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Np(e)}catch(e){Z(t,t.return,e)}}}function fl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Np(e)}catch(e){Z(t,t.return,e)}}function pl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new nl),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new nl),t;default:throw Error(i(435,e.tag))}}function ml(e,t){var n=pl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Yu.bind(null,e,t);t.then(r,r)}})}function hl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(Zd(c.type)){sl=c.stateNode,cl=!1;break a}break;case 5:sl=c.stateNode,cl=!1;break a;case 3:case 4:sl=c.stateNode.containerInfo,cl=!0;break a}c=c.return}if(sl===null)throw Error(i(160));ul(o,s,a),sl=null,cl=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)_l(t,e),t=t.sibling}var gl=null;function _l(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:hl(t,e),vl(e),r&4&&(Vc(3,e,e.return),Bc(3,e),Vc(5,e,e.return));break;case 1:hl(t,e),vl(e),r&512&&(el||n===null||Gc(n,n.return)),r&64&&$c&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=gl;if(hl(t,e),vl(e),r&512&&(el||n===null||Gc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[_t]||o[ut]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Pd(o,r,n),o[ut]=e,Ct(o),r=o;break a;case`link`:var s=Vf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Pd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Vf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Pd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[ut]=e,Ct(o),r=o}e.stateNode=r}else Hf(a,e.type,e.stateNode);else e.stateNode=If(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&qc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Hf(a,e.type,e.stateNode):If(a,r,e.memoizedProps))}break;case 27:hl(t,e),vl(e),r&512&&(el||n===null||Gc(n,n.return)),n!==null&&r&4&&qc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(hl(t,e),vl(e),r&512&&(el||n===null||Gc(n,n.return)),e.flags&32){a=e.stateNode;try{Jt(a,``)}catch(t){Z(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,qc(e,a,n===null?a:n.memoizedProps)),r&1024&&(tl=!0);break;case 6:if(hl(t,e),vl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Z(e,e.return,t)}}break;case 3:if(Bf=null,a=gl,gl=gf(t.containerInfo),hl(t,e),gl=a,vl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Np(t.containerInfo)}catch(t){Z(e,e.return,t)}tl&&(tl=!1,yl(e));break;case 4:r=gl,gl=gf(e.stateNode.containerInfo),hl(t,e),vl(e),gl=r;break;case 12:hl(t,e),vl(e);break;case 31:hl(t,e),vl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ml(e,r)));break;case 13:hl(t,e),vl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&($l=Ae()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ml(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=$c,d=el;if($c=u||a,el=d||l,hl(t,e),el=d,$c=u,vl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||$c||el||xl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Z(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Z(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?$d(m,!0):$d(l.stateNode,!1)}catch(e){Z(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,ml(e,n))));break;case 19:hl(t,e),vl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ml(e,r)));break;case 30:break;case 21:break;default:hl(t,e),vl(e)}}function vl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Jc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;Zc(e,Yc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Jt(o,``),n.flags&=-33),Zc(e,Yc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Xc(e,Yc(e),s);break;default:throw Error(i(161))}}catch(t){Z(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function yl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;yl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function bl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)al(e,t.alternate,t),t=t.sibling}function xl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Vc(4,t,t.return),xl(t);break;case 1:Gc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Uc(t,t.return,n),xl(t);break;case 27:pf(t.stateNode);case 26:case 5:Gc(t,t.return),xl(t);break;case 22:t.memoizedState===null&&xl(t);break;case 30:xl(t);break;default:xl(t)}e=e.sibling}}function Sl(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:Sl(i,a,n),Bc(4,a);break;case 1:if(Sl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Z(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Ka(c[i],s)}catch(e){Z(r,r.return,e)}}n&&o&64&&Hc(a),Wc(a,a.return);break;case 27:Qc(a);case 26:case 5:Sl(i,a,n),n&&r===null&&o&4&&Kc(a),Wc(a,a.return);break;case 12:Sl(i,a,n);break;case 31:Sl(i,a,n),n&&o&4&&dl(i,a);break;case 13:Sl(i,a,n),n&&o&4&&fl(i,a);break;case 22:a.memoizedState===null&&Sl(i,a,n),Wc(a,a.return);break;case 30:break;default:Sl(i,a,n)}t=t.sibling}}function Cl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&aa(n))}function wl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&aa(e))}function Tl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)El(e,t,n,r),t=t.sibling}function El(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Tl(e,t,n,r),i&2048&&Bc(9,t);break;case 1:Tl(e,t,n,r);break;case 3:Tl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&aa(e)));break;case 12:if(i&2048){Tl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Z(t,t.return,e)}}else Tl(e,t,n,r);break;case 31:Tl(e,t,n,r);break;case 13:Tl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Tl(e,t,n,r):(a._visibility|=2,Dl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?Tl(e,t,n,r):Ol(e,t),i&2048&&Cl(o,t);break;case 24:Tl(e,t,n,r),i&2048&&wl(t.alternate,t);break;default:Tl(e,t,n,r)}}function Dl(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Dl(a,o,s,c,i),Bc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Dl(a,o,s,c,i)):u._visibility&2?Dl(a,o,s,c,i):Ol(a,o),i&&l&2048&&Cl(o.alternate,o);break;case 24:Dl(a,o,s,c,i),i&&l&2048&&wl(o.alternate,o);break;default:Dl(a,o,s,c,i)}t=t.sibling}}function Ol(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Ol(n,r),i&2048&&Cl(r.alternate,r);break;case 24:Ol(n,r),i&2048&&wl(r.alternate,r);break;default:Ol(n,r)}t=t.sibling}}var kl=8192;function Al(e,t,n){if(e.subtreeFlags&kl)for(e=e.child;e!==null;)jl(e,t,n),e=e.sibling}function jl(e,t,n){switch(e.tag){case 26:Al(e,t,n),e.flags&kl&&e.memoizedState!==null&&Gf(n,gl,e.memoizedState,e.memoizedProps);break;case 5:Al(e,t,n);break;case 3:case 4:var r=gl;gl=gf(e.stateNode.containerInfo),Al(e,t,n),gl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=kl,kl=16777216,Al(e,t,n),kl=r):Al(e,t,n));break;default:Al(e,t,n)}}function Ml(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Nl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];rl=r,Il(r,e)}Ml(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Pl(e),e=e.sibling}function Pl(e){switch(e.tag){case 0:case 11:case 15:Nl(e),e.flags&2048&&Vc(9,e,e.return);break;case 3:Nl(e);break;case 12:Nl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Fl(e)):Nl(e);break;default:Nl(e)}}function Fl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];rl=r,Il(r,e)}Ml(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Vc(8,t,t.return),Fl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Fl(t));break;default:Fl(t)}e=e.sibling}}function Il(e,t){for(;rl!==null;){var n=rl;switch(n.tag){case 0:case 11:case 15:Vc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:aa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,rl=r;else a:for(n=e;rl!==null;){r=rl;var i=r.sibling,a=r.return;if(ol(r),r===n){rl=null;break a}if(i!==null){i.return=a,rl=i;break a}rl=a}}}var Ll={getCacheForType:function(e){var t=Zi(ra),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Zi(ra).controller.signal}},Rl=typeof WeakMap==`function`?WeakMap:Map,K=0,q=null,J=null,Y=0,X=0,zl=null,Bl=!1,Vl=!1,Hl=!1,Ul=0,Wl=0,Gl=0,Kl=0,ql=0,Jl=0,Yl=0,Xl=null,Zl=null,Ql=!1,$l=0,eu=0,tu=1/0,nu=null,ru=null,iu=0,au=null,ou=null,su=0,cu=0,lu=null,uu=null,du=0,fu=null;function pu(){return K&2&&Y!==0?Y&-Y:j.T===null?ct():dd()}function mu(){if(Jl===0)if(!(Y&536870912)||U){var e=qe;qe<<=1,!(qe&3932160)&&(qe=262144),Jl=e}else Jl=536870912;return e=$a.current,e!==null&&(e.flags|=32),Jl}function hu(e,t,n){(e===q&&(X===2||X===9)||e.cancelPendingCommit!==null)&&(Su(e,0),yu(e,Y,Jl,!1)),tt(e,n),(!(K&2)||e!==q)&&(e===q&&(!(K&2)&&(Kl|=n),Wl===4&&yu(e,Y,Jl,!1)),rd(e))}function gu(e,t,n){if(K&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||Ze(e,t),a=r?Au(e,t):Ou(e,t,!0),o=r;do{if(a===0){Vl&&!r&&yu(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!vu(n)){a=Ou(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=Xl;var l=c.current.memoizedState.isDehydrated;if(l&&(Su(c,s).flags|=256),s=Ou(c,s,!1),s!==2){if(Hl&&!l){c.errorRecoveryDisabledLanes|=o,Kl|=o,a=4;break a}o=Zl,Zl=a,o!==null&&(Zl===null?Zl=o:Zl.push.apply(Zl,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Su(e,0),yu(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:yu(r,t,Jl,!Bl);break a;case 2:Zl=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=$l+300-Ae(),10<a)){if(yu(r,t,Jl,!Bl),Xe(r,0,!0)!==0)break a;su=t,r.timeoutHandle=Kd(_u.bind(null,r,n,Zl,nu,Ql,t,Jl,Kl,Yl,Bl,o,`Throttled`,-0,0),a);break a}_u(r,n,Zl,nu,Ql,t,Jl,Kl,Yl,Bl,o,null,-0,0)}}break}while(1);rd(e)}function _u(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:nn},jl(t,a,d);var m=(a&62914560)===a?$l-Ae():(a&4194048)===a?eu-Ae():0;if(m=qf(d,m),m!==null){su=a,e.cancelPendingCommit=m(Lu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),yu(e,a,o,!l);return}}Lu(e,t,a,n,r,i,o,s,c)}function vu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!br(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function yu(e,t,n,r){t&=~ql,t&=~Kl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-He(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&rt(e,n,t)}function bu(){return K&6?!0:(id(0,!1),!1)}function xu(){if(J!==null){if(X===0)var e=J.return;else e=J,Ui=Hi=null,Eo(e),Oa=null,ka=0,e=J;for(;e!==null;)zc(e.alternate,e),e=e.return;J=null}}function Su(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,qd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),su=0,xu(),q=e,J=n=ci(e.current,null),Y=t,X=0,zl=null,Bl=!1,Vl=Ze(e,t),Hl=!1,Yl=Jl=ql=Kl=Gl=Wl=0,Zl=Xl=null,Ql=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-He(r),a=1<<i;t|=e[i],r&=~a}return Ul=t,Qr(),n}function Cu(e,t){W=null,j.H=Is,t===va||t===ba?(t=Ea(),X=3):t===ya?(t=Ea(),X=4):X=t===ec?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,zl=t,J===null&&(Wl=1,Js(e,H(t,e.current)))}function wu(){var e=$a.current;return e===null?!0:(Y&4194048)===Y?eo===null:(Y&62914560)===Y||Y&536870912?e===eo:!1}function Tu(){var e=j.H;return j.H=Is,e===null?Is:e}function Eu(){var e=j.A;return j.A=Ll,e}function Du(){Wl=4,Bl||(Y&4194048)!==Y&&$a.current!==null||(Vl=!0),!(Gl&134217727)&&!(Kl&134217727)||q===null||yu(q,Y,Jl,!1)}function Ou(e,t,n){var r=K;K|=2;var i=Tu(),a=Eu();(q!==e||Y!==t)&&(nu=null,Su(e,t)),t=!1;var o=Wl;a:do try{if(X!==0&&J!==null){var s=J,c=zl;switch(X){case 8:xu(),o=6;break a;case 3:case 2:case 9:case 6:$a.current===null&&(t=!0);var l=X;if(X=0,zl=null,Pu(e,s,c,l),n&&Vl){o=0;break a}break;default:l=X,X=0,zl=null,Pu(e,s,c,l)}}ku(),o=Wl;break}catch(t){Cu(e,t)}while(1);return t&&e.shellSuspendCounter++,Ui=Hi=null,K=r,j.H=i,j.A=a,J===null&&(q=null,Y=0,Qr()),o}function ku(){for(;J!==null;)Mu(J)}function Au(e,t){var n=K;K|=2;var r=Tu(),a=Eu();q!==e||Y!==t?(nu=null,tu=Ae()+500,Su(e,t)):Vl=Ze(e,t);a:do try{if(X!==0&&J!==null){t=J;var o=zl;b:switch(X){case 1:X=0,zl=null,Pu(e,t,o,1);break;case 2:case 9:if(Sa(o)){X=0,zl=null,Nu(t);break}t=function(){X!==2&&X!==9||q!==e||(X=7),rd(e)},o.then(t,t);break a;case 3:X=7;break a;case 4:X=5;break a;case 7:Sa(o)?(X=0,zl=null,Nu(t)):(X=0,zl=null,Pu(e,t,o,7));break;case 5:var s=null;switch(J.tag){case 26:s=J.memoizedState;case 5:case 27:var c=J;if(s?Wf(s):c.stateNode.complete){X=0,zl=null;var l=c.sibling;if(l!==null)J=l;else{var u=c.return;u===null?J=null:(J=u,Fu(u))}break b}}X=0,zl=null,Pu(e,t,o,5);break;case 6:X=0,zl=null,Pu(e,t,o,6);break;case 8:xu(),Wl=6;break a;default:throw Error(i(462))}}ju();break}catch(t){Cu(e,t)}while(1);return Ui=Hi=null,j.H=r,j.A=a,K=n,J===null?(q=null,Y=0,Qr(),Wl):0}function ju(){for(;J!==null&&!Oe();)Mu(J)}function Mu(e){var t=Ac(e.alternate,e,Ul);e.memoizedProps=e.pendingProps,t===null?Fu(e):J=t}function Nu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=mc(n,t,t.pendingProps,t.type,void 0,Y);break;case 11:t=mc(n,t,t.pendingProps,t.type.render,t.ref,Y);break;case 5:Eo(t);default:zc(n,t),t=J=li(t,Ul),t=Ac(n,t,Ul)}e.memoizedProps=e.pendingProps,t===null?Fu(e):J=t}function Pu(e,t,n,r){Ui=Hi=null,Eo(t),Oa=null,ka=0;var i=t.return;try{if($s(e,i,t,n,Y)){Wl=1,Js(e,H(n,e.current)),J=null;return}}catch(t){if(i!==null)throw J=i,t;Wl=1,Js(e,H(n,e.current)),J=null;return}t.flags&32768?(U||r===1?e=!0:Vl||Y&536870912?e=!1:(Bl=e=!0,(r===2||r===9||r===3||r===6)&&(r=$a.current,r!==null&&r.tag===13&&(r.flags|=16384))),Iu(t,e)):Fu(t)}function Fu(e){var t=e;do{if(t.flags&32768){Iu(t,Bl);return}e=t.return;var n=Lc(t.alternate,t,Ul);if(n!==null){J=n;return}if(t=t.sibling,t!==null){J=t;return}J=t=e}while(t!==null);Wl===0&&(Wl=5)}function Iu(e,t){do{var n=Rc(e.alternate,e);if(n!==null){n.flags&=32767,J=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){J=e;return}J=e=n}while(e!==null);Wl=6,J=null}function Lu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Hu();while(iu!==0);if(K&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Zr,nt(e,n,o,s,c,l),e===q&&(J=q=null,Y=0),ou=t,au=e,su=n,cu=o,lu=a,uu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Xu(Pe,function(){return Uu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=j.T,j.T=null,a=M.p,M.p=2,s=K,K|=4;try{il(e,t,n)}finally{K=s,M.p=a,j.T=r}}iu=1,Ru(),zu(),Bu()}}function Ru(){if(iu===1){iu=0;var e=au,t=ou,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=j.T,j.T=null;var r=M.p;M.p=2;var i=K;K|=4;try{_l(t,e);var a=zd,o=Tr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&wr(s.ownerDocument.documentElement,s)){if(c!==null&&Er(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Cr(s,h),v=Cr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}sp=!!Rd,zd=Rd=null}finally{K=i,M.p=r,j.T=n}}e.current=t,iu=2}}function zu(){if(iu===2){iu=0;var e=au,t=ou,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=j.T,j.T=null;var r=M.p;M.p=2;var i=K;K|=4;try{al(e,t.alternate,t)}finally{K=i,M.p=r,j.T=n}}iu=3}}function Bu(){if(iu===4||iu===3){iu=0,ke();var e=au,t=ou,n=su,r=uu;t.subtreeFlags&10256||t.flags&10256?iu=5:(iu=0,ou=au=null,Vu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(ru=null),st(n),t=t.stateNode,Be&&typeof Be.onCommitFiberRoot==`function`)try{Be.onCommitFiberRoot(ze,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=j.T,i=M.p,M.p=2,j.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{j.T=t,M.p=i}}su&3&&Hu(),rd(e),i=e.pendingLanes,n&261930&&i&42?e===fu?du++:(du=0,fu=e):du=0,id(0,!1)}}function Vu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,aa(t)))}function Hu(){return Ru(),zu(),Bu(),Uu()}function Uu(){if(iu!==5)return!1;var e=au,t=cu;cu=0;var n=st(su),r=j.T,a=M.p;try{M.p=32>n?32:n,j.T=null,n=lu,lu=null;var o=au,s=su;if(iu=0,ou=au=null,su=0,K&6)throw Error(i(331));var c=K;if(K|=4,Pl(o.current),El(o,o.current,s,n),K=c,id(0,!1),Be&&typeof Be.onPostCommitFiberRoot==`function`)try{Be.onPostCommitFiberRoot(ze,o)}catch{}return!0}finally{M.p=a,j.T=r,Vu(e,t)}}function Wu(e,t,n){t=H(n,t),t=Xs(e.stateNode,t,2),e=Ba(e,t,2),e!==null&&(tt(e,2),rd(e))}function Z(e,t,n){if(e.tag===3)Wu(e,e,n);else for(;t!==null;){if(t.tag===3){Wu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(ru===null||!ru.has(r))){e=H(n,e),n=Zs(2),r=Ba(t,n,2),r!==null&&(Qs(n,r,t,e),tt(r,2),rd(r));break}}t=t.return}}function Gu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Rl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Hl=!0,i.add(n),e=Ku.bind(null,e,t,n),t.then(e,e))}function Ku(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,q===e&&(Y&n)===n&&(Wl===4||Wl===3&&(Y&62914560)===Y&&300>Ae()-$l?!(K&2)&&Su(e,0):ql|=n,Yl===Y&&(Yl=0)),rd(e)}function qu(e,t){t===0&&(t=$e()),e=ti(e,t),e!==null&&(tt(e,t),rd(e))}function Ju(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),qu(e,n)}function Yu(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),qu(e,n)}function Xu(e,t){return Ee(e,t)}var Zu=null,Qu=null,$u=!1,ed=!1,td=!1,nd=0;function rd(e){e!==Qu&&e.next===null&&(Qu===null?Zu=Qu=e:Qu=Qu.next=e),ed=!0,$u||($u=!0,ud())}function id(e,t){if(!td&&ed){td=!0;do for(var n=!1,r=Zu;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-He(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,ld(r,a))}else a=Y,a=Xe(r,r===q?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Ze(r,a)||(n=!0,ld(r,a));r=r.next}while(n);td=!1}}function ad(){od()}function od(){ed=$u=!1;var e=0;nd!==0&&Gd()&&(e=nd);for(var t=Ae(),n=null,r=Zu;r!==null;){var i=r.next,a=sd(r,t);a===0?(r.next=null,n===null?Zu=i:n.next=i,i===null&&(Qu=n)):(n=r,(e!==0||a&3)&&(ed=!0)),r=i}iu!==0&&iu!==5||id(e,!1),nd!==0&&(nd=0)}function sd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-He(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Qe(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=q,n=Y,n=Xe(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(X===2||X===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&De(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Ze(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&De(r),st(n)){case 2:case 8:n=Ne;break;case 32:n=Pe;break;case 268435456:n=Ie;break;default:n=Pe}return r=cd.bind(null,e),n=Ee(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&De(r),e.callbackPriority=2,e.callbackNode=null,2}function cd(e,t){if(iu!==0&&iu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Hu()&&e.callbackNode!==n)return null;var r=Y;return r=Xe(e,e===q?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(gu(e,r,t),sd(e,Ae()),e.callbackNode!=null&&e.callbackNode===n?cd.bind(null,e):null)}function ld(e,t){if(Hu())return null;gu(e,t,!0)}function ud(){Yd(function(){K&6?Ee(Me,ad):od()})}function dd(){if(nd===0){var e=ca;e===0&&(e=Ke,Ke<<=1,!(Ke&261888)&&(Ke=256)),nd=e}return nd}function fd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:tn(``+e)}function pd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function md(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=fd((i[dt]||null).action),o=r.submitter;o&&(t=(t=o[dt]||null)?fd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Cn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(nd!==0){var e=o?pd(i,o):new FormData(i);Ss(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?pd(i,o):new FormData(i),Ss(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var hd=0;hd<Kr.length;hd++){var gd=Kr[hd];qr(gd.toLowerCase(),`on`+(gd[0].toUpperCase()+gd.slice(1)))}qr(Rr,`onAnimationEnd`),qr(zr,`onAnimationIteration`),qr(Br,`onAnimationStart`),qr(`dblclick`,`onDoubleClick`),qr(`focusin`,`onFocus`),qr(`focusout`,`onBlur`),qr(Vr,`onTransitionRun`),qr(Hr,`onTransitionStart`),qr(Ur,`onTransitionCancel`),qr(Wr,`onTransitionEnd`),Dt(`onMouseEnter`,[`mouseout`,`mouseover`]),Dt(`onMouseLeave`,[`mouseout`,`mouseover`]),Dt(`onPointerEnter`,[`pointerout`,`pointerover`]),Dt(`onPointerLeave`,[`pointerout`,`pointerover`]),Et(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Et(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Et(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Et(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Et(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Et(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var _d=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),vd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(_d));function yd(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Jr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Jr(e)}i.currentTarget=null,a=c}}}}function Q(e,t){var n=t[pt];n===void 0&&(n=t[pt]=new Set);var r=e+`__bubble`;n.has(r)||(Cd(t,e,2,!1),n.add(r))}function bd(e,t,n){var r=0;t&&(r|=4),Cd(n,e,r,t)}var xd=`_reactListening`+Math.random().toString(36).slice(2);function Sd(e){if(!e[xd]){e[xd]=!0,wt.forEach(function(t){t!==`selectionchange`&&(vd.has(t)||bd(t,!1,e),bd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[xd]||(t[xd]=!0,bd(`selectionchange`,!1,t))}}function Cd(e,t,n,r){switch(mp(t)){case 2:var i=cp;break;case 8:i=lp;break;default:i=up}n=i.bind(null,t,n,e),i=void 0,!fn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function wd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=yt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}un(function(){var r=a,i=an(n),s=[];a:{var c=Gr.get(e);if(c!==void 0){var l=Cn,u=e;switch(e){case`keypress`:if(vn(n)===0)break a;case`keydown`:case`keyup`:l=Bn;break;case`focusin`:u=`focus`,l=Mn;break;case`focusout`:u=`blur`,l=Mn;break;case`beforeblur`:case`afterblur`:l=Mn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=An;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=jn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Hn;break;case Rr:case zr:case Br:l=Nn;break;case Wr:l=R;break;case`scroll`:case`scrollend`:l=Tn;break;case`wheel`:l=Un;break;case`copy`:case`cut`:case`paste`:l=Pn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Vn;break;case`toggle`:case`beforetoggle`:l=Wn}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=dn(m,p),g!=null&&d.push(Td(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==rn&&(u=n.relatedTarget||n.fromElement)&&(yt(u)||u[ft]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?yt(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=An,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Vn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:xt(l),h=u==null?c:xt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,yt(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Dd,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Od(s,c,l,d,!1),u!==null&&f!==null&&Od(s,f,u,d,!0)}}a:{if(c=r?xt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=cr;else if(nr(c))if(lr)v=vr;else{v=gr;var y=hr}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Qt(r.elementType)&&(v=cr):v=_r;if(v&&=v(e,r)){rr(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Wt(c,`number`,c.value)}switch(y=r?xt(r):window,e){case`focusin`:(nr(y)||y.contentEditable===`true`)&&(Or=y,kr=r,Ar=null);break;case`focusout`:Ar=kr=Or=null;break;case`mousedown`:jr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:jr=!1,Mr(s,n,i);break;case`selectionchange`:if(Dr)break;case`keydown`:case`keyup`:Mr(s,n,i)}var b;if(Kn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else Qn?Xn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Jn&&n.locale!==`ko`&&(Qn||x!==`onCompositionStart`?x===`onCompositionEnd`&&Qn&&(b=_n()):(mn=i,hn=`value`in mn?mn.value:mn.textContent,Qn=!0)),y=Ed(r,x),0<y.length&&(x=new Fn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=Zn(n),b!==null&&(x.data=b)))),(b=z?$n(e,n):er(e,n))&&(x=Ed(r,`onBeforeInput`),0<x.length&&(y=new Fn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),md(s,e,r,n,i)}yd(s,t)})}function Td(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ed(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=dn(e,n),i!=null&&r.unshift(Td(e,i,a)),i=dn(e,t),i!=null&&r.push(Td(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Dd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Od(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=dn(n,a),l!=null&&o.unshift(Td(n,l,c))):i||(l=dn(n,a),l!=null&&o.push(Td(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var kd=/\r\n?/g,Ad=/\u0000|\uFFFD/g;function jd(e){return(typeof e==`string`?e:``+e).replace(kd,`
9
+ `).replace(Ad,``)}function Md(e,t){return t=jd(t),jd(e)===t}function $(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Jt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Jt(e,``+r);break;case`className`:Mt(e,`class`,r);break;case`tabIndex`:Mt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Mt(e,n,r);break;case`style`:Zt(e,r,o);break;case`data`:if(t!==`object`){Mt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=tn(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&$(e,t,`name`,a.name,a,null),$(e,t,`formEncType`,a.formEncType,a,null),$(e,t,`formMethod`,a.formMethod,a,null),$(e,t,`formTarget`,a.formTarget,a,null)):($(e,t,`encType`,a.encType,a,null),$(e,t,`method`,a.method,a,null),$(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=tn(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=nn);break;case`onScroll`:r!=null&&Q(`scroll`,e);break;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=tn(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Q(`beforetoggle`,e),Q(`toggle`,e),jt(e,`popover`,r);break;case`xlinkActuate`:Nt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Nt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Nt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Nt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Nt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Nt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Nt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Nt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Nt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:jt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=$t.get(n)||n,jt(e,n,r))}}function Nd(e,t,n,r,a,o){switch(n){case`style`:Zt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Jt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Jt(e,``+r);break;case`onScroll`:r!=null&&Q(`scroll`,e);break;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=nn);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!Tt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[dt]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):jt(e,n,r)}}}function Pd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Q(`error`,e),Q(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:$(e,t,o,s,n,null)}}a&&$(e,t,`srcSet`,n.srcSet,n,null),r&&$(e,t,`src`,n.src,n,null);return;case`input`:Q(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:$(e,t,r,d,n,null)}}Ut(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Q(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:$(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Gt(e,!!r,n,!0):Gt(e,!!r,t,!1);return;case`textarea`:for(s in Q(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:$(e,t,s,c,n,null)}qt(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:$(e,t,l,r,n,null)}return;case`dialog`:Q(`beforetoggle`,e),Q(`toggle`,e),Q(`cancel`,e),Q(`close`,e);break;case`iframe`:case`object`:Q(`load`,e);break;case`video`:case`audio`:for(r=0;r<_d.length;r++)Q(_d[r],e);break;case`image`:Q(`error`,e),Q(`load`,e);break;case`details`:Q(`toggle`,e);break;case`embed`:case`source`:case`link`:Q(`error`,e),Q(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:$(e,t,u,r,n,null)}return;default:if(Qt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Nd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&$(e,t,c,r,n,null))}function Fd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||$(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&$(e,t,p,m,r,f)}}Ht(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||$(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&$(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Gt(e,!!n,n?[]:``,!1):Gt(e,!!n,t,!0)):Gt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:$(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&$(e,t,s,a,r,o)}Kt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:$(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:$(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&$(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:$(e,t,u,p,r,m)}return;default:if(Qt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Nd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Nd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&$(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||$(e,t,f,p,r,m)}function Id(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Ld(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Id(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Id(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Rd=null,zd=null;function Bd(e){return e.nodeType===9?e:e.ownerDocument}function Vd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Hd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Ud(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Wd=null;function Gd(){var e=window.event;return e&&e.type===`popstate`?e===Wd?!1:(Wd=e,!0):(Wd=null,!1)}var Kd=typeof setTimeout==`function`?setTimeout:void 0,qd=typeof clearTimeout==`function`?clearTimeout:void 0,Jd=typeof Promise==`function`?Promise:void 0,Yd=typeof queueMicrotask==`function`?queueMicrotask:Jd===void 0?Kd:function(e){return Jd.resolve(null).then(e).catch(Xd)};function Xd(e){setTimeout(function(){throw e})}function Zd(e){return e===`head`}function Qd(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Np(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)pf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,pf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[_t]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&pf(e.ownerDocument.body);n=i}while(n);Np(t)}function $d(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function ef(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:ef(n),vt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function tf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[_t])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=cf(e.nextSibling),e===null)break}return null}function nf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=cf(e.nextSibling),e===null))return null;return e}function rf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=cf(e.nextSibling),e===null))return null;return e}function af(e){return e.data===`$?`||e.data===`$~`}function of(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function sf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function cf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var lf=null;function uf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return cf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function df(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function ff(e,t,n){switch(t=Bd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function pf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);vt(e)}var mf=new Map,hf=new Set;function gf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var _f=M.d;M.d={f:vf,r:yf,D:Sf,C:Cf,L:wf,m:Tf,X:Df,S:Ef,M:Of};function vf(){var e=_f.f(),t=bu();return e||t}function yf(e){var t=bt(e);t!==null&&t.tag===5&&t.type===`form`?ws(t):_f.r(e)}var bf=typeof document>`u`?null:document;function xf(e,t,n){var r=bf;if(r&&typeof t==`string`&&t){var i=Vt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),hf.has(i)||(hf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Pd(t,`link`,e),Ct(t),r.head.appendChild(t)))}}function Sf(e){_f.D(e),xf(`dns-prefetch`,e,null)}function Cf(e,t){_f.C(e,t),xf(`preconnect`,e,t)}function wf(e,t,n){_f.L(e,t,n);var r=bf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Vt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Vt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Vt(n.imageSizes)+`"]`)):i+=`[href="`+Vt(e)+`"]`;var a=i;switch(t){case`style`:a=Af(e);break;case`script`:a=Pf(e)}mf.has(a)||(e=h({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),mf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(jf(a))||t===`script`&&r.querySelector(Ff(a))||(t=r.createElement(`link`),Pd(t,`link`,e),Ct(t),r.head.appendChild(t)))}}function Tf(e,t){_f.m(e,t);var n=bf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Vt(r)+`"][href="`+Vt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Pf(e)}if(!mf.has(a)&&(e=h({rel:`modulepreload`,href:e},t),mf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Ff(a)))return}r=n.createElement(`link`),Pd(r,`link`,e),Ct(r),n.head.appendChild(r)}}}function Ef(e,t,n){_f.S(e,t,n);var r=bf;if(r&&e){var i=St(r).hoistableStyles,a=Af(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(jf(a)))s.loading=5;else{e=h({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=mf.get(a))&&Rf(e,n);var c=o=r.createElement(`link`);Ct(c),Pd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Lf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Df(e,t){_f.X(e,t);var n=bf;if(n&&e){var r=St(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=h({src:e,async:!0},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),Ct(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Of(e,t){_f.M(e,t);var n=bf;if(n&&e){var r=St(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=h({src:e,async:!0,type:`module`},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),Ct(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t,n,r){var a=(a=fe.current)?gf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Af(n.href),n=St(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Af(n.href);var o=St(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(jf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),mf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},mf.set(e,n),o||Nf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Pf(n),n=St(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Af(e){return`href="`+Vt(e)+`"`}function jf(e){return`link[rel="stylesheet"][`+e+`]`}function Mf(e){return h({},e,{"data-precedence":e.precedence,precedence:null})}function Nf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Pd(t,`link`,n),Ct(t),e.head.appendChild(t))}function Pf(e){return`[src="`+Vt(e)+`"]`}function Ff(e){return`script[async]`+e}function If(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Vt(n.href)+`"]`);if(r)return t.instance=r,Ct(r),r;var a=h({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Ct(r),Pd(r,`style`,a),Lf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Af(n.href);var o=e.querySelector(jf(a));if(o)return t.state.loading|=4,t.instance=o,Ct(o),o;r=Mf(n),(a=mf.get(a))&&Rf(r,a),o=(e.ownerDocument||e).createElement(`link`),Ct(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Pd(o,`link`,r),t.state.loading|=4,Lf(o,n.precedence,e),t.instance=o;case`script`:return o=Pf(n.src),(a=e.querySelector(Ff(o)))?(t.instance=a,Ct(a),a):(r=n,(a=mf.get(o))&&(r=h({},n),zf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Ct(a),Pd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Lf(r,n.precedence,e));return t.instance}function Lf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Rf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function zf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Bf=null;function Vf(e,t,n){if(Bf===null){var r=new Map,i=Bf=new Map;i.set(n,r)}else i=Bf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[_t]||a[ut]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Hf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Uf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Wf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Gf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Af(r.href),a=t.querySelector(jf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Jf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Ct(a);return}a=t.ownerDocument||t,r=Mf(r),(i=mf.get(i))&&Rf(r,i),a=a.createElement(`link`),Ct(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Pd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Jf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Kf=0;function qf(e,t){return e.stylesheets&&e.count===0&&Xf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Kf===0&&(Kf=62500*Ld());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Kf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Jf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Yf=null;function Xf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yf=new Map,t.forEach(Zf,e),Yf=null,Jf.call(e))}function Zf(e,t){if(!(t.state.loading&4)){var n=Yf.get(e);if(n)var r=n.get(null);else{n=new Map,Yf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=Jf.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Qf={$$typeof:C,Provider:null,Consumer:null,_currentValue:ae,_currentValue2:ae,_threadCount:0};function $f(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=et(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=et(0),this.hiddenUpdates=et(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function ep(e,t,n,r,i,a,o,s,c,l,u,d){return e=new $f(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=oi(3,null,null,t),e.current=a,a.stateNode=e,t=ia(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},La(a),e}function tp(e){return e?(e=ii,e):ii}function np(e,t,n,r,i,a){i=tp(i),r.context===null?r.context=i:r.pendingContext=i,r=za(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ba(e,r,t),n!==null&&(hu(n,e,t),Va(n,e,t))}function rp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ip(e,t){rp(e,t),(e=e.alternate)&&rp(e,t)}function ap(e){if(e.tag===13||e.tag===31){var t=ti(e,67108864);t!==null&&hu(t,e,67108864),ip(e,67108864)}}function op(e){if(e.tag===13||e.tag===31){var t=pu();t=ot(t);var n=ti(e,t);n!==null&&hu(n,e,t),ip(e,t)}}var sp=!0;function cp(e,t,n,r){var i=j.T;j.T=null;var a=M.p;try{M.p=2,up(e,t,n,r)}finally{M.p=a,j.T=i}}function lp(e,t,n,r){var i=j.T;j.T=null;var a=M.p;try{M.p=8,up(e,t,n,r)}finally{M.p=a,j.T=i}}function up(e,t,n,r){if(sp){var i=dp(r);if(i===null)wd(e,t,r,fp,n),Cp(e,r);else if(Tp(i,e,t,n,r))r.stopPropagation();else if(Cp(e,r),t&4&&-1<Sp.indexOf(e)){for(;i!==null;){var a=bt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ye(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-He(o);s.entanglements[1]|=c,o&=~c}rd(a),!(K&6)&&(tu=Ae()+500,id(0,!1))}}break;case 31:case 13:s=ti(a,2),s!==null&&hu(s,a,2),bu(),ip(a,2)}if(a=dp(r),a===null&&wd(e,t,r,fp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else wd(e,t,r,null,n)}}function dp(e){return e=an(e),pp(e)}var fp=null;function pp(e){if(fp=null,e=yt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return fp=e,null}function mp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(je()){case Me:return 2;case Ne:return 8;case Pe:case Fe:return 32;case Ie:return 268435456;default:return 32}default:return 32}}var hp=!1,gp=null,_p=null,vp=null,yp=new Map,bp=new Map,xp=[],Sp=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Cp(e,t){switch(e){case`focusin`:case`focusout`:gp=null;break;case`dragenter`:case`dragleave`:_p=null;break;case`mouseover`:case`mouseout`:vp=null;break;case`pointerover`:case`pointerout`:yp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:bp.delete(t.pointerId)}}function wp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=bt(t),t!==null&&ap(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Tp(e,t,n,r,i){switch(t){case`focusin`:return gp=wp(gp,e,t,n,r,i),!0;case`dragenter`:return _p=wp(_p,e,t,n,r,i),!0;case`mouseover`:return vp=wp(vp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return yp.set(a,wp(yp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,bp.set(a,wp(bp.get(a)||null,e,t,n,r,i)),!0}return!1}function Ep(e){var t=yt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,P(e.priority,function(){op(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,P(e.priority,function(){op(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Dp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=dp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);rn=r,n.target.dispatchEvent(r),rn=null}else return t=bt(n),t!==null&&ap(t),e.blockedOn=n,!1;t.shift()}return!0}function Op(e,t,n){Dp(e)&&n.delete(t)}function kp(){hp=!1,gp!==null&&Dp(gp)&&(gp=null),_p!==null&&Dp(_p)&&(_p=null),vp!==null&&Dp(vp)&&(vp=null),yp.forEach(Op),bp.forEach(Op)}function Ap(e,n){e.blockedOn===n&&(e.blockedOn=null,hp||(hp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,kp)))}var jp=null;function Mp(e){jp!==e&&(jp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){jp===e&&(jp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(pp(r||n)===null)continue;break}var a=bt(n);a!==null&&(e.splice(t,3),t-=3,Ss(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Np(e){function t(t){return Ap(t,e)}gp!==null&&Ap(gp,e),_p!==null&&Ap(_p,e),vp!==null&&Ap(vp,e),yp.forEach(t),bp.forEach(t);for(var n=0;n<xp.length;n++){var r=xp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<xp.length&&(n=xp[0],n.blockedOn===null);)Ep(n),n.blockedOn===null&&xp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[dt]||null;if(typeof a==`function`)o||Mp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[dt]||null)s=o.formAction;else if(pp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Mp(n)}}}function Pp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Fp(e){this._internalRoot=e}Ip.prototype.render=Fp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;np(n,pu(),e,t,null,null)},Ip.prototype.unmount=Fp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;np(e.current,2,null,e,null,null),bu(),t[ft]=null}};function Ip(e){this._internalRoot=e}Ip.prototype.unstable_scheduleHydration=function(e){if(e){var t=ct();e={blockedOn:null,target:e,priority:t};for(var n=0;n<xp.length&&t!==0&&t<xp[n].priority;n++);xp.splice(n,0,e),n===0&&Ep(e)}};var Lp=n.version;if(Lp!==`19.2.6`)throw Error(i(527,Lp,`19.2.6`));M.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=d(t),e=e===null?null:p(e),e=e===null?null:e.stateNode,e};var Rp={bundleType:0,version:`19.2.6`,rendererPackageName:`react-dom`,currentDispatcherRef:j,reconcilerVersion:`19.2.6`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var zp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zp.isDisabled&&zp.supportsFiber)try{ze=zp.inject(Rp),Be=zp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Gs,s=Ks,c=qs;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=ep(e,1,!1,null,null,n,r,null,o,s,c,Pp),e[ft]=t.current,Sd(e),new Fp(t)}})),g=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=h()})),_=`modulepreload`,v=function(e){return`/`+e},y={},b=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=v(t,n),t in y)return;y[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:_,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},x=c(u(),1),S=`popstate`;function C(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function w(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return O(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:k(t)}return te(t,n,null,e)}function T(e,t){if(e===!1||e==null)throw Error(t)}function E(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function ee(){return Math.random().toString(36).substring(2,10)}function D(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function O(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?A(t):t,state:n,key:t&&t.key||r||ee(),mask:i}}function k({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function A(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function te(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=C(e)?e:O(h.location,e,t);n&&n(r,e),l=u()+1;let d=D(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=C(e)?e:O(h.location,e,t);n&&n(r,e),l=u();let i=D(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return ne(e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(S,d),c=e,()=>{i.removeEventListener(S,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function ne(e,t=!1){let n=`http://localhost`;typeof window<`u`&&(n=window.location.origin===`null`?window.location.href:window.location.origin),T(n,`No window.location.(origin|href) available to create URL`);let r=typeof e==`string`?e:k(e);return r=r.replace(/ $/,`%20`),!t&&r.startsWith(`//`)&&(r=n+r),new URL(r,n)}function re(e,t,n=`/`){return ie(e,t,n,!1)}function ie(e,t,n,r,i){let a=be((typeof t==`string`?A(t):t).pathname||`/`,n);if(a==null)return null;let o=i??M(e),s=null,c=ye(a);for(let e=0;s==null&&e<o.length;++e)s=ge(o[e],c,r);return s}function j(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function M(e){let t=ae(e);return se(t),t}function ae(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;T(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=ke([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(T(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),ae(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:me(l,e.index),routesMeta:u})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of oe(e.path))a(e,t,!0,n)}),t}function oe(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=oe(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function se(e){e.sort((e,t)=>e.score===t.score?he(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var ce=/^:[\w-]+$/,le=3,N=2,ue=1,de=10,fe=-2,pe=e=>e===`*`;function me(e,t){let n=e.split(`/`),r=n.length;return n.some(pe)&&(r+=fe),t&&(r+=N),n.filter(e=>!pe(e)).reduce((e,t)=>e+(ce.test(t)?le:t===``?ue:de),r)}function he(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function ge(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u=_e({path:s.relativePath,caseSensitive:s.caseSensitive,end:c},l),d=s.route;if(!u&&c&&n&&!r[r.length-1].route.index&&(u=_e({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!u)return null;Object.assign(i,u.params),o.push({params:i,pathname:ke([a,u.pathname]),pathnameBase:je(ke([a,u.pathnameBase])),route:d}),u.pathnameBase!==`/`&&(a=ke([a,u.pathnameBase]))}return o}function _e(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=ve(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function ve(e,t=!1,n=!0){E(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function ye(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return E(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function be(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}var xe=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function Se(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?A(e):e,a;return n?(n=Oe(n),a=n.startsWith(`/`)?Ce(n.substring(1),`/`):Ce(n,t)):a=t,{pathname:a,search:Me(r),hash:Ne(i)}}function Ce(e,t){let n=Ae(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function we(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Te(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Ee(e){let t=Te(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function De(e,t,n,r=!1){let i;typeof e==`string`?i=A(e):(i={...e},T(!i.pathname||!i.pathname.includes(`?`),we(`?`,`pathname`,`search`,i)),T(!i.pathname||!i.pathname.includes(`#`),we(`#`,`pathname`,`hash`,i)),T(!i.search||!i.search.includes(`#`),we(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=Se(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var Oe=e=>e.replace(/\/\/+/g,`/`),ke=e=>Oe(e.join(`/`)),Ae=e=>e.replace(/\/+$/,``),je=e=>Ae(e).replace(/^\/*/,`/`),Me=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Ne=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Pe=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Fe(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Ie(e){return ke(e.map(e=>e.route.path).filter(Boolean))||`/`}var Le=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Re(e,t){let n=e;if(typeof n!=`string`||!xe.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Le)try{let e=new URL(window.location.href),r=n.startsWith(`//`)?new URL(e.protocol+n):new URL(n),a=be(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{E(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var ze=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(ze);var Be=[`GET`,...ze];new Set(Be);var Ve=x.createContext(null);Ve.displayName=`DataRouter`;var He=x.createContext(null);He.displayName=`DataRouterState`;var Ue=x.createContext(!1);function We(){return x.useContext(Ue)}var Ge=x.createContext({isTransitioning:!1});Ge.displayName=`ViewTransition`;var Ke=x.createContext(new Map);Ke.displayName=`Fetchers`;var qe=x.createContext(null);qe.displayName=`Await`;var Je=x.createContext(null);Je.displayName=`Navigation`;var Ye=x.createContext(null);Ye.displayName=`Location`;var Xe=x.createContext({outlet:null,matches:[],isDataRoute:!1});Xe.displayName=`Route`;var Ze=x.createContext(null);Ze.displayName=`RouteError`;var Qe=`REACT_ROUTER_ERROR`,$e=`REDIRECT`,et=`ROUTE_ERROR_RESPONSE`;function tt(e){if(e.startsWith(`${Qe}:${$e}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function nt(e){if(e.startsWith(`${Qe}:${et}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new Pe(t.status,t.statusText,t.data)}catch{}}function rt(e,{relative:t}={}){T(it(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=x.useContext(Je),{hash:i,pathname:a,search:o}=lt(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:ke([n,a])),r.createHref({pathname:s,search:o,hash:i})}function it(){return x.useContext(Ye)!=null}function at(){return T(it(),`useLocation() may be used only in the context of a <Router> component.`),x.useContext(Ye).location}var ot=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function st(e){x.useContext(Je).static||x.useLayoutEffect(e)}function ct(){let{isDataRoute:e}=x.useContext(Xe);return e?Dt():P()}function P(){T(it(),`useNavigate() may be used only in the context of a <Router> component.`);let e=x.useContext(Ve),{basename:t,navigator:n}=x.useContext(Je),{matches:r}=x.useContext(Xe),{pathname:i}=at(),a=JSON.stringify(Ee(r)),o=x.useRef(!1);return st(()=>{o.current=!0}),x.useCallback((r,s={})=>{if(E(o.current,ot),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=De(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:ke([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}x.createContext(null);function lt(e,{relative:t}={}){let{matches:n}=x.useContext(Xe),{pathname:r}=at(),i=JSON.stringify(Ee(n));return x.useMemo(()=>De(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function ut(e,t,n){T(it(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=x.useContext(Je),{matches:i}=x.useContext(Xe),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;kt(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
10
+
11
+ Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=at(),d;if(t){let e=typeof t==`string`?A(t):t;T(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):re(e,{pathname:p});E(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),E(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let h=_t(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:ke([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:ke([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?x.createElement(Ye.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...d},navigationType:`POP`}},h):h}function dt(){let e=Et(),t=Fe(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=x.createElement(x.Fragment,null,x.createElement(`p`,null,`💿 Hey developer 👋`),x.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,x.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,x.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),x.createElement(x.Fragment,null,x.createElement(`h2`,null,`Unexpected Application Error!`),x.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?x.createElement(`pre`,{style:i},n):null,o)}var ft=x.createElement(dt,null),pt=class extends x.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=nt(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:x.createElement(Xe.Provider,{value:this.props.routeContext},x.createElement(Ze.Provider,{value:e,children:this.props.component}));return this.context?x.createElement(ht,{error:e},t):t}};pt.contextType=Ue;var mt=new WeakMap;function ht({children:e,error:t}){let{basename:n}=x.useContext(Je);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=tt(t.digest);if(e){let r=mt.get(t);if(r)throw r;let i=Re(e.location,n);if(Le&&!mt.get(t))if(i.isExternal||e.reloadDocument)window.location.href=i.absoluteURL||i.to;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw mt.set(t,n),n}return x.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${i.absoluteURL||i.to}`})}}return e}function gt({routeContext:e,match:t,children:n}){let r=x.useContext(Ve);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),x.createElement(Xe.Provider,{value:e},n)}function _t(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);T(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:Ie(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||ft,o&&(s<0&&c===0?(kt(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?x.createElement(n.route.Component,null):n.route.element?n.route.element:e,x.createElement(gt,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?x.createElement(pt,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function vt(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function yt(e){let t=x.useContext(Ve);return T(t,vt(e)),t}function bt(e){let t=x.useContext(He);return T(t,vt(e)),t}function xt(e){let t=x.useContext(Xe);return T(t,vt(e)),t}function St(e){let t=xt(e),n=t.matches[t.matches.length-1];return T(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Ct(){return St(`useRouteId`)}function wt(){return bt(`useNavigation`).navigation}function Tt(){let{matches:e,loaderData:t}=bt(`useMatches`);return x.useMemo(()=>e.map(e=>j(e,t)),[e,t])}function Et(){let e=x.useContext(Ze),t=bt(`useRouteError`),n=St(`useRouteError`);return e===void 0?t.errors?.[n]:e}function Dt(){let{router:e}=yt(`useNavigate`),t=St(`useNavigate`),n=x.useRef(!1);return st(()=>{n.current=!0}),x.useCallback(async(r,i={})=>{E(n.current,ot),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var Ot={};function kt(e,t,n){!t&&!Ot[e]&&(Ot[e]=!0,E(!1,n))}x.memo(At);function At({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return ut(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function F({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){T(!it(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=x.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=A(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,h=x.useMemo(()=>{let e=be(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return E(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:x.createElement(Je.Provider,{value:c},x.createElement(Ye.Provider,{children:t,value:h}))}x.Component;var jt=`get`,Mt=`application/x-www-form-urlencoded`;function Nt(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Pt(e){return Nt(e)&&e.tagName.toLowerCase()===`button`}function Ft(e){return Nt(e)&&e.tagName.toLowerCase()===`form`}function It(e){return Nt(e)&&e.tagName.toLowerCase()===`input`}function Lt(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Rt(e,t){return e.button===0&&(!t||t===`_self`)&&!Lt(e)}var zt=null;function Bt(){if(zt===null)try{new FormData(document.createElement(`form`),0),zt=!1}catch{zt=!0}return zt}var Vt=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Ht(e){return e!=null&&!Vt.has(e)?(E(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Mt}"`),null):e}function Ut(e,t){let n,r,i,a,o;if(Ft(e)){let o=e.getAttribute(`action`);r=o?be(o,t):null,n=e.getAttribute(`method`)||jt,i=Ht(e.getAttribute(`enctype`))||Mt,a=new FormData(e)}else if(Pt(e)||It(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?be(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||jt,i=Ht(e.getAttribute(`formenctype`))||Ht(o.getAttribute(`enctype`))||Mt,a=new FormData(o,e),!Bt()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(Nt(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=jt,r=null,i=Mt,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Wt={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},Gt=/[&><\u2028\u2029]/g;function Kt(e){return e.replace(Gt,e=>Wt[e])}function qt(e,t){if(e===!1||e==null)throw Error(t)}function Jt(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n?i.pathname.endsWith(`/`)?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname===`/`?i.pathname=`_root.${r}`:t&&be(i.pathname,t)===`/`?i.pathname=`${Ae(t)}/_root.${r}`:i.pathname=`${Ae(i.pathname)}.${r}`,i}async function Yt(e,t){if(e.id in t)return t[e.id];try{let n=await b(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Xt(e){return e!=null&&typeof e.page==`string`}function Zt(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function Qt(e,t,n){return rn((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await Yt(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(Zt).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function $t(e,t,n,r,i,a){let o=(e,t)=>n[t]?e.route.id!==n[t].route.id:!0,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function en(e,t,{includeHydrateFallback:n}={}){return tn(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function tn(e){return[...new Set(e)]}function nn(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function rn(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!Xt(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(nn(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function an(){let e=x.useContext(Ve);return qt(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function on(){let e=x.useContext(He);return qt(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var sn=x.createContext(void 0);sn.displayName=`FrameworkContext`;function cn(){let e=x.useContext(sn);return qt(e,`You must render this element inside a <HydratedRouter> element`),e}function ln(e,t){let n=x.useContext(sn),[r,i]=x.useState(!1),[a,o]=x.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=x.useRef(null);x.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),x.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:un(s,p),onBlur:un(c,m),onMouseEnter:un(l,p),onMouseLeave:un(u,m),onTouchStart:un(d,p)}]:[a,f,{}]:[!1,f,{}]}function un(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function dn({page:e,...t}){let n=We(),{router:r}=an(),i=x.useMemo(()=>re(r.routes,e,r.basename),[r.routes,e,r.basename]);return i?n?x.createElement(fn,{page:e,matches:i,...t}):x.createElement(pn,{page:e,matches:i,...t}):null}function I(e){let{manifest:t,routeModules:n}=cn(),[r,i]=x.useState([]);return x.useEffect(()=>{let r=!1;return Qt(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function fn({page:e,matches:t,...n}){let r=at(),{future:i}=cn(),{basename:a}=an(),o=x.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=Jt(e,a,i.unstable_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.unstable_trailingSlashAwareDataRequests,e,r,t]);return x.createElement(x.Fragment,null,o.map(e=>x.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function pn({page:e,matches:t,...n}){let r=at(),{future:i,manifest:a,routeModules:o}=cn(),{basename:s}=an(),{loaderData:c,matches:l}=on(),u=x.useMemo(()=>$t(e,t,l,a,r,`data`),[e,t,l,a,r]),d=x.useMemo(()=>$t(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=x.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=Jt(e,s,i.unstable_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.unstable_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=x.useMemo(()=>en(d,a),[d,a]),m=I(d);return x.createElement(x.Fragment,null,f.map(e=>x.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>x.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>x.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function mn(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}x.Component;var hn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{hn&&(window.__reactRouterVersion=`7.15.0`)}catch{}function gn({basename:e,children:t,useTransitions:n,window:r}){let i=x.useRef();i.current??=w({window:r,v5Compat:!0});let a=i.current,[o,s]=x.useState({action:a.action,location:a.location}),c=x.useCallback(e=>{n===!1?s(e):x.startTransition(()=>s(e))},[n]);return x.useLayoutEffect(()=>a.listen(c),[a,c]),x.createElement(F,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}function _n({basename:e,children:t,history:n,useTransitions:r}){let[i,a]=x.useState({action:n.action,location:n.location}),o=x.useCallback(e=>{r===!1?a(e):x.startTransition(()=>a(e))},[r]);return x.useLayoutEffect(()=>n.listen(o),[n,o]),x.createElement(F,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,useTransitions:r})}_n.displayName=`unstable_HistoryRouter`;var vn=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,yn=x.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,useTransitions:_}=x.useContext(Je),v=typeof l==`string`&&vn.test(l),y=Re(l,h);l=y.to;let b=rt(l,{relative:r}),S=at(),C=null;if(o){let e=De(o,[],S.mask?S.mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:ke([h,e.pathname])),C=g.createHref(e)}let[w,T,E]=ln(n,p),ee=En(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:_});function D(t){e&&e(t),t.defaultPrevented||ee(t)}let O=!(y.isExternal||i),k=x.createElement(`a`,{...p,...E,href:(O?C:void 0)||y.absoluteURL||b,onClick:O?D:e,ref:mn(m,T),target:c,"data-discover":!v&&t===`render`?`true`:void 0});return w&&!v?x.createElement(x.Fragment,null,k,x.createElement(dn,{page:b})):k});yn.displayName=`Link`;var bn=x.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=lt(a,{relative:c.relative}),d=at(),f=x.useContext(He),{navigator:p,basename:m}=x.useContext(Je),h=f!=null&&In(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,v=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),v=v?v.toLowerCase():null,g=g.toLowerCase()),v&&m&&(v=be(v,m)||v);let y=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,b=_===g||!r&&_.startsWith(g)&&_.charAt(y)===`/`,S=v!=null&&(v===g||!r&&v.startsWith(g)&&v.charAt(g.length)===`/`),C={isActive:b,isPending:S,isTransitioning:h},w=b?e:void 0,T;T=typeof n==`function`?n(C):[n,b?`active`:null,S?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let E=typeof i==`function`?i(C):i;return x.createElement(yn,{...c,"aria-current":w,className:T,ref:l,style:E,to:a,viewTransition:o},typeof s==`function`?s(C):s)});bn.displayName=`NavLink`;var xn=x.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=jt,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:h}=x.useContext(Je),g=kn(),_=An(s,{relative:l}),v=o.toLowerCase()===`get`?`get`:`post`,y=typeof s==`string`&&vn.test(s);return x.createElement(`form`,{ref:m,method:v,action:_,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f});h&&n!==!1?x.startTransition(()=>p()):p()},...p,"data-discover":!y&&e===`render`?`true`:void 0})});xn.displayName=`Form`;function Sn({getKey:e,storageKey:t,...n}){let r=x.useContext(sn),{basename:i}=x.useContext(Je),a=at(),o=Tt();Pn({getKey:e,storageKey:t});let s=x.useMemo(()=>{if(!r||!e)return null;let t=Nn(a,o,i,e);return t===a.key?null:t},[]);if(!r||r.isSpaMode)return null;let c=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return x.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${c})(${Kt(JSON.stringify(t||jn))}, ${Kt(JSON.stringify(s))})`}})}Sn.displayName=`ScrollRestoration`;function Cn(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function wn(e){let t=x.useContext(Ve);return T(t,Cn(e)),t}function Tn(e){let t=x.useContext(He);return T(t,Cn(e)),t}function En(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=ct(),d=at(),f=lt(e,{relative:o});return x.useCallback(p=>{if(Rt(p,t)){p.preventDefault();let t=n===void 0?k(d)===k(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?x.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}var Dn=0,On=()=>`__${String(++Dn)}__`;function kn(){let{router:e}=wn(`useSubmit`),{basename:t}=x.useContext(Je),n=Ct(),r=e.fetch,i=e.navigate;return x.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=Ut(e,t);a.navigate===!1?await r(a.fetcherKey||On(),n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync}):await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function An(e,{relative:t}={}){let{basename:n}=x.useContext(Je),r=x.useContext(Xe);T(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...lt(e||`.`,{relative:t})},o=at();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:ke([n,a.pathname])),k(a)}var jn=`react-router-scroll-positions`,Mn={};function Nn(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:be(e.pathname,n)||e.pathname},t)),i??=e.key,i}function Pn({getKey:e,storageKey:t}={}){let{router:n}=wn(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=Tn(`useScrollRestoration`),{basename:a}=x.useContext(Je),o=at(),s=Tt(),c=wt();x.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),Fn(x.useCallback(()=>{if(c.state===`idle`){let t=Nn(o,s,a,e);Mn[t]=window.scrollY}try{sessionStorage.setItem(t||jn,JSON.stringify(Mn))}catch(e){E(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[c.state,e,a,o,s,t])),typeof document<`u`&&(x.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||jn);e&&(Mn=JSON.parse(e))}catch{}},[t]),x.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(Mn,()=>window.scrollY,e?(t,n)=>Nn(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),x.useLayoutEffect(()=>{if(r!==!1){if(typeof r==`number`){window.scrollTo(0,r);return}try{if(o.hash){let e=document.getElementById(decodeURIComponent(o.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{E(!1,`"${o.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[o,r,i]))}function Fn(e,t){let{capture:n}=t||{};x.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function In(e,{relative:t}={}){let n=x.useContext(Ge);T(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=wn(`useViewTransitionState`),i=lt(e,{relative:t});if(!n.isTransitioning)return!1;let a=be(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=be(n.nextLocation.pathname,r)||n.nextLocation.pathname;return _e(i.pathname,o)!=null||_e(i.pathname,a)!=null}var Ln=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),Rn=o(((e,t)=>{t.exports=Ln()})),zn=g(),L=Rn(),Bn=class extends x.Component{state={error:null,info:null};static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){this.setState({info:t}),console.error(`[ErrorBoundary]`,e,t)}reset=()=>{this.setState({error:null,info:null})};reload=()=>{window.location.reload()};clearStorage=()=>{try{localStorage.clear(),sessionStorage.clear()}catch{}this.reload()};render(){let{error:e,info:t}=this.state;if(!e)return this.props.children;let n=`${e.message}\n\n${e.stack??``}\n${t?.componentStack??``}`.trim();return(0,L.jsx)(`div`,{className:`min-h-screen bg-zinc-900 text-zinc-100 p-6 flex items-start justify-center`,children:(0,L.jsxs)(`div`,{className:`max-w-2xl w-full flex flex-col gap-4`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`h1`,{className:`text-lg font-semibold text-red-300`,children:`Something went wrong.`}),(0,L.jsx)(`p`,{className:`text-sm text-zinc-400 mt-1`,children:`The dashboard hit an unexpected error. Your work isn't lost — try Reload first; if the error keeps coming back after a hot-reload, Reset state will clear local storage and start fresh.`})]}),(0,L.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,L.jsx)(`button`,{onClick:this.reload,className:`bg-violet-600 hover:bg-violet-500 text-white text-sm font-medium px-4 py-1.5 rounded-md transition-colors`,children:`Reload`}),(0,L.jsx)(`button`,{onClick:this.reset,className:`bg-zinc-800 hover:bg-zinc-700 border border-zinc-700 text-zinc-200 text-sm font-medium px-4 py-1.5 rounded-md transition-colors`,children:`Try again`}),(0,L.jsx)(`button`,{onClick:this.clearStorage,className:`bg-zinc-800 hover:bg-red-900/40 border border-zinc-700 hover:border-red-800 text-zinc-200 hover:text-red-200 text-sm font-medium px-4 py-1.5 rounded-md transition-colors`,children:`Reset state & reload`})]}),(0,L.jsxs)(`details`,{className:`bg-zinc-950/80 border border-zinc-800 rounded-md`,children:[(0,L.jsx)(`summary`,{className:`cursor-pointer text-xs text-zinc-500 hover:text-zinc-300 px-3 py-2 select-none`,children:`Error details`}),(0,L.jsx)(`pre`,{className:`text-[11px] leading-snug text-red-300 font-mono whitespace-pre-wrap break-words [overflow-wrap:anywhere] px-3 pb-3 max-h-80 overflow-y-auto`,children:n})]})]})})}},Vn={"Content-Type":`application/json`,"X-Forge-Request":`1`},Hn=`forge:unauthorized`;async function R(e,t){let n=await fetch(`/api/forge${e}`,{credentials:`same-origin`,...t,headers:{...Vn,...t?.headers}});if(!n.ok){n.status===401&&window.dispatchEvent(new Event(Hn));let e={};try{e=await n.json()}catch{}throw Error(e.error??`Request failed: ${n.status}`)}try{return await n.json()}catch{throw Error(`Empty response from ${e}`)}}var Un=(e,t={})=>R(e,{method:`POST`,body:JSON.stringify(t)}),Wn={me:()=>R(`/auth/me`),login:(e,t)=>Un(`/auth/login`,{email:e,password:t}),setup:e=>Un(`/auth/setup`,e),logout:()=>Un(`/auth/logout`),ssoStartUrl:e=>`/api/forge/auth/oidc/start?returnTo=${encodeURIComponent(e)}`};function Gn(...e){return e.filter(Boolean).join(` `)}var Kn={primary:`bg-accent text-on-accent hover:bg-accent-hover shadow-sm`,secondary:`bg-surface-raised text-fg border border-line hover:bg-surface-hover hover:border-line-strong`,ghost:`text-fg-muted hover:text-fg hover:bg-surface-hover`,danger:`bg-red-600 text-on-accent hover:bg-red-500`},qn={sm:`h-7 px-2.5 text-xs gap-1.5`,md:`h-9 px-3.5 text-sm gap-2`};function z({variant:e=`secondary`,size:t=`md`,className:n,type:r=`button`,...i}){return(0,L.jsx)(`button`,{type:r,className:Gn(`inline-flex shrink-0 items-center justify-center whitespace-nowrap rounded-lg font-medium transition-colors`,`disabled:opacity-50 disabled:pointer-events-none`,Kn[e],qn[t],n),...i})}var Jn={issues:`M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Zm0-5.5a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7Z`,mergeRequest:`M6 21a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Zm0-13a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Zm0 0v8m12 5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Zm0-5V9a3 3 0 0 0-3-3h-4m0 0 2.5-2.5M11 6l2.5 2.5`,pipeline:`M4 7h4m8 0h4M4 17h4m8 0h4M10 7a2 2 0 1 0 4 0 2 2 0 0 0-4 0Zm0 10a2 2 0 1 0 4 0 2 2 0 0 0-4 0ZM12 9v6`,settings:`M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Zm7.4-3a7.4 7.4 0 0 0-.1-1.2l2-1.6-2-3.4-2.4 1a7.6 7.6 0 0 0-2-1.2L14.5 3h-5l-.4 2.6a7.6 7.6 0 0 0-2 1.2l-2.4-1-2 3.4 2 1.6a7.4 7.4 0 0 0 0 2.4l-2 1.6 2 3.4 2.4-1a7.6 7.6 0 0 0 2 1.2l.4 2.6h5l.4-2.6a7.6 7.6 0 0 0 2-1.2l2.4 1 2-3.4-2-1.6c.1-.4.1-.8.1-1.2Z`,search:`m20 20-4.2-4.2M11 18a7 7 0 1 0 0-14 7 7 0 0 0 0 14Z`,plus:`M12 5v14M5 12h14`,refresh:`M20 11a8 8 0 0 0-14.8-4M4 4v4h4m-4 5a8 8 0 0 0 14.8 4M20 20v-4h-4`,sun:`M12 16a4 4 0 1 0 0-8 4 4 0 0 0 0 8Zm0-14v2m0 16v2M4.9 4.9l1.4 1.4m11.4 11.4 1.4 1.4M2 12h2m16 0h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4`,moon:`M20 14.5A8 8 0 0 1 9.5 4a8 8 0 1 0 10.5 10.5Z`,monitor:`M3 5h18v11H3zM8 20h8m-4-4v4`,chevronRight:`m9 6 6 6-6 6`,chevronLeft:`m15 6-6 6 6 6`,chevronDown:`m6 9 6 6 6-6`,logout:`M15 4h4v16h-4M10 8l-4 4 4 4m-4-4h11`,external:`M14 4h6v6m0-6-9 9M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5`,branch:`M6 3v12m0 0a3 3 0 1 0 0 6 3 3 0 0 0 0-6Zm12-6a3 3 0 1 0 0-6 3 3 0 0 0 0 6Zm0 0a9 9 0 0 1-9 9`,command:`M9 6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6Z`,inbox:`M3 13h5l1.5 3h5L16 13h5M5 5h14l2 8v6H3v-6l2-8Z`,sparkle:`M12 3v4m0 10v4M3 12h4m10 0h4M6.3 6.3l2.8 2.8m5.8 5.8 2.8 2.8m0-11.4-2.8 2.8m-5.8 5.8-2.8 2.8`,menu:`M4 7h16M4 12h16M4 17h16`,more:`M5 12h.01M12 12h.01M19 12h.01`,users:`M16 20v-1.5a3.5 3.5 0 0 0-3.5-3.5h-5A3.5 3.5 0 0 0 4 18.5V20m16 0v-1.5a3.5 3.5 0 0 0-2.5-3.35M10 11a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7Zm5.5-6.85a3.5 3.5 0 0 1 0 6.7`,shield:`M12 21s7-3.5 7-9.5V5.5L12 3 5 5.5v6c0 6 7 9.5 7 9.5Zm-3-9.5 2 2 4-4`,trash:`M4 7h16M10 11v6m4-6v6M6 7l1 13h10l1-13M9 7V4h6v3`,pencil:`M4 20h4L19 9l-4-4L4 16v4Zm9-13 4 4`,copy:`M9 9h11v11H9zM5 15H4V4h11v1`,archive:`M3 5h18v4H3zM5 9v10h14V9M10 13h4`};function B({name:e,size:t=16,className:n,...r}){return(0,L.jsx)(`svg`,{width:t,height:t,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:1.75,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,className:n,...r,children:(0,L.jsx)(`path`,{d:Jn[e]})})}var Yn=`forge:theme`,Xn=[`light`,`dark`,`system`];function Zn({preference:e,systemDark:t}){return e===`system`?t?`dark`:`light`:e}function Qn(){try{let e=localStorage.getItem(Yn);return Xn.includes(e)?e:`system`}catch{return`system`}}function $n(e){try{localStorage.setItem(Yn,e)}catch{}}var er=(0,x.createContext)(null),tr=`(prefers-color-scheme: dark)`,nr=()=>typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(tr).matches;function rr({children:e}){let[t,n]=(0,x.useState)(Qn),[r,i]=(0,x.useState)(nr),a=Zn({preference:t,systemDark:r});return(0,x.useEffect)(()=>{if(typeof window.matchMedia!=`function`)return;let e=window.matchMedia(tr),t=e=>i(e.matches);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]),(0,x.useEffect)(()=>{document.documentElement.setAttribute(`data-theme`,a)},[a]),(0,L.jsx)(er.Provider,{value:{preference:t,theme:a,setPreference:e=>{n(e),$n(e)}},children:e})}function ir(){let e=(0,x.useContext)(er);if(!e)throw Error(`useTheme must be used inside <ThemeProvider>`);return e}var ar=[{value:`light`,label:`Light theme`,icon:`sun`},{value:`dark`,label:`Dark theme`,icon:`moon`},{value:`system`,label:`System theme`,icon:`monitor`}];function or({value:e,onChange:t}){return(0,L.jsx)(`div`,{role:`radiogroup`,"aria-label":`Theme`,className:`flex rounded-lg border border-line bg-surface p-0.5`,children:ar.map(n=>{let r=e===n.value;return(0,L.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":r,"aria-label":n.label,title:n.label,onClick:()=>t(n.value),className:Gn(`flex h-6 flex-1 items-center justify-center rounded-md transition-colors`,r?`bg-surface-raised text-fg shadow-sm ring-1 ring-line`:`text-fg-subtle hover:text-fg`),children:(0,L.jsx)(B,{name:n.icon,size:13})},n.value)})})}function sr(e){let t=(0,x.useRef)(e);t.current=e,(0,x.useEffect)(()=>{let e=new EventSource(`/api/forge/events`);return e.onmessage=e=>{try{t.current(JSON.parse(e.data))}catch{}},e.onerror=()=>{e.close(),setTimeout(()=>e.url&&window.dispatchEvent(new Event(`forge:reconnect`)),5e3)},()=>e.close()},[])}var cr=Object.freeze({ISSUE_CREATED:`issue:created`,ISSUE_UPDATED:`issue:updated`,ISSUE_CLOSED:`issue:closed`,ISSUE_DELETED:`issue:deleted`,ANALYSIS_STARTED:`analysis:started`,ANALYSIS_DONE:`analysis:done`,REFINE_DONE:`refine:done`,CI_FIX_DONE:`ci-fix:done`,VALIDATION_DONE:`validation:done`,FIX_APPLIED:`fix:applied`,MR_MERGED:`mr:merged`,MR_CLOSED:`mr:closed`}),lr=5,ur=(e,t)=>`forge:analyses:${e}:${t}`,dr=(e,t)=>`forge:analysis:${e}:${t}`;function fr(e){if(e.every(e=>typeof e.ordinal==`number`))return e;let t=e.length;return e.map((e,n)=>({...e,ordinal:typeof e.ordinal==`number`?e.ordinal:t-n}))}function pr(e,t){try{let n=localStorage.getItem(ur(e,t));if(n){let r=JSON.parse(n);if(Array.isArray(r)){let n=fr(r);return n!==r&&mr(e,t,n),n}}let r=localStorage.getItem(dr(e,t));if(r){let n=JSON.parse(r),i={id:n.analyzedAt||crypto.randomUUID(),ordinal:1,...n};return localStorage.setItem(ur(e,t),JSON.stringify([i])),localStorage.removeItem(dr(e,t)),[i]}}catch{}return[]}function mr(e,t,n){try{localStorage.setItem(ur(e,t),JSON.stringify(n))}catch{}}var hr=(e,t,n)=>`/issues/${t}/analyses${n?`/${encodeURIComponent(n)}`:``}${e===`default`?``:`?repo=${encodeURIComponent(e)}`}`;function gr(e){return[...e].sort((e,t)=>t.ordinal-e.ordinal).slice(0,lr)}function _r(e,t,n){mr(e,t,gr([n,...pr(e,t).filter(e=>e.id!==n.id)]))}async function vr(e,t,n){let{analysis:r}=await R(hr(e,t,n.id),{method:`PUT`,body:JSON.stringify({analysis:n})});return r.ordinal!==n.ordinal&&_r(e,t,r),r}function yr(e,t,n){vr(e,t,n).catch(()=>{})}function br(e,t,n){_r(e,t,n)}async function xr(e,t){let n;try{({analyses:n}=await R(hr(e,t)))}catch{return pr(e,t)}let r=new Set(n.map(e=>e.id)),i=pr(e,t).filter(e=>!r.has(e.id)),a=[];for(let n of i)try{a.push(await vr(e,t,n))}catch{a.push(n)}let o=gr([...n,...a]);return mr(e,t,o),o}function Sr(){return typeof crypto<`u`&&`randomUUID`in crypto?crypto.randomUUID():`${Date.now()}-${Math.random().toString(36).slice(2,8)}`}function Cr(e,t,n,r,i,a,o){let s=a?.trim(),c=pr(e,t),l=c.reduce((e,t)=>Math.max(e,t.ordinal??0),0)+1,u={id:Sr(),ordinal:l,result:n,analyzedAt:new Date().toISOString(),repo:e,model:r,...i!==void 0&&{mrIid:i},...s&&{prompt:s},...o&&o.length>0&&{refineThread:o}};return mr(e,t,[u,...c].slice(0,lr)),yr(e,t,u),u}function wr(e,t,n,r){let i=pr(e,t),a=i.findIndex(e=>e.ordinal===n);if(a<0)return null;let o={...i[a],...r},s=[...i];return s[a]=o,mr(e,t,s),yr(e,t,o),o}function Tr(e,t){return pr(e,t)}function Er(e,t,n){mr(e,t,pr(e,t).filter(e=>e.id!==n)),R(hr(e,t,n),{method:`DELETE`}).catch(()=>{})}function Dr(e,t){try{localStorage.removeItem(ur(e,t)),localStorage.removeItem(dr(e,t))}catch{}R(hr(e,t),{method:`DELETE`}).catch(()=>{})}function Or(){let e=0;try{let t=[];for(let e=0;e<localStorage.length;e++){let n=localStorage.key(e);n&&(n.startsWith(`forge:analyses:`)||n.startsWith(`forge:analysis:`))&&t.push(n)}for(let n of t)localStorage.removeItem(n),e+=1}catch{}return e}function kr(e){let t=new Date(e),n=new Date().getTime()-t.getTime(),r=Math.floor(n/6e4),i=Math.floor(r/60),a=Math.floor(i/24);return r<1?`just now`:r<60?`${r}m ago`:i<24?`${i}h ago`:a<7?`${a}d ago`:t.toLocaleDateString(void 0,{month:`short`,day:`numeric`})+` at `+t.toLocaleTimeString(void 0,{hour:`numeric`,minute:`2-digit`})}function Ar(e,t,n,r){let i=r?.retries??6,a=r?.backoffMs??1e3,o=0,s=null,c=null,l=0,u=!1,d=()=>{let f=0;s=new EventSource(e),s.onmessage=e=>{l=0,f+=1,!(f<=o)&&(o=f,t(JSON.parse(e.data)))},s.onerror=()=>{if(s?.close(),s=null,u)return;if(!r||l>=i){n();return}let e=Math.min(a*2**l,15e3);l+=1,c=setTimeout(()=>{c=null,!u&&d()},e)}};return d(),{close:()=>{u=!0,c&&clearTimeout(c),s?.close(),s=null}}}function jr(e,t,n){return[...e.filter(e=>e.step!==t),{step:t,message:n}]}var Mr=`Refinement canceled — the page was reloaded before it finished.`,Nr=`Refinement canceled.`,Pr=`Lost the connection to this refinement. Reload to pick it up if it is still running.`;function Fr(e){return e?`Refinement failed: ${e}`:`Refinement failed.`}function Ir(e,t,n){let r=e[e.length-1];return!r||r.explanation!==void 0?e:[...e.slice(0,-1),{...r,kind:t,explanation:n}]}function Lr(e){return!e||e.length===0?[]:e.map(e=>e.explanation===void 0&&e.kind!==`canceled`?{...e,kind:`canceled`,explanation:Mr}:e)}var Rr=`forge:activeJob`;function zr(e,t,n){return`${Rr}:${e}:${t}:${n}`}var Br=new Set,Vr=null;function Hr(){Vr=null;for(let e of Br)e()}function Ur(){if(Vr)return Vr;let e={};try{for(let t=0;t<sessionStorage.length;t++){let n=sessionStorage.key(t);if(!n||!n.startsWith(Rr+`:`))continue;let r=sessionStorage.getItem(n);if(r)try{let t=JSON.parse(r);t&&typeof t.jobId==`string`&&(e[n]=t)}catch{}}}catch{}return Vr=e,e}typeof window<`u`&&window.addEventListener(`storage`,e=>{(!e.key||e.key.startsWith(Rr+`:`))&&Hr()});function Wr(e,t,n,r){try{sessionStorage.setItem(zr(e,t,n),JSON.stringify(r))}catch{}Hr()}function Gr(e,t,n){try{let r=sessionStorage.getItem(zr(e,t,n));if(!r)return null;let i=JSON.parse(r);return i&&typeof i.jobId==`string`?i:null}catch{return null}}function Kr(e,t,n){try{sessionStorage.removeItem(zr(e,t,n))}catch{}Hr()}function qr(){return(0,x.useSyncExternalStore)(e=>(Br.add(e),()=>{Br.delete(e)}),Ur,()=>Jr)}var Jr={};function Yr(e){let t=Rr+`:`;if(!e.startsWith(t))return null;let n=e.slice(16).split(`:`);if(n.length<3)return null;let r=n[n.length-1],i=Number(n[n.length-2]);return Number.isFinite(i)?{repo:n.slice(0,-2).join(`:`),iid:i,type:r}:null}function Xr(e,t,n){let r=[];for(let i of Object.keys(e)){let a=Yr(i);a&&(a.repo!==t||a.iid!==n||e[i].meta?.finished||r.push(a.type))}return r}var Zr={result:null,byRepo:{},repoOrder:[],aggregateLogs:[],stale:!1};function Qr(e){if(!e)return Zr;if(e.byRepo&&e.repoOrder)return{result:e.result??null,byRepo:$r(e.byRepo),repoOrder:e.repoOrder,aggregateLogs:e.aggregateLogs??[],stale:e.stale??!1};let t=e.steps,n=e.result?.repo;return t&&n?{result:e.result??null,byRepo:$r({[n]:{repo:n,steps:t}}),repoOrder:[n],aggregateLogs:[],stale:e.stale??!1}:{...Zr,stale:e.stale??!1}}function $r(e){let t=!1,n={};for(let[r,i]of Object.entries(e)){let e={};for(let[n,r]of Object.entries(i.steps))r.status===`running`?(t=!0,e[n]={...r,status:`interrupted`}):e[n]=r;n[r]={...i,steps:e}}return t?n:e}function ei(e){return!!e.result||e.repoOrder.length>0||e.stale}var ti={retries:6},ni=`forge_secondary_repos`,ri=`forge_selected_repo`;function ii(){try{let e=localStorage.getItem(ni);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t.filter(e=>typeof e==`string`):[]}catch{return[]}}function ai(e){try{localStorage.setItem(ni,JSON.stringify(e))}catch{}}function oi(){let[e,t]=(0,x.useState)(()=>typeof window<`u`&&/^\/issues\/\d+/.test(window.location.pathname)?`selected`:`idle`),[n,r]=(0,x.useState)([]),[i,a]=(0,x.useState)(!0),[o,s]=(0,x.useState)(!1),[c,l]=(0,x.useState)(null),[u,d]=(0,x.useState)(null),[f,p]=(0,x.useState)([]),[m,h]=(0,x.useState)([]),[g,_]=(0,x.useState)(null),[v,y]=(0,x.useState)([]),[b,S]=(0,x.useState)(null),[C,w]=(0,x.useState)(null),[T,E]=(0,x.useState)(null),[ee,D]=(0,x.useState)(!1),[O,k]=(0,x.useState)([]),[A,te]=(0,x.useState)(null),[ne,re]=(0,x.useState)(!1),[ie,j]=(0,x.useState)(null),[M,ae]=(0,x.useState)(null),[oe,se]=(0,x.useState)(0),[ce,le]=(0,x.useState)(null),[N,ue]=(0,x.useState)(!1),[de,fe]=(0,x.useState)([]),[pe,me]=(0,x.useState)([]),[he,ge]=(0,x.useState)(!1),[_e,ve]=(0,x.useState)([]),[ye,be]=(0,x.useState)(!1),[xe,Se]=(0,x.useState)(!1),[Ce,we]=(0,x.useState)(null),[Te,Ee]=(0,x.useState)(null),[De,Oe]=(0,x.useState)(!1),[ke,Ae]=(0,x.useState)(null),[je,Me]=(0,x.useState)(!1),[Ne,Pe]=(0,x.useState)([]),[Fe,Ie]=(0,x.useState)([]),[Le,Re]=(0,x.useState)(`analyze`),[ze,Be]=(0,x.useState)(``),[Ve,He]=(0,x.useState)(0),[Ue,We]=(0,x.useState)(null),[Ge,Ke]=(0,x.useState)(null),qe=(0,x.useRef)(3),[Je,Ye]=(0,x.useState)(!1),[Xe,Ze]=(0,x.useState)(null),[Qe,$e]=(0,x.useState)(Zr),et=(0,x.useRef)(null),tt=(0,x.useRef)(null),nt=(0,x.useRef)(!1),[rt,it]=(0,x.useState)(()=>localStorage.getItem(`forge_auto_push_on_green`)===`1`),at=(0,x.useRef)(rt);(0,x.useEffect)(()=>{at.current=rt},[rt]);let ot=e=>{it(e);try{localStorage.setItem(`forge_auto_push_on_green`,e?`1`:`0`)}catch{}},[st,ct]=(0,x.useState)([]),[P,lt]=(0,x.useState)(()=>localStorage.getItem(ri)??``),ut=e=>{lt(e);try{e?localStorage.setItem(ri,e):localStorage.removeItem(ri)}catch{}},[dt,ft]=(0,x.useState)(null),[pt,mt]=(0,x.useState)(ii),ht=e=>{mt(e),ai(e)},[gt,_t]=(0,x.useState)([]),[vt,yt]=(0,x.useState)(!1),[bt,xt]=(0,x.useState)(()=>localStorage.getItem(`forge_model`)??``),[St,Ct]=(0,x.useState)([]),[wt,Tt]=(0,x.useState)(()=>localStorage.getItem(`forge_agent`)??`claude`),Et=e=>{xt(e),localStorage.setItem(`forge_model`,e)},Dt=e=>{Tt(e),localStorage.setItem(`forge_agent`,e)},Ot=(0,x.useRef)(null),kt=(0,x.useRef)(0),At=(0,x.useRef)(0),F=(0,x.useRef)(null);(0,x.useEffect)(()=>()=>{Ot.current?.abort(),F.current?.close(),F.current=null},[]);let jt=(e=`?`)=>P?`${e}repo=${encodeURIComponent(P)}`:``,Mt=e=>{_t(e.models),yt(!0),xt(t=>t||e.defaultModel),ft(e.testDeployUrlTemplate??null),e.maxCiFixAttempts!=null&&(qe.current=e.maxCiFixAttempts),e.repos?.length&&(ct(e.repos),lt(t=>{let n=new Set(e.repos.map(e=>e.id));if(t&&n.has(t))return t;let r=e.defaultRepo||e.repos[0].id;try{r?localStorage.setItem(ri,r):localStorage.removeItem(ri)}catch{}return r}),mt(t=>{let n=new Set(e.repos.map(e=>e.id)),r=t.filter(e=>n.has(e));return r.length!==t.length&&ai(r),r})),e.agents?.length&&(Ct(e.agents),Tt(t=>t||e.defaultAgent||`claude`)),localStorage.getItem(`forge_model`)||localStorage.setItem(`forge_model`,e.defaultModel),localStorage.getItem(`forge_agent`)||localStorage.setItem(`forge_agent`,e.defaultAgent??`claude`)};(0,x.useEffect)(()=>{P&&pt.includes(P)&&ht(pt.filter(e=>e!==P))},[P]);let Nt=(0,x.useRef)(``);(0,x.useEffect)(()=>{let e=Nt.current;Nt.current=P,!(!e||!P||e===P)&&(et.current?.close(),et.current=null,tt.current=null,Ln(),r([]),s(!1),ve([]),Se(!1),Ht(new Set),zt(),Bt())},[P]);let Pt=(0,x.useRef)(!1),Ft=()=>{D(!0),R(`/status`).then(e=>{Mt(e),E(null),zt(),Bt()}).catch(e=>{E(e?.message??`Forge backend is unreachable.`)}).finally(()=>D(!1))};(0,x.useEffect)(()=>{Pt.current||(Pt.current=!0,Ft())},[e]);let It=async()=>{Mt(await R(`/status`))},Lt=()=>{E(null),Ft()},Rt=(0,x.useRef)(null);(0,x.useEffect)(()=>{let t=Rt.current;Rt.current=e,t!=null&&t!==`idle`&&e===`idle`&&(zt(),Bt())},[e]);let zt=async()=>{Ot.current?.abort();let e=new AbortController;Ot.current=e,a(!0),l(null);try{r((await R(`/issues${jt()}`,{signal:e.signal})).issues),s(!0)}catch(e){e.name!==`AbortError`&&(l(e.message),s(!0))}finally{a(!1)}},Bt=async(e=`open`)=>{let t=++kt.current;be(!0),we(null);try{let n=await R(`/mrs?state=${e}${jt(`&`)}`);t===kt.current&&ve(n.mrs)}catch(e){t===kt.current&&e.name!==`AbortError`&&we(e.message)}finally{t===kt.current&&(Se(!0),be(!1))}},[Vt,Ht]=(0,x.useState)(new Set),[Ut,Wt]=(0,x.useState)(null),Gt=(0,x.useRef)(u);Gt.current=u;let Kt=(0,x.useRef)(e);Kt.current=e;let qt=(0,x.useRef)(P);qt.current=P,sr((0,x.useCallback)(e=>{let{ISSUE_CREATED:n,ISSUE_UPDATED:r,ISSUE_CLOSED:i,ISSUE_DELETED:a,MR_MERGED:o,MR_CLOSED:s,FIX_APPLIED:c,ANALYSIS_STARTED:l,ANALYSIS_DONE:u,REFINE_DONE:d,CI_FIX_DONE:f,VALIDATION_DONE:p}=cr;if(!(e.repo&&qt.current&&e.repo!==qt.current)){if(e.type===p&&e.iid&&e.jobId&&e.jobId!==tt.current){let t=qt.current||`default`,n=Gr(t,e.iid,`validate`);n?.jobId===e.jobId&&Wr(t,e.iid,`validate`,{...n,meta:{...n.meta,finished:!0}})}if(e.type===l&&e.iid&&(Ht(t=>new Set(t).add(e.iid)),Gt.current?.iid===e.iid&&(Kt.current===`selected`||Kt.current===`idle`)&&(Wt(e.jobId??null),t(`analyzing`))),e.type===u&&e.iid){Ht(t=>{let n=new Set(t);return n.delete(e.iid),n}),Wt(null),zt(),Bt();let t=e.iid;Gt.current?.iid===t&&xr(qt.current||`default`,t).then(e=>{Gt.current?.iid===t&&k(e)})}(e.type===n||e.type===r||e.type===i||e.type===a)&&zt(),(e.type===o||e.type===s||e.type===c)&&Bt(),(e.type===d||e.type===f)&&(zt(),Bt())}},[]));let Jt=e=>{let n={repo:P,branchName:e.source_branch,mr:{iid:e.iid,web_url:e.web_url,title:e.title},pipelineUrl:e.pipeline?.web_url??null};le({iid:e.iid,web_url:e.web_url,title:e.title,branchName:e.source_branch}),j({applications:[n]}),fe([]),d(null),_(null),w(null),t(`monitoring`);let r=e.source_branch.match(/^forge\/issue-(\d+)-/);if(r){let e=Number(r[1]);Promise.all([R(`/issues/${e}${jt()}`).then(e=>e.issue,()=>null),R(`/issues/${e}/merged-mrs${jt()}`).then(e=>e.mrs,()=>[])]).then(([e,t])=>{e&&d(e),t.length&&fe(t)})}},Yt=async(e,t,n=[])=>{let i=await R(`/issues`,{method:`POST`,body:JSON.stringify({title:e,description:t,labels:n,repo:P})});return r(e=>[i.issue,...e]),i.issue},Xt=async(e,t,n)=>{if(!u)return;let i=await R(`/issues/${u.iid}`,{method:`PUT`,body:JSON.stringify({title:e,description:t,labels:n,repo:P})});d(i.issue),r(e=>e.map(e=>e.iid===i.issue.iid?i.issue:e))},Zt=e=>{let t=At.current;xr(P||`default`,e).then(e=>{t===At.current&&k(e)})},Qt=e=>{F.current?.close(),F.current=null,et.current?.close(),et.current=null,tt.current=null,I.current.clear();let n=++At.current,r=()=>n===At.current;d(e),le(null),ue(!0),fe([]),me([]),ge(!0),p([]),h([]),_(null),w(null),j(null),ae(null),Ee(null),Ae(null),k(Tr(P||`default`,e.iid)),Zt(e.iid),$e(Zr),Ze(null),He(0),We(null),Ke(null),Me(!1),Pe([]),Ye(!1),Ie([]),te(null),t(`selected`),R(`/issues/${e.iid}/active-job${P?`?repo=${encodeURIComponent(P)}`:``}`).then(({job:e})=>{r()&&e?.status===`running`&&e.id&&(Wt(e.id),t(`analyzing`))}).catch(()=>{});let i=[P,...pt].filter(Boolean);Promise.all(i.map(t=>R(`/issues/${e.iid}/environments?repo=${encodeURIComponent(t)}`).then(e=>e.environments).catch(()=>[]))).then(e=>{r()&&(me(e.flat()),ge(!1))});let a=[P,...pt].filter(Boolean);Promise.all([Promise.all(a.map(t=>R(`/issues/${e.iid}/mr?repo=${encodeURIComponent(t)}`).then(e=>e.mr?{...e.mr,repo:t}:null).catch(()=>null))),R(`/issues/${e.iid}/merged-mrs${jt()}`).then(e=>e.mrs,()=>[]),Promise.all(a.map(t=>R(`/issues/${e.iid}/deploy-branches?repo=${encodeURIComponent(t)}`).then(e=>({repo:t,branches:e.branches})).catch(()=>({repo:t,branches:[]}))))]).then(([e,t,n])=>{if(!r())return;ue(!1),t.length&&fe(t);let i=e.filter(e=>e!==null).map(e=>({repo:e.repo,branchName:e.branchName,mr:{iid:e.iid,web_url:e.web_url,title:e.title},pipelineUrl:null})),a=n.flatMap(({repo:e,branches:t})=>t.map(t=>({repo:e,branchName:t.branchName,mr:null,pipelineUrl:t.pipeline?.web_url??null}))),o=e[0];o&&le({iid:o.iid,web_url:o.web_url,title:o.title,branchName:o.branchName});let s=[...i,...a];s.length&&j({applications:s})})},$t=(e,n)=>{let{submittedPrompt:r,model:i,existingMrIid:a,issueIid:o,repoKey:s}=n,c=null,l=null;F.current?.close();let u=new URLSearchParams;P&&u.set(`repo`,P),pt.length&&u.set(`secondaryRepos`,pt.join(`,`)),F.current=Ar(`/api/forge/jobs/${e}/stream?${u.toString()}`,e=>{if(e.type===`progress`)p(t=>jr(t,e.step,e.message));else if(e.type===`log`)h(t=>[...t,{ts:new Date().toISOString(),message:e.message}]);else if(e.type===`result`){let t=e.data;c=t,_(t)}else if(e.type===`analysis_saved`)l=e.analysis,br(s,o,l);else if(e.type===`done`){if(F.current?.close(),F.current=null,Kr(s,o,`analyze`),c){let e=l??Cr(s,o,c,i,a,r);k(Tr(s,o)),te(e.ordinal),$e(Zr),Ze(null)}t(`reviewing`)}else e.type===`error`?(F.current?.close(),F.current=null,Kr(s,o,`analyze`),w(e.message),t(`reviewing`)):e.type===`cancelled`&&(F.current?.close(),F.current=null,Kr(s,o,`analyze`),p([]),h([]),_(null),w(null),t(`selected`))},()=>{F.current?.close(),F.current=null,w(`Connection lost during analysis.`),t(`reviewing`)},ti)},en=async()=>{if(!u)return;let e=ce?`update`:O.length>0?`new`:de.length>0&&Te&&!Te.resolved?`retry`:`fresh`;p([]),h([]),_(null),w(null),y([]),S(null),Re(`analyze`),t(`analyzing`);let n=ze.trim();Be(``);try{let{jobId:t}=await R(`/issues/${u.iid}/analyze`,{method:`POST`,body:JSON.stringify({model:bt,repo:P,secondaryRepos:pt,agent:wt,prompt:n,kind:e,previousChanges:e===`new`?g?.changes??null:null})}),r=P||`default`,i={submittedPrompt:n,model:bt,existingMrIid:ce?.iid,issueIid:u.iid,repoKey:r};Wr(r,u.iid,`analyze`,{jobId:t,meta:{submittedPrompt:n,model:bt,existingMrIid:ce?.iid}}),I.current.add(t),$t(t,i)}catch(e){w(e.message),t(`reviewing`)}};(0,x.useEffect)(()=>{!Ut||!u||(p([]),h([]),_(null),w(null),Re(`analyze`),I.current.add(Ut),$t(Ut,{submittedPrompt:``,model:bt,existingMrIid:ce?.iid,issueIid:u.iid,repoKey:P||`default`}))},[Ut]);let tn=async()=>{if(!u)return;p([]),h([]),_(null),w(null),y([]),S(null),Re(`analyze`),t(`analyzing`);let e=ze.trim();Be(``);try{let{jobId:t}=await R(`/issues/${u.iid}/analyze`,{method:`POST`,body:JSON.stringify({model:bt,repo:P,secondaryRepos:pt,agent:wt,prompt:e,kind:`fresh`})}),n=P||`default`,r={submittedPrompt:e,model:bt,existingMrIid:ce?.iid,issueIid:u.iid,repoKey:n};Wr(n,u.iid,`analyze`,{jobId:t,meta:r}),I.current.add(t),$t(t,r)}catch(e){w(e.message),t(`reviewing`)}},nn=async()=>{if(!u)return;let e=P||`default`,t=Gr(e,u.iid,`analyze`);if(F.current?.close(),F.current=null,I.current.clear(),Kr(e,u.iid,`analyze`),p([]),h([]),_(null),w(null),Ln(),t?.jobId)try{await R(`/jobs/${t.jobId}/cancel`,{method:`POST`})}catch{}},rn=()=>({repo:P,secondaryRepos:pt}),an=(e,t)=>{let n=e.byRepo??{},r=e.repoOrder??[];return n[t]?{...e,byRepo:n,repoOrder:r}:{...e,byRepo:{...n,[t]:{repo:t,steps:{}}},repoOrder:[...r,t]}},on=(e,t,n)=>{$e(r=>{let i=an(r,e),a=i.byRepo[e],o=a.steps[t]??{status:`idle`,logs:[]};return{...i,byRepo:{...i.byRepo,[e]:{...a,steps:{...a.steps,[t]:n(o)}}}}})},sn=(e,t,n)=>{on(e,t,e=>({...e,...n}))},cn=(e,t,n)=>{on(e,t,e=>({...e,logs:[...e.logs,{ts:new Date().toISOString(),message:n}]}))},ln=async()=>{if(g){dn.current=g.changes,Ye(!0),Ze(null),$e(Zr);try{let{jobId:e}=await R(`/validate`,{method:`POST`,body:JSON.stringify({analysis:g,repo:P,secondaryRepos:pt})});u&&Wr(P||`default`,u.iid,`validate`,{jobId:e,meta:{ordinal:A}}),I.current.add(e),un(e,u?.iid??null)}catch(e){Ze(e.message),Ye(!1)}}},un=(e,t)=>{let n=P||`default`,r=()=>{et.current?.close(),et.current=null,tt.current=null,t!=null&&Kr(n,t,`validate`),Ye(!1)};et.current?.close(),tt.current=e;let i=new URLSearchParams;P&&i.set(`repo`,P),et.current=Ar(`/api/forge/jobs/${e}/stream?${i.toString()}`,e=>{let t=e.repo??P??`default`;if(e.type===`progress`)sn(t,e.step,{status:`running`,startedAt:new Date().toISOString()});else if(e.type===`log`){let n=e.message;e.step?cn(t,e.step,n):$e(e=>({...e,aggregateLogs:[...e.aggregateLogs??[],{ts:new Date().toISOString(),message:n}]}))}else if(e.type===`step_result`){let n=e.step,r=!!e.passed,i=!!e.skipped;sn(t,n,{status:i?`skipped`:r?`passed`:`failed`,passed:r,skipped:i,exitCode:e.exitCode,durationMs:e.durationMs,tail:e.tail})}else if(e.type===`repo_skipped`)$e(n=>{let r=an(n,t);return{...r,byRepo:{...r.byRepo,[t]:{...r.byRepo[t],skipped:!0,skipReason:e.reason??`skipped`}}}});else if(e.type===`repo_started`)$e(n=>{let r=an(n,t);return{...r,byRepo:{...r.byRepo,[t]:{...r.byRepo[t],projectType:e.projectType,stepOrder:e.stepOrder,fixableSteps:e.fixableSteps}}}});else if(e.type===`repo_result`)$e(n=>{let r=an(n,t);return{...r,byRepo:{...r.byRepo,[t]:{...r.byRepo[t],projectType:e.projectType??r.byRepo[t].projectType,result:{allPassed:!!e.allPassed,checkedAt:e.checkedAt??new Date().toISOString()}}}}});else if(e.type===`changes_formatted`){let t=e.files??[];if(t.length>0){let e=new Map(t.map(e=>[e.file,e.proposed]));_(t=>{if(!t)return t;let n=!1,r=t.changes.map(t=>{let r=e.get(t.file);return r!==void 0&&r!==t.proposed?(n=!0,{...t,proposed:r}):t});if(!n)return t;let i={...t,changes:r};return dn.current=r,u&&A!=null&&wr(P||`default`,u.iid,A,{result:i}),i})}}else if(e.type===`result`){let t=e.data;$e(e=>({...e,result:t})),t.allPassed&&at.current&&setTimeout(()=>{gn()},0)}else e.type===`done`?r():e.type===`error`&&($e(e=>({...e,byRepo:$r(e.byRepo)})),Ze(e.message),r())},()=>{et.current?.close(),et.current=null,tt.current=null,$e(e=>({...e,byRepo:$r(e.byRepo)})),Ze(`Lost the connection to the checks. Reload to pick them back up.`),Ye(!1)},ti)},dn=(0,x.useRef)(null);(0,x.useEffect)(()=>{let e=g?.changes??null;e&&$e(t=>!dn.current||dn.current===e||!t.result&&(t.repoOrder?.length??0)===0?t:{...t,stale:!0})},[g?.changes]),(0,x.useEffect)(()=>{if(Je||!u||A==null)return;let e=ei(Qe)?Qe:void 0;wr(P||`default`,u.iid,A,{validation:e}),k(Tr(P||`default`,u.iid))},[Je,Qe,A,u,P]),(0,x.useEffect)(()=>()=>{et.current?.close(),et.current=null,tt.current=null},[]);let I=(0,x.useRef)(new Set);(0,x.useEffect)(()=>{if(!u)return;let e=P||`default`,n=u.iid,r=Gr(e,n,`analyze`);if(!r||I.current.has(r.jobId))return;let i=!1;return R(`/jobs/${r.jobId}`).then(a=>{if(i)return;I.current.add(r.jobId);let o=r.meta??{};p([]),h([]),_(null),w(null),y([]),S(null),Re(`analyze`),a.status===`running`&&t(`analyzing`),$t(r.jobId,{submittedPrompt:o.submittedPrompt??``,model:o.model??``,existingMrIid:o.existingMrIid,issueIid:n,repoKey:e})},()=>{i||Kr(e,n,`analyze`)}),()=>{i=!0}},[u?.iid,P]),(0,x.useEffect)(()=>{if(!u)return;let e=P||`default`,n=u.iid,r=Gr(e,n,`refine`);if(!r||I.current.has(r.jobId))return;if(!g){let t=r.meta?.ordinal;if(t==null){Kr(e,n,`refine`);return}yn(t,n)||Kr(e,n,`refine`);return}let i=()=>{Kr(e,n,`refine`);let t=Tr(e,n).find(e=>e.ordinal===A);if(!t?.refineThread)return;let r=Lr(t.refineThread);r.some((e,n)=>e!==t.refineThread[n])&&(wr(e,n,t.ordinal,{refineThread:r}),y(r))},a=!1;return R(`/jobs/${r.jobId}`).then(()=>{a||(I.current.add(r.jobId),t(`reviewing`),Dn(r.jobId,{issueIid:n,repoKey:e,startingResult:g}))},()=>{a||i()}),()=>{a=!0}},[u?.iid,P,A,g]),(0,x.useEffect)(()=>{if(!u||!g)return;let e=P||`default`,t=u.iid,n=Gr(e,t,`validate`);if(!n||I.current.has(n.jobId))return;let r=n.meta?.ordinal;if(r!=null&&r!==A)return;let i=!1;return R(`/jobs/${n.jobId}`).then(()=>{i||(I.current.add(n.jobId),dn.current=g.changes,Ye(!0),Ze(null),$e(Zr),un(n.jobId,t))},()=>{i||Kr(e,t,`validate`)}),()=>{i=!0}},[u?.iid,P,A,g]),(0,x.useEffect)(()=>{if(je||Ne.length===0)return;let e=Ne[0];Pe(e=>e.slice(1)),On(e)},[je,Ne]),(0,x.useEffect)(()=>{if(!u)return;let e=P||`default`,n=u.iid,r=Gr(e,n,`ci-fix`);if(!r||I.current.has(r.jobId))return;let i=!!r.meta?.isRefine;if(i&&!g){let t=r.meta?.ordinal;if(t==null){Kr(e,n,`ci-fix`);return}yn(t,n)||Kr(e,n,`ci-fix`);return}let a=!1;return R(`/jobs/${r.jobId}`).then(o=>{if(!a){if(o.status!==`running`&&o.status!==`done`){Kr(e,n,`ci-fix`);return}I.current.add(r.jobId),p([]),h([]),w(null),Re(`ci-fix`),i?(Me(!0),t(`reviewing`)):(_(null),t(`analyzing`)),An(r.jobId,{repoKey:e,issueIid:n,isRefine:i})}},()=>{a||Kr(e,n,`ci-fix`)}),()=>{a=!0}},[u?.iid,P,g]);let fn=async()=>{if(g){re(!0),ae(null);try{j(await R(`/apply`,{method:`POST`,body:JSON.stringify({analysis:g,...rn()})})),t(`monitoring`)}catch(e){ae(e.message)}finally{re(!1)}}},pn=async()=>{if(g){re(!0),ae(null);try{j(await R(`/deploy-branch`,{method:`POST`,body:JSON.stringify({analysis:g,...rn()})})),t(`monitoring`)}catch(e){ae(e.message)}finally{re(!1)}}},mn=async e=>{if(u){re(!0),ae(null);try{let t=await R(`/promote-branch`,{method:`POST`,body:JSON.stringify({branchName:e.branchName,repo:e.repo,issueIid:u.iid})});j(e=>e?{applications:e.applications.map(e=>e.repo===t.repo&&e.branchName===t.branchName?t:e)}:{applications:[t]})}catch(e){ae(e.message)}finally{re(!1)}}},hn=async()=>{if(!g)return;let e=ie?.applications??[];if(e.length){re(!0),ae(null);try{let n=new Set(g.changes.map(e=>e.repo||P)),r=e.filter(e=>n.has(e.repo));if(!r.length)throw Error(`No existing branches match the refined changes.`);await Promise.all(r.map(e=>R(`/commit-to-branch`,{method:`POST`,body:JSON.stringify({branchName:e.branchName,analysis:{...g,changes:g.changes.filter(t=>(t.repo||P)===e.repo)},repo:e.repo})}))),se(e=>e+1),t(`monitoring`)}catch(e){ae(e.message)}finally{re(!1)}}},gn=()=>{ne||!g||((ie?.applications??[]).length>0?hn():fn())},_n=()=>{_(null),te(null),$e(Zr),Ze(null),t(`selected`)},vn=e=>{let n=O.find(t=>t.id===e);if(!n)return;_(n.result),w(null),p([]),h([]);let r=P||`default`,i=u&&Gr(r,u.iid,`refine`)?n.refineThread??[]:Lr(n.refineThread);y(i),S(n.claudeSessionId??null),u&&n.refineThread&&i.some((e,t)=>e!==n.refineThread[t])&&wr(r,u.iid,n.ordinal,{refineThread:i}),te(n.ordinal),$e(Qr(n.validation)),Ze(null),dn.current=n.validation?n.result.changes:null,t(`reviewing`)},yn=(e,n)=>{let r=n??u?.iid;if(!r)return!1;let i=P||`default`,a=Tr(i,r),o=a.find(t=>t.ordinal===e);if(!o)return!1;k(a),_(o.result),w(null),p([]),h([]);let s=Gr(i,r,`refine`)?o.refineThread??[]:Lr(o.refineThread);return y(s),S(o.claudeSessionId??null),o.refineThread&&s.some((e,t)=>e!==o.refineThread[t])&&wr(i,r,o.ordinal,{refineThread:s}),te(o.ordinal),$e(Qr(o.validation)),Ze(null),dn.current=o.validation?o.result.changes:null,t(`reviewing`),!0},bn=e=>{u&&(Er(P||`default`,u.iid,e),k(t=>t.filter(t=>t.id!==e)))},xn=()=>{u&&(Dr(P||`default`,u.iid),k([]),te(null),_(null),$e(Zr),Ze(null),dn.current=null)},Sn=()=>{let e=Or();return k([]),te(null),_(null),$e(Zr),Ze(null),dn.current=null,e},Cn=e=>{if(!u||je)return;let t=v[e];if(!t||t.kind!==`refine`||!t.prevResult)return;let n=v.slice(0,e),r=t.prevResult;y(n),_(r),S(null),A!=null&&(wr(P||`default`,u.iid,A,{refineThread:n,result:r,claudeSessionId:void 0}),k(Tr(P||`default`,u.iid)))},wn=(e,t,n)=>{F.current?.close();let r=new URLSearchParams;P&&r.set(`repo`,P),pt.length&&r.set(`secondaryRepos`,pt.join(`,`)),F.current=Ar(`/api/forge/jobs/${e}/stream?${r.toString()}`,t,n,ti)},Tn=()=>{let{result:e,byRepo:t,repoOrder:n}=Qe,r=n.map(e=>t[e]).filter(Boolean);if(!(e||r.some(e=>Object.values(e.steps).some(e=>e&&e.status!==`idle`))))return null;let i=r.map(e=>{let t={};for(let[n,r]of Object.entries(e.steps))r&&(t[n]={status:r.status,passed:r.passed,skipped:r.skipped,exitCode:r.exitCode,durationMs:r.durationMs,tail:r.tail});return{repo:e.repo,projectType:e.projectType??null,allPassed:e.result?.allPassed??null,steps:t}});return{checkedAt:e?.checkedAt??null,allPassed:e?.allPassed??null,repo:e?.repo??null,repos:i}},En=(e,t,n,r,{persist:i})=>{y(a=>{let o=Ir(a,n,r);return i&&o!==a&&A!=null&&(wr(e,t,A,{refineThread:o}),k(Tr(e,t))),o})},Dn=(e,t)=>{let{issueIid:n,repoKey:r,startingResult:i}=t,a=null,o=null;Me(!0),w(null),p([]),Ie([]),F.current?.close();let s=new URLSearchParams;P&&s.set(`repo`,P),pt.length&&s.set(`secondaryRepos`,pt.join(`,`)),F.current=Ar(`/api/forge/jobs/${e}/stream?${s.toString()}`,e=>{if(e.type===`progress`)p(t=>jr(t,e.step,e.message));else if(e.type===`log`){let t=e.message;h(e=>[...e,{ts:new Date().toISOString(),message:t}]),Ie(e=>[...e,t])}else if(e.type===`session`){let t=e.sessionId;t&&(o=t,S(t))}else if(e.type===`answer`){let t=e.text??``;y(e=>{if(e.length===0)return e;let n=e[e.length-1];return[...e.slice(0,-1),{...n,explanation:t,kind:`answer`}]})}else if(e.type===`result`){let t=e.data;a=t,_(t),y(e=>{if(e.length===0)return e;let n=e[e.length-1];return[...e.slice(0,-1),{...n,explanation:t.explanation,kind:`refine`,prevResult:i}]})}else e.type===`done`?(F.current?.close(),F.current=null,Me(!1),Ie([]),Kr(r,n,`refine`),y(e=>{if(A!=null){let t={refineThread:e};a&&(t.result=a),o&&(t.claudeSessionId=o),wr(r,n,A,t),k(Tr(r,n))}return e})):(e.type===`error`||e.type===`cancelled`)&&(F.current?.close(),F.current=null,Kr(r,n,`refine`),e.type===`error`?(w(e.message),En(r,n,`failed`,Fr(e.message),{persist:!0})):En(r,n,`canceled`,Nr,{persist:!0}),Me(!1),Ie([]))},()=>{F.current?.close(),F.current=null,w(`Connection lost during refinement.`),En(r,n,`failed`,Pr,{persist:!1}),Me(!1),Ie([])},ti)},On=async e=>{if(!g||!u)return;if(je){Pe(t=>[...t,e]);return}let t=g;Me(!0),w(null),p([]),Ie([]);let n=[...v,{feedback:e}];y(n);let r=null,i=!1,a=b;try{let{jobId:o}=await R(`/issues/${u.iid}/refine`,{method:`POST`,body:JSON.stringify({feedback:e,previousChanges:g.changes,validationState:Tn(),repo:P,secondaryRepos:pt,agent:wt,...b?{claudeSessionId:b}:{}})}),s=P||`default`,c=u.iid;Wr(s,c,`refine`,{jobId:o,meta:{ordinal:A}}),A!=null&&(wr(s,c,A,{refineThread:n}),k(Tr(s,c))),I.current.add(o),wn(o,e=>{if(e.type===`progress`)p(t=>jr(t,e.step,e.message));else if(e.type===`log`){let t=e.message;h(e=>[...e,{ts:new Date().toISOString(),message:t}]),Ie(e=>[...e,t])}else if(e.type===`session`){let t=e.sessionId;t&&(a=t,S(t))}else if(e.type===`answer`){i=!0;let t=e.text??``;y(e=>{if(e.length===0)return e;let n=e[e.length-1];return[...e.slice(0,-1),{...n,explanation:t,kind:`answer`}]})}else if(e.type===`result`){let n=e.data;r=n,_(n),y(e=>{if(e.length===0)return e;let r=e[e.length-1];return[...e.slice(0,-1),{...r,explanation:n.explanation,kind:`refine`,prevResult:t}]})}else e.type===`done`?(F.current?.close(),F.current=null,Me(!1),Ie([]),Kr(s,c,`refine`),y(e=>{if(u&&A!=null){let t={refineThread:e};r&&(t.result=r),a&&(t.claudeSessionId=a),wr(P||`default`,u.iid,A,t),k(Tr(P||`default`,u.iid))}return e}),nt.current&&(nt.current=!1,!i&&r&&setTimeout(()=>{ln()},0))):(e.type===`error`||e.type===`cancelled`)&&(F.current?.close(),F.current=null,Kr(s,c,`refine`),e.type===`error`?(w(e.message),En(s,c,`failed`,Fr(e.message),{persist:!0})):En(s,c,`canceled`,Nr,{persist:!0}),Me(!1),Ie([]),nt.current=!1)},()=>{F.current?.close(),F.current=null,w(`Connection lost during refinement.`),En(s,c,`failed`,Pr,{persist:!1}),Me(!1),Ie([]),nt.current=!1})}catch(e){w(e.message),En(P||`default`,u.iid,`failed`,Fr(e.message),{persist:!1}),Me(!1),Ie([]),nt.current=!1}},kn=(e,t)=>{let n=`The pre-flight ${e===`lint`?`lint`:e===`typecheck`?`typecheck`:e===`test`?`test suite`:e} check failed when validating the proposed changes against the real repo. Fix the errors below without altering unrelated behaviour, and keep the change surgical:\n\n${t?.trim()||`(no output captured for ${e})`}`;nt.current=!0,On(n)},An=(e,n)=>{let{repoKey:r,issueIid:i,isRefine:a}=n;F.current?.close();let o=new URLSearchParams;P&&o.set(`repo`,P),pt.length&&o.set(`secondaryRepos`,pt.join(`,`)),F.current=Ar(`/api/forge/jobs/${e}/stream?${o.toString()}`,e=>{e.type===`progress`?p(t=>jr(t,e.step,e.message)):e.type===`log`?h(t=>[...t,{ts:new Date().toISOString(),message:e.message}]):e.type===`result`?_(e.data):e.type===`done`?(F.current?.close(),F.current=null,Kr(r,i,`ci-fix`),a&&Me(!1),t(`reviewing`)):e.type===`error`&&(F.current?.close(),F.current=null,Kr(r,i,`ci-fix`),w(e.message),a&&Me(!1),t(`reviewing`))},()=>{F.current?.close(),F.current=null,w(a?`Connection lost during CI fix.`:`Connection lost during CI fix analysis.`),a&&Me(!1),t(`reviewing`)},ti)},jn=async(e,n,r)=>{if(!u)return;let i=r||P,a=`?repo=${encodeURIComponent(i)}`,o=await Promise.all(e.map(e=>R(`/jobs/${e}/trace${a}`).then(e=>e,()=>({trace:`(trace unavailable for job ${e})`})))),s=o.map(e=>e.parsed?.fingerprint).filter(e=>!!e).join(`|`)||null,c=qe.current,l=Ve+1;if(s&&s===Ue){if(l>c){let e=o.map(e=>e.parsed?.summary).filter(Boolean).join(`
12
+ `)||`Same error repeating`;Ke(`CI fix loop detected: the same error has persisted across ${l-1} attempts. The AI keeps making unrelated changes instead of fixing the actual error.\n\nError: ${e}\n\nConsider fixing this manually or providing more specific instructions in the prompt field.`);return}}else s&&(He(0),Ke(null));He(l),We(s);let d=o.map((t,n)=>{let r=t.trace.split(`
13
+ `),a=r.length>150?r.slice(-150).join(`
14
+ `):t.trace;return`--- Job ${e[n]} (${i}) ---\n${a}`}).join(`
15
+
16
+ `),f=n?.trim()?`${d}\n\n--- User instructions ---\n${n.trim()}`:d;Re(`ci-fix`);let m=P||`default`,v=u.iid;if(g){Me(!0),w(null),p([]);try{let{jobId:e}=await R(`/issues/${u.iid}/refine`,{method:`POST`,body:JSON.stringify({ciContext:f,previousChanges:g.changes,repo:P,secondaryRepos:pt,agent:wt})});Wr(m,v,`ci-fix`,{jobId:e,meta:{isRefine:!0,ordinal:A}}),I.current.add(e),An(e,{repoKey:m,issueIid:v,isRefine:!0})}catch(e){w(e.message),Me(!1)}return}let{jobId:y}=await R(`/issues/${u.iid}/ci-fix`,{method:`POST`,body:JSON.stringify({ciContext:f,model:bt,repo:P,secondaryRepos:pt,agent:wt})});p([]),h([]),_(null),w(null),t(`analyzing`),Wr(m,v,`ci-fix`,{jobId:y,meta:{isRefine:!1}}),I.current.add(y),An(y,{repoKey:m,issueIid:v,isRefine:!1})},Mn=async()=>{if(u){Oe(!0),Ae(null);try{let e=await R(`/issues/${u.iid}/resolution-check`,{method:`POST`,body:JSON.stringify({repo:P,secondaryRepos:pt,agent:wt})});Ee(e),e.cost??e.inputTokens}catch(e){Ae(e.message)}finally{Oe(!1)}}},Nn=()=>{ce&&(j({applications:[{repo:P,branchName:ce.branchName,mr:{iid:ce.iid,web_url:ce.web_url,title:ce.title},pipelineUrl:null}]}),t(`monitoring`))},Pn=async()=>{u&&(await R(`/issues/${u.iid}/close`,{method:`POST`,body:JSON.stringify({repo:P})}),r(e=>e.filter(e=>e.iid!==u.iid)),Ln())},Fn=async()=>{u&&(await R(`/issues/${u.iid}?repo=${encodeURIComponent(P)}`,{method:`DELETE`}),r(e=>e.filter(e=>e.iid!==u.iid)),Ln())},In=()=>{F.current?.close(),F.current=null,et.current?.close(),et.current=null,tt.current=null,I.current.clear(),Ye(!1),Me(!1),Pe([]),te(null),$e(Zr),Ze(null),t(`selected`)},Ln=()=>{At.current+=1,Ot.current?.abort(),F.current?.close(),F.current=null,I.current.clear(),d(null),le(null),ue(!1),fe([]),me([]),ge(!1),Ee(null),Ae(null),_(null),k([]),te(null),j(null),p([]),h([]),w(null),ae(null),Me(!1),Pe([]),$e(Zr),Ze(null),t(`idle`)};return{phase:e,setPhase:t,issues:n,issuesLoading:i,issuesError:c,selectedIssue:u,progressSteps:f,analysisLogs:m,analysisResult:g,analysisError:C,applying:ne,applyResult:ie,applyError:M,pipelineRefreshKey:oe,refining:je,analysisMode:Le,analysisPrompt:ze,setAnalysisPrompt:Be,existingMr:ce,existingMrLoading:N,mergedMrs:de,issueEnvironments:pe,issueEnvironmentsLoading:he,openMRs:_e,openMRsLoading:ye,openMRsError:Ce,storedAnalyses:O,currentOrdinal:A,handleRestoreAnalysis:vn,restoreAnalysisByOrdinal:yn,handleDiscardStoredAnalysis:bn,handleClearIssueCache:xn,handleDestroyAllAnalyses:Sn,handleUndoRefine:Cn,formatAnalysisDate:kr,reloadStatus:It,loadIssues:zt,loadOpenMRs:Bt,handleSelectMR:Jt,handleCreateIssue:Yt,handleUpdateIssue:Xt,handleSelectIssue:Qt,handleBeginAnalysis:en,handleFreshReanalyze:tn,handleCancelAnalysis:nn,handleApprove:fn,handleDeployBranch:pn,handlePromoteBranch:mn,handleCommitToBranch:hn,handleReject:_n,handleRefine:On,handleRefinePipelineFailure:jn,handleCheckResolution:Mn,resolutionCheck:Te,resolutionChecking:De,resolutionError:ke,handleViewExistingMr:Nn,handleCloseIssue:Pn,handleDeleteIssue:Fn,handleBackToIssue:In,handleReset:Ln,availableRepos:st,selectedRepo:P,setSelectedRepo:ut,selectedSecondaryRepos:pt,setSelectedSecondaryRepos:ht,testDeployUrlTemplate:dt,availableModels:gt,selectedModel:bt,setSelectedModel:Et,availableAgents:St,selectedAgent:wt,setSelectedAgent:Dt,validating:Je,validationError:Xe,validation:Qe,handleValidate:ln,handleFixValidation:kn,autoPushOnValidatePass:rt,setAutoPushOnValidatePass:ot,refineThread:v,refineQueue:Ne,thinkingLogs:Fe,backendError:T,statusLoaded:vt,issuesLoaded:o,openMRsLoaded:xe,backendRetrying:ee,retryBackend:Lt,remoteActiveIids:Vt,remoteJobId:Ut,ciFixAttempts:Ve,ciFixLoopWarning:Ge,ciFixMaxAttempts:qe.current,dismissCiFixLoopWarning:()=>{Ke(null),He(0),We(null)}}}var si=`setPhase.setAnalysisPrompt.setAutoPushOnValidatePass.setSelectedModel.setSelectedAgent.setSelectedRepo.setSelectedSecondaryRepos.reloadStatus.handleSelectMR.handleCreateIssue.handleUpdateIssue.handleSelectIssue.handleBeginAnalysis.handleFreshReanalyze.handleCancelAnalysis.handleApprove.handleDeployBranch.handlePromoteBranch.handleCommitToBranch.handleReject.handleRefine.handleUndoRefine.handleRefinePipelineFailure.handleCheckResolution.handleRestoreAnalysis.restoreAnalysisByOrdinal.handleDiscardStoredAnalysis.handleClearIssueCache.handleDestroyAllAnalyses.handleViewExistingMr.handleCloseIssue.handleDeleteIssue.handleBackToIssue.handleReset.handleValidate.handleFixValidation.loadIssues.loadOpenMRs.formatAnalysisDate.retryBackend.dismissCiFixLoopWarning`.split(`.`),ci=(0,x.createContext)(null),li=(0,x.createContext)(null),ui=(0,x.createContext)(null),di=new Set(si);function fi(e){let t={},n={};for(let[r,i]of Object.entries(e))di.has(r)?n[r]=i:t[r]=i;return{state:t,actions:n}}function pi({children:e}){let{state:t,actions:n}=fi(oi()),[r,i]=(0,x.useState)(`issue`),[a,o]=(0,x.useState)(!1),[s,c]=(0,x.useState)(!1);return(0,L.jsx)(ci.Provider,{value:t,children:(0,L.jsx)(li.Provider,{value:n,children:(0,L.jsx)(ui.Provider,{value:{activeDetailTab:r,setActiveDetailTab:i,mrMerged:a,setMrMerged:o,taskModalOpen:s,setTaskModalOpen:c},children:e})})})}function mi(e,t){let n=(0,x.useContext)(e);if(!n)throw Error(`${t} must be used inside <ForgeProvider>`);return n}var V=()=>mi(ci,`useForgeState`),H=()=>mi(li,`useForgeActions`),hi=()=>mi(ui,`useForgeUI`);function gi(){let{availableRepos:e,selectedRepo:t,statusLoaded:n}=V(),{setSelectedRepo:r}=H(),i=e.find(e=>e.id===t)?.label??(n?`No repository`:``);return e.length<2?(0,L.jsx)(`div`,{className:`h-4 truncate text-[12px] leading-4 text-fg-subtle ${n?``:`w-16 animate-pulse rounded bg-surface-hover`}`,children:i},`single`):(0,L.jsxs)(`div`,{className:`relative flex h-4 min-w-0 items-center gap-1 text-[12px] leading-4 text-fg-muted hover:text-fg`,children:[(0,L.jsx)(`span`,{className:`truncate`,children:i}),(0,L.jsx)(B,{name:`chevronDown`,size:12,className:`shrink-0`}),(0,L.jsx)(`select`,{"aria-label":`Repository`,value:t,onChange:e=>r(e.target.value),className:`absolute inset-0 cursor-pointer opacity-0`,children:e.map(e=>(0,L.jsx)(`option`,{value:e.id,children:e.label},e.id))})]},`multi`)}var _i=[`viewer`,`operator`,`approver`,`admin`],vi={viewer:`Viewer`,operator:`Operator`,approver:`Approver`,admin:`Admin`},yi={viewer:`Read issues, merge requests, pipelines and runs.`,operator:`Analyze issues, refine fixes, validate and open merge requests.`,approver:`Everything an operator can do, plus merge and close merge requests.`,admin:`Full access, including connections, repositories, members and the audit log.`},bi=(e,t)=>_i.indexOf(e)>=_i.indexOf(t);function xi(){let[e,t]=(0,x.useState)(!1),{user:n,signOut:r}=Ui(),i=(0,x.useRef)(null);return(0,x.useEffect)(()=>{if(!e)return;let n=e=>{i.current&&!i.current.contains(e.target)&&t(!1)},r=e=>e.key===`Escape`&&t(!1);return document.addEventListener(`mousedown`,n),document.addEventListener(`keydown`,r),()=>{document.removeEventListener(`mousedown`,n),document.removeEventListener(`keydown`,r)}},[e]),(0,L.jsxs)(`div`,{ref:i,className:`relative`,children:[e&&(0,L.jsxs)(`div`,{role:`menu`,className:`absolute bottom-full left-0 right-0 mb-1.5 overflow-hidden rounded-lg bg-surface-raised p-1 shadow-overlay animate-pop-in`,children:[(0,L.jsxs)(`div`,{className:`px-2.5 py-2`,children:[(0,L.jsx)(`div`,{className:`truncate text-sm text-fg`,children:n.email}),(0,L.jsx)(`div`,{className:`text-[11px] text-fg-subtle`,children:vi[n.role]})]}),(0,L.jsx)(`div`,{className:`my-1 h-px bg-line`}),(0,L.jsxs)(`button`,{role:`menuitem`,onClick:()=>{t(!1),r()},className:`flex w-full items-center gap-2 rounded-md px-2.5 py-1.5 text-left text-sm text-fg-muted hover:bg-surface-hover hover:text-fg`,children:[(0,L.jsx)(B,{name:`logout`,size:14}),` Sign out`]})]}),(0,L.jsxs)(`button`,{onClick:()=>t(e=>!e),className:`flex h-10 w-full items-center gap-2.5 rounded-lg px-2 text-sm text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg`,"aria-expanded":e,"aria-haspopup":`menu`,children:[(0,L.jsx)(`span`,{className:`flex size-7 shrink-0 items-center justify-center rounded-full bg-gradient-to-br from-violet-500 to-indigo-600 text-[11px] font-semibold text-on-accent`,children:n.name.slice(0,1).toUpperCase()}),(0,L.jsxs)(`span`,{className:`min-w-0 flex-1 text-left leading-tight`,children:[(0,L.jsx)(`span`,{className:`block truncate text-fg`,children:n.name}),(0,L.jsx)(`span`,{className:`block text-[11px] text-fg-subtle`,children:vi[n.role]})]}),(0,L.jsx)(B,{name:`more`,size:14,className:`text-fg-subtle`})]}),(0,L.jsxs)(`p`,{className:`mt-1 text-center text-[10px] tabular-nums text-fg-subtle opacity-60`,children:[`v`,`1.35.0`]})]})}function Si({count:e,active:t}){let n=!e;return(0,L.jsx)(`span`,{"data-testid":`count-badge`,"aria-hidden":n||void 0,className:Gn(`min-w-6 rounded-md px-1.5 text-center text-[11px] font-medium tabular-nums leading-5`,t?`bg-surface text-fg`:`bg-surface-hover text-fg-subtle`,n&&`invisible`),children:e??0})}function Ci({label:e,icon:t,active:n,onClick:r,badgeCount:i,showBadge:a=!0}){return(0,L.jsxs)(`button`,{type:`button`,onClick:r,"aria-current":n?`page`:void 0,className:Gn(`flex h-8 w-full items-center gap-2.5 rounded-lg px-2.5 text-sm transition-colors`,n?`bg-surface-hover font-medium text-fg`:`text-fg-muted hover:bg-surface-hover/60 hover:text-fg`),children:[(0,L.jsx)(B,{name:t,className:n?`text-accent-fg`:`text-fg-subtle`}),(0,L.jsx)(`span`,{className:`flex-1 text-left`,children:e}),a&&(0,L.jsx)(Si,{count:i,active:n})]})}var wi=(0,x.createContext)(null);function Ti({basePath:e=``,children:t}){let n=ct(),r=at(),i=e.replace(/\/+$/,``),a=(0,x.useCallback)((e,t)=>{n(`${i}${e}`,t)},[n,i]),o=(0,x.useMemo)(()=>{let e=r.pathname;return i&&e.startsWith(i)?e.slice(i.length)||`/`:e},[r.pathname,i]),s=(0,x.useMemo)(()=>({navigate:a,pathname:o,search:r.search,basePath:i}),[a,o,r.search,i]);return(0,L.jsx)(wi.Provider,{value:s,children:t})}function Ei(){let e=(0,x.useContext)(wi);if(!e)throw Error(`useForgeRouter must be used inside <ForgeRouterProvider>`);return e}var Di=[{path:`/issues`,label:`Issues`,icon:`issues`,section:`primary`,adminOnly:!1,preloadMRs:!1,keywords:[]},{path:`/mrs`,label:`Merge requests`,icon:`mergeRequest`,section:`primary`,adminOnly:!1,preloadMRs:!0,keywords:[`mr`,`pull`]},{path:`/pipelines`,label:`Pipelines`,icon:`pipeline`,section:`primary`,adminOnly:!1,preloadMRs:!0,keywords:[`ci`]},{path:`/settings`,label:`Settings`,icon:`settings`,section:`workspace`,adminOnly:!1,preloadMRs:!1,keywords:[`config`,`tokens`,`repos`]},{path:`/members`,label:`Members`,icon:`users`,section:`workspace`,adminOnly:!0,preloadMRs:!1,keywords:[`users`,`roles`,`team`]},{path:`/audit`,label:`Audit log`,icon:`shield`,section:`workspace`,adminOnly:!0,preloadMRs:!1,keywords:[`activity`,`security`]}];function Oi(e,t){return e===t||e.startsWith(`${t}/`)}function ki(e){return Di.find(t=>Oi(e,t.path))}function Ai(){let{can:e}=Ui(),t=e(`admin`);return Di.filter(e=>t||!e.adminOnly)}function U(){let{issues:e,issuesLoaded:t,openMRs:n,openMRsLoading:r}=V(),{loadOpenMRs:i}=H(),{navigate:a,pathname:o}=Ei(),s=Ai(),c={"/issues":t?e.length:void 0,"/mrs":n.length,"/pipelines":n.filter(e=>e.pipeline).length};return s.map(e=>({...e,active:Oi(o,e.path),badgeCount:c[e.path],go:()=>{a(e.path,{replace:!0}),e.preloadMRs&&n.length===0&&!r&&i()}}))}function ji(){let e=U();return(0,L.jsx)(`nav`,{"aria-label":`Primary`,className:`flex flex-col gap-0.5`,children:e.map((t,n)=>(0,L.jsxs)(x.Fragment,{children:[t.section===`workspace`&&e[n-1]?.section!==`workspace`&&(0,L.jsx)(`div`,{className:`px-2.5 pb-1 pt-5 text-xs font-medium text-fg-subtle`,children:`Workspace`}),(0,L.jsx)(Ci,{label:t.label,icon:t.icon,active:t.active,onClick:t.go,badgeCount:t.badgeCount,showBadge:t.section===`primary`})]},t.path))})}function Mi({size:e=28}){return(0,L.jsx)(`span`,{className:`flex shrink-0 items-center justify-center rounded-lg bg-gradient-to-br from-violet-500 to-indigo-600 text-on-accent shadow-sm`,style:{width:e,height:e},"aria-hidden":!0,children:(0,L.jsx)(`svg`,{width:e*.55,height:e*.55,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2.2,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,L.jsx)(`path`,{d:`M4 20h16M7 16h10l-1.5-5h-7L7 16Zm1.5-5L10 4h4l1.5 7`})})})}function Ni({open:e,onClose:t}){let{setTaskModalOpen:n}=hi(),{preference:r,setPreference:i}=ir(),{can:a}=Ui();return(0,x.useEffect)(()=>{if(!e)return;let n=e=>e.key===`Escape`&&t();return document.addEventListener(`keydown`,n),()=>document.removeEventListener(`keydown`,n)},[e,t]),(0,L.jsxs)(L.Fragment,{children:[e&&(0,L.jsx)(`div`,{"aria-hidden":!0,className:`fixed inset-0 z-40 bg-black/40 lg:hidden`,onClick:t}),(0,L.jsxs)(`aside`,{className:Gn(`w-60 shrink-0 flex-col border-r border-line bg-surface lg:static lg:flex`,e?`fixed inset-y-0 left-0 z-50 flex shadow-overlay animate-[forge-slide-in_280ms_cubic-bezier(0.32,0.72,0,1)] pt-[env(safe-area-inset-top)]`:`hidden`),children:[(0,L.jsxs)(`div`,{className:`flex h-14 items-center gap-2.5 px-4`,children:[(0,L.jsx)(Mi,{}),(0,L.jsxs)(`div`,{className:`min-w-0 leading-tight`,children:[(0,L.jsx)(`div`,{className:`text-sm font-semibold tracking-tight text-fg`,children:`Forge`}),(0,L.jsx)(gi,{})]})]}),(0,L.jsxs)(`div`,{className:`flex flex-1 flex-col gap-4 overflow-y-auto px-3 pb-3 pt-2`,children:[(0,L.jsxs)(z,{variant:`primary`,className:`w-full`,disabled:!a(`operator`),title:a(`operator`)?void 0:`Requires the operator role`,onClick:()=>n(!0),children:[(0,L.jsx)(B,{name:`plus`,size:15}),` New task`]}),(0,L.jsx)(ji,{})]}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-2 border-t border-line p-3 pb-[max(0.75rem,env(safe-area-inset-bottom))]`,children:[(0,L.jsx)(or,{value:r,onChange:i}),(0,L.jsx)(xi,{})]})]})]})}function Pi({title:e,subtitle:t,children:n}){return(0,L.jsx)(`main`,{className:`flex min-h-screen items-center justify-center bg-canvas px-4 py-12`,children:(0,L.jsxs)(`div`,{className:`w-full max-w-sm`,children:[(0,L.jsxs)(`div`,{className:`mb-8 flex flex-col items-center gap-4 text-center`,children:[(0,L.jsx)(Mi,{size:40}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`h1`,{className:`text-xl font-semibold tracking-tight text-fg`,children:e}),(0,L.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:t})]})]}),(0,L.jsx)(`div`,{className:`rounded-2xl border border-line bg-surface-raised p-6 shadow-sm`,children:n})]})})}var Fi=`h-10 w-full rounded-lg border border-line bg-canvas px-3 text-sm text-fg placeholder:text-fg-subtle focus:border-accent-hover focus:outline-none`;function Ii({message:e}){return(0,L.jsx)(`p`,{role:e?`alert`:void 0,className:e?`rounded-lg bg-red-950/50 px-3 py-2 text-sm text-red-300 ring-1 ring-inset ring-red-800/60`:`hidden`,children:e})}function Li({sso:e,onSignedIn:t}){let[n,r]=(0,x.useState)(``),[i,a]=(0,x.useState)(``),[o,s]=(0,x.useState)(null),[c,l]=(0,x.useState)(!1);return(0,L.jsx)(Pi,{title:`Sign in to Forge`,subtitle:`Use your work account to continue.`,children:(0,L.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[e&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(z,{variant:`secondary`,className:`h-10 w-full`,onClick:()=>{window.location.assign(Wn.ssoStartUrl(window.location.pathname+window.location.search))},children:[`Continue with `,e.name]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-3 text-xs text-fg-subtle`,children:[(0,L.jsx)(`span`,{className:`h-px flex-1 bg-line`}),`or use a password`,(0,L.jsx)(`span`,{className:`h-px flex-1 bg-line`})]})]}),(0,L.jsxs)(`form`,{onSubmit:async e=>{e.preventDefault(),l(!0),s(null);try{await Wn.login(n,i),t()}catch(e){s(e.message)}finally{l(!1)}},className:`flex flex-col gap-4`,children:[(0,L.jsxs)(`label`,{className:`flex flex-col gap-1.5 text-sm font-medium text-fg`,children:[`Email`,(0,L.jsx)(`input`,{type:`email`,autoComplete:`username`,required:!0,value:n,onChange:e=>r(e.target.value),className:Fi})]}),(0,L.jsxs)(`label`,{className:`flex flex-col gap-1.5 text-sm font-medium text-fg`,children:[`Password`,(0,L.jsx)(`input`,{type:`password`,autoComplete:`current-password`,required:!0,value:i,onChange:e=>a(e.target.value),className:Fi})]}),(0,L.jsx)(Ii,{message:o}),(0,L.jsx)(z,{type:`submit`,variant:`primary`,className:`h-10 w-full`,disabled:c,children:c?`Signing in…`:`Sign in`})]})]})})}function Ri({requiresToken:e,onDone:t}){let[n,r]=(0,x.useState)({name:``,email:``,password:``,setupToken:``}),[i,a]=(0,x.useState)(null),[o,s]=(0,x.useState)(!1),c=e=>t=>r(n=>({...n,[e]:t.target.value}));return(0,L.jsx)(Pi,{title:`Set up Forge`,subtitle:`Create the first admin account for this workspace.`,children:(0,L.jsxs)(`form`,{onSubmit:async r=>{r.preventDefault(),s(!0),a(null);try{await Wn.setup(e?n:{...n,setupToken:void 0}),t()}catch(e){a(e.message)}finally{s(!1)}},className:`flex flex-col gap-4`,children:[(0,L.jsxs)(`label`,{className:`flex flex-col gap-1.5 text-sm font-medium text-fg`,children:[`Your name`,(0,L.jsx)(`input`,{autoComplete:`name`,required:!0,value:n.name,onChange:c(`name`),className:Fi})]}),(0,L.jsxs)(`label`,{className:`flex flex-col gap-1.5 text-sm font-medium text-fg`,children:[`Work email`,(0,L.jsx)(`input`,{type:`email`,autoComplete:`username`,required:!0,value:n.email,onChange:c(`email`),className:Fi})]}),(0,L.jsxs)(`label`,{className:`flex flex-col gap-1.5 text-sm font-medium text-fg`,children:[`Password`,(0,L.jsx)(`input`,{type:`password`,autoComplete:`new-password`,required:!0,minLength:12,value:n.password,onChange:c(`password`),className:Fi}),(0,L.jsx)(`span`,{className:`text-xs font-normal text-fg-subtle`,children:`At least 12 characters.`})]}),e&&(0,L.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,L.jsxs)(`label`,{className:`flex flex-col gap-1.5 text-sm font-medium text-fg`,children:[`Setup code`,(0,L.jsx)(`input`,{autoComplete:`off`,required:!0,"aria-describedby":`setup-code-hint`,value:n.setupToken,onChange:c(`setupToken`),className:`h-10 w-full rounded-lg border border-line bg-canvas px-3 text-sm text-fg placeholder:text-fg-subtle focus:border-accent-hover focus:outline-none`})]}),(0,L.jsx)(`span`,{id:`setup-code-hint`,className:`text-xs text-fg-subtle`,children:`Printed in the server log on first start (or your FORGE_TOKEN, if set). It proves you operate this install.`})]}),(0,L.jsx)(Ii,{message:i}),(0,L.jsx)(z,{type:`submit`,variant:`primary`,className:`h-10 w-full`,disabled:o,children:o?`Creating…`:`Create admin account`})]})})}var zi=(0,x.createContext)(null),Bi=700;function Vi(){let e=window.__forgeBootT??0;return Math.round((performance.now()-e)%Bi)}function Hi({children:e}){let[t,n]=(0,x.useState)(null),[r,i]=(0,x.useState)(null),a=(0,x.useRef)(null),o=()=>a.current??=Wn.me().then(e=>{n(e),i(null)}).catch(e=>i(e.message)).finally(()=>{a.current=null});if((0,x.useEffect)(()=>{o();let e=()=>o();return window.addEventListener(Hn,e),()=>window.removeEventListener(Hn,e)},[]),r&&!t)return(0,L.jsxs)(`div`,{role:`alert`,className:`flex min-h-screen flex-col items-center justify-center gap-3 bg-canvas px-4 text-center`,children:[(0,L.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:`Forge couldn't load your session.`}),(0,L.jsx)(`p`,{className:`max-w-sm text-sm text-fg-muted`,children:r}),(0,L.jsx)(`button`,{onClick:o,className:`text-sm text-accent-fg hover:underline`,children:`Try again`})]});if(!t)return(0,L.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-canvas`,"aria-busy":`true`,children:(0,L.jsx)(`div`,{className:`size-5 animate-spin rounded-full border-2 border-line-strong border-t-violet-500`,style:{animationDelay:`-${Vi()}ms`}})});if(t.needsSetup)return(0,L.jsx)(Ri,{requiresToken:t.setupRequiresToken??!0,onDone:o});if(!t.user)return(0,L.jsx)(Li,{sso:t.sso,onSignedIn:o});let s=t.user,c={user:s,can:e=>bi(s.role,e),signOut:async()=>{await Wn.logout().catch(()=>void 0),await o()}};return(0,L.jsx)(zi.Provider,{value:c,children:e})}function Ui(){let e=(0,x.useContext)(zi);if(!e)throw Error(`useSession must be used inside <AuthGate>`);return e}var Wi={neutral:`bg-surface-hover/70 text-fg ring-line-strong/60`,accent:`bg-violet-950/60 text-violet-300 ring-violet-800/60`,success:`bg-emerald-950/60 text-emerald-300 ring-emerald-800/60`,warning:`bg-amber-950/60 text-amber-300 ring-amber-800/60`,danger:`bg-red-950/60 text-red-300 ring-red-800/60`,info:`bg-sky-950/60 text-sky-300 ring-sky-800/60`};function Gi({tone:e=`neutral`,dot:t,className:n,children:r}){return(0,L.jsxs)(`span`,{className:Gn(`inline-flex items-center gap-1.5 rounded-md px-1.5 py-0.5 text-[11px] font-medium ring-1 ring-inset whitespace-nowrap`,Wi[e],n),children:[t&&(0,L.jsx)(`span`,{className:`size-1.5 rounded-full bg-current`,"aria-hidden":!0}),r]})}function Ki({icon:e,title:t,description:n,action:r}){return(0,L.jsxs)(`div`,{className:`flex min-h-[40vh] flex-col items-center justify-center gap-3 rounded-xl border border-dashed border-line px-6 py-12 text-center`,children:[(0,L.jsx)(`div`,{className:`flex size-11 items-center justify-center rounded-2xl bg-surface-hover text-fg-muted ring-1 ring-line`,children:(0,L.jsx)(B,{name:e,size:20})}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:t}),n&&(0,L.jsx)(`p`,{className:`mt-1 max-w-sm text-sm text-fg-muted`,children:n})]}),r]})}function qi({title:e,description:t,actions:n}){return(0,L.jsxs)(`header`,{className:`flex flex-wrap items-end justify-between gap-4`,children:[(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsx)(`h1`,{className:`text-xl font-semibold tracking-tight text-fg`,children:e}),t&&(0,L.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:t})]}),n&&(0,L.jsx)(`div`,{className:`flex items-center gap-2`,children:n})]})}var Ji=(e,t,n)=>R(t,{method:e,body:n===void 0?void 0:JSON.stringify(n)}),Yi={listMembers:()=>R(`/admin/users`),addMember:e=>Ji(`POST`,`/admin/users`,e),updateMember:(e,t)=>Ji(`PATCH`,`/admin/users/${e}`,t),listAudit:e=>{let t=new URLSearchParams;return e.action&&t.set(`action`,e.action),e.before&&t.set(`before`,String(e.before)),R(`/admin/audit?${t}`)},listTokens:()=>R(`/auth/tokens`),createToken:e=>Ji(`POST`,`/auth/tokens`,{name:e}),revokeToken:e=>Ji(`DELETE`,`/auth/tokens/${e}`)},Xi=new Intl.DateTimeFormat(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`}),Zi=e=>e?Xi.format(new Date(e)):`—`,Qi={"auth.setup":`Set up Forge`,"auth.login":`Signed in`,"auth.sso_login":`Signed in with SSO`,"auth.logout":`Signed out`,"user.create":`Added member`,"user.update":`Updated member`,"token.create":`Created API token`,"token.revoke":`Revoked API token`,"PUT /config":`Changed workspace settings`,"DELETE /workspaces":`Deleted local workspace`,"POST /workspaces/purge":`Purged local workspaces`,"POST /issues":`Created issue`,"PUT /issues/:iid":`Edited issue`,"POST /issues/:iid/close":`Closed issue`,"DELETE /issues/:iid":`Deleted issue`,"POST /issues/:iid/analyze":`Started analysis`,"POST /issues/:iid/refine":`Refined fix`,"POST /issues/:iid/ci-fix":`Asked AI to fix CI`,"POST /issues/:iid/resolution-check":`Checked resolution`,"POST /validate":`Ran validation`,"POST /apply":`Opened merge request`,"POST /commit-to-branch":`Committed to branch`,"POST /promote-branch":`Promoted branch`,"POST /deploy-branch":`Deployed branch`,"POST /jobs/:jobId/cancel":`Cancelled job`,"POST /mr/:mrIid/merge":`Merged merge request`,"POST /mr/:mrIid/auto-merge":`Enabled auto-merge`,"POST /mr/:mrIid/cancel-auto-merge":`Cancelled auto-merge`,"POST /mr/:mrIid/close":`Closed merge request`,"POST /mr/:mrIid/reopen":`Reopened merge request`,"POST /mr/:mrIid/rebase":`Rebased merge request`,"POST /mr/:mrIid/draft":`Changed draft status`};function $i(e){return Qi[e]??e}var ea={success:{label:`Success`,tone:`success`},failure:{label:`Failed`,tone:`danger`},denied:{label:`Denied`,tone:`warning`}},ta=[{value:``,label:`All activity`},{value:`auth.login`,label:`Sign-ins`},{value:`auth.sso_login`,label:`SSO sign-ins`},{value:`POST /mr/:mrIid/merge`,label:`Merges`},{value:`POST /apply`,label:`Merge requests opened`},{value:`PUT /config`,label:`Settings changes`},{value:`user.update`,label:`Member changes`}];function na(){let[e,t]=(0,x.useState)(``),[n,r]=(0,x.useState)(null),[i,a]=(0,x.useState)(null),[o,s]=(0,x.useState)(null);return(0,x.useEffect)(()=>{r(null),Yi.listAudit({action:e}).then(e=>{r(e.events),a(e.nextCursor)}).catch(e=>s(e.message))},[e]),(0,L.jsxs)(`div`,{className:`mx-auto flex w-full max-w-6xl flex-col gap-6`,children:[(0,L.jsx)(qi,{title:`Audit log`,description:`Every sign-in and every change made through Forge. Entries can't be edited or deleted.`,actions:(0,L.jsx)(`select`,{"aria-label":`Filter activity`,value:e,onChange:e=>t(e.target.value),className:`h-8 rounded-lg border border-line bg-surface-raised px-2.5 text-xs text-fg focus:border-accent-hover focus:outline-none`,children:ta.map(e=>(0,L.jsx)(`option`,{value:e.value,children:e.label},e.value))})}),o&&(0,L.jsx)(`p`,{role:`alert`,className:`text-sm text-red-400`,children:o}),n&&n.length===0?(0,L.jsx)(Ki,{icon:`inbox`,title:`No activity yet`,description:`Sign-ins and changes will appear here as they happen.`}):(0,L.jsx)(`div`,{className:`overflow-x-auto rounded-xl border border-line bg-surface-raised`,children:(0,L.jsxs)(`table`,{"aria-label":`Audit log`,className:`w-full min-w-[860px] table-fixed text-left text-sm`,children:[(0,L.jsxs)(`colgroup`,{children:[(0,L.jsx)(`col`,{className:`w-36`}),(0,L.jsx)(`col`,{className:`w-52`}),(0,L.jsx)(`col`,{}),(0,L.jsx)(`col`,{className:`w-44`}),(0,L.jsx)(`col`,{className:`w-28`})]}),(0,L.jsx)(`thead`,{className:`border-b border-line text-xs font-medium text-fg-subtle`,children:(0,L.jsxs)(`tr`,{children:[(0,L.jsx)(`th`,{scope:`col`,className:`py-2.5 pl-4 pr-3 font-medium`,children:`When`}),(0,L.jsx)(`th`,{scope:`col`,className:`px-3 py-2.5 font-medium`,children:`Who`}),(0,L.jsx)(`th`,{scope:`col`,className:`px-3 py-2.5 font-medium`,children:`What`}),(0,L.jsx)(`th`,{scope:`col`,className:`px-3 py-2.5 font-medium`,children:`Where`}),(0,L.jsx)(`th`,{scope:`col`,className:`py-2.5 pl-3 pr-4 text-right font-medium`,children:`Result`})]})}),(0,L.jsxs)(`tbody`,{className:`divide-y divide-line`,children:[(n??[]).map(e=>(0,L.jsxs)(`tr`,{children:[(0,L.jsx)(`td`,{className:`py-3 pl-4 pr-3 tabular-nums text-fg-muted`,children:Zi(e.at)}),(0,L.jsx)(`td`,{className:`truncate px-3 py-3 text-fg`,title:e.ip??void 0,children:e.actorLabel}),(0,L.jsxs)(`td`,{className:`px-3 py-3`,children:[(0,L.jsx)(`span`,{className:`text-fg`,children:$i(e.action)}),e.target&&(0,L.jsx)(`span`,{className:`ml-2 font-mono text-xs text-fg-subtle`,children:e.target})]}),(0,L.jsx)(`td`,{className:`truncate px-3 py-3 font-mono text-xs text-fg-subtle`,children:e.repo?.replace(/^[a-z]+:/,``)??`—`}),(0,L.jsx)(`td`,{className:`py-3 pl-3 pr-4 text-right`,children:(0,L.jsx)(Gi,{tone:ea[e.outcome].tone,children:ea[e.outcome].label})})]},e.id)),!n&&Array.from({length:5}).map((e,t)=>(0,L.jsx)(`tr`,{children:(0,L.jsx)(`td`,{colSpan:5,className:`h-[45px] px-4`,children:(0,L.jsx)(`div`,{className:`h-3 w-1/2 animate-pulse rounded bg-surface-hover`})})},t))]})]})}),i&&(0,L.jsx)(`div`,{className:`flex justify-center`,children:(0,L.jsx)(z,{size:`sm`,onClick:async()=>{if(!i)return;let t=await Yi.listAudit({action:e,before:i});r(e=>[...e??[],...t.events]),a(t.nextCursor)},children:`Load older activity`})})]})}var ra=`h-9 w-full rounded-lg border border-line bg-canvas px-3 text-sm text-fg placeholder:text-fg-subtle focus:border-accent-hover focus:outline-none`,ia=`h-8 rounded-lg border border-line bg-surface-raised px-2 text-xs text-fg focus:border-accent-hover focus:outline-none disabled:opacity-50`;function aa({onAdded:e,onCancel:t}){let[n,r]=(0,x.useState)({name:``,email:``,role:`operator`,password:``}),[i,a]=(0,x.useState)(null),[o,s]=(0,x.useState)(!1);return(0,L.jsxs)(`form`,{onSubmit:async t=>{t.preventDefault(),s(!0),a(null);try{e((await Yi.addMember(n)).user)}catch(e){a(e.message)}finally{s(!1)}},"aria-label":`Add member`,className:`grid gap-4 rounded-xl border border-line bg-surface-raised p-5 shadow-sm sm:grid-cols-2`,children:[(0,L.jsxs)(`label`,{className:`flex flex-col gap-1.5 text-sm font-medium text-fg`,children:[`Name`,(0,L.jsx)(`input`,{required:!0,value:n.name,onChange:e=>r({...n,name:e.target.value}),className:ra})]}),(0,L.jsxs)(`label`,{className:`flex flex-col gap-1.5 text-sm font-medium text-fg`,children:[`Email`,(0,L.jsx)(`input`,{type:`email`,required:!0,value:n.email,onChange:e=>r({...n,email:e.target.value}),className:ra})]}),(0,L.jsxs)(`label`,{className:`flex flex-col gap-1.5 text-sm font-medium text-fg`,children:[`Role`,(0,L.jsx)(`select`,{value:n.role,onChange:e=>r({...n,role:e.target.value}),className:ra,children:_i.map(e=>(0,L.jsx)(`option`,{value:e,children:vi[e]},e))}),(0,L.jsx)(`span`,{className:`text-xs font-normal text-fg-subtle`,children:yi[n.role]})]}),(0,L.jsxs)(`label`,{className:`flex flex-col gap-1.5 text-sm font-medium text-fg`,children:[`Temporary password`,(0,L.jsx)(`input`,{type:`password`,required:!0,minLength:12,autoComplete:`new-password`,value:n.password,onChange:e=>r({...n,password:e.target.value}),className:ra}),(0,L.jsx)(`span`,{className:`text-xs font-normal text-fg-subtle`,children:`Share it privately. SSO users can leave Forge's password unused.`})]}),i&&(0,L.jsx)(`p`,{role:`alert`,className:`text-sm text-red-400 sm:col-span-2`,children:i}),(0,L.jsxs)(`div`,{className:`flex justify-end gap-2 sm:col-span-2`,children:[(0,L.jsx)(z,{variant:`ghost`,size:`sm`,onClick:t,children:`Cancel`}),(0,L.jsx)(z,{type:`submit`,variant:`primary`,size:`sm`,disabled:o,children:`Add`})]})]})}function oa(){let{user:e}=Ui(),[t,n]=(0,x.useState)(null),[r,i]=(0,x.useState)(null),[a,o]=(0,x.useState)(!1);(0,x.useEffect)(()=>{Yi.listMembers().then(e=>n(e.users)).catch(e=>i(e.message))},[]);let s=async(e,t)=>{i(null);try{let{user:r}=await Yi.updateMember(e.id,t);n(e=>e?.map(e=>e.id===r.id?r:e)??null)}catch(e){i(e.message)}};return(0,L.jsxs)(`div`,{className:`mx-auto flex w-full max-w-6xl flex-col gap-6`,children:[(0,L.jsx)(qi,{title:`Members`,description:`Who can use this Forge workspace, and what they're allowed to do.`,actions:(0,L.jsxs)(z,{size:`sm`,variant:`primary`,onClick:()=>o(!0),children:[(0,L.jsx)(B,{name:`plus`,size:14}),` Add member`]})}),a&&(0,L.jsx)(aa,{onCancel:()=>o(!1),onAdded:e=>{n(t=>[...t??[],e]),o(!1)}}),r&&(0,L.jsx)(`p`,{role:`alert`,className:`rounded-lg bg-red-950/50 px-3 py-2 text-sm text-red-300 ring-1 ring-inset ring-red-800/60`,children:r}),(0,L.jsx)(`div`,{className:`overflow-x-auto rounded-xl border border-line bg-surface-raised`,children:(0,L.jsxs)(`table`,{"aria-label":`Members`,className:`w-full min-w-[760px] table-fixed text-left text-sm`,children:[(0,L.jsxs)(`colgroup`,{children:[(0,L.jsx)(`col`,{}),(0,L.jsx)(`col`,{className:`w-40`}),(0,L.jsx)(`col`,{className:`w-28`}),(0,L.jsx)(`col`,{className:`w-40`}),(0,L.jsx)(`col`,{className:`w-32`})]}),(0,L.jsx)(`thead`,{className:`border-b border-line text-xs font-medium text-fg-subtle`,children:(0,L.jsxs)(`tr`,{children:[(0,L.jsx)(`th`,{scope:`col`,className:`py-2.5 pl-4 pr-3 font-medium`,children:`Member`}),(0,L.jsx)(`th`,{scope:`col`,className:`px-3 py-2.5 font-medium`,children:`Role`}),(0,L.jsx)(`th`,{scope:`col`,className:`px-3 py-2.5 font-medium`,children:`Sign-in`}),(0,L.jsx)(`th`,{scope:`col`,className:`px-3 py-2.5 font-medium`,children:`Last active`}),(0,L.jsx)(`th`,{scope:`col`,className:`py-2.5 pl-3 pr-4 text-right font-medium`,children:`Access`})]})}),(0,L.jsxs)(`tbody`,{className:`divide-y divide-line`,children:[(t??[]).map(t=>(0,L.jsxs)(`tr`,{className:t.disabled?`opacity-60`:void 0,children:[(0,L.jsx)(`td`,{className:`py-3 pl-4 pr-3`,children:(0,L.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,L.jsx)(`span`,{className:`flex size-8 shrink-0 items-center justify-center rounded-full bg-surface-hover text-xs font-semibold text-fg-muted ring-1 ring-line`,children:t.name.slice(0,1).toUpperCase()}),(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsxs)(`div`,{className:`truncate font-medium text-fg`,children:[t.name,` `,t.id===e.id&&(0,L.jsx)(`span`,{className:`font-normal text-fg-subtle`,children:`(you)`})]}),(0,L.jsx)(`div`,{className:`truncate text-xs text-fg-subtle`,children:t.email})]})]})}),(0,L.jsx)(`td`,{className:`px-3 py-3`,children:(0,L.jsx)(`select`,{"aria-label":`Role for ${t.name}`,value:t.role,onChange:e=>s(t,{role:e.target.value}),title:yi[t.role],className:ia,children:_i.map(e=>(0,L.jsx)(`option`,{value:e,children:vi[e]},e))})}),(0,L.jsx)(`td`,{className:`px-3 py-3`,children:(0,L.jsx)(Gi,{tone:t.authProvider===`oidc`?`info`:`neutral`,children:t.authProvider===`oidc`?`SSO`:`Password`})}),(0,L.jsx)(`td`,{className:`px-3 py-3 tabular-nums text-fg-muted`,children:Zi(t.lastLoginAt)}),(0,L.jsx)(`td`,{className:`py-3 pl-3 pr-4 text-right`,children:(0,L.jsx)(z,{size:`sm`,variant:`ghost`,disabled:t.id===e.id,onClick:()=>s(t,{disabled:!t.disabled}),children:t.disabled?`Enable`:`Disable`})})]},t.id)),!t&&Array.from({length:3}).map((e,t)=>(0,L.jsx)(`tr`,{children:(0,L.jsx)(`td`,{colSpan:5,className:`h-[57px] px-4`,children:(0,L.jsx)(`div`,{className:`h-3 w-1/3 animate-pulse rounded bg-surface-hover`})})},t))]})]})})]})}var sa=/\b(error|failed|failure|exception|panic|traceback|cannot|could not|refused|denied|timed? out|abort|unexpected)\b/i,ca=/\b(warn|warning|skipped|skipping|deprecated|retry|retrying|fallback|truncated|missing)\b/i,la=/\b(ok|success|passed|completed|done|ready|merged|applied|resolved)\b/i,ua=/^(reasoning|scanning|analysis started|ci fix started|identified|loaded)\b/i;function da(e){return sa.test(e)?`error`:ca.test(e)?`warn`:la.test(e)?`success`:ua.test(e)?`debug`:`info`}function fa(e){try{let t=new Date(e);return Number.isNaN(t.getTime())?``:`${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}:${String(t.getSeconds()).padStart(2,`0`)}.${String(t.getMilliseconds()).padStart(3,`0`)}`}catch{return`--:--:--.---`}}var pa={info:{icon:`ℹ`,text:`text-fg`,iconColor:`text-sky-400`},warn:{icon:`⚠`,text:`text-amber-300`,iconColor:`text-amber-400`},error:{icon:`✖`,text:`text-red-300`,iconColor:`text-red-400`},debug:{icon:`›`,text:`text-fg-subtle`,iconColor:`text-fg-subtle`},success:{icon:`✓`,text:`text-emerald-300`,iconColor:`text-emerald-400`}};function ma({entries:e,autoScroll:t=!0,variant:n=`panel`,heightClass:r=`min-h-[12rem] max-h-[60vh]`,label:i,badge:a,headerAccessory:o,empty:s=`No output yet.`}){let c=(0,x.useRef)(null);(0,x.useEffect)(()=>{t&&c.current&&(c.current.scrollTop=c.current.scrollHeight)},[e.length,t]);let l=e.map(e=>typeof e==`string`?{ts:new Date().toISOString(),message:e}:e),u=(0,L.jsx)(`div`,{ref:c,className:`font-mono text-[11px] leading-5 ${r} overflow-y-auto bg-canvas`,children:l.length===0?(0,L.jsx)(`div`,{className:`px-4 py-3 text-fg-subtle italic`,children:s}):(0,L.jsx)(`div`,{children:l.map((e,t)=>{let n=e.level??da(e.message),r=pa[n];return(0,L.jsxs)(`div`,{className:`flex items-start gap-2 px-3 py-[2px] hover:bg-fg/[0.02] border-l-2 border-transparent`,style:{borderLeftColor:n===`error`?`rgba(248, 113, 113, 0.5)`:n===`warn`?`rgba(251, 191, 36, 0.4)`:n===`success`?`rgba(52, 211, 153, 0.4)`:`transparent`},children:[(0,L.jsx)(`span`,{className:`text-fg-subtle select-none shrink-0 tabular-nums`,children:fa(e.ts)}),(0,L.jsx)(`span`,{className:`${r.iconColor} shrink-0 select-none`,children:r.icon}),(0,L.jsx)(`span`,{className:`${r.text} whitespace-pre-wrap break-words`,children:e.message})]},t)})})});return n===`embedded`?u:(0,L.jsxs)(`div`,{className:`border border-line rounded-lg overflow-hidden bg-canvas shadow-inner`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between bg-surface-raised/80 border-b border-line px-3 py-1.5`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px] text-fg-subtle font-mono`,children:[(0,L.jsxs)(`span`,{className:`flex gap-1.5`,children:[(0,L.jsx)(`span`,{className:`w-2.5 h-2.5 rounded-full bg-red-500/60`}),(0,L.jsx)(`span`,{className:`w-2.5 h-2.5 rounded-full bg-amber-500/60`}),(0,L.jsx)(`span`,{className:`w-2.5 h-2.5 rounded-full bg-emerald-500/60`})]}),i&&(0,L.jsx)(`span`,{className:`pl-1`,children:i}),a&&(0,L.jsx)(`span`,{className:`ml-1 px-1.5 py-0.5 rounded bg-surface-raised text-[10px] text-fg-muted tracking-normal normal-case`,children:a})]}),o&&(0,L.jsx)(`div`,{className:`flex items-center`,children:o})]}),u]})}function ha(e,t=Date.now()){return e.replace(/\x1b\[[0-9;]*[a-zA-Z]/g,``).split(`
17
+ `).map((e,n)=>({ts:new Date(t+n).toISOString(),message:e.length?e:` `}))}var ga=[`fetch_issue`,`scan_repo`,`identify_files`,`fetch_files`,`generate_fix`],_a={fetch_issue:`fetch_issue`,scan_repo:`scan_repos`,identify_files:`identify_files`,fetch_files:`fetch_files`,generate_fix:`generate_fix`};function va({steps:e,logs:t,issueTitle:n,mode:r=`analyze`}){let i=new Set(e.map(e=>e.step)),a=e[e.length-1],o=r===`ci-fix`?`ci-fix`:`analyze`;return(0,L.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,L.jsxs)(`div`,{className:`border border-line rounded-lg overflow-hidden bg-canvas`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between bg-surface-raised/80 border-b border-line px-4 py-2`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-3 text-xs font-mono text-fg-muted`,children:[(0,L.jsx)(`span`,{className:`text-emerald-400`,children:`●`}),(0,L.jsxs)(`span`,{className:`text-fg-subtle`,children:[`forge / `,o]}),(0,L.jsx)(`span`,{className:`text-fg-subtle`,children:`›`}),(0,L.jsx)(`span`,{className:`text-fg truncate max-w-md`,children:n})]}),r===`ci-fix`&&(0,L.jsx)(`span`,{className:`text-[11px] font-mono px-2 py-0.5 rounded bg-amber-950/60 text-amber-300 border border-amber-900`,children:`CI FAILURE`})]}),(0,L.jsx)(`div`,{className:`px-4 py-4`,children:(0,L.jsx)(`div`,{className:`flex flex-col gap-1`,children:ga.map((t,n)=>{let r=i.has(t),o=a?.step===t,s=e.find(e=>e.step===t)?.message??``,c=_a[t]??t,l,u=`text-fg-subtle`;return r&&!o?(l=(0,L.jsx)(`span`,{className:`text-emerald-400 text-sm`,children:`✓`}),u=`text-fg-muted`):o?(l=(0,L.jsx)(`span`,{className:`w-3.5 h-3.5 rounded-full border-2 border-violet-400 border-t-transparent animate-spin inline-block`}),u=`text-fg`):l=(0,L.jsx)(`span`,{className:`text-fg-subtle text-sm`,children:`○`}),(0,L.jsxs)(`div`,{className:`flex items-center gap-3 font-mono text-xs`,children:[(0,L.jsx)(`span`,{className:`text-fg-subtle tabular-nums select-none w-6 text-right`,children:String(n+1).padStart(2,`0`)}),(0,L.jsx)(`span`,{className:`w-5 flex items-center justify-center shrink-0`,children:l}),(0,L.jsx)(`span`,{className:`${u} w-36 shrink-0`,children:c}),(0,L.jsx)(`span`,{className:`text-fg-subtle truncate`,children:s||`—`})]},t)})})})]}),t.length>0&&(0,L.jsx)(ma,{entries:t,label:`forge ${o}`,badge:`${t.length} entr${t.length===1?`y`:`ies`}`,heightClass:`min-h-[40vh] max-h-[65vh]`})]})}function ya(){let{selectedIssue:e,progressSteps:t,analysisLogs:n,analysisResult:r,analysisMode:i}=V(),{handleCancelAnalysis:a}=H();return e?(0,L.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,L.jsx)(va,{steps:t,logs:n,issueTitle:e.title,mode:i}),(0,L.jsx)(`div`,{className:`flex items-center justify-end`,children:(0,L.jsx)(`button`,{onClick:a,className:`w-full md:w-auto min-h-[50px] md:min-h-0 text-[17px] md:text-xs text-red-400 md:text-fg-muted hover:text-red-300 border border-line-strong hover:border-red-800/60 px-3 py-1.5 rounded-xl md:rounded-lg transition-colors`,title:`Stop the running analysis and return to the issue view. The Claude CLI is killed on the server.`,children:`Cancel analysis`})}),r&&r.changes.length>0&&(0,L.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,L.jsxs)(`p`,{className:`text-xs font-medium text-fg-subtle`,children:[`Proposed changes (`,r.changes.length,` file`,r.changes.length===1?``:`s`,`)`]}),r.changes.map(e=>(0,L.jsxs)(`div`,{className:`flex items-start gap-3 bg-surface-raised border border-line-strong rounded-lg px-4 py-3`,children:[(0,L.jsx)(`span`,{className:`text-xs font-medium mt-0.5 shrink-0 ${e.action===`create`?`text-green-400`:e.action===`delete`?`text-red-400`:`text-yellow-400`}`,children:e.action}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-0.5 min-w-0`,children:[(0,L.jsx)(`span`,{className:`text-sm font-mono text-fg truncate`,children:e.file}),e.summary&&(0,L.jsx)(`span`,{className:`text-xs text-fg-muted`,children:e.summary})]})]},e.file))]})]}):null}var ba={success:`bg-green-400`,failed:`bg-red-400`,running:`bg-yellow-400 animate-pulse`,pending:`bg-yellow-600`,canceled:`bg-fg-subtle`,skipped:`bg-fg-subtle`,created:`bg-fg-subtle`},xa={success:`passed`,failed:`failed`,running:`running`,pending:`pending`,canceled:`canceled`},Sa={open:`No open Forge merge requests.`,merged:`No merged Forge merge requests.`,closed:`No closed Forge merge requests.`};function Ca({mrs:e,loading:t,refreshing:n=!1,error:r,state:i=`open`,onSelect:a,onRefresh:o}){return t?(0,L.jsx)(`div`,{className:`flex flex-col gap-3`,children:Array.from({length:3}).map((e,t)=>(0,L.jsx)(`div`,{className:`h-16 bg-surface-raised rounded-lg animate-pulse`},t))}):r?(0,L.jsxs)(`div`,{className:`flex items-center justify-between bg-red-950/40 border border-red-800 rounded-lg px-4 py-3`,children:[(0,L.jsx)(`p`,{className:`text-sm text-red-300`,children:r}),(0,L.jsx)(`button`,{onClick:o,className:`text-xs text-red-400 hover:text-red-200 transition-colors ml-4 shrink-0`,children:`Retry`})]}):e.length===0?(0,L.jsx)(`div`,{className:`text-center py-12 text-fg-subtle text-sm`,children:Sa[i]}):(0,L.jsx)(`div`,{"aria-busy":n||void 0,className:`flex flex-col gap-2 transition-opacity ${n?`opacity-60`:``}`,children:e.map(e=>{let t=e.pipeline?ba[e.pipeline.status]??`bg-fg-subtle`:`bg-fg-subtle`,n=e.pipeline?xa[e.pipeline.status]??e.pipeline.status:`no pipeline`,r=e.source_branch.match(/^forge\/issue-(\d+)-/),i=r?r[1]:null;return(0,L.jsx)(`button`,{onClick:()=>a(e),className:`w-full text-left bg-surface-raised ring-1 ring-inset ring-line-strong hover:bg-surface-hover active:bg-surface-hover border border-line-strong hover:border-violet-500 rounded-xl md:rounded-lg px-4 py-3 transition-colors group`,children:(0,L.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,L.jsx)(`div`,{className:`flex flex-col items-center gap-1 pt-0.5 shrink-0`,children:(0,L.jsx)(`span`,{className:`w-2 h-2 rounded-full ${t}`,title:n})}),(0,L.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2 mb-0.5`,children:[(0,L.jsxs)(`span`,{className:`text-xs text-fg-subtle font-mono`,children:[`!`,e.iid]}),i&&(0,L.jsxs)(`span`,{className:`text-xs text-fg-subtle font-mono`,children:[`#`,i]}),e.has_conflicts&&(0,L.jsx)(`span`,{className:`text-xs bg-amber-900/50 text-amber-400 border border-amber-700/50 px-1.5 py-0.5 rounded`,children:`conflicts`}),e.pipeline&&(0,L.jsx)(`span`,{className:`text-xs ${e.pipeline.status===`failed`?`text-red-400`:e.pipeline.status===`success`?`text-green-400`:e.pipeline.status===`running`?`text-yellow-400`:`text-fg-subtle`}`,children:n})]}),(0,L.jsx)(`p`,{className:`text-[16px] md:text-sm leading-snug text-fg font-semibold md:font-medium line-clamp-2 md:line-clamp-none md:truncate`,children:e.title}),(0,L.jsx)(`p`,{className:`text-xs font-mono text-fg-subtle mt-0.5 truncate`,children:e.source_branch})]}),(0,L.jsxs)(`div`,{className:`shrink-0 flex flex-col items-end gap-1`,children:[(0,L.jsx)(`span`,{className:`text-xs text-fg-subtle`,children:new Date(e.created_at).toLocaleDateString()}),(0,L.jsx)(`span`,{className:`hidden md:inline text-violet-400 opacity-0 group-hover:opacity-100 transition-opacity text-xs`,children:`View →`}),(0,L.jsx)(B,{name:`chevronRight`,className:`md:hidden mt-2 text-fg-subtle`})]})]})},e.iid)})})}var wa={success:`success`,failed:`danger`,running:`info`,pending:`warning`,created:`neutral`,manual:`accent`,canceled:`neutral`,skipped:`neutral`},Ta=/^refs\/merge-requests\/(\d+)\/head$/,Ea=`h-14`;function Da(e){let t=Ta.exec(e);return t?`!${t[1]}`:e}function Oa(e,t){let n=new URLSearchParams;return e&&n.set(`repo`,e),n.set(`page`,String(t)),`/pipelines?${n}`}function ka({repo:e,reloadKey:t}){let[n,r]=(0,x.useState)(null),[i,a]=(0,x.useState)(null),[o,s]=(0,x.useState)(!1),[c,l]=(0,x.useState)(null);return(0,x.useEffect)(()=>{let t=!1;return l(null),R(Oa(e,1)).then(e=>{t||(r(e.pipelines),a(e.nextPage))}).catch(e=>{t||l(e.message)}),()=>{t=!0}},[e,t]),c&&n===null?(0,L.jsx)(`div`,{className:`rounded-lg border border-red-800 bg-red-950/40 px-4 py-3 text-sm text-red-300`,children:c}):n===null?(0,L.jsx)(`div`,{className:`flex flex-col gap-2`,children:Array.from({length:6}).map((e,t)=>(0,L.jsx)(`div`,{"data-testid":`pipeline-skeleton`,className:`${Ea} animate-pulse rounded-lg bg-surface-raised`},t))}):n.length===0?(0,L.jsx)(Ki,{icon:`pipeline`,title:`No pipelines yet`,description:`CI runs for this repo will show up here.`}):(0,L.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,L.jsx)(`ul`,{className:`flex flex-col gap-2`,children:n.map(e=>{let t=Da(e.ref);return(0,L.jsxs)(`li`,{className:`${Ea} flex items-center gap-4 rounded-lg border border-line-strong/50 bg-surface-raised/50 px-4`,children:[(0,L.jsx)(Gi,{tone:wa[e.status]??`neutral`,dot:!0,className:`w-20 justify-center`,children:e.status}),(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,L.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,L.jsx)(`span`,{className:`truncate font-mono text-sm text-fg`,title:e.ref,children:t}),e.ref.startsWith(`forge/`)&&(0,L.jsx)(Gi,{tone:`accent`,children:`Forge`})]}),(0,L.jsxs)(`span`,{className:`font-mono text-[11px] text-fg-subtle`,children:[e.sha.slice(0,8),` · `,e.source.replace(/_/g,` `)]})]}),(0,L.jsx)(`span`,{className:`shrink-0 text-xs tabular-nums text-fg-subtle`,children:kr(e.created_at)}),(0,L.jsxs)(`a`,{href:e.web_url,target:`_blank`,rel:`noreferrer`,className:`shrink-0 text-xs tabular-nums text-fg-subtle transition-colors hover:text-fg`,children:[`#`,e.id,` ↗`]})]},e.id)})}),c&&(0,L.jsx)(`p`,{className:`text-xs text-red-400`,children:c}),i!==null&&(0,L.jsx)(z,{size:`sm`,className:`self-center`,onClick:()=>{i!==null&&(s(!0),R(Oa(e,i)).then(e=>{r(t=>{let n=new Set(t?.map(e=>e.id));return[...t??[],...e.pipelines.filter(e=>!n.has(e.id))]}),a(e.nextPage)}).catch(e=>l(e.message)).finally(()=>s(!1)))},disabled:o,children:o?`Loading…`:`Load more`})]})}var Aa=new Map;function ja(e){let t=Aa.get(e);return t||(t=R(`/labels?repo=${encodeURIComponent(e)}`).then(({labels:e})=>e.map(e=>e.name)).catch(()=>(Aa.delete(e),[])),Aa.set(e,t)),t}function Ma(e){let[t,n]=(0,x.useState)([]);return(0,x.useEffect)(()=>{if(!e)return;let t=!0;return ja(e).then(e=>t&&n(e)),()=>{t=!1}},[e]),t}var Na=[`critical`,`high`,`medium`,`low`],Pa={priority:Na,status:[`triage`,`ready`,`in-progress`,`in-review`,`blocked`]},Fa=/^(type|priority|status|area)::(.+)$/;function Ia(e){let t={type:null,priority:null,status:null,areas:[],other:[]};for(let n of e){let e=n.match(Fa);if(!e){t.other.push(n);continue}let[,r,i]=e;r===`area`?t.areas.push(i):t[r]=i}return t}function La({issues:e,query:t,type:n,priority:r}){let i=t.trim().toLowerCase().split(/\s+/).filter(Boolean);return e.filter(e=>{let t=Ia(e.labels);if(n!==`all`&&t.type!==n||r!==`all`&&t.priority!==r)return!1;if(!i.length)return!0;let a=`#${e.iid} ${e.title} ${e.labels.join(` `)}`.toLowerCase();return i.every(t=>t.startsWith(`#`)?`#${e.iid}`===t:a.includes(t))})}function Ra(e,t,n){let r=e.filter(e=>!e.startsWith(`${t}::`));return n?[...r,`${t}::${n}`]:r}function za(e,t){return e.includes(t)?e.filter(e=>e!==t):[...e,t]}function Ba({available:e,scope:t,current:n}){let r=`${t}::`,i=new Set(e.filter(e=>e.startsWith(r)).map(e=>e.slice(r.length)));n&&i.add(n);let a=t===`area`?void 0:Pa[t],o=e=>a?.includes(e)?a.indexOf(e):2**53-1;return[...i].sort((e,t)=>o(e)-o(t)||e.localeCompare(t))}var Va=[{scope:`type`,label:`Type`},{scope:`priority`,label:`Priority`},{scope:`status`,label:`Status`}],Ha=`h-8 w-full rounded-lg border border-line bg-canvas px-2.5 text-xs text-fg focus:border-accent-hover focus:outline-none`,Ua=`inline-flex h-6 items-center gap-1 rounded-md px-2 text-xs transition-colors`;function Wa({labels:e,available:t,onChange:n}){let r=Ia(e),i=Ba({available:t,scope:`area`,current:null});for(let e of r.areas)i.includes(e)||i.push(e);let a=t.filter(t=>!t.includes(`::`)&&!e.includes(t)),[o,s]=(0,x.useState)(``),c=(0,x.useId)(),l=()=>{let t=o.trim();!t||t.includes(`,`)||(e.includes(t)||n([...e,t]),s(``))};return(0,L.jsxs)(`fieldset`,{className:`flex flex-col gap-3`,children:[(0,L.jsx)(`legend`,{className:`sr-only`,children:`Labels`}),(0,L.jsx)(`div`,{className:`grid grid-cols-1 gap-2 sm:grid-cols-3`,children:Va.map(({scope:i,label:a})=>(0,L.jsxs)(`label`,{className:`flex flex-col gap-1 text-xs font-medium text-fg-subtle`,children:[a,(0,L.jsxs)(`select`,{"aria-label":a,value:r[i]??``,onChange:t=>n(Ra(e,i,t.target.value||null)),className:Gn(Ha,`normal-case tracking-normal`),children:[(0,L.jsx)(`option`,{value:``,children:`None`}),Ba({available:t,scope:i,current:r[i]}).map(e=>(0,L.jsx)(`option`,{value:e,children:e},e))]})]},i))}),i.length>0&&(0,L.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,L.jsx)(`span`,{className:`text-xs font-medium text-fg-subtle`,children:`Areas`}),(0,L.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:i.map(t=>{let i=r.areas.includes(t);return(0,L.jsx)(`button`,{type:`button`,"aria-pressed":i,onClick:()=>n(za(e,`area::${t}`)),className:Gn(Ua,i?`bg-accent text-on-accent`:`bg-surface-raised text-fg-muted ring-1 ring-inset ring-line hover:text-fg`),children:t},t)})})]}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,L.jsx)(`span`,{className:`text-xs font-medium text-fg-subtle`,children:`Other labels`}),(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[r.other.map(t=>(0,L.jsxs)(`span`,{className:Gn(Ua,`bg-surface-raised text-fg-muted ring-1 ring-inset ring-line`),children:[t,(0,L.jsx)(`button`,{type:`button`,"aria-label":`Remove ${t}`,onClick:()=>n(e.filter(e=>e!==t)),className:`text-fg-subtle hover:text-fg`,children:`×`})]},t)),(0,L.jsx)(`input`,{type:`text`,role:`combobox`,"aria-label":`Add label`,"aria-expanded":!1,list:c,placeholder:`Add label…`,value:o,onChange:e=>s(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),l())},onBlur:l,className:Gn(Ha,`h-6 w-36`)}),(0,L.jsx)(`datalist`,{id:c,children:a.map(e=>(0,L.jsx)(`option`,{value:e},e))})]})]})]})}var Ga=`w-full rounded-lg border border-line bg-canvas px-3 py-2 text-sm text-fg placeholder:text-fg-subtle focus:border-accent-hover focus:outline-none`;function Ka({onCreate:e,availableLabels:t,onCancel:n}){let[r,i]=(0,x.useState)(``),[a,o]=(0,x.useState)(``),[s,c]=(0,x.useState)([]),[l,u]=(0,x.useState)(!1),[d,f]=(0,x.useState)(null);return(0,L.jsxs)(`form`,{onSubmit:async t=>{if(t.preventDefault(),r.trim()){u(!0),f(null);try{await e(r.trim(),a.trim(),s),n()}catch(e){f(e.message)}finally{u(!1)}}},"aria-label":`New issue`,className:`flex flex-col gap-3 rounded-xl border border-line bg-surface-raised p-4 shadow-sm`,children:[(0,L.jsx)(`input`,{type:`text`,"aria-label":`Issue title`,placeholder:`Issue title`,value:r,onChange:e=>i(e.target.value),className:Ga}),(0,L.jsx)(`textarea`,{"aria-label":`Description`,placeholder:`Description (optional)`,value:a,onChange:e=>o(e.target.value),rows:3,className:`${Ga} resize-none`}),(0,L.jsx)(Wa,{labels:s,available:t,onChange:c}),d&&(0,L.jsx)(`p`,{className:`text-xs text-red-400`,children:d}),(0,L.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,L.jsx)(z,{variant:`ghost`,size:`sm`,onClick:n,children:`Cancel`}),(0,L.jsx)(z,{type:`submit`,variant:`primary`,size:`sm`,disabled:l||!r.trim(),children:l?`Creating…`:`Create issue`})]})]})}var qa={analyze:`analyzing`,refine:`refining`,"ci-fix":`fixing CI`,validate:`validating`};function Ja({types:e}){if(!e.length)return null;let t=e.find(e=>e===`analyze`)??e.find(e=>e===`ci-fix`)??e.find(e=>e===`refine`)??e[0];return(0,L.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[11px] text-violet-300 bg-violet-950/50 border border-violet-800/60 px-2 py-0.5 rounded-full shrink-0`,children:[(0,L.jsx)(`span`,{className:`w-2 h-2 rounded-full border border-violet-300 border-t-transparent animate-spin inline-block shrink-0`}),qa[t],e.length>1&&(0,L.jsxs)(`span`,{className:`text-violet-400/70`,children:[`+`,e.length-1]})]})}var Ya=new Set([`running`,`pending`,`created`,`preparing`,`waiting_for_resource`,`scheduled`]);function Xa({pipeline:e}){if(!e)return null;let t=Ya.has(e.status),n=e.status===`failed`;if(!t&&!n)return null;let r=t?`text-amber-300 bg-amber-950/40 border-amber-800/60 hover:bg-amber-900/50`:`text-red-300 bg-red-950/40 border-red-800/60 hover:bg-red-900/50`,i=t?`pipeline running`:`pipeline failed`;return(0,L.jsxs)(`a`,{href:e.web_url,target:`_blank`,rel:`noreferrer`,onClick:e=>e.stopPropagation(),className:`flex items-center gap-1.5 text-[11px] px-2 py-0.5 rounded-full shrink-0 border transition-colors ${r}`,title:`CI pipeline is ${e.status}`,children:[t?(0,L.jsx)(`span`,{className:`w-2 h-2 rounded-full border border-amber-300 border-t-transparent animate-spin inline-block shrink-0`}):(0,L.jsx)(`span`,{"aria-hidden":!0,children:`✗`}),i]})}function Za({issue:e,activeJobs:t=[],pipeline:n,openMr:r}){return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Ja,{types:t}),(0,L.jsx)(Xa,{pipeline:n}),!e.likelyFixedByMr&&r&&(0,L.jsxs)(`a`,{href:r.web_url,target:`_blank`,rel:`noreferrer`,onClick:e=>e.stopPropagation(),className:`text-[11px] text-sky-300 bg-sky-950/50 border border-sky-800/60 px-2 py-0.5 rounded-full shrink-0 hover:bg-sky-900/60 transition-colors`,title:`MR !${r.iid} is open — not yet merged.`,children:[`MR open !`,r.iid]}),e.likelyFixedByMr&&(0,L.jsxs)(`a`,{href:e.likelyFixedByMr.webUrl,target:`_blank`,rel:`noreferrer`,onClick:e=>e.stopPropagation(),className:`text-[11px] text-emerald-300 bg-emerald-950/50 border border-emerald-800/60 px-2 py-0.5 rounded-full shrink-0 hover:bg-emerald-900/60 transition-colors`,title:`Merged via !${e.likelyFixedByMr.iid}. Verify the fix and close the issue on GitLab if resolved.`,children:[`✓ merged !`,e.likelyFixedByMr.iid]}),e.forgeBranch&&e.branchAhead===0&&(0,L.jsx)(`span`,{className:`text-[11px] text-amber-300 bg-amber-950/40 border border-amber-800/60 px-2 py-0.5 rounded-full shrink-0`,title:`Branch has no commits ahead of main — nothing to promote.`,children:`stale branch`})]})}var Qa={bug:`danger`,security:`danger`,feature:`accent`,enhancement:`info`},$a={critical:`danger`,high:`warning`,medium:`info`,low:`neutral`},eo=e=>e.charAt(0).toUpperCase()+e.slice(1),to=new Intl.DateTimeFormat(void 0,{month:`short`,day:`numeric`});function no({issues:e,onSelect:t,renderStatus:n}){return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`ul`,{"aria-label":`Issues`,className:`divide-y divide-line overflow-hidden rounded-xl border border-line bg-surface-raised md:hidden`,children:e.map(e=>{let r=Ia(e.labels);return(0,L.jsx)(`li`,{children:(0,L.jsxs)(`button`,{type:`button`,onClick:()=>t(e),className:`flex w-full items-center gap-3 px-4 py-3.5 text-left active:bg-surface-hover`,children:[(0,L.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,L.jsx)(`div`,{className:`line-clamp-2 font-medium text-fg`,children:e.title}),(0,L.jsxs)(`div`,{className:`mt-1 flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1 text-xs text-fg-subtle`,children:[(0,L.jsxs)(`span`,{children:[`#`,e.iid]}),r.type&&(0,L.jsx)(Gi,{tone:Qa[r.type]??`neutral`,children:eo(r.type)}),r.priority&&(0,L.jsx)(Gi,{tone:$a[r.priority]??`neutral`,dot:!0,children:eo(r.priority)}),n?.(e)]})]}),(0,L.jsx)(B,{name:`chevronRight`,size:16,className:`shrink-0 text-fg-subtle`})]})},e.iid)})}),(0,L.jsx)(`div`,{className:`hidden overflow-x-auto rounded-xl border border-line bg-surface-raised md:block`,children:(0,L.jsxs)(`table`,{"aria-label":`Issues`,className:`w-full min-w-[880px] table-fixed text-left text-sm`,children:[(0,L.jsxs)(`colgroup`,{children:[(0,L.jsx)(`col`,{}),(0,L.jsx)(`col`,{className:`w-28`}),(0,L.jsx)(`col`,{className:`w-28`}),(0,L.jsx)(`col`,{className:`w-48`}),(0,L.jsx)(`col`,{className:`w-36`}),(0,L.jsx)(`col`,{className:`w-24`})]}),(0,L.jsx)(`thead`,{className:`border-b border-line text-xs font-medium text-fg-subtle`,children:(0,L.jsxs)(`tr`,{children:[(0,L.jsx)(`th`,{scope:`col`,className:`py-2.5 pl-4 pr-3 font-medium`,children:`Issue`}),(0,L.jsx)(`th`,{scope:`col`,className:`px-3 py-2.5 font-medium`,children:`Type`}),(0,L.jsx)(`th`,{scope:`col`,className:`px-3 py-2.5 font-medium`,children:`Priority`}),(0,L.jsx)(`th`,{scope:`col`,className:`px-3 py-2.5 font-medium`,children:`Status`}),(0,L.jsx)(`th`,{scope:`col`,className:`px-3 py-2.5 font-medium`,children:`Author`}),(0,L.jsx)(`th`,{scope:`col`,className:`py-2.5 pl-3 pr-4 text-right font-medium`,children:`Opened`})]})}),(0,L.jsx)(`tbody`,{className:`divide-y divide-line`,children:e.map(e=>{let r=Ia(e.labels);return(0,L.jsxs)(`tr`,{onClick:()=>t(e),className:`group cursor-pointer transition-colors hover:bg-surface-hover`,children:[(0,L.jsxs)(`td`,{className:`py-3 pl-4 pr-3 align-top`,children:[(0,L.jsxs)(`div`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,L.jsxs)(`span`,{className:`shrink-0 font-mono text-xs text-fg-subtle`,children:[`#`,e.iid]}),(0,L.jsx)(`button`,{type:`button`,onClick:n=>{n.stopPropagation(),t(e)},className:`truncate text-left font-medium text-fg group-hover:text-accent-fg`,children:e.title})]}),(0,L.jsxs)(`div`,{className:`mt-1 flex min-w-0 items-center gap-2 text-xs text-fg-subtle`,children:[e.forgeBranch&&(0,L.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1 font-mono`,title:e.forgeBranch,children:[(0,L.jsx)(B,{name:`branch`,size:12,className:`shrink-0`}),(0,L.jsx)(`span`,{className:`truncate`,children:e.forgeBranch})]}),r.areas.map(e=>(0,L.jsx)(`span`,{className:`shrink-0 rounded bg-surface-hover px-1.5 py-px`,children:e},e))]})]}),(0,L.jsx)(`td`,{className:`px-3 py-3 align-top`,children:r.type?(0,L.jsx)(Gi,{tone:Qa[r.type]??`neutral`,children:eo(r.type)}):(0,L.jsx)(`span`,{className:`text-fg-subtle`,children:`—`})}),(0,L.jsx)(`td`,{className:`px-3 py-3 align-top`,children:r.priority?(0,L.jsx)(Gi,{tone:$a[r.priority]??`neutral`,dot:!0,children:eo(r.priority)}):(0,L.jsx)(`span`,{className:`text-fg-subtle`,children:`—`})}),(0,L.jsx)(`td`,{className:`px-3 py-3 align-top`,children:(0,L.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:n?.(e)})}),(0,L.jsx)(`td`,{className:`truncate px-3 py-3 align-top text-fg-muted`,children:e.author.name}),(0,L.jsx)(`td`,{className:`whitespace-nowrap py-3 pl-3 pr-4 text-right align-top tabular-nums text-fg-subtle`,children:to.format(new Date(e.created_at))})]},e.iid)})})]})})]})}var ro=`h-8 rounded-lg border border-line bg-surface-raised px-2.5 text-xs text-fg focus:border-accent-hover focus:outline-none`;function io(e,t){let n=new Set;for(let r of e){let e=Ia(r.labels)[t];e&&n.add(e)}let r=[...n];return t===`priority`?r.sort((e,t)=>Na.indexOf(e)-Na.indexOf(t)):r.sort()}function ao({issues:e,loading:t,refreshing:n=!1,error:r,onSelect:i,onCreate:a,availableLabels:o,activeJobsByIid:s,pipelinesByIid:c,openMrByIid:l,creating:u,onCreatingChange:d}){let[f,p]=(0,x.useState)(``),[m,h]=(0,x.useState)(`all`),[g,_]=(0,x.useState)(`all`),v=La({issues:e,query:f,type:m,priority:g}),y=v.length===e.length?`${e.length} ${e.length===1?`issue`:`issues`}`:`${v.length} of ${e.length} issues`;return(0,L.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[u&&(0,L.jsx)(Ka,{onCreate:a,availableLabels:o,onCancel:()=>d(!1)}),(0,L.jsxs)(`div`,{className:`grid grid-cols-2 items-center gap-2 sm:flex sm:flex-wrap`,children:[(0,L.jsxs)(`div`,{className:`relative col-span-2 min-w-[220px] flex-1 sm:max-w-xs`,children:[(0,L.jsx)(B,{name:`search`,size:14,className:`pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-fg-subtle`}),(0,L.jsx)(`input`,{type:`search`,"aria-label":`Filter issues`,placeholder:`Filter by title, #number or label`,value:f,onChange:e=>p(e.target.value),className:`h-8 w-full rounded-lg border border-line bg-surface-raised pl-8 pr-2.5 text-xs text-fg placeholder:text-fg-subtle focus:border-accent-hover focus:outline-none`})]}),(0,L.jsxs)(`select`,{"aria-label":`Type`,value:m,onChange:e=>h(e.target.value),className:ro,children:[(0,L.jsx)(`option`,{value:`all`,children:`All types`}),io(e,`type`).map(e=>(0,L.jsx)(`option`,{value:e,children:e},e))]}),(0,L.jsxs)(`select`,{"aria-label":`Priority`,value:g,onChange:e=>_(e.target.value),className:ro,children:[(0,L.jsx)(`option`,{value:`all`,children:`All priorities`}),io(e,`priority`).map(e=>(0,L.jsx)(`option`,{value:e,children:e},e))]}),(0,L.jsx)(`span`,{className:`col-span-2 min-w-28 text-xs tabular-nums text-fg-subtle sm:ml-auto`,"aria-live":`polite`,children:t?`Loading…`:y})]}),r&&(0,L.jsx)(`div`,{className:`max-h-48 overflow-y-auto whitespace-pre-wrap break-words rounded-xl border border-red-800/60 bg-red-950/40 px-4 py-3 text-sm leading-snug text-red-300 [overflow-wrap:anywhere]`,children:r}),t?(0,L.jsx)(`div`,{className:`overflow-hidden rounded-xl border border-line bg-surface-raised`,"aria-busy":`true`,children:Array.from({length:6}).map((e,t)=>(0,L.jsxs)(`div`,{className:`flex h-[61px] items-center gap-4 border-b border-line px-4 last:border-0`,children:[(0,L.jsx)(`div`,{className:`h-3 w-8 animate-pulse rounded bg-surface-hover`}),(0,L.jsx)(`div`,{className:`h-3 flex-1 animate-pulse rounded bg-surface-hover`}),(0,L.jsx)(`div`,{className:`h-3 w-16 animate-pulse rounded bg-surface-hover`}),(0,L.jsx)(`div`,{className:`h-3 w-16 animate-pulse rounded bg-surface-hover`})]},t))}):e.length===0?(0,L.jsx)(Ki,{icon:`inbox`,title:`No open issues`,description:`Create an issue and Forge can analyze it, propose a fix and open the merge request.`,action:(0,L.jsxs)(z,{size:`sm`,variant:`primary`,onClick:()=>d(!0),children:[(0,L.jsx)(B,{name:`plus`,size:14}),` New issue`]})}):v.length===0?(0,L.jsx)(Ki,{icon:`search`,title:`No matching issues`,description:`Try a different search or clear the filters.`}):(0,L.jsx)(`div`,{"aria-busy":n||void 0,className:Gn(`transition-opacity`,n&&`opacity-60`),children:(0,L.jsx)(no,{issues:v,onSelect:i,renderStatus:e=>(0,L.jsx)(Za,{issue:e,activeJobs:s[e.iid],pipeline:c[e.iid],openMr:l[e.iid]})})})]})}var oo=new Set([`running`,`pending`,`created`,`preparing`,`waiting_for_resource`,`scheduled`]),so=15e3;function co(e){if(!e)return null;let t=e.match(/^forge\/issue-(\d+)(?:-|$)/);return t?Number(t[1]):null}function W(e){return e===`/mrs`||e.startsWith(`/mrs/`)?`mrs`:e===`/pipelines`||e.startsWith(`/pipelines/`)?`pipelines`:`issues`}var G=[`open`,`merged`,`closed`];function lo(){let{pathname:e}=Ei(),{issues:t,issuesLoading:n,issuesLoaded:r,issuesError:i,openMRs:a,openMRsLoading:o,openMRsLoaded:s,openMRsError:c,selectedRepo:l,availableRepos:u,remoteActiveIids:d}=V(),[f,p]=(0,x.useState)(!1),[m,h]=(0,x.useState)(0),g=qr(),_=(0,x.useMemo)(()=>{let e=l||`default`,n={};for(let r of t){let t=Xr(g,e,r.iid);t.length?n[r.iid]=t:d.has(r.iid)&&!n[r.iid]?.length&&(n[r.iid]=[`analyze`])}return n},[g,t,l,d]),v=(0,x.useMemo)(()=>{let e={};for(let t of a){if(!t.pipeline)continue;let n=co(t.source_branch);n!=null&&(e[n]={status:t.pipeline.status,web_url:t.pipeline.web_url})}return e},[a]),y=(0,x.useMemo)(()=>{let e={};for(let t of a){let n=co(t.source_branch);n!=null&&(e[n]={iid:t.iid,web_url:t.web_url})}return e},[a]),{handleSelectIssue:b,handleCreateIssue:S,handleSelectMR:C,loadIssues:w,loadOpenMRs:T}=H(),E=W(e),ee=Ma(l),D=(0,x.useMemo)(()=>Object.values(v).some(e=>oo.has(e.status)),[v]);(0,x.useEffect)(()=>{if(E!==`issues`||!D)return;let e=setInterval(()=>T(),so);return()=>clearInterval(e)},[E,D,T]);let[O,k]=(0,x.useState)(`open`);(0,x.useEffect)(()=>{E!==`mrs`&&O!==`open`&&(k(`open`),T(`open`))},[E]);let A=e=>{e!==O&&(k(e),T(e))},te=()=>{E===`issues`?w():T(E===`mrs`?O:`open`)},ne=u.find(e=>e.id===l)?.label??l,re=(0,L.jsxs)(z,{size:`sm`,onClick:te,children:[(0,L.jsx)(B,{name:`refresh`,size:14}),` Refresh`]});return(0,L.jsxs)(`div`,{className:`mx-auto flex w-full max-w-6xl flex-col gap-6`,children:[E===`issues`&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(qi,{title:`Issues`,description:(0,L.jsxs)(`span`,{"aria-hidden":!ne||void 0,className:ne?void 0:`animate-pulse rounded bg-surface-hover text-transparent [box-decoration-break:clone]`,children:[`Open issues in `,ne||`repository`,`. Pick one to have Forge analyze and fix it.`]},ne?`ready`:`loading`),actions:(0,L.jsxs)(L.Fragment,{children:[re,(0,L.jsxs)(z,{size:`sm`,variant:`primary`,onClick:()=>p(!0),children:[(0,L.jsx)(B,{name:`plus`,size:14}),` New issue`]})]})}),(0,L.jsx)(ao,{issues:t,loading:!r||!s,refreshing:n&&r,error:i,onSelect:b,onCreate:S,availableLabels:ee,activeJobsByIid:_,pipelinesByIid:v,openMrByIid:y,creating:f,onCreatingChange:p})]}),E===`mrs`&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(qi,{title:`Merge requests`,description:`Forge-authored and team merge requests, with their pipelines.`,actions:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`div`,{role:`tablist`,"aria-label":`Merge request state`,className:`flex rounded-lg border border-line bg-surface p-0.5`,children:G.map(e=>(0,L.jsx)(`button`,{role:`tab`,"aria-selected":O===e,onClick:()=>A(e),className:`h-6 rounded-md px-3 text-xs capitalize transition-colors ${O===e?`bg-surface-raised text-fg shadow-sm ring-1 ring-line`:`text-fg-subtle hover:text-fg`}`,children:e},e))}),re]})}),(0,L.jsx)(Ca,{mrs:a,loading:!s&&!c,refreshing:o&&s,error:c,state:O,onSelect:C,onRefresh:()=>T(O)})]}),E===`pipelines`&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(qi,{title:`Pipelines`,description:`CI history: main, merge requests and branches.`,actions:(0,L.jsxs)(z,{size:`sm`,onClick:()=>h(e=>e+1),children:[(0,L.jsx)(B,{name:`refresh`,size:14}),` Refresh`]})}),(0,L.jsx)(ka,{repo:l||void 0,reloadKey:m})]})]})}function uo(){let{issueEnvironments:e}=V();return e.length===0?null:(0,L.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(`h3`,{className:`text-[15px] font-semibold text-fg`,children:`Environments`}),(0,L.jsx)(`span`,{className:`text-[10px] text-fg-subtle`,children:`Ephemeral review apps`})]}),(0,L.jsx)(`div`,{className:`flex flex-col gap-2`,children:e.map(e=>(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-3 bg-surface-raised/50 border border-line-strong rounded-lg px-4 py-3`,children:[(0,L.jsxs)(`div`,{className:`flex flex-col gap-0.5 min-w-0`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,L.jsx)(`span`,{className:`font-medium ${e.state===`available`?`text-emerald-400`:e.state===`stopping`?`text-amber-400`:e.state===`stopped`?`text-fg-subtle`:`text-fg-muted`}`,children:e.state}),(0,L.jsx)(`span`,{className:`text-fg-subtle`,children:`·`}),(0,L.jsx)(`span`,{className:`text-fg-muted font-mono truncate`,title:e.name,children:e.name})]}),(0,L.jsxs)(`span`,{className:`text-[11px] font-mono text-fg-subtle truncate`,title:e.branchName,children:[`⎇ `,e.branchName]})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-3 shrink-0`,children:[e.external_url?(0,L.jsx)(`a`,{href:e.external_url,target:`_blank`,rel:`noreferrer`,className:`text-sm text-violet-400 hover:underline`,children:`Open preview ↗`}):(0,L.jsx)(`span`,{className:`text-xs text-fg-subtle italic`,children:`no URL yet`}),e.web_url&&(0,L.jsx)(`a`,{href:e.web_url,target:`_blank`,rel:`noreferrer`,className:`text-xs text-fg-subtle hover:text-fg transition-colors`,title:`View environment in GitLab`,children:`details ↗`})]})]},e.id))})]})}function fo({label:e,trigger:t,items:n,triggerClassName:r}){let[i,a]=(0,x.useState)(!1),o=(0,x.useId)(),s=(0,x.useRef)(null),c=(0,x.useRef)(null),l=(0,x.useRef)([]);l.current.length=n.length,(0,x.useEffect)(()=>{if(!i)return;l.current[0]?.focus();let e=e=>{s.current?.contains(e.target)||a(!1)};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[i]);let u=()=>{a(!1),c.current?.focus()};return(0,L.jsxs)(`div`,{ref:s,className:`relative`,children:[(0,L.jsx)(`button`,{ref:c,type:`button`,"aria-label":e,"aria-haspopup":`menu`,"aria-expanded":i,"aria-controls":i?o:void 0,onClick:()=>a(e=>!e),className:r,children:t}),i&&(0,L.jsx)(`div`,{id:o,role:`menu`,"aria-label":e,onKeyDown:e=>{let t=l.current.filter(e=>e!==null),n=t.indexOf(document.activeElement),r=n=>{e.preventDefault(),t[(n+t.length)%t.length]?.focus()};e.key===`ArrowDown`?r(n+1):e.key===`ArrowUp`?r(n-1):e.key===`Home`?r(0):e.key===`End`?r(t.length-1):e.key===`Escape`?(e.preventDefault(),u()):e.key===`Tab`&&a(!1)},className:`absolute right-0 top-full mt-2 z-40 w-60 p-1.5 flex flex-col rounded-xl border border-line-strong bg-surface-raised shadow-2xl animate-[forge-fade_120ms_ease-out]`,children:n.map((e,t)=>(0,L.jsxs)(`div`,{className:`contents`,children:[e.separated&&(0,L.jsx)(`div`,{role:`separator`,className:`my-1.5 mx-1 h-px bg-line`}),(0,L.jsxs)(`button`,{ref:e=>{l.current[t]=e},type:`button`,role:`menuitem`,tabIndex:-1,onClick:()=>{a(!1),e.onSelect()},className:Gn(`flex items-center gap-2.5 min-h-11 md:min-h-9 px-2.5 rounded-lg text-[15px] md:text-sm text-left outline-none transition-colors`,`hover:bg-surface-hover focus-visible:bg-surface-hover`,e.tone===`danger`?`text-red-400`:`text-fg`),children:[e.icon,e.label]})]},e.id))})]})}function po(e,t){let n=(0,x.useRef)(t);n.current=t,(0,x.useEffect)(()=>{if(!e)return;let t=document.activeElement instanceof HTMLElement?document.activeElement:null,r=e=>{e.key===`Escape`&&n.current()};window.addEventListener(`keydown`,r);let i=document.body.style.overflow;return document.body.style.overflow=`hidden`,()=>{window.removeEventListener(`keydown`,r),document.body.style.overflow=i,t?.isConnected&&t.focus()}},[e])}function mo({open:e,onClose:t,title:n,description:r,icon:i,footer:a,children:o}){let s=(0,x.useId)(),c=(0,x.useId)();return po(e,t),e?(0,L.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-end md:items-center justify-center bg-black/60 md:p-4 animate-[forge-fade_160ms_ease-out]`,onClick:t,children:(0,L.jsxs)(`section`,{role:`dialog`,"aria-modal":`true`,"aria-labelledby":s,"aria-describedby":r?c:void 0,onClick:e=>e.stopPropagation(),className:`w-full md:max-w-[480px] max-h-[92dvh] flex flex-col bg-surface-raised border-t md:border border-line-strong rounded-t-[20px] md:rounded-2xl shadow-2xl animate-[forge-sheet-up_320ms_cubic-bezier(0.32,0.72,0,1)] md:animate-none`,children:[(0,L.jsx)(`div`,{className:`md:hidden flex justify-center pt-2`,children:(0,L.jsx)(`span`,{"aria-hidden":`true`,className:`w-9 h-[5px] rounded-full bg-line-strong`})}),(0,L.jsxs)(`header`,{className:`flex items-start gap-3.5 px-4 md:px-6 pt-3 md:pt-6`,children:[i&&(0,L.jsx)(`span`,{className:`hidden md:inline-flex shrink-0`,children:i}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-1 min-w-0`,children:[(0,L.jsx)(`h2`,{id:s,className:`text-xl md:text-[17px] font-bold md:font-semibold text-fg`,children:n}),r&&(0,L.jsx)(`p`,{id:c,className:`text-sm md:text-[13px] text-fg-muted truncate`,children:r})]})]}),o&&(0,L.jsx)(`div`,{className:`overflow-y-auto overscroll-contain px-4 md:px-6 py-4 md:py-5 flex flex-col gap-4`,children:o}),(0,L.jsx)(`footer`,{className:Gn(`flex flex-col-reverse md:flex-row md:justify-end gap-2 px-4 md:px-6 pt-3 md:py-4 pb-[max(1.25rem,env(safe-area-inset-bottom))] md:border-t md:border-line`,!o&&`mt-4`),children:a})]})}):null}var ho={close:{title:`Close issue`,confirm:`Close issue`,pending:`Closing…`,issueRow:`The issue`,issueEffect:`closed, can be reopened`},delete:{title:`Delete issue`,confirm:`Delete issue`,pending:`Deleting…`,issueRow:`The issue and its comments`,issueEffect:`deleted`}};function go({action:e,onClose:t,onSwitch:n}){let{selectedIssue:r,selectedRepo:i}=V(),{handleCloseIssue:a,handleDeleteIssue:o}=H(),[s,c]=(0,x.useState)({status:`loading`}),[l,u]=(0,x.useState)(``),[d,f]=(0,x.useState)(!1),[p,m]=(0,x.useState)(null),h=r?.iid,g=e!==null&&h!==void 0;if((0,x.useEffect)(()=>{if(!g)return;let e=!1;return c({status:`loading`}),R(`/issues/${h}/footprint?repo=${encodeURIComponent(i)}`).then(t=>!e&&c({status:`ready`,footprint:t})).catch(()=>!e&&c({status:`unknown`})),()=>{e=!0}},[g,h,i]),(0,x.useEffect)(()=>{u(``),m(null),f(!1)},[e,h]),!g||!r||!e)return null;let _=ho[e],v=e===`delete`,y=s.status===`ready`?s.footprint.openMr:null,b=l.trim()===String(r.iid),S=s.status!==`loading`&&!y&&(!v||b)&&!d,C=async()=>{f(!0),m(null);try{await(v?o():a()),t()}catch(e){m(e.message),f(!1)}},w=e=>s.status===`ready`?String(e(s.footprint)):s.status===`unknown`?`—`:null;return(0,L.jsxs)(mo,{open:!0,onClose:d?()=>{}:t,title:`${_.title} #${r.iid}?`,description:r.title,icon:(0,L.jsx)(`span`,{"aria-hidden":`true`,className:Gn(`inline-flex items-center justify-center size-10 rounded-[10px]`,v?`bg-red-950 text-red-400`:`bg-surface-hover text-fg-muted`),children:(0,L.jsx)(B,{name:v?`trash`:`archive`,size:18})}),footer:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(z,{variant:`secondary`,onClick:t,disabled:d,className:`h-12 md:h-10 px-4 text-[15px] md:text-sm`,children:`Cancel`}),(0,L.jsx)(z,{variant:v?`danger`:`primary`,onClick:C,disabled:!S,className:`h-12 md:h-10 px-4 text-[15px] md:text-sm font-semibold`,children:(0,L.jsxs)(`span`,{className:`grid`,children:[(0,L.jsx)(`span`,{className:Gn(`[grid-area:1/1]`,d&&`invisible`),children:_.confirm}),(0,L.jsx)(`span`,{"aria-hidden":!d,className:Gn(`[grid-area:1/1]`,!d&&`invisible`),children:_.pending})]})})]}),children:[(0,L.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,L.jsx)(`span`,{className:`text-sm md:text-[13px] text-fg`,children:v?`This permanently removes:`:`This will:`}),(0,L.jsxs)(`ul`,{className:`rounded-xl md:rounded-[10px] border border-line bg-surface`,children:[(0,L.jsx)(_o,{label:_.issueRow,value:_.issueEffect}),(0,L.jsx)(_o,{label:`Forge branches`,value:w(e=>e.branches),effect:`deleted`}),(0,L.jsx)(_o,{label:`Review environments`,value:w(e=>e.environments),effect:`stopped`})]})]}),(0,L.jsx)(`div`,{className:`min-h-[76px] flex flex-col justify-center`,children:y?(0,L.jsxs)(`p`,{role:`alert`,className:`rounded-[10px] border border-amber-800/60 bg-amber-950/40 px-3.5 py-3 text-sm md:text-[13px] text-amber-200`,children:[`MR`,` `,(0,L.jsxs)(`a`,{href:y.web_url,target:`_blank`,rel:`noreferrer`,className:`font-mono underline`,children:[`!`,y.iid]}),` `,`is still open. Merge or close it first.`]}):v?(0,L.jsxs)(`label`,{className:`flex flex-col gap-1.5`,children:[(0,L.jsxs)(`span`,{className:`text-sm md:text-[13px] text-fg`,children:[`Type `,(0,L.jsx)(`strong`,{className:`font-mono`,children:r.iid}),` to confirm`]}),(0,L.jsx)(`input`,{autoFocus:!0,value:l,onChange:e=>u(e.target.value),onKeyDown:e=>{e.key===`Enter`&&S&&C()},inputMode:`numeric`,autoComplete:`off`,"aria-label":`Type ${r.iid} to confirm`,className:Gn(`h-12 md:h-10 px-3 rounded-xl md:rounded-lg border bg-canvas font-mono text-fg outline-none`,b?`border-red-500`:`border-line-strong focus:border-accent`)})]}):(0,L.jsx)(`p`,{className:`text-sm md:text-[13px] text-fg-muted`,children:`You can reopen it later.`})}),v&&(0,L.jsxs)(`div`,{className:`flex items-center gap-3 rounded-xl md:rounded-[10px] bg-surface-hover px-3.5 py-3`,children:[(0,L.jsx)(`span`,{className:`flex-1 text-sm md:text-[13px] text-fg`,children:`Just want it off the list? Closing is reversible.`}),(0,L.jsx)(z,{variant:`secondary`,size:`sm`,onClick:()=>n(`close`),disabled:d||!!y,className:`h-9`,children:`Close instead`})]}),p&&(0,L.jsx)(`p`,{role:`alert`,className:`rounded-[10px] border border-red-800 bg-red-950/40 px-3.5 py-3 text-sm md:text-[13px] text-red-300`,children:p})]})}function _o({label:e,value:t,effect:n}){return(0,L.jsxs)(`li`,{className:`flex items-center justify-between gap-3 min-h-11 md:min-h-10 px-3.5 text-sm md:text-[13px] border-t border-line first:border-t-0`,children:[(0,L.jsx)(`span`,{className:`text-fg`,children:e}),(0,L.jsx)(`span`,{className:`text-fg-muted tabular-nums`,children:t===null?(0,L.jsx)(`span`,{"aria-label":`Loading`,className:`inline-block align-middle h-3 w-16 rounded bg-surface-hover animate-pulse`}):n?`${t} ${n}`:t})]})}function vo({onEdit:e}){let{selectedIssue:t}=V(),{can:n}=Ui(),[r,i]=(0,x.useState)(null);if(!t)return null;let a=[...e?[{id:`edit`,label:`Edit title & labels`,icon:(0,L.jsx)(B,{name:`pencil`}),onSelect:e}]:[],{id:`open`,label:`Open in GitLab`,icon:(0,L.jsx)(B,{name:`external`}),onSelect:()=>window.open(t.web_url,`_blank`,`noopener,noreferrer`)},...n(`approver`)?[{id:`delete`,label:`Delete issue…`,icon:(0,L.jsx)(B,{name:`trash`}),tone:`danger`,separated:!0,onSelect:()=>i(`delete`)}]:[]];return(0,L.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[n(`operator`)&&(0,L.jsx)(z,{variant:`secondary`,onClick:()=>i(`close`),className:`h-11 md:h-10 px-3.5`,children:`Close issue`}),(0,L.jsx)(fo,{label:`More actions`,trigger:(0,L.jsx)(B,{name:`more`,size:18}),items:a,triggerClassName:`inline-flex items-center justify-center size-11 md:size-10 rounded-lg border border-line-strong text-fg hover:bg-surface-hover aria-expanded:bg-surface-hover transition-colors`}),(0,L.jsx)(go,{action:r,onClose:()=>i(null),onSwitch:i})]})}var yo={success:`bg-green-400`,failed:`bg-red-400`,running:`bg-yellow-400 animate-pulse`,pending:`bg-yellow-600`,canceled:`bg-fg-subtle`,skipped:`bg-fg-subtle`,created:`bg-fg-subtle`},bo={success:`passed`,failed:`failed`,running:`running`,pending:`pending`,canceled:`canceled`,skipped:`skipped`,created:`created`},xo={success:`text-green-400`,failed:`text-red-400`,running:`text-yellow-400`,pending:`text-yellow-500`,canceled:`text-fg-subtle`,skipped:`text-fg-subtle`,created:`text-fg-subtle`};function So({mrs:e}){return e.length===0?null:(0,L.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,L.jsx)(`h3`,{className:`text-[15px] font-semibold text-fg`,children:`Merged changes`}),(0,L.jsx)(`div`,{className:`flex flex-col gap-1`,children:e.map(e=>{let t=e.pipeline?.status,n=t?yo[t]??`bg-fg-subtle`:`bg-fg-subtle`,r=t?bo[t]??t:`no pipeline`,i=t?xo[t]??`text-fg-subtle`:`text-fg-subtle`;return(0,L.jsxs)(`div`,{className:`flex items-center justify-between bg-surface-raised border border-line rounded px-3 py-2`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,L.jsx)(`span`,{className:`w-2 h-2 rounded-full shrink-0 ${n}`,title:`post-merge pipeline: ${r}`}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-0.5 min-w-0`,children:[(0,L.jsxs)(`a`,{href:e.web_url,target:`_blank`,rel:`noreferrer`,className:`text-sm text-fg hover:text-fg transition-colors truncate`,children:[`!`,e.iid,` `,e.title]}),(0,L.jsx)(`span`,{className:`text-xs font-mono text-fg-subtle truncate`,children:e.branchName})]})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-3 shrink-0 ml-3`,children:[e.pipeline?(0,L.jsx)(`a`,{href:e.pipeline.web_url,target:`_blank`,rel:`noreferrer`,className:`text-xs hover:underline ${i}`,title:`View post-merge pipeline in GitLab`,children:r}):(0,L.jsx)(`span`,{className:`text-xs text-fg-subtle italic`,children:`no pipeline`}),(0,L.jsx)(`span`,{className:`text-xs text-fg-subtle`,children:new Date(e.merged_at).toLocaleDateString()})]})]},e.iid)})})]})}function Co(){let{selectedIssue:e,analysisPrompt:t,refining:n,mergedMrs:r}=V(),{setAnalysisPrompt:i,handleBeginAnalysis:a}=H();return e?(0,L.jsxs)(`div`,{className:`flex flex-col gap-6 w-full`,children:[(0,L.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-fg-subtle`,children:[(0,L.jsxs)(`span`,{className:`font-mono`,children:[`#`,e.iid]}),e.labels.map(e=>(0,L.jsx)(`span`,{className:`bg-surface-raised text-fg-muted ring-1 ring-inset ring-line px-1.5 py-0.5 rounded`,children:e},e))]}),(0,L.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,L.jsx)(`h2`,{className:`text-lg font-semibold text-fg`,children:e.title}),(0,L.jsx)(vo,{})]}),(0,L.jsxs)(`p`,{className:`text-xs text-fg-subtle`,children:[`by `,e.author.name,` ·`,` `,(0,L.jsx)(`a`,{href:e.web_url,target:`_blank`,rel:`noreferrer`,className:`hover:text-fg transition-colors`,children:`view on GitLab ↗`})]})]}),e.description&&(0,L.jsx)(`div`,{className:`bg-surface-raised border border-line-strong rounded-lg px-4 py-4 text-sm text-fg whitespace-pre-wrap leading-relaxed w-full max-h-[50vh] overflow-y-auto`,children:e.description}),(0,L.jsx)(uo,{}),!n&&(0,L.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,L.jsx)(`textarea`,{value:t,onChange:e=>i(e.target.value),placeholder:`Optional instructions for the analysis…`,rows:2,className:`w-full bg-surface-raised/60 border border-line-strong rounded-lg px-3 py-2 text-sm text-fg placeholder-fg-subtle focus:outline-none focus:border-violet-500 resize-none`}),(0,L.jsx)(`div`,{className:`flex items-center justify-between gap-6 border-t border-line/60 pt-3`,children:(0,L.jsx)(`div`,{className:`flex items-center gap-3`,children:(0,L.jsx)(`button`,{onClick:a,className:`bg-surface-raised ring-1 ring-inset ring-line-strong hover:bg-surface-hover text-fg text-sm font-medium px-4 py-2 rounded-lg transition-colors`,children:`Analyze & Update MR`})})})]}),(0,L.jsx)(So,{mrs:r})]}):null}var wo=(0,x.createContext)(null);function To({children:e,placeholder:t=null,className:n}){let[r,i]=(0,x.useState)({}),[a,o]=(0,x.useState)(!1),[s,c]=(0,x.useState)(!1),l=(0,x.useCallback)((e,t)=>{i(n=>n[e]===!t?n:{...n,[e]:!t})},[]);(0,x.useEffect)(()=>o(!0),[]);let u=a&&Object.values(r).every(e=>!e);return(0,x.useEffect)(()=>{u&&c(!0)},[u]),(0,L.jsxs)(wo.Provider,{value:l,children:[!s&&t,(0,L.jsx)(`div`,{hidden:!s,className:s?n:void 0,children:e})]})}function Eo(e){let t=(0,x.useContext)(wo),n=(0,x.useId)();(0,x.useEffect)(()=>{t?.(n,e)},[t,n,e]),(0,x.useEffect)(()=>()=>t?.(n,!0),[t,n])}function Do({ready:e}){return Eo(e),null}async function Oo(e,t){let n=await e.text().catch(()=>``);try{let e=JSON.parse(n);if(e.error)return e.error}catch{}return n||t}function ko({state:e,label:t,detail:n}){return(0,L.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,L.jsx)(`span`,{className:`w-4 text-center font-mono ${e===`ok`?`text-emerald-400`:e===`fail`?`text-red-400`:e===`pending`?`text-yellow-400`:`text-fg-subtle`}`,children:e===`ok`?`✓`:e===`fail`?`✗`:e===`pending`?`○`:`–`}),(0,L.jsx)(`span`,{className:`text-fg`,children:t}),n&&(0,L.jsxs)(`span`,{className:`text-fg-subtle`,children:[`— `,n]})]})}function Ao(e){let t=[],n=null;for(let r of e.split(`
18
+ `))r.startsWith(`@@`)?(n={header:r,lines:[]},t.push(n)):n&&(r.startsWith(`+`)?n.lines.push({type:`add`,content:r.slice(1)}):r.startsWith(`-`)?n.lines.push({type:`remove`,content:r.slice(1)}):r.startsWith(`\\`)||n.lines.push({type:`context`,content:r.slice(1)}));return t}function jo({d:e}){let[t,n]=(0,x.useState)(!0),r=Ao(e.diff),i=e.new_file?`A`:e.deleted_file?`D`:e.renamed_file?`R`:`M`;return(0,L.jsxs)(`div`,{className:`border border-line-strong rounded-lg overflow-hidden`,children:[(0,L.jsxs)(`button`,{onClick:()=>n(e=>!e),className:`w-full flex items-center gap-2 bg-surface-raised px-3 py-2 text-left hover:bg-surface-hover transition-colors`,children:[(0,L.jsx)(`span`,{className:`text-xs font-mono font-bold ${i===`A`?`text-green-400`:i===`D`?`text-red-400`:i===`R`?`text-blue-400`:`text-fg-muted`}`,children:i}),(0,L.jsx)(`span`,{className:`text-xs font-mono text-fg flex-1 truncate`,children:e.new_path!==e.old_path&&e.old_path!==`/dev/null`?`${e.old_path} → ${e.new_path}`:e.new_path}),(0,L.jsx)(`span`,{className:`text-fg-subtle text-xs`,children:t?`▲`:`▼`})]}),t&&(0,L.jsx)(`div`,{className:`overflow-x-auto`,children:r.length===0?(0,L.jsx)(`p`,{className:`text-xs text-fg-subtle px-3 py-2`,children:`Binary or empty diff`}):r.map((e,t)=>(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`div`,{className:`bg-surface-raised px-3 py-0.5 text-xs font-mono text-fg-subtle`,children:e.header}),e.lines.map((e,t)=>(0,L.jsxs)(`div`,{className:`flex font-mono text-xs leading-5 ${e.type===`add`?`bg-green-950/40 text-green-300`:e.type===`remove`?`bg-red-950/40 text-red-300`:`text-fg-muted`}`,children:[(0,L.jsx)(`span`,{className:`select-none w-4 shrink-0 text-center ${e.type===`add`?`text-green-500`:e.type===`remove`?`text-red-500`:`text-fg-subtle`}`,children:e.type===`add`?`+`:e.type===`remove`?`−`:` `}),(0,L.jsx)(`span`,{className:`pl-2 whitespace-pre`,children:e.content})]},t))]},t))})]})}function Mo({mrIid:e,repo:t,pipelineStatus:n,onMerged:r}){let[i,a]=(0,x.useState)(null),[o,s]=(0,x.useState)(!0),[c,l]=(0,x.useState)(null),[u,d]=(0,x.useState)(!1),[f,p]=(0,x.useState)(null),[m,h]=(0,x.useState)(!1),[g,_]=(0,x.useState)(null),[v,y]=(0,x.useState)(null),{can:b}=Ui(),[S,C]=(0,x.useState)(null),[w,T]=(0,x.useState)(!1),[E,ee]=(0,x.useState)(!1),[D,O]=(0,x.useState)(null),[k,A]=(0,x.useState)(!1),[te,ne]=(0,x.useState)(null),[re,ie]=(0,x.useState)(!1),j=(0,x.useRef)(null),M=(0,x.useRef)(!1),ae=(0,x.useRef)(!1);Eo(!o);let oe=t?`?repo=${encodeURIComponent(t)}`:``,se=(0,x.useCallback)(async()=>{try{let t=await window.fetch(`/api/forge/mr/${e}/detail${oe}`,{headers:Vn});if(!t.ok)throw t.status===404?(M.current=!0,j.current&&=(clearInterval(j.current),null),Error(`MR not found — it may have been deleted or belongs to a different project`)):Error(`MR API ${t.status}`);let n=await t.json();if(M.current)return;if(a(n),l(null),s(!1),n.state===`merged`&&!ae.current){ae.current=!0,j.current&&clearInterval(j.current),j.current=null,r?.();return}!n.rebase_in_progress&&j.current&&(clearInterval(j.current),j.current=null)}catch(e){if(M.current)return;l(e.message),s(!1)}},[e,oe]);(0,x.useEffect)(()=>(M.current=!1,se(),()=>{M.current=!0,j.current&&clearInterval(j.current)}),[se]);let ce=async()=>{d(!0),p(null);try{let t=await window.fetch(`/api/forge/mr/${e}/rebase${oe}`,{method:`POST`,headers:Vn});if(!t.ok)throw Error(await Oo(t,`Rebase API ${t.status}`));a(e=>e&&{...e,rebase_in_progress:!0}),j.current&&clearInterval(j.current),j.current=setInterval(se,3e3)}catch(e){p(e.message)}finally{d(!1)}},le=async()=>{h(!0),_(null);let t=i?.merge_when_pipeline_succeeds;try{let n=t?`/api/forge/mr/${e}/cancel-auto-merge${oe}`:`/api/forge/mr/${e}/auto-merge${oe}`,r=await window.fetch(n,{method:`POST`,headers:Vn});if(!r.ok)throw Error(await Oo(r,`Auto-merge API ${r.status}`));a(e=>e&&{...e,merge_when_pipeline_succeeds:!t})}catch(e){_(e.message)}finally{h(!1)}},N=async(t,n,r)=>{y(t),C(null);try{let t=await window.fetch(`/api/forge/mr/${e}/${n}${oe}`,{method:`POST`,headers:{...Vn,...r?{"Content-Type":`application/json`}:{}},body:r?JSON.stringify(r):void 0});if(!t.ok)throw Error(await Oo(t,`${n} API ${t.status}`));await se()}catch(e){C(e.message)}finally{y(null)}},ue=async()=>{A(!0),ne(null);try{let t=await window.fetch(`/api/forge/mr/${e}/diffs${oe}`,{headers:Vn});if(!t.ok)throw Error(`Diffs API ${t.status}`);O((await t.json()).diffs??[])}catch(e){ne(e.message)}finally{A(!1)}},de=()=>{!re&&D===null&&ue(),ie(e=>!e)};if(o)return(0,L.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-fg-subtle py-1`,children:[(0,L.jsx)(`span`,{className:`w-3 h-3 rounded-full border-2 border-fg-subtle border-t-transparent animate-spin inline-block shrink-0`}),`Loading MR status…`]});if(c||!i)return(0,L.jsxs)(`div`,{className:`text-sm text-fg-subtle py-1`,children:[`Could not load MR status`,c?` — ${c}`:``,`.`]});let fe=i.has_conflicts||i.detailed_merge_status===`need_rebase`||i.merge_status===`cannot_be_merged`;return(0,L.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[i.rebase_in_progress&&(0,L.jsxs)(`div`,{className:`flex items-center gap-2 bg-surface-raised border border-line-strong rounded-lg px-4 py-3`,children:[(0,L.jsx)(`span`,{className:`w-3 h-3 rounded-full border-2 border-yellow-400 border-t-transparent animate-spin inline-block shrink-0`}),(0,L.jsx)(`span`,{className:`text-sm text-yellow-300`,children:`Rebase in progress…`})]}),!i.rebase_in_progress&&fe&&(0,L.jsxs)(`div`,{className:`bg-amber-950/40 border border-amber-700 rounded-lg px-4 py-3 flex items-start justify-between gap-4`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`p`,{className:`text-sm font-medium text-amber-300`,children:i.has_conflicts?`Merge conflicts detected`:`Rebase required`}),(0,L.jsx)(`p`,{className:`text-xs text-amber-400/70 mt-0.5`,children:i.has_conflicts?`This branch has conflicts with the target branch.`:`The target branch has moved ahead of this MR branch.`}),f&&(0,L.jsx)(`p`,{className:`text-xs text-red-400 mt-1`,children:f})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[b(`operator`)&&(0,L.jsx)(`button`,{onClick:ce,disabled:u,className:`bg-amber-600 hover:bg-amber-500 disabled:opacity-50 text-on-accent text-xs font-medium px-3 py-1.5 rounded-lg transition-colors`,children:u?`Rebasing…`:`Rebase`}),i.has_conflicts&&(0,L.jsx)(`a`,{href:`${i.web_url}/conflicts`,target:`_blank`,rel:`noreferrer`,className:`text-xs text-amber-400 hover:text-amber-200 transition-colors`,children:`Resolve in GitLab ↗`})]})]}),i.state===`opened`&&!i.rebase_in_progress&&(()=>{let e=n===`failed`||n===`canceled`,t=n===`success`?`ok`:e?`fail`:n===`running`||n===`pending`||n===`created`?`pending`:`neutral`,r=i.draft?`Marked as draft`:i.has_conflicts?`Has merge conflicts`:fe?`Needs rebase`:e?`CI pipeline failed`:null,a=!r;return(0,L.jsxs)(`div`,{className:`bg-surface-raised/50 border border-line-strong rounded-lg overflow-hidden`,children:[(0,L.jsxs)(`div`,{className:`px-4 py-2.5 border-b border-line-strong flex items-center justify-between`,children:[(0,L.jsx)(`div`,{className:`flex items-center gap-2`,children:i.draft?(0,L.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-xs font-medium bg-surface-raised text-fg-muted ring-1 ring-inset ring-line px-2 py-0.5 rounded`,children:[(0,L.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-fg-muted`}),`Draft`]}):(0,L.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-xs font-medium bg-emerald-900/40 text-emerald-300 px-2 py-0.5 rounded`,children:[(0,L.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-emerald-400`}),`Open`]})}),b(`approver`)&&(0,L.jsx)(`button`,{onClick:le,disabled:m||!a,className:i.merge_when_pipeline_succeeds?`text-xs text-fg-subtle hover:text-fg disabled:opacity-40 transition-colors`:`text-xs text-violet-400 hover:text-violet-200 disabled:opacity-40 transition-colors`,title:i.merge_when_pipeline_succeeds?`Cancel the pending auto-merge`:`Queue this MR to merge automatically when the pipeline passes`,children:m?`…`:i.merge_when_pipeline_succeeds?`Cancel auto-merge`:`Set auto-merge`})]}),(0,L.jsxs)(`div`,{className:`px-4 py-3 border-b border-line-strong flex flex-col gap-1`,children:[(0,L.jsx)(ko,{state:t,label:`CI pipeline`,detail:n??`no pipeline`}),(0,L.jsx)(ko,{state:i.has_conflicts?`fail`:`ok`,label:i.has_conflicts?`Merge conflicts`:`No merge conflicts`}),(0,L.jsx)(ko,{state:fe?`fail`:`ok`,label:fe?`Rebase required`:`Branch up to date`}),i.draft&&(0,L.jsx)(ko,{state:`fail`,label:`Marked as draft`,detail:`mark ready to enable merge`}),i.merge_when_pipeline_succeeds&&(0,L.jsx)(ko,{state:`pending`,label:`Auto-merge queued`,detail:`will merge when pipeline passes`}),g&&(0,L.jsx)(`p`,{className:`text-xs text-red-400 pt-1`,children:g})]}),(0,L.jsxs)(`div`,{className:`px-4 py-3 bg-surface-raised/40 flex items-center justify-between gap-3`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-3 text-xs`,children:[b(`operator`)&&(0,L.jsx)(`button`,{onClick:()=>N(`draft`,`draft`,{draft:!i.draft}),disabled:v!==null,className:`text-fg-subtle hover:text-fg disabled:opacity-50 transition-colors`,title:i.draft?`Mark this MR as ready for review`:`Mark this MR as a draft`,children:v===`draft`?`…`:i.draft?`Mark ready`:`Mark as draft`}),b(`operator`)&&b(`approver`)&&(0,L.jsx)(`span`,{className:`text-fg-subtle`,children:`•`}),b(`approver`)&&(E?(0,L.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,L.jsx)(`span`,{className:`text-red-300`,children:`Close MR?`}),(0,L.jsx)(`button`,{onClick:()=>{ee(!1),N(`close`,`close`)},disabled:v!==null,className:`font-medium text-red-300 hover:text-red-200 disabled:opacity-50 transition-colors`,children:v===`close`?`Closing…`:`Confirm`}),(0,L.jsx)(`button`,{onClick:()=>ee(!1),className:`text-fg-subtle hover:text-fg transition-colors`,children:`Cancel`})]}):(0,L.jsx)(`button`,{onClick:()=>{C(null),T(!1),ee(!0)},disabled:v!==null,className:`text-fg-subtle hover:text-red-300 disabled:opacity-50 transition-colors`,children:`Close MR`}))]}),(0,L.jsx)(`div`,{className:`flex items-center gap-3`,children:a?b(`approver`)?w?(0,L.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,L.jsx)(`button`,{onClick:()=>T(!1),className:`text-xs text-fg-muted hover:text-fg transition-colors`,children:`Cancel`}),(0,L.jsx)(`button`,{onClick:()=>{T(!1),N(`merge`,`merge`)},disabled:v!==null,className:`text-sm font-medium text-on-accent bg-emerald-600 hover:bg-emerald-500 disabled:opacity-50 rounded-lg px-4 py-1.5 transition-colors`,children:v===`merge`?`Merging…`:`Confirm merge`})]}):(0,L.jsx)(`button`,{onClick:()=>{C(null),ee(!1),T(!0)},disabled:v!==null,className:`text-sm font-medium text-on-accent bg-emerald-600 hover:bg-emerald-500 disabled:opacity-50 rounded-lg px-4 py-1.5 transition-colors`,children:`Merge now`}):(0,L.jsx)(`span`,{className:`text-xs text-fg-subtle`,children:`Ready to merge — an approver merges it`}):(0,L.jsxs)(`span`,{className:`text-xs text-fg-subtle`,children:[`Can't merge — `,r]})})]})]})})(),i.state!==`opened`&&(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-xs font-medium px-2 py-0.5 rounded ${i.state===`merged`?`bg-violet-900/40 text-violet-300`:`bg-red-900/30 text-red-300`}`,children:[(0,L.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full ${i.state===`merged`?`bg-violet-400`:`bg-red-400`}`}),i.state===`merged`?`Merged`:`Closed`]}),i.state===`closed`&&b(`approver`)&&(0,L.jsx)(`button`,{onClick:()=>N(`reopen`,`reopen`),disabled:v!==null,className:`text-xs text-violet-400 hover:text-violet-200 disabled:opacity-50 transition-colors`,children:v===`reopen`?`Reopening…`:`Reopen`})]}),S&&(0,L.jsx)(`p`,{className:`text-xs text-red-400`,children:S}),(0,L.jsxs)(`div`,{children:[(0,L.jsxs)(`button`,{onClick:de,className:`text-xs text-fg-subtle hover:text-fg transition-colors flex items-center gap-1`,children:[(0,L.jsx)(`span`,{className:`transition-transform ${re?`rotate-90`:``} inline-block`,children:`›`}),re?`Hide diff`:`Show current diff`,D!==null&&` (${D.length} file${D.length===1?``:`s`})`]}),re&&(0,L.jsxs)(`div`,{className:`mt-3 flex flex-col gap-2`,children:[k&&(0,L.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-fg-subtle`,children:[(0,L.jsx)(`span`,{className:`w-3 h-3 rounded-full border-2 border-fg-subtle border-t-transparent animate-spin inline-block shrink-0`}),`Loading diff…`]}),te&&(0,L.jsx)(`p`,{className:`text-xs text-red-400`,children:te}),D&&D.length===0&&(0,L.jsx)(`p`,{className:`text-xs text-fg-subtle`,children:`No changes in this MR.`}),D&&D.map((e,t)=>(0,L.jsx)(jo,{d:e},t))]})]})]})}var No={success:`text-green-400`,failed:`text-red-400`,running:`text-yellow-400`,pending:`text-yellow-400`,canceled:`text-fg-subtle`,skipped:`text-fg-subtle`,created:`text-fg-muted`,waiting_for_resource:`text-fg-muted`,preparing:`text-fg-muted`,scheduled:`text-fg-muted`,manual:`text-blue-400`},Po={success:`✓`,failed:`✗`,running:`◎`,pending:`○`,canceled:`⊘`,skipped:`→`,created:`○`,manual:`⊡`},Fo=new Set([`success`,`failed`,`canceled`]);function Io(e){return No[e]??`text-fg-muted`}function Lo(e){return Po[e]??`○`}function Ro(e){let t=new Map;return e.forEach(e=>{t.has(e.stage)||t.set(e.stage,[]),t.get(e.stage).push(e)}),t}function zo({endpoint:e,repo:t,refreshKey:n,onRefinePipelineFailure:r,onStatusChange:i,ciFixAttempts:a,ciFixMaxAttempts:o,ciFixLoopWarning:s,onDismissCiFixWarning:c}){let[l,u]=(0,x.useState)(null),[d,f]=(0,x.useState)([]),[p,m]=(0,x.useState)(!0),[h,g]=(0,x.useState)(null),[_,v]=(0,x.useState)(``),[y,b]=(0,x.useState)({}),[S,C]=(0,x.useState)({}),[w,T]=(0,x.useState)(0);Eo(!p&&w===0);let E=(0,x.useRef)(!1),ee=(0,x.useRef)(null),D=(0,x.useRef)(!1),O=(0,x.useRef)(null),k=(0,x.useRef)(i);(0,x.useEffect)(()=>{k.current=i},[i]);let A=async()=>{let n=new AbortController,r=setTimeout(()=>n.abort(),12e3);try{let i=e.includes(`?`)?`&`:`?`,a=t?`${i}repo=${encodeURIComponent(t)}`:``,o=await window.fetch(`/api/forge/${e}${a}`,{headers:Vn,signal:n.signal});if(clearTimeout(r),!o.ok)throw Error(`Pipeline API ${o.status}`);let s=await o.json();if(E.current)return;u(s.pipeline??null),f(s.jobs??[]),g(null),m(!1);let c=s.pipeline?.status??null;if(c!==O.current&&(O.current=c,k.current?.(c)),s.pipeline&&Fo.has(s.pipeline.status)&&(E.current=!0,ee.current&&clearInterval(ee.current),s.pipeline.status===`failed`&&!D.current)){D.current=!0;let e=(s.jobs??[]).filter(e=>e.status===`failed`);T(e.length),e.forEach(e=>{window.fetch(`/api/forge/jobs/${e.id}/trace`,{headers:Vn}).then(e=>e.json()).then(t=>b(n=>({...n,[e.id]:t.trace??`(empty)`}))).catch(()=>b(t=>({...t,[e.id]:`(failed to load trace)`}))).finally(()=>T(e=>Math.max(0,e-1)))})}}catch(e){if(clearTimeout(r),E.current)return;g(e.name===`AbortError`?`Request timed out`:e.message),m(!1)}};(0,x.useEffect)(()=>(E.current=!1,D.current=!1,O.current=null,u(null),f([]),m(!0),g(null),b({}),T(0),A(),ee.current=setInterval(A,1e4),()=>{E.current=!0,ee.current&&clearInterval(ee.current)}),[e,n]);let te=async e=>{if(y[e]!==void 0){b(t=>{let n={...t};return delete n[e],n});return}C(t=>({...t,[e]:!0}));try{let t=await(await window.fetch(`/api/forge/jobs/${e}/trace`,{headers:Vn})).json();b(n=>({...n,[e]:t.trace??`(empty)`}))}catch{b(t=>({...t,[e]:`(failed to load trace)`}))}finally{C(t=>({...t,[e]:!1}))}},ne=d.filter(e=>e.status===`failed`);if(p)return(0,L.jsxs)(`div`,{className:`flex items-center gap-2 py-4 text-sm text-fg-subtle`,children:[(0,L.jsx)(`span`,{className:`w-3 h-3 rounded-full border-2 border-fg-subtle border-t-transparent animate-spin inline-block shrink-0`}),`Waiting for pipeline...`]});if(h)return(0,L.jsxs)(`div`,{className:`flex items-center justify-between py-3 px-4 bg-surface-raised border border-line-strong rounded-lg`,children:[(0,L.jsxs)(`p`,{className:`text-sm text-fg-muted`,children:[`Could not load pipeline — `,h]}),(0,L.jsx)(`button`,{onClick:()=>{m(!0),g(null),A()},className:`text-xs text-fg-muted hover:text-fg transition-colors ml-4 shrink-0`,children:`Retry`})]});if(!l)return(0,L.jsxs)(`div`,{className:`flex items-center gap-2 py-4 text-sm text-fg-subtle`,children:[(0,L.jsx)(`span`,{className:`w-3 h-3 rounded-full border-2 border-line-strong border-t-transparent animate-spin inline-block shrink-0`}),`Waiting for pipeline to start...`]});let re=Ro(d),ie=l.status===`failed`;return(0,L.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(`span`,{className:`font-mono text-sm ${Io(l.status)}`,children:l.status===`running`?(0,L.jsx)(`span`,{className:`w-3 h-3 rounded-full border-2 border-yellow-400 border-t-transparent animate-spin inline-block`}):Lo(l.status)}),(0,L.jsx)(`span`,{className:`text-sm font-medium capitalize ${Io(l.status)}`,children:l.status}),(0,L.jsxs)(`span`,{className:`text-xs text-fg-subtle`,children:[`#`,l.id]})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,L.jsx)(`button`,{onClick:()=>{m(!0),A()},className:`text-xs text-fg-subtle hover:text-fg-muted transition-colors`,children:`↻`}),(0,L.jsx)(`a`,{href:l.web_url,target:`_blank`,rel:`noreferrer`,className:`text-xs text-fg-muted hover:text-fg transition-colors`,children:`View in GitLab →`})]})]}),ie&&r&&ne.length>0&&(0,L.jsxs)(`div`,{className:`bg-red-950/40 border border-red-800 rounded-lg px-4 py-3 flex flex-col gap-3`,children:[(0,L.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`p`,{className:`text-sm font-medium text-red-300`,children:`Pipeline failed`}),(0,L.jsxs)(`p`,{className:`text-xs text-red-400/70 mt-0.5`,children:[ne.length,` job`,ne.length===1?``:`s`,` `,`failed: `,ne.map(e=>e.name).join(`, `)]})]}),a!=null&&a>0&&(0,L.jsxs)(`span`,{className:`text-xs font-mono shrink-0 ${o&&a>=o?`text-amber-400`:`text-fg-subtle`}`,children:[`attempt `,a,`/`,o??3]})]}),s?(0,L.jsxs)(`div`,{className:`bg-amber-950/40 border border-amber-800/50 rounded-lg px-3 py-2 flex flex-col gap-2`,children:[(0,L.jsx)(`p`,{className:`text-xs text-amber-300 font-medium`,children:`CI fix loop detected`}),(0,L.jsx)(`p`,{className:`text-xs text-amber-400/80 whitespace-pre-wrap`,children:s}),(0,L.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,L.jsx)(`button`,{onClick:c,className:`text-xs text-amber-400 hover:text-amber-300 underline transition-colors`,children:`Dismiss and retry`})})]}):(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(`input`,{type:`text`,value:_,onChange:e=>v(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),r(ne.map(e=>e.id),_,t))},placeholder:`Add context or instructions for the AI fix (optional)`,className:`flex-1 bg-surface-raised border border-red-800/50 rounded-lg px-3 py-1.5 text-xs text-fg placeholder-fg-subtle focus:outline-none focus:border-red-600`}),(0,L.jsx)(`button`,{onClick:()=>r(ne.map(e=>e.id),_,t),className:`shrink-0 bg-violet-600 hover:bg-violet-500 text-on-accent text-xs font-medium px-4 py-2 rounded-lg transition-colors`,children:`Fix with AI`})]})]}),Array.from(re.entries()).map(([e,t])=>(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`p`,{className:`text-xs font-medium text-fg-subtle mb-2`,children:e}),(0,L.jsx)(`div`,{className:`flex flex-col gap-1`,children:t.map(e=>(0,L.jsxs)(`div`,{className:`flex flex-col`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-3 bg-surface-raised rounded px-3 py-2`,children:[(0,L.jsx)(`span`,{className:`font-mono text-sm w-4 ${Io(e.status)}`,children:e.status===`running`?(0,L.jsx)(`span`,{className:`w-3 h-3 rounded-full border-2 border-yellow-400 border-t-transparent animate-spin inline-block`}):Lo(e.status)}),(0,L.jsx)(`a`,{href:e.web_url,target:`_blank`,rel:`noreferrer`,className:`text-sm text-fg hover:text-fg transition-colors flex-1`,children:e.name}),e.duration!=null&&(0,L.jsxs)(`span`,{className:`text-xs text-fg-subtle`,children:[Math.round(e.duration),`s`]}),Fo.has(e.status)&&(0,L.jsx)(`button`,{onClick:()=>te(e.id),className:`text-xs text-fg-subtle hover:text-fg transition-colors shrink-0`,children:S[e.id]?(0,L.jsx)(`span`,{className:`w-3 h-3 rounded-full border border-fg-subtle border-t-transparent animate-spin inline-block`}):y[e.id]===void 0?`View logs`:`Hide logs`})]}),y[e.id]!==void 0&&(0,L.jsx)(`div`,{className:`border border-line border-t-0 rounded-b overflow-hidden`,children:(0,L.jsx)(ma,{variant:`embedded`,autoScroll:!1,heightClass:`max-h-64`,entries:ha(y[e.id].split(`
19
+ `).slice(-200).join(`
20
+ `)),empty:`(empty trace)`})})]},e.id))})]},e))]})}var Bo=3e4;function Vo(e,t){let n=new URLSearchParams;`branchName`in e&&n.set(`branch`,e.branchName),t&&n.set(`repo`,t);let r=n.toString()?`?${n}`:``;return`branchName`in e?`/branch-environment${r}`:`/mr/${e.mrIid}/environment${r}`}function Ho({repo:e,fallbackUrl:t=null,...n}){let r=Vo(n,e),[i,a]=(0,x.useState)(null);(0,x.useEffect)(()=>{let e=!1,t=0,n;a(null);let i=()=>{t+=1,R(r).then(({environment:e})=>e?.external_url??null).catch(()=>null).then(r=>{e||(r?a(r):t<60&&(n=setTimeout(i,Bo)))})};return i(),()=>{e=!0,clearTimeout(n)}},[r]);let o=i??t,s=`shrink-0 ml-4 inline-flex items-center gap-1 text-sm text-emerald-400 hover:text-emerald-300 hover:underline`;return o?(0,L.jsxs)(`a`,{"data-testid":`review-env-slot`,href:o,target:`_blank`,rel:`noreferrer`,className:s,title:o,children:[`Review env `,(0,L.jsx)(`span`,{"aria-hidden":!0,children:`↗`})]}):(0,L.jsxs)(`span`,{"data-testid":`review-env-slot`,"aria-hidden":`true`,className:`${s} invisible`,children:[`Review env `,(0,L.jsx)(`span`,{children:`↗`})]})}function Uo(e,t){if(!e)return null;let n=t.replace(/^forge\//,``).replace(/[/_]+/g,`-`).toLowerCase();return e.replace(/\{branch\}/g,()=>t).replace(/\{slug\}/g,()=>n)}function Wo({showTryAgain:e=!1}){let{resolutionCheck:t,resolutionChecking:n,resolutionError:r}=V(),{handleCheckResolution:i,handleBeginAnalysis:a}=H();return t?(0,L.jsxs)(`div`,{className:`border rounded-lg px-4 py-3 flex flex-col gap-2 ${t.resolved?`bg-green-950/40 border-green-800`:`bg-amber-950/40 border-amber-800`}`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(`span`,{className:`text-sm font-medium ${t.resolved?`text-green-300`:`text-amber-300`}`,children:t.resolved?`✓ Issue appears resolved`:`✗ Issue may not be resolved`}),(0,L.jsxs)(`button`,{onClick:i,disabled:n,className:`text-xs text-fg-subtle hover:text-fg transition-colors ml-auto disabled:opacity-50 flex items-center gap-1.5`,children:[n&&(0,L.jsx)(`span`,{className:`w-2.5 h-2.5 rounded-full border border-fg-subtle border-t-transparent animate-spin inline-block shrink-0`}),n?`Checking…`:`Re-check`]})]}),(0,L.jsx)(`p`,{className:`text-xs leading-relaxed ${t.resolved?`text-green-400/80`:`text-amber-400/80`}`,children:t.reasoning}),r&&(0,L.jsx)(`p`,{className:`text-xs text-red-400`,children:r}),e&&!t.resolved&&(0,L.jsx)(`button`,{onClick:a,className:`self-start mt-1 bg-violet-600 hover:bg-violet-500 text-on-accent text-xs font-medium px-4 py-1.5 rounded-lg transition-colors`,children:`Try Again`})]}):(0,L.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,L.jsx)(`button`,{onClick:i,disabled:n,className:`flex items-center gap-2 text-sm text-fg-muted hover:text-fg border border-line-strong hover:border-fg-subtle rounded-lg px-4 py-2 transition-colors disabled:opacity-50`,children:n?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`span`,{className:`w-3 h-3 rounded-full border-2 border-fg-muted border-t-transparent animate-spin inline-block shrink-0`}),`Checking…`]}):`Check if resolved`}),r&&(0,L.jsx)(`span`,{className:`text-xs text-red-400`,children:r})]})}function Go(){let{applyResult:e,selectedIssue:t,progressSteps:n,refining:r,applying:i,applyError:a,mergedMrs:o,availableRepos:s,selectedRepo:c,pipelineRefreshKey:l,ciFixAttempts:u,ciFixLoopWarning:d,ciFixMaxAttempts:f,testDeployUrlTemplate:p}=V(),{handleRefinePipelineFailure:m,handlePromoteBranch:h,dismissCiFixLoopWarning:g}=H(),{mrMerged:_,setMrMerged:v}=hi(),[y,b]=(0,x.useState)({});if(!e)return null;let S=new Set(e.applications.map(e=>e.repo));return(0,L.jsxs)(`div`,{className:`flex flex-col gap-8`,children:[S.size>1&&(0,L.jsxs)(`div`,{className:`bg-violet-950/30 border border-violet-900/50 rounded-lg px-4 py-3 flex items-center gap-3`,children:[(0,L.jsx)(`span`,{className:`text-violet-300 text-sm`,children:`⚡`}),(0,L.jsxs)(`div`,{className:`flex-1`,children:[(0,L.jsxs)(`p`,{className:`text-sm font-medium text-violet-200`,children:[`Full-stack change across `,S.size,` repositories`]}),(0,L.jsx)(`p`,{className:`text-xs text-violet-400/80 mt-0.5`,children:`Each repo has its own branch + CI pipeline. All need to go green before merging.`})]})]}),e.applications.map((t,n)=>{let o=`${t.repo}:${t.branchName}`,c=!t.mr&&y[o]===`success`,_=s.find(e=>e.id===t.repo)?.label??t.repo.split(`/`).pop()??t.repo;return(0,L.jsxs)(To,{placeholder:(0,L.jsx)(`div`,{"aria-hidden":`true`,className:`h-40 animate-pulse rounded-lg border border-line-strong bg-surface-raised`}),className:`flex flex-col gap-4`,children:[e.applications.length>1&&(0,L.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-line pb-2`,children:[(0,L.jsxs)(`span`,{className:`text-xs font-mono font-semibold text-violet-300`,children:[`[`,_,`]`]}),(0,L.jsx)(`span`,{className:`text-xs text-fg-subtle font-mono truncate`,children:t.repo}),(0,L.jsx)(`span`,{className:`ml-auto text-[11px] text-fg-subtle`,children:n===0?`primary`:`companion`})]}),(0,L.jsxs)(`div`,{className:`bg-surface-raised border border-line-strong rounded-lg px-4 py-4 flex items-center justify-between`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:t.mr?t.mr.title:`Test deploy — branch only, no MR`}),(0,L.jsxs)(`p`,{className:`text-xs text-fg-muted mt-0.5`,children:[`Branch: `,(0,L.jsx)(`span`,{className:`font-mono`,children:t.branchName})]})]}),(0,L.jsxs)(`div`,{className:`flex items-center shrink-0`,children:[t.mr?(0,L.jsx)(Ho,{mrIid:t.mr.iid,repo:t.repo}):(0,L.jsx)(Ho,{branchName:t.branchName,repo:t.repo,fallbackUrl:c?Uo(p,t.branchName):null}),t.mr?(0,L.jsx)(`a`,{href:t.mr.web_url,target:`_blank`,rel:`noreferrer`,className:`text-sm text-violet-400 hover:underline shrink-0 ml-4`,children:`View MR →`}):c&&(0,L.jsx)(`button`,{onClick:()=>h(t),disabled:i,className:`shrink-0 ml-4 bg-violet-600 hover:bg-violet-500 disabled:opacity-40 disabled:cursor-not-allowed text-on-accent text-sm font-medium px-4 py-2 rounded-lg transition-colors`,title:`Pipeline is green — promote this branch to a merge request`,children:i?`Creating MR…`:`Approve & Create MR`})]})]}),!t.mr&&a&&(0,L.jsx)(`div`,{className:`bg-red-950/40 border border-red-800 rounded-lg px-4 py-2 text-xs text-red-300`,children:a}),t.mr&&(0,L.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,L.jsx)(`h2`,{className:`text-[15px] font-semibold text-fg`,children:`Merge request`}),(0,L.jsx)(Mo,{mrIid:t.mr.iid,repo:t.repo,onMerged:()=>{n===0&&v(!0)}})]}),!r&&(0,L.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,L.jsx)(`h2`,{className:`text-[15px] font-semibold text-fg`,children:t.mr?`Pipeline`:`Test deploy pipeline`}),(0,L.jsx)(zo,{endpoint:t.mr?`mr/${t.mr.iid}/pipeline`:`branch-pipeline?branch=${encodeURIComponent(t.branchName)}`,repo:t.repo,refreshKey:l,onRefinePipelineFailure:m,onStatusChange:t.mr?void 0:e=>b(t=>({...t,[o]:e??``})),ciFixAttempts:u,ciFixMaxAttempts:f,ciFixLoopWarning:d,onDismissCiFixWarning:g})]})]},`${t.repo}:${t.branchName}`)}),r&&t&&(0,L.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,L.jsx)(`h2`,{className:`text-[15px] font-semibold text-fg`,children:`Fixing the pipeline`}),(0,L.jsx)(va,{steps:n,logs:[],issueTitle:t.title,mode:`ci-fix`})]}),t&&_&&!r&&(0,L.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(`h2`,{className:`text-[15px] font-semibold text-fg`,children:`After merge`}),(0,L.jsx)(`span`,{className:`text-xs text-fg-subtle`,children:`main branch`})]}),(0,L.jsx)(zo,{endpoint:`issues/${t.iid}/post-merge-pipeline`,repo:c||void 0,onRefinePipelineFailure:m,ciFixAttempts:u,ciFixMaxAttempts:f,ciFixLoopWarning:d,onDismissCiFixWarning:g})]}),t&&_&&!r&&(0,L.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,L.jsx)(`h2`,{className:`text-[15px] font-semibold text-fg`,children:`Resolution`}),(0,L.jsx)(Wo,{showTryAgain:!0})]}),(0,L.jsx)(So,{mrs:o})]})}function Ko({tabs:e,active:t,onSelect:n,className:r=``}){return(0,L.jsx)(`div`,{role:`tablist`,className:`flex items-center gap-0.5 md:gap-1 self-stretch md:self-start rounded-[9px] md:rounded-lg bg-surface-hover p-0.5 md:p-1 ring-1 ring-inset ring-line ${r}`,children:e.map(e=>{let r=t===e.id;return(0,L.jsx)(`button`,{role:`tab`,"aria-selected":r,onClick:()=>n(e.id),className:`flex-1 basis-0 md:flex-none md:basis-auto justify-center px-4 py-1.5 text-[13px] md:text-xs font-medium rounded-[7px] md:rounded-md transition-colors flex items-center gap-1.5 ${r?`bg-surface-raised text-fg shadow-sm ring-1 ring-line`:`text-fg-subtle hover:text-fg`}`,children:(0,L.jsxs)(`span`,{className:`relative inline-flex items-center`,children:[e.label,(e.loading||e.badge!==void 0)&&(0,L.jsx)(`span`,{className:`absolute left-full ml-1.5 inline-flex items-center h-4 md:static`,children:e.loading?(0,L.jsx)(`span`,{className:`w-2.5 h-2.5 rounded-full border border-current border-t-transparent animate-spin`}):e.badge})]})},e.id)})})}function qo(){let{applyResult:e,selectedIssue:t}=V(),{activeDetailTab:n,setActiveDetailTab:r}=hi(),{navigate:i}=Ei();if(!e)return null;let a=e=>{if(!t)return;let n=e===`mr`?`mr`:`issue`;r(n),i(n===`mr`?`/issues/${t.iid}/mr`:`/issues/${t.iid}`,{replace:!0})},o=e.applications,s=[{id:`issue`,label:`Issue`},{id:`mr`,label:`Pipeline`,badge:o.length>0&&(0,L.jsx)(`span`,{className:`text-xs px-1.5 py-0.5 rounded-full ${n===`mr`?`bg-surface-raised text-fg`:`bg-violet-600/40 text-violet-300`}`,children:o.length>1?`${o.length} MRs`:o[0].mr?`!${o[0].mr.iid}`:`branch`})||void 0}];return(0,L.jsxs)(`div`,{className:`max-w-4xl mx-auto w-full flex flex-col gap-6`,children:[t&&(0,L.jsx)(Ko,{tabs:s,active:n,onSelect:a}),n===`issue`&&t&&(0,L.jsx)(Co,{}),(n===`mr`||!t)&&(0,L.jsx)(Go,{})]})}var Jo=`w-full md:w-auto min-h-[50px] md:min-h-0 rounded-xl md:rounded-lg text-[17px] md:text-sm font-semibold md:font-medium`,Yo=`flex flex-col md:flex-row md:flex-wrap gap-2 md:gap-3`;function Xo(e,t){let n=e.split(`
21
+ `),r=t.split(`
22
+ `),i=n.length,a=r.length,o=Array.from({length:i+1},()=>Array(a+1).fill(0));for(let e=1;e<=i;e++)for(let t=1;t<=a;t++)o[e][t]=n[e-1]===r[t-1]?o[e-1][t-1]+1:Math.max(o[e-1][t],o[e][t-1]);let s=[],c=i,l=a;for(;c>0||l>0;)c>0&&l>0&&n[c-1]===r[l-1]?(s.unshift({type:`context`,text:n[c-1]}),c--,l--):l>0&&(c===0||o[c][l-1]>=o[c-1][l])?(s.unshift({type:`add`,text:r[l-1]}),l--):(s.unshift({type:`remove`,text:n[c-1]}),c--);return Zo(s)}function Zo(e){let t=new Set;e.forEach((e,n)=>{e.type!==`context`&&t.add(n)});let n=new Set;t.forEach(t=>{for(let r=Math.max(0,t-3);r<=Math.min(e.length-1,t+3);r++)n.add(r)});let r=[],i=!0;return e.forEach((e,t)=>{n.has(t)?(i||r.push({type:`context`,text:`...`}),r.push(e),i=!0):i=!1}),r}function Qo({change:e}){let[t,n]=(0,x.useState)(!0),r=e.action===`modify`&&e.original?Xo(e.original,e.proposed):e.action===`create`?e.proposed.split(`
23
+ `).map(e=>({type:`add`,text:e})):e.original?e.original.split(`
24
+ `).map(e=>({type:`remove`,text:e})):[],i=e.action===`create`?`text-green-400`:e.action===`delete`?`text-red-400`:`text-yellow-400`,a=r.filter(e=>e.type===`add`).length,o=r.filter(e=>e.type===`remove`).length;return(0,L.jsxs)(`div`,{className:`border border-line-strong rounded-lg overflow-hidden`,children:[(0,L.jsxs)(`button`,{onClick:()=>n(e=>!e),className:`w-full flex items-center gap-3 px-4 py-2.5 bg-surface-raised hover:bg-surface-hover text-left`,children:[(0,L.jsx)(`span`,{className:`text-xs font-medium ${i}`,children:e.action}),(0,L.jsx)(`span`,{className:`text-sm text-fg font-mono flex-1 truncate`,children:e.file}),(0,L.jsxs)(`span`,{className:`text-xs text-green-400`,children:[`+`,a]}),(0,L.jsxs)(`span`,{className:`text-xs text-red-400 ml-1`,children:[`-`,o]}),(0,L.jsx)(`span`,{className:`text-fg-subtle text-xs ml-2`,children:t?`▲`:`▼`})]}),(0,L.jsx)(`div`,{className:`px-4 py-1.5 bg-surface-raised border-t border-line-strong text-xs text-fg-muted`,children:e.summary}),t&&(0,L.jsx)(`div`,{className:`overflow-x-auto`,children:(0,L.jsx)(`table`,{className:`w-full text-xs font-mono border-collapse`,children:(0,L.jsx)(`tbody`,{children:r.map((e,t)=>(0,L.jsxs)(`tr`,{className:e.type===`add`?`bg-green-950/40`:e.type===`remove`?`bg-red-950/40`:``,children:[(0,L.jsx)(`td`,{className:`w-6 px-2 py-px text-fg-subtle select-none border-r border-line text-right`,children:e.type===`add`?`+`:e.type===`remove`?`-`:` `}),(0,L.jsx)(`td`,{className:`px-3 py-px whitespace-pre ${e.type===`add`?`text-green-300`:e.type===`remove`?`text-red-300`:e.text===`...`?`text-fg-subtle`:`text-fg`}`,children:e.text})]},t))})})})]})}function $o(e,t){return t?.find(t=>t.id===e)?.label??e.split(`/`).pop()??e}function es(e,t,n){let r=new Map;for(let t of e){let e=t.repo||`(unknown)`,n=r.get(e)??[];n.push(t),r.set(e,n)}return Array.from(r.entries()).map(([e,r])=>{let i=0,a=0;for(let e of r)if(e.action===`create`&&e.proposed)i+=e.proposed.split(`
25
+ `).length;else if(e.action===`delete`&&e.original)a+=e.original.split(`
26
+ `).length;else if(e.action===`modify`&&e.original){let t=Xo(e.original,e.proposed);for(let e of t)e.type===`add`?i++:e.type===`remove`&&a++}let o=n?.find(t=>t.repo===e);return{repo:e,label:$o(e,t),changes:r,adds:i,removes:a,existingBranch:o?.branchName}})}function ts({explanation:e,changes:t,removals:n=[],existingApplications:r,availableRepos:i,onApprove:a,onDeployBranch:o,onCommitToBranch:s,checks:c,onRefine:l,onUndoRefine:u,refineThread:d=[],refineQueue:f=[],thinkingLogs:p=[],applying:m,refining:h,validationStatus:g=`idle`}){let[_,v]=(0,x.useState)(``),[y,b]=(0,x.useState)(!1),[S,C]=(0,x.useState)(new Set),w=(0,x.useMemo)(()=>es(t,i,r),[t,i,r]),T=m||h,E=w.length>1,ee=w.every(e=>e.existingBranch),D=w.some(e=>e.existingBranch),O=g!==`passed`&&!y,k=T||O;return(0,L.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,L.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,L.jsx)(`h1`,{className:`text-xl font-semibold tracking-tight text-fg`,children:`Proposed changes`}),(0,L.jsx)(`p`,{className:`text-[15px] leading-relaxed text-fg-muted whitespace-pre-wrap`,children:e})]}),n.length>0&&(0,L.jsxs)(`div`,{className:`bg-amber-950/40 border border-amber-700/60 rounded-lg px-4 py-3`,children:[(0,L.jsxs)(`p`,{className:`text-sm font-medium text-amber-400 mb-2`,children:[`⚠ `,n.length,` existing code removal`,n.length===1?``:`s`,` declared`]}),(0,L.jsx)(`ul`,{className:`flex flex-col gap-1.5`,children:n.map((e,t)=>(0,L.jsxs)(`li`,{className:`text-sm text-amber-200/80`,children:[(0,L.jsx)(`span`,{className:`font-mono text-amber-300/90`,children:e.file}),` — `,(0,L.jsx)(`span`,{children:e.what}),(0,L.jsxs)(`span`,{className:`text-amber-200/50`,children:[` (`,e.why,`)`]})]},t))})]}),E&&(0,L.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-fg-subtle font-mono`,children:[(0,L.jsx)(`span`,{className:`text-violet-400`,children:`⚡ full-stack`}),(0,L.jsx)(`span`,{children:`•`}),(0,L.jsxs)(`span`,{children:[w.length,` repos`]}),(0,L.jsx)(`span`,{children:`•`}),(0,L.jsxs)(`span`,{children:[t.length,` file`,t.length===1?``:`s`]})]}),(0,L.jsx)(`div`,{className:`flex flex-col gap-6`,children:w.map(e=>(0,L.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[E&&(0,L.jsxs)(`div`,{className:`flex items-center gap-3 px-1`,children:[(0,L.jsxs)(`span`,{className:`text-xs font-mono font-semibold text-violet-300`,children:[`[`,e.label,`]`]}),(0,L.jsx)(`span`,{className:`text-xs text-fg-subtle font-mono truncate`,children:e.repo}),(0,L.jsxs)(`span`,{className:`ml-auto text-xs text-fg-subtle flex items-center gap-2`,children:[(0,L.jsxs)(`span`,{children:[e.changes.length,` file`,e.changes.length===1?``:`s`]}),(0,L.jsxs)(`span`,{className:`text-green-400`,children:[`+`,e.adds]}),(0,L.jsxs)(`span`,{className:`text-red-400`,children:[`-`,e.removes]}),e.existingBranch&&(0,L.jsx)(`span`,{className:`ml-2 text-[11px] bg-violet-900/40 text-violet-300 px-1.5 py-0.5 rounded font-mono`,children:`branch open`})]})]}),(0,L.jsx)(`div`,{className:`flex flex-col gap-3`,children:e.changes.map(t=>(0,L.jsx)(Qo,{change:t},`${e.repo}:${t.file}`))})]},e.repo))}),c,(0,L.jsxs)(`section`,{className:`flex flex-col gap-3 rounded-2xl bg-surface-raised px-4 py-4 ring-1 ring-inset ring-line`,children:[(0,L.jsx)(`label`,{htmlFor:`diff-refine`,className:`text-[15px] font-semibold text-fg`,children:`Ask or refine`}),d.length>0&&(0,L.jsx)(`div`,{className:`flex flex-col gap-3`,children:d.map((e,t)=>{let n=e.kind===`answer`,r=e.kind===`canceled`,i=e.kind===`failed`,a=e.kind===`refine`,o=i?`border-red-800/60 bg-red-950/30`:r?`border-amber-800/60 bg-amber-950/30`:n?`border-sky-800/60 bg-sky-950/30`:`border-line-strong bg-surface-raised`,s=S.has(t),c=e.feedback.length>240,d=()=>{C(e=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n})},f=a&&!!e.prevResult&&!!u&&!T,m=(r||i)&&!T;return(0,L.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,L.jsxs)(`div`,{className:`text-xs text-fg-subtle`,children:[(0,L.jsxs)(`div`,{className:`flex items-start gap-1.5`,children:[(0,L.jsx)(`span`,{className:`text-violet-400/80 font-medium shrink-0`,children:`You:`}),(0,L.jsx)(`span`,{className:`italic flex-1 whitespace-pre-wrap break-words [overflow-wrap:anywhere] ${c&&!s?`max-h-12 overflow-hidden line-clamp-2`:`max-h-40 overflow-y-auto`}`,children:c&&!s?e.feedback.slice(0,240)+`…`:e.feedback})]}),c&&(0,L.jsx)(`button`,{onClick:d,className:`ml-10 mt-0.5 text-[11px] text-fg-subtle hover:text-fg transition-colors`,children:s?`Show less`:`Show more`})]}),e.explanation===void 0?(0,L.jsxs)(`div`,{className:`flex flex-col gap-1.5 px-1`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-fg-subtle`,children:[(0,L.jsx)(`span`,{className:`w-3 h-3 rounded-full border-2 border-fg-subtle border-t-transparent animate-spin inline-block`}),`Thinking…`]}),p.length>0&&(0,L.jsx)(`div`,{className:`ml-5 flex flex-col gap-0.5 font-mono text-[11px] text-fg-subtle/80 leading-tight`,children:p.slice(-3).map((e,t)=>(0,L.jsx)(`div`,{className:`truncate`,title:e,children:e},`${p.length-3+t}-${e}`))})]}):(0,L.jsxs)(`div`,{className:`text-sm text-fg border rounded px-3 py-2 leading-relaxed whitespace-pre-wrap ${o}`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-2 mb-1.5`,children:[(0,L.jsx)(`span`,{className:`text-[11px] font-mono ${i?`text-red-300`:r?`text-amber-300`:n?`text-sky-300`:`text-emerald-300`}`,children:i?`Failed`:r?`Canceled`:n?`Answer — no code changed`:`Refined — code updated`}),f&&(0,L.jsx)(`button`,{onClick:()=>u?.(t),className:`text-[11px] text-fg-muted hover:text-fg border border-line-strong hover:border-fg-subtle rounded px-2 py-0.5 transition-colors`,title:`Revert the code back to the state before this refinement`,children:`Undo`}),m&&(0,L.jsx)(`button`,{onClick:()=>l(e.feedback),className:`text-[11px] text-amber-300 hover:text-amber-200 border border-amber-800/60 hover:border-amber-600 rounded px-2 py-0.5 transition-colors`,title:`Re-run refinement with the same feedback`,children:`Retry`})]}),e.explanation]})]},t)})}),f.length>0&&(0,L.jsx)(`div`,{className:`flex flex-col gap-2`,children:f.map((e,t)=>(0,L.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,L.jsxs)(`div`,{className:`text-xs text-fg-subtle flex items-start gap-1.5`,children:[(0,L.jsx)(`span`,{className:`text-violet-400/80 font-medium shrink-0`,children:`You:`}),(0,L.jsx)(`span`,{className:`italic flex-1 whitespace-pre-wrap break-words [overflow-wrap:anywhere]`,children:e})]}),(0,L.jsx)(`div`,{className:`text-[11px] font-mono text-fg-subtle border border-line bg-surface-raised/60 rounded px-2 py-1 w-fit`,children:`Queued — runs after the current turn`})]},`queued-${t}`))}),(0,L.jsx)(`textarea`,{id:`diff-refine`,value:_,onChange:e=>v(e.target.value),disabled:m,placeholder:h?`Stack another prompt — it'll run after the current turn.`:`Ask a question (e.g. “are the lint issues fixed?”) or give direction (e.g. “use the existing log utility”)`,rows:2,className:`w-full rounded-xl border border-line bg-surface px-3 py-2.5 text-[15px] text-fg placeholder-fg-subtle resize-none focus:border-accent-hover focus:outline-none disabled:opacity-40`}),(0,L.jsxs)(`div`,{className:`flex items-center justify-end gap-3`,children:[h&&(0,L.jsx)(`span`,{className:`text-[11px] text-fg-subtle`,children:f.length>0?`${f.length} queued`:`New prompts will queue`}),(0,L.jsx)(`button`,{onClick:()=>{_.trim()&&(l(_.trim()),v(``))},disabled:m||!_.trim(),className:`rounded-full bg-surface px-4 py-1.5 text-sm font-medium text-accent-fg ring-1 ring-inset ring-line transition-colors hover:bg-surface-hover disabled:cursor-not-allowed disabled:opacity-40`,children:h?`Queue →`:`Refine →`})]})]}),(0,L.jsxs)(`div`,{className:`sticky bottom-0 z-10 -mx-4 mt-1 flex flex-col gap-2.5 border-t border-line/70 bg-canvas/85 px-4 pb-[max(0.75rem,env(safe-area-inset-bottom))] pt-3 backdrop-blur-xl sm:mx-0 sm:rounded-2xl sm:border sm:px-4`,children:[g===`idle`&&(0,L.jsxs)(`p`,{className:`text-xs text-amber-300`,children:[`Run the checks before pushing.`,` `,(0,L.jsx)(`button`,{onClick:()=>b(e=>!e),className:`underline decoration-dotted hover:text-amber-200 transition-colors`,children:y?`Cancel override`:`Skip checks`}),y&&` — override active, CI may still fail.`]}),g===`running`&&(0,L.jsx)(`p`,{className:`text-xs text-violet-300`,children:`Validation in progress — hold on before pushing.`}),g===`failed`&&(0,L.jsxs)(`p`,{className:`text-xs text-red-300`,children:[`Validation failed.`,` `,(0,L.jsx)(`button`,{onClick:()=>b(e=>!e),className:`underline decoration-dotted hover:text-red-200 transition-colors`,children:y?`Cancel override`:`Push anyway`}),y&&` — override active, CI may still fail.`]}),(0,L.jsxs)(`div`,{className:Yo,children:[ee&&s?(0,L.jsx)(`button`,{onClick:s,disabled:k,className:`${Jo} md:flex-1 bg-violet-600 hover:bg-violet-500 disabled:opacity-40 disabled:cursor-not-allowed text-on-accent py-2.5 transition-colors`,children:m?`Pushing...`:g===`running`?`Waiting for checks…`:O?g===`failed`?`Checks failed`:`Validate first`:E?`Push to ${w.length} existing branches`:`Push to ${w[0]?.existingBranch??`branch`}`}):(0,L.jsx)(`button`,{onClick:a,disabled:k,className:`${Jo} md:flex-1 bg-violet-600 hover:bg-violet-500 disabled:opacity-40 disabled:cursor-not-allowed text-on-accent py-2.5 transition-colors`,children:m?`Pushing...`:g===`running`?`Waiting for checks…`:O?g===`failed`?`Checks failed`:`Validate first`:E?`Approve & Create ${w.length} MRs`:`Approve & Create MR`}),!D&&(0,L.jsx)(`button`,{onClick:o,disabled:k,title:`Push branch only — deploys to test namespace without opening an MR`,className:`w-full md:w-auto min-h-[50px] md:min-h-0 rounded-xl md:rounded-lg text-[17px] md:text-sm font-semibold md:font-medium px-4 bg-surface-raised ring-1 ring-inset ring-line-strong hover:bg-surface-hover disabled:opacity-40 disabled:cursor-not-allowed text-fg py-2.5 transition-colors border border-line-strong`,children:`Deploy to Test`})]})]})]})}function ns({checked:e,onChange:t,className:n=``}){return(0,L.jsxs)(`span`,{className:`relative inline-flex shrink-0 ${n}`,children:[(0,L.jsx)(`input`,{type:`checkbox`,role:`switch`,checked:e,onChange:e=>t(e.target.checked),className:`peer sr-only`}),(0,L.jsx)(`span`,{"aria-hidden":`true`,className:`w-[51px] h-[31px] md:w-9 md:h-5 rounded-full bg-line-strong transition-colors duration-200 peer-checked:bg-accent peer-focus-visible:ring-2 peer-focus-visible:ring-accent-hover peer-focus-visible:ring-offset-2 peer-focus-visible:ring-offset-canvas`}),(0,L.jsx)(`span`,{"aria-hidden":`true`,className:`absolute top-[2px] left-[2px] w-[27px] h-[27px] md:w-4 md:h-4 rounded-full bg-on-accent shadow-md transition-transform duration-200 peer-checked:translate-x-5 md:peer-checked:translate-x-4`})]})}var rs=[`clone`,`install`,`overlay`,`format`,`lint`,`typecheck`,`test`],is=[`lint`,`typecheck`,`test`],as={clone:`Clone`,install:`Install`,overlay:`Apply`,format:`Format`,lint:`Lint`,typecheck:`Types`,tdd_precheck:`Test first`,test:`Tests`,fmt:`Format`,vet:`Vet`,build:`Build`};function os(e){switch(e){case`running`:return(0,L.jsx)(`span`,{className:`w-3.5 h-3.5 rounded-full border-2 border-violet-400 border-t-transparent animate-spin inline-block`});case`passed`:return(0,L.jsx)(`span`,{className:`text-emerald-400 text-sm`,children:`✓`});case`failed`:return(0,L.jsx)(`span`,{className:`text-red-400 text-sm`,children:`✗`});case`skipped`:return(0,L.jsx)(`span`,{className:`text-fg-subtle text-sm`,children:`—`});case`interrupted`:return(0,L.jsx)(`span`,{className:`text-amber-300 text-sm`,children:`!`});default:return(0,L.jsx)(`span`,{className:`text-fg-subtle text-sm`,children:`○`})}}function ss(e,t){let n=e?Date.parse(e):NaN;if(Number.isNaN(n))return`running…`;let r=Math.max(0,Math.floor((t-n)/1e3));return r<60?`running · ${r}s`:`running · ${Math.floor(r/60)}m ${r%60}s`}function cs(e,t){switch(e.status){case`running`:return ss(e.startedAt,t);case`interrupted`:return`interrupted`;case`passed`:return e.durationMs==null?`passed`:`passed in ${(e.durationMs/1e3).toFixed(1)}s`;case`failed`:return e.exitCode==null?`failed`:`failed (exit ${e.exitCode})`;case`idle`:return`pending`;case`skipped`:return`skipped`;default:return``}}function ls({step:e,state:t,stale:n,onFix:r,fixing:i,fixable:a}){let[o,s]=(0,x.useState)(!1),[c,l]=(0,x.useState)(()=>Date.now()),u=t.status===`running`;(0,x.useEffect)(()=>{if(!u)return;let e=setInterval(()=>l(Date.now()),1e3);return()=>clearInterval(e)},[u]);let d=t.logs.length>0||!!t.tail,f=r&&a&&t.status===`failed`;return(0,L.jsxs)(`div`,{className:n?`opacity-70`:void 0,children:[(0,L.jsxs)(`div`,{className:`flex items-stretch`,children:[(0,L.jsxs)(`button`,{disabled:!d,onClick:()=>s(e=>!e),className:`flex-1 flex min-h-11 items-center gap-3 px-3.5 py-2 text-left ${d?`hover:bg-surface-hover/60 cursor-pointer`:`cursor-default`}`,children:[(0,L.jsx)(`span`,{className:`w-4 flex items-center justify-center shrink-0`,children:os(t.status)}),(0,L.jsx)(`span`,{className:`text-sm text-fg w-24 shrink-0`,children:as[e]??e}),(0,L.jsx)(`span`,{className:`text-xs ${t.status===`failed`?`text-red-300`:t.status===`passed`?`text-fg-muted`:t.status===`running`?`text-violet-300`:t.status===`interrupted`?`text-amber-300`:`text-fg-subtle`} flex-1 truncate`,children:cs(t,c)}),d&&(0,L.jsx)(`span`,{className:`text-fg-subtle shrink-0 transition-transform ${o?`rotate-90`:``}`,children:`›`})]}),f&&(0,L.jsx)(`button`,{onClick:e=>{e.stopPropagation(),r()},disabled:i,title:`Send this ${e} failure to Claude to refine the proposed changes.`,className:`shrink-0 px-3.5 text-sm font-medium text-accent-fg hover:bg-accent-soft disabled:opacity-50 disabled:cursor-not-allowed transition-colors`,children:i?`Fixing…`:`Fix with AI`})]}),o&&d&&(0,L.jsx)(ma,{entries:t.logs.length>0?t.logs:fs(t.tail),variant:`embedded`,heightClass:`max-h-56`,autoScroll:t.status===`running`})]})}function us({repo:e,stale:t,onFixStep:n,fixingStep:r,showName:i}){let a=e.stepOrder??rs,o=new Set,s=[];for(let t of a)e.steps[t]&&(s.push(t),o.add(t));for(let t of Object.keys(e.steps))o.has(t)||s.push(t);if(s.length===0&&!e.skipped)return null;if(e.skipped)return(0,L.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,L.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3`,children:[(0,L.jsx)(`span`,{className:`font-mono text-xs text-amber-300 truncate`,children:e.repo}),(0,L.jsx)(`span`,{className:`text-[11px] text-fg-subtle font-mono shrink-0`,children:`skipped`})]}),(0,L.jsx)(`div`,{className:`text-xs text-amber-300/80 bg-amber-950/20 border border-amber-900/40 rounded-md px-3 py-2`,children:e.skipReason===`misattributed`?`No proposed file exists in this repo — the change was likely misrouted here. Refine and tell the model the correct repo, or leave it for the other block to validate.`:`Skipped (${e.skipReason??`unknown`})`})]});let c=new Set(e.fixableSteps??is),l=e.result?.allPassed?`text-emerald-300`:s.some(t=>e.steps[t]?.status===`failed`)?`text-red-300`:s.some(t=>e.steps[t]?.status===`running`)?`text-violet-300`:`text-fg-muted`;return(0,L.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[i&&(0,L.jsx)(`span`,{className:`px-1 text-xs ${l} truncate`,children:e.repo.replace(/^[a-z]+:/,``)}),(0,L.jsx)(`div`,{className:`divide-y divide-line overflow-hidden rounded-xl bg-surface ring-1 ring-inset ring-line`,children:s.map(i=>{let a=e.steps[i];return(0,L.jsx)(ls,{step:i,state:a,stale:t,onFix:n?()=>n(i,a.tail):void 0,fixing:r===i,fixable:c.has(i)},i)})})]})}function ds({state:e,validating:t,error:n,onValidate:r,onFixStep:i,fixingStep:a=null,autoPushOnPass:o=!1,onToggleAutoPush:s,children:c}){let{result:l,byRepo:u={},repoOrder:d=[],aggregateLogs:f=[],stale:p}=e,m=d.map(e=>u[e]).filter(Boolean),h=m.some(e=>Object.values(e.steps).some(e=>e&&e.status!==`idle`))||f.length>0,g=!t&&m.some(e=>Object.values(e.steps).some(e=>e?.status===`interrupted`)),_=h?t?`text-violet-300`:g||p?`text-amber-300`:l?.allPassed?`text-emerald-300`:`text-red-300`:`text-fg-subtle`,v=h?t?`Running pre-flight checks…`:g?`Checks were interrupted. Run them again.`:p?`Results outdated — proposal changed since last run`:l?.allPassed?`All checks passed`:`Some checks failed`:`Lint, types and tests run before anything is pushed.`,y=!t&&!p&&!!l?.allPassed,b=m.reduce((e,t)=>e+Object.keys(t.steps).length,0),x=(0,L.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[f.length>0&&(0,L.jsx)(`div`,{className:`max-h-40 overflow-y-auto rounded-lg bg-surface px-3 py-2 font-mono text-[11px] leading-relaxed text-fg-subtle [overflow-wrap:anywhere]`,children:f.slice(-30).map((e,t)=>(0,L.jsx)(`div`,{children:e.message},t))}),m.map(e=>(0,L.jsx)(us,{repo:e,stale:p,onFixStep:i,fixingStep:a,showName:m.length>1},e.repo))]});return(0,L.jsxs)(`section`,{className:`flex flex-col gap-3 rounded-2xl bg-surface-raised p-4 ring-1 ring-inset ring-line [overflow-anchor:none]`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-3 flex-wrap`,children:[(0,L.jsxs)(`div`,{className:`flex flex-col gap-0.5 min-w-0`,children:[(0,L.jsx)(`h2`,{className:`text-[15px] font-semibold text-fg`,children:`Checks`}),(0,L.jsx)(`span`,{className:`text-sm ${_}`,children:v})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-3 shrink-0`,children:[s&&(0,L.jsxs)(`label`,{className:`flex items-center gap-2 text-[13px] md:text-[11px] text-fg-muted cursor-pointer select-none`,title:`When checked, any validation that passes automatically commits — pushes to the existing branch if one exists, or opens a new MR otherwise. Pairs with Fix with AI to close the loop.`,children:[(0,L.jsx)(ns,{checked:o,onChange:s}),`Auto-push on green`]}),(0,L.jsx)(`button`,{onClick:r,disabled:t,className:`min-h-11 md:min-h-0 rounded-full bg-surface px-4 py-1.5 text-[15px] md:text-sm font-medium text-accent-fg ring-1 ring-inset ring-line transition-colors hover:bg-surface-hover disabled:cursor-not-allowed disabled:opacity-50`,children:t?`Validating…`:p||h?`Re-validate`:`Validate`})]})]}),n&&(0,L.jsx)(`div`,{className:`text-xs text-red-400 bg-red-950/40 border border-red-900 rounded px-3 py-2 whitespace-pre-wrap break-words [overflow-wrap:anywhere] max-h-32 overflow-y-auto font-mono`,children:n}),h&&(y?(0,L.jsxs)(`details`,{className:`group`,children:[(0,L.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center gap-1 text-xs text-fg-subtle select-none hover:text-fg`,children:[(0,L.jsx)(`span`,{className:`inline-block transition-transform group-open:rotate-90`,children:`›`}),`Show `,b,` checks`]}),(0,L.jsx)(`div`,{className:`mt-3`,children:x})]}):x),c]})}function fs(e){return(e??``).split(`
27
+ `).map(e=>({ts:``,message:e}))}function ps(){let{analysisLogs:e,analysisResult:t,analysisError:n,applyResult:r,applyError:i,applying:a,refining:o,validation:s,validating:c,validationError:l,autoPushOnValidatePass:u,availableRepos:d,refineThread:f,refineQueue:p,thinkingLogs:m}=V(),{handleApprove:h,handleDeployBranch:g,handleCommitToBranch:_,handleRefine:v,handleUndoRefine:y,handleValidate:b,handleFixValidation:S,setAutoPushOnValidatePass:C}=H(),[w,T]=(0,x.useState)(null);(0,x.useEffect)(()=>{o||T(null)},[o]);let E=(e,t)=>{T(e),S(e,t)},ee=c?`running`:s.stale||!s.result?`idle`:s.result.allPassed?`passed`:`failed`;return(0,L.jsxs)(`div`,{className:`max-w-3xl mx-auto w-full flex flex-col gap-6`,children:[n&&(0,L.jsx)(`div`,{className:`bg-red-950/40 border border-red-800 rounded-lg px-4 py-3 text-sm text-red-300 whitespace-pre-wrap break-words [overflow-wrap:anywhere] max-h-48 overflow-y-auto font-mono leading-snug`,children:n}),i&&(0,L.jsx)(`div`,{className:`bg-red-950/40 border border-red-800 rounded-lg px-4 py-3 text-sm text-red-300 whitespace-pre-wrap break-words [overflow-wrap:anywhere] max-h-48 overflow-y-auto font-mono leading-snug`,children:i}),e.length>0&&(0,L.jsxs)(`details`,{className:`group order-last`,children:[(0,L.jsxs)(`summary`,{className:`cursor-pointer text-xs text-fg-subtle hover:text-fg transition-colors select-none list-none flex items-center gap-1`,children:[(0,L.jsx)(`span`,{className:`group-open:rotate-90 transition-transform inline-block`,children:`›`}),`Analysis log (`,e.length,` lines)`]}),(0,L.jsx)(`div`,{className:`mt-2`,children:(0,L.jsx)(ma,{entries:e,label:`forge analysis`,badge:`${e.length} entr${e.length===1?`y`:`ies`}`,heightClass:`max-h-56`})})]}),t?(0,L.jsx)(ts,{explanation:t.explanation,changes:t.changes,removals:t.removals,existingApplications:r?.applications??[],availableRepos:d,onApprove:h,onDeployBranch:g,onCommitToBranch:_,checks:(0,L.jsx)(ds,{state:s,validating:c,error:l,onValidate:b,onFixStep:E,fixingStep:w,autoPushOnPass:u,onToggleAutoPush:C}),onRefine:v,onUndoRefine:y,refineThread:f,refineQueue:p,thinkingLogs:m,applying:a,refining:o,validationStatus:ee}):(0,L.jsx)(`div`,{className:`text-center py-12 text-fg-subtle text-sm`,children:`No changes were proposed.`})]})}function ms({className:e}){return(0,L.jsx)(`div`,{className:Gn(`animate-pulse rounded bg-surface-hover`,e)})}function hs(){return(0,L.jsxs)(`div`,{className:`mx-auto flex w-full max-w-3xl flex-col gap-10`,role:`status`,"aria-label":`Loading settings`,children:[(0,L.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,L.jsx)(ms,{className:`h-6 w-28`}),(0,L.jsx)(ms,{className:`h-3 w-2/3`})]}),[0,1,2].map(e=>(0,L.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,L.jsx)(ms,{className:`h-4 w-32`}),(0,L.jsx)(ms,{className:`h-3 w-1/2`}),(0,L.jsx)(ms,{className:`h-28 w-full rounded-xl`})]},e))]})}function gs(){return(0,L.jsxs)(`div`,{className:`mx-auto flex w-full max-w-6xl flex-col gap-4`,role:`status`,"aria-label":`Loading issue`,children:[(0,L.jsx)(ms,{className:`h-7 w-2/3`}),(0,L.jsx)(ms,{className:`h-3 w-1/3`}),(0,L.jsx)(ms,{className:`h-8 w-40 rounded-lg`}),(0,L.jsx)(ms,{className:`h-24 w-full rounded-xl`}),(0,L.jsx)(ms,{className:`h-24 w-full rounded-xl`})]})}var _s=`h-9 w-full rounded-lg border border-line bg-surface px-2.5 text-sm text-fg focus:border-accent-hover focus:outline-none sm:w-auto`;function vs(){let{availableRepos:e,selectedRepo:t,selectedSecondaryRepos:n,availableAgents:r,selectedAgent:i,availableModels:a,selectedModel:o}=V(),{setSelectedSecondaryRepos:s,setSelectedAgent:c,setSelectedModel:l}=H(),u=e.filter(e=>e.id!==t),d=i!==`openclaw`&&a.length>0,f=u.filter(e=>n.includes(e.id)),p=[d?a.find(e=>e.id===o)?.label:r.find(e=>e.id===i)?.label,f.length?`+ ${f.map(e=>e.label).join(`, `)}`:null].filter(Boolean).join(` · `);if(!d&&r.length<2&&u.length===0)return null;let m=e=>s(n.includes(e)?n.filter(t=>t!==e):[...n,e]);return(0,L.jsxs)(`details`,{className:`group text-sm`,children:[(0,L.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center gap-1.5 text-fg-muted select-none hover:text-fg`,children:[(0,L.jsx)(`span`,{className:`inline-block transition-transform group-open:rotate-90`,children:`›`}),`Options`,p&&(0,L.jsxs)(`span`,{className:`truncate text-fg-subtle`,children:[`· `,p]})]}),(0,L.jsxs)(`div`,{className:`mt-3 flex flex-col gap-3 rounded-xl bg-surface-raised p-4 sm:flex-row sm:flex-wrap sm:items-end sm:gap-5`,children:[r.length>1&&(0,L.jsxs)(`label`,{className:`flex flex-col gap-1.5 text-xs text-fg-subtle`,children:[`Agent`,(0,L.jsx)(`select`,{"aria-label":`Agent`,value:i,onChange:e=>c(e.target.value),className:_s,children:r.map(e=>(0,L.jsxs)(`option`,{value:e.id,disabled:!e.configured,children:[e.label,e.configured?``:` (not configured)`]},e.id))})]}),d&&(0,L.jsxs)(`label`,{className:`flex flex-col gap-1.5 text-xs text-fg-subtle`,children:[`Model`,(0,L.jsx)(`select`,{"aria-label":`Model`,value:o,onChange:e=>l(e.target.value),className:_s,children:a.map(e=>(0,L.jsx)(`option`,{value:e.id,children:e.label},e.id))})]}),u.length>0&&(0,L.jsxs)(`fieldset`,{className:`flex flex-col gap-1.5 text-xs text-fg-subtle`,children:[(0,L.jsx)(`legend`,{className:`mb-1.5`,children:`Also change`}),(0,L.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:u.map(e=>{let t=n.includes(e.id);return(0,L.jsx)(`button`,{type:`button`,"aria-pressed":t,onClick:()=>m(e.id),className:`h-9 rounded-full px-3.5 text-sm transition-colors ${t?`bg-accent-soft text-accent-fg`:`bg-surface text-fg-muted ring-1 ring-inset ring-line hover:text-fg`}`,children:e.label},e.id)})})]})]})]})}function ys(){let{applyResult:e}=V(),{handleRefinePipelineFailure:t}=H(),n=e?.applications.filter(e=>!e.mr)??[];return n.length===0?null:(0,L.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(`h3`,{className:`text-[15px] font-semibold text-fg`,children:`Activity`}),(0,L.jsx)(`span`,{className:`text-[10px] text-fg-subtle`,children:`Deploy-to-Test · no MR yet`})]}),n.map(e=>(0,L.jsxs)(`div`,{className:`flex flex-col gap-3 bg-surface-raised/50 border border-line-strong rounded-lg p-4`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,L.jsxs)(`div`,{className:`flex flex-col gap-0.5 min-w-0`,children:[(0,L.jsx)(`span`,{className:`text-xs font-medium text-fg-subtle`,children:`Branch`}),(0,L.jsxs)(`span`,{className:`text-sm font-mono text-violet-300 truncate`,title:e.branchName,children:[`⎇ `,e.branchName]})]}),e.pipelineUrl&&(0,L.jsx)(`a`,{href:e.pipelineUrl,target:`_blank`,rel:`noreferrer`,className:`text-xs text-violet-400 hover:underline shrink-0`,children:`Open in GitLab ↗`})]}),(0,L.jsx)(zo,{endpoint:`branch-pipeline?branch=${encodeURIComponent(e.branchName)}`,repo:e.repo,onRefinePipelineFailure:t})]},`${e.repo}:${e.branchName}`))]})}function bs(){let{storedAnalyses:e}=V(),{handleRestoreAnalysis:t,handleDiscardStoredAnalysis:n,handleClearIssueCache:r,formatAnalysisDate:i}=H();return e.length===0?null:(0,L.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,L.jsxs)(`span`,{className:`text-xs text-fg-muted font-medium`,children:[`Previous analyses (`,e.length,`)`]}),(0,L.jsx)(`button`,{onClick:()=>{window.confirm(`Delete all ${e.length} analyses for this issue? They're removed for everyone and can't be restored.`)&&r()},className:`text-xs text-fg-subtle hover:text-red-300 transition-colors`,title:`Delete every analysis for this issue`,children:`Clear all`})]}),(0,L.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:e.map(e=>(0,L.jsxs)(`div`,{className:`bg-surface-raised/60 border border-line-strong rounded-lg px-4 py-2.5 flex items-start justify-between gap-4`,children:[(0,L.jsxs)(`div`,{className:`flex flex-col gap-1 min-w-0 flex-1`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-fg-subtle min-w-0`,children:[(0,L.jsx)(`span`,{children:i(e.analyzedAt)}),(0,L.jsx)(`span`,{children:`·`}),(0,L.jsxs)(`span`,{children:[e.result.changes.length,` file`,e.result.changes.length===1?``:`s`]}),e.model&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`span`,{children:`·`}),(0,L.jsx)(`span`,{className:`truncate`,children:e.model.split(`-`).slice(1,3).join(` `)})]}),(0,L.jsx)(`span`,{children:`·`}),e.mrIid?(0,L.jsxs)(`span`,{className:`text-violet-400`,children:[`MR !`,e.mrIid]}):(0,L.jsx)(`span`,{className:`text-fg-subtle`,children:`no MR`})]}),e.prompt&&(0,L.jsxs)(`div`,{className:`text-xs text-fg-muted italic truncate`,title:e.prompt,children:[`“`,e.prompt,`”`]})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,L.jsx)(`button`,{onClick:()=>t(e.id),className:`bg-violet-600 hover:bg-violet-500 text-on-accent text-xs font-medium px-3 py-1 rounded transition-colors`,children:`Restore`}),(0,L.jsx)(`button`,{onClick:()=>n(e.id),className:`text-xs text-fg-subtle hover:text-fg-muted transition-colors`,title:`Discard`,children:`✕`})]})]},e.id))})]})}var xs={updateMr:`Analyze & Update MR`,newAnalysis:`New Analysis`,tryAgain:`Try Again`,begin:`Begin Analysis`};function Ss({editing:e,editDescription:t,setEditDescription:n,editLabels:r,setEditLabels:i,availableLabels:a,saving:o,onSave:s,onCancelEdit:c,editTitle:l}){let{selectedIssue:u,analysisPrompt:d,existingMr:f,existingMrLoading:p,storedAnalyses:m,mergedMrs:h,resolutionCheck:g,issueEnvironmentsLoading:_}=V(),{setAnalysisPrompt:v,handleBeginAnalysis:y,handleFreshReanalyze:b}=H();if(!u)return null;let x=h.length>0&&!f&&!p,S=p?null:f?xs.updateMr:m.length>0?xs.newAnalysis:h.length>0&&g&&!g.resolved?xs.tryAgain:xs.begin,C=!p&&!_;return(0,L.jsxs)(L.Fragment,{children:[e?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`textarea`,{"aria-label":`Description`,value:t,onChange:e=>n(e.target.value),rows:8,className:`bg-surface-raised border border-line-strong focus:border-violet-500 rounded-lg px-4 py-3 text-sm text-fg outline-none w-full resize-y leading-relaxed`}),(0,L.jsx)(Wa,{labels:r,available:a,onChange:i})]}):u.description&&(0,L.jsx)(`div`,{className:`bg-surface-raised border border-line-strong rounded-lg px-4 py-4 text-sm text-fg whitespace-pre-wrap leading-relaxed w-full max-h-[50vh] overflow-y-auto`,children:u.description}),!e&&(0,L.jsx)(bs,{}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[!e&&(0,L.jsx)(`textarea`,{value:d,onChange:e=>v(e.target.value),placeholder:`Optional instructions for the analysis…`,rows:2,className:`w-full bg-surface-raised/60 border border-line-strong rounded-lg px-3 py-2 text-sm text-fg placeholder-fg-subtle focus:outline-none focus:border-violet-500 resize-none`}),!e&&(0,L.jsx)(vs,{}),e?(0,L.jsxs)(`div`,{className:`flex flex-col md:flex-row md:items-center gap-1 md:gap-3`,children:[(0,L.jsx)(`button`,{onClick:s,disabled:o||!l.trim(),className:`${Jo} bg-violet-600 hover:bg-violet-500 disabled:opacity-50 text-on-accent px-5 py-2 transition-colors ${p?`animate-pulse`:``}`,children:o?`Saving…`:`Save`}),(0,L.jsx)(`button`,{onClick:c,className:`min-h-11 md:min-h-0 text-[17px] md:text-sm text-fg-subtle hover:text-fg transition-colors`,children:`Cancel`})]}):(0,L.jsx)(`div`,{className:`flex flex-col md:flex-row md:flex-wrap md:items-center justify-between gap-3 md:gap-x-6 md:gap-y-3 border-t border-line/60 pt-3`,children:(0,L.jsxs)(`div`,{className:`flex flex-col md:flex-row md:items-center gap-1 md:gap-3`,children:[(0,L.jsx)(`button`,{onClick:y,disabled:p,className:`grid ${Jo} bg-violet-600 hover:bg-violet-500 disabled:opacity-50 text-on-accent px-5 py-2 transition-colors ${p?`animate-pulse`:``}`,children:Object.values(xs).map(e=>(0,L.jsx)(`span`,{"aria-hidden":e!==S||void 0,className:`[grid-area:1/1] ${e===S?``:`invisible`}`,children:e},e))}),m.length>0&&(0,L.jsx)(`button`,{onClick:b,className:`min-h-11 md:min-h-0 text-[17px] md:text-sm text-amber-400/90 md:text-fg-muted hover:text-amber-400 transition-colors`,children:`Discard & Reanalyze`})]})})]}),!e&&(0,L.jsxs)(To,{className:`flex flex-col gap-6`,children:[(0,L.jsx)(Do,{ready:C}),x&&(0,L.jsx)(`div`,{className:`flex flex-col gap-3`,children:(0,L.jsx)(Wo,{})}),(0,L.jsx)(uo,{}),(0,L.jsx)(ys,{}),(0,L.jsx)(So,{mrs:h})]},u.iid)]})}function Cs(){return(0,L.jsxs)(`div`,{"aria-hidden":`true`,className:`flex flex-col gap-3 animate-pulse`,children:[(0,L.jsx)(`div`,{className:`h-20 bg-surface-raised border border-line-strong rounded-lg`}),(0,L.jsx)(`div`,{className:`h-32 bg-surface-raised border border-line-strong rounded-lg`})]})}function ws(){let{existingMr:e,existingMrLoading:t,applyResult:n,selectedRepo:r,applying:i,applyError:a,testDeployUrlTemplate:o}=V(),{handleRefinePipelineFailure:s,handlePromoteBranch:c}=H(),{setMrMerged:l}=hi(),[u,d]=(0,x.useState)({}),[f,p]=(0,x.useState)(null);if(t)return(0,L.jsx)(Cs,{});if(e)return(0,L.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between bg-surface-raised border border-line-strong rounded-lg px-4 py-3`,children:[(0,L.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,L.jsx)(`span`,{className:`text-xs font-medium text-fg-subtle`,children:`Merge request`}),(0,L.jsxs)(`a`,{href:e.web_url,target:`_blank`,rel:`noreferrer`,className:`text-sm text-violet-400 hover:underline`,children:[`!`,e.iid,` `,e.title]}),(0,L.jsx)(`span`,{className:`text-xs font-mono text-fg-subtle`,children:e.branchName})]}),(0,L.jsx)(Ho,{mrIid:e.iid,repo:r||void 0})]}),(0,L.jsxs)(To,{placeholder:(0,L.jsx)(Cs,{}),className:`flex flex-col gap-6`,children:[(0,L.jsx)(Mo,{mrIid:e.iid,repo:r||void 0,pipelineStatus:f,onMerged:()=>l(!0)}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,L.jsx)(`h2`,{className:`text-[15px] font-semibold text-fg`,children:`Pipeline`}),(0,L.jsx)(zo,{endpoint:`mr/${e.iid}/pipeline`,repo:r||void 0,onRefinePipelineFailure:s,onStatusChange:p})]})]},e.iid)]});let m=n?.applications.filter(e=>!e.mr)??[];return m.length>0?(0,L.jsx)(To,{placeholder:(0,L.jsx)(Cs,{}),className:`flex flex-col gap-6`,children:m.map(e=>{let t=`${e.repo}:${e.branchName}`,n=u[t]===`success`,r=n?Uo(o,e.branchName):null;return(0,L.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,L.jsxs)(`div`,{className:`bg-surface-raised border border-line-strong rounded-lg px-4 py-4 flex items-center justify-between`,children:[(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:`Test deploy — branch only, no MR`}),(0,L.jsxs)(`p`,{className:`text-xs text-fg-muted mt-0.5 truncate`,children:[`Branch: `,(0,L.jsx)(`span`,{className:`font-mono`,children:e.branchName})]})]}),(0,L.jsx)(Ho,{branchName:e.branchName,repo:e.repo,fallbackUrl:r}),n&&(0,L.jsx)(`button`,{onClick:()=>c(e),disabled:i,className:`shrink-0 ml-4 bg-violet-600 hover:bg-violet-500 disabled:opacity-40 disabled:cursor-not-allowed text-on-accent text-sm font-medium px-4 py-2 rounded-lg transition-colors`,title:`Pipeline is green — promote this branch to a merge request`,children:i?`Creating MR…`:`Approve & Create MR`})]}),a&&(0,L.jsx)(`div`,{className:`bg-red-950/40 border border-red-800 rounded-lg px-4 py-2 text-xs text-red-300`,children:a}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,L.jsx)(`h2`,{className:`text-[15px] font-semibold text-fg`,children:`Test deploy pipeline`}),(0,L.jsx)(zo,{endpoint:`branch-pipeline?branch=${encodeURIComponent(e.branchName)}`,repo:e.repo,onRefinePipelineFailure:s,onStatusChange:e=>d(n=>({...n,[t]:e??``}))})]})]},t)})}):(0,L.jsx)(`div`,{className:`text-center py-12 text-fg-subtle text-sm`,children:`No open MR found for this issue.`})}function Ts({editing:e,editTitle:t,setEditTitle:n,onStartEdit:r}){let{selectedIssue:i}=V();if(!i)return null;let a=Ia(i.labels),o=/^(type|priority|area)::/,s=i.labels.find(e=>e.startsWith(`status::`))?.slice(8),c=i.labels.filter(e=>!o.test(e)&&!e.startsWith(`status::`));return(0,L.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,L.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[e?(0,L.jsx)(`input`,{"aria-label":`Title`,value:t,onChange:e=>n(e.target.value),className:`w-full rounded-lg border border-line-strong bg-surface-raised px-3 py-1.5 text-xl font-semibold text-fg outline-none focus:border-violet-500`}):(0,L.jsx)(`h1`,{className:`text-xl font-semibold tracking-tight text-fg sm:text-2xl`,children:i.title}),!e&&(0,L.jsx)(vo,{onEdit:r})]}),(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1.5 text-sm text-fg-subtle`,children:[(0,L.jsxs)(`span`,{children:[`#`,i.iid]}),a.type&&(0,L.jsx)(Gi,{tone:Qa[a.type]??`neutral`,children:eo(a.type)}),a.priority&&(0,L.jsx)(Gi,{tone:$a[a.priority]??`neutral`,dot:!0,children:eo(a.priority)}),s&&(0,L.jsx)(Gi,{tone:`neutral`,children:eo(s.replace(/-/g,` `))}),[...a.areas,...c].map(e=>(0,L.jsx)(`span`,{className:`rounded-full bg-surface-raised px-2 py-0.5 text-xs text-fg-muted`,children:e},e))]}),(0,L.jsxs)(`p`,{className:`text-[13px] text-fg-subtle`,children:[`Opened by `,i.author.name,` ·`,` `,(0,L.jsx)(`a`,{href:i.web_url,target:`_blank`,rel:`noreferrer`,className:`hover:text-fg`,children:`View on GitLab ↗`})]})]})}function Es(){let{selectedIssue:e,existingMr:t,existingMrLoading:n,applyResult:r,selectedRepo:i}=V(),{handleUpdateIssue:a}=H(),{activeDetailTab:o,setActiveDetailTab:s}=hi(),[c,l]=(0,x.useState)(!1),[u,d]=(0,x.useState)(``),[f,p]=(0,x.useState)(``),[m,h]=(0,x.useState)([]),g=Ma(i),[_,v]=(0,x.useState)(!1),{navigate:y}=Ei();if(!e)return(0,L.jsx)(gs,{});let b=()=>{d(e.title??``),p(e.description??``),h(e.labels),l(!0)},S=()=>l(!1),C=async()=>{v(!0);try{await a(u,f,m),l(!1)}finally{v(!1)}},w=t=>{let n=t===`mr`?`mr`:`issue`;s(n),y(n===`mr`?`/issues/${e.iid}/mr`:`/issues/${e.iid}`,{replace:!0})},T=(r?.applications??[]).filter(e=>!e.mr).length,E=t?`MR`:T>0?`Branch`:`MR`,ee=t?(0,L.jsxs)(`span`,{className:`text-xs px-1.5 py-0.5 rounded-full ${o===`mr`?`bg-surface-raised text-fg`:`bg-violet-600/40 text-violet-300`}`,children:[`!`,t.iid]}):T>0?(0,L.jsx)(`span`,{className:`text-xs px-1.5 py-0.5 rounded-full ${o===`mr`?`bg-surface-raised text-fg`:`bg-amber-600/40 text-amber-300`}`,title:`${T} deploy-to-test branch${T>1?`es`:``} without an MR`,children:T}):(0,L.jsx)(`span`,{className:`text-xs text-fg-subtle`,children:`—`});return(0,L.jsxs)(`div`,{className:`flex flex-col gap-6 w-full`,children:[(0,L.jsx)(Ts,{editing:c,editTitle:u,setEditTitle:d,onStartEdit:b}),(0,L.jsx)(Ko,{tabs:[{id:`issue`,label:`Issue`},{id:`mr`,label:E,loading:n,badge:n?void 0:ee}],active:o,onSelect:w}),o===`issue`&&(0,L.jsx)(Ss,{editing:c,editDescription:f,setEditDescription:p,editLabels:m,setEditLabels:h,availableLabels:g,saving:_,onSave:C,onCancelEdit:S,editTitle:u}),o===`mr`&&(0,L.jsx)(ws,{})]})}function Ds(){let[e,t]=(0,x.useState)(null),[n,r]=(0,x.useState)(!1),[i,a]=(0,x.useState)(null),o=(0,x.useCallback)(async()=>{r(!0),a(null);try{t(await R(`/config`))}catch(e){a(e instanceof Error?e.message:String(e))}finally{r(!1)}},[]),s=(0,x.useCallback)(async e=>{let n=await R(`/config`,{method:`PUT`,body:JSON.stringify(e)});return t(n),n},[]);return(0,x.useEffect)(()=>{o()},[o]),{config:e,loading:n,error:i,reload:o,patch:s}}function Os(){let[e,t]=(0,x.useState)([]),[n,r]=(0,x.useState)(!1),[i,a]=(0,x.useState)(``),[o,s]=(0,x.useState)(null),[c,l]=(0,x.useState)(null);(0,x.useEffect)(()=>{Yi.listTokens().then(e=>t(e.tokens)).catch(e=>l(e.message))},[]);let u=async e=>{e.preventDefault(),l(null);try{let{token:e,record:n}=await Yi.createToken(i);t(e=>[n,...e]),s(e),r(!1),a(``)}catch(e){l(e.message)}},d=async e=>{await Yi.revokeToken(e),t(t=>t.filter(t=>t.id!==e))};return(0,L.jsxs)(`section`,{className:`flex flex-col gap-3`,children:[(0,L.jsxs)(`div`,{className:`flex items-end justify-between gap-4`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:`API tokens`}),(0,L.jsxs)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:[`Personal tokens for the `,(0,L.jsx)(`code`,{className:`font-mono`,children:`forge`}),` CLI and automation. They act with your role.`]})]}),!n&&(0,L.jsx)(z,{size:`sm`,onClick:()=>r(!0),children:`New token`})]}),o&&(0,L.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-xl border border-emerald-800/60 bg-emerald-950/40 p-4`,children:[(0,L.jsx)(`p`,{className:`text-sm font-medium text-emerald-300`,children:`Copy this token now. You won't see it again.`}),(0,L.jsx)(`code`,{className:`break-all rounded-lg bg-canvas px-3 py-2 font-mono text-xs text-fg ring-1 ring-line`,children:o}),(0,L.jsxs)(`p`,{className:`text-xs text-fg-muted`,children:[`Use it as `,(0,L.jsx)(`code`,{className:`font-mono`,children:`FORGE_API_TOKEN`}),` in the CLI's environment.`]}),(0,L.jsxs)(`div`,{className:`flex gap-2`,children:[(0,L.jsx)(z,{size:`sm`,variant:`secondary`,onClick:()=>navigator.clipboard?.writeText(o),children:`Copy`}),(0,L.jsx)(z,{size:`sm`,variant:`ghost`,onClick:()=>s(null),children:`Done`})]})]}),n&&(0,L.jsxs)(`form`,{onSubmit:u,className:`flex items-end gap-2 rounded-xl border border-line bg-surface-raised p-4`,children:[(0,L.jsxs)(`label`,{className:`flex flex-1 flex-col gap-1.5 text-sm font-medium text-fg`,children:[`Token name`,(0,L.jsx)(`input`,{required:!0,placeholder:`e.g. laptop CLI`,value:i,onChange:e=>a(e.target.value),className:`h-9 rounded-lg border border-line bg-canvas px-3 text-sm text-fg placeholder:text-fg-subtle focus:border-accent-hover focus:outline-none`})]}),(0,L.jsx)(z,{variant:`ghost`,size:`md`,onClick:()=>r(!1),children:`Cancel`}),(0,L.jsx)(z,{type:`submit`,variant:`primary`,size:`md`,children:`Create token`})]}),c&&(0,L.jsx)(`p`,{className:`text-xs text-red-400`,children:c}),(0,L.jsx)(`div`,{className:`overflow-hidden rounded-xl border border-line bg-surface-raised`,children:(0,L.jsx)(`table`,{"aria-label":`API tokens`,className:`w-full text-left text-sm`,children:(0,L.jsxs)(`tbody`,{className:`divide-y divide-line`,children:[e.map(e=>(0,L.jsxs)(`tr`,{children:[(0,L.jsxs)(`td`,{className:`py-3 pl-4 pr-3`,children:[(0,L.jsx)(`div`,{className:`font-medium text-fg`,children:e.name}),(0,L.jsxs)(`div`,{className:`font-mono text-xs text-fg-subtle`,children:[e.prefix,`…`]})]}),(0,L.jsxs)(`td`,{className:`px-3 py-3 text-xs text-fg-muted`,children:[`Created `,Zi(e.createdAt)]}),(0,L.jsxs)(`td`,{className:`px-3 py-3 text-xs text-fg-muted`,children:[`Last used `,Zi(e.lastUsedAt)]}),(0,L.jsx)(`td`,{className:`py-3 pl-3 pr-4 text-right`,children:(0,L.jsx)(z,{size:`sm`,variant:`ghost`,onClick:()=>d(e.id),children:`Revoke`})})]},e.id)),e.length===0&&(0,L.jsx)(`tr`,{children:(0,L.jsx)(`td`,{className:`px-4 py-6 text-center text-sm text-fg-subtle`,children:`No tokens yet.`})})]})})})]})}var ks={gitlab:`GitLab`,github:`GitHub`,azuredevops:`Azure DevOps`,anthropic:`Anthropic`},As={gitlab:`GitLab token`,github:`GitHub token`,azuredevops:`Azure DevOps token`,anthropic:`Anthropic API key`},js={gitlab:`Clear stored token (revert to env var if set)`,github:`Clear stored token (revert to env var if set)`,azuredevops:`Clear stored token (revert to env var if set)`,anthropic:`Clear stored key (Claude goes back to the Claude Code subscription)`};function Ms(e,t){return e===`anthropic`&&t===`none`?(0,L.jsx)(`span`,{className:`text-[11px] text-fg-subtle`,children:`subscription`}):t===`config`?(0,L.jsx)(`span`,{className:`text-[11px] text-violet-400`,children:`config`}):t===`env`?(0,L.jsx)(`span`,{className:`text-[11px] text-fg-subtle`,children:`env`}):(0,L.jsx)(`span`,{className:`text-[11px] text-red-400/80`,children:`missing`})}function Ns({provider:e,connection:t,newToken:n,setNewToken:r,clearToken:i,setClearToken:a,baseUrl:o,setBaseUrl:s}){let[c,l]=(0,x.useState)(!1);return(0,L.jsxs)(`div`,{className:`flex flex-col gap-3 bg-surface-raised border border-line rounded-lg px-4 py-3`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,L.jsx)(`span`,{className:`text-sm font-medium text-fg`,children:ks[e]}),Ms(e,t.tokenSource)]}),s&&(0,L.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,L.jsx)(`span`,{className:`text-xs text-fg-subtle`,children:`API base URL`}),(0,L.jsx)(`input`,{value:o??``,onChange:e=>s(e.target.value),placeholder:`https://gitlab.com/api/v4`,className:`bg-surface-raised border border-line-strong rounded px-2 py-1 text-xs font-mono text-fg focus:outline-none focus:border-violet-500`})]}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,L.jsxs)(`span`,{className:`text-xs text-fg-subtle`,children:[e===`anthropic`?`API key`:`Token`,t.hasToken&&(0,L.jsx)(`span`,{className:`ml-2 font-mono text-fg-subtle`,children:t.tokenHint})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(`input`,{type:c?`text`:`password`,"aria-label":As[e],value:n,onChange:e=>r(e.target.value),placeholder:t.hasToken?`Leave blank to keep current`:e===`anthropic`?`Paste API key`:`Paste token`,disabled:i,className:`flex-1 bg-surface-raised border border-line-strong rounded px-2 py-1 text-xs font-mono text-fg focus:outline-none focus:border-violet-500 disabled:opacity-40`}),(0,L.jsx)(`button`,{onClick:()=>l(e=>!e),disabled:!n,className:`text-xs text-fg-subtle hover:text-fg disabled:opacity-30`,children:c?`Hide`:`Show`})]}),t.tokenSource===`config`&&(0,L.jsxs)(`label`,{className:`flex items-center gap-2 text-[13px] md:text-xs text-fg-subtle`,children:[(0,L.jsx)(ns,{checked:i,onChange:a}),js[e]]})]})]})}var Ps={gitlab:``,github:``,azuredevops:``,anthropic:``},Fs={gitlab:!1,github:!1,azuredevops:!1,anthropic:!1};function Is({connections:e,onSave:t}){let[n,r]=(0,x.useState)(e.gitlab.baseUrl),[i,a]=(0,x.useState)(Ps),[o,s]=(0,x.useState)(Fs),[c,l]=(0,x.useState)(!1),[u,d]=(0,x.useState)(null);(0,x.useEffect)(()=>{r(e.gitlab.baseUrl)},[e.gitlab.baseUrl]);let f=n!==e.gitlab.baseUrl,p=Object.values(i).some(Boolean)||Object.values(o).some(Boolean),m=f||p,h=()=>{let e={},t={};return f&&(t.baseUrl=n),o.gitlab?t.token=``:i.gitlab&&(t.token=i.gitlab),Object.keys(t).length>0&&(e.gitlab=t),o.github?e.github={token:``}:i.github&&(e.github={token:i.github}),o.azuredevops?e.azuredevops={token:``}:i.azuredevops&&(e.azuredevops={token:i.azuredevops}),o.anthropic?e.anthropic={token:``}:i.anthropic&&(e.anthropic={token:i.anthropic}),e};return(0,L.jsxs)(`section`,{className:`flex flex-col gap-4`,children:[(0,L.jsxs)(`header`,{className:`flex items-center justify-between`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:`Connections`}),(0,L.jsx)(`p`,{className:`text-xs text-fg-subtle mt-0.5`,children:`SCM hosts and tokens. Config values override env vars; empty config values fall back to env.`})]}),m&&(0,L.jsx)(`button`,{onClick:async()=>{l(!0),d(null);try{await t(h()),a(Ps),s(Fs)}catch(e){d(e instanceof Error?e.message:String(e))}finally{l(!1)}},disabled:c,className:`bg-violet-600 hover:bg-violet-500 disabled:opacity-50 text-on-accent text-sm font-medium px-4 py-1.5 rounded-lg transition-colors`,children:c?`Saving…`:`Save`})]}),u&&(0,L.jsx)(`div`,{className:`bg-red-950/40 border border-red-800 rounded-lg px-3 py-2 text-sm text-red-300`,children:u}),(0,L.jsx)(Ns,{provider:`gitlab`,connection:e.gitlab,baseUrl:n,setBaseUrl:r,newToken:i.gitlab,setNewToken:e=>a(t=>({...t,gitlab:e})),clearToken:o.gitlab,setClearToken:e=>s(t=>({...t,gitlab:e}))}),(0,L.jsx)(Ns,{provider:`github`,connection:e.github,newToken:i.github,setNewToken:e=>a(t=>({...t,github:e})),clearToken:o.github,setClearToken:e=>s(t=>({...t,github:e}))}),(0,L.jsx)(Ns,{provider:`azuredevops`,connection:e.azuredevops,newToken:i.azuredevops,setNewToken:e=>a(t=>({...t,azuredevops:e})),clearToken:o.azuredevops,setClearToken:e=>s(t=>({...t,azuredevops:e}))}),(0,L.jsx)(Ns,{provider:`anthropic`,connection:e.anthropic,newToken:i.anthropic,setNewToken:e=>a(t=>({...t,anthropic:e})),clearToken:o.anthropic,setClearToken:e=>s(t=>({...t,anthropic:e}))})]})}function Ls({defaults:e,onSave:t}){let{availableModels:n,availableAgents:r}=V(),[i,a]=(0,x.useState)(e),[o,s]=(0,x.useState)(!1),[c,l]=(0,x.useState)(null),u=(0,x.useId)();(0,x.useEffect)(()=>{a(e)},[e]);let d=JSON.stringify(i)!==JSON.stringify(e);return(0,L.jsxs)(`section`,{className:`flex flex-col gap-4`,children:[(0,L.jsxs)(`header`,{className:`flex items-center justify-between`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:`Defaults`}),(0,L.jsx)(`p`,{className:`text-xs text-fg-subtle mt-0.5`,children:`Preselect the model and agent on load. Leaves selection free per-request.`})]}),(0,L.jsx)(`button`,{onClick:async()=>{s(!0),l(null);try{await t(i)}catch(e){l(e instanceof Error?e.message:String(e))}finally{s(!1)}},disabled:!d||o,"aria-hidden":!d||void 0,tabIndex:d?void 0:-1,className:`bg-violet-600 hover:bg-violet-500 disabled:opacity-50 text-on-accent text-sm font-medium px-4 py-1.5 rounded-lg transition-colors ${d?``:`invisible`}`,children:o?`Saving…`:`Save`})]}),c&&(0,L.jsx)(`div`,{className:`bg-red-950/40 border border-red-800 rounded-lg px-3 py-2 text-sm text-red-300`,children:c}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,L.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,L.jsx)(`span`,{className:`text-xs text-fg-subtle`,children:`Default model`}),(0,L.jsxs)(`select`,{value:i.model??``,onChange:e=>a({...i,model:e.target.value===``?null:e.target.value}),className:`bg-surface-raised border border-line-strong rounded px-2 py-1 text-xs text-fg focus:outline-none focus:border-violet-500`,children:[(0,L.jsx)(`option`,{value:``,children:`— none —`}),n.map(e=>(0,L.jsx)(`option`,{value:e.id,children:e.label},e.id))]})]}),(0,L.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,L.jsx)(`span`,{className:`text-xs text-fg-subtle`,children:`Default agent`}),(0,L.jsxs)(`select`,{value:i.agent??``,onChange:e=>a({...i,agent:e.target.value===``?null:e.target.value}),className:`bg-surface-raised border border-line-strong rounded px-2 py-1 text-xs text-fg focus:outline-none focus:border-violet-500`,children:[(0,L.jsx)(`option`,{value:``,children:`— none —`}),r.map(e=>(0,L.jsxs)(`option`,{value:e.id,disabled:!e.configured,children:[e.label,e.configured?``:` (not configured)`]},e.id))]})]}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,L.jsx)(`label`,{htmlFor:u,className:`text-xs text-fg-subtle`,children:`Agent mode`}),(0,L.jsxs)(`select`,{id:u,"aria-describedby":`${u}-help`,value:i.agentMode??`structured`,onChange:e=>a({...i,agentMode:e.target.value}),className:`bg-surface-raised border border-line-strong rounded px-2 py-1 text-xs text-fg focus:outline-none focus:border-violet-500`,children:[(0,L.jsx)(`option`,{value:`structured`,children:`Structured — single-pass JSON, no tools`}),(0,L.jsx)(`option`,{value:`agentic`,children:`Agentic — works in a checkout with tools`})]}),(0,L.jsxs)(`span`,{id:`${u}-help`,className:`text-[11px] text-fg-subtle leading-relaxed`,children:[`Agentic runs Claude inside a clone of the repo (GitLab, single repo) with its `,(0,L.jsx)(`code`,{className:`text-fg-muted`,children:`CLAUDE.md`}),`, so it can run tests and Playwright and attach a write-up and screenshots to the MR. Other cases fall back to structured. `,(0,L.jsx)(`code`,{className:`text-fg-muted`,children:`FORGE_AGENT_MODE`}),`, if set, overrides this.`]})]}),(0,L.jsxs)(`label`,{className:`flex items-center gap-3 md:gap-2`,children:[(0,L.jsx)(ns,{checked:i.autoPushOnValidatePass,onChange:e=>a({...i,autoPushOnValidatePass:e})}),(0,L.jsx)(`span`,{className:`text-[15px] md:text-xs text-fg`,children:`Auto-push on successful validation`})]}),(0,L.jsxs)(`label`,{className:`flex items-start gap-3 md:gap-2`,children:[(0,L.jsx)(ns,{checked:i.refineRepoAccess,onChange:e=>a({...i,refineRepoAccess:e}),className:`mt-0.5`}),(0,L.jsxs)(`span`,{className:`flex flex-col`,children:[(0,L.jsx)(`span`,{className:`text-[15px] md:text-xs text-fg`,children:`Refine repo access`}),(0,L.jsxs)(`span`,{className:`text-[11px] text-fg-subtle leading-relaxed`,children:[`When on, Refine spawns Claude with `,(0,L.jsx)(`code`,{className:`text-fg-muted`,children:`Read/Glob/Grep`}),` over a local clone of the primary repo (GitLab only). Off uses a lighter "file tree + attached files" prompt. `,(0,L.jsx)(`code`,{className:`text-fg-muted`,children:`FORGE_REFINE_REPO_ACCESS`}),`, if set, overrides this.`]})]})]}),(0,L.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,L.jsx)(`span`,{className:`text-xs text-fg-subtle`,children:`Prompt rules`}),(0,L.jsx)(`textarea`,{value:i.promptRules??``,onChange:e=>a({...i,promptRules:e.target.value}),placeholder:`e.g. "Never restructure the NavBar — only add entries"`,rows:3,className:`bg-surface-raised border border-line-strong rounded px-2 py-1.5 text-xs text-fg placeholder-fg-subtle focus:outline-none focus:border-violet-500 font-mono resize-y`}),(0,L.jsx)(`span`,{className:`text-[11px] text-fg-subtle leading-relaxed`,children:`Custom instructions injected into every analysis and refine prompt, in both modes. Use this to steer the model towards your preferred patterns, or to ask for evidence (e.g. "run the e2e tests and screenshot every changed page") — that needs agentic mode.`})]}),(0,L.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,L.jsx)(`span`,{className:`text-xs text-fg-subtle`,children:`Test deploy URL`}),(0,L.jsx)(`input`,{type:`url`,value:i.testDeployUrlTemplate??``,onChange:e=>a({...i,testDeployUrlTemplate:e.target.value}),placeholder:`https://test.example.com or https://{slug}.test.example.com`,className:`bg-surface-raised border border-line-strong rounded px-2 py-1 text-xs text-fg placeholder-fg-subtle focus:outline-none focus:border-violet-500 font-mono`}),(0,L.jsxs)(`span`,{className:`text-[11px] text-fg-subtle leading-relaxed`,children:[`Shown next to "Approve & Create MR" once the branch pipeline is green. Supports `,(0,L.jsx)(`code`,{className:`text-fg-muted`,children:`{branch}`}),` (full branch) and`,` `,(0,L.jsx)(`code`,{className:`text-fg-muted`,children:`{slug}`}),` (subdomain-safe) placeholders for ephemeral per-branch envs. Leave blank to hide the link.`]})]})]})]})}var Rs=[`gitlab`,`github`,`azuredevops`],zs=[{value:`auto`,label:`auto-detect`},{value:`node`,label:`Node (npm)`},{value:`go`,label:`Go`}];function Bs(e){let t=e.replace(/^(gitlab|github|azuredevops):/,``);return t.split(`/`).pop()??t}function Vs({repos:e,onSave:t}){let[n,r]=(0,x.useState)(e),[i,a]=(0,x.useState)(`gitlab`),[o,s]=(0,x.useState)(``),[c,l]=(0,x.useState)(!1),[u,d]=(0,x.useState)(null),[f,p]=(0,x.useState)(null),[m,h]=(0,x.useState)(null);(0,x.useEffect)(()=>{r(e)},[e]);let g=JSON.stringify(n)!==JSON.stringify(e),_=()=>{let e=o.trim();if(!e)return;let t=e.includes(`:`)?e:`${i}:${e}`;if(n.some(e=>e.id===t)){d(`Already in list: ${t}`);return}d(null),r([...n,{id:t,label:Bs(t),projectType:`auto`}]),s(``)},v=e=>{r(n.filter(t=>t.id!==e))},y=(e,t)=>{r(n.map(n=>n.id===e?{...n,label:t}:n))},b=(e,t)=>{r(n.map(n=>n.id===e?{...n,projectType:t}:n))},S=(e,t)=>{e!==t&&r(n=>{let r=[...n],[i]=r.splice(e,1);return r.splice(t,0,i),r})};return(0,L.jsxs)(`section`,{className:`flex flex-col gap-4`,children:[(0,L.jsxs)(`header`,{className:`flex items-center justify-between`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:`Repositories`}),(0,L.jsxs)(`p`,{className:`text-xs text-fg-subtle mt-0.5`,children:[`Override the `,(0,L.jsx)(`code`,{className:`text-fg-muted`,children:`FORGE_REPOS`}),` env var. Empty list falls back to env.`]})]}),g&&(0,L.jsx)(`button`,{onClick:async()=>{l(!0),d(null);try{await t(n)}catch(e){d(e instanceof Error?e.message:String(e))}finally{l(!1)}},disabled:c,className:`bg-violet-600 hover:bg-violet-500 disabled:opacity-50 text-on-accent text-sm font-medium px-4 py-1.5 rounded-lg transition-colors`,children:c?`Saving…`:`Save`})]}),u&&(0,L.jsx)(`div`,{className:`bg-red-950/40 border border-red-800 rounded-lg px-3 py-2 text-sm text-red-300`,children:u}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[n.length===0&&(0,L.jsx)(`p`,{className:`text-xs text-fg-subtle italic`,children:`No repos configured — using env vars.`}),n.map((e,t)=>{let n=f===t,r=m===t&&f!==null&&f!==t;return(0,L.jsxs)(`div`,{onDragOver:e=>{f!==null&&(e.preventDefault(),e.dataTransfer.dropEffect=`move`,m!==t&&h(t))},onDragLeave:()=>{m===t&&h(null)},onDrop:e=>{e.preventDefault(),f!==null&&S(f,t),p(null),h(null)},className:`flex flex-wrap md:flex-nowrap items-center gap-2 md:gap-3 bg-surface-raised border rounded-xl md:rounded-lg px-3 py-2.5 md:py-2 transition-colors ${n?`opacity-40 border-line`:`border-line`} ${r&&f>t?`!border-t-violet-500`:``} ${r&&f<t?`!border-b-violet-500`:``}`,children:[(0,L.jsx)(`span`,{draggable:!0,onDragStart:n=>{p(t),n.dataTransfer.effectAllowed=`move`,n.dataTransfer.setData(`text/plain`,e.id)},onDragEnd:()=>{p(null),h(null)},className:`hidden md:inline shrink-0 cursor-grab active:cursor-grabbing text-fg-subtle hover:text-fg-muted select-none leading-none px-1`,title:`Drag to reorder`,"aria-label":`Drag to reorder`,children:`⋮⋮`}),(0,L.jsx)(`span`,{className:`order-first md:order-none basis-[calc(100%-2.5rem)] md:basis-auto text-xs font-mono text-fg-subtle truncate md:shrink-0`,children:e.id}),(0,L.jsx)(`input`,{value:e.label,onChange:t=>y(e.id,t.target.value),className:`flex-1 min-w-0 bg-surface-raised border border-line-strong rounded px-2 py-1 text-xs text-fg focus:outline-none focus:border-violet-500`}),(0,L.jsx)(`select`,{value:e.projectType??`auto`,onChange:t=>b(e.id,t.target.value),title:`Validator toolchain — picks npm scripts or go fmt/vet/build/test`,className:`bg-surface-raised border border-line-strong rounded px-2 py-1 text-xs text-fg focus:outline-none focus:border-violet-500`,children:zs.map(e=>(0,L.jsx)(`option`,{value:e.value,children:e.label},e.value))}),(0,L.jsx)(`button`,{onClick:()=>v(e.id),className:`order-first md:order-none ml-auto md:ml-0 h-8 w-8 md:h-auto md:w-auto text-xs text-fg-subtle hover:text-red-400 transition-colors`,title:`Remove`,"aria-label":`Remove ${e.id}`,children:`✕`})]},e.id)})]}),(0,L.jsxs)(`div`,{className:`flex flex-wrap md:flex-nowrap items-center gap-2 border-t border-line pt-4`,children:[(0,L.jsx)(`select`,{value:i,onChange:e=>a(e.target.value),className:`bg-surface-raised border border-line-strong rounded px-2 py-1 text-xs text-fg focus:outline-none focus:border-violet-500`,children:Rs.map(e=>(0,L.jsx)(`option`,{value:e,children:e},e))}),(0,L.jsx)(`input`,{value:o,onChange:e=>s(e.target.value),onKeyDown:e=>{e.key===`Enter`&&_()},placeholder:`group/repo or owner/repo`,className:`basis-full md:basis-auto order-first md:order-none flex-1 min-w-0 bg-surface-raised border border-line-strong rounded px-2 py-1 text-xs text-fg focus:outline-none focus:border-violet-500`}),(0,L.jsx)(`button`,{onClick:_,className:`bg-surface-raised ring-1 ring-inset ring-line-strong hover:bg-surface-hover border border-line-strong hover:border-line-strong text-fg text-xs px-3 py-1 rounded transition-colors`,children:`+ Add`})]})]})}var Hs=3,Us={base:`Base clone`,legacy:`Old-layout clone`,orphan:`Stray folder`};function Ws(e){return e>=1024**3?`${(e/1024**3).toFixed(1)} GB`:e>=1024**2?`${Math.round(e/1024**2)} MB`:e>=1024?`${Math.round(e/1024)} KB`:`${e} B`}function Gs({removed:e,skipped:t,freedBytes:n}){let r=[`Removed ${e.length}`,`freed ${Ws(n)}`];return t.length&&r.push(`${t.length} in use, kept`),r.join(` · `)}function Ks(e){return e.lastUsedAt?`used ${Zi(Date.parse(e.lastUsedAt))}`:`never used`}function qs({ws:e}){let t=e.kind===`worktree`||e.kind===`base`?e.repo:e.id;return(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsx)(`div`,{className:`flex min-w-0 items-baseline gap-2`,children:e.kind===`worktree`?(0,L.jsxs)(L.Fragment,{children:[e.issueIid!==null&&(0,L.jsxs)(`span`,{className:`shrink-0 font-medium text-fg`,children:[`#`,e.issueIid]}),(0,L.jsx)(`span`,{className:`truncate font-mono text-xs text-fg-muted`,children:e.branch??`detached`})]}):(0,L.jsx)(`span`,{className:`font-medium text-fg`,children:Us[e.kind]})}),(0,L.jsxs)(`div`,{className:`truncate text-[11px] text-fg-subtle`,children:[(0,L.jsx)(`span`,{className:`font-mono`,children:t}),(0,L.jsxs)(`span`,{className:`tabular-nums`,children:[` · `,Ws(e.sizeBytes),` · `,Ks(e)]})]})]})}function Js(){let[e,t]=(0,x.useState)(null),[n,r]=(0,x.useState)(null),[i,a]=(0,x.useState)(null),[o,s]=(0,x.useState)(!1),[c,l]=(0,x.useState)(!1),[u,d]=(0,x.useState)(!1),[f,p]=(0,x.useState)(null),m=()=>R(`/workspaces`).then(e=>t(e.workspaces)).catch(e=>r(e.message));(0,x.useEffect)(()=>{m()},[]);let h=async e=>{d(!0),r(null);try{await R(`/workspaces?id=${encodeURIComponent(e)}`,{method:`DELETE`}),p(null),await m()}catch(e){r(e.message)}finally{d(!1),a(null)}},g=async()=>{d(!0),r(null);try{p(Gs(await R(`/workspaces/purge`,{method:`POST`,body:JSON.stringify({includeBases:c})}))),await m()}catch(e){r(e.message)}finally{d(!1),s(!1)}},_=e?.reduce((e,t)=>e+t.sizeBytes,0)??0,v=e?.filter(e=>!e.inUse&&(c||e.kind!==`base`))??[],y=v.reduce((e,t)=>e+t.sizeBytes,0);return(0,L.jsxs)(`section`,{className:`flex flex-col gap-3`,children:[(0,L.jsxs)(`div`,{className:`flex flex-wrap items-end justify-between gap-x-4 gap-y-2`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:`Workspaces`}),(0,L.jsxs)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:[`Checkouts Forge works in, under `,(0,L.jsx)(`code`,{className:`font-mono`,children:`~/.forge/cache`}),`: one worktree per issue off a base clone per repo.`,` `,(0,L.jsxs)(`span`,{className:Gn(`tabular-nums`,!e&&`invisible`),children:[Ws(_),` total.`]})]})]}),(0,L.jsx)(`div`,{className:`flex h-7 items-center gap-2`,children:o?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`span`,{className:`text-xs text-fg-muted tabular-nums`,children:[`Remove `,v.length,` (`,Ws(y),`)?`]}),(0,L.jsx)(z,{size:`sm`,variant:`ghost`,onClick:()=>s(!1),children:`Cancel`}),(0,L.jsx)(z,{size:`sm`,variant:`danger`,disabled:u,onClick:g,children:`Confirm purge`})]}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(z,{size:`sm`,variant:`ghost`,disabled:u,onClick:()=>m(),children:`Refresh`}),(0,L.jsx)(z,{size:`sm`,disabled:u||!e,onClick:()=>s(!0),children:`Purge idle`})]})})]}),(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-x-4 gap-y-1`,children:[(0,L.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-fg`,children:[(0,L.jsx)(`input`,{type:`checkbox`,checked:c,onChange:e=>l(e.target.checked),className:`rounded border-line-strong bg-surface-raised text-violet-600 focus:ring-violet-500`}),`Include base clones`]}),(0,L.jsx)(`p`,{"aria-live":`polite`,className:Gn(`min-h-4 text-xs`,n?`text-red-400`:`text-fg-muted`),children:n??f})]}),(0,L.jsx)(`div`,{className:`overflow-hidden rounded-xl border border-line bg-surface-raised`,children:(0,L.jsx)(`table`,{"aria-label":`Workspaces`,"aria-busy":!e||void 0,className:`w-full table-fixed text-left text-sm`,children:(0,L.jsxs)(`tbody`,{className:`divide-y divide-line`,children:[!e&&Array.from({length:Hs},(e,t)=>(0,L.jsx)(`tr`,{"aria-hidden":`true`,className:`h-14`,children:(0,L.jsx)(`td`,{colSpan:2,className:`px-4`,children:(0,L.jsx)(`div`,{className:`h-4 w-2/3 animate-pulse rounded bg-surface-hover`})})},t)),e?.map(e=>(0,L.jsxs)(`tr`,{className:`h-14`,children:[(0,L.jsx)(`td`,{className:`py-2 pl-4 pr-2`,children:(0,L.jsx)(qs,{ws:e})}),(0,L.jsx)(`td`,{className:`w-40 py-2 pl-2 pr-4`,children:(0,L.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[e.inUse&&(0,L.jsx)(`span`,{className:`rounded bg-amber-500/15 px-1.5 py-0.5 text-[11px] text-amber-300`,children:`In use`}),i===e.id?(0,L.jsx)(z,{size:`sm`,variant:`danger`,disabled:u,onClick:()=>h(e.id),onBlur:()=>a(null),children:`Confirm delete`}):(0,L.jsx)(z,{size:`sm`,variant:`ghost`,disabled:u||e.inUse,title:e.inUse?`A running job is using this workspace`:void 0,onClick:()=>a(e.id),children:`Delete`})]})})]},e.id)),e?.length===0&&(0,L.jsx)(`tr`,{className:`h-14`,children:(0,L.jsx)(`td`,{colSpan:2,className:`px-4 text-center text-sm text-fg-subtle`,children:`No workspaces yet. Forge creates one per issue when a job needs a checkout.`})})]})})})]})}function Ys(){let{config:e,loading:t,error:n,patch:r}=Ds(),{can:i}=Ui(),a=i(`admin`),{selectedRepo:o,availableRepos:s,selectedSecondaryRepos:c}=V(),{handleDestroyAllAnalyses:l,reloadStatus:u}=H(),[d,f]=(0,x.useState)(null),p=()=>{if(!window.confirm(`Destroy every cached analysis across every issue and repo? This cannot be undone.`))return;let e=l();f(e===0?`No cached analyses to remove.`:`Removed ${e} cached analysis entr${e===1?`y`:`ies`}.`)},m=s.find(e=>e.id===o)?.label??o,h=c.map(e=>s.find(t=>t.id===e)?.label??e);return t&&!e?(0,L.jsx)(hs,{}):n&&!e?(0,L.jsx)(`div`,{className:`max-w-3xl mx-auto w-full bg-red-950/40 border border-red-800 rounded-lg px-4 py-3 text-sm text-red-300`,children:n}):e?(0,L.jsxs)(`div`,{className:`max-w-3xl mx-auto w-full flex flex-col gap-10`,children:[(0,L.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-3 flex-wrap`,children:[(0,L.jsx)(`h1`,{className:`text-lg font-semibold text-fg`,children:`Settings`}),m&&(0,L.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px] font-mono`,children:[(0,L.jsx)(`span`,{className:`text-fg-subtle`,children:`Current repo`}),(0,L.jsx)(`span`,{className:`bg-violet-600/15 border border-violet-600/40 text-violet-200 px-2 py-0.5 rounded`,children:m}),h.length>0&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`span`,{className:`text-fg-subtle`,children:`+`}),h.map(e=>(0,L.jsx)(`span`,{className:`bg-surface-raised border border-line-strong text-fg px-2 py-0.5 rounded`,children:e},e))]})]})]}),(0,L.jsxs)(`p`,{className:`text-xs text-fg-subtle`,children:[`Persisted to `,(0,L.jsx)(`code`,{className:`text-fg-muted`,children:`~/.forge/config.json`}),`. Env vars apply when config is empty.`]})]}),(0,L.jsx)(Os,{}),!a&&(0,L.jsx)(`p`,{className:`rounded-xl border border-line bg-surface px-4 py-3 text-sm text-fg-muted`,children:`Workspace connections, repositories and defaults are managed by admins.`}),a&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Is,{connections:e.connections,onSave:e=>r({connections:e}).then(()=>void 0)}),(0,L.jsx)(Vs,{repos:e.repos,onSave:e=>r({repos:e}).then(()=>u())}),(0,L.jsx)(Ls,{defaults:e.defaults,onSave:e=>r({defaults:e}).then(()=>u())}),(0,L.jsxs)(`section`,{className:`flex flex-col gap-3`,children:[(0,L.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:`Local cache`}),(0,L.jsxs)(`p`,{className:`text-xs text-fg-subtle`,children:[`Forge caches previous analyses in `,(0,L.jsx)(`code`,{className:`text-fg-muted`,children:`localStorage`}),` so you can restore them without re-running Claude. Destroy the cache if it grows too large or if an analysis schema change has left stale entries that won't render.`]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,L.jsx)(`button`,{onClick:p,className:`text-xs text-red-300 hover:text-red-200 border border-red-900/60 hover:border-red-800 bg-red-950/30 hover:bg-red-950/50 px-3 py-1.5 rounded-lg transition-colors`,children:`Destroy all cached analyses`}),d&&(0,L.jsx)(`span`,{className:`text-xs text-fg-muted`,children:d})]})]}),(0,L.jsx)(Js,{})]})]}):null}function Xs(){let{phase:e,selectedIssue:t,currentOrdinal:n,storedAnalyses:r,selectedRepo:i,availableRepos:a}=V(),{setPhase:o,handleReset:s,handleSelectIssue:c,restoreAnalysisByOrdinal:l,setSelectedRepo:u}=H(),{setActiveDetailTab:d}=hi(),{navigate:f,pathname:p,search:m}=Ei(),h=new URLSearchParams(m).get(`repo`),g=(0,x.useRef)(!1),_=(0,x.useRef)(i);_.current=i;let v=(0,x.useRef)(i);(0,x.useEffect)(()=>{let e=v.current;v.current=i,!(!e||e===i||!g.current)&&/^\/issues\/\d+/.test(p)&&h!==i&&(s(),f(`/issues`,{replace:!0}))},[i]),(0,x.useEffect)(()=>{!t||!i||h||v.current===i&&p.startsWith(`/issues/${t.iid}`)&&f(`${p}?repo=${encodeURIComponent(i)}`,{replace:!0})},[t?.iid,i,p,h]),(0,x.useEffect)(()=>{d(p.endsWith(`/mr`)?`mr`:`issue`)},[p,d]),(0,x.useEffect)(()=>{if(!t||e===`idle`||e===`applying`)return;let r=`/issues/${t.iid}`;if(e===`reviewing`){let e=`${r}/analysis/${n??1}`;p!==e&&f(e)}else if(e===`monitoring`){let e=`${r}/mr`;p!==e&&f(e)}else p.startsWith(r)||f(r)},[e,t?.iid,n]);let y=(0,x.useRef)(t?.iid);return(0,x.useEffect)(()=>{let e=y.current;y.current=t?.iid,e!==void 0&&!t&&p.startsWith(`/issues/${e}`)&&f(`/issues`,{replace:!0})},[t?.iid]),(0,x.useEffect)(()=>{if(!t||e===`idle`)return;let i=`/issues/${t.iid}`;if(!p.startsWith(i)){s();return}let a=p.match(RegExp(`^${i}/analysis/(\\d+)$`));if(p===`${i}/review`){let e=r[0];f(e?`${i}/analysis/${e.ordinal}`:i,{replace:!0});return}if(a){let t=Number(a[1]);if(e===`reviewing`&&n===t)return;l(t)||f(i,{replace:!0})}else e===`reviewing`&&o(`selected`)},[p]),(0,x.useEffect)(()=>{if(g.current||!i)return;if(h&&h!==i){if(!a.length)return;if(a.some(e=>e.id===h)){u(h);return}}if(g.current=!0,e!==`idle`&&e!==`selected`)return;let t=p.match(/^\/issues\/(\d+)/);if(!t)return;let n=p.match(/^\/issues\/\d+\/analysis\/(\d+)$/),r=p.endsWith(`/review`),o=i;R(`/issues/${t[1]}?repo=${encodeURIComponent(o)}`).then(async({issue:e})=>{if(_.current!==o||(c(e),!n&&!r))return;let t=await xr(i,e.iid);if(n)l(Number(n[1]),e.iid)||f(`/issues/${e.iid}`,{replace:!0});else{let n=t[0];n&&l(n.ordinal,e.iid)?f(`/issues/${e.iid}/analysis/${n.ordinal}`,{replace:!0}):f(`/issues/${e.iid}`,{replace:!0})}}).catch(()=>f(`/issues`,{replace:!0}))},[e,i,a.length]),null}function Zs({open:e,onClose:t,title:n,leading:r,trailing:i,closeLabel:a=`Cancel`,children:o}){return po(e,t),e?(0,L.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-end md:items-start justify-center bg-black/50 backdrop-blur-sm md:pt-24 md:px-4 animate-[forge-fade_200ms_ease-out]`,onClick:t,children:(0,L.jsxs)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-label":n,onClick:e=>e.stopPropagation(),className:`w-full md:max-w-xl max-h-[92dvh] flex flex-col bg-surface-raised border-t md:border border-line md:border-line-strong rounded-t-[14px] md:rounded-xl shadow-2xl animate-[forge-sheet-up_320ms_cubic-bezier(0.32,0.72,0,1)] md:animate-none`,children:[(0,L.jsx)(`div`,{className:`md:hidden flex justify-center pt-2`,children:(0,L.jsx)(`span`,{className:`w-9 h-[5px] rounded-full bg-line-strong`})}),(0,L.jsxs)(`div`,{className:`grid grid-cols-[1fr_auto_1fr] items-center gap-2 px-4 md:px-5 h-12 md:h-auto md:pt-4 md:pb-1 shrink-0`,children:[(0,L.jsx)(`div`,{className:`justify-self-start`,children:r??(0,L.jsx)(`button`,{type:`button`,onClick:t,className:`text-[17px] md:text-sm text-accent-fg md:text-fg-muted hover:text-accent-hover md:hover:text-fg -ml-1 px-1 py-2 md:py-0`,children:a})}),(0,L.jsx)(`h2`,{className:`text-[17px] md:text-sm font-semibold text-fg truncate`,children:n}),(0,L.jsx)(`div`,{className:`justify-self-end`,children:i})]}),(0,L.jsx)(`div`,{className:`overflow-y-auto overscroll-contain px-4 md:px-5 pt-2 pb-[max(1.25rem,env(safe-area-inset-bottom))]`,children:o})]})}):null}var Qs=`forge-new-task`;function $s(){let{taskModalOpen:e,setTaskModalOpen:t}=hi(),{handleCreateIssue:n,handleSelectIssue:r}=H(),{navigate:i}=Ei(),{selectedRepo:a}=V(),o=Ma(a),[s,c]=(0,x.useState)(``),[l,u]=(0,x.useState)(``),[d,f]=(0,x.useState)([]),[p,m]=(0,x.useState)(!1),[h,g]=(0,x.useState)(null);(0,x.useEffect)(()=>{e||(c(``),u(``),f([]),g(null),m(!1))},[e]);let _=()=>t(!1);return(0,L.jsx)(Zs,{open:e,onClose:_,title:`New Task`,trailing:(0,L.jsx)(`button`,{type:`submit`,form:Qs,disabled:!(!p&&s.trim()),className:`text-[17px] md:text-xs font-semibold md:font-medium text-accent-fg md:text-on-accent md:bg-violet-600 md:hover:bg-violet-500 disabled:opacity-40 disabled:cursor-not-allowed md:px-4 md:py-1.5 md:rounded px-1 py-2 transition-colors`,children:p?`Creating…`:`Create task`}),children:(0,L.jsxs)(`form`,{id:Qs,onSubmit:async e=>{if(e.preventDefault(),s.trim()){m(!0),g(null);try{let e=await n(s.trim(),l.trim(),d);r(e),i(`/issues/${e.iid}`,{replace:!1}),_()}catch(e){g(e.message),m(!1)}}},className:`flex flex-col gap-3`,children:[(0,L.jsx)(`input`,{type:`text`,placeholder:`Task title`,value:s,onChange:e=>c(e.target.value),autoFocus:!0,enterKeyHint:`next`,className:`w-full bg-surface-raised border border-line-strong rounded-[10px] md:rounded px-3 py-2.5 md:py-2 text-[17px] md:text-sm text-fg placeholder:text-fg-subtle focus:outline-none focus:border-violet-500`}),(0,L.jsx)(`textarea`,{placeholder:`Describe what you want done. The more detail, the better the analysis.`,value:l,onChange:e=>u(e.target.value),rows:6,className:`w-full bg-surface-raised border border-line-strong rounded-[10px] md:rounded px-3 py-2.5 md:py-2 text-[17px] md:text-sm text-fg placeholder:text-fg-subtle focus:outline-none focus:border-violet-500 resize-y`}),(0,L.jsx)(Wa,{labels:d,available:o,onChange:f}),h&&(0,L.jsx)(`p`,{className:`text-[13px] md:text-xs text-red-400`,children:h}),(0,L.jsx)(`p`,{className:`text-[13px] md:text-[11px] text-fg-subtle`,children:`Creates an issue in the selected repo and opens it — then choose “Begin Analysis”.`})]})})}function ec({children:e}){return(0,L.jsx)(`kbd`,{className:`inline-flex h-5 min-w-5 items-center justify-center rounded border border-line bg-surface px-1 font-sans text-[10px] font-medium text-fg-subtle`,children:e})}function tc({commands:e,query:t}){let n=t.trim().toLowerCase().split(/\s+/).filter(Boolean);if(!n.length)return e;let r=[];return e.forEach((e,t)=>{let i=e.hint?.toLowerCase()??``,a=[e.label,i,...e.keywords??[]].join(` `).toLowerCase(),o=0;for(let t of n)if(t.startsWith(`#`))if(i===t)o+=3;else if(i.startsWith(t))o+=1;else return;else if(e.label.toLowerCase().startsWith(t))o+=2;else if(a.includes(t))o+=1;else return;r.push({command:e,score:o,index:t})}),r.sort((e,t)=>t.score-e.score||e.index-t.index).map(e=>e.command)}function nc({open:e,commands:t,onClose:n}){return e?(0,L.jsx)(rc,{commands:t,onClose:n}):null}function rc({commands:e,onClose:t}){let[n,r]=(0,x.useState)(``),[i,a]=(0,x.useState)(0),o=(0,x.useId)(),s=(0,x.useRef)(null),c=tc({commands:e,query:n}),l=c[Math.min(i,c.length-1)];(0,x.useEffect)(()=>{s.current?.querySelector(`[aria-selected="true"]`)?.scrollIntoView?.({block:`nearest`})},[i,n]);let u=e=>{e&&(t(),e.run())},d=e=>{e.key===`ArrowDown`?(e.preventDefault(),a(e=>Math.min(e+1,c.length-1))):e.key===`ArrowUp`?(e.preventDefault(),a(e=>Math.max(e-1,0))):e.key===`Enter`?(e.preventDefault(),u(l)):e.key===`Escape`&&(e.preventDefault(),t())},f=``;return(0,L.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-start justify-center px-4 pt-[12vh]`,children:[(0,L.jsx)(`div`,{className:`absolute inset-0 bg-black/50 backdrop-blur-[2px] animate-fade-in`,onClick:t,"aria-hidden":!0}),(0,L.jsxs)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-label":`Command palette`,className:`relative w-full max-w-xl overflow-hidden rounded-xl bg-surface-raised shadow-overlay animate-pop-in`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-line px-4`,children:[(0,L.jsx)(B,{name:`search`,className:`text-fg-subtle shrink-0`}),(0,L.jsx)(`input`,{ref:e=>e?.focus(),role:`combobox`,"aria-expanded":`true`,"aria-controls":o,"aria-activedescendant":l?`${o}-${l.id}`:void 0,"aria-autocomplete":`list`,value:n,onChange:e=>{r(e.target.value),a(0)},onKeyDown:d,placeholder:`Search issues, pages and actions…`,className:`h-12 flex-1 bg-transparent text-sm text-fg placeholder:text-fg-subtle focus:outline-none`}),(0,L.jsx)(ec,{children:`Esc`})]}),(0,L.jsxs)(`div`,{ref:s,id:o,role:`listbox`,"aria-label":`Results`,className:`max-h-[50vh] overflow-y-auto p-1.5`,children:[c.length===0&&(0,L.jsxs)(`p`,{className:`px-3 py-10 text-center text-sm text-fg-subtle`,children:[`No results for “`,n,`”`]}),c.map((e,t)=>{let n=e.group!==f;f=e.group;let r=e===l;return(0,L.jsxs)(`div`,{children:[n&&(0,L.jsx)(`div`,{className:`px-3 pb-1 pt-2.5 text-[11px] font-medium uppercase tracking-wide text-fg-subtle`,children:e.group}),(0,L.jsxs)(`div`,{id:`${o}-${e.id}`,role:`option`,"aria-selected":r,onMouseMove:()=>a(t),onClick:()=>u(e),className:Gn(`flex cursor-pointer items-center justify-between gap-3 rounded-lg px-3 py-2 text-sm`,r?`bg-surface-hover text-fg`:`text-fg-muted`),children:[(0,L.jsx)(`span`,{className:`truncate`,children:e.label}),e.hint&&(0,L.jsx)(`span`,{className:`shrink-0 font-mono text-xs text-fg-subtle`,children:e.hint})]})]},e.id)})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-4 border-t border-line px-4 py-2 text-[11px] text-fg-subtle`,children:[(0,L.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,L.jsx)(ec,{children:`↑`}),(0,L.jsx)(ec,{children:`↓`}),` navigate`]}),(0,L.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,L.jsx)(ec,{children:`↵`}),` open`]})]})]})]})}function ic({open:e,onOpenChange:t}){let{issues:n,phase:r,openMRs:i,openMRsLoading:a}=V(),{handleSelectIssue:o,handleReset:s,loadIssues:c,loadOpenMRs:l}=H(),{setTaskModalOpen:u}=hi(),{navigate:d}=Ei(),{setPreference:f}=ir(),{can:p,signOut:m}=Ui(),h=Ai();(0,x.useEffect)(()=>{let n=n=>{(n.metaKey||n.ctrlKey)&&n.key.toLowerCase()===`k`&&(n.preventDefault(),t(!e))};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,t]);let g=(e,t)=>{r!==`idle`&&s(),d(e,{replace:!0}),t&&i.length===0&&!a&&l()};return(0,L.jsx)(nc,{open:e,commands:[...h.map(e=>({id:`go-${e.path.slice(1)}`,group:`Navigate`,label:`Go to ${e.label}`,keywords:[...e.keywords],run:()=>g(e.path,e.preloadMRs)})),...p(`operator`)?[{id:`new-task`,group:`Actions`,label:`New task`,keywords:[`create`],run:()=>u(!0)}]:[],{id:`refresh`,group:`Actions`,label:`Refresh issues and merge requests`,keywords:[`reload`],run:()=>{c(),l()}},{id:`theme-light`,group:`Actions`,label:`Switch to light theme`,keywords:[`appearance`],run:()=>f(`light`)},{id:`theme-dark`,group:`Actions`,label:`Switch to dark theme`,keywords:[`appearance`],run:()=>f(`dark`)},{id:`theme-system`,group:`Actions`,label:`Use system theme`,keywords:[`appearance`],run:()=>f(`system`)},{id:`sign-out`,group:`Actions`,label:`Sign out`,keywords:[`logout`],run:()=>void m()},...n.map(e=>({id:`issue-${e.iid}`,group:`Issues`,label:e.title,hint:`#${e.iid}`,keywords:e.labels,run:()=>{r!==`idle`&&s(),o(e)}}))],onClose:()=>t(!1)})}function ac(){let e=U().filter(e=>!e.adminOnly);return(0,L.jsx)(`nav`,{"aria-label":`Tabs`,className:`fixed inset-x-0 bottom-0 z-30 border-t border-line/70 bg-canvas/80 pb-[env(safe-area-inset-bottom)] backdrop-blur-xl backdrop-saturate-150 md:hidden`,children:(0,L.jsx)(`ul`,{className:`grid h-[50px]`,style:{gridTemplateColumns:`repeat(${e.length}, minmax(0, 1fr))`},children:e.map(e=>{let t=e.badgeCount!==void 0&&e.badgeCount>0;return(0,L.jsx)(`li`,{className:`flex`,children:(0,L.jsxs)(`button`,{type:`button`,onClick:e.go,"aria-current":e.active?`page`:void 0,className:Gn(`flex flex-1 flex-col items-center justify-center gap-0.5 pt-1 transition-colors`,e.active?`text-accent-fg`:`text-fg-subtle active:text-fg-muted`),children:[(0,L.jsxs)(`span`,{className:`relative`,children:[(0,L.jsx)(B,{name:e.icon,size:24}),t&&(0,L.jsx)(`span`,{className:`absolute -right-2.5 -top-1 h-[18px] min-w-[18px] rounded-full bg-red-500 px-1 text-center text-[11px] font-semibold leading-[18px] text-on-accent tabular-nums`,children:e.badgeCount})]}),(0,L.jsx)(`span`,{className:`text-[10px] font-medium leading-none tracking-tight`,children:e.label})]})},e.path)})})})}var oc=[`/issues`,`/mrs`,`/pipelines`];function sc(e){return oc.includes(e)}var cc=typeof navigator<`u`&&/Mac|iPhone|iPad/.test(navigator.platform);function lc({popoutUrl:e,onOpenPalette:t,onOpenNav:n}){let{phase:r,selectedIssue:i,applyResult:a}=V(),{handleReset:o,handleBackToIssue:s}=H(),{setMrMerged:c,setTaskModalOpen:l}=hi(),{navigate:u,pathname:d}=Ei(),{can:f}=Ui(),p=(0,x.useRef)(`/issues`);(0,x.useEffect)(()=>{r===`idle`&&sc(d)&&(p.current=d)},[d,r]);let m=r!==`idle`,h=a?.applications[0]?.mr,g=ki(m?p.current:d)?.label??`Issues`;return(0,L.jsxs)(`header`,{className:`box-content flex h-14 shrink-0 pt-[env(safe-area-inset-top)] items-center justify-between gap-2 border-b border-line/70 bg-canvas/80 px-3 backdrop-blur-xl sm:gap-4 sm:px-6`,children:[(0,L.jsx)(`button`,{type:`button`,"aria-label":`Open navigation`,onClick:n,className:`-ml-1 flex size-8 shrink-0 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover hover:text-fg lg:hidden`,children:(0,L.jsx)(B,{name:`menu`,size:18})}),(0,L.jsxs)(`nav`,{"aria-label":`Breadcrumb`,className:`mr-auto flex min-w-0 items-center gap-1 text-sm`,children:[m?(0,L.jsxs)(`button`,{onClick:()=>{c(!1),o(),u(p.current,{replace:!0})},"aria-label":`Back to ${g}`,className:`-ml-1.5 flex shrink-0 items-center rounded-lg py-1 pl-0.5 pr-2 text-accent-fg transition-colors hover:bg-surface-hover`,children:[(0,L.jsx)(B,{name:`chevronLeft`,size:18}),(0,L.jsx)(`span`,{className:`hidden sm:inline`,children:g})]}):null,i&&m&&(0,L.jsxs)(`button`,{type:`button`,onClick:s,disabled:r!==`analyzing`&&r!==`reviewing`,title:r===`analyzing`||r===`reviewing`?`Back to the ticket; the analysis stays`:void 0,"aria-current":`page`,className:`min-w-0 truncate rounded-lg px-1.5 py-1 text-left font-medium text-fg enabled:hover:bg-surface-hover`,children:[(0,L.jsxs)(`span`,{className:`font-normal text-fg-subtle`,children:[`#`,i.iid]}),` `,i.title]}),!i&&h&&m&&a&&(0,L.jsxs)(`span`,{className:`truncate px-1.5 font-medium text-fg`,"aria-current":`page`,children:[(0,L.jsxs)(`span`,{className:`font-normal text-fg-subtle`,children:[`!`,h.iid]}),` `,h.title,a.applications.length>1&&(0,L.jsxs)(`span`,{className:`ml-2 text-xs text-accent-fg`,children:[`+`,a.applications.length-1,` more`]})]})]}),(0,L.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[!m&&f(`operator`)&&(0,L.jsx)(`button`,{type:`button`,onClick:()=>l(!0),"aria-label":`New task`,className:`flex size-8 items-center justify-center rounded-lg text-accent-fg transition-colors hover:bg-surface-hover md:hidden`,children:(0,L.jsx)(B,{name:`plus`,size:18})}),(0,L.jsxs)(`button`,{type:`button`,onClick:t,"aria-label":`Search or jump to`,className:`flex h-8 w-8 items-center justify-center gap-2 rounded-lg sm:w-64 sm:justify-start border border-line bg-surface px-2.5 text-xs text-fg-subtle transition-colors hover:border-line-strong hover:text-fg-muted`,children:[(0,L.jsx)(B,{name:`search`,size:14}),(0,L.jsx)(`span`,{className:`hidden flex-1 text-left sm:inline`,children:`Search or jump to…`}),(0,L.jsxs)(`span`,{className:`hidden items-center gap-1 sm:flex`,children:[(0,L.jsx)(ec,{children:cc?`⌘`:`Ctrl`}),(0,L.jsx)(ec,{children:`K`})]})]}),e&&(0,L.jsx)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,className:`flex size-8 items-center justify-center rounded-lg text-fg-subtle transition-colors hover:bg-surface-hover hover:text-fg`,title:`Open in new tab`,"aria-label":`Open in new tab`,children:(0,L.jsx)(B,{name:`external`,size:14})})]})]})}function uc({popoutUrl:e,children:t}){let{phase:n}=V(),[r,i]=(0,x.useState)(!1),[a,o]=(0,x.useState)(!1),{pathname:s}=Ei();(0,x.useEffect)(()=>o(!1),[s]);let c=n===`idle`;return(0,L.jsxs)(`div`,{className:`flex h-[100dvh] bg-canvas text-fg`,children:[(0,L.jsx)(Ni,{open:a,onClose:()=>o(!1)}),(0,L.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:[(0,L.jsx)(lc,{popoutUrl:e,onOpenPalette:()=>i(!0),onOpenNav:()=>o(!0)}),(0,L.jsx)(`main`,{className:Gn(`min-h-0 w-full flex-1 overflow-y-auto overscroll-contain px-4 pt-6 sm:px-6 sm:pt-8 md:pb-8 lg:px-10`,c?`pb-[calc(50px+env(safe-area-inset-bottom)+1.5rem)]`:`pb-[max(1.5rem,env(safe-area-inset-bottom))]`),children:t})]}),c&&(0,L.jsx)(ac,{}),(0,L.jsx)($s,{}),(0,L.jsx)(ic,{open:r,onOpenChange:i})]})}function dc({popoutUrl:e,basePath:t}={}){return(0,L.jsx)(Ti,{basePath:t,children:(0,L.jsxs)(pi,{children:[(0,L.jsx)(Xs,{}),(0,L.jsx)(fc,{popoutUrl:e})]})})}function fc({popoutUrl:e}){let{backendError:t,backendRetrying:n}=V(),{retryBackend:r}=H();return t?(0,L.jsx)(`div`,{className:`min-h-screen flex items-center justify-center bg-canvas px-4`,children:(0,L.jsxs)(`div`,{className:`max-w-md w-full bg-red-950/40 border border-red-800 rounded-lg p-6 text-center`,children:[(0,L.jsx)(`h2`,{className:`text-lg font-medium text-red-200 mb-2`,children:`Forge backend unreachable`}),(0,L.jsx)(`p`,{className:`text-sm text-red-300/80 mb-4 break-words`,children:t}),(0,L.jsx)(`button`,{onClick:r,disabled:n,className:`bg-red-800 hover:bg-red-700 disabled:opacity-50 text-on-accent text-sm font-medium px-4 py-2 rounded-lg transition-colors`,children:n?`Retrying…`:`Retry`})]})}):(0,L.jsx)(uc,{popoutUrl:e,children:(0,L.jsx)(pc,{})})}function pc(){let{phase:e}=V(),{pathname:t}=Ei();if(e===`idle`){if(t.startsWith(`/settings`))return(0,L.jsx)(Ys,{});if(t.startsWith(`/members`))return(0,L.jsx)(oa,{});if(t.startsWith(`/audit`))return(0,L.jsx)(na,{})}switch(e){case`idle`:return(0,L.jsx)(lo,{});case`selected`:return(0,L.jsx)(Es,{});case`analyzing`:return(0,L.jsx)(ya,{});case`reviewing`:case`applying`:return(0,L.jsx)(ps,{});case`monitoring`:return(0,L.jsx)(qo,{});default:return null}}(0,zn.createRoot)(document.getElementById(`root`)).render((0,L.jsx)(x.StrictMode,{children:(0,L.jsx)(Bn,{children:(0,L.jsx)(rr,{children:(0,L.jsx)(gn,{children:(0,L.jsx)(`div`,{className:`min-h-screen bg-canvas`,children:(0,L.jsx)(Hi,{children:(0,L.jsx)(dc,{})})})})})})}));