dispach 0.1.2 → 0.1.3

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 (195) hide show
  1. package/README.md +134 -85
  2. package/dist/App-qfqvx9c7.js +11 -0
  3. package/dist/{App-b1yrwrcq.js.map → App-qfqvx9c7.js.map} +6 -7
  4. package/dist/ConfigEditor-apcnj4nj.js +6 -0
  5. package/dist/{ConfigEditor-n8hdw6r7.js.map → ConfigEditor-apcnj4nj.js.map} +2 -2
  6. package/dist/KeyProbe-ya5t3v3v.js +5 -0
  7. package/dist/{KeyProbe-9jjeze5r.js.map → KeyProbe-ya5t3v3v.js.map} +2 -2
  8. package/dist/Picker-b7mn0mjg.js +5 -0
  9. package/dist/{Picker-hfeh1g6m.js.map → Picker-b7mn0mjg.js.map} +1 -1
  10. package/dist/SessionPicker-vacfwczg.js +5 -0
  11. package/dist/{SessionPicker-zyqkg4dn.js.map → SessionPicker-vacfwczg.js.map} +2 -2
  12. package/dist/SkillBrowser-66ntwaa9.js +5 -0
  13. package/dist/{SkillBrowser-3qdp8080.js.map → SkillBrowser-66ntwaa9.js.map} +1 -1
  14. package/dist/WizardApp-123998yh.js +5 -0
  15. package/dist/{WizardApp-vzpbydy3.js.map → WizardApp-123998yh.js.map} +3 -3
  16. package/dist/agents.d.ts +19 -3
  17. package/dist/agents.d.ts.map +1 -1
  18. package/dist/channels-q4fwqq87.js +31 -0
  19. package/dist/channels-q4fwqq87.js.map +10 -0
  20. package/dist/channels.d.ts +26 -0
  21. package/dist/channels.d.ts.map +1 -0
  22. package/dist/client.js +10 -10
  23. package/dist/client.js.map +3 -3
  24. package/dist/config-64q4mgxc.js +24 -0
  25. package/dist/{config-g7za9x13.js.map → config-64q4mgxc.js.map} +2 -2
  26. package/dist/{credential-npr6z8c8.js → credential-2sj7vsmw.js} +5 -5
  27. package/dist/{credential-npr6z8c8.js.map → credential-2sj7vsmw.js.map} +1 -1
  28. package/dist/daemon.d.ts.map +1 -1
  29. package/dist/index-0k3w2mxf.js +6 -0
  30. package/dist/{index-hwpvhaza.js.map → index-0k3w2mxf.js.map} +1 -1
  31. package/dist/index-1s81qstp.js +6 -0
  32. package/dist/{index-v8e92nfw.js.map → index-1s81qstp.js.map} +1 -1
  33. package/dist/index-2rycma8x.js +12 -0
  34. package/dist/{index-258d8bzg.js.map → index-2rycma8x.js.map} +4 -3
  35. package/dist/index-2zye08c4.js +6 -0
  36. package/dist/{index-vgc3y3rm.js.map → index-2zye08c4.js.map} +2 -2
  37. package/dist/{index-gme2egyq.js → index-3km1jwh7.js} +4 -4
  38. package/dist/{index-gme2egyq.js.map → index-3km1jwh7.js.map} +1 -1
  39. package/dist/index-3mtgcvkq.js +429 -0
  40. package/dist/index-3mtgcvkq.js.map +11 -0
  41. package/dist/index-4knb5vjm.js +90 -0
  42. package/dist/index-4knb5vjm.js.map +13 -0
  43. package/dist/{index-3g3ny01d.js → index-5nwwekk0.js} +4 -4
  44. package/dist/{index-3g3ny01d.js.map → index-5nwwekk0.js.map} +1 -1
  45. package/dist/index-5rm7dwq4.js +6 -0
  46. package/dist/index-5rm7dwq4.js.map +11 -0
  47. package/dist/index-79epttpm.js +6 -0
  48. package/dist/index-79epttpm.js.map +10 -0
  49. package/dist/{index-4cf6v9nb.js → index-7yk1zvds.js} +4 -4
  50. package/dist/{index-4cf6v9nb.js.map → index-7yk1zvds.js.map} +1 -1
  51. package/dist/index-81gb4ey4.js +6 -0
  52. package/dist/{index-4z7axw4r.js.map → index-81gb4ey4.js.map} +1 -1
  53. package/dist/index-8a5d8sfe.js +6 -0
  54. package/dist/{index-0d93hyfc.js.map → index-8a5d8sfe.js.map} +1 -1
  55. package/dist/index-a21zyy54.js +6 -0
  56. package/dist/index-a21zyy54.js.map +9 -0
  57. package/dist/index-b6da6c16.js +92 -0
  58. package/dist/index-b6da6c16.js.map +15 -0
  59. package/dist/index-byxrc961.js +903 -0
  60. package/dist/{index-tv4yv7d2.js.map → index-byxrc961.js.map} +16 -15
  61. package/dist/{index-ammv5st7.js → index-cgfg6t5a.js} +6 -6
  62. package/dist/{index-ammv5st7.js.map → index-cgfg6t5a.js.map} +1 -1
  63. package/dist/{index-s9mbq7h6.js → index-ehzwdnc3.js} +4 -4
  64. package/dist/{index-s9mbq7h6.js.map → index-ehzwdnc3.js.map} +1 -1
  65. package/dist/index-fzmmhmk2.js +7 -0
  66. package/dist/index-fzmmhmk2.js.map +11 -0
  67. package/dist/index-g3pk0kc0.js +6 -0
  68. package/dist/{index-9r0wyj6w.js.map → index-g3pk0kc0.js.map} +2 -2
  69. package/dist/index-h828nk24.js +153 -0
  70. package/dist/index-h828nk24.js.map +20 -0
  71. package/dist/{index-02dn6m2j.js → index-jq999vcw.js} +5 -5
  72. package/dist/{index-02dn6m2j.js.map → index-jq999vcw.js.map} +2 -2
  73. package/dist/index-k2aq5bg0.js +9 -0
  74. package/dist/{index-6p999cx4.js.map → index-k2aq5bg0.js.map} +4 -6
  75. package/dist/{index-cqqb6gaq.js → index-k3y8y3wj.js} +5 -5
  76. package/dist/{index-cqqb6gaq.js.map → index-k3y8y3wj.js.map} +1 -1
  77. package/dist/index-k59wwdgz.js +9 -0
  78. package/dist/{index-ff514z3y.js.map → index-k59wwdgz.js.map} +3 -5
  79. package/dist/index-nmnnwa02.js +6 -0
  80. package/dist/{index-6q4wf8e3.js.map → index-nmnnwa02.js.map} +1 -1
  81. package/dist/index-nn3tk25c.js +6 -0
  82. package/dist/{index-d4x6yvqh.js.map → index-nn3tk25c.js.map} +3 -4
  83. package/dist/index-q0hxh57v.js +126 -0
  84. package/dist/index-q0hxh57v.js.map +14 -0
  85. package/dist/index-srmhk9g5.js +11 -0
  86. package/dist/index-srmhk9g5.js.map +11 -0
  87. package/dist/index-swtyfhha.js +6 -0
  88. package/dist/{index-fex44816.js.map → index-swtyfhha.js.map} +2 -2
  89. package/dist/index-whq42sat.js +6 -0
  90. package/dist/{index-h9mw7b9d.js.map → index-whq42sat.js.map} +1 -1
  91. package/dist/{index-j7gyr5nx.js → index-wzsmh5j0.js} +7 -7
  92. package/dist/{index-j7gyr5nx.js.map → index-wzsmh5j0.js.map} +1 -1
  93. package/dist/{index-j55s3ehk.js → index-x7v1zq89.js} +7 -7
  94. package/dist/{index-j55s3ehk.js.map → index-x7v1zq89.js.map} +2 -2
  95. package/dist/index-xhzmv4dh.js +66 -0
  96. package/dist/index-xhzmv4dh.js.map +12 -0
  97. package/dist/index-xmv47vs0.js +6 -0
  98. package/dist/{index-gz9x25tz.js.map → index-xmv47vs0.js.map} +2 -2
  99. package/dist/index-y4c32wn7.js +6 -0
  100. package/dist/{index-qdbq8crg.js.map → index-y4c32wn7.js.map} +2 -2
  101. package/dist/index-yjcdp72k.js +6 -0
  102. package/dist/{index-tf71ap9v.js.map → index-yjcdp72k.js.map} +1 -1
  103. package/dist/index-zn24991r.js +6 -0
  104. package/dist/index-zn24991r.js.map +10 -0
  105. package/dist/index.js +374 -443
  106. package/dist/index.js.map +23 -27
  107. package/dist/init.d.ts.map +1 -1
  108. package/dist/lib/channel-actions.d.ts +103 -0
  109. package/dist/lib/channel-actions.d.ts.map +1 -0
  110. package/dist/lib/chat-frame.d.ts +12 -1
  111. package/dist/lib/chat-frame.d.ts.map +1 -1
  112. package/dist/lib/commands.d.ts +13 -0
  113. package/dist/lib/commands.d.ts.map +1 -1
  114. package/dist/lib/const.d.ts +1 -1
  115. package/dist/lib/host-actions.d.ts +121 -0
  116. package/dist/lib/host-actions.d.ts.map +1 -0
  117. package/dist/lib/init-flow.d.ts +32 -0
  118. package/dist/lib/init-flow.d.ts.map +1 -1
  119. package/dist/lib/init-whatsapp.d.ts +52 -0
  120. package/dist/lib/init-whatsapp.d.ts.map +1 -0
  121. package/dist/lib/plugin-install.d.ts +120 -0
  122. package/dist/lib/plugin-install.d.ts.map +1 -0
  123. package/dist/lib/providers.d.ts.map +1 -1
  124. package/dist/lib/provision.d.ts.map +1 -1
  125. package/dist/lib/readme-table.d.ts +15 -0
  126. package/dist/lib/readme-table.d.ts.map +1 -0
  127. package/dist/lib/sandbox.d.ts +15 -0
  128. package/dist/lib/sandbox.d.ts.map +1 -1
  129. package/dist/lib/schema.d.ts +34 -1
  130. package/dist/lib/schema.d.ts.map +1 -1
  131. package/dist/lib/subcommand.d.ts.map +1 -1
  132. package/dist/lib/web-url.d.ts +15 -0
  133. package/dist/lib/web-url.d.ts.map +1 -0
  134. package/dist/lib/wizard.d.ts.map +1 -1
  135. package/dist/memory.d.ts.map +1 -1
  136. package/dist/model.d.ts.map +1 -1
  137. package/dist/plugins.d.ts +27 -8
  138. package/dist/plugins.d.ts.map +1 -1
  139. package/dist/restart.d.ts +21 -0
  140. package/dist/restart.d.ts.map +1 -0
  141. package/dist/run.d.ts.map +1 -1
  142. package/dist/schedules.d.ts.map +1 -1
  143. package/dist/serve.d.ts.map +1 -1
  144. package/dist/sessions.d.ts.map +1 -1
  145. package/dist/skills.d.ts.map +1 -1
  146. package/dist/status.d.ts +16 -0
  147. package/dist/status.d.ts.map +1 -0
  148. package/dist/tools.d.ts.map +1 -1
  149. package/dist/validate.d.ts.map +1 -1
  150. package/dist/web-923c7f5e.js +14 -0
  151. package/dist/{web-vkb16r62.js.map → web-923c7f5e.js.map} +3 -3
  152. package/dist/web.d.ts +2 -13
  153. package/dist/web.d.ts.map +1 -1
  154. package/dist/workspace.d.ts.map +1 -1
  155. package/dist/wrapper-0w9b3my0.js +11 -0
  156. package/dist/wrapper-0w9b3my0.js.map +23 -0
  157. package/package.json +6 -3
  158. package/dist/App-b1yrwrcq.js +0 -11
  159. package/dist/ConfigEditor-n8hdw6r7.js +0 -6
  160. package/dist/KeyProbe-9jjeze5r.js +0 -5
  161. package/dist/Picker-hfeh1g6m.js +0 -5
  162. package/dist/SessionPicker-zyqkg4dn.js +0 -5
  163. package/dist/SkillBrowser-3qdp8080.js +0 -5
  164. package/dist/WizardApp-vzpbydy3.js +0 -5
  165. package/dist/config-g7za9x13.js +0 -24
  166. package/dist/index-0d93hyfc.js +0 -6
  167. package/dist/index-1c5113t4.js +0 -66
  168. package/dist/index-1c5113t4.js.map +0 -12
  169. package/dist/index-258d8bzg.js +0 -12
  170. package/dist/index-4z7axw4r.js +0 -6
  171. package/dist/index-6p999cx4.js +0 -9
  172. package/dist/index-6q4wf8e3.js +0 -6
  173. package/dist/index-9r0wyj6w.js +0 -6
  174. package/dist/index-d4x6yvqh.js +0 -6
  175. package/dist/index-fecm8xe7.js +0 -77
  176. package/dist/index-fecm8xe7.js.map +0 -12
  177. package/dist/index-fex44816.js +0 -6
  178. package/dist/index-ff514z3y.js +0 -14
  179. package/dist/index-gz9x25tz.js +0 -6
  180. package/dist/index-h9mw7b9d.js +0 -6
  181. package/dist/index-hwpvhaza.js +0 -6
  182. package/dist/index-mtn0g9vc.js +0 -7
  183. package/dist/index-mtn0g9vc.js.map +0 -11
  184. package/dist/index-qdbq8crg.js +0 -6
  185. package/dist/index-tf71ap9v.js +0 -6
  186. package/dist/index-ttwyrdjs.js +0 -427
  187. package/dist/index-ttwyrdjs.js.map +0 -11
  188. package/dist/index-tv4yv7d2.js +0 -903
  189. package/dist/index-ty24n0jh.js +0 -167
  190. package/dist/index-ty24n0jh.js.map +0 -19
  191. package/dist/index-v8e92nfw.js +0 -6
  192. package/dist/index-vgc3y3rm.js +0 -6
  193. package/dist/index-whaw4b18.js +0 -6
  194. package/dist/index-whaw4b18.js.map +0 -10
  195. package/dist/web-vkb16r62.js +0 -14
@@ -0,0 +1,90 @@
1
+ #!/usr/bin/env node
2
+ import{wA,ee,j,je,_e,kn,On,Nn,Wo,ht,Zo,Xo,$o,Wn,ei,qe,yt,wt,ti,ze,ni,mt,oi,ii}from"./index-xhzmv4dh.js";import{se,$n,eo,ai,gi,n,a,y,d,s,Le,T,f,qA}from"./index-byxrc961.js";import{readFile as Be}from"node:fs/promises";var Ue=()=>{let t={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function e(c){return t[c]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},h={nan:"NaN"};return(c)=>{switch(c.code){case"invalid_type":{let p=h[c.expected]??c.expected,w=ai(c.input),C=h[w]??w;return`Invalid input: expected ${p}, received ${C}`}case"invalid_value":if(c.values.length===1)return`Invalid input: expected ${eo(c.values[0])}`;return`Invalid option: expected one of ${$n(c.values,"|")}`;case"too_big":{let p=c.inclusive?"<=":"<",w=e(c.origin);if(w)return`Too big: expected ${c.origin??"value"} to have ${p}${c.maximum.toString()} ${w.unit??"elements"}`;return`Too big: expected ${c.origin??"value"} to be ${p}${c.maximum.toString()}`}case"too_small":{let p=c.inclusive?">=":">",w=e(c.origin);if(w)return`Too small: expected ${c.origin} to have ${p}${c.minimum.toString()} ${w.unit}`;return`Too small: expected ${c.origin} to be ${p}${c.minimum.toString()}`}case"invalid_format":{let p=c;if(p.format==="starts_with")return`Invalid string: must start with "${p.prefix}"`;if(p.format==="ends_with")return`Invalid string: must end with "${p.suffix}"`;if(p.format==="includes")return`Invalid string: must include "${p.includes}"`;if(p.format==="regex")return`Invalid string: must match pattern ${p.pattern}`;return`Invalid ${r[p.format]??c.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${c.divisor}`;case"unrecognized_keys":return`Unrecognized key${c.keys.length>1?"s":""}: ${$n(c.keys,", ")}`;case"invalid_key":return`Invalid key in ${c.origin}`;case"invalid_union":if(c.options&&Array.isArray(c.options)&&c.options.length>0)return`Invalid discriminator value. Expected ${c.options.map((w)=>`'${w}'`).join(" | ")}`;return"Invalid input";case"invalid_element":return`Invalid value in ${c.origin}`;default:return"Invalid input"}}};function ne(){return{localeError:Ue()}}se(ne());function qn(t={}){let e=t.now??(()=>new Date),r=new Map;return{approver:(c)=>new Promise((p)=>{let w={pending:{approvalId:c.approvalId,agentId:c.agentId,slug:c.slug,callId:c.callId,match:c.match,mutating:c.mutating,reason:c.reason,requestedAt:e().toISOString()},settle:(C)=>{r.delete(c.approvalId),p(C)}};r.set(c.approvalId,w),c.signal.addEventListener("abort",()=>w.settle(!1),{once:!0})}),pending:(c)=>[...r.values()].map((p)=>p.pending).filter((p)=>p.agentId===c).sort((p,w)=>p.requestedAt.localeCompare(w.requestedAt)),resolve:(c,p)=>{let w=r.get(c);if(w===void 0)return!1;return w.settle(p),!0},get size(){return r.size}}}function k(t,e,r={}){return new Response(JSON.stringify({error:t}),{status:e,headers:{"content-type":"application/json; charset=utf-8",...r}})}function de(){return k({code:"unauthorized",message:"Missing or invalid bearer token.",hint:"Send Authorization: Bearer <token>, where the token is either the value of the variable named by server.tokenEnv or an operator key from POST /v1/keys. A revoked key, an expired one and a wrong one answer the same way on purpose."},401)}function xe(){return k({code:"claim_spent",message:"That claim has already been exchanged.",hint:"A claim is good for one key. Use the key it minted; if it is lost, restart with --claim to print a new one — a claim lives in the process rather than the database, so it never outlives the boot that printed it."},401)}function Fe(t,e){return k({code:"capability_required",message:`This credential cannot ${e}.`,hint:`The key is scoped, and "${t}" is not among its capabilities. GET /v1/keys shows what each key may do; mint another with POST /v1/keys, or use the server token. An unscoped key has all four.`,field:"scope.can"},403)}function fe(t,e){if(t.length!==e.length)return!1;let r=0;for(let h=0;h<t.length;h+=1)r|=t.charCodeAt(h)^e.charCodeAt(h);return r===0}function He(t){let e=t.headers.get("authorization")??"";return e.startsWith("Bearer ")?e.slice(7):""}async function Ke(t){let e=He(t.request);if(t.expected!==void 0&&fe(e,t.expected))return{kind:"token"};if(e!==""){let r=await t.keys.findLive(await On(e),new Date(t.at).toISOString());if(r!==void 0)return await t.keys.touch(r.keyId,new Date(t.at).toISOString()),{kind:"key",keyId:r.keyId,...r.scope===void 0?{}:{scope:r.scope}};if(t.claim!==void 0&&fe(e,t.claim.token)){if(t.request.method!=="POST"||t.pathname!=="/v1/keys")return de();if(!t.claim.live())return xe();return{kind:"claim"}}}return de()}var Ee="dispach.bearer";function Ge(t){let e=t.headers.get("sec-websocket-protocol");if(e===null)return;let r=e.split(",").map((c)=>c.trim()),h=r.indexOf(Ee);return h===-1?void 0:r[h+1]??""}function Ve(t,e){let r=new Headers(t.headers);return r.set("authorization",`Bearer ${e}`),new Request(t.url,{method:t.method,headers:r})}function U(t,e){return t.meta({...e})}function Y(t,e){return t.meta({description:e})}var Qe=s({id:U(n().trim().min(1),{code:"sender_invalid",hint:'Send { "from": { "id": "agent:ops-bot", "kind": "agent" } }, or omit it entirely for a turn the token-holder is sending itself.',description:"Stable identifier for the sender. Appears on the turn row and in events."}),kind:U(f(qe,{error:(t)=>{let e=typeof t.input==="string"?t.input:void 0,r=e===void 0?void 0:wA(e,qe);return`from.kind must be one of: ${qe.join(", ")}.${r===void 0?"":` Did you mean "${r}"?`}`}}),{code:"sender_invalid",hint:'This field decides the trust boundary — "agent" fences the message and blocks mutating tools for the turn, "user" does not — so there is no default and an unknown value is refused rather than guessed at. A turn the token-holder is sending itself omits "from".',description:'The trust boundary. "agent" fences the text as data and blocks mutating tools for the whole turn.'}),name:U(n().optional(),{code:"sender_invalid",hint:"A display name, shown beside the sender id. Omit it rather than sending an empty string.",description:"Human-readable name for the sender."})}).meta({description:"Attribution for a turn somebody other than the token-holder is sending. Omit for your own."}),We=U(Le([qA("none"),s({channel:n().min(1),to:n().min(1)})]),{code:"deliver_invalid",hint:'A bare channel id is not enough on an API turn: the request has no originating conversation, so there is no recipient to infer. Send { "channel": "tg", "to": "12345" }, or "none" to read the reply from the event stream.',description:'Where the reply goes. "none" leaves it on the event stream and in the store.'}),Te=s({text:U(n().trim().min(1),{code:"message_text_required",hint:'Send { "text": "..." }. An empty turn would be billed for a full prompt and produce nothing.',description:"What to say to the agent."}),sessionKey:Y(n().min(1).optional(),"Which conversation this belongs to. Defaults to `api:default`."),deliver:We.optional(),from:Qe.optional(),stream:Y(y().optional(),"Stream the turn's events inline as SSE rather than returning a handle."),chunks:Y(y().optional(),"Include per-token `model.chunk` frames. Off by default — the reader decides.")}),Ce=s({granted:U(y(),{code:"approval_decision_required",hint:'Send { "granted": true } or { "granted": false }. There is no default: one direction would deny a call over a typo and the other would grant one, and neither is a decision anybody made.',description:"Whether the blocked tool call may proceed."})}),Ye=s({agents:d(n().min(1)).optional().meta({code:"key_scope_agents_invalid",hint:'Send { "agents": ["milo"] } — a list of agent ids. Omit it for a key that reaches every agent. An id naming no agent on this server is reported rather than silently matching nothing.',description:"Agent ids this key may reach. Absent means all of them."}),sessions:n().min(1).optional().meta({code:"key_scope_sessions_invalid",hint:'Send { "sessions": "team_42:" } — a session-key prefix, with an optional trailing "*". A prefix rather than a list, because the conversations this key will cover do not exist yet when it is minted.',description:"Session-key prefix. Absent means every session."}),can:d(f(["read","chat","write","admin"])).optional().meta({code:"key_scope_can_invalid",hint:'Send { "can": ["chat", "read"] }. The four are read (every GET), chat (send a message, answer an approval, stop a turn), write (schedules, phase, clearing a session) and admin (keys, provisioning, start/stop/reload). Absent means all four; an empty array means none, and is honoured as written.',description:"Capabilities this key may exercise. Absent means all four."}),expiresIn:a().int().positive().optional().meta({code:"key_scope_expires_invalid",hint:'Send { "expiresIn": 3600 } — whole seconds from now, as a number. Relative rather than an absolute instant, because that would need the caller and this server to agree about the clock; the response reports the absolute expiresAt this server computed.',description:"Seconds until this key stops authenticating. Absent means never."})}),Ne=s({label:U(n(),{code:"key_label_required",hint:'Send { "label": "my browser" }. A label is required rather than defaulted because it is the only thing distinguishing two credentials in a listing, and "key 2" is a name nobody can act on when deciding which to revoke.',description:"How this credential is shown in a listing. Required; see `keyLabelProblem`."}),scope:Ye.optional().meta({code:"key_scope_invalid",hint:'Send { "scope": { "agents": ["milo"], "can": ["chat"] } }, or omit it entirely for a key that reaches everything — which is what every key minted before scopes existed does.',description:"Opt-in narrowing. Absent is an unscoped key."})}),Ae=s({phase:U(n().min(1),{code:"phase_invalid",hint:"Send the name of a phase this agent's manifest declares. `GET /v1/agents/:id` lists them.",description:"The phase to move this session into."})}),Pe=s({reason:U(n().optional(),{code:"agent_stop_invalid",hint:"A short note, recorded on the row and shown wherever the agent is reported as off.",description:"Why, for whoever reads the listing later."})}),Xe=s({path:U(n().min(1),{code:"config_path_unknown",hint:"GET /v1/agents/:id/config lists every field this surface may change, with what each one does.",description:"A dotted path, exactly as it appears in the manifest — `tools.pinned`, `model.main.id`."}),value:U(n(),{code:"config_value_unreadable",hint:'Text, the way it is typed at a terminal: a bare word, a number, true or false, a list as ["a", "b"], or a map as {k: v}. Quote anything containing a colon or a "#".',description:"The new value, as text. Read by the same parser the `config` command uses."}),confirm:Y(y().optional(),"Required only for a field whose own row carries a `confirm` sentence. Absent is not consent.")}),Ze=s({enabled:Y(y().optional(),"Switch the channel on or off. It takes effect at the agent's next start, because a channel is constructed at boot."),credential:U(n().min(1).optional(),{code:"channel_credential_unreadable",hint:"The value goes into the .env beside the manifest at 0600, under the variable that channel's own entry names. Send a non-empty string; an empty one fails the load exactly as a missing variable does.",description:"The channel's credential — a Telegram bot token. Never returned by any route; only whether it is set."})}),Ie=s({answers:U(T(n(),U(n(),{code:"provision_answer_invalid",hint:"Answers arrive as strings from the terminal and from here, and are validated per step. Send the value as a string — including a boolean-looking choice, whose values are named in GET /v1/provision.",description:"One answer. Always text, whatever the step's type looks like."})),{code:"provision_answers_required",hint:'Send { "answers": { "name": "milo", … } }. Every step you leave out takes its default, exactly as `init --yes` does with flags; GET /v1/provision lists them.',description:"A subset of the wizard's steps, as strings. `GET /v1/provision` lists every step with its prompt, default and choices."})});function q(t,e){let r=t.safeParse(e??{});if(r.success)return{ok:!0,value:r.data};let h=r.error.issues[0],c=(h?.path??[]).filter((C)=>typeof C==="string"),p=et(t,c);return{ok:!1,error:{...{code:"request_body_invalid",message:c.length===0?h?.message??"The request body is invalid.":`${c.join(".")}: ${h?.message}`,hint:"The field above is the one to fix. GET /v1/openapi.json describes every body this server accepts, including the error code each field produces."},...p?.code===void 0?{}:{code:p.code},...p?.hint===void 0?{}:{hint:p.hint},...c.length===0?{}:{field:c.join(".")}}}}function et(t,e){let r=t,h=he(t);for(let c of e){if(r=tt(r,c),r===void 0)break;h=he(r)??h}return h}function he(t){let e=t?.meta();if(e?.code===void 0&&e?.hint===void 0)return;return e}function tt(t,e){let r=re(t),h=r?.shape;if(h?.[e]!==void 0)return re(h[e]);let c=r?.def?.valueType;return c===void 0?void 0:re(c)}function re(t){let e=t;for(let r=0;r<8&&e!==void 0;r+=1){let h=e.def?.innerType;if(h===void 0)return e;e=h}return e}var nt={"GET /v1/health":{summary:"Liveness, the version, and how many agents are hosted."},"GET /v1/ready":{summary:"Whether a turn can be served yet.",statuses:[{code:503,when:"still starting; channels may still be connecting"}]},"GET /v1/agents":{summary:"Every agent this server knows about, hosted or switched off."},"GET /v1/agents/:id":{summary:"One agent, with its dialect, window, counts and warnings."},"POST /v1/agents/:id/reload":{summary:"Re-read the manifest by replacing the agent with a new instance.",statuses:[{code:409,when:"a turn is running — it is not aborted to apply a change"},{code:400,when:"a team member, which has no manifest of its own"}]},"GET /v1/provision":{summary:"The questions creating an agent asks, and whether this server can answer them."},"POST /v1/agents":{summary:"Create an agent and adopt it into this host, live.",body:Ie,statuses:[{code:201,when:"created; `adopted` is empty with an `error` if it is not running"},{code:403,when:"not a loopback bind"},{code:501,when:"this server has no provisioner"}]},"POST /v1/agents/:id/stop":{summary:"Switch an agent off durably and drop it from this host now.",body:Pe,statuses:[{code:409,when:"a turn is running"}]},"POST /v1/agents/:id/start":{summary:"Switch it back on and have this host adopt it.",statuses:[{code:501,when:"this server cannot look up manifests"}]},"POST /v1/agents/:id/messages":{summary:"Start a turn. Returns once accepted; the turn runs detached.",body:Te,statuses:[{code:202,when:"accepted"}]},"POST /v1/agents/:id/turns/:turnId/stop":{summary:"Cooperatively stop a turn this API started.",statuses:[{code:409,when:"no cancel handle — a channel or schedule started it"}]},"GET /v1/agents/:id/turns/:turnId/stream":{summary:"One turn's events as SSE, replayed from the start and then live.",query:[{name:"chunks",about:"Include per-token frames. Off by default."},{name:"types",about:"Narrow to these event types, comma-separated."}],statuses:[{code:200,when:"an event stream; see the event table in the wire spec"}]},"GET /v1/events":{summary:"Every event this process emits, as SSE. The firehose.",query:[{name:"agentId",about:"Narrow to one agent."},{name:"sessionKey",about:"Narrow to one conversation."},{name:"chunks",about:"Include per-token frames. Off by default."},{name:"types",about:"Narrow to these event types, comma-separated."}],statuses:[{code:200,when:"an event stream; see the event table in the wire spec"}]},"GET /v1/agents/:id/approvals":{summary:"Questions waiting on a person, oldest first."},"POST /v1/agents/:id/approvals/:approvalId":{summary:"Answer one blocked tool call.",body:Ce},"POST /v1/keys":{summary:"Mint an operator key. The secret is returned once and never again.",body:Ne,statuses:[{code:201,when:"minted"}]},"GET /v1/keys":{summary:"Every key, live and revoked. Never a secret."},"DELETE /v1/keys/:keyId":{summary:"Revoke a key. A soft delete; the row survives."},"GET /v1/agents/:id/turns/:turnId":{summary:"One turn's stored row."},"GET /v1/agents/:id/sessions":{summary:"Conversations, most recently active first."},"GET /v1/agents/:id/sessions/:key":{summary:"One conversation's summary."},"GET /v1/agents/:id/sessions/:key/messages":{summary:"A page of a conversation's messages.",query:[{name:"limit",about:"How many to return."},{name:"before",about:"Page backwards from this message id."}]},"DELETE /v1/agents/:id/sessions/:key":{summary:"Drop a conversation's history, turns and derived index."},"POST /v1/agents/:id/sessions/:key/phase":{summary:"Move a session into a declared phase.",body:Ae},"GET /v1/agents/:id/config":{summary:"Every manifest field this surface may set, what it does, and its current value."},"PATCH /v1/agents/:id/config":{summary:"Set one manifest field, then replace the agent so it takes effect.",statuses:[{code:409,when:"the field carries a confirm sentence and `confirm` was not true"},{code:409,when:"the agent came from an object, so there is no manifest to edit"},{code:400,when:"the path is not settable here, or the result would not validate"}]},"PATCH /v1/agents/:id/channels/:channelId":{summary:"Connect or disconnect a channel, and set its credential.",statuses:[{code:400,when:"neither `enabled` nor `credential` was sent, or the channel is unknown"},{code:409,when:"the agent came from an object, so there is no manifest to edit"},{code:501,when:"the host supplied no channel actions"}]},"POST /v1/agents/:id/channels/:channelId/unpair":{summary:"Forget a channel's stored pairing, so the next start offers a new code.",statuses:[{code:404,when:"this agent has no such channel"},{code:409,when:"the channel stores no pairing — a typed credential is a PATCH"}]},"GET /v1/agents/:id/schedules":{summary:"Every schedule, from the store."},"POST /v1/agents/:id/schedules":{summary:"Create a schedule. Validated by the manifest's own schedule rules.",statuses:[{code:201,when:"created"}]},"GET /v1/agents/:id/schedules/:sid":{summary:"One schedule's row."},"PATCH /v1/agents/:id/schedules/:sid":{summary:"Replace a schedule the API created.",statuses:[{code:409,when:"the manifest declares it, so reconciliation would undo the write"}]},"DELETE /v1/agents/:id/schedules/:sid":{summary:"Delete a schedule the API created.",statuses:[{code:409,when:"the manifest declares it, so the next boot would re-create it"}]},"POST /v1/agents/:id/schedules/:sid/run":{summary:"Fire a schedule now, out of band."},"GET /v1/agents/:id/tools":{summary:"The resolved catalogue, with trust and phases."},"GET /v1/agents/:id/skills":{summary:"What the skills index holds."},"GET /v1/agents/:id/context":{summary:"The prompt the next turn would be given, without running one.",query:[{name:"sessionKey",about:"Which conversation to assemble for."},{name:"input",about:"Pretend this is the next message."}]},"POST /v1/channels/:channelId/webhook/:agentId":{summary:"A channel provider's webhook. Open by design; the provider authenticates itself."},"GET /v1/openapi.json":{summary:"This document."},"GET /docs":{summary:"A browser reference over this document."}};function rt(t){return t.startsWith("/v1/")||t==="/docs"}function at(t){let e={};for(let r of t.routes){if(!rt(r.pattern))continue;let h=nt[`${r.method} ${r.pattern}`];if(h===void 0)continue;let c=r.pattern.replace(/:([A-Za-z0-9_]+)/g,"{$1}"),p=[...r.pattern.matchAll(/:([A-Za-z0-9_]+)/g)].map((A)=>({name:A[1],in:"path",required:!0,schema:{type:"string"}})),w=(h.query??[]).map((A)=>({name:A.name,in:"query",required:!1,description:A.about,schema:{type:"string"}})),C={};for(let A of h.statuses??[])C[String(A.code)]={description:A.when};if(C["200"]===void 0&&C["201"]===void 0){if(C["202"]===void 0)C["200"]={description:"OK"}}if(C["401"]={description:"No credential, or one this server does not accept."},r.pattern.includes(":id"))C["404"]={description:"No such agent, or it is switched off."};e[c]??={};let L={summary:h.summary,...p.length+w.length===0?{}:{parameters:[...p,...w]},responses:C};if(h.body!==void 0)L.requestBody={required:!0,content:{"application/json":{schema:gi(h.body,{target:"draft-2020-12",io:"input"})}}};e[c][r.method.toLowerCase()]=L}return{openapi:"3.1.0",info:{title:"Dispach agent server",version:je,description:"Generated from the router table and the request schemas — see openapi.ts. The binding contract is docs/04-SPEC-WIRE.md, which is checked against the code; @dispach/client's types are the response reference."},...t.serverUrl===void 0?{}:{servers:[{url:t.serverUrl}]},components:{securitySchemes:{bearer:{type:"http",scheme:"bearer",description:"An operator key or the configured token."}},schemas:{Error:{type:"object",description:"Every failure has this shape. `hint` is never absent — it is the part that says what to do.",properties:{error:{type:"object",required:["code","message","hint"],properties:{code:{type:"string"},message:{type:"string"},hint:{type:"string"},field:{type:"string"}}}}}}},security:[{bearer:[]}],paths:e}}var it=new Set(["127.0.0.1","::1","localhost","[::1]"]);function X(t){return it.has(t.toLowerCase())}function Q(t){let e=t.trim();if(e===""||e.toLowerCase()==="null")return;try{return new URL(e.includes("://")?e:`http://${e}`).hostname.toLowerCase().replace(/^\[|\]$/g,"")}catch{return}}function pe(t){return X(t)||/^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(t)}function Z(t,e){let r=X(e.host),h=t.headers.get("host"),c=t.headers.get("origin");if(r){let w=h===null?void 0:Q(h),C=e.allowedHosts??[];if(!(w!==void 0&&(pe(w)||C.some((A)=>Q(A)===w))))return{code:"host_not_allowed",message:`This server does not answer to the host ${h??"(absent)"}.`,hint:"It is bound to loopback, so only a loopback name or address can legitimately reach it — a request addressed to any other name arrived through DNS pointed at this machine, which is how a web page reaches a local server it was never given access to. Add the name to server.allowedHosts if a proxy on this machine needs it.",field:"server.allowedHosts"}}if(c===null)return;let p=Q(c);if(p!==void 0){if(pe(p))return;if((e.allowedOrigins??[]).some((w)=>Q(w)===p))return;if(!r&&h!==null&&Q(h)===p)return}return{code:"origin_not_allowed",message:`Refusing a request from the origin ${c}.`,hint:r?"This server is bound to loopback, so a page served from anywhere else has no business calling it. Add the origin to server.allowedOrigins if you meant to allow it.":"Only a page served from this server's own host may call it. Add the origin to server.allowedOrigins if you meant to allow it — there is no wildcard, deliberately.",field:"server.allowedOrigins"}}function lt(t,e){let r=t.headers.get("origin");if(r===null)return{};if(Z(t,e)!==void 0)return{};return{"access-control-allow-origin":r,vary:"Origin"}}function ot(t,e){let r=t.headers.get("access-control-request-headers");return{"access-control-allow-methods":e.join(", "),"access-control-allow-headers":r??"authorization, content-type","access-control-max-age":"600"}}function me(t,e){if(t.kind!=="key")return t.kind!=="claim";let r=t.scope?.can;return r===void 0||r.includes(e)}function V(t,e){if(t.kind!=="key")return t.kind!=="claim";let r=t.scope?.agents;return r===void 0||r.includes(e)}function te(t,e){if(t.kind!=="key")return t.kind!=="claim";let r=t.scope?.sessions;if(r===void 0)return!0;return e.startsWith(r.endsWith("*")?r.slice(0,-1):r)}function Oe(t){if(t.kind!=="key")return!1;let e=t.scope;return e!==void 0&&(e.agents!==void 0||e.sessions!==void 0||e.can!==void 0)}class Re{#e=[];add(t,e,r,h){return this.#e.push({method:t.toUpperCase(),pattern:e,handler:r,capability:h.capability,streaming:h.streaming===!0,segments:ge(e)}),this}routes(){return this.#e.map(({method:t,pattern:e,handler:r,streaming:h,capability:c})=>({method:t,pattern:e,handler:r,streaming:h,capability:c}))}match(t,e){let r=ge(e),h=[];for(let c of this.#e){let p=st(c.segments,r);if(p===void 0)continue;if(h.push(c),c.method===t.toUpperCase())return{kind:"found",handler:c.handler,params:p,streaming:c.streaming,capability:c.capability}}if(h.length>0)return{kind:"method",allowed:[...new Set(h.map((c)=>c.method))]};return{kind:"none"}}}function ge(t){return t.split("/").filter((e)=>e!=="")}function st(t,e){if(t.length!==e.length)return;let r={};for(let[h,c]of t.entries()){let p=e[h];if(p===void 0)return;if(c.startsWith(":")){try{r[c.slice(1)]=decodeURIComponent(p)}catch{return}continue}if(c!==p)return}return r}var Me=15000;function ut(t){let e=[];if(t.event!==void 0)e.push(`event: ${t.event}`);if(t.id!==void 0)e.push(`id: ${t.id}`);let r=typeof t.data==="string"?t.data:JSON.stringify(t.data);for(let h of r.split(`
3
+ `))e.push(`data: ${h}`);return`${e.join(`
4
+ `)}
5
+
6
+ `}function ue(t){let e=new TextEncoder,r,h,c=!1,p=new ReadableStream({start(w){let C=()=>{if(c)return;if(c=!0,h!==void 0)clearInterval(h);r?.(),r=void 0;try{w.close()}catch{}},L=(S)=>{if(c)return;try{w.enqueue(e.encode(ut(S)))}catch{C()}};t.signal?.addEventListener("abort",C,{once:!0});let A=t.start({send:L,close:C});if(c){A?.();return}r=A,h=setInterval(()=>{if(c)return;try{w.enqueue(e.encode(`: ping
7
+
8
+ `))}catch{C()}},t.heartbeatMs??Me),h.unref?.()},cancel(){if(c)return;if(c=!0,h!==void 0)clearInterval(h);r?.(),r=void 0}});return new Response(p,{status:t.status??200,headers:{"content-type":"text/event-stream; charset=utf-8","cache-control":"no-cache, no-transform",connection:"keep-alive","x-accel-buffering":"no"}})}var ct=':root{--ground: #0b0b0c;--raised: #151517;--line: #26262a;--text: #e8e6e3;--dim: #8b8b93;--accent: #7aa2f7;--warn: #e0af68;--bad: #f7768e;--ok: #9ece6a;--mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;--sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif}*{box-sizing:border-box}body{margin:0;background:var(--ground);color:var(--text);font:14px / 1.55 var(--sans);-webkit-font-smoothing:antialiased}button{font:inherit;color:inherit;background:var(--raised);border:1px solid var(--line);border-radius:6px;padding:5px 11px;cursor:pointer}button:hover:not(:disabled){border-color:var(--dim)}button:disabled{opacity:.45;cursor:default}button.primary{background:var(--accent);border-color:var(--accent);color:#0b0b0c;font-weight:600}button.bad{color:var(--bad)}input,textarea{font:inherit;color:inherit;background:var(--ground);border:1px solid var(--line);border-radius:6px;padding:8px 10px;width:100%}input:focus,textarea:focus{outline:none;border-color:var(--accent)}.shell{display:grid;grid-template-columns:240px 1fr;height:100vh}.side{background:var(--raised);border-right:1px solid var(--line);display:flex;flex-direction:column;min-height:0}.side header{padding:14px 16px;border-bottom:1px solid var(--line)}.brand{font-weight:650;letter-spacing:.01em}.side nav{padding:8px;overflow-y:auto;flex:1;min-height:0}.side footer{padding:10px 12px;border-top:1px solid var(--line);display:flex;gap:8px;align-items:center}.row-button{display:block;width:100%;text-align:left;background:none;border:none;border-radius:6px;padding:7px 9px;font-family:var(--mono);font-size:12px}.row-button:hover{background:var(--ground)}.row-button[aria-current=true]{background:var(--ground);color:var(--accent)}.group{font-size:11px;text-transform:uppercase;letter-spacing:.08em;color:var(--dim);padding:12px 9px 5px}.main{display:flex;flex-direction:column;min-height:0}.bar{display:flex;gap:14px;align-items:baseline;padding:12px 20px;border-bottom:1px solid var(--line);font-size:12px;color:var(--dim);min-height:44px}.bar strong{color:var(--text);font-size:14px;font-weight:600}.bar .spacer{flex:1}.scroll{flex:1;overflow-y:auto;min-height:0;padding:20px}.pad{max-width:780px;margin:0 auto}.row{margin:0 0 16px;white-space:pre-wrap;overflow-wrap:anywhere}.row.user{background:var(--raised);border:1px solid var(--line);border-radius:8px;padding:10px 13px}.label{font-family:var(--mono);font-size:11px;color:var(--dim);margin-bottom:4px}.tool{border-left:2px solid var(--line);padding-left:11px;font-family:var(--mono);font-size:12px}.tool .slug{color:var(--accent)}.tool .out{color:var(--dim);max-height:13em;overflow-y:auto;margin-top:5px}.tool.failed .slug{color:var(--bad)}.tool .mut{color:var(--warn);font-size:11px}.tool .out{display:inline}.fence{border:1px dashed var(--warn);border-radius:6px;padding:7px 9px;margin-top:5px}.fence .why{color:var(--warn);font-size:11px;margin-bottom:4px}.payload-code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:28px;font-weight:600;letter-spacing:.18em;margin:10px 0;-webkit-user-select:all;user-select:all}.channel-input.stale .payload-code{opacity:.35}.payload-qr{display:block;width:240px;max-width:100%;height:auto;border-radius:6px;margin:8px 0}.channel-input.stale .payload-qr{opacity:.35}.note{font-size:12px;color:var(--dim);border-left:2px solid var(--line);padding-left:11px;white-space:pre-wrap}.note.bad{color:var(--bad);border-left-color:var(--bad)}.ask{border:1px solid var(--warn);border-radius:8px;padding:12px 14px;background:#17140e}.ask .what{font-family:var(--mono);font-size:12px;margin:6px 0 10px;white-space:pre-wrap;overflow-wrap:anywhere}.ask .buttons{display:flex;gap:8px}.ask .settled{font-size:12px;color:var(--dim)}details.fold summary{cursor:pointer;color:var(--dim);font-family:var(--mono);font-size:11px}details.fold[open] summary{margin-bottom:5px}details.fold .body{color:var(--dim);font-size:13px}.composer{border-top:1px solid var(--line);padding:12px 20px}.composer .inner{max-width:780px;margin:0 auto;display:flex;gap:9px;align-items:flex-end}.composer textarea{resize:none;min-height:40px;max-height:190px;font-family:var(--sans)}.hint{font-size:11px;color:var(--dim);max-width:780px;margin:6px auto 0}.card{border:1px solid var(--line);border-radius:8px;padding:16px 18px;margin-bottom:14px;background:var(--raised)}.card h2{margin:0 0 4px;font-size:15px}.card p{margin:0 0 12px;color:var(--dim);font-size:13px}table{width:100%;border-collapse:collapse;font-size:13px}th{text-align:left;font-size:11px;text-transform:uppercase;letter-spacing:.07em;color:var(--dim);font-weight:500;padding:0 10px 7px 0}td{padding:8px 10px 8px 0;border-top:1px solid var(--line);font-family:var(--mono);font-size:12px}td.revoked{color:var(--dim);text-decoration:line-through}.secret{font-family:var(--mono);font-size:12px;background:var(--ground);border:1px solid var(--ok);border-radius:6px;padding:9px 11px;overflow-wrap:anywhere;margin-bottom:8px}.gate{display:grid;place-items:center;height:100vh;padding:20px}.gate .card{max-width:460px;width:100%}.dot{width:7px;height:7px;border-radius:50%;display:inline-block;background:var(--dim)}.dot.live{background:var(--ok)}.dot.busy{background:var(--warn)}@media(max-width:720px){.shell{grid-template-columns:1fr}.side{display:none}}.agent-row{display:block}.agent-row .row-button:disabled{color:var(--dim);cursor:default}.agent-off{color:var(--warn);font-size:11px}.agent-note{display:flex;gap:6px;align-items:baseline;padding:0 9px 6px;font-size:11px;color:var(--dim)}.link{background:none;border:none;padding:0;color:var(--accent);font-size:11px;text-decoration:underline;cursor:pointer}.link:disabled{color:var(--dim);cursor:default;text-decoration:none}.empty{color:var(--dim);font-size:13px;max-width:60ch}.panel-table{width:100%;border-collapse:collapse;font-size:12px}.panel-table th{text-align:left;font-weight:500;font-size:11px;text-transform:uppercase;letter-spacing:.06em;color:var(--dim);padding:6px 10px 6px 0;border-bottom:1px solid var(--line)}.panel-table td{padding:9px 10px 9px 0;border-bottom:1px solid var(--line);vertical-align:top}.panel-table tr.off td{color:var(--dim)}.sub{color:var(--dim);font-size:11px;margin-top:2px;max-width:52ch}.channel{border:1px solid var(--line);border-radius:8px;padding:12px 14px;margin-bottom:12px}.channel h3{margin:0 0 6px;font-size:13px;font-weight:500}.status{margin:0;font-size:12px}.status-connected{color:var(--ok)}.status-error,.status-disconnected{color:var(--bad)}.status-needs_input{color:var(--warn)}.channel-input{margin-top:10px;padding:10px;border-radius:6px;background:var(--ground)}.payload{margin:0;font-family:var(--mono);font-size:11px;white-space:pre-wrap;word-break:break-all;max-height:9em;overflow-y:auto}.channel-input.stale .payload{opacity:.45}.warn{color:var(--warn);font-size:12px;margin:0 0 6px}select{font:inherit;color:inherit;background:var(--ground);border:1px solid var(--line);border-radius:6px;padding:8px 10px;width:100%}select:focus{outline:none;border-color:var(--accent)}.provision{display:flex;flex-direction:column;gap:16px;max-width:60ch}.provision>button[type=submit]{align-self:flex-start}.field label{display:block;font-size:12px;color:var(--dim);margin-bottom:5px}.field.invalid input,.field.invalid select{border-color:var(--bad)}.sub{color:var(--dim);font-size:11px}.error{color:var(--bad);font-size:13px;max-width:60ch}.ok{color:var(--ok);font-size:13px}.created{max-width:66ch;font-size:13px}.created h3{font-size:15px;font-weight:600;margin:0 0 10px}.created p{margin:0 0 10px}.blank-secrets{border:1px solid var(--warn);border-radius:6px;padding:11px 13px;margin:14px 0}.blank-secrets p{margin:0 0 6px}.blank-secrets p:last-child{margin:0}.config-row{border-bottom:1px solid var(--line);padding:14px 0;max-width:72ch}.config-row:first-of-type{padding-top:0}.config-head{display:flex;align-items:baseline;gap:8px}.config-row .sub{margin:4px 0 8px;max-width:68ch}.config-row input[type=text],.config-row input:not([type]),.config-row textarea{width:100%;font-family:var(--mono);font-size:12px}.config-row button{margin-top:8px}.config-row label input[type=checkbox]{width:auto;margin-right:4px;vertical-align:baseline}.form-grid{display:grid;grid-template-columns:6em 1fr;gap:8px 12px;align-items:start;max-width:60ch}.form-grid label{font-size:12px;color:var(--dim);padding-top:9px}.form-grid input,.form-grid select{width:100%}.form-grid>div>input+input{margin-top:6px}.warnings{border:1px solid var(--warn);border-radius:6px;padding:.75rem 1rem;margin-bottom:1rem}.warnings h3{margin:0;color:var(--warn)}.warnings .sub{margin:.25rem 0 .75rem;opacity:.8}.warning{margin-top:.5rem}.warning-message{margin:0}.warning .hint{margin:.15rem 0 0;opacity:.75}.channel-actions{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center;margin-top:.5rem}.channel-actions form{display:flex;gap:.35rem}.channel-actions input{min-width:14rem}.status-off{opacity:.7}\n',dt=`(function(){const f=document.createElement("link").relList;if(f&&f.supports&&f.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))c(d);new MutationObserver(d=>{for(const h of d)if(h.type==="childList")for(const v of h.addedNodes)v.tagName==="LINK"&&v.rel==="modulepreload"&&c(v)}).observe(document,{childList:!0,subtree:!0});function r(d){const h={};return d.integrity&&(h.integrity=d.integrity),d.referrerPolicy&&(h.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?h.credentials="include":d.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function c(d){if(d.ep)return;d.ep=!0;const h=r(d);fetch(d.href,h)}})();function Yg(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Uf={exports:{}},Za={};var bh;function Lg(){if(bh)return Za;bh=1;var i=Symbol.for("react.transitional.element"),f=Symbol.for("react.fragment");function r(c,d,h){var v=null;if(h!==void 0&&(v=""+h),d.key!==void 0&&(v=""+d.key),"key"in d){h={};for(var A in d)A!=="key"&&(h[A]=d[A])}else h=d;return d=h.ref,{$$typeof:i,type:c,key:v,ref:d!==void 0?d:null,props:h}}return Za.Fragment=f,Za.jsx=r,Za.jsxs=r,Za}var Sh;function Gg(){return Sh||(Sh=1,Uf.exports=Lg()),Uf.exports}var m=Gg(),Of={exports:{}},oe={};var ph;function Qg(){if(ph)return oe;ph=1;var i=Symbol.for("react.transitional.element"),f=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),h=Symbol.for("react.consumer"),v=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),E=Symbol.for("react.activity"),x=Symbol.iterator;function H(b){return b===null||typeof b!="object"?null:(b=x&&b[x]||b["@@iterator"],typeof b=="function"?b:null)}var X={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},D=Object.assign,se={};function L(b,R,Q){this.props=b,this.context=R,this.refs=se,this.updater=Q||X}L.prototype.isReactComponent={},L.prototype.setState=function(b,R){if(typeof b!="object"&&typeof b!="function"&&b!=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,b,R,"setState")},L.prototype.forceUpdate=function(b){this.updater.enqueueForceUpdate(this,b,"forceUpdate")};function ce(){}ce.prototype=L.prototype;function I(b,R,Q){this.props=b,this.context=R,this.refs=se,this.updater=Q||X}var $=I.prototype=new ce;$.constructor=I,D($,L.prototype),$.isPureReactComponent=!0;var Ae=Array.isArray;function Z(){}var Y={H:null,A:null,T:null,S:null},K=Object.prototype.hasOwnProperty;function V(b,R,Q){var W=Q.ref;return{$$typeof:i,type:b,key:R,ref:W!==void 0?W:null,props:Q}}function ne(b,R){return V(b.type,R,b.props)}function q(b){return typeof b=="object"&&b!==null&&b.$$typeof===i}function F(b){var R={"=":"=0",":":"=2"};return"$"+b.replace(/[=:]/g,function(Q){return R[Q]})}var ee=/\\/+/g;function ue(b,R){return typeof b=="object"&&b!==null&&b.key!=null?F(""+b.key):R.toString(36)}function Ye(b){switch(b.status){case"fulfilled":return b.value;case"rejected":throw b.reason;default:switch(typeof b.status=="string"?b.then(Z,Z):(b.status="pending",b.then(function(R){b.status==="pending"&&(b.status="fulfilled",b.value=R)},function(R){b.status==="pending"&&(b.status="rejected",b.reason=R)})),b.status){case"fulfilled":return b.value;case"rejected":throw b.reason}}throw b}function M(b,R,Q,W,fe){var re=typeof b;(re==="undefined"||re==="boolean")&&(b=null);var de=!1;if(b===null)de=!0;else switch(re){case"bigint":case"string":case"number":de=!0;break;case"object":switch(b.$$typeof){case i:case f:de=!0;break;case j:return de=b._init,M(de(b._payload),R,Q,W,fe)}}if(de)return fe=fe(b),de=W===""?"."+ue(b,0):W,Ae(fe)?(Q="",de!=null&&(Q=de.replace(ee,"$&/")+"/"),M(fe,R,Q,"",function(nt){return nt})):fe!=null&&(q(fe)&&(fe=ne(fe,Q+(fe.key==null||b&&b.key===fe.key?"":(""+fe.key).replace(ee,"$&/")+"/")+de)),R.push(fe)),1;de=0;var Me=W===""?".":W+":";if(Ae(b))for(var Ne=0;Ne<b.length;Ne++)W=b[Ne],re=Me+ue(W,Ne),de+=M(W,R,Q,re,fe);else if(Ne=H(b),typeof Ne=="function")for(b=Ne.call(b),Ne=0;!(W=b.next()).done;)W=W.value,re=Me+ue(W,Ne++),de+=M(W,R,Q,re,fe);else if(re==="object"){if(typeof b.then=="function")return M(Ye(b),R,Q,W,fe);throw R=String(b),Error("Objects are not valid as a React child (found: "+(R==="[object Object]"?"object with keys {"+Object.keys(b).join(", ")+"}":R)+"). If you meant to render a collection of children, use an array instead.")}return de}function G(b,R,Q){if(b==null)return b;var W=[],fe=0;return M(b,W,"","",function(re){return R.call(Q,re,fe++)}),W}function ae(b){if(b._status===-1){var R=b._result;R=R(),R.then(function(Q){(b._status===0||b._status===-1)&&(b._status=1,b._result=Q)},function(Q){(b._status===0||b._status===-1)&&(b._status=2,b._result=Q)}),b._status===-1&&(b._status=0,b._result=R)}if(b._status===1)return b._result.default;throw b._result}var Te=typeof reportError=="function"?reportError:function(b){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var R=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof b=="object"&&b!==null&&typeof b.message=="string"?String(b.message):String(b),error:b});if(!window.dispatchEvent(R))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",b);return}console.error(b)},be={map:G,forEach:function(b,R,Q){G(b,function(){R.apply(this,arguments)},Q)},count:function(b){var R=0;return G(b,function(){R++}),R},toArray:function(b){return G(b,function(R){return R})||[]},only:function(b){if(!q(b))throw Error("React.Children.only expected to receive a single React element child.");return b}};return oe.Activity=E,oe.Children=be,oe.Component=L,oe.Fragment=r,oe.Profiler=d,oe.PureComponent=I,oe.StrictMode=c,oe.Suspense=p,oe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Y,oe.__COMPILER_RUNTIME={__proto__:null,c:function(b){return Y.H.useMemoCache(b)}},oe.cache=function(b){return function(){return b.apply(null,arguments)}},oe.cacheSignal=function(){return null},oe.cloneElement=function(b,R,Q){if(b==null)throw Error("The argument must be a React element, but you passed "+b+".");var W=D({},b.props),fe=b.key;if(R!=null)for(re in R.key!==void 0&&(fe=""+R.key),R)!K.call(R,re)||re==="key"||re==="__self"||re==="__source"||re==="ref"&&R.ref===void 0||(W[re]=R[re]);var re=arguments.length-2;if(re===1)W.children=Q;else if(1<re){for(var de=Array(re),Me=0;Me<re;Me++)de[Me]=arguments[Me+2];W.children=de}return V(b.type,fe,W)},oe.createContext=function(b){return b={$$typeof:v,_currentValue:b,_currentValue2:b,_threadCount:0,Provider:null,Consumer:null},b.Provider=b,b.Consumer={$$typeof:h,_context:b},b},oe.createElement=function(b,R,Q){var W,fe={},re=null;if(R!=null)for(W in R.key!==void 0&&(re=""+R.key),R)K.call(R,W)&&W!=="key"&&W!=="__self"&&W!=="__source"&&(fe[W]=R[W]);var de=arguments.length-2;if(de===1)fe.children=Q;else if(1<de){for(var Me=Array(de),Ne=0;Ne<de;Ne++)Me[Ne]=arguments[Ne+2];fe.children=Me}if(b&&b.defaultProps)for(W in de=b.defaultProps,de)fe[W]===void 0&&(fe[W]=de[W]);return V(b,re,fe)},oe.createRef=function(){return{current:null}},oe.forwardRef=function(b){return{$$typeof:A,render:b}},oe.isValidElement=q,oe.lazy=function(b){return{$$typeof:j,_payload:{_status:-1,_result:b},_init:ae}},oe.memo=function(b,R){return{$$typeof:y,type:b,compare:R===void 0?null:R}},oe.startTransition=function(b){var R=Y.T,Q={};Y.T=Q;try{var W=b(),fe=Y.S;fe!==null&&fe(Q,W),typeof W=="object"&&W!==null&&typeof W.then=="function"&&W.then(Z,Te)}catch(re){Te(re)}finally{R!==null&&Q.types!==null&&(R.types=Q.types),Y.T=R}},oe.unstable_useCacheRefresh=function(){return Y.H.useCacheRefresh()},oe.use=function(b){return Y.H.use(b)},oe.useActionState=function(b,R,Q){return Y.H.useActionState(b,R,Q)},oe.useCallback=function(b,R){return Y.H.useCallback(b,R)},oe.useContext=function(b){return Y.H.useContext(b)},oe.useDebugValue=function(){},oe.useDeferredValue=function(b,R){return Y.H.useDeferredValue(b,R)},oe.useEffect=function(b,R){return Y.H.useEffect(b,R)},oe.useEffectEvent=function(b){return Y.H.useEffectEvent(b)},oe.useId=function(){return Y.H.useId()},oe.useImperativeHandle=function(b,R,Q){return Y.H.useImperativeHandle(b,R,Q)},oe.useInsertionEffect=function(b,R){return Y.H.useInsertionEffect(b,R)},oe.useLayoutEffect=function(b,R){return Y.H.useLayoutEffect(b,R)},oe.useMemo=function(b,R){return Y.H.useMemo(b,R)},oe.useOptimistic=function(b,R){return Y.H.useOptimistic(b,R)},oe.useReducer=function(b,R,Q){return Y.H.useReducer(b,R,Q)},oe.useRef=function(b){return Y.H.useRef(b)},oe.useState=function(b){return Y.H.useState(b)},oe.useSyncExternalStore=function(b,R,Q){return Y.H.useSyncExternalStore(b,R,Q)},oe.useTransition=function(){return Y.H.useTransition()},oe.version="19.2.8",oe}var Eh;function ys(){return Eh||(Eh=1,Of.exports=Qg()),Of.exports}var J=ys(),Df={exports:{}},Va={},Bf={exports:{}},Hf={};var Th;function Xg(){return Th||(Th=1,(function(i){function f(M,G){var ae=M.length;M.push(G);e:for(;0<ae;){var Te=ae-1>>>1,be=M[Te];if(0<d(be,G))M[Te]=G,M[ae]=be,ae=Te;else break e}}function r(M){return M.length===0?null:M[0]}function c(M){if(M.length===0)return null;var G=M[0],ae=M.pop();if(ae!==G){M[0]=ae;e:for(var Te=0,be=M.length,b=be>>>1;Te<b;){var R=2*(Te+1)-1,Q=M[R],W=R+1,fe=M[W];if(0>d(Q,ae))W<be&&0>d(fe,Q)?(M[Te]=fe,M[W]=ae,Te=W):(M[Te]=Q,M[R]=ae,Te=R);else if(W<be&&0>d(fe,ae))M[Te]=fe,M[W]=ae,Te=W;else break e}}return G}function d(M,G){var ae=M.sortIndex-G.sortIndex;return ae!==0?ae:M.id-G.id}if(i.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var h=performance;i.unstable_now=function(){return h.now()}}else{var v=Date,A=v.now();i.unstable_now=function(){return v.now()-A}}var p=[],y=[],j=1,E=null,x=3,H=!1,X=!1,D=!1,se=!1,L=typeof setTimeout=="function"?setTimeout:null,ce=typeof clearTimeout=="function"?clearTimeout:null,I=typeof setImmediate<"u"?setImmediate:null;function $(M){for(var G=r(y);G!==null;){if(G.callback===null)c(y);else if(G.startTime<=M)c(y),G.sortIndex=G.expirationTime,f(p,G);else break;G=r(y)}}function Ae(M){if(D=!1,$(M),!X)if(r(p)!==null)X=!0,Z||(Z=!0,F());else{var G=r(y);G!==null&&Ye(Ae,G.startTime-M)}}var Z=!1,Y=-1,K=5,V=-1;function ne(){return se?!0:!(i.unstable_now()-V<K)}function q(){if(se=!1,Z){var M=i.unstable_now();V=M;var G=!0;try{e:{X=!1,D&&(D=!1,ce(Y),Y=-1),H=!0;var ae=x;try{t:{for($(M),E=r(p);E!==null&&!(E.expirationTime>M&&ne());){var Te=E.callback;if(typeof Te=="function"){E.callback=null,x=E.priorityLevel;var be=Te(E.expirationTime<=M);if(M=i.unstable_now(),typeof be=="function"){E.callback=be,$(M),G=!0;break t}E===r(p)&&c(p),$(M)}else c(p);E=r(p)}if(E!==null)G=!0;else{var b=r(y);b!==null&&Ye(Ae,b.startTime-M),G=!1}}break e}finally{E=null,x=ae,H=!1}G=void 0}}finally{G?F():Z=!1}}}var F;if(typeof I=="function")F=function(){I(q)};else if(typeof MessageChannel<"u"){var ee=new MessageChannel,ue=ee.port2;ee.port1.onmessage=q,F=function(){ue.postMessage(null)}}else F=function(){L(q,0)};function Ye(M,G){Y=L(function(){M(i.unstable_now())},G)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(M){M.callback=null},i.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):K=0<M?Math.floor(1e3/M):5},i.unstable_getCurrentPriorityLevel=function(){return x},i.unstable_next=function(M){switch(x){case 1:case 2:case 3:var G=3;break;default:G=x}var ae=x;x=G;try{return M()}finally{x=ae}},i.unstable_requestPaint=function(){se=!0},i.unstable_runWithPriority=function(M,G){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var ae=x;x=M;try{return G()}finally{x=ae}},i.unstable_scheduleCallback=function(M,G,ae){var Te=i.unstable_now();switch(typeof ae=="object"&&ae!==null?(ae=ae.delay,ae=typeof ae=="number"&&0<ae?Te+ae:Te):ae=Te,M){case 1:var be=-1;break;case 2:be=250;break;case 5:be=1073741823;break;case 4:be=1e4;break;default:be=5e3}return be=ae+be,M={id:j++,callback:G,priorityLevel:M,startTime:ae,expirationTime:be,sortIndex:-1},ae>Te?(M.sortIndex=ae,f(y,M),r(p)===null&&M===r(y)&&(D?(ce(Y),Y=-1):D=!0,Ye(Ae,ae-Te))):(M.sortIndex=be,f(p,M),X||H||(X=!0,Z||(Z=!0,F()))),M},i.unstable_shouldYield=ne,i.unstable_wrapCallback=function(M){var G=x;return function(){var ae=x;x=G;try{return M.apply(this,arguments)}finally{x=ae}}}})(Hf)),Hf}var Ah;function Kg(){return Ah||(Ah=1,Bf.exports=Xg()),Bf.exports}var qf={exports:{}},at={};var zh;function Zg(){if(zh)return at;zh=1;var i=ys();function f(p){var y="https://react.dev/errors/"+p;if(1<arguments.length){y+="?args[]="+encodeURIComponent(arguments[1]);for(var j=2;j<arguments.length;j++)y+="&args[]="+encodeURIComponent(arguments[j])}return"Minified React error #"+p+"; visit "+y+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var c={d:{f:r,r:function(){throw Error(f(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},d=Symbol.for("react.portal");function h(p,y,j){var E=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:E==null?null:""+E,children:p,containerInfo:y,implementation:j}}var v=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function A(p,y){if(p==="font")return"";if(typeof y=="string")return y==="use-credentials"?y:""}return at.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c,at.createPortal=function(p,y){var j=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!y||y.nodeType!==1&&y.nodeType!==9&&y.nodeType!==11)throw Error(f(299));return h(p,y,null,j)},at.flushSync=function(p){var y=v.T,j=c.p;try{if(v.T=null,c.p=2,p)return p()}finally{v.T=y,c.p=j,c.d.f()}},at.preconnect=function(p,y){typeof p=="string"&&(y?(y=y.crossOrigin,y=typeof y=="string"?y==="use-credentials"?y:"":void 0):y=null,c.d.C(p,y))},at.prefetchDNS=function(p){typeof p=="string"&&c.d.D(p)},at.preinit=function(p,y){if(typeof p=="string"&&y&&typeof y.as=="string"){var j=y.as,E=A(j,y.crossOrigin),x=typeof y.integrity=="string"?y.integrity:void 0,H=typeof y.fetchPriority=="string"?y.fetchPriority:void 0;j==="style"?c.d.S(p,typeof y.precedence=="string"?y.precedence:void 0,{crossOrigin:E,integrity:x,fetchPriority:H}):j==="script"&&c.d.X(p,{crossOrigin:E,integrity:x,fetchPriority:H,nonce:typeof y.nonce=="string"?y.nonce:void 0})}},at.preinitModule=function(p,y){if(typeof p=="string")if(typeof y=="object"&&y!==null){if(y.as==null||y.as==="script"){var j=A(y.as,y.crossOrigin);c.d.M(p,{crossOrigin:j,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0})}}else y==null&&c.d.M(p)},at.preload=function(p,y){if(typeof p=="string"&&typeof y=="object"&&y!==null&&typeof y.as=="string"){var j=y.as,E=A(j,y.crossOrigin);c.d.L(p,j,{crossOrigin:E,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0,type:typeof y.type=="string"?y.type:void 0,fetchPriority:typeof y.fetchPriority=="string"?y.fetchPriority:void 0,referrerPolicy:typeof y.referrerPolicy=="string"?y.referrerPolicy:void 0,imageSrcSet:typeof y.imageSrcSet=="string"?y.imageSrcSet:void 0,imageSizes:typeof y.imageSizes=="string"?y.imageSizes:void 0,media:typeof y.media=="string"?y.media:void 0})}},at.preloadModule=function(p,y){if(typeof p=="string")if(y){var j=A(y.as,y.crossOrigin);c.d.m(p,{as:typeof y.as=="string"&&y.as!=="script"?y.as:void 0,crossOrigin:j,integrity:typeof y.integrity=="string"?y.integrity:void 0})}else c.d.m(p)},at.requestFormReset=function(p){c.d.r(p)},at.unstable_batchedUpdates=function(p,y){return p(y)},at.useFormState=function(p,y,j){return v.H.useFormState(p,y,j)},at.useFormStatus=function(){return v.H.useHostTransitionStatus()},at.version="19.2.8",at}var Ch;function Vg(){if(Ch)return qf.exports;Ch=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(f){console.error(f)}}return i(),qf.exports=Zg(),qf.exports}var Nh;function Jg(){if(Nh)return Va;Nh=1;var i=Kg(),f=ys(),r=Vg();function c(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 d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function h(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function v(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 A(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 p(e){if(h(e)!==e)throw Error(c(188))}function y(e){var t=e.alternate;if(!t){if(t=h(e),t===null)throw Error(c(188));return t!==e?null:e}for(var n=e,l=t;;){var a=n.return;if(a===null)break;var u=a.alternate;if(u===null){if(l=a.return,l!==null){n=l;continue}break}if(a.child===u.child){for(u=a.child;u;){if(u===n)return p(a),e;if(u===l)return p(a),t;u=u.sibling}throw Error(c(188))}if(n.return!==l.return)n=a,l=u;else{for(var s=!1,o=a.child;o;){if(o===n){s=!0,n=a,l=u;break}if(o===l){s=!0,l=a,n=u;break}o=o.sibling}if(!s){for(o=u.child;o;){if(o===n){s=!0,n=u,l=a;break}if(o===l){s=!0,l=u,n=a;break}o=o.sibling}if(!s)throw Error(c(189))}}if(n.alternate!==l)throw Error(c(190))}if(n.tag!==3)throw Error(c(188));return n.stateNode.current===n?e:t}function j(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=j(e),t!==null)return t;e=e.sibling}return null}var E=Object.assign,x=Symbol.for("react.element"),H=Symbol.for("react.transitional.element"),X=Symbol.for("react.portal"),D=Symbol.for("react.fragment"),se=Symbol.for("react.strict_mode"),L=Symbol.for("react.profiler"),ce=Symbol.for("react.consumer"),I=Symbol.for("react.context"),$=Symbol.for("react.forward_ref"),Ae=Symbol.for("react.suspense"),Z=Symbol.for("react.suspense_list"),Y=Symbol.for("react.memo"),K=Symbol.for("react.lazy"),V=Symbol.for("react.activity"),ne=Symbol.for("react.memo_cache_sentinel"),q=Symbol.iterator;function F(e){return e===null||typeof e!="object"?null:(e=q&&e[q]||e["@@iterator"],typeof e=="function"?e:null)}var ee=Symbol.for("react.client.reference");function ue(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ee?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case D:return"Fragment";case L:return"Profiler";case se:return"StrictMode";case Ae:return"Suspense";case Z:return"SuspenseList";case V:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case X:return"Portal";case I:return e.displayName||"Context";case ce:return(e._context.displayName||"Context")+".Consumer";case $:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Y:return t=e.displayName||null,t!==null?t:ue(e.type)||"Memo";case K:t=e._payload,e=e._init;try{return ue(e(t))}catch{}}return null}var Ye=Array.isArray,M=f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae={pending:!1,data:null,method:null,action:null},Te=[],be=-1;function b(e){return{current:e}}function R(e){0>be||(e.current=Te[be],Te[be]=null,be--)}function Q(e,t){be++,Te[be]=e.current,e.current=t}var W=b(null),fe=b(null),re=b(null),de=b(null);function Me(e,t){switch(Q(re,t),Q(fe,e),Q(W,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Gd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Gd(t),e=Qd(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}R(W),Q(W,e)}function Ne(){R(W),R(fe),R(re)}function nt(e){e.memoizedState!==null&&Q(de,e);var t=W.current,n=Qd(t,e.type);t!==n&&(Q(fe,e),Q(W,n))}function al(e){fe.current===e&&(R(W),R(fe)),de.current===e&&(R(de),Ga._currentValue=ae)}var At,Fl;function zt(e){if(At===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\\n( *(at )?)/);At=t&&t[1]||"",Fl=-1<n.stack.indexOf(\`
9
+ at\`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return\`
10
+ \`+At+e+Fl}var ul=!1;function Wl(e,t){if(!e||ul)return"";ul=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var O=function(){throw Error()};if(Object.defineProperty(O.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(O,[])}catch(_){var N=_}Reflect.construct(e,[],O)}else{try{O.call()}catch(_){N=_}e.call(O.prototype)}}else{try{throw Error()}catch(_){N=_}(O=e())&&typeof O.catch=="function"&&O.catch(function(){})}}catch(_){if(_&&N&&typeof _.stack=="string")return[_.stack,N.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var a=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");a&&a.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var u=l.DetermineComponentFrameRoot(),s=u[0],o=u[1];if(s&&o){var g=s.split(\`
11
+ \`),C=o.split(\`
12
+ \`);for(a=l=0;l<g.length&&!g[l].includes("DetermineComponentFrameRoot");)l++;for(;a<C.length&&!C[a].includes("DetermineComponentFrameRoot");)a++;if(l===g.length||a===C.length)for(l=g.length-1,a=C.length-1;1<=l&&0<=a&&g[l]!==C[a];)a--;for(;1<=l&&0<=a;l--,a--)if(g[l]!==C[a]){if(l!==1||a!==1)do if(l--,a--,0>a||g[l]!==C[a]){var w=\`
13
+ \`+g[l].replace(" at new "," at ");return e.displayName&&w.includes("<anonymous>")&&(w=w.replace("<anonymous>",e.displayName)),w}while(1<=l&&0<=a);break}}}finally{ul=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?zt(n):""}function Wa(e,t){switch(e.tag){case 26:case 27:case 5:return zt(e.type);case 16:return zt("Lazy");case 13:return e.child!==t&&t!==null?zt("Suspense Fallback"):zt("Suspense");case 19:return zt("SuspenseList");case 0:case 15:return Wl(e.type,!1);case 11:return Wl(e.type.render,!1);case 1:return Wl(e.type,!0);case 31:return zt("Activity");default:return""}}function Ia(e){try{var t="",n=null;do t+=Wa(e,n),n=e,e=e.return;while(e);return t}catch(l){return\`
14
+ Error generating stack: \`+l.message+\`
15
+ \`+l.stack}}var il=Object.prototype.hasOwnProperty,cl=i.unstable_scheduleCallback,fl=i.unstable_cancelCallback,Si=i.unstable_shouldYield,sl=i.unstable_requestPaint,ut=i.unstable_now,B=i.unstable_getCurrentPriorityLevel,k=i.unstable_ImmediatePriority,he=i.unstable_UserBlockingPriority,De=i.unstable_NormalPriority,lt=i.unstable_LowPriority,rl=i.unstable_IdlePriority,Il=i.log,T0=i.unstable_setDisableYieldValue,Pl=null,mt=null;function on(e){if(typeof Il=="function"&&T0(e),mt&&typeof mt.setStrictMode=="function")try{mt.setStrictMode(Pl,e)}catch{}}var gt=Math.clz32?Math.clz32:C0,A0=Math.log,z0=Math.LN2;function C0(e){return e>>>=0,e===0?32:31-(A0(e)/z0|0)|0}var Pa=256,eu=262144,tu=4194304;function Hn(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 nu(e,t,n){var l=e.pendingLanes;if(l===0)return 0;var a=0,u=e.suspendedLanes,s=e.pingedLanes;e=e.warmLanes;var o=l&134217727;return o!==0?(l=o&~u,l!==0?a=Hn(l):(s&=o,s!==0?a=Hn(s):n||(n=o&~e,n!==0&&(a=Hn(n))))):(o=l&~u,o!==0?a=Hn(o):s!==0?a=Hn(s):n||(n=l&~e,n!==0&&(a=Hn(n)))),a===0?0:t!==0&&t!==a&&(t&u)===0&&(u=a&-a,n=t&-t,u>=n||u===32&&(n&4194048)!==0)?t:a}function ea(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function N0(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 Es(){var e=tu;return tu<<=1,(tu&62914560)===0&&(tu=4194304),e}function pi(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ta(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function j0(e,t,n,l,a,u){var s=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 o=e.entanglements,g=e.expirationTimes,C=e.hiddenUpdates;for(n=s&~n;0<n;){var w=31-gt(n),O=1<<w;o[w]=0,g[w]=-1;var N=C[w];if(N!==null)for(C[w]=null,w=0;w<N.length;w++){var _=N[w];_!==null&&(_.lane&=-536870913)}n&=~O}l!==0&&Ts(e,l,0),u!==0&&a===0&&e.tag!==0&&(e.suspendedLanes|=u&~(s&~t))}function Ts(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-gt(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|n&261930}function As(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var l=31-gt(n),a=1<<l;a&t|e[l]&t&&(e[l]|=t),n&=~a}}function zs(e,t){var n=t&-t;return n=(n&42)!==0?1:Ei(n),(n&(e.suspendedLanes|t))!==0?0:n}function Ei(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 Ti(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Cs(){var e=G.p;return e!==0?e:(e=window.event,e===void 0?32:oh(e.type))}function Ns(e,t){var n=G.p;try{return G.p=e,t()}finally{G.p=n}}var dn=Math.random().toString(36).slice(2),We="__reactFiber$"+dn,ct="__reactProps$"+dn,ol="__reactContainer$"+dn,Ai="__reactEvents$"+dn,x0="__reactListeners$"+dn,_0="__reactHandles$"+dn,js="__reactResources$"+dn,na="__reactMarker$"+dn;function zi(e){delete e[We],delete e[ct],delete e[Ai],delete e[x0],delete e[_0]}function dl(e){var t=e[We];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ol]||n[We]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=$d(e);e!==null;){if(n=e[We])return n;e=$d(e)}return t}e=n,n=e.parentNode}return null}function hl(e){if(e=e[We]||e[ol]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function la(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(c(33))}function ml(e){var t=e[js];return t||(t=e[js]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function $e(e){e[na]=!0}var xs=new Set,_s={};function qn(e,t){gl(e,t),gl(e+"Capture",t)}function gl(e,t){for(_s[e]=t,e=0;e<t.length;e++)xs.add(t[e])}var M0=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]*$"),Ms={},ws={};function w0(e){return il.call(ws,e)?!0:il.call(Ms,e)?!1:M0.test(e)?ws[e]=!0:(Ms[e]=!0,!1)}function lu(e,t,n){if(w0(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var l=t.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function au(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 Vt(e,t,n,l){if(l===null)e.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+l)}}function Ct(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Rs(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function R0(e,t,n){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var a=l.get,u=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(s){n=""+s,u.call(this,s)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return n},setValue:function(s){n=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ci(e){if(!e._valueTracker){var t=Rs(e)?"checked":"value";e._valueTracker=R0(e,t,""+e[t])}}function Us(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),l="";return e&&(l=Rs(e)?e.checked?"true":"false":e.value),e=l,e!==n?(t.setValue(e),!0):!1}function uu(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var U0=/[\\n"\\\\]/g;function Nt(e){return e.replace(U0,function(t){return"\\\\"+t.charCodeAt(0).toString(16)+" "})}function Ni(e,t,n,l,a,u,s,o){e.name="",s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"?e.type=s:e.removeAttribute("type"),t!=null?s==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Ct(t)):e.value!==""+Ct(t)&&(e.value=""+Ct(t)):s!=="submit"&&s!=="reset"||e.removeAttribute("value"),t!=null?ji(e,s,Ct(t)):n!=null?ji(e,s,Ct(n)):l!=null&&e.removeAttribute("value"),a==null&&u!=null&&(e.defaultChecked=!!u),a!=null&&(e.checked=a&&typeof a!="function"&&typeof a!="symbol"),o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?e.name=""+Ct(o):e.removeAttribute("name")}function Os(e,t,n,l,a,u,s,o){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(e.type=u),t!=null||n!=null){if(!(u!=="submit"&&u!=="reset"||t!=null)){Ci(e);return}n=n!=null?""+Ct(n):"",t=t!=null?""+Ct(t):n,o||t===e.value||(e.value=t),e.defaultValue=t}l=l??a,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=o?e.checked:!!l,e.defaultChecked=!!l,s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(e.name=s),Ci(e)}function ji(e,t,n){t==="number"&&uu(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function yl(e,t,n,l){if(e=e.options,t){t={};for(var a=0;a<n.length;a++)t["$"+n[a]]=!0;for(n=0;n<e.length;n++)a=t.hasOwnProperty("$"+e[n].value),e[n].selected!==a&&(e[n].selected=a),a&&l&&(e[n].defaultSelected=!0)}else{for(n=""+Ct(n),t=null,a=0;a<e.length;a++){if(e[a].value===n){e[a].selected=!0,l&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function Ds(e,t,n){if(t!=null&&(t=""+Ct(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+Ct(n):""}function Bs(e,t,n,l){if(t==null){if(l!=null){if(n!=null)throw Error(c(92));if(Ye(l)){if(1<l.length)throw Error(c(93));l=l[0]}n=l}n==null&&(n=""),t=n}n=Ct(t),e.defaultValue=n,l=e.textContent,l===n&&l!==""&&l!==null&&(e.value=l),Ci(e)}function vl(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var O0=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 Hs(e,t,n){var l=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?l?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":l?e.setProperty(t,n):typeof n!="number"||n===0||O0.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function qs(e,t,n){if(t!=null&&typeof t!="object")throw Error(c(62));if(e=e.style,n!=null){for(var l in n)!n.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="");for(var a in t)l=t[a],t.hasOwnProperty(a)&&n[a]!==l&&Hs(e,a,l)}else for(var u in t)t.hasOwnProperty(u)&&Hs(e,u,t[u])}function xi(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 D0=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"]]),B0=/^[\\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 iu(e){return B0.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Jt(){}var _i=null;function Mi(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var bl=null,Sl=null;function Ys(e){var t=hl(e);if(t&&(e=t.stateNode)){var n=e[ct]||null;e:switch(e=t.stateNode,t.type){case"input":if(Ni(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="'+Nt(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var l=n[t];if(l!==e&&l.form===e.form){var a=l[ct]||null;if(!a)throw Error(c(90));Ni(l,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)l=n[t],l.form===e.form&&Us(l)}break e;case"textarea":Ds(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&yl(e,!!n.multiple,t,!1)}}}var wi=!1;function Ls(e,t,n){if(wi)return e(t,n);wi=!0;try{var l=e(t);return l}finally{if(wi=!1,(bl!==null||Sl!==null)&&(Ju(),bl&&(t=bl,e=Sl,Sl=bl=null,Ys(t),e)))for(t=0;t<e.length;t++)Ys(e[t])}}function aa(e,t){var n=e.stateNode;if(n===null)return null;var l=n[ct]||null;if(l===null)return null;n=l[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(c(231,t,typeof n));return n}var kt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ri=!1;if(kt)try{var ua={};Object.defineProperty(ua,"passive",{get:function(){Ri=!0}}),window.addEventListener("test",ua,ua),window.removeEventListener("test",ua,ua)}catch{Ri=!1}var hn=null,Ui=null,cu=null;function Gs(){if(cu)return cu;var e,t=Ui,n=t.length,l,a="value"in hn?hn.value:hn.textContent,u=a.length;for(e=0;e<n&&t[e]===a[e];e++);var s=n-e;for(l=1;l<=s&&t[n-l]===a[u-l];l++);return cu=a.slice(e,1<l?1-l:void 0)}function fu(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 su(){return!0}function Qs(){return!1}function ft(e){function t(n,l,a,u,s){this._reactName=n,this._targetInst=a,this.type=l,this.nativeEvent=u,this.target=s,this.currentTarget=null;for(var o in e)e.hasOwnProperty(o)&&(n=e[o],this[o]=n?n(u):u[o]);return this.isDefaultPrevented=(u.defaultPrevented!=null?u.defaultPrevented:u.returnValue===!1)?su:Qs,this.isPropagationStopped=Qs,this}return E(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=su)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=su)},persist:function(){},isPersistent:su}),t}var Yn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ru=ft(Yn),ia=E({},Yn,{view:0,detail:0}),H0=ft(ia),Oi,Di,ca,ou=E({},ia,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Hi,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!==ca&&(ca&&e.type==="mousemove"?(Oi=e.screenX-ca.screenX,Di=e.screenY-ca.screenY):Di=Oi=0,ca=e),Oi)},movementY:function(e){return"movementY"in e?e.movementY:Di}}),Xs=ft(ou),q0=E({},ou,{dataTransfer:0}),Y0=ft(q0),L0=E({},ia,{relatedTarget:0}),Bi=ft(L0),G0=E({},Yn,{animationName:0,elapsedTime:0,pseudoElement:0}),Q0=ft(G0),X0=E({},Yn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),K0=ft(X0),Z0=E({},Yn,{data:0}),Ks=ft(Z0),V0={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},J0={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"},k0={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function $0(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=k0[e])?!!t[e]:!1}function Hi(){return $0}var F0=E({},ia,{key:function(e){if(e.key){var t=V0[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=fu(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?J0[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Hi,charCode:function(e){return e.type==="keypress"?fu(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?fu(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),W0=ft(F0),I0=E({},ou,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Zs=ft(I0),P0=E({},ia,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Hi}),em=ft(P0),tm=E({},Yn,{propertyName:0,elapsedTime:0,pseudoElement:0}),nm=ft(tm),lm=E({},ou,{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}),am=ft(lm),um=E({},Yn,{newState:0,oldState:0}),im=ft(um),cm=[9,13,27,32],qi=kt&&"CompositionEvent"in window,fa=null;kt&&"documentMode"in document&&(fa=document.documentMode);var fm=kt&&"TextEvent"in window&&!fa,Vs=kt&&(!qi||fa&&8<fa&&11>=fa),Js=" ",ks=!1;function $s(e,t){switch(e){case"keyup":return cm.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Fs(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var pl=!1;function sm(e,t){switch(e){case"compositionend":return Fs(t);case"keypress":return t.which!==32?null:(ks=!0,Js);case"textInput":return e=t.data,e===Js&&ks?null:e;default:return null}}function rm(e,t){if(pl)return e==="compositionend"||!qi&&$s(e,t)?(e=Gs(),cu=Ui=hn=null,pl=!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 Vs&&t.locale!=="ko"?null:t.data;default:return null}}var om={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 Ws(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!om[e.type]:t==="textarea"}function Is(e,t,n,l){bl?Sl?Sl.push(l):Sl=[l]:bl=l,t=ei(t,"onChange"),0<t.length&&(n=new ru("onChange","change",null,n,l),e.push({event:n,listeners:t}))}var sa=null,ra=null;function dm(e){Dd(e,0)}function du(e){var t=la(e);if(Us(t))return e}function Ps(e,t){if(e==="change")return t}var er=!1;if(kt){var Yi;if(kt){var Li="oninput"in document;if(!Li){var tr=document.createElement("div");tr.setAttribute("oninput","return;"),Li=typeof tr.oninput=="function"}Yi=Li}else Yi=!1;er=Yi&&(!document.documentMode||9<document.documentMode)}function nr(){sa&&(sa.detachEvent("onpropertychange",lr),ra=sa=null)}function lr(e){if(e.propertyName==="value"&&du(ra)){var t=[];Is(t,ra,e,Mi(e)),Ls(dm,t)}}function hm(e,t,n){e==="focusin"?(nr(),sa=t,ra=n,sa.attachEvent("onpropertychange",lr)):e==="focusout"&&nr()}function mm(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return du(ra)}function gm(e,t){if(e==="click")return du(t)}function ym(e,t){if(e==="input"||e==="change")return du(t)}function vm(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var yt=typeof Object.is=="function"?Object.is:vm;function oa(e,t){if(yt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),l=Object.keys(t);if(n.length!==l.length)return!1;for(l=0;l<n.length;l++){var a=n[l];if(!il.call(t,a)||!yt(e[a],t[a]))return!1}return!0}function ar(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ur(e,t){var n=ar(e);e=0;for(var l;n;){if(n.nodeType===3){if(l=e+n.textContent.length,e<=t&&l>=t)return{node:n,offset:t-e};e=l}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=ar(n)}}function ir(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ir(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function cr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=uu(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=uu(e.document)}return t}function Gi(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 bm=kt&&"documentMode"in document&&11>=document.documentMode,El=null,Qi=null,da=null,Xi=!1;function fr(e,t,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Xi||El==null||El!==uu(l)||(l=El,"selectionStart"in l&&Gi(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),da&&oa(da,l)||(da=l,l=ei(Qi,"onSelect"),0<l.length&&(t=new ru("onSelect","select",null,t,n),e.push({event:t,listeners:l}),t.target=El)))}function Ln(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Tl={animationend:Ln("Animation","AnimationEnd"),animationiteration:Ln("Animation","AnimationIteration"),animationstart:Ln("Animation","AnimationStart"),transitionrun:Ln("Transition","TransitionRun"),transitionstart:Ln("Transition","TransitionStart"),transitioncancel:Ln("Transition","TransitionCancel"),transitionend:Ln("Transition","TransitionEnd")},Ki={},sr={};kt&&(sr=document.createElement("div").style,"AnimationEvent"in window||(delete Tl.animationend.animation,delete Tl.animationiteration.animation,delete Tl.animationstart.animation),"TransitionEvent"in window||delete Tl.transitionend.transition);function Gn(e){if(Ki[e])return Ki[e];if(!Tl[e])return e;var t=Tl[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in sr)return Ki[e]=t[n];return e}var rr=Gn("animationend"),or=Gn("animationiteration"),dr=Gn("animationstart"),Sm=Gn("transitionrun"),pm=Gn("transitionstart"),Em=Gn("transitioncancel"),hr=Gn("transitionend"),mr=new Map,Zi="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(" ");Zi.push("scrollEnd");function Dt(e,t){mr.set(e,t),qn(t,[e])}var hu=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!==null&&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)},jt=[],Al=0,Vi=0;function mu(){for(var e=Al,t=Vi=Al=0;t<e;){var n=jt[t];jt[t++]=null;var l=jt[t];jt[t++]=null;var a=jt[t];jt[t++]=null;var u=jt[t];if(jt[t++]=null,l!==null&&a!==null){var s=l.pending;s===null?a.next=a:(a.next=s.next,s.next=a),l.pending=a}u!==0&&gr(n,a,u)}}function gu(e,t,n,l){jt[Al++]=e,jt[Al++]=t,jt[Al++]=n,jt[Al++]=l,Vi|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function Ji(e,t,n,l){return gu(e,t,n,l),yu(e)}function Qn(e,t){return gu(e,null,null,t),yu(e)}function gr(e,t,n){e.lanes|=n;var l=e.alternate;l!==null&&(l.lanes|=n);for(var a=!1,u=e.return;u!==null;)u.childLanes|=n,l=u.alternate,l!==null&&(l.childLanes|=n),u.tag===22&&(e=u.stateNode,e===null||e._visibility&1||(a=!0)),e=u,u=u.return;return e.tag===3?(u=e.stateNode,a&&t!==null&&(a=31-gt(n),e=u.hiddenUpdates,l=e[a],l===null?e[a]=[t]:l.push(t),t.lane=n|536870912),u):null}function yu(e){if(50<Oa)throw Oa=0,nf=null,Error(c(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var zl={};function Tm(e,t,n,l){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=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function vt(e,t,n,l){return new Tm(e,t,n,l)}function ki(e){return e=e.prototype,!(!e||!e.isReactComponent)}function $t(e,t){var n=e.alternate;return n===null?(n=vt(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 yr(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 vu(e,t,n,l,a,u){var s=0;if(l=e,typeof e=="function")ki(e)&&(s=1);else if(typeof e=="string")s=jg(e,n,W.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case V:return e=vt(31,n,t,a),e.elementType=V,e.lanes=u,e;case D:return Xn(n.children,a,u,t);case se:s=8,a|=24;break;case L:return e=vt(12,n,t,a|2),e.elementType=L,e.lanes=u,e;case Ae:return e=vt(13,n,t,a),e.elementType=Ae,e.lanes=u,e;case Z:return e=vt(19,n,t,a),e.elementType=Z,e.lanes=u,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case I:s=10;break e;case ce:s=9;break e;case $:s=11;break e;case Y:s=14;break e;case K:s=16,l=null;break e}s=29,n=Error(c(130,e===null?"null":typeof e,"")),l=null}return t=vt(s,n,t,a),t.elementType=e,t.type=l,t.lanes=u,t}function Xn(e,t,n,l){return e=vt(7,e,l,t),e.lanes=n,e}function $i(e,t,n){return e=vt(6,e,null,t),e.lanes=n,e}function vr(e){var t=vt(18,null,null,0);return t.stateNode=e,t}function Fi(e,t,n){return t=vt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var br=new WeakMap;function xt(e,t){if(typeof e=="object"&&e!==null){var n=br.get(e);return n!==void 0?n:(t={value:e,source:t,stack:Ia(t)},br.set(e,t),t)}return{value:e,source:t,stack:Ia(t)}}var Cl=[],Nl=0,bu=null,ha=0,_t=[],Mt=0,mn=null,Yt=1,Lt="";function Ft(e,t){Cl[Nl++]=ha,Cl[Nl++]=bu,bu=e,ha=t}function Sr(e,t,n){_t[Mt++]=Yt,_t[Mt++]=Lt,_t[Mt++]=mn,mn=e;var l=Yt;e=Lt;var a=32-gt(l)-1;l&=~(1<<a),n+=1;var u=32-gt(t)+a;if(30<u){var s=a-a%5;u=(l&(1<<s)-1).toString(32),l>>=s,a-=s,Yt=1<<32-gt(t)+a|n<<a|l,Lt=u+e}else Yt=1<<u|n<<a|l,Lt=e}function Wi(e){e.return!==null&&(Ft(e,1),Sr(e,1,0))}function Ii(e){for(;e===bu;)bu=Cl[--Nl],Cl[Nl]=null,ha=Cl[--Nl],Cl[Nl]=null;for(;e===mn;)mn=_t[--Mt],_t[Mt]=null,Lt=_t[--Mt],_t[Mt]=null,Yt=_t[--Mt],_t[Mt]=null}function pr(e,t){_t[Mt++]=Yt,_t[Mt++]=Lt,_t[Mt++]=mn,Yt=t.id,Lt=t.overflow,mn=e}var Ie=null,Be=null,Ee=!1,gn=null,wt=!1,Pi=Error(c(519));function yn(e){var t=Error(c(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ma(xt(t,e)),Pi}function Er(e){var t=e.stateNode,n=e.type,l=e.memoizedProps;switch(t[We]=e,t[ct]=l,n){case"dialog":ve("cancel",t),ve("close",t);break;case"iframe":case"object":case"embed":ve("load",t);break;case"video":case"audio":for(n=0;n<Ba.length;n++)ve(Ba[n],t);break;case"source":ve("error",t);break;case"img":case"image":case"link":ve("error",t),ve("load",t);break;case"details":ve("toggle",t);break;case"input":ve("invalid",t),Os(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":ve("invalid",t);break;case"textarea":ve("invalid",t),Bs(t,l.value,l.defaultValue,l.children)}n=l.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||l.suppressHydrationWarning===!0||Yd(t.textContent,n)?(l.popover!=null&&(ve("beforetoggle",t),ve("toggle",t)),l.onScroll!=null&&ve("scroll",t),l.onScrollEnd!=null&&ve("scrollend",t),l.onClick!=null&&(t.onclick=Jt),t=!0):t=!1,t||yn(e,!0)}function Tr(e){for(Ie=e.return;Ie;)switch(Ie.tag){case 5:case 31:case 13:wt=!1;return;case 27:case 3:wt=!0;return;default:Ie=Ie.return}}function jl(e){if(e!==Ie)return!1;if(!Ee)return Tr(e),Ee=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||bf(e.type,e.memoizedProps)),n=!n),n&&Be&&yn(e),Tr(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));Be=kd(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));Be=kd(e)}else t===27?(t=Be,Mn(e.type)?(e=Af,Af=null,Be=e):Be=t):Be=Ie?Ut(e.stateNode.nextSibling):null;return!0}function Kn(){Be=Ie=null,Ee=!1}function ec(){var e=gn;return e!==null&&(dt===null?dt=e:dt.push.apply(dt,e),gn=null),e}function ma(e){gn===null?gn=[e]:gn.push(e)}var tc=b(null),Zn=null,Wt=null;function vn(e,t,n){Q(tc,t._currentValue),t._currentValue=n}function It(e){e._currentValue=tc.current,R(tc)}function nc(e,t,n){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===n)break;e=e.return}}function lc(e,t,n,l){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var u=a.dependencies;if(u!==null){var s=a.child;u=u.firstContext;e:for(;u!==null;){var o=u;u=a;for(var g=0;g<t.length;g++)if(o.context===t[g]){u.lanes|=n,o=u.alternate,o!==null&&(o.lanes|=n),nc(u.return,n,e),l||(s=null);break e}u=o.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(c(341));s.lanes|=n,u=s.alternate,u!==null&&(u.lanes|=n),nc(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 xl(e,t,n,l){e=null;for(var a=t,u=!1;a!==null;){if(!u){if((a.flags&524288)!==0)u=!0;else if((a.flags&262144)!==0)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(c(387));if(s=s.memoizedProps,s!==null){var o=a.type;yt(a.pendingProps.value,s.value)||(e!==null?e.push(o):e=[o])}}else if(a===de.current){if(s=a.alternate,s===null)throw Error(c(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e!==null?e.push(Ga):e=[Ga])}a=a.return}e!==null&&lc(t,e,n,l),t.flags|=262144}function Su(e){for(e=e.firstContext;e!==null;){if(!yt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Vn(e){Zn=e,Wt=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Pe(e){return Ar(Zn,e)}function pu(e,t){return Zn===null&&Vn(e),Ar(e,t)}function Ar(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Wt===null){if(e===null)throw Error(c(308));Wt=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Wt=Wt.next=t;return n}var Am=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,l){e.push(l)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},zm=i.unstable_scheduleCallback,Cm=i.unstable_NormalPriority,Ke={$$typeof:I,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ac(){return{controller:new Am,data:new Map,refCount:0}}function ga(e){e.refCount--,e.refCount===0&&zm(Cm,function(){e.controller.abort()})}var ya=null,uc=0,_l=0,Ml=null;function Nm(e,t){if(ya===null){var n=ya=[];uc=0,_l=sf(),Ml={status:"pending",value:void 0,then:function(l){n.push(l)}}}return uc++,t.then(zr,zr),t}function zr(){if(--uc===0&&ya!==null){Ml!==null&&(Ml.status="fulfilled");var e=ya;ya=null,_l=0,Ml=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function jm(e,t){var n=[],l={status:"pending",value:null,reason:null,then:function(a){n.push(a)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var a=0;a<n.length;a++)(0,n[a])(t)},function(a){for(l.status="rejected",l.reason=a,a=0;a<n.length;a++)(0,n[a])(void 0)}),l}var Cr=M.S;M.S=function(e,t){sd=ut(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Nm(e,t),Cr!==null&&Cr(e,t)};var Jn=b(null);function ic(){var e=Jn.current;return e!==null?e:Oe.pooledCache}function Eu(e,t){t===null?Q(Jn,Jn.current):Q(Jn,t.pool)}function Nr(){var e=ic();return e===null?null:{parent:Ke._currentValue,pool:e}}var wl=Error(c(460)),cc=Error(c(474)),Tu=Error(c(542)),Au={then:function(){}};function jr(e){return e=e.status,e==="fulfilled"||e==="rejected"}function xr(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Jt,Jt),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Mr(e),e;default:if(typeof t.status=="string")t.then(Jt,Jt);else{if(e=Oe,e!==null&&100<e.shellSuspendCounter)throw Error(c(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var a=t;a.status="fulfilled",a.value=l}},function(l){if(t.status==="pending"){var a=t;a.status="rejected",a.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Mr(e),e}throw $n=t,wl}}function kn(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?($n=n,wl):n}}var $n=null;function _r(){if($n===null)throw Error(c(459));var e=$n;return $n=null,e}function Mr(e){if(e===wl||e===Tu)throw Error(c(483))}var Rl=null,va=0;function zu(e){var t=va;return va+=1,Rl===null&&(Rl=[]),xr(Rl,e,t)}function ba(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Cu(e,t){throw t.$$typeof===x?Error(c(525)):(e=Object.prototype.toString.call(t),Error(c(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function wr(e){function t(T,S){if(e){var z=T.deletions;z===null?(T.deletions=[S],T.flags|=16):z.push(S)}}function n(T,S){if(!e)return null;for(;S!==null;)t(T,S),S=S.sibling;return null}function l(T){for(var S=new Map;T!==null;)T.key!==null?S.set(T.key,T):S.set(T.index,T),T=T.sibling;return S}function a(T,S){return T=$t(T,S),T.index=0,T.sibling=null,T}function u(T,S,z){return T.index=z,e?(z=T.alternate,z!==null?(z=z.index,z<S?(T.flags|=67108866,S):z):(T.flags|=67108866,S)):(T.flags|=1048576,S)}function s(T){return e&&T.alternate===null&&(T.flags|=67108866),T}function o(T,S,z,U){return S===null||S.tag!==6?(S=$i(z,T.mode,U),S.return=T,S):(S=a(S,z),S.return=T,S)}function g(T,S,z,U){var le=z.type;return le===D?w(T,S,z.props.children,U,z.key):S!==null&&(S.elementType===le||typeof le=="object"&&le!==null&&le.$$typeof===K&&kn(le)===S.type)?(S=a(S,z.props),ba(S,z),S.return=T,S):(S=vu(z.type,z.key,z.props,null,T.mode,U),ba(S,z),S.return=T,S)}function C(T,S,z,U){return S===null||S.tag!==4||S.stateNode.containerInfo!==z.containerInfo||S.stateNode.implementation!==z.implementation?(S=Fi(z,T.mode,U),S.return=T,S):(S=a(S,z.children||[]),S.return=T,S)}function w(T,S,z,U,le){return S===null||S.tag!==7?(S=Xn(z,T.mode,U,le),S.return=T,S):(S=a(S,z),S.return=T,S)}function O(T,S,z){if(typeof S=="string"&&S!==""||typeof S=="number"||typeof S=="bigint")return S=$i(""+S,T.mode,z),S.return=T,S;if(typeof S=="object"&&S!==null){switch(S.$$typeof){case H:return z=vu(S.type,S.key,S.props,null,T.mode,z),ba(z,S),z.return=T,z;case X:return S=Fi(S,T.mode,z),S.return=T,S;case K:return S=kn(S),O(T,S,z)}if(Ye(S)||F(S))return S=Xn(S,T.mode,z,null),S.return=T,S;if(typeof S.then=="function")return O(T,zu(S),z);if(S.$$typeof===I)return O(T,pu(T,S),z);Cu(T,S)}return null}function N(T,S,z,U){var le=S!==null?S.key:null;if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return le!==null?null:o(T,S,""+z,U);if(typeof z=="object"&&z!==null){switch(z.$$typeof){case H:return z.key===le?g(T,S,z,U):null;case X:return z.key===le?C(T,S,z,U):null;case K:return z=kn(z),N(T,S,z,U)}if(Ye(z)||F(z))return le!==null?null:w(T,S,z,U,null);if(typeof z.then=="function")return N(T,S,zu(z),U);if(z.$$typeof===I)return N(T,S,pu(T,z),U);Cu(T,z)}return null}function _(T,S,z,U,le){if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return T=T.get(z)||null,o(S,T,""+U,le);if(typeof U=="object"&&U!==null){switch(U.$$typeof){case H:return T=T.get(U.key===null?z:U.key)||null,g(S,T,U,le);case X:return T=T.get(U.key===null?z:U.key)||null,C(S,T,U,le);case K:return U=kn(U),_(T,S,z,U,le)}if(Ye(U)||F(U))return T=T.get(z)||null,w(S,T,U,le,null);if(typeof U.then=="function")return _(T,S,z,zu(U),le);if(U.$$typeof===I)return _(T,S,z,pu(S,U),le);Cu(S,U)}return null}function P(T,S,z,U){for(var le=null,ze=null,te=S,ge=S=0,pe=null;te!==null&&ge<z.length;ge++){te.index>ge?(pe=te,te=null):pe=te.sibling;var Ce=N(T,te,z[ge],U);if(Ce===null){te===null&&(te=pe);break}e&&te&&Ce.alternate===null&&t(T,te),S=u(Ce,S,ge),ze===null?le=Ce:ze.sibling=Ce,ze=Ce,te=pe}if(ge===z.length)return n(T,te),Ee&&Ft(T,ge),le;if(te===null){for(;ge<z.length;ge++)te=O(T,z[ge],U),te!==null&&(S=u(te,S,ge),ze===null?le=te:ze.sibling=te,ze=te);return Ee&&Ft(T,ge),le}for(te=l(te);ge<z.length;ge++)pe=_(te,T,ge,z[ge],U),pe!==null&&(e&&pe.alternate!==null&&te.delete(pe.key===null?ge:pe.key),S=u(pe,S,ge),ze===null?le=pe:ze.sibling=pe,ze=pe);return e&&te.forEach(function(Dn){return t(T,Dn)}),Ee&&Ft(T,ge),le}function ie(T,S,z,U){if(z==null)throw Error(c(151));for(var le=null,ze=null,te=S,ge=S=0,pe=null,Ce=z.next();te!==null&&!Ce.done;ge++,Ce=z.next()){te.index>ge?(pe=te,te=null):pe=te.sibling;var Dn=N(T,te,Ce.value,U);if(Dn===null){te===null&&(te=pe);break}e&&te&&Dn.alternate===null&&t(T,te),S=u(Dn,S,ge),ze===null?le=Dn:ze.sibling=Dn,ze=Dn,te=pe}if(Ce.done)return n(T,te),Ee&&Ft(T,ge),le;if(te===null){for(;!Ce.done;ge++,Ce=z.next())Ce=O(T,Ce.value,U),Ce!==null&&(S=u(Ce,S,ge),ze===null?le=Ce:ze.sibling=Ce,ze=Ce);return Ee&&Ft(T,ge),le}for(te=l(te);!Ce.done;ge++,Ce=z.next())Ce=_(te,T,ge,Ce.value,U),Ce!==null&&(e&&Ce.alternate!==null&&te.delete(Ce.key===null?ge:Ce.key),S=u(Ce,S,ge),ze===null?le=Ce:ze.sibling=Ce,ze=Ce);return e&&te.forEach(function(qg){return t(T,qg)}),Ee&&Ft(T,ge),le}function Ue(T,S,z,U){if(typeof z=="object"&&z!==null&&z.type===D&&z.key===null&&(z=z.props.children),typeof z=="object"&&z!==null){switch(z.$$typeof){case H:e:{for(var le=z.key;S!==null;){if(S.key===le){if(le=z.type,le===D){if(S.tag===7){n(T,S.sibling),U=a(S,z.props.children),U.return=T,T=U;break e}}else if(S.elementType===le||typeof le=="object"&&le!==null&&le.$$typeof===K&&kn(le)===S.type){n(T,S.sibling),U=a(S,z.props),ba(U,z),U.return=T,T=U;break e}n(T,S);break}else t(T,S);S=S.sibling}z.type===D?(U=Xn(z.props.children,T.mode,U,z.key),U.return=T,T=U):(U=vu(z.type,z.key,z.props,null,T.mode,U),ba(U,z),U.return=T,T=U)}return s(T);case X:e:{for(le=z.key;S!==null;){if(S.key===le)if(S.tag===4&&S.stateNode.containerInfo===z.containerInfo&&S.stateNode.implementation===z.implementation){n(T,S.sibling),U=a(S,z.children||[]),U.return=T,T=U;break e}else{n(T,S);break}else t(T,S);S=S.sibling}U=Fi(z,T.mode,U),U.return=T,T=U}return s(T);case K:return z=kn(z),Ue(T,S,z,U)}if(Ye(z))return P(T,S,z,U);if(F(z)){if(le=F(z),typeof le!="function")throw Error(c(150));return z=le.call(z),ie(T,S,z,U)}if(typeof z.then=="function")return Ue(T,S,zu(z),U);if(z.$$typeof===I)return Ue(T,S,pu(T,z),U);Cu(T,z)}return typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint"?(z=""+z,S!==null&&S.tag===6?(n(T,S.sibling),U=a(S,z),U.return=T,T=U):(n(T,S),U=$i(z,T.mode,U),U.return=T,T=U),s(T)):n(T,S)}return function(T,S,z,U){try{va=0;var le=Ue(T,S,z,U);return Rl=null,le}catch(te){if(te===wl||te===Tu)throw te;var ze=vt(29,te,null,T.mode);return ze.lanes=U,ze.return=T,ze}finally{}}}var Fn=wr(!0),Rr=wr(!1),bn=!1;function fc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function sc(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 Sn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function pn(e,t,n){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(je&2)!==0){var a=l.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),l.pending=t,t=yu(e),gr(e,null,n),t}return gu(e,l,t,n),yu(e)}function Sa(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,As(e,n)}}function rc(e,t){var n=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var a=null,u=null;if(n=n.firstBaseUpdate,n!==null){do{var s={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};u===null?a=u=s:u=u.next=s,n=n.next}while(n!==null);u===null?a=u=t:u=u.next=t}else a=u=t;n={baseState:l.baseState,firstBaseUpdate:a,lastBaseUpdate:u,shared:l.shared,callbacks:l.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var oc=!1;function pa(){if(oc){var e=Ml;if(e!==null)throw e}}function Ea(e,t,n,l){oc=!1;var a=e.updateQueue;bn=!1;var u=a.firstBaseUpdate,s=a.lastBaseUpdate,o=a.shared.pending;if(o!==null){a.shared.pending=null;var g=o,C=g.next;g.next=null,s===null?u=C:s.next=C,s=g;var w=e.alternate;w!==null&&(w=w.updateQueue,o=w.lastBaseUpdate,o!==s&&(o===null?w.firstBaseUpdate=C:o.next=C,w.lastBaseUpdate=g))}if(u!==null){var O=a.baseState;s=0,w=C=g=null,o=u;do{var N=o.lane&-536870913,_=N!==o.lane;if(_?(Se&N)===N:(l&N)===N){N!==0&&N===_l&&(oc=!0),w!==null&&(w=w.next={lane:0,tag:o.tag,payload:o.payload,callback:null,next:null});e:{var P=e,ie=o;N=t;var Ue=n;switch(ie.tag){case 1:if(P=ie.payload,typeof P=="function"){O=P.call(Ue,O,N);break e}O=P;break e;case 3:P.flags=P.flags&-65537|128;case 0:if(P=ie.payload,N=typeof P=="function"?P.call(Ue,O,N):P,N==null)break e;O=E({},O,N);break e;case 2:bn=!0}}N=o.callback,N!==null&&(e.flags|=64,_&&(e.flags|=8192),_=a.callbacks,_===null?a.callbacks=[N]:_.push(N))}else _={lane:N,tag:o.tag,payload:o.payload,callback:o.callback,next:null},w===null?(C=w=_,g=O):w=w.next=_,s|=N;if(o=o.next,o===null){if(o=a.shared.pending,o===null)break;_=o,o=_.next,_.next=null,a.lastBaseUpdate=_,a.shared.pending=null}}while(!0);w===null&&(g=O),a.baseState=g,a.firstBaseUpdate=C,a.lastBaseUpdate=w,u===null&&(a.shared.lanes=0),Cn|=s,e.lanes=s,e.memoizedState=O}}function Ur(e,t){if(typeof e!="function")throw Error(c(191,e));e.call(t)}function Or(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ur(n[e],t)}var Ul=b(null),Nu=b(0);function Dr(e,t){e=fn,Q(Nu,e),Q(Ul,t),fn=e|t.baseLanes}function dc(){Q(Nu,fn),Q(Ul,Ul.current)}function hc(){fn=Nu.current,R(Ul),R(Nu)}var bt=b(null),Rt=null;function En(e){var t=e.alternate;Q(Qe,Qe.current&1),Q(bt,e),Rt===null&&(t===null||Ul.current!==null||t.memoizedState!==null)&&(Rt=e)}function mc(e){Q(Qe,Qe.current),Q(bt,e),Rt===null&&(Rt=e)}function Br(e){e.tag===22?(Q(Qe,Qe.current),Q(bt,e),Rt===null&&(Rt=e)):Tn()}function Tn(){Q(Qe,Qe.current),Q(bt,bt.current)}function St(e){R(bt),Rt===e&&(Rt=null),R(Qe)}var Qe=b(0);function ju(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Ef(n)||Tf(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)!==0)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 Pt=0,me=null,we=null,Ze=null,xu=!1,Ol=!1,Wn=!1,_u=0,Ta=0,Dl=null,xm=0;function Le(){throw Error(c(321))}function gc(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!yt(e[n],t[n]))return!1;return!0}function yc(e,t,n,l,a,u){return Pt=u,me=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,M.H=e===null||e.memoizedState===null?po:wc,Wn=!1,u=n(l,a),Wn=!1,Ol&&(u=qr(t,n,l,a)),Hr(e),u}function Hr(e){M.H=Ca;var t=we!==null&&we.next!==null;if(Pt=0,Ze=we=me=null,xu=!1,Ta=0,Dl=null,t)throw Error(c(300));e===null||Ve||(e=e.dependencies,e!==null&&Su(e)&&(Ve=!0))}function qr(e,t,n,l){me=e;var a=0;do{if(Ol&&(Dl=null),Ta=0,Ol=!1,25<=a)throw Error(c(301));if(a+=1,Ze=we=null,e.updateQueue!=null){var u=e.updateQueue;u.lastEffect=null,u.events=null,u.stores=null,u.memoCache!=null&&(u.memoCache.index=0)}M.H=Eo,u=t(n,l)}while(Ol);return u}function _m(){var e=M.H,t=e.useState()[0];return t=typeof t.then=="function"?Aa(t):t,e=e.useState()[0],(we!==null?we.memoizedState:null)!==e&&(me.flags|=1024),t}function vc(){var e=_u!==0;return _u=0,e}function bc(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Sc(e){if(xu){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}xu=!1}Pt=0,Ze=we=me=null,Ol=!1,Ta=_u=0,Dl=null}function it(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ze===null?me.memoizedState=Ze=e:Ze=Ze.next=e,Ze}function Xe(){if(we===null){var e=me.alternate;e=e!==null?e.memoizedState:null}else e=we.next;var t=Ze===null?me.memoizedState:Ze.next;if(t!==null)Ze=t,we=e;else{if(e===null)throw me.alternate===null?Error(c(467)):Error(c(310));we=e,e={memoizedState:we.memoizedState,baseState:we.baseState,baseQueue:we.baseQueue,queue:we.queue,next:null},Ze===null?me.memoizedState=Ze=e:Ze=Ze.next=e}return Ze}function Mu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Aa(e){var t=Ta;return Ta+=1,Dl===null&&(Dl=[]),e=xr(Dl,e,t),t=me,(Ze===null?t.memoizedState:Ze.next)===null&&(t=t.alternate,M.H=t===null||t.memoizedState===null?po:wc),e}function wu(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Aa(e);if(e.$$typeof===I)return Pe(e)}throw Error(c(438,String(e)))}function pc(e){var t=null,n=me.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var l=me.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(a){return a.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=Mu(),me.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),l=0;l<e;l++)n[l]=ne;return t.index++,n}function en(e,t){return typeof t=="function"?t(e):t}function Ru(e){var t=Xe();return Ec(t,we,e)}function Ec(e,t,n){var l=e.queue;if(l===null)throw Error(c(311));l.lastRenderedReducer=n;var a=e.baseQueue,u=l.pending;if(u!==null){if(a!==null){var s=a.next;a.next=u.next,u.next=s}t.baseQueue=a=u,l.pending=null}if(u=e.baseState,a===null)e.memoizedState=u;else{t=a.next;var o=s=null,g=null,C=t,w=!1;do{var O=C.lane&-536870913;if(O!==C.lane?(Se&O)===O:(Pt&O)===O){var N=C.revertLane;if(N===0)g!==null&&(g=g.next={lane:0,revertLane:0,gesture:null,action:C.action,hasEagerState:C.hasEagerState,eagerState:C.eagerState,next:null}),O===_l&&(w=!0);else if((Pt&N)===N){C=C.next,N===_l&&(w=!0);continue}else O={lane:0,revertLane:C.revertLane,gesture:null,action:C.action,hasEagerState:C.hasEagerState,eagerState:C.eagerState,next:null},g===null?(o=g=O,s=u):g=g.next=O,me.lanes|=N,Cn|=N;O=C.action,Wn&&n(u,O),u=C.hasEagerState?C.eagerState:n(u,O)}else N={lane:O,revertLane:C.revertLane,gesture:C.gesture,action:C.action,hasEagerState:C.hasEagerState,eagerState:C.eagerState,next:null},g===null?(o=g=N,s=u):g=g.next=N,me.lanes|=O,Cn|=O;C=C.next}while(C!==null&&C!==t);if(g===null?s=u:g.next=o,!yt(u,e.memoizedState)&&(Ve=!0,w&&(n=Ml,n!==null)))throw n;e.memoizedState=u,e.baseState=s,e.baseQueue=g,l.lastRenderedState=u}return a===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function Tc(e){var t=Xe(),n=t.queue;if(n===null)throw Error(c(311));n.lastRenderedReducer=e;var l=n.dispatch,a=n.pending,u=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do u=e(u,s.action),s=s.next;while(s!==a);yt(u,t.memoizedState)||(Ve=!0),t.memoizedState=u,t.baseQueue===null&&(t.baseState=u),n.lastRenderedState=u}return[u,l]}function Yr(e,t,n){var l=me,a=Xe(),u=Ee;if(u){if(n===void 0)throw Error(c(407));n=n()}else n=t();var s=!yt((we||a).memoizedState,n);if(s&&(a.memoizedState=n,Ve=!0),a=a.queue,Cc(Qr.bind(null,l,a,e),[e]),a.getSnapshot!==t||s||Ze!==null&&Ze.memoizedState.tag&1){if(l.flags|=2048,Bl(9,{destroy:void 0},Gr.bind(null,l,a,n,t),null),Oe===null)throw Error(c(349));u||(Pt&127)!==0||Lr(l,t,n)}return n}function Lr(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=me.updateQueue,t===null?(t=Mu(),me.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Gr(e,t,n,l){t.value=n,t.getSnapshot=l,Xr(t)&&Kr(e)}function Qr(e,t,n){return n(function(){Xr(t)&&Kr(e)})}function Xr(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!yt(e,n)}catch{return!0}}function Kr(e){var t=Qn(e,2);t!==null&&ht(t,e,2)}function Ac(e){var t=it();if(typeof e=="function"){var n=e;if(e=n(),Wn){on(!0);try{n()}finally{on(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:en,lastRenderedState:e},t}function Zr(e,t,n,l){return e.baseState=n,Ec(e,we,typeof l=="function"?l:en)}function Mm(e,t,n,l,a){if(Du(e))throw Error(c(485));if(e=t.action,e!==null){var u={payload:a,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(s){u.listeners.push(s)}};M.T!==null?n(!0):u.isTransition=!1,l(u),n=t.pending,n===null?(u.next=t.pending=u,Vr(t,u)):(u.next=n.next,t.pending=n.next=u)}}function Vr(e,t){var n=t.action,l=t.payload,a=e.state;if(t.isTransition){var u=M.T,s={};M.T=s;try{var o=n(a,l),g=M.S;g!==null&&g(s,o),Jr(e,t,o)}catch(C){zc(e,t,C)}finally{u!==null&&s.types!==null&&(u.types=s.types),M.T=u}}else try{u=n(a,l),Jr(e,t,u)}catch(C){zc(e,t,C)}}function Jr(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(l){kr(e,t,l)},function(l){return zc(e,t,l)}):kr(e,t,n)}function kr(e,t,n){t.status="fulfilled",t.value=n,$r(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Vr(e,n)))}function zc(e,t,n){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=n,$r(t),t=t.next;while(t!==l)}e.action=null}function $r(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Fr(e,t){return t}function Wr(e,t){if(Ee){var n=Oe.formState;if(n!==null){e:{var l=me;if(Ee){if(Be){t:{for(var a=Be,u=wt;a.nodeType!==8;){if(!u){a=null;break t}if(a=Ut(a.nextSibling),a===null){a=null;break t}}u=a.data,a=u==="F!"||u==="F"?a:null}if(a){Be=Ut(a.nextSibling),l=a.data==="F!";break e}}yn(l)}l=!1}l&&(t=n[0])}}return n=it(),n.memoizedState=n.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fr,lastRenderedState:t},n.queue=l,n=vo.bind(null,me,l),l.dispatch=n,l=Ac(!1),u=Mc.bind(null,me,!1,l.queue),l=it(),a={state:t,dispatch:null,action:e,pending:null},l.queue=a,n=Mm.bind(null,me,a,u,n),a.dispatch=n,l.memoizedState=e,[t,n,!1]}function Ir(e){var t=Xe();return Pr(t,we,e)}function Pr(e,t,n){if(t=Ec(e,t,Fr)[0],e=Ru(en)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=Aa(t)}catch(s){throw s===wl?Tu:s}else l=t;t=Xe();var a=t.queue,u=a.dispatch;return n!==t.memoizedState&&(me.flags|=2048,Bl(9,{destroy:void 0},wm.bind(null,a,n),null)),[l,u,e]}function wm(e,t){e.action=t}function eo(e){var t=Xe(),n=we;if(n!==null)return Pr(t,n,e);Xe(),t=t.memoizedState,n=Xe();var l=n.queue.dispatch;return n.memoizedState=e,[t,l,!1]}function Bl(e,t,n,l){return e={tag:e,create:n,deps:l,inst:t,next:null},t=me.updateQueue,t===null&&(t=Mu(),me.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(l=n.next,n.next=e,e.next=l,t.lastEffect=e),e}function to(){return Xe().memoizedState}function Uu(e,t,n,l){var a=it();me.flags|=e,a.memoizedState=Bl(1|t,{destroy:void 0},n,l===void 0?null:l)}function Ou(e,t,n,l){var a=Xe();l=l===void 0?null:l;var u=a.memoizedState.inst;we!==null&&l!==null&&gc(l,we.memoizedState.deps)?a.memoizedState=Bl(t,u,n,l):(me.flags|=e,a.memoizedState=Bl(1|t,u,n,l))}function no(e,t){Uu(8390656,8,e,t)}function Cc(e,t){Ou(2048,8,e,t)}function Rm(e){me.flags|=4;var t=me.updateQueue;if(t===null)t=Mu(),me.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function lo(e){var t=Xe().memoizedState;return Rm({ref:t,nextImpl:e}),function(){if((je&2)!==0)throw Error(c(440));return t.impl.apply(void 0,arguments)}}function ao(e,t){return Ou(4,2,e,t)}function uo(e,t){return Ou(4,4,e,t)}function io(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 co(e,t,n){n=n!=null?n.concat([e]):null,Ou(4,4,io.bind(null,t,e),n)}function Nc(){}function fo(e,t){var n=Xe();t=t===void 0?null:t;var l=n.memoizedState;return t!==null&&gc(t,l[1])?l[0]:(n.memoizedState=[e,t],e)}function so(e,t){var n=Xe();t=t===void 0?null:t;var l=n.memoizedState;if(t!==null&&gc(t,l[1]))return l[0];if(l=e(),Wn){on(!0);try{e()}finally{on(!1)}}return n.memoizedState=[l,t],l}function jc(e,t,n){return n===void 0||(Pt&1073741824)!==0&&(Se&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=od(),me.lanes|=e,Cn|=e,n)}function ro(e,t,n,l){return yt(n,t)?n:Ul.current!==null?(e=jc(e,n,l),yt(e,t)||(Ve=!0),e):(Pt&42)===0||(Pt&1073741824)!==0&&(Se&261930)===0?(Ve=!0,e.memoizedState=n):(e=od(),me.lanes|=e,Cn|=e,t)}function oo(e,t,n,l,a){var u=G.p;G.p=u!==0&&8>u?u:8;var s=M.T,o={};M.T=o,Mc(e,!1,t,n);try{var g=a(),C=M.S;if(C!==null&&C(o,g),g!==null&&typeof g=="object"&&typeof g.then=="function"){var w=jm(g,l);za(e,t,w,Tt(e))}else za(e,t,l,Tt(e))}catch(O){za(e,t,{then:function(){},status:"rejected",reason:O},Tt())}finally{G.p=u,s!==null&&o.types!==null&&(s.types=o.types),M.T=s}}function Um(){}function xc(e,t,n,l){if(e.tag!==5)throw Error(c(476));var a=ho(e).queue;oo(e,a,t,ae,n===null?Um:function(){return mo(e),n(l)})}function ho(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:en,lastRenderedState:ae},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:en,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function mo(e){var t=ho(e);t.next===null&&(t=e.alternate.memoizedState),za(e,t.next.queue,{},Tt())}function _c(){return Pe(Ga)}function go(){return Xe().memoizedState}function yo(){return Xe().memoizedState}function Om(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Tt();e=Sn(n);var l=pn(t,e,n);l!==null&&(ht(l,t,n),Sa(l,t,n)),t={cache:ac()},e.payload=t;return}t=t.return}}function Dm(e,t,n){var l=Tt();n={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Du(e)?bo(t,n):(n=Ji(e,t,n,l),n!==null&&(ht(n,e,l),So(n,t,l)))}function vo(e,t,n){var l=Tt();za(e,t,n,l)}function za(e,t,n,l){var a={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Du(e))bo(t,a);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var s=t.lastRenderedState,o=u(s,n);if(a.hasEagerState=!0,a.eagerState=o,yt(o,s))return gu(e,t,a,0),Oe===null&&mu(),!1}catch{}finally{}if(n=Ji(e,t,a,l),n!==null)return ht(n,e,l),So(n,t,l),!0}return!1}function Mc(e,t,n,l){if(l={lane:2,revertLane:sf(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Du(e)){if(t)throw Error(c(479))}else t=Ji(e,n,l,2),t!==null&&ht(t,e,2)}function Du(e){var t=e.alternate;return e===me||t!==null&&t===me}function bo(e,t){Ol=xu=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function So(e,t,n){if((n&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,As(e,n)}}var Ca={readContext:Pe,use:wu,useCallback:Le,useContext:Le,useEffect:Le,useImperativeHandle:Le,useLayoutEffect:Le,useInsertionEffect:Le,useMemo:Le,useReducer:Le,useRef:Le,useState:Le,useDebugValue:Le,useDeferredValue:Le,useTransition:Le,useSyncExternalStore:Le,useId:Le,useHostTransitionStatus:Le,useFormState:Le,useActionState:Le,useOptimistic:Le,useMemoCache:Le,useCacheRefresh:Le};Ca.useEffectEvent=Le;var po={readContext:Pe,use:wu,useCallback:function(e,t){return it().memoizedState=[e,t===void 0?null:t],e},useContext:Pe,useEffect:no,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Uu(4194308,4,io.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Uu(4194308,4,e,t)},useInsertionEffect:function(e,t){Uu(4,2,e,t)},useMemo:function(e,t){var n=it();t=t===void 0?null:t;var l=e();if(Wn){on(!0);try{e()}finally{on(!1)}}return n.memoizedState=[l,t],l},useReducer:function(e,t,n){var l=it();if(n!==void 0){var a=n(t);if(Wn){on(!0);try{n(t)}finally{on(!1)}}}else a=t;return l.memoizedState=l.baseState=a,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:a},l.queue=e,e=e.dispatch=Dm.bind(null,me,e),[l.memoizedState,e]},useRef:function(e){var t=it();return e={current:e},t.memoizedState=e},useState:function(e){e=Ac(e);var t=e.queue,n=vo.bind(null,me,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Nc,useDeferredValue:function(e,t){var n=it();return jc(n,e,t)},useTransition:function(){var e=Ac(!1);return e=oo.bind(null,me,e.queue,!0,!1),it().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var l=me,a=it();if(Ee){if(n===void 0)throw Error(c(407));n=n()}else{if(n=t(),Oe===null)throw Error(c(349));(Se&127)!==0||Lr(l,t,n)}a.memoizedState=n;var u={value:n,getSnapshot:t};return a.queue=u,no(Qr.bind(null,l,u,e),[e]),l.flags|=2048,Bl(9,{destroy:void 0},Gr.bind(null,l,u,n,t),null),n},useId:function(){var e=it(),t=Oe.identifierPrefix;if(Ee){var n=Lt,l=Yt;n=(l&~(1<<32-gt(l)-1)).toString(32)+n,t="_"+t+"R_"+n,n=_u++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=xm++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:_c,useFormState:Wr,useActionState:Wr,useOptimistic:function(e){var t=it();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Mc.bind(null,me,!0,n),n.dispatch=t,[e,t]},useMemoCache:pc,useCacheRefresh:function(){return it().memoizedState=Om.bind(null,me)},useEffectEvent:function(e){var t=it(),n={impl:e};return t.memoizedState=n,function(){if((je&2)!==0)throw Error(c(440));return n.impl.apply(void 0,arguments)}}},wc={readContext:Pe,use:wu,useCallback:fo,useContext:Pe,useEffect:Cc,useImperativeHandle:co,useInsertionEffect:ao,useLayoutEffect:uo,useMemo:so,useReducer:Ru,useRef:to,useState:function(){return Ru(en)},useDebugValue:Nc,useDeferredValue:function(e,t){var n=Xe();return ro(n,we.memoizedState,e,t)},useTransition:function(){var e=Ru(en)[0],t=Xe().memoizedState;return[typeof e=="boolean"?e:Aa(e),t]},useSyncExternalStore:Yr,useId:go,useHostTransitionStatus:_c,useFormState:Ir,useActionState:Ir,useOptimistic:function(e,t){var n=Xe();return Zr(n,we,e,t)},useMemoCache:pc,useCacheRefresh:yo};wc.useEffectEvent=lo;var Eo={readContext:Pe,use:wu,useCallback:fo,useContext:Pe,useEffect:Cc,useImperativeHandle:co,useInsertionEffect:ao,useLayoutEffect:uo,useMemo:so,useReducer:Tc,useRef:to,useState:function(){return Tc(en)},useDebugValue:Nc,useDeferredValue:function(e,t){var n=Xe();return we===null?jc(n,e,t):ro(n,we.memoizedState,e,t)},useTransition:function(){var e=Tc(en)[0],t=Xe().memoizedState;return[typeof e=="boolean"?e:Aa(e),t]},useSyncExternalStore:Yr,useId:go,useHostTransitionStatus:_c,useFormState:eo,useActionState:eo,useOptimistic:function(e,t){var n=Xe();return we!==null?Zr(n,we,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:pc,useCacheRefresh:yo};Eo.useEffectEvent=lo;function Rc(e,t,n,l){t=e.memoizedState,n=n(l,t),n=n==null?t:E({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Uc={enqueueSetState:function(e,t,n){e=e._reactInternals;var l=Tt(),a=Sn(l);a.payload=t,n!=null&&(a.callback=n),t=pn(e,a,l),t!==null&&(ht(t,e,l),Sa(t,e,l))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var l=Tt(),a=Sn(l);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=pn(e,a,l),t!==null&&(ht(t,e,l),Sa(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Tt(),l=Sn(n);l.tag=2,t!=null&&(l.callback=t),t=pn(e,l,n),t!==null&&(ht(t,e,n),Sa(t,e,n))}};function To(e,t,n,l,a,u,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,u,s):t.prototype&&t.prototype.isPureReactComponent?!oa(n,l)||!oa(a,u):!0}function Ao(e,t,n,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,l),t.state!==e&&Uc.enqueueReplaceState(t,t.state,null)}function In(e,t){var n=t;if("ref"in t){n={};for(var l in t)l!=="ref"&&(n[l]=t[l])}if(e=e.defaultProps){n===t&&(n=E({},n));for(var a in e)n[a]===void 0&&(n[a]=e[a])}return n}function zo(e){hu(e)}function Co(e){console.error(e)}function No(e){hu(e)}function Bu(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function jo(e,t,n){try{var l=e.onCaughtError;l(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(a){setTimeout(function(){throw a})}}function Oc(e,t,n){return n=Sn(n),n.tag=3,n.payload={element:null},n.callback=function(){Bu(e,t)},n}function xo(e){return e=Sn(e),e.tag=3,e}function _o(e,t,n,l){var a=n.type.getDerivedStateFromError;if(typeof a=="function"){var u=l.value;e.payload=function(){return a(u)},e.callback=function(){jo(t,n,l)}}var s=n.stateNode;s!==null&&typeof s.componentDidCatch=="function"&&(e.callback=function(){jo(t,n,l),typeof a!="function"&&(Nn===null?Nn=new Set([this]):Nn.add(this));var o=l.stack;this.componentDidCatch(l.value,{componentStack:o!==null?o:""})})}function Bm(e,t,n,l,a){if(n.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=n.alternate,t!==null&&xl(t,n,a,!0),n=bt.current,n!==null){switch(n.tag){case 31:case 13:return Rt===null?ku():n.alternate===null&&Ge===0&&(Ge=3),n.flags&=-257,n.flags|=65536,n.lanes=a,l===Au?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([l]):t.add(l),uf(e,l,a)),!1;case 22:return n.flags|=65536,l===Au?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([l]):n.add(l)),uf(e,l,a)),!1}throw Error(c(435,n.tag))}return uf(e,l,a),ku(),!1}if(Ee)return t=bt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=a,l!==Pi&&(e=Error(c(422),{cause:l}),ma(xt(e,n)))):(l!==Pi&&(t=Error(c(423),{cause:l}),ma(xt(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,l=xt(l,n),a=Oc(e.stateNode,l,a),rc(e,a),Ge!==4&&(Ge=2)),!1;var u=Error(c(520),{cause:l});if(u=xt(u,n),Ua===null?Ua=[u]:Ua.push(u),Ge!==4&&(Ge=2),t===null)return!0;l=xt(l,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Oc(n.stateNode,l,e),rc(n,e),!1;case 1:if(t=n.type,u=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||u!==null&&typeof u.componentDidCatch=="function"&&(Nn===null||!Nn.has(u))))return n.flags|=65536,a&=-a,n.lanes|=a,a=xo(a),_o(a,e,n,l),rc(n,a),!1}n=n.return}while(n!==null);return!1}var Dc=Error(c(461)),Ve=!1;function et(e,t,n,l){t.child=e===null?Rr(t,null,n,l):Fn(t,e.child,n,l)}function Mo(e,t,n,l,a){n=n.render;var u=t.ref;if("ref"in l){var s={};for(var o in l)o!=="ref"&&(s[o]=l[o])}else s=l;return Vn(t),l=yc(e,t,n,s,u,a),o=vc(),e!==null&&!Ve?(bc(e,t,a),tn(e,t,a)):(Ee&&o&&Wi(t),t.flags|=1,et(e,t,l,a),t.child)}function wo(e,t,n,l,a){if(e===null){var u=n.type;return typeof u=="function"&&!ki(u)&&u.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=u,Ro(e,t,u,l,a)):(e=vu(n.type,null,l,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(u=e.child,!Xc(e,a)){var s=u.memoizedProps;if(n=n.compare,n=n!==null?n:oa,n(s,l)&&e.ref===t.ref)return tn(e,t,a)}return t.flags|=1,e=$t(u,l),e.ref=t.ref,e.return=t,t.child=e}function Ro(e,t,n,l,a){if(e!==null){var u=e.memoizedProps;if(oa(u,l)&&e.ref===t.ref)if(Ve=!1,t.pendingProps=l=u,Xc(e,a))(e.flags&131072)!==0&&(Ve=!0);else return t.lanes=e.lanes,tn(e,t,a)}return Bc(e,t,n,l,a)}function Uo(e,t,n,l){var a=l.children,u=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((t.flags&128)!==0){if(u=u!==null?u.baseLanes|n:n,e!==null){for(l=t.child=e.child,a=0;l!==null;)a=a|l.lanes|l.childLanes,l=l.sibling;l=a&~u}else l=0,t.child=null;return Oo(e,t,u,n,l)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Eu(t,u!==null?u.cachePool:null),u!==null?Dr(t,u):dc(),Br(t);else return l=t.lanes=536870912,Oo(e,t,u!==null?u.baseLanes|n:n,n,l)}else u!==null?(Eu(t,u.cachePool),Dr(t,u),Tn(),t.memoizedState=null):(e!==null&&Eu(t,null),dc(),Tn());return et(e,t,a,n),t.child}function Na(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Oo(e,t,n,l,a){var u=ic();return u=u===null?null:{parent:Ke._currentValue,pool:u},t.memoizedState={baseLanes:n,cachePool:u},e!==null&&Eu(t,null),dc(),Br(t),e!==null&&xl(e,t,l,!0),t.childLanes=a,null}function Hu(e,t){return t=Yu({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Do(e,t,n){return Fn(t,e.child,null,n),e=Hu(t,t.pendingProps),e.flags|=2,St(t),t.memoizedState=null,e}function Hm(e,t,n){var l=t.pendingProps,a=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ee){if(l.mode==="hidden")return e=Hu(t,l),t.lanes=536870912,Na(null,e);if(mc(t),(e=Be)?(e=Jd(e,wt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:mn!==null?{id:Yt,overflow:Lt}:null,retryLane:536870912,hydrationErrors:null},n=vr(e),n.return=t,t.child=n,Ie=t,Be=null)):e=null,e===null)throw yn(t);return t.lanes=536870912,null}return Hu(t,l)}var u=e.memoizedState;if(u!==null){var s=u.dehydrated;if(mc(t),a)if(t.flags&256)t.flags&=-257,t=Do(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(c(558));else if(Ve||xl(e,t,n,!1),a=(n&e.childLanes)!==0,Ve||a){if(l=Oe,l!==null&&(s=zs(l,n),s!==0&&s!==u.retryLane))throw u.retryLane=s,Qn(e,s),ht(l,e,s),Dc;ku(),t=Do(e,t,n)}else e=u.treeContext,Be=Ut(s.nextSibling),Ie=t,Ee=!0,gn=null,wt=!1,e!==null&&pr(t,e),t=Hu(t,l),t.flags|=4096;return t}return e=$t(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function qu(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(c(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Bc(e,t,n,l,a){return Vn(t),n=yc(e,t,n,l,void 0,a),l=vc(),e!==null&&!Ve?(bc(e,t,a),tn(e,t,a)):(Ee&&l&&Wi(t),t.flags|=1,et(e,t,n,a),t.child)}function Bo(e,t,n,l,a,u){return Vn(t),t.updateQueue=null,n=qr(t,l,n,a),Hr(e),l=vc(),e!==null&&!Ve?(bc(e,t,u),tn(e,t,u)):(Ee&&l&&Wi(t),t.flags|=1,et(e,t,n,u),t.child)}function Ho(e,t,n,l,a){if(Vn(t),t.stateNode===null){var u=zl,s=n.contextType;typeof s=="object"&&s!==null&&(u=Pe(s)),u=new n(l,u),t.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=Uc,t.stateNode=u,u._reactInternals=t,u=t.stateNode,u.props=l,u.state=t.memoizedState,u.refs={},fc(t),s=n.contextType,u.context=typeof s=="object"&&s!==null?Pe(s):zl,u.state=t.memoizedState,s=n.getDerivedStateFromProps,typeof s=="function"&&(Rc(t,n,s,l),u.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof u.getSnapshotBeforeUpdate=="function"||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(s=u.state,typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount(),s!==u.state&&Uc.enqueueReplaceState(u,u.state,null),Ea(t,l,u,a),pa(),u.state=t.memoizedState),typeof u.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){u=t.stateNode;var o=t.memoizedProps,g=In(n,o);u.props=g;var C=u.context,w=n.contextType;s=zl,typeof w=="object"&&w!==null&&(s=Pe(w));var O=n.getDerivedStateFromProps;w=typeof O=="function"||typeof u.getSnapshotBeforeUpdate=="function",o=t.pendingProps!==o,w||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(o||C!==s)&&Ao(t,u,l,s),bn=!1;var N=t.memoizedState;u.state=N,Ea(t,l,u,a),pa(),C=t.memoizedState,o||N!==C||bn?(typeof O=="function"&&(Rc(t,n,O,l),C=t.memoizedState),(g=bn||To(t,n,g,l,N,C,s))?(w||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount()),typeof u.componentDidMount=="function"&&(t.flags|=4194308)):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=C),u.props=l,u.state=C,u.context=s,l=g):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{u=t.stateNode,sc(e,t),s=t.memoizedProps,w=In(n,s),u.props=w,O=t.pendingProps,N=u.context,C=n.contextType,g=zl,typeof C=="object"&&C!==null&&(g=Pe(C)),o=n.getDerivedStateFromProps,(C=typeof o=="function"||typeof u.getSnapshotBeforeUpdate=="function")||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(s!==O||N!==g)&&Ao(t,u,l,g),bn=!1,N=t.memoizedState,u.state=N,Ea(t,l,u,a),pa();var _=t.memoizedState;s!==O||N!==_||bn||e!==null&&e.dependencies!==null&&Su(e.dependencies)?(typeof o=="function"&&(Rc(t,n,o,l),_=t.memoizedState),(w=bn||To(t,n,w,l,N,_,g)||e!==null&&e.dependencies!==null&&Su(e.dependencies))?(C||typeof u.UNSAFE_componentWillUpdate!="function"&&typeof u.componentWillUpdate!="function"||(typeof u.componentWillUpdate=="function"&&u.componentWillUpdate(l,_,g),typeof u.UNSAFE_componentWillUpdate=="function"&&u.UNSAFE_componentWillUpdate(l,_,g)),typeof u.componentDidUpdate=="function"&&(t.flags|=4),typeof u.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof u.componentDidUpdate!="function"||s===e.memoizedProps&&N===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&N===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=_),u.props=l,u.state=_,u.context=g,l=w):(typeof u.componentDidUpdate!="function"||s===e.memoizedProps&&N===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&N===e.memoizedState||(t.flags|=1024),l=!1)}return u=l,qu(e,t),l=(t.flags&128)!==0,u||l?(u=t.stateNode,n=l&&typeof n.getDerivedStateFromError!="function"?null:u.render(),t.flags|=1,e!==null&&l?(t.child=Fn(t,e.child,null,a),t.child=Fn(t,null,n,a)):et(e,t,n,a),t.memoizedState=u.state,e=t.child):e=tn(e,t,a),e}function qo(e,t,n,l){return Kn(),t.flags|=256,et(e,t,n,l),t.child}var Hc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function qc(e){return{baseLanes:e,cachePool:Nr()}}function Yc(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=Et),e}function Yo(e,t,n){var l=t.pendingProps,a=!1,u=(t.flags&128)!==0,s;if((s=u)||(s=e!==null&&e.memoizedState===null?!1:(Qe.current&2)!==0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ee){if(a?En(t):Tn(),(e=Be)?(e=Jd(e,wt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:mn!==null?{id:Yt,overflow:Lt}:null,retryLane:536870912,hydrationErrors:null},n=vr(e),n.return=t,t.child=n,Ie=t,Be=null)):e=null,e===null)throw yn(t);return Tf(e)?t.lanes=32:t.lanes=536870912,null}var o=l.children;return l=l.fallback,a?(Tn(),a=t.mode,o=Yu({mode:"hidden",children:o},a),l=Xn(l,a,n,null),o.return=t,l.return=t,o.sibling=l,t.child=o,l=t.child,l.memoizedState=qc(n),l.childLanes=Yc(e,s,n),t.memoizedState=Hc,Na(null,l)):(En(t),Lc(t,o))}var g=e.memoizedState;if(g!==null&&(o=g.dehydrated,o!==null)){if(u)t.flags&256?(En(t),t.flags&=-257,t=Gc(e,t,n)):t.memoizedState!==null?(Tn(),t.child=e.child,t.flags|=128,t=null):(Tn(),o=l.fallback,a=t.mode,l=Yu({mode:"visible",children:l.children},a),o=Xn(o,a,n,null),o.flags|=2,l.return=t,o.return=t,l.sibling=o,t.child=l,Fn(t,e.child,null,n),l=t.child,l.memoizedState=qc(n),l.childLanes=Yc(e,s,n),t.memoizedState=Hc,t=Na(null,l));else if(En(t),Tf(o)){if(s=o.nextSibling&&o.nextSibling.dataset,s)var C=s.dgst;s=C,l=Error(c(419)),l.stack="",l.digest=s,ma({value:l,source:null,stack:null}),t=Gc(e,t,n)}else if(Ve||xl(e,t,n,!1),s=(n&e.childLanes)!==0,Ve||s){if(s=Oe,s!==null&&(l=zs(s,n),l!==0&&l!==g.retryLane))throw g.retryLane=l,Qn(e,l),ht(s,e,l),Dc;Ef(o)||ku(),t=Gc(e,t,n)}else Ef(o)?(t.flags|=192,t.child=e.child,t=null):(e=g.treeContext,Be=Ut(o.nextSibling),Ie=t,Ee=!0,gn=null,wt=!1,e!==null&&pr(t,e),t=Lc(t,l.children),t.flags|=4096);return t}return a?(Tn(),o=l.fallback,a=t.mode,g=e.child,C=g.sibling,l=$t(g,{mode:"hidden",children:l.children}),l.subtreeFlags=g.subtreeFlags&65011712,C!==null?o=$t(C,o):(o=Xn(o,a,n,null),o.flags|=2),o.return=t,l.return=t,l.sibling=o,t.child=l,Na(null,l),l=t.child,o=e.child.memoizedState,o===null?o=qc(n):(a=o.cachePool,a!==null?(g=Ke._currentValue,a=a.parent!==g?{parent:g,pool:g}:a):a=Nr(),o={baseLanes:o.baseLanes|n,cachePool:a}),l.memoizedState=o,l.childLanes=Yc(e,s,n),t.memoizedState=Hc,Na(e.child,l)):(En(t),n=e.child,e=n.sibling,n=$t(n,{mode:"visible",children:l.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 Lc(e,t){return t=Yu({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Yu(e,t){return e=vt(22,e,null,t),e.lanes=0,e}function Gc(e,t,n){return Fn(t,e.child,null,n),e=Lc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Lo(e,t,n){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),nc(e.return,t,n)}function Qc(e,t,n,l,a,u){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:n,tailMode:a,treeForkCount:u}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=l,s.tail=n,s.tailMode=a,s.treeForkCount=u)}function Go(e,t,n){var l=t.pendingProps,a=l.revealOrder,u=l.tail;l=l.children;var s=Qe.current,o=(s&2)!==0;if(o?(s=s&1|2,t.flags|=128):s&=1,Q(Qe,s),et(e,t,l,n),l=Ee?ha:0,!o&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Lo(e,n,t);else if(e.tag===19)Lo(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(a){case"forwards":for(n=t.child,a=null;n!==null;)e=n.alternate,e!==null&&ju(e)===null&&(a=n),n=n.sibling;n=a,n===null?(a=t.child,t.child=null):(a=n.sibling,n.sibling=null),Qc(t,!1,a,n,u,l);break;case"backwards":case"unstable_legacy-backwards":for(n=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&ju(e)===null){t.child=a;break}e=a.sibling,a.sibling=n,n=a,a=e}Qc(t,!0,n,null,u,l);break;case"together":Qc(t,!1,null,null,void 0,l);break;default:t.memoizedState=null}return t.child}function tn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Cn|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(xl(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(c(153));if(t.child!==null){for(e=t.child,n=$t(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=$t(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Xc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Su(e)))}function qm(e,t,n){switch(t.tag){case 3:Me(t,t.stateNode.containerInfo),vn(t,Ke,e.memoizedState.cache),Kn();break;case 27:case 5:nt(t);break;case 4:Me(t,t.stateNode.containerInfo);break;case 10:vn(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,mc(t),null;break;case 13:var l=t.memoizedState;if(l!==null)return l.dehydrated!==null?(En(t),t.flags|=128,null):(n&t.child.childLanes)!==0?Yo(e,t,n):(En(t),e=tn(e,t,n),e!==null?e.sibling:null);En(t);break;case 19:var a=(e.flags&128)!==0;if(l=(n&t.childLanes)!==0,l||(xl(e,t,n,!1),l=(n&t.childLanes)!==0),a){if(l)return Go(e,t,n);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),Q(Qe,Qe.current),l)break;return null;case 22:return t.lanes=0,Uo(e,t,n,t.pendingProps);case 24:vn(t,Ke,e.memoizedState.cache)}return tn(e,t,n)}function Qo(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ve=!0;else{if(!Xc(e,n)&&(t.flags&128)===0)return Ve=!1,qm(e,t,n);Ve=(e.flags&131072)!==0}else Ve=!1,Ee&&(t.flags&1048576)!==0&&Sr(t,ha,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=kn(t.elementType),t.type=e,typeof e=="function")ki(e)?(l=In(e,l),t.tag=1,t=Ho(null,t,e,l,n)):(t.tag=0,t=Bc(null,t,e,l,n));else{if(e!=null){var a=e.$$typeof;if(a===$){t.tag=11,t=Mo(null,t,e,l,n);break e}else if(a===Y){t.tag=14,t=wo(null,t,e,l,n);break e}}throw t=ue(e)||e,Error(c(306,t,""))}}return t;case 0:return Bc(e,t,t.type,t.pendingProps,n);case 1:return l=t.type,a=In(l,t.pendingProps),Ho(e,t,l,a,n);case 3:e:{if(Me(t,t.stateNode.containerInfo),e===null)throw Error(c(387));l=t.pendingProps;var u=t.memoizedState;a=u.element,sc(e,t),Ea(t,l,null,n);var s=t.memoizedState;if(l=s.cache,vn(t,Ke,l),l!==u.cache&&lc(t,[Ke],n,!0),pa(),l=s.element,u.isDehydrated)if(u={element:l,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=u,t.memoizedState=u,t.flags&256){t=qo(e,t,l,n);break e}else if(l!==a){a=xt(Error(c(424)),t),ma(a),t=qo(e,t,l,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Be=Ut(e.firstChild),Ie=t,Ee=!0,gn=null,wt=!0,n=Rr(t,null,l,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Kn(),l===a){t=tn(e,t,n);break e}et(e,t,l,n)}t=t.child}return t;case 26:return qu(e,t),e===null?(n=Pd(t.type,null,t.pendingProps,null))?t.memoizedState=n:Ee||(n=t.type,e=t.pendingProps,l=ti(re.current).createElement(n),l[We]=t,l[ct]=e,tt(l,n,e),$e(l),t.stateNode=l):t.memoizedState=Pd(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return nt(t),e===null&&Ee&&(l=t.stateNode=Fd(t.type,t.pendingProps,re.current),Ie=t,wt=!0,a=Be,Mn(t.type)?(Af=a,Be=Ut(l.firstChild)):Be=a),et(e,t,t.pendingProps.children,n),qu(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ee&&((a=l=Be)&&(l=mg(l,t.type,t.pendingProps,wt),l!==null?(t.stateNode=l,Ie=t,Be=Ut(l.firstChild),wt=!1,a=!0):a=!1),a||yn(t)),nt(t),a=t.type,u=t.pendingProps,s=e!==null?e.memoizedProps:null,l=u.children,bf(a,u)?l=null:s!==null&&bf(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=yc(e,t,_m,null,null,n),Ga._currentValue=a),qu(e,t),et(e,t,l,n),t.child;case 6:return e===null&&Ee&&((e=n=Be)&&(n=gg(n,t.pendingProps,wt),n!==null?(t.stateNode=n,Ie=t,Be=null,e=!0):e=!1),e||yn(t)),null;case 13:return Yo(e,t,n);case 4:return Me(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=Fn(t,null,l,n):et(e,t,l,n),t.child;case 11:return Mo(e,t,t.type,t.pendingProps,n);case 7:return et(e,t,t.pendingProps,n),t.child;case 8:return et(e,t,t.pendingProps.children,n),t.child;case 12:return et(e,t,t.pendingProps.children,n),t.child;case 10:return l=t.pendingProps,vn(t,t.type,l.value),et(e,t,l.children,n),t.child;case 9:return a=t.type._context,l=t.pendingProps.children,Vn(t),a=Pe(a),l=l(a),t.flags|=1,et(e,t,l,n),t.child;case 14:return wo(e,t,t.type,t.pendingProps,n);case 15:return Ro(e,t,t.type,t.pendingProps,n);case 19:return Go(e,t,n);case 31:return Hm(e,t,n);case 22:return Uo(e,t,n,t.pendingProps);case 24:return Vn(t),l=Pe(Ke),e===null?(a=ic(),a===null&&(a=Oe,u=ac(),a.pooledCache=u,u.refCount++,u!==null&&(a.pooledCacheLanes|=n),a=u),t.memoizedState={parent:l,cache:a},fc(t),vn(t,Ke,a)):((e.lanes&n)!==0&&(sc(e,t),Ea(t,null,null,n),pa()),a=e.memoizedState,u=t.memoizedState,a.parent!==l?(a={parent:l,cache:l},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),vn(t,Ke,l)):(l=u.cache,vn(t,Ke,l),l!==a.cache&&lc(t,[Ke],n,!0))),et(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(c(156,t.tag))}function nn(e){e.flags|=4}function Kc(e,t,n,l,a){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(a&335544128)===a)if(e.stateNode.complete)e.flags|=8192;else if(gd())e.flags|=8192;else throw $n=Au,cc}else e.flags&=-16777217}function Xo(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!ah(t))if(gd())e.flags|=8192;else throw $n=Au,cc}function Lu(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Es():536870912,e.lanes|=t,Ll|=t)}function ja(e,t){if(!Ee)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 l=null;n!==null;)n.alternate!==null&&(l=n),n=n.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function He(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,l=0;if(t)for(var a=e.child;a!==null;)n|=a.lanes|a.childLanes,l|=a.subtreeFlags&65011712,l|=a.flags&65011712,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)n|=a.lanes|a.childLanes,l|=a.subtreeFlags,l|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=l,e.childLanes=n,t}function Ym(e,t,n){var l=t.pendingProps;switch(Ii(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return He(t),null;case 1:return He(t),null;case 3:return n=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),It(Ke),Ne(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(jl(t)?nn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,ec())),He(t),null;case 26:var a=t.type,u=t.memoizedState;return e===null?(nn(t),u!==null?(He(t),Xo(t,u)):(He(t),Kc(t,a,null,l,n))):u?u!==e.memoizedState?(nn(t),He(t),Xo(t,u)):(He(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&nn(t),He(t),Kc(t,a,e,l,n)),null;case 27:if(al(t),n=re.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&nn(t);else{if(!l){if(t.stateNode===null)throw Error(c(166));return He(t),null}e=W.current,jl(t)?Er(t):(e=Fd(a,l,n),t.stateNode=e,nn(t))}return He(t),null;case 5:if(al(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&nn(t);else{if(!l){if(t.stateNode===null)throw Error(c(166));return He(t),null}if(u=W.current,jl(t))Er(t);else{var s=ti(re.current);switch(u){case 1:u=s.createElementNS("http://www.w3.org/2000/svg",a);break;case 2:u=s.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;default:switch(a){case"svg":u=s.createElementNS("http://www.w3.org/2000/svg",a);break;case"math":u=s.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;case"script":u=s.createElement("div"),u.innerHTML="<script><\\/script>",u=u.removeChild(u.firstChild);break;case"select":u=typeof l.is=="string"?s.createElement("select",{is:l.is}):s.createElement("select"),l.multiple?u.multiple=!0:l.size&&(u.size=l.size);break;default:u=typeof l.is=="string"?s.createElement(a,{is:l.is}):s.createElement(a)}}u[We]=t,u[ct]=l;e:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)u.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 e;for(;s.sibling===null;){if(s.return===null||s.return===t)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=u;e:switch(tt(u,a,l),a){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&nn(t)}}return He(t),Kc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&nn(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(c(166));if(e=re.current,jl(t)){if(e=t.stateNode,n=t.memoizedProps,l=null,a=Ie,a!==null)switch(a.tag){case 27:case 5:l=a.memoizedProps}e[We]=t,e=!!(e.nodeValue===n||l!==null&&l.suppressHydrationWarning===!0||Yd(e.nodeValue,n)),e||yn(t,!0)}else e=ti(e).createTextNode(l),e[We]=t,t.stateNode=e}return He(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(l=jl(t),n!==null){if(e===null){if(!l)throw Error(c(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(557));e[We]=t}else Kn(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;He(t),e=!1}else n=ec(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(St(t),t):(St(t),null);if((t.flags&128)!==0)throw Error(c(558))}return He(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=jl(t),l!==null&&l.dehydrated!==null){if(e===null){if(!a)throw Error(c(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(c(317));a[We]=t}else Kn(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;He(t),a=!1}else a=ec(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(St(t),t):(St(t),null)}return St(t),(t.flags&128)!==0?(t.lanes=n,t):(n=l!==null,e=e!==null&&e.memoizedState!==null,n&&(l=t.child,a=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(a=l.alternate.memoizedState.cachePool.pool),u=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(u=l.memoizedState.cachePool.pool),u!==a&&(l.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Lu(t,t.updateQueue),He(t),null);case 4:return Ne(),e===null&&hf(t.stateNode.containerInfo),He(t),null;case 10:return It(t.type),He(t),null;case 19:if(R(Qe),l=t.memoizedState,l===null)return He(t),null;if(a=(t.flags&128)!==0,u=l.rendering,u===null)if(a)ja(l,!1);else{if(Ge!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(u=ju(e),u!==null){for(t.flags|=128,ja(l,!1),e=u.updateQueue,t.updateQueue=e,Lu(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)yr(n,e),n=n.sibling;return Q(Qe,Qe.current&1|2),Ee&&Ft(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&ut()>Zu&&(t.flags|=128,a=!0,ja(l,!1),t.lanes=4194304)}else{if(!a)if(e=ju(u),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Lu(t,e),ja(l,!0),l.tail===null&&l.tailMode==="hidden"&&!u.alternate&&!Ee)return He(t),null}else 2*ut()-l.renderingStartTime>Zu&&n!==536870912&&(t.flags|=128,a=!0,ja(l,!1),t.lanes=4194304);l.isBackwards?(u.sibling=t.child,t.child=u):(e=l.last,e!==null?e.sibling=u:t.child=u,l.last=u)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=ut(),e.sibling=null,n=Qe.current,Q(Qe,a?n&1|2:n&1),Ee&&Ft(t,l.treeForkCount),e):(He(t),null);case 22:case 23:return St(t),hc(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(n&536870912)!==0&&(t.flags&128)===0&&(He(t),t.subtreeFlags&6&&(t.flags|=8192)):He(t),n=t.updateQueue,n!==null&&Lu(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==n&&(t.flags|=2048),e!==null&&R(Jn),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),It(Ke),He(t),null;case 25:return null;case 30:return null}throw Error(c(156,t.tag))}function Lm(e,t){switch(Ii(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return It(Ke),Ne(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return al(t),null;case 31:if(t.memoizedState!==null){if(St(t),t.alternate===null)throw Error(c(340));Kn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(St(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(c(340));Kn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return R(Qe),null;case 4:return Ne(),null;case 10:return It(t.type),null;case 22:case 23:return St(t),hc(),e!==null&&R(Jn),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return It(Ke),null;case 25:return null;default:return null}}function Ko(e,t){switch(Ii(t),t.tag){case 3:It(Ke),Ne();break;case 26:case 27:case 5:al(t);break;case 4:Ne();break;case 31:t.memoizedState!==null&&St(t);break;case 13:St(t);break;case 19:R(Qe);break;case 10:It(t.type);break;case 22:case 23:St(t),hc(),e!==null&&R(Jn);break;case 24:It(Ke)}}function xa(e,t){try{var n=t.updateQueue,l=n!==null?n.lastEffect:null;if(l!==null){var a=l.next;n=a;do{if((n.tag&e)===e){l=void 0;var u=n.create,s=n.inst;l=u(),s.destroy=l}n=n.next}while(n!==a)}}catch(o){_e(t,t.return,o)}}function An(e,t,n){try{var l=t.updateQueue,a=l!==null?l.lastEffect:null;if(a!==null){var u=a.next;l=u;do{if((l.tag&e)===e){var s=l.inst,o=s.destroy;if(o!==void 0){s.destroy=void 0,a=t;var g=n,C=o;try{C()}catch(w){_e(a,g,w)}}}l=l.next}while(l!==u)}}catch(w){_e(t,t.return,w)}}function Zo(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Or(t,n)}catch(l){_e(e,e.return,l)}}}function Vo(e,t,n){n.props=In(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(l){_e(e,t,l)}}function _a(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:l=e.stateNode;break;default:l=e.stateNode}typeof n=="function"?e.refCleanup=n(l):n.current=l}}catch(a){_e(e,t,a)}}function Gt(e,t){var n=e.ref,l=e.refCleanup;if(n!==null)if(typeof l=="function")try{l()}catch(a){_e(e,t,a)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(a){_e(e,t,a)}else n.current=null}function Jo(e){var t=e.type,n=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&l.focus();break e;case"img":n.src?l.src=n.src:n.srcSet&&(l.srcset=n.srcSet)}}catch(a){_e(e,e.return,a)}}function Zc(e,t,n){try{var l=e.stateNode;fg(l,e.type,n,t),l[ct]=t}catch(a){_e(e,e.return,a)}}function ko(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Mn(e.type)||e.tag===4}function Vc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ko(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&&Mn(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Jc(e,t,n){var l=e.tag;if(l===5||l===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=Jt));else if(l!==4&&(l===27&&Mn(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Jc(e,t,n),e=e.sibling;e!==null;)Jc(e,t,n),e=e.sibling}function Gu(e,t,n){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(l!==4&&(l===27&&Mn(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Gu(e,t,n),e=e.sibling;e!==null;)Gu(e,t,n),e=e.sibling}function $o(e){var t=e.stateNode,n=e.memoizedProps;try{for(var l=e.type,a=t.attributes;a.length;)t.removeAttributeNode(a[0]);tt(t,l,n),t[We]=e,t[ct]=n}catch(u){_e(e,e.return,u)}}var ln=!1,Je=!1,kc=!1,Fo=typeof WeakSet=="function"?WeakSet:Set,Fe=null;function Gm(e,t){if(e=e.containerInfo,yf=fi,e=cr(e),Gi(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var l=n.getSelection&&n.getSelection();if(l&&l.rangeCount!==0){n=l.anchorNode;var a=l.anchorOffset,u=l.focusNode;l=l.focusOffset;try{n.nodeType,u.nodeType}catch{n=null;break e}var s=0,o=-1,g=-1,C=0,w=0,O=e,N=null;t:for(;;){for(var _;O!==n||a!==0&&O.nodeType!==3||(o=s+a),O!==u||l!==0&&O.nodeType!==3||(g=s+l),O.nodeType===3&&(s+=O.nodeValue.length),(_=O.firstChild)!==null;)N=O,O=_;for(;;){if(O===e)break t;if(N===n&&++C===a&&(o=s),N===u&&++w===l&&(g=s),(_=O.nextSibling)!==null)break;O=N,N=O.parentNode}O=_}n=o===-1||g===-1?null:{start:o,end:g}}else n=null}n=n||{start:0,end:0}}else n=null;for(vf={focusedElem:e,selectionRange:n},fi=!1,Fe=t;Fe!==null;)if(t=Fe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Fe=e;else for(;Fe!==null;){switch(t=Fe,u=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,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)!==0&&u!==null){e=void 0,n=t,a=u.memoizedProps,u=u.memoizedState,l=n.stateNode;try{var P=In(n.type,a);e=l.getSnapshotBeforeUpdate(P,u),l.__reactInternalSnapshotBeforeUpdate=e}catch(ie){_e(n,n.return,ie)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)pf(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":pf(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(c(163))}if(e=t.sibling,e!==null){e.return=t.return,Fe=e;break}Fe=t.return}}function Wo(e,t,n){var l=n.flags;switch(n.tag){case 0:case 11:case 15:un(e,n),l&4&&xa(5,n);break;case 1:if(un(e,n),l&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(s){_e(n,n.return,s)}else{var a=In(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(a,t,e.__reactInternalSnapshotBeforeUpdate)}catch(s){_e(n,n.return,s)}}l&64&&Zo(n),l&512&&_a(n,n.return);break;case 3:if(un(e,n),l&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{Or(e,t)}catch(s){_e(n,n.return,s)}}break;case 27:t===null&&l&4&&$o(n);case 26:case 5:un(e,n),t===null&&l&4&&Jo(n),l&512&&_a(n,n.return);break;case 12:un(e,n);break;case 31:un(e,n),l&4&&ed(e,n);break;case 13:un(e,n),l&4&&td(e,n),l&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Fm.bind(null,n),yg(e,n))));break;case 22:if(l=n.memoizedState!==null||ln,!l){t=t!==null&&t.memoizedState!==null||Je,a=ln;var u=Je;ln=l,(Je=t)&&!u?cn(e,n,(n.subtreeFlags&8772)!==0):un(e,n),ln=a,Je=u}break;case 30:break;default:un(e,n)}}function Io(e){var t=e.alternate;t!==null&&(e.alternate=null,Io(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&zi(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 qe=null,st=!1;function an(e,t,n){for(n=n.child;n!==null;)Po(e,t,n),n=n.sibling}function Po(e,t,n){if(mt&&typeof mt.onCommitFiberUnmount=="function")try{mt.onCommitFiberUnmount(Pl,n)}catch{}switch(n.tag){case 26:Je||Gt(n,t),an(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Je||Gt(n,t);var l=qe,a=st;Mn(n.type)&&(qe=n.stateNode,st=!1),an(e,t,n),qa(n.stateNode),qe=l,st=a;break;case 5:Je||Gt(n,t);case 6:if(l=qe,a=st,qe=null,an(e,t,n),qe=l,st=a,qe!==null)if(st)try{(qe.nodeType===9?qe.body:qe.nodeName==="HTML"?qe.ownerDocument.body:qe).removeChild(n.stateNode)}catch(u){_e(n,t,u)}else try{qe.removeChild(n.stateNode)}catch(u){_e(n,t,u)}break;case 18:qe!==null&&(st?(e=qe,Zd(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),kl(e)):Zd(qe,n.stateNode));break;case 4:l=qe,a=st,qe=n.stateNode.containerInfo,st=!0,an(e,t,n),qe=l,st=a;break;case 0:case 11:case 14:case 15:An(2,n,t),Je||An(4,n,t),an(e,t,n);break;case 1:Je||(Gt(n,t),l=n.stateNode,typeof l.componentWillUnmount=="function"&&Vo(n,t,l)),an(e,t,n);break;case 21:an(e,t,n);break;case 22:Je=(l=Je)||n.memoizedState!==null,an(e,t,n),Je=l;break;default:an(e,t,n)}}function ed(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{kl(e)}catch(n){_e(t,t.return,n)}}}function td(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{kl(e)}catch(n){_e(t,t.return,n)}}function Qm(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Fo),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Fo),t;default:throw Error(c(435,e.tag))}}function Qu(e,t){var n=Qm(e);t.forEach(function(l){if(!n.has(l)){n.add(l);var a=Wm.bind(null,e,l);l.then(a,a)}})}function rt(e,t){var n=t.deletions;if(n!==null)for(var l=0;l<n.length;l++){var a=n[l],u=e,s=t,o=s;e:for(;o!==null;){switch(o.tag){case 27:if(Mn(o.type)){qe=o.stateNode,st=!1;break e}break;case 5:qe=o.stateNode,st=!1;break e;case 3:case 4:qe=o.stateNode.containerInfo,st=!0;break e}o=o.return}if(qe===null)throw Error(c(160));Po(u,s,a),qe=null,st=!1,u=a.alternate,u!==null&&(u.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)nd(t,e),t=t.sibling}var Bt=null;function nd(e,t){var n=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:rt(t,e),ot(e),l&4&&(An(3,e,e.return),xa(3,e),An(5,e,e.return));break;case 1:rt(t,e),ot(e),l&512&&(Je||n===null||Gt(n,n.return)),l&64&&ln&&(e=e.updateQueue,e!==null&&(l=e.callbacks,l!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?l:n.concat(l))));break;case 26:var a=Bt;if(rt(t,e),ot(e),l&512&&(Je||n===null||Gt(n,n.return)),l&4){var u=n!==null?n.memoizedState:null;if(l=e.memoizedState,n===null)if(l===null)if(e.stateNode===null){e:{l=e.type,n=e.memoizedProps,a=a.ownerDocument||a;t:switch(l){case"title":u=a.getElementsByTagName("title")[0],(!u||u[na]||u[We]||u.namespaceURI==="http://www.w3.org/2000/svg"||u.hasAttribute("itemprop"))&&(u=a.createElement(l),a.head.insertBefore(u,a.querySelector("head > title"))),tt(u,l,n),u[We]=e,$e(u),l=u;break e;case"link":var s=nh("link","href",a).get(l+(n.href||""));if(s){for(var o=0;o<s.length;o++)if(u=s[o],u.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&u.getAttribute("rel")===(n.rel==null?null:n.rel)&&u.getAttribute("title")===(n.title==null?null:n.title)&&u.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(o,1);break t}}u=a.createElement(l),tt(u,l,n),a.head.appendChild(u);break;case"meta":if(s=nh("meta","content",a).get(l+(n.content||""))){for(o=0;o<s.length;o++)if(u=s[o],u.getAttribute("content")===(n.content==null?null:""+n.content)&&u.getAttribute("name")===(n.name==null?null:n.name)&&u.getAttribute("property")===(n.property==null?null:n.property)&&u.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&u.getAttribute("charset")===(n.charSet==null?null:n.charSet)){s.splice(o,1);break t}}u=a.createElement(l),tt(u,l,n),a.head.appendChild(u);break;default:throw Error(c(468,l))}u[We]=e,$e(u),l=u}e.stateNode=l}else lh(a,e.type,e.stateNode);else e.stateNode=th(a,l,e.memoizedProps);else u!==l?(u===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):u.count--,l===null?lh(a,e.type,e.stateNode):th(a,l,e.memoizedProps)):l===null&&e.stateNode!==null&&Zc(e,e.memoizedProps,n.memoizedProps)}break;case 27:rt(t,e),ot(e),l&512&&(Je||n===null||Gt(n,n.return)),n!==null&&l&4&&Zc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(rt(t,e),ot(e),l&512&&(Je||n===null||Gt(n,n.return)),e.flags&32){a=e.stateNode;try{vl(a,"")}catch(P){_e(e,e.return,P)}}l&4&&e.stateNode!=null&&(a=e.memoizedProps,Zc(e,a,n!==null?n.memoizedProps:a)),l&1024&&(kc=!0);break;case 6:if(rt(t,e),ot(e),l&4){if(e.stateNode===null)throw Error(c(162));l=e.memoizedProps,n=e.stateNode;try{n.nodeValue=l}catch(P){_e(e,e.return,P)}}break;case 3:if(ai=null,a=Bt,Bt=ni(t.containerInfo),rt(t,e),Bt=a,ot(e),l&4&&n!==null&&n.memoizedState.isDehydrated)try{kl(t.containerInfo)}catch(P){_e(e,e.return,P)}kc&&(kc=!1,ld(e));break;case 4:l=Bt,Bt=ni(e.stateNode.containerInfo),rt(t,e),ot(e),Bt=l;break;case 12:rt(t,e),ot(e);break;case 31:rt(t,e),ot(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Qu(e,l)));break;case 13:rt(t,e),ot(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Ku=ut()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Qu(e,l)));break;case 22:a=e.memoizedState!==null;var g=n!==null&&n.memoizedState!==null,C=ln,w=Je;if(ln=C||a,Je=w||g,rt(t,e),Je=w,ln=C,ot(e),l&8192)e:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||g||ln||Je||Pn(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){g=n=t;try{if(u=g.stateNode,a)s=u.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none";else{o=g.stateNode;var O=g.memoizedProps.style,N=O!=null&&O.hasOwnProperty("display")?O.display:null;o.style.display=N==null||typeof N=="boolean"?"":(""+N).trim()}}catch(P){_e(g,g.return,P)}}}else if(t.tag===6){if(n===null){g=t;try{g.stateNode.nodeValue=a?"":g.memoizedProps}catch(P){_e(g,g.return,P)}}}else if(t.tag===18){if(n===null){g=t;try{var _=g.stateNode;a?Vd(_,!0):Vd(g.stateNode,!1)}catch(P){_e(g,g.return,P)}}}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 e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}l&4&&(l=e.updateQueue,l!==null&&(n=l.retryQueue,n!==null&&(l.retryQueue=null,Qu(e,n))));break;case 19:rt(t,e),ot(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Qu(e,l)));break;case 30:break;case 21:break;default:rt(t,e),ot(e)}}function ot(e){var t=e.flags;if(t&2){try{for(var n,l=e.return;l!==null;){if(ko(l)){n=l;break}l=l.return}if(n==null)throw Error(c(160));switch(n.tag){case 27:var a=n.stateNode,u=Vc(e);Gu(e,u,a);break;case 5:var s=n.stateNode;n.flags&32&&(vl(s,""),n.flags&=-33);var o=Vc(e);Gu(e,o,s);break;case 3:case 4:var g=n.stateNode.containerInfo,C=Vc(e);Jc(e,C,g);break;default:throw Error(c(161))}}catch(w){_e(e,e.return,w)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function ld(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;ld(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function un(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Wo(e,t.alternate,t),t=t.sibling}function Pn(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:An(4,t,t.return),Pn(t);break;case 1:Gt(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&Vo(t,t.return,n),Pn(t);break;case 27:qa(t.stateNode);case 26:case 5:Gt(t,t.return),Pn(t);break;case 22:t.memoizedState===null&&Pn(t);break;case 30:Pn(t);break;default:Pn(t)}e=e.sibling}}function cn(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var l=t.alternate,a=e,u=t,s=u.flags;switch(u.tag){case 0:case 11:case 15:cn(a,u,n),xa(4,u);break;case 1:if(cn(a,u,n),l=u,a=l.stateNode,typeof a.componentDidMount=="function")try{a.componentDidMount()}catch(C){_e(l,l.return,C)}if(l=u,a=l.updateQueue,a!==null){var o=l.stateNode;try{var g=a.shared.hiddenCallbacks;if(g!==null)for(a.shared.hiddenCallbacks=null,a=0;a<g.length;a++)Ur(g[a],o)}catch(C){_e(l,l.return,C)}}n&&s&64&&Zo(u),_a(u,u.return);break;case 27:$o(u);case 26:case 5:cn(a,u,n),n&&l===null&&s&4&&Jo(u),_a(u,u.return);break;case 12:cn(a,u,n);break;case 31:cn(a,u,n),n&&s&4&&ed(a,u);break;case 13:cn(a,u,n),n&&s&4&&td(a,u);break;case 22:u.memoizedState===null&&cn(a,u,n),_a(u,u.return);break;case 30:break;default:cn(a,u,n)}t=t.sibling}}function $c(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&&ga(n))}function Fc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ga(e))}function Ht(e,t,n,l){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)ad(e,t,n,l),t=t.sibling}function ad(e,t,n,l){var a=t.flags;switch(t.tag){case 0:case 11:case 15:Ht(e,t,n,l),a&2048&&xa(9,t);break;case 1:Ht(e,t,n,l);break;case 3:Ht(e,t,n,l),a&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ga(e)));break;case 12:if(a&2048){Ht(e,t,n,l),e=t.stateNode;try{var u=t.memoizedProps,s=u.id,o=u.onPostCommit;typeof o=="function"&&o(s,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(g){_e(t,t.return,g)}}else Ht(e,t,n,l);break;case 31:Ht(e,t,n,l);break;case 13:Ht(e,t,n,l);break;case 23:break;case 22:u=t.stateNode,s=t.alternate,t.memoizedState!==null?u._visibility&2?Ht(e,t,n,l):Ma(e,t):u._visibility&2?Ht(e,t,n,l):(u._visibility|=2,Hl(e,t,n,l,(t.subtreeFlags&10256)!==0||!1)),a&2048&&$c(s,t);break;case 24:Ht(e,t,n,l),a&2048&&Fc(t.alternate,t);break;default:Ht(e,t,n,l)}}function Hl(e,t,n,l,a){for(a=a&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var u=e,s=t,o=n,g=l,C=s.flags;switch(s.tag){case 0:case 11:case 15:Hl(u,s,o,g,a),xa(8,s);break;case 23:break;case 22:var w=s.stateNode;s.memoizedState!==null?w._visibility&2?Hl(u,s,o,g,a):Ma(u,s):(w._visibility|=2,Hl(u,s,o,g,a)),a&&C&2048&&$c(s.alternate,s);break;case 24:Hl(u,s,o,g,a),a&&C&2048&&Fc(s.alternate,s);break;default:Hl(u,s,o,g,a)}t=t.sibling}}function Ma(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,l=t,a=l.flags;switch(l.tag){case 22:Ma(n,l),a&2048&&$c(l.alternate,l);break;case 24:Ma(n,l),a&2048&&Fc(l.alternate,l);break;default:Ma(n,l)}t=t.sibling}}var wa=8192;function ql(e,t,n){if(e.subtreeFlags&wa)for(e=e.child;e!==null;)ud(e,t,n),e=e.sibling}function ud(e,t,n){switch(e.tag){case 26:ql(e,t,n),e.flags&wa&&e.memoizedState!==null&&xg(n,Bt,e.memoizedState,e.memoizedProps);break;case 5:ql(e,t,n);break;case 3:case 4:var l=Bt;Bt=ni(e.stateNode.containerInfo),ql(e,t,n),Bt=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=wa,wa=16777216,ql(e,t,n),wa=l):ql(e,t,n));break;default:ql(e,t,n)}}function id(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 Ra(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var l=t[n];Fe=l,fd(l,e)}id(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)cd(e),e=e.sibling}function cd(e){switch(e.tag){case 0:case 11:case 15:Ra(e),e.flags&2048&&An(9,e,e.return);break;case 3:Ra(e);break;case 12:Ra(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Xu(e)):Ra(e);break;default:Ra(e)}}function Xu(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var l=t[n];Fe=l,fd(l,e)}id(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:An(8,t,t.return),Xu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Xu(t));break;default:Xu(t)}e=e.sibling}}function fd(e,t){for(;Fe!==null;){var n=Fe;switch(n.tag){case 0:case 11:case 15:An(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var l=n.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:ga(n.memoizedState.cache)}if(l=n.child,l!==null)l.return=n,Fe=l;else e:for(n=e;Fe!==null;){l=Fe;var a=l.sibling,u=l.return;if(Io(l),l===n){Fe=null;break e}if(a!==null){a.return=u,Fe=a;break e}Fe=u}}}var Xm={getCacheForType:function(e){var t=Pe(Ke),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Pe(Ke).controller.signal}},Km=typeof WeakMap=="function"?WeakMap:Map,je=0,Oe=null,ye=null,Se=0,xe=0,pt=null,zn=!1,Yl=!1,Wc=!1,fn=0,Ge=0,Cn=0,el=0,Ic=0,Et=0,Ll=0,Ua=null,dt=null,Pc=!1,Ku=0,sd=0,Zu=1/0,Vu=null,Nn=null,ke=0,jn=null,Gl=null,sn=0,ef=0,tf=null,rd=null,Oa=0,nf=null;function Tt(){return(je&2)!==0&&Se!==0?Se&-Se:M.T!==null?sf():Cs()}function od(){if(Et===0)if((Se&536870912)===0||Ee){var e=eu;eu<<=1,(eu&3932160)===0&&(eu=262144),Et=e}else Et=536870912;return e=bt.current,e!==null&&(e.flags|=32),Et}function ht(e,t,n){(e===Oe&&(xe===2||xe===9)||e.cancelPendingCommit!==null)&&(Ql(e,0),xn(e,Se,Et,!1)),ta(e,n),((je&2)===0||e!==Oe)&&(e===Oe&&((je&2)===0&&(el|=n),Ge===4&&xn(e,Se,Et,!1)),Qt(e))}function dd(e,t,n){if((je&6)!==0)throw Error(c(327));var l=!n&&(t&127)===0&&(t&e.expiredLanes)===0||ea(e,t),a=l?Jm(e,t):af(e,t,!0),u=l;do{if(a===0){Yl&&!l&&xn(e,t,0,!1);break}else{if(n=e.current.alternate,u&&!Zm(n)){a=af(e,t,!1),u=!1;continue}if(a===2){if(u=t,e.errorRecoveryDisabledLanes&u)var s=0;else s=e.pendingLanes&-536870913,s=s!==0?s:s&536870912?536870912:0;if(s!==0){t=s;e:{var o=e;a=Ua;var g=o.current.memoizedState.isDehydrated;if(g&&(Ql(o,s).flags|=256),s=af(o,s,!1),s!==2){if(Wc&&!g){o.errorRecoveryDisabledLanes|=u,el|=u,a=4;break e}u=dt,dt=a,u!==null&&(dt===null?dt=u:dt.push.apply(dt,u))}a=s}if(u=!1,a!==2)continue}}if(a===1){Ql(e,0),xn(e,t,0,!0);break}e:{switch(l=e,u=a,u){case 0:case 1:throw Error(c(345));case 4:if((t&4194048)!==t)break;case 6:xn(l,t,Et,!zn);break e;case 2:dt=null;break;case 3:case 5:break;default:throw Error(c(329))}if((t&62914560)===t&&(a=Ku+300-ut(),10<a)){if(xn(l,t,Et,!zn),nu(l,0,!0)!==0)break e;sn=t,l.timeoutHandle=Xd(hd.bind(null,l,n,dt,Vu,Pc,t,Et,el,Ll,zn,u,"Throttled",-0,0),a);break e}hd(l,n,dt,Vu,Pc,t,Et,el,Ll,zn,u,null,-0,0)}}break}while(!0);Qt(e)}function hd(e,t,n,l,a,u,s,o,g,C,w,O,N,_){if(e.timeoutHandle=-1,O=t.subtreeFlags,O&8192||(O&16785408)===16785408){O={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Jt},ud(t,u,O);var P=(u&62914560)===u?Ku-ut():(u&4194048)===u?sd-ut():0;if(P=_g(O,P),P!==null){sn=u,e.cancelPendingCommit=P(Ed.bind(null,e,t,u,n,l,a,s,o,g,w,O,null,N,_)),xn(e,u,s,!C);return}}Ed(e,t,u,n,l,a,s,o,g)}function Zm(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 l=0;l<n.length;l++){var a=n[l],u=a.getSnapshot;a=a.value;try{if(!yt(u(),a))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 xn(e,t,n,l){t&=~Ic,t&=~el,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var a=t;0<a;){var u=31-gt(a),s=1<<u;l[u]=-1,a&=~s}n!==0&&Ts(e,n,t)}function Ju(){return(je&6)===0?(Da(0),!1):!0}function lf(){if(ye!==null){if(xe===0)var e=ye.return;else e=ye,Wt=Zn=null,Sc(e),Rl=null,va=0,e=ye;for(;e!==null;)Ko(e.alternate,e),e=e.return;ye=null}}function Ql(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,og(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),sn=0,lf(),Oe=e,ye=n=$t(e.current,null),Se=t,xe=0,pt=null,zn=!1,Yl=ea(e,t),Wc=!1,Ll=Et=Ic=el=Cn=Ge=0,dt=Ua=null,Pc=!1,(t&8)!==0&&(t|=t&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=t;0<l;){var a=31-gt(l),u=1<<a;t|=e[a],l&=~u}return fn=t,mu(),n}function md(e,t){me=null,M.H=Ca,t===wl||t===Tu?(t=_r(),xe=3):t===cc?(t=_r(),xe=4):xe=t===Dc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,pt=t,ye===null&&(Ge=1,Bu(e,xt(t,e.current)))}function gd(){var e=bt.current;return e===null?!0:(Se&4194048)===Se?Rt===null:(Se&62914560)===Se||(Se&536870912)!==0?e===Rt:!1}function yd(){var e=M.H;return M.H=Ca,e===null?Ca:e}function vd(){var e=M.A;return M.A=Xm,e}function ku(){Ge=4,zn||(Se&4194048)!==Se&&bt.current!==null||(Yl=!0),(Cn&134217727)===0&&(el&134217727)===0||Oe===null||xn(Oe,Se,Et,!1)}function af(e,t,n){var l=je;je|=2;var a=yd(),u=vd();(Oe!==e||Se!==t)&&(Vu=null,Ql(e,t)),t=!1;var s=Ge;e:do try{if(xe!==0&&ye!==null){var o=ye,g=pt;switch(xe){case 8:lf(),s=6;break e;case 3:case 2:case 9:case 6:bt.current===null&&(t=!0);var C=xe;if(xe=0,pt=null,Xl(e,o,g,C),n&&Yl){s=0;break e}break;default:C=xe,xe=0,pt=null,Xl(e,o,g,C)}}Vm(),s=Ge;break}catch(w){md(e,w)}while(!0);return t&&e.shellSuspendCounter++,Wt=Zn=null,je=l,M.H=a,M.A=u,ye===null&&(Oe=null,Se=0,mu()),s}function Vm(){for(;ye!==null;)bd(ye)}function Jm(e,t){var n=je;je|=2;var l=yd(),a=vd();Oe!==e||Se!==t?(Vu=null,Zu=ut()+500,Ql(e,t)):Yl=ea(e,t);e:do try{if(xe!==0&&ye!==null){t=ye;var u=pt;t:switch(xe){case 1:xe=0,pt=null,Xl(e,t,u,1);break;case 2:case 9:if(jr(u)){xe=0,pt=null,Sd(t);break}t=function(){xe!==2&&xe!==9||Oe!==e||(xe=7),Qt(e)},u.then(t,t);break e;case 3:xe=7;break e;case 4:xe=5;break e;case 7:jr(u)?(xe=0,pt=null,Sd(t)):(xe=0,pt=null,Xl(e,t,u,7));break;case 5:var s=null;switch(ye.tag){case 26:s=ye.memoizedState;case 5:case 27:var o=ye;if(s?ah(s):o.stateNode.complete){xe=0,pt=null;var g=o.sibling;if(g!==null)ye=g;else{var C=o.return;C!==null?(ye=C,$u(C)):ye=null}break t}}xe=0,pt=null,Xl(e,t,u,5);break;case 6:xe=0,pt=null,Xl(e,t,u,6);break;case 8:lf(),Ge=6;break e;default:throw Error(c(462))}}km();break}catch(w){md(e,w)}while(!0);return Wt=Zn=null,M.H=l,M.A=a,je=n,ye!==null?0:(Oe=null,Se=0,mu(),Ge)}function km(){for(;ye!==null&&!Si();)bd(ye)}function bd(e){var t=Qo(e.alternate,e,fn);e.memoizedProps=e.pendingProps,t===null?$u(e):ye=t}function Sd(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Bo(n,t,t.pendingProps,t.type,void 0,Se);break;case 11:t=Bo(n,t,t.pendingProps,t.type.render,t.ref,Se);break;case 5:Sc(t);default:Ko(n,t),t=ye=yr(t,fn),t=Qo(n,t,fn)}e.memoizedProps=e.pendingProps,t===null?$u(e):ye=t}function Xl(e,t,n,l){Wt=Zn=null,Sc(t),Rl=null,va=0;var a=t.return;try{if(Bm(e,a,t,n,Se)){Ge=1,Bu(e,xt(n,e.current)),ye=null;return}}catch(u){if(a!==null)throw ye=a,u;Ge=1,Bu(e,xt(n,e.current)),ye=null;return}t.flags&32768?(Ee||l===1?e=!0:Yl||(Se&536870912)!==0?e=!1:(zn=e=!0,(l===2||l===9||l===3||l===6)&&(l=bt.current,l!==null&&l.tag===13&&(l.flags|=16384))),pd(t,e)):$u(t)}function $u(e){var t=e;do{if((t.flags&32768)!==0){pd(t,zn);return}e=t.return;var n=Ym(t.alternate,t,fn);if(n!==null){ye=n;return}if(t=t.sibling,t!==null){ye=t;return}ye=t=e}while(t!==null);Ge===0&&(Ge=5)}function pd(e,t){do{var n=Lm(e.alternate,e);if(n!==null){n.flags&=32767,ye=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){ye=e;return}ye=e=n}while(e!==null);Ge=6,ye=null}function Ed(e,t,n,l,a,u,s,o,g){e.cancelPendingCommit=null;do Fu();while(ke!==0);if((je&6)!==0)throw Error(c(327));if(t!==null){if(t===e.current)throw Error(c(177));if(u=t.lanes|t.childLanes,u|=Vi,j0(e,n,u,s,o,g),e===Oe&&(ye=Oe=null,Se=0),Gl=t,jn=e,sn=n,ef=u,tf=a,rd=l,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Im(De,function(){return Nd(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=M.T,M.T=null,a=G.p,G.p=2,s=je,je|=4;try{Gm(e,t,n)}finally{je=s,G.p=a,M.T=l}}ke=1,Td(),Ad(),zd()}}function Td(){if(ke===1){ke=0;var e=jn,t=Gl,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=M.T,M.T=null;var l=G.p;G.p=2;var a=je;je|=4;try{nd(t,e);var u=vf,s=cr(e.containerInfo),o=u.focusedElem,g=u.selectionRange;if(s!==o&&o&&o.ownerDocument&&ir(o.ownerDocument.documentElement,o)){if(g!==null&&Gi(o)){var C=g.start,w=g.end;if(w===void 0&&(w=C),"selectionStart"in o)o.selectionStart=C,o.selectionEnd=Math.min(w,o.value.length);else{var O=o.ownerDocument||document,N=O&&O.defaultView||window;if(N.getSelection){var _=N.getSelection(),P=o.textContent.length,ie=Math.min(g.start,P),Ue=g.end===void 0?ie:Math.min(g.end,P);!_.extend&&ie>Ue&&(s=Ue,Ue=ie,ie=s);var T=ur(o,ie),S=ur(o,Ue);if(T&&S&&(_.rangeCount!==1||_.anchorNode!==T.node||_.anchorOffset!==T.offset||_.focusNode!==S.node||_.focusOffset!==S.offset)){var z=O.createRange();z.setStart(T.node,T.offset),_.removeAllRanges(),ie>Ue?(_.addRange(z),_.extend(S.node,S.offset)):(z.setEnd(S.node,S.offset),_.addRange(z))}}}}for(O=[],_=o;_=_.parentNode;)_.nodeType===1&&O.push({element:_,left:_.scrollLeft,top:_.scrollTop});for(typeof o.focus=="function"&&o.focus(),o=0;o<O.length;o++){var U=O[o];U.element.scrollLeft=U.left,U.element.scrollTop=U.top}}fi=!!yf,vf=yf=null}finally{je=a,G.p=l,M.T=n}}e.current=t,ke=2}}function Ad(){if(ke===2){ke=0;var e=jn,t=Gl,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=M.T,M.T=null;var l=G.p;G.p=2;var a=je;je|=4;try{Wo(e,t.alternate,t)}finally{je=a,G.p=l,M.T=n}}ke=3}}function zd(){if(ke===4||ke===3){ke=0,sl();var e=jn,t=Gl,n=sn,l=rd;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?ke=5:(ke=0,Gl=jn=null,Cd(e,e.pendingLanes));var a=e.pendingLanes;if(a===0&&(Nn=null),Ti(n),t=t.stateNode,mt&&typeof mt.onCommitFiberRoot=="function")try{mt.onCommitFiberRoot(Pl,t,void 0,(t.current.flags&128)===128)}catch{}if(l!==null){t=M.T,a=G.p,G.p=2,M.T=null;try{for(var u=e.onRecoverableError,s=0;s<l.length;s++){var o=l[s];u(o.value,{componentStack:o.stack})}}finally{M.T=t,G.p=a}}(sn&3)!==0&&Fu(),Qt(e),a=e.pendingLanes,(n&261930)!==0&&(a&42)!==0?e===nf?Oa++:(Oa=0,nf=e):Oa=0,Da(0)}}function Cd(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ga(t)))}function Fu(){return Td(),Ad(),zd(),Nd()}function Nd(){if(ke!==5)return!1;var e=jn,t=ef;ef=0;var n=Ti(sn),l=M.T,a=G.p;try{G.p=32>n?32:n,M.T=null,n=tf,tf=null;var u=jn,s=sn;if(ke=0,Gl=jn=null,sn=0,(je&6)!==0)throw Error(c(331));var o=je;if(je|=4,cd(u.current),ad(u,u.current,s,n),je=o,Da(0,!1),mt&&typeof mt.onPostCommitFiberRoot=="function")try{mt.onPostCommitFiberRoot(Pl,u)}catch{}return!0}finally{G.p=a,M.T=l,Cd(e,t)}}function jd(e,t,n){t=xt(n,t),t=Oc(e.stateNode,t,2),e=pn(e,t,2),e!==null&&(ta(e,2),Qt(e))}function _e(e,t,n){if(e.tag===3)jd(e,e,n);else for(;t!==null;){if(t.tag===3){jd(t,e,n);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Nn===null||!Nn.has(l))){e=xt(n,e),n=xo(2),l=pn(t,n,2),l!==null&&(_o(n,l,t,e),ta(l,2),Qt(l));break}}t=t.return}}function uf(e,t,n){var l=e.pingCache;if(l===null){l=e.pingCache=new Km;var a=new Set;l.set(t,a)}else a=l.get(t),a===void 0&&(a=new Set,l.set(t,a));a.has(n)||(Wc=!0,a.add(n),e=$m.bind(null,e,t,n),t.then(e,e))}function $m(e,t,n){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Oe===e&&(Se&n)===n&&(Ge===4||Ge===3&&(Se&62914560)===Se&&300>ut()-Ku?(je&2)===0&&Ql(e,0):Ic|=n,Ll===Se&&(Ll=0)),Qt(e)}function xd(e,t){t===0&&(t=Es()),e=Qn(e,t),e!==null&&(ta(e,t),Qt(e))}function Fm(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),xd(e,n)}function Wm(e,t){var n=0;switch(e.tag){case 31:case 13:var l=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(c(314))}l!==null&&l.delete(t),xd(e,n)}function Im(e,t){return cl(e,t)}var Wu=null,Kl=null,cf=!1,Iu=!1,ff=!1,_n=0;function Qt(e){e!==Kl&&e.next===null&&(Kl===null?Wu=Kl=e:Kl=Kl.next=e),Iu=!0,cf||(cf=!0,eg())}function Da(e,t){if(!ff&&Iu){ff=!0;do for(var n=!1,l=Wu;l!==null;){if(e!==0){var a=l.pendingLanes;if(a===0)var u=0;else{var s=l.suspendedLanes,o=l.pingedLanes;u=(1<<31-gt(42|e)+1)-1,u&=a&~(s&~o),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(n=!0,Rd(l,u))}else u=Se,u=nu(l,l===Oe?u:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(u&3)===0||ea(l,u)||(n=!0,Rd(l,u));l=l.next}while(n);ff=!1}}function Pm(){_d()}function _d(){Iu=cf=!1;var e=0;_n!==0&&rg()&&(e=_n);for(var t=ut(),n=null,l=Wu;l!==null;){var a=l.next,u=Md(l,t);u===0?(l.next=null,n===null?Wu=a:n.next=a,a===null&&(Kl=n)):(n=l,(e!==0||(u&3)!==0)&&(Iu=!0)),l=a}ke!==0&&ke!==5||Da(e),_n!==0&&(_n=0)}function Md(e,t){for(var n=e.suspendedLanes,l=e.pingedLanes,a=e.expirationTimes,u=e.pendingLanes&-62914561;0<u;){var s=31-gt(u),o=1<<s,g=a[s];g===-1?((o&n)===0||(o&l)!==0)&&(a[s]=N0(o,t)):g<=t&&(e.expiredLanes|=o),u&=~o}if(t=Oe,n=Se,n=nu(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,n===0||e===t&&(xe===2||xe===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&fl(l),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||ea(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(l!==null&&fl(l),Ti(n)){case 2:case 8:n=he;break;case 32:n=De;break;case 268435456:n=rl;break;default:n=De}return l=wd.bind(null,e),n=cl(n,l),e.callbackPriority=t,e.callbackNode=n,t}return l!==null&&l!==null&&fl(l),e.callbackPriority=2,e.callbackNode=null,2}function wd(e,t){if(ke!==0&&ke!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Fu()&&e.callbackNode!==n)return null;var l=Se;return l=nu(e,e===Oe?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(dd(e,l,t),Md(e,ut()),e.callbackNode!=null&&e.callbackNode===n?wd.bind(null,e):null)}function Rd(e,t){if(Fu())return null;dd(e,t,!0)}function eg(){dg(function(){(je&6)!==0?cl(k,Pm):_d()})}function sf(){if(_n===0){var e=_l;e===0&&(e=Pa,Pa<<=1,(Pa&261888)===0&&(Pa=256)),_n=e}return _n}function Ud(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:iu(""+e)}function Od(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 tg(e,t,n,l,a){if(t==="submit"&&n&&n.stateNode===a){var u=Ud((a[ct]||null).action),s=l.submitter;s&&(t=(t=s[ct]||null)?Ud(t.formAction):s.getAttribute("formAction"),t!==null&&(u=t,s=null));var o=new ru("action","action",null,l,a);e.push({event:o,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(_n!==0){var g=s?Od(a,s):new FormData(a);xc(n,{pending:!0,data:g,method:a.method,action:u},null,g)}}else typeof u=="function"&&(o.preventDefault(),g=s?Od(a,s):new FormData(a),xc(n,{pending:!0,data:g,method:a.method,action:u},u,g))},currentTarget:a}]})}}for(var rf=0;rf<Zi.length;rf++){var of=Zi[rf],ng=of.toLowerCase(),lg=of[0].toUpperCase()+of.slice(1);Dt(ng,"on"+lg)}Dt(rr,"onAnimationEnd"),Dt(or,"onAnimationIteration"),Dt(dr,"onAnimationStart"),Dt("dblclick","onDoubleClick"),Dt("focusin","onFocus"),Dt("focusout","onBlur"),Dt(Sm,"onTransitionRun"),Dt(pm,"onTransitionStart"),Dt(Em,"onTransitionCancel"),Dt(hr,"onTransitionEnd"),gl("onMouseEnter",["mouseout","mouseover"]),gl("onMouseLeave",["mouseout","mouseover"]),gl("onPointerEnter",["pointerout","pointerover"]),gl("onPointerLeave",["pointerout","pointerover"]),qn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),qn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),qn("onBeforeInput",["compositionend","keypress","textInput","paste"]),qn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),qn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),qn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ba="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(" "),ag=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ba));function Dd(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var l=e[n],a=l.event;l=l.listeners;e:{var u=void 0;if(t)for(var s=l.length-1;0<=s;s--){var o=l[s],g=o.instance,C=o.currentTarget;if(o=o.listener,g!==u&&a.isPropagationStopped())break e;u=o,a.currentTarget=C;try{u(a)}catch(w){hu(w)}a.currentTarget=null,u=g}else for(s=0;s<l.length;s++){if(o=l[s],g=o.instance,C=o.currentTarget,o=o.listener,g!==u&&a.isPropagationStopped())break e;u=o,a.currentTarget=C;try{u(a)}catch(w){hu(w)}a.currentTarget=null,u=g}}}}function ve(e,t){var n=t[Ai];n===void 0&&(n=t[Ai]=new Set);var l=e+"__bubble";n.has(l)||(Bd(t,e,2,!1),n.add(l))}function df(e,t,n){var l=0;t&&(l|=4),Bd(n,e,l,t)}var Pu="_reactListening"+Math.random().toString(36).slice(2);function hf(e){if(!e[Pu]){e[Pu]=!0,xs.forEach(function(n){n!=="selectionchange"&&(ag.has(n)||df(n,!1,e),df(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Pu]||(t[Pu]=!0,df("selectionchange",!1,t))}}function Bd(e,t,n,l){switch(oh(t)){case 2:var a=Rg;break;case 8:a=Ug;break;default:a=xf}n=a.bind(null,t,n,e),a=void 0,!Ri||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),l?a!==void 0?e.addEventListener(t,n,{capture:!0,passive:a}):e.addEventListener(t,n,!0):a!==void 0?e.addEventListener(t,n,{passive:a}):e.addEventListener(t,n,!1)}function mf(e,t,n,l,a){var u=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var s=l.tag;if(s===3||s===4){var o=l.stateNode.containerInfo;if(o===a)break;if(s===4)for(s=l.return;s!==null;){var g=s.tag;if((g===3||g===4)&&s.stateNode.containerInfo===a)return;s=s.return}for(;o!==null;){if(s=dl(o),s===null)return;if(g=s.tag,g===5||g===6||g===26||g===27){l=u=s;continue e}o=o.parentNode}}l=l.return}Ls(function(){var C=u,w=Mi(n),O=[];e:{var N=mr.get(e);if(N!==void 0){var _=ru,P=e;switch(e){case"keypress":if(fu(n)===0)break e;case"keydown":case"keyup":_=W0;break;case"focusin":P="focus",_=Bi;break;case"focusout":P="blur",_=Bi;break;case"beforeblur":case"afterblur":_=Bi;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":_=Xs;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":_=Y0;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":_=em;break;case rr:case or:case dr:_=Q0;break;case hr:_=nm;break;case"scroll":case"scrollend":_=H0;break;case"wheel":_=am;break;case"copy":case"cut":case"paste":_=K0;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":_=Zs;break;case"toggle":case"beforetoggle":_=im}var ie=(t&4)!==0,Ue=!ie&&(e==="scroll"||e==="scrollend"),T=ie?N!==null?N+"Capture":null:N;ie=[];for(var S=C,z;S!==null;){var U=S;if(z=U.stateNode,U=U.tag,U!==5&&U!==26&&U!==27||z===null||T===null||(U=aa(S,T),U!=null&&ie.push(Ha(S,U,z))),Ue)break;S=S.return}0<ie.length&&(N=new _(N,P,null,n,w),O.push({event:N,listeners:ie}))}}if((t&7)===0){e:{if(N=e==="mouseover"||e==="pointerover",_=e==="mouseout"||e==="pointerout",N&&n!==_i&&(P=n.relatedTarget||n.fromElement)&&(dl(P)||P[ol]))break e;if((_||N)&&(N=w.window===w?w:(N=w.ownerDocument)?N.defaultView||N.parentWindow:window,_?(P=n.relatedTarget||n.toElement,_=C,P=P?dl(P):null,P!==null&&(Ue=h(P),ie=P.tag,P!==Ue||ie!==5&&ie!==27&&ie!==6)&&(P=null)):(_=null,P=C),_!==P)){if(ie=Xs,U="onMouseLeave",T="onMouseEnter",S="mouse",(e==="pointerout"||e==="pointerover")&&(ie=Zs,U="onPointerLeave",T="onPointerEnter",S="pointer"),Ue=_==null?N:la(_),z=P==null?N:la(P),N=new ie(U,S+"leave",_,n,w),N.target=Ue,N.relatedTarget=z,U=null,dl(w)===C&&(ie=new ie(T,S+"enter",P,n,w),ie.target=z,ie.relatedTarget=Ue,U=ie),Ue=U,_&&P)t:{for(ie=ug,T=_,S=P,z=0,U=T;U;U=ie(U))z++;U=0;for(var le=S;le;le=ie(le))U++;for(;0<z-U;)T=ie(T),z--;for(;0<U-z;)S=ie(S),U--;for(;z--;){if(T===S||S!==null&&T===S.alternate){ie=T;break t}T=ie(T),S=ie(S)}ie=null}else ie=null;_!==null&&Hd(O,N,_,ie,!1),P!==null&&Ue!==null&&Hd(O,Ue,P,ie,!0)}}e:{if(N=C?la(C):window,_=N.nodeName&&N.nodeName.toLowerCase(),_==="select"||_==="input"&&N.type==="file")var ze=Ps;else if(Ws(N))if(er)ze=ym;else{ze=mm;var te=hm}else _=N.nodeName,!_||_.toLowerCase()!=="input"||N.type!=="checkbox"&&N.type!=="radio"?C&&xi(C.elementType)&&(ze=Ps):ze=gm;if(ze&&(ze=ze(e,C))){Is(O,ze,n,w);break e}te&&te(e,N,C),e==="focusout"&&C&&N.type==="number"&&C.memoizedProps.value!=null&&ji(N,"number",N.value)}switch(te=C?la(C):window,e){case"focusin":(Ws(te)||te.contentEditable==="true")&&(El=te,Qi=C,da=null);break;case"focusout":da=Qi=El=null;break;case"mousedown":Xi=!0;break;case"contextmenu":case"mouseup":case"dragend":Xi=!1,fr(O,n,w);break;case"selectionchange":if(bm)break;case"keydown":case"keyup":fr(O,n,w)}var ge;if(qi)e:{switch(e){case"compositionstart":var pe="onCompositionStart";break e;case"compositionend":pe="onCompositionEnd";break e;case"compositionupdate":pe="onCompositionUpdate";break e}pe=void 0}else pl?$s(e,n)&&(pe="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(pe="onCompositionStart");pe&&(Vs&&n.locale!=="ko"&&(pl||pe!=="onCompositionStart"?pe==="onCompositionEnd"&&pl&&(ge=Gs()):(hn=w,Ui="value"in hn?hn.value:hn.textContent,pl=!0)),te=ei(C,pe),0<te.length&&(pe=new Ks(pe,e,null,n,w),O.push({event:pe,listeners:te}),ge?pe.data=ge:(ge=Fs(n),ge!==null&&(pe.data=ge)))),(ge=fm?sm(e,n):rm(e,n))&&(pe=ei(C,"onBeforeInput"),0<pe.length&&(te=new Ks("onBeforeInput","beforeinput",null,n,w),O.push({event:te,listeners:pe}),te.data=ge)),tg(O,e,C,n,w)}Dd(O,t)})}function Ha(e,t,n){return{instance:e,listener:t,currentTarget:n}}function ei(e,t){for(var n=t+"Capture",l=[];e!==null;){var a=e,u=a.stateNode;if(a=a.tag,a!==5&&a!==26&&a!==27||u===null||(a=aa(e,n),a!=null&&l.unshift(Ha(e,a,u)),a=aa(e,t),a!=null&&l.push(Ha(e,a,u))),e.tag===3)return l;e=e.return}return[]}function ug(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Hd(e,t,n,l,a){for(var u=t._reactName,s=[];n!==null&&n!==l;){var o=n,g=o.alternate,C=o.stateNode;if(o=o.tag,g!==null&&g===l)break;o!==5&&o!==26&&o!==27||C===null||(g=C,a?(C=aa(n,u),C!=null&&s.unshift(Ha(n,C,g))):a||(C=aa(n,u),C!=null&&s.push(Ha(n,C,g)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var ig=/\\r\\n?/g,cg=/\\u0000|\\uFFFD/g;function qd(e){return(typeof e=="string"?e:""+e).replace(ig,\`
16
+ \`).replace(cg,"")}function Yd(e,t){return t=qd(t),qd(e)===t}function Re(e,t,n,l,a,u){switch(n){case"children":typeof l=="string"?t==="body"||t==="textarea"&&l===""||vl(e,l):(typeof l=="number"||typeof l=="bigint")&&t!=="body"&&vl(e,""+l);break;case"className":au(e,"class",l);break;case"tabIndex":au(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":au(e,n,l);break;case"style":qs(e,l,u);break;case"data":if(t!=="object"){au(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(n);break}l=iu(""+l),e.setAttribute(n,l);break;case"action":case"formAction":if(typeof l=="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 u=="function"&&(n==="formAction"?(t!=="input"&&Re(e,t,"name",a.name,a,null),Re(e,t,"formEncType",a.formEncType,a,null),Re(e,t,"formMethod",a.formMethod,a,null),Re(e,t,"formTarget",a.formTarget,a,null)):(Re(e,t,"encType",a.encType,a,null),Re(e,t,"method",a.method,a,null),Re(e,t,"target",a.target,a,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(n);break}l=iu(""+l),e.setAttribute(n,l);break;case"onClick":l!=null&&(e.onclick=Jt);break;case"onScroll":l!=null&&ve("scroll",e);break;case"onScrollEnd":l!=null&&ve("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(c(61));if(n=l.__html,n!=null){if(a.children!=null)throw Error(c(60));e.innerHTML=n}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}n=iu(""+l),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":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,""+l):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":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":l===!0?e.setAttribute(n,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,l):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(n,l):e.removeAttribute(n);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(n):e.setAttribute(n,l);break;case"popover":ve("beforetoggle",e),ve("toggle",e),lu(e,"popover",l);break;case"xlinkActuate":Vt(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Vt(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Vt(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Vt(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Vt(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Vt(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Vt(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Vt(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Vt(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":lu(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=D0.get(n)||n,lu(e,n,l))}}function gf(e,t,n,l,a,u){switch(n){case"style":qs(e,l,u);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(c(61));if(n=l.__html,n!=null){if(a.children!=null)throw Error(c(60));e.innerHTML=n}}break;case"children":typeof l=="string"?vl(e,l):(typeof l=="number"||typeof l=="bigint")&&vl(e,""+l);break;case"onScroll":l!=null&&ve("scroll",e);break;case"onScrollEnd":l!=null&&ve("scrollend",e);break;case"onClick":l!=null&&(e.onclick=Jt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!_s.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(a=n.endsWith("Capture"),t=n.slice(2,a?n.length-7:void 0),u=e[ct]||null,u=u!=null?u[n]:null,typeof u=="function"&&e.removeEventListener(t,u,a),typeof l=="function")){typeof u!="function"&&u!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,l,a);break e}n in e?e[n]=l:l===!0?e.setAttribute(n,""):lu(e,n,l)}}}function tt(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ve("error",e),ve("load",e);var l=!1,a=!1,u;for(u in n)if(n.hasOwnProperty(u)){var s=n[u];if(s!=null)switch(u){case"src":l=!0;break;case"srcSet":a=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:Re(e,t,u,s,n,null)}}a&&Re(e,t,"srcSet",n.srcSet,n,null),l&&Re(e,t,"src",n.src,n,null);return;case"input":ve("invalid",e);var o=u=s=a=null,g=null,C=null;for(l in n)if(n.hasOwnProperty(l)){var w=n[l];if(w!=null)switch(l){case"name":a=w;break;case"type":s=w;break;case"checked":g=w;break;case"defaultChecked":C=w;break;case"value":u=w;break;case"defaultValue":o=w;break;case"children":case"dangerouslySetInnerHTML":if(w!=null)throw Error(c(137,t));break;default:Re(e,t,l,w,n,null)}}Os(e,u,o,g,C,s,a,!1);return;case"select":ve("invalid",e),l=s=u=null;for(a in n)if(n.hasOwnProperty(a)&&(o=n[a],o!=null))switch(a){case"value":u=o;break;case"defaultValue":s=o;break;case"multiple":l=o;default:Re(e,t,a,o,n,null)}t=u,n=s,e.multiple=!!l,t!=null?yl(e,!!l,t,!1):n!=null&&yl(e,!!l,n,!0);return;case"textarea":ve("invalid",e),u=a=l=null;for(s in n)if(n.hasOwnProperty(s)&&(o=n[s],o!=null))switch(s){case"value":l=o;break;case"defaultValue":a=o;break;case"children":u=o;break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(c(91));break;default:Re(e,t,s,o,n,null)}Bs(e,l,a,u);return;case"option":for(g in n)if(n.hasOwnProperty(g)&&(l=n[g],l!=null))switch(g){case"selected":e.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:Re(e,t,g,l,n,null)}return;case"dialog":ve("beforetoggle",e),ve("toggle",e),ve("cancel",e),ve("close",e);break;case"iframe":case"object":ve("load",e);break;case"video":case"audio":for(l=0;l<Ba.length;l++)ve(Ba[l],e);break;case"image":ve("error",e),ve("load",e);break;case"details":ve("toggle",e);break;case"embed":case"source":case"link":ve("error",e),ve("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(C in n)if(n.hasOwnProperty(C)&&(l=n[C],l!=null))switch(C){case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:Re(e,t,C,l,n,null)}return;default:if(xi(t)){for(w in n)n.hasOwnProperty(w)&&(l=n[w],l!==void 0&&gf(e,t,w,l,n,void 0));return}}for(o in n)n.hasOwnProperty(o)&&(l=n[o],l!=null&&Re(e,t,o,l,n,null))}function fg(e,t,n,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var a=null,u=null,s=null,o=null,g=null,C=null,w=null;for(_ in n){var O=n[_];if(n.hasOwnProperty(_)&&O!=null)switch(_){case"checked":break;case"value":break;case"defaultValue":g=O;default:l.hasOwnProperty(_)||Re(e,t,_,null,l,O)}}for(var N in l){var _=l[N];if(O=n[N],l.hasOwnProperty(N)&&(_!=null||O!=null))switch(N){case"type":u=_;break;case"name":a=_;break;case"checked":C=_;break;case"defaultChecked":w=_;break;case"value":s=_;break;case"defaultValue":o=_;break;case"children":case"dangerouslySetInnerHTML":if(_!=null)throw Error(c(137,t));break;default:_!==O&&Re(e,t,N,_,l,O)}}Ni(e,s,o,g,C,w,u,a);return;case"select":_=s=o=N=null;for(u in n)if(g=n[u],n.hasOwnProperty(u)&&g!=null)switch(u){case"value":break;case"multiple":_=g;default:l.hasOwnProperty(u)||Re(e,t,u,null,l,g)}for(a in l)if(u=l[a],g=n[a],l.hasOwnProperty(a)&&(u!=null||g!=null))switch(a){case"value":N=u;break;case"defaultValue":o=u;break;case"multiple":s=u;default:u!==g&&Re(e,t,a,u,l,g)}t=o,n=s,l=_,N!=null?yl(e,!!n,N,!1):!!l!=!!n&&(t!=null?yl(e,!!n,t,!0):yl(e,!!n,n?[]:"",!1));return;case"textarea":_=N=null;for(o in n)if(a=n[o],n.hasOwnProperty(o)&&a!=null&&!l.hasOwnProperty(o))switch(o){case"value":break;case"children":break;default:Re(e,t,o,null,l,a)}for(s in l)if(a=l[s],u=n[s],l.hasOwnProperty(s)&&(a!=null||u!=null))switch(s){case"value":N=a;break;case"defaultValue":_=a;break;case"children":break;case"dangerouslySetInnerHTML":if(a!=null)throw Error(c(91));break;default:a!==u&&Re(e,t,s,a,l,u)}Ds(e,N,_);return;case"option":for(var P in n)if(N=n[P],n.hasOwnProperty(P)&&N!=null&&!l.hasOwnProperty(P))switch(P){case"selected":e.selected=!1;break;default:Re(e,t,P,null,l,N)}for(g in l)if(N=l[g],_=n[g],l.hasOwnProperty(g)&&N!==_&&(N!=null||_!=null))switch(g){case"selected":e.selected=N&&typeof N!="function"&&typeof N!="symbol";break;default:Re(e,t,g,N,l,_)}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 ie in n)N=n[ie],n.hasOwnProperty(ie)&&N!=null&&!l.hasOwnProperty(ie)&&Re(e,t,ie,null,l,N);for(C in l)if(N=l[C],_=n[C],l.hasOwnProperty(C)&&N!==_&&(N!=null||_!=null))switch(C){case"children":case"dangerouslySetInnerHTML":if(N!=null)throw Error(c(137,t));break;default:Re(e,t,C,N,l,_)}return;default:if(xi(t)){for(var Ue in n)N=n[Ue],n.hasOwnProperty(Ue)&&N!==void 0&&!l.hasOwnProperty(Ue)&&gf(e,t,Ue,void 0,l,N);for(w in l)N=l[w],_=n[w],!l.hasOwnProperty(w)||N===_||N===void 0&&_===void 0||gf(e,t,w,N,l,_);return}}for(var T in n)N=n[T],n.hasOwnProperty(T)&&N!=null&&!l.hasOwnProperty(T)&&Re(e,t,T,null,l,N);for(O in l)N=l[O],_=n[O],!l.hasOwnProperty(O)||N===_||N==null&&_==null||Re(e,t,O,N,l,_)}function Ld(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function sg(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),l=0;l<n.length;l++){var a=n[l],u=a.transferSize,s=a.initiatorType,o=a.duration;if(u&&o&&Ld(s)){for(s=0,o=a.responseEnd,l+=1;l<n.length;l++){var g=n[l],C=g.startTime;if(C>o)break;var w=g.transferSize,O=g.initiatorType;w&&Ld(O)&&(g=g.responseEnd,s+=w*(g<o?1:(o-C)/(g-C)))}if(--l,t+=8*(u+s)/(a.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 yf=null,vf=null;function ti(e){return e.nodeType===9?e:e.ownerDocument}function Gd(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 Qd(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 bf(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 Sf=null;function rg(){var e=window.event;return e&&e.type==="popstate"?e===Sf?!1:(Sf=e,!0):(Sf=null,!1)}var Xd=typeof setTimeout=="function"?setTimeout:void 0,og=typeof clearTimeout=="function"?clearTimeout:void 0,Kd=typeof Promise=="function"?Promise:void 0,dg=typeof queueMicrotask=="function"?queueMicrotask:typeof Kd<"u"?function(e){return Kd.resolve(null).then(e).catch(hg)}:Xd;function hg(e){setTimeout(function(){throw e})}function Mn(e){return e==="head"}function Zd(e,t){var n=t,l=0;do{var a=n.nextSibling;if(e.removeChild(n),a&&a.nodeType===8)if(n=a.data,n==="/$"||n==="/&"){if(l===0){e.removeChild(a),kl(t);return}l--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")l++;else if(n==="html")qa(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,qa(n);for(var u=n.firstChild;u;){var s=u.nextSibling,o=u.nodeName;u[na]||o==="SCRIPT"||o==="STYLE"||o==="LINK"&&u.rel.toLowerCase()==="stylesheet"||n.removeChild(u),u=s}}else n==="body"&&qa(e.ownerDocument.body);n=a}while(n);kl(t)}function Vd(e,t){var n=e;e=0;do{var l=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||""),l&&l.nodeType===8)if(n=l.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=l}while(n)}function pf(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":pf(n),zi(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function mg(e,t,n,l){for(;e.nodeType===1;){var a=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[na])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(u=e.getAttribute("rel"),u==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(u!==a.rel||e.getAttribute("href")!==(a.href==null||a.href===""?null:a.href)||e.getAttribute("crossorigin")!==(a.crossOrigin==null?null:a.crossOrigin)||e.getAttribute("title")!==(a.title==null?null:a.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(u=e.getAttribute("src"),(u!==(a.src==null?null:a.src)||e.getAttribute("type")!==(a.type==null?null:a.type)||e.getAttribute("crossorigin")!==(a.crossOrigin==null?null:a.crossOrigin))&&u&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var u=a.name==null?null:""+a.name;if(a.type==="hidden"&&e.getAttribute("name")===u)return e}else return e;if(e=Ut(e.nextSibling),e===null)break}return null}function gg(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Ut(e.nextSibling),e===null))return null;return e}function Jd(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Ut(e.nextSibling),e===null))return null;return e}function Ef(e){return e.data==="$?"||e.data==="$~"}function Tf(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function yg(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var l=function(){t(),n.removeEventListener("DOMContentLoaded",l)};n.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function Ut(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 Af=null;function kd(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return Ut(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function $d(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 Fd(e,t,n){switch(t=ti(n),e){case"html":if(e=t.documentElement,!e)throw Error(c(452));return e;case"head":if(e=t.head,!e)throw Error(c(453));return e;case"body":if(e=t.body,!e)throw Error(c(454));return e;default:throw Error(c(451))}}function qa(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);zi(e)}var Ot=new Map,Wd=new Set;function ni(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var rn=G.d;G.d={f:vg,r:bg,D:Sg,C:pg,L:Eg,m:Tg,X:zg,S:Ag,M:Cg};function vg(){var e=rn.f(),t=Ju();return e||t}function bg(e){var t=hl(e);t!==null&&t.tag===5&&t.type==="form"?mo(t):rn.r(e)}var Zl=typeof document>"u"?null:document;function Id(e,t,n){var l=Zl;if(l&&typeof t=="string"&&t){var a=Nt(t);a='link[rel="'+e+'"][href="'+a+'"]',typeof n=="string"&&(a+='[crossorigin="'+n+'"]'),Wd.has(a)||(Wd.add(a),e={rel:e,crossOrigin:n,href:t},l.querySelector(a)===null&&(t=l.createElement("link"),tt(t,"link",e),$e(t),l.head.appendChild(t)))}}function Sg(e){rn.D(e),Id("dns-prefetch",e,null)}function pg(e,t){rn.C(e,t),Id("preconnect",e,t)}function Eg(e,t,n){rn.L(e,t,n);var l=Zl;if(l&&e&&t){var a='link[rel="preload"][as="'+Nt(t)+'"]';t==="image"&&n&&n.imageSrcSet?(a+='[imagesrcset="'+Nt(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(a+='[imagesizes="'+Nt(n.imageSizes)+'"]')):a+='[href="'+Nt(e)+'"]';var u=a;switch(t){case"style":u=Vl(e);break;case"script":u=Jl(e)}Ot.has(u)||(e=E({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Ot.set(u,e),l.querySelector(a)!==null||t==="style"&&l.querySelector(Ya(u))||t==="script"&&l.querySelector(La(u))||(t=l.createElement("link"),tt(t,"link",e),$e(t),l.head.appendChild(t)))}}function Tg(e,t){rn.m(e,t);var n=Zl;if(n&&e){var l=t&&typeof t.as=="string"?t.as:"script",a='link[rel="modulepreload"][as="'+Nt(l)+'"][href="'+Nt(e)+'"]',u=a;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=Jl(e)}if(!Ot.has(u)&&(e=E({rel:"modulepreload",href:e},t),Ot.set(u,e),n.querySelector(a)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(La(u)))return}l=n.createElement("link"),tt(l,"link",e),$e(l),n.head.appendChild(l)}}}function Ag(e,t,n){rn.S(e,t,n);var l=Zl;if(l&&e){var a=ml(l).hoistableStyles,u=Vl(e);t=t||"default";var s=a.get(u);if(!s){var o={loading:0,preload:null};if(s=l.querySelector(Ya(u)))o.loading=5;else{e=E({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Ot.get(u))&&zf(e,n);var g=s=l.createElement("link");$e(g),tt(g,"link",e),g._p=new Promise(function(C,w){g.onload=C,g.onerror=w}),g.addEventListener("load",function(){o.loading|=1}),g.addEventListener("error",function(){o.loading|=2}),o.loading|=4,li(s,t,l)}s={type:"stylesheet",instance:s,count:1,state:o},a.set(u,s)}}}function zg(e,t){rn.X(e,t);var n=Zl;if(n&&e){var l=ml(n).hoistableScripts,a=Jl(e),u=l.get(a);u||(u=n.querySelector(La(a)),u||(e=E({src:e,async:!0},t),(t=Ot.get(a))&&Cf(e,t),u=n.createElement("script"),$e(u),tt(u,"link",e),n.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},l.set(a,u))}}function Cg(e,t){rn.M(e,t);var n=Zl;if(n&&e){var l=ml(n).hoistableScripts,a=Jl(e),u=l.get(a);u||(u=n.querySelector(La(a)),u||(e=E({src:e,async:!0,type:"module"},t),(t=Ot.get(a))&&Cf(e,t),u=n.createElement("script"),$e(u),tt(u,"link",e),n.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},l.set(a,u))}}function Pd(e,t,n,l){var a=(a=re.current)?ni(a):null;if(!a)throw Error(c(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Vl(n.href),n=ml(a).hoistableStyles,l=n.get(t),l||(l={type:"style",instance:null,count:0,state:null},n.set(t,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Vl(n.href);var u=ml(a).hoistableStyles,s=u.get(e);if(s||(a=a.ownerDocument||a,s={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,s),(u=a.querySelector(Ya(e)))&&!u._p&&(s.instance=u,s.state.loading=5),Ot.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},Ot.set(e,n),u||Ng(a,e,n,s.state))),t&&l===null)throw Error(c(528,""));return s}if(t&&l!==null)throw Error(c(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Jl(n),n=ml(a).hoistableScripts,l=n.get(t),l||(l={type:"script",instance:null,count:0,state:null},n.set(t,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(c(444,e))}}function Vl(e){return'href="'+Nt(e)+'"'}function Ya(e){return'link[rel="stylesheet"]['+e+"]"}function eh(e){return E({},e,{"data-precedence":e.precedence,precedence:null})}function Ng(e,t,n,l){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?l.loading=1:(t=e.createElement("link"),l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2}),tt(t,"link",n),$e(t),e.head.appendChild(t))}function Jl(e){return'[src="'+Nt(e)+'"]'}function La(e){return"script[async]"+e}function th(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+Nt(n.href)+'"]');if(l)return t.instance=l,$e(l),l;var a=E({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),$e(l),tt(l,"style",a),li(l,n.precedence,e),t.instance=l;case"stylesheet":a=Vl(n.href);var u=e.querySelector(Ya(a));if(u)return t.state.loading|=4,t.instance=u,$e(u),u;l=eh(n),(a=Ot.get(a))&&zf(l,a),u=(e.ownerDocument||e).createElement("link"),$e(u);var s=u;return s._p=new Promise(function(o,g){s.onload=o,s.onerror=g}),tt(u,"link",l),t.state.loading|=4,li(u,n.precedence,e),t.instance=u;case"script":return u=Jl(n.src),(a=e.querySelector(La(u)))?(t.instance=a,$e(a),a):(l=n,(a=Ot.get(u))&&(l=E({},n),Cf(l,a)),e=e.ownerDocument||e,a=e.createElement("script"),$e(a),tt(a,"link",l),e.head.appendChild(a),t.instance=a);case"void":return null;default:throw Error(c(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,li(l,n.precedence,e));return t.instance}function li(e,t,n){for(var l=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),a=l.length?l[l.length-1]:null,u=a,s=0;s<l.length;s++){var o=l[s];if(o.dataset.precedence===t)u=o;else if(u!==a)break}u?u.parentNode.insertBefore(e,u.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function zf(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Cf(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var ai=null;function nh(e,t,n){if(ai===null){var l=new Map,a=ai=new Map;a.set(n,l)}else a=ai,l=a.get(n),l||(l=new Map,a.set(n,l));if(l.has(e))return l;for(l.set(e,null),n=n.getElementsByTagName(e),a=0;a<n.length;a++){var u=n[a];if(!(u[na]||u[We]||e==="link"&&u.getAttribute("rel")==="stylesheet")&&u.namespaceURI!=="http://www.w3.org/2000/svg"){var s=u.getAttribute(t)||"";s=e+s;var o=l.get(s);o?o.push(u):l.set(s,[u])}}return l}function lh(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function jg(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 ah(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function xg(e,t,n,l){if(n.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var a=Vl(l.href),u=t.querySelector(Ya(a));if(u){t=u._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=ui.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=u,$e(u);return}u=t.ownerDocument||t,l=eh(l),(a=Ot.get(a))&&zf(l,a),u=u.createElement("link"),$e(u);var s=u;s._p=new Promise(function(o,g){s.onload=o,s.onerror=g}),tt(u,"link",l),n.instance=u}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=ui.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Nf=0;function _g(e,t){return e.stylesheets&&e.count===0&&ci(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var l=setTimeout(function(){if(e.stylesheets&&ci(e,e.stylesheets),e.unsuspend){var u=e.unsuspend;e.unsuspend=null,u()}},6e4+t);0<e.imgBytes&&Nf===0&&(Nf=62500*sg());var a=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ci(e,e.stylesheets),e.unsuspend)){var u=e.unsuspend;e.unsuspend=null,u()}},(e.imgBytes>Nf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(a)}}:null}function ui(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ci(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ii=null;function ci(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ii=new Map,t.forEach(Mg,e),ii=null,ui.call(e))}function Mg(e,t){if(!(t.state.loading&4)){var n=ii.get(e);if(n)var l=n.get(null);else{n=new Map,ii.set(e,n);for(var a=e.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u<a.length;u++){var s=a[u];(s.nodeName==="LINK"||s.getAttribute("media")!=="not all")&&(n.set(s.dataset.precedence,s),l=s)}l&&n.set(null,l)}a=t.instance,s=a.getAttribute("data-precedence"),u=n.get(s)||l,u===l&&n.set(null,a),n.set(s,a),this.count++,l=ui.bind(this),a.addEventListener("load",l),a.addEventListener("error",l),u?u.parentNode.insertBefore(a,u.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(a,e.firstChild)),t.state.loading|=4}}var Ga={$$typeof:I,Provider:null,Consumer:null,_currentValue:ae,_currentValue2:ae,_threadCount:0};function wg(e,t,n,l,a,u,s,o,g){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=pi(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=pi(0),this.hiddenUpdates=pi(null),this.identifierPrefix=l,this.onUncaughtError=a,this.onCaughtError=u,this.onRecoverableError=s,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=g,this.incompleteTransitions=new Map}function uh(e,t,n,l,a,u,s,o,g,C,w,O){return e=new wg(e,t,n,s,g,C,w,O,o),t=1,u===!0&&(t|=24),u=vt(3,null,null,t),e.current=u,u.stateNode=e,t=ac(),t.refCount++,e.pooledCache=t,t.refCount++,u.memoizedState={element:l,isDehydrated:n,cache:t},fc(u),e}function ih(e){return e?(e=zl,e):zl}function ch(e,t,n,l,a,u){a=ih(a),l.context===null?l.context=a:l.pendingContext=a,l=Sn(t),l.payload={element:n},u=u===void 0?null:u,u!==null&&(l.callback=u),n=pn(e,l,t),n!==null&&(ht(n,e,t),Sa(n,e,t))}function fh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function jf(e,t){fh(e,t),(e=e.alternate)&&fh(e,t)}function sh(e){if(e.tag===13||e.tag===31){var t=Qn(e,67108864);t!==null&&ht(t,e,67108864),jf(e,67108864)}}function rh(e){if(e.tag===13||e.tag===31){var t=Tt();t=Ei(t);var n=Qn(e,t);n!==null&&ht(n,e,t),jf(e,t)}}var fi=!0;function Rg(e,t,n,l){var a=M.T;M.T=null;var u=G.p;try{G.p=2,xf(e,t,n,l)}finally{G.p=u,M.T=a}}function Ug(e,t,n,l){var a=M.T;M.T=null;var u=G.p;try{G.p=8,xf(e,t,n,l)}finally{G.p=u,M.T=a}}function xf(e,t,n,l){if(fi){var a=_f(l);if(a===null)mf(e,t,l,si,n),dh(e,l);else if(Dg(a,e,t,n,l))l.stopPropagation();else if(dh(e,l),t&4&&-1<Og.indexOf(e)){for(;a!==null;){var u=hl(a);if(u!==null)switch(u.tag){case 3:if(u=u.stateNode,u.current.memoizedState.isDehydrated){var s=Hn(u.pendingLanes);if(s!==0){var o=u;for(o.pendingLanes|=2,o.entangledLanes|=2;s;){var g=1<<31-gt(s);o.entanglements[1]|=g,s&=~g}Qt(u),(je&6)===0&&(Zu=ut()+500,Da(0))}}break;case 31:case 13:o=Qn(u,2),o!==null&&ht(o,u,2),Ju(),jf(u,2)}if(u=_f(l),u===null&&mf(e,t,l,si,n),u===a)break;a=u}a!==null&&l.stopPropagation()}else mf(e,t,l,null,n)}}function _f(e){return e=Mi(e),Mf(e)}var si=null;function Mf(e){if(si=null,e=dl(e),e!==null){var t=h(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=v(t),e!==null)return e;e=null}else if(n===31){if(e=A(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 si=e,null}function oh(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(B()){case k:return 2;case he:return 8;case De:case lt:return 32;case rl:return 268435456;default:return 32}default:return 32}}var wf=!1,wn=null,Rn=null,Un=null,Qa=new Map,Xa=new Map,On=[],Og="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 dh(e,t){switch(e){case"focusin":case"focusout":wn=null;break;case"dragenter":case"dragleave":Rn=null;break;case"mouseover":case"mouseout":Un=null;break;case"pointerover":case"pointerout":Qa.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Xa.delete(t.pointerId)}}function Ka(e,t,n,l,a,u){return e===null||e.nativeEvent!==u?(e={blockedOn:t,domEventName:n,eventSystemFlags:l,nativeEvent:u,targetContainers:[a]},t!==null&&(t=hl(t),t!==null&&sh(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function Dg(e,t,n,l,a){switch(t){case"focusin":return wn=Ka(wn,e,t,n,l,a),!0;case"dragenter":return Rn=Ka(Rn,e,t,n,l,a),!0;case"mouseover":return Un=Ka(Un,e,t,n,l,a),!0;case"pointerover":var u=a.pointerId;return Qa.set(u,Ka(Qa.get(u)||null,e,t,n,l,a)),!0;case"gotpointercapture":return u=a.pointerId,Xa.set(u,Ka(Xa.get(u)||null,e,t,n,l,a)),!0}return!1}function hh(e){var t=dl(e.target);if(t!==null){var n=h(t);if(n!==null){if(t=n.tag,t===13){if(t=v(n),t!==null){e.blockedOn=t,Ns(e.priority,function(){rh(n)});return}}else if(t===31){if(t=A(n),t!==null){e.blockedOn=t,Ns(e.priority,function(){rh(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 ri(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=_f(e.nativeEvent);if(n===null){n=e.nativeEvent;var l=new n.constructor(n.type,n);_i=l,n.target.dispatchEvent(l),_i=null}else return t=hl(n),t!==null&&sh(t),e.blockedOn=n,!1;t.shift()}return!0}function mh(e,t,n){ri(e)&&n.delete(t)}function Bg(){wf=!1,wn!==null&&ri(wn)&&(wn=null),Rn!==null&&ri(Rn)&&(Rn=null),Un!==null&&ri(Un)&&(Un=null),Qa.forEach(mh),Xa.forEach(mh)}function oi(e,t){e.blockedOn===t&&(e.blockedOn=null,wf||(wf=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,Bg)))}var di=null;function gh(e){di!==e&&(di=e,i.unstable_scheduleCallback(i.unstable_NormalPriority,function(){di===e&&(di=null);for(var t=0;t<e.length;t+=3){var n=e[t],l=e[t+1],a=e[t+2];if(typeof l!="function"){if(Mf(l||n)===null)continue;break}var u=hl(n);u!==null&&(e.splice(t,3),t-=3,xc(u,{pending:!0,data:a,method:n.method,action:l},l,a))}}))}function kl(e){function t(g){return oi(g,e)}wn!==null&&oi(wn,e),Rn!==null&&oi(Rn,e),Un!==null&&oi(Un,e),Qa.forEach(t),Xa.forEach(t);for(var n=0;n<On.length;n++){var l=On[n];l.blockedOn===e&&(l.blockedOn=null)}for(;0<On.length&&(n=On[0],n.blockedOn===null);)hh(n),n.blockedOn===null&&On.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(l=0;l<n.length;l+=3){var a=n[l],u=n[l+1],s=a[ct]||null;if(typeof u=="function")s||gh(n);else if(s){var o=null;if(u&&u.hasAttribute("formAction")){if(a=u,s=u[ct]||null)o=s.formAction;else if(Mf(a)!==null)continue}else o=s.action;typeof o=="function"?n[l+1]=o:(n.splice(l,3),l-=3),gh(n)}}}function yh(){function e(u){u.canIntercept&&u.info==="react-transition"&&u.intercept({handler:function(){return new Promise(function(s){return a=s})},focusReset:"manual",scroll:"manual"})}function t(){a!==null&&(a(),a=null),l||setTimeout(n,20)}function n(){if(!l&&!navigation.transition){var u=navigation.currentEntry;u&&u.url!=null&&navigation.navigate(u.url,{state:u.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,a=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),a!==null&&(a(),a=null)}}}function Rf(e){this._internalRoot=e}hi.prototype.render=Rf.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(c(409));var n=t.current,l=Tt();ch(n,l,e,t,null,null)},hi.prototype.unmount=Rf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ch(e.current,2,null,e,null,null),Ju(),t[ol]=null}};function hi(e){this._internalRoot=e}hi.prototype.unstable_scheduleHydration=function(e){if(e){var t=Cs();e={blockedOn:null,target:e,priority:t};for(var n=0;n<On.length&&t!==0&&t<On[n].priority;n++);On.splice(n,0,e),n===0&&hh(e)}};var vh=f.version;if(vh!=="19.2.8")throw Error(c(527,vh,"19.2.8"));G.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(c(188)):(e=Object.keys(e).join(","),Error(c(268,e)));return e=y(t),e=e!==null?j(e):null,e=e===null?null:e.stateNode,e};var Hg={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:M,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var mi=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!mi.isDisabled&&mi.supportsFiber)try{Pl=mi.inject(Hg),mt=mi}catch{}}return Va.createRoot=function(e,t){if(!d(e))throw Error(c(299));var n=!1,l="",a=zo,u=Co,s=No;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(a=t.onUncaughtError),t.onCaughtError!==void 0&&(u=t.onCaughtError),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=uh(e,1,!1,null,null,n,l,null,a,u,s,yh),e[ol]=t.current,hf(e),new Rf(t)},Va.hydrateRoot=function(e,t,n){if(!d(e))throw Error(c(299));var l=!1,a="",u=zo,s=Co,o=No,g=null;return n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onUncaughtError!==void 0&&(u=n.onUncaughtError),n.onCaughtError!==void 0&&(s=n.onCaughtError),n.onRecoverableError!==void 0&&(o=n.onRecoverableError),n.formState!==void 0&&(g=n.formState)),t=uh(e,1,!0,t,n??null,l,a,g,u,s,o,yh),t.context=ih(null),n=t.current,l=Tt(),l=Ei(l),a=Sn(l),a.callback=null,pn(n,a,l),n=l,t.current.lanes=n,ta(t,n),Qt(t),e[ol]=t.current,hf(e),new hi(t)},Va.version="19.2.8",Va}var jh;function kg(){if(jh)return Df.exports;jh=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(f){console.error(f)}}return i(),Df.exports=Jg(),Df.exports}var $g=kg(),Fg=["runtime.ready","store.ready","runtime.stopping","agent.loaded","agent.disposed","agent.warning","plugin.loaded","plugin.slow","approval.requested","approval.resolved","handoff.start","handoff.result","turn.start","context.assembled","context.dropped","context.pressure","compaction.stage","context.reset","phase.changed","model.call","model.chunk","model.retry","model.result","tool.call","tool.result","tool.gated","tool.repair","tools.refreshed","agent.channel.status","agent.channel.error","agent.channel.rejected","delivery.sent","delivery.retry","delivery.failed","delivery.uncertain","runtime.released","schedules.reconciled","schedule.fired","schedule.skipped","schedule.deferred","schedule.error","turn.end","error"],Wg=/\\r\\n\\r\\n|\\n\\n|\\r\\r/;function xh(i){const f=[];let r,c,d;for(const h of i.split(/\\r\\n|\\n|\\r/)){if(h===""||h.startsWith(":"))continue;const v=h.indexOf(":"),A=v===-1?h:h.slice(0,v);let p=v===-1?"":h.slice(v+1);switch(p.startsWith(" ")&&(p=p.slice(1)),A){case"data":f.push(p);break;case"event":r=p;break;case"id":c=p;break;case"retry":{const y=Number.parseInt(p,10);Number.isFinite(y)&&(d=y);break}}}if(!(f.length===0&&r===void 0))return{...r===void 0?{}:{event:r},data:f.join(\`
17
+ \`),...c===void 0?{}:{id:c},...d===void 0?{}:{retry:d}}}async function*Ig(i){const f=new TextDecoder;let r="";for await(const c of i)for(r+=typeof c=="string"?c:f.decode(c,{stream:!0});;){const d=Wg.exec(r);if(d===null)break;const h=r.slice(0,d.index);r=r.slice(d.index+d[0].length);const v=xh(h);v!==void 0&&(yield v)}if(r+=f.decode(),r.trim()!==""){const c=xh(r);c!==void 0&&(yield c)}}function c0(){return{push:i=>i,endStep:()=>"",end:()=>""}}function Pg(i){return i!=="final"&&i!=="stopped"}function ey(i,f={}){switch(i){case"final":return;case"max_steps":return\`stopped\${f.steps===void 0?"":\` after \${f.steps} steps\`} without finishing — say "continue" to carry on, or raise limits.maxSteps\`;case"no_progress":return'stopped: the same tool call was repeated with no change — say "continue" with more to go on, or check whether that tool is telling it anything useful';case"truncated":return"the reply was cut off at the output limit — raise model.<role>.maxTokens, or ask for less";case"timeout":return\`timed out\${f.durationMs===void 0?"":\` after \${f.durationMs} ms\`} — raise limits.turnTimeoutMs\`;case"stopped":return f.cancelledAfterMs===void 0?"cancelled":\`cancelled after \${f.cancelledAfterMs.toFixed(0)} ms\`;case"error":return}}var ty="<<<",ny=">>>",$a=/^\\s*(?:[-*+]\\s+|\\d+[.)]\\s+)?<?\\s*action\\s*:\\s*(.+?)\\s*>?\\s*$/i,ly=/^\\s*(?:[-*+]\\s+|\\d+[.)]\\s+)?([A-Za-z_][\\w.-]*?)\\s*:\\s*(.*)$/,hs=/^\\s*\`{3,}\\s*[\\w+-]*\\s*$/,Yf=/^\\s*end\\s*$/i,ay=/^\\s*<\\s*action\\s*>\\s*$/i,_h=/^\\s*<\\s*\\/\\s*action\\s*>\\s*$/i,uy=/^\\s*<\\/?\\s*[A-Za-z_][\\w.:-]*\\s*\\/?\\s*>\\s*$/;function Lf(i){return i.replace(/^[\`'"*<]+/,"").replace(/[\`'"*>]+$/,"").replace(/[.,;:]+$/,"").trim()}function f0(i,f,r){const c=i.fields.get(f);c===void 0?i.fields.set(f,[r]):c.push(r)}function s0(i){if(i.block===void 0||i.heredocKey===void 0)return;const f=[...i.heredocLines];f[f.length-1]===""&&f.pop(),f0(i.block,i.heredocKey,f.join(\`
18
+ \`)),i.block.wrapped.add(i.heredocKey),i.heredocKey=void 0,i.heredocLines=[]}function tl(i){s0(i),i.block!==void 0&&i.blocks.push(i.block),i.block=void 0,i.openKey=void 0,i.awaitingSlug=!1}function Mh(){return{block:void 0,openKey:void 0,severedKey:void 0,severedPending:void 0,heredocKey:void 0,heredocLines:[],justClosed:!1,awaitingSlug:!1,text:[],blocks:[]}}function iy(i,f,r){const c=f.trim();if(i.heredocKey!==void 0){if(c===ny){s0(i);return}if(Yf.test(c)){tl(i),i.justClosed=!0;return}if($a.test(f)){tl(i);const v=$a.exec(f),A=Lf(v?.[1]??"");A!==""&&(i.block={slug:A,fields:new Map,wrapped:new Set,severed:new Set});return}i.heredocLines.push(f);return}const d=$a.exec(f);if(d!==null){const v=Lf(d[1]??"");if(tl(i),v==="")return;i.block={slug:v,fields:new Map,wrapped:new Set,severed:new Set};return}if(ay.test(f)){tl(i),i.awaitingSlug=!0;return}if(i.awaitingSlug){if(c==="")return;if(_h.test(f)){i.awaitingSlug=!1;return}const v=Lf(c);i.awaitingSlug=!1,v!==""&&(i.block={slug:v,fields:new Map,wrapped:new Set,severed:new Set});return}if(_h.test(f)){i.block!==void 0&&(tl(i),i.justClosed=!0);return}if(uy.test(f))return;if(i.block===void 0){if(hs.test(f)&&(i.justClosed||r())){i.justClosed=!1;return}if(Yf.test(c)&&i.severedPending!==void 0){i.severedPending.block.severed.add(i.severedPending.key),i.severedPending=void 0;return}$a.test(f)&&(i.severedPending=void 0),i.text.push(f),c!==""&&(i.justClosed=!1);return}if(c===""){i.openKey!==void 0&&(i.severedKey=i.openKey),i.openKey=void 0;return}if(Yf.test(c)){i.severedKey=void 0,tl(i),i.justClosed=!0;return}if(hs.test(f))return;const h=ly.exec(f);if(h!==null){const v=(h[1]??"").trim(),A=(h[2]??"").trim();i.severedKey=void 0,A===ty?(i.heredocKey=v,i.heredocLines=[],i.openKey=void 0):(f0(i.block,v,A),i.openKey=v);return}if(i.openKey!==void 0){const v=i.block.fields.get(i.openKey),A=v?.[v.length-1];v!==void 0&&A!==void 0&&(v[v.length-1]=A===""?c:\`\${A}
19
+ \${c}\`);return}i.severedKey!==void 0&&(i.severedPending={block:i.block,key:i.severedKey},i.severedKey=void 0),tl(i),i.text.push(f)}function cy(i){if(/^\\s*(?:[-*+]|\\d+[.)]?)?\\s*$/.test(i))return!0;const f=i.replace(/^\\s*(?:[-*+]\\s+|\\d+[.)]\\s+)?/,"").toLowerCase(),r=f.startsWith("<")?f.slice(1):f;return"action:".startsWith(r)||r.startsWith("action:")||/^<\\/?$/.test(f)||/^<\\/?[a-z_][\\w.:-]*>?$/.test(f)?!0:/^\`{1,3}[\\w+-]*$/.test(f)}function Gf(i){return i.endsWith("\\r")?i.slice(0,-1):i}function fy(){let i=Mh(),f="",r=0,c,d="",h=!1;const v=E=>{if(E==="")return"";if(E.trim()==="")return d+=E,"";const x=d+E;return d="",h?x:(h=!0,x.replace(/^\\s+/,""))},A=(E,x)=>{const H=i.text.length;return iy(i,E,()=>x!==void 0&&$a.test(x)),i.text.length>H?E:void 0},p=(E,x,H)=>{const X=A(E,x);return X===void 0?"":v(X.slice(H))+v(\`
20
+ \`)},y=E=>{if(c===void 0)return"";const x=c;return c=void 0,p(x,E,0)};return{push(E){let x="";f+=E;let H=f.indexOf(\`
21
+ \`);for(;H!==-1;){const D=Gf(f.slice(0,H));f=f.slice(H+1),x+=y(D),i.block===void 0&&hs.test(D)&&!i.justClosed?c=D:x+=p(D,void 0,r),r=0,H=f.indexOf(\`
22
+ \`)}const X=Gf(f);return i.block===void 0&&!i.awaitingSlug&&c===void 0&&!cy(X)&&(x+=v(X.slice(r)),r=X.length),x},endStep(){const E=j();return d=\`
23
+
24
+ \`,i=Mh(),E},end:j};function j(){let E=y(void 0);const x=Gf(f);if(x!==""){const H=A(x,void 0);H!==void 0&&(E+=v(H.slice(r)))}return f="",r=0,c=void 0,E}}class Zt extends Error{code;hint;field;status;request;constructor(f,r={}){super(f.hint===void 0?f.message:\`\${f.message}
25
+ hint: \${f.hint}\`),this.name="DispachError",this.code=f.code,this.hint=f.hint??"",this.field=f.field,this.status=r.status,this.request=r.method===void 0||r.path===void 0?void 0:{method:r.method,path:r.path},r.cause!==void 0&&(this.cause=r.cause)}}function sy(i,f){const r=i instanceof Error?i.message:String(i);return new Zt({code:"transport_failed",message:\`\${f.method} \${f.path} did not reach \${f.baseUrl}: \${r}\`,hint:"Check the base URL, that the server is running, and that nothing between you and it is refusing the connection. \`GET /v1/health\` needs no token and is the cheapest probe."},{...f,cause:i})}async function ry(i,f){let r;try{const c=await i.json();typeof c.error?.code=="string"&&typeof c.error.message=="string"&&(r={code:c.error.code,message:c.error.message,...c.error.hint===void 0?{}:{hint:c.error.hint},...c.error.field===void 0?{}:{field:c.error.field}})}catch{}return new Zt(r??{code:\`http_\${i.status}\`,message:\`\${f.method} \${f.path} returned \${i.status} with no error body.\`,hint:"This is not a response this server produces, so something between you and it answered — a proxy, a gateway, or a load balancer. Check the URL and what is in front of it."},{status:i.status,...f})}var r0=new Set(Fg);async function*o0(i){for await(const f of Ig(oy(i))){if(f.event===void 0||f.data==="")continue;let r;try{r=JSON.parse(f.data)}catch{continue}yield{name:f.event,data:r}}}async function*oy(i){const f=i.getReader();try{for(;;){const{done:r,value:c}=await f.read();if(r)return;c!==void 0&&(yield c)}}finally{f.releaseLock()}}async function*dy(i){for await(const{name:f,data:r}of o0(i)){if(r0.has(f)){yield{kind:"event",event:r};continue}const c=r??{};switch(f){case"turn.accepted":yield{kind:"accepted",turnId:String(c.turnId??""),sessionKey:String(c.sessionKey??"")};break;case"stream.replay":yield{kind:"replay",report:{state:c.state==="ended"?"ended":"running",events:Number(c.events??0),truncated:c.truncated===!0,dropped:Number(c.dropped??0),chunks:c.chunks==="start"||c.chunks==="partial"?c.chunks:"none"}};break;case"stream.ended":yield{kind:"ended",turnId:String(c.turnId??""),status:String(c.status??"unknown"),steps:typeof c.steps=="number"?c.steps:void 0,errorCode:typeof c.errorCode=="string"?c.errorCode:void 0};break;case"stream.unavailable":yield{kind:"unavailable",turnId:String(c.turnId??""),reason:String(c.reason??"not observable from this process")};break}}}async function*hy(i){for await(const{name:f,data:r}of o0(i)){if(r0.has(f)){yield{kind:"event",event:r};continue}if(f==="stream.subscribed"){const c=r??{};yield{kind:"subscribed",report:{agentId:typeof c.agentId=="string"?c.agentId:null,types:Array.isArray(c.types)?c.types:null,chunks:c.chunks===!0,implied:typeof c.implied=="string"?c.implied:void 0}}}}}async function*my(i,f={}){for await(const r of i){if(r.kind==="replay"&&r.report.truncated&&f.allowTruncated!==!0)throw new Zt({code:"replay_truncated",message:\`This turn's replay is missing its oldest \${r.report.dropped} event(s), so the text reconstructed from it would be incomplete.\`,hint:"Read the finished text from GET /v1/agents/:id/turns/:turnId, or pass { allowTruncated: true } to accept a fragment. Streaming from the start of a turn is never truncated — this only happens when reattaching to one that has already produced more events than the buffer holds."});if(r.kind==="unavailable")throw new Zt({code:"turn_not_observable",message:\`Turn \${r.turnId} is recorded as running but is not observable here: \${r.reason}.\`,hint:"Its events are buffered in whichever process is executing it. Poll GET /v1/agents/:id/turns/:turnId for the outcome."});if(r.kind!=="event"||r.event.type!=="model.chunk")continue;const c=r.event.data;c.kind!=="reasoning"&&typeof c.delta=="string"&&(yield c.delta)}}function gy(i){const f=i.baseUrl.replace(/\\/+$/,""),r=i.fetch??fetch,c=(y={})=>({...i.token===void 0?{}:{authorization:\`Bearer \${i.token}\`},...y});async function d(y,j,E={}){let x;try{x=await r(\`\${f}\${j}\`,{method:y,headers:c({...E.body===void 0?{}:{"content-type":"application/json"},...E.accept===void 0?{}:{accept:E.accept},...E.headers}),...E.body===void 0?{}:{body:JSON.stringify(E.body)},...E.signal===void 0?{}:{signal:E.signal}})}catch(H){throw sy(H,{method:y,path:j,baseUrl:f})}if(!x.ok)throw await ry(x,{method:y,path:j});return x}async function h(y,j,E){return await(await d(y,j,E??{})).json()}async function v(y,j){const E=await d("GET",y,{accept:"text/event-stream",...j===void 0?{}:{signal:j}});if(E.body===null)throw new Zt({code:"no_response_body",message:\`GET \${y} returned \${E.status} with no body to read.\`,hint:"An SSE route always has a body. A missing one means something between you and the server buffered the response — commonly a proxy without streaming enabled."},{status:E.status,method:"GET",path:y});return E.body}function A(y,j,E,x={}){const H=D=>D?.chunks===!0?"?chunks=true":"",X={turnId:j,sessionKey:E,replayed:x.replayed===!0,async*stream(D){const se=await v(\`/v1/agents/\${encodeURIComponent(y)}/turns/\${encodeURIComponent(j)}/stream\${H(D)}\`,D?.signal);yield*dy(se)},async*tokens(D){yield*my(X.stream({chunks:!0,...D}),{...D?.allowTruncated===void 0?{}:{allowTruncated:D.allowTruncated}})},async text(){for await(const D of X.stream())if(D.kind==="ended"||D.kind==="unavailable"||D.kind==="event"&&D.event.type==="turn.end")break;return(await X.get()).text},get:()=>h("GET",\`/v1/agents/\${encodeURIComponent(y)}/turns/\${encodeURIComponent(j)}\`),async stop(){await d("POST",\`/v1/agents/\${encodeURIComponent(y)}/turns/\${encodeURIComponent(j)}/stop\`)}};return X}function p(y){const j=E=>\`/v1/agents/\${encodeURIComponent(y)}\${E}\`;return{id:y,async send(E,x){const H=await h("POST",j("/messages"),{body:{text:E,...x?.sessionKey===void 0?{}:{sessionKey:x.sessionKey},...x?.deliver===void 0?{}:{deliver:x.deliver},...x?.from===void 0?{}:{from:x.from}},...x?.idempotencyKey===void 0?{}:{headers:{"idempotency-key":x.idempotencyKey}},...x?.signal===void 0?{}:{signal:x.signal}});return A(y,H.turnId,H.sessionKey,{replayed:H.replayed===!0})},turn:E=>A(y,E,""),describe:()=>h("GET",j("")),tools:()=>h("GET",j("/tools")),skills:()=>h("GET",j("/skills")),sessions:()=>h("GET",j("/sessions")),messages:(E,x)=>{const H=new URLSearchParams;x?.before!==void 0&&H.set("before",String(x.before)),x?.limit!==void 0&&H.set("limit",String(x.limit));const X=H.size===0?"":\`?\${H.toString()}\`;return h("GET",j(\`/sessions/\${encodeURIComponent(E)}/messages\${X}\`))},clearSession:E=>h("DELETE",j(\`/sessions/\${encodeURIComponent(E)}\`)),reload:()=>h("POST",j("/reload"),{body:{}}),schedules:async()=>(await h("GET",j("/schedules"))).schedules,approvals:async()=>(await h("GET",j("/approvals"))).approvals,createSchedule:E=>h("POST",j("/schedules"),{body:E}),updateSchedule:(E,x)=>h("PATCH",j(\`/schedules/\${encodeURIComponent(E)}\`),{body:x}),deleteSchedule:async E=>{await h("DELETE",j(\`/schedules/\${encodeURIComponent(E)}\`))},runSchedule:E=>h("POST",j(\`/schedules/\${encodeURIComponent(E)}/run\`),{body:{}}),config:()=>h("GET",j("/config")),setConfig:(E,x,H)=>h("PATCH",j("/config"),{body:{path:E,value:x,...H?.confirm===void 0?{}:{confirm:H.confirm}}}),setChannel:(E,x)=>h("PATCH",j(\`/channels/\${encodeURIComponent(E)}\`),{body:{...x}}),unpairChannel:E=>h("POST",j(\`/channels/\${encodeURIComponent(E)}/unpair\`)),session:E=>h("GET",j(\`/sessions/\${encodeURIComponent(E)}\`)),setPhase:(E,x)=>h("POST",j(\`/sessions/\${encodeURIComponent(E)}/phase\`),{body:{phase:x}}),approve:async(E,x)=>{await h("POST",j(\`/approvals/\${encodeURIComponent(E)}\`),{body:{granted:x}})},stop:E=>h("POST",j("/stop"),{body:E===void 0?{}:{reason:E}}),start:()=>h("POST",j("/start"),{body:{}}),context:E=>{const x=new URLSearchParams;E?.sessionKey!==void 0&&x.set("sessionKey",E.sessionKey),E?.input!==void 0&&x.set("input",E.input);const H=x.size===0?"":\`?\${x.toString()}\`;return h("GET",j(\`/context\${H}\`))}}}return{agent:p,agents:()=>h("GET","/v1/agents"),health:()=>h("GET","/v1/health"),async ready(){try{return await d("GET","/v1/ready"),!0}catch(y){if(y instanceof Zt&&y.status===503)return!1;throw y}},provision:()=>h("GET","/v1/provision"),keys:()=>h("GET","/v1/keys"),createKey:y=>h("POST","/v1/keys",{body:y}),revokeKey:y=>h("DELETE",\`/v1/keys/\${encodeURIComponent(y)}\`),createAgent:y=>h("POST","/v1/agents",{body:{answers:y}}),async*events(y){const j=new URLSearchParams;y?.agentId!==void 0&&j.set("agentId",y.agentId),y?.types!==void 0&&y.types.length>0&&j.set("types",y.types.join(",")),y?.chunks===!0&&j.set("chunks","true");const E=j.size===0?"":\`?\${j.toString()}\`,x=await v(\`/v1/events\${E}\`,y?.signal);yield*hy(x)}}}function yy(i){return m.jsxs(m.Fragment,{children:[i.state.truncated?m.jsx("p",{className:"row note bad",children:"This turn produced more than the server keeps for a reattach, so the beginning of the reply is missing. The stored turn has all of it."}):null,i.state.rows.map(f=>m.jsx(vy,{row:f,onAnswer:i.onAnswer},f.id)),i.state.liveReasoning===""?null:m.jsx(d0,{label:"thinking",text:i.state.liveReasoning,open:!0}),i.state.live===""?null:m.jsx("p",{className:"row",children:i.state.live})]})}function vy(i){const f=i.row;switch(f.kind){case"user":return m.jsx("p",{className:"row user",children:f.text});case"reply":return m.jsx("p",{className:"row",children:f.text});case"reasoning":return m.jsx(d0,{label:"thinking",text:f.text});case"tool":return m.jsxs("div",{className:\`row tool\${f.ok===!1?" failed":""}\`,children:[m.jsx("span",{className:"slug",children:f.slug}),f.mutating?m.jsx("span",{className:"mut",children:" changes things"}):null,m.jsx("span",{className:"out",children:by(f)}),f.untrusted===!0?m.jsx("div",{className:"fence",children:m.jsx("div",{className:"why",children:"this result came from outside the agent — treated as data, and mutating tools are blocked for the rest of the turn"})}):null]});case"approval":return m.jsxs("div",{className:"row ask",children:[m.jsxs("div",{children:[m.jsx("strong",{children:f.slug})," needs permission — ",f.reason]}),f.match===void 0?null:m.jsx("div",{className:"what",children:f.match}),f.settled===void 0?m.jsxs("div",{className:"buttons",children:[m.jsx("button",{type:"button",className:"primary",onClick:()=>i.onAnswer(f.approvalId,!0),children:"Allow once"}),m.jsx("button",{type:"button",onClick:()=>i.onAnswer(f.approvalId,!1),children:"Refuse"})]}):m.jsx("div",{className:"settled",children:Sy(f.settled)})]});case"note":return m.jsx("p",{className:\`row note\${f.bad?" bad":""}\`,children:f.text})}}function by(i){if(i.ok===void 0)return" running…";const f=i.bytes===void 0?"":\` · \${i.bytes} bytes\`,r=i.truncated===!0?" · truncated to fit the observation budget":"",c=i.latencyMs===void 0?"":\` · \${i.latencyMs} ms\`;return\`\${i.ok?" ok":" failed"}\${f}\${c}\${r}\`}function Sy(i){switch(i){case"granted":return"Allowed — the call ran.";case"denied":return"Refused. The model was told a person declined it.";case"abandoned":return"The turn ended while this was waiting, so the call did not run. Nobody declined it.";case"error":return"The approver itself failed, so the call was refused. That says nothing about what anybody wanted."}}function d0(i){return m.jsxs("details",{className:"row fold",open:i.open===!0,children:[m.jsxs("summary",{children:[i.label," · ",i.text.length," chars"]}),m.jsx("div",{className:"body",children:i.text})]})}function py(i){const f=J.useRef(null);return J.useEffect(()=>{const r=f.current;r!==null&&(r.style.height="auto",r.style.height=\`\${Math.min(r.scrollHeight,190)}px\`)},[i.value]),m.jsxs("div",{className:"composer",children:[m.jsxs("div",{className:"inner",children:[m.jsx("textarea",{ref:f,value:i.value,placeholder:"Ask the agent something",onChange:r=>i.onChange(r.target.value),onKeyDown:r=>{r.key==="Enter"&&!r.shiftKey&&(r.preventDefault(),i.onSend())}}),i.busy?m.jsx("button",{type:"button",onClick:i.onStop,children:"Stop"}):m.jsx("button",{type:"button",className:"primary",disabled:i.value.trim()==="",onClick:i.onSend,children:"Send"})]}),m.jsx("p",{className:"hint",children:i.busy?"Running. Closing this page does not stop it — the turn is detached, and reopening reattaches.":"Enter sends · shift-enter for a new line"})]})}const vs="dispach.key";function Ey(){const i=new URL(window.location.href),f=i.searchParams.get("claim");if(!(f===null||f===""))return i.searchParams.delete("claim"),window.history.replaceState({},"",i.pathname+i.search+i.hash),f}function ms(){try{return window.localStorage.getItem(vs)??void 0}catch{return}}function bs(i){try{window.localStorage.setItem(vs,i)}catch{}}function Ss(){try{window.localStorage.removeItem(vs)}catch{}}async function h0(i,f){const r=await fetch(\`\${i}/v1/keys\`,{method:"POST",headers:{"content-type":"application/json",authorization:\`Bearer \${f}\`},body:JSON.stringify({label:Ty()})}),c=await r.json();if(!r.ok||typeof c.secret!="string")throw new Error(c.error?.message??\`The claim was refused (\${r.status}).\`);return c.secret}function Ty(){const i=navigator.userAgent;return\`\${/Firefox\\//.test(i)?"Firefox":/Edg\\//.test(i)?"Edge":/Chrome\\//.test(i)?"Chrome":/Safari\\//.test(i)?"Safari":"browser"} · \${new Date().toISOString().slice(0,10)}\`}async function Ay(i){const f=Ey();if(f!==void 0)try{const c=await h0(i,f);return bs(c),{kind:"key",secret:c}}catch(c){const d=c instanceof Error?c.message:String(c);if(ms()===void 0)return{kind:"needed",because:d}}const r=ms();return r!==void 0&&await wh(i,r)?{kind:"key",secret:r}:(r!==void 0&&Ss(),await wh(i,void 0)?{kind:"open"}:{kind:"needed",because:r===void 0?"This server needs a credential.":"The key this browser held no longer works — it was revoked, or this is a different server."})}async function wh(i,f){try{return await m0(i,f).agents(),!0}catch(r){if(r instanceof Zt&&r.code==="unauthorized")return!1;throw r}}function m0(i,f){return gy({baseUrl:i,...f===void 0?{}:{token:f}})}function zy(i,f){const r=[i.scope?.agents===void 0?"every agent":i.scope.agents.join(", "),...i.scope?.sessions===void 0?[]:[\`sessions \${i.scope.sessions}\`],i.scope?.can===void 0?"all capabilities":i.scope.can.join("+")];return i.expiresAt!==void 0&&r.push(Date.parse(i.expiresAt)<=f?"expired":\`until \${vi(i.expiresAt)}\`),r.join(" · ")}function Cy(i){const[f,r]=J.useState([]),[c,d]=J.useState(),[h,v]=J.useState(""),[A,p]=J.useState(),[y,j]=J.useState(),E=J.useCallback((D={})=>({...D,...i.token===void 0?{}:{authorization:\`Bearer \${i.token}\`}}),[i.token]),x=J.useCallback(async()=>{try{const D=await fetch(\`\${i.baseUrl}/v1/keys\`,{headers:E()}),se=await D.json();if(!D.ok)throw new Error(se.error?.message??\`HTTP \${D.status}\`);r(se.keys??[]),d(se.scope)}catch(D){j(D instanceof Error?D.message:String(D))}},[i.baseUrl,E]);J.useEffect(()=>{x()},[x]);const H=async()=>{j(void 0);try{const D=await fetch(\`\${i.baseUrl}/v1/keys\`,{method:"POST",headers:E({"content-type":"application/json"}),body:JSON.stringify({label:h.trim()})}),se=await D.json();if(!D.ok||se.secret===void 0)throw new Error(se.error?.message??\`HTTP \${D.status}\`);p(se.secret),v(""),await x()}catch(D){j(D instanceof Error?D.message:String(D))}},X=async D=>{if(j(void 0),!window.confirm(\`Revoke "\${D.label}"? If it is the key this browser is using, you will be signed out of this page. There is no way to tell from here — the listing carries no secrets.\`))return;const se=ms();try{const L=await fetch(\`\${i.baseUrl}/v1/keys/\${D.keyId}\`,{method:"DELETE",headers:E()});if(!L.ok){const ce=await L.json();throw new Error(ce.error?.message??\`HTTP \${L.status}\`)}if(se!==void 0&&!await Ny(i.baseUrl,se)){Ss(),window.location.reload();return}await x()}catch(L){j(L instanceof Error?L.message:String(L))}};return m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"card",children:[m.jsx("h2",{children:"Issue a key"}),m.jsx("p",{children:"A key is shown once and never again — the server stores a hash of it, so there is no way to recover one. Label it for the browser or machine that will hold it."}),A===void 0?null:m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"secret",children:A}),m.jsxs("p",{className:"hint",style:{margin:"0 0 12px"},children:["Copy it now. This is the only time it is readable."," ",m.jsx("button",{type:"button",style:{padding:"2px 8px",fontSize:11},onClick:()=>{bs(A),window.location.reload()},children:"use it in this browser"})]})]}),m.jsxs("div",{style:{display:"flex",gap:8},children:[m.jsx("input",{value:h,placeholder:"my laptop",onChange:D=>v(D.target.value)}),m.jsx("button",{type:"button",className:"primary",disabled:h.trim()==="",onClick:()=>void H(),children:"Issue"})]})]}),m.jsxs("div",{className:"card",children:[m.jsx("h2",{children:"Keys"}),m.jsx("p",{children:c??"…"}),y===void 0?null:m.jsx("p",{className:"note bad",children:y}),m.jsxs("table",{children:[m.jsx("thead",{children:m.jsxs("tr",{children:[m.jsx("th",{children:"Label"}),m.jsx("th",{children:"Created"}),m.jsx("th",{children:"Reaches"}),m.jsx("th",{children:"Last used"}),m.jsx("th",{})]})}),m.jsx("tbody",{children:f.map(D=>m.jsxs("tr",{children:[m.jsx("td",{className:D.revokedAt===void 0?"":"revoked",children:D.label}),m.jsx("td",{children:vi(D.createdAt)}),m.jsx("td",{className:"sub",children:zy(D,Date.now())}),m.jsx("td",{children:D.revokedAt!==void 0?\`revoked \${vi(D.revokedAt)}\`:D.lastUsedAt===void 0?"never":vi(D.lastUsedAt)}),m.jsx("td",{children:D.revokedAt===void 0?m.jsx("button",{type:"button",className:"bad",style:{padding:"2px 9px",fontSize:11},onClick:()=>void X(D),children:"revoke"}):null})]},D.keyId))})]}),f.length===0?m.jsx("p",{className:"hint",style:{marginTop:10},children:"No keys. This server is open to anyone who can reach the port — issuing the first key is what closes it."}):null]})]})}async function Ny(i,f){try{return(await fetch(\`\${i}/v1/agents\`,{headers:{authorization:\`Bearer \${f}\`}})).ok}catch{return!0}}function vi(i){const f=new Date(i);return Number.isNaN(f.getTime())?i:f.toISOString().slice(0,10)}const jy=["chat","new","tools","schedules","channels","config","keys"];function xy(i){return i!==null&&jy.includes(i)}function _y(i){const f=new URL(i).searchParams,r=f.get("agent"),c=f.get("panel");return{...r===null||r===""?{}:{agentId:r},panel:xy(c)?c:"chat"}}function My(i,f){const r=new URL(i);return f.agentId===void 0||f.agentId===""?r.searchParams.delete("agent"):r.searchParams.set("agent",f.agentId),f.panel==="chat"?r.searchParams.delete("panel"):r.searchParams.set("panel",f.panel),\`\${r.pathname}\${r.search}\`}function wy(){let i,f;return{begin(r){if(i!==r)return f?.abort(),i=r,f=new AbortController,f.signal},finish(r){i===r&&(i=void 0,f=void 0)},abort(){f?.abort()},following:()=>i,aborted:()=>f?.signal.aborted??!1}}function Ry(i){const f={};for(const r of i)f[r.step]=r.fallback;return f}const Uy=8;function Oy(i,f,r){let c=f;for(let d=0;d<Uy;d+=1){if(c===void 0)return!1;const h=c.requires;if(h===void 0)return!0;if(r[h.step]!==h.value)return!1;c=i.find(v=>v.step===h.step)}return!1}function bi(i,f){return i.filter(r=>Oy(i,r,f))}function g0(i,f){return bi(i,f).filter(r=>r.optional!==!0&&(f[r.step]??"").trim()==="")}function Dy(i,f){const r={};for(const c of bi(i,f)){const d=(f[c.step]??"").trim();d!==""&&(r[c.step]=d)}return r}function By(i,f){return bi(i,f).filter(r=>r.secret&&(f[r.step]??"").trim()==="")}function Hy(i){return{...Fa,filter:i==="nlt"?fy():c0()}}const Fa={filter:c0(),rows:[],live:"",liveReasoning:"",running:!1,truncated:!1};let Rh=0;function Kt(){return Rh+=1,\`r\${Rh}\`}function qy(i,f){return{...i,rows:[...i.rows,{kind:"user",id:Kt(),text:f}],running:!0}}function Yy(i,f){switch(f.kind){case"accepted":return i;case"replay":return f.report.truncated?{...i,truncated:!0}:i;case"ended":return{...i,running:!1,rows:[...i.rows,{kind:"note",id:Kt(),text:\`This turn finished before the page attached — \${f.status}. Its reply is stored.\`,bad:f.status!=="final"}]};case"unavailable":return{...i,running:!1,rows:[...i.rows,{kind:"note",id:Kt(),text:f.reason,bad:!0}]};case"event":return Ly(i,f.event)}}function Ly(i,f){switch(f.type){case"turn.start":return{...i,running:!0};case"model.chunk":{const r=f.data;if(r.kind==="reasoning")return{...i,liveReasoning:i.liveReasoning+r.delta};const c=i.filter.push(r.delta);return c===""?i:{...i,live:i.live+c}}case"model.result":return Ja({...i,live:i.live+i.filter.endStep()});case"tool.call":{const r=f.data,c=Ja(i);return{...c,rows:[...c.rows,{kind:"tool",id:Kt(),callId:r.callId,slug:r.slug,mutating:r.mutating}]}}case"tool.result":{const r=f.data,c=i.rows.findIndex(v=>v.kind==="tool"&&v.callId===r.callId);if(c===-1)return i;const d=i.rows[c];if(d===void 0||d.kind!=="tool")return i;const h=[...i.rows];return h[c]={...d,ok:r.ok,bytes:r.bytes,truncated:r.truncated,latencyMs:r.latencyMs,...r.trust==="untrusted"?{untrusted:!0}:{}},{...i,rows:h}}case"approval.requested":{const r=f.data,c=Ja(i);return{...c,rows:[...c.rows,{kind:"approval",id:Kt(),approvalId:r.approvalId,slug:r.slug,...r.match===void 0?{}:{match:r.match},reason:r.reason}]}}case"approval.resolved":{const r=f.data,c=i.rows.findIndex(v=>v.kind==="approval"&&v.approvalId===r.approvalId);if(c===-1)return i;const d=i.rows[c];if(d===void 0||d.kind!=="approval")return i;const h=[...i.rows];return h[c]={...d,settled:r.by==="abandoned"?"abandoned":r.by==="error"?"error":r.granted?"granted":"denied"},{...i,rows:h}}case"error":{const r=f.data,c=Ja({...i,live:i.live+i.filter.end()});return{...c,running:!1,rows:[...c.rows,{kind:"note",id:Kt(),text:\`\${r.code}: \${r.message}
26
+ hint: \${r.hint}\`,bad:!0}]}}case"agent.warning":{const r=f.data;return{...i,rows:[...i.rows,{kind:"note",id:Kt(),text:r.message??"",bad:!1}]}}case"turn.end":{const r=f.data,c=Ja({...i,live:i.live+i.filter.end()}),d=ey(r.reason,{steps:r.steps});return{...c,running:!1,rows:d===void 0?c.rows:[...c.rows,{kind:"note",id:Kt(),text:d,bad:Pg(r.reason)}]}}default:return i}}function Ja(i){if(i.live===""&&i.liveReasoning==="")return i;const f=[...i.rows],r=i.liveReasoning.trim();r!==""&&f.push({kind:"reasoning",id:Kt(),text:r});const c=i.live.trim();return c!==""&&f.push({kind:"reply",id:Kt(),text:c}),{...i,rows:f,live:"",liveReasoning:""}}function Gy(i){if(!i.available)return m.jsxs("p",{className:"empty",children:["This server has no provisioner, so it cannot create an agent — the case for an embedder mounting the API over its own agent store. Run ",m.jsx("code",{children:"dispach init"})," ","where the sandbox is, or mount an agent directory."]});if(!i.allowed)return m.jsxs("p",{className:"empty",children:["Creating an agent needs a loopback bind or a credential with the ",m.jsx("code",{children:"admin"})," ","capability, and this request has neither. On a server reachable from elsewhere, set"," ",m.jsx("code",{children:"server.tokenEnv"})," or present an operator key minted with"," ",m.jsx("code",{children:"can: [admin]"})," — or mount a written agent at ",m.jsx("code",{children:"/agent"}),"."]})}function Qy(i){const{step:f,value:r}=i,c=\`provision-\${f.step}\`;return m.jsxs("div",{className:i.invalid?"field invalid":"field",children:[m.jsxs("label",{htmlFor:c,children:[f.prompt,f.optional?m.jsx("span",{className:"sub",children:" optional"}):null,f.secret?m.jsx("span",{className:"sub",children:" · written to .env, never read back"}):null]}),f.choices===void 0?m.jsx("input",{id:c,name:f.step,type:f.secret?"password":"text",value:r,disabled:i.disabled,autoComplete:f.secret?"new-password":"off",spellCheck:!1,onChange:d=>i.onChange(d.target.value)}):m.jsx("select",{id:c,name:f.step,value:r,disabled:i.disabled,onChange:d=>i.onChange(d.target.value),children:f.choices.map(d=>m.jsx("option",{value:d.value,children:d.hint===void 0?d.label:\`\${d.label} — \${d.hint}\`},d.value))}),i.invalid?m.jsx("div",{className:"sub error",children:"needs an answer"}):null]})}function Xy(i){const f=i.result.adopted.includes(i.result.id);return m.jsxs("div",{className:"created",children:[m.jsxs("h3",{children:["Created ",m.jsx("code",{children:i.result.id})]}),m.jsxs("p",{children:[m.jsx("code",{children:i.result.dir}),m.jsxs("span",{className:"sub",children:[" · ",i.result.files.length," files"]})]}),f?m.jsx("p",{className:"ok",children:"adopted · live on this host, with its channels and schedules"}):m.jsxs("p",{className:"error",children:["written, and ",m.jsx("strong",{children:"not running"}),i.result.error===void 0?null:m.jsxs(m.Fragment,{children:[": ",i.result.error.message,i.result.error.hint===void 0?null:m.jsxs("span",{className:"sub",children:[" ",i.result.error.hint]})]})]}),i.blank.length===0?null:m.jsxs("div",{className:"blank-secrets",children:[m.jsxs("p",{children:["Left empty, and needed before this works:"," ",i.blank.map(r=>r.prompt).join(", "),"."]}),m.jsxs("p",{className:"sub",children:["Fill them in ",m.jsxs("code",{children:[i.result.dir,"/.env"]})," at a terminal —"," ",m.jsx("code",{children:".env"})," is a protected path, so neither the agent nor this API can write it. The file names each variable in its own comments."]})]}),f?m.jsxs("button",{type:"button",onClick:()=>i.onOpen(i.result.id),children:["open ",i.result.id]}):null]})}function Ky(i){if(i.result!==void 0)return m.jsx(Xy,{result:i.result,blank:By(i.offer.steps,i.answers),onOpen:i.onOpen});const f=Gy(i.offer);if(f!==void 0)return f;const r=bi(i.offer.steps,i.answers),c=g0(i.offer.steps,i.answers),d=new Set(c.map(h=>h.step));return m.jsxs("form",{className:"provision",onSubmit:h=>{h.preventDefault(),i.onSubmit()},children:[m.jsxs("p",{className:"sub",children:["The same questions ",m.jsx("code",{children:"dispach init"})," asks, served from the same walk. What you leave alone takes its default. The agent is adopted into this server as it is created — there is no second command."]}),r.map(h=>m.jsx(Qy,{step:h,value:i.answers[h.step]??"",invalid:i.touched&&d.has(h.step),disabled:i.busy,onChange:v=>i.onAnswer(h.step,v)},h.step)),i.error===void 0?null:m.jsx("p",{className:"error",children:i.error}),m.jsx("button",{type:"submit",disabled:i.busy,children:i.busy?"creating…":"create agent"}),i.touched&&c.length>0?m.jsxs("p",{className:"sub error",children:[c.map(h=>h.prompt).join(", ")," — still needed."]}):null]})}var $l={},Qf,Uh;function Zy(){return Uh||(Uh=1,Qf=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),Qf}var Xf={},Bn={},Oh;function nl(){if(Oh)return Bn;Oh=1;let i;const f=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return Bn.getSymbolSize=function(c){if(!c)throw new Error('"version" cannot be null or undefined');if(c<1||c>40)throw new Error('"version" should be in range from 1 to 40');return c*4+17},Bn.getSymbolTotalCodewords=function(c){return f[c]},Bn.getBCHDigit=function(r){let c=0;for(;r!==0;)c++,r>>>=1;return c},Bn.setToSJISFunction=function(c){if(typeof c!="function")throw new Error('"toSJISFunc" is not a valid function.');i=c},Bn.isKanjiModeEnabled=function(){return typeof i<"u"},Bn.toSJIS=function(c){return i(c)},Bn}var Kf={},Dh;function ps(){return Dh||(Dh=1,(function(i){i.L={bit:1},i.M={bit:0},i.Q={bit:3},i.H={bit:2};function f(r){if(typeof r!="string")throw new Error("Param is not a string");switch(r.toLowerCase()){case"l":case"low":return i.L;case"m":case"medium":return i.M;case"q":case"quartile":return i.Q;case"h":case"high":return i.H;default:throw new Error("Unknown EC Level: "+r)}}i.isValid=function(c){return c&&typeof c.bit<"u"&&c.bit>=0&&c.bit<4},i.from=function(c,d){if(i.isValid(c))return c;try{return f(c)}catch{return d}}})(Kf)),Kf}var Zf,Bh;function Vy(){if(Bh)return Zf;Bh=1;function i(){this.buffer=[],this.length=0}return i.prototype={get:function(f){const r=Math.floor(f/8);return(this.buffer[r]>>>7-f%8&1)===1},put:function(f,r){for(let c=0;c<r;c++)this.putBit((f>>>r-c-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(f){const r=Math.floor(this.length/8);this.buffer.length<=r&&this.buffer.push(0),f&&(this.buffer[r]|=128>>>this.length%8),this.length++}},Zf=i,Zf}var Vf,Hh;function Jy(){if(Hh)return Vf;Hh=1;function i(f){if(!f||f<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=f,this.data=new Uint8Array(f*f),this.reservedBit=new Uint8Array(f*f)}return i.prototype.set=function(f,r,c,d){const h=f*this.size+r;this.data[h]=c,d&&(this.reservedBit[h]=!0)},i.prototype.get=function(f,r){return this.data[f*this.size+r]},i.prototype.xor=function(f,r,c){this.data[f*this.size+r]^=c},i.prototype.isReserved=function(f,r){return this.reservedBit[f*this.size+r]},Vf=i,Vf}var Jf={},qh;function ky(){return qh||(qh=1,(function(i){const f=nl().getSymbolSize;i.getRowColCoords=function(c){if(c===1)return[];const d=Math.floor(c/7)+2,h=f(c),v=h===145?26:Math.ceil((h-13)/(2*d-2))*2,A=[h-7];for(let p=1;p<d-1;p++)A[p]=A[p-1]-v;return A.push(6),A.reverse()},i.getPositions=function(c){const d=[],h=i.getRowColCoords(c),v=h.length;for(let A=0;A<v;A++)for(let p=0;p<v;p++)A===0&&p===0||A===0&&p===v-1||A===v-1&&p===0||d.push([h[A],h[p]]);return d}})(Jf)),Jf}var kf={},Yh;function $y(){if(Yh)return kf;Yh=1;const i=nl().getSymbolSize,f=7;return kf.getPositions=function(c){const d=i(c);return[[0,0],[d-f,0],[0,d-f]]},kf}var $f={},Lh;function Fy(){return Lh||(Lh=1,(function(i){i.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const f={N1:3,N2:3,N3:40,N4:10};i.isValid=function(d){return d!=null&&d!==""&&!isNaN(d)&&d>=0&&d<=7},i.from=function(d){return i.isValid(d)?parseInt(d,10):void 0},i.getPenaltyN1=function(d){const h=d.size;let v=0,A=0,p=0,y=null,j=null;for(let E=0;E<h;E++){A=p=0,y=j=null;for(let x=0;x<h;x++){let H=d.get(E,x);H===y?A++:(A>=5&&(v+=f.N1+(A-5)),y=H,A=1),H=d.get(x,E),H===j?p++:(p>=5&&(v+=f.N1+(p-5)),j=H,p=1)}A>=5&&(v+=f.N1+(A-5)),p>=5&&(v+=f.N1+(p-5))}return v},i.getPenaltyN2=function(d){const h=d.size;let v=0;for(let A=0;A<h-1;A++)for(let p=0;p<h-1;p++){const y=d.get(A,p)+d.get(A,p+1)+d.get(A+1,p)+d.get(A+1,p+1);(y===4||y===0)&&v++}return v*f.N2},i.getPenaltyN3=function(d){const h=d.size;let v=0,A=0,p=0;for(let y=0;y<h;y++){A=p=0;for(let j=0;j<h;j++)A=A<<1&2047|d.get(y,j),j>=10&&(A===1488||A===93)&&v++,p=p<<1&2047|d.get(j,y),j>=10&&(p===1488||p===93)&&v++}return v*f.N3},i.getPenaltyN4=function(d){let h=0;const v=d.data.length;for(let p=0;p<v;p++)h+=d.data[p];return Math.abs(Math.ceil(h*100/v/5)-10)*f.N4};function r(c,d,h){switch(c){case i.Patterns.PATTERN000:return(d+h)%2===0;case i.Patterns.PATTERN001:return d%2===0;case i.Patterns.PATTERN010:return h%3===0;case i.Patterns.PATTERN011:return(d+h)%3===0;case i.Patterns.PATTERN100:return(Math.floor(d/2)+Math.floor(h/3))%2===0;case i.Patterns.PATTERN101:return d*h%2+d*h%3===0;case i.Patterns.PATTERN110:return(d*h%2+d*h%3)%2===0;case i.Patterns.PATTERN111:return(d*h%3+(d+h)%2)%2===0;default:throw new Error("bad maskPattern:"+c)}}i.applyMask=function(d,h){const v=h.size;for(let A=0;A<v;A++)for(let p=0;p<v;p++)h.isReserved(p,A)||h.xor(p,A,r(d,p,A))},i.getBestMask=function(d,h){const v=Object.keys(i.Patterns).length;let A=0,p=1/0;for(let y=0;y<v;y++){h(y),i.applyMask(y,d);const j=i.getPenaltyN1(d)+i.getPenaltyN2(d)+i.getPenaltyN3(d)+i.getPenaltyN4(d);i.applyMask(y,d),j<p&&(p=j,A=y)}return A}})($f)),$f}var gi={},Gh;function y0(){if(Gh)return gi;Gh=1;const i=ps(),f=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],r=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return gi.getBlocksCount=function(d,h){switch(h){case i.L:return f[(d-1)*4+0];case i.M:return f[(d-1)*4+1];case i.Q:return f[(d-1)*4+2];case i.H:return f[(d-1)*4+3];default:return}},gi.getTotalCodewordsCount=function(d,h){switch(h){case i.L:return r[(d-1)*4+0];case i.M:return r[(d-1)*4+1];case i.Q:return r[(d-1)*4+2];case i.H:return r[(d-1)*4+3];default:return}},gi}var Ff={},ka={},Qh;function Wy(){if(Qh)return ka;Qh=1;const i=new Uint8Array(512),f=new Uint8Array(256);return(function(){let c=1;for(let d=0;d<255;d++)i[d]=c,f[c]=d,c<<=1,c&256&&(c^=285);for(let d=255;d<512;d++)i[d]=i[d-255]})(),ka.log=function(c){if(c<1)throw new Error("log("+c+")");return f[c]},ka.exp=function(c){return i[c]},ka.mul=function(c,d){return c===0||d===0?0:i[f[c]+f[d]]},ka}var Xh;function Iy(){return Xh||(Xh=1,(function(i){const f=Wy();i.mul=function(c,d){const h=new Uint8Array(c.length+d.length-1);for(let v=0;v<c.length;v++)for(let A=0;A<d.length;A++)h[v+A]^=f.mul(c[v],d[A]);return h},i.mod=function(c,d){let h=new Uint8Array(c);for(;h.length-d.length>=0;){const v=h[0];for(let p=0;p<d.length;p++)h[p]^=f.mul(d[p],v);let A=0;for(;A<h.length&&h[A]===0;)A++;h=h.slice(A)}return h},i.generateECPolynomial=function(c){let d=new Uint8Array([1]);for(let h=0;h<c;h++)d=i.mul(d,new Uint8Array([1,f.exp(h)]));return d}})(Ff)),Ff}var Wf,Kh;function Py(){if(Kh)return Wf;Kh=1;const i=Iy();function f(r){this.genPoly=void 0,this.degree=r,this.degree&&this.initialize(this.degree)}return f.prototype.initialize=function(c){this.degree=c,this.genPoly=i.generateECPolynomial(this.degree)},f.prototype.encode=function(c){if(!this.genPoly)throw new Error("Encoder not initialized");const d=new Uint8Array(c.length+this.degree);d.set(c);const h=i.mod(d,this.genPoly),v=this.degree-h.length;if(v>0){const A=new Uint8Array(this.degree);return A.set(h,v),A}return h},Wf=f,Wf}var If={},Pf={},es={},Zh;function v0(){return Zh||(Zh=1,es.isValid=function(f){return!isNaN(f)&&f>=1&&f<=40}),es}var Xt={},Vh;function b0(){if(Vh)return Xt;Vh=1;const i="[0-9]+",f="[A-Z $%*+\\\\-./:]+";let r="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";r=r.replace(/u/g,"\\\\u");const c="(?:(?![A-Z0-9 $%*+\\\\-./:]|"+r+\`)(?:.|[\\r
27
+ ]))+\`;Xt.KANJI=new RegExp(r,"g"),Xt.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\\\-./:]+","g"),Xt.BYTE=new RegExp(c,"g"),Xt.NUMERIC=new RegExp(i,"g"),Xt.ALPHANUMERIC=new RegExp(f,"g");const d=new RegExp("^"+r+"$"),h=new RegExp("^"+i+"$"),v=new RegExp("^[A-Z0-9 $%*+\\\\-./:]+$");return Xt.testKanji=function(p){return d.test(p)},Xt.testNumeric=function(p){return h.test(p)},Xt.testAlphanumeric=function(p){return v.test(p)},Xt}var Jh;function ll(){return Jh||(Jh=1,(function(i){const f=v0(),r=b0();i.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},i.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},i.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},i.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},i.MIXED={bit:-1},i.getCharCountIndicator=function(h,v){if(!h.ccBits)throw new Error("Invalid mode: "+h);if(!f.isValid(v))throw new Error("Invalid version: "+v);return v>=1&&v<10?h.ccBits[0]:v<27?h.ccBits[1]:h.ccBits[2]},i.getBestModeForData=function(h){return r.testNumeric(h)?i.NUMERIC:r.testAlphanumeric(h)?i.ALPHANUMERIC:r.testKanji(h)?i.KANJI:i.BYTE},i.toString=function(h){if(h&&h.id)return h.id;throw new Error("Invalid mode")},i.isValid=function(h){return h&&h.bit&&h.ccBits};function c(d){if(typeof d!="string")throw new Error("Param is not a string");switch(d.toLowerCase()){case"numeric":return i.NUMERIC;case"alphanumeric":return i.ALPHANUMERIC;case"kanji":return i.KANJI;case"byte":return i.BYTE;default:throw new Error("Unknown mode: "+d)}}i.from=function(h,v){if(i.isValid(h))return h;try{return c(h)}catch{return v}}})(Pf)),Pf}var kh;function ev(){return kh||(kh=1,(function(i){const f=nl(),r=y0(),c=ps(),d=ll(),h=v0(),v=7973,A=f.getBCHDigit(v);function p(x,H,X){for(let D=1;D<=40;D++)if(H<=i.getCapacity(D,X,x))return D}function y(x,H){return d.getCharCountIndicator(x,H)+4}function j(x,H){let X=0;return x.forEach(function(D){const se=y(D.mode,H);X+=se+D.getBitsLength()}),X}function E(x,H){for(let X=1;X<=40;X++)if(j(x,X)<=i.getCapacity(X,H,d.MIXED))return X}i.from=function(H,X){return h.isValid(H)?parseInt(H,10):X},i.getCapacity=function(H,X,D){if(!h.isValid(H))throw new Error("Invalid QR Code version");typeof D>"u"&&(D=d.BYTE);const se=f.getSymbolTotalCodewords(H),L=r.getTotalCodewordsCount(H,X),ce=(se-L)*8;if(D===d.MIXED)return ce;const I=ce-y(D,H);switch(D){case d.NUMERIC:return Math.floor(I/10*3);case d.ALPHANUMERIC:return Math.floor(I/11*2);case d.KANJI:return Math.floor(I/13);case d.BYTE:default:return Math.floor(I/8)}},i.getBestVersionForData=function(H,X){let D;const se=c.from(X,c.M);if(Array.isArray(H)){if(H.length>1)return E(H,se);if(H.length===0)return 1;D=H[0]}else D=H;return p(D.mode,D.getLength(),se)},i.getEncodedBits=function(H){if(!h.isValid(H)||H<7)throw new Error("Invalid QR Code version");let X=H<<12;for(;f.getBCHDigit(X)-A>=0;)X^=v<<f.getBCHDigit(X)-A;return H<<12|X}})(If)),If}var ts={},$h;function tv(){if($h)return ts;$h=1;const i=nl(),f=1335,r=21522,c=i.getBCHDigit(f);return ts.getEncodedBits=function(h,v){const A=h.bit<<3|v;let p=A<<10;for(;i.getBCHDigit(p)-c>=0;)p^=f<<i.getBCHDigit(p)-c;return(A<<10|p)^r},ts}var ns={},ls,Fh;function nv(){if(Fh)return ls;Fh=1;const i=ll();function f(r){this.mode=i.NUMERIC,this.data=r.toString()}return f.getBitsLength=function(c){return 10*Math.floor(c/3)+(c%3?c%3*3+1:0)},f.prototype.getLength=function(){return this.data.length},f.prototype.getBitsLength=function(){return f.getBitsLength(this.data.length)},f.prototype.write=function(c){let d,h,v;for(d=0;d+3<=this.data.length;d+=3)h=this.data.substr(d,3),v=parseInt(h,10),c.put(v,10);const A=this.data.length-d;A>0&&(h=this.data.substr(d),v=parseInt(h,10),c.put(v,A*3+1))},ls=f,ls}var as,Wh;function lv(){if(Wh)return as;Wh=1;const i=ll(),f=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function r(c){this.mode=i.ALPHANUMERIC,this.data=c}return r.getBitsLength=function(d){return 11*Math.floor(d/2)+6*(d%2)},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(d){let h;for(h=0;h+2<=this.data.length;h+=2){let v=f.indexOf(this.data[h])*45;v+=f.indexOf(this.data[h+1]),d.put(v,11)}this.data.length%2&&d.put(f.indexOf(this.data[h]),6)},as=r,as}var us,Ih;function av(){if(Ih)return us;Ih=1;const i=ll();function f(r){this.mode=i.BYTE,typeof r=="string"?this.data=new TextEncoder().encode(r):this.data=new Uint8Array(r)}return f.getBitsLength=function(c){return c*8},f.prototype.getLength=function(){return this.data.length},f.prototype.getBitsLength=function(){return f.getBitsLength(this.data.length)},f.prototype.write=function(r){for(let c=0,d=this.data.length;c<d;c++)r.put(this.data[c],8)},us=f,us}var is,Ph;function uv(){if(Ph)return is;Ph=1;const i=ll(),f=nl();function r(c){this.mode=i.KANJI,this.data=c}return r.getBitsLength=function(d){return d*13},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(c){let d;for(d=0;d<this.data.length;d++){let h=f.toSJIS(this.data[d]);if(h>=33088&&h<=40956)h-=33088;else if(h>=57408&&h<=60351)h-=49472;else throw new Error("Invalid SJIS character: "+this.data[d]+\`
28
+ Make sure your charset is UTF-8\`);h=(h>>>8&255)*192+(h&255),c.put(h,13)}},is=r,is}var cs={exports:{}},e0;function iv(){return e0||(e0=1,(function(i){var f={single_source_shortest_paths:function(r,c,d){var h={},v={};v[c]=0;var A=f.PriorityQueue.make();A.push(c,0);for(var p,y,j,E,x,H,X,D,se;!A.empty();){p=A.pop(),y=p.value,E=p.cost,x=r[y]||{};for(j in x)x.hasOwnProperty(j)&&(H=x[j],X=E+H,D=v[j],se=typeof v[j]>"u",(se||D>X)&&(v[j]=X,A.push(j,X),h[j]=y))}if(typeof d<"u"&&typeof v[d]>"u"){var L=["Could not find a path from ",c," to ",d,"."].join("");throw new Error(L)}return h},extract_shortest_path_from_predecessor_list:function(r,c){for(var d=[],h=c;h;)d.push(h),r[h],h=r[h];return d.reverse(),d},find_path:function(r,c,d){var h=f.single_source_shortest_paths(r,c,d);return f.extract_shortest_path_from_predecessor_list(h,d)},PriorityQueue:{make:function(r){var c=f.PriorityQueue,d={},h;r=r||{};for(h in c)c.hasOwnProperty(h)&&(d[h]=c[h]);return d.queue=[],d.sorter=r.sorter||c.default_sorter,d},default_sorter:function(r,c){return r.cost-c.cost},push:function(r,c){var d={value:r,cost:c};this.queue.push(d),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};i.exports=f})(cs)),cs.exports}var t0;function cv(){return t0||(t0=1,(function(i){const f=ll(),r=nv(),c=lv(),d=av(),h=uv(),v=b0(),A=nl(),p=iv();function y(L){return unescape(encodeURIComponent(L)).length}function j(L,ce,I){const $=[];let Ae;for(;(Ae=L.exec(I))!==null;)$.push({data:Ae[0],index:Ae.index,mode:ce,length:Ae[0].length});return $}function E(L){const ce=j(v.NUMERIC,f.NUMERIC,L),I=j(v.ALPHANUMERIC,f.ALPHANUMERIC,L);let $,Ae;return A.isKanjiModeEnabled()?($=j(v.BYTE,f.BYTE,L),Ae=j(v.KANJI,f.KANJI,L)):($=j(v.BYTE_KANJI,f.BYTE,L),Ae=[]),ce.concat(I,$,Ae).sort(function(Y,K){return Y.index-K.index}).map(function(Y){return{data:Y.data,mode:Y.mode,length:Y.length}})}function x(L,ce){switch(ce){case f.NUMERIC:return r.getBitsLength(L);case f.ALPHANUMERIC:return c.getBitsLength(L);case f.KANJI:return h.getBitsLength(L);case f.BYTE:return d.getBitsLength(L)}}function H(L){return L.reduce(function(ce,I){const $=ce.length-1>=0?ce[ce.length-1]:null;return $&&$.mode===I.mode?(ce[ce.length-1].data+=I.data,ce):(ce.push(I),ce)},[])}function X(L){const ce=[];for(let I=0;I<L.length;I++){const $=L[I];switch($.mode){case f.NUMERIC:ce.push([$,{data:$.data,mode:f.ALPHANUMERIC,length:$.length},{data:$.data,mode:f.BYTE,length:$.length}]);break;case f.ALPHANUMERIC:ce.push([$,{data:$.data,mode:f.BYTE,length:$.length}]);break;case f.KANJI:ce.push([$,{data:$.data,mode:f.BYTE,length:y($.data)}]);break;case f.BYTE:ce.push([{data:$.data,mode:f.BYTE,length:y($.data)}])}}return ce}function D(L,ce){const I={},$={start:{}};let Ae=["start"];for(let Z=0;Z<L.length;Z++){const Y=L[Z],K=[];for(let V=0;V<Y.length;V++){const ne=Y[V],q=""+Z+V;K.push(q),I[q]={node:ne,lastCount:0},$[q]={};for(let F=0;F<Ae.length;F++){const ee=Ae[F];I[ee]&&I[ee].node.mode===ne.mode?($[ee][q]=x(I[ee].lastCount+ne.length,ne.mode)-x(I[ee].lastCount,ne.mode),I[ee].lastCount+=ne.length):(I[ee]&&(I[ee].lastCount=ne.length),$[ee][q]=x(ne.length,ne.mode)+4+f.getCharCountIndicator(ne.mode,ce))}}Ae=K}for(let Z=0;Z<Ae.length;Z++)$[Ae[Z]].end=0;return{map:$,table:I}}function se(L,ce){let I;const $=f.getBestModeForData(L);if(I=f.from(ce,$),I!==f.BYTE&&I.bit<$.bit)throw new Error('"'+L+'" cannot be encoded with mode '+f.toString(I)+\`.
29
+ Suggested mode is: \`+f.toString($));switch(I===f.KANJI&&!A.isKanjiModeEnabled()&&(I=f.BYTE),I){case f.NUMERIC:return new r(L);case f.ALPHANUMERIC:return new c(L);case f.KANJI:return new h(L);case f.BYTE:return new d(L)}}i.fromArray=function(ce){return ce.reduce(function(I,$){return typeof $=="string"?I.push(se($,null)):$.data&&I.push(se($.data,$.mode)),I},[])},i.fromString=function(ce,I){const $=E(ce,A.isKanjiModeEnabled()),Ae=X($),Z=D(Ae,I),Y=p.find_path(Z.map,"start","end"),K=[];for(let V=1;V<Y.length-1;V++)K.push(Z.table[Y[V]].node);return i.fromArray(H(K))},i.rawSplit=function(ce){return i.fromArray(E(ce,A.isKanjiModeEnabled()))}})(ns)),ns}var n0;function fv(){if(n0)return Xf;n0=1;const i=nl(),f=ps(),r=Vy(),c=Jy(),d=ky(),h=$y(),v=Fy(),A=y0(),p=Py(),y=ev(),j=tv(),E=ll(),x=cv();function H(Z,Y){const K=Z.size,V=h.getPositions(Y);for(let ne=0;ne<V.length;ne++){const q=V[ne][0],F=V[ne][1];for(let ee=-1;ee<=7;ee++)if(!(q+ee<=-1||K<=q+ee))for(let ue=-1;ue<=7;ue++)F+ue<=-1||K<=F+ue||(ee>=0&&ee<=6&&(ue===0||ue===6)||ue>=0&&ue<=6&&(ee===0||ee===6)||ee>=2&&ee<=4&&ue>=2&&ue<=4?Z.set(q+ee,F+ue,!0,!0):Z.set(q+ee,F+ue,!1,!0))}}function X(Z){const Y=Z.size;for(let K=8;K<Y-8;K++){const V=K%2===0;Z.set(K,6,V,!0),Z.set(6,K,V,!0)}}function D(Z,Y){const K=d.getPositions(Y);for(let V=0;V<K.length;V++){const ne=K[V][0],q=K[V][1];for(let F=-2;F<=2;F++)for(let ee=-2;ee<=2;ee++)F===-2||F===2||ee===-2||ee===2||F===0&&ee===0?Z.set(ne+F,q+ee,!0,!0):Z.set(ne+F,q+ee,!1,!0)}}function se(Z,Y){const K=Z.size,V=y.getEncodedBits(Y);let ne,q,F;for(let ee=0;ee<18;ee++)ne=Math.floor(ee/3),q=ee%3+K-8-3,F=(V>>ee&1)===1,Z.set(ne,q,F,!0),Z.set(q,ne,F,!0)}function L(Z,Y,K){const V=Z.size,ne=j.getEncodedBits(Y,K);let q,F;for(q=0;q<15;q++)F=(ne>>q&1)===1,q<6?Z.set(q,8,F,!0):q<8?Z.set(q+1,8,F,!0):Z.set(V-15+q,8,F,!0),q<8?Z.set(8,V-q-1,F,!0):q<9?Z.set(8,15-q-1+1,F,!0):Z.set(8,15-q-1,F,!0);Z.set(V-8,8,1,!0)}function ce(Z,Y){const K=Z.size;let V=-1,ne=K-1,q=7,F=0;for(let ee=K-1;ee>0;ee-=2)for(ee===6&&ee--;;){for(let ue=0;ue<2;ue++)if(!Z.isReserved(ne,ee-ue)){let Ye=!1;F<Y.length&&(Ye=(Y[F]>>>q&1)===1),Z.set(ne,ee-ue,Ye),q--,q===-1&&(F++,q=7)}if(ne+=V,ne<0||K<=ne){ne-=V,V=-V;break}}}function I(Z,Y,K){const V=new r;K.forEach(function(ue){V.put(ue.mode.bit,4),V.put(ue.getLength(),E.getCharCountIndicator(ue.mode,Z)),ue.write(V)});const ne=i.getSymbolTotalCodewords(Z),q=A.getTotalCodewordsCount(Z,Y),F=(ne-q)*8;for(V.getLengthInBits()+4<=F&&V.put(0,4);V.getLengthInBits()%8!==0;)V.putBit(0);const ee=(F-V.getLengthInBits())/8;for(let ue=0;ue<ee;ue++)V.put(ue%2?17:236,8);return $(V,Z,Y)}function $(Z,Y,K){const V=i.getSymbolTotalCodewords(Y),ne=A.getTotalCodewordsCount(Y,K),q=V-ne,F=A.getBlocksCount(Y,K),ee=V%F,ue=F-ee,Ye=Math.floor(V/F),M=Math.floor(q/F),G=M+1,ae=Ye-M,Te=new p(ae);let be=0;const b=new Array(F),R=new Array(F);let Q=0;const W=new Uint8Array(Z.buffer);for(let Ne=0;Ne<F;Ne++){const nt=Ne<ue?M:G;b[Ne]=W.slice(be,be+nt),R[Ne]=Te.encode(b[Ne]),be+=nt,Q=Math.max(Q,nt)}const fe=new Uint8Array(V);let re=0,de,Me;for(de=0;de<Q;de++)for(Me=0;Me<F;Me++)de<b[Me].length&&(fe[re++]=b[Me][de]);for(de=0;de<ae;de++)for(Me=0;Me<F;Me++)fe[re++]=R[Me][de];return fe}function Ae(Z,Y,K,V){let ne;if(Array.isArray(Z))ne=x.fromArray(Z);else if(typeof Z=="string"){let Ye=Y;if(!Ye){const M=x.rawSplit(Z);Ye=y.getBestVersionForData(M,K)}ne=x.fromString(Z,Ye||40)}else throw new Error("Invalid data");const q=y.getBestVersionForData(ne,K);if(!q)throw new Error("The amount of data is too big to be stored in a QR Code");if(!Y)Y=q;else if(Y<q)throw new Error(\`
30
+ The chosen QR Code version cannot contain this amount of data.
31
+ Minimum version required to store current data is: \`+q+\`.
32
+ \`);const F=I(Y,K,ne),ee=i.getSymbolSize(Y),ue=new c(ee);return H(ue,Y),X(ue),D(ue,Y),L(ue,K,0),Y>=7&&se(ue,Y),ce(ue,F),isNaN(V)&&(V=v.getBestMask(ue,L.bind(null,ue,K))),v.applyMask(V,ue),L(ue,K,V),{modules:ue,version:Y,errorCorrectionLevel:K,maskPattern:V,segments:ne}}return Xf.create=function(Y,K){if(typeof Y>"u"||Y==="")throw new Error("No input text");let V=f.M,ne,q;return typeof K<"u"&&(V=f.from(K.errorCorrectionLevel,f.M),ne=y.from(K.version),q=v.from(K.maskPattern),K.toSJISFunc&&i.setToSJISFunction(K.toSJISFunc)),Ae(Y,ne,V,q)},Xf}var fs={},ss={},l0;function S0(){return l0||(l0=1,(function(i){function f(r){if(typeof r=="number"&&(r=r.toString()),typeof r!="string")throw new Error("Color should be defined as hex string");let c=r.slice().replace("#","").split("");if(c.length<3||c.length===5||c.length>8)throw new Error("Invalid hex color: "+r);(c.length===3||c.length===4)&&(c=Array.prototype.concat.apply([],c.map(function(h){return[h,h]}))),c.length===6&&c.push("F","F");const d=parseInt(c.join(""),16);return{r:d>>24&255,g:d>>16&255,b:d>>8&255,a:d&255,hex:"#"+c.slice(0,6).join("")}}i.getOptions=function(c){c||(c={}),c.color||(c.color={});const d=typeof c.margin>"u"||c.margin===null||c.margin<0?4:c.margin,h=c.width&&c.width>=21?c.width:void 0,v=c.scale||4;return{width:h,scale:h?4:v,margin:d,color:{dark:f(c.color.dark||"#000000ff"),light:f(c.color.light||"#ffffffff")},type:c.type,rendererOpts:c.rendererOpts||{}}},i.getScale=function(c,d){return d.width&&d.width>=c+d.margin*2?d.width/(c+d.margin*2):d.scale},i.getImageWidth=function(c,d){const h=i.getScale(c,d);return Math.floor((c+d.margin*2)*h)},i.qrToImageData=function(c,d,h){const v=d.modules.size,A=d.modules.data,p=i.getScale(v,h),y=Math.floor((v+h.margin*2)*p),j=h.margin*p,E=[h.color.light,h.color.dark];for(let x=0;x<y;x++)for(let H=0;H<y;H++){let X=(x*y+H)*4,D=h.color.light;if(x>=j&&H>=j&&x<y-j&&H<y-j){const se=Math.floor((x-j)/p),L=Math.floor((H-j)/p);D=E[A[se*v+L]?1:0]}c[X++]=D.r,c[X++]=D.g,c[X++]=D.b,c[X]=D.a}}})(ss)),ss}var a0;function sv(){return a0||(a0=1,(function(i){const f=S0();function r(d,h,v){d.clearRect(0,0,h.width,h.height),h.style||(h.style={}),h.height=v,h.width=v,h.style.height=v+"px",h.style.width=v+"px"}function c(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}i.render=function(h,v,A){let p=A,y=v;typeof p>"u"&&(!v||!v.getContext)&&(p=v,v=void 0),v||(y=c()),p=f.getOptions(p);const j=f.getImageWidth(h.modules.size,p),E=y.getContext("2d"),x=E.createImageData(j,j);return f.qrToImageData(x.data,h,p),r(E,y,j),E.putImageData(x,0,0),y},i.renderToDataURL=function(h,v,A){let p=A;typeof p>"u"&&(!v||!v.getContext)&&(p=v,v=void 0),p||(p={});const y=i.render(h,v,p),j=p.type||"image/png",E=p.rendererOpts||{};return y.toDataURL(j,E.quality)}})(fs)),fs}var rs={},u0;function rv(){if(u0)return rs;u0=1;const i=S0();function f(d,h){const v=d.a/255,A=h+'="'+d.hex+'"';return v<1?A+" "+h+'-opacity="'+v.toFixed(2).slice(1)+'"':A}function r(d,h,v){let A=d+h;return typeof v<"u"&&(A+=" "+v),A}function c(d,h,v){let A="",p=0,y=!1,j=0;for(let E=0;E<d.length;E++){const x=Math.floor(E%h),H=Math.floor(E/h);!x&&!y&&(y=!0),d[E]?(j++,E>0&&x>0&&d[E-1]||(A+=y?r("M",x+v,.5+H+v):r("m",p,0),p=0,y=!1),x+1<h&&d[E+1]||(A+=r("h",j),j=0)):p++}return A}return rs.render=function(h,v,A){const p=i.getOptions(v),y=h.modules.size,j=h.modules.data,E=y+p.margin*2,x=p.color.light.a?"<path "+f(p.color.light,"fill")+' d="M0 0h'+E+"v"+E+'H0z"/>':"",H="<path "+f(p.color.dark,"stroke")+' d="'+c(j,y,p.margin)+'"/>',X='viewBox="0 0 '+E+" "+E+'"',se='<svg xmlns="http://www.w3.org/2000/svg" '+(p.width?'width="'+p.width+'" height="'+p.width+'" ':"")+X+' shape-rendering="crispEdges">'+x+H+\`</svg>
33
+ \`;return typeof A=="function"&&A(null,se),se},rs}var i0;function ov(){if(i0)return $l;i0=1;const i=Zy(),f=fv(),r=sv(),c=rv();function d(h,v,A,p,y){const j=[].slice.call(arguments,1),E=j.length,x=typeof j[E-1]=="function";if(!x&&!i())throw new Error("Callback required as last argument");if(x){if(E<2)throw new Error("Too few arguments provided");E===2?(y=A,A=v,v=p=void 0):E===3&&(v.getContext&&typeof y>"u"?(y=p,p=void 0):(y=p,p=A,A=v,v=void 0))}else{if(E<1)throw new Error("Too few arguments provided");return E===1?(A=v,v=p=void 0):E===2&&!v.getContext&&(p=A,A=v,v=void 0),new Promise(function(H,X){try{const D=f.create(A,p);H(h(D,v,p))}catch(D){X(D)}})}try{const H=f.create(A,p);y(null,h(H,v,p))}catch(H){y(H)}}return $l.create=f.create,$l.toCanvas=d.bind(null,r.render),$l.toDataURL=d.bind(null,r.renderToDataURL),$l.toString=d.bind(null,function(h,v,A){return c.render(h,A)}),$l}var dv=ov();const hv=Yg(dv);function p0(i){return i==null?"":typeof i=="string"?i:typeof i=="number"||typeof i=="boolean"?String(i):JSON.stringify(i)}function mv(i){return!(i.text.trim()===""||i.text===p0(i.setting.value)||i.setting.confirm!==void 0&&!i.confirmed)}function gv(i){return i.agents.length===0?m.jsx("div",{className:"empty",style:{fontSize:12,padding:"4px 8px"},children:"no agents on this server"}):m.jsx(m.Fragment,{children:i.agents.map(f=>{const r=f.status==="disabled";return m.jsxs("div",{className:"agent-row",children:[m.jsxs("button",{type:"button",className:"row-button","aria-current":f.id===i.current,disabled:r,onClick:()=>i.onSelect(f.id),children:[f.name,r?m.jsx("span",{className:"agent-off",children:" · stopped"}):null]}),r?m.jsxs("div",{className:"agent-note",children:[f.reason??"switched off",m.jsx("button",{type:"button",className:"link",disabled:i.starting===f.id,onClick:()=>i.onStart(f.id),children:i.starting===f.id?"starting…":"start"})]}):null]},f.id)})})}function yv(i){return i.tools.length===0?m.jsxs("p",{className:"empty",children:["No tools are pinned. An agent with none can still hold a conversation; a manifest's"," ",m.jsx("code",{children:"tools.pinned"})," is what grants the rest."]}):m.jsxs("table",{className:"panel-table",children:[m.jsx("thead",{children:m.jsxs("tr",{children:[m.jsx("th",{children:"tool"}),m.jsx("th",{children:"provider"}),m.jsx("th",{children:"writes"}),m.jsx("th",{children:"trust"})]})}),m.jsx("tbody",{children:i.tools.map(f=>m.jsxs("tr",{children:[m.jsxs("td",{children:[m.jsx("code",{children:f.slug}),m.jsx("div",{className:"sub",children:f.summary})]}),m.jsx("td",{children:f.provider}),m.jsx("td",{children:f.mutating?"yes":"no"}),m.jsxs("td",{children:[f.trust,f.trustReason===void 0?null:m.jsx("div",{className:"sub",children:f.trustReason})]})]},f.slug))})]})}function vv(i){return m.jsxs(m.Fragment,{children:[i.schedules.length===0?m.jsxs("p",{className:"empty",children:["No schedules. Add one below, or declare it in the manifest's"," ",m.jsx("code",{children:"schedules:"})," block — a declared one survives a rebuild and shows up in a diff."]}):m.jsxs("table",{className:"panel-table",children:[m.jsx("thead",{children:m.jsxs("tr",{children:[m.jsx("th",{children:"schedule"}),m.jsx("th",{children:"when"}),m.jsx("th",{children:"next"}),m.jsx("th",{children:"delivers to"}),m.jsx("th",{children:"declared in"}),m.jsx("th",{})]})}),m.jsx("tbody",{children:i.schedules.map(f=>{const r=f.origin==="manifest",c=i.busy===f.id;return m.jsxs("tr",{className:f.enabled?"":"off",children:[m.jsxs("td",{children:[m.jsx("code",{children:f.id}),m.jsx("div",{className:"sub",children:f.task})]}),m.jsxs("td",{children:[f.kind," ",f.expr,f.timezone===void 0?null:m.jsx("div",{className:"sub",children:f.timezone})]}),m.jsx("td",{children:f.enabled?f.nextRunAt??"never again — a spent one-shot":"disabled"}),m.jsx("td",{children:f.deliverChannel===void 0?"this session only":\`\${f.deliverChannel}\${f.deliverTo===void 0?"":\` → \${f.deliverTo}\`}\`}),m.jsxs("td",{children:[r?"agent.yaml":"the API",r?m.jsxs("div",{className:"sub",children:["the manifest decides it — edit the file, or the"," ",m.jsx("code",{children:"schedules"})," field under config"]}):null]}),m.jsxs("td",{style:{whiteSpace:"nowrap"},children:[i.onRun===void 0?null:m.jsx("button",{type:"button",disabled:c,onClick:()=>i.onRun?.(f.id),children:"run now"}),i.onToggle===void 0||r?null:m.jsx("button",{type:"button",disabled:c,onClick:()=>i.onToggle?.(f.id,!f.enabled),children:f.enabled?"disable":"enable"}),i.onDelete===void 0||r?null:m.jsx("button",{type:"button",disabled:c,onClick:()=>i.onDelete?.(f.id),children:"delete"})]})]},f.id)})})]}),i.onCreate===void 0?null:m.jsx(bv,{onCreate:i.onCreate})]})}function bv(i){const[f,r]=J.useState(""),[c,d]=J.useState("cron"),[h,v]=J.useState(""),[A,p]=J.useState(""),[y,j]=J.useState(""),[E,x]=J.useState(""),H=f.trim()!==""&&h.trim()!==""&&A.trim()!=="";return m.jsxs("section",{style:{marginTop:24},children:[m.jsx("h3",{style:{fontSize:13,margin:"0 0 8px"},children:"Add a schedule"}),m.jsxs("div",{className:"form-grid",children:[m.jsx("label",{htmlFor:"sched-id",children:"id"}),m.jsx("input",{id:"sched-id",value:f,placeholder:"morning-brief",onChange:X=>r(X.target.value)}),m.jsx("label",{htmlFor:"sched-kind",children:"kind"}),m.jsxs("select",{id:"sched-kind",value:c,onChange:X=>d(X.target.value),children:[m.jsx("option",{value:"cron",children:"cron — a 5- or 6-field expression"}),m.jsx("option",{value:"every",children:"every — a duration like 15m"}),m.jsx("option",{value:"at",children:"at — one ISO instant, once"})]}),m.jsx("label",{htmlFor:"sched-expr",children:"expr"}),m.jsx("input",{id:"sched-expr",value:h,placeholder:c==="cron"?"0 8 * * *":c==="every"?"15m":"",onChange:X=>v(X.target.value)}),m.jsx("label",{htmlFor:"sched-task",children:"task"}),m.jsx("input",{id:"sched-task",value:A,placeholder:"Summarise today's calendar.",onChange:X=>p(X.target.value)}),m.jsx("label",{htmlFor:"sched-channel",children:"deliver"}),m.jsxs("div",{children:[m.jsx("input",{id:"sched-channel",value:y,placeholder:"channel id — blank for this session only",onChange:X=>j(X.target.value)}),y.trim()===""?null:m.jsxs(m.Fragment,{children:[m.jsx("input",{value:E,placeholder:"address",onChange:X=>x(X.target.value)}),m.jsxs("p",{className:"sub",children:["The address a reply is ",m.jsx("em",{children:"sent"})," to — on Telegram the numeric chat id, never an ",m.jsx("code",{children:"@handle"}),", which addresses a channel and not a person. It is the id inbound messages arrive on."]})]})]})]}),m.jsx("button",{type:"button",disabled:!H,style:{marginTop:10},onClick:()=>i.onCreate({id:f.trim(),kind:c,expr:h.trim(),task:A.trim(),deliver:y.trim()===""?"none":{channel:y.trim(),to:E.trim()}}),children:"add"})]})}function Sv(i){return i.editable?m.jsxs(m.Fragment,{children:[m.jsxs("p",{className:"sub",style:{marginTop:0},children:[i.file===void 0?null:m.jsxs(m.Fragment,{children:[m.jsx("code",{children:i.file}),"."," "]}),"An agent's settings are fixed for its instance's lifetime, so saving one replaces the agent — the conversation history is in the store and survives it."]}),i.note===void 0?null:m.jsx("p",{className:"row note",children:i.note}),i.settings.map(f=>m.jsx(pv,{setting:f,busy:i.busy===f.path,onSet:i.onSet},f.path))]}):m.jsx("p",{className:"empty",children:"This agent was loaded from an object rather than a file, so there is no manifest to change. An embedder holding new settings passes the new object to its runtime."})}function pv(i){const f=p0(i.setting.value),[r,c]=J.useState(f),[d,h]=J.useState(!1),[v,A]=J.useState(f);v!==f&&(A(f),c(f),h(!1));const p=mv({setting:i.setting,text:r,confirmed:d}),y=f.length>48||f.includes("{")||f.includes("[");return m.jsxs("section",{className:"config-row",children:[m.jsxs("div",{className:"config-head",children:[m.jsx("code",{children:i.setting.path}),i.setting.value===void 0?m.jsx("span",{className:"sub",children:" not set"}):null]}),m.jsx("p",{className:"sub",children:i.setting.means}),y?m.jsx("textarea",{rows:2,value:r,"aria-label":i.setting.path,onChange:j=>c(j.target.value)}):m.jsx("input",{value:r,"aria-label":i.setting.path,onChange:j=>c(j.target.value)}),i.setting.confirm===void 0?null:m.jsxs("label",{className:"row note bad",style:{display:"block"},children:[m.jsx("input",{type:"checkbox",checked:d,onChange:j=>h(j.target.checked)})," ",i.setting.confirm]}),m.jsx("button",{type:"button",disabled:!p||i.busy,onClick:()=>i.onSet(i.setting.path,r,{confirm:d}),children:i.busy?"saving…":"save"})]})}function Ev(i){return i.warnings.length===0?null:m.jsxs("section",{className:"warnings",children:[m.jsxs("h3",{children:[i.warnings.length," thing",i.warnings.length===1?"":"s"," this agent could not set up"]}),m.jsx("p",{className:"sub",children:"It is running. Each of these is a capability it does not have — fix the cause and restart the agent."}),i.warnings.map(f=>m.jsxs("div",{className:"warning",children:[m.jsxs("p",{className:"warning-message",children:[f.field===void 0?null:m.jsx("code",{children:f.field})," ",f.message]}),f.hint===void 0?null:m.jsx("p",{className:"hint",children:f.hint})]},\`\${f.code}:\${f.message}\`))]})}function Tv(i){return i.channels.length===0?m.jsx("p",{className:"empty",children:"No channels. This agent is reached through this page and the HTTP API only."}):m.jsxs("div",{className:"channels",children:[i.channels.map(f=>{const r=f.input,c=r?.expiresAt!==void 0&&Date.parse(r.expiresAt)<=i.now;return m.jsxs("section",{className:"channel",children:[m.jsxs("h3",{children:[m.jsx("code",{children:f.id})," ",m.jsx("span",{className:"sub",children:f.type})]}),m.jsxs("p",{className:\`status status-\${f.status??"off"}\`,children:[f.enabled===!1?"disconnected":f.status??"not started here",f.detail===void 0?null:\` — \${f.detail}\`]}),f.credentialEnv===void 0?null:m.jsxs("p",{className:f.credentialSet===!0?"sub":"warn",children:[m.jsx("code",{children:f.credentialEnv})," ",f.credentialSet===!0?"is set":"is NOT set"]}),r===void 0?null:m.jsxs("div",{className:\`channel-input \${c?"stale":"fresh"}\`,children:[c?m.jsx("p",{className:"warn",children:"this expired — the channel will issue another"}):null,m.jsx(Cv,{kind:r.kind,payload:r.payload}),m.jsxs("p",{className:"sub",children:[r.kind," · issued ",r.issuedAt,r.expiresAt===void 0?" · no expiry reported":\` · expires \${r.expiresAt}\`]})]}),i.actions===void 0?null:m.jsx(Av,{channel:f,actions:i.actions})]},f.id)}),i.actions?.note===void 0?null:m.jsx("p",{className:"row note",children:i.actions.note})]})}function Av(i){const[f,r]=J.useState(""),{channel:c,actions:d}=i,h=d.busy===c.id,v=c.enabled!==!1,A=c.input!==void 0||c.type==="whatsapp";return m.jsxs("div",{className:"channel-actions",children:[m.jsx("button",{type:"button",disabled:h,onClick:()=>d.onConnect(c.id,!v),children:v?"disconnect":"connect"}),A?m.jsx("button",{type:"button",disabled:h,onClick:()=>d.onUnpair(c.id),children:"unpair"}):null,c.credentialEnv===void 0?null:m.jsxs("form",{onSubmit:p=>{p.preventDefault(),f!==""&&(d.onCredential(c.id,f),r(""))},children:[m.jsx("input",{type:"password",autoComplete:"new-password",placeholder:c.credentialEnv,value:f,disabled:h,onChange:p=>r(p.target.value)}),m.jsx("button",{type:"submit",disabled:h||f==="",children:c.credentialSet===!0?"replace":"set"})]}),h?m.jsx("span",{className:"sub",children:"working…"}):null]})}const zv=[{panel:"tools",label:"tools"},{panel:"schedules",label:"schedules"},{panel:"channels",label:"channels"},{panel:"config",label:"config"},{panel:"keys",label:"keys"}];function Cv(i){if(i.kind==="pairing_code")return m.jsx("p",{className:"payload-code","data-kind":i.kind,children:i.payload.length===8?\`\${i.payload.slice(0,4)} \${i.payload.slice(4)}\`:i.payload});const f=i.kind==="qr"?Nv(i.payload):void 0;return f===void 0?m.jsx("pre",{className:"payload","data-kind":i.kind,children:i.payload}):m.jsxs("svg",{className:"payload-qr",viewBox:\`0 0 \${f.extent} \${f.extent}\`,"data-kind":i.kind,"data-modules":f.size,shapeRendering:"crispEdges",role:"img","aria-label":"Scan this code from WhatsApp, under Linked devices",children:[m.jsx("rect",{width:f.extent,height:f.extent,fill:"#fff"}),m.jsx("path",{d:f.d,fill:"#000"})]})}const os=4;function Nv(i){try{const{modules:f}=hv.create(i,{errorCorrectionLevel:"L"}),r=f.size;let c="";for(let d=0;d<r;d+=1)for(let h=0;h<r;h+=1)f.data[d*r+h]===1&&(c+=\`M\${h+os},\${d+os}h1v1h-1z\`);return c===""?void 0:{d:c,size:r,extent:r+os*2}}catch{return}}const ds="dispach.turn";function jv(i){const[f,r]=J.useState(),[c,d]=J.useState();return J.useEffect(()=>{Ay(i.baseUrl).then(r).catch(h=>d(h instanceof Error?h.message:String(h)))},[i.baseUrl]),c!==void 0?m.jsxs(gs,{title:"Cannot reach the server",children:[m.jsx("p",{children:c}),m.jsx("button",{type:"button",onClick:()=>window.location.reload(),children:"Try again"})]}):f===void 0?m.jsx(gs,{title:"Connecting…"}):f.kind==="needed"?m.jsx(xv,{baseUrl:i.baseUrl,because:f.because}):m.jsx(Mv,{baseUrl:i.baseUrl,token:f.kind==="key"?f.secret:void 0})}function gs(i){return m.jsx("div",{className:"gate",children:m.jsxs("div",{className:"card",children:[m.jsx("h2",{children:i.title}),i.children]})})}function xv(i){const[f,r]=J.useState(""),[c,d]=J.useState(),[h,v]=J.useState(!1),A=async p=>{v(!0),d(void 0);try{const y=p?await h0(i.baseUrl,f.trim()):f.trim();bs(y),window.location.reload()}catch(y){d(y instanceof Error?y.message:String(y)),v(!1)}};return m.jsxs(gs,{title:"This server needs a credential",children:[m.jsx("p",{children:i.because}),m.jsx("input",{value:f,placeholder:"paste a claim or an operator key",onChange:p=>r(p.target.value)}),m.jsxs("p",{className:"hint",style:{margin:"8px 0 12px"},children:[m.jsx("code",{children:"dispach serve"})," prints a one-time claim at boot while no key exists. A claim is exchanged for a key this browser keeps; a key is used directly."]}),m.jsx("div",{className:"ask",children:m.jsxs("div",{className:"buttons",children:[m.jsx("button",{type:"button",className:"primary",disabled:h||f.trim()==="",onClick:()=>A(!0),children:"Exchange a claim"}),m.jsx("button",{type:"button",disabled:h||f.trim()==="",onClick:()=>A(!1),children:"Use as a key"})]})}),c===void 0?null:m.jsx("p",{className:"note bad",style:{marginTop:12},children:c})]})}const yi=i=>i instanceof Zt&&i.status===404,_v={new:"New agent",tools:"Tools",schedules:"Schedules",channels:"Channels",config:"Settings",keys:"Operator keys"};function Mv(i){const f=J.useRef(m0(i.baseUrl,i.token)),[r,c]=J.useState([]),[d,h]=J.useState(),[v,A]=J.useState(),[p,y]=J.useState(),[j,E]=J.useState([]),x=J.useCallback(async()=>{h(void 0),A(void 0),E([]),K("this agent is no longer running on this server — start it from the list");try{c(await f.current.agents())}catch{}},[]),[H,X]=J.useState([]),[D,se]=J.useState(),[L,ce]=J.useState(()=>_y(window.location.href).panel),[I,$]=J.useState(Fa),[Ae,Z]=J.useState(""),[Y,K]=J.useState(),V=J.useRef(void 0),ne=J.useRef(wy());J.useEffect(()=>{const B=new URL(window.location.href).searchParams.get("agent")??void 0;f.current.agents().then(k=>{c(k);const he=k.filter(lt=>lt.status!=="disabled"),De=he.find(lt=>lt.id===B)??he[0];if(De===void 0){new URL(window.location.href).searchParams.get("panel")===null&&ce("new");return}h(De.id),A(De.name),$(lt=>({...lt,filter:Hy(De.dialect??"nlt").filter})),document.title=\`\${De.name} · Dispach\`}).catch(k=>K(qt(k)))},[]);const q=J.useMemo(()=>d===void 0?void 0:f.current.agent(d),[d]),F=J.useCallback(async()=>{if(q!==void 0)try{X(await q.sessions()),K(void 0)}catch(B){yi(B)?x():K(qt(B))}},[q,x]);J.useEffect(()=>{F()},[F]);const ee=J.useCallback(async(B,k)=>{const he=ne.current,De=he.begin(B);if(De===void 0)return;const lt=k.turn(B);V.current=()=>lt.stop();try{sessionStorage.setItem(ds,B);for await(const rl of lt.stream({chunks:!0,signal:De}))$(Il=>Yy(Il,rl))}catch(rl){De.aborted||(K(qt(rl)),$(Il=>({...Il,running:!1})))}finally{he.finish(B),sessionStorage.removeItem(ds),V.current=void 0,De.aborted||F()}},[F]);J.useEffect(()=>{if(q===void 0)return;const B=sessionStorage.getItem(ds);if(B!==null)return $(k=>({...k,running:!0})),ee(B,q),()=>ne.current.abort()},[q,ee]),J.useEffect(()=>{if(q===void 0)return;let B=!0;const k=()=>{q.approvals().then(De=>{B&&E(De)}).catch(De=>{B&&yi(De)&&x()})};k();const he=window.setInterval(k,5e3);return()=>{B=!1,window.clearInterval(he)}},[q,x]);const ue=async()=>{const B=Ae.trim();if(!(B===""||q===void 0)){Z(""),K(void 0),$(k=>qy(k,B));try{const k=await q.send(B,{...D===void 0?{}:{sessionKey:D}});D===void 0&&se(k.sessionKey),await ee(k.turnId,q)}catch(k){K(qt(k)),$(he=>({...he,running:!1}))}}},Ye=async(B,k)=>{if(q!==void 0)try{await q.approve(B,k)}catch(he){he instanceof Zt&&he.code==="approval_not_found"||K(qt(he))}},M=async B=>{if(ne.current.abort(),ce("chat"),se(B),$(Fa),Z(""),!(B===void 0||q===void 0))try{const k=await Rv(i.baseUrl,i.token,d??"",B);$({...Fa,rows:k})}catch(k){K(qt(k))}},[G,ae]=J.useState({tools:[],schedules:[],channels:[],warnings:[]}),[Te,be]=J.useState(void 0),[b,R]=J.useState(void 0),Q=J.useCallback(async B=>{const[k,he,De,lt]=await Promise.all([B.tools(),B.schedules(),B.describe(),B.config()]);ae({tools:k,schedules:he,channels:De.channels??[],warnings:De.warnings??[],config:lt})},[]),W=J.useCallback(async(B,k)=>{if(q!==void 0){be(B),R(void 0);try{const he=await q.setChannel(B,k);R([...he.notes,...he.applied?[]:[\`Not in force yet: \${he.pending?.message??"restart to apply"}\`]].join(" ")),await Q(q)}catch(he){R(he instanceof Error?he.message:String(he))}finally{be(void 0)}}},[q,Q]),fe=J.useCallback(async B=>{if(q!==void 0){be(B),R(void 0);try{R((await q.unpairChannel(B)).note),await Q(q)}catch(k){R(k instanceof Error?k.message:String(k))}finally{be(void 0)}}},[q,Q]);J.useEffect(()=>{if(q===void 0||L!=="tools"&&L!=="schedules"&&L!=="channels"&&L!=="config")return;let B=!1;return(async()=>{try{if(await Q(q),B)return}catch(k){if(B)return;yi(k)?x():K(qt(k))}})(),()=>{B=!0}},[q,L,x,Q]);const[re,de]=J.useState(),[Me,Ne]=J.useState(),nt=J.useCallback(async(B,k)=>{if(q!==void 0){de(B),K(void 0),Ne(void 0);try{const he=await k(q);Ne(he),await Q(q)}catch(he){yi(he)?x():K(qt(he))}finally{de(void 0)}}},[q,x,Q]),al=J.useCallback((B,k,he)=>void nt(B,async De=>{const lt=await De.setConfig(B,k,{...he.confirm?{confirm:!0}:{}});return lt.applied?lt.reflowed?\`\${B} saved. The manifest was re-serialised, so its comments have moved — worth a look at the diff.\`:void 0:\`\${B} was written to the manifest and is not in force yet: \${lt.pending?.message??"the agent could not be replaced"} It takes effect at the next start.\`}),[nt]),[At,Fl]=J.useState(),[zt,ul]=J.useState({}),[Wl,Wa]=J.useState(!1),[Ia,il]=J.useState(!1),[cl,fl]=J.useState();J.useEffect(()=>{if(L!=="new"||At!==void 0)return;let B=!1;return(async()=>{try{const k=await f.current.provision();if(B)return;Fl(k),ul(Ry(k.steps))}catch(k){B||K(qt(k))}})(),()=>{B=!0}},[L,At]);const Si=J.useCallback(async()=>{if(At!==void 0&&(Wa(!0),!(g0(At.steps,zt).length>0))){il(!0),K(void 0);try{const B=await f.current.createAgent(Dy(At.steps,zt));fl(B),c(await f.current.agents())}catch(B){K(qt(B))}finally{il(!1)}}},[At,zt]),sl=J.useCallback(B=>{const k=B.panel??L,he=B.agentId??d;ce(k),B.agentId!==void 0&&B.agentId!==d&&(h(B.agentId),A(r.find(De=>De.id===B.agentId)?.name),se(void 0),$(Fa),Z("")),window.history.replaceState(null,"",My(window.location.href,{...he===void 0?{}:{agentId:he},panel:k}))},[d,r,L]),ut=J.useCallback(async B=>{y(B);try{await f.current.agent(B).start(),c(await f.current.agents())}catch(k){K(qt(k))}finally{y(void 0)}},[]);return m.jsxs("div",{className:"shell",children:[m.jsxs("aside",{className:"side",children:[m.jsxs("header",{children:[m.jsx("div",{className:"brand",children:"Dispach"}),m.jsx("div",{style:{fontSize:12,color:"var(--dim)"},children:v??"…"})]}),m.jsxs("nav",{children:[r.length>1||r.some(B=>B.status==="disabled")?m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"group",children:"Agents"}),m.jsx(gv,{agents:r,current:d,onSelect:B=>sl({agentId:B}),onStart:B=>void ut(B),...p===void 0?{}:{starting:p}})]}):null,m.jsx("div",{className:"group",children:"Conversation"}),m.jsx("button",{type:"button",className:"row-button","aria-current":L==="chat"&&D===void 0,onClick:()=>void M(void 0),children:"+ new"}),H.map(B=>m.jsx("button",{type:"button",className:"row-button","aria-current":L==="chat"&&D===B.sessionKey,onClick:()=>void M(B.sessionKey),children:B.sessionKey},B.sessionKey)),m.jsx("div",{className:"group",children:"Server"}),m.jsx("button",{type:"button",className:"row-button","aria-current":L==="new",onClick:()=>sl({panel:"new"}),children:"+ new agent"}),zv.map(B=>m.jsx("button",{type:"button",className:"row-button","aria-current":L===B.panel,onClick:()=>sl({panel:B.panel}),children:B.label},B.panel))]}),m.jsxs("footer",{children:[m.jsx("span",{className:\`dot \${I.running?"busy":"live"}\`}),m.jsx("span",{style:{fontSize:11,color:"var(--dim)"},children:I.running?"working":"ready"}),i.token===void 0?m.jsx("span",{style:{fontSize:11,color:"var(--warn)",marginLeft:"auto"},children:"unauthenticated"}):m.jsx("button",{type:"button",style:{marginLeft:"auto",padding:"3px 8px",fontSize:11},onClick:()=>{Ss(),window.location.reload()},children:"forget key"})]})]}),m.jsxs("main",{className:"main",children:[m.jsxs("div",{className:"bar",children:[m.jsx("strong",{children:L==="chat"?v??"":_v[L]}),L==="chat"?m.jsx("span",{children:D??"new conversation"}):null,m.jsx("span",{className:"spacer"}),j.length>0?m.jsxs("span",{style:{color:"var(--warn)"},children:[j.length," waiting on you"]}):null]}),L!=="chat"?m.jsx("div",{className:"scroll",children:m.jsxs("div",{className:"pad",children:[Y===void 0?null:m.jsx("p",{className:"row note bad",children:Y}),m.jsx(Ev,{warnings:G.warnings}),L==="new"?At===void 0?m.jsx("p",{className:"empty",children:"reading this server's questions…"}):m.jsx(Ky,{offer:At,answers:zt,busy:Ia,touched:Wl,...Y===void 0?{}:{error:Y},...cl===void 0?{}:{result:cl},onAnswer:(B,k)=>ul(he=>({...he,[B]:k})),onSubmit:()=>void Si(),onOpen:B=>{fl(void 0),Fl(void 0),Wa(!1),sl({agentId:B,panel:"chat"})}}):null,L==="keys"?m.jsx(Cy,{client:f.current,baseUrl:i.baseUrl,token:i.token}):null,L==="tools"?m.jsx(yv,{tools:G.tools}):null,L==="schedules"?m.jsx(vv,{schedules:G.schedules,...re===void 0?{}:{busy:re},onCreate:B=>void nt(String(B.id),k=>k.createSchedule(B).then(()=>{})),onDelete:B=>void nt(B,k=>k.deleteSchedule(B).then(()=>{})),onRun:B=>void nt(B,async k=>{const he=await k.runSchedule(B);return\`\${B} fired out of band as \${he.turnId} — its next scheduled run has not moved.\`}),onToggle:(B,k)=>void nt(B,he=>he.updateSchedule(B,{enabled:k}).then(()=>{}))}):null,L==="config"?G.config===void 0?m.jsx("p",{className:"empty",children:"reading this agent's settings…"}):m.jsx(Sv,{settings:G.config.settings,editable:G.config.editable,...G.config.file===void 0?{}:{file:G.config.file},...re===void 0?{}:{busy:re},...Me===void 0?{}:{note:Me},onSet:al}):null,L==="channels"?m.jsx(Tv,{channels:G.channels,now:Date.now(),actions:{onConnect:(B,k)=>void W(B,{enabled:k}),onCredential:(B,k)=>void W(B,{credential:k}),onUnpair:B=>void fe(B),...Te===void 0?{}:{busy:Te},...b===void 0?{}:{note:b}}}):null]})}):m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"scroll",children:m.jsxs("div",{className:"pad",children:[Y===void 0?null:m.jsx("p",{className:"row note bad",children:Y}),m.jsx(yy,{state:I,onAnswer:(B,k)=>void Ye(B,k)}),m.jsx(wv,{state:I})]})}),m.jsx(py,{value:Ae,busy:I.running,onChange:Z,onSend:()=>void ue(),onStop:()=>void V.current?.()})]})]})]})}function wv(i){const f=J.useRef(null),r=i.state.rows.length+i.state.live.length;return J.useEffect(()=>{const c=f.current,d=c?.closest(".scroll");if(c===null||d===null||d===void 0)return;d.scrollHeight-d.scrollTop-d.clientHeight<40&&c.scrollIntoView({block:"end"})},[r]),m.jsx("div",{ref:f})}async function Rv(i,f,r,c){const d=await fetch(\`\${i}/v1/agents/\${r}/sessions/\${encodeURIComponent(c)}/messages?limit=200\`,{headers:f===void 0?{}:{authorization:\`Bearer \${f}\`}});return d.ok?[...(await d.json()).messages??[]].reverse().filter(v=>v.origin===void 0&&(v.role==="user"||v.role==="assistant")&&(v.content??"")!=="").map((v,A)=>({kind:v.role==="user"?"user":"reply",id:\`h\${A}\`,text:v.content??""})):[]}function qt(i){return i instanceof Zt||i instanceof Error?i.message:String(i)}const E0=document.getElementById("root");if(E0===null)throw new Error("no #root in the document");$g.createRoot(E0).render(m.jsx(J.StrictMode,{children:m.jsx(jv,{baseUrl:window.location.origin})}));
34
+ `;var ft=`<!doctype html>
35
+ <html lang="en">
36
+ <head>
37
+ <meta charset="utf-8" />
38
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
39
+ <!--
40
+ An inline SVG data URI rather than a file, and that is a constraint rather than a
41
+ flourish: the server embeds these assets as *text* (decision 11.200), so a binary
42
+ favicon would be the one thing in the build that could not ride inside the bundle.
43
+ -->
44
+ <link
45
+ rel="icon"
46
+ href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect width='32' height='32' rx='7' fill='%230b0b0c'/%3E%3Cpath d='M9 8h7a8 8 0 0 1 0 16H9z' fill='none' stroke='%23e8e6e3' stroke-width='2.5'/%3E%3C/svg%3E"
47
+ />
48
+ <title>Dispach</title>
49
+ <!--
50
+ No title text beyond the brand. The page sets \`document.title\` from the agent it is
51
+ actually talking to once it knows, because a tab saying "Dispach" next to three others
52
+ saying "Dispach" is a tab nobody can find.
53
+ -->
54
+ <script type="module" crossorigin src="./assets/app.js"></script>
55
+ <link rel="stylesheet" crossorigin href="./assets/app.css">
56
+ </head>
57
+ <body>
58
+ <div id="root"></div>
59
+ </body>
60
+ </html>
61
+ `;function pt(t){let e=2166136261;for(let r=0;r<t.length;r+=1)e^=t.charCodeAt(r),e=Math.imul(e,16777619)>>>0;return`"${e.toString(36)}-${t.length.toString(36)}"`}function ae(t,e){return{body:t,contentType:e,etag:pt(t)}}var De={"/":ae(ft,"text/html; charset=utf-8"),"/assets/app.js":ae(dt,"text/javascript; charset=utf-8"),"/assets/app.css":ae(ct,"text/css; charset=utf-8")},gt=Object.keys(De);function vt(t,e){let r=De[t];if(r===void 0)return;let h={"content-type":r.contentType,etag:r.etag,"cache-control":"no-cache"};if(e.headers.get("if-none-match")===r.etag)return new Response(null,{status:304,headers:h});return new Response(r.body,{status:200,headers:h})}var J=1e6,ye=256,bt=128,ie=255,kt=`<!doctype html>
62
+ <html lang="en">
63
+ <head>
64
+ <meta charset="utf-8">
65
+ <meta name="viewport" content="width=device-width, initial-scale=1">
66
+ <title>Dispach API</title>
67
+ </head>
68
+ <body style="margin:0">
69
+ <noscript style="display:block;font:14px/1.5 system-ui;padding:2rem;max-width:40rem">
70
+ <h1 style="font-size:1rem">This page needs JavaScript and a network</h1>
71
+ <p>It loads the reference viewer from a CDN. The document itself is served locally and needs
72
+ neither: <a href="/v1/openapi.json">/v1/openapi.json</a>.</p>
73
+ </noscript>
74
+ <div id="app"></div>
75
+ <script src="https://cdn.jsdelivr.net/npm/@scalar/api-reference"></script>
76
+ <script>
77
+ Scalar.createApiReference('#app', { url: '/v1/openapi.json', theme: 'default' })
78
+ </script>
79
+ </body>
80
+ </html>
81
+ `;function St(t){let{runtime:e}=t,r=t.token,h=t.now??(()=>Date.now()),c=h();if(r===void 0&&t.allowUnauthenticated!==!0)throw new j({code:"server_token_missing",message:"createHandler was called with no token and no allowUnauthenticated.",hint:"Pass token, or pass allowUnauthenticated: true to state that this handler is mounted somewhere already protected. Defaulting to open would make the safe configuration the one you have to remember."});let p=t.running??new Map,w=t.approvals??qn(),C=()=>t.origin!==void 0&&X(t.origin.host),L=(i)=>C()||i.kind!=="open"&&me(i,"admin"),A=(i)=>{if(t.origin===void 0)return;let l=Z(i,t.origin);return l===void 0?void 0:k(l,403)},S=(i,l)=>{if(t.origin===void 0)return l;let o=lt(i,t.origin);if(Object.keys(o).length===0)return l;let u=new Headers(l.headers);for(let[m,g]of Object.entries(o))u.set(m,g);return new Response(l.body,{status:l.status,statusText:l.statusText,headers:u})},O=!1,_=async()=>{if(r!==void 0||O)return!0;return O=await e.store.operatorKeys.liveCount()>0,O},z=async(i,l,o)=>{if(xt(l)||!await _())return{kind:"open"};let u=await Ke({request:i,expected:r,keys:e.store.operatorKeys,claim:t.claim,pathname:l,at:h()});if(u instanceof Response)return u;if(u.kind==="claim")return u;if(o!=="open"&&!me(u,o))return Fe(o,`${i.method} ${l}`);return u},v=new Re;return v.add("GET","/v1/health",()=>E({status:"ok",version:je,uptimeMs:h()-c,agents:e.list().length}),{capability:"open"}),v.add("GET","/v1/ready",()=>{if(e.ready)return E({status:"ready",agents:e.list().length});return E({status:"starting",agents:e.list().length},503)},{capability:"open"}),v.add("GET","/v1/agents",async(i)=>{let l=e.list().map((m)=>ke(e,m)),o=new Set(l.map((m)=>m.id)),u=(await e.store.agentState.list()).filter((m)=>!m.enabled&&!o.has(m.agentId)).map((m)=>({id:m.agentId,name:m.agentId,status:"disabled",...m.reason===void 0?{}:{reason:m.reason},...m.disabledAt===void 0?{}:{disabledAt:m.disabledAt}}));return E(Ct(i.principal,[...l,...u]))},{capability:"read"}),v.add("GET","/v1/agents/:id",(i)=>P(e,i,async(l)=>{let o=await l.store.schedules.list(l.id),u=e.team(l.id);return E({...ke(e,l),dialect:l.describe().dialect,window:l.window,tools:l.tools.size,catalogueTokens:l.describe().catalogueTokens,skills:l.skills?.skills.length??0,schedules:o.length,...u.length===0?{}:{team:u.map((m)=>({id:m.id,task:m.task,artifact:Object.keys(m.artifact.properties)}))},warnings:[...l.warnings,...l.tools.warnings]})}),{capability:"read"}),v.add("POST","/v1/agents/:id/reload",(i)=>P(e,i,async(l)=>{try{let o=await e.replace(l.id);return E({id:l.id,status:"loaded",adopted:o.map((u)=>u.id)})}catch(o){if(ee(o))return k({code:o.code,message:o.message,hint:o.hint,...o.field===void 0?{}:{field:o.field}},o.code==="agent_turn_in_flight"?409:400);throw o}}),{capability:"admin"}),v.add("GET","/v1/openapi.json",(i)=>E(at({routes:v.routes(),serverUrl:`${i.url.protocol}//${i.url.host}`})),{capability:"open"}),v.add("GET","/docs",()=>new Response(kt,{status:200,headers:{"content-type":"text/html; charset=utf-8"}}),{capability:"open"}),v.add("GET","/v1/provision",(i)=>E({available:t.provision!==void 0,local:C(),allowed:L(i.principal),steps:t.provision?.steps()??[]}),{capability:"read"}),v.add("POST","/v1/agents",async(i)=>{let l=t.provision;if(l===void 0)return k({code:"provisioning_not_supported",message:"This server cannot create agents.",hint:"Creating one writes a directory of files from a question set this process was not given — an embedder mounting this handler over its own agent store is the case that lands here. Run `init` where the sandbox is, or mount an agent directory."},501);if(!L(i.principal))return k({code:"provisioning_not_local",message:"Creating an agent needs either a loopback bind or a credential with the admin capability.",hint:"This route writes files and starts an agent. A token-less loopback server is a supported configuration, so on a non-loopback bind it asks for a credential instead — set server.tokenEnv (the container's DISPACH_API_TOKEN does this) or present an operator key minted with `can: [admin]`. What is refused is provisioning on a server that required no credential at all and is reachable from the network."},403);let o=await F(i.request);if(o.kind==="error")return k(o.error,400);let u=q(Ie,o.value);if(!u.ok)return k(u.error,400);let m=u.value.answers,g;try{g=l.create(m)}catch(b){if(ee(b))return k(b.toDetail(),400);throw b}try{let b=await e.adopt(g.manifestPath);return E({id:g.agentId,dir:g.dir,files:g.files,adopted:b.map((N)=>N.id)},201)}catch(b){return E({id:g.agentId,dir:g.dir,files:g.files,adopted:[],error:ee(b)?b.toDetail():{code:"provision_adopt_failed",message:b instanceof Error?b.message:String(b),hint:"The agent was written and is not running. Fix what the message names and `start` it, or restart the host."}},201)}},{capability:"admin"}),v.add("POST","/v1/agents/:id/stop",async(i)=>{let l=i.params.id??"",o=e.list().some((x)=>x.id===l),u=await e.store.agentState.get(l);if(!o&&u===void 0)return D("agent",l);let m=await F(i.request);if(m.kind==="error")return k(m.error,400);let g=q(Pe,m.value);if(!g.ok)return k(g.error,400);let b=g.value.reason?.trim(),N=await e.store.agentState.disable(l,new Date(t.now?.()??Date.now()).toISOString(),b===void 0||b===""?void 0:b);if(o)try{await e.dispose(l,"stopped")}catch(x){if(ee(x)&&x.code==="agent_turn_in_flight")return k(x.toDetail(),409);throw x}return E({id:l,status:"disabled",...oe(N)})},{capability:"admin"}),v.add("POST","/v1/agents/:id/start",async(i)=>{let l=i.params.id??"";if(e.list().some((g)=>g.id===l)){let g=await e.store.agentState.enable(l);return E({id:l,status:"loaded",...oe(g)})}let o=t.resolveAgent;if(o===void 0)return k({code:"start_not_supported",message:"This server cannot look up a manifest for an agent it is not hosting.",hint:"Starting a stopped agent needs its manifest, which lives wherever agents live — the sandbox for the CLI, a mounted path for a container. This process was built without that lookup, so pass the agent to `serve` and restart it instead."},501);let u=o(l);if(u===void 0)return D("agent",l);let m=await e.store.agentState.enable(l);try{let g=await e.adopt(u);return E({id:l,status:"loaded",...oe(m),adopted:g.map((b)=>b.id)})}catch(g){if(await e.store.agentState.disable(l,new Date(t.now?.()??Date.now()).toISOString(),"start failed"),ee(g))return k(g.toDetail(),400);throw g}},{capability:"admin"}),v.add("POST","/v1/agents/:id/messages",async(i)=>P(e,i,async(l)=>{let o=await F(i.request);if(o.kind==="error")return k(o.error,400);let u=q(Te,o.value);if(!u.ok)return k(u.error,400);let m=u.value,g=m.chunks===!0,b=m.text,N=m.sessionKey??"api:default",x=W(i,N);if(x!==void 0)return x;let I=zt(m.deliver);if(I.kind==="error")return k(I.error,400);let H=_t(m.from);if(H.kind==="error")return k(H.error,400);let M=jt(i.request);if(M.kind==="error")return k(M.error,400);let B=ht();if(M.key!==void 0){let G=await l.store.turns.claimInboundKey({agentId:l.id,key:M.key,turnId:B,inputHash:await At(N,b),now:new Date});if(G.kind==="replay")return E({turnId:G.turnId,sessionKey:N,replayed:!0},200);if(G.kind==="mismatch")return k({code:"idempotency_key_reused",message:`Idempotency-Key "${M.key}" was already used for a different message.`,hint:`It belongs to turn ${G.turnId}, whose text or session differed from this request's. Nothing was run. Use a fresh key for a new message, or resend the original text byte for byte to get that turn back. A key is remembered for 24 hours.`,field:"Idempotency-Key"},409)}let K=new AbortController;p.set(B,K),e.streams.open(B,{chunks:g});let Rt=l.send(b,{sessionKey:N,turnId:B,source:"api",...H.from===void 0?{}:{from:H.from},signal:K.signal}).then(async(G)=>{if(I.target===void 0||G.text.trim()==="")return;await e.channels.deliver({agentId:l.id,sessionKey:N,channelId:I.target.channel,recipient:I.target.to,turnId:B,text:G.text})}).catch(()=>{}).finally(()=>{p.delete(B)});if(m.stream!==!0)return E({turnId:B,sessionKey:N},202);return Se(e,B,{accepted:{turnId:B,sessionKey:N},status:202,chunks:g})}),{capability:"chat"}),v.add("GET","/v1/agents/:id/turns/:turnId/stream",(i)=>P(e,i,async(l)=>{let o=i.params.turnId??"";if(e.streams.state(o)===void 0){let u=await l.store.turns.get(o);if(u===void 0)return D("turn",o,"No turn with this id has ever run on this agent. A turn id is the `turnId` from POST /v1/agents/:id/messages — check the agent in the path too, since a turn belongs to one.");return Pt(u)}return Se(e,o,{chunks:i.url.searchParams.get("chunks")==="true"})}),{capability:"read",streaming:!0}),v.add("POST","/v1/agents/:id/turns/:turnId/stop",(i)=>P(e,i,()=>{let l=i.params.turnId??"",o=p.get(l);if(o===void 0)return k({code:"turn_not_running",message:`No cancel handle for turn ${l} on this API.`,hint:"This surface can stop a turn it started. A turn that has already finished cannot be stopped at all — read its final state from GET /v1/agents/:id/turns/:turnId. A turn started by a channel, a schedule, or another process is running without a handle here."},409);return o.abort(),E({turnId:l,stopping:!0},202)}),{capability:"chat"}),v.add("GET","/v1/agents/:id/approvals",(i)=>P(e,i,async(l)=>E({approvals:w.pending(l.id)})),{capability:"read"}),v.add("POST","/v1/agents/:id/approvals/:approvalId",(i)=>P(e,i,async()=>{let l=await F(i.request);if(l.kind==="error")return k(l.error,400);let o=q(Ce,l.value);if(!o.ok)return k(o.error,400);let u=o.value,m=i.params.approvalId??"";if(!w.resolve(m,u.granted))return k({code:"approval_not_found",message:`No approval with id ${m} is waiting.`,hint:'It was answered already, or its turn ended while it waited — a stopped or timed-out turn abandons its question, and `approval.resolved` reports that as `by: "abandoned"`. GET /v1/agents/:id/approvals lists what is actually waiting. Nothing about a settled approval is kept, so this is also the answer for an id that was never real.'},404);return E({approvalId:m,granted:u.granted})}),{capability:"chat"}),v.add("GET","/",(i)=>le("/",i),{capability:"open"}),v.add("GET","/assets/app.js",(i)=>le("/assets/app.js",i),{capability:"open"}),v.add("GET","/assets/app.css",(i)=>le("/assets/app.css",i),{capability:"open"}),v.add("POST","/v1/keys",async(i)=>{let l=t.claim!==void 0&&Tt(i.request)===t.claim.token,o=await F(i.request);if(o.kind==="error")return k(o.error,400);let u=q(Ne,o.value);if(!u.ok)return k(u.error,400);let m=u.value,g=Wo(m.label);if(g!==void 0)return k({code:"key_label_invalid",message:g,hint:`A label is shown in a listing and in the UI, so it is at most ${Nn} printable characters on one line. It is a display name, not a description.`,field:"label"},400);if(l&&t.claim?.spend()!==!0)return xe();let b=m.scope;if(b?.agents!==void 0){let M=new Set(e.list().map((K)=>K.id));for(let K of await e.store.agentState.list())M.add(K.agentId);let B=b.agents.filter((K)=>!M.has(K));if(B.length>0)return k({code:"key_scope_agent_unknown",message:`No agent ${B.map((K)=>JSON.stringify(K)).join(", ")} on this server.`,hint:"A key scoped to an agent that does not exist authenticates and then reaches nothing, which looks exactly like a working credential until it is used. GET /v1/agents lists what this server holds, stopped agents included.",field:"scope.agents"},400)}let N=b?.expiresIn===void 0?void 0:new Date(h()+b.expiresIn*1000).toISOString(),x=b===void 0?void 0:{...b.agents===void 0?{}:{agents:b.agents},...b.sessions===void 0?{}:{sessions:b.sessions},...b.can===void 0?{}:{can:b.can}},I=kn(),H=await e.store.operatorKeys.issue({keyId:Xo(h()),label:m.label.trim(),fingerprint:await On(I),createdAt:new Date(h()).toISOString(),...x===void 0||Object.keys(x).length===0?{}:{scope:x},...N===void 0?{}:{expiresAt:N}});return E({...H,secret:I},201)},{capability:"admin"}),v.add("GET","/v1/keys",async()=>{let i=await e.store.operatorKeys.list();return E({keys:i,scope:"A key with no scope authenticates every route for every agent this server holds. A scope narrows an already-authenticated caller — it names agents, a session prefix and capabilities, and it is not an identity: there are no users, teams or roles here."})},{capability:"admin"}),v.add("DELETE","/v1/keys/:keyId",async(i)=>{let l=i.params.keyId??"",o=await e.store.operatorKeys.revoke(l,new Date(h()).toISOString());if(o===void 0)return D("key",l,"The id is the `keyId` from POST /v1/keys, not the secret — GET /v1/keys lists them. An already-revoked key is a 200 carrying its original stamp, so this really does mean no such key exists.");return E(o)},{capability:"admin"}),v.add("GET","/v1/agents/:id/turns/:turnId",(i)=>P(e,i,async(l)=>{let o=await l.store.turns.get(i.params.turnId??"");if(o===void 0)return D("turn",i.params.turnId??"");return E(o)}),{capability:"read"}),v.add("GET","/v1/agents/:id/sessions",(i)=>P(e,i,async(l)=>E(Nt(i.principal,await l.store.sessions.list(l.id)))),{capability:"read"}),v.add("GET","/v1/agents/:id/sessions/:key",(i)=>P(e,i,async(l)=>{let o=i.params.key??"",u=W(i,o);if(u!==void 0)return u;let m=await l.store.sessions.get(l.id,o);if(m===void 0)return D("session",o);return E(m)}),{capability:"read"}),v.add("GET","/v1/agents/:id/sessions/:key/messages",(i)=>P(e,i,async(l)=>{let o=i.url.searchParams.get("before"),u=i.url.searchParams.get("limit"),m=W(i,i.params.key??"");if(m!==void 0)return m;let g=await l.store.messages.page(l.id,i.params.key??"",{...o===null?{}:{before:Number.parseInt(o,10)},...u===null?{}:{limit:Number.parseInt(u,10)}});return E(g)}),{capability:"read"}),v.add("DELETE","/v1/agents/:id/sessions/:key",(i)=>P(e,i,async(l)=>{let o=W(i,i.params.key??"");if(o!==void 0)return o;return await l.store.sessions.clear(l.id,i.params.key??""),E({cleared:i.params.key??"",memoryFilesKept:!0})}),{capability:"write"}),v.add("POST","/v1/agents/:id/sessions/:key/phase",(i)=>P(e,i,async(l)=>{let o=await F(i.request);if(o.kind==="error")return k(o.error,400);let u=q(Ae,o.value);if(!u.ok)return k(u.error,400);let m=u.value.phase;if(typeof m!=="string"&&m!==null)return k({code:"phase_invalid",message:"phase must be a string, or null to clear it.",hint:'Send { "phase": "triage" }. Phase-scoped tool visibility arrives in Phase 7; the column is written now so a session carries the value across a restart.',field:"phase"},400);let g=W(i,i.params.key??"");if(g!==void 0)return g;return await l.store.sessions.setPhase(l.id,i.params.key??"",m===null?void 0:m),E({phase:m})}),{capability:"write"}),v.add("GET","/v1/agents/:id/schedules",(i)=>P(e,i,async(l)=>{let o=i.url.searchParams.get("enabled"),u=await l.store.schedules.list(l.id,o===null?{}:{enabled:o==="true"});return E({schedules:u})}),{capability:"read"}),v.add("POST","/v1/agents/:id/schedules",(i)=>P(e,i,async(l)=>{let o=await F(i.request);if(o.kind==="error")return k(o.error,400);return be(e,l,o.value,void 0)}),{capability:"write"}),v.add("GET","/v1/agents/:id/schedules/:sid",(i)=>P(e,i,async(l)=>{let o=i.params.sid??"",u=await l.store.schedules.get(l.id,o);return u===void 0?D("schedule",o):E(u)}),{capability:"read"}),v.add("PATCH","/v1/agents/:id/schedules/:sid",(i)=>P(e,i,async(l)=>{let o=i.params.sid??"",u=await l.store.schedules.get(l.id,o);if(u===void 0)return D("schedule",o);let m=ve(u);if(m!==void 0)return m;let g=await F(i.request);if(g.kind==="error")return k(g.error,400);let b=g.value===null||typeof g.value!=="object"||Array.isArray(g.value)?{}:g.value,{id:N,...x}=b,I={kind:u.kind,expr:u.expr,task:u.task,deliver:u.deliverChannel===void 0||u.deliverTo===void 0?"none":{channel:u.deliverChannel,to:u.deliverTo},session:u.sessionMode,enabled:u.enabled,...u.timezone===void 0?{}:{timezone:u.timezone},...u.role===void 0?{}:{role:u.role},...x,id:u.id};return be(e,l,I,u)}),{capability:"write"}),v.add("DELETE","/v1/agents/:id/schedules/:sid",(i)=>P(e,i,async(l)=>{let o=i.params.sid??"",u=await l.store.schedules.get(l.id,o);if(u===void 0)return D("schedule",o);let m=ve(u);if(m!==void 0)return m;if(!await l.store.schedules.remove(l.id,o))return D("schedule",o);return e.scheduler.changed(),E({removed:o})}),{capability:"write"}),v.add("POST","/v1/agents/:id/schedules/:sid/run",(i)=>P(e,i,async(l)=>{let o=i.params.sid??"",u=await l.store.schedules.get(l.id,o);if(u===void 0)return D("schedule",o);let m=Zo(),g=oi(u.sessionMode,u.id,m),b=ht();return e.streams.open(b),l.send(u.task,{sessionKey:g,turnId:b,source:`schedule:${u.id}:manual`,...u.role===void 0?{}:{role:u.role}}).catch(()=>{}),E({scheduleId:u.id,turnId:b,sessionKey:g,outOfBand:!0},202)}),{capability:"write"}),v.add("GET","/v1/agents/:id/config",(i)=>P(e,i,async(l)=>{let o=e.sourceOf(l.id),u=typeof o==="string"?o:void 0,m=u===void 0?void 0:await Be(u,"utf8");return E({...u===void 0?{editable:!1}:{editable:!0,file:u},settings:ze.filter((g)=>mt.includes(g.path)).map((g)=>({path:g.path,means:g.means,...g.confirm===void 0?{}:{confirm:g.confirm},...m===void 0?{}:{value:ti(m,g.path.split("."))}}))})}),{capability:"admin"}),v.add("PATCH","/v1/agents/:id/config",(i)=>P(e,i,async(l)=>{let o=await F(i.request);if(o.kind==="error")return k(o.error,400);let u=q(Xe,o.value);if(!u.ok)return k(u.error,400);let m=e.sourceOf(l.id);if(typeof m!=="string")return k({code:"config_not_editable",message:`"${l.id}" was loaded from an object, not from a file, so it has no manifest to change.`,hint:"An embedder holding new settings passes the new object to dispose() and adopt(). This route edits a manifest on disk."},409);let g=ni(u.value.path);if(g===void 0||!mt.includes(g.path))return k({code:"config_path_unknown",message:g?.via===void 0?`"${u.value.path}" is not a field this surface sets.`:`"${u.value.path}" is set by \`${g.via}\`, not by a dotted path.`,hint:g?.via===void 0?`GET /v1/agents/:id/config lists every one. Nearest: ${wA(u.value.path,mt)??mt.join(", ")}.`:"It is a key inside a list entry, and the source editor matches a key at an indent — it cannot index a sequence. That action also validates the handle against the service that issues it.",field:"path"},400);if(g.confirm!==void 0&&u.value.confirm!==!0)return k({code:"config_confirm_required",message:g.confirm,hint:'Send { "confirm": true } beside the value to make this change anyway. Nothing has been written.',field:"confirm"},409);let b;try{b=await yt({file:m,path:g.path.split("."),value:wt(u.value.value)})}catch(x){if(ee(x))return k(x.toDetail(),400);throw x}let N;try{await e.replace(l.id)}catch(x){if(!ee(x))throw x;N=x.toDetail()}return E({path:g.path,before:b.before,after:b.after,reflowed:b.reflowed,...N===void 0?{applied:!0}:{applied:!1,pending:N}})}),{capability:"admin"}),v.add("PATCH","/v1/agents/:id/channels/:channelId",(i)=>P(e,i,async(l)=>{let o=t.channels;if(o===void 0)return k({code:"channels_not_supported",message:"This server cannot change a channel.",hint:"The host did not supply the channel actions — a library caller embedding this handler has to pass them. `dispach serve` does."},501);let u=e.sourceOf(l.id);if(typeof u!=="string")return k({code:"config_not_editable",message:`Agent "${l.id}" was loaded from an object, so it has no manifest to edit.`,hint:"Only an agent loaded from a file can be changed here."},409);let m=await F(i.request);if(m.kind==="error")return k(m.error,400);let g=q(Ze,m.value);if(!g.ok)return k(g.error,400);let{enabled:b,credential:N}=g.value;if(b===void 0&&N===void 0)return k({code:"channel_patch_empty",message:"Nothing to change.",hint:'Send { "enabled": true | false } to connect or disconnect it, { "credential": "…" } to set its token, or both.'},400);let x=i.params.channelId??"",I=[];try{if(N!==void 0)I.push(o.setCredential(u,x,N).note);if(b!==void 0)I.push((await o.setEnabled(u,x,b)).note)}catch(M){if(!ee(M))throw M;return k(M.toDetail(),400)}let H;try{await e.replace(l.id)}catch(M){if(!ee(M))throw M;H=M.toDetail()}return E({channelId:x,notes:I,...H===void 0?{applied:!0}:{applied:!1,pending:H}})}),{capability:"admin"}),v.add("POST","/v1/agents/:id/channels/:channelId/unpair",(i)=>P(e,i,async(l)=>{let o=i.params.channelId??"",u=await e.channels.reset(l.id,o);if(u==="reset")return E({channelId:o,note:"Pairing forgotten. The channel offers a new code to scan; the old device may still be listed on the phone, which is the only place it can be removed.",restarted:!1});let m=t.channels,g=e.sourceOf(l.id);if(m===void 0||typeof g!=="string")return k({code:u==="unsupported"?"channel_has_no_pairing":"channel_unknown",message:u==="unsupported"?`Channel "${o}" stores no pairing.`:`Agent "${l.id}" has no channel "${o}" registered.`,hint:"Only a channel linked by scanning a code has one to forget. A credential somebody typed is changed with PATCH on this channel, and a channel is switched off with { enabled: false }.",field:"channelId"},u==="unsupported"?409:404);try{return E({channelId:o,...m.unpair(g,o),restarted:!1})}catch(b){if(!ee(b))throw b;return k(b.toDetail(),b.code==="channel_unknown"?404:409)}}),{capability:"admin"}),v.add("GET","/v1/agents/:id/tools",(i)=>P(e,i,(l)=>{let o=l.manifest.phases,u=Wn(o);return E(l.tools.specs().map((m)=>({slug:m.slug,summary:m.summary,mutating:m.mutating,trust:m.trust,...m.trustReason===void 0?{}:{trustReason:m.trustReason},provider:m.provider??"local",tags:m.tags,...u?{phases:ei(o,m)}:{}})))}),{capability:"read"}),v.add("GET","/v1/agents/:id/skills",(i)=>P(e,i,(l)=>{let o=l.skills;if(o===void 0)return E({skills:[],configured:!1});return E({configured:!0,maxActive:o.maxActive,threshold:o.threshold,cached:o.cached,skills:o.skills.map((u)=>({name:u.name,description:u.frontmatter.description,tokens:u.tokens,...u.frontmatter.whenNotToUse===void 0?{}:{whenNotToUse:u.frontmatter.whenNotToUse},scripts:u.scripts.map((m)=>m.slug)}))})}),{capability:"read"}),v.add("GET","/v1/agents/:id/context",(i)=>P(e,i,async(l)=>{let o=i.url.searchParams.get("sessionKey"),u=i.url.searchParams.get("input");return E(await l.previewContext({...o===null?{}:{sessionKey:o},...u===null?{}:{input:u}}))}),{capability:"read"}),v.add("POST","/v1/channels/:channelId/webhook/:agentId",async(i)=>{let l=await F(i.request);if(l.kind==="error")return k(l.error,400);let o={};i.request.headers.forEach((m,g)=>{o[g.toLowerCase()]=m});let u=await e.channels.handleWebhook(i.params.agentId??"",i.params.channelId??"",{body:l.value,headers:o});return new Response(u.detail??"",{status:u.status,headers:{"content-type":"text/plain; charset=utf-8"}})},{capability:"open"}),v.add("GET","/v1/events",(i)=>{let l=i.url.searchParams.get("agentId");if(l!==null&&!V(i.principal,l))return D("agent",l);let o=i.url.searchParams.get("types")?.split(",").filter(Boolean),u=i.url.searchParams.get("chunks")==="true",m=o?.includes("model.chunk")===!0,g=u||m,b=o?.filter((N)=>!_e.includes(N));if(b!==void 0&&b.length>0){let N=wA(b[0]??"",_e);return k({code:"unknown_event_type",message:`No such event type: ${b.join(", ")}.`,hint:N===void 0?"The full catalogue is the event table in docs/04-SPEC-WIRE.md. Omit ?types= to receive every event.":`Did you mean "${N}"? The full catalogue is the event table in docs/04-SPEC-WIRE.md.`,field:"types"},400)}return ue({...i.request.signal===void 0?{}:{signal:i.request.signal},start:({send:N})=>(N({event:"stream.subscribed",data:{agentId:l??null,types:o??null,chunks:g,...g&&!u?{implied:"types names model.chunk"}:{}}}),e.bus.on("*",(x)=>{if(l!==null&&x.agentId!==l)return;if(x.agentId!==void 0&&!V(i.principal,x.agentId))return;if(x.sessionKey!==void 0&&!te(i.principal,x.sessionKey))return;if(o!==void 0&&o.length>0&&!o.includes(x.type))return;N({event:x.type,data:x})},{chunks:g}))})},{capability:"read",streaming:!0}),Object.assign(async(i)=>{let l;try{l=new URL(i.url)}catch{return k({code:"bad_request_url",message:"The request URL could not be parsed.",hint:"This usually means the server was handed a relative URL. A handler mounted inside another framework needs an absolute request.url."},400)}let o=i.method.toUpperCase();if(o==="OPTIONS"){let b=v.match("OPTIONS",l.pathname);if(b.kind==="method"){let x=v.match("HEAD",l.pathname).kind==="method"&&Et(v,l.pathname),I=[...b.allowed,...b.allowed.includes("GET")&&!x?["HEAD"]:[],"OPTIONS"];return S(i,new Response(null,{status:204,headers:{allow:I.join(", "),...t.origin===void 0?{}:ot(i,I)}}))}}if(o==="HEAD"){let b=v.match("GET",l.pathname);if(b.kind==="found"){if(b.streaming)return k({code:"method_not_allowed",message:`HEAD is not allowed on ${l.pathname}.`,hint:"This path answers with an open event stream. A HEAD would have to start one and then throw the body away, leaving a subscription nothing ever closes — so it is refused rather than leaked. Use GET, or GET /v1/health to check the server is up."},405,{allow:"GET, OPTIONS"});let N=A(i);if(N!==void 0)return N;let x=await z(i,l.pathname,b.capability);if(x instanceof Response)return x;let I=await we(b.handler,{request:i,url:l,params:b.params,principal:x});return S(i,new Response(null,{status:I.status,headers:I.headers}))}}let u=v.match(o,l.pathname);if(u.kind==="method")return k({code:"method_not_allowed",message:`${o} is not allowed on ${l.pathname}.`,hint:`This path accepts ${u.allowed.join(", ")}.`},405,{allow:u.allowed.join(", ")});if(u.kind==="none")return k({code:"not_found",message:`No route for ${i.method} ${l.pathname}.`,hint:"Every path is under /v1. See docs/04-SPEC-WIRE.md for the surface."},404);let m=A(i);if(m!==void 0)return m;let g=await z(i,l.pathname,u.capability);if(g instanceof Response)return g;return S(i,await we(u.handler,{request:i,url:l,params:u.params,principal:g}))},{authenticate:(i)=>z(i,"/v1/ws","read")})}function ve(t){if(t.origin!=="manifest")return;return k({code:"schedule_manifest_owned",message:`Schedule "${t.id}" is declared in this agent's manifest, so the manifest decides it.`,hint:"Writing it here would last until the next start — reconciliation restores every field from the file, enabled included. Change the `schedules:` entry instead, with PATCH /v1/agents/:id/config, or create a separate schedule through this route."},409)}async function be(t,e,r,h){if(r===null||typeof r!=="object"||Array.isArray(r))return k({code:"schedule_invalid",message:"A schedule must be a JSON object.",hint:"Send { id, kind, expr, task, deliver } — see docs/02-SPEC-MANIFEST.md."},400);try{let c=ii({agentId:e.id,body:r,channelIds:e.manifest.channels.map((w)=>w.id),roleNames:Object.keys(e.manifest.model),now:Date.now(),origin:"api",...h===void 0?{}:{existing:h}}),p=await e.store.schedules.upsert(c);return t.scheduler.changed(),E(p,h===void 0?201:200)}catch(c){let p=ee(c)?c.toDetail():{code:"schedule_invalid",message:c instanceof Error?c.message:String(c),hint:"See docs/02-SPEC-MANIFEST.md for the schedule fields."};return k(p,400)}}function le(t,e){let r=vt(t,e.request);if(r===void 0)throw new j({code:"web_asset_missing",message:`No web asset for ${t}.`,hint:"The routes in handler.ts and the table in web.ts have diverged, which spec.test.ts asserts cannot happen — so this build is inconsistent. Rebuild with `bun run build`."});return r}function E(t,e=200){return new Response(JSON.stringify(t),{status:e,headers:{"content-type":"application/json; charset=utf-8"}})}function xt(t){return t==="/v1/health"||t==="/v1/ready"||t.startsWith("/v1/channels/")||gt.includes(t)||t==="/docs"||t==="/v1/openapi.json"}function Et(t,e){let r=t.match("GET",e);return r.kind==="found"&&r.streaming}async function we(t,e){try{return await t(e)}catch(r){if(ee(r))return k(r.toDetail(),400);return k({code:"internal_error",message:r instanceof Error?r.message:String(r),hint:"An unexpected failure in the server. The runtime's event stream carries what happened around it."},500)}}function D(t,e,r){return k({code:`${t}_not_found`,message:`No ${t} "${e}".`,hint:r??"Check the id — it is case-sensitive, and a session key includes its channel segment."},404)}function Tt(t){let e=t.headers.get("authorization")??"";if(!e.startsWith("Bearer "))return;let r=e.slice(7);return r===""?void 0:r}function P(t,e,r){let h=e.params.id??"",c=t.list().find((p)=>p.id===h);if(c===void 0)return D("agent",h);if(!V(e.principal,h))return D("agent",h);return r(c)}function Ct(t,e){if(!Oe(t))return e;return e.filter((r)=>V(t,r.id))}function Nt(t,e){if(!Oe(t))return e;return e.filter((r)=>te(t,r.sessionKey))}function W(t,e){return te(t.principal,e)?void 0:D("session",e)}function ke(t,e){let r=e.manifest.phases,h=Wn(r);return{id:e.id,name:e.manifest.name??e.id,status:"loaded",model:e.manifest.model.main.id,channels:e.manifest.channels.map((c)=>{let p=t.channels.statusOf(e.id).find((C)=>C.id===c.id),w=typeof c.tokenEnv==="string"?c.tokenEnv:void 0;return{...p??{},id:c.id,type:c.type,enabled:c.enabled,...w===void 0?{}:{credentialEnv:w,credentialSet:e.hasEnv(w)}}}),entryPhase:h?$o(r)??null:null,...h?{phases:Object.keys(r)}:{}}}function oe(t){return{...t.disabledAt===void 0?{}:{disabledAt:t.disabledAt},...t.reason===void 0?{}:{reason:t.reason}}}async function F(t){let e=Number.parseInt(t.headers.get("content-length")??"0",10);if(Number.isFinite(e)&&e>J)return{kind:"error",error:{code:"body_too_large",message:`The request body declares ${e} bytes; the limit is ${J}.`,hint:"This cap is enforced before a channel plugin sees anything, so a plugin never has to defend against a large POST."}};let r=await t.text();if(r.length>J)return{kind:"error",error:{code:"body_too_large",message:`The request body is ${r.length} bytes; the limit is ${J}.`,hint:"Send less. A message longer than this is not a message."}};if(r==="")return{kind:"ok",value:{}};try{return{kind:"ok",value:JSON.parse(r)}}catch(h){return{kind:"error",error:{code:"body_not_json",message:`The request body is not valid JSON: ${h instanceof Error?h.message:String(h)}`,hint:"Send application/json. A shell quoting mistake is the usual cause — check for unescaped quotes inside the payload."}}}}function _t(t){if(t===void 0||t===null)return{kind:"ok",from:void 0};let e=(h,c,p="from")=>({kind:"error",error:{code:"sender_invalid",message:h,hint:c,field:p}});if(typeof t!=="object")return e("from must be an object.",'Send { "from": { "id": "agent:ops-bot", "kind": "agent" } }, or omit it entirely for a turn the token-holder is sending itself.');let r=t;if(typeof r.id!=="string"||r.id.trim()==="")return e("from.id is required and must be a non-empty string.","Use a stable identity in your own namespace — `agent:ops-bot`, `user:018f…`, an email address. It is opaque to this runtime and is recorded on the turn so an audit can answer who asked.","from.id");if(r.id.length>ye)return e(`from.id is ${r.id.length} characters, over the ${ye} limit.`,"A sender id is an identifier, not a payload. It is rendered into the prompt's fence label, so an unbounded one spends the context window the message needs.","from.id");if(typeof r.kind!=="string"||!qe.includes(r.kind)){let h=typeof r.kind==="string"?wA(r.kind,qe):void 0;return e(`from.kind must be one of: ${qe.join(", ")}.`,`${h===void 0?"":`Did you mean "${h}"? `}This field decides the trust boundary — "agent" fences the message and blocks mutating tools for the turn, "user" does not — so there is no default and an unknown value is refused rather than guessed at. A turn the token-holder is sending itself omits "from".`,"from.kind")}if(r.name!==void 0&&typeof r.name!=="string")return e("from.name must be a string when present.","It is a display name only and is rendered inside the fence, never above it. Omit it if you have none.","from.name");return{kind:"ok",from:{id:r.id,kind:r.kind,...r.name===void 0?{}:{name:r.name.slice(0,bt)}}}}function jt(t){let e=t.headers.get("idempotency-key");if(e===null)return{kind:"ok",key:void 0};let r=e.trim(),h=(c)=>({kind:"error",error:{code:"idempotency_key_invalid",message:c,hint:`Send 1-${ie} printable ASCII characters that are unique per logical request — a UUID is the usual choice. Omit the header entirely to accept that a retry runs the turn again. Printable ASCII because the key is a database key, and node:sqlite truncates a bound string at a NUL byte where bun:sqlite stores it whole.`,field:"Idempotency-Key"}});if(r==="")return h("Idempotency-Key is present but empty.");if(r.length>ie)return h(`Idempotency-Key is ${r.length} characters, over the ${ie} limit.`);if(!/^[\x20-\x7e]+$/.test(r))return h("Idempotency-Key contains characters that are not printable ASCII.");return{kind:"ok",key:r}}async function At(t,e){let r=new TextEncoder().encode(`${t}\x00${e}`),h=await crypto.subtle.digest("SHA-256",r);return Array.from(new Uint8Array(h)).map((c)=>c.toString(16).padStart(2,"0")).join("")}function zt(t){if(t===void 0||t===null||t==="none")return{kind:"ok",target:void 0};if(typeof t==="object"){let e=t;if(typeof e.channel==="string"&&typeof e.to==="string")return{kind:"ok",target:{channel:e.channel,to:e.to}}}return{kind:"error",error:{code:"deliver_invalid",message:'deliver must be "none" or { channel, to }.',hint:'A bare channel id is not enough on an API turn: the request has no originating conversation, so there is no recipient to infer. Send { "channel": "tg", "to": "12345" }, or "none" to read the reply from the event stream.',field:"deliver"}}}function Pt(t){let e=t.status==="running";return ue({start:({send:r,close:h})=>{r({event:e?"stream.unavailable":"stream.ended",data:{turnId:t.turnId,status:t.status,sessionKey:t.sessionKey,...e?{reason:"no buffer for this turn in this process",hint:"The turn is recorded as running but is not observable here — its events are buffered in whichever process is executing it, and buffers are in-memory and per-process. Poll GET /v1/agents/:id/turns/:turnId for the outcome."}:{steps:t.steps,...t.errorCode===void 0?{}:{errorCode:t.errorCode},hint:"This turn finished before you attached and its buffer has been evicted. Its full text is in GET /v1/agents/:id/turns/:turnId."}}}),h();return}})}function Se(t,e,r){return ue({...r?.status===void 0?{}:{status:r.status},start:({send:h,close:c})=>{if(r?.accepted!==void 0)h({event:"turn.accepted",data:r.accepted});let p=t.streams.attach(e,(w)=>{if(h({event:w.type,data:w}),w.type==="turn.end")c()},{chunks:r?.chunks===!0});if(p===void 0){h({event:"stream.unavailable",data:{turnId:e,reason:"no buffer for this turn in this process",hint:"Read the final state from GET /v1/agents/:id/turns/:turnId. Buffers are in-memory and are evicted after a turn ends."}}),c();return}h({event:"stream.replay",data:{turnId:e,state:p.state,events:p.replay.length,truncated:p.truncated,dropped:p.dropped,chunks:p.chunks,...p.truncated?{hint:`The oldest ${p.dropped} event(s) of this turn were discarded to stay under the buffer cap, so this replay starts mid-turn. The turn's final text is complete in GET /v1/agents/:id/turns/:turnId.`}:{}}});for(let w of p.replay)h({event:w.type,data:w});if(p.state==="ended")c();return()=>p.unsubscribe()}})}function Go(){let t=kn(),e=!1;return{token:t,live:()=>!e,spend:()=>{if(e)return!1;return e=!0,!0}}}function KA(t){let e=t.startsWith("[")&&t.endsWith("]")?t.slice(1,-1):t,r=e==="0.0.0.0"||e==="::"||e===""?"127.0.0.1":e;return r.includes(":")?`[${r}]`:r}function Fo(t,e,r){return`http://${KA(t)}:${e}/?claim=${r}`}function To(t,e,r){return`curl -sX POST http://${KA(t)}:${e}/v1/keys -H 'Authorization: Bearer ${r}' -H 'content-type: application/json' -d '{"label":"my browser"}'`}function $e(t,e,r=new Map){let h=new Set,c,p=0,w,C=(S)=>{let O=S.type==="model.chunk";for(let _ of h){if(_.data.agentId!==void 0&&S.agentId!==_.data.agentId)continue;if(S.agentId!==void 0&&!V(_.data.principal,S.agentId))continue;if(S.sessionKey!==void 0&&!te(_.data.principal,S.sessionKey))continue;if(O&&!_.data.chunks)continue;try{_.send(JSON.stringify(S))}catch{}}},L=()=>{if(p+=1,w===void 0)w=t.bus.on("model.chunk",C)},A=()=>{if(p===0)return;if(p-=1,p===0)w?.(),w=void 0};return{async accept(S){let O=new URL(S.url),_=Ge(S),z=O.searchParams.get("token"),R=await e(Ve(S,_??z??""));if(R instanceof Response)return{kind:"reject",response:R};let i=O.searchParams.get("agentId");if(i!==null&&!V(R,i))return{kind:"reject",response:new Response(JSON.stringify({error:{code:"agent_not_found",message:`No agent "${i}".`,hint:"Check the id — it is case-sensitive. A key scoped away from an agent sees exactly what a caller asking for one that does not exist sees."}}),{status:404,headers:{"content-type":"application/json"}})};return{kind:"accept",session:{agentId:i??void 0,chunks:O.searchParams.get("chunks")==="true",principal:R},..._===void 0?{}:{protocol:Ee}}},handlers:{open(S){if(h.add(S),c===void 0)c=t.bus.on("*",C);if(S.data.chunks)L();S.send(JSON.stringify({type:"ws.open",agentId:S.data.agentId??null,chunks:S.data.chunks}))},message(S,O){let _;try{_=JSON.parse(typeof O==="string"?O:new TextDecoder().decode(O))}catch{S.send(JSON.stringify({type:"ws.error",code:"frame_not_json"}));return}if(_.type==="ping"){S.send(JSON.stringify({type:"pong"}));return}if(_.type==="subscribe"){if(_.agentId===void 0&&_.sessionKey!==void 0){S.send(JSON.stringify({type:"ws.error",code:"subscribe_needs_agent_id",hint:"Send { type: 'subscribe', agentId: '<agent>' }. A socket filters on the agent an event carries; sessionKey names a conversation and can never match one, so a socket pointed with it receives nothing."}));return}let o=typeof _.chunks==="boolean"?_.chunks:S.data.chunks;if(o&&!S.data.chunks)L();else if(!o&&S.data.chunks)A();let u=_.agentId??S.data.agentId;if(u!==void 0&&!V(S.data.principal,u)){S.send(JSON.stringify({type:"ws.error",error:{code:"agent_not_found",message:`No agent "${u}".`,hint:"Check the id — it is case-sensitive. A key scoped away from an agent sees exactly what a caller asking for one that does not exist sees."}}));return}S.data={agentId:u,chunks:o,principal:S.data.principal},S.send(JSON.stringify({type:"ws.subscribed",agentId:S.data.agentId??null,chunks:S.data.chunks}));return}if(_.type==="stop"){let o=_.turnId===void 0?void 0:r.get(_.turnId);o?.abort(),S.send(JSON.stringify({type:"ws.stopping",turnId:_.turnId??null,found:o!==void 0}));return}if(_.type!=="message"){S.send(JSON.stringify({type:"ws.error",code:"unknown_frame_type"}));return}let z=S.data.agentId,v=t.list().find((o)=>o.id===z);if(v===void 0){S.send(JSON.stringify({type:"ws.error",code:"agent_not_found"}));return}let R=_.text??"";if(R.trim()===""){S.send(JSON.stringify({type:"ws.error",code:"message_text_required"}));return}let i=ht(),l=new AbortController;r.set(i,l),S.send(JSON.stringify({type:"ws.accepted",turnId:i})),v.send(R,{sessionKey:_.sessionKey??"api:default",turnId:i,source:"ws",signal:l.signal}).catch(()=>{}).finally(()=>r.delete(i))},close(S){if(h.delete(S)&&S.data.chunks)A();if(h.size===0)c?.(),c=void 0}},closeAll(){for(let S of h)try{S.close(1001,"server stopping")}catch{}h.clear(),c?.(),c=void 0,w?.(),w=void 0,p=0}}}async function Lo(t){let{host:e,port:r,runtime:h}=t;if(!X(e)&&t.token===void 0)throw new j({code:"server_public_without_token",message:`Refusing to bind ${e}:${r} with no API token.`,hint:"Set the variable named by server.tokenEnv, or bind 127.0.0.1. A public bind with no token exposes every endpoint — including the ones that start a turn — to anyone who can reach the port, and behaves identically to a safe one until someone finds it.",field:"server.host"});let c=new Map,p=St({runtime:h,...t.token===void 0?{}:{token:t.token},...t.token===void 0?{allowUnauthenticated:!0}:{},...t.now===void 0?{}:{now:t.now},running:c,...t.approvals===void 0?{}:{approvals:t.approvals},...t.claim===void 0?{}:{claim:t.claim},...t.resolveAgent===void 0?{}:{resolveAgent:t.resolveAgent},...t.provision===void 0?{}:{provision:t.provision},...t.channels===void 0?{}:{channels:t.channels},origin:{host:t.host,...t.allowedOrigins===void 0?{}:{allowedOrigins:t.allowedOrigins},...t.allowedHosts===void 0?{}:{allowedHosts:t.allowedHosts}}});if(t.engine==="bun"||t.engine===void 0&&typeof Bun<"u"&&typeof Bun.serve==="function")return It(p,t,c);return Ot(p,t,c)}function It(t,e,r){let h=$e(e.runtime,t.authenticate,r),c=Bun.serve({port:e.port,hostname:e.host,idleTimeout:Math.min(255,Math.ceil(Me/1000*3)),fetch:async(p,w)=>{if(new URL(p.url).pathname!=="/v1/ws")return t(p);let L=Z(p,{host:e.host,...e.allowedOrigins===void 0?{}:{allowedOrigins:e.allowedOrigins},...e.allowedHosts===void 0?{}:{allowedHosts:e.allowedHosts}});if(L!==void 0)return new Response(JSON.stringify({error:L}),{status:403,headers:{"content-type":"application/json; charset=utf-8"}});let A=await h.accept(p);if(A.kind==="reject")return A.response;if(w.upgrade(p,{data:A.session,...A.protocol===void 0?{}:{headers:{"sec-websocket-protocol":A.protocol}}}))return;return new Response("upgrade failed",{status:400})},websocket:{open:(p)=>h.handlers.open(p),message:(p,w)=>h.handlers.message(p,w),close:(p)=>h.handlers.close(p)}});return{url:`http://${e.host}:${c.port}`,port:c.port??e.port,host:e.host,websocket:!0,stop:async()=>{h.closeAll(),await c.stop(!0)}}}async function Ot(t,e,r){let{createServer:h}=await import("node:http"),{WebSocketServer:c}=await import("./wrapper-0w9b3my0.js"),p=$e(e.runtime,t.authenticate,r),w=(z,v)=>{let R=`http://${z.headers.host??`${e.host}:${e.port}`}${z.url??"/"}`,i=new Headers;for(let[o,u]of Object.entries(z.headers))if(typeof u==="string")i.set(o,u);else if(Array.isArray(u))i.set(o,u.join(", "));let l=z.method??"GET";return new Request(R,{method:l,headers:i,...l==="GET"||l==="HEAD"||v===void 0?{}:{body:v}})},C=h((z,v)=>{(async()=>{let R=[];for await(let u of z)R.push(u);let i=await t(w(z,Buffer.concat(R))),l={};if(i.headers.forEach((u,m)=>{l[m]=u}),v.writeHead(i.status,l),i.body===null){v.end();return}let o=i.body.getReader();v.on("close",()=>void o.cancel().catch(()=>{}));for(;;){let{done:u,value:m}=await o.read();if(u)break;v.write(Buffer.from(m))}v.end()})().catch(()=>{if(!v.headersSent)v.writeHead(500);v.end()})}),L=new WeakMap,A=new c({noServer:!0,handleProtocols:(z,v)=>L.get(v)??!1}),S=(z,v,R)=>{z.end(`HTTP/1.1 ${v} Refused\r
82
+ content-type: application/json; charset=utf-8\r
83
+ content-length: ${Buffer.byteLength(R)}\r
84
+ connection: close\r
85
+ \r
86
+ ${R}`)};C.on("upgrade",(z,v,R)=>{(async()=>{let i=w(z);if(new URL(i.url).pathname!=="/v1/ws"){v.destroy();return}let l=Z(i,{host:e.host,...e.allowedOrigins===void 0?{}:{allowedOrigins:e.allowedOrigins},...e.allowedHosts===void 0?{}:{allowedHosts:e.allowedHosts}});if(l!==void 0){S(v,403,JSON.stringify({error:l}));return}let o=await p.accept(i);if(o.kind==="reject"){S(v,o.response.status,await o.response.text());return}if(o.protocol!==void 0)L.set(z,o.protocol);A.handleUpgrade(z,v,R,(u)=>{let m={data:o.session,send:(g)=>u.send(g),close:(g,b)=>u.close(g,b)};u.on("message",(g,b)=>{let N=Array.isArray(g)?Buffer.concat(g):g instanceof ArrayBuffer?Buffer.from(g):g;p.handlers.message(m,b?new Uint8Array(N):N.toString("utf8"))}),u.on("close",()=>p.handlers.close(m)),p.handlers.open(m)})})().catch(()=>v.destroy())}),await new Promise((z,v)=>{C.once("error",v),C.listen(e.port,e.host,()=>{C.removeListener("error",v),z()})});let O=C.address(),_=typeof O==="object"&&O!==null?O.port:e.port;return{url:`http://${e.host}:${_}`,port:_,host:e.host,websocket:!0,stop:()=>new Promise((z)=>{p.closeAll(),A.close(),C.closeAllConnections?.(),C.close(()=>z())})}}function Je(t,e){let r=new URL(t);if(r.pathname="/",r.hostname=KA(r.hostname),e!==void 0&&e!=="")r.searchParams.set("agent",e);return r.toString()}
87
+ export{qn,Go,KA,Fo,To,Lo,Je};
88
+
89
+ //# debugId=F1DA656328E3F11F64756E2164756E21
90
+ //# sourceMappingURL=index-4knb5vjm.js.map