dispach 0.1.0 → 0.1.2
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.
- package/README.md +131 -31
- package/dist/App-b1yrwrcq.js +11 -0
- package/dist/{App-dxqm39zx.js.map → App-b1yrwrcq.js.map} +1 -1
- package/dist/{ConfigEditor-7v5nebvy.js → ConfigEditor-n8hdw6r7.js} +4 -4
- package/dist/{ConfigEditor-7v5nebvy.js.map → ConfigEditor-n8hdw6r7.js.map} +1 -1
- package/dist/{KeyProbe-vjhmdpx6.js → KeyProbe-9jjeze5r.js} +3 -3
- package/dist/{KeyProbe-vjhmdpx6.js.map → KeyProbe-9jjeze5r.js.map} +1 -1
- package/dist/{Picker-jxaesaxy.js → Picker-hfeh1g6m.js} +3 -3
- package/dist/{Picker-jxaesaxy.js.map → Picker-hfeh1g6m.js.map} +1 -1
- package/dist/{SessionPicker-z2t0p4b5.js → SessionPicker-zyqkg4dn.js} +3 -3
- package/dist/{SessionPicker-z2t0p4b5.js.map → SessionPicker-zyqkg4dn.js.map} +1 -1
- package/dist/{SkillBrowser-yyf2gy0q.js → SkillBrowser-3qdp8080.js} +3 -3
- package/dist/{SkillBrowser-yyf2gy0q.js.map → SkillBrowser-3qdp8080.js.map} +1 -1
- package/dist/WizardApp-vzpbydy3.js +5 -0
- package/dist/{WizardApp-12ndxgqv.js.map → WizardApp-vzpbydy3.js.map} +1 -1
- package/dist/client.js +10 -10
- package/dist/client.js.map +5 -5
- package/dist/{config-yz0nz51b.js → config-g7za9x13.js} +13 -13
- package/dist/{config-yz0nz51b.js.map → config-g7za9x13.js.map} +1 -1
- package/dist/credential-npr6z8c8.js +19 -0
- package/dist/{credential-wgt4gvcz.js.map → credential-npr6z8c8.js.map} +2 -2
- package/dist/index-02dn6m2j.js +7 -0
- package/dist/{index-h2yds678.js.map → index-02dn6m2j.js.map} +1 -1
- package/dist/index-0d93hyfc.js +6 -0
- package/dist/{index-rqbtm761.js.map → index-0d93hyfc.js.map} +1 -1
- package/dist/index-1c5113t4.js +66 -0
- package/dist/index-1c5113t4.js.map +12 -0
- package/dist/{index-3nwfz9jq.js → index-258d8bzg.js} +10 -10
- package/dist/{index-3nwfz9jq.js.map → index-258d8bzg.js.map} +1 -1
- package/dist/{index-9d011p3q.js → index-3g3ny01d.js} +4 -4
- package/dist/{index-9d011p3q.js.map → index-3g3ny01d.js.map} +1 -1
- package/dist/{index-8bmhd2hj.js → index-4cf6v9nb.js} +4 -4
- package/dist/{index-8bmhd2hj.js.map → index-4cf6v9nb.js.map} +1 -1
- package/dist/{index-bwckzbf8.js → index-4z7axw4r.js} +4 -4
- package/dist/{index-bwckzbf8.js.map → index-4z7axw4r.js.map} +1 -1
- package/dist/{index-xgqzk5cq.js → index-6p999cx4.js} +6 -6
- package/dist/{index-xgqzk5cq.js.map → index-6p999cx4.js.map} +1 -1
- package/dist/index-6q4wf8e3.js +6 -0
- package/dist/{index-jym27m75.js.map → index-6q4wf8e3.js.map} +1 -1
- package/dist/{index-cx3vz7sf.js → index-9r0wyj6w.js} +4 -4
- package/dist/{index-cx3vz7sf.js.map → index-9r0wyj6w.js.map} +1 -1
- package/dist/{index-j97vttdt.js → index-ammv5st7.js} +6 -6
- package/dist/{index-j97vttdt.js.map → index-ammv5st7.js.map} +1 -1
- package/dist/{index-qc2vrq9z.js → index-cqqb6gaq.js} +5 -5
- package/dist/{index-qc2vrq9z.js.map → index-cqqb6gaq.js.map} +1 -1
- package/dist/{index-jk0def33.js → index-d4x6yvqh.js} +4 -4
- package/dist/{index-jk0def33.js.map → index-d4x6yvqh.js.map} +1 -1
- package/dist/index-fecm8xe7.js +77 -0
- package/dist/index-fecm8xe7.js.map +12 -0
- package/dist/{index-e8n70sgj.js → index-fex44816.js} +4 -4
- package/dist/{index-e8n70sgj.js.map → index-fex44816.js.map} +1 -1
- package/dist/{index-gbnc99j8.js → index-ff514z3y.js} +9 -9
- package/dist/{index-gbnc99j8.js.map → index-ff514z3y.js.map} +1 -1
- package/dist/{index-t1xvacym.js → index-gme2egyq.js} +4 -4
- package/dist/{index-t1xvacym.js.map → index-gme2egyq.js.map} +1 -1
- package/dist/{index-mrtb5y08.js → index-gz9x25tz.js} +4 -4
- package/dist/{index-mrtb5y08.js.map → index-gz9x25tz.js.map} +1 -1
- package/dist/{index-9nsfs0vy.js → index-h9mw7b9d.js} +4 -4
- package/dist/{index-9nsfs0vy.js.map → index-h9mw7b9d.js.map} +1 -1
- package/dist/{index-6b7qvh1x.js → index-hwpvhaza.js} +4 -4
- package/dist/{index-6b7qvh1x.js.map → index-hwpvhaza.js.map} +1 -1
- package/dist/{index-6z0yr17z.js → index-j55s3ehk.js} +7 -7
- package/dist/{index-6z0yr17z.js.map → index-j55s3ehk.js.map} +1 -1
- package/dist/{index-mgdgx22q.js → index-j7gyr5nx.js} +6 -6
- package/dist/{index-mgdgx22q.js.map → index-j7gyr5nx.js.map} +1 -1
- package/dist/{index-7da4fqcr.js → index-mtn0g9vc.js} +5 -5
- package/dist/{index-7da4fqcr.js.map → index-mtn0g9vc.js.map} +1 -1
- package/dist/{index-rqzg861g.js → index-qdbq8crg.js} +4 -4
- package/dist/{index-rqzg861g.js.map → index-qdbq8crg.js.map} +1 -1
- package/dist/{index-xqyms08r.js → index-s9mbq7h6.js} +4 -4
- package/dist/{index-xqyms08r.js.map → index-s9mbq7h6.js.map} +1 -1
- package/dist/{index-9f9pp2ef.js → index-tf71ap9v.js} +4 -4
- package/dist/{index-9f9pp2ef.js.map → index-tf71ap9v.js.map} +1 -1
- package/dist/index-ttwyrdjs.js +427 -0
- package/dist/index-ttwyrdjs.js.map +11 -0
- package/dist/{index-2cvtz0fy.js → index-tv4yv7d2.js} +228 -228
- package/dist/{index-2cvtz0fy.js.map → index-tv4yv7d2.js.map} +9 -9
- package/dist/{index-fvhg0xyd.js → index-ty24n0jh.js} +79 -79
- package/dist/{index-fvhg0xyd.js.map → index-ty24n0jh.js.map} +1 -1
- package/dist/index-v8e92nfw.js +6 -0
- package/dist/{index-b8zwg8a3.js.map → index-v8e92nfw.js.map} +1 -1
- package/dist/index-vgc3y3rm.js +6 -0
- package/dist/{index-my5cjx00.js.map → index-vgc3y3rm.js.map} +1 -1
- package/dist/index-whaw4b18.js +6 -0
- package/dist/index-whaw4b18.js.map +10 -0
- package/dist/index.js +202 -198
- package/dist/index.js.map +6 -6
- package/dist/lib/bootstrap.d.ts +13 -0
- package/dist/lib/bootstrap.d.ts.map +1 -1
- package/dist/lib/commands.d.ts.map +1 -1
- package/dist/lib/init-flow.d.ts +17 -4
- package/dist/lib/init-flow.d.ts.map +1 -1
- package/dist/lib/provision.d.ts.map +1 -1
- package/dist/serve.d.ts.map +1 -1
- package/dist/{web-w7r68df1.js → web-vkb16r62.js} +5 -5
- package/dist/{web-w7r68df1.js.map → web-vkb16r62.js.map} +1 -1
- package/dist/wire.js +10 -10
- package/dist/wire.js.map +4 -4
- package/package.json +2 -2
- package/dist/App-dxqm39zx.js +0 -11
- package/dist/WizardApp-12ndxgqv.js +0 -5
- package/dist/credential-wgt4gvcz.js +0 -19
- package/dist/index-9pj1ws0p.js +0 -77
- package/dist/index-9pj1ws0p.js.map +0 -12
- package/dist/index-b5wwtxzk.js +0 -66
- package/dist/index-b5wwtxzk.js.map +0 -12
- package/dist/index-b8zwg8a3.js +0 -6
- package/dist/index-bry9bzt3.js +0 -427
- package/dist/index-bry9bzt3.js.map +0 -11
- package/dist/index-h2yds678.js +0 -7
- package/dist/index-jym27m75.js +0 -6
- package/dist/index-my5cjx00.js +0 -6
- package/dist/index-rqbtm761.js +0 -6
- package/dist/index-yr25dnf5.js +0 -6
- package/dist/index-yr25dnf5.js.map +0 -10
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{rt,fe,z,qt,Me,zn,Bn,Kn,Xr,Gt,Jr,Qr,eo,mr,to,Le,Zt,Vt,ro,De,oo,Yt,so,io}from"./index-1c5113t4.js";import{ne,br,vr,Io,Oo,r,a,v,h,i,$e,P,g,Lt}from"./index-tv4yv7d2.js";import{readFile as Ue}from"node:fs/promises";var Re=()=>{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(u){return t[u]??null}let n={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"},d={nan:"NaN"};return(u)=>{switch(u.code){case"invalid_type":{let f=d[u.expected]??u.expected,y=Io(u.input),x=d[y]??y;return`Invalid input: expected ${f}, received ${x}`}case"invalid_value":if(u.values.length===1)return`Invalid input: expected ${vr(u.values[0])}`;return`Invalid option: expected one of ${br(u.values,"|")}`;case"too_big":{let f=u.inclusive?"<=":"<",y=e(u.origin);if(y)return`Too big: expected ${u.origin??"value"} to have ${f}${u.maximum.toString()} ${y.unit??"elements"}`;return`Too big: expected ${u.origin??"value"} to be ${f}${u.maximum.toString()}`}case"too_small":{let f=u.inclusive?">=":">",y=e(u.origin);if(y)return`Too small: expected ${u.origin} to have ${f}${u.minimum.toString()} ${y.unit}`;return`Too small: expected ${u.origin} to be ${f}${u.minimum.toString()}`}case"invalid_format":{let f=u;if(f.format==="starts_with")return`Invalid string: must start with "${f.prefix}"`;if(f.format==="ends_with")return`Invalid string: must end with "${f.suffix}"`;if(f.format==="includes")return`Invalid string: must include "${f.includes}"`;if(f.format==="regex")return`Invalid string: must match pattern ${f.pattern}`;return`Invalid ${n[f.format]??u.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${u.divisor}`;case"unrecognized_keys":return`Unrecognized key${u.keys.length>1?"s":""}: ${br(u.keys,", ")}`;case"invalid_key":return`Invalid key in ${u.origin}`;case"invalid_union":if(u.options&&Array.isArray(u.options)&&u.options.length>0)return`Invalid discriminator value. Expected ${u.options.map((y)=>`'${y}'`).join(" | ")}`;return"Invalid input";case"invalid_element":return`Invalid value in ${u.origin}`;default:return"Invalid input"}}};function ee(){return{localeError:Re()}}ne(ee());function cr(t={}){let e=t.now??(()=>new Date),n=new Map;return{approver:(u)=>new Promise((f)=>{let y={pending:{approvalId:u.approvalId,agentId:u.agentId,slug:u.slug,callId:u.callId,match:u.match,mutating:u.mutating,reason:u.reason,requestedAt:e().toISOString()},settle:(x)=>{n.delete(u.approvalId),f(x)}};n.set(u.approvalId,y),u.signal.addEventListener("abort",()=>y.settle(!1),{once:!0})}),pending:(u)=>[...n.values()].map((f)=>f.pending).filter((f)=>f.agentId===u).sort((f,y)=>f.requestedAt.localeCompare(y.requestedAt)),resolve:(u,f)=>{let y=n.get(u);if(y===void 0)return!1;return y.settle(f),!0},get size(){return n.size}}}function S(t,e,n={}){return new Response(JSON.stringify({error:t}),{status:e,headers:{"content-type":"application/json; charset=utf-8",...n}})}function ce(){return S({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 S({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 S({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 de(t,e){if(t.length!==e.length)return!1;let n=0;for(let d=0;d<t.length;d+=1)n|=t.charCodeAt(d)^e.charCodeAt(d);return n===0}function He(t){let e=t.headers.get("authorization")??"";return e.startsWith("Bearer ")?e.slice(7):""}async function Be(t){let e=He(t.request);if(t.expected!==void 0&&de(e,t.expected))return{kind:"token"};if(e!==""){let n=await t.keys.findLive(await Bn(e),new Date(t.at).toISOString());if(n!==void 0)return await t.keys.touch(n.keyId,new Date(t.at).toISOString()),{kind:"key",keyId:n.keyId,...n.scope===void 0?{}:{scope:n.scope}};if(t.claim!==void 0&&de(e,t.claim.token)){if(t.request.method!=="POST"||t.pathname!=="/v1/keys")return ce();if(!t.claim.live())return xe();return{kind:"claim"}}}return ce()}var Ee="dispach.bearer";function qe(t){let e=t.headers.get("sec-websocket-protocol");if(e===null)return;let n=e.split(",").map((u)=>u.trim()),d=n.indexOf(Ee);return d===-1?void 0:n[d+1]??""}function Ge(t,e){let n=new Headers(t.headers);return n.set("authorization",`Bearer ${e}`),new Request(t.url,{method:t.method,headers:n})}function L(t,e){return t.meta({...e})}function X(t,e){return t.meta({description:e})}var Ke=i({id:L(r().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:L(g(Le,{error:(t)=>{let e=typeof t.input==="string"?t.input:void 0,n=e===void 0?void 0:rt(e,Le);return`from.kind must be one of: ${Le.join(", ")}.${n===void 0?"":` Did you mean "${n}"?`}`}}),{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:L(r().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."}),Ve=L($e([Lt("none"),i({channel:r().min(1),to:r().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=i({text:L(r().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:X(r().min(1).optional(),"Which conversation this belongs to. Defaults to `api:default`."),deliver:Ve.optional(),from:Ke.optional(),stream:X(v().optional(),"Stream the turn's events inline as SSE rather than returning a handle."),chunks:X(v().optional(),"Include per-token `model.chunk` frames. Off by default — the reader decides.")}),Ne=i({granted:L(v(),{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."})}),We=i({agents:h(r().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:r().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:h(g(["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."})}),Ce=i({label:L(r(),{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:We.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."})}),_e=i({phase:L(r().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."})}),je=i({reason:L(r().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."})}),Qe=i({path:L(r().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:L(r(),{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:X(v().optional(),"Required only for a field whose own row carries a `confirm` sentence. Absent is not consent.")}),ze=i({answers:L(P(r(),L(r(),{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 G(t,e){let n=t.safeParse(e??{});if(n.success)return{ok:!0,value:n.data};let d=n.error.issues[0],u=(d?.path??[]).filter((x)=>typeof x==="string"),f=Ye(t,u);return{ok:!1,error:{...{code:"request_body_invalid",message:u.length===0?d?.message??"The request body is invalid.":`${u.join(".")}: ${d?.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."},...f?.code===void 0?{}:{code:f.code},...f?.hint===void 0?{}:{hint:f.hint},...u.length===0?{}:{field:u.join(".")}}}}function Ye(t,e){let n=t,d=he(t);for(let u of e){if(n=Je(n,u),n===void 0)break;d=he(n)??d}return d}function he(t){let e=t?.meta();if(e?.code===void 0&&e?.hint===void 0)return;return e}function Je(t,e){let n=te(t),d=n?.shape;if(d?.[e]!==void 0)return te(d[e]);let u=n?.def?.valueType;return u===void 0?void 0:te(u)}function te(t){let e=t;for(let n=0;n<8&&e!==void 0;n+=1){let d=e.def?.innerType;if(d===void 0)return e;e=d}return e}var Ze={"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:ze,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:je,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:Ne},"POST /v1/keys":{summary:"Mint an operator key. The secret is returned once and never again.",body:Ce,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:_e},"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"}]},"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 et(t){return t.startsWith("/v1/")||t==="/docs"}function tt(t){let e={};for(let n of t.routes){if(!et(n.pattern))continue;let d=Ze[`${n.method} ${n.pattern}`];if(d===void 0)continue;let u=n.pattern.replace(/:([A-Za-z0-9_]+)/g,"{$1}"),f=[...n.pattern.matchAll(/:([A-Za-z0-9_]+)/g)].map((_)=>({name:_[1],in:"path",required:!0,schema:{type:"string"}})),y=(d.query??[]).map((_)=>({name:_.name,in:"query",required:!1,description:_.about,schema:{type:"string"}})),x={};for(let _ of d.statuses??[])x[String(_.code)]={description:_.when};if(x["200"]===void 0&&x["201"]===void 0){if(x["202"]===void 0)x["200"]={description:"OK"}}if(x["401"]={description:"No credential, or one this server does not accept."},n.pattern.includes(":id"))x["404"]={description:"No such agent, or it is switched off."};e[u]??={};let O={summary:d.summary,...f.length+y.length===0?{}:{parameters:[...f,...y]},responses:x};if(d.body!==void 0)O.requestBody={required:!0,content:{"application/json":{schema:Oo(d.body,{target:"draft-2020-12",io:"input"})}}};e[u][n.method.toLowerCase()]=O}return{openapi:"3.1.0",info:{title:"Dispach agent server",version:qt,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 nt=new Set(["127.0.0.1","::1","localhost","[::1]"]);function J(t){return nt.has(t.toLowerCase())}function W(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 J(t)||/^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(t)}function oe(t,e){let n=J(e.host),d=t.headers.get("host"),u=t.headers.get("origin");if(n){let y=d===null?void 0:W(d),x=e.allowedHosts??[];if(!(y!==void 0&&(pe(y)||x.some((_)=>W(_)===y))))return{code:"host_not_allowed",message:`This server does not answer to the host ${d??"(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(u===null)return;let f=W(u);if(f!==void 0){if(pe(f))return;if((e.allowedOrigins??[]).some((y)=>W(y)===f))return;if(!n&&d!==null&&W(d)===f)return}return{code:"origin_not_allowed",message:`Refusing a request from the origin ${u}.`,hint:n?"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 at(t,e){let n=t.headers.get("origin");if(n===null)return{};if(oe(t,e)!==void 0)return{};return{"access-control-allow-origin":n,vary:"Origin"}}function lt(t,e){let n=t.headers.get("access-control-request-headers");return{"access-control-allow-methods":e.join(", "),"access-control-allow-headers":n??"authorization, content-type","access-control-max-age":"600"}}function me(t,e){if(t.kind!=="key")return t.kind!=="claim";let n=t.scope?.can;return n===void 0||n.includes(e)}function K(t,e){if(t.kind!=="key")return t.kind!=="claim";let n=t.scope?.agents;return n===void 0||n.includes(e)}function Z(t,e){if(t.kind!=="key")return t.kind!=="claim";let n=t.scope?.sessions;if(n===void 0)return!0;return e.startsWith(n.endsWith("*")?n.slice(0,-1):n)}function Ae(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 Oe{#e=[];add(t,e,n,d){return this.#e.push({method:t.toUpperCase(),pattern:e,handler:n,capability:d.capability,streaming:d.streaming===!0,segments:ge(e)}),this}routes(){return this.#e.map(({method:t,pattern:e,handler:n,streaming:d,capability:u})=>({method:t,pattern:e,handler:n,streaming:d,capability:u}))}match(t,e){let n=ge(e),d=[];for(let u of this.#e){let f=it(u.segments,n);if(f===void 0)continue;if(d.push(u),u.method===t.toUpperCase())return{kind:"found",handler:u.handler,params:f,streaming:u.streaming,capability:u.capability}}if(d.length>0)return{kind:"method",allowed:[...new Set(d.map((u)=>u.method))]};return{kind:"none"}}}function ge(t){return t.split("/").filter((e)=>e!=="")}function it(t,e){if(t.length!==e.length)return;let n={};for(let[d,u]of t.entries()){let f=e[d];if(f===void 0)return;if(u.startsWith(":")){try{n[u.slice(1)]=decodeURIComponent(f)}catch{return}continue}if(u!==f)return}return n}var Pe=15000;function ot(t){let e=[];if(t.event!==void 0)e.push(`event: ${t.event}`);if(t.id!==void 0)e.push(`id: ${t.id}`);let n=typeof t.data==="string"?t.data:JSON.stringify(t.data);for(let d of n.split(`
|
|
3
|
+
`))e.push(`data: ${d}`);return`${e.join(`
|
|
4
|
+
`)}
|
|
5
|
+
|
|
6
|
+
`}function se(t){let e=new TextEncoder,n,d,u=!1,f=new ReadableStream({start(y){let x=()=>{if(u)return;if(u=!0,d!==void 0)clearInterval(d);n?.(),n=void 0;try{y.close()}catch{}},O=(w)=>{if(u)return;try{y.enqueue(e.encode(ot(w)))}catch{x()}};t.signal?.addEventListener("abort",x,{once:!0});let _=t.start({send:O,close:x});if(u){_?.();return}n=_,d=setInterval(()=>{if(u)return;try{y.enqueue(e.encode(`: ping
|
|
7
|
+
|
|
8
|
+
`))}catch{x()}},t.heartbeatMs??Pe),d.unref?.()},cancel(){if(u)return;if(u=!0,d!==void 0)clearInterval(d);n?.(),n=void 0}});return new Response(f,{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 st=':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}.note{font-size:12px;color:var(--dim);border-left:2px solid var(--line);padding-left:11px}.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}\n',ut=`(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const j of document.querySelectorAll('link[rel="modulepreload"]'))o(j);new MutationObserver(j=>{for(const z of j)if(z.type==="childList")for(const C of z.addedNodes)C.tagName==="LINK"&&C.rel==="modulepreload"&&o(C)}).observe(document,{childList:!0,subtree:!0});function r(j){const z={};return j.integrity&&(z.integrity=j.integrity),j.referrerPolicy&&(z.referrerPolicy=j.referrerPolicy),j.crossOrigin==="use-credentials"?z.credentials="include":j.crossOrigin==="anonymous"?z.credentials="omit":z.credentials="same-origin",z}function o(j){if(j.ep)return;j.ep=!0;const z=r(j);fetch(j.href,z)}})();var Tf={exports:{}},qn={};var Yr;function Om(){if(Yr)return qn;Yr=1;var c=Symbol.for("react.transitional.element"),s=Symbol.for("react.fragment");function r(o,j,z){var C=null;if(z!==void 0&&(C=""+z),j.key!==void 0&&(C=""+j.key),"key"in j){z={};for(var L in j)L!=="key"&&(z[L]=j[L])}else z=j;return j=z.ref,{$$typeof:c,type:o,key:C,ref:j!==void 0?j:null,props:z}}return qn.Fragment=s,qn.jsx=r,qn.jsxs=r,qn}var wr;function Mm(){return wr||(wr=1,Tf.exports=Om()),Tf.exports}var d=Mm(),Ef={exports:{}},I={};var Gr;function Um(){if(Gr)return I;Gr=1;var c=Symbol.for("react.transitional.element"),s=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),j=Symbol.for("react.profiler"),z=Symbol.for("react.consumer"),C=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),H=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),E=Symbol.for("react.activity"),U=Symbol.iterator;function J(m){return m===null||typeof m!="object"?null:(m=U&&m[U]||m["@@iterator"],typeof m=="function"?m:null)}var W={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},q=Object.assign,Ee={};function $(m,O,B){this.props=m,this.context=O,this.refs=Ee,this.updater=B||W}$.prototype.isReactComponent={},$.prototype.setState=function(m,O){if(typeof m!="object"&&typeof m!="function"&&m!=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,m,O,"setState")},$.prototype.forceUpdate=function(m){this.updater.enqueueForceUpdate(this,m,"forceUpdate")};function Pe(){}Pe.prototype=$.prototype;function _e(m,O,B){this.props=m,this.context=O,this.refs=Ee,this.updater=B||W}var Ne=_e.prototype=new Pe;Ne.constructor=_e,q(Ne,$.prototype),Ne.isPureReactComponent=!0;var ft=Array.isArray;function we(){}var P={H:null,A:null,T:null,S:null},ve=Object.prototype.hasOwnProperty;function et(m,O,B){var Y=B.ref;return{$$typeof:c,type:m,key:O,ref:Y!==void 0?Y:null,props:B}}function Ht(m,O){return et(m.type,O,m.props)}function fe(m){return typeof m=="object"&&m!==null&&m.$$typeof===c}function Ge(m){var O={"=":"=0",":":"=2"};return"$"+m.replace(/[=:]/g,function(B){return O[B]})}var Ot=/\\/+/g;function Mt(m,O){return typeof m=="object"&&m!==null&&m.key!=null?Ge(""+m.key):O.toString(36)}function st(m){switch(m.status){case"fulfilled":return m.value;case"rejected":throw m.reason;default:switch(typeof m.status=="string"?m.then(we,we):(m.status="pending",m.then(function(O){m.status==="pending"&&(m.status="fulfilled",m.value=O)},function(O){m.status==="pending"&&(m.status="rejected",m.reason=O)})),m.status){case"fulfilled":return m.value;case"rejected":throw m.reason}}throw m}function x(m,O,B,Y,F){var k=typeof m;(k==="undefined"||k==="boolean")&&(m=null);var oe=!1;if(m===null)oe=!0;else switch(k){case"bigint":case"string":case"number":oe=!0;break;case"object":switch(m.$$typeof){case c:case s:oe=!0;break;case D:return oe=m._init,x(oe(m._payload),O,B,Y,F)}}if(oe)return F=F(m),oe=Y===""?"."+Mt(m,0):Y,ft(F)?(B="",oe!=null&&(B=oe.replace(Ot,"$&/")+"/"),x(F,O,B,"",function(Dl){return Dl})):F!=null&&(fe(F)&&(F=Ht(F,B+(F.key==null||m&&m.key===F.key?"":(""+F.key).replace(Ot,"$&/")+"/")+oe)),O.push(F)),1;oe=0;var Re=Y===""?".":Y+":";if(ft(m))for(var xe=0;xe<m.length;xe++)Y=m[xe],k=Re+Mt(Y,xe),oe+=x(Y,O,B,k,F);else if(xe=J(m),typeof xe=="function")for(m=xe.call(m),xe=0;!(Y=m.next()).done;)Y=Y.value,k=Re+Mt(Y,xe++),oe+=x(Y,O,B,k,F);else if(k==="object"){if(typeof m.then=="function")return x(st(m),O,B,Y,F);throw O=String(m),Error("Objects are not valid as a React child (found: "+(O==="[object Object]"?"object with keys {"+Object.keys(m).join(", ")+"}":O)+"). If you meant to render a collection of children, use an array instead.")}return oe}function R(m,O,B){if(m==null)return m;var Y=[],F=0;return x(m,Y,"","",function(k){return O.call(B,k,F++)}),Y}function V(m){if(m._status===-1){var O=m._result;O=O(),O.then(function(B){(m._status===0||m._status===-1)&&(m._status=1,m._result=B)},function(B){(m._status===0||m._status===-1)&&(m._status=2,m._result=B)}),m._status===-1&&(m._status=0,m._result=O)}if(m._status===1)return m._result.default;throw m._result}var se=typeof reportError=="function"?reportError:function(m){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var O=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof m=="object"&&m!==null&&typeof m.message=="string"?String(m.message):String(m),error:m});if(!window.dispatchEvent(O))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",m);return}console.error(m)},de={map:R,forEach:function(m,O,B){R(m,function(){O.apply(this,arguments)},B)},count:function(m){var O=0;return R(m,function(){O++}),O},toArray:function(m){return R(m,function(O){return O})||[]},only:function(m){if(!fe(m))throw Error("React.Children.only expected to receive a single React element child.");return m}};return I.Activity=E,I.Children=de,I.Component=$,I.Fragment=r,I.Profiler=j,I.PureComponent=_e,I.StrictMode=o,I.Suspense=H,I.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=P,I.__COMPILER_RUNTIME={__proto__:null,c:function(m){return P.H.useMemoCache(m)}},I.cache=function(m){return function(){return m.apply(null,arguments)}},I.cacheSignal=function(){return null},I.cloneElement=function(m,O,B){if(m==null)throw Error("The argument must be a React element, but you passed "+m+".");var Y=q({},m.props),F=m.key;if(O!=null)for(k in O.key!==void 0&&(F=""+O.key),O)!ve.call(O,k)||k==="key"||k==="__self"||k==="__source"||k==="ref"&&O.ref===void 0||(Y[k]=O[k]);var k=arguments.length-2;if(k===1)Y.children=B;else if(1<k){for(var oe=Array(k),Re=0;Re<k;Re++)oe[Re]=arguments[Re+2];Y.children=oe}return et(m.type,F,Y)},I.createContext=function(m){return m={$$typeof:C,_currentValue:m,_currentValue2:m,_threadCount:0,Provider:null,Consumer:null},m.Provider=m,m.Consumer={$$typeof:z,_context:m},m},I.createElement=function(m,O,B){var Y,F={},k=null;if(O!=null)for(Y in O.key!==void 0&&(k=""+O.key),O)ve.call(O,Y)&&Y!=="key"&&Y!=="__self"&&Y!=="__source"&&(F[Y]=O[Y]);var oe=arguments.length-2;if(oe===1)F.children=B;else if(1<oe){for(var Re=Array(oe),xe=0;xe<oe;xe++)Re[xe]=arguments[xe+2];F.children=Re}if(m&&m.defaultProps)for(Y in oe=m.defaultProps,oe)F[Y]===void 0&&(F[Y]=oe[Y]);return et(m,k,F)},I.createRef=function(){return{current:null}},I.forwardRef=function(m){return{$$typeof:L,render:m}},I.isValidElement=fe,I.lazy=function(m){return{$$typeof:D,_payload:{_status:-1,_result:m},_init:V}},I.memo=function(m,O){return{$$typeof:g,type:m,compare:O===void 0?null:O}},I.startTransition=function(m){var O=P.T,B={};P.T=B;try{var Y=m(),F=P.S;F!==null&&F(B,Y),typeof Y=="object"&&Y!==null&&typeof Y.then=="function"&&Y.then(we,se)}catch(k){se(k)}finally{O!==null&&B.types!==null&&(O.types=B.types),P.T=O}},I.unstable_useCacheRefresh=function(){return P.H.useCacheRefresh()},I.use=function(m){return P.H.use(m)},I.useActionState=function(m,O,B){return P.H.useActionState(m,O,B)},I.useCallback=function(m,O){return P.H.useCallback(m,O)},I.useContext=function(m){return P.H.useContext(m)},I.useDebugValue=function(){},I.useDeferredValue=function(m,O){return P.H.useDeferredValue(m,O)},I.useEffect=function(m,O){return P.H.useEffect(m,O)},I.useEffectEvent=function(m){return P.H.useEffectEvent(m)},I.useId=function(){return P.H.useId()},I.useImperativeHandle=function(m,O,B){return P.H.useImperativeHandle(m,O,B)},I.useInsertionEffect=function(m,O){return P.H.useInsertionEffect(m,O)},I.useLayoutEffect=function(m,O){return P.H.useLayoutEffect(m,O)},I.useMemo=function(m,O){return P.H.useMemo(m,O)},I.useOptimistic=function(m,O){return P.H.useOptimistic(m,O)},I.useReducer=function(m,O,B){return P.H.useReducer(m,O,B)},I.useRef=function(m){return P.H.useRef(m)},I.useState=function(m){return P.H.useState(m)},I.useSyncExternalStore=function(m,O,B){return P.H.useSyncExternalStore(m,O,B)},I.useTransition=function(){return P.H.useTransition()},I.version="19.2.8",I}var Xr;function Rf(){return Xr||(Xr=1,Ef.exports=Um()),Ef.exports}var w=Rf(),zf={exports:{}},Bn={},Af={exports:{}},xf={};var Qr;function Dm(){return Qr||(Qr=1,(function(c){function s(x,R){var V=x.length;x.push(R);e:for(;0<V;){var se=V-1>>>1,de=x[se];if(0<j(de,R))x[se]=R,x[V]=de,V=se;else break e}}function r(x){return x.length===0?null:x[0]}function o(x){if(x.length===0)return null;var R=x[0],V=x.pop();if(V!==R){x[0]=V;e:for(var se=0,de=x.length,m=de>>>1;se<m;){var O=2*(se+1)-1,B=x[O],Y=O+1,F=x[Y];if(0>j(B,V))Y<de&&0>j(F,B)?(x[se]=F,x[Y]=V,se=Y):(x[se]=B,x[O]=V,se=O);else if(Y<de&&0>j(F,V))x[se]=F,x[Y]=V,se=Y;else break e}}return R}function j(x,R){var V=x.sortIndex-R.sortIndex;return V!==0?V:x.id-R.id}if(c.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var z=performance;c.unstable_now=function(){return z.now()}}else{var C=Date,L=C.now();c.unstable_now=function(){return C.now()-L}}var H=[],g=[],D=1,E=null,U=3,J=!1,W=!1,q=!1,Ee=!1,$=typeof setTimeout=="function"?setTimeout:null,Pe=typeof clearTimeout=="function"?clearTimeout:null,_e=typeof setImmediate<"u"?setImmediate:null;function Ne(x){for(var R=r(g);R!==null;){if(R.callback===null)o(g);else if(R.startTime<=x)o(g),R.sortIndex=R.expirationTime,s(H,R);else break;R=r(g)}}function ft(x){if(q=!1,Ne(x),!W)if(r(H)!==null)W=!0,we||(we=!0,Ge());else{var R=r(g);R!==null&&st(ft,R.startTime-x)}}var we=!1,P=-1,ve=5,et=-1;function Ht(){return Ee?!0:!(c.unstable_now()-et<ve)}function fe(){if(Ee=!1,we){var x=c.unstable_now();et=x;var R=!0;try{e:{W=!1,q&&(q=!1,Pe(P),P=-1),J=!0;var V=U;try{t:{for(Ne(x),E=r(H);E!==null&&!(E.expirationTime>x&&Ht());){var se=E.callback;if(typeof se=="function"){E.callback=null,U=E.priorityLevel;var de=se(E.expirationTime<=x);if(x=c.unstable_now(),typeof de=="function"){E.callback=de,Ne(x),R=!0;break t}E===r(H)&&o(H),Ne(x)}else o(H);E=r(H)}if(E!==null)R=!0;else{var m=r(g);m!==null&&st(ft,m.startTime-x),R=!1}}break e}finally{E=null,U=V,J=!1}R=void 0}}finally{R?Ge():we=!1}}}var Ge;if(typeof _e=="function")Ge=function(){_e(fe)};else if(typeof MessageChannel<"u"){var Ot=new MessageChannel,Mt=Ot.port2;Ot.port1.onmessage=fe,Ge=function(){Mt.postMessage(null)}}else Ge=function(){$(fe,0)};function st(x,R){P=$(function(){x(c.unstable_now())},R)}c.unstable_IdlePriority=5,c.unstable_ImmediatePriority=1,c.unstable_LowPriority=4,c.unstable_NormalPriority=3,c.unstable_Profiling=null,c.unstable_UserBlockingPriority=2,c.unstable_cancelCallback=function(x){x.callback=null},c.unstable_forceFrameRate=function(x){0>x||125<x?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ve=0<x?Math.floor(1e3/x):5},c.unstable_getCurrentPriorityLevel=function(){return U},c.unstable_next=function(x){switch(U){case 1:case 2:case 3:var R=3;break;default:R=U}var V=U;U=R;try{return x()}finally{U=V}},c.unstable_requestPaint=function(){Ee=!0},c.unstable_runWithPriority=function(x,R){switch(x){case 1:case 2:case 3:case 4:case 5:break;default:x=3}var V=U;U=x;try{return R()}finally{U=V}},c.unstable_scheduleCallback=function(x,R,V){var se=c.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?se+V:se):V=se,x){case 1:var de=-1;break;case 2:de=250;break;case 5:de=1073741823;break;case 4:de=1e4;break;default:de=5e3}return de=V+de,x={id:D++,callback:R,priorityLevel:x,startTime:V,expirationTime:de,sortIndex:-1},V>se?(x.sortIndex=V,s(g,x),r(H)===null&&x===r(g)&&(q?(Pe(P),P=-1):q=!0,st(ft,V-se))):(x.sortIndex=de,s(H,x),W||J||(W=!0,we||(we=!0,Ge()))),x},c.unstable_shouldYield=Ht,c.unstable_wrapCallback=function(x){var R=U;return function(){var V=U;U=R;try{return x.apply(this,arguments)}finally{U=V}}}})(xf)),xf}var Zr;function Cm(){return Zr||(Zr=1,Af.exports=Dm()),Af.exports}var jf={exports:{}},Fe={};var Lr;function Rm(){if(Lr)return Fe;Lr=1;var c=Rf();function s(H){var g="https://react.dev/errors/"+H;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var D=2;D<arguments.length;D++)g+="&args[]="+encodeURIComponent(arguments[D])}return"Minified React error #"+H+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var o={d:{f:r,r:function(){throw Error(s(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},j=Symbol.for("react.portal");function z(H,g,D){var E=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:j,key:E==null?null:""+E,children:H,containerInfo:g,implementation:D}}var C=c.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function L(H,g){if(H==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return Fe.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,Fe.createPortal=function(H,g){var D=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(s(299));return z(H,g,null,D)},Fe.flushSync=function(H){var g=C.T,D=o.p;try{if(C.T=null,o.p=2,H)return H()}finally{C.T=g,o.p=D,o.d.f()}},Fe.preconnect=function(H,g){typeof H=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,o.d.C(H,g))},Fe.prefetchDNS=function(H){typeof H=="string"&&o.d.D(H)},Fe.preinit=function(H,g){if(typeof H=="string"&&g&&typeof g.as=="string"){var D=g.as,E=L(D,g.crossOrigin),U=typeof g.integrity=="string"?g.integrity:void 0,J=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;D==="style"?o.d.S(H,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:E,integrity:U,fetchPriority:J}):D==="script"&&o.d.X(H,{crossOrigin:E,integrity:U,fetchPriority:J,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},Fe.preinitModule=function(H,g){if(typeof H=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var D=L(g.as,g.crossOrigin);o.d.M(H,{crossOrigin:D,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0})}}else g==null&&o.d.M(H)},Fe.preload=function(H,g){if(typeof H=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var D=g.as,E=L(D,g.crossOrigin);o.d.L(H,D,{crossOrigin:E,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},Fe.preloadModule=function(H,g){if(typeof H=="string")if(g){var D=L(g.as,g.crossOrigin);o.d.m(H,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:D,integrity:typeof g.integrity=="string"?g.integrity:void 0})}else o.d.m(H)},Fe.requestFormReset=function(H){o.d.r(H)},Fe.unstable_batchedUpdates=function(H,g){return H(g)},Fe.useFormState=function(H,g,D){return C.H.useFormState(H,g,D)},Fe.useFormStatus=function(){return C.H.useHostTransitionStatus()},Fe.version="19.2.8",Fe}var Kr;function Hm(){if(Kr)return jf.exports;Kr=1;function c(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(c)}catch(s){console.error(s)}}return c(),jf.exports=Rm(),jf.exports}var Vr;function qm(){if(Vr)return Bn;Vr=1;var c=Cm(),s=Rf(),r=Hm();function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)t+="&args[]="+encodeURIComponent(arguments[l])}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 j(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function z(e){var t=e,l=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(l=t.return),e=t.return;while(e)}return t.tag===3?l:null}function C(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 L(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 H(e){if(z(e)!==e)throw Error(o(188))}function g(e){var t=e.alternate;if(!t){if(t=z(e),t===null)throw Error(o(188));return t!==e?null:e}for(var l=e,a=t;;){var n=l.return;if(n===null)break;var u=n.alternate;if(u===null){if(a=n.return,a!==null){l=a;continue}break}if(n.child===u.child){for(u=n.child;u;){if(u===l)return H(n),e;if(u===a)return H(n),t;u=u.sibling}throw Error(o(188))}if(l.return!==a.return)l=n,a=u;else{for(var i=!1,f=n.child;f;){if(f===l){i=!0,l=n,a=u;break}if(f===a){i=!0,a=n,l=u;break}f=f.sibling}if(!i){for(f=u.child;f;){if(f===l){i=!0,l=u,a=n;break}if(f===a){i=!0,a=u,l=n;break}f=f.sibling}if(!i)throw Error(o(189))}}if(l.alternate!==a)throw Error(o(190))}if(l.tag!==3)throw Error(o(188));return l.stateNode.current===l?e:t}function D(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=D(e),t!==null)return t;e=e.sibling}return null}var E=Object.assign,U=Symbol.for("react.element"),J=Symbol.for("react.transitional.element"),W=Symbol.for("react.portal"),q=Symbol.for("react.fragment"),Ee=Symbol.for("react.strict_mode"),$=Symbol.for("react.profiler"),Pe=Symbol.for("react.consumer"),_e=Symbol.for("react.context"),Ne=Symbol.for("react.forward_ref"),ft=Symbol.for("react.suspense"),we=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),ve=Symbol.for("react.lazy"),et=Symbol.for("react.activity"),Ht=Symbol.for("react.memo_cache_sentinel"),fe=Symbol.iterator;function Ge(e){return e===null||typeof e!="object"?null:(e=fe&&e[fe]||e["@@iterator"],typeof e=="function"?e:null)}var Ot=Symbol.for("react.client.reference");function Mt(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Ot?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case q:return"Fragment";case $:return"Profiler";case Ee:return"StrictMode";case ft:return"Suspense";case we:return"SuspenseList";case et:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case W:return"Portal";case _e:return e.displayName||"Context";case Pe:return(e._context.displayName||"Context")+".Consumer";case Ne:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case P:return t=e.displayName||null,t!==null?t:Mt(e.type)||"Memo";case ve:t=e._payload,e=e._init;try{return Mt(e(t))}catch{}}return null}var st=Array.isArray,x=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,R=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V={pending:!1,data:null,method:null,action:null},se=[],de=-1;function m(e){return{current:e}}function O(e){0>de||(e.current=se[de],se[de]=null,de--)}function B(e,t){de++,se[de]=e.current,e.current=t}var Y=m(null),F=m(null),k=m(null),oe=m(null);function Re(e,t){switch(B(k,t),B(F,e),B(Y,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?cr(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=cr(t),e=fr(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}O(Y),B(Y,e)}function xe(){O(Y),O(F),O(k)}function Dl(e){e.memoizedState!==null&&B(oe,e);var t=Y.current,l=fr(t,e.type);t!==l&&(B(F,e),B(Y,l))}function Cl(e){F.current===e&&(O(Y),O(F)),oe.current===e&&(O(oe),Dn._currentValue=V)}var wa,Ga;function qt(e){if(wa===void 0)try{throw Error()}catch(l){var t=l.stack.trim().match(/\\n( *(at )?)/);wa=t&&t[1]||"",Ga=-1<l.stack.indexOf(\`
|
|
9
|
+
at\`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return\`
|
|
10
|
+
\`+wa+e+Ga}var Pl=!1;function Xa(e,t){if(!e||Pl)return"";Pl=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(t){var N=function(){throw Error()};if(Object.defineProperty(N.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(N,[])}catch(T){var p=T}Reflect.construct(e,[],N)}else{try{N.call()}catch(T){p=T}e.call(N.prototype)}}else{try{throw Error()}catch(T){p=T}(N=e())&&typeof N.catch=="function"&&N.catch(function(){})}}catch(T){if(T&&p&&typeof T.stack=="string")return[T.stack,p.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var n=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");n&&n.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var u=a.DetermineComponentFrameRoot(),i=u[0],f=u[1];if(i&&f){var h=i.split(\`
|
|
11
|
+
\`),S=f.split(\`
|
|
12
|
+
\`);for(n=a=0;a<h.length&&!h[a].includes("DetermineComponentFrameRoot");)a++;for(;n<S.length&&!S[n].includes("DetermineComponentFrameRoot");)n++;if(a===h.length||n===S.length)for(a=h.length-1,n=S.length-1;1<=a&&0<=n&&h[a]!==S[n];)n--;for(;1<=a&&0<=n;a--,n--)if(h[a]!==S[n]){if(a!==1||n!==1)do if(a--,n--,0>n||h[a]!==S[n]){var A=\`
|
|
13
|
+
\`+h[a].replace(" at new "," at ");return e.displayName&&A.includes("<anonymous>")&&(A=A.replace("<anonymous>",e.displayName)),A}while(1<=a&&0<=n);break}}}finally{Pl=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?qt(l):""}function ea(e,t){switch(e.tag){case 26:case 27:case 5:return qt(e.type);case 16:return qt("Lazy");case 13:return e.child!==t&&t!==null?qt("Suspense Fallback"):qt("Suspense");case 19:return qt("SuspenseList");case 0:case 15:return Xa(e.type,!1);case 11:return Xa(e.type.render,!1);case 1:return Xa(e.type,!0);case 31:return qt("Activity");default:return""}}function Gn(e){try{var t="",l=null;do t+=ea(e,l),l=e,e=e.return;while(e);return t}catch(a){return\`
|
|
14
|
+
Error generating stack: \`+a.message+\`
|
|
15
|
+
\`+a.stack}}var M=Object.prototype.hasOwnProperty,Q=c.unstable_scheduleCallback,ie=c.unstable_cancelCallback,Oe=c.unstable_shouldYield,We=c.unstable_requestPaint,Le=c.unstable_now,Qa=c.unstable_getCurrentPriorityLevel,Yf=c.unstable_ImmediatePriority,wf=c.unstable_UserBlockingPriority,Xn=c.unstable_NormalPriority,oh=c.unstable_LowPriority,Gf=c.unstable_IdlePriority,dh=c.log,rh=c.unstable_setDisableYieldValue,Za=null,ot=null;function cl(e){if(typeof dh=="function"&&rh(e),ot&&typeof ot.setStrictMode=="function")try{ot.setStrictMode(Za,e)}catch{}}var dt=Math.clz32?Math.clz32:mh,hh=Math.log,vh=Math.LN2;function mh(e){return e>>>=0,e===0?32:31-(hh(e)/vh|0)|0}var Qn=256,Zn=262144,Ln=4194304;function Rl(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 Kn(e,t,l){var a=e.pendingLanes;if(a===0)return 0;var n=0,u=e.suspendedLanes,i=e.pingedLanes;e=e.warmLanes;var f=a&134217727;return f!==0?(a=f&~u,a!==0?n=Rl(a):(i&=f,i!==0?n=Rl(i):l||(l=f&~e,l!==0&&(n=Rl(l))))):(f=a&~u,f!==0?n=Rl(f):i!==0?n=Rl(i):l||(l=a&~e,l!==0&&(n=Rl(l)))),n===0?0:t!==0&&t!==n&&(t&u)===0&&(u=n&-n,l=t&-t,u>=l||u===32&&(l&4194048)!==0)?t:n}function La(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function yh(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 Xf(){var e=Ln;return Ln<<=1,(Ln&62914560)===0&&(Ln=4194304),e}function fi(e){for(var t=[],l=0;31>l;l++)t.push(e);return t}function Ka(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function gh(e,t,l,a,n,u){var i=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var f=e.entanglements,h=e.expirationTimes,S=e.hiddenUpdates;for(l=i&~l;0<l;){var A=31-dt(l),N=1<<A;f[A]=0,h[A]=-1;var p=S[A];if(p!==null)for(S[A]=null,A=0;A<p.length;A++){var T=p[A];T!==null&&(T.lane&=-536870913)}l&=~N}a!==0&&Qf(e,a,0),u!==0&&n===0&&e.tag!==0&&(e.suspendedLanes|=u&~(i&~t))}function Qf(e,t,l){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-dt(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|l&261930}function Zf(e,t){var l=e.entangledLanes|=t;for(e=e.entanglements;l;){var a=31-dt(l),n=1<<a;n&t|e[a]&t&&(e[a]|=t),l&=~n}}function Lf(e,t){var l=t&-t;return l=(l&42)!==0?1:si(l),(l&(e.suspendedLanes|t))!==0?0:l}function si(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 oi(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Kf(){var e=R.p;return e!==0?e:(e=window.event,e===void 0?32:Ur(e.type))}function Vf(e,t){var l=R.p;try{return R.p=e,t()}finally{R.p=l}}var fl=Math.random().toString(36).slice(2),Ke="__reactFiber$"+fl,tt="__reactProps$"+fl,ta="__reactContainer$"+fl,di="__reactEvents$"+fl,bh="__reactListeners$"+fl,Sh="__reactHandles$"+fl,Jf="__reactResources$"+fl,Va="__reactMarker$"+fl;function ri(e){delete e[Ke],delete e[tt],delete e[di],delete e[bh],delete e[Sh]}function la(e){var t=e[Ke];if(t)return t;for(var l=e.parentNode;l;){if(t=l[ta]||l[Ke]){if(l=t.alternate,t.child!==null||l!==null&&l.child!==null)for(e=mr(e);e!==null;){if(l=e[Ke])return l;e=mr(e)}return t}e=l,l=e.parentNode}return null}function aa(e){if(e=e[Ke]||e[ta]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ja(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function na(e){var t=e[Jf];return t||(t=e[Jf]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Qe(e){e[Va]=!0}var kf=new Set,$f={};function Hl(e,t){ua(e,t),ua(e+"Capture",t)}function ua(e,t){for($f[e]=t,e=0;e<t.length;e++)kf.add(t[e])}var ph=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]*$"),Wf={},Ff={};function Th(e){return M.call(Ff,e)?!0:M.call(Wf,e)?!1:ph.test(e)?Ff[e]=!0:(Wf[e]=!0,!1)}function Vn(e,t,l){if(Th(t))if(l===null)e.removeAttribute(t);else{switch(typeof l){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var a=t.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+l)}}function Jn(e,t,l){if(l===null)e.removeAttribute(t);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+l)}}function Qt(e,t,l,a){if(a===null)e.removeAttribute(l);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(l);return}e.setAttributeNS(t,l,""+a)}}function St(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function If(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Eh(e,t,l){var a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var n=a.get,u=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return n.call(this)},set:function(i){l=""+i,u.call(this,i)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return l},setValue:function(i){l=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function hi(e){if(!e._valueTracker){var t=If(e)?"checked":"value";e._valueTracker=Eh(e,t,""+e[t])}}function Pf(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var l=t.getValue(),a="";return e&&(a=If(e)?e.checked?"true":"false":e.value),e=a,e!==l?(t.setValue(e),!0):!1}function kn(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 zh=/[\\n"\\\\]/g;function pt(e){return e.replace(zh,function(t){return"\\\\"+t.charCodeAt(0).toString(16)+" "})}function vi(e,t,l,a,n,u,i,f){e.name="",i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"?e.type=i:e.removeAttribute("type"),t!=null?i==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+St(t)):e.value!==""+St(t)&&(e.value=""+St(t)):i!=="submit"&&i!=="reset"||e.removeAttribute("value"),t!=null?mi(e,i,St(t)):l!=null?mi(e,i,St(l)):a!=null&&e.removeAttribute("value"),n==null&&u!=null&&(e.defaultChecked=!!u),n!=null&&(e.checked=n&&typeof n!="function"&&typeof n!="symbol"),f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"?e.name=""+St(f):e.removeAttribute("name")}function es(e,t,l,a,n,u,i,f){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(e.type=u),t!=null||l!=null){if(!(u!=="submit"&&u!=="reset"||t!=null)){hi(e);return}l=l!=null?""+St(l):"",t=t!=null?""+St(t):l,f||t===e.value||(e.value=t),e.defaultValue=t}a=a??n,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=f?e.checked:!!a,e.defaultChecked=!!a,i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.name=i),hi(e)}function mi(e,t,l){t==="number"&&kn(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function ia(e,t,l,a){if(e=e.options,t){t={};for(var n=0;n<l.length;n++)t["$"+l[n]]=!0;for(l=0;l<e.length;l++)n=t.hasOwnProperty("$"+e[l].value),e[l].selected!==n&&(e[l].selected=n),n&&a&&(e[l].defaultSelected=!0)}else{for(l=""+St(l),t=null,n=0;n<e.length;n++){if(e[n].value===l){e[n].selected=!0,a&&(e[n].defaultSelected=!0);return}t!==null||e[n].disabled||(t=e[n])}t!==null&&(t.selected=!0)}}function ts(e,t,l){if(t!=null&&(t=""+St(t),t!==e.value&&(e.value=t),l==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=l!=null?""+St(l):""}function ls(e,t,l,a){if(t==null){if(a!=null){if(l!=null)throw Error(o(92));if(st(a)){if(1<a.length)throw Error(o(93));a=a[0]}l=a}l==null&&(l=""),t=l}l=St(t),e.defaultValue=l,a=e.textContent,a===l&&a!==""&&a!==null&&(e.value=a),hi(e)}function ca(e,t){if(t){var l=e.firstChild;if(l&&l===e.lastChild&&l.nodeType===3){l.nodeValue=t;return}}e.textContent=t}var Ah=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 as(e,t,l){var a=t.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?a?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":a?e.setProperty(t,l):typeof l!="number"||l===0||Ah.has(t)?t==="float"?e.cssFloat=l:e[t]=(""+l).trim():e[t]=l+"px"}function ns(e,t,l){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,l!=null){for(var a in l)!l.hasOwnProperty(a)||t!=null&&t.hasOwnProperty(a)||(a.indexOf("--")===0?e.setProperty(a,""):a==="float"?e.cssFloat="":e[a]="");for(var n in t)a=t[n],t.hasOwnProperty(n)&&l[n]!==a&&as(e,n,a)}else for(var u in t)t.hasOwnProperty(u)&&as(e,u,t[u])}function yi(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 xh=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"]]),jh=/^[\\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 $n(e){return jh.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Zt(){}var gi=null;function bi(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var fa=null,sa=null;function us(e){var t=aa(e);if(t&&(e=t.stateNode)){var l=e[tt]||null;e:switch(e=t.stateNode,t.type){case"input":if(vi(e,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),t=l.name,l.type==="radio"&&t!=null){for(l=e;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+pt(""+t)+'"][type="radio"]'),t=0;t<l.length;t++){var a=l[t];if(a!==e&&a.form===e.form){var n=a[tt]||null;if(!n)throw Error(o(90));vi(a,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name)}}for(t=0;t<l.length;t++)a=l[t],a.form===e.form&&Pf(a)}break e;case"textarea":ts(e,l.value,l.defaultValue);break e;case"select":t=l.value,t!=null&&ia(e,!!l.multiple,t,!1)}}}var Si=!1;function is(e,t,l){if(Si)return e(t,l);Si=!0;try{var a=e(t);return a}finally{if(Si=!1,(fa!==null||sa!==null)&&(qu(),fa&&(t=fa,e=sa,sa=fa=null,us(t),e)))for(t=0;t<e.length;t++)us(e[t])}}function ka(e,t){var l=e.stateNode;if(l===null)return null;var a=l[tt]||null;if(a===null)return null;l=a[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":(a=!a.disabled)||(e=e.type,a=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!a;break e;default:e=!1}if(e)return null;if(l&&typeof l!="function")throw Error(o(231,t,typeof l));return l}var Lt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),pi=!1;if(Lt)try{var $a={};Object.defineProperty($a,"passive",{get:function(){pi=!0}}),window.addEventListener("test",$a,$a),window.removeEventListener("test",$a,$a)}catch{pi=!1}var sl=null,Ti=null,Wn=null;function cs(){if(Wn)return Wn;var e,t=Ti,l=t.length,a,n="value"in sl?sl.value:sl.textContent,u=n.length;for(e=0;e<l&&t[e]===n[e];e++);var i=l-e;for(a=1;a<=i&&t[l-a]===n[u-a];a++);return Wn=n.slice(e,1<a?1-a:void 0)}function Fn(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 In(){return!0}function fs(){return!1}function lt(e){function t(l,a,n,u,i){this._reactName=l,this._targetInst=n,this.type=a,this.nativeEvent=u,this.target=i,this.currentTarget=null;for(var f in e)e.hasOwnProperty(f)&&(l=e[f],this[f]=l?l(u):u[f]);return this.isDefaultPrevented=(u.defaultPrevented!=null?u.defaultPrevented:u.returnValue===!1)?In:fs,this.isPropagationStopped=fs,this}return E(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=In)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=In)},persist:function(){},isPersistent:In}),t}var ql={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Pn=lt(ql),Wa=E({},ql,{view:0,detail:0}),_h=lt(Wa),Ei,zi,Fa,eu=E({},Wa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:xi,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!==Fa&&(Fa&&e.type==="mousemove"?(Ei=e.screenX-Fa.screenX,zi=e.screenY-Fa.screenY):zi=Ei=0,Fa=e),Ei)},movementY:function(e){return"movementY"in e?e.movementY:zi}}),ss=lt(eu),Nh=E({},eu,{dataTransfer:0}),Oh=lt(Nh),Mh=E({},Wa,{relatedTarget:0}),Ai=lt(Mh),Uh=E({},ql,{animationName:0,elapsedTime:0,pseudoElement:0}),Dh=lt(Uh),Ch=E({},ql,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Rh=lt(Ch),Hh=E({},ql,{data:0}),os=lt(Hh),qh={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Bh={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"},Yh={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function wh(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Yh[e])?!!t[e]:!1}function xi(){return wh}var Gh=E({},Wa,{key:function(e){if(e.key){var t=qh[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Fn(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Bh[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:xi,charCode:function(e){return e.type==="keypress"?Fn(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Fn(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Xh=lt(Gh),Qh=E({},eu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ds=lt(Qh),Zh=E({},Wa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:xi}),Lh=lt(Zh),Kh=E({},ql,{propertyName:0,elapsedTime:0,pseudoElement:0}),Vh=lt(Kh),Jh=E({},eu,{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}),kh=lt(Jh),$h=E({},ql,{newState:0,oldState:0}),Wh=lt($h),Fh=[9,13,27,32],ji=Lt&&"CompositionEvent"in window,Ia=null;Lt&&"documentMode"in document&&(Ia=document.documentMode);var Ih=Lt&&"TextEvent"in window&&!Ia,rs=Lt&&(!ji||Ia&&8<Ia&&11>=Ia),hs=" ",vs=!1;function ms(e,t){switch(e){case"keyup":return Fh.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ys(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var oa=!1;function Ph(e,t){switch(e){case"compositionend":return ys(t);case"keypress":return t.which!==32?null:(vs=!0,hs);case"textInput":return e=t.data,e===hs&&vs?null:e;default:return null}}function ev(e,t){if(oa)return e==="compositionend"||!ji&&ms(e,t)?(e=cs(),Wn=Ti=sl=null,oa=!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 rs&&t.locale!=="ko"?null:t.data;default:return null}}var tv={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 gs(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!tv[e.type]:t==="textarea"}function bs(e,t,l,a){fa?sa?sa.push(a):sa=[a]:fa=a,t=Zu(t,"onChange"),0<t.length&&(l=new Pn("onChange","change",null,l,a),e.push({event:l,listeners:t}))}var Pa=null,en=null;function lv(e){tr(e,0)}function tu(e){var t=Ja(e);if(Pf(t))return e}function Ss(e,t){if(e==="change")return t}var ps=!1;if(Lt){var _i;if(Lt){var Ni="oninput"in document;if(!Ni){var Ts=document.createElement("div");Ts.setAttribute("oninput","return;"),Ni=typeof Ts.oninput=="function"}_i=Ni}else _i=!1;ps=_i&&(!document.documentMode||9<document.documentMode)}function Es(){Pa&&(Pa.detachEvent("onpropertychange",zs),en=Pa=null)}function zs(e){if(e.propertyName==="value"&&tu(en)){var t=[];bs(t,en,e,bi(e)),is(lv,t)}}function av(e,t,l){e==="focusin"?(Es(),Pa=t,en=l,Pa.attachEvent("onpropertychange",zs)):e==="focusout"&&Es()}function nv(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return tu(en)}function uv(e,t){if(e==="click")return tu(t)}function iv(e,t){if(e==="input"||e==="change")return tu(t)}function cv(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var rt=typeof Object.is=="function"?Object.is:cv;function tn(e,t){if(rt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var l=Object.keys(e),a=Object.keys(t);if(l.length!==a.length)return!1;for(a=0;a<l.length;a++){var n=l[a];if(!M.call(t,n)||!rt(e[n],t[n]))return!1}return!0}function As(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function xs(e,t){var l=As(e);e=0;for(var a;l;){if(l.nodeType===3){if(a=e+l.textContent.length,e<=t&&a>=t)return{node:l,offset:t-e};e=a}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=As(l)}}function js(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?js(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function _s(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=kn(e.document);t instanceof e.HTMLIFrameElement;){try{var l=typeof t.contentWindow.location.href=="string"}catch{l=!1}if(l)e=t.contentWindow;else break;t=kn(e.document)}return t}function Oi(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 fv=Lt&&"documentMode"in document&&11>=document.documentMode,da=null,Mi=null,ln=null,Ui=!1;function Ns(e,t,l){var a=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Ui||da==null||da!==kn(a)||(a=da,"selectionStart"in a&&Oi(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),ln&&tn(ln,a)||(ln=a,a=Zu(Mi,"onSelect"),0<a.length&&(t=new Pn("onSelect","select",null,t,l),e.push({event:t,listeners:a}),t.target=da)))}function Bl(e,t){var l={};return l[e.toLowerCase()]=t.toLowerCase(),l["Webkit"+e]="webkit"+t,l["Moz"+e]="moz"+t,l}var ra={animationend:Bl("Animation","AnimationEnd"),animationiteration:Bl("Animation","AnimationIteration"),animationstart:Bl("Animation","AnimationStart"),transitionrun:Bl("Transition","TransitionRun"),transitionstart:Bl("Transition","TransitionStart"),transitioncancel:Bl("Transition","TransitionCancel"),transitionend:Bl("Transition","TransitionEnd")},Di={},Os={};Lt&&(Os=document.createElement("div").style,"AnimationEvent"in window||(delete ra.animationend.animation,delete ra.animationiteration.animation,delete ra.animationstart.animation),"TransitionEvent"in window||delete ra.transitionend.transition);function Yl(e){if(Di[e])return Di[e];if(!ra[e])return e;var t=ra[e],l;for(l in t)if(t.hasOwnProperty(l)&&l in Os)return Di[e]=t[l];return e}var Ms=Yl("animationend"),Us=Yl("animationiteration"),Ds=Yl("animationstart"),sv=Yl("transitionrun"),ov=Yl("transitionstart"),dv=Yl("transitioncancel"),Cs=Yl("transitionend"),Rs=new Map,Ci="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(" ");Ci.push("scrollEnd");function Ut(e,t){Rs.set(e,t),Hl(t,[e])}var lu=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)},Tt=[],ha=0,Ri=0;function au(){for(var e=ha,t=Ri=ha=0;t<e;){var l=Tt[t];Tt[t++]=null;var a=Tt[t];Tt[t++]=null;var n=Tt[t];Tt[t++]=null;var u=Tt[t];if(Tt[t++]=null,a!==null&&n!==null){var i=a.pending;i===null?n.next=n:(n.next=i.next,i.next=n),a.pending=n}u!==0&&Hs(l,n,u)}}function nu(e,t,l,a){Tt[ha++]=e,Tt[ha++]=t,Tt[ha++]=l,Tt[ha++]=a,Ri|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function Hi(e,t,l,a){return nu(e,t,l,a),uu(e)}function wl(e,t){return nu(e,null,null,t),uu(e)}function Hs(e,t,l){e.lanes|=l;var a=e.alternate;a!==null&&(a.lanes|=l);for(var n=!1,u=e.return;u!==null;)u.childLanes|=l,a=u.alternate,a!==null&&(a.childLanes|=l),u.tag===22&&(e=u.stateNode,e===null||e._visibility&1||(n=!0)),e=u,u=u.return;return e.tag===3?(u=e.stateNode,n&&t!==null&&(n=31-dt(l),e=u.hiddenUpdates,a=e[n],a===null?e[n]=[t]:a.push(t),t.lane=l|536870912),u):null}function uu(e){if(50<xn)throw xn=0,Lc=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var va={};function rv(e,t,l,a){this.tag=e,this.key=l,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=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ht(e,t,l,a){return new rv(e,t,l,a)}function qi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Kt(e,t){var l=e.alternate;return l===null?(l=ht(e.tag,t,e.key,e.mode),l.elementType=e.elementType,l.type=e.type,l.stateNode=e.stateNode,l.alternate=e,e.alternate=l):(l.pendingProps=t,l.type=e.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=e.flags&65011712,l.childLanes=e.childLanes,l.lanes=e.lanes,l.child=e.child,l.memoizedProps=e.memoizedProps,l.memoizedState=e.memoizedState,l.updateQueue=e.updateQueue,t=e.dependencies,l.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},l.sibling=e.sibling,l.index=e.index,l.ref=e.ref,l.refCleanup=e.refCleanup,l}function qs(e,t){e.flags&=65011714;var l=e.alternate;return l===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=l.childLanes,e.lanes=l.lanes,e.child=l.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=l.memoizedProps,e.memoizedState=l.memoizedState,e.updateQueue=l.updateQueue,e.type=l.type,t=l.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function iu(e,t,l,a,n,u){var i=0;if(a=e,typeof e=="function")qi(e)&&(i=1);else if(typeof e=="string")i=gm(e,l,Y.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case et:return e=ht(31,l,t,n),e.elementType=et,e.lanes=u,e;case q:return Gl(l.children,n,u,t);case Ee:i=8,n|=24;break;case $:return e=ht(12,l,t,n|2),e.elementType=$,e.lanes=u,e;case ft:return e=ht(13,l,t,n),e.elementType=ft,e.lanes=u,e;case we:return e=ht(19,l,t,n),e.elementType=we,e.lanes=u,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case _e:i=10;break e;case Pe:i=9;break e;case Ne:i=11;break e;case P:i=14;break e;case ve:i=16,a=null;break e}i=29,l=Error(o(130,e===null?"null":typeof e,"")),a=null}return t=ht(i,l,t,n),t.elementType=e,t.type=a,t.lanes=u,t}function Gl(e,t,l,a){return e=ht(7,e,a,t),e.lanes=l,e}function Bi(e,t,l){return e=ht(6,e,null,t),e.lanes=l,e}function Bs(e){var t=ht(18,null,null,0);return t.stateNode=e,t}function Yi(e,t,l){return t=ht(4,e.children!==null?e.children:[],e.key,t),t.lanes=l,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Ys=new WeakMap;function Et(e,t){if(typeof e=="object"&&e!==null){var l=Ys.get(e);return l!==void 0?l:(t={value:e,source:t,stack:Gn(t)},Ys.set(e,t),t)}return{value:e,source:t,stack:Gn(t)}}var ma=[],ya=0,cu=null,an=0,zt=[],At=0,ol=null,Bt=1,Yt="";function Vt(e,t){ma[ya++]=an,ma[ya++]=cu,cu=e,an=t}function ws(e,t,l){zt[At++]=Bt,zt[At++]=Yt,zt[At++]=ol,ol=e;var a=Bt;e=Yt;var n=32-dt(a)-1;a&=~(1<<n),l+=1;var u=32-dt(t)+n;if(30<u){var i=n-n%5;u=(a&(1<<i)-1).toString(32),a>>=i,n-=i,Bt=1<<32-dt(t)+n|l<<n|a,Yt=u+e}else Bt=1<<u|l<<n|a,Yt=e}function wi(e){e.return!==null&&(Vt(e,1),ws(e,1,0))}function Gi(e){for(;e===cu;)cu=ma[--ya],ma[ya]=null,an=ma[--ya],ma[ya]=null;for(;e===ol;)ol=zt[--At],zt[At]=null,Yt=zt[--At],zt[At]=null,Bt=zt[--At],zt[At]=null}function Gs(e,t){zt[At++]=Bt,zt[At++]=Yt,zt[At++]=ol,Bt=t.id,Yt=t.overflow,ol=e}var Ve=null,ze=null,ce=!1,dl=null,xt=!1,Xi=Error(o(519));function rl(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw nn(Et(t,e)),Xi}function Xs(e){var t=e.stateNode,l=e.type,a=e.memoizedProps;switch(t[Ke]=e,t[tt]=a,l){case"dialog":ae("cancel",t),ae("close",t);break;case"iframe":case"object":case"embed":ae("load",t);break;case"video":case"audio":for(l=0;l<_n.length;l++)ae(_n[l],t);break;case"source":ae("error",t);break;case"img":case"image":case"link":ae("error",t),ae("load",t);break;case"details":ae("toggle",t);break;case"input":ae("invalid",t),es(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":ae("invalid",t);break;case"textarea":ae("invalid",t),ls(t,a.value,a.defaultValue,a.children)}l=a.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||t.textContent===""+l||a.suppressHydrationWarning===!0||ur(t.textContent,l)?(a.popover!=null&&(ae("beforetoggle",t),ae("toggle",t)),a.onScroll!=null&&ae("scroll",t),a.onScrollEnd!=null&&ae("scrollend",t),a.onClick!=null&&(t.onclick=Zt),t=!0):t=!1,t||rl(e,!0)}function Qs(e){for(Ve=e.return;Ve;)switch(Ve.tag){case 5:case 31:case 13:xt=!1;return;case 27:case 3:xt=!0;return;default:Ve=Ve.return}}function ga(e){if(e!==Ve)return!1;if(!ce)return Qs(e),ce=!0,!1;var t=e.tag,l;if((l=t!==3&&t!==27)&&((l=t===5)&&(l=e.type,l=!(l!=="form"&&l!=="button")||uf(e.type,e.memoizedProps)),l=!l),l&&ze&&rl(e),Qs(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));ze=vr(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));ze=vr(e)}else t===27?(t=ze,jl(e.type)?(e=df,df=null,ze=e):ze=t):ze=Ve?_t(e.stateNode.nextSibling):null;return!0}function Xl(){ze=Ve=null,ce=!1}function Qi(){var e=dl;return e!==null&&(it===null?it=e:it.push.apply(it,e),dl=null),e}function nn(e){dl===null?dl=[e]:dl.push(e)}var Zi=m(null),Ql=null,Jt=null;function hl(e,t,l){B(Zi,t._currentValue),t._currentValue=l}function kt(e){e._currentValue=Zi.current,O(Zi)}function Li(e,t,l){for(;e!==null;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,a!==null&&(a.childLanes|=t)):a!==null&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===l)break;e=e.return}}function Ki(e,t,l,a){var n=e.child;for(n!==null&&(n.return=e);n!==null;){var u=n.dependencies;if(u!==null){var i=n.child;u=u.firstContext;e:for(;u!==null;){var f=u;u=n;for(var h=0;h<t.length;h++)if(f.context===t[h]){u.lanes|=l,f=u.alternate,f!==null&&(f.lanes|=l),Li(u.return,l,e),a||(i=null);break e}u=f.next}}else if(n.tag===18){if(i=n.return,i===null)throw Error(o(341));i.lanes|=l,u=i.alternate,u!==null&&(u.lanes|=l),Li(i,l,e),i=null}else i=n.child;if(i!==null)i.return=n;else for(i=n;i!==null;){if(i===e){i=null;break}if(n=i.sibling,n!==null){n.return=i.return,i=n;break}i=i.return}n=i}}function ba(e,t,l,a){e=null;for(var n=t,u=!1;n!==null;){if(!u){if((n.flags&524288)!==0)u=!0;else if((n.flags&262144)!==0)break}if(n.tag===10){var i=n.alternate;if(i===null)throw Error(o(387));if(i=i.memoizedProps,i!==null){var f=n.type;rt(n.pendingProps.value,i.value)||(e!==null?e.push(f):e=[f])}}else if(n===oe.current){if(i=n.alternate,i===null)throw Error(o(387));i.memoizedState.memoizedState!==n.memoizedState.memoizedState&&(e!==null?e.push(Dn):e=[Dn])}n=n.return}e!==null&&Ki(t,e,l,a),t.flags|=262144}function fu(e){for(e=e.firstContext;e!==null;){if(!rt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Zl(e){Ql=e,Jt=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Je(e){return Zs(Ql,e)}function su(e,t){return Ql===null&&Zl(e),Zs(e,t)}function Zs(e,t){var l=t._currentValue;if(t={context:t,memoizedValue:l,next:null},Jt===null){if(e===null)throw Error(o(308));Jt=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Jt=Jt.next=t;return l}var hv=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(l,a){e.push(a)}};this.abort=function(){t.aborted=!0,e.forEach(function(l){return l()})}},vv=c.unstable_scheduleCallback,mv=c.unstable_NormalPriority,He={$$typeof:_e,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Vi(){return{controller:new hv,data:new Map,refCount:0}}function un(e){e.refCount--,e.refCount===0&&vv(mv,function(){e.controller.abort()})}var cn=null,Ji=0,Sa=0,pa=null;function yv(e,t){if(cn===null){var l=cn=[];Ji=0,Sa=Wc(),pa={status:"pending",value:void 0,then:function(a){l.push(a)}}}return Ji++,t.then(Ls,Ls),t}function Ls(){if(--Ji===0&&cn!==null){pa!==null&&(pa.status="fulfilled");var e=cn;cn=null,Sa=0,pa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function gv(e,t){var l=[],a={status:"pending",value:null,reason:null,then:function(n){l.push(n)}};return e.then(function(){a.status="fulfilled",a.value=t;for(var n=0;n<l.length;n++)(0,l[n])(t)},function(n){for(a.status="rejected",a.reason=n,n=0;n<l.length;n++)(0,l[n])(void 0)}),a}var Ks=x.S;x.S=function(e,t){Od=Le(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&yv(e,t),Ks!==null&&Ks(e,t)};var Ll=m(null);function ki(){var e=Ll.current;return e!==null?e:Te.pooledCache}function ou(e,t){t===null?B(Ll,Ll.current):B(Ll,t.pool)}function Vs(){var e=ki();return e===null?null:{parent:He._currentValue,pool:e}}var Ta=Error(o(460)),$i=Error(o(474)),du=Error(o(542)),ru={then:function(){}};function Js(e){return e=e.status,e==="fulfilled"||e==="rejected"}function ks(e,t,l){switch(l=e[l],l===void 0?e.push(t):l!==t&&(t.then(Zt,Zt),t=l),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ws(e),e;default:if(typeof t.status=="string")t.then(Zt,Zt);else{if(e=Te,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(a){if(t.status==="pending"){var n=t;n.status="fulfilled",n.value=a}},function(a){if(t.status==="pending"){var n=t;n.status="rejected",n.reason=a}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ws(e),e}throw Vl=t,Ta}}function Kl(e){try{var t=e._init;return t(e._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(Vl=l,Ta):l}}var Vl=null;function $s(){if(Vl===null)throw Error(o(459));var e=Vl;return Vl=null,e}function Ws(e){if(e===Ta||e===du)throw Error(o(483))}var Ea=null,fn=0;function hu(e){var t=fn;return fn+=1,Ea===null&&(Ea=[]),ks(Ea,e,t)}function sn(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function vu(e,t){throw t.$$typeof===U?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Fs(e){function t(y,v){if(e){var b=y.deletions;b===null?(y.deletions=[v],y.flags|=16):b.push(v)}}function l(y,v){if(!e)return null;for(;v!==null;)t(y,v),v=v.sibling;return null}function a(y){for(var v=new Map;y!==null;)y.key!==null?v.set(y.key,y):v.set(y.index,y),y=y.sibling;return v}function n(y,v){return y=Kt(y,v),y.index=0,y.sibling=null,y}function u(y,v,b){return y.index=b,e?(b=y.alternate,b!==null?(b=b.index,b<v?(y.flags|=67108866,v):b):(y.flags|=67108866,v)):(y.flags|=1048576,v)}function i(y){return e&&y.alternate===null&&(y.flags|=67108866),y}function f(y,v,b,_){return v===null||v.tag!==6?(v=Bi(b,y.mode,_),v.return=y,v):(v=n(v,b),v.return=y,v)}function h(y,v,b,_){var Z=b.type;return Z===q?A(y,v,b.props.children,_,b.key):v!==null&&(v.elementType===Z||typeof Z=="object"&&Z!==null&&Z.$$typeof===ve&&Kl(Z)===v.type)?(v=n(v,b.props),sn(v,b),v.return=y,v):(v=iu(b.type,b.key,b.props,null,y.mode,_),sn(v,b),v.return=y,v)}function S(y,v,b,_){return v===null||v.tag!==4||v.stateNode.containerInfo!==b.containerInfo||v.stateNode.implementation!==b.implementation?(v=Yi(b,y.mode,_),v.return=y,v):(v=n(v,b.children||[]),v.return=y,v)}function A(y,v,b,_,Z){return v===null||v.tag!==7?(v=Gl(b,y.mode,_,Z),v.return=y,v):(v=n(v,b),v.return=y,v)}function N(y,v,b){if(typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint")return v=Bi(""+v,y.mode,b),v.return=y,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case J:return b=iu(v.type,v.key,v.props,null,y.mode,b),sn(b,v),b.return=y,b;case W:return v=Yi(v,y.mode,b),v.return=y,v;case ve:return v=Kl(v),N(y,v,b)}if(st(v)||Ge(v))return v=Gl(v,y.mode,b,null),v.return=y,v;if(typeof v.then=="function")return N(y,hu(v),b);if(v.$$typeof===_e)return N(y,su(y,v),b);vu(y,v)}return null}function p(y,v,b,_){var Z=v!==null?v.key:null;if(typeof b=="string"&&b!==""||typeof b=="number"||typeof b=="bigint")return Z!==null?null:f(y,v,""+b,_);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case J:return b.key===Z?h(y,v,b,_):null;case W:return b.key===Z?S(y,v,b,_):null;case ve:return b=Kl(b),p(y,v,b,_)}if(st(b)||Ge(b))return Z!==null?null:A(y,v,b,_,null);if(typeof b.then=="function")return p(y,v,hu(b),_);if(b.$$typeof===_e)return p(y,v,su(y,b),_);vu(y,b)}return null}function T(y,v,b,_,Z){if(typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint")return y=y.get(b)||null,f(v,y,""+_,Z);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case J:return y=y.get(_.key===null?b:_.key)||null,h(v,y,_,Z);case W:return y=y.get(_.key===null?b:_.key)||null,S(v,y,_,Z);case ve:return _=Kl(_),T(y,v,b,_,Z)}if(st(_)||Ge(_))return y=y.get(b)||null,A(v,y,_,Z,null);if(typeof _.then=="function")return T(y,v,b,hu(_),Z);if(_.$$typeof===_e)return T(y,v,b,su(v,_),Z);vu(v,_)}return null}function G(y,v,b,_){for(var Z=null,re=null,X=v,te=v=0,ue=null;X!==null&&te<b.length;te++){X.index>te?(ue=X,X=null):ue=X.sibling;var he=p(y,X,b[te],_);if(he===null){X===null&&(X=ue);break}e&&X&&he.alternate===null&&t(y,X),v=u(he,v,te),re===null?Z=he:re.sibling=he,re=he,X=ue}if(te===b.length)return l(y,X),ce&&Vt(y,te),Z;if(X===null){for(;te<b.length;te++)X=N(y,b[te],_),X!==null&&(v=u(X,v,te),re===null?Z=X:re.sibling=X,re=X);return ce&&Vt(y,te),Z}for(X=a(X);te<b.length;te++)ue=T(X,y,te,b[te],_),ue!==null&&(e&&ue.alternate!==null&&X.delete(ue.key===null?te:ue.key),v=u(ue,v,te),re===null?Z=ue:re.sibling=ue,re=ue);return e&&X.forEach(function(Ul){return t(y,Ul)}),ce&&Vt(y,te),Z}function K(y,v,b,_){if(b==null)throw Error(o(151));for(var Z=null,re=null,X=v,te=v=0,ue=null,he=b.next();X!==null&&!he.done;te++,he=b.next()){X.index>te?(ue=X,X=null):ue=X.sibling;var Ul=p(y,X,he.value,_);if(Ul===null){X===null&&(X=ue);break}e&&X&&Ul.alternate===null&&t(y,X),v=u(Ul,v,te),re===null?Z=Ul:re.sibling=Ul,re=Ul,X=ue}if(he.done)return l(y,X),ce&&Vt(y,te),Z;if(X===null){for(;!he.done;te++,he=b.next())he=N(y,he.value,_),he!==null&&(v=u(he,v,te),re===null?Z=he:re.sibling=he,re=he);return ce&&Vt(y,te),Z}for(X=a(X);!he.done;te++,he=b.next())he=T(X,y,te,he.value,_),he!==null&&(e&&he.alternate!==null&&X.delete(he.key===null?te:he.key),v=u(he,v,te),re===null?Z=he:re.sibling=he,re=he);return e&&X.forEach(function(Nm){return t(y,Nm)}),ce&&Vt(y,te),Z}function pe(y,v,b,_){if(typeof b=="object"&&b!==null&&b.type===q&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case J:e:{for(var Z=b.key;v!==null;){if(v.key===Z){if(Z=b.type,Z===q){if(v.tag===7){l(y,v.sibling),_=n(v,b.props.children),_.return=y,y=_;break e}}else if(v.elementType===Z||typeof Z=="object"&&Z!==null&&Z.$$typeof===ve&&Kl(Z)===v.type){l(y,v.sibling),_=n(v,b.props),sn(_,b),_.return=y,y=_;break e}l(y,v);break}else t(y,v);v=v.sibling}b.type===q?(_=Gl(b.props.children,y.mode,_,b.key),_.return=y,y=_):(_=iu(b.type,b.key,b.props,null,y.mode,_),sn(_,b),_.return=y,y=_)}return i(y);case W:e:{for(Z=b.key;v!==null;){if(v.key===Z)if(v.tag===4&&v.stateNode.containerInfo===b.containerInfo&&v.stateNode.implementation===b.implementation){l(y,v.sibling),_=n(v,b.children||[]),_.return=y,y=_;break e}else{l(y,v);break}else t(y,v);v=v.sibling}_=Yi(b,y.mode,_),_.return=y,y=_}return i(y);case ve:return b=Kl(b),pe(y,v,b,_)}if(st(b))return G(y,v,b,_);if(Ge(b)){if(Z=Ge(b),typeof Z!="function")throw Error(o(150));return b=Z.call(b),K(y,v,b,_)}if(typeof b.then=="function")return pe(y,v,hu(b),_);if(b.$$typeof===_e)return pe(y,v,su(y,b),_);vu(y,b)}return typeof b=="string"&&b!==""||typeof b=="number"||typeof b=="bigint"?(b=""+b,v!==null&&v.tag===6?(l(y,v.sibling),_=n(v,b),_.return=y,y=_):(l(y,v),_=Bi(b,y.mode,_),_.return=y,y=_),i(y)):l(y,v)}return function(y,v,b,_){try{fn=0;var Z=pe(y,v,b,_);return Ea=null,Z}catch(X){if(X===Ta||X===du)throw X;var re=ht(29,X,null,y.mode);return re.lanes=_,re.return=y,re}finally{}}}var Jl=Fs(!0),Is=Fs(!1),vl=!1;function Wi(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Fi(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 ml(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function yl(e,t,l){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(me&2)!==0){var n=a.pending;return n===null?t.next=t:(t.next=n.next,n.next=t),a.pending=t,t=uu(e),Hs(e,null,l),t}return nu(e,a,t,l),uu(e)}function on(e,t,l){if(t=t.updateQueue,t!==null&&(t=t.shared,(l&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,l|=a,t.lanes=l,Zf(e,l)}}function Ii(e,t){var l=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,l===a)){var n=null,u=null;if(l=l.firstBaseUpdate,l!==null){do{var i={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};u===null?n=u=i:u=u.next=i,l=l.next}while(l!==null);u===null?n=u=t:u=u.next=t}else n=u=t;l={baseState:a.baseState,firstBaseUpdate:n,lastBaseUpdate:u,shared:a.shared,callbacks:a.callbacks},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=t:e.next=t,l.lastBaseUpdate=t}var Pi=!1;function dn(){if(Pi){var e=pa;if(e!==null)throw e}}function rn(e,t,l,a){Pi=!1;var n=e.updateQueue;vl=!1;var u=n.firstBaseUpdate,i=n.lastBaseUpdate,f=n.shared.pending;if(f!==null){n.shared.pending=null;var h=f,S=h.next;h.next=null,i===null?u=S:i.next=S,i=h;var A=e.alternate;A!==null&&(A=A.updateQueue,f=A.lastBaseUpdate,f!==i&&(f===null?A.firstBaseUpdate=S:f.next=S,A.lastBaseUpdate=h))}if(u!==null){var N=n.baseState;i=0,A=S=h=null,f=u;do{var p=f.lane&-536870913,T=p!==f.lane;if(T?(ne&p)===p:(a&p)===p){p!==0&&p===Sa&&(Pi=!0),A!==null&&(A=A.next={lane:0,tag:f.tag,payload:f.payload,callback:null,next:null});e:{var G=e,K=f;p=t;var pe=l;switch(K.tag){case 1:if(G=K.payload,typeof G=="function"){N=G.call(pe,N,p);break e}N=G;break e;case 3:G.flags=G.flags&-65537|128;case 0:if(G=K.payload,p=typeof G=="function"?G.call(pe,N,p):G,p==null)break e;N=E({},N,p);break e;case 2:vl=!0}}p=f.callback,p!==null&&(e.flags|=64,T&&(e.flags|=8192),T=n.callbacks,T===null?n.callbacks=[p]:T.push(p))}else T={lane:p,tag:f.tag,payload:f.payload,callback:f.callback,next:null},A===null?(S=A=T,h=N):A=A.next=T,i|=p;if(f=f.next,f===null){if(f=n.shared.pending,f===null)break;T=f,f=T.next,T.next=null,n.lastBaseUpdate=T,n.shared.pending=null}}while(!0);A===null&&(h=N),n.baseState=h,n.firstBaseUpdate=S,n.lastBaseUpdate=A,u===null&&(n.shared.lanes=0),Tl|=i,e.lanes=i,e.memoizedState=N}}function Ps(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function eo(e,t){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;e<l.length;e++)Ps(l[e],t)}var za=m(null),mu=m(0);function to(e,t){e=al,B(mu,e),B(za,t),al=e|t.baseLanes}function ec(){B(mu,al),B(za,za.current)}function tc(){al=mu.current,O(za),O(mu)}var vt=m(null),jt=null;function gl(e){var t=e.alternate;B(De,De.current&1),B(vt,e),jt===null&&(t===null||za.current!==null||t.memoizedState!==null)&&(jt=e)}function lc(e){B(De,De.current),B(vt,e),jt===null&&(jt=e)}function lo(e){e.tag===22?(B(De,De.current),B(vt,e),jt===null&&(jt=e)):bl()}function bl(){B(De,De.current),B(vt,vt.current)}function mt(e){O(vt),jt===e&&(jt=null),O(De)}var De=m(0);function yu(e){for(var t=e;t!==null;){if(t.tag===13){var l=t.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||sf(l)||of(l)))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 $t=0,ee=null,be=null,qe=null,gu=!1,Aa=!1,kl=!1,bu=0,hn=0,xa=null,bv=0;function Me(){throw Error(o(321))}function ac(e,t){if(t===null)return!1;for(var l=0;l<t.length&&l<e.length;l++)if(!rt(e[l],t[l]))return!1;return!0}function nc(e,t,l,a,n,u){return $t=u,ee=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,x.H=e===null||e.memoizedState===null?Go:Sc,kl=!1,u=l(a,n),kl=!1,Aa&&(u=no(t,l,a,n)),ao(e),u}function ao(e){x.H=yn;var t=be!==null&&be.next!==null;if($t=0,qe=be=ee=null,gu=!1,hn=0,xa=null,t)throw Error(o(300));e===null||Be||(e=e.dependencies,e!==null&&fu(e)&&(Be=!0))}function no(e,t,l,a){ee=e;var n=0;do{if(Aa&&(xa=null),hn=0,Aa=!1,25<=n)throw Error(o(301));if(n+=1,qe=be=null,e.updateQueue!=null){var u=e.updateQueue;u.lastEffect=null,u.events=null,u.stores=null,u.memoCache!=null&&(u.memoCache.index=0)}x.H=Xo,u=t(l,a)}while(Aa);return u}function Sv(){var e=x.H,t=e.useState()[0];return t=typeof t.then=="function"?vn(t):t,e=e.useState()[0],(be!==null?be.memoizedState:null)!==e&&(ee.flags|=1024),t}function uc(){var e=bu!==0;return bu=0,e}function ic(e,t,l){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l}function cc(e){if(gu){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}gu=!1}$t=0,qe=be=ee=null,Aa=!1,hn=bu=0,xa=null}function Ie(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return qe===null?ee.memoizedState=qe=e:qe=qe.next=e,qe}function Ce(){if(be===null){var e=ee.alternate;e=e!==null?e.memoizedState:null}else e=be.next;var t=qe===null?ee.memoizedState:qe.next;if(t!==null)qe=t,be=e;else{if(e===null)throw ee.alternate===null?Error(o(467)):Error(o(310));be=e,e={memoizedState:be.memoizedState,baseState:be.baseState,baseQueue:be.baseQueue,queue:be.queue,next:null},qe===null?ee.memoizedState=qe=e:qe=qe.next=e}return qe}function Su(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function vn(e){var t=hn;return hn+=1,xa===null&&(xa=[]),e=ks(xa,e,t),t=ee,(qe===null?t.memoizedState:qe.next)===null&&(t=t.alternate,x.H=t===null||t.memoizedState===null?Go:Sc),e}function pu(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return vn(e);if(e.$$typeof===_e)return Je(e)}throw Error(o(438,String(e)))}function fc(e){var t=null,l=ee.updateQueue;if(l!==null&&(t=l.memoCache),t==null){var a=ee.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(t={data:a.data.map(function(n){return n.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),l===null&&(l=Su(),ee.updateQueue=l),l.memoCache=t,l=t.data[t.index],l===void 0)for(l=t.data[t.index]=Array(e),a=0;a<e;a++)l[a]=Ht;return t.index++,l}function Wt(e,t){return typeof t=="function"?t(e):t}function Tu(e){var t=Ce();return sc(t,be,e)}function sc(e,t,l){var a=e.queue;if(a===null)throw Error(o(311));a.lastRenderedReducer=l;var n=e.baseQueue,u=a.pending;if(u!==null){if(n!==null){var i=n.next;n.next=u.next,u.next=i}t.baseQueue=n=u,a.pending=null}if(u=e.baseState,n===null)e.memoizedState=u;else{t=n.next;var f=i=null,h=null,S=t,A=!1;do{var N=S.lane&-536870913;if(N!==S.lane?(ne&N)===N:($t&N)===N){var p=S.revertLane;if(p===0)h!==null&&(h=h.next={lane:0,revertLane:0,gesture:null,action:S.action,hasEagerState:S.hasEagerState,eagerState:S.eagerState,next:null}),N===Sa&&(A=!0);else if(($t&p)===p){S=S.next,p===Sa&&(A=!0);continue}else N={lane:0,revertLane:S.revertLane,gesture:null,action:S.action,hasEagerState:S.hasEagerState,eagerState:S.eagerState,next:null},h===null?(f=h=N,i=u):h=h.next=N,ee.lanes|=p,Tl|=p;N=S.action,kl&&l(u,N),u=S.hasEagerState?S.eagerState:l(u,N)}else p={lane:N,revertLane:S.revertLane,gesture:S.gesture,action:S.action,hasEagerState:S.hasEagerState,eagerState:S.eagerState,next:null},h===null?(f=h=p,i=u):h=h.next=p,ee.lanes|=N,Tl|=N;S=S.next}while(S!==null&&S!==t);if(h===null?i=u:h.next=f,!rt(u,e.memoizedState)&&(Be=!0,A&&(l=pa,l!==null)))throw l;e.memoizedState=u,e.baseState=i,e.baseQueue=h,a.lastRenderedState=u}return n===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function oc(e){var t=Ce(),l=t.queue;if(l===null)throw Error(o(311));l.lastRenderedReducer=e;var a=l.dispatch,n=l.pending,u=t.memoizedState;if(n!==null){l.pending=null;var i=n=n.next;do u=e(u,i.action),i=i.next;while(i!==n);rt(u,t.memoizedState)||(Be=!0),t.memoizedState=u,t.baseQueue===null&&(t.baseState=u),l.lastRenderedState=u}return[u,a]}function uo(e,t,l){var a=ee,n=Ce(),u=ce;if(u){if(l===void 0)throw Error(o(407));l=l()}else l=t();var i=!rt((be||n).memoizedState,l);if(i&&(n.memoizedState=l,Be=!0),n=n.queue,hc(fo.bind(null,a,n,e),[e]),n.getSnapshot!==t||i||qe!==null&&qe.memoizedState.tag&1){if(a.flags|=2048,ja(9,{destroy:void 0},co.bind(null,a,n,l,t),null),Te===null)throw Error(o(349));u||($t&127)!==0||io(a,t,l)}return l}function io(e,t,l){e.flags|=16384,e={getSnapshot:t,value:l},t=ee.updateQueue,t===null?(t=Su(),ee.updateQueue=t,t.stores=[e]):(l=t.stores,l===null?t.stores=[e]:l.push(e))}function co(e,t,l,a){t.value=l,t.getSnapshot=a,so(t)&&oo(e)}function fo(e,t,l){return l(function(){so(t)&&oo(e)})}function so(e){var t=e.getSnapshot;e=e.value;try{var l=t();return!rt(e,l)}catch{return!0}}function oo(e){var t=wl(e,2);t!==null&&ct(t,e,2)}function dc(e){var t=Ie();if(typeof e=="function"){var l=e;if(e=l(),kl){cl(!0);try{l()}finally{cl(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wt,lastRenderedState:e},t}function ro(e,t,l,a){return e.baseState=l,sc(e,be,typeof a=="function"?a:Wt)}function pv(e,t,l,a,n){if(Au(e))throw Error(o(485));if(e=t.action,e!==null){var u={payload:n,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(i){u.listeners.push(i)}};x.T!==null?l(!0):u.isTransition=!1,a(u),l=t.pending,l===null?(u.next=t.pending=u,ho(t,u)):(u.next=l.next,t.pending=l.next=u)}}function ho(e,t){var l=t.action,a=t.payload,n=e.state;if(t.isTransition){var u=x.T,i={};x.T=i;try{var f=l(n,a),h=x.S;h!==null&&h(i,f),vo(e,t,f)}catch(S){rc(e,t,S)}finally{u!==null&&i.types!==null&&(u.types=i.types),x.T=u}}else try{u=l(n,a),vo(e,t,u)}catch(S){rc(e,t,S)}}function vo(e,t,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(a){mo(e,t,a)},function(a){return rc(e,t,a)}):mo(e,t,l)}function mo(e,t,l){t.status="fulfilled",t.value=l,yo(t),e.state=l,t=e.pending,t!==null&&(l=t.next,l===t?e.pending=null:(l=l.next,t.next=l,ho(e,l)))}function rc(e,t,l){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=l,yo(t),t=t.next;while(t!==a)}e.action=null}function yo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function go(e,t){return t}function bo(e,t){if(ce){var l=Te.formState;if(l!==null){e:{var a=ee;if(ce){if(ze){t:{for(var n=ze,u=xt;n.nodeType!==8;){if(!u){n=null;break t}if(n=_t(n.nextSibling),n===null){n=null;break t}}u=n.data,n=u==="F!"||u==="F"?n:null}if(n){ze=_t(n.nextSibling),a=n.data==="F!";break e}}rl(a)}a=!1}a&&(t=l[0])}}return l=Ie(),l.memoizedState=l.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:go,lastRenderedState:t},l.queue=a,l=Bo.bind(null,ee,a),a.dispatch=l,a=dc(!1),u=bc.bind(null,ee,!1,a.queue),a=Ie(),n={state:t,dispatch:null,action:e,pending:null},a.queue=n,l=pv.bind(null,ee,n,u,l),n.dispatch=l,a.memoizedState=e,[t,l,!1]}function So(e){var t=Ce();return po(t,be,e)}function po(e,t,l){if(t=sc(e,t,go)[0],e=Tu(Wt)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=vn(t)}catch(i){throw i===Ta?du:i}else a=t;t=Ce();var n=t.queue,u=n.dispatch;return l!==t.memoizedState&&(ee.flags|=2048,ja(9,{destroy:void 0},Tv.bind(null,n,l),null)),[a,u,e]}function Tv(e,t){e.action=t}function To(e){var t=Ce(),l=be;if(l!==null)return po(t,l,e);Ce(),t=t.memoizedState,l=Ce();var a=l.queue.dispatch;return l.memoizedState=e,[t,a,!1]}function ja(e,t,l,a){return e={tag:e,create:l,deps:a,inst:t,next:null},t=ee.updateQueue,t===null&&(t=Su(),ee.updateQueue=t),l=t.lastEffect,l===null?t.lastEffect=e.next=e:(a=l.next,l.next=e,e.next=a,t.lastEffect=e),e}function Eo(){return Ce().memoizedState}function Eu(e,t,l,a){var n=Ie();ee.flags|=e,n.memoizedState=ja(1|t,{destroy:void 0},l,a===void 0?null:a)}function zu(e,t,l,a){var n=Ce();a=a===void 0?null:a;var u=n.memoizedState.inst;be!==null&&a!==null&&ac(a,be.memoizedState.deps)?n.memoizedState=ja(t,u,l,a):(ee.flags|=e,n.memoizedState=ja(1|t,u,l,a))}function zo(e,t){Eu(8390656,8,e,t)}function hc(e,t){zu(2048,8,e,t)}function Ev(e){ee.flags|=4;var t=ee.updateQueue;if(t===null)t=Su(),ee.updateQueue=t,t.events=[e];else{var l=t.events;l===null?t.events=[e]:l.push(e)}}function Ao(e){var t=Ce().memoizedState;return Ev({ref:t,nextImpl:e}),function(){if((me&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function xo(e,t){return zu(4,2,e,t)}function jo(e,t){return zu(4,4,e,t)}function _o(e,t){if(typeof t=="function"){e=e();var l=t(e);return function(){typeof l=="function"?l():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function No(e,t,l){l=l!=null?l.concat([e]):null,zu(4,4,_o.bind(null,t,e),l)}function vc(){}function Oo(e,t){var l=Ce();t=t===void 0?null:t;var a=l.memoizedState;return t!==null&&ac(t,a[1])?a[0]:(l.memoizedState=[e,t],e)}function Mo(e,t){var l=Ce();t=t===void 0?null:t;var a=l.memoizedState;if(t!==null&&ac(t,a[1]))return a[0];if(a=e(),kl){cl(!0);try{e()}finally{cl(!1)}}return l.memoizedState=[a,t],a}function mc(e,t,l){return l===void 0||($t&1073741824)!==0&&(ne&261930)===0?e.memoizedState=t:(e.memoizedState=l,e=Ud(),ee.lanes|=e,Tl|=e,l)}function Uo(e,t,l,a){return rt(l,t)?l:za.current!==null?(e=mc(e,l,a),rt(e,t)||(Be=!0),e):($t&42)===0||($t&1073741824)!==0&&(ne&261930)===0?(Be=!0,e.memoizedState=l):(e=Ud(),ee.lanes|=e,Tl|=e,t)}function Do(e,t,l,a,n){var u=R.p;R.p=u!==0&&8>u?u:8;var i=x.T,f={};x.T=f,bc(e,!1,t,l);try{var h=n(),S=x.S;if(S!==null&&S(f,h),h!==null&&typeof h=="object"&&typeof h.then=="function"){var A=gv(h,a);mn(e,t,A,bt(e))}else mn(e,t,a,bt(e))}catch(N){mn(e,t,{then:function(){},status:"rejected",reason:N},bt())}finally{R.p=u,i!==null&&f.types!==null&&(i.types=f.types),x.T=i}}function zv(){}function yc(e,t,l,a){if(e.tag!==5)throw Error(o(476));var n=Co(e).queue;Do(e,n,t,V,l===null?zv:function(){return Ro(e),l(a)})}function Co(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:V,baseState:V,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wt,lastRenderedState:V},next:null};var l={};return t.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wt,lastRenderedState:l},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ro(e){var t=Co(e);t.next===null&&(t=e.alternate.memoizedState),mn(e,t.next.queue,{},bt())}function gc(){return Je(Dn)}function Ho(){return Ce().memoizedState}function qo(){return Ce().memoizedState}function Av(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var l=bt();e=ml(l);var a=yl(t,e,l);a!==null&&(ct(a,t,l),on(a,t,l)),t={cache:Vi()},e.payload=t;return}t=t.return}}function xv(e,t,l){var a=bt();l={lane:a,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Au(e)?Yo(t,l):(l=Hi(e,t,l,a),l!==null&&(ct(l,e,a),wo(l,t,a)))}function Bo(e,t,l){var a=bt();mn(e,t,l,a)}function mn(e,t,l,a){var n={lane:a,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(Au(e))Yo(t,n);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var i=t.lastRenderedState,f=u(i,l);if(n.hasEagerState=!0,n.eagerState=f,rt(f,i))return nu(e,t,n,0),Te===null&&au(),!1}catch{}finally{}if(l=Hi(e,t,n,a),l!==null)return ct(l,e,a),wo(l,t,a),!0}return!1}function bc(e,t,l,a){if(a={lane:2,revertLane:Wc(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Au(e)){if(t)throw Error(o(479))}else t=Hi(e,l,a,2),t!==null&&ct(t,e,2)}function Au(e){var t=e.alternate;return e===ee||t!==null&&t===ee}function Yo(e,t){Aa=gu=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function wo(e,t,l){if((l&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,l|=a,t.lanes=l,Zf(e,l)}}var yn={readContext:Je,use:pu,useCallback:Me,useContext:Me,useEffect:Me,useImperativeHandle:Me,useLayoutEffect:Me,useInsertionEffect:Me,useMemo:Me,useReducer:Me,useRef:Me,useState:Me,useDebugValue:Me,useDeferredValue:Me,useTransition:Me,useSyncExternalStore:Me,useId:Me,useHostTransitionStatus:Me,useFormState:Me,useActionState:Me,useOptimistic:Me,useMemoCache:Me,useCacheRefresh:Me};yn.useEffectEvent=Me;var Go={readContext:Je,use:pu,useCallback:function(e,t){return Ie().memoizedState=[e,t===void 0?null:t],e},useContext:Je,useEffect:zo,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,Eu(4194308,4,_o.bind(null,t,e),l)},useLayoutEffect:function(e,t){return Eu(4194308,4,e,t)},useInsertionEffect:function(e,t){Eu(4,2,e,t)},useMemo:function(e,t){var l=Ie();t=t===void 0?null:t;var a=e();if(kl){cl(!0);try{e()}finally{cl(!1)}}return l.memoizedState=[a,t],a},useReducer:function(e,t,l){var a=Ie();if(l!==void 0){var n=l(t);if(kl){cl(!0);try{l(t)}finally{cl(!1)}}}else n=t;return a.memoizedState=a.baseState=n,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},a.queue=e,e=e.dispatch=xv.bind(null,ee,e),[a.memoizedState,e]},useRef:function(e){var t=Ie();return e={current:e},t.memoizedState=e},useState:function(e){e=dc(e);var t=e.queue,l=Bo.bind(null,ee,t);return t.dispatch=l,[e.memoizedState,l]},useDebugValue:vc,useDeferredValue:function(e,t){var l=Ie();return mc(l,e,t)},useTransition:function(){var e=dc(!1);return e=Do.bind(null,ee,e.queue,!0,!1),Ie().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,l){var a=ee,n=Ie();if(ce){if(l===void 0)throw Error(o(407));l=l()}else{if(l=t(),Te===null)throw Error(o(349));(ne&127)!==0||io(a,t,l)}n.memoizedState=l;var u={value:l,getSnapshot:t};return n.queue=u,zo(fo.bind(null,a,u,e),[e]),a.flags|=2048,ja(9,{destroy:void 0},co.bind(null,a,u,l,t),null),l},useId:function(){var e=Ie(),t=Te.identifierPrefix;if(ce){var l=Yt,a=Bt;l=(a&~(1<<32-dt(a)-1)).toString(32)+l,t="_"+t+"R_"+l,l=bu++,0<l&&(t+="H"+l.toString(32)),t+="_"}else l=bv++,t="_"+t+"r_"+l.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:gc,useFormState:bo,useActionState:bo,useOptimistic:function(e){var t=Ie();t.memoizedState=t.baseState=e;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=l,t=bc.bind(null,ee,!0,l),l.dispatch=t,[e,t]},useMemoCache:fc,useCacheRefresh:function(){return Ie().memoizedState=Av.bind(null,ee)},useEffectEvent:function(e){var t=Ie(),l={impl:e};return t.memoizedState=l,function(){if((me&2)!==0)throw Error(o(440));return l.impl.apply(void 0,arguments)}}},Sc={readContext:Je,use:pu,useCallback:Oo,useContext:Je,useEffect:hc,useImperativeHandle:No,useInsertionEffect:xo,useLayoutEffect:jo,useMemo:Mo,useReducer:Tu,useRef:Eo,useState:function(){return Tu(Wt)},useDebugValue:vc,useDeferredValue:function(e,t){var l=Ce();return Uo(l,be.memoizedState,e,t)},useTransition:function(){var e=Tu(Wt)[0],t=Ce().memoizedState;return[typeof e=="boolean"?e:vn(e),t]},useSyncExternalStore:uo,useId:Ho,useHostTransitionStatus:gc,useFormState:So,useActionState:So,useOptimistic:function(e,t){var l=Ce();return ro(l,be,e,t)},useMemoCache:fc,useCacheRefresh:qo};Sc.useEffectEvent=Ao;var Xo={readContext:Je,use:pu,useCallback:Oo,useContext:Je,useEffect:hc,useImperativeHandle:No,useInsertionEffect:xo,useLayoutEffect:jo,useMemo:Mo,useReducer:oc,useRef:Eo,useState:function(){return oc(Wt)},useDebugValue:vc,useDeferredValue:function(e,t){var l=Ce();return be===null?mc(l,e,t):Uo(l,be.memoizedState,e,t)},useTransition:function(){var e=oc(Wt)[0],t=Ce().memoizedState;return[typeof e=="boolean"?e:vn(e),t]},useSyncExternalStore:uo,useId:Ho,useHostTransitionStatus:gc,useFormState:To,useActionState:To,useOptimistic:function(e,t){var l=Ce();return be!==null?ro(l,be,e,t):(l.baseState=e,[e,l.queue.dispatch])},useMemoCache:fc,useCacheRefresh:qo};Xo.useEffectEvent=Ao;function pc(e,t,l,a){t=e.memoizedState,l=l(a,t),l=l==null?t:E({},t,l),e.memoizedState=l,e.lanes===0&&(e.updateQueue.baseState=l)}var Tc={enqueueSetState:function(e,t,l){e=e._reactInternals;var a=bt(),n=ml(a);n.payload=t,l!=null&&(n.callback=l),t=yl(e,n,a),t!==null&&(ct(t,e,a),on(t,e,a))},enqueueReplaceState:function(e,t,l){e=e._reactInternals;var a=bt(),n=ml(a);n.tag=1,n.payload=t,l!=null&&(n.callback=l),t=yl(e,n,a),t!==null&&(ct(t,e,a),on(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var l=bt(),a=ml(l);a.tag=2,t!=null&&(a.callback=t),t=yl(e,a,l),t!==null&&(ct(t,e,l),on(t,e,l))}};function Qo(e,t,l,a,n,u,i){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,u,i):t.prototype&&t.prototype.isPureReactComponent?!tn(l,a)||!tn(n,u):!0}function Zo(e,t,l,a){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(l,a),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(l,a),t.state!==e&&Tc.enqueueReplaceState(t,t.state,null)}function $l(e,t){var l=t;if("ref"in t){l={};for(var a in t)a!=="ref"&&(l[a]=t[a])}if(e=e.defaultProps){l===t&&(l=E({},l));for(var n in e)l[n]===void 0&&(l[n]=e[n])}return l}function Lo(e){lu(e)}function Ko(e){console.error(e)}function Vo(e){lu(e)}function xu(e,t){try{var l=e.onUncaughtError;l(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function Jo(e,t,l){try{var a=e.onCaughtError;a(l.value,{componentStack:l.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(n){setTimeout(function(){throw n})}}function Ec(e,t,l){return l=ml(l),l.tag=3,l.payload={element:null},l.callback=function(){xu(e,t)},l}function ko(e){return e=ml(e),e.tag=3,e}function $o(e,t,l,a){var n=l.type.getDerivedStateFromError;if(typeof n=="function"){var u=a.value;e.payload=function(){return n(u)},e.callback=function(){Jo(t,l,a)}}var i=l.stateNode;i!==null&&typeof i.componentDidCatch=="function"&&(e.callback=function(){Jo(t,l,a),typeof n!="function"&&(El===null?El=new Set([this]):El.add(this));var f=a.stack;this.componentDidCatch(a.value,{componentStack:f!==null?f:""})})}function jv(e,t,l,a,n){if(l.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=l.alternate,t!==null&&ba(t,l,n,!0),l=vt.current,l!==null){switch(l.tag){case 31:case 13:return jt===null?Bu():l.alternate===null&&Ue===0&&(Ue=3),l.flags&=-257,l.flags|=65536,l.lanes=n,a===ru?l.flags|=16384:(t=l.updateQueue,t===null?l.updateQueue=new Set([a]):t.add(a),Jc(e,a,n)),!1;case 22:return l.flags|=65536,a===ru?l.flags|=16384:(t=l.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([a])},l.updateQueue=t):(l=t.retryQueue,l===null?t.retryQueue=new Set([a]):l.add(a)),Jc(e,a,n)),!1}throw Error(o(435,l.tag))}return Jc(e,a,n),Bu(),!1}if(ce)return t=vt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=n,a!==Xi&&(e=Error(o(422),{cause:a}),nn(Et(e,l)))):(a!==Xi&&(t=Error(o(423),{cause:a}),nn(Et(t,l))),e=e.current.alternate,e.flags|=65536,n&=-n,e.lanes|=n,a=Et(a,l),n=Ec(e.stateNode,a,n),Ii(e,n),Ue!==4&&(Ue=2)),!1;var u=Error(o(520),{cause:a});if(u=Et(u,l),An===null?An=[u]:An.push(u),Ue!==4&&(Ue=2),t===null)return!0;a=Et(a,l),l=t;do{switch(l.tag){case 3:return l.flags|=65536,e=n&-n,l.lanes|=e,e=Ec(l.stateNode,a,e),Ii(l,e),!1;case 1:if(t=l.type,u=l.stateNode,(l.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||u!==null&&typeof u.componentDidCatch=="function"&&(El===null||!El.has(u))))return l.flags|=65536,n&=-n,l.lanes|=n,n=ko(n),$o(n,e,l,a),Ii(l,n),!1}l=l.return}while(l!==null);return!1}var zc=Error(o(461)),Be=!1;function ke(e,t,l,a){t.child=e===null?Is(t,null,l,a):Jl(t,e.child,l,a)}function Wo(e,t,l,a,n){l=l.render;var u=t.ref;if("ref"in a){var i={};for(var f in a)f!=="ref"&&(i[f]=a[f])}else i=a;return Zl(t),a=nc(e,t,l,i,u,n),f=uc(),e!==null&&!Be?(ic(e,t,n),Ft(e,t,n)):(ce&&f&&wi(t),t.flags|=1,ke(e,t,a,n),t.child)}function Fo(e,t,l,a,n){if(e===null){var u=l.type;return typeof u=="function"&&!qi(u)&&u.defaultProps===void 0&&l.compare===null?(t.tag=15,t.type=u,Io(e,t,u,a,n)):(e=iu(l.type,null,a,t,t.mode,n),e.ref=t.ref,e.return=t,t.child=e)}if(u=e.child,!Uc(e,n)){var i=u.memoizedProps;if(l=l.compare,l=l!==null?l:tn,l(i,a)&&e.ref===t.ref)return Ft(e,t,n)}return t.flags|=1,e=Kt(u,a),e.ref=t.ref,e.return=t,t.child=e}function Io(e,t,l,a,n){if(e!==null){var u=e.memoizedProps;if(tn(u,a)&&e.ref===t.ref)if(Be=!1,t.pendingProps=a=u,Uc(e,n))(e.flags&131072)!==0&&(Be=!0);else return t.lanes=e.lanes,Ft(e,t,n)}return Ac(e,t,l,a,n)}function Po(e,t,l,a){var n=a.children,u=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.mode==="hidden"){if((t.flags&128)!==0){if(u=u!==null?u.baseLanes|l:l,e!==null){for(a=t.child=e.child,n=0;a!==null;)n=n|a.lanes|a.childLanes,a=a.sibling;a=n&~u}else a=0,t.child=null;return ed(e,t,u,l,a)}if((l&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ou(t,u!==null?u.cachePool:null),u!==null?to(t,u):ec(),lo(t);else return a=t.lanes=536870912,ed(e,t,u!==null?u.baseLanes|l:l,l,a)}else u!==null?(ou(t,u.cachePool),to(t,u),bl(),t.memoizedState=null):(e!==null&&ou(t,null),ec(),bl());return ke(e,t,n,l),t.child}function gn(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function ed(e,t,l,a,n){var u=ki();return u=u===null?null:{parent:He._currentValue,pool:u},t.memoizedState={baseLanes:l,cachePool:u},e!==null&&ou(t,null),ec(),lo(t),e!==null&&ba(e,t,a,!0),t.childLanes=n,null}function ju(e,t){return t=Nu({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function td(e,t,l){return Jl(t,e.child,null,l),e=ju(t,t.pendingProps),e.flags|=2,mt(t),t.memoizedState=null,e}function _v(e,t,l){var a=t.pendingProps,n=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(ce){if(a.mode==="hidden")return e=ju(t,a),t.lanes=536870912,gn(null,e);if(lc(t),(e=ze)?(e=hr(e,xt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ol!==null?{id:Bt,overflow:Yt}:null,retryLane:536870912,hydrationErrors:null},l=Bs(e),l.return=t,t.child=l,Ve=t,ze=null)):e=null,e===null)throw rl(t);return t.lanes=536870912,null}return ju(t,a)}var u=e.memoizedState;if(u!==null){var i=u.dehydrated;if(lc(t),n)if(t.flags&256)t.flags&=-257,t=td(e,t,l);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(Be||ba(e,t,l,!1),n=(l&e.childLanes)!==0,Be||n){if(a=Te,a!==null&&(i=Lf(a,l),i!==0&&i!==u.retryLane))throw u.retryLane=i,wl(e,i),ct(a,e,i),zc;Bu(),t=td(e,t,l)}else e=u.treeContext,ze=_t(i.nextSibling),Ve=t,ce=!0,dl=null,xt=!1,e!==null&&Gs(t,e),t=ju(t,a),t.flags|=4096;return t}return e=Kt(e.child,{mode:a.mode,children:a.children}),e.ref=t.ref,t.child=e,e.return=t,e}function _u(e,t){var l=t.ref;if(l===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(o(284));(e===null||e.ref!==l)&&(t.flags|=4194816)}}function Ac(e,t,l,a,n){return Zl(t),l=nc(e,t,l,a,void 0,n),a=uc(),e!==null&&!Be?(ic(e,t,n),Ft(e,t,n)):(ce&&a&&wi(t),t.flags|=1,ke(e,t,l,n),t.child)}function ld(e,t,l,a,n,u){return Zl(t),t.updateQueue=null,l=no(t,a,l,n),ao(e),a=uc(),e!==null&&!Be?(ic(e,t,u),Ft(e,t,u)):(ce&&a&&wi(t),t.flags|=1,ke(e,t,l,u),t.child)}function ad(e,t,l,a,n){if(Zl(t),t.stateNode===null){var u=va,i=l.contextType;typeof i=="object"&&i!==null&&(u=Je(i)),u=new l(a,u),t.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=Tc,t.stateNode=u,u._reactInternals=t,u=t.stateNode,u.props=a,u.state=t.memoizedState,u.refs={},Wi(t),i=l.contextType,u.context=typeof i=="object"&&i!==null?Je(i):va,u.state=t.memoizedState,i=l.getDerivedStateFromProps,typeof i=="function"&&(pc(t,l,i,a),u.state=t.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof u.getSnapshotBeforeUpdate=="function"||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(i=u.state,typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount(),i!==u.state&&Tc.enqueueReplaceState(u,u.state,null),rn(t,a,u,n),dn(),u.state=t.memoizedState),typeof u.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){u=t.stateNode;var f=t.memoizedProps,h=$l(l,f);u.props=h;var S=u.context,A=l.contextType;i=va,typeof A=="object"&&A!==null&&(i=Je(A));var N=l.getDerivedStateFromProps;A=typeof N=="function"||typeof u.getSnapshotBeforeUpdate=="function",f=t.pendingProps!==f,A||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(f||S!==i)&&Zo(t,u,a,i),vl=!1;var p=t.memoizedState;u.state=p,rn(t,a,u,n),dn(),S=t.memoizedState,f||p!==S||vl?(typeof N=="function"&&(pc(t,l,N,a),S=t.memoizedState),(h=vl||Qo(t,l,h,a,p,S,i))?(A||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=a,t.memoizedState=S),u.props=a,u.state=S,u.context=i,a=h):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{u=t.stateNode,Fi(e,t),i=t.memoizedProps,A=$l(l,i),u.props=A,N=t.pendingProps,p=u.context,S=l.contextType,h=va,typeof S=="object"&&S!==null&&(h=Je(S)),f=l.getDerivedStateFromProps,(S=typeof f=="function"||typeof u.getSnapshotBeforeUpdate=="function")||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(i!==N||p!==h)&&Zo(t,u,a,h),vl=!1,p=t.memoizedState,u.state=p,rn(t,a,u,n),dn();var T=t.memoizedState;i!==N||p!==T||vl||e!==null&&e.dependencies!==null&&fu(e.dependencies)?(typeof f=="function"&&(pc(t,l,f,a),T=t.memoizedState),(A=vl||Qo(t,l,A,a,p,T,h)||e!==null&&e.dependencies!==null&&fu(e.dependencies))?(S||typeof u.UNSAFE_componentWillUpdate!="function"&&typeof u.componentWillUpdate!="function"||(typeof u.componentWillUpdate=="function"&&u.componentWillUpdate(a,T,h),typeof u.UNSAFE_componentWillUpdate=="function"&&u.UNSAFE_componentWillUpdate(a,T,h)),typeof u.componentDidUpdate=="function"&&(t.flags|=4),typeof u.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof u.componentDidUpdate!="function"||i===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=T),u.props=a,u.state=T,u.context=h,a=A):(typeof u.componentDidUpdate!="function"||i===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),a=!1)}return u=a,_u(e,t),a=(t.flags&128)!==0,u||a?(u=t.stateNode,l=a&&typeof l.getDerivedStateFromError!="function"?null:u.render(),t.flags|=1,e!==null&&a?(t.child=Jl(t,e.child,null,n),t.child=Jl(t,null,l,n)):ke(e,t,l,n),t.memoizedState=u.state,e=t.child):e=Ft(e,t,n),e}function nd(e,t,l,a){return Xl(),t.flags|=256,ke(e,t,l,a),t.child}var xc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function jc(e){return{baseLanes:e,cachePool:Vs()}}function _c(e,t,l){return e=e!==null?e.childLanes&~l:0,t&&(e|=gt),e}function ud(e,t,l){var a=t.pendingProps,n=!1,u=(t.flags&128)!==0,i;if((i=u)||(i=e!==null&&e.memoizedState===null?!1:(De.current&2)!==0),i&&(n=!0,t.flags&=-129),i=(t.flags&32)!==0,t.flags&=-33,e===null){if(ce){if(n?gl(t):bl(),(e=ze)?(e=hr(e,xt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ol!==null?{id:Bt,overflow:Yt}:null,retryLane:536870912,hydrationErrors:null},l=Bs(e),l.return=t,t.child=l,Ve=t,ze=null)):e=null,e===null)throw rl(t);return of(e)?t.lanes=32:t.lanes=536870912,null}var f=a.children;return a=a.fallback,n?(bl(),n=t.mode,f=Nu({mode:"hidden",children:f},n),a=Gl(a,n,l,null),f.return=t,a.return=t,f.sibling=a,t.child=f,a=t.child,a.memoizedState=jc(l),a.childLanes=_c(e,i,l),t.memoizedState=xc,gn(null,a)):(gl(t),Nc(t,f))}var h=e.memoizedState;if(h!==null&&(f=h.dehydrated,f!==null)){if(u)t.flags&256?(gl(t),t.flags&=-257,t=Oc(e,t,l)):t.memoizedState!==null?(bl(),t.child=e.child,t.flags|=128,t=null):(bl(),f=a.fallback,n=t.mode,a=Nu({mode:"visible",children:a.children},n),f=Gl(f,n,l,null),f.flags|=2,a.return=t,f.return=t,a.sibling=f,t.child=a,Jl(t,e.child,null,l),a=t.child,a.memoizedState=jc(l),a.childLanes=_c(e,i,l),t.memoizedState=xc,t=gn(null,a));else if(gl(t),of(f)){if(i=f.nextSibling&&f.nextSibling.dataset,i)var S=i.dgst;i=S,a=Error(o(419)),a.stack="",a.digest=i,nn({value:a,source:null,stack:null}),t=Oc(e,t,l)}else if(Be||ba(e,t,l,!1),i=(l&e.childLanes)!==0,Be||i){if(i=Te,i!==null&&(a=Lf(i,l),a!==0&&a!==h.retryLane))throw h.retryLane=a,wl(e,a),ct(i,e,a),zc;sf(f)||Bu(),t=Oc(e,t,l)}else sf(f)?(t.flags|=192,t.child=e.child,t=null):(e=h.treeContext,ze=_t(f.nextSibling),Ve=t,ce=!0,dl=null,xt=!1,e!==null&&Gs(t,e),t=Nc(t,a.children),t.flags|=4096);return t}return n?(bl(),f=a.fallback,n=t.mode,h=e.child,S=h.sibling,a=Kt(h,{mode:"hidden",children:a.children}),a.subtreeFlags=h.subtreeFlags&65011712,S!==null?f=Kt(S,f):(f=Gl(f,n,l,null),f.flags|=2),f.return=t,a.return=t,a.sibling=f,t.child=a,gn(null,a),a=t.child,f=e.child.memoizedState,f===null?f=jc(l):(n=f.cachePool,n!==null?(h=He._currentValue,n=n.parent!==h?{parent:h,pool:h}:n):n=Vs(),f={baseLanes:f.baseLanes|l,cachePool:n}),a.memoizedState=f,a.childLanes=_c(e,i,l),t.memoizedState=xc,gn(e.child,a)):(gl(t),l=e.child,e=l.sibling,l=Kt(l,{mode:"visible",children:a.children}),l.return=t,l.sibling=null,e!==null&&(i=t.deletions,i===null?(t.deletions=[e],t.flags|=16):i.push(e)),t.child=l,t.memoizedState=null,l)}function Nc(e,t){return t=Nu({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Nu(e,t){return e=ht(22,e,null,t),e.lanes=0,e}function Oc(e,t,l){return Jl(t,e.child,null,l),e=Nc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function id(e,t,l){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),Li(e.return,t,l)}function Mc(e,t,l,a,n,u){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:l,tailMode:n,treeForkCount:u}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=a,i.tail=l,i.tailMode=n,i.treeForkCount=u)}function cd(e,t,l){var a=t.pendingProps,n=a.revealOrder,u=a.tail;a=a.children;var i=De.current,f=(i&2)!==0;if(f?(i=i&1|2,t.flags|=128):i&=1,B(De,i),ke(e,t,a,l),a=ce?an:0,!f&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&id(e,l,t);else if(e.tag===19)id(e,l,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(n){case"forwards":for(l=t.child,n=null;l!==null;)e=l.alternate,e!==null&&yu(e)===null&&(n=l),l=l.sibling;l=n,l===null?(n=t.child,t.child=null):(n=l.sibling,l.sibling=null),Mc(t,!1,n,l,u,a);break;case"backwards":case"unstable_legacy-backwards":for(l=null,n=t.child,t.child=null;n!==null;){if(e=n.alternate,e!==null&&yu(e)===null){t.child=n;break}e=n.sibling,n.sibling=l,l=n,n=e}Mc(t,!0,l,null,u,a);break;case"together":Mc(t,!1,null,null,void 0,a);break;default:t.memoizedState=null}return t.child}function Ft(e,t,l){if(e!==null&&(t.dependencies=e.dependencies),Tl|=t.lanes,(l&t.childLanes)===0)if(e!==null){if(ba(e,t,l,!1),(l&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,l=Kt(e,e.pendingProps),t.child=l,l.return=t;e.sibling!==null;)e=e.sibling,l=l.sibling=Kt(e,e.pendingProps),l.return=t;l.sibling=null}return t.child}function Uc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&fu(e)))}function Nv(e,t,l){switch(t.tag){case 3:Re(t,t.stateNode.containerInfo),hl(t,He,e.memoizedState.cache),Xl();break;case 27:case 5:Dl(t);break;case 4:Re(t,t.stateNode.containerInfo);break;case 10:hl(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,lc(t),null;break;case 13:var a=t.memoizedState;if(a!==null)return a.dehydrated!==null?(gl(t),t.flags|=128,null):(l&t.child.childLanes)!==0?ud(e,t,l):(gl(t),e=Ft(e,t,l),e!==null?e.sibling:null);gl(t);break;case 19:var n=(e.flags&128)!==0;if(a=(l&t.childLanes)!==0,a||(ba(e,t,l,!1),a=(l&t.childLanes)!==0),n){if(a)return cd(e,t,l);t.flags|=128}if(n=t.memoizedState,n!==null&&(n.rendering=null,n.tail=null,n.lastEffect=null),B(De,De.current),a)break;return null;case 22:return t.lanes=0,Po(e,t,l,t.pendingProps);case 24:hl(t,He,e.memoizedState.cache)}return Ft(e,t,l)}function fd(e,t,l){if(e!==null)if(e.memoizedProps!==t.pendingProps)Be=!0;else{if(!Uc(e,l)&&(t.flags&128)===0)return Be=!1,Nv(e,t,l);Be=(e.flags&131072)!==0}else Be=!1,ce&&(t.flags&1048576)!==0&&ws(t,an,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=Kl(t.elementType),t.type=e,typeof e=="function")qi(e)?(a=$l(e,a),t.tag=1,t=ad(null,t,e,a,l)):(t.tag=0,t=Ac(null,t,e,a,l));else{if(e!=null){var n=e.$$typeof;if(n===Ne){t.tag=11,t=Wo(null,t,e,a,l);break e}else if(n===P){t.tag=14,t=Fo(null,t,e,a,l);break e}}throw t=Mt(e)||e,Error(o(306,t,""))}}return t;case 0:return Ac(e,t,t.type,t.pendingProps,l);case 1:return a=t.type,n=$l(a,t.pendingProps),ad(e,t,a,n,l);case 3:e:{if(Re(t,t.stateNode.containerInfo),e===null)throw Error(o(387));a=t.pendingProps;var u=t.memoizedState;n=u.element,Fi(e,t),rn(t,a,null,l);var i=t.memoizedState;if(a=i.cache,hl(t,He,a),a!==u.cache&&Ki(t,[He],l,!0),dn(),a=i.element,u.isDehydrated)if(u={element:a,isDehydrated:!1,cache:i.cache},t.updateQueue.baseState=u,t.memoizedState=u,t.flags&256){t=nd(e,t,a,l);break e}else if(a!==n){n=Et(Error(o(424)),t),nn(n),t=nd(e,t,a,l);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(ze=_t(e.firstChild),Ve=t,ce=!0,dl=null,xt=!0,l=Is(t,null,a,l),t.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(Xl(),a===n){t=Ft(e,t,l);break e}ke(e,t,a,l)}t=t.child}return t;case 26:return _u(e,t),e===null?(l=Sr(t.type,null,t.pendingProps,null))?t.memoizedState=l:ce||(l=t.type,e=t.pendingProps,a=Lu(k.current).createElement(l),a[Ke]=t,a[tt]=e,$e(a,l,e),Qe(a),t.stateNode=a):t.memoizedState=Sr(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Dl(t),e===null&&ce&&(a=t.stateNode=yr(t.type,t.pendingProps,k.current),Ve=t,xt=!0,n=ze,jl(t.type)?(df=n,ze=_t(a.firstChild)):ze=n),ke(e,t,t.pendingProps.children,l),_u(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ce&&((n=a=ze)&&(a=nm(a,t.type,t.pendingProps,xt),a!==null?(t.stateNode=a,Ve=t,ze=_t(a.firstChild),xt=!1,n=!0):n=!1),n||rl(t)),Dl(t),n=t.type,u=t.pendingProps,i=e!==null?e.memoizedProps:null,a=u.children,uf(n,u)?a=null:i!==null&&uf(n,i)&&(t.flags|=32),t.memoizedState!==null&&(n=nc(e,t,Sv,null,null,l),Dn._currentValue=n),_u(e,t),ke(e,t,a,l),t.child;case 6:return e===null&&ce&&((e=l=ze)&&(l=um(l,t.pendingProps,xt),l!==null?(t.stateNode=l,Ve=t,ze=null,e=!0):e=!1),e||rl(t)),null;case 13:return ud(e,t,l);case 4:return Re(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=Jl(t,null,a,l):ke(e,t,a,l),t.child;case 11:return Wo(e,t,t.type,t.pendingProps,l);case 7:return ke(e,t,t.pendingProps,l),t.child;case 8:return ke(e,t,t.pendingProps.children,l),t.child;case 12:return ke(e,t,t.pendingProps.children,l),t.child;case 10:return a=t.pendingProps,hl(t,t.type,a.value),ke(e,t,a.children,l),t.child;case 9:return n=t.type._context,a=t.pendingProps.children,Zl(t),n=Je(n),a=a(n),t.flags|=1,ke(e,t,a,l),t.child;case 14:return Fo(e,t,t.type,t.pendingProps,l);case 15:return Io(e,t,t.type,t.pendingProps,l);case 19:return cd(e,t,l);case 31:return _v(e,t,l);case 22:return Po(e,t,l,t.pendingProps);case 24:return Zl(t),a=Je(He),e===null?(n=ki(),n===null&&(n=Te,u=Vi(),n.pooledCache=u,u.refCount++,u!==null&&(n.pooledCacheLanes|=l),n=u),t.memoizedState={parent:a,cache:n},Wi(t),hl(t,He,n)):((e.lanes&l)!==0&&(Fi(e,t),rn(t,null,null,l),dn()),n=e.memoizedState,u=t.memoizedState,n.parent!==a?(n={parent:a,cache:a},t.memoizedState=n,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=n),hl(t,He,a)):(a=u.cache,hl(t,He,a),a!==n.cache&&Ki(t,[He],l,!0))),ke(e,t,t.pendingProps.children,l),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function It(e){e.flags|=4}function Dc(e,t,l,a,n){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(n&335544128)===n)if(e.stateNode.complete)e.flags|=8192;else if(Hd())e.flags|=8192;else throw Vl=ru,$i}else e.flags&=-16777217}function sd(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Ar(t))if(Hd())e.flags|=8192;else throw Vl=ru,$i}function Ou(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Xf():536870912,e.lanes|=t,Ma|=t)}function bn(e,t){if(!ce)switch(e.tailMode){case"hidden":t=e.tail;for(var l=null;t!==null;)t.alternate!==null&&(l=t),t=t.sibling;l===null?e.tail=null:l.sibling=null;break;case"collapsed":l=e.tail;for(var a=null;l!==null;)l.alternate!==null&&(a=l),l=l.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function Ae(e){var t=e.alternate!==null&&e.alternate.child===e.child,l=0,a=0;if(t)for(var n=e.child;n!==null;)l|=n.lanes|n.childLanes,a|=n.subtreeFlags&65011712,a|=n.flags&65011712,n.return=e,n=n.sibling;else for(n=e.child;n!==null;)l|=n.lanes|n.childLanes,a|=n.subtreeFlags,a|=n.flags,n.return=e,n=n.sibling;return e.subtreeFlags|=a,e.childLanes=l,t}function Ov(e,t,l){var a=t.pendingProps;switch(Gi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ae(t),null;case 1:return Ae(t),null;case 3:return l=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),kt(He),xe(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(ga(t)?It(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Qi())),Ae(t),null;case 26:var n=t.type,u=t.memoizedState;return e===null?(It(t),u!==null?(Ae(t),sd(t,u)):(Ae(t),Dc(t,n,null,a,l))):u?u!==e.memoizedState?(It(t),Ae(t),sd(t,u)):(Ae(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&It(t),Ae(t),Dc(t,n,e,a,l)),null;case 27:if(Cl(t),l=k.current,n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&It(t);else{if(!a){if(t.stateNode===null)throw Error(o(166));return Ae(t),null}e=Y.current,ga(t)?Xs(t):(e=yr(n,a,l),t.stateNode=e,It(t))}return Ae(t),null;case 5:if(Cl(t),n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&It(t);else{if(!a){if(t.stateNode===null)throw Error(o(166));return Ae(t),null}if(u=Y.current,ga(t))Xs(t);else{var i=Lu(k.current);switch(u){case 1:u=i.createElementNS("http://www.w3.org/2000/svg",n);break;case 2:u=i.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;default:switch(n){case"svg":u=i.createElementNS("http://www.w3.org/2000/svg",n);break;case"math":u=i.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;case"script":u=i.createElement("div"),u.innerHTML="<script><\\/script>",u=u.removeChild(u.firstChild);break;case"select":u=typeof a.is=="string"?i.createElement("select",{is:a.is}):i.createElement("select"),a.multiple?u.multiple=!0:a.size&&(u.size=a.size);break;default:u=typeof a.is=="string"?i.createElement(n,{is:a.is}):i.createElement(n)}}u[Ke]=t,u[tt]=a;e:for(i=t.child;i!==null;){if(i.tag===5||i.tag===6)u.appendChild(i.stateNode);else if(i.tag!==4&&i.tag!==27&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break e;for(;i.sibling===null;){if(i.return===null||i.return===t)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}t.stateNode=u;e:switch($e(u,n,a),n){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&It(t)}}return Ae(t),Dc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,l),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&It(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(o(166));if(e=k.current,ga(t)){if(e=t.stateNode,l=t.memoizedProps,a=null,n=Ve,n!==null)switch(n.tag){case 27:case 5:a=n.memoizedProps}e[Ke]=t,e=!!(e.nodeValue===l||a!==null&&a.suppressHydrationWarning===!0||ur(e.nodeValue,l)),e||rl(t,!0)}else e=Lu(e).createTextNode(a),e[Ke]=t,t.stateNode=e}return Ae(t),null;case 31:if(l=t.memoizedState,e===null||e.memoizedState!==null){if(a=ga(t),l!==null){if(e===null){if(!a)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[Ke]=t}else Xl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ae(t),e=!1}else l=Qi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return t.flags&256?(mt(t),t):(mt(t),null);if((t.flags&128)!==0)throw Error(o(558))}return Ae(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(n=ga(t),a!==null&&a.dehydrated!==null){if(e===null){if(!n)throw Error(o(318));if(n=t.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(o(317));n[Ke]=t}else Xl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ae(t),n=!1}else n=Qi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),n=!0;if(!n)return t.flags&256?(mt(t),t):(mt(t),null)}return mt(t),(t.flags&128)!==0?(t.lanes=l,t):(l=a!==null,e=e!==null&&e.memoizedState!==null,l&&(a=t.child,n=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(n=a.alternate.memoizedState.cachePool.pool),u=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),u!==n&&(a.flags|=2048)),l!==e&&l&&(t.child.flags|=8192),Ou(t,t.updateQueue),Ae(t),null);case 4:return xe(),e===null&&ef(t.stateNode.containerInfo),Ae(t),null;case 10:return kt(t.type),Ae(t),null;case 19:if(O(De),a=t.memoizedState,a===null)return Ae(t),null;if(n=(t.flags&128)!==0,u=a.rendering,u===null)if(n)bn(a,!1);else{if(Ue!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(u=yu(e),u!==null){for(t.flags|=128,bn(a,!1),e=u.updateQueue,t.updateQueue=e,Ou(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)qs(l,e),l=l.sibling;return B(De,De.current&1|2),ce&&Vt(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&Le()>Ru&&(t.flags|=128,n=!0,bn(a,!1),t.lanes=4194304)}else{if(!n)if(e=yu(u),e!==null){if(t.flags|=128,n=!0,e=e.updateQueue,t.updateQueue=e,Ou(t,e),bn(a,!0),a.tail===null&&a.tailMode==="hidden"&&!u.alternate&&!ce)return Ae(t),null}else 2*Le()-a.renderingStartTime>Ru&&l!==536870912&&(t.flags|=128,n=!0,bn(a,!1),t.lanes=4194304);a.isBackwards?(u.sibling=t.child,t.child=u):(e=a.last,e!==null?e.sibling=u:t.child=u,a.last=u)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=Le(),e.sibling=null,l=De.current,B(De,n?l&1|2:l&1),ce&&Vt(t,a.treeForkCount),e):(Ae(t),null);case 22:case 23:return mt(t),tc(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(l&536870912)!==0&&(t.flags&128)===0&&(Ae(t),t.subtreeFlags&6&&(t.flags|=8192)):Ae(t),l=t.updateQueue,l!==null&&Ou(t,l.retryQueue),l=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==l&&(t.flags|=2048),e!==null&&O(Ll),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),kt(He),Ae(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function Mv(e,t){switch(Gi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return kt(He),xe(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Cl(t),null;case 31:if(t.memoizedState!==null){if(mt(t),t.alternate===null)throw Error(o(340));Xl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(mt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));Xl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return O(De),null;case 4:return xe(),null;case 10:return kt(t.type),null;case 22:case 23:return mt(t),tc(),e!==null&&O(Ll),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return kt(He),null;case 25:return null;default:return null}}function od(e,t){switch(Gi(t),t.tag){case 3:kt(He),xe();break;case 26:case 27:case 5:Cl(t);break;case 4:xe();break;case 31:t.memoizedState!==null&&mt(t);break;case 13:mt(t);break;case 19:O(De);break;case 10:kt(t.type);break;case 22:case 23:mt(t),tc(),e!==null&&O(Ll);break;case 24:kt(He)}}function Sn(e,t){try{var l=t.updateQueue,a=l!==null?l.lastEffect:null;if(a!==null){var n=a.next;l=n;do{if((l.tag&e)===e){a=void 0;var u=l.create,i=l.inst;a=u(),i.destroy=a}l=l.next}while(l!==n)}}catch(f){ge(t,t.return,f)}}function Sl(e,t,l){try{var a=t.updateQueue,n=a!==null?a.lastEffect:null;if(n!==null){var u=n.next;a=u;do{if((a.tag&e)===e){var i=a.inst,f=i.destroy;if(f!==void 0){i.destroy=void 0,n=t;var h=l,S=f;try{S()}catch(A){ge(n,h,A)}}}a=a.next}while(a!==u)}}catch(A){ge(t,t.return,A)}}function dd(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{eo(t,l)}catch(a){ge(e,e.return,a)}}}function rd(e,t,l){l.props=$l(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(a){ge(e,t,a)}}function pn(e,t){try{var l=e.ref;if(l!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:a=e.stateNode;break;default:a=e.stateNode}typeof l=="function"?e.refCleanup=l(a):l.current=a}}catch(n){ge(e,t,n)}}function wt(e,t){var l=e.ref,a=e.refCleanup;if(l!==null)if(typeof a=="function")try{a()}catch(n){ge(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(n){ge(e,t,n)}else l.current=null}function hd(e){var t=e.type,l=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":l.autoFocus&&a.focus();break e;case"img":l.src?a.src=l.src:l.srcSet&&(a.srcset=l.srcSet)}}catch(n){ge(e,e.return,n)}}function Cc(e,t,l){try{var a=e.stateNode;Iv(a,e.type,l,t),a[tt]=t}catch(n){ge(e,e.return,n)}}function vd(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&jl(e.type)||e.tag===4}function Rc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||vd(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&&jl(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 Hc(e,t,l){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(e,t):(t=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,t.appendChild(e),l=l._reactRootContainer,l!=null||t.onclick!==null||(t.onclick=Zt));else if(a!==4&&(a===27&&jl(e.type)&&(l=e.stateNode,t=null),e=e.child,e!==null))for(Hc(e,t,l),e=e.sibling;e!==null;)Hc(e,t,l),e=e.sibling}function Mu(e,t,l){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?l.insertBefore(e,t):l.appendChild(e);else if(a!==4&&(a===27&&jl(e.type)&&(l=e.stateNode),e=e.child,e!==null))for(Mu(e,t,l),e=e.sibling;e!==null;)Mu(e,t,l),e=e.sibling}function md(e){var t=e.stateNode,l=e.memoizedProps;try{for(var a=e.type,n=t.attributes;n.length;)t.removeAttributeNode(n[0]);$e(t,a,l),t[Ke]=e,t[tt]=l}catch(u){ge(e,e.return,u)}}var Pt=!1,Ye=!1,qc=!1,yd=typeof WeakSet=="function"?WeakSet:Set,Ze=null;function Uv(e,t){if(e=e.containerInfo,af=Fu,e=_s(e),Oi(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var a=l.getSelection&&l.getSelection();if(a&&a.rangeCount!==0){l=a.anchorNode;var n=a.anchorOffset,u=a.focusNode;a=a.focusOffset;try{l.nodeType,u.nodeType}catch{l=null;break e}var i=0,f=-1,h=-1,S=0,A=0,N=e,p=null;t:for(;;){for(var T;N!==l||n!==0&&N.nodeType!==3||(f=i+n),N!==u||a!==0&&N.nodeType!==3||(h=i+a),N.nodeType===3&&(i+=N.nodeValue.length),(T=N.firstChild)!==null;)p=N,N=T;for(;;){if(N===e)break t;if(p===l&&++S===n&&(f=i),p===u&&++A===a&&(h=i),(T=N.nextSibling)!==null)break;N=p,p=N.parentNode}N=T}l=f===-1||h===-1?null:{start:f,end:h}}else l=null}l=l||{start:0,end:0}}else l=null;for(nf={focusedElem:e,selectionRange:l},Fu=!1,Ze=t;Ze!==null;)if(t=Ze,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ze=e;else for(;Ze!==null;){switch(t=Ze,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(l=0;l<e.length;l++)n=e[l],n.ref.impl=n.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&u!==null){e=void 0,l=t,n=u.memoizedProps,u=u.memoizedState,a=l.stateNode;try{var G=$l(l.type,n);e=a.getSnapshotBeforeUpdate(G,u),a.__reactInternalSnapshotBeforeUpdate=e}catch(K){ge(l,l.return,K)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,l=e.nodeType,l===9)ff(e);else if(l===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":ff(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(o(163))}if(e=t.sibling,e!==null){e.return=t.return,Ze=e;break}Ze=t.return}}function gd(e,t,l){var a=l.flags;switch(l.tag){case 0:case 11:case 15:tl(e,l),a&4&&Sn(5,l);break;case 1:if(tl(e,l),a&4)if(e=l.stateNode,t===null)try{e.componentDidMount()}catch(i){ge(l,l.return,i)}else{var n=$l(l.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(n,t,e.__reactInternalSnapshotBeforeUpdate)}catch(i){ge(l,l.return,i)}}a&64&&dd(l),a&512&&pn(l,l.return);break;case 3:if(tl(e,l),a&64&&(e=l.updateQueue,e!==null)){if(t=null,l.child!==null)switch(l.child.tag){case 27:case 5:t=l.child.stateNode;break;case 1:t=l.child.stateNode}try{eo(e,t)}catch(i){ge(l,l.return,i)}}break;case 27:t===null&&a&4&&md(l);case 26:case 5:tl(e,l),t===null&&a&4&&hd(l),a&512&&pn(l,l.return);break;case 12:tl(e,l);break;case 31:tl(e,l),a&4&&pd(e,l);break;case 13:tl(e,l),a&4&&Td(e,l),a&64&&(e=l.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(l=Gv.bind(null,l),im(e,l))));break;case 22:if(a=l.memoizedState!==null||Pt,!a){t=t!==null&&t.memoizedState!==null||Ye,n=Pt;var u=Ye;Pt=a,(Ye=t)&&!u?ll(e,l,(l.subtreeFlags&8772)!==0):tl(e,l),Pt=n,Ye=u}break;case 30:break;default:tl(e,l)}}function bd(e){var t=e.alternate;t!==null&&(e.alternate=null,bd(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ri(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 je=null,at=!1;function el(e,t,l){for(l=l.child;l!==null;)Sd(e,t,l),l=l.sibling}function Sd(e,t,l){if(ot&&typeof ot.onCommitFiberUnmount=="function")try{ot.onCommitFiberUnmount(Za,l)}catch{}switch(l.tag){case 26:Ye||wt(l,t),el(e,t,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:Ye||wt(l,t);var a=je,n=at;jl(l.type)&&(je=l.stateNode,at=!1),el(e,t,l),On(l.stateNode),je=a,at=n;break;case 5:Ye||wt(l,t);case 6:if(a=je,n=at,je=null,el(e,t,l),je=a,at=n,je!==null)if(at)try{(je.nodeType===9?je.body:je.nodeName==="HTML"?je.ownerDocument.body:je).removeChild(l.stateNode)}catch(u){ge(l,t,u)}else try{je.removeChild(l.stateNode)}catch(u){ge(l,t,u)}break;case 18:je!==null&&(at?(e=je,dr(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.stateNode),Ya(e)):dr(je,l.stateNode));break;case 4:a=je,n=at,je=l.stateNode.containerInfo,at=!0,el(e,t,l),je=a,at=n;break;case 0:case 11:case 14:case 15:Sl(2,l,t),Ye||Sl(4,l,t),el(e,t,l);break;case 1:Ye||(wt(l,t),a=l.stateNode,typeof a.componentWillUnmount=="function"&&rd(l,t,a)),el(e,t,l);break;case 21:el(e,t,l);break;case 22:Ye=(a=Ye)||l.memoizedState!==null,el(e,t,l),Ye=a;break;default:el(e,t,l)}}function pd(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ya(e)}catch(l){ge(t,t.return,l)}}}function Td(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ya(e)}catch(l){ge(t,t.return,l)}}function Dv(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new yd),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new yd),t;default:throw Error(o(435,e.tag))}}function Uu(e,t){var l=Dv(e);t.forEach(function(a){if(!l.has(a)){l.add(a);var n=Xv.bind(null,e,a);a.then(n,n)}})}function nt(e,t){var l=t.deletions;if(l!==null)for(var a=0;a<l.length;a++){var n=l[a],u=e,i=t,f=i;e:for(;f!==null;){switch(f.tag){case 27:if(jl(f.type)){je=f.stateNode,at=!1;break e}break;case 5:je=f.stateNode,at=!1;break e;case 3:case 4:je=f.stateNode.containerInfo,at=!0;break e}f=f.return}if(je===null)throw Error(o(160));Sd(u,i,n),je=null,at=!1,u=n.alternate,u!==null&&(u.return=null),n.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Ed(t,e),t=t.sibling}var Dt=null;function Ed(e,t){var l=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:nt(t,e),ut(e),a&4&&(Sl(3,e,e.return),Sn(3,e),Sl(5,e,e.return));break;case 1:nt(t,e),ut(e),a&512&&(Ye||l===null||wt(l,l.return)),a&64&&Pt&&(e=e.updateQueue,e!==null&&(a=e.callbacks,a!==null&&(l=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=l===null?a:l.concat(a))));break;case 26:var n=Dt;if(nt(t,e),ut(e),a&512&&(Ye||l===null||wt(l,l.return)),a&4){var u=l!==null?l.memoizedState:null;if(a=e.memoizedState,l===null)if(a===null)if(e.stateNode===null){e:{a=e.type,l=e.memoizedProps,n=n.ownerDocument||n;t:switch(a){case"title":u=n.getElementsByTagName("title")[0],(!u||u[Va]||u[Ke]||u.namespaceURI==="http://www.w3.org/2000/svg"||u.hasAttribute("itemprop"))&&(u=n.createElement(a),n.head.insertBefore(u,n.querySelector("head > title"))),$e(u,a,l),u[Ke]=e,Qe(u),a=u;break e;case"link":var i=Er("link","href",n).get(a+(l.href||""));if(i){for(var f=0;f<i.length;f++)if(u=i[f],u.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&u.getAttribute("rel")===(l.rel==null?null:l.rel)&&u.getAttribute("title")===(l.title==null?null:l.title)&&u.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){i.splice(f,1);break t}}u=n.createElement(a),$e(u,a,l),n.head.appendChild(u);break;case"meta":if(i=Er("meta","content",n).get(a+(l.content||""))){for(f=0;f<i.length;f++)if(u=i[f],u.getAttribute("content")===(l.content==null?null:""+l.content)&&u.getAttribute("name")===(l.name==null?null:l.name)&&u.getAttribute("property")===(l.property==null?null:l.property)&&u.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&u.getAttribute("charset")===(l.charSet==null?null:l.charSet)){i.splice(f,1);break t}}u=n.createElement(a),$e(u,a,l),n.head.appendChild(u);break;default:throw Error(o(468,a))}u[Ke]=e,Qe(u),a=u}e.stateNode=a}else zr(n,e.type,e.stateNode);else e.stateNode=Tr(n,a,e.memoizedProps);else u!==a?(u===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):u.count--,a===null?zr(n,e.type,e.stateNode):Tr(n,a,e.memoizedProps)):a===null&&e.stateNode!==null&&Cc(e,e.memoizedProps,l.memoizedProps)}break;case 27:nt(t,e),ut(e),a&512&&(Ye||l===null||wt(l,l.return)),l!==null&&a&4&&Cc(e,e.memoizedProps,l.memoizedProps);break;case 5:if(nt(t,e),ut(e),a&512&&(Ye||l===null||wt(l,l.return)),e.flags&32){n=e.stateNode;try{ca(n,"")}catch(G){ge(e,e.return,G)}}a&4&&e.stateNode!=null&&(n=e.memoizedProps,Cc(e,n,l!==null?l.memoizedProps:n)),a&1024&&(qc=!0);break;case 6:if(nt(t,e),ut(e),a&4){if(e.stateNode===null)throw Error(o(162));a=e.memoizedProps,l=e.stateNode;try{l.nodeValue=a}catch(G){ge(e,e.return,G)}}break;case 3:if(Ju=null,n=Dt,Dt=Ku(t.containerInfo),nt(t,e),Dt=n,ut(e),a&4&&l!==null&&l.memoizedState.isDehydrated)try{Ya(t.containerInfo)}catch(G){ge(e,e.return,G)}qc&&(qc=!1,zd(e));break;case 4:a=Dt,Dt=Ku(e.stateNode.containerInfo),nt(t,e),ut(e),Dt=a;break;case 12:nt(t,e),ut(e);break;case 31:nt(t,e),ut(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Uu(e,a)));break;case 13:nt(t,e),ut(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Cu=Le()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Uu(e,a)));break;case 22:n=e.memoizedState!==null;var h=l!==null&&l.memoizedState!==null,S=Pt,A=Ye;if(Pt=S||n,Ye=A||h,nt(t,e),Ye=A,Pt=S,ut(e),a&8192)e:for(t=e.stateNode,t._visibility=n?t._visibility&-2:t._visibility|1,n&&(l===null||h||Pt||Ye||Wl(e)),l=null,t=e;;){if(t.tag===5||t.tag===26){if(l===null){h=l=t;try{if(u=h.stateNode,n)i=u.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none";else{f=h.stateNode;var N=h.memoizedProps.style,p=N!=null&&N.hasOwnProperty("display")?N.display:null;f.style.display=p==null||typeof p=="boolean"?"":(""+p).trim()}}catch(G){ge(h,h.return,G)}}}else if(t.tag===6){if(l===null){h=t;try{h.stateNode.nodeValue=n?"":h.memoizedProps}catch(G){ge(h,h.return,G)}}}else if(t.tag===18){if(l===null){h=t;try{var T=h.stateNode;n?rr(T,!0):rr(h.stateNode,!1)}catch(G){ge(h,h.return,G)}}}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;l===t&&(l=null),t=t.return}l===t&&(l=null),t.sibling.return=t.return,t=t.sibling}a&4&&(a=e.updateQueue,a!==null&&(l=a.retryQueue,l!==null&&(a.retryQueue=null,Uu(e,l))));break;case 19:nt(t,e),ut(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Uu(e,a)));break;case 30:break;case 21:break;default:nt(t,e),ut(e)}}function ut(e){var t=e.flags;if(t&2){try{for(var l,a=e.return;a!==null;){if(vd(a)){l=a;break}a=a.return}if(l==null)throw Error(o(160));switch(l.tag){case 27:var n=l.stateNode,u=Rc(e);Mu(e,u,n);break;case 5:var i=l.stateNode;l.flags&32&&(ca(i,""),l.flags&=-33);var f=Rc(e);Mu(e,f,i);break;case 3:case 4:var h=l.stateNode.containerInfo,S=Rc(e);Hc(e,S,h);break;default:throw Error(o(161))}}catch(A){ge(e,e.return,A)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function zd(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;zd(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function tl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)gd(e,t.alternate,t),t=t.sibling}function Wl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Sl(4,t,t.return),Wl(t);break;case 1:wt(t,t.return);var l=t.stateNode;typeof l.componentWillUnmount=="function"&&rd(t,t.return,l),Wl(t);break;case 27:On(t.stateNode);case 26:case 5:wt(t,t.return),Wl(t);break;case 22:t.memoizedState===null&&Wl(t);break;case 30:Wl(t);break;default:Wl(t)}e=e.sibling}}function ll(e,t,l){for(l=l&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var a=t.alternate,n=e,u=t,i=u.flags;switch(u.tag){case 0:case 11:case 15:ll(n,u,l),Sn(4,u);break;case 1:if(ll(n,u,l),a=u,n=a.stateNode,typeof n.componentDidMount=="function")try{n.componentDidMount()}catch(S){ge(a,a.return,S)}if(a=u,n=a.updateQueue,n!==null){var f=a.stateNode;try{var h=n.shared.hiddenCallbacks;if(h!==null)for(n.shared.hiddenCallbacks=null,n=0;n<h.length;n++)Ps(h[n],f)}catch(S){ge(a,a.return,S)}}l&&i&64&&dd(u),pn(u,u.return);break;case 27:md(u);case 26:case 5:ll(n,u,l),l&&a===null&&i&4&&hd(u),pn(u,u.return);break;case 12:ll(n,u,l);break;case 31:ll(n,u,l),l&&i&4&&pd(n,u);break;case 13:ll(n,u,l),l&&i&4&&Td(n,u);break;case 22:u.memoizedState===null&&ll(n,u,l),pn(u,u.return);break;case 30:break;default:ll(n,u,l)}t=t.sibling}}function Bc(e,t){var l=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==l&&(e!=null&&e.refCount++,l!=null&&un(l))}function Yc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&un(e))}function Ct(e,t,l,a){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Ad(e,t,l,a),t=t.sibling}function Ad(e,t,l,a){var n=t.flags;switch(t.tag){case 0:case 11:case 15:Ct(e,t,l,a),n&2048&&Sn(9,t);break;case 1:Ct(e,t,l,a);break;case 3:Ct(e,t,l,a),n&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&un(e)));break;case 12:if(n&2048){Ct(e,t,l,a),e=t.stateNode;try{var u=t.memoizedProps,i=u.id,f=u.onPostCommit;typeof f=="function"&&f(i,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(h){ge(t,t.return,h)}}else Ct(e,t,l,a);break;case 31:Ct(e,t,l,a);break;case 13:Ct(e,t,l,a);break;case 23:break;case 22:u=t.stateNode,i=t.alternate,t.memoizedState!==null?u._visibility&2?Ct(e,t,l,a):Tn(e,t):u._visibility&2?Ct(e,t,l,a):(u._visibility|=2,_a(e,t,l,a,(t.subtreeFlags&10256)!==0||!1)),n&2048&&Bc(i,t);break;case 24:Ct(e,t,l,a),n&2048&&Yc(t.alternate,t);break;default:Ct(e,t,l,a)}}function _a(e,t,l,a,n){for(n=n&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var u=e,i=t,f=l,h=a,S=i.flags;switch(i.tag){case 0:case 11:case 15:_a(u,i,f,h,n),Sn(8,i);break;case 23:break;case 22:var A=i.stateNode;i.memoizedState!==null?A._visibility&2?_a(u,i,f,h,n):Tn(u,i):(A._visibility|=2,_a(u,i,f,h,n)),n&&S&2048&&Bc(i.alternate,i);break;case 24:_a(u,i,f,h,n),n&&S&2048&&Yc(i.alternate,i);break;default:_a(u,i,f,h,n)}t=t.sibling}}function Tn(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var l=e,a=t,n=a.flags;switch(a.tag){case 22:Tn(l,a),n&2048&&Bc(a.alternate,a);break;case 24:Tn(l,a),n&2048&&Yc(a.alternate,a);break;default:Tn(l,a)}t=t.sibling}}var En=8192;function Na(e,t,l){if(e.subtreeFlags&En)for(e=e.child;e!==null;)xd(e,t,l),e=e.sibling}function xd(e,t,l){switch(e.tag){case 26:Na(e,t,l),e.flags&En&&e.memoizedState!==null&&bm(l,Dt,e.memoizedState,e.memoizedProps);break;case 5:Na(e,t,l);break;case 3:case 4:var a=Dt;Dt=Ku(e.stateNode.containerInfo),Na(e,t,l),Dt=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=En,En=16777216,Na(e,t,l),En=a):Na(e,t,l));break;default:Na(e,t,l)}}function jd(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 zn(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var l=0;l<t.length;l++){var a=t[l];Ze=a,Nd(a,e)}jd(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)_d(e),e=e.sibling}function _d(e){switch(e.tag){case 0:case 11:case 15:zn(e),e.flags&2048&&Sl(9,e,e.return);break;case 3:zn(e);break;case 12:zn(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Du(e)):zn(e);break;default:zn(e)}}function Du(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var l=0;l<t.length;l++){var a=t[l];Ze=a,Nd(a,e)}jd(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Sl(8,t,t.return),Du(t);break;case 22:l=t.stateNode,l._visibility&2&&(l._visibility&=-3,Du(t));break;default:Du(t)}e=e.sibling}}function Nd(e,t){for(;Ze!==null;){var l=Ze;switch(l.tag){case 0:case 11:case 15:Sl(8,l,t);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var a=l.memoizedState.cachePool.pool;a!=null&&a.refCount++}break;case 24:un(l.memoizedState.cache)}if(a=l.child,a!==null)a.return=l,Ze=a;else e:for(l=e;Ze!==null;){a=Ze;var n=a.sibling,u=a.return;if(bd(a),a===l){Ze=null;break e}if(n!==null){n.return=u,Ze=n;break e}Ze=u}}}var Cv={getCacheForType:function(e){var t=Je(He),l=t.data.get(e);return l===void 0&&(l=e(),t.data.set(e,l)),l},cacheSignal:function(){return Je(He).controller.signal}},Rv=typeof WeakMap=="function"?WeakMap:Map,me=0,Te=null,le=null,ne=0,ye=0,yt=null,pl=!1,Oa=!1,wc=!1,al=0,Ue=0,Tl=0,Fl=0,Gc=0,gt=0,Ma=0,An=null,it=null,Xc=!1,Cu=0,Od=0,Ru=1/0,Hu=null,El=null,Xe=0,zl=null,Ua=null,nl=0,Qc=0,Zc=null,Md=null,xn=0,Lc=null;function bt(){return(me&2)!==0&&ne!==0?ne&-ne:x.T!==null?Wc():Kf()}function Ud(){if(gt===0)if((ne&536870912)===0||ce){var e=Zn;Zn<<=1,(Zn&3932160)===0&&(Zn=262144),gt=e}else gt=536870912;return e=vt.current,e!==null&&(e.flags|=32),gt}function ct(e,t,l){(e===Te&&(ye===2||ye===9)||e.cancelPendingCommit!==null)&&(Da(e,0),Al(e,ne,gt,!1)),Ka(e,l),((me&2)===0||e!==Te)&&(e===Te&&((me&2)===0&&(Fl|=l),Ue===4&&Al(e,ne,gt,!1)),Gt(e))}function Dd(e,t,l){if((me&6)!==0)throw Error(o(327));var a=!l&&(t&127)===0&&(t&e.expiredLanes)===0||La(e,t),n=a?Bv(e,t):Vc(e,t,!0),u=a;do{if(n===0){Oa&&!a&&Al(e,t,0,!1);break}else{if(l=e.current.alternate,u&&!Hv(l)){n=Vc(e,t,!1),u=!1;continue}if(n===2){if(u=t,e.errorRecoveryDisabledLanes&u)var i=0;else i=e.pendingLanes&-536870913,i=i!==0?i:i&536870912?536870912:0;if(i!==0){t=i;e:{var f=e;n=An;var h=f.current.memoizedState.isDehydrated;if(h&&(Da(f,i).flags|=256),i=Vc(f,i,!1),i!==2){if(wc&&!h){f.errorRecoveryDisabledLanes|=u,Fl|=u,n=4;break e}u=it,it=n,u!==null&&(it===null?it=u:it.push.apply(it,u))}n=i}if(u=!1,n!==2)continue}}if(n===1){Da(e,0),Al(e,t,0,!0);break}e:{switch(a=e,u=n,u){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:Al(a,t,gt,!pl);break e;case 2:it=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(n=Cu+300-Le(),10<n)){if(Al(a,t,gt,!pl),Kn(a,0,!0)!==0)break e;nl=t,a.timeoutHandle=sr(Cd.bind(null,a,l,it,Hu,Xc,t,gt,Fl,Ma,pl,u,"Throttled",-0,0),n);break e}Cd(a,l,it,Hu,Xc,t,gt,Fl,Ma,pl,u,null,-0,0)}}break}while(!0);Gt(e)}function Cd(e,t,l,a,n,u,i,f,h,S,A,N,p,T){if(e.timeoutHandle=-1,N=t.subtreeFlags,N&8192||(N&16785408)===16785408){N={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Zt},xd(t,u,N);var G=(u&62914560)===u?Cu-Le():(u&4194048)===u?Od-Le():0;if(G=Sm(N,G),G!==null){nl=u,e.cancelPendingCommit=G(Xd.bind(null,e,t,u,l,a,n,i,f,h,A,N,null,p,T)),Al(e,u,i,!S);return}}Xd(e,t,u,l,a,n,i,f,h)}function Hv(e){for(var t=e;;){var l=t.tag;if((l===0||l===11||l===15)&&t.flags&16384&&(l=t.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var a=0;a<l.length;a++){var n=l[a],u=n.getSnapshot;n=n.value;try{if(!rt(u(),n))return!1}catch{return!1}}if(l=t.child,t.subtreeFlags&16384&&l!==null)l.return=t,t=l;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 Al(e,t,l,a){t&=~Gc,t&=~Fl,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var n=t;0<n;){var u=31-dt(n),i=1<<u;a[u]=-1,n&=~i}l!==0&&Qf(e,l,t)}function qu(){return(me&6)===0?(jn(0),!1):!0}function Kc(){if(le!==null){if(ye===0)var e=le.return;else e=le,Jt=Ql=null,cc(e),Ea=null,fn=0,e=le;for(;e!==null;)od(e.alternate,e),e=e.return;le=null}}function Da(e,t){var l=e.timeoutHandle;l!==-1&&(e.timeoutHandle=-1,tm(l)),l=e.cancelPendingCommit,l!==null&&(e.cancelPendingCommit=null,l()),nl=0,Kc(),Te=e,le=l=Kt(e.current,null),ne=t,ye=0,yt=null,pl=!1,Oa=La(e,t),wc=!1,Ma=gt=Gc=Fl=Tl=Ue=0,it=An=null,Xc=!1,(t&8)!==0&&(t|=t&32);var a=e.entangledLanes;if(a!==0)for(e=e.entanglements,a&=t;0<a;){var n=31-dt(a),u=1<<n;t|=e[n],a&=~u}return al=t,au(),l}function Rd(e,t){ee=null,x.H=yn,t===Ta||t===du?(t=$s(),ye=3):t===$i?(t=$s(),ye=4):ye=t===zc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,yt=t,le===null&&(Ue=1,xu(e,Et(t,e.current)))}function Hd(){var e=vt.current;return e===null?!0:(ne&4194048)===ne?jt===null:(ne&62914560)===ne||(ne&536870912)!==0?e===jt:!1}function qd(){var e=x.H;return x.H=yn,e===null?yn:e}function Bd(){var e=x.A;return x.A=Cv,e}function Bu(){Ue=4,pl||(ne&4194048)!==ne&&vt.current!==null||(Oa=!0),(Tl&134217727)===0&&(Fl&134217727)===0||Te===null||Al(Te,ne,gt,!1)}function Vc(e,t,l){var a=me;me|=2;var n=qd(),u=Bd();(Te!==e||ne!==t)&&(Hu=null,Da(e,t)),t=!1;var i=Ue;e:do try{if(ye!==0&&le!==null){var f=le,h=yt;switch(ye){case 8:Kc(),i=6;break e;case 3:case 2:case 9:case 6:vt.current===null&&(t=!0);var S=ye;if(ye=0,yt=null,Ca(e,f,h,S),l&&Oa){i=0;break e}break;default:S=ye,ye=0,yt=null,Ca(e,f,h,S)}}qv(),i=Ue;break}catch(A){Rd(e,A)}while(!0);return t&&e.shellSuspendCounter++,Jt=Ql=null,me=a,x.H=n,x.A=u,le===null&&(Te=null,ne=0,au()),i}function qv(){for(;le!==null;)Yd(le)}function Bv(e,t){var l=me;me|=2;var a=qd(),n=Bd();Te!==e||ne!==t?(Hu=null,Ru=Le()+500,Da(e,t)):Oa=La(e,t);e:do try{if(ye!==0&&le!==null){t=le;var u=yt;t:switch(ye){case 1:ye=0,yt=null,Ca(e,t,u,1);break;case 2:case 9:if(Js(u)){ye=0,yt=null,wd(t);break}t=function(){ye!==2&&ye!==9||Te!==e||(ye=7),Gt(e)},u.then(t,t);break e;case 3:ye=7;break e;case 4:ye=5;break e;case 7:Js(u)?(ye=0,yt=null,wd(t)):(ye=0,yt=null,Ca(e,t,u,7));break;case 5:var i=null;switch(le.tag){case 26:i=le.memoizedState;case 5:case 27:var f=le;if(i?Ar(i):f.stateNode.complete){ye=0,yt=null;var h=f.sibling;if(h!==null)le=h;else{var S=f.return;S!==null?(le=S,Yu(S)):le=null}break t}}ye=0,yt=null,Ca(e,t,u,5);break;case 6:ye=0,yt=null,Ca(e,t,u,6);break;case 8:Kc(),Ue=6;break e;default:throw Error(o(462))}}Yv();break}catch(A){Rd(e,A)}while(!0);return Jt=Ql=null,x.H=a,x.A=n,me=l,le!==null?0:(Te=null,ne=0,au(),Ue)}function Yv(){for(;le!==null&&!Oe();)Yd(le)}function Yd(e){var t=fd(e.alternate,e,al);e.memoizedProps=e.pendingProps,t===null?Yu(e):le=t}function wd(e){var t=e,l=t.alternate;switch(t.tag){case 15:case 0:t=ld(l,t,t.pendingProps,t.type,void 0,ne);break;case 11:t=ld(l,t,t.pendingProps,t.type.render,t.ref,ne);break;case 5:cc(t);default:od(l,t),t=le=qs(t,al),t=fd(l,t,al)}e.memoizedProps=e.pendingProps,t===null?Yu(e):le=t}function Ca(e,t,l,a){Jt=Ql=null,cc(t),Ea=null,fn=0;var n=t.return;try{if(jv(e,n,t,l,ne)){Ue=1,xu(e,Et(l,e.current)),le=null;return}}catch(u){if(n!==null)throw le=n,u;Ue=1,xu(e,Et(l,e.current)),le=null;return}t.flags&32768?(ce||a===1?e=!0:Oa||(ne&536870912)!==0?e=!1:(pl=e=!0,(a===2||a===9||a===3||a===6)&&(a=vt.current,a!==null&&a.tag===13&&(a.flags|=16384))),Gd(t,e)):Yu(t)}function Yu(e){var t=e;do{if((t.flags&32768)!==0){Gd(t,pl);return}e=t.return;var l=Ov(t.alternate,t,al);if(l!==null){le=l;return}if(t=t.sibling,t!==null){le=t;return}le=t=e}while(t!==null);Ue===0&&(Ue=5)}function Gd(e,t){do{var l=Mv(e.alternate,e);if(l!==null){l.flags&=32767,le=l;return}if(l=e.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!t&&(e=e.sibling,e!==null)){le=e;return}le=e=l}while(e!==null);Ue=6,le=null}function Xd(e,t,l,a,n,u,i,f,h){e.cancelPendingCommit=null;do wu();while(Xe!==0);if((me&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(u=t.lanes|t.childLanes,u|=Ri,gh(e,l,u,i,f,h),e===Te&&(le=Te=null,ne=0),Ua=t,zl=e,nl=l,Qc=u,Zc=n,Md=a,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Qv(Xn,function(){return Vd(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=x.T,x.T=null,n=R.p,R.p=2,i=me,me|=4;try{Uv(e,t,l)}finally{me=i,R.p=n,x.T=a}}Xe=1,Qd(),Zd(),Ld()}}function Qd(){if(Xe===1){Xe=0;var e=zl,t=Ua,l=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||l){l=x.T,x.T=null;var a=R.p;R.p=2;var n=me;me|=4;try{Ed(t,e);var u=nf,i=_s(e.containerInfo),f=u.focusedElem,h=u.selectionRange;if(i!==f&&f&&f.ownerDocument&&js(f.ownerDocument.documentElement,f)){if(h!==null&&Oi(f)){var S=h.start,A=h.end;if(A===void 0&&(A=S),"selectionStart"in f)f.selectionStart=S,f.selectionEnd=Math.min(A,f.value.length);else{var N=f.ownerDocument||document,p=N&&N.defaultView||window;if(p.getSelection){var T=p.getSelection(),G=f.textContent.length,K=Math.min(h.start,G),pe=h.end===void 0?K:Math.min(h.end,G);!T.extend&&K>pe&&(i=pe,pe=K,K=i);var y=xs(f,K),v=xs(f,pe);if(y&&v&&(T.rangeCount!==1||T.anchorNode!==y.node||T.anchorOffset!==y.offset||T.focusNode!==v.node||T.focusOffset!==v.offset)){var b=N.createRange();b.setStart(y.node,y.offset),T.removeAllRanges(),K>pe?(T.addRange(b),T.extend(v.node,v.offset)):(b.setEnd(v.node,v.offset),T.addRange(b))}}}}for(N=[],T=f;T=T.parentNode;)T.nodeType===1&&N.push({element:T,left:T.scrollLeft,top:T.scrollTop});for(typeof f.focus=="function"&&f.focus(),f=0;f<N.length;f++){var _=N[f];_.element.scrollLeft=_.left,_.element.scrollTop=_.top}}Fu=!!af,nf=af=null}finally{me=n,R.p=a,x.T=l}}e.current=t,Xe=2}}function Zd(){if(Xe===2){Xe=0;var e=zl,t=Ua,l=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||l){l=x.T,x.T=null;var a=R.p;R.p=2;var n=me;me|=4;try{gd(e,t.alternate,t)}finally{me=n,R.p=a,x.T=l}}Xe=3}}function Ld(){if(Xe===4||Xe===3){Xe=0,We();var e=zl,t=Ua,l=nl,a=Md;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Xe=5:(Xe=0,Ua=zl=null,Kd(e,e.pendingLanes));var n=e.pendingLanes;if(n===0&&(El=null),oi(l),t=t.stateNode,ot&&typeof ot.onCommitFiberRoot=="function")try{ot.onCommitFiberRoot(Za,t,void 0,(t.current.flags&128)===128)}catch{}if(a!==null){t=x.T,n=R.p,R.p=2,x.T=null;try{for(var u=e.onRecoverableError,i=0;i<a.length;i++){var f=a[i];u(f.value,{componentStack:f.stack})}}finally{x.T=t,R.p=n}}(nl&3)!==0&&wu(),Gt(e),n=e.pendingLanes,(l&261930)!==0&&(n&42)!==0?e===Lc?xn++:(xn=0,Lc=e):xn=0,jn(0)}}function Kd(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,un(t)))}function wu(){return Qd(),Zd(),Ld(),Vd()}function Vd(){if(Xe!==5)return!1;var e=zl,t=Qc;Qc=0;var l=oi(nl),a=x.T,n=R.p;try{R.p=32>l?32:l,x.T=null,l=Zc,Zc=null;var u=zl,i=nl;if(Xe=0,Ua=zl=null,nl=0,(me&6)!==0)throw Error(o(331));var f=me;if(me|=4,_d(u.current),Ad(u,u.current,i,l),me=f,jn(0,!1),ot&&typeof ot.onPostCommitFiberRoot=="function")try{ot.onPostCommitFiberRoot(Za,u)}catch{}return!0}finally{R.p=n,x.T=a,Kd(e,t)}}function Jd(e,t,l){t=Et(l,t),t=Ec(e.stateNode,t,2),e=yl(e,t,2),e!==null&&(Ka(e,2),Gt(e))}function ge(e,t,l){if(e.tag===3)Jd(e,e,l);else for(;t!==null;){if(t.tag===3){Jd(t,e,l);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(El===null||!El.has(a))){e=Et(l,e),l=ko(2),a=yl(t,l,2),a!==null&&($o(l,a,t,e),Ka(a,2),Gt(a));break}}t=t.return}}function Jc(e,t,l){var a=e.pingCache;if(a===null){a=e.pingCache=new Rv;var n=new Set;a.set(t,n)}else n=a.get(t),n===void 0&&(n=new Set,a.set(t,n));n.has(l)||(wc=!0,n.add(l),e=wv.bind(null,e,t,l),t.then(e,e))}function wv(e,t,l){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,Te===e&&(ne&l)===l&&(Ue===4||Ue===3&&(ne&62914560)===ne&&300>Le()-Cu?(me&2)===0&&Da(e,0):Gc|=l,Ma===ne&&(Ma=0)),Gt(e)}function kd(e,t){t===0&&(t=Xf()),e=wl(e,t),e!==null&&(Ka(e,t),Gt(e))}function Gv(e){var t=e.memoizedState,l=0;t!==null&&(l=t.retryLane),kd(e,l)}function Xv(e,t){var l=0;switch(e.tag){case 31:case 13:var a=e.stateNode,n=e.memoizedState;n!==null&&(l=n.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(o(314))}a!==null&&a.delete(t),kd(e,l)}function Qv(e,t){return Q(e,t)}var Gu=null,Ra=null,kc=!1,Xu=!1,$c=!1,xl=0;function Gt(e){e!==Ra&&e.next===null&&(Ra===null?Gu=Ra=e:Ra=Ra.next=e),Xu=!0,kc||(kc=!0,Lv())}function jn(e,t){if(!$c&&Xu){$c=!0;do for(var l=!1,a=Gu;a!==null;){if(e!==0){var n=a.pendingLanes;if(n===0)var u=0;else{var i=a.suspendedLanes,f=a.pingedLanes;u=(1<<31-dt(42|e)+1)-1,u&=n&~(i&~f),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(l=!0,Id(a,u))}else u=ne,u=Kn(a,a===Te?u:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(u&3)===0||La(a,u)||(l=!0,Id(a,u));a=a.next}while(l);$c=!1}}function Zv(){$d()}function $d(){Xu=kc=!1;var e=0;xl!==0&&em()&&(e=xl);for(var t=Le(),l=null,a=Gu;a!==null;){var n=a.next,u=Wd(a,t);u===0?(a.next=null,l===null?Gu=n:l.next=n,n===null&&(Ra=l)):(l=a,(e!==0||(u&3)!==0)&&(Xu=!0)),a=n}Xe!==0&&Xe!==5||jn(e),xl!==0&&(xl=0)}function Wd(e,t){for(var l=e.suspendedLanes,a=e.pingedLanes,n=e.expirationTimes,u=e.pendingLanes&-62914561;0<u;){var i=31-dt(u),f=1<<i,h=n[i];h===-1?((f&l)===0||(f&a)!==0)&&(n[i]=yh(f,t)):h<=t&&(e.expiredLanes|=f),u&=~f}if(t=Te,l=ne,l=Kn(e,e===t?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,l===0||e===t&&(ye===2||ye===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&ie(a),e.callbackNode=null,e.callbackPriority=0;if((l&3)===0||La(e,l)){if(t=l&-l,t===e.callbackPriority)return t;switch(a!==null&&ie(a),oi(l)){case 2:case 8:l=wf;break;case 32:l=Xn;break;case 268435456:l=Gf;break;default:l=Xn}return a=Fd.bind(null,e),l=Q(l,a),e.callbackPriority=t,e.callbackNode=l,t}return a!==null&&a!==null&&ie(a),e.callbackPriority=2,e.callbackNode=null,2}function Fd(e,t){if(Xe!==0&&Xe!==5)return e.callbackNode=null,e.callbackPriority=0,null;var l=e.callbackNode;if(wu()&&e.callbackNode!==l)return null;var a=ne;return a=Kn(e,e===Te?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(Dd(e,a,t),Wd(e,Le()),e.callbackNode!=null&&e.callbackNode===l?Fd.bind(null,e):null)}function Id(e,t){if(wu())return null;Dd(e,t,!0)}function Lv(){lm(function(){(me&6)!==0?Q(Yf,Zv):$d()})}function Wc(){if(xl===0){var e=Sa;e===0&&(e=Qn,Qn<<=1,(Qn&261888)===0&&(Qn=256)),xl=e}return xl}function Pd(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:$n(""+e)}function er(e,t){var l=t.ownerDocument.createElement("input");return l.name=t.name,l.value=t.value,e.id&&l.setAttribute("form",e.id),t.parentNode.insertBefore(l,t),e=new FormData(e),l.parentNode.removeChild(l),e}function Kv(e,t,l,a,n){if(t==="submit"&&l&&l.stateNode===n){var u=Pd((n[tt]||null).action),i=a.submitter;i&&(t=(t=i[tt]||null)?Pd(t.formAction):i.getAttribute("formAction"),t!==null&&(u=t,i=null));var f=new Pn("action","action",null,a,n);e.push({event:f,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(xl!==0){var h=i?er(n,i):new FormData(n);yc(l,{pending:!0,data:h,method:n.method,action:u},null,h)}}else typeof u=="function"&&(f.preventDefault(),h=i?er(n,i):new FormData(n),yc(l,{pending:!0,data:h,method:n.method,action:u},u,h))},currentTarget:n}]})}}for(var Fc=0;Fc<Ci.length;Fc++){var Ic=Ci[Fc],Vv=Ic.toLowerCase(),Jv=Ic[0].toUpperCase()+Ic.slice(1);Ut(Vv,"on"+Jv)}Ut(Ms,"onAnimationEnd"),Ut(Us,"onAnimationIteration"),Ut(Ds,"onAnimationStart"),Ut("dblclick","onDoubleClick"),Ut("focusin","onFocus"),Ut("focusout","onBlur"),Ut(sv,"onTransitionRun"),Ut(ov,"onTransitionStart"),Ut(dv,"onTransitionCancel"),Ut(Cs,"onTransitionEnd"),ua("onMouseEnter",["mouseout","mouseover"]),ua("onMouseLeave",["mouseout","mouseover"]),ua("onPointerEnter",["pointerout","pointerover"]),ua("onPointerLeave",["pointerout","pointerover"]),Hl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Hl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Hl("onBeforeInput",["compositionend","keypress","textInput","paste"]),Hl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Hl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Hl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var _n="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(" "),kv=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(_n));function tr(e,t){t=(t&4)!==0;for(var l=0;l<e.length;l++){var a=e[l],n=a.event;a=a.listeners;e:{var u=void 0;if(t)for(var i=a.length-1;0<=i;i--){var f=a[i],h=f.instance,S=f.currentTarget;if(f=f.listener,h!==u&&n.isPropagationStopped())break e;u=f,n.currentTarget=S;try{u(n)}catch(A){lu(A)}n.currentTarget=null,u=h}else for(i=0;i<a.length;i++){if(f=a[i],h=f.instance,S=f.currentTarget,f=f.listener,h!==u&&n.isPropagationStopped())break e;u=f,n.currentTarget=S;try{u(n)}catch(A){lu(A)}n.currentTarget=null,u=h}}}}function ae(e,t){var l=t[di];l===void 0&&(l=t[di]=new Set);var a=e+"__bubble";l.has(a)||(lr(t,e,2,!1),l.add(a))}function Pc(e,t,l){var a=0;t&&(a|=4),lr(l,e,a,t)}var Qu="_reactListening"+Math.random().toString(36).slice(2);function ef(e){if(!e[Qu]){e[Qu]=!0,kf.forEach(function(l){l!=="selectionchange"&&(kv.has(l)||Pc(l,!1,e),Pc(l,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Qu]||(t[Qu]=!0,Pc("selectionchange",!1,t))}}function lr(e,t,l,a){switch(Ur(t)){case 2:var n=Em;break;case 8:n=zm;break;default:n=yf}l=n.bind(null,t,l,e),n=void 0,!pi||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(n=!0),a?n!==void 0?e.addEventListener(t,l,{capture:!0,passive:n}):e.addEventListener(t,l,!0):n!==void 0?e.addEventListener(t,l,{passive:n}):e.addEventListener(t,l,!1)}function tf(e,t,l,a,n){var u=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var i=a.tag;if(i===3||i===4){var f=a.stateNode.containerInfo;if(f===n)break;if(i===4)for(i=a.return;i!==null;){var h=i.tag;if((h===3||h===4)&&i.stateNode.containerInfo===n)return;i=i.return}for(;f!==null;){if(i=la(f),i===null)return;if(h=i.tag,h===5||h===6||h===26||h===27){a=u=i;continue e}f=f.parentNode}}a=a.return}is(function(){var S=u,A=bi(l),N=[];e:{var p=Rs.get(e);if(p!==void 0){var T=Pn,G=e;switch(e){case"keypress":if(Fn(l)===0)break e;case"keydown":case"keyup":T=Xh;break;case"focusin":G="focus",T=Ai;break;case"focusout":G="blur",T=Ai;break;case"beforeblur":case"afterblur":T=Ai;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":T=ss;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":T=Oh;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":T=Lh;break;case Ms:case Us:case Ds:T=Dh;break;case Cs:T=Vh;break;case"scroll":case"scrollend":T=_h;break;case"wheel":T=kh;break;case"copy":case"cut":case"paste":T=Rh;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":T=ds;break;case"toggle":case"beforetoggle":T=Wh}var K=(t&4)!==0,pe=!K&&(e==="scroll"||e==="scrollend"),y=K?p!==null?p+"Capture":null:p;K=[];for(var v=S,b;v!==null;){var _=v;if(b=_.stateNode,_=_.tag,_!==5&&_!==26&&_!==27||b===null||y===null||(_=ka(v,y),_!=null&&K.push(Nn(v,_,b))),pe)break;v=v.return}0<K.length&&(p=new T(p,G,null,l,A),N.push({event:p,listeners:K}))}}if((t&7)===0){e:{if(p=e==="mouseover"||e==="pointerover",T=e==="mouseout"||e==="pointerout",p&&l!==gi&&(G=l.relatedTarget||l.fromElement)&&(la(G)||G[ta]))break e;if((T||p)&&(p=A.window===A?A:(p=A.ownerDocument)?p.defaultView||p.parentWindow:window,T?(G=l.relatedTarget||l.toElement,T=S,G=G?la(G):null,G!==null&&(pe=z(G),K=G.tag,G!==pe||K!==5&&K!==27&&K!==6)&&(G=null)):(T=null,G=S),T!==G)){if(K=ss,_="onMouseLeave",y="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(K=ds,_="onPointerLeave",y="onPointerEnter",v="pointer"),pe=T==null?p:Ja(T),b=G==null?p:Ja(G),p=new K(_,v+"leave",T,l,A),p.target=pe,p.relatedTarget=b,_=null,la(A)===S&&(K=new K(y,v+"enter",G,l,A),K.target=b,K.relatedTarget=pe,_=K),pe=_,T&&G)t:{for(K=$v,y=T,v=G,b=0,_=y;_;_=K(_))b++;_=0;for(var Z=v;Z;Z=K(Z))_++;for(;0<b-_;)y=K(y),b--;for(;0<_-b;)v=K(v),_--;for(;b--;){if(y===v||v!==null&&y===v.alternate){K=y;break t}y=K(y),v=K(v)}K=null}else K=null;T!==null&&ar(N,p,T,K,!1),G!==null&&pe!==null&&ar(N,pe,G,K,!0)}}e:{if(p=S?Ja(S):window,T=p.nodeName&&p.nodeName.toLowerCase(),T==="select"||T==="input"&&p.type==="file")var re=Ss;else if(gs(p))if(ps)re=iv;else{re=nv;var X=av}else T=p.nodeName,!T||T.toLowerCase()!=="input"||p.type!=="checkbox"&&p.type!=="radio"?S&&yi(S.elementType)&&(re=Ss):re=uv;if(re&&(re=re(e,S))){bs(N,re,l,A);break e}X&&X(e,p,S),e==="focusout"&&S&&p.type==="number"&&S.memoizedProps.value!=null&&mi(p,"number",p.value)}switch(X=S?Ja(S):window,e){case"focusin":(gs(X)||X.contentEditable==="true")&&(da=X,Mi=S,ln=null);break;case"focusout":ln=Mi=da=null;break;case"mousedown":Ui=!0;break;case"contextmenu":case"mouseup":case"dragend":Ui=!1,Ns(N,l,A);break;case"selectionchange":if(fv)break;case"keydown":case"keyup":Ns(N,l,A)}var te;if(ji)e:{switch(e){case"compositionstart":var ue="onCompositionStart";break e;case"compositionend":ue="onCompositionEnd";break e;case"compositionupdate":ue="onCompositionUpdate";break e}ue=void 0}else oa?ms(e,l)&&(ue="onCompositionEnd"):e==="keydown"&&l.keyCode===229&&(ue="onCompositionStart");ue&&(rs&&l.locale!=="ko"&&(oa||ue!=="onCompositionStart"?ue==="onCompositionEnd"&&oa&&(te=cs()):(sl=A,Ti="value"in sl?sl.value:sl.textContent,oa=!0)),X=Zu(S,ue),0<X.length&&(ue=new os(ue,e,null,l,A),N.push({event:ue,listeners:X}),te?ue.data=te:(te=ys(l),te!==null&&(ue.data=te)))),(te=Ih?Ph(e,l):ev(e,l))&&(ue=Zu(S,"onBeforeInput"),0<ue.length&&(X=new os("onBeforeInput","beforeinput",null,l,A),N.push({event:X,listeners:ue}),X.data=te)),Kv(N,e,S,l,A)}tr(N,t)})}function Nn(e,t,l){return{instance:e,listener:t,currentTarget:l}}function Zu(e,t){for(var l=t+"Capture",a=[];e!==null;){var n=e,u=n.stateNode;if(n=n.tag,n!==5&&n!==26&&n!==27||u===null||(n=ka(e,l),n!=null&&a.unshift(Nn(e,n,u)),n=ka(e,t),n!=null&&a.push(Nn(e,n,u))),e.tag===3)return a;e=e.return}return[]}function $v(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function ar(e,t,l,a,n){for(var u=t._reactName,i=[];l!==null&&l!==a;){var f=l,h=f.alternate,S=f.stateNode;if(f=f.tag,h!==null&&h===a)break;f!==5&&f!==26&&f!==27||S===null||(h=S,n?(S=ka(l,u),S!=null&&i.unshift(Nn(l,S,h))):n||(S=ka(l,u),S!=null&&i.push(Nn(l,S,h)))),l=l.return}i.length!==0&&e.push({event:t,listeners:i})}var Wv=/\\r\\n?/g,Fv=/\\u0000|\\uFFFD/g;function nr(e){return(typeof e=="string"?e:""+e).replace(Wv,\`
|
|
16
|
+
\`).replace(Fv,"")}function ur(e,t){return t=nr(t),nr(e)===t}function Se(e,t,l,a,n,u){switch(l){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||ca(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&ca(e,""+a);break;case"className":Jn(e,"class",a);break;case"tabIndex":Jn(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":Jn(e,l,a);break;case"style":ns(e,a,u);break;case"data":if(t!=="object"){Jn(e,"data",a);break}case"src":case"href":if(a===""&&(t!=="a"||l!=="href")){e.removeAttribute(l);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(l);break}a=$n(""+a),e.setAttribute(l,a);break;case"action":case"formAction":if(typeof a=="function"){e.setAttribute(l,"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"&&(l==="formAction"?(t!=="input"&&Se(e,t,"name",n.name,n,null),Se(e,t,"formEncType",n.formEncType,n,null),Se(e,t,"formMethod",n.formMethod,n,null),Se(e,t,"formTarget",n.formTarget,n,null)):(Se(e,t,"encType",n.encType,n,null),Se(e,t,"method",n.method,n,null),Se(e,t,"target",n.target,n,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(l);break}a=$n(""+a),e.setAttribute(l,a);break;case"onClick":a!=null&&(e.onclick=Zt);break;case"onScroll":a!=null&&ae("scroll",e);break;case"onScrollEnd":a!=null&&ae("scrollend",e);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(o(61));if(l=a.__html,l!=null){if(n.children!=null)throw Error(o(60));e.innerHTML=l}}break;case"multiple":e.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":e.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){e.removeAttribute("xlink:href");break}l=$n(""+a),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(l,""+a):e.removeAttribute(l);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":a&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(l,""):e.removeAttribute(l);break;case"capture":case"download":a===!0?e.setAttribute(l,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(l,a):e.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?e.setAttribute(l,a):e.removeAttribute(l);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?e.removeAttribute(l):e.setAttribute(l,a);break;case"popover":ae("beforetoggle",e),ae("toggle",e),Vn(e,"popover",a);break;case"xlinkActuate":Qt(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":Qt(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":Qt(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":Qt(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":Qt(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":Qt(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":Qt(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":Qt(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":Qt(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":Vn(e,"is",a);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=xh.get(l)||l,Vn(e,l,a))}}function lf(e,t,l,a,n,u){switch(l){case"style":ns(e,a,u);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(o(61));if(l=a.__html,l!=null){if(n.children!=null)throw Error(o(60));e.innerHTML=l}}break;case"children":typeof a=="string"?ca(e,a):(typeof a=="number"||typeof a=="bigint")&&ca(e,""+a);break;case"onScroll":a!=null&&ae("scroll",e);break;case"onScrollEnd":a!=null&&ae("scrollend",e);break;case"onClick":a!=null&&(e.onclick=Zt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!$f.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(n=l.endsWith("Capture"),t=l.slice(2,n?l.length-7:void 0),u=e[tt]||null,u=u!=null?u[l]:null,typeof u=="function"&&e.removeEventListener(t,u,n),typeof a=="function")){typeof u!="function"&&u!==null&&(l in e?e[l]=null:e.hasAttribute(l)&&e.removeAttribute(l)),e.addEventListener(t,a,n);break e}l in e?e[l]=a:a===!0?e.setAttribute(l,""):Vn(e,l,a)}}}function $e(e,t,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ae("error",e),ae("load",e);var a=!1,n=!1,u;for(u in l)if(l.hasOwnProperty(u)){var i=l[u];if(i!=null)switch(u){case"src":a=!0;break;case"srcSet":n=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Se(e,t,u,i,l,null)}}n&&Se(e,t,"srcSet",l.srcSet,l,null),a&&Se(e,t,"src",l.src,l,null);return;case"input":ae("invalid",e);var f=u=i=n=null,h=null,S=null;for(a in l)if(l.hasOwnProperty(a)){var A=l[a];if(A!=null)switch(a){case"name":n=A;break;case"type":i=A;break;case"checked":h=A;break;case"defaultChecked":S=A;break;case"value":u=A;break;case"defaultValue":f=A;break;case"children":case"dangerouslySetInnerHTML":if(A!=null)throw Error(o(137,t));break;default:Se(e,t,a,A,l,null)}}es(e,u,f,h,S,i,n,!1);return;case"select":ae("invalid",e),a=i=u=null;for(n in l)if(l.hasOwnProperty(n)&&(f=l[n],f!=null))switch(n){case"value":u=f;break;case"defaultValue":i=f;break;case"multiple":a=f;default:Se(e,t,n,f,l,null)}t=u,l=i,e.multiple=!!a,t!=null?ia(e,!!a,t,!1):l!=null&&ia(e,!!a,l,!0);return;case"textarea":ae("invalid",e),u=n=a=null;for(i in l)if(l.hasOwnProperty(i)&&(f=l[i],f!=null))switch(i){case"value":a=f;break;case"defaultValue":n=f;break;case"children":u=f;break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(o(91));break;default:Se(e,t,i,f,l,null)}ls(e,a,n,u);return;case"option":for(h in l)if(l.hasOwnProperty(h)&&(a=l[h],a!=null))switch(h){case"selected":e.selected=a&&typeof a!="function"&&typeof a!="symbol";break;default:Se(e,t,h,a,l,null)}return;case"dialog":ae("beforetoggle",e),ae("toggle",e),ae("cancel",e),ae("close",e);break;case"iframe":case"object":ae("load",e);break;case"video":case"audio":for(a=0;a<_n.length;a++)ae(_n[a],e);break;case"image":ae("error",e),ae("load",e);break;case"details":ae("toggle",e);break;case"embed":case"source":case"link":ae("error",e),ae("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(S in l)if(l.hasOwnProperty(S)&&(a=l[S],a!=null))switch(S){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Se(e,t,S,a,l,null)}return;default:if(yi(t)){for(A in l)l.hasOwnProperty(A)&&(a=l[A],a!==void 0&&lf(e,t,A,a,l,void 0));return}}for(f in l)l.hasOwnProperty(f)&&(a=l[f],a!=null&&Se(e,t,f,a,l,null))}function Iv(e,t,l,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var n=null,u=null,i=null,f=null,h=null,S=null,A=null;for(T in l){var N=l[T];if(l.hasOwnProperty(T)&&N!=null)switch(T){case"checked":break;case"value":break;case"defaultValue":h=N;default:a.hasOwnProperty(T)||Se(e,t,T,null,a,N)}}for(var p in a){var T=a[p];if(N=l[p],a.hasOwnProperty(p)&&(T!=null||N!=null))switch(p){case"type":u=T;break;case"name":n=T;break;case"checked":S=T;break;case"defaultChecked":A=T;break;case"value":i=T;break;case"defaultValue":f=T;break;case"children":case"dangerouslySetInnerHTML":if(T!=null)throw Error(o(137,t));break;default:T!==N&&Se(e,t,p,T,a,N)}}vi(e,i,f,h,S,A,u,n);return;case"select":T=i=f=p=null;for(u in l)if(h=l[u],l.hasOwnProperty(u)&&h!=null)switch(u){case"value":break;case"multiple":T=h;default:a.hasOwnProperty(u)||Se(e,t,u,null,a,h)}for(n in a)if(u=a[n],h=l[n],a.hasOwnProperty(n)&&(u!=null||h!=null))switch(n){case"value":p=u;break;case"defaultValue":f=u;break;case"multiple":i=u;default:u!==h&&Se(e,t,n,u,a,h)}t=f,l=i,a=T,p!=null?ia(e,!!l,p,!1):!!a!=!!l&&(t!=null?ia(e,!!l,t,!0):ia(e,!!l,l?[]:"",!1));return;case"textarea":T=p=null;for(f in l)if(n=l[f],l.hasOwnProperty(f)&&n!=null&&!a.hasOwnProperty(f))switch(f){case"value":break;case"children":break;default:Se(e,t,f,null,a,n)}for(i in a)if(n=a[i],u=l[i],a.hasOwnProperty(i)&&(n!=null||u!=null))switch(i){case"value":p=n;break;case"defaultValue":T=n;break;case"children":break;case"dangerouslySetInnerHTML":if(n!=null)throw Error(o(91));break;default:n!==u&&Se(e,t,i,n,a,u)}ts(e,p,T);return;case"option":for(var G in l)if(p=l[G],l.hasOwnProperty(G)&&p!=null&&!a.hasOwnProperty(G))switch(G){case"selected":e.selected=!1;break;default:Se(e,t,G,null,a,p)}for(h in a)if(p=a[h],T=l[h],a.hasOwnProperty(h)&&p!==T&&(p!=null||T!=null))switch(h){case"selected":e.selected=p&&typeof p!="function"&&typeof p!="symbol";break;default:Se(e,t,h,p,a,T)}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 K in l)p=l[K],l.hasOwnProperty(K)&&p!=null&&!a.hasOwnProperty(K)&&Se(e,t,K,null,a,p);for(S in a)if(p=a[S],T=l[S],a.hasOwnProperty(S)&&p!==T&&(p!=null||T!=null))switch(S){case"children":case"dangerouslySetInnerHTML":if(p!=null)throw Error(o(137,t));break;default:Se(e,t,S,p,a,T)}return;default:if(yi(t)){for(var pe in l)p=l[pe],l.hasOwnProperty(pe)&&p!==void 0&&!a.hasOwnProperty(pe)&&lf(e,t,pe,void 0,a,p);for(A in a)p=a[A],T=l[A],!a.hasOwnProperty(A)||p===T||p===void 0&&T===void 0||lf(e,t,A,p,a,T);return}}for(var y in l)p=l[y],l.hasOwnProperty(y)&&p!=null&&!a.hasOwnProperty(y)&&Se(e,t,y,null,a,p);for(N in a)p=a[N],T=l[N],!a.hasOwnProperty(N)||p===T||p==null&&T==null||Se(e,t,N,p,a,T)}function ir(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Pv(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,l=performance.getEntriesByType("resource"),a=0;a<l.length;a++){var n=l[a],u=n.transferSize,i=n.initiatorType,f=n.duration;if(u&&f&&ir(i)){for(i=0,f=n.responseEnd,a+=1;a<l.length;a++){var h=l[a],S=h.startTime;if(S>f)break;var A=h.transferSize,N=h.initiatorType;A&&ir(N)&&(h=h.responseEnd,i+=A*(h<f?1:(f-S)/(h-S)))}if(--a,t+=8*(u+i)/(n.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 af=null,nf=null;function Lu(e){return e.nodeType===9?e:e.ownerDocument}function cr(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 fr(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 uf(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 cf=null;function em(){var e=window.event;return e&&e.type==="popstate"?e===cf?!1:(cf=e,!0):(cf=null,!1)}var sr=typeof setTimeout=="function"?setTimeout:void 0,tm=typeof clearTimeout=="function"?clearTimeout:void 0,or=typeof Promise=="function"?Promise:void 0,lm=typeof queueMicrotask=="function"?queueMicrotask:typeof or<"u"?function(e){return or.resolve(null).then(e).catch(am)}:sr;function am(e){setTimeout(function(){throw e})}function jl(e){return e==="head"}function dr(e,t){var l=t,a=0;do{var n=l.nextSibling;if(e.removeChild(l),n&&n.nodeType===8)if(l=n.data,l==="/$"||l==="/&"){if(a===0){e.removeChild(n),Ya(t);return}a--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")a++;else if(l==="html")On(e.ownerDocument.documentElement);else if(l==="head"){l=e.ownerDocument.head,On(l);for(var u=l.firstChild;u;){var i=u.nextSibling,f=u.nodeName;u[Va]||f==="SCRIPT"||f==="STYLE"||f==="LINK"&&u.rel.toLowerCase()==="stylesheet"||l.removeChild(u),u=i}}else l==="body"&&On(e.ownerDocument.body);l=n}while(l);Ya(t)}function rr(e,t){var l=e;e=0;do{var a=l.nextSibling;if(l.nodeType===1?t?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(t?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),a&&a.nodeType===8)if(l=a.data,l==="/$"){if(e===0)break;e--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||e++;l=a}while(l)}function ff(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var l=t;switch(t=t.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":ff(l),ri(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}e.removeChild(l)}}function nm(e,t,l,a){for(;e.nodeType===1;){var n=l;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!a&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(a){if(!e[Va])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!==n.rel||e.getAttribute("href")!==(n.href==null||n.href===""?null:n.href)||e.getAttribute("crossorigin")!==(n.crossOrigin==null?null:n.crossOrigin)||e.getAttribute("title")!==(n.title==null?null:n.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(u=e.getAttribute("src"),(u!==(n.src==null?null:n.src)||e.getAttribute("type")!==(n.type==null?null:n.type)||e.getAttribute("crossorigin")!==(n.crossOrigin==null?null:n.crossOrigin))&&u&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var u=n.name==null?null:""+n.name;if(n.type==="hidden"&&e.getAttribute("name")===u)return e}else return e;if(e=_t(e.nextSibling),e===null)break}return null}function um(e,t,l){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!l||(e=_t(e.nextSibling),e===null))return null;return e}function hr(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=_t(e.nextSibling),e===null))return null;return e}function sf(e){return e.data==="$?"||e.data==="$~"}function of(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function im(e,t){var l=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||l.readyState!=="loading")t();else{var a=function(){t(),l.removeEventListener("DOMContentLoaded",a)};l.addEventListener("DOMContentLoaded",a),e._reactRetry=a}}function _t(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 df=null;function vr(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="/$"||l==="/&"){if(t===0)return _t(e.nextSibling);t--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||t++}e=e.nextSibling}return null}function mr(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(t===0)return e;t--}else l!=="/$"&&l!=="/&"||t++}e=e.previousSibling}return null}function yr(e,t,l){switch(t=Lu(l),e){case"html":if(e=t.documentElement,!e)throw Error(o(452));return e;case"head":if(e=t.head,!e)throw Error(o(453));return e;case"body":if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function On(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ri(e)}var Nt=new Map,gr=new Set;function Ku(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ul=R.d;R.d={f:cm,r:fm,D:sm,C:om,L:dm,m:rm,X:vm,S:hm,M:mm};function cm(){var e=ul.f(),t=qu();return e||t}function fm(e){var t=aa(e);t!==null&&t.tag===5&&t.type==="form"?Ro(t):ul.r(e)}var Ha=typeof document>"u"?null:document;function br(e,t,l){var a=Ha;if(a&&typeof t=="string"&&t){var n=pt(t);n='link[rel="'+e+'"][href="'+n+'"]',typeof l=="string"&&(n+='[crossorigin="'+l+'"]'),gr.has(n)||(gr.add(n),e={rel:e,crossOrigin:l,href:t},a.querySelector(n)===null&&(t=a.createElement("link"),$e(t,"link",e),Qe(t),a.head.appendChild(t)))}}function sm(e){ul.D(e),br("dns-prefetch",e,null)}function om(e,t){ul.C(e,t),br("preconnect",e,t)}function dm(e,t,l){ul.L(e,t,l);var a=Ha;if(a&&e&&t){var n='link[rel="preload"][as="'+pt(t)+'"]';t==="image"&&l&&l.imageSrcSet?(n+='[imagesrcset="'+pt(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(n+='[imagesizes="'+pt(l.imageSizes)+'"]')):n+='[href="'+pt(e)+'"]';var u=n;switch(t){case"style":u=qa(e);break;case"script":u=Ba(e)}Nt.has(u)||(e=E({rel:"preload",href:t==="image"&&l&&l.imageSrcSet?void 0:e,as:t},l),Nt.set(u,e),a.querySelector(n)!==null||t==="style"&&a.querySelector(Mn(u))||t==="script"&&a.querySelector(Un(u))||(t=a.createElement("link"),$e(t,"link",e),Qe(t),a.head.appendChild(t)))}}function rm(e,t){ul.m(e,t);var l=Ha;if(l&&e){var a=t&&typeof t.as=="string"?t.as:"script",n='link[rel="modulepreload"][as="'+pt(a)+'"][href="'+pt(e)+'"]',u=n;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=Ba(e)}if(!Nt.has(u)&&(e=E({rel:"modulepreload",href:e},t),Nt.set(u,e),l.querySelector(n)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Un(u)))return}a=l.createElement("link"),$e(a,"link",e),Qe(a),l.head.appendChild(a)}}}function hm(e,t,l){ul.S(e,t,l);var a=Ha;if(a&&e){var n=na(a).hoistableStyles,u=qa(e);t=t||"default";var i=n.get(u);if(!i){var f={loading:0,preload:null};if(i=a.querySelector(Mn(u)))f.loading=5;else{e=E({rel:"stylesheet",href:e,"data-precedence":t},l),(l=Nt.get(u))&&rf(e,l);var h=i=a.createElement("link");Qe(h),$e(h,"link",e),h._p=new Promise(function(S,A){h.onload=S,h.onerror=A}),h.addEventListener("load",function(){f.loading|=1}),h.addEventListener("error",function(){f.loading|=2}),f.loading|=4,Vu(i,t,a)}i={type:"stylesheet",instance:i,count:1,state:f},n.set(u,i)}}}function vm(e,t){ul.X(e,t);var l=Ha;if(l&&e){var a=na(l).hoistableScripts,n=Ba(e),u=a.get(n);u||(u=l.querySelector(Un(n)),u||(e=E({src:e,async:!0},t),(t=Nt.get(n))&&hf(e,t),u=l.createElement("script"),Qe(u),$e(u,"link",e),l.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},a.set(n,u))}}function mm(e,t){ul.M(e,t);var l=Ha;if(l&&e){var a=na(l).hoistableScripts,n=Ba(e),u=a.get(n);u||(u=l.querySelector(Un(n)),u||(e=E({src:e,async:!0,type:"module"},t),(t=Nt.get(n))&&hf(e,t),u=l.createElement("script"),Qe(u),$e(u,"link",e),l.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},a.set(n,u))}}function Sr(e,t,l,a){var n=(n=k.current)?Ku(n):null;if(!n)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(t=qa(l.href),l=na(n).hoistableStyles,a=l.get(t),a||(a={type:"style",instance:null,count:0,state:null},l.set(t,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){e=qa(l.href);var u=na(n).hoistableStyles,i=u.get(e);if(i||(n=n.ownerDocument||n,i={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,i),(u=n.querySelector(Mn(e)))&&!u._p&&(i.instance=u,i.state.loading=5),Nt.has(e)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Nt.set(e,l),u||ym(n,e,l,i.state))),t&&a===null)throw Error(o(528,""));return i}if(t&&a!==null)throw Error(o(529,""));return null;case"script":return t=l.async,l=l.src,typeof l=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Ba(l),l=na(n).hoistableScripts,a=l.get(t),a||(a={type:"script",instance:null,count:0,state:null},l.set(t,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function qa(e){return'href="'+pt(e)+'"'}function Mn(e){return'link[rel="stylesheet"]['+e+"]"}function pr(e){return E({},e,{"data-precedence":e.precedence,precedence:null})}function ym(e,t,l,a){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?a.loading=1:(t=e.createElement("link"),a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2}),$e(t,"link",l),Qe(t),e.head.appendChild(t))}function Ba(e){return'[src="'+pt(e)+'"]'}function Un(e){return"script[async]"+e}function Tr(e,t,l){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+pt(l.href)+'"]');if(a)return t.instance=a,Qe(a),a;var n=E({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),Qe(a),$e(a,"style",n),Vu(a,l.precedence,e),t.instance=a;case"stylesheet":n=qa(l.href);var u=e.querySelector(Mn(n));if(u)return t.state.loading|=4,t.instance=u,Qe(u),u;a=pr(l),(n=Nt.get(n))&&rf(a,n),u=(e.ownerDocument||e).createElement("link"),Qe(u);var i=u;return i._p=new Promise(function(f,h){i.onload=f,i.onerror=h}),$e(u,"link",a),t.state.loading|=4,Vu(u,l.precedence,e),t.instance=u;case"script":return u=Ba(l.src),(n=e.querySelector(Un(u)))?(t.instance=n,Qe(n),n):(a=l,(n=Nt.get(u))&&(a=E({},l),hf(a,n)),e=e.ownerDocument||e,n=e.createElement("script"),Qe(n),$e(n,"link",a),e.head.appendChild(n),t.instance=n);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,Vu(a,l.precedence,e));return t.instance}function Vu(e,t,l){for(var a=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),n=a.length?a[a.length-1]:null,u=n,i=0;i<a.length;i++){var f=a[i];if(f.dataset.precedence===t)u=f;else if(u!==n)break}u?u.parentNode.insertBefore(e,u.nextSibling):(t=l.nodeType===9?l.head:l,t.insertBefore(e,t.firstChild))}function rf(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function hf(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Ju=null;function Er(e,t,l){if(Ju===null){var a=new Map,n=Ju=new Map;n.set(l,a)}else n=Ju,a=n.get(l),a||(a=new Map,n.set(l,a));if(a.has(e))return a;for(a.set(e,null),l=l.getElementsByTagName(e),n=0;n<l.length;n++){var u=l[n];if(!(u[Va]||u[Ke]||e==="link"&&u.getAttribute("rel")==="stylesheet")&&u.namespaceURI!=="http://www.w3.org/2000/svg"){var i=u.getAttribute(t)||"";i=e+i;var f=a.get(i);f?f.push(u):a.set(i,[u])}}return a}function zr(e,t,l){e=e.ownerDocument||e,e.head.insertBefore(l,t==="title"?e.querySelector("head > title"):null)}function gm(e,t,l){if(l===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 Ar(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function bm(e,t,l,a){if(l.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var n=qa(a.href),u=t.querySelector(Mn(n));if(u){t=u._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=ku.bind(e),t.then(e,e)),l.state.loading|=4,l.instance=u,Qe(u);return}u=t.ownerDocument||t,a=pr(a),(n=Nt.get(n))&&rf(a,n),u=u.createElement("link"),Qe(u);var i=u;i._p=new Promise(function(f,h){i.onload=f,i.onerror=h}),$e(u,"link",a),l.instance=u}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(l,t),(t=l.state.preload)&&(l.state.loading&3)===0&&(e.count++,l=ku.bind(e),t.addEventListener("load",l),t.addEventListener("error",l))}}var vf=0;function Sm(e,t){return e.stylesheets&&e.count===0&&Wu(e,e.stylesheets),0<e.count||0<e.imgCount?function(l){var a=setTimeout(function(){if(e.stylesheets&&Wu(e,e.stylesheets),e.unsuspend){var u=e.unsuspend;e.unsuspend=null,u()}},6e4+t);0<e.imgBytes&&vf===0&&(vf=62500*Pv());var n=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Wu(e,e.stylesheets),e.unsuspend)){var u=e.unsuspend;e.unsuspend=null,u()}},(e.imgBytes>vf?50:800)+t);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(n)}}:null}function ku(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Wu(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var $u=null;function Wu(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,$u=new Map,t.forEach(pm,e),$u=null,ku.call(e))}function pm(e,t){if(!(t.state.loading&4)){var l=$u.get(e);if(l)var a=l.get(null);else{l=new Map,$u.set(e,l);for(var n=e.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u<n.length;u++){var i=n[u];(i.nodeName==="LINK"||i.getAttribute("media")!=="not all")&&(l.set(i.dataset.precedence,i),a=i)}a&&l.set(null,a)}n=t.instance,i=n.getAttribute("data-precedence"),u=l.get(i)||a,u===a&&l.set(null,n),l.set(i,n),this.count++,a=ku.bind(this),n.addEventListener("load",a),n.addEventListener("error",a),u?u.parentNode.insertBefore(n,u.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(n,e.firstChild)),t.state.loading|=4}}var Dn={$$typeof:_e,Provider:null,Consumer:null,_currentValue:V,_currentValue2:V,_threadCount:0};function Tm(e,t,l,a,n,u,i,f,h){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=fi(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=fi(0),this.hiddenUpdates=fi(null),this.identifierPrefix=a,this.onUncaughtError=n,this.onCaughtError=u,this.onRecoverableError=i,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=h,this.incompleteTransitions=new Map}function xr(e,t,l,a,n,u,i,f,h,S,A,N){return e=new Tm(e,t,l,i,h,S,A,N,f),t=1,u===!0&&(t|=24),u=ht(3,null,null,t),e.current=u,u.stateNode=e,t=Vi(),t.refCount++,e.pooledCache=t,t.refCount++,u.memoizedState={element:a,isDehydrated:l,cache:t},Wi(u),e}function jr(e){return e?(e=va,e):va}function _r(e,t,l,a,n,u){n=jr(n),a.context===null?a.context=n:a.pendingContext=n,a=ml(t),a.payload={element:l},u=u===void 0?null:u,u!==null&&(a.callback=u),l=yl(e,a,t),l!==null&&(ct(l,e,t),on(l,e,t))}function Nr(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var l=e.retryLane;e.retryLane=l!==0&&l<t?l:t}}function mf(e,t){Nr(e,t),(e=e.alternate)&&Nr(e,t)}function Or(e){if(e.tag===13||e.tag===31){var t=wl(e,67108864);t!==null&&ct(t,e,67108864),mf(e,67108864)}}function Mr(e){if(e.tag===13||e.tag===31){var t=bt();t=si(t);var l=wl(e,t);l!==null&&ct(l,e,t),mf(e,t)}}var Fu=!0;function Em(e,t,l,a){var n=x.T;x.T=null;var u=R.p;try{R.p=2,yf(e,t,l,a)}finally{R.p=u,x.T=n}}function zm(e,t,l,a){var n=x.T;x.T=null;var u=R.p;try{R.p=8,yf(e,t,l,a)}finally{R.p=u,x.T=n}}function yf(e,t,l,a){if(Fu){var n=gf(a);if(n===null)tf(e,t,a,Iu,l),Dr(e,a);else if(xm(n,e,t,l,a))a.stopPropagation();else if(Dr(e,a),t&4&&-1<Am.indexOf(e)){for(;n!==null;){var u=aa(n);if(u!==null)switch(u.tag){case 3:if(u=u.stateNode,u.current.memoizedState.isDehydrated){var i=Rl(u.pendingLanes);if(i!==0){var f=u;for(f.pendingLanes|=2,f.entangledLanes|=2;i;){var h=1<<31-dt(i);f.entanglements[1]|=h,i&=~h}Gt(u),(me&6)===0&&(Ru=Le()+500,jn(0))}}break;case 31:case 13:f=wl(u,2),f!==null&&ct(f,u,2),qu(),mf(u,2)}if(u=gf(a),u===null&&tf(e,t,a,Iu,l),u===n)break;n=u}n!==null&&a.stopPropagation()}else tf(e,t,a,null,l)}}function gf(e){return e=bi(e),bf(e)}var Iu=null;function bf(e){if(Iu=null,e=la(e),e!==null){var t=z(e);if(t===null)e=null;else{var l=t.tag;if(l===13){if(e=C(t),e!==null)return e;e=null}else if(l===31){if(e=L(t),e!==null)return e;e=null}else if(l===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Iu=e,null}function Ur(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(Qa()){case Yf:return 2;case wf:return 8;case Xn:case oh:return 32;case Gf:return 268435456;default:return 32}default:return 32}}var Sf=!1,_l=null,Nl=null,Ol=null,Cn=new Map,Rn=new Map,Ml=[],Am="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 Dr(e,t){switch(e){case"focusin":case"focusout":_l=null;break;case"dragenter":case"dragleave":Nl=null;break;case"mouseover":case"mouseout":Ol=null;break;case"pointerover":case"pointerout":Cn.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Rn.delete(t.pointerId)}}function Hn(e,t,l,a,n,u){return e===null||e.nativeEvent!==u?(e={blockedOn:t,domEventName:l,eventSystemFlags:a,nativeEvent:u,targetContainers:[n]},t!==null&&(t=aa(t),t!==null&&Or(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,n!==null&&t.indexOf(n)===-1&&t.push(n),e)}function xm(e,t,l,a,n){switch(t){case"focusin":return _l=Hn(_l,e,t,l,a,n),!0;case"dragenter":return Nl=Hn(Nl,e,t,l,a,n),!0;case"mouseover":return Ol=Hn(Ol,e,t,l,a,n),!0;case"pointerover":var u=n.pointerId;return Cn.set(u,Hn(Cn.get(u)||null,e,t,l,a,n)),!0;case"gotpointercapture":return u=n.pointerId,Rn.set(u,Hn(Rn.get(u)||null,e,t,l,a,n)),!0}return!1}function Cr(e){var t=la(e.target);if(t!==null){var l=z(t);if(l!==null){if(t=l.tag,t===13){if(t=C(l),t!==null){e.blockedOn=t,Vf(e.priority,function(){Mr(l)});return}}else if(t===31){if(t=L(l),t!==null){e.blockedOn=t,Vf(e.priority,function(){Mr(l)});return}}else if(t===3&&l.stateNode.current.memoizedState.isDehydrated){e.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Pu(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var l=gf(e.nativeEvent);if(l===null){l=e.nativeEvent;var a=new l.constructor(l.type,l);gi=a,l.target.dispatchEvent(a),gi=null}else return t=aa(l),t!==null&&Or(t),e.blockedOn=l,!1;t.shift()}return!0}function Rr(e,t,l){Pu(e)&&l.delete(t)}function jm(){Sf=!1,_l!==null&&Pu(_l)&&(_l=null),Nl!==null&&Pu(Nl)&&(Nl=null),Ol!==null&&Pu(Ol)&&(Ol=null),Cn.forEach(Rr),Rn.forEach(Rr)}function ei(e,t){e.blockedOn===t&&(e.blockedOn=null,Sf||(Sf=!0,c.unstable_scheduleCallback(c.unstable_NormalPriority,jm)))}var ti=null;function Hr(e){ti!==e&&(ti=e,c.unstable_scheduleCallback(c.unstable_NormalPriority,function(){ti===e&&(ti=null);for(var t=0;t<e.length;t+=3){var l=e[t],a=e[t+1],n=e[t+2];if(typeof a!="function"){if(bf(a||l)===null)continue;break}var u=aa(l);u!==null&&(e.splice(t,3),t-=3,yc(u,{pending:!0,data:n,method:l.method,action:a},a,n))}}))}function Ya(e){function t(h){return ei(h,e)}_l!==null&&ei(_l,e),Nl!==null&&ei(Nl,e),Ol!==null&&ei(Ol,e),Cn.forEach(t),Rn.forEach(t);for(var l=0;l<Ml.length;l++){var a=Ml[l];a.blockedOn===e&&(a.blockedOn=null)}for(;0<Ml.length&&(l=Ml[0],l.blockedOn===null);)Cr(l),l.blockedOn===null&&Ml.shift();if(l=(e.ownerDocument||e).$$reactFormReplay,l!=null)for(a=0;a<l.length;a+=3){var n=l[a],u=l[a+1],i=n[tt]||null;if(typeof u=="function")i||Hr(l);else if(i){var f=null;if(u&&u.hasAttribute("formAction")){if(n=u,i=u[tt]||null)f=i.formAction;else if(bf(n)!==null)continue}else f=i.action;typeof f=="function"?l[a+1]=f:(l.splice(a,3),a-=3),Hr(l)}}}function qr(){function e(u){u.canIntercept&&u.info==="react-transition"&&u.intercept({handler:function(){return new Promise(function(i){return n=i})},focusReset:"manual",scroll:"manual"})}function t(){n!==null&&(n(),n=null),a||setTimeout(l,20)}function l(){if(!a&&!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 a=!1,n=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(l,100),function(){a=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),n!==null&&(n(),n=null)}}}function pf(e){this._internalRoot=e}li.prototype.render=pf.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var l=t.current,a=bt();_r(l,a,e,t,null,null)},li.prototype.unmount=pf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;_r(e.current,2,null,e,null,null),qu(),t[ta]=null}};function li(e){this._internalRoot=e}li.prototype.unstable_scheduleHydration=function(e){if(e){var t=Kf();e={blockedOn:null,target:e,priority:t};for(var l=0;l<Ml.length&&t!==0&&t<Ml[l].priority;l++);Ml.splice(l,0,e),l===0&&Cr(e)}};var Br=s.version;if(Br!=="19.2.8")throw Error(o(527,Br,"19.2.8"));R.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=g(t),e=e!==null?D(e):null,e=e===null?null:e.stateNode,e};var _m={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:x,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ai=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ai.isDisabled&&ai.supportsFiber)try{Za=ai.inject(_m),ot=ai}catch{}}return Bn.createRoot=function(e,t){if(!j(e))throw Error(o(299));var l=!1,a="",n=Lo,u=Ko,i=Vo;return t!=null&&(t.unstable_strictMode===!0&&(l=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onUncaughtError!==void 0&&(n=t.onUncaughtError),t.onCaughtError!==void 0&&(u=t.onCaughtError),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=xr(e,1,!1,null,null,l,a,null,n,u,i,qr),e[ta]=t.current,ef(e),new pf(t)},Bn.hydrateRoot=function(e,t,l){if(!j(e))throw Error(o(299));var a=!1,n="",u=Lo,i=Ko,f=Vo,h=null;return l!=null&&(l.unstable_strictMode===!0&&(a=!0),l.identifierPrefix!==void 0&&(n=l.identifierPrefix),l.onUncaughtError!==void 0&&(u=l.onUncaughtError),l.onCaughtError!==void 0&&(i=l.onCaughtError),l.onRecoverableError!==void 0&&(f=l.onRecoverableError),l.formState!==void 0&&(h=l.formState)),t=xr(e,1,!0,t,l??null,a,n,h,u,i,f,qr),t.context=jr(null),l=t.current,a=bt(),a=si(a),n=ml(a),n.callback=null,yl(l,n,a),l=a,t.current.lanes=l,Ka(t,l),Gt(t),e[ta]=t.current,ef(e),new li(t)},Bn.version="19.2.8",Bn}var Jr;function Bm(){if(Jr)return zf.exports;Jr=1;function c(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(c)}catch(s){console.error(s)}}return c(),zf.exports=qm(),zf.exports}var Ym=Bm(),wm=["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"],Gm=/\\r\\n\\r\\n|\\n\\n|\\r\\r/;function kr(c){const s=[];let r,o,j;for(const z of c.split(/\\r\\n|\\n|\\r/)){if(z===""||z.startsWith(":"))continue;const C=z.indexOf(":"),L=C===-1?z:z.slice(0,C);let H=C===-1?"":z.slice(C+1);switch(H.startsWith(" ")&&(H=H.slice(1)),L){case"data":s.push(H);break;case"event":r=H;break;case"id":o=H;break;case"retry":{const g=Number.parseInt(H,10);Number.isFinite(g)&&(j=g);break}}}if(!(s.length===0&&r===void 0))return{...r===void 0?{}:{event:r},data:s.join(\`
|
|
17
|
+
\`),...o===void 0?{}:{id:o},...j===void 0?{}:{retry:j}}}async function*Xm(c){const s=new TextDecoder;let r="";for await(const o of c)for(r+=typeof o=="string"?o:s.decode(o,{stream:!0});;){const j=Gm.exec(r);if(j===null)break;const z=r.slice(0,j.index);r=r.slice(j.index+j[0].length);const C=kr(z);C!==void 0&&(yield C)}if(r+=s.decode(),r.trim()!==""){const o=kr(r);o!==void 0&&(yield o)}}function Pr(){return{push:c=>c,endStep:()=>"",end:()=>""}}function Qm(c){return c!=="final"&&c!=="stopped"}function Zm(c,s={}){switch(c){case"final":return;case"max_steps":return\`stopped\${s.steps===void 0?"":\` after \${s.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\${s.durationMs===void 0?"":\` after \${s.durationMs} ms\`} — raise limits.turnTimeoutMs\`;case"stopped":return s.cancelledAfterMs===void 0?"cancelled":\`cancelled after \${s.cancelledAfterMs.toFixed(0)} ms\`;case"error":return}}var Lm="<<<",Km=">>>",Yn=/^\\s*(?:[-*+]\\s+|\\d+[.)]\\s+)?<?\\s*action\\s*:\\s*(.+?)\\s*>?\\s*$/i,Vm=/^\\s*(?:[-*+]\\s+|\\d+[.)]\\s+)?([A-Za-z_][\\w.-]*?)\\s*:\\s*(.*)$/,Uf=/^\\s*\`{3,}\\s*[\\w+-]*\\s*$/,_f=/^\\s*end\\s*$/i,Jm=/^\\s*<\\s*action\\s*>\\s*$/i,$r=/^\\s*<\\s*\\/\\s*action\\s*>\\s*$/i,km=/^\\s*<\\/?\\s*[A-Za-z_][\\w.:-]*\\s*\\/?\\s*>\\s*$/;function Nf(c){return c.replace(/^[\`'"*<]+/,"").replace(/[\`'"*>]+$/,"").replace(/[.,;:]+$/,"").trim()}function eh(c,s,r){const o=c.fields.get(s);o===void 0?c.fields.set(s,[r]):o.push(r)}function th(c){if(c.block===void 0||c.heredocKey===void 0)return;const s=[...c.heredocLines];s[s.length-1]===""&&s.pop(),eh(c.block,c.heredocKey,s.join(\`
|
|
18
|
+
\`)),c.block.wrapped.add(c.heredocKey),c.heredocKey=void 0,c.heredocLines=[]}function Il(c){th(c),c.block!==void 0&&c.blocks.push(c.block),c.block=void 0,c.openKey=void 0,c.awaitingSlug=!1}function Wr(){return{block:void 0,openKey:void 0,severedKey:void 0,severedPending:void 0,heredocKey:void 0,heredocLines:[],justClosed:!1,awaitingSlug:!1,text:[],blocks:[]}}function $m(c,s,r){const o=s.trim();if(c.heredocKey!==void 0){if(o===Km){th(c);return}if(_f.test(o)){Il(c),c.justClosed=!0;return}if(Yn.test(s)){Il(c);const C=Yn.exec(s),L=Nf(C?.[1]??"");L!==""&&(c.block={slug:L,fields:new Map,wrapped:new Set,severed:new Set});return}c.heredocLines.push(s);return}const j=Yn.exec(s);if(j!==null){const C=Nf(j[1]??"");if(Il(c),C==="")return;c.block={slug:C,fields:new Map,wrapped:new Set,severed:new Set};return}if(Jm.test(s)){Il(c),c.awaitingSlug=!0;return}if(c.awaitingSlug){if(o==="")return;if($r.test(s)){c.awaitingSlug=!1;return}const C=Nf(o);c.awaitingSlug=!1,C!==""&&(c.block={slug:C,fields:new Map,wrapped:new Set,severed:new Set});return}if($r.test(s)){c.block!==void 0&&(Il(c),c.justClosed=!0);return}if(km.test(s))return;if(c.block===void 0){if(Uf.test(s)&&(c.justClosed||r())){c.justClosed=!1;return}if(_f.test(o)&&c.severedPending!==void 0){c.severedPending.block.severed.add(c.severedPending.key),c.severedPending=void 0;return}Yn.test(s)&&(c.severedPending=void 0),c.text.push(s),o!==""&&(c.justClosed=!1);return}if(o===""){c.openKey!==void 0&&(c.severedKey=c.openKey),c.openKey=void 0;return}if(_f.test(o)){c.severedKey=void 0,Il(c),c.justClosed=!0;return}if(Uf.test(s))return;const z=Vm.exec(s);if(z!==null){const C=(z[1]??"").trim(),L=(z[2]??"").trim();c.severedKey=void 0,L===Lm?(c.heredocKey=C,c.heredocLines=[],c.openKey=void 0):(eh(c.block,C,L),c.openKey=C);return}if(c.openKey!==void 0){const C=c.block.fields.get(c.openKey),L=C?.[C.length-1];C!==void 0&&L!==void 0&&(C[C.length-1]=L===""?o:\`\${L}
|
|
19
|
+
\${o}\`);return}c.severedKey!==void 0&&(c.severedPending={block:c.block,key:c.severedKey},c.severedKey=void 0),Il(c),c.text.push(s)}function Wm(c){if(/^\\s*(?:[-*+]|\\d+[.)]?)?\\s*$/.test(c))return!0;const s=c.replace(/^\\s*(?:[-*+]\\s+|\\d+[.)]\\s+)?/,"").toLowerCase(),r=s.startsWith("<")?s.slice(1):s;return"action:".startsWith(r)||r.startsWith("action:")||/^<\\/?$/.test(s)||/^<\\/?[a-z_][\\w.:-]*>?$/.test(s)?!0:/^\`{1,3}[\\w+-]*$/.test(s)}function Of(c){return c.endsWith("\\r")?c.slice(0,-1):c}function Fm(){let c=Wr(),s="",r=0,o,j="",z=!1;const C=E=>{if(E==="")return"";if(E.trim()==="")return j+=E,"";const U=j+E;return j="",z?U:(z=!0,U.replace(/^\\s+/,""))},L=(E,U)=>{const J=c.text.length;return $m(c,E,()=>U!==void 0&&Yn.test(U)),c.text.length>J?E:void 0},H=(E,U,J)=>{const W=L(E,U);return W===void 0?"":C(W.slice(J))+C(\`
|
|
20
|
+
\`)},g=E=>{if(o===void 0)return"";const U=o;return o=void 0,H(U,E,0)};return{push(E){let U="";s+=E;let J=s.indexOf(\`
|
|
21
|
+
\`);for(;J!==-1;){const q=Of(s.slice(0,J));s=s.slice(J+1),U+=g(q),c.block===void 0&&Uf.test(q)&&!c.justClosed?o=q:U+=H(q,void 0,r),r=0,J=s.indexOf(\`
|
|
22
|
+
\`)}const W=Of(s);return c.block===void 0&&!c.awaitingSlug&&o===void 0&&!Wm(W)&&(U+=C(W.slice(r)),r=W.length),U},endStep(){const E=D();return j=\`
|
|
23
|
+
|
|
24
|
+
\`,c=Wr(),E},end:D};function D(){let E=g(void 0);const U=Of(s);if(U!==""){const J=L(U,void 0);J!==void 0&&(E+=C(J.slice(r)))}return s="",r=0,o=void 0,E}}class Xt extends Error{code;hint;field;status;request;constructor(s,r={}){super(s.hint===void 0?s.message:\`\${s.message}
|
|
25
|
+
hint: \${s.hint}\`),this.name="DispachError",this.code=s.code,this.hint=s.hint??"",this.field=s.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 Im(c,s){const r=c instanceof Error?c.message:String(c);return new Xt({code:"transport_failed",message:\`\${s.method} \${s.path} did not reach \${s.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."},{...s,cause:c})}async function Pm(c,s){let r;try{const o=await c.json();typeof o.error?.code=="string"&&typeof o.error.message=="string"&&(r={code:o.error.code,message:o.error.message,...o.error.hint===void 0?{}:{hint:o.error.hint},...o.error.field===void 0?{}:{field:o.error.field}})}catch{}return new Xt(r??{code:\`http_\${c.status}\`,message:\`\${s.method} \${s.path} returned \${c.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:c.status,...s})}var lh=new Set(wm);async function*ah(c){for await(const s of Xm(ey(c))){if(s.event===void 0||s.data==="")continue;let r;try{r=JSON.parse(s.data)}catch{continue}yield{name:s.event,data:r}}}async function*ey(c){const s=c.getReader();try{for(;;){const{done:r,value:o}=await s.read();if(r)return;o!==void 0&&(yield o)}}finally{s.releaseLock()}}async function*ty(c){for await(const{name:s,data:r}of ah(c)){if(lh.has(s)){yield{kind:"event",event:r};continue}const o=r??{};switch(s){case"turn.accepted":yield{kind:"accepted",turnId:String(o.turnId??""),sessionKey:String(o.sessionKey??"")};break;case"stream.replay":yield{kind:"replay",report:{state:o.state==="ended"?"ended":"running",events:Number(o.events??0),truncated:o.truncated===!0,dropped:Number(o.dropped??0),chunks:o.chunks==="start"||o.chunks==="partial"?o.chunks:"none"}};break;case"stream.ended":yield{kind:"ended",turnId:String(o.turnId??""),status:String(o.status??"unknown"),steps:typeof o.steps=="number"?o.steps:void 0,errorCode:typeof o.errorCode=="string"?o.errorCode:void 0};break;case"stream.unavailable":yield{kind:"unavailable",turnId:String(o.turnId??""),reason:String(o.reason??"not observable from this process")};break}}}async function*ly(c){for await(const{name:s,data:r}of ah(c)){if(lh.has(s)){yield{kind:"event",event:r};continue}if(s==="stream.subscribed"){const o=r??{};yield{kind:"subscribed",report:{agentId:typeof o.agentId=="string"?o.agentId:null,types:Array.isArray(o.types)?o.types:null,chunks:o.chunks===!0,implied:typeof o.implied=="string"?o.implied:void 0}}}}}async function*ay(c,s={}){for await(const r of c){if(r.kind==="replay"&&r.report.truncated&&s.allowTruncated!==!0)throw new Xt({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 Xt({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 o=r.event.data;o.kind!=="reasoning"&&typeof o.delta=="string"&&(yield o.delta)}}function ny(c){const s=c.baseUrl.replace(/\\/+$/,""),r=c.fetch??fetch,o=(g={})=>({...c.token===void 0?{}:{authorization:\`Bearer \${c.token}\`},...g});async function j(g,D,E={}){let U;try{U=await r(\`\${s}\${D}\`,{method:g,headers:o({...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(J){throw Im(J,{method:g,path:D,baseUrl:s})}if(!U.ok)throw await Pm(U,{method:g,path:D});return U}async function z(g,D,E){return await(await j(g,D,E??{})).json()}async function C(g,D){const E=await j("GET",g,{accept:"text/event-stream",...D===void 0?{}:{signal:D}});if(E.body===null)throw new Xt({code:"no_response_body",message:\`GET \${g} 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:g});return E.body}function L(g,D,E,U={}){const J=q=>q?.chunks===!0?"?chunks=true":"",W={turnId:D,sessionKey:E,replayed:U.replayed===!0,async*stream(q){const Ee=await C(\`/v1/agents/\${encodeURIComponent(g)}/turns/\${encodeURIComponent(D)}/stream\${J(q)}\`,q?.signal);yield*ty(Ee)},async*tokens(q){yield*ay(W.stream({chunks:!0,...q}),{...q?.allowTruncated===void 0?{}:{allowTruncated:q.allowTruncated}})},async text(){for await(const q of W.stream())if(q.kind==="ended"||q.kind==="unavailable"||q.kind==="event"&&q.event.type==="turn.end")break;return(await W.get()).text},get:()=>z("GET",\`/v1/agents/\${encodeURIComponent(g)}/turns/\${encodeURIComponent(D)}\`),async stop(){await j("POST",\`/v1/agents/\${encodeURIComponent(g)}/turns/\${encodeURIComponent(D)}/stop\`)}};return W}function H(g){const D=E=>\`/v1/agents/\${encodeURIComponent(g)}\${E}\`;return{id:g,async send(E,U){const J=await z("POST",D("/messages"),{body:{text:E,...U?.sessionKey===void 0?{}:{sessionKey:U.sessionKey},...U?.deliver===void 0?{}:{deliver:U.deliver},...U?.from===void 0?{}:{from:U.from}},...U?.idempotencyKey===void 0?{}:{headers:{"idempotency-key":U.idempotencyKey}},...U?.signal===void 0?{}:{signal:U.signal}});return L(g,J.turnId,J.sessionKey,{replayed:J.replayed===!0})},turn:E=>L(g,E,""),describe:()=>z("GET",D("")),tools:()=>z("GET",D("/tools")),skills:()=>z("GET",D("/skills")),sessions:()=>z("GET",D("/sessions")),messages:(E,U)=>{const J=new URLSearchParams;U?.before!==void 0&&J.set("before",String(U.before)),U?.limit!==void 0&&J.set("limit",String(U.limit));const W=J.size===0?"":\`?\${J.toString()}\`;return z("GET",D(\`/sessions/\${encodeURIComponent(E)}/messages\${W}\`))},clearSession:E=>z("DELETE",D(\`/sessions/\${encodeURIComponent(E)}\`)),reload:()=>z("POST",D("/reload"),{body:{}}),schedules:async()=>(await z("GET",D("/schedules"))).schedules,approvals:async()=>(await z("GET",D("/approvals"))).approvals,createSchedule:E=>z("POST",D("/schedules"),{body:E}),updateSchedule:(E,U)=>z("PATCH",D(\`/schedules/\${encodeURIComponent(E)}\`),{body:U}),deleteSchedule:async E=>{await z("DELETE",D(\`/schedules/\${encodeURIComponent(E)}\`))},runSchedule:E=>z("POST",D(\`/schedules/\${encodeURIComponent(E)}/run\`),{body:{}}),config:()=>z("GET",D("/config")),setConfig:(E,U,J)=>z("PATCH",D("/config"),{body:{path:E,value:U,...J?.confirm===void 0?{}:{confirm:J.confirm}}}),session:E=>z("GET",D(\`/sessions/\${encodeURIComponent(E)}\`)),setPhase:(E,U)=>z("POST",D(\`/sessions/\${encodeURIComponent(E)}/phase\`),{body:{phase:U}}),approve:async(E,U)=>{await z("POST",D(\`/approvals/\${encodeURIComponent(E)}\`),{body:{granted:U}})},stop:E=>z("POST",D("/stop"),{body:E===void 0?{}:{reason:E}}),start:()=>z("POST",D("/start"),{body:{}}),context:E=>{const U=new URLSearchParams;E?.sessionKey!==void 0&&U.set("sessionKey",E.sessionKey),E?.input!==void 0&&U.set("input",E.input);const J=U.size===0?"":\`?\${U.toString()}\`;return z("GET",D(\`/context\${J}\`))}}}return{agent:H,agents:()=>z("GET","/v1/agents"),health:()=>z("GET","/v1/health"),async ready(){try{return await j("GET","/v1/ready"),!0}catch(g){if(g instanceof Xt&&g.status===503)return!1;throw g}},provision:()=>z("GET","/v1/provision"),keys:()=>z("GET","/v1/keys"),createKey:g=>z("POST","/v1/keys",{body:g}),revokeKey:g=>z("DELETE",\`/v1/keys/\${encodeURIComponent(g)}\`),createAgent:g=>z("POST","/v1/agents",{body:{answers:g}}),async*events(g){const D=new URLSearchParams;g?.agentId!==void 0&&D.set("agentId",g.agentId),g?.types!==void 0&&g.types.length>0&&D.set("types",g.types.join(",")),g?.chunks===!0&&D.set("chunks","true");const E=D.size===0?"":\`?\${D.toString()}\`,U=await C(\`/v1/events\${E}\`,g?.signal);yield*ly(U)}}}function uy(c){return d.jsxs(d.Fragment,{children:[c.state.truncated?d.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,c.state.rows.map(s=>d.jsx(iy,{row:s,onAnswer:c.onAnswer},s.id)),c.state.liveReasoning===""?null:d.jsx(nh,{label:"thinking",text:c.state.liveReasoning,open:!0}),c.state.live===""?null:d.jsx("p",{className:"row",children:c.state.live})]})}function iy(c){const s=c.row;switch(s.kind){case"user":return d.jsx("p",{className:"row user",children:s.text});case"reply":return d.jsx("p",{className:"row",children:s.text});case"reasoning":return d.jsx(nh,{label:"thinking",text:s.text});case"tool":return d.jsxs("div",{className:\`row tool\${s.ok===!1?" failed":""}\`,children:[d.jsx("span",{className:"slug",children:s.slug}),s.mutating?d.jsx("span",{className:"mut",children:" changes things"}):null,d.jsx("span",{className:"out",children:cy(s)}),s.untrusted===!0?d.jsx("div",{className:"fence",children:d.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 d.jsxs("div",{className:"row ask",children:[d.jsxs("div",{children:[d.jsx("strong",{children:s.slug})," needs permission — ",s.reason]}),s.match===void 0?null:d.jsx("div",{className:"what",children:s.match}),s.settled===void 0?d.jsxs("div",{className:"buttons",children:[d.jsx("button",{type:"button",className:"primary",onClick:()=>c.onAnswer(s.approvalId,!0),children:"Allow once"}),d.jsx("button",{type:"button",onClick:()=>c.onAnswer(s.approvalId,!1),children:"Refuse"})]}):d.jsx("div",{className:"settled",children:fy(s.settled)})]});case"note":return d.jsx("p",{className:\`row note\${s.bad?" bad":""}\`,children:s.text})}}function cy(c){if(c.ok===void 0)return" running…";const s=c.bytes===void 0?"":\` · \${c.bytes} bytes\`,r=c.truncated===!0?" · truncated to fit the observation budget":"",o=c.latencyMs===void 0?"":\` · \${c.latencyMs} ms\`;return\`\${c.ok?" ok":" failed"}\${s}\${o}\${r}\`}function fy(c){switch(c){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 nh(c){return d.jsxs("details",{className:"row fold",open:c.open===!0,children:[d.jsxs("summary",{children:[c.label," · ",c.text.length," chars"]}),d.jsx("div",{className:"body",children:c.text})]})}function sy(c){const s=w.useRef(null);return w.useEffect(()=>{const r=s.current;r!==null&&(r.style.height="auto",r.style.height=\`\${Math.min(r.scrollHeight,190)}px\`)},[c.value]),d.jsxs("div",{className:"composer",children:[d.jsxs("div",{className:"inner",children:[d.jsx("textarea",{ref:s,value:c.value,placeholder:"Ask the agent something",onChange:r=>c.onChange(r.target.value),onKeyDown:r=>{r.key==="Enter"&&!r.shiftKey&&(r.preventDefault(),c.onSend())}}),c.busy?d.jsx("button",{type:"button",onClick:c.onStop,children:"Stop"}):d.jsx("button",{type:"button",className:"primary",disabled:c.value.trim()==="",onClick:c.onSend,children:"Send"})]}),d.jsx("p",{className:"hint",children:c.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 Hf="dispach.key";function oy(){const c=new URL(window.location.href),s=c.searchParams.get("claim");if(!(s===null||s===""))return c.searchParams.delete("claim"),window.history.replaceState({},"",c.pathname+c.search+c.hash),s}function Df(){try{return window.localStorage.getItem(Hf)??void 0}catch{return}}function qf(c){try{window.localStorage.setItem(Hf,c)}catch{}}function Bf(){try{window.localStorage.removeItem(Hf)}catch{}}async function uh(c,s){const r=await fetch(\`\${c}/v1/keys\`,{method:"POST",headers:{"content-type":"application/json",authorization:\`Bearer \${s}\`},body:JSON.stringify({label:dy()})}),o=await r.json();if(!r.ok||typeof o.secret!="string")throw new Error(o.error?.message??\`The claim was refused (\${r.status}).\`);return o.secret}function dy(){const c=navigator.userAgent;return\`\${/Firefox\\//.test(c)?"Firefox":/Edg\\//.test(c)?"Edge":/Chrome\\//.test(c)?"Chrome":/Safari\\//.test(c)?"Safari":"browser"} · \${new Date().toISOString().slice(0,10)}\`}async function ry(c){const s=oy();if(s!==void 0)try{const o=await uh(c,s);return qf(o),{kind:"key",secret:o}}catch(o){const j=o instanceof Error?o.message:String(o);if(Df()===void 0)return{kind:"needed",because:j}}const r=Df();return r!==void 0&&await Fr(c,r)?{kind:"key",secret:r}:(r!==void 0&&Bf(),await Fr(c,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 Fr(c,s){try{return await ih(c,s).agents(),!0}catch(r){if(r instanceof Xt&&r.code==="unauthorized")return!1;throw r}}function ih(c,s){return ny({baseUrl:c,...s===void 0?{}:{token:s}})}function hy(c,s){const r=[c.scope?.agents===void 0?"every agent":c.scope.agents.join(", "),...c.scope?.sessions===void 0?[]:[\`sessions \${c.scope.sessions}\`],c.scope?.can===void 0?"all capabilities":c.scope.can.join("+")];return c.expiresAt!==void 0&&r.push(Date.parse(c.expiresAt)<=s?"expired":\`until \${ii(c.expiresAt)}\`),r.join(" · ")}function vy(c){const[s,r]=w.useState([]),[o,j]=w.useState(),[z,C]=w.useState(""),[L,H]=w.useState(),[g,D]=w.useState(),E=w.useCallback((q={})=>({...q,...c.token===void 0?{}:{authorization:\`Bearer \${c.token}\`}}),[c.token]),U=w.useCallback(async()=>{try{const q=await fetch(\`\${c.baseUrl}/v1/keys\`,{headers:E()}),Ee=await q.json();if(!q.ok)throw new Error(Ee.error?.message??\`HTTP \${q.status}\`);r(Ee.keys??[]),j(Ee.scope)}catch(q){D(q instanceof Error?q.message:String(q))}},[c.baseUrl,E]);w.useEffect(()=>{U()},[U]);const J=async()=>{D(void 0);try{const q=await fetch(\`\${c.baseUrl}/v1/keys\`,{method:"POST",headers:E({"content-type":"application/json"}),body:JSON.stringify({label:z.trim()})}),Ee=await q.json();if(!q.ok||Ee.secret===void 0)throw new Error(Ee.error?.message??\`HTTP \${q.status}\`);H(Ee.secret),C(""),await U()}catch(q){D(q instanceof Error?q.message:String(q))}},W=async q=>{if(D(void 0),!window.confirm(\`Revoke "\${q.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 Ee=Df();try{const $=await fetch(\`\${c.baseUrl}/v1/keys/\${q.keyId}\`,{method:"DELETE",headers:E()});if(!$.ok){const Pe=await $.json();throw new Error(Pe.error?.message??\`HTTP \${$.status}\`)}if(Ee!==void 0&&!await my(c.baseUrl,Ee)){Bf(),window.location.reload();return}await U()}catch($){D($ instanceof Error?$.message:String($))}};return d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"card",children:[d.jsx("h2",{children:"Issue a key"}),d.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."}),L===void 0?null:d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"secret",children:L}),d.jsxs("p",{className:"hint",style:{margin:"0 0 12px"},children:["Copy it now. This is the only time it is readable."," ",d.jsx("button",{type:"button",style:{padding:"2px 8px",fontSize:11},onClick:()=>{qf(L),window.location.reload()},children:"use it in this browser"})]})]}),d.jsxs("div",{style:{display:"flex",gap:8},children:[d.jsx("input",{value:z,placeholder:"my laptop",onChange:q=>C(q.target.value)}),d.jsx("button",{type:"button",className:"primary",disabled:z.trim()==="",onClick:()=>void J(),children:"Issue"})]})]}),d.jsxs("div",{className:"card",children:[d.jsx("h2",{children:"Keys"}),d.jsx("p",{children:o??"…"}),g===void 0?null:d.jsx("p",{className:"note bad",children:g}),d.jsxs("table",{children:[d.jsx("thead",{children:d.jsxs("tr",{children:[d.jsx("th",{children:"Label"}),d.jsx("th",{children:"Created"}),d.jsx("th",{children:"Reaches"}),d.jsx("th",{children:"Last used"}),d.jsx("th",{})]})}),d.jsx("tbody",{children:s.map(q=>d.jsxs("tr",{children:[d.jsx("td",{className:q.revokedAt===void 0?"":"revoked",children:q.label}),d.jsx("td",{children:ii(q.createdAt)}),d.jsx("td",{className:"sub",children:hy(q,Date.now())}),d.jsx("td",{children:q.revokedAt!==void 0?\`revoked \${ii(q.revokedAt)}\`:q.lastUsedAt===void 0?"never":ii(q.lastUsedAt)}),d.jsx("td",{children:q.revokedAt===void 0?d.jsx("button",{type:"button",className:"bad",style:{padding:"2px 9px",fontSize:11},onClick:()=>void W(q),children:"revoke"}):null})]},q.keyId))})]}),s.length===0?d.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 my(c,s){try{return(await fetch(\`\${c}/v1/agents\`,{headers:{authorization:\`Bearer \${s}\`}})).ok}catch{return!0}}function ii(c){const s=new Date(c);return Number.isNaN(s.getTime())?c:s.toISOString().slice(0,10)}const yy=["chat","new","tools","schedules","channels","config","keys"];function gy(c){return c!==null&&yy.includes(c)}function by(c){const s=new URL(c).searchParams,r=s.get("agent"),o=s.get("panel");return{...r===null||r===""?{}:{agentId:r},panel:gy(o)?o:"chat"}}function Sy(c,s){const r=new URL(c);return s.agentId===void 0||s.agentId===""?r.searchParams.delete("agent"):r.searchParams.set("agent",s.agentId),s.panel==="chat"?r.searchParams.delete("panel"):r.searchParams.set("panel",s.panel),\`\${r.pathname}\${r.search}\`}function py(){let c,s;return{begin(r){if(c!==r)return s?.abort(),c=r,s=new AbortController,s.signal},finish(r){c===r&&(c=void 0,s=void 0)},abort(){s?.abort()},following:()=>c,aborted:()=>s?.signal.aborted??!1}}function Ty(c){const s={};for(const r of c)s[r.step]=r.fallback;return s}const Ey=8;function zy(c,s,r){let o=s;for(let j=0;j<Ey;j+=1){if(o===void 0)return!1;const z=o.requires;if(z===void 0)return!0;if(r[z.step]!==z.value)return!1;o=c.find(C=>C.step===z.step)}return!1}function ci(c,s){return c.filter(r=>zy(c,r,s))}function ch(c,s){return ci(c,s).filter(r=>r.optional!==!0&&(s[r.step]??"").trim()==="")}function Ay(c,s){const r={};for(const o of ci(c,s)){const j=(s[o.step]??"").trim();j!==""&&(r[o.step]=j)}return r}function xy(c,s){return ci(c,s).filter(r=>r.secret&&(s[r.step]??"").trim()==="")}function jy(c){return{...wn,filter:c==="nlt"?Fm():Pr()}}const wn={filter:Pr(),rows:[],live:"",liveReasoning:"",running:!1,truncated:!1};let Ir=0;function il(){return Ir+=1,\`r\${Ir}\`}function _y(c,s){return{...c,rows:[...c.rows,{kind:"user",id:il(),text:s}],running:!0}}function Ny(c,s){switch(s.kind){case"accepted":return c;case"replay":return s.report.truncated?{...c,truncated:!0}:c;case"ended":return{...c,running:!1,rows:[...c.rows,{kind:"note",id:il(),text:\`This turn finished before the page attached — \${s.status}. Its reply is stored.\`,bad:s.status!=="final"}]};case"unavailable":return{...c,running:!1,rows:[...c.rows,{kind:"note",id:il(),text:s.reason,bad:!0}]};case"event":return Oy(c,s.event)}}function Oy(c,s){switch(s.type){case"turn.start":return{...c,running:!0};case"model.chunk":{const r=s.data;if(r.kind==="reasoning")return{...c,liveReasoning:c.liveReasoning+r.delta};const o=c.filter.push(r.delta);return o===""?c:{...c,live:c.live+o}}case"model.result":return ni({...c,live:c.live+c.filter.endStep()});case"tool.call":{const r=s.data,o=ni(c);return{...o,rows:[...o.rows,{kind:"tool",id:il(),callId:r.callId,slug:r.slug,mutating:r.mutating}]}}case"tool.result":{const r=s.data,o=c.rows.findIndex(C=>C.kind==="tool"&&C.callId===r.callId);if(o===-1)return c;const j=c.rows[o];if(j===void 0||j.kind!=="tool")return c;const z=[...c.rows];return z[o]={...j,ok:r.ok,bytes:r.bytes,truncated:r.truncated,latencyMs:r.latencyMs,...r.trust==="untrusted"?{untrusted:!0}:{}},{...c,rows:z}}case"approval.requested":{const r=s.data,o=ni(c);return{...o,rows:[...o.rows,{kind:"approval",id:il(),approvalId:r.approvalId,slug:r.slug,...r.match===void 0?{}:{match:r.match},reason:r.reason}]}}case"approval.resolved":{const r=s.data,o=c.rows.findIndex(C=>C.kind==="approval"&&C.approvalId===r.approvalId);if(o===-1)return c;const j=c.rows[o];if(j===void 0||j.kind!=="approval")return c;const z=[...c.rows];return z[o]={...j,settled:r.by==="abandoned"?"abandoned":r.by==="error"?"error":r.granted?"granted":"denied"},{...c,rows:z}}case"agent.warning":{const r=s.data;return{...c,rows:[...c.rows,{kind:"note",id:il(),text:r.message??"",bad:!1}]}}case"turn.end":{const r=s.data,o=ni({...c,live:c.live+c.filter.end()}),j=Zm(r.reason,{steps:r.steps});return{...o,running:!1,rows:j===void 0?o.rows:[...o.rows,{kind:"note",id:il(),text:j,bad:Qm(r.reason)}]}}default:return c}}function ni(c){if(c.live===""&&c.liveReasoning==="")return c;const s=[...c.rows],r=c.liveReasoning.trim();r!==""&&s.push({kind:"reasoning",id:il(),text:r});const o=c.live.trim();return o!==""&&s.push({kind:"reply",id:il(),text:o}),{...c,rows:s,live:"",liveReasoning:""}}function My(c){if(!c.available)return d.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 ",d.jsx("code",{children:"dispach init"})," ","where the sandbox is, or mount an agent directory."]});if(!c.allowed)return d.jsxs("p",{className:"empty",children:["Creating an agent needs a loopback bind or a credential with the ",d.jsx("code",{children:"admin"})," ","capability, and this request has neither. On a server reachable from elsewhere, set"," ",d.jsx("code",{children:"server.tokenEnv"})," or present an operator key minted with"," ",d.jsx("code",{children:"can: [admin]"})," — or mount a written agent at ",d.jsx("code",{children:"/agent"}),"."]})}function Uy(c){const{step:s,value:r}=c,o=\`provision-\${s.step}\`;return d.jsxs("div",{className:c.invalid?"field invalid":"field",children:[d.jsxs("label",{htmlFor:o,children:[s.prompt,s.optional?d.jsx("span",{className:"sub",children:" optional"}):null,s.secret?d.jsx("span",{className:"sub",children:" · written to .env, never read back"}):null]}),s.choices===void 0?d.jsx("input",{id:o,name:s.step,type:s.secret?"password":"text",value:r,disabled:c.disabled,autoComplete:s.secret?"new-password":"off",spellCheck:!1,onChange:j=>c.onChange(j.target.value)}):d.jsx("select",{id:o,name:s.step,value:r,disabled:c.disabled,onChange:j=>c.onChange(j.target.value),children:s.choices.map(j=>d.jsx("option",{value:j.value,children:j.hint===void 0?j.label:\`\${j.label} — \${j.hint}\`},j.value))}),c.invalid?d.jsx("div",{className:"sub error",children:"needs an answer"}):null]})}function Dy(c){const s=c.result.adopted.includes(c.result.id);return d.jsxs("div",{className:"created",children:[d.jsxs("h3",{children:["Created ",d.jsx("code",{children:c.result.id})]}),d.jsxs("p",{children:[d.jsx("code",{children:c.result.dir}),d.jsxs("span",{className:"sub",children:[" · ",c.result.files.length," files"]})]}),s?d.jsx("p",{className:"ok",children:"adopted · live on this host, with its channels and schedules"}):d.jsxs("p",{className:"error",children:["written, and ",d.jsx("strong",{children:"not running"}),c.result.error===void 0?null:d.jsxs(d.Fragment,{children:[": ",c.result.error.message,c.result.error.hint===void 0?null:d.jsxs("span",{className:"sub",children:[" ",c.result.error.hint]})]})]}),c.blank.length===0?null:d.jsxs("div",{className:"blank-secrets",children:[d.jsxs("p",{children:["Left empty, and needed before this works:"," ",c.blank.map(r=>r.prompt).join(", "),"."]}),d.jsxs("p",{className:"sub",children:["Fill them in ",d.jsxs("code",{children:[c.result.dir,"/.env"]})," at a terminal —"," ",d.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."]})]}),s?d.jsxs("button",{type:"button",onClick:()=>c.onOpen(c.result.id),children:["open ",c.result.id]}):null]})}function Cy(c){if(c.result!==void 0)return d.jsx(Dy,{result:c.result,blank:xy(c.offer.steps,c.answers),onOpen:c.onOpen});const s=My(c.offer);if(s!==void 0)return s;const r=ci(c.offer.steps,c.answers),o=ch(c.offer.steps,c.answers),j=new Set(o.map(z=>z.step));return d.jsxs("form",{className:"provision",onSubmit:z=>{z.preventDefault(),c.onSubmit()},children:[d.jsxs("p",{className:"sub",children:["The same questions ",d.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(z=>d.jsx(Uy,{step:z,value:c.answers[z.step]??"",invalid:c.touched&&j.has(z.step),disabled:c.busy,onChange:C=>c.onAnswer(z.step,C)},z.step)),c.error===void 0?null:d.jsx("p",{className:"error",children:c.error}),d.jsx("button",{type:"submit",disabled:c.busy,children:c.busy?"creating…":"create agent"}),c.touched&&o.length>0?d.jsxs("p",{className:"sub error",children:[o.map(z=>z.prompt).join(", ")," — still needed."]}):null]})}function fh(c){return c==null?"":typeof c=="string"?c:typeof c=="number"||typeof c=="boolean"?String(c):JSON.stringify(c)}function Ry(c){return!(c.text.trim()===""||c.text===fh(c.setting.value)||c.setting.confirm!==void 0&&!c.confirmed)}function Hy(c){return c.agents.length===0?d.jsx("div",{className:"empty",style:{fontSize:12,padding:"4px 8px"},children:"no agents on this server"}):d.jsx(d.Fragment,{children:c.agents.map(s=>{const r=s.status==="disabled";return d.jsxs("div",{className:"agent-row",children:[d.jsxs("button",{type:"button",className:"row-button","aria-current":s.id===c.current,disabled:r,onClick:()=>c.onSelect(s.id),children:[s.name,r?d.jsx("span",{className:"agent-off",children:" · stopped"}):null]}),r?d.jsxs("div",{className:"agent-note",children:[s.reason??"switched off",d.jsx("button",{type:"button",className:"link",disabled:c.starting===s.id,onClick:()=>c.onStart(s.id),children:c.starting===s.id?"starting…":"start"})]}):null]},s.id)})})}function qy(c){return c.tools.length===0?d.jsxs("p",{className:"empty",children:["No tools are pinned. An agent with none can still hold a conversation; a manifest's"," ",d.jsx("code",{children:"tools.pinned"})," is what grants the rest."]}):d.jsxs("table",{className:"panel-table",children:[d.jsx("thead",{children:d.jsxs("tr",{children:[d.jsx("th",{children:"tool"}),d.jsx("th",{children:"provider"}),d.jsx("th",{children:"writes"}),d.jsx("th",{children:"trust"})]})}),d.jsx("tbody",{children:c.tools.map(s=>d.jsxs("tr",{children:[d.jsxs("td",{children:[d.jsx("code",{children:s.slug}),d.jsx("div",{className:"sub",children:s.summary})]}),d.jsx("td",{children:s.provider}),d.jsx("td",{children:s.mutating?"yes":"no"}),d.jsxs("td",{children:[s.trust,s.trustReason===void 0?null:d.jsx("div",{className:"sub",children:s.trustReason})]})]},s.slug))})]})}function By(c){return d.jsxs(d.Fragment,{children:[c.schedules.length===0?d.jsxs("p",{className:"empty",children:["No schedules. Add one below, or declare it in the manifest's"," ",d.jsx("code",{children:"schedules:"})," block — a declared one survives a rebuild and shows up in a diff."]}):d.jsxs("table",{className:"panel-table",children:[d.jsx("thead",{children:d.jsxs("tr",{children:[d.jsx("th",{children:"schedule"}),d.jsx("th",{children:"when"}),d.jsx("th",{children:"next"}),d.jsx("th",{children:"delivers to"}),d.jsx("th",{children:"declared in"}),d.jsx("th",{})]})}),d.jsx("tbody",{children:c.schedules.map(s=>{const r=s.origin==="manifest",o=c.busy===s.id;return d.jsxs("tr",{className:s.enabled?"":"off",children:[d.jsxs("td",{children:[d.jsx("code",{children:s.id}),d.jsx("div",{className:"sub",children:s.task})]}),d.jsxs("td",{children:[s.kind," ",s.expr,s.timezone===void 0?null:d.jsx("div",{className:"sub",children:s.timezone})]}),d.jsx("td",{children:s.enabled?s.nextRunAt??"never again — a spent one-shot":"disabled"}),d.jsx("td",{children:s.deliverChannel===void 0?"this session only":\`\${s.deliverChannel}\${s.deliverTo===void 0?"":\` → \${s.deliverTo}\`}\`}),d.jsxs("td",{children:[r?"agent.yaml":"the API",r?d.jsxs("div",{className:"sub",children:["the manifest decides it — edit the file, or the"," ",d.jsx("code",{children:"schedules"})," field under config"]}):null]}),d.jsxs("td",{style:{whiteSpace:"nowrap"},children:[c.onRun===void 0?null:d.jsx("button",{type:"button",disabled:o,onClick:()=>c.onRun?.(s.id),children:"run now"}),c.onToggle===void 0||r?null:d.jsx("button",{type:"button",disabled:o,onClick:()=>c.onToggle?.(s.id,!s.enabled),children:s.enabled?"disable":"enable"}),c.onDelete===void 0||r?null:d.jsx("button",{type:"button",disabled:o,onClick:()=>c.onDelete?.(s.id),children:"delete"})]})]},s.id)})})]}),c.onCreate===void 0?null:d.jsx(Yy,{onCreate:c.onCreate})]})}function Yy(c){const[s,r]=w.useState(""),[o,j]=w.useState("cron"),[z,C]=w.useState(""),[L,H]=w.useState(""),[g,D]=w.useState(""),[E,U]=w.useState(""),J=s.trim()!==""&&z.trim()!==""&&L.trim()!=="";return d.jsxs("section",{style:{marginTop:24},children:[d.jsx("h3",{style:{fontSize:13,margin:"0 0 8px"},children:"Add a schedule"}),d.jsxs("div",{className:"form-grid",children:[d.jsx("label",{htmlFor:"sched-id",children:"id"}),d.jsx("input",{id:"sched-id",value:s,placeholder:"morning-brief",onChange:W=>r(W.target.value)}),d.jsx("label",{htmlFor:"sched-kind",children:"kind"}),d.jsxs("select",{id:"sched-kind",value:o,onChange:W=>j(W.target.value),children:[d.jsx("option",{value:"cron",children:"cron — a 5- or 6-field expression"}),d.jsx("option",{value:"every",children:"every — a duration like 15m"}),d.jsx("option",{value:"at",children:"at — one ISO instant, once"})]}),d.jsx("label",{htmlFor:"sched-expr",children:"expr"}),d.jsx("input",{id:"sched-expr",value:z,placeholder:o==="cron"?"0 8 * * *":o==="every"?"15m":"",onChange:W=>C(W.target.value)}),d.jsx("label",{htmlFor:"sched-task",children:"task"}),d.jsx("input",{id:"sched-task",value:L,placeholder:"Summarise today's calendar.",onChange:W=>H(W.target.value)}),d.jsx("label",{htmlFor:"sched-channel",children:"deliver"}),d.jsxs("div",{children:[d.jsx("input",{id:"sched-channel",value:g,placeholder:"channel id — blank for this session only",onChange:W=>D(W.target.value)}),g.trim()===""?null:d.jsxs(d.Fragment,{children:[d.jsx("input",{value:E,placeholder:"address",onChange:W=>U(W.target.value)}),d.jsxs("p",{className:"sub",children:["The address a reply is ",d.jsx("em",{children:"sent"})," to — on Telegram the numeric chat id, never an ",d.jsx("code",{children:"@handle"}),", which addresses a channel and not a person. It is the id inbound messages arrive on."]})]})]})]}),d.jsx("button",{type:"button",disabled:!J,style:{marginTop:10},onClick:()=>c.onCreate({id:s.trim(),kind:o,expr:z.trim(),task:L.trim(),deliver:g.trim()===""?"none":{channel:g.trim(),to:E.trim()}}),children:"add"})]})}function wy(c){return c.editable?d.jsxs(d.Fragment,{children:[d.jsxs("p",{className:"sub",style:{marginTop:0},children:[c.file===void 0?null:d.jsxs(d.Fragment,{children:[d.jsx("code",{children:c.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."]}),c.note===void 0?null:d.jsx("p",{className:"row note",children:c.note}),c.settings.map(s=>d.jsx(Gy,{setting:s,busy:c.busy===s.path,onSet:c.onSet},s.path))]}):d.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 Gy(c){const s=fh(c.setting.value),[r,o]=w.useState(s),[j,z]=w.useState(!1),[C,L]=w.useState(s);C!==s&&(L(s),o(s),z(!1));const H=Ry({setting:c.setting,text:r,confirmed:j}),g=s.length>48||s.includes("{")||s.includes("[");return d.jsxs("section",{className:"config-row",children:[d.jsxs("div",{className:"config-head",children:[d.jsx("code",{children:c.setting.path}),c.setting.value===void 0?d.jsx("span",{className:"sub",children:" not set"}):null]}),d.jsx("p",{className:"sub",children:c.setting.means}),g?d.jsx("textarea",{rows:2,value:r,"aria-label":c.setting.path,onChange:D=>o(D.target.value)}):d.jsx("input",{value:r,"aria-label":c.setting.path,onChange:D=>o(D.target.value)}),c.setting.confirm===void 0?null:d.jsxs("label",{className:"row note bad",style:{display:"block"},children:[d.jsx("input",{type:"checkbox",checked:j,onChange:D=>z(D.target.checked)})," ",c.setting.confirm]}),d.jsx("button",{type:"button",disabled:!H||c.busy,onClick:()=>c.onSet(c.setting.path,r,{confirm:j}),children:c.busy?"saving…":"save"})]})}function Xy(c){return c.channels.length===0?d.jsx("p",{className:"empty",children:"No channels. This agent is reached through this page and the HTTP API only."}):d.jsx("div",{className:"channels",children:c.channels.map(s=>{const r=s.input,o=r?.expiresAt!==void 0&&Date.parse(r.expiresAt)<=c.now;return d.jsxs("section",{className:"channel",children:[d.jsxs("h3",{children:[d.jsx("code",{children:s.id})," ",d.jsx("span",{className:"sub",children:s.type})]}),d.jsxs("p",{className:\`status status-\${s.status}\`,children:[s.status,s.detail===void 0?null:\` — \${s.detail}\`]}),r===void 0?null:d.jsxs("div",{className:\`channel-input \${o?"stale":"fresh"}\`,children:[o?d.jsx("p",{className:"warn",children:"this expired — the channel will issue another"}):null,d.jsx("pre",{className:"payload","data-kind":r.kind,children:r.payload}),d.jsxs("p",{className:"sub",children:[r.kind," · issued ",r.issuedAt,r.expiresAt===void 0?" · no expiry reported":\` · expires \${r.expiresAt}\`]})]})]},s.id)})})}const Qy=[{panel:"tools",label:"tools"},{panel:"schedules",label:"schedules"},{panel:"channels",label:"channels"},{panel:"config",label:"config"},{panel:"keys",label:"keys"}],Mf="dispach.turn";function Zy(c){const[s,r]=w.useState(),[o,j]=w.useState();return w.useEffect(()=>{ry(c.baseUrl).then(r).catch(z=>j(z instanceof Error?z.message:String(z)))},[c.baseUrl]),o!==void 0?d.jsxs(Cf,{title:"Cannot reach the server",children:[d.jsx("p",{children:o}),d.jsx("button",{type:"button",onClick:()=>window.location.reload(),children:"Try again"})]}):s===void 0?d.jsx(Cf,{title:"Connecting…"}):s.kind==="needed"?d.jsx(Ly,{baseUrl:c.baseUrl,because:s.because}):d.jsx(Vy,{baseUrl:c.baseUrl,token:s.kind==="key"?s.secret:void 0})}function Cf(c){return d.jsx("div",{className:"gate",children:d.jsxs("div",{className:"card",children:[d.jsx("h2",{children:c.title}),c.children]})})}function Ly(c){const[s,r]=w.useState(""),[o,j]=w.useState(),[z,C]=w.useState(!1),L=async H=>{C(!0),j(void 0);try{const g=H?await uh(c.baseUrl,s.trim()):s.trim();qf(g),window.location.reload()}catch(g){j(g instanceof Error?g.message:String(g)),C(!1)}};return d.jsxs(Cf,{title:"This server needs a credential",children:[d.jsx("p",{children:c.because}),d.jsx("input",{value:s,placeholder:"paste a claim or an operator key",onChange:H=>r(H.target.value)}),d.jsxs("p",{className:"hint",style:{margin:"8px 0 12px"},children:[d.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."]}),d.jsx("div",{className:"ask",children:d.jsxs("div",{className:"buttons",children:[d.jsx("button",{type:"button",className:"primary",disabled:z||s.trim()==="",onClick:()=>L(!0),children:"Exchange a claim"}),d.jsx("button",{type:"button",disabled:z||s.trim()==="",onClick:()=>L(!1),children:"Use as a key"})]})}),o===void 0?null:d.jsx("p",{className:"note bad",style:{marginTop:12},children:o})]})}const ui=c=>c instanceof Xt&&c.status===404,Ky={new:"New agent",tools:"Tools",schedules:"Schedules",channels:"Channels",config:"Settings",keys:"Operator keys"};function Vy(c){const s=w.useRef(ih(c.baseUrl,c.token)),[r,o]=w.useState([]),[j,z]=w.useState(),[C,L]=w.useState(),[H,g]=w.useState(),[D,E]=w.useState([]),U=w.useCallback(async()=>{z(void 0),L(void 0),E([]),ve("this agent is no longer running on this server — start it from the list");try{o(await s.current.agents())}catch{}},[]),[J,W]=w.useState([]),[q,Ee]=w.useState(),[$,Pe]=w.useState(()=>by(window.location.href).panel),[_e,Ne]=w.useState(wn),[ft,we]=w.useState(""),[P,ve]=w.useState(),et=w.useRef(void 0),Ht=w.useRef(py());w.useEffect(()=>{const M=new URL(window.location.href).searchParams.get("agent")??void 0;s.current.agents().then(Q=>{o(Q);const ie=Q.filter(We=>We.status!=="disabled"),Oe=ie.find(We=>We.id===M)??ie[0];if(Oe===void 0){new URL(window.location.href).searchParams.get("panel")===null&&Pe("new");return}z(Oe.id),L(Oe.name),Ne(We=>({...We,filter:jy(Oe.dialect??"nlt").filter})),document.title=\`\${Oe.name} · Dispach\`}).catch(Q=>ve(Rt(Q)))},[]);const fe=w.useMemo(()=>j===void 0?void 0:s.current.agent(j),[j]),Ge=w.useCallback(async()=>{if(fe!==void 0)try{W(await fe.sessions()),ve(void 0)}catch(M){ui(M)?U():ve(Rt(M))}},[fe,U]);w.useEffect(()=>{Ge()},[Ge]);const Ot=w.useCallback(async(M,Q)=>{const ie=Ht.current,Oe=ie.begin(M);if(Oe===void 0)return;const We=Q.turn(M);et.current=()=>We.stop();try{sessionStorage.setItem(Mf,M);for await(const Le of We.stream({chunks:!0,signal:Oe}))Ne(Qa=>Ny(Qa,Le))}catch(Le){Oe.aborted||(ve(Rt(Le)),Ne(Qa=>({...Qa,running:!1})))}finally{ie.finish(M),sessionStorage.removeItem(Mf),et.current=void 0,Oe.aborted||Ge()}},[Ge]);w.useEffect(()=>{if(fe===void 0)return;const M=sessionStorage.getItem(Mf);if(M!==null)return Ne(Q=>({...Q,running:!0})),Ot(M,fe),()=>Ht.current.abort()},[fe,Ot]),w.useEffect(()=>{if(fe===void 0)return;let M=!0;const Q=()=>{fe.approvals().then(Oe=>{M&&E(Oe)}).catch(Oe=>{M&&ui(Oe)&&U()})};Q();const ie=window.setInterval(Q,5e3);return()=>{M=!1,window.clearInterval(ie)}},[fe,U]);const Mt=async()=>{const M=ft.trim();if(!(M===""||fe===void 0)){we(""),ve(void 0),Ne(Q=>_y(Q,M));try{const Q=await fe.send(M,{...q===void 0?{}:{sessionKey:q}});q===void 0&&Ee(Q.sessionKey),await Ot(Q.turnId,fe)}catch(Q){ve(Rt(Q)),Ne(ie=>({...ie,running:!1}))}}},st=async(M,Q)=>{if(fe!==void 0)try{await fe.approve(M,Q)}catch(ie){ie instanceof Xt&&ie.code==="approval_not_found"||ve(Rt(ie))}},x=async M=>{if(Ht.current.abort(),Pe("chat"),Ee(M),Ne(wn),we(""),!(M===void 0||fe===void 0))try{const Q=await ky(c.baseUrl,c.token,j??"",M);Ne({...wn,rows:Q})}catch(Q){ve(Rt(Q))}},[R,V]=w.useState({tools:[],schedules:[],channels:[]}),se=w.useCallback(async M=>{const[Q,ie,Oe,We]=await Promise.all([M.tools(),M.schedules(),M.describe(),M.config()]);V({tools:Q,schedules:ie,channels:Oe.channels??[],config:We})},[]);w.useEffect(()=>{if(fe===void 0||$!=="tools"&&$!=="schedules"&&$!=="channels"&&$!=="config")return;let M=!1;return(async()=>{try{if(await se(fe),M)return}catch(Q){if(M)return;ui(Q)?U():ve(Rt(Q))}})(),()=>{M=!0}},[fe,$,U,se]);const[de,m]=w.useState(),[O,B]=w.useState(),Y=w.useCallback(async(M,Q)=>{if(fe!==void 0){m(M),ve(void 0),B(void 0);try{const ie=await Q(fe);B(ie),await se(fe)}catch(ie){ui(ie)?U():ve(Rt(ie))}finally{m(void 0)}}},[fe,U,se]),F=w.useCallback((M,Q,ie)=>void Y(M,async Oe=>{const We=await Oe.setConfig(M,Q,{...ie.confirm?{confirm:!0}:{}});return We.applied?We.reflowed?\`\${M} saved. The manifest was re-serialised, so its comments have moved — worth a look at the diff.\`:void 0:\`\${M} was written to the manifest and is not in force yet: \${We.pending?.message??"the agent could not be replaced"} It takes effect at the next start.\`}),[Y]),[k,oe]=w.useState(),[Re,xe]=w.useState({}),[Dl,Cl]=w.useState(!1),[wa,Ga]=w.useState(!1),[qt,Pl]=w.useState();w.useEffect(()=>{if($!=="new"||k!==void 0)return;let M=!1;return(async()=>{try{const Q=await s.current.provision();if(M)return;oe(Q),xe(Ty(Q.steps))}catch(Q){M||ve(Rt(Q))}})(),()=>{M=!0}},[$,k]);const Xa=w.useCallback(async()=>{if(k!==void 0&&(Cl(!0),!(ch(k.steps,Re).length>0))){Ga(!0),ve(void 0);try{const M=await s.current.createAgent(Ay(k.steps,Re));Pl(M),o(await s.current.agents())}catch(M){ve(Rt(M))}finally{Ga(!1)}}},[k,Re]),ea=w.useCallback(M=>{const Q=M.panel??$,ie=M.agentId??j;Pe(Q),M.agentId!==void 0&&M.agentId!==j&&(z(M.agentId),L(r.find(Oe=>Oe.id===M.agentId)?.name),Ee(void 0),Ne(wn),we("")),window.history.replaceState(null,"",Sy(window.location.href,{...ie===void 0?{}:{agentId:ie},panel:Q}))},[j,r,$]),Gn=w.useCallback(async M=>{g(M);try{await s.current.agent(M).start(),o(await s.current.agents())}catch(Q){ve(Rt(Q))}finally{g(void 0)}},[]);return d.jsxs("div",{className:"shell",children:[d.jsxs("aside",{className:"side",children:[d.jsxs("header",{children:[d.jsx("div",{className:"brand",children:"Dispach"}),d.jsx("div",{style:{fontSize:12,color:"var(--dim)"},children:C??"…"})]}),d.jsxs("nav",{children:[r.length>1||r.some(M=>M.status==="disabled")?d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"group",children:"Agents"}),d.jsx(Hy,{agents:r,current:j,onSelect:M=>ea({agentId:M}),onStart:M=>void Gn(M),...H===void 0?{}:{starting:H}})]}):null,d.jsx("div",{className:"group",children:"Conversation"}),d.jsx("button",{type:"button",className:"row-button","aria-current":$==="chat"&&q===void 0,onClick:()=>void x(void 0),children:"+ new"}),J.map(M=>d.jsx("button",{type:"button",className:"row-button","aria-current":$==="chat"&&q===M.sessionKey,onClick:()=>void x(M.sessionKey),children:M.sessionKey},M.sessionKey)),d.jsx("div",{className:"group",children:"Server"}),d.jsx("button",{type:"button",className:"row-button","aria-current":$==="new",onClick:()=>ea({panel:"new"}),children:"+ new agent"}),Qy.map(M=>d.jsx("button",{type:"button",className:"row-button","aria-current":$===M.panel,onClick:()=>ea({panel:M.panel}),children:M.label},M.panel))]}),d.jsxs("footer",{children:[d.jsx("span",{className:\`dot \${_e.running?"busy":"live"}\`}),d.jsx("span",{style:{fontSize:11,color:"var(--dim)"},children:_e.running?"working":"ready"}),c.token===void 0?d.jsx("span",{style:{fontSize:11,color:"var(--warn)",marginLeft:"auto"},children:"unauthenticated"}):d.jsx("button",{type:"button",style:{marginLeft:"auto",padding:"3px 8px",fontSize:11},onClick:()=>{Bf(),window.location.reload()},children:"forget key"})]})]}),d.jsxs("main",{className:"main",children:[d.jsxs("div",{className:"bar",children:[d.jsx("strong",{children:$==="chat"?C??"":Ky[$]}),$==="chat"?d.jsx("span",{children:q??"new conversation"}):null,d.jsx("span",{className:"spacer"}),D.length>0?d.jsxs("span",{style:{color:"var(--warn)"},children:[D.length," waiting on you"]}):null]}),$!=="chat"?d.jsx("div",{className:"scroll",children:d.jsxs("div",{className:"pad",children:[P===void 0?null:d.jsx("p",{className:"row note bad",children:P}),$==="new"?k===void 0?d.jsx("p",{className:"empty",children:"reading this server's questions…"}):d.jsx(Cy,{offer:k,answers:Re,busy:wa,touched:Dl,...P===void 0?{}:{error:P},...qt===void 0?{}:{result:qt},onAnswer:(M,Q)=>xe(ie=>({...ie,[M]:Q})),onSubmit:()=>void Xa(),onOpen:M=>{Pl(void 0),oe(void 0),Cl(!1),ea({agentId:M,panel:"chat"})}}):null,$==="keys"?d.jsx(vy,{client:s.current,baseUrl:c.baseUrl,token:c.token}):null,$==="tools"?d.jsx(qy,{tools:R.tools}):null,$==="schedules"?d.jsx(By,{schedules:R.schedules,...de===void 0?{}:{busy:de},onCreate:M=>void Y(String(M.id),Q=>Q.createSchedule(M).then(()=>{})),onDelete:M=>void Y(M,Q=>Q.deleteSchedule(M).then(()=>{})),onRun:M=>void Y(M,async Q=>{const ie=await Q.runSchedule(M);return\`\${M} fired out of band as \${ie.turnId} — its next scheduled run has not moved.\`}),onToggle:(M,Q)=>void Y(M,ie=>ie.updateSchedule(M,{enabled:Q}).then(()=>{}))}):null,$==="config"?R.config===void 0?d.jsx("p",{className:"empty",children:"reading this agent's settings…"}):d.jsx(wy,{settings:R.config.settings,editable:R.config.editable,...R.config.file===void 0?{}:{file:R.config.file},...de===void 0?{}:{busy:de},...O===void 0?{}:{note:O},onSet:F}):null,$==="channels"?d.jsx(Xy,{channels:R.channels,now:Date.now()}):null]})}):d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"scroll",children:d.jsxs("div",{className:"pad",children:[P===void 0?null:d.jsx("p",{className:"row note bad",children:P}),d.jsx(uy,{state:_e,onAnswer:(M,Q)=>void st(M,Q)}),d.jsx(Jy,{state:_e})]})}),d.jsx(sy,{value:ft,busy:_e.running,onChange:we,onSend:()=>void Mt(),onStop:()=>void et.current?.()})]})]})]})}function Jy(c){const s=w.useRef(null),r=c.state.rows.length+c.state.live.length;return w.useEffect(()=>{const o=s.current,j=o?.closest(".scroll");if(o===null||j===null||j===void 0)return;j.scrollHeight-j.scrollTop-j.clientHeight<40&&o.scrollIntoView({block:"end"})},[r]),d.jsx("div",{ref:s})}async function ky(c,s,r,o){const j=await fetch(\`\${c}/v1/agents/\${r}/sessions/\${encodeURIComponent(o)}/messages?limit=200\`,{headers:s===void 0?{}:{authorization:\`Bearer \${s}\`}});return j.ok?[...(await j.json()).messages??[]].reverse().filter(C=>C.origin===void 0&&(C.role==="user"||C.role==="assistant")&&(C.content??"")!=="").map((C,L)=>({kind:C.role==="user"?"user":"reply",id:\`h\${L}\`,text:C.content??""})):[]}function Rt(c){return c instanceof Xt||c instanceof Error?c.message:String(c)}const sh=document.getElementById("root");if(sh===null)throw new Error("no #root in the document");Ym.createRoot(sh).render(d.jsx(w.StrictMode,{children:d.jsx(Zy,{baseUrl:window.location.origin})}));
|
|
26
|
+
`;var ct=`<!doctype html>
|
|
27
|
+
<html lang="en">
|
|
28
|
+
<head>
|
|
29
|
+
<meta charset="utf-8" />
|
|
30
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
31
|
+
<!--
|
|
32
|
+
An inline SVG data URI rather than a file, and that is a constraint rather than a
|
|
33
|
+
flourish: the server embeds these assets as *text* (decision 11.200), so a binary
|
|
34
|
+
favicon would be the one thing in the build that could not ride inside the bundle.
|
|
35
|
+
-->
|
|
36
|
+
<link
|
|
37
|
+
rel="icon"
|
|
38
|
+
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"
|
|
39
|
+
/>
|
|
40
|
+
<title>Dispach</title>
|
|
41
|
+
<!--
|
|
42
|
+
No title text beyond the brand. The page sets \`document.title\` from the agent it is
|
|
43
|
+
actually talking to once it knows, because a tab saying "Dispach" next to three others
|
|
44
|
+
saying "Dispach" is a tab nobody can find.
|
|
45
|
+
-->
|
|
46
|
+
<script type="module" crossorigin src="./assets/app.js"></script>
|
|
47
|
+
<link rel="stylesheet" crossorigin href="./assets/app.css">
|
|
48
|
+
</head>
|
|
49
|
+
<body>
|
|
50
|
+
<div id="root"></div>
|
|
51
|
+
</body>
|
|
52
|
+
</html>
|
|
53
|
+
`;function dt(t){let e=2166136261;for(let n=0;n<t.length;n+=1)e^=t.charCodeAt(n),e=Math.imul(e,16777619)>>>0;return`"${e.toString(36)}-${t.length.toString(36)}"`}function ae(t,e){return{body:t,contentType:e,etag:dt(t)}}var Ie={"/":ae(ct,"text/html; charset=utf-8"),"/assets/app.js":ae(ut,"text/javascript; charset=utf-8"),"/assets/app.css":ae(st,"text/css; charset=utf-8")},ft=Object.keys(Ie);function ht(t,e){let n=Ie[t];if(n===void 0)return;let d={"content-type":n.contentType,etag:n.etag,"cache-control":"no-cache"};if(e.headers.get("if-none-match")===n.etag)return new Response(null,{status:304,headers:d});return new Response(n.body,{status:200,headers:d})}var Y=1e6,ve=256,pt=128,re=255,mt=`<!doctype html>
|
|
54
|
+
<html lang="en">
|
|
55
|
+
<head>
|
|
56
|
+
<meta charset="utf-8">
|
|
57
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
58
|
+
<title>Dispach API</title>
|
|
59
|
+
</head>
|
|
60
|
+
<body style="margin:0">
|
|
61
|
+
<noscript style="display:block;font:14px/1.5 system-ui;padding:2rem;max-width:40rem">
|
|
62
|
+
<h1 style="font-size:1rem">This page needs JavaScript and a network</h1>
|
|
63
|
+
<p>It loads the reference viewer from a CDN. The document itself is served locally and needs
|
|
64
|
+
neither: <a href="/v1/openapi.json">/v1/openapi.json</a>.</p>
|
|
65
|
+
</noscript>
|
|
66
|
+
<div id="app"></div>
|
|
67
|
+
<script src="https://cdn.jsdelivr.net/npm/@scalar/api-reference"></script>
|
|
68
|
+
<script>
|
|
69
|
+
Scalar.createApiReference('#app', { url: '/v1/openapi.json', theme: 'default' })
|
|
70
|
+
</script>
|
|
71
|
+
</body>
|
|
72
|
+
</html>
|
|
73
|
+
`;function gt(t){let{runtime:e}=t,n=t.token,d=t.now??(()=>Date.now()),u=d();if(n===void 0&&t.allowUnauthenticated!==!0)throw new z({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 f=t.running??new Map,y=t.approvals??cr(),x=()=>t.origin!==void 0&&J(t.origin.host),O=(l)=>x()||l.kind!=="open"&&me(l,"admin"),_=(l)=>{if(t.origin===void 0)return;let o=oe(l,t.origin);return o===void 0?void 0:S(o,403)},w=(l,o)=>{if(t.origin===void 0)return o;let s=at(l,t.origin);if(Object.keys(s).length===0)return o;let c=new Headers(o.headers);for(let[p,m]of Object.entries(s))c.set(p,m);return new Response(o.body,{status:o.status,statusText:o.statusText,headers:c})},A=!1,N=async()=>{if(n!==void 0||A)return!0;return A=await e.store.operatorKeys.liveCount()>0,A},U=async(l,o,s)=>{if(vt(o)||!await N())return{kind:"open"};let c=await Be({request:l,expected:n,keys:e.store.operatorKeys,claim:t.claim,pathname:o,at:d()});if(c instanceof Response)return c;if(c.kind==="claim")return c;if(s!=="open"&&!me(c,s))return Fe(s,`${l.method} ${o}`);return c},k=new Oe;return k.add("GET","/v1/health",()=>T({status:"ok",version:qt,uptimeMs:d()-u,agents:e.list().length}),{capability:"open"}),k.add("GET","/v1/ready",()=>{if(e.ready)return T({status:"ready",agents:e.list().length});return T({status:"starting",agents:e.list().length},503)},{capability:"open"}),k.add("GET","/v1/agents",async(l)=>{let o=e.list().map((p)=>ke(e,p)),s=new Set(o.map((p)=>p.id)),c=(await e.store.agentState.list()).filter((p)=>!p.enabled&&!s.has(p.agentId)).map((p)=>({id:p.agentId,name:p.agentId,status:"disabled",...p.reason===void 0?{}:{reason:p.reason},...p.disabledAt===void 0?{}:{disabledAt:p.disabledAt}}));return T(wt(l.principal,[...o,...c]))},{capability:"read"}),k.add("GET","/v1/agents/:id",(l)=>j(e,l,async(o)=>{let s=await o.store.schedules.list(o.id),c=e.team(o.id);return T({...ke(e,o),dialect:o.describe().dialect,window:o.window,tools:o.tools.size,catalogueTokens:o.describe().catalogueTokens,skills:o.skills?.skills.length??0,schedules:s.length,...c.length===0?{}:{team:c.map((p)=>({id:p.id,task:p.task,artifact:Object.keys(p.artifact.properties)}))},warnings:[...o.warnings,...o.tools.warnings]})}),{capability:"read"}),k.add("POST","/v1/agents/:id/reload",(l)=>j(e,l,async(o)=>{try{let s=await e.replace(o.id);return T({id:o.id,status:"loaded",adopted:s.map((c)=>c.id)})}catch(s){if(fe(s))return S({code:s.code,message:s.message,hint:s.hint,...s.field===void 0?{}:{field:s.field}},s.code==="agent_turn_in_flight"?409:400);throw s}}),{capability:"admin"}),k.add("GET","/v1/openapi.json",(l)=>T(tt({routes:k.routes(),serverUrl:`${l.url.protocol}//${l.url.host}`})),{capability:"open"}),k.add("GET","/docs",()=>new Response(mt,{status:200,headers:{"content-type":"text/html; charset=utf-8"}}),{capability:"open"}),k.add("GET","/v1/provision",(l)=>T({available:t.provision!==void 0,local:x(),allowed:O(l.principal),steps:t.provision?.steps()??[]}),{capability:"read"}),k.add("POST","/v1/agents",async(l)=>{let o=t.provision;if(o===void 0)return S({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(!O(l.principal))return S({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 s=await H(l.request);if(s.kind==="error")return S(s.error,400);let c=G(ze,s.value);if(!c.ok)return S(c.error,400);let p=c.value.answers,m;try{m=o.create(p)}catch(b){if(fe(b))return S(b.toDetail(),400);throw b}try{let b=await e.adopt(m.manifestPath);return T({id:m.agentId,dir:m.dir,files:m.files,adopted:b.map((C)=>C.id)},201)}catch(b){return T({id:m.agentId,dir:m.dir,files:m.files,adopted:[],error:fe(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"}),k.add("POST","/v1/agents/:id/stop",async(l)=>{let o=l.params.id??"",s=e.list().some((E)=>E.id===o),c=await e.store.agentState.get(o);if(!s&&c===void 0)return D("agent",o);let p=await H(l.request);if(p.kind==="error")return S(p.error,400);let m=G(je,p.value);if(!m.ok)return S(m.error,400);let b=m.value.reason?.trim(),C=await e.store.agentState.disable(o,new Date(t.now?.()??Date.now()).toISOString(),b===void 0||b===""?void 0:b);if(s)try{await e.dispose(o,"stopped")}catch(E){if(fe(E)&&E.code==="agent_turn_in_flight")return S(E.toDetail(),409);throw E}return T({id:o,status:"disabled",...ie(C)})},{capability:"admin"}),k.add("POST","/v1/agents/:id/start",async(l)=>{let o=l.params.id??"";if(e.list().some((m)=>m.id===o)){let m=await e.store.agentState.enable(o);return T({id:o,status:"loaded",...ie(m)})}let s=t.resolveAgent;if(s===void 0)return S({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 c=s(o);if(c===void 0)return D("agent",o);let p=await e.store.agentState.enable(o);try{let m=await e.adopt(c);return T({id:o,status:"loaded",...ie(p),adopted:m.map((b)=>b.id)})}catch(m){if(await e.store.agentState.disable(o,new Date(t.now?.()??Date.now()).toISOString(),"start failed"),fe(m))return S(m.toDetail(),400);throw m}},{capability:"admin"}),k.add("POST","/v1/agents/:id/messages",async(l)=>j(e,l,async(o)=>{let s=await H(l.request);if(s.kind==="error")return S(s.error,400);let c=G(Te,s.value);if(!c.ok)return S(c.error,400);let p=c.value,m=p.chunks===!0,b=p.text,C=p.sessionKey??"api:default",E=Q(l,C);if(E!==void 0)return E;let R=Tt(p.deliver);if(R.kind==="error")return S(R.error,400);let V=St(p.from);if(V.kind==="error")return S(V.error,400);let B=xt(l.request);if(B.kind==="error")return S(B.error,400);let M=Gt();if(B.key!==void 0){let q=await o.store.turns.claimInboundKey({agentId:o.id,key:B.key,turnId:M,inputHash:await Et(C,b),now:new Date});if(q.kind==="replay")return T({turnId:q.turnId,sessionKey:C,replayed:!0},200);if(q.kind==="mismatch")return S({code:"idempotency_key_reused",message:`Idempotency-Key "${B.key}" was already used for a different message.`,hint:`It belongs to turn ${q.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 F=new AbortController;f.set(M,F),e.streams.open(M,{chunks:m});let zt=o.send(b,{sessionKey:C,turnId:M,source:"api",...V.from===void 0?{}:{from:V.from},signal:F.signal}).then(async(q)=>{if(R.target===void 0||q.text.trim()==="")return;await e.channels.deliver({agentId:o.id,sessionKey:C,channelId:R.target.channel,recipient:R.target.to,turnId:M,text:q.text})}).catch(()=>{}).finally(()=>{f.delete(M)});if(p.stream!==!0)return T({turnId:M,sessionKey:C},202);return Se(e,M,{accepted:{turnId:M,sessionKey:C},status:202,chunks:m})}),{capability:"chat"}),k.add("GET","/v1/agents/:id/turns/:turnId/stream",(l)=>j(e,l,async(o)=>{let s=l.params.turnId??"";if(e.streams.state(s)===void 0){let c=await o.store.turns.get(s);if(c===void 0)return D("turn",s,"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 Nt(c)}return Se(e,s,{chunks:l.url.searchParams.get("chunks")==="true"})}),{capability:"read",streaming:!0}),k.add("POST","/v1/agents/:id/turns/:turnId/stop",(l)=>j(e,l,()=>{let o=l.params.turnId??"",s=f.get(o);if(s===void 0)return S({code:"turn_not_running",message:`No cancel handle for turn ${o} 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 s.abort(),T({turnId:o,stopping:!0},202)}),{capability:"chat"}),k.add("GET","/v1/agents/:id/approvals",(l)=>j(e,l,async(o)=>T({approvals:y.pending(o.id)})),{capability:"read"}),k.add("POST","/v1/agents/:id/approvals/:approvalId",(l)=>j(e,l,async()=>{let o=await H(l.request);if(o.kind==="error")return S(o.error,400);let s=G(Ne,o.value);if(!s.ok)return S(s.error,400);let c=s.value,p=l.params.approvalId??"";if(!y.resolve(p,c.granted))return S({code:"approval_not_found",message:`No approval with id ${p} 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 T({approvalId:p,granted:c.granted})}),{capability:"chat"}),k.add("GET","/",(l)=>le("/",l),{capability:"open"}),k.add("GET","/assets/app.js",(l)=>le("/assets/app.js",l),{capability:"open"}),k.add("GET","/assets/app.css",(l)=>le("/assets/app.css",l),{capability:"open"}),k.add("POST","/v1/keys",async(l)=>{let o=t.claim!==void 0&&bt(l.request)===t.claim.token,s=await H(l.request);if(s.kind==="error")return S(s.error,400);let c=G(Ce,s.value);if(!c.ok)return S(c.error,400);let p=c.value,m=Xr(p.label);if(m!==void 0)return S({code:"key_label_invalid",message:m,hint:`A label is shown in a listing and in the UI, so it is at most ${Kn} printable characters on one line. It is a display name, not a description.`,field:"label"},400);if(o&&t.claim?.spend()!==!0)return xe();let b=p.scope;if(b?.agents!==void 0){let B=new Set(e.list().map((F)=>F.id));for(let F of await e.store.agentState.list())B.add(F.agentId);let M=b.agents.filter((F)=>!B.has(F));if(M.length>0)return S({code:"key_scope_agent_unknown",message:`No agent ${M.map((F)=>JSON.stringify(F)).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 C=b?.expiresIn===void 0?void 0:new Date(d()+b.expiresIn*1000).toISOString(),E=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}},R=zn(),V=await e.store.operatorKeys.issue({keyId:Qr(d()),label:p.label.trim(),fingerprint:await Bn(R),createdAt:new Date(d()).toISOString(),...E===void 0||Object.keys(E).length===0?{}:{scope:E},...C===void 0?{}:{expiresAt:C}});return T({...V,secret:R},201)},{capability:"admin"}),k.add("GET","/v1/keys",async()=>{let l=await e.store.operatorKeys.list();return T({keys:l,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"}),k.add("DELETE","/v1/keys/:keyId",async(l)=>{let o=l.params.keyId??"",s=await e.store.operatorKeys.revoke(o,new Date(d()).toISOString());if(s===void 0)return D("key",o,"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 T(s)},{capability:"admin"}),k.add("GET","/v1/agents/:id/turns/:turnId",(l)=>j(e,l,async(o)=>{let s=await o.store.turns.get(l.params.turnId??"");if(s===void 0)return D("turn",l.params.turnId??"");return T(s)}),{capability:"read"}),k.add("GET","/v1/agents/:id/sessions",(l)=>j(e,l,async(o)=>T(kt(l.principal,await o.store.sessions.list(o.id)))),{capability:"read"}),k.add("GET","/v1/agents/:id/sessions/:key",(l)=>j(e,l,async(o)=>{let s=l.params.key??"",c=Q(l,s);if(c!==void 0)return c;let p=await o.store.sessions.get(o.id,s);if(p===void 0)return D("session",s);return T(p)}),{capability:"read"}),k.add("GET","/v1/agents/:id/sessions/:key/messages",(l)=>j(e,l,async(o)=>{let s=l.url.searchParams.get("before"),c=l.url.searchParams.get("limit"),p=Q(l,l.params.key??"");if(p!==void 0)return p;let m=await o.store.messages.page(o.id,l.params.key??"",{...s===null?{}:{before:Number.parseInt(s,10)},...c===null?{}:{limit:Number.parseInt(c,10)}});return T(m)}),{capability:"read"}),k.add("DELETE","/v1/agents/:id/sessions/:key",(l)=>j(e,l,async(o)=>{let s=Q(l,l.params.key??"");if(s!==void 0)return s;return await o.store.sessions.clear(o.id,l.params.key??""),T({cleared:l.params.key??"",memoryFilesKept:!0})}),{capability:"write"}),k.add("POST","/v1/agents/:id/sessions/:key/phase",(l)=>j(e,l,async(o)=>{let s=await H(l.request);if(s.kind==="error")return S(s.error,400);let c=G(_e,s.value);if(!c.ok)return S(c.error,400);let p=c.value.phase;if(typeof p!=="string"&&p!==null)return S({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 m=Q(l,l.params.key??"");if(m!==void 0)return m;return await o.store.sessions.setPhase(o.id,l.params.key??"",p===null?void 0:p),T({phase:p})}),{capability:"write"}),k.add("GET","/v1/agents/:id/schedules",(l)=>j(e,l,async(o)=>{let s=l.url.searchParams.get("enabled"),c=await o.store.schedules.list(o.id,s===null?{}:{enabled:s==="true"});return T({schedules:c})}),{capability:"read"}),k.add("POST","/v1/agents/:id/schedules",(l)=>j(e,l,async(o)=>{let s=await H(l.request);if(s.kind==="error")return S(s.error,400);return be(e,o,s.value,void 0)}),{capability:"write"}),k.add("GET","/v1/agents/:id/schedules/:sid",(l)=>j(e,l,async(o)=>{let s=l.params.sid??"",c=await o.store.schedules.get(o.id,s);return c===void 0?D("schedule",s):T(c)}),{capability:"read"}),k.add("PATCH","/v1/agents/:id/schedules/:sid",(l)=>j(e,l,async(o)=>{let s=l.params.sid??"",c=await o.store.schedules.get(o.id,s);if(c===void 0)return D("schedule",s);let p=ye(c);if(p!==void 0)return p;let m=await H(l.request);if(m.kind==="error")return S(m.error,400);let b=m.value===null||typeof m.value!=="object"||Array.isArray(m.value)?{}:m.value,{id:C,...E}=b,R={kind:c.kind,expr:c.expr,task:c.task,deliver:c.deliverChannel===void 0||c.deliverTo===void 0?"none":{channel:c.deliverChannel,to:c.deliverTo},session:c.sessionMode,enabled:c.enabled,...c.timezone===void 0?{}:{timezone:c.timezone},...c.role===void 0?{}:{role:c.role},...E,id:c.id};return be(e,o,R,c)}),{capability:"write"}),k.add("DELETE","/v1/agents/:id/schedules/:sid",(l)=>j(e,l,async(o)=>{let s=l.params.sid??"",c=await o.store.schedules.get(o.id,s);if(c===void 0)return D("schedule",s);let p=ye(c);if(p!==void 0)return p;if(!await o.store.schedules.remove(o.id,s))return D("schedule",s);return e.scheduler.changed(),T({removed:s})}),{capability:"write"}),k.add("POST","/v1/agents/:id/schedules/:sid/run",(l)=>j(e,l,async(o)=>{let s=l.params.sid??"",c=await o.store.schedules.get(o.id,s);if(c===void 0)return D("schedule",s);let p=Jr(),m=so(c.sessionMode,c.id,p),b=Gt();return e.streams.open(b),o.send(c.task,{sessionKey:m,turnId:b,source:`schedule:${c.id}:manual`,...c.role===void 0?{}:{role:c.role}}).catch(()=>{}),T({scheduleId:c.id,turnId:b,sessionKey:m,outOfBand:!0},202)}),{capability:"write"}),k.add("GET","/v1/agents/:id/config",(l)=>j(e,l,async(o)=>{let s=e.sourceOf(o.id),c=typeof s==="string"?s:void 0,p=c===void 0?void 0:await Ue(c,"utf8");return T({...c===void 0?{editable:!1}:{editable:!0,file:c},settings:De.filter((m)=>Yt.includes(m.path)).map((m)=>({path:m.path,means:m.means,...m.confirm===void 0?{}:{confirm:m.confirm},...p===void 0?{}:{value:ro(p,m.path.split("."))}}))})}),{capability:"admin"}),k.add("PATCH","/v1/agents/:id/config",(l)=>j(e,l,async(o)=>{let s=await H(l.request);if(s.kind==="error")return S(s.error,400);let c=G(Qe,s.value);if(!c.ok)return S(c.error,400);let p=e.sourceOf(o.id);if(typeof p!=="string")return S({code:"config_not_editable",message:`"${o.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 m=oo(c.value.path);if(m===void 0||!Yt.includes(m.path))return S({code:"config_path_unknown",message:m?.via===void 0?`"${c.value.path}" is not a field this surface sets.`:`"${c.value.path}" is set by \`${m.via}\`, not by a dotted path.`,hint:m?.via===void 0?`GET /v1/agents/:id/config lists every one. Nearest: ${rt(c.value.path,Yt)??Yt.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(m.confirm!==void 0&&c.value.confirm!==!0)return S({code:"config_confirm_required",message:m.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 Zt({file:p,path:m.path.split("."),value:Vt(c.value.value)})}catch(E){if(fe(E))return S(E.toDetail(),400);throw E}let C;try{await e.replace(o.id)}catch(E){if(!fe(E))throw E;C=E.toDetail()}return T({path:m.path,before:b.before,after:b.after,reflowed:b.reflowed,...C===void 0?{applied:!0}:{applied:!1,pending:C}})}),{capability:"admin"}),k.add("GET","/v1/agents/:id/tools",(l)=>j(e,l,(o)=>{let s=o.manifest.phases,c=mr(s);return T(o.tools.specs().map((p)=>({slug:p.slug,summary:p.summary,mutating:p.mutating,trust:p.trust,...p.trustReason===void 0?{}:{trustReason:p.trustReason},provider:p.provider??"local",tags:p.tags,...c?{phases:to(s,p)}:{}})))}),{capability:"read"}),k.add("GET","/v1/agents/:id/skills",(l)=>j(e,l,(o)=>{let s=o.skills;if(s===void 0)return T({skills:[],configured:!1});return T({configured:!0,maxActive:s.maxActive,threshold:s.threshold,cached:s.cached,skills:s.skills.map((c)=>({name:c.name,description:c.frontmatter.description,tokens:c.tokens,...c.frontmatter.whenNotToUse===void 0?{}:{whenNotToUse:c.frontmatter.whenNotToUse},scripts:c.scripts.map((p)=>p.slug)}))})}),{capability:"read"}),k.add("GET","/v1/agents/:id/context",(l)=>j(e,l,async(o)=>{let s=l.url.searchParams.get("sessionKey"),c=l.url.searchParams.get("input");return T(await o.previewContext({...s===null?{}:{sessionKey:s},...c===null?{}:{input:c}}))}),{capability:"read"}),k.add("POST","/v1/channels/:channelId/webhook/:agentId",async(l)=>{let o=await H(l.request);if(o.kind==="error")return S(o.error,400);let s={};l.request.headers.forEach((p,m)=>{s[m.toLowerCase()]=p});let c=await e.channels.handleWebhook(l.params.agentId??"",l.params.channelId??"",{body:o.value,headers:s});return new Response(c.detail??"",{status:c.status,headers:{"content-type":"text/plain; charset=utf-8"}})},{capability:"open"}),k.add("GET","/v1/events",(l)=>{let o=l.url.searchParams.get("agentId");if(o!==null&&!K(l.principal,o))return D("agent",o);let s=l.url.searchParams.get("types")?.split(",").filter(Boolean),c=l.url.searchParams.get("chunks")==="true",p=s?.includes("model.chunk")===!0,m=c||p,b=s?.filter((C)=>!Me.includes(C));if(b!==void 0&&b.length>0){let C=rt(b[0]??"",Me);return S({code:"unknown_event_type",message:`No such event type: ${b.join(", ")}.`,hint:C===void 0?"The full catalogue is the event table in docs/04-SPEC-WIRE.md. Omit ?types= to receive every event.":`Did you mean "${C}"? The full catalogue is the event table in docs/04-SPEC-WIRE.md.`,field:"types"},400)}return se({...l.request.signal===void 0?{}:{signal:l.request.signal},start:({send:C})=>(C({event:"stream.subscribed",data:{agentId:o??null,types:s??null,chunks:m,...m&&!c?{implied:"types names model.chunk"}:{}}}),e.bus.on("*",(E)=>{if(o!==null&&E.agentId!==o)return;if(E.agentId!==void 0&&!K(l.principal,E.agentId))return;if(E.sessionKey!==void 0&&!Z(l.principal,E.sessionKey))return;if(s!==void 0&&s.length>0&&!s.includes(E.type))return;C({event:E.type,data:E})},{chunks:m}))})},{capability:"read",streaming:!0}),Object.assign(async(l)=>{let o;try{o=new URL(l.url)}catch{return S({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 s=l.method.toUpperCase();if(s==="OPTIONS"){let b=k.match("OPTIONS",o.pathname);if(b.kind==="method"){let E=k.match("HEAD",o.pathname).kind==="method"&&yt(k,o.pathname),R=[...b.allowed,...b.allowed.includes("GET")&&!E?["HEAD"]:[],"OPTIONS"];return w(l,new Response(null,{status:204,headers:{allow:R.join(", "),...t.origin===void 0?{}:lt(l,R)}}))}}if(s==="HEAD"){let b=k.match("GET",o.pathname);if(b.kind==="found"){if(b.streaming)return S({code:"method_not_allowed",message:`HEAD is not allowed on ${o.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 C=_(l);if(C!==void 0)return C;let E=await U(l,o.pathname,b.capability);if(E instanceof Response)return E;let R=await we(b.handler,{request:l,url:o,params:b.params,principal:E});return w(l,new Response(null,{status:R.status,headers:R.headers}))}}let c=k.match(s,o.pathname);if(c.kind==="method")return S({code:"method_not_allowed",message:`${s} is not allowed on ${o.pathname}.`,hint:`This path accepts ${c.allowed.join(", ")}.`},405,{allow:c.allowed.join(", ")});if(c.kind==="none")return S({code:"not_found",message:`No route for ${l.method} ${o.pathname}.`,hint:"Every path is under /v1. See docs/04-SPEC-WIRE.md for the surface."},404);let p=_(l);if(p!==void 0)return p;let m=await U(l,o.pathname,c.capability);if(m instanceof Response)return m;return w(l,await we(c.handler,{request:l,url:o,params:c.params,principal:m}))},{authenticate:(l)=>U(l,"/v1/ws","read")})}function ye(t){if(t.origin!=="manifest")return;return S({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,n,d){if(n===null||typeof n!=="object"||Array.isArray(n))return S({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 u=io({agentId:e.id,body:n,channelIds:e.manifest.channels.map((y)=>y.id),roleNames:Object.keys(e.manifest.model),now:Date.now(),origin:"api",...d===void 0?{}:{existing:d}}),f=await e.store.schedules.upsert(u);return t.scheduler.changed(),T(f,d===void 0?201:200)}catch(u){let f=fe(u)?u.toDetail():{code:"schedule_invalid",message:u instanceof Error?u.message:String(u),hint:"See docs/02-SPEC-MANIFEST.md for the schedule fields."};return S(f,400)}}function le(t,e){let n=ht(t,e.request);if(n===void 0)throw new z({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 n}function T(t,e=200){return new Response(JSON.stringify(t),{status:e,headers:{"content-type":"application/json; charset=utf-8"}})}function vt(t){return t==="/v1/health"||t==="/v1/ready"||t.startsWith("/v1/channels/")||ft.includes(t)||t==="/docs"||t==="/v1/openapi.json"}function yt(t,e){let n=t.match("GET",e);return n.kind==="found"&&n.streaming}async function we(t,e){try{return await t(e)}catch(n){if(fe(n))return S(n.toDetail(),400);return S({code:"internal_error",message:n instanceof Error?n.message:String(n),hint:"An unexpected failure in the server. The runtime's event stream carries what happened around it."},500)}}function D(t,e,n){return S({code:`${t}_not_found`,message:`No ${t} "${e}".`,hint:n??"Check the id — it is case-sensitive, and a session key includes its channel segment."},404)}function bt(t){let e=t.headers.get("authorization")??"";if(!e.startsWith("Bearer "))return;let n=e.slice(7);return n===""?void 0:n}function j(t,e,n){let d=e.params.id??"",u=t.list().find((f)=>f.id===d);if(u===void 0)return D("agent",d);if(!K(e.principal,d))return D("agent",d);return n(u)}function wt(t,e){if(!Ae(t))return e;return e.filter((n)=>K(t,n.id))}function kt(t,e){if(!Ae(t))return e;return e.filter((n)=>Z(t,n.sessionKey))}function Q(t,e){return Z(t.principal,e)?void 0:D("session",e)}function ke(t,e){let n=e.manifest.phases,d=mr(n);return{id:e.id,name:e.manifest.name??e.id,status:"loaded",model:e.manifest.model.main.id,channels:t.channels.statusOf(e.id),entryPhase:d?eo(n)??null:null,...d?{phases:Object.keys(n)}:{}}}function ie(t){return{...t.disabledAt===void 0?{}:{disabledAt:t.disabledAt},...t.reason===void 0?{}:{reason:t.reason}}}async function H(t){let e=Number.parseInt(t.headers.get("content-length")??"0",10);if(Number.isFinite(e)&&e>Y)return{kind:"error",error:{code:"body_too_large",message:`The request body declares ${e} bytes; the limit is ${Y}.`,hint:"This cap is enforced before a channel plugin sees anything, so a plugin never has to defend against a large POST."}};let n=await t.text();if(n.length>Y)return{kind:"error",error:{code:"body_too_large",message:`The request body is ${n.length} bytes; the limit is ${Y}.`,hint:"Send less. A message longer than this is not a message."}};if(n==="")return{kind:"ok",value:{}};try{return{kind:"ok",value:JSON.parse(n)}}catch(d){return{kind:"error",error:{code:"body_not_json",message:`The request body is not valid JSON: ${d instanceof Error?d.message:String(d)}`,hint:"Send application/json. A shell quoting mistake is the usual cause — check for unescaped quotes inside the payload."}}}}function St(t){if(t===void 0||t===null)return{kind:"ok",from:void 0};let e=(d,u,f="from")=>({kind:"error",error:{code:"sender_invalid",message:d,hint:u,field:f}});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 n=t;if(typeof n.id!=="string"||n.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(n.id.length>ve)return e(`from.id is ${n.id.length} characters, over the ${ve} 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 n.kind!=="string"||!Le.includes(n.kind)){let d=typeof n.kind==="string"?rt(n.kind,Le):void 0;return e(`from.kind must be one of: ${Le.join(", ")}.`,`${d===void 0?"":`Did you mean "${d}"? `}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(n.name!==void 0&&typeof n.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:n.id,kind:n.kind,...n.name===void 0?{}:{name:n.name.slice(0,pt)}}}}function xt(t){let e=t.headers.get("idempotency-key");if(e===null)return{kind:"ok",key:void 0};let n=e.trim(),d=(u)=>({kind:"error",error:{code:"idempotency_key_invalid",message:u,hint:`Send 1-${re} 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(n==="")return d("Idempotency-Key is present but empty.");if(n.length>re)return d(`Idempotency-Key is ${n.length} characters, over the ${re} limit.`);if(!/^[\x20-\x7e]+$/.test(n))return d("Idempotency-Key contains characters that are not printable ASCII.");return{kind:"ok",key:n}}async function Et(t,e){let n=new TextEncoder().encode(`${t}\x00${e}`),d=await crypto.subtle.digest("SHA-256",n);return Array.from(new Uint8Array(d)).map((u)=>u.toString(16).padStart(2,"0")).join("")}function Tt(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 Nt(t){let e=t.status==="running";return se({start:({send:n,close:d})=>{n({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."}}}),d();return}})}function Se(t,e,n){return se({...n?.status===void 0?{}:{status:n.status},start:({send:d,close:u})=>{if(n?.accepted!==void 0)d({event:"turn.accepted",data:n.accepted});let f=t.streams.attach(e,(y)=>{if(d({event:y.type,data:y}),y.type==="turn.end")u()},{chunks:n?.chunks===!0});if(f===void 0){d({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."}}),u();return}d({event:"stream.replay",data:{turnId:e,state:f.state,events:f.replay.length,truncated:f.truncated,dropped:f.dropped,chunks:f.chunks,...f.truncated?{hint:`The oldest ${f.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 y of f.replay)d({event:y.type,data:y});if(f.state==="ended")u();return()=>f.unsubscribe()}})}function Lr(){let t=zn(),e=!1;return{token:t,live:()=>!e,spend:()=>{if(e)return!1;return e=!0,!0}}}function Xe(t){let e=t.startsWith("[")&&t.endsWith("]")?t.slice(1,-1):t,n=e==="0.0.0.0"||e==="::"||e===""?"127.0.0.1":e;return n.includes(":")?`[${n}]`:n}function Dr(t,e,n){return`http://${Xe(t)}:${e}/?claim=${n}`}function Fr(t,e,n){return`curl -sX POST http://${Xe(t)}:${e}/v1/keys -H 'Authorization: Bearer ${n}' -H 'content-type: application/json' -d '{"label":"my browser"}'`}function Ct(t,e,n=new Map){let d=new Set,u,f=0,y,x=(w)=>{let A=w.type==="model.chunk";for(let N of d){if(N.data.agentId!==void 0&&w.agentId!==N.data.agentId)continue;if(w.agentId!==void 0&&!K(N.data.principal,w.agentId))continue;if(w.sessionKey!==void 0&&!Z(N.data.principal,w.sessionKey))continue;if(A&&!N.data.chunks)continue;try{N.send(JSON.stringify(w))}catch{}}},O=()=>{if(f+=1,y===void 0)y=t.bus.on("model.chunk",x)},_=()=>{if(f===0)return;if(f-=1,f===0)y?.(),y=void 0};return{async accept(w){let A=new URL(w.url),N=qe(w),U=A.searchParams.get("token"),I=await e(Ge(w,N??U??""));if(I instanceof Response)return{kind:"reject",response:I};let l=A.searchParams.get("agentId");if(l!==null&&!K(I,l))return{kind:"reject",response:new Response(JSON.stringify({error:{code:"agent_not_found",message:`No agent "${l}".`,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:l??void 0,chunks:A.searchParams.get("chunks")==="true",principal:I},...N===void 0?{}:{protocol:Ee}}},handlers:{open(w){if(d.add(w),u===void 0)u=t.bus.on("*",x);if(w.data.chunks)O();w.send(JSON.stringify({type:"ws.open",agentId:w.data.agentId??null,chunks:w.data.chunks}))},message(w,A){let N;try{N=JSON.parse(typeof A==="string"?A:new TextDecoder().decode(A))}catch{w.send(JSON.stringify({type:"ws.error",code:"frame_not_json"}));return}if(N.type==="ping"){w.send(JSON.stringify({type:"pong"}));return}if(N.type==="subscribe"){if(N.agentId===void 0&&N.sessionKey!==void 0){w.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 s=typeof N.chunks==="boolean"?N.chunks:w.data.chunks;if(s&&!w.data.chunks)O();else if(!s&&w.data.chunks)_();let c=N.agentId??w.data.agentId;if(c!==void 0&&!K(w.data.principal,c)){w.send(JSON.stringify({type:"ws.error",error:{code:"agent_not_found",message:`No agent "${c}".`,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}w.data={agentId:c,chunks:s,principal:w.data.principal},w.send(JSON.stringify({type:"ws.subscribed",agentId:w.data.agentId??null,chunks:w.data.chunks}));return}if(N.type==="stop"){let s=N.turnId===void 0?void 0:n.get(N.turnId);s?.abort(),w.send(JSON.stringify({type:"ws.stopping",turnId:N.turnId??null,found:s!==void 0}));return}if(N.type!=="message"){w.send(JSON.stringify({type:"ws.error",code:"unknown_frame_type"}));return}let U=w.data.agentId,k=t.list().find((s)=>s.id===U);if(k===void 0){w.send(JSON.stringify({type:"ws.error",code:"agent_not_found"}));return}let I=N.text??"";if(I.trim()===""){w.send(JSON.stringify({type:"ws.error",code:"message_text_required"}));return}let l=Gt(),o=new AbortController;n.set(l,o),w.send(JSON.stringify({type:"ws.accepted",turnId:l})),k.send(I,{sessionKey:N.sessionKey??"api:default",turnId:l,source:"ws",signal:o.signal}).catch(()=>{}).finally(()=>n.delete(l))},close(w){if(d.delete(w)&&w.data.chunks)_();if(d.size===0)u?.(),u=void 0}},closeAll(){for(let w of d)try{w.close(1001,"server stopping")}catch{}d.clear(),u?.(),u=void 0,y?.(),y=void 0,f=0}}}async function Ur(t){let{host:e,port:n,runtime:d}=t;if(!J(e)&&t.token===void 0)throw new z({code:"server_public_without_token",message:`Refusing to bind ${e}:${n} 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 u=new Map,f=gt({runtime:d,...t.token===void 0?{}:{token:t.token},...t.token===void 0?{allowUnauthenticated:!0}:{},...t.now===void 0?{}:{now:t.now},running:u,...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},origin:{host:t.host,...t.allowedOrigins===void 0?{}:{allowedOrigins:t.allowedOrigins},...t.allowedHosts===void 0?{}:{allowedHosts:t.allowedHosts}}});if(typeof Bun<"u"&&typeof Bun.serve==="function")return _t(f,t,u);return jt(f,t)}function _t(t,e,n){let d=Ct(e.runtime,t.authenticate,n),u=Bun.serve({port:e.port,hostname:e.host,idleTimeout:Math.min(255,Math.ceil(Pe/1000*3)),fetch:async(f,y)=>{if(new URL(f.url).pathname!=="/v1/ws")return t(f);let O=oe(f,{host:e.host,...e.allowedOrigins===void 0?{}:{allowedOrigins:e.allowedOrigins},...e.allowedHosts===void 0?{}:{allowedHosts:e.allowedHosts}});if(O!==void 0)return new Response(JSON.stringify({error:O}),{status:403,headers:{"content-type":"application/json; charset=utf-8"}});let _=await d.accept(f);if(_.kind==="reject")return _.response;if(y.upgrade(f,{data:_.session,..._.protocol===void 0?{}:{headers:{"sec-websocket-protocol":_.protocol}}}))return;return new Response("upgrade failed",{status:400})},websocket:{open:(f)=>d.handlers.open(f),message:(f,y)=>d.handlers.message(f,y),close:(f)=>d.handlers.close(f)}});return{url:`http://${e.host}:${u.port}`,port:u.port??e.port,host:e.host,websocket:!0,stop:async()=>{d.closeAll(),await u.stop(!0)}}}async function jt(t,e){let{createServer:n}=await import("node:http"),d=n((y,x)=>{(async()=>{let O=[];for await(let I of y)O.push(I);let _=`http://${y.headers.host??`${e.host}:${e.port}`}${y.url??"/"}`,w=new Headers;for(let[I,l]of Object.entries(y.headers))if(typeof l==="string")w.set(I,l);else if(Array.isArray(l))w.set(I,l.join(", "));if(new URL(_).pathname==="/v1/ws"){x.writeHead(501,{"content-type":"application/json; charset=utf-8"}),x.end(JSON.stringify({error:{code:"websocket_unavailable",message:"This process is running under Node, where /v1/ws is not served.",hint:"Run under Bun for WebSocket support, or use GET /v1/events (SSE) plus POST /v1/agents/:id/messages — everything the WS endpoint does is achievable over HTTP, which is why the spec calls it secondary."}}));return}let A=y.method??"GET",N=await t(new Request(_,{method:A,headers:w,...A==="GET"||A==="HEAD"?{}:{body:Buffer.concat(O)}})),U={};if(N.headers.forEach((I,l)=>{U[l]=I}),x.writeHead(N.status,U),N.body===null){x.end();return}let k=N.body.getReader();x.on("close",()=>void k.cancel().catch(()=>{}));for(;;){let{done:I,value:l}=await k.read();if(I)break;x.write(Buffer.from(l))}x.end()})().catch(()=>{if(!x.headersSent)x.writeHead(500);x.end()})});await new Promise((y,x)=>{d.once("error",x),d.listen(e.port,e.host,()=>{d.removeListener("error",x),y()})});let u=d.address(),f=typeof u==="object"&&u!==null?u.port:e.port;return{url:`http://${e.host}:${f}`,port:f,host:e.host,websocket:!1,stop:()=>new Promise((y)=>{d.closeAllConnections?.(),d.close(()=>y())})}}
|
|
74
|
+
export{cr,Lr,Xe,Dr,Fr,Ur};
|
|
75
|
+
|
|
76
|
+
//# debugId=B92EEE8ECD78A50464756E2164756E21
|
|
77
|
+
//# sourceMappingURL=index-fecm8xe7.js.map
|