@source-repo/rpc-cli 4.5.0 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/console.d.ts +15 -2
- package/dist/console.d.ts.map +1 -1
- package/dist/console.js +49 -15
- package/dist/console.js.map +1 -1
- package/dist/console.types.json +483 -0
- package/dist/credentials.d.ts +77 -0
- package/dist/credentials.d.ts.map +1 -0
- package/dist/credentials.js +118 -0
- package/dist/credentials.js.map +1 -0
- package/dist/enrolment.d.ts +91 -0
- package/dist/enrolment.d.ts.map +1 -0
- package/dist/enrolment.js +94 -0
- package/dist/enrolment.js.map +1 -0
- package/dist/extract.d.ts.map +1 -1
- package/dist/extract.js +97 -3
- package/dist/extract.js.map +1 -1
- package/dist/grants.d.ts +25 -0
- package/dist/grants.d.ts.map +1 -0
- package/dist/grants.js +62 -0
- package/dist/grants.js.map +1 -0
- package/dist/index.js +254 -41
- package/dist/index.js.map +1 -1
- package/dist/mcp.d.ts +5 -0
- package/dist/mcp.d.ts.map +1 -1
- package/dist/mcp.js +329 -2
- package/dist/mcp.js.map +1 -1
- package/dist/network.d.ts +47 -1
- package/dist/network.d.ts.map +1 -1
- package/dist/network.js +17 -1
- package/dist/network.js.map +1 -1
- package/dist/node.d.ts +15 -0
- package/dist/node.d.ts.map +1 -1
- package/dist/node.js +14 -1
- package/dist/node.js.map +1 -1
- package/dist/pairing.d.ts +52 -0
- package/dist/pairing.d.ts.map +1 -0
- package/dist/pairing.js +57 -0
- package/dist/pairing.js.map +1 -0
- package/dist/scripting.d.ts +10 -0
- package/dist/scripting.d.ts.map +1 -1
- package/dist/scripting.js +2 -2
- package/dist/scripting.js.map +1 -1
- package/dist/scripts.d.ts +27 -3
- package/dist/scripts.d.ts.map +1 -1
- package/dist/scripts.js +31 -8
- package/dist/scripts.js.map +1 -1
- package/dist/tasks.d.ts +189 -0
- package/dist/tasks.d.ts.map +1 -0
- package/dist/tasks.js +485 -0
- package/dist/tasks.js.map +1 -0
- package/dist/web/app.css +1 -1
- package/dist/web/app.js +12 -12
- package/dist/web/app.js.map +1 -1
- package/package.json +7 -5
package/dist/web/app.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
var bv=Object.create;var kc=Object.defineProperty;var wv=Object.getOwnPropertyDescriptor;var dp=(r,n)=>(n=Symbol[r])?n:Symbol.for("Symbol."+r),ha=r=>{throw TypeError(r)};var pp=(r,n,a)=>n in r?kc(r,n,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[n]=a;var up=(r,n)=>kc(r,"name",{value:n,configurable:!0});var mp=r=>[,,,bv(r?.[dp("metadata")]??null)],yp=["class","method","getter","setter","accessor","field","value","get","set"],fa=r=>r!==void 0&&typeof r!="function"?ha("Function expected"):r,Sv=(r,n,a,l,u)=>({kind:yp[r],name:n,metadata:l,addInitializer:f=>a._?ha("Already initialized"):u.push(fa(f||null))}),xv=(r,n)=>pp(n,dp("metadata"),r[3]),Tc=(r,n,a,l)=>{for(var u=0,f=r[n>>1],d=f&&f.length;u<d;u++)n&1?f[u].call(a):l=f[u].call(a,l);return l},Vl=(r,n,a,l,u,f)=>{var d,m,y,b,R,w=n&7,j=!!(n&8),L=!!(n&16),K=w>3?r.length+1:w?j?1:2:0,P=yp[w+5],W=w>3&&(r[K-1]=[]),z=r[K]||(r[K]=[]),X=w&&(!L&&!j&&(u=u.prototype),w<5&&(w>3||!L)&&wv(w<4?u:{get[a](){return fp(this,f)},set[a](N){return hp(this,f,N)}},a));w?L&&w<4&&up(f,(w>2?"set ":w>1?"get ":"")+a):up(u,a);for(var J=l.length-1;J>=0;J--)b=Sv(w,a,y={},r[3],z),w&&(b.static=j,b.private=L,R=b.access={has:L?N=>Ev(u,N):N=>a in N},w^3&&(R.get=L?N=>(w^1?fp:kv)(N,u,w^4?f:X.get):N=>N[a]),w>2&&(R.set=L?(N,C)=>hp(N,u,C,w^4?f:X.set):(N,C)=>N[a]=C)),m=(0,l[J])(w?w<4?L?f:X[P]:w>4?void 0:{get:X.get,set:X.set}:u,b),y._=1,w^4||m===void 0?fa(m)&&(w>4?W.unshift(m):w?L?f=m:X[P]=m:u=m):typeof m!="object"||m===null?ha("Object expected"):(fa(d=m.get)&&(X.get=d),fa(d=m.set)&&(X.set=d),fa(d=m.init)&&W.unshift(d));return w||xv(r,u),X&&kc(u,a,X),L?w^4?f:X:u},gp=(r,n,a)=>pp(r,typeof n!="symbol"?n+"":n,a),_c=(r,n,a)=>n.has(r)||ha("Cannot "+a),Ev=(r,n)=>Object(n)!==n?ha('Cannot use the "in" operator on this value'):r.has(n),fp=(r,n,a)=>(_c(r,n,"read from private field"),a?a.call(r):n.get(r));var hp=(r,n,a,l)=>(_c(r,n,"write to private field"),l?l.call(r,a):n.set(r,a),a),kv=(r,n,a)=>(_c(r,n,"access private method"),a);(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))l(u);new MutationObserver(u=>{for(const f of u)if(f.type==="childList")for(const d of f.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&l(d)}).observe(document,{childList:!0,subtree:!0});function a(u){const f={};return u.integrity&&(f.integrity=u.integrity),u.referrerPolicy&&(f.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?f.credentials="include":u.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function l(u){if(u.ep)return;u.ep=!0;const f=a(u);fetch(u.href,f)}})();function Tv(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Ac={exports:{}},da={};var vp;function _v(){if(vp)return da;vp=1;var r=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function a(l,u,f){var d=null;if(f!==void 0&&(d=""+f),u.key!==void 0&&(d=""+u.key),"key"in u){f={};for(var m in u)m!=="key"&&(f[m]=u[m])}else f=u;return u=f.ref,{$$typeof:r,type:l,key:d,ref:u!==void 0?u:null,props:f}}return da.Fragment=n,da.jsx=a,da.jsxs=a,da}var bp;function Av(){return bp||(bp=1,Ac.exports=_v()),Ac.exports}var g=Av(),Nc={exports:{}},ce={};var wp;function Nv(){if(wp)return ce;wp=1;var r=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),d=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),b=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),w=Symbol.for("react.activity"),j=Symbol.iterator;function L(S){return S===null||typeof S!="object"?null:(S=j&&S[j]||S["@@iterator"],typeof S=="function"?S:null)}var K={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},P=Object.assign,W={};function z(S,q,G){this.props=S,this.context=q,this.refs=W,this.updater=G||K}z.prototype.isReactComponent={},z.prototype.setState=function(S,q){if(typeof S!="object"&&typeof S!="function"&&S!=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,S,q,"setState")},z.prototype.forceUpdate=function(S){this.updater.enqueueForceUpdate(this,S,"forceUpdate")};function X(){}X.prototype=z.prototype;function J(S,q,G){this.props=S,this.context=q,this.refs=W,this.updater=G||K}var N=J.prototype=new X;N.constructor=J,P(N,z.prototype),N.isPureReactComponent=!0;var C=Array.isArray;function H(){}var B={H:null,A:null,T:null,S:null},Q=Object.prototype.hasOwnProperty;function ne(S,q,G){var ee=G.ref;return{$$typeof:r,type:S,key:q,ref:ee!==void 0?ee:null,props:G}}function se(S,q){return ne(S.type,q,S.props)}function xe(S){return typeof S=="object"&&S!==null&&S.$$typeof===r}function ue(S){var q={"=":"=0",":":"=2"};return"$"+S.replace(/[=:]/g,function(G){return q[G]})}var je=/\/+/g;function Ge(S,q){return typeof S=="object"&&S!==null&&S.key!=null?ue(""+S.key):q.toString(36)}function V(S){switch(S.status){case"fulfilled":return S.value;case"rejected":throw S.reason;default:switch(typeof S.status=="string"?S.then(H,H):(S.status="pending",S.then(function(q){S.status==="pending"&&(S.status="fulfilled",S.value=q)},function(q){S.status==="pending"&&(S.status="rejected",S.reason=q)})),S.status){case"fulfilled":return S.value;case"rejected":throw S.reason}}throw S}function k(S,q,G,ee,oe){var he=typeof S;(he==="undefined"||he==="boolean")&&(S=null);var Ee=!1;if(S===null)Ee=!0;else switch(he){case"bigint":case"string":case"number":Ee=!0;break;case"object":switch(S.$$typeof){case r:case n:Ee=!0;break;case R:return Ee=S._init,k(Ee(S._payload),q,G,ee,oe)}}if(Ee)return oe=oe(S),Ee=ee===""?"."+Ge(S,0):ee,C(oe)?(G="",Ee!=null&&(G=Ee.replace(je,"$&/")+"/"),k(oe,q,G,"",function(ti){return ti})):oe!=null&&(xe(oe)&&(oe=se(oe,G+(oe.key==null||S&&S.key===oe.key?"":(""+oe.key).replace(je,"$&/")+"/")+Ee)),q.push(oe)),1;Ee=0;var it=ee===""?".":ee+":";if(C(S))for(var Ce=0;Ce<S.length;Ce++)ee=S[Ce],he=it+Ge(ee,Ce),Ee+=k(ee,q,G,he,oe);else if(Ce=L(S),typeof Ce=="function")for(S=Ce.call(S),Ce=0;!(ee=S.next()).done;)ee=ee.value,he=it+Ge(ee,Ce++),Ee+=k(ee,q,G,he,oe);else if(he==="object"){if(typeof S.then=="function")return k(V(S),q,G,ee,oe);throw q=String(S),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(S).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return Ee}function $(S,q,G){if(S==null)return S;var ee=[],oe=0;return k(S,ee,"","",function(he){return q.call(G,he,oe++)}),ee}function F(S){if(S._status===-1){var q=S._result;q=q(),q.then(function(G){(S._status===0||S._status===-1)&&(S._status=1,S._result=G)},function(G){(S._status===0||S._status===-1)&&(S._status=2,S._result=G)}),S._status===-1&&(S._status=0,S._result=q)}if(S._status===1)return S._result.default;throw S._result}var re=typeof reportError=="function"?reportError:function(S){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof S=="object"&&S!==null&&typeof S.message=="string"?String(S.message):String(S),error:S});if(!window.dispatchEvent(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",S);return}console.error(S)},pe={map:$,forEach:function(S,q,G){$(S,function(){q.apply(this,arguments)},G)},count:function(S){var q=0;return $(S,function(){q++}),q},toArray:function(S){return $(S,function(q){return q})||[]},only:function(S){if(!xe(S))throw Error("React.Children.only expected to receive a single React element child.");return S}};return ce.Activity=w,ce.Children=pe,ce.Component=z,ce.Fragment=a,ce.Profiler=u,ce.PureComponent=J,ce.StrictMode=l,ce.Suspense=y,ce.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=B,ce.__COMPILER_RUNTIME={__proto__:null,c:function(S){return B.H.useMemoCache(S)}},ce.cache=function(S){return function(){return S.apply(null,arguments)}},ce.cacheSignal=function(){return null},ce.cloneElement=function(S,q,G){if(S==null)throw Error("The argument must be a React element, but you passed "+S+".");var ee=P({},S.props),oe=S.key;if(q!=null)for(he in q.key!==void 0&&(oe=""+q.key),q)!Q.call(q,he)||he==="key"||he==="__self"||he==="__source"||he==="ref"&&q.ref===void 0||(ee[he]=q[he]);var he=arguments.length-2;if(he===1)ee.children=G;else if(1<he){for(var Ee=Array(he),it=0;it<he;it++)Ee[it]=arguments[it+2];ee.children=Ee}return ne(S.type,oe,ee)},ce.createContext=function(S){return S={$$typeof:d,_currentValue:S,_currentValue2:S,_threadCount:0,Provider:null,Consumer:null},S.Provider=S,S.Consumer={$$typeof:f,_context:S},S},ce.createElement=function(S,q,G){var ee,oe={},he=null;if(q!=null)for(ee in q.key!==void 0&&(he=""+q.key),q)Q.call(q,ee)&&ee!=="key"&&ee!=="__self"&&ee!=="__source"&&(oe[ee]=q[ee]);var Ee=arguments.length-2;if(Ee===1)oe.children=G;else if(1<Ee){for(var it=Array(Ee),Ce=0;Ce<Ee;Ce++)it[Ce]=arguments[Ce+2];oe.children=it}if(S&&S.defaultProps)for(ee in Ee=S.defaultProps,Ee)oe[ee]===void 0&&(oe[ee]=Ee[ee]);return ne(S,he,oe)},ce.createRef=function(){return{current:null}},ce.forwardRef=function(S){return{$$typeof:m,render:S}},ce.isValidElement=xe,ce.lazy=function(S){return{$$typeof:R,_payload:{_status:-1,_result:S},_init:F}},ce.memo=function(S,q){return{$$typeof:b,type:S,compare:q===void 0?null:q}},ce.startTransition=function(S){var q=B.T,G={};B.T=G;try{var ee=S(),oe=B.S;oe!==null&&oe(G,ee),typeof ee=="object"&&ee!==null&&typeof ee.then=="function"&&ee.then(H,re)}catch(he){re(he)}finally{q!==null&&G.types!==null&&(q.types=G.types),B.T=q}},ce.unstable_useCacheRefresh=function(){return B.H.useCacheRefresh()},ce.use=function(S){return B.H.use(S)},ce.useActionState=function(S,q,G){return B.H.useActionState(S,q,G)},ce.useCallback=function(S,q){return B.H.useCallback(S,q)},ce.useContext=function(S){return B.H.useContext(S)},ce.useDebugValue=function(){},ce.useDeferredValue=function(S,q){return B.H.useDeferredValue(S,q)},ce.useEffect=function(S,q){return B.H.useEffect(S,q)},ce.useEffectEvent=function(S){return B.H.useEffectEvent(S)},ce.useId=function(){return B.H.useId()},ce.useImperativeHandle=function(S,q,G){return B.H.useImperativeHandle(S,q,G)},ce.useInsertionEffect=function(S,q){return B.H.useInsertionEffect(S,q)},ce.useLayoutEffect=function(S,q){return B.H.useLayoutEffect(S,q)},ce.useMemo=function(S,q){return B.H.useMemo(S,q)},ce.useOptimistic=function(S,q){return B.H.useOptimistic(S,q)},ce.useReducer=function(S,q,G){return B.H.useReducer(S,q,G)},ce.useRef=function(S){return B.H.useRef(S)},ce.useState=function(S){return B.H.useState(S)},ce.useSyncExternalStore=function(S,q,G){return B.H.useSyncExternalStore(S,q,G)},ce.useTransition=function(){return B.H.useTransition()},ce.version="19.2.8",ce}var Sp;function Pc(){return Sp||(Sp=1,Nc.exports=Nv()),Nc.exports}var Z=Pc(),Oc={exports:{}},pa={},jc={exports:{}},Rc={};var xp;function Ov(){return xp||(xp=1,(function(r){function n(k,$){var F=k.length;k.push($);e:for(;0<F;){var re=F-1>>>1,pe=k[re];if(0<u(pe,$))k[re]=$,k[F]=pe,F=re;else break e}}function a(k){return k.length===0?null:k[0]}function l(k){if(k.length===0)return null;var $=k[0],F=k.pop();if(F!==$){k[0]=F;e:for(var re=0,pe=k.length,S=pe>>>1;re<S;){var q=2*(re+1)-1,G=k[q],ee=q+1,oe=k[ee];if(0>u(G,F))ee<pe&&0>u(oe,G)?(k[re]=oe,k[ee]=F,re=ee):(k[re]=G,k[q]=F,re=q);else if(ee<pe&&0>u(oe,F))k[re]=oe,k[ee]=F,re=ee;else break e}}return $}function u(k,$){var F=k.sortIndex-$.sortIndex;return F!==0?F:k.id-$.id}if(r.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;r.unstable_now=function(){return f.now()}}else{var d=Date,m=d.now();r.unstable_now=function(){return d.now()-m}}var y=[],b=[],R=1,w=null,j=3,L=!1,K=!1,P=!1,W=!1,z=typeof setTimeout=="function"?setTimeout:null,X=typeof clearTimeout=="function"?clearTimeout:null,J=typeof setImmediate<"u"?setImmediate:null;function N(k){for(var $=a(b);$!==null;){if($.callback===null)l(b);else if($.startTime<=k)l(b),$.sortIndex=$.expirationTime,n(y,$);else break;$=a(b)}}function C(k){if(P=!1,N(k),!K)if(a(y)!==null)K=!0,H||(H=!0,ue());else{var $=a(b);$!==null&&V(C,$.startTime-k)}}var H=!1,B=-1,Q=5,ne=-1;function se(){return W?!0:!(r.unstable_now()-ne<Q)}function xe(){if(W=!1,H){var k=r.unstable_now();ne=k;var $=!0;try{e:{K=!1,P&&(P=!1,X(B),B=-1),L=!0;var F=j;try{t:{for(N(k),w=a(y);w!==null&&!(w.expirationTime>k&&se());){var re=w.callback;if(typeof re=="function"){w.callback=null,j=w.priorityLevel;var pe=re(w.expirationTime<=k);if(k=r.unstable_now(),typeof pe=="function"){w.callback=pe,N(k),$=!0;break t}w===a(y)&&l(y),N(k)}else l(y);w=a(y)}if(w!==null)$=!0;else{var S=a(b);S!==null&&V(C,S.startTime-k),$=!1}}break e}finally{w=null,j=F,L=!1}$=void 0}}finally{$?ue():H=!1}}}var ue;if(typeof J=="function")ue=function(){J(xe)};else if(typeof MessageChannel<"u"){var je=new MessageChannel,Ge=je.port2;je.port1.onmessage=xe,ue=function(){Ge.postMessage(null)}}else ue=function(){z(xe,0)};function V(k,$){B=z(function(){k(r.unstable_now())},$)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(k){k.callback=null},r.unstable_forceFrameRate=function(k){0>k||125<k?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Q=0<k?Math.floor(1e3/k):5},r.unstable_getCurrentPriorityLevel=function(){return j},r.unstable_next=function(k){switch(j){case 1:case 2:case 3:var $=3;break;default:$=j}var F=j;j=$;try{return k()}finally{j=F}},r.unstable_requestPaint=function(){W=!0},r.unstable_runWithPriority=function(k,$){switch(k){case 1:case 2:case 3:case 4:case 5:break;default:k=3}var F=j;j=k;try{return $()}finally{j=F}},r.unstable_scheduleCallback=function(k,$,F){var re=r.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0<F?re+F:re):F=re,k){case 1:var pe=-1;break;case 2:pe=250;break;case 5:pe=1073741823;break;case 4:pe=1e4;break;default:pe=5e3}return pe=F+pe,k={id:R++,callback:$,priorityLevel:k,startTime:F,expirationTime:pe,sortIndex:-1},F>re?(k.sortIndex=F,n(b,k),a(y)===null&&k===a(b)&&(P?(X(B),B=-1):P=!0,V(C,F-re))):(k.sortIndex=pe,n(y,k),K||L||(K=!0,H||(H=!0,ue()))),k},r.unstable_shouldYield=se,r.unstable_wrapCallback=function(k){var $=j;return function(){var F=j;j=$;try{return k.apply(this,arguments)}finally{j=F}}}})(Rc)),Rc}var Ep;function jv(){return Ep||(Ep=1,jc.exports=Ov()),jc.exports}var zc={exports:{}},ft={};var kp;function Rv(){if(kp)return ft;kp=1;var r=Pc();function n(y){var b="https://react.dev/errors/"+y;if(1<arguments.length){b+="?args[]="+encodeURIComponent(arguments[1]);for(var R=2;R<arguments.length;R++)b+="&args[]="+encodeURIComponent(arguments[R])}return"Minified React error #"+y+"; visit "+b+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var l={d:{f:a,r:function(){throw Error(n(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},u=Symbol.for("react.portal");function f(y,b,R){var w=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:u,key:w==null?null:""+w,children:y,containerInfo:b,implementation:R}}var d=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(y,b){if(y==="font")return"";if(typeof b=="string")return b==="use-credentials"?b:""}return ft.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=l,ft.createPortal=function(y,b){var R=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!b||b.nodeType!==1&&b.nodeType!==9&&b.nodeType!==11)throw Error(n(299));return f(y,b,null,R)},ft.flushSync=function(y){var b=d.T,R=l.p;try{if(d.T=null,l.p=2,y)return y()}finally{d.T=b,l.p=R,l.d.f()}},ft.preconnect=function(y,b){typeof y=="string"&&(b?(b=b.crossOrigin,b=typeof b=="string"?b==="use-credentials"?b:"":void 0):b=null,l.d.C(y,b))},ft.prefetchDNS=function(y){typeof y=="string"&&l.d.D(y)},ft.preinit=function(y,b){if(typeof y=="string"&&b&&typeof b.as=="string"){var R=b.as,w=m(R,b.crossOrigin),j=typeof b.integrity=="string"?b.integrity:void 0,L=typeof b.fetchPriority=="string"?b.fetchPriority:void 0;R==="style"?l.d.S(y,typeof b.precedence=="string"?b.precedence:void 0,{crossOrigin:w,integrity:j,fetchPriority:L}):R==="script"&&l.d.X(y,{crossOrigin:w,integrity:j,fetchPriority:L,nonce:typeof b.nonce=="string"?b.nonce:void 0})}},ft.preinitModule=function(y,b){if(typeof y=="string")if(typeof b=="object"&&b!==null){if(b.as==null||b.as==="script"){var R=m(b.as,b.crossOrigin);l.d.M(y,{crossOrigin:R,integrity:typeof b.integrity=="string"?b.integrity:void 0,nonce:typeof b.nonce=="string"?b.nonce:void 0})}}else b==null&&l.d.M(y)},ft.preload=function(y,b){if(typeof y=="string"&&typeof b=="object"&&b!==null&&typeof b.as=="string"){var R=b.as,w=m(R,b.crossOrigin);l.d.L(y,R,{crossOrigin:w,integrity:typeof b.integrity=="string"?b.integrity:void 0,nonce:typeof b.nonce=="string"?b.nonce:void 0,type:typeof b.type=="string"?b.type:void 0,fetchPriority:typeof b.fetchPriority=="string"?b.fetchPriority:void 0,referrerPolicy:typeof b.referrerPolicy=="string"?b.referrerPolicy:void 0,imageSrcSet:typeof b.imageSrcSet=="string"?b.imageSrcSet:void 0,imageSizes:typeof b.imageSizes=="string"?b.imageSizes:void 0,media:typeof b.media=="string"?b.media:void 0})}},ft.preloadModule=function(y,b){if(typeof y=="string")if(b){var R=m(b.as,b.crossOrigin);l.d.m(y,{as:typeof b.as=="string"&&b.as!=="script"?b.as:void 0,crossOrigin:R,integrity:typeof b.integrity=="string"?b.integrity:void 0})}else l.d.m(y)},ft.requestFormReset=function(y){l.d.r(y)},ft.unstable_batchedUpdates=function(y,b){return y(b)},ft.useFormState=function(y,b,R){return d.H.useFormState(y,b,R)},ft.useFormStatus=function(){return d.H.useHostTransitionStatus()},ft.version="19.2.8",ft}var Tp;function zv(){if(Tp)return zc.exports;Tp=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(n){console.error(n)}}return r(),zc.exports=Rv(),zc.exports}var _p;function Mv(){if(_p)return pa;_p=1;var r=jv(),n=Pc(),a=zv();function l(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i])}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 u(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function f(e){var t=e,i=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(i=t.return),e=t.return;while(e)}return t.tag===3?i:null}function d(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 m(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 y(e){if(f(e)!==e)throw Error(l(188))}function b(e){var t=e.alternate;if(!t){if(t=f(e),t===null)throw Error(l(188));return t!==e?null:e}for(var i=e,s=t;;){var o=i.return;if(o===null)break;var c=o.alternate;if(c===null){if(s=o.return,s!==null){i=s;continue}break}if(o.child===c.child){for(c=o.child;c;){if(c===i)return y(o),e;if(c===s)return y(o),t;c=c.sibling}throw Error(l(188))}if(i.return!==s.return)i=o,s=c;else{for(var h=!1,p=o.child;p;){if(p===i){h=!0,i=o,s=c;break}if(p===s){h=!0,s=o,i=c;break}p=p.sibling}if(!h){for(p=c.child;p;){if(p===i){h=!0,i=c,s=o;break}if(p===s){h=!0,s=c,i=o;break}p=p.sibling}if(!h)throw Error(l(189))}}if(i.alternate!==s)throw Error(l(190))}if(i.tag!==3)throw Error(l(188));return i.stateNode.current===i?e:t}function R(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=R(e),t!==null)return t;e=e.sibling}return null}var w=Object.assign,j=Symbol.for("react.element"),L=Symbol.for("react.transitional.element"),K=Symbol.for("react.portal"),P=Symbol.for("react.fragment"),W=Symbol.for("react.strict_mode"),z=Symbol.for("react.profiler"),X=Symbol.for("react.consumer"),J=Symbol.for("react.context"),N=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),H=Symbol.for("react.suspense_list"),B=Symbol.for("react.memo"),Q=Symbol.for("react.lazy"),ne=Symbol.for("react.activity"),se=Symbol.for("react.memo_cache_sentinel"),xe=Symbol.iterator;function ue(e){return e===null||typeof e!="object"?null:(e=xe&&e[xe]||e["@@iterator"],typeof e=="function"?e:null)}var je=Symbol.for("react.client.reference");function Ge(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===je?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case P:return"Fragment";case z:return"Profiler";case W:return"StrictMode";case C:return"Suspense";case H:return"SuspenseList";case ne:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case K:return"Portal";case J:return e.displayName||"Context";case X:return(e._context.displayName||"Context")+".Consumer";case N:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case B:return t=e.displayName||null,t!==null?t:Ge(e.type)||"Memo";case Q:t=e._payload,e=e._init;try{return Ge(e(t))}catch{}}return null}var V=Array.isArray,k=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F={pending:!1,data:null,method:null,action:null},re=[],pe=-1;function S(e){return{current:e}}function q(e){0>pe||(e.current=re[pe],re[pe]=null,pe--)}function G(e,t){pe++,re[pe]=e.current,e.current=t}var ee=S(null),oe=S(null),he=S(null),Ee=S(null);function it(e,t){switch(G(he,t),G(oe,e),G(ee,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Md(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Md(t),e=Cd(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}q(ee),G(ee,e)}function Ce(){q(ee),q(oe),q(he)}function ti(e){e.memoizedState!==null&&G(Ee,e);var t=ee.current,i=Cd(t,e.type);t!==i&&(G(oe,e),G(ee,i))}function Jt(e){oe.current===e&&(q(ee),q(oe)),Ee.current===e&&(q(Ee),ra._currentValue=F)}var ms,ys;function rn(e){if(ms===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);ms=t&&t[1]||"",ys=-1<i.stack.indexOf(`
|
|
1
|
+
var b0=Object.create;var Cc=Object.defineProperty;var w0=Object.getOwnPropertyDescriptor;var Op=(a,n)=>(n=Symbol[a])?n:Symbol.for("Symbol."+a),ma=a=>{throw TypeError(a)};var Rp=(a,n,s)=>n in a?Cc(a,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):a[n]=s;var _p=(a,n)=>Cc(a,"name",{value:n,configurable:!0});var Mp=a=>[,,,b0(a?.[Op("metadata")]??null)],Cp=["class","method","getter","setter","accessor","field","value","get","set"],pa=a=>a!==void 0&&typeof a!="function"?ma("Function expected"):a,x0=(a,n,s,l,o)=>({kind:Cp[a],name:n,metadata:l,addInitializer:f=>s._?ma("Already initialized"):o.push(pa(f||null))}),S0=(a,n)=>Rp(n,Op("metadata"),a[3]),zc=(a,n,s,l)=>{for(var o=0,f=a[n>>1],d=f&&f.length;o<d;o++)n&1?f[o].call(s):l=f[o].call(s,l);return l},Zr=(a,n,s,l,o,f)=>{var d,p,g,v,k,b=n&7,_=!!(n&8),G=!!(n&16),V=b>3?a.length+1:b?_?1:2:0,J=Cp[b+5],F=b>3&&(a[V-1]=[]),M=a[V]||(a[V]=[]),Y=b&&(!G&&!_&&(o=o.prototype),b<5&&(b>3||!G)&&w0(b<4?o:{get[s](){return jp(this,f)},set[s](S){return Np(this,f,S)}},s));b?G&&b<4&&_p(f,(b>2?"set ":b>1?"get ":"")+s):_p(o,s);for(var Z=l.length-1;Z>=0;Z--)v=x0(b,s,g={},a[3],M),b&&(v.static=_,v.private=G,k=v.access={has:G?S=>E0(o,S):S=>s in S},b^3&&(k.get=G?S=>(b^1?jp:k0)(S,o,b^4?f:Y.get):S=>S[s]),b>2&&(k.set=G?(S,A)=>Np(S,o,A,b^4?f:Y.set):(S,A)=>S[s]=A)),p=(0,l[Z])(b?b<4?G?f:Y[J]:b>4?void 0:{get:Y.get,set:Y.set}:o,v),g._=1,b^4||p===void 0?pa(p)&&(b>4?F.unshift(p):b?G?f=p:Y[J]=p:o=p):typeof p!="object"||p===null?ma("Object expected"):(pa(d=p.get)&&(Y.get=d),pa(d=p.set)&&(Y.set=d),pa(d=p.init)&&F.unshift(d));return b||S0(a,o),Y&&Cc(o,s,Y),G?b^4?f:Y:o},zp=(a,n,s)=>Rp(a,typeof n!="symbol"?n+"":n,s),Uc=(a,n,s)=>n.has(a)||ma("Cannot "+s),E0=(a,n)=>Object(n)!==n?ma('Cannot use the "in" operator on this value'):a.has(n),jp=(a,n,s)=>(Uc(a,n,"read from private field"),s?s.call(a):n.get(a));var Np=(a,n,s,l)=>(Uc(a,n,"write to private field"),l?l.call(a,s):n.set(a,s),s),k0=(a,n,s)=>(Uc(a,n,"access private method"),s);(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))l(o);new MutationObserver(o=>{for(const f of o)if(f.type==="childList")for(const d of f.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&l(d)}).observe(document,{childList:!0,subtree:!0});function s(o){const f={};return o.integrity&&(f.integrity=o.integrity),o.referrerPolicy&&(f.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?f.credentials="include":o.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function l(o){if(o.ep)return;o.ep=!0;const f=s(o);fetch(o.href,f)}})();function T0(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var Dc={exports:{}},ya={};var Up;function A0(){if(Up)return ya;Up=1;var a=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function s(l,o,f){var d=null;if(f!==void 0&&(d=""+f),o.key!==void 0&&(d=""+o.key),"key"in o){f={};for(var p in o)p!=="key"&&(f[p]=o[p])}else f=o;return o=f.ref,{$$typeof:a,type:l,key:d,ref:o!==void 0?o:null,props:f}}return ya.Fragment=n,ya.jsx=s,ya.jsxs=s,ya}var Dp;function _0(){return Dp||(Dp=1,Dc.exports=A0()),Dc.exports}var y=_0(),Bc={exports:{}},he={};var Bp;function j0(){if(Bp)return he;Bp=1;var a=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),d=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),v=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),_=Symbol.iterator;function G(x){return x===null||typeof x!="object"?null:(x=_&&x[_]||x["@@iterator"],typeof x=="function"?x:null)}var V={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},J=Object.assign,F={};function M(x,D,Q){this.props=x,this.context=D,this.refs=F,this.updater=Q||V}M.prototype.isReactComponent={},M.prototype.setState=function(x,D){if(typeof x!="object"&&typeof x!="function"&&x!=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,x,D,"setState")},M.prototype.forceUpdate=function(x){this.updater.enqueueForceUpdate(this,x,"forceUpdate")};function Y(){}Y.prototype=M.prototype;function Z(x,D,Q){this.props=x,this.context=D,this.refs=F,this.updater=Q||V}var S=Z.prototype=new Y;S.constructor=Z,J(S,M.prototype),S.isPureReactComponent=!0;var A=Array.isArray;function $(){}var z={H:null,A:null,T:null,S:null},W=Object.prototype.hasOwnProperty;function P(x,D,Q){var ee=Q.ref;return{$$typeof:a,type:x,key:D,ref:ee!==void 0?ee:null,props:Q}}function ie(x,D){return P(x.type,D,x.props)}function de(x){return typeof x=="object"&&x!==null&&x.$$typeof===a}function le(x){var D={"=":"=0",":":"=2"};return"$"+x.replace(/[=:]/g,function(Q){return D[Q]})}var fe=/\/+/g;function Ce(x,D){return typeof x=="object"&&x!==null&&x.key!=null?le(""+x.key):D.toString(36)}function K(x){switch(x.status){case"fulfilled":return x.value;case"rejected":throw x.reason;default:switch(typeof x.status=="string"?x.then($,$):(x.status="pending",x.then(function(D){x.status==="pending"&&(x.status="fulfilled",x.value=D)},function(D){x.status==="pending"&&(x.status="rejected",x.reason=D)})),x.status){case"fulfilled":return x.value;case"rejected":throw x.reason}}throw x}function j(x,D,Q,ee,ce){var pe=typeof x;(pe==="undefined"||pe==="boolean")&&(x=null);var Ae=!1;if(x===null)Ae=!0;else switch(pe){case"bigint":case"string":case"number":Ae=!0;break;case"object":switch(x.$$typeof){case a:case n:Ae=!0;break;case k:return Ae=x._init,j(Ae(x._payload),D,Q,ee,ce)}}if(Ae)return ce=ce(x),Ae=ee===""?"."+Ce(x,0):ee,A(ce)?(Q="",Ae!=null&&(Q=Ae.replace(fe,"$&/")+"/"),j(ce,D,Q,"",function(ni){return ni})):ce!=null&&(de(ce)&&(ce=ie(ce,Q+(ce.key==null||x&&x.key===ce.key?"":(""+ce.key).replace(fe,"$&/")+"/")+Ae)),D.push(ce)),1;Ae=0;var it=ee===""?".":ee+":";if(A(x))for(var Be=0;Be<x.length;Be++)ee=x[Be],pe=it+Ce(ee,Be),Ae+=j(ee,D,Q,pe,ce);else if(Be=G(x),typeof Be=="function")for(x=Be.call(x),Be=0;!(ee=x.next()).done;)ee=ee.value,pe=it+Ce(ee,Be++),Ae+=j(ee,D,Q,pe,ce);else if(pe==="object"){if(typeof x.then=="function")return j(K(x),D,Q,ee,ce);throw D=String(x),Error("Objects are not valid as a React child (found: "+(D==="[object Object]"?"object with keys {"+Object.keys(x).join(", ")+"}":D)+"). If you meant to render a collection of children, use an array instead.")}return Ae}function X(x,D,Q){if(x==null)return x;var ee=[],ce=0;return j(x,ee,"","",function(pe){return D.call(Q,pe,ce++)}),ee}function te(x){if(x._status===-1){var D=x._result;D=D(),D.then(function(Q){(x._status===0||x._status===-1)&&(x._status=1,x._result=Q)},function(Q){(x._status===0||x._status===-1)&&(x._status=2,x._result=Q)}),x._status===-1&&(x._status=0,x._result=D)}if(x._status===1)return x._result.default;throw x._result}var I=typeof reportError=="function"?reportError:function(x){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var D=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof x=="object"&&x!==null&&typeof x.message=="string"?String(x.message):String(x),error:x});if(!window.dispatchEvent(D))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",x);return}console.error(x)},ae={map:X,forEach:function(x,D,Q){X(x,function(){D.apply(this,arguments)},Q)},count:function(x){var D=0;return X(x,function(){D++}),D},toArray:function(x){return X(x,function(D){return D})||[]},only:function(x){if(!de(x))throw Error("React.Children.only expected to receive a single React element child.");return x}};return he.Activity=b,he.Children=ae,he.Component=M,he.Fragment=s,he.Profiler=o,he.PureComponent=Z,he.StrictMode=l,he.Suspense=g,he.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=z,he.__COMPILER_RUNTIME={__proto__:null,c:function(x){return z.H.useMemoCache(x)}},he.cache=function(x){return function(){return x.apply(null,arguments)}},he.cacheSignal=function(){return null},he.cloneElement=function(x,D,Q){if(x==null)throw Error("The argument must be a React element, but you passed "+x+".");var ee=J({},x.props),ce=x.key;if(D!=null)for(pe in D.key!==void 0&&(ce=""+D.key),D)!W.call(D,pe)||pe==="key"||pe==="__self"||pe==="__source"||pe==="ref"&&D.ref===void 0||(ee[pe]=D[pe]);var pe=arguments.length-2;if(pe===1)ee.children=Q;else if(1<pe){for(var Ae=Array(pe),it=0;it<pe;it++)Ae[it]=arguments[it+2];ee.children=Ae}return P(x.type,ce,ee)},he.createContext=function(x){return x={$$typeof:d,_currentValue:x,_currentValue2:x,_threadCount:0,Provider:null,Consumer:null},x.Provider=x,x.Consumer={$$typeof:f,_context:x},x},he.createElement=function(x,D,Q){var ee,ce={},pe=null;if(D!=null)for(ee in D.key!==void 0&&(pe=""+D.key),D)W.call(D,ee)&&ee!=="key"&&ee!=="__self"&&ee!=="__source"&&(ce[ee]=D[ee]);var Ae=arguments.length-2;if(Ae===1)ce.children=Q;else if(1<Ae){for(var it=Array(Ae),Be=0;Be<Ae;Be++)it[Be]=arguments[Be+2];ce.children=it}if(x&&x.defaultProps)for(ee in Ae=x.defaultProps,Ae)ce[ee]===void 0&&(ce[ee]=Ae[ee]);return P(x,pe,ce)},he.createRef=function(){return{current:null}},he.forwardRef=function(x){return{$$typeof:p,render:x}},he.isValidElement=de,he.lazy=function(x){return{$$typeof:k,_payload:{_status:-1,_result:x},_init:te}},he.memo=function(x,D){return{$$typeof:v,type:x,compare:D===void 0?null:D}},he.startTransition=function(x){var D=z.T,Q={};z.T=Q;try{var ee=x(),ce=z.S;ce!==null&&ce(Q,ee),typeof ee=="object"&&ee!==null&&typeof ee.then=="function"&&ee.then($,I)}catch(pe){I(pe)}finally{D!==null&&Q.types!==null&&(D.types=Q.types),z.T=D}},he.unstable_useCacheRefresh=function(){return z.H.useCacheRefresh()},he.use=function(x){return z.H.use(x)},he.useActionState=function(x,D,Q){return z.H.useActionState(x,D,Q)},he.useCallback=function(x,D){return z.H.useCallback(x,D)},he.useContext=function(x){return z.H.useContext(x)},he.useDebugValue=function(){},he.useDeferredValue=function(x,D){return z.H.useDeferredValue(x,D)},he.useEffect=function(x,D){return z.H.useEffect(x,D)},he.useEffectEvent=function(x){return z.H.useEffectEvent(x)},he.useId=function(){return z.H.useId()},he.useImperativeHandle=function(x,D,Q){return z.H.useImperativeHandle(x,D,Q)},he.useInsertionEffect=function(x,D){return z.H.useInsertionEffect(x,D)},he.useLayoutEffect=function(x,D){return z.H.useLayoutEffect(x,D)},he.useMemo=function(x,D){return z.H.useMemo(x,D)},he.useOptimistic=function(x,D){return z.H.useOptimistic(x,D)},he.useReducer=function(x,D,Q){return z.H.useReducer(x,D,Q)},he.useRef=function(x){return z.H.useRef(x)},he.useState=function(x){return z.H.useState(x)},he.useSyncExternalStore=function(x,D,Q){return z.H.useSyncExternalStore(x,D,Q)},he.useTransition=function(){return z.H.useTransition()},he.version="19.2.8",he}var qp;function hu(){return qp||(qp=1,Bc.exports=j0()),Bc.exports}var q=hu(),qc={exports:{}},ga={},$c={exports:{}},Lc={};var $p;function N0(){return $p||($p=1,(function(a){function n(j,X){var te=j.length;j.push(X);e:for(;0<te;){var I=te-1>>>1,ae=j[I];if(0<o(ae,X))j[I]=X,j[te]=ae,te=I;else break e}}function s(j){return j.length===0?null:j[0]}function l(j){if(j.length===0)return null;var X=j[0],te=j.pop();if(te!==X){j[0]=te;e:for(var I=0,ae=j.length,x=ae>>>1;I<x;){var D=2*(I+1)-1,Q=j[D],ee=D+1,ce=j[ee];if(0>o(Q,te))ee<ae&&0>o(ce,Q)?(j[I]=ce,j[ee]=te,I=ee):(j[I]=Q,j[D]=te,I=D);else if(ee<ae&&0>o(ce,te))j[I]=ce,j[ee]=te,I=ee;else break e}}return X}function o(j,X){var te=j.sortIndex-X.sortIndex;return te!==0?te:j.id-X.id}if(a.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;a.unstable_now=function(){return f.now()}}else{var d=Date,p=d.now();a.unstable_now=function(){return d.now()-p}}var g=[],v=[],k=1,b=null,_=3,G=!1,V=!1,J=!1,F=!1,M=typeof setTimeout=="function"?setTimeout:null,Y=typeof clearTimeout=="function"?clearTimeout:null,Z=typeof setImmediate<"u"?setImmediate:null;function S(j){for(var X=s(v);X!==null;){if(X.callback===null)l(v);else if(X.startTime<=j)l(v),X.sortIndex=X.expirationTime,n(g,X);else break;X=s(v)}}function A(j){if(J=!1,S(j),!V)if(s(g)!==null)V=!0,$||($=!0,le());else{var X=s(v);X!==null&&K(A,X.startTime-j)}}var $=!1,z=-1,W=5,P=-1;function ie(){return F?!0:!(a.unstable_now()-P<W)}function de(){if(F=!1,$){var j=a.unstable_now();P=j;var X=!0;try{e:{V=!1,J&&(J=!1,Y(z),z=-1),G=!0;var te=_;try{t:{for(S(j),b=s(g);b!==null&&!(b.expirationTime>j&&ie());){var I=b.callback;if(typeof I=="function"){b.callback=null,_=b.priorityLevel;var ae=I(b.expirationTime<=j);if(j=a.unstable_now(),typeof ae=="function"){b.callback=ae,S(j),X=!0;break t}b===s(g)&&l(g),S(j)}else l(g);b=s(g)}if(b!==null)X=!0;else{var x=s(v);x!==null&&K(A,x.startTime-j),X=!1}}break e}finally{b=null,_=te,G=!1}X=void 0}}finally{X?le():$=!1}}}var le;if(typeof Z=="function")le=function(){Z(de)};else if(typeof MessageChannel<"u"){var fe=new MessageChannel,Ce=fe.port2;fe.port1.onmessage=de,le=function(){Ce.postMessage(null)}}else le=function(){M(de,0)};function K(j,X){z=M(function(){j(a.unstable_now())},X)}a.unstable_IdlePriority=5,a.unstable_ImmediatePriority=1,a.unstable_LowPriority=4,a.unstable_NormalPriority=3,a.unstable_Profiling=null,a.unstable_UserBlockingPriority=2,a.unstable_cancelCallback=function(j){j.callback=null},a.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):W=0<j?Math.floor(1e3/j):5},a.unstable_getCurrentPriorityLevel=function(){return _},a.unstable_next=function(j){switch(_){case 1:case 2:case 3:var X=3;break;default:X=_}var te=_;_=X;try{return j()}finally{_=te}},a.unstable_requestPaint=function(){F=!0},a.unstable_runWithPriority=function(j,X){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var te=_;_=j;try{return X()}finally{_=te}},a.unstable_scheduleCallback=function(j,X,te){var I=a.unstable_now();switch(typeof te=="object"&&te!==null?(te=te.delay,te=typeof te=="number"&&0<te?I+te:I):te=I,j){case 1:var ae=-1;break;case 2:ae=250;break;case 5:ae=1073741823;break;case 4:ae=1e4;break;default:ae=5e3}return ae=te+ae,j={id:k++,callback:X,priorityLevel:j,startTime:te,expirationTime:ae,sortIndex:-1},te>I?(j.sortIndex=te,n(v,j),s(g)===null&&j===s(v)&&(J?(Y(z),z=-1):J=!0,K(A,te-I))):(j.sortIndex=ae,n(g,j),V||G||(V=!0,$||($=!0,le()))),j},a.unstable_shouldYield=ie,a.unstable_wrapCallback=function(j){var X=_;return function(){var te=_;_=X;try{return j.apply(this,arguments)}finally{_=te}}}})(Lc)),Lc}var Lp;function O0(){return Lp||(Lp=1,$c.exports=N0()),$c.exports}var Hc={exports:{}},ft={};var Hp;function R0(){if(Hp)return ft;Hp=1;var a=hu();function n(g){var v="https://react.dev/errors/"+g;if(1<arguments.length){v+="?args[]="+encodeURIComponent(arguments[1]);for(var k=2;k<arguments.length;k++)v+="&args[]="+encodeURIComponent(arguments[k])}return"Minified React error #"+g+"; visit "+v+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var l={d:{f:s,r:function(){throw Error(n(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},o=Symbol.for("react.portal");function f(g,v,k){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:b==null?null:""+b,children:g,containerInfo:v,implementation:k}}var d=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function p(g,v){if(g==="font")return"";if(typeof v=="string")return v==="use-credentials"?v:""}return ft.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=l,ft.createPortal=function(g,v){var k=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!v||v.nodeType!==1&&v.nodeType!==9&&v.nodeType!==11)throw Error(n(299));return f(g,v,null,k)},ft.flushSync=function(g){var v=d.T,k=l.p;try{if(d.T=null,l.p=2,g)return g()}finally{d.T=v,l.p=k,l.d.f()}},ft.preconnect=function(g,v){typeof g=="string"&&(v?(v=v.crossOrigin,v=typeof v=="string"?v==="use-credentials"?v:"":void 0):v=null,l.d.C(g,v))},ft.prefetchDNS=function(g){typeof g=="string"&&l.d.D(g)},ft.preinit=function(g,v){if(typeof g=="string"&&v&&typeof v.as=="string"){var k=v.as,b=p(k,v.crossOrigin),_=typeof v.integrity=="string"?v.integrity:void 0,G=typeof v.fetchPriority=="string"?v.fetchPriority:void 0;k==="style"?l.d.S(g,typeof v.precedence=="string"?v.precedence:void 0,{crossOrigin:b,integrity:_,fetchPriority:G}):k==="script"&&l.d.X(g,{crossOrigin:b,integrity:_,fetchPriority:G,nonce:typeof v.nonce=="string"?v.nonce:void 0})}},ft.preinitModule=function(g,v){if(typeof g=="string")if(typeof v=="object"&&v!==null){if(v.as==null||v.as==="script"){var k=p(v.as,v.crossOrigin);l.d.M(g,{crossOrigin:k,integrity:typeof v.integrity=="string"?v.integrity:void 0,nonce:typeof v.nonce=="string"?v.nonce:void 0})}}else v==null&&l.d.M(g)},ft.preload=function(g,v){if(typeof g=="string"&&typeof v=="object"&&v!==null&&typeof v.as=="string"){var k=v.as,b=p(k,v.crossOrigin);l.d.L(g,k,{crossOrigin:b,integrity:typeof v.integrity=="string"?v.integrity:void 0,nonce:typeof v.nonce=="string"?v.nonce:void 0,type:typeof v.type=="string"?v.type:void 0,fetchPriority:typeof v.fetchPriority=="string"?v.fetchPriority:void 0,referrerPolicy:typeof v.referrerPolicy=="string"?v.referrerPolicy:void 0,imageSrcSet:typeof v.imageSrcSet=="string"?v.imageSrcSet:void 0,imageSizes:typeof v.imageSizes=="string"?v.imageSizes:void 0,media:typeof v.media=="string"?v.media:void 0})}},ft.preloadModule=function(g,v){if(typeof g=="string")if(v){var k=p(v.as,v.crossOrigin);l.d.m(g,{as:typeof v.as=="string"&&v.as!=="script"?v.as:void 0,crossOrigin:k,integrity:typeof v.integrity=="string"?v.integrity:void 0})}else l.d.m(g)},ft.requestFormReset=function(g){l.d.r(g)},ft.unstable_batchedUpdates=function(g,v){return g(v)},ft.useFormState=function(g,v,k){return d.H.useFormState(g,v,k)},ft.useFormStatus=function(){return d.H.useHostTransitionStatus()},ft.version="19.2.8",ft}var Yp;function M0(){if(Yp)return Hc.exports;Yp=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(n){console.error(n)}}return a(),Hc.exports=R0(),Hc.exports}var Gp;function C0(){if(Gp)return ga;Gp=1;var a=O0(),n=hu(),s=M0();function l(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i])}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 o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function f(e){var t=e,i=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(i=t.return),e=t.return;while(e)}return t.tag===3?i:null}function d(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 p(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 g(e){if(f(e)!==e)throw Error(l(188))}function v(e){var t=e.alternate;if(!t){if(t=f(e),t===null)throw Error(l(188));return t!==e?null:e}for(var i=e,r=t;;){var c=i.return;if(c===null)break;var u=c.alternate;if(u===null){if(r=c.return,r!==null){i=r;continue}break}if(c.child===u.child){for(u=c.child;u;){if(u===i)return g(c),e;if(u===r)return g(c),t;u=u.sibling}throw Error(l(188))}if(i.return!==r.return)i=c,r=u;else{for(var h=!1,m=c.child;m;){if(m===i){h=!0,i=c,r=u;break}if(m===r){h=!0,r=c,i=u;break}m=m.sibling}if(!h){for(m=u.child;m;){if(m===i){h=!0,i=u,r=c;break}if(m===r){h=!0,r=u,i=c;break}m=m.sibling}if(!h)throw Error(l(189))}}if(i.alternate!==r)throw Error(l(190))}if(i.tag!==3)throw Error(l(188));return i.stateNode.current===i?e:t}function k(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=k(e),t!==null)return t;e=e.sibling}return null}var b=Object.assign,_=Symbol.for("react.element"),G=Symbol.for("react.transitional.element"),V=Symbol.for("react.portal"),J=Symbol.for("react.fragment"),F=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),Y=Symbol.for("react.consumer"),Z=Symbol.for("react.context"),S=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),$=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),W=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),ie=Symbol.for("react.memo_cache_sentinel"),de=Symbol.iterator;function le(e){return e===null||typeof e!="object"?null:(e=de&&e[de]||e["@@iterator"],typeof e=="function"?e:null)}var fe=Symbol.for("react.client.reference");function Ce(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===fe?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case J:return"Fragment";case M:return"Profiler";case F:return"StrictMode";case A:return"Suspense";case $:return"SuspenseList";case P:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case V:return"Portal";case Z:return e.displayName||"Context";case Y:return(e._context.displayName||"Context")+".Consumer";case S:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case z:return t=e.displayName||null,t!==null?t:Ce(e.type)||"Memo";case W:t=e._payload,e=e._init;try{return Ce(e(t))}catch{}}return null}var K=Array.isArray,j=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te={pending:!1,data:null,method:null,action:null},I=[],ae=-1;function x(e){return{current:e}}function D(e){0>ae||(e.current=I[ae],I[ae]=null,ae--)}function Q(e,t){ae++,I[ae]=e.current,e.current=t}var ee=x(null),ce=x(null),pe=x(null),Ae=x(null);function it(e,t){switch(Q(pe,t),Q(ce,e),Q(ee,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Fh(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Fh(t),e=Wh(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}D(ee),Q(ee,e)}function Be(){D(ee),D(ce),D(pe)}function ni(e){e.memoizedState!==null&&Q(Ae,e);var t=ee.current,i=Wh(t,e.type);t!==i&&(Q(ce,e),Q(ee,i))}function en(e){ce.current===e&&(D(ee),D(ce)),Ae.current===e&&(D(Ae),ua._currentValue=te)}var vs,bs;function cn(e){if(vs===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);vs=t&&t[1]||"",bs=-1<i.stack.indexOf(`
|
|
2
2
|
at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
-
`+
|
|
4
|
-
`),
|
|
5
|
-
`);for(
|
|
6
|
-
`+
|
|
7
|
-
Error generating stack: `+
|
|
8
|
-
`+s.stack}}var Y=Object.prototype.hasOwnProperty,ae=r.unstable_scheduleCallback,De=r.unstable_cancelCallback,me=r.unstable_shouldYield,st=r.unstable_requestPaint,Qe=r.unstable_now,Ei=r.unstable_getCurrentPriorityLevel,uu=r.unstable_ImmediatePriority,fu=r.unstable_UserBlockingPriority,_a=r.unstable_NormalPriority,ey=r.unstable_LowPriority,hu=r.unstable_IdlePriority,ty=r.log,ny=r.unstable_setDisableYieldValue,bs=null,St=null;function An(e){if(typeof ty=="function"&&ny(e),St&&typeof St.setStrictMode=="function")try{St.setStrictMode(bs,e)}catch{}}var xt=Math.clz32?Math.clz32:ay,iy=Math.log,sy=Math.LN2;function ay(e){return e>>>=0,e===0?32:31-(iy(e)/sy|0)|0}var Aa=256,Na=262144,Oa=4194304;function ii(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 ja(e,t,i){var s=e.pendingLanes;if(s===0)return 0;var o=0,c=e.suspendedLanes,h=e.pingedLanes;e=e.warmLanes;var p=s&134217727;return p!==0?(s=p&~c,s!==0?o=ii(s):(h&=p,h!==0?o=ii(h):i||(i=p&~e,i!==0&&(o=ii(i))))):(p=s&~c,p!==0?o=ii(p):h!==0?o=ii(h):i||(i=s&~e,i!==0&&(o=ii(i)))),o===0?0:t!==0&&t!==o&&(t&c)===0&&(c=o&-o,i=t&-t,c>=i||c===32&&(i&4194048)!==0)?t:o}function ws(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ly(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 du(){var e=Oa;return Oa<<=1,(Oa&62914560)===0&&(Oa=4194304),e}function fr(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function Ss(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ry(e,t,i,s,o,c){var h=e.pendingLanes;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=i,e.entangledLanes&=i,e.errorRecoveryDisabledLanes&=i,e.shellSuspendCounter=0;var p=e.entanglements,v=e.expirationTimes,_=e.hiddenUpdates;for(i=h&~i;0<i;){var M=31-xt(i),D=1<<M;p[M]=0,v[M]=-1;var A=_[M];if(A!==null)for(_[M]=null,M=0;M<A.length;M++){var O=A[M];O!==null&&(O.lane&=-536870913)}i&=~D}s!==0&&pu(e,s,0),c!==0&&o===0&&e.tag!==0&&(e.suspendedLanes|=c&~(h&~t))}function pu(e,t,i){e.pendingLanes|=t,e.suspendedLanes&=~t;var s=31-xt(t);e.entangledLanes|=t,e.entanglements[s]=e.entanglements[s]|1073741824|i&261930}function mu(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var s=31-xt(i),o=1<<s;o&t|e[s]&t&&(e[s]|=t),i&=~o}}function yu(e,t){var i=t&-t;return i=(i&42)!==0?1:hr(i),(i&(e.suspendedLanes|t))!==0?0:i}function hr(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 dr(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function gu(){var e=$.p;return e!==0?e:(e=window.event,e===void 0?32:ip(e.type))}function vu(e,t){var i=$.p;try{return $.p=e,t()}finally{$.p=i}}var Nn=Math.random().toString(36).slice(2),at="__reactFiber$"+Nn,pt="__reactProps$"+Nn,ki="__reactContainer$"+Nn,pr="__reactEvents$"+Nn,oy="__reactListeners$"+Nn,cy="__reactHandles$"+Nn,bu="__reactResources$"+Nn,xs="__reactMarker$"+Nn;function mr(e){delete e[at],delete e[pt],delete e[pr],delete e[oy],delete e[cy]}function Ti(e){var t=e[at];if(t)return t;for(var i=e.parentNode;i;){if(t=i[ki]||i[at]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=$d(e);e!==null;){if(i=e[at])return i;e=$d(e)}return t}e=i,i=e.parentNode}return null}function _i(e){if(e=e[at]||e[ki]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Es(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(l(33))}function Ai(e){var t=e[bu];return t||(t=e[bu]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function tt(e){e[xs]=!0}var wu=new Set,Su={};function si(e,t){Ni(e,t),Ni(e+"Capture",t)}function Ni(e,t){for(Su[e]=t,e=0;e<t.length;e++)wu.add(t[e])}var uy=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]*$"),xu={},Eu={};function fy(e){return Y.call(Eu,e)?!0:Y.call(xu,e)?!1:uy.test(e)?Eu[e]=!0:(xu[e]=!0,!1)}function Ra(e,t,i){if(fy(t))if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var s=t.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+i)}}function za(e,t,i){if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+i)}}function on(e,t,i,s){if(s===null)e.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttributeNS(t,i,""+s)}}function Rt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ku(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function hy(e,t,i){var s=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var o=s.get,c=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(h){i=""+h,c.call(this,h)}}),Object.defineProperty(e,t,{enumerable:s.enumerable}),{getValue:function(){return i},setValue:function(h){i=""+h},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function yr(e){if(!e._valueTracker){var t=ku(e)?"checked":"value";e._valueTracker=hy(e,t,""+e[t])}}function Tu(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),s="";return e&&(s=ku(e)?e.checked?"true":"false":e.value),e=s,e!==i?(t.setValue(e),!0):!1}function Ma(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 dy=/[\n"\\]/g;function zt(e){return e.replace(dy,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function gr(e,t,i,s,o,c,h,p){e.name="",h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"?e.type=h:e.removeAttribute("type"),t!=null?h==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Rt(t)):e.value!==""+Rt(t)&&(e.value=""+Rt(t)):h!=="submit"&&h!=="reset"||e.removeAttribute("value"),t!=null?vr(e,h,Rt(t)):i!=null?vr(e,h,Rt(i)):s!=null&&e.removeAttribute("value"),o==null&&c!=null&&(e.defaultChecked=!!c),o!=null&&(e.checked=o&&typeof o!="function"&&typeof o!="symbol"),p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"?e.name=""+Rt(p):e.removeAttribute("name")}function _u(e,t,i,s,o,c,h,p){if(c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(e.type=c),t!=null||i!=null){if(!(c!=="submit"&&c!=="reset"||t!=null)){yr(e);return}i=i!=null?""+Rt(i):"",t=t!=null?""+Rt(t):i,p||t===e.value||(e.value=t),e.defaultValue=t}s=s??o,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=p?e.checked:!!s,e.defaultChecked=!!s,h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.name=h),yr(e)}function vr(e,t,i){t==="number"&&Ma(e.ownerDocument)===e||e.defaultValue===""+i||(e.defaultValue=""+i)}function Oi(e,t,i,s){if(e=e.options,t){t={};for(var o=0;o<i.length;o++)t["$"+i[o]]=!0;for(i=0;i<e.length;i++)o=t.hasOwnProperty("$"+e[i].value),e[i].selected!==o&&(e[i].selected=o),o&&s&&(e[i].defaultSelected=!0)}else{for(i=""+Rt(i),t=null,o=0;o<e.length;o++){if(e[o].value===i){e[o].selected=!0,s&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function Au(e,t,i){if(t!=null&&(t=""+Rt(t),t!==e.value&&(e.value=t),i==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=i!=null?""+Rt(i):""}function Nu(e,t,i,s){if(t==null){if(s!=null){if(i!=null)throw Error(l(92));if(V(s)){if(1<s.length)throw Error(l(93));s=s[0]}i=s}i==null&&(i=""),t=i}i=Rt(t),e.defaultValue=i,s=e.textContent,s===i&&s!==""&&s!==null&&(e.value=s),yr(e)}function ji(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var py=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 Ou(e,t,i){var s=t.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?s?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":s?e.setProperty(t,i):typeof i!="number"||i===0||py.has(t)?t==="float"?e.cssFloat=i:e[t]=(""+i).trim():e[t]=i+"px"}function ju(e,t,i){if(t!=null&&typeof t!="object")throw Error(l(62));if(e=e.style,i!=null){for(var s in i)!i.hasOwnProperty(s)||t!=null&&t.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="");for(var o in t)s=t[o],t.hasOwnProperty(o)&&i[o]!==s&&Ou(e,o,s)}else for(var c in t)t.hasOwnProperty(c)&&Ou(e,c,t[c])}function br(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 my=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"]]),yy=/^[\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 Ca(e){return yy.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function cn(){}var wr=null;function Sr(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ri=null,zi=null;function Ru(e){var t=_i(e);if(t&&(e=t.stateNode)){var i=e[pt]||null;e:switch(e=t.stateNode,t.type){case"input":if(gr(e,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),t=i.name,i.type==="radio"&&t!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+zt(""+t)+'"][type="radio"]'),t=0;t<i.length;t++){var s=i[t];if(s!==e&&s.form===e.form){var o=s[pt]||null;if(!o)throw Error(l(90));gr(s,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name)}}for(t=0;t<i.length;t++)s=i[t],s.form===e.form&&Tu(s)}break e;case"textarea":Au(e,i.value,i.defaultValue);break e;case"select":t=i.value,t!=null&&Oi(e,!!i.multiple,t,!1)}}}var xr=!1;function zu(e,t,i){if(xr)return e(t,i);xr=!0;try{var s=e(t);return s}finally{if(xr=!1,(Ri!==null||zi!==null)&&(Sl(),Ri&&(t=Ri,e=zi,zi=Ri=null,Ru(t),e)))for(t=0;t<e.length;t++)Ru(e[t])}}function ks(e,t){var i=e.stateNode;if(i===null)return null;var s=i[pt]||null;if(s===null)return null;i=s[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":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(l(231,t,typeof i));return i}var un=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Er=!1;if(un)try{var Ts={};Object.defineProperty(Ts,"passive",{get:function(){Er=!0}}),window.addEventListener("test",Ts,Ts),window.removeEventListener("test",Ts,Ts)}catch{Er=!1}var On=null,kr=null,Ua=null;function Mu(){if(Ua)return Ua;var e,t=kr,i=t.length,s,o="value"in On?On.value:On.textContent,c=o.length;for(e=0;e<i&&t[e]===o[e];e++);var h=i-e;for(s=1;s<=h&&t[i-s]===o[c-s];s++);return Ua=o.slice(e,1<s?1-s:void 0)}function Da(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 Ba(){return!0}function Cu(){return!1}function mt(e){function t(i,s,o,c,h){this._reactName=i,this._targetInst=o,this.type=s,this.nativeEvent=c,this.target=h,this.currentTarget=null;for(var p in e)e.hasOwnProperty(p)&&(i=e[p],this[p]=i?i(c):c[p]);return this.isDefaultPrevented=(c.defaultPrevented!=null?c.defaultPrevented:c.returnValue===!1)?Ba:Cu,this.isPropagationStopped=Cu,this}return w(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=Ba)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Ba)},persist:function(){},isPersistent:Ba}),t}var ai={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},qa=mt(ai),_s=w({},ai,{view:0,detail:0}),gy=mt(_s),Tr,_r,As,La=w({},_s,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Nr,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!==As&&(As&&e.type==="mousemove"?(Tr=e.screenX-As.screenX,_r=e.screenY-As.screenY):_r=Tr=0,As=e),Tr)},movementY:function(e){return"movementY"in e?e.movementY:_r}}),Uu=mt(La),vy=w({},La,{dataTransfer:0}),by=mt(vy),wy=w({},_s,{relatedTarget:0}),Ar=mt(wy),Sy=w({},ai,{animationName:0,elapsedTime:0,pseudoElement:0}),xy=mt(Sy),Ey=w({},ai,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),ky=mt(Ey),Ty=w({},ai,{data:0}),Du=mt(Ty),_y={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ay={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"},Ny={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Oy(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Ny[e])?!!t[e]:!1}function Nr(){return Oy}var jy=w({},_s,{key:function(e){if(e.key){var t=_y[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Da(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Ay[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Nr,charCode:function(e){return e.type==="keypress"?Da(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Da(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Ry=mt(jy),zy=w({},La,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Bu=mt(zy),My=w({},_s,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Nr}),Cy=mt(My),Uy=w({},ai,{propertyName:0,elapsedTime:0,pseudoElement:0}),Dy=mt(Uy),By=w({},La,{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}),qy=mt(By),Ly=w({},ai,{newState:0,oldState:0}),Hy=mt(Ly),$y=[9,13,27,32],Or=un&&"CompositionEvent"in window,Ns=null;un&&"documentMode"in document&&(Ns=document.documentMode);var Yy=un&&"TextEvent"in window&&!Ns,qu=un&&(!Or||Ns&&8<Ns&&11>=Ns),Lu=" ",Hu=!1;function $u(e,t){switch(e){case"keyup":return $y.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Yu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Mi=!1;function Vy(e,t){switch(e){case"compositionend":return Yu(t);case"keypress":return t.which!==32?null:(Hu=!0,Lu);case"textInput":return e=t.data,e===Lu&&Hu?null:e;default:return null}}function Xy(e,t){if(Mi)return e==="compositionend"||!Or&&$u(e,t)?(e=Mu(),Ua=kr=On=null,Mi=!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 qu&&t.locale!=="ko"?null:t.data;default:return null}}var Gy={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 Vu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Gy[e.type]:t==="textarea"}function Xu(e,t,i,s){Ri?zi?zi.push(s):zi=[s]:Ri=s,t=Nl(t,"onChange"),0<t.length&&(i=new qa("onChange","change",null,i,s),e.push({event:i,listeners:t}))}var Os=null,js=null;function Qy(e){Ad(e,0)}function Ha(e){var t=Es(e);if(Tu(t))return e}function Gu(e,t){if(e==="change")return t}var Qu=!1;if(un){var jr;if(un){var Rr="oninput"in document;if(!Rr){var Ku=document.createElement("div");Ku.setAttribute("oninput","return;"),Rr=typeof Ku.oninput=="function"}jr=Rr}else jr=!1;Qu=jr&&(!document.documentMode||9<document.documentMode)}function Zu(){Os&&(Os.detachEvent("onpropertychange",Ju),js=Os=null)}function Ju(e){if(e.propertyName==="value"&&Ha(js)){var t=[];Xu(t,js,e,Sr(e)),zu(Qy,t)}}function Ky(e,t,i){e==="focusin"?(Zu(),Os=t,js=i,Os.attachEvent("onpropertychange",Ju)):e==="focusout"&&Zu()}function Zy(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ha(js)}function Jy(e,t){if(e==="click")return Ha(t)}function Fy(e,t){if(e==="input"||e==="change")return Ha(t)}function Wy(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Et=typeof Object.is=="function"?Object.is:Wy;function Rs(e,t){if(Et(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var i=Object.keys(e),s=Object.keys(t);if(i.length!==s.length)return!1;for(s=0;s<i.length;s++){var o=i[s];if(!Y.call(t,o)||!Et(e[o],t[o]))return!1}return!0}function Fu(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Wu(e,t){var i=Fu(e);e=0;for(var s;i;){if(i.nodeType===3){if(s=e+i.textContent.length,e<=t&&s>=t)return{node:i,offset:t-e};e=s}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=Fu(i)}}function Iu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Iu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Pu(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ma(e.document);t instanceof e.HTMLIFrameElement;){try{var i=typeof t.contentWindow.location.href=="string"}catch{i=!1}if(i)e=t.contentWindow;else break;t=Ma(e.document)}return t}function zr(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 Iy=un&&"documentMode"in document&&11>=document.documentMode,Ci=null,Mr=null,zs=null,Cr=!1;function ef(e,t,i){var s=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Cr||Ci==null||Ci!==Ma(s)||(s=Ci,"selectionStart"in s&&zr(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),zs&&Rs(zs,s)||(zs=s,s=Nl(Mr,"onSelect"),0<s.length&&(t=new qa("onSelect","select",null,t,i),e.push({event:t,listeners:s}),t.target=Ci)))}function li(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var Ui={animationend:li("Animation","AnimationEnd"),animationiteration:li("Animation","AnimationIteration"),animationstart:li("Animation","AnimationStart"),transitionrun:li("Transition","TransitionRun"),transitionstart:li("Transition","TransitionStart"),transitioncancel:li("Transition","TransitionCancel"),transitionend:li("Transition","TransitionEnd")},Ur={},tf={};un&&(tf=document.createElement("div").style,"AnimationEvent"in window||(delete Ui.animationend.animation,delete Ui.animationiteration.animation,delete Ui.animationstart.animation),"TransitionEvent"in window||delete Ui.transitionend.transition);function ri(e){if(Ur[e])return Ur[e];if(!Ui[e])return e;var t=Ui[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in tf)return Ur[e]=t[i];return e}var nf=ri("animationend"),sf=ri("animationiteration"),af=ri("animationstart"),Py=ri("transitionrun"),eg=ri("transitionstart"),tg=ri("transitioncancel"),lf=ri("transitionend"),rf=new Map,Dr="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(" ");Dr.push("scrollEnd");function Yt(e,t){rf.set(e,t),si(t,[e])}var $a=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)},Mt=[],Di=0,Br=0;function Ya(){for(var e=Di,t=Br=Di=0;t<e;){var i=Mt[t];Mt[t++]=null;var s=Mt[t];Mt[t++]=null;var o=Mt[t];Mt[t++]=null;var c=Mt[t];if(Mt[t++]=null,s!==null&&o!==null){var h=s.pending;h===null?o.next=o:(o.next=h.next,h.next=o),s.pending=o}c!==0&&of(i,o,c)}}function Va(e,t,i,s){Mt[Di++]=e,Mt[Di++]=t,Mt[Di++]=i,Mt[Di++]=s,Br|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function qr(e,t,i,s){return Va(e,t,i,s),Xa(e)}function oi(e,t){return Va(e,null,null,t),Xa(e)}function of(e,t,i){e.lanes|=i;var s=e.alternate;s!==null&&(s.lanes|=i);for(var o=!1,c=e.return;c!==null;)c.childLanes|=i,s=c.alternate,s!==null&&(s.childLanes|=i),c.tag===22&&(e=c.stateNode,e===null||e._visibility&1||(o=!0)),e=c,c=c.return;return e.tag===3?(c=e.stateNode,o&&t!==null&&(o=31-xt(i),e=c.hiddenUpdates,s=e[o],s===null?e[o]=[t]:s.push(t),t.lane=i|536870912),c):null}function Xa(e){if(50<ea)throw ea=0,Zo=null,Error(l(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Bi={};function ng(e,t,i,s){this.tag=e,this.key=i,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=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function kt(e,t,i,s){return new ng(e,t,i,s)}function Lr(e){return e=e.prototype,!(!e||!e.isReactComponent)}function fn(e,t){var i=e.alternate;return i===null?(i=kt(e.tag,t,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=t,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=e.flags&65011712,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,t=e.dependencies,i.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i.refCleanup=e.refCleanup,i}function cf(e,t){e.flags&=65011714;var i=e.alternate;return i===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=i.childLanes,e.lanes=i.lanes,e.child=i.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=i.memoizedProps,e.memoizedState=i.memoizedState,e.updateQueue=i.updateQueue,e.type=i.type,t=i.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Ga(e,t,i,s,o,c){var h=0;if(s=e,typeof e=="function")Lr(e)&&(h=1);else if(typeof e=="string")h=rv(e,i,ee.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case ne:return e=kt(31,i,t,o),e.elementType=ne,e.lanes=c,e;case P:return ci(i.children,o,c,t);case W:h=8,o|=24;break;case z:return e=kt(12,i,t,o|2),e.elementType=z,e.lanes=c,e;case C:return e=kt(13,i,t,o),e.elementType=C,e.lanes=c,e;case H:return e=kt(19,i,t,o),e.elementType=H,e.lanes=c,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case J:h=10;break e;case X:h=9;break e;case N:h=11;break e;case B:h=14;break e;case Q:h=16,s=null;break e}h=29,i=Error(l(130,e===null?"null":typeof e,"")),s=null}return t=kt(h,i,t,o),t.elementType=e,t.type=s,t.lanes=c,t}function ci(e,t,i,s){return e=kt(7,e,s,t),e.lanes=i,e}function Hr(e,t,i){return e=kt(6,e,null,t),e.lanes=i,e}function uf(e){var t=kt(18,null,null,0);return t.stateNode=e,t}function $r(e,t,i){return t=kt(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var ff=new WeakMap;function Ct(e,t){if(typeof e=="object"&&e!==null){var i=ff.get(e);return i!==void 0?i:(t={value:e,source:t,stack:vs(t)},ff.set(e,t),t)}return{value:e,source:t,stack:vs(t)}}var qi=[],Li=0,Qa=null,Ms=0,Ut=[],Dt=0,jn=null,Wt=1,It="";function hn(e,t){qi[Li++]=Ms,qi[Li++]=Qa,Qa=e,Ms=t}function hf(e,t,i){Ut[Dt++]=Wt,Ut[Dt++]=It,Ut[Dt++]=jn,jn=e;var s=Wt;e=It;var o=32-xt(s)-1;s&=~(1<<o),i+=1;var c=32-xt(t)+o;if(30<c){var h=o-o%5;c=(s&(1<<h)-1).toString(32),s>>=h,o-=h,Wt=1<<32-xt(t)+o|i<<o|s,It=c+e}else Wt=1<<c|i<<o|s,It=e}function Yr(e){e.return!==null&&(hn(e,1),hf(e,1,0))}function Vr(e){for(;e===Qa;)Qa=qi[--Li],qi[Li]=null,Ms=qi[--Li],qi[Li]=null;for(;e===jn;)jn=Ut[--Dt],Ut[Dt]=null,It=Ut[--Dt],Ut[Dt]=null,Wt=Ut[--Dt],Ut[Dt]=null}function df(e,t){Ut[Dt++]=Wt,Ut[Dt++]=It,Ut[Dt++]=jn,Wt=t.id,It=t.overflow,jn=e}var lt=null,Be=null,we=!1,Rn=null,Bt=!1,Xr=Error(l(519));function zn(e){var t=Error(l(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Cs(Ct(t,e)),Xr}function pf(e){var t=e.stateNode,i=e.type,s=e.memoizedProps;switch(t[at]=e,t[pt]=s,i){case"dialog":ge("cancel",t),ge("close",t);break;case"iframe":case"object":case"embed":ge("load",t);break;case"video":case"audio":for(i=0;i<na.length;i++)ge(na[i],t);break;case"source":ge("error",t);break;case"img":case"image":case"link":ge("error",t),ge("load",t);break;case"details":ge("toggle",t);break;case"input":ge("invalid",t),_u(t,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":ge("invalid",t);break;case"textarea":ge("invalid",t),Nu(t,s.value,s.defaultValue,s.children)}i=s.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||t.textContent===""+i||s.suppressHydrationWarning===!0||Rd(t.textContent,i)?(s.popover!=null&&(ge("beforetoggle",t),ge("toggle",t)),s.onScroll!=null&&ge("scroll",t),s.onScrollEnd!=null&&ge("scrollend",t),s.onClick!=null&&(t.onclick=cn),t=!0):t=!1,t||zn(e,!0)}function mf(e){for(lt=e.return;lt;)switch(lt.tag){case 5:case 31:case 13:Bt=!1;return;case 27:case 3:Bt=!0;return;default:lt=lt.return}}function Hi(e){if(e!==lt)return!1;if(!we)return mf(e),we=!0,!1;var t=e.tag,i;if((i=t!==3&&t!==27)&&((i=t===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||cc(e.type,e.memoizedProps)),i=!i),i&&Be&&zn(e),mf(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));Be=Hd(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));Be=Hd(e)}else t===27?(t=Be,Qn(e.type)?(e=pc,pc=null,Be=e):Be=t):Be=lt?Lt(e.stateNode.nextSibling):null;return!0}function ui(){Be=lt=null,we=!1}function Gr(){var e=Rn;return e!==null&&(bt===null?bt=e:bt.push.apply(bt,e),Rn=null),e}function Cs(e){Rn===null?Rn=[e]:Rn.push(e)}var Qr=S(null),fi=null,dn=null;function Mn(e,t,i){G(Qr,t._currentValue),t._currentValue=i}function pn(e){e._currentValue=Qr.current,q(Qr)}function Kr(e,t,i){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===i)break;e=e.return}}function Zr(e,t,i,s){var o=e.child;for(o!==null&&(o.return=e);o!==null;){var c=o.dependencies;if(c!==null){var h=o.child;c=c.firstContext;e:for(;c!==null;){var p=c;c=o;for(var v=0;v<t.length;v++)if(p.context===t[v]){c.lanes|=i,p=c.alternate,p!==null&&(p.lanes|=i),Kr(c.return,i,e),s||(h=null);break e}c=p.next}}else if(o.tag===18){if(h=o.return,h===null)throw Error(l(341));h.lanes|=i,c=h.alternate,c!==null&&(c.lanes|=i),Kr(h,i,e),h=null}else h=o.child;if(h!==null)h.return=o;else for(h=o;h!==null;){if(h===e){h=null;break}if(o=h.sibling,o!==null){o.return=h.return,h=o;break}h=h.return}o=h}}function $i(e,t,i,s){e=null;for(var o=t,c=!1;o!==null;){if(!c){if((o.flags&524288)!==0)c=!0;else if((o.flags&262144)!==0)break}if(o.tag===10){var h=o.alternate;if(h===null)throw Error(l(387));if(h=h.memoizedProps,h!==null){var p=o.type;Et(o.pendingProps.value,h.value)||(e!==null?e.push(p):e=[p])}}else if(o===Ee.current){if(h=o.alternate,h===null)throw Error(l(387));h.memoizedState.memoizedState!==o.memoizedState.memoizedState&&(e!==null?e.push(ra):e=[ra])}o=o.return}e!==null&&Zr(t,e,i,s),t.flags|=262144}function Ka(e){for(e=e.firstContext;e!==null;){if(!Et(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function hi(e){fi=e,dn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function rt(e){return yf(fi,e)}function Za(e,t){return fi===null&&hi(e),yf(e,t)}function yf(e,t){var i=t._currentValue;if(t={context:t,memoizedValue:i,next:null},dn===null){if(e===null)throw Error(l(308));dn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else dn=dn.next=t;return i}var ig=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(i,s){e.push(s)}};this.abort=function(){t.aborted=!0,e.forEach(function(i){return i()})}},sg=r.unstable_scheduleCallback,ag=r.unstable_NormalPriority,Ke={$$typeof:J,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Jr(){return{controller:new ig,data:new Map,refCount:0}}function Us(e){e.refCount--,e.refCount===0&&sg(ag,function(){e.controller.abort()})}var Ds=null,Fr=0,Yi=0,Vi=null;function lg(e,t){if(Ds===null){var i=Ds=[];Fr=0,Yi=ec(),Vi={status:"pending",value:void 0,then:function(s){i.push(s)}}}return Fr++,t.then(gf,gf),t}function gf(){if(--Fr===0&&Ds!==null){Vi!==null&&(Vi.status="fulfilled");var e=Ds;Ds=null,Yi=0,Vi=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function rg(e,t){var i=[],s={status:"pending",value:null,reason:null,then:function(o){i.push(o)}};return e.then(function(){s.status="fulfilled",s.value=t;for(var o=0;o<i.length;o++)(0,i[o])(t)},function(o){for(s.status="rejected",s.reason=o,o=0;o<i.length;o++)(0,i[o])(void 0)}),s}var vf=k.S;k.S=function(e,t){td=Qe(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&lg(e,t),vf!==null&&vf(e,t)};var di=S(null);function Wr(){var e=di.current;return e!==null?e:Ue.pooledCache}function Ja(e,t){t===null?G(di,di.current):G(di,t.pool)}function bf(){var e=Wr();return e===null?null:{parent:Ke._currentValue,pool:e}}var Xi=Error(l(460)),Ir=Error(l(474)),Fa=Error(l(542)),Wa={then:function(){}};function wf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Sf(e,t,i){switch(i=e[i],i===void 0?e.push(t):i!==t&&(t.then(cn,cn),t=i),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ef(e),e;default:if(typeof t.status=="string")t.then(cn,cn);else{if(e=Ue,e!==null&&100<e.shellSuspendCounter)throw Error(l(482));e=t,e.status="pending",e.then(function(s){if(t.status==="pending"){var o=t;o.status="fulfilled",o.value=s}},function(s){if(t.status==="pending"){var o=t;o.status="rejected",o.reason=s}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ef(e),e}throw mi=t,Xi}}function pi(e){try{var t=e._init;return t(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(mi=i,Xi):i}}var mi=null;function xf(){if(mi===null)throw Error(l(459));var e=mi;return mi=null,e}function Ef(e){if(e===Xi||e===Fa)throw Error(l(483))}var Gi=null,Bs=0;function Ia(e){var t=Bs;return Bs+=1,Gi===null&&(Gi=[]),Sf(Gi,e,t)}function qs(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Pa(e,t){throw t.$$typeof===j?Error(l(525)):(e=Object.prototype.toString.call(t),Error(l(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function kf(e){function t(E,x){if(e){var T=E.deletions;T===null?(E.deletions=[x],E.flags|=16):T.push(x)}}function i(E,x){if(!e)return null;for(;x!==null;)t(E,x),x=x.sibling;return null}function s(E){for(var x=new Map;E!==null;)E.key!==null?x.set(E.key,E):x.set(E.index,E),E=E.sibling;return x}function o(E,x){return E=fn(E,x),E.index=0,E.sibling=null,E}function c(E,x,T){return E.index=T,e?(T=E.alternate,T!==null?(T=T.index,T<x?(E.flags|=67108866,x):T):(E.flags|=67108866,x)):(E.flags|=1048576,x)}function h(E){return e&&E.alternate===null&&(E.flags|=67108866),E}function p(E,x,T,U){return x===null||x.tag!==6?(x=Hr(T,E.mode,U),x.return=E,x):(x=o(x,T),x.return=E,x)}function v(E,x,T,U){var ie=T.type;return ie===P?M(E,x,T.props.children,U,T.key):x!==null&&(x.elementType===ie||typeof ie=="object"&&ie!==null&&ie.$$typeof===Q&&pi(ie)===x.type)?(x=o(x,T.props),qs(x,T),x.return=E,x):(x=Ga(T.type,T.key,T.props,null,E.mode,U),qs(x,T),x.return=E,x)}function _(E,x,T,U){return x===null||x.tag!==4||x.stateNode.containerInfo!==T.containerInfo||x.stateNode.implementation!==T.implementation?(x=$r(T,E.mode,U),x.return=E,x):(x=o(x,T.children||[]),x.return=E,x)}function M(E,x,T,U,ie){return x===null||x.tag!==7?(x=ci(T,E.mode,U,ie),x.return=E,x):(x=o(x,T),x.return=E,x)}function D(E,x,T){if(typeof x=="string"&&x!==""||typeof x=="number"||typeof x=="bigint")return x=Hr(""+x,E.mode,T),x.return=E,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case L:return T=Ga(x.type,x.key,x.props,null,E.mode,T),qs(T,x),T.return=E,T;case K:return x=$r(x,E.mode,T),x.return=E,x;case Q:return x=pi(x),D(E,x,T)}if(V(x)||ue(x))return x=ci(x,E.mode,T,null),x.return=E,x;if(typeof x.then=="function")return D(E,Ia(x),T);if(x.$$typeof===J)return D(E,Za(E,x),T);Pa(E,x)}return null}function A(E,x,T,U){var ie=x!==null?x.key:null;if(typeof T=="string"&&T!==""||typeof T=="number"||typeof T=="bigint")return ie!==null?null:p(E,x,""+T,U);if(typeof T=="object"&&T!==null){switch(T.$$typeof){case L:return T.key===ie?v(E,x,T,U):null;case K:return T.key===ie?_(E,x,T,U):null;case Q:return T=pi(T),A(E,x,T,U)}if(V(T)||ue(T))return ie!==null?null:M(E,x,T,U,null);if(typeof T.then=="function")return A(E,x,Ia(T),U);if(T.$$typeof===J)return A(E,x,Za(E,T),U);Pa(E,T)}return null}function O(E,x,T,U,ie){if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return E=E.get(T)||null,p(x,E,""+U,ie);if(typeof U=="object"&&U!==null){switch(U.$$typeof){case L:return E=E.get(U.key===null?T:U.key)||null,v(x,E,U,ie);case K:return E=E.get(U.key===null?T:U.key)||null,_(x,E,U,ie);case Q:return U=pi(U),O(E,x,T,U,ie)}if(V(U)||ue(U))return E=E.get(T)||null,M(x,E,U,ie,null);if(typeof U.then=="function")return O(E,x,T,Ia(U),ie);if(U.$$typeof===J)return O(E,x,T,Za(x,U),ie);Pa(x,U)}return null}function I(E,x,T,U){for(var ie=null,ke=null,te=x,de=x=0,be=null;te!==null&&de<T.length;de++){te.index>de?(be=te,te=null):be=te.sibling;var Te=A(E,te,T[de],U);if(Te===null){te===null&&(te=be);break}e&&te&&Te.alternate===null&&t(E,te),x=c(Te,x,de),ke===null?ie=Te:ke.sibling=Te,ke=Te,te=be}if(de===T.length)return i(E,te),we&&hn(E,de),ie;if(te===null){for(;de<T.length;de++)te=D(E,T[de],U),te!==null&&(x=c(te,x,de),ke===null?ie=te:ke.sibling=te,ke=te);return we&&hn(E,de),ie}for(te=s(te);de<T.length;de++)be=O(te,E,de,T[de],U),be!==null&&(e&&be.alternate!==null&&te.delete(be.key===null?de:be.key),x=c(be,x,de),ke===null?ie=be:ke.sibling=be,ke=be);return e&&te.forEach(function(Wn){return t(E,Wn)}),we&&hn(E,de),ie}function le(E,x,T,U){if(T==null)throw Error(l(151));for(var ie=null,ke=null,te=x,de=x=0,be=null,Te=T.next();te!==null&&!Te.done;de++,Te=T.next()){te.index>de?(be=te,te=null):be=te.sibling;var Wn=A(E,te,Te.value,U);if(Wn===null){te===null&&(te=be);break}e&&te&&Wn.alternate===null&&t(E,te),x=c(Wn,x,de),ke===null?ie=Wn:ke.sibling=Wn,ke=Wn,te=be}if(Te.done)return i(E,te),we&&hn(E,de),ie;if(te===null){for(;!Te.done;de++,Te=T.next())Te=D(E,Te.value,U),Te!==null&&(x=c(Te,x,de),ke===null?ie=Te:ke.sibling=Te,ke=Te);return we&&hn(E,de),ie}for(te=s(te);!Te.done;de++,Te=T.next())Te=O(te,E,de,Te.value,U),Te!==null&&(e&&Te.alternate!==null&&te.delete(Te.key===null?de:Te.key),x=c(Te,x,de),ke===null?ie=Te:ke.sibling=Te,ke=Te);return e&&te.forEach(function(vv){return t(E,vv)}),we&&hn(E,de),ie}function Me(E,x,T,U){if(typeof T=="object"&&T!==null&&T.type===P&&T.key===null&&(T=T.props.children),typeof T=="object"&&T!==null){switch(T.$$typeof){case L:e:{for(var ie=T.key;x!==null;){if(x.key===ie){if(ie=T.type,ie===P){if(x.tag===7){i(E,x.sibling),U=o(x,T.props.children),U.return=E,E=U;break e}}else if(x.elementType===ie||typeof ie=="object"&&ie!==null&&ie.$$typeof===Q&&pi(ie)===x.type){i(E,x.sibling),U=o(x,T.props),qs(U,T),U.return=E,E=U;break e}i(E,x);break}else t(E,x);x=x.sibling}T.type===P?(U=ci(T.props.children,E.mode,U,T.key),U.return=E,E=U):(U=Ga(T.type,T.key,T.props,null,E.mode,U),qs(U,T),U.return=E,E=U)}return h(E);case K:e:{for(ie=T.key;x!==null;){if(x.key===ie)if(x.tag===4&&x.stateNode.containerInfo===T.containerInfo&&x.stateNode.implementation===T.implementation){i(E,x.sibling),U=o(x,T.children||[]),U.return=E,E=U;break e}else{i(E,x);break}else t(E,x);x=x.sibling}U=$r(T,E.mode,U),U.return=E,E=U}return h(E);case Q:return T=pi(T),Me(E,x,T,U)}if(V(T))return I(E,x,T,U);if(ue(T)){if(ie=ue(T),typeof ie!="function")throw Error(l(150));return T=ie.call(T),le(E,x,T,U)}if(typeof T.then=="function")return Me(E,x,Ia(T),U);if(T.$$typeof===J)return Me(E,x,Za(E,T),U);Pa(E,T)}return typeof T=="string"&&T!==""||typeof T=="number"||typeof T=="bigint"?(T=""+T,x!==null&&x.tag===6?(i(E,x.sibling),U=o(x,T),U.return=E,E=U):(i(E,x),U=Hr(T,E.mode,U),U.return=E,E=U),h(E)):i(E,x)}return function(E,x,T,U){try{Bs=0;var ie=Me(E,x,T,U);return Gi=null,ie}catch(te){if(te===Xi||te===Fa)throw te;var ke=kt(29,te,null,E.mode);return ke.lanes=U,ke.return=E,ke}}}var yi=kf(!0),Tf=kf(!1),Cn=!1;function Pr(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function eo(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 Un(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Dn(e,t,i){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(Ae&2)!==0){var o=s.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),s.pending=t,t=Xa(e),of(e,null,i),t}return Va(e,s,t,i),Xa(e)}function Ls(e,t,i){if(t=t.updateQueue,t!==null&&(t=t.shared,(i&4194048)!==0)){var s=t.lanes;s&=e.pendingLanes,i|=s,t.lanes=i,mu(e,i)}}function to(e,t){var i=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,i===s)){var o=null,c=null;if(i=i.firstBaseUpdate,i!==null){do{var h={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};c===null?o=c=h:c=c.next=h,i=i.next}while(i!==null);c===null?o=c=t:c=c.next=t}else o=c=t;i={baseState:s.baseState,firstBaseUpdate:o,lastBaseUpdate:c,shared:s.shared,callbacks:s.callbacks},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=t:e.next=t,i.lastBaseUpdate=t}var no=!1;function Hs(){if(no){var e=Vi;if(e!==null)throw e}}function $s(e,t,i,s){no=!1;var o=e.updateQueue;Cn=!1;var c=o.firstBaseUpdate,h=o.lastBaseUpdate,p=o.shared.pending;if(p!==null){o.shared.pending=null;var v=p,_=v.next;v.next=null,h===null?c=_:h.next=_,h=v;var M=e.alternate;M!==null&&(M=M.updateQueue,p=M.lastBaseUpdate,p!==h&&(p===null?M.firstBaseUpdate=_:p.next=_,M.lastBaseUpdate=v))}if(c!==null){var D=o.baseState;h=0,M=_=v=null,p=c;do{var A=p.lane&-536870913,O=A!==p.lane;if(O?(ve&A)===A:(s&A)===A){A!==0&&A===Yi&&(no=!0),M!==null&&(M=M.next={lane:0,tag:p.tag,payload:p.payload,callback:null,next:null});e:{var I=e,le=p;A=t;var Me=i;switch(le.tag){case 1:if(I=le.payload,typeof I=="function"){D=I.call(Me,D,A);break e}D=I;break e;case 3:I.flags=I.flags&-65537|128;case 0:if(I=le.payload,A=typeof I=="function"?I.call(Me,D,A):I,A==null)break e;D=w({},D,A);break e;case 2:Cn=!0}}A=p.callback,A!==null&&(e.flags|=64,O&&(e.flags|=8192),O=o.callbacks,O===null?o.callbacks=[A]:O.push(A))}else O={lane:A,tag:p.tag,payload:p.payload,callback:p.callback,next:null},M===null?(_=M=O,v=D):M=M.next=O,h|=A;if(p=p.next,p===null){if(p=o.shared.pending,p===null)break;O=p,p=O.next,O.next=null,o.lastBaseUpdate=O,o.shared.pending=null}}while(!0);M===null&&(v=D),o.baseState=v,o.firstBaseUpdate=_,o.lastBaseUpdate=M,c===null&&(o.shared.lanes=0),$n|=h,e.lanes=h,e.memoizedState=D}}function _f(e,t){if(typeof e!="function")throw Error(l(191,e));e.call(t)}function Af(e,t){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)_f(i[e],t)}var Qi=S(null),el=S(0);function Nf(e,t){e=En,G(el,e),G(Qi,t),En=e|t.baseLanes}function io(){G(el,En),G(Qi,Qi.current)}function so(){En=el.current,q(Qi),q(el)}var Tt=S(null),qt=null;function Bn(e){var t=e.alternate;G(Ye,Ye.current&1),G(Tt,e),qt===null&&(t===null||Qi.current!==null||t.memoizedState!==null)&&(qt=e)}function ao(e){G(Ye,Ye.current),G(Tt,e),qt===null&&(qt=e)}function Of(e){e.tag===22?(G(Ye,Ye.current),G(Tt,e),qt===null&&(qt=e)):qn()}function qn(){G(Ye,Ye.current),G(Tt,Tt.current)}function _t(e){q(Tt),qt===e&&(qt=null),q(Ye)}var Ye=S(0);function tl(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||hc(i)||dc(i)))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 mn=0,fe=null,Re=null,Ze=null,nl=!1,Ki=!1,gi=!1,il=0,Ys=0,Zi=null,og=0;function He(){throw Error(l(321))}function lo(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!Et(e[i],t[i]))return!1;return!0}function ro(e,t,i,s,o,c){return mn=c,fe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,k.H=e===null||e.memoizedState===null?hh:Eo,gi=!1,c=i(s,o),gi=!1,Ki&&(c=Rf(t,i,s,o)),jf(e),c}function jf(e){k.H=Gs;var t=Re!==null&&Re.next!==null;if(mn=0,Ze=Re=fe=null,nl=!1,Ys=0,Zi=null,t)throw Error(l(300));e===null||Je||(e=e.dependencies,e!==null&&Ka(e)&&(Je=!0))}function Rf(e,t,i,s){fe=e;var o=0;do{if(Ki&&(Zi=null),Ys=0,Ki=!1,25<=o)throw Error(l(301));if(o+=1,Ze=Re=null,e.updateQueue!=null){var c=e.updateQueue;c.lastEffect=null,c.events=null,c.stores=null,c.memoCache!=null&&(c.memoCache.index=0)}k.H=dh,c=t(i,s)}while(Ki);return c}function cg(){var e=k.H,t=e.useState()[0];return t=typeof t.then=="function"?Vs(t):t,e=e.useState()[0],(Re!==null?Re.memoizedState:null)!==e&&(fe.flags|=1024),t}function oo(){var e=il!==0;return il=0,e}function co(e,t,i){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i}function uo(e){if(nl){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}nl=!1}mn=0,Ze=Re=fe=null,Ki=!1,Ys=il=0,Zi=null}function ht(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ze===null?fe.memoizedState=Ze=e:Ze=Ze.next=e,Ze}function Ve(){if(Re===null){var e=fe.alternate;e=e!==null?e.memoizedState:null}else e=Re.next;var t=Ze===null?fe.memoizedState:Ze.next;if(t!==null)Ze=t,Re=e;else{if(e===null)throw fe.alternate===null?Error(l(467)):Error(l(310));Re=e,e={memoizedState:Re.memoizedState,baseState:Re.baseState,baseQueue:Re.baseQueue,queue:Re.queue,next:null},Ze===null?fe.memoizedState=Ze=e:Ze=Ze.next=e}return Ze}function sl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Vs(e){var t=Ys;return Ys+=1,Zi===null&&(Zi=[]),e=Sf(Zi,e,t),t=fe,(Ze===null?t.memoizedState:Ze.next)===null&&(t=t.alternate,k.H=t===null||t.memoizedState===null?hh:Eo),e}function al(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Vs(e);if(e.$$typeof===J)return rt(e)}throw Error(l(438,String(e)))}function fo(e){var t=null,i=fe.updateQueue;if(i!==null&&(t=i.memoCache),t==null){var s=fe.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(t={data:s.data.map(function(o){return o.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),i===null&&(i=sl(),fe.updateQueue=i),i.memoCache=t,i=t.data[t.index],i===void 0)for(i=t.data[t.index]=Array(e),s=0;s<e;s++)i[s]=se;return t.index++,i}function yn(e,t){return typeof t=="function"?t(e):t}function ll(e){var t=Ve();return ho(t,Re,e)}function ho(e,t,i){var s=e.queue;if(s===null)throw Error(l(311));s.lastRenderedReducer=i;var o=e.baseQueue,c=s.pending;if(c!==null){if(o!==null){var h=o.next;o.next=c.next,c.next=h}t.baseQueue=o=c,s.pending=null}if(c=e.baseState,o===null)e.memoizedState=c;else{t=o.next;var p=h=null,v=null,_=t,M=!1;do{var D=_.lane&-536870913;if(D!==_.lane?(ve&D)===D:(mn&D)===D){var A=_.revertLane;if(A===0)v!==null&&(v=v.next={lane:0,revertLane:0,gesture:null,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null}),D===Yi&&(M=!0);else if((mn&A)===A){_=_.next,A===Yi&&(M=!0);continue}else D={lane:0,revertLane:_.revertLane,gesture:null,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null},v===null?(p=v=D,h=c):v=v.next=D,fe.lanes|=A,$n|=A;D=_.action,gi&&i(c,D),c=_.hasEagerState?_.eagerState:i(c,D)}else A={lane:D,revertLane:_.revertLane,gesture:_.gesture,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null},v===null?(p=v=A,h=c):v=v.next=A,fe.lanes|=D,$n|=D;_=_.next}while(_!==null&&_!==t);if(v===null?h=c:v.next=p,!Et(c,e.memoizedState)&&(Je=!0,M&&(i=Vi,i!==null)))throw i;e.memoizedState=c,e.baseState=h,e.baseQueue=v,s.lastRenderedState=c}return o===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function po(e){var t=Ve(),i=t.queue;if(i===null)throw Error(l(311));i.lastRenderedReducer=e;var s=i.dispatch,o=i.pending,c=t.memoizedState;if(o!==null){i.pending=null;var h=o=o.next;do c=e(c,h.action),h=h.next;while(h!==o);Et(c,t.memoizedState)||(Je=!0),t.memoizedState=c,t.baseQueue===null&&(t.baseState=c),i.lastRenderedState=c}return[c,s]}function zf(e,t,i){var s=fe,o=Ve(),c=we;if(c){if(i===void 0)throw Error(l(407));i=i()}else i=t();var h=!Et((Re||o).memoizedState,i);if(h&&(o.memoizedState=i,Je=!0),o=o.queue,go(Uf.bind(null,s,o,e),[e]),o.getSnapshot!==t||h||Ze!==null&&Ze.memoizedState.tag&1){if(s.flags|=2048,Ji(9,{destroy:void 0},Cf.bind(null,s,o,i,t),null),Ue===null)throw Error(l(349));c||(mn&127)!==0||Mf(s,t,i)}return i}function Mf(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=fe.updateQueue,t===null?(t=sl(),fe.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function Cf(e,t,i,s){t.value=i,t.getSnapshot=s,Df(t)&&Bf(e)}function Uf(e,t,i){return i(function(){Df(t)&&Bf(e)})}function Df(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!Et(e,i)}catch{return!0}}function Bf(e){var t=oi(e,2);t!==null&&wt(t,e,2)}function mo(e){var t=ht();if(typeof e=="function"){var i=e;if(e=i(),gi){An(!0);try{i()}finally{An(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:yn,lastRenderedState:e},t}function qf(e,t,i,s){return e.baseState=i,ho(e,Re,typeof s=="function"?s:yn)}function ug(e,t,i,s,o){if(cl(e))throw Error(l(485));if(e=t.action,e!==null){var c={payload:o,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(h){c.listeners.push(h)}};k.T!==null?i(!0):c.isTransition=!1,s(c),i=t.pending,i===null?(c.next=t.pending=c,Lf(t,c)):(c.next=i.next,t.pending=i.next=c)}}function Lf(e,t){var i=t.action,s=t.payload,o=e.state;if(t.isTransition){var c=k.T,h={};k.T=h;try{var p=i(o,s),v=k.S;v!==null&&v(h,p),Hf(e,t,p)}catch(_){yo(e,t,_)}finally{c!==null&&h.types!==null&&(c.types=h.types),k.T=c}}else try{c=i(o,s),Hf(e,t,c)}catch(_){yo(e,t,_)}}function Hf(e,t,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(s){$f(e,t,s)},function(s){return yo(e,t,s)}):$f(e,t,i)}function $f(e,t,i){t.status="fulfilled",t.value=i,Yf(t),e.state=i,t=e.pending,t!==null&&(i=t.next,i===t?e.pending=null:(i=i.next,t.next=i,Lf(e,i)))}function yo(e,t,i){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do t.status="rejected",t.reason=i,Yf(t),t=t.next;while(t!==s)}e.action=null}function Yf(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Vf(e,t){return t}function Xf(e,t){if(we){var i=Ue.formState;if(i!==null){e:{var s=fe;if(we){if(Be){t:{for(var o=Be,c=Bt;o.nodeType!==8;){if(!c){o=null;break t}if(o=Lt(o.nextSibling),o===null){o=null;break t}}c=o.data,o=c==="F!"||c==="F"?o:null}if(o){Be=Lt(o.nextSibling),s=o.data==="F!";break e}}zn(s)}s=!1}s&&(t=i[0])}}return i=ht(),i.memoizedState=i.baseState=t,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vf,lastRenderedState:t},i.queue=s,i=ch.bind(null,fe,s),s.dispatch=i,s=mo(!1),c=xo.bind(null,fe,!1,s.queue),s=ht(),o={state:t,dispatch:null,action:e,pending:null},s.queue=o,i=ug.bind(null,fe,o,c,i),o.dispatch=i,s.memoizedState=e,[t,i,!1]}function Gf(e){var t=Ve();return Qf(t,Re,e)}function Qf(e,t,i){if(t=ho(e,t,Vf)[0],e=ll(yn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var s=Vs(t)}catch(h){throw h===Xi?Fa:h}else s=t;t=Ve();var o=t.queue,c=o.dispatch;return i!==t.memoizedState&&(fe.flags|=2048,Ji(9,{destroy:void 0},fg.bind(null,o,i),null)),[s,c,e]}function fg(e,t){e.action=t}function Kf(e){var t=Ve(),i=Re;if(i!==null)return Qf(t,i,e);Ve(),t=t.memoizedState,i=Ve();var s=i.queue.dispatch;return i.memoizedState=e,[t,s,!1]}function Ji(e,t,i,s){return e={tag:e,create:i,deps:s,inst:t,next:null},t=fe.updateQueue,t===null&&(t=sl(),fe.updateQueue=t),i=t.lastEffect,i===null?t.lastEffect=e.next=e:(s=i.next,i.next=e,e.next=s,t.lastEffect=e),e}function Zf(){return Ve().memoizedState}function rl(e,t,i,s){var o=ht();fe.flags|=e,o.memoizedState=Ji(1|t,{destroy:void 0},i,s===void 0?null:s)}function ol(e,t,i,s){var o=Ve();s=s===void 0?null:s;var c=o.memoizedState.inst;Re!==null&&s!==null&&lo(s,Re.memoizedState.deps)?o.memoizedState=Ji(t,c,i,s):(fe.flags|=e,o.memoizedState=Ji(1|t,c,i,s))}function Jf(e,t){rl(8390656,8,e,t)}function go(e,t){ol(2048,8,e,t)}function hg(e){fe.flags|=4;var t=fe.updateQueue;if(t===null)t=sl(),fe.updateQueue=t,t.events=[e];else{var i=t.events;i===null?t.events=[e]:i.push(e)}}function Ff(e){var t=Ve().memoizedState;return hg({ref:t,nextImpl:e}),function(){if((Ae&2)!==0)throw Error(l(440));return t.impl.apply(void 0,arguments)}}function Wf(e,t){return ol(4,2,e,t)}function If(e,t){return ol(4,4,e,t)}function Pf(e,t){if(typeof t=="function"){e=e();var i=t(e);return function(){typeof i=="function"?i():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function eh(e,t,i){i=i!=null?i.concat([e]):null,ol(4,4,Pf.bind(null,t,e),i)}function vo(){}function th(e,t){var i=Ve();t=t===void 0?null:t;var s=i.memoizedState;return t!==null&&lo(t,s[1])?s[0]:(i.memoizedState=[e,t],e)}function nh(e,t){var i=Ve();t=t===void 0?null:t;var s=i.memoizedState;if(t!==null&&lo(t,s[1]))return s[0];if(s=e(),gi){An(!0);try{e()}finally{An(!1)}}return i.memoizedState=[s,t],s}function bo(e,t,i){return i===void 0||(mn&1073741824)!==0&&(ve&261930)===0?e.memoizedState=t:(e.memoizedState=i,e=id(),fe.lanes|=e,$n|=e,i)}function ih(e,t,i,s){return Et(i,t)?i:Qi.current!==null?(e=bo(e,i,s),Et(e,t)||(Je=!0),e):(mn&42)===0||(mn&1073741824)!==0&&(ve&261930)===0?(Je=!0,e.memoizedState=i):(e=id(),fe.lanes|=e,$n|=e,t)}function sh(e,t,i,s,o){var c=$.p;$.p=c!==0&&8>c?c:8;var h=k.T,p={};k.T=p,xo(e,!1,t,i);try{var v=o(),_=k.S;if(_!==null&&_(p,v),v!==null&&typeof v=="object"&&typeof v.then=="function"){var M=rg(v,s);Xs(e,t,M,Ot(e))}else Xs(e,t,s,Ot(e))}catch(D){Xs(e,t,{then:function(){},status:"rejected",reason:D},Ot())}finally{$.p=c,h!==null&&p.types!==null&&(h.types=p.types),k.T=h}}function dg(){}function wo(e,t,i,s){if(e.tag!==5)throw Error(l(476));var o=ah(e).queue;sh(e,o,t,F,i===null?dg:function(){return lh(e),i(s)})}function ah(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:F,baseState:F,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:yn,lastRenderedState:F},next:null};var i={};return t.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:yn,lastRenderedState:i},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function lh(e){var t=ah(e);t.next===null&&(t=e.alternate.memoizedState),Xs(e,t.next.queue,{},Ot())}function So(){return rt(ra)}function rh(){return Ve().memoizedState}function oh(){return Ve().memoizedState}function pg(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var i=Ot();e=Un(i);var s=Dn(t,e,i);s!==null&&(wt(s,t,i),Ls(s,t,i)),t={cache:Jr()},e.payload=t;return}t=t.return}}function mg(e,t,i){var s=Ot();i={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},cl(e)?uh(t,i):(i=qr(e,t,i,s),i!==null&&(wt(i,e,s),fh(i,t,s)))}function ch(e,t,i){var s=Ot();Xs(e,t,i,s)}function Xs(e,t,i,s){var o={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(cl(e))uh(t,o);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var h=t.lastRenderedState,p=c(h,i);if(o.hasEagerState=!0,o.eagerState=p,Et(p,h))return Va(e,t,o,0),Ue===null&&Ya(),!1}catch{}if(i=qr(e,t,o,s),i!==null)return wt(i,e,s),fh(i,t,s),!0}return!1}function xo(e,t,i,s){if(s={lane:2,revertLane:ec(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},cl(e)){if(t)throw Error(l(479))}else t=qr(e,i,s,2),t!==null&&wt(t,e,2)}function cl(e){var t=e.alternate;return e===fe||t!==null&&t===fe}function uh(e,t){Ki=nl=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function fh(e,t,i){if((i&4194048)!==0){var s=t.lanes;s&=e.pendingLanes,i|=s,t.lanes=i,mu(e,i)}}var Gs={readContext:rt,use:al,useCallback:He,useContext:He,useEffect:He,useImperativeHandle:He,useLayoutEffect:He,useInsertionEffect:He,useMemo:He,useReducer:He,useRef:He,useState:He,useDebugValue:He,useDeferredValue:He,useTransition:He,useSyncExternalStore:He,useId:He,useHostTransitionStatus:He,useFormState:He,useActionState:He,useOptimistic:He,useMemoCache:He,useCacheRefresh:He};Gs.useEffectEvent=He;var hh={readContext:rt,use:al,useCallback:function(e,t){return ht().memoizedState=[e,t===void 0?null:t],e},useContext:rt,useEffect:Jf,useImperativeHandle:function(e,t,i){i=i!=null?i.concat([e]):null,rl(4194308,4,Pf.bind(null,t,e),i)},useLayoutEffect:function(e,t){return rl(4194308,4,e,t)},useInsertionEffect:function(e,t){rl(4,2,e,t)},useMemo:function(e,t){var i=ht();t=t===void 0?null:t;var s=e();if(gi){An(!0);try{e()}finally{An(!1)}}return i.memoizedState=[s,t],s},useReducer:function(e,t,i){var s=ht();if(i!==void 0){var o=i(t);if(gi){An(!0);try{i(t)}finally{An(!1)}}}else o=t;return s.memoizedState=s.baseState=o,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:o},s.queue=e,e=e.dispatch=mg.bind(null,fe,e),[s.memoizedState,e]},useRef:function(e){var t=ht();return e={current:e},t.memoizedState=e},useState:function(e){e=mo(e);var t=e.queue,i=ch.bind(null,fe,t);return t.dispatch=i,[e.memoizedState,i]},useDebugValue:vo,useDeferredValue:function(e,t){var i=ht();return bo(i,e,t)},useTransition:function(){var e=mo(!1);return e=sh.bind(null,fe,e.queue,!0,!1),ht().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,i){var s=fe,o=ht();if(we){if(i===void 0)throw Error(l(407));i=i()}else{if(i=t(),Ue===null)throw Error(l(349));(ve&127)!==0||Mf(s,t,i)}o.memoizedState=i;var c={value:i,getSnapshot:t};return o.queue=c,Jf(Uf.bind(null,s,c,e),[e]),s.flags|=2048,Ji(9,{destroy:void 0},Cf.bind(null,s,c,i,t),null),i},useId:function(){var e=ht(),t=Ue.identifierPrefix;if(we){var i=It,s=Wt;i=(s&~(1<<32-xt(s)-1)).toString(32)+i,t="_"+t+"R_"+i,i=il++,0<i&&(t+="H"+i.toString(32)),t+="_"}else i=og++,t="_"+t+"r_"+i.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:So,useFormState:Xf,useActionState:Xf,useOptimistic:function(e){var t=ht();t.memoizedState=t.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=i,t=xo.bind(null,fe,!0,i),i.dispatch=t,[e,t]},useMemoCache:fo,useCacheRefresh:function(){return ht().memoizedState=pg.bind(null,fe)},useEffectEvent:function(e){var t=ht(),i={impl:e};return t.memoizedState=i,function(){if((Ae&2)!==0)throw Error(l(440));return i.impl.apply(void 0,arguments)}}},Eo={readContext:rt,use:al,useCallback:th,useContext:rt,useEffect:go,useImperativeHandle:eh,useInsertionEffect:Wf,useLayoutEffect:If,useMemo:nh,useReducer:ll,useRef:Zf,useState:function(){return ll(yn)},useDebugValue:vo,useDeferredValue:function(e,t){var i=Ve();return ih(i,Re.memoizedState,e,t)},useTransition:function(){var e=ll(yn)[0],t=Ve().memoizedState;return[typeof e=="boolean"?e:Vs(e),t]},useSyncExternalStore:zf,useId:rh,useHostTransitionStatus:So,useFormState:Gf,useActionState:Gf,useOptimistic:function(e,t){var i=Ve();return qf(i,Re,e,t)},useMemoCache:fo,useCacheRefresh:oh};Eo.useEffectEvent=Ff;var dh={readContext:rt,use:al,useCallback:th,useContext:rt,useEffect:go,useImperativeHandle:eh,useInsertionEffect:Wf,useLayoutEffect:If,useMemo:nh,useReducer:po,useRef:Zf,useState:function(){return po(yn)},useDebugValue:vo,useDeferredValue:function(e,t){var i=Ve();return Re===null?bo(i,e,t):ih(i,Re.memoizedState,e,t)},useTransition:function(){var e=po(yn)[0],t=Ve().memoizedState;return[typeof e=="boolean"?e:Vs(e),t]},useSyncExternalStore:zf,useId:rh,useHostTransitionStatus:So,useFormState:Kf,useActionState:Kf,useOptimistic:function(e,t){var i=Ve();return Re!==null?qf(i,Re,e,t):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:fo,useCacheRefresh:oh};dh.useEffectEvent=Ff;function ko(e,t,i,s){t=e.memoizedState,i=i(s,t),i=i==null?t:w({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var To={enqueueSetState:function(e,t,i){e=e._reactInternals;var s=Ot(),o=Un(s);o.payload=t,i!=null&&(o.callback=i),t=Dn(e,o,s),t!==null&&(wt(t,e,s),Ls(t,e,s))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var s=Ot(),o=Un(s);o.tag=1,o.payload=t,i!=null&&(o.callback=i),t=Dn(e,o,s),t!==null&&(wt(t,e,s),Ls(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=Ot(),s=Un(i);s.tag=2,t!=null&&(s.callback=t),t=Dn(e,s,i),t!==null&&(wt(t,e,i),Ls(t,e,i))}};function ph(e,t,i,s,o,c,h){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,c,h):t.prototype&&t.prototype.isPureReactComponent?!Rs(i,s)||!Rs(o,c):!0}function mh(e,t,i,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(i,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(i,s),t.state!==e&&To.enqueueReplaceState(t,t.state,null)}function vi(e,t){var i=t;if("ref"in t){i={};for(var s in t)s!=="ref"&&(i[s]=t[s])}if(e=e.defaultProps){i===t&&(i=w({},i));for(var o in e)i[o]===void 0&&(i[o]=e[o])}return i}function yh(e){$a(e)}function gh(e){console.error(e)}function vh(e){$a(e)}function ul(e,t){try{var i=e.onUncaughtError;i(t.value,{componentStack:t.stack})}catch(s){setTimeout(function(){throw s})}}function bh(e,t,i){try{var s=e.onCaughtError;s(i.value,{componentStack:i.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(o){setTimeout(function(){throw o})}}function _o(e,t,i){return i=Un(i),i.tag=3,i.payload={element:null},i.callback=function(){ul(e,t)},i}function wh(e){return e=Un(e),e.tag=3,e}function Sh(e,t,i,s){var o=i.type.getDerivedStateFromError;if(typeof o=="function"){var c=s.value;e.payload=function(){return o(c)},e.callback=function(){bh(t,i,s)}}var h=i.stateNode;h!==null&&typeof h.componentDidCatch=="function"&&(e.callback=function(){bh(t,i,s),typeof o!="function"&&(Yn===null?Yn=new Set([this]):Yn.add(this));var p=s.stack;this.componentDidCatch(s.value,{componentStack:p!==null?p:""})})}function yg(e,t,i,s,o){if(i.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(t=i.alternate,t!==null&&$i(t,i,o,!0),i=Tt.current,i!==null){switch(i.tag){case 31:case 13:return qt===null?xl():i.alternate===null&&$e===0&&($e=3),i.flags&=-257,i.flags|=65536,i.lanes=o,s===Wa?i.flags|=16384:(t=i.updateQueue,t===null?i.updateQueue=new Set([s]):t.add(s),Wo(e,s,o)),!1;case 22:return i.flags|=65536,s===Wa?i.flags|=16384:(t=i.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([s])},i.updateQueue=t):(i=t.retryQueue,i===null?t.retryQueue=new Set([s]):i.add(s)),Wo(e,s,o)),!1}throw Error(l(435,i.tag))}return Wo(e,s,o),xl(),!1}if(we)return t=Tt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=o,s!==Xr&&(e=Error(l(422),{cause:s}),Cs(Ct(e,i)))):(s!==Xr&&(t=Error(l(423),{cause:s}),Cs(Ct(t,i))),e=e.current.alternate,e.flags|=65536,o&=-o,e.lanes|=o,s=Ct(s,i),o=_o(e.stateNode,s,o),to(e,o),$e!==4&&($e=2)),!1;var c=Error(l(520),{cause:s});if(c=Ct(c,i),Ps===null?Ps=[c]:Ps.push(c),$e!==4&&($e=2),t===null)return!0;s=Ct(s,i),i=t;do{switch(i.tag){case 3:return i.flags|=65536,e=o&-o,i.lanes|=e,e=_o(i.stateNode,s,e),to(i,e),!1;case 1:if(t=i.type,c=i.stateNode,(i.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||c!==null&&typeof c.componentDidCatch=="function"&&(Yn===null||!Yn.has(c))))return i.flags|=65536,o&=-o,i.lanes|=o,o=wh(o),Sh(o,e,i,s),to(i,o),!1}i=i.return}while(i!==null);return!1}var Ao=Error(l(461)),Je=!1;function ot(e,t,i,s){t.child=e===null?Tf(t,null,i,s):yi(t,e.child,i,s)}function xh(e,t,i,s,o){i=i.render;var c=t.ref;if("ref"in s){var h={};for(var p in s)p!=="ref"&&(h[p]=s[p])}else h=s;return hi(t),s=ro(e,t,i,h,c,o),p=oo(),e!==null&&!Je?(co(e,t,o),gn(e,t,o)):(we&&p&&Yr(t),t.flags|=1,ot(e,t,s,o),t.child)}function Eh(e,t,i,s,o){if(e===null){var c=i.type;return typeof c=="function"&&!Lr(c)&&c.defaultProps===void 0&&i.compare===null?(t.tag=15,t.type=c,kh(e,t,c,s,o)):(e=Ga(i.type,null,s,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(c=e.child,!Uo(e,o)){var h=c.memoizedProps;if(i=i.compare,i=i!==null?i:Rs,i(h,s)&&e.ref===t.ref)return gn(e,t,o)}return t.flags|=1,e=fn(c,s),e.ref=t.ref,e.return=t,t.child=e}function kh(e,t,i,s,o){if(e!==null){var c=e.memoizedProps;if(Rs(c,s)&&e.ref===t.ref)if(Je=!1,t.pendingProps=s=c,Uo(e,o))(e.flags&131072)!==0&&(Je=!0);else return t.lanes=e.lanes,gn(e,t,o)}return No(e,t,i,s,o)}function Th(e,t,i,s){var o=s.children,c=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.mode==="hidden"){if((t.flags&128)!==0){if(c=c!==null?c.baseLanes|i:i,e!==null){for(s=t.child=e.child,o=0;s!==null;)o=o|s.lanes|s.childLanes,s=s.sibling;s=o&~c}else s=0,t.child=null;return _h(e,t,c,i,s)}if((i&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ja(t,c!==null?c.cachePool:null),c!==null?Nf(t,c):io(),Of(t);else return s=t.lanes=536870912,_h(e,t,c!==null?c.baseLanes|i:i,i,s)}else c!==null?(Ja(t,c.cachePool),Nf(t,c),qn(),t.memoizedState=null):(e!==null&&Ja(t,null),io(),qn());return ot(e,t,o,i),t.child}function Qs(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function _h(e,t,i,s,o){var c=Wr();return c=c===null?null:{parent:Ke._currentValue,pool:c},t.memoizedState={baseLanes:i,cachePool:c},e!==null&&Ja(t,null),io(),Of(t),e!==null&&$i(e,t,s,!0),t.childLanes=o,null}function fl(e,t){return t=dl({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Ah(e,t,i){return yi(t,e.child,null,i),e=fl(t,t.pendingProps),e.flags|=2,_t(t),t.memoizedState=null,e}function gg(e,t,i){var s=t.pendingProps,o=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(we){if(s.mode==="hidden")return e=fl(t,s),t.lanes=536870912,Qs(null,e);if(ao(t),(e=Be)?(e=Ld(e,Bt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:jn!==null?{id:Wt,overflow:It}:null,retryLane:536870912,hydrationErrors:null},i=uf(e),i.return=t,t.child=i,lt=t,Be=null)):e=null,e===null)throw zn(t);return t.lanes=536870912,null}return fl(t,s)}var c=e.memoizedState;if(c!==null){var h=c.dehydrated;if(ao(t),o)if(t.flags&256)t.flags&=-257,t=Ah(e,t,i);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(l(558));else if(Je||$i(e,t,i,!1),o=(i&e.childLanes)!==0,Je||o){if(s=Ue,s!==null&&(h=yu(s,i),h!==0&&h!==c.retryLane))throw c.retryLane=h,oi(e,h),wt(s,e,h),Ao;xl(),t=Ah(e,t,i)}else e=c.treeContext,Be=Lt(h.nextSibling),lt=t,we=!0,Rn=null,Bt=!1,e!==null&&df(t,e),t=fl(t,s),t.flags|=4096;return t}return e=fn(e.child,{mode:s.mode,children:s.children}),e.ref=t.ref,t.child=e,e.return=t,e}function hl(e,t){var i=t.ref;if(i===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(l(284));(e===null||e.ref!==i)&&(t.flags|=4194816)}}function No(e,t,i,s,o){return hi(t),i=ro(e,t,i,s,void 0,o),s=oo(),e!==null&&!Je?(co(e,t,o),gn(e,t,o)):(we&&s&&Yr(t),t.flags|=1,ot(e,t,i,o),t.child)}function Nh(e,t,i,s,o,c){return hi(t),t.updateQueue=null,i=Rf(t,s,i,o),jf(e),s=oo(),e!==null&&!Je?(co(e,t,c),gn(e,t,c)):(we&&s&&Yr(t),t.flags|=1,ot(e,t,i,c),t.child)}function Oh(e,t,i,s,o){if(hi(t),t.stateNode===null){var c=Bi,h=i.contextType;typeof h=="object"&&h!==null&&(c=rt(h)),c=new i(s,c),t.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=To,t.stateNode=c,c._reactInternals=t,c=t.stateNode,c.props=s,c.state=t.memoizedState,c.refs={},Pr(t),h=i.contextType,c.context=typeof h=="object"&&h!==null?rt(h):Bi,c.state=t.memoizedState,h=i.getDerivedStateFromProps,typeof h=="function"&&(ko(t,i,h,s),c.state=t.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof c.getSnapshotBeforeUpdate=="function"||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(h=c.state,typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount(),h!==c.state&&To.enqueueReplaceState(c,c.state,null),$s(t,s,c,o),Hs(),c.state=t.memoizedState),typeof c.componentDidMount=="function"&&(t.flags|=4194308),s=!0}else if(e===null){c=t.stateNode;var p=t.memoizedProps,v=vi(i,p);c.props=v;var _=c.context,M=i.contextType;h=Bi,typeof M=="object"&&M!==null&&(h=rt(M));var D=i.getDerivedStateFromProps;M=typeof D=="function"||typeof c.getSnapshotBeforeUpdate=="function",p=t.pendingProps!==p,M||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(p||_!==h)&&mh(t,c,s,h),Cn=!1;var A=t.memoizedState;c.state=A,$s(t,s,c,o),Hs(),_=t.memoizedState,p||A!==_||Cn?(typeof D=="function"&&(ko(t,i,D,s),_=t.memoizedState),(v=Cn||ph(t,i,v,s,A,_,h))?(M||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount()),typeof c.componentDidMount=="function"&&(t.flags|=4194308)):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=_),c.props=s,c.state=_,c.context=h,s=v):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{c=t.stateNode,eo(e,t),h=t.memoizedProps,M=vi(i,h),c.props=M,D=t.pendingProps,A=c.context,_=i.contextType,v=Bi,typeof _=="object"&&_!==null&&(v=rt(_)),p=i.getDerivedStateFromProps,(_=typeof p=="function"||typeof c.getSnapshotBeforeUpdate=="function")||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(h!==D||A!==v)&&mh(t,c,s,v),Cn=!1,A=t.memoizedState,c.state=A,$s(t,s,c,o),Hs();var O=t.memoizedState;h!==D||A!==O||Cn||e!==null&&e.dependencies!==null&&Ka(e.dependencies)?(typeof p=="function"&&(ko(t,i,p,s),O=t.memoizedState),(M=Cn||ph(t,i,M,s,A,O,v)||e!==null&&e.dependencies!==null&&Ka(e.dependencies))?(_||typeof c.UNSAFE_componentWillUpdate!="function"&&typeof c.componentWillUpdate!="function"||(typeof c.componentWillUpdate=="function"&&c.componentWillUpdate(s,O,v),typeof c.UNSAFE_componentWillUpdate=="function"&&c.UNSAFE_componentWillUpdate(s,O,v)),typeof c.componentDidUpdate=="function"&&(t.flags|=4),typeof c.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof c.componentDidUpdate!="function"||h===e.memoizedProps&&A===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||h===e.memoizedProps&&A===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=O),c.props=s,c.state=O,c.context=v,s=M):(typeof c.componentDidUpdate!="function"||h===e.memoizedProps&&A===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||h===e.memoizedProps&&A===e.memoizedState||(t.flags|=1024),s=!1)}return c=s,hl(e,t),s=(t.flags&128)!==0,c||s?(c=t.stateNode,i=s&&typeof i.getDerivedStateFromError!="function"?null:c.render(),t.flags|=1,e!==null&&s?(t.child=yi(t,e.child,null,o),t.child=yi(t,null,i,o)):ot(e,t,i,o),t.memoizedState=c.state,e=t.child):e=gn(e,t,o),e}function jh(e,t,i,s){return ui(),t.flags|=256,ot(e,t,i,s),t.child}var Oo={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function jo(e){return{baseLanes:e,cachePool:bf()}}function Ro(e,t,i){return e=e!==null?e.childLanes&~i:0,t&&(e|=Nt),e}function Rh(e,t,i){var s=t.pendingProps,o=!1,c=(t.flags&128)!==0,h;if((h=c)||(h=e!==null&&e.memoizedState===null?!1:(Ye.current&2)!==0),h&&(o=!0,t.flags&=-129),h=(t.flags&32)!==0,t.flags&=-33,e===null){if(we){if(o?Bn(t):qn(),(e=Be)?(e=Ld(e,Bt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:jn!==null?{id:Wt,overflow:It}:null,retryLane:536870912,hydrationErrors:null},i=uf(e),i.return=t,t.child=i,lt=t,Be=null)):e=null,e===null)throw zn(t);return dc(e)?t.lanes=32:t.lanes=536870912,null}var p=s.children;return s=s.fallback,o?(qn(),o=t.mode,p=dl({mode:"hidden",children:p},o),s=ci(s,o,i,null),p.return=t,s.return=t,p.sibling=s,t.child=p,s=t.child,s.memoizedState=jo(i),s.childLanes=Ro(e,h,i),t.memoizedState=Oo,Qs(null,s)):(Bn(t),zo(t,p))}var v=e.memoizedState;if(v!==null&&(p=v.dehydrated,p!==null)){if(c)t.flags&256?(Bn(t),t.flags&=-257,t=Mo(e,t,i)):t.memoizedState!==null?(qn(),t.child=e.child,t.flags|=128,t=null):(qn(),p=s.fallback,o=t.mode,s=dl({mode:"visible",children:s.children},o),p=ci(p,o,i,null),p.flags|=2,s.return=t,p.return=t,s.sibling=p,t.child=s,yi(t,e.child,null,i),s=t.child,s.memoizedState=jo(i),s.childLanes=Ro(e,h,i),t.memoizedState=Oo,t=Qs(null,s));else if(Bn(t),dc(p)){if(h=p.nextSibling&&p.nextSibling.dataset,h)var _=h.dgst;h=_,s=Error(l(419)),s.stack="",s.digest=h,Cs({value:s,source:null,stack:null}),t=Mo(e,t,i)}else if(Je||$i(e,t,i,!1),h=(i&e.childLanes)!==0,Je||h){if(h=Ue,h!==null&&(s=yu(h,i),s!==0&&s!==v.retryLane))throw v.retryLane=s,oi(e,s),wt(h,e,s),Ao;hc(p)||xl(),t=Mo(e,t,i)}else hc(p)?(t.flags|=192,t.child=e.child,t=null):(e=v.treeContext,Be=Lt(p.nextSibling),lt=t,we=!0,Rn=null,Bt=!1,e!==null&&df(t,e),t=zo(t,s.children),t.flags|=4096);return t}return o?(qn(),p=s.fallback,o=t.mode,v=e.child,_=v.sibling,s=fn(v,{mode:"hidden",children:s.children}),s.subtreeFlags=v.subtreeFlags&65011712,_!==null?p=fn(_,p):(p=ci(p,o,i,null),p.flags|=2),p.return=t,s.return=t,s.sibling=p,t.child=s,Qs(null,s),s=t.child,p=e.child.memoizedState,p===null?p=jo(i):(o=p.cachePool,o!==null?(v=Ke._currentValue,o=o.parent!==v?{parent:v,pool:v}:o):o=bf(),p={baseLanes:p.baseLanes|i,cachePool:o}),s.memoizedState=p,s.childLanes=Ro(e,h,i),t.memoizedState=Oo,Qs(e.child,s)):(Bn(t),i=e.child,e=i.sibling,i=fn(i,{mode:"visible",children:s.children}),i.return=t,i.sibling=null,e!==null&&(h=t.deletions,h===null?(t.deletions=[e],t.flags|=16):h.push(e)),t.child=i,t.memoizedState=null,i)}function zo(e,t){return t=dl({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function dl(e,t){return e=kt(22,e,null,t),e.lanes=0,e}function Mo(e,t,i){return yi(t,e.child,null,i),e=zo(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function zh(e,t,i){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),Kr(e.return,t,i)}function Co(e,t,i,s,o,c){var h=e.memoizedState;h===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:i,tailMode:o,treeForkCount:c}:(h.isBackwards=t,h.rendering=null,h.renderingStartTime=0,h.last=s,h.tail=i,h.tailMode=o,h.treeForkCount=c)}function Mh(e,t,i){var s=t.pendingProps,o=s.revealOrder,c=s.tail;s=s.children;var h=Ye.current,p=(h&2)!==0;if(p?(h=h&1|2,t.flags|=128):h&=1,G(Ye,h),ot(e,t,s,i),s=we?Ms:0,!p&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&zh(e,i,t);else if(e.tag===19)zh(e,i,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(o){case"forwards":for(i=t.child,o=null;i!==null;)e=i.alternate,e!==null&&tl(e)===null&&(o=i),i=i.sibling;i=o,i===null?(o=t.child,t.child=null):(o=i.sibling,i.sibling=null),Co(t,!1,o,i,c,s);break;case"backwards":case"unstable_legacy-backwards":for(i=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&tl(e)===null){t.child=o;break}e=o.sibling,o.sibling=i,i=o,o=e}Co(t,!0,i,null,c,s);break;case"together":Co(t,!1,null,null,void 0,s);break;default:t.memoizedState=null}return t.child}function gn(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),$n|=t.lanes,(i&t.childLanes)===0)if(e!==null){if($i(e,t,i,!1),(i&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(l(153));if(t.child!==null){for(e=t.child,i=fn(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=fn(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function Uo(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Ka(e)))}function vg(e,t,i){switch(t.tag){case 3:it(t,t.stateNode.containerInfo),Mn(t,Ke,e.memoizedState.cache),ui();break;case 27:case 5:ti(t);break;case 4:it(t,t.stateNode.containerInfo);break;case 10:Mn(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,ao(t),null;break;case 13:var s=t.memoizedState;if(s!==null)return s.dehydrated!==null?(Bn(t),t.flags|=128,null):(i&t.child.childLanes)!==0?Rh(e,t,i):(Bn(t),e=gn(e,t,i),e!==null?e.sibling:null);Bn(t);break;case 19:var o=(e.flags&128)!==0;if(s=(i&t.childLanes)!==0,s||($i(e,t,i,!1),s=(i&t.childLanes)!==0),o){if(s)return Mh(e,t,i);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),G(Ye,Ye.current),s)break;return null;case 22:return t.lanes=0,Th(e,t,i,t.pendingProps);case 24:Mn(t,Ke,e.memoizedState.cache)}return gn(e,t,i)}function Ch(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps)Je=!0;else{if(!Uo(e,i)&&(t.flags&128)===0)return Je=!1,vg(e,t,i);Je=(e.flags&131072)!==0}else Je=!1,we&&(t.flags&1048576)!==0&&hf(t,Ms,t.index);switch(t.lanes=0,t.tag){case 16:e:{var s=t.pendingProps;if(e=pi(t.elementType),t.type=e,typeof e=="function")Lr(e)?(s=vi(e,s),t.tag=1,t=Oh(null,t,e,s,i)):(t.tag=0,t=No(null,t,e,s,i));else{if(e!=null){var o=e.$$typeof;if(o===N){t.tag=11,t=xh(null,t,e,s,i);break e}else if(o===B){t.tag=14,t=Eh(null,t,e,s,i);break e}}throw t=Ge(e)||e,Error(l(306,t,""))}}return t;case 0:return No(e,t,t.type,t.pendingProps,i);case 1:return s=t.type,o=vi(s,t.pendingProps),Oh(e,t,s,o,i);case 3:e:{if(it(t,t.stateNode.containerInfo),e===null)throw Error(l(387));s=t.pendingProps;var c=t.memoizedState;o=c.element,eo(e,t),$s(t,s,null,i);var h=t.memoizedState;if(s=h.cache,Mn(t,Ke,s),s!==c.cache&&Zr(t,[Ke],i,!0),Hs(),s=h.element,c.isDehydrated)if(c={element:s,isDehydrated:!1,cache:h.cache},t.updateQueue.baseState=c,t.memoizedState=c,t.flags&256){t=jh(e,t,s,i);break e}else if(s!==o){o=Ct(Error(l(424)),t),Cs(o),t=jh(e,t,s,i);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,Be=Lt(e.firstChild),lt=t,we=!0,Rn=null,Bt=!0,i=Tf(t,null,s,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(ui(),s===o){t=gn(e,t,i);break e}ot(e,t,s,i)}t=t.child}return t;case 26:return hl(e,t),e===null?(i=Gd(t.type,null,t.pendingProps,null))?t.memoizedState=i:we||(i=t.type,e=t.pendingProps,s=Ol(he.current).createElement(i),s[at]=t,s[pt]=e,ct(s,i,e),tt(s),t.stateNode=s):t.memoizedState=Gd(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ti(t),e===null&&we&&(s=t.stateNode=Yd(t.type,t.pendingProps,he.current),lt=t,Bt=!0,o=Be,Qn(t.type)?(pc=o,Be=Lt(s.firstChild)):Be=o),ot(e,t,t.pendingProps.children,i),hl(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&we&&((o=s=Be)&&(s=Zg(s,t.type,t.pendingProps,Bt),s!==null?(t.stateNode=s,lt=t,Be=Lt(s.firstChild),Bt=!1,o=!0):o=!1),o||zn(t)),ti(t),o=t.type,c=t.pendingProps,h=e!==null?e.memoizedProps:null,s=c.children,cc(o,c)?s=null:h!==null&&cc(o,h)&&(t.flags|=32),t.memoizedState!==null&&(o=ro(e,t,cg,null,null,i),ra._currentValue=o),hl(e,t),ot(e,t,s,i),t.child;case 6:return e===null&&we&&((e=i=Be)&&(i=Jg(i,t.pendingProps,Bt),i!==null?(t.stateNode=i,lt=t,Be=null,e=!0):e=!1),e||zn(t)),null;case 13:return Rh(e,t,i);case 4:return it(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=yi(t,null,s,i):ot(e,t,s,i),t.child;case 11:return xh(e,t,t.type,t.pendingProps,i);case 7:return ot(e,t,t.pendingProps,i),t.child;case 8:return ot(e,t,t.pendingProps.children,i),t.child;case 12:return ot(e,t,t.pendingProps.children,i),t.child;case 10:return s=t.pendingProps,Mn(t,t.type,s.value),ot(e,t,s.children,i),t.child;case 9:return o=t.type._context,s=t.pendingProps.children,hi(t),o=rt(o),s=s(o),t.flags|=1,ot(e,t,s,i),t.child;case 14:return Eh(e,t,t.type,t.pendingProps,i);case 15:return kh(e,t,t.type,t.pendingProps,i);case 19:return Mh(e,t,i);case 31:return gg(e,t,i);case 22:return Th(e,t,i,t.pendingProps);case 24:return hi(t),s=rt(Ke),e===null?(o=Wr(),o===null&&(o=Ue,c=Jr(),o.pooledCache=c,c.refCount++,c!==null&&(o.pooledCacheLanes|=i),o=c),t.memoizedState={parent:s,cache:o},Pr(t),Mn(t,Ke,o)):((e.lanes&i)!==0&&(eo(e,t),$s(t,null,null,i),Hs()),o=e.memoizedState,c=t.memoizedState,o.parent!==s?(o={parent:s,cache:s},t.memoizedState=o,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=o),Mn(t,Ke,s)):(s=c.cache,Mn(t,Ke,s),s!==o.cache&&Zr(t,[Ke],i,!0))),ot(e,t,t.pendingProps.children,i),t.child;case 29:throw t.pendingProps}throw Error(l(156,t.tag))}function vn(e){e.flags|=4}function Do(e,t,i,s,o){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(o&335544128)===o)if(e.stateNode.complete)e.flags|=8192;else if(rd())e.flags|=8192;else throw mi=Wa,Ir}else e.flags&=-16777217}function Uh(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Fd(t))if(rd())e.flags|=8192;else throw mi=Wa,Ir}function pl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?du():536870912,e.lanes|=t,Pi|=t)}function Ks(e,t){if(!we)switch(e.tailMode){case"hidden":t=e.tail;for(var i=null;t!==null;)t.alternate!==null&&(i=t),t=t.sibling;i===null?e.tail=null:i.sibling=null;break;case"collapsed":i=e.tail;for(var s=null;i!==null;)i.alternate!==null&&(s=i),i=i.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function qe(e){var t=e.alternate!==null&&e.alternate.child===e.child,i=0,s=0;if(t)for(var o=e.child;o!==null;)i|=o.lanes|o.childLanes,s|=o.subtreeFlags&65011712,s|=o.flags&65011712,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)i|=o.lanes|o.childLanes,s|=o.subtreeFlags,s|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=s,e.childLanes=i,t}function bg(e,t,i){var s=t.pendingProps;switch(Vr(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return qe(t),null;case 1:return qe(t),null;case 3:return i=t.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),pn(Ke),Ce(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Hi(t)?vn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Gr())),qe(t),null;case 26:var o=t.type,c=t.memoizedState;return e===null?(vn(t),c!==null?(qe(t),Uh(t,c)):(qe(t),Do(t,o,null,s,i))):c?c!==e.memoizedState?(vn(t),qe(t),Uh(t,c)):(qe(t),t.flags&=-16777217):(e=e.memoizedProps,e!==s&&vn(t),qe(t),Do(t,o,e,s,i)),null;case 27:if(Jt(t),i=he.current,o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&vn(t);else{if(!s){if(t.stateNode===null)throw Error(l(166));return qe(t),null}e=ee.current,Hi(t)?pf(t):(e=Yd(o,s,i),t.stateNode=e,vn(t))}return qe(t),null;case 5:if(Jt(t),o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&vn(t);else{if(!s){if(t.stateNode===null)throw Error(l(166));return qe(t),null}if(c=ee.current,Hi(t))pf(t);else{var h=Ol(he.current);switch(c){case 1:c=h.createElementNS("http://www.w3.org/2000/svg",o);break;case 2:c=h.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;default:switch(o){case"svg":c=h.createElementNS("http://www.w3.org/2000/svg",o);break;case"math":c=h.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;case"script":c=h.createElement("div"),c.innerHTML="<script><\/script>",c=c.removeChild(c.firstChild);break;case"select":c=typeof s.is=="string"?h.createElement("select",{is:s.is}):h.createElement("select"),s.multiple?c.multiple=!0:s.size&&(c.size=s.size);break;default:c=typeof s.is=="string"?h.createElement(o,{is:s.is}):h.createElement(o)}}c[at]=t,c[pt]=s;e:for(h=t.child;h!==null;){if(h.tag===5||h.tag===6)c.appendChild(h.stateNode);else if(h.tag!==4&&h.tag!==27&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===t)break e;for(;h.sibling===null;){if(h.return===null||h.return===t)break e;h=h.return}h.sibling.return=h.return,h=h.sibling}t.stateNode=c;e:switch(ct(c,o,s),o){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&vn(t)}}return qe(t),Do(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,i),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&vn(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(l(166));if(e=he.current,Hi(t)){if(e=t.stateNode,i=t.memoizedProps,s=null,o=lt,o!==null)switch(o.tag){case 27:case 5:s=o.memoizedProps}e[at]=t,e=!!(e.nodeValue===i||s!==null&&s.suppressHydrationWarning===!0||Rd(e.nodeValue,i)),e||zn(t,!0)}else e=Ol(e).createTextNode(s),e[at]=t,t.stateNode=e}return qe(t),null;case 31:if(i=t.memoizedState,e===null||e.memoizedState!==null){if(s=Hi(t),i!==null){if(e===null){if(!s)throw Error(l(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(557));e[at]=t}else ui(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;qe(t),e=!1}else i=Gr(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return t.flags&256?(_t(t),t):(_t(t),null);if((t.flags&128)!==0)throw Error(l(558))}return qe(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(o=Hi(t),s!==null&&s.dehydrated!==null){if(e===null){if(!o)throw Error(l(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(l(317));o[at]=t}else ui(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;qe(t),o=!1}else o=Gr(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=o),o=!0;if(!o)return t.flags&256?(_t(t),t):(_t(t),null)}return _t(t),(t.flags&128)!==0?(t.lanes=i,t):(i=s!==null,e=e!==null&&e.memoizedState!==null,i&&(s=t.child,o=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(o=s.alternate.memoizedState.cachePool.pool),c=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(c=s.memoizedState.cachePool.pool),c!==o&&(s.flags|=2048)),i!==e&&i&&(t.child.flags|=8192),pl(t,t.updateQueue),qe(t),null);case 4:return Ce(),e===null&&sc(t.stateNode.containerInfo),qe(t),null;case 10:return pn(t.type),qe(t),null;case 19:if(q(Ye),s=t.memoizedState,s===null)return qe(t),null;if(o=(t.flags&128)!==0,c=s.rendering,c===null)if(o)Ks(s,!1);else{if($e!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(c=tl(e),c!==null){for(t.flags|=128,Ks(s,!1),e=c.updateQueue,t.updateQueue=e,pl(t,e),t.subtreeFlags=0,e=i,i=t.child;i!==null;)cf(i,e),i=i.sibling;return G(Ye,Ye.current&1|2),we&&hn(t,s.treeForkCount),t.child}e=e.sibling}s.tail!==null&&Qe()>bl&&(t.flags|=128,o=!0,Ks(s,!1),t.lanes=4194304)}else{if(!o)if(e=tl(c),e!==null){if(t.flags|=128,o=!0,e=e.updateQueue,t.updateQueue=e,pl(t,e),Ks(s,!0),s.tail===null&&s.tailMode==="hidden"&&!c.alternate&&!we)return qe(t),null}else 2*Qe()-s.renderingStartTime>bl&&i!==536870912&&(t.flags|=128,o=!0,Ks(s,!1),t.lanes=4194304);s.isBackwards?(c.sibling=t.child,t.child=c):(e=s.last,e!==null?e.sibling=c:t.child=c,s.last=c)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=Qe(),e.sibling=null,i=Ye.current,G(Ye,o?i&1|2:i&1),we&&hn(t,s.treeForkCount),e):(qe(t),null);case 22:case 23:return _t(t),so(),s=t.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(t.flags|=8192):s&&(t.flags|=8192),s?(i&536870912)!==0&&(t.flags&128)===0&&(qe(t),t.subtreeFlags&6&&(t.flags|=8192)):qe(t),i=t.updateQueue,i!==null&&pl(t,i.retryQueue),i=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),s=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),s!==i&&(t.flags|=2048),e!==null&&q(di),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),pn(Ke),qe(t),null;case 25:return null;case 30:return null}throw Error(l(156,t.tag))}function wg(e,t){switch(Vr(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return pn(Ke),Ce(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Jt(t),null;case 31:if(t.memoizedState!==null){if(_t(t),t.alternate===null)throw Error(l(340));ui()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(_t(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(l(340));ui()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return q(Ye),null;case 4:return Ce(),null;case 10:return pn(t.type),null;case 22:case 23:return _t(t),so(),e!==null&&q(di),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return pn(Ke),null;case 25:return null;default:return null}}function Dh(e,t){switch(Vr(t),t.tag){case 3:pn(Ke),Ce();break;case 26:case 27:case 5:Jt(t);break;case 4:Ce();break;case 31:t.memoizedState!==null&&_t(t);break;case 13:_t(t);break;case 19:q(Ye);break;case 10:pn(t.type);break;case 22:case 23:_t(t),so(),e!==null&&q(di);break;case 24:pn(Ke)}}function Zs(e,t){try{var i=t.updateQueue,s=i!==null?i.lastEffect:null;if(s!==null){var o=s.next;i=o;do{if((i.tag&e)===e){s=void 0;var c=i.create,h=i.inst;s=c(),h.destroy=s}i=i.next}while(i!==o)}}catch(p){Oe(t,t.return,p)}}function Ln(e,t,i){try{var s=t.updateQueue,o=s!==null?s.lastEffect:null;if(o!==null){var c=o.next;s=c;do{if((s.tag&e)===e){var h=s.inst,p=h.destroy;if(p!==void 0){h.destroy=void 0,o=t;var v=i,_=p;try{_()}catch(M){Oe(o,v,M)}}}s=s.next}while(s!==c)}}catch(M){Oe(t,t.return,M)}}function Bh(e){var t=e.updateQueue;if(t!==null){var i=e.stateNode;try{Af(t,i)}catch(s){Oe(e,e.return,s)}}}function qh(e,t,i){i.props=vi(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(s){Oe(e,t,s)}}function Js(e,t){try{var i=e.ref;if(i!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:s=e.stateNode;break;default:s=e.stateNode}typeof i=="function"?e.refCleanup=i(s):i.current=s}}catch(o){Oe(e,t,o)}}function Pt(e,t){var i=e.ref,s=e.refCleanup;if(i!==null)if(typeof s=="function")try{s()}catch(o){Oe(e,t,o)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(o){Oe(e,t,o)}else i.current=null}function Lh(e){var t=e.type,i=e.memoizedProps,s=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":i.autoFocus&&s.focus();break e;case"img":i.src?s.src=i.src:i.srcSet&&(s.srcset=i.srcSet)}}catch(o){Oe(e,e.return,o)}}function Bo(e,t,i){try{var s=e.stateNode;Yg(s,e.type,i,t),s[pt]=t}catch(o){Oe(e,e.return,o)}}function Hh(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Qn(e.type)||e.tag===4}function qo(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Hh(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&&Qn(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 Lo(e,t,i){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(e,t):(t=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,t.appendChild(e),i=i._reactRootContainer,i!=null||t.onclick!==null||(t.onclick=cn));else if(s!==4&&(s===27&&Qn(e.type)&&(i=e.stateNode,t=null),e=e.child,e!==null))for(Lo(e,t,i),e=e.sibling;e!==null;)Lo(e,t,i),e=e.sibling}function ml(e,t,i){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?i.insertBefore(e,t):i.appendChild(e);else if(s!==4&&(s===27&&Qn(e.type)&&(i=e.stateNode),e=e.child,e!==null))for(ml(e,t,i),e=e.sibling;e!==null;)ml(e,t,i),e=e.sibling}function $h(e){var t=e.stateNode,i=e.memoizedProps;try{for(var s=e.type,o=t.attributes;o.length;)t.removeAttributeNode(o[0]);ct(t,s,i),t[at]=e,t[pt]=i}catch(c){Oe(e,e.return,c)}}var bn=!1,Fe=!1,Ho=!1,Yh=typeof WeakSet=="function"?WeakSet:Set,nt=null;function Sg(e,t){if(e=e.containerInfo,rc=Dl,e=Pu(e),zr(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var s=i.getSelection&&i.getSelection();if(s&&s.rangeCount!==0){i=s.anchorNode;var o=s.anchorOffset,c=s.focusNode;s=s.focusOffset;try{i.nodeType,c.nodeType}catch{i=null;break e}var h=0,p=-1,v=-1,_=0,M=0,D=e,A=null;t:for(;;){for(var O;D!==i||o!==0&&D.nodeType!==3||(p=h+o),D!==c||s!==0&&D.nodeType!==3||(v=h+s),D.nodeType===3&&(h+=D.nodeValue.length),(O=D.firstChild)!==null;)A=D,D=O;for(;;){if(D===e)break t;if(A===i&&++_===o&&(p=h),A===c&&++M===s&&(v=h),(O=D.nextSibling)!==null)break;D=A,A=D.parentNode}D=O}i=p===-1||v===-1?null:{start:p,end:v}}else i=null}i=i||{start:0,end:0}}else i=null;for(oc={focusedElem:e,selectionRange:i},Dl=!1,nt=t;nt!==null;)if(t=nt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,nt=e;else for(;nt!==null;){switch(t=nt,c=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(i=0;i<e.length;i++)o=e[i],o.ref.impl=o.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&c!==null){e=void 0,i=t,o=c.memoizedProps,c=c.memoizedState,s=i.stateNode;try{var I=vi(i.type,o);e=s.getSnapshotBeforeUpdate(I,c),s.__reactInternalSnapshotBeforeUpdate=e}catch(le){Oe(i,i.return,le)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,i=e.nodeType,i===9)fc(e);else if(i===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":fc(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(l(163))}if(e=t.sibling,e!==null){e.return=t.return,nt=e;break}nt=t.return}}function Vh(e,t,i){var s=i.flags;switch(i.tag){case 0:case 11:case 15:Sn(e,i),s&4&&Zs(5,i);break;case 1:if(Sn(e,i),s&4)if(e=i.stateNode,t===null)try{e.componentDidMount()}catch(h){Oe(i,i.return,h)}else{var o=vi(i.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(o,t,e.__reactInternalSnapshotBeforeUpdate)}catch(h){Oe(i,i.return,h)}}s&64&&Bh(i),s&512&&Js(i,i.return);break;case 3:if(Sn(e,i),s&64&&(e=i.updateQueue,e!==null)){if(t=null,i.child!==null)switch(i.child.tag){case 27:case 5:t=i.child.stateNode;break;case 1:t=i.child.stateNode}try{Af(e,t)}catch(h){Oe(i,i.return,h)}}break;case 27:t===null&&s&4&&$h(i);case 26:case 5:Sn(e,i),t===null&&s&4&&Lh(i),s&512&&Js(i,i.return);break;case 12:Sn(e,i);break;case 31:Sn(e,i),s&4&&Qh(e,i);break;case 13:Sn(e,i),s&4&&Kh(e,i),s&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=jg.bind(null,i),Fg(e,i))));break;case 22:if(s=i.memoizedState!==null||bn,!s){t=t!==null&&t.memoizedState!==null||Fe,o=bn;var c=Fe;bn=s,(Fe=t)&&!c?xn(e,i,(i.subtreeFlags&8772)!==0):Sn(e,i),bn=o,Fe=c}break;case 30:break;default:Sn(e,i)}}function Xh(e){var t=e.alternate;t!==null&&(e.alternate=null,Xh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&mr(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 Le=null,yt=!1;function wn(e,t,i){for(i=i.child;i!==null;)Gh(e,t,i),i=i.sibling}function Gh(e,t,i){if(St&&typeof St.onCommitFiberUnmount=="function")try{St.onCommitFiberUnmount(bs,i)}catch{}switch(i.tag){case 26:Fe||Pt(i,t),wn(e,t,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:Fe||Pt(i,t);var s=Le,o=yt;Qn(i.type)&&(Le=i.stateNode,yt=!1),wn(e,t,i),sa(i.stateNode),Le=s,yt=o;break;case 5:Fe||Pt(i,t);case 6:if(s=Le,o=yt,Le=null,wn(e,t,i),Le=s,yt=o,Le!==null)if(yt)try{(Le.nodeType===9?Le.body:Le.nodeName==="HTML"?Le.ownerDocument.body:Le).removeChild(i.stateNode)}catch(c){Oe(i,t,c)}else try{Le.removeChild(i.stateNode)}catch(c){Oe(i,t,c)}break;case 18:Le!==null&&(yt?(e=Le,Bd(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),rs(e)):Bd(Le,i.stateNode));break;case 4:s=Le,o=yt,Le=i.stateNode.containerInfo,yt=!0,wn(e,t,i),Le=s,yt=o;break;case 0:case 11:case 14:case 15:Ln(2,i,t),Fe||Ln(4,i,t),wn(e,t,i);break;case 1:Fe||(Pt(i,t),s=i.stateNode,typeof s.componentWillUnmount=="function"&&qh(i,t,s)),wn(e,t,i);break;case 21:wn(e,t,i);break;case 22:Fe=(s=Fe)||i.memoizedState!==null,wn(e,t,i),Fe=s;break;default:wn(e,t,i)}}function Qh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{rs(e)}catch(i){Oe(t,t.return,i)}}}function Kh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{rs(e)}catch(i){Oe(t,t.return,i)}}function xg(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Yh),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Yh),t;default:throw Error(l(435,e.tag))}}function yl(e,t){var i=xg(e);t.forEach(function(s){if(!i.has(s)){i.add(s);var o=Rg.bind(null,e,s);s.then(o,o)}})}function gt(e,t){var i=t.deletions;if(i!==null)for(var s=0;s<i.length;s++){var o=i[s],c=e,h=t,p=h;e:for(;p!==null;){switch(p.tag){case 27:if(Qn(p.type)){Le=p.stateNode,yt=!1;break e}break;case 5:Le=p.stateNode,yt=!1;break e;case 3:case 4:Le=p.stateNode.containerInfo,yt=!0;break e}p=p.return}if(Le===null)throw Error(l(160));Gh(c,h,o),Le=null,yt=!1,c=o.alternate,c!==null&&(c.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Zh(t,e),t=t.sibling}var Vt=null;function Zh(e,t){var i=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:gt(t,e),vt(e),s&4&&(Ln(3,e,e.return),Zs(3,e),Ln(5,e,e.return));break;case 1:gt(t,e),vt(e),s&512&&(Fe||i===null||Pt(i,i.return)),s&64&&bn&&(e=e.updateQueue,e!==null&&(s=e.callbacks,s!==null&&(i=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=i===null?s:i.concat(s))));break;case 26:var o=Vt;if(gt(t,e),vt(e),s&512&&(Fe||i===null||Pt(i,i.return)),s&4){var c=i!==null?i.memoizedState:null;if(s=e.memoizedState,i===null)if(s===null)if(e.stateNode===null){e:{s=e.type,i=e.memoizedProps,o=o.ownerDocument||o;t:switch(s){case"title":c=o.getElementsByTagName("title")[0],(!c||c[xs]||c[at]||c.namespaceURI==="http://www.w3.org/2000/svg"||c.hasAttribute("itemprop"))&&(c=o.createElement(s),o.head.insertBefore(c,o.querySelector("head > title"))),ct(c,s,i),c[at]=e,tt(c),s=c;break e;case"link":var h=Zd("link","href",o).get(s+(i.href||""));if(h){for(var p=0;p<h.length;p++)if(c=h[p],c.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&c.getAttribute("rel")===(i.rel==null?null:i.rel)&&c.getAttribute("title")===(i.title==null?null:i.title)&&c.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){h.splice(p,1);break t}}c=o.createElement(s),ct(c,s,i),o.head.appendChild(c);break;case"meta":if(h=Zd("meta","content",o).get(s+(i.content||""))){for(p=0;p<h.length;p++)if(c=h[p],c.getAttribute("content")===(i.content==null?null:""+i.content)&&c.getAttribute("name")===(i.name==null?null:i.name)&&c.getAttribute("property")===(i.property==null?null:i.property)&&c.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&c.getAttribute("charset")===(i.charSet==null?null:i.charSet)){h.splice(p,1);break t}}c=o.createElement(s),ct(c,s,i),o.head.appendChild(c);break;default:throw Error(l(468,s))}c[at]=e,tt(c),s=c}e.stateNode=s}else Jd(o,e.type,e.stateNode);else e.stateNode=Kd(o,s,e.memoizedProps);else c!==s?(c===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):c.count--,s===null?Jd(o,e.type,e.stateNode):Kd(o,s,e.memoizedProps)):s===null&&e.stateNode!==null&&Bo(e,e.memoizedProps,i.memoizedProps)}break;case 27:gt(t,e),vt(e),s&512&&(Fe||i===null||Pt(i,i.return)),i!==null&&s&4&&Bo(e,e.memoizedProps,i.memoizedProps);break;case 5:if(gt(t,e),vt(e),s&512&&(Fe||i===null||Pt(i,i.return)),e.flags&32){o=e.stateNode;try{ji(o,"")}catch(I){Oe(e,e.return,I)}}s&4&&e.stateNode!=null&&(o=e.memoizedProps,Bo(e,o,i!==null?i.memoizedProps:o)),s&1024&&(Ho=!0);break;case 6:if(gt(t,e),vt(e),s&4){if(e.stateNode===null)throw Error(l(162));s=e.memoizedProps,i=e.stateNode;try{i.nodeValue=s}catch(I){Oe(e,e.return,I)}}break;case 3:if(zl=null,o=Vt,Vt=jl(t.containerInfo),gt(t,e),Vt=o,vt(e),s&4&&i!==null&&i.memoizedState.isDehydrated)try{rs(t.containerInfo)}catch(I){Oe(e,e.return,I)}Ho&&(Ho=!1,Jh(e));break;case 4:s=Vt,Vt=jl(e.stateNode.containerInfo),gt(t,e),vt(e),Vt=s;break;case 12:gt(t,e),vt(e);break;case 31:gt(t,e),vt(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,yl(e,s)));break;case 13:gt(t,e),vt(e),e.child.flags&8192&&e.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(vl=Qe()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,yl(e,s)));break;case 22:o=e.memoizedState!==null;var v=i!==null&&i.memoizedState!==null,_=bn,M=Fe;if(bn=_||o,Fe=M||v,gt(t,e),Fe=M,bn=_,vt(e),s&8192)e:for(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,o&&(i===null||v||bn||Fe||bi(e)),i=null,t=e;;){if(t.tag===5||t.tag===26){if(i===null){v=i=t;try{if(c=v.stateNode,o)h=c.style,typeof h.setProperty=="function"?h.setProperty("display","none","important"):h.display="none";else{p=v.stateNode;var D=v.memoizedProps.style,A=D!=null&&D.hasOwnProperty("display")?D.display:null;p.style.display=A==null||typeof A=="boolean"?"":(""+A).trim()}}catch(I){Oe(v,v.return,I)}}}else if(t.tag===6){if(i===null){v=t;try{v.stateNode.nodeValue=o?"":v.memoizedProps}catch(I){Oe(v,v.return,I)}}}else if(t.tag===18){if(i===null){v=t;try{var O=v.stateNode;o?qd(O,!0):qd(v.stateNode,!1)}catch(I){Oe(v,v.return,I)}}}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;i===t&&(i=null),t=t.return}i===t&&(i=null),t.sibling.return=t.return,t=t.sibling}s&4&&(s=e.updateQueue,s!==null&&(i=s.retryQueue,i!==null&&(s.retryQueue=null,yl(e,i))));break;case 19:gt(t,e),vt(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,yl(e,s)));break;case 30:break;case 21:break;default:gt(t,e),vt(e)}}function vt(e){var t=e.flags;if(t&2){try{for(var i,s=e.return;s!==null;){if(Hh(s)){i=s;break}s=s.return}if(i==null)throw Error(l(160));switch(i.tag){case 27:var o=i.stateNode,c=qo(e);ml(e,c,o);break;case 5:var h=i.stateNode;i.flags&32&&(ji(h,""),i.flags&=-33);var p=qo(e);ml(e,p,h);break;case 3:case 4:var v=i.stateNode.containerInfo,_=qo(e);Lo(e,_,v);break;default:throw Error(l(161))}}catch(M){Oe(e,e.return,M)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Jh(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Jh(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Sn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Vh(e,t.alternate,t),t=t.sibling}function bi(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ln(4,t,t.return),bi(t);break;case 1:Pt(t,t.return);var i=t.stateNode;typeof i.componentWillUnmount=="function"&&qh(t,t.return,i),bi(t);break;case 27:sa(t.stateNode);case 26:case 5:Pt(t,t.return),bi(t);break;case 22:t.memoizedState===null&&bi(t);break;case 30:bi(t);break;default:bi(t)}e=e.sibling}}function xn(e,t,i){for(i=i&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var s=t.alternate,o=e,c=t,h=c.flags;switch(c.tag){case 0:case 11:case 15:xn(o,c,i),Zs(4,c);break;case 1:if(xn(o,c,i),s=c,o=s.stateNode,typeof o.componentDidMount=="function")try{o.componentDidMount()}catch(_){Oe(s,s.return,_)}if(s=c,o=s.updateQueue,o!==null){var p=s.stateNode;try{var v=o.shared.hiddenCallbacks;if(v!==null)for(o.shared.hiddenCallbacks=null,o=0;o<v.length;o++)_f(v[o],p)}catch(_){Oe(s,s.return,_)}}i&&h&64&&Bh(c),Js(c,c.return);break;case 27:$h(c);case 26:case 5:xn(o,c,i),i&&s===null&&h&4&&Lh(c),Js(c,c.return);break;case 12:xn(o,c,i);break;case 31:xn(o,c,i),i&&h&4&&Qh(o,c);break;case 13:xn(o,c,i),i&&h&4&&Kh(o,c);break;case 22:c.memoizedState===null&&xn(o,c,i),Js(c,c.return);break;case 30:break;default:xn(o,c,i)}t=t.sibling}}function $o(e,t){var i=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==i&&(e!=null&&e.refCount++,i!=null&&Us(i))}function Yo(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Us(e))}function Xt(e,t,i,s){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Fh(e,t,i,s),t=t.sibling}function Fh(e,t,i,s){var o=t.flags;switch(t.tag){case 0:case 11:case 15:Xt(e,t,i,s),o&2048&&Zs(9,t);break;case 1:Xt(e,t,i,s);break;case 3:Xt(e,t,i,s),o&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Us(e)));break;case 12:if(o&2048){Xt(e,t,i,s),e=t.stateNode;try{var c=t.memoizedProps,h=c.id,p=c.onPostCommit;typeof p=="function"&&p(h,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(v){Oe(t,t.return,v)}}else Xt(e,t,i,s);break;case 31:Xt(e,t,i,s);break;case 13:Xt(e,t,i,s);break;case 23:break;case 22:c=t.stateNode,h=t.alternate,t.memoizedState!==null?c._visibility&2?Xt(e,t,i,s):Fs(e,t):c._visibility&2?Xt(e,t,i,s):(c._visibility|=2,Fi(e,t,i,s,(t.subtreeFlags&10256)!==0||!1)),o&2048&&$o(h,t);break;case 24:Xt(e,t,i,s),o&2048&&Yo(t.alternate,t);break;default:Xt(e,t,i,s)}}function Fi(e,t,i,s,o){for(o=o&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var c=e,h=t,p=i,v=s,_=h.flags;switch(h.tag){case 0:case 11:case 15:Fi(c,h,p,v,o),Zs(8,h);break;case 23:break;case 22:var M=h.stateNode;h.memoizedState!==null?M._visibility&2?Fi(c,h,p,v,o):Fs(c,h):(M._visibility|=2,Fi(c,h,p,v,o)),o&&_&2048&&$o(h.alternate,h);break;case 24:Fi(c,h,p,v,o),o&&_&2048&&Yo(h.alternate,h);break;default:Fi(c,h,p,v,o)}t=t.sibling}}function Fs(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var i=e,s=t,o=s.flags;switch(s.tag){case 22:Fs(i,s),o&2048&&$o(s.alternate,s);break;case 24:Fs(i,s),o&2048&&Yo(s.alternate,s);break;default:Fs(i,s)}t=t.sibling}}var Ws=8192;function Wi(e,t,i){if(e.subtreeFlags&Ws)for(e=e.child;e!==null;)Wh(e,t,i),e=e.sibling}function Wh(e,t,i){switch(e.tag){case 26:Wi(e,t,i),e.flags&Ws&&e.memoizedState!==null&&ov(i,Vt,e.memoizedState,e.memoizedProps);break;case 5:Wi(e,t,i);break;case 3:case 4:var s=Vt;Vt=jl(e.stateNode.containerInfo),Wi(e,t,i),Vt=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=Ws,Ws=16777216,Wi(e,t,i),Ws=s):Wi(e,t,i));break;default:Wi(e,t,i)}}function Ih(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 Is(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var s=t[i];nt=s,ed(s,e)}Ih(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ph(e),e=e.sibling}function Ph(e){switch(e.tag){case 0:case 11:case 15:Is(e),e.flags&2048&&Ln(9,e,e.return);break;case 3:Is(e);break;case 12:Is(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,gl(e)):Is(e);break;default:Is(e)}}function gl(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var s=t[i];nt=s,ed(s,e)}Ih(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ln(8,t,t.return),gl(t);break;case 22:i=t.stateNode,i._visibility&2&&(i._visibility&=-3,gl(t));break;default:gl(t)}e=e.sibling}}function ed(e,t){for(;nt!==null;){var i=nt;switch(i.tag){case 0:case 11:case 15:Ln(8,i,t);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var s=i.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:Us(i.memoizedState.cache)}if(s=i.child,s!==null)s.return=i,nt=s;else e:for(i=e;nt!==null;){s=nt;var o=s.sibling,c=s.return;if(Xh(s),s===i){nt=null;break e}if(o!==null){o.return=c,nt=o;break e}nt=c}}}var Eg={getCacheForType:function(e){var t=rt(Ke),i=t.data.get(e);return i===void 0&&(i=e(),t.data.set(e,i)),i},cacheSignal:function(){return rt(Ke).controller.signal}},kg=typeof WeakMap=="function"?WeakMap:Map,Ae=0,Ue=null,ye=null,ve=0,Ne=0,At=null,Hn=!1,Ii=!1,Vo=!1,En=0,$e=0,$n=0,wi=0,Xo=0,Nt=0,Pi=0,Ps=null,bt=null,Go=!1,vl=0,td=0,bl=1/0,wl=null,Yn=null,Pe=0,Vn=null,es=null,kn=0,Qo=0,Ko=null,nd=null,ea=0,Zo=null;function Ot(){return(Ae&2)!==0&&ve!==0?ve&-ve:k.T!==null?ec():gu()}function id(){if(Nt===0)if((ve&536870912)===0||we){var e=Na;Na<<=1,(Na&3932160)===0&&(Na=262144),Nt=e}else Nt=536870912;return e=Tt.current,e!==null&&(e.flags|=32),Nt}function wt(e,t,i){(e===Ue&&(Ne===2||Ne===9)||e.cancelPendingCommit!==null)&&(ts(e,0),Xn(e,ve,Nt,!1)),Ss(e,i),((Ae&2)===0||e!==Ue)&&(e===Ue&&((Ae&2)===0&&(wi|=i),$e===4&&Xn(e,ve,Nt,!1)),en(e))}function sd(e,t,i){if((Ae&6)!==0)throw Error(l(327));var s=!i&&(t&127)===0&&(t&e.expiredLanes)===0||ws(e,t),o=s?Ag(e,t):Fo(e,t,!0),c=s;do{if(o===0){Ii&&!s&&Xn(e,t,0,!1);break}else{if(i=e.current.alternate,c&&!Tg(i)){o=Fo(e,t,!1),c=!1;continue}if(o===2){if(c=t,e.errorRecoveryDisabledLanes&c)var h=0;else h=e.pendingLanes&-536870913,h=h!==0?h:h&536870912?536870912:0;if(h!==0){t=h;e:{var p=e;o=Ps;var v=p.current.memoizedState.isDehydrated;if(v&&(ts(p,h).flags|=256),h=Fo(p,h,!1),h!==2){if(Vo&&!v){p.errorRecoveryDisabledLanes|=c,wi|=c,o=4;break e}c=bt,bt=o,c!==null&&(bt===null?bt=c:bt.push.apply(bt,c))}o=h}if(c=!1,o!==2)continue}}if(o===1){ts(e,0),Xn(e,t,0,!0);break}e:{switch(s=e,c=o,c){case 0:case 1:throw Error(l(345));case 4:if((t&4194048)!==t)break;case 6:Xn(s,t,Nt,!Hn);break e;case 2:bt=null;break;case 3:case 5:break;default:throw Error(l(329))}if((t&62914560)===t&&(o=vl+300-Qe(),10<o)){if(Xn(s,t,Nt,!Hn),ja(s,0,!0)!==0)break e;kn=t,s.timeoutHandle=Ud(ad.bind(null,s,i,bt,wl,Go,t,Nt,wi,Pi,Hn,c,"Throttled",-0,0),o);break e}ad(s,i,bt,wl,Go,t,Nt,wi,Pi,Hn,c,null,-0,0)}}break}while(!0);en(e)}function ad(e,t,i,s,o,c,h,p,v,_,M,D,A,O){if(e.timeoutHandle=-1,D=t.subtreeFlags,D&8192||(D&16785408)===16785408){D={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:cn},Wh(t,c,D);var I=(c&62914560)===c?vl-Qe():(c&4194048)===c?td-Qe():0;if(I=cv(D,I),I!==null){kn=c,e.cancelPendingCommit=I(dd.bind(null,e,t,c,i,s,o,h,p,v,M,D,null,A,O)),Xn(e,c,h,!_);return}}dd(e,t,c,i,s,o,h,p,v)}function Tg(e){for(var t=e;;){var i=t.tag;if((i===0||i===11||i===15)&&t.flags&16384&&(i=t.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var s=0;s<i.length;s++){var o=i[s],c=o.getSnapshot;o=o.value;try{if(!Et(c(),o))return!1}catch{return!1}}if(i=t.child,t.subtreeFlags&16384&&i!==null)i.return=t,t=i;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Xn(e,t,i,s){t&=~Xo,t&=~wi,e.suspendedLanes|=t,e.pingedLanes&=~t,s&&(e.warmLanes|=t),s=e.expirationTimes;for(var o=t;0<o;){var c=31-xt(o),h=1<<c;s[c]=-1,o&=~h}i!==0&&pu(e,i,t)}function Sl(){return(Ae&6)===0?(ta(0),!1):!0}function Jo(){if(ye!==null){if(Ne===0)var e=ye.return;else e=ye,dn=fi=null,uo(e),Gi=null,Bs=0,e=ye;for(;e!==null;)Dh(e.alternate,e),e=e.return;ye=null}}function ts(e,t){var i=e.timeoutHandle;i!==-1&&(e.timeoutHandle=-1,Gg(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),kn=0,Jo(),Ue=e,ye=i=fn(e.current,null),ve=t,Ne=0,At=null,Hn=!1,Ii=ws(e,t),Vo=!1,Pi=Nt=Xo=wi=$n=$e=0,bt=Ps=null,Go=!1,(t&8)!==0&&(t|=t&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=t;0<s;){var o=31-xt(s),c=1<<o;t|=e[o],s&=~c}return En=t,Ya(),i}function ld(e,t){fe=null,k.H=Gs,t===Xi||t===Fa?(t=xf(),Ne=3):t===Ir?(t=xf(),Ne=4):Ne=t===Ao?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,At=t,ye===null&&($e=1,ul(e,Ct(t,e.current)))}function rd(){var e=Tt.current;return e===null?!0:(ve&4194048)===ve?qt===null:(ve&62914560)===ve||(ve&536870912)!==0?e===qt:!1}function od(){var e=k.H;return k.H=Gs,e===null?Gs:e}function cd(){var e=k.A;return k.A=Eg,e}function xl(){$e=4,Hn||(ve&4194048)!==ve&&Tt.current!==null||(Ii=!0),($n&134217727)===0&&(wi&134217727)===0||Ue===null||Xn(Ue,ve,Nt,!1)}function Fo(e,t,i){var s=Ae;Ae|=2;var o=od(),c=cd();(Ue!==e||ve!==t)&&(wl=null,ts(e,t)),t=!1;var h=$e;e:do try{if(Ne!==0&&ye!==null){var p=ye,v=At;switch(Ne){case 8:Jo(),h=6;break e;case 3:case 2:case 9:case 6:Tt.current===null&&(t=!0);var _=Ne;if(Ne=0,At=null,ns(e,p,v,_),i&&Ii){h=0;break e}break;default:_=Ne,Ne=0,At=null,ns(e,p,v,_)}}_g(),h=$e;break}catch(M){ld(e,M)}while(!0);return t&&e.shellSuspendCounter++,dn=fi=null,Ae=s,k.H=o,k.A=c,ye===null&&(Ue=null,ve=0,Ya()),h}function _g(){for(;ye!==null;)ud(ye)}function Ag(e,t){var i=Ae;Ae|=2;var s=od(),o=cd();Ue!==e||ve!==t?(wl=null,bl=Qe()+500,ts(e,t)):Ii=ws(e,t);e:do try{if(Ne!==0&&ye!==null){t=ye;var c=At;t:switch(Ne){case 1:Ne=0,At=null,ns(e,t,c,1);break;case 2:case 9:if(wf(c)){Ne=0,At=null,fd(t);break}t=function(){Ne!==2&&Ne!==9||Ue!==e||(Ne=7),en(e)},c.then(t,t);break e;case 3:Ne=7;break e;case 4:Ne=5;break e;case 7:wf(c)?(Ne=0,At=null,fd(t)):(Ne=0,At=null,ns(e,t,c,7));break;case 5:var h=null;switch(ye.tag){case 26:h=ye.memoizedState;case 5:case 27:var p=ye;if(h?Fd(h):p.stateNode.complete){Ne=0,At=null;var v=p.sibling;if(v!==null)ye=v;else{var _=p.return;_!==null?(ye=_,El(_)):ye=null}break t}}Ne=0,At=null,ns(e,t,c,5);break;case 6:Ne=0,At=null,ns(e,t,c,6);break;case 8:Jo(),$e=6;break e;default:throw Error(l(462))}}Ng();break}catch(M){ld(e,M)}while(!0);return dn=fi=null,k.H=s,k.A=o,Ae=i,ye!==null?0:(Ue=null,ve=0,Ya(),$e)}function Ng(){for(;ye!==null&&!me();)ud(ye)}function ud(e){var t=Ch(e.alternate,e,En);e.memoizedProps=e.pendingProps,t===null?El(e):ye=t}function fd(e){var t=e,i=t.alternate;switch(t.tag){case 15:case 0:t=Nh(i,t,t.pendingProps,t.type,void 0,ve);break;case 11:t=Nh(i,t,t.pendingProps,t.type.render,t.ref,ve);break;case 5:uo(t);default:Dh(i,t),t=ye=cf(t,En),t=Ch(i,t,En)}e.memoizedProps=e.pendingProps,t===null?El(e):ye=t}function ns(e,t,i,s){dn=fi=null,uo(t),Gi=null,Bs=0;var o=t.return;try{if(yg(e,o,t,i,ve)){$e=1,ul(e,Ct(i,e.current)),ye=null;return}}catch(c){if(o!==null)throw ye=o,c;$e=1,ul(e,Ct(i,e.current)),ye=null;return}t.flags&32768?(we||s===1?e=!0:Ii||(ve&536870912)!==0?e=!1:(Hn=e=!0,(s===2||s===9||s===3||s===6)&&(s=Tt.current,s!==null&&s.tag===13&&(s.flags|=16384))),hd(t,e)):El(t)}function El(e){var t=e;do{if((t.flags&32768)!==0){hd(t,Hn);return}e=t.return;var i=bg(t.alternate,t,En);if(i!==null){ye=i;return}if(t=t.sibling,t!==null){ye=t;return}ye=t=e}while(t!==null);$e===0&&($e=5)}function hd(e,t){do{var i=wg(e.alternate,e);if(i!==null){i.flags&=32767,ye=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!t&&(e=e.sibling,e!==null)){ye=e;return}ye=e=i}while(e!==null);$e=6,ye=null}function dd(e,t,i,s,o,c,h,p,v){e.cancelPendingCommit=null;do kl();while(Pe!==0);if((Ae&6)!==0)throw Error(l(327));if(t!==null){if(t===e.current)throw Error(l(177));if(c=t.lanes|t.childLanes,c|=Br,ry(e,i,c,h,p,v),e===Ue&&(ye=Ue=null,ve=0),es=t,Vn=e,kn=i,Qo=c,Ko=o,nd=s,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,zg(_a,function(){return vd(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||s){s=k.T,k.T=null,o=$.p,$.p=2,h=Ae,Ae|=4;try{Sg(e,t,i)}finally{Ae=h,$.p=o,k.T=s}}Pe=1,pd(),md(),yd()}}function pd(){if(Pe===1){Pe=0;var e=Vn,t=es,i=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||i){i=k.T,k.T=null;var s=$.p;$.p=2;var o=Ae;Ae|=4;try{Zh(t,e);var c=oc,h=Pu(e.containerInfo),p=c.focusedElem,v=c.selectionRange;if(h!==p&&p&&p.ownerDocument&&Iu(p.ownerDocument.documentElement,p)){if(v!==null&&zr(p)){var _=v.start,M=v.end;if(M===void 0&&(M=_),"selectionStart"in p)p.selectionStart=_,p.selectionEnd=Math.min(M,p.value.length);else{var D=p.ownerDocument||document,A=D&&D.defaultView||window;if(A.getSelection){var O=A.getSelection(),I=p.textContent.length,le=Math.min(v.start,I),Me=v.end===void 0?le:Math.min(v.end,I);!O.extend&&le>Me&&(h=Me,Me=le,le=h);var E=Wu(p,le),x=Wu(p,Me);if(E&&x&&(O.rangeCount!==1||O.anchorNode!==E.node||O.anchorOffset!==E.offset||O.focusNode!==x.node||O.focusOffset!==x.offset)){var T=D.createRange();T.setStart(E.node,E.offset),O.removeAllRanges(),le>Me?(O.addRange(T),O.extend(x.node,x.offset)):(T.setEnd(x.node,x.offset),O.addRange(T))}}}}for(D=[],O=p;O=O.parentNode;)O.nodeType===1&&D.push({element:O,left:O.scrollLeft,top:O.scrollTop});for(typeof p.focus=="function"&&p.focus(),p=0;p<D.length;p++){var U=D[p];U.element.scrollLeft=U.left,U.element.scrollTop=U.top}}Dl=!!rc,oc=rc=null}finally{Ae=o,$.p=s,k.T=i}}e.current=t,Pe=2}}function md(){if(Pe===2){Pe=0;var e=Vn,t=es,i=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||i){i=k.T,k.T=null;var s=$.p;$.p=2;var o=Ae;Ae|=4;try{Vh(e,t.alternate,t)}finally{Ae=o,$.p=s,k.T=i}}Pe=3}}function yd(){if(Pe===4||Pe===3){Pe=0,st();var e=Vn,t=es,i=kn,s=nd;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Pe=5:(Pe=0,es=Vn=null,gd(e,e.pendingLanes));var o=e.pendingLanes;if(o===0&&(Yn=null),dr(i),t=t.stateNode,St&&typeof St.onCommitFiberRoot=="function")try{St.onCommitFiberRoot(bs,t,void 0,(t.current.flags&128)===128)}catch{}if(s!==null){t=k.T,o=$.p,$.p=2,k.T=null;try{for(var c=e.onRecoverableError,h=0;h<s.length;h++){var p=s[h];c(p.value,{componentStack:p.stack})}}finally{k.T=t,$.p=o}}(kn&3)!==0&&kl(),en(e),o=e.pendingLanes,(i&261930)!==0&&(o&42)!==0?e===Zo?ea++:(ea=0,Zo=e):ea=0,ta(0)}}function gd(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Us(t)))}function kl(){return pd(),md(),yd(),vd()}function vd(){if(Pe!==5)return!1;var e=Vn,t=Qo;Qo=0;var i=dr(kn),s=k.T,o=$.p;try{$.p=32>i?32:i,k.T=null,i=Ko,Ko=null;var c=Vn,h=kn;if(Pe=0,es=Vn=null,kn=0,(Ae&6)!==0)throw Error(l(331));var p=Ae;if(Ae|=4,Ph(c.current),Fh(c,c.current,h,i),Ae=p,ta(0,!1),St&&typeof St.onPostCommitFiberRoot=="function")try{St.onPostCommitFiberRoot(bs,c)}catch{}return!0}finally{$.p=o,k.T=s,gd(e,t)}}function bd(e,t,i){t=Ct(i,t),t=_o(e.stateNode,t,2),e=Dn(e,t,2),e!==null&&(Ss(e,2),en(e))}function Oe(e,t,i){if(e.tag===3)bd(e,e,i);else for(;t!==null;){if(t.tag===3){bd(t,e,i);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Yn===null||!Yn.has(s))){e=Ct(i,e),i=wh(2),s=Dn(t,i,2),s!==null&&(Sh(i,s,t,e),Ss(s,2),en(s));break}}t=t.return}}function Wo(e,t,i){var s=e.pingCache;if(s===null){s=e.pingCache=new kg;var o=new Set;s.set(t,o)}else o=s.get(t),o===void 0&&(o=new Set,s.set(t,o));o.has(i)||(Vo=!0,o.add(i),e=Og.bind(null,e,t,i),t.then(e,e))}function Og(e,t,i){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,Ue===e&&(ve&i)===i&&($e===4||$e===3&&(ve&62914560)===ve&&300>Qe()-vl?(Ae&2)===0&&ts(e,0):Xo|=i,Pi===ve&&(Pi=0)),en(e)}function wd(e,t){t===0&&(t=du()),e=oi(e,t),e!==null&&(Ss(e,t),en(e))}function jg(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),wd(e,i)}function Rg(e,t){var i=0;switch(e.tag){case 31:case 13:var s=e.stateNode,o=e.memoizedState;o!==null&&(i=o.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(l(314))}s!==null&&s.delete(t),wd(e,i)}function zg(e,t){return ae(e,t)}var Tl=null,is=null,Io=!1,_l=!1,Po=!1,Gn=0;function en(e){e!==is&&e.next===null&&(is===null?Tl=is=e:is=is.next=e),_l=!0,Io||(Io=!0,Cg())}function ta(e,t){if(!Po&&_l){Po=!0;do for(var i=!1,s=Tl;s!==null;){if(e!==0){var o=s.pendingLanes;if(o===0)var c=0;else{var h=s.suspendedLanes,p=s.pingedLanes;c=(1<<31-xt(42|e)+1)-1,c&=o&~(h&~p),c=c&201326741?c&201326741|1:c?c|2:0}c!==0&&(i=!0,kd(s,c))}else c=ve,c=ja(s,s===Ue?c:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(c&3)===0||ws(s,c)||(i=!0,kd(s,c));s=s.next}while(i);Po=!1}}function Mg(){Sd()}function Sd(){_l=Io=!1;var e=0;Gn!==0&&Xg()&&(e=Gn);for(var t=Qe(),i=null,s=Tl;s!==null;){var o=s.next,c=xd(s,t);c===0?(s.next=null,i===null?Tl=o:i.next=o,o===null&&(is=i)):(i=s,(e!==0||(c&3)!==0)&&(_l=!0)),s=o}Pe!==0&&Pe!==5||ta(e),Gn!==0&&(Gn=0)}function xd(e,t){for(var i=e.suspendedLanes,s=e.pingedLanes,o=e.expirationTimes,c=e.pendingLanes&-62914561;0<c;){var h=31-xt(c),p=1<<h,v=o[h];v===-1?((p&i)===0||(p&s)!==0)&&(o[h]=ly(p,t)):v<=t&&(e.expiredLanes|=p),c&=~p}if(t=Ue,i=ve,i=ja(e,e===t?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,i===0||e===t&&(Ne===2||Ne===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&De(s),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||ws(e,i)){if(t=i&-i,t===e.callbackPriority)return t;switch(s!==null&&De(s),dr(i)){case 2:case 8:i=fu;break;case 32:i=_a;break;case 268435456:i=hu;break;default:i=_a}return s=Ed.bind(null,e),i=ae(i,s),e.callbackPriority=t,e.callbackNode=i,t}return s!==null&&s!==null&&De(s),e.callbackPriority=2,e.callbackNode=null,2}function Ed(e,t){if(Pe!==0&&Pe!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(kl()&&e.callbackNode!==i)return null;var s=ve;return s=ja(e,e===Ue?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(sd(e,s,t),xd(e,Qe()),e.callbackNode!=null&&e.callbackNode===i?Ed.bind(null,e):null)}function kd(e,t){if(kl())return null;sd(e,t,!0)}function Cg(){Qg(function(){(Ae&6)!==0?ae(uu,Mg):Sd()})}function ec(){if(Gn===0){var e=Yi;e===0&&(e=Aa,Aa<<=1,(Aa&261888)===0&&(Aa=256)),Gn=e}return Gn}function Td(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Ca(""+e)}function _d(e,t){var i=t.ownerDocument.createElement("input");return i.name=t.name,i.value=t.value,e.id&&i.setAttribute("form",e.id),t.parentNode.insertBefore(i,t),e=new FormData(e),i.parentNode.removeChild(i),e}function Ug(e,t,i,s,o){if(t==="submit"&&i&&i.stateNode===o){var c=Td((o[pt]||null).action),h=s.submitter;h&&(t=(t=h[pt]||null)?Td(t.formAction):h.getAttribute("formAction"),t!==null&&(c=t,h=null));var p=new qa("action","action",null,s,o);e.push({event:p,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(Gn!==0){var v=h?_d(o,h):new FormData(o);wo(i,{pending:!0,data:v,method:o.method,action:c},null,v)}}else typeof c=="function"&&(p.preventDefault(),v=h?_d(o,h):new FormData(o),wo(i,{pending:!0,data:v,method:o.method,action:c},c,v))},currentTarget:o}]})}}for(var tc=0;tc<Dr.length;tc++){var nc=Dr[tc],Dg=nc.toLowerCase(),Bg=nc[0].toUpperCase()+nc.slice(1);Yt(Dg,"on"+Bg)}Yt(nf,"onAnimationEnd"),Yt(sf,"onAnimationIteration"),Yt(af,"onAnimationStart"),Yt("dblclick","onDoubleClick"),Yt("focusin","onFocus"),Yt("focusout","onBlur"),Yt(Py,"onTransitionRun"),Yt(eg,"onTransitionStart"),Yt(tg,"onTransitionCancel"),Yt(lf,"onTransitionEnd"),Ni("onMouseEnter",["mouseout","mouseover"]),Ni("onMouseLeave",["mouseout","mouseover"]),Ni("onPointerEnter",["pointerout","pointerover"]),Ni("onPointerLeave",["pointerout","pointerover"]),si("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),si("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),si("onBeforeInput",["compositionend","keypress","textInput","paste"]),si("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),si("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),si("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var na="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(" "),qg=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(na));function Ad(e,t){t=(t&4)!==0;for(var i=0;i<e.length;i++){var s=e[i],o=s.event;s=s.listeners;e:{var c=void 0;if(t)for(var h=s.length-1;0<=h;h--){var p=s[h],v=p.instance,_=p.currentTarget;if(p=p.listener,v!==c&&o.isPropagationStopped())break e;c=p,o.currentTarget=_;try{c(o)}catch(M){$a(M)}o.currentTarget=null,c=v}else for(h=0;h<s.length;h++){if(p=s[h],v=p.instance,_=p.currentTarget,p=p.listener,v!==c&&o.isPropagationStopped())break e;c=p,o.currentTarget=_;try{c(o)}catch(M){$a(M)}o.currentTarget=null,c=v}}}}function ge(e,t){var i=t[pr];i===void 0&&(i=t[pr]=new Set);var s=e+"__bubble";i.has(s)||(Nd(t,e,2,!1),i.add(s))}function ic(e,t,i){var s=0;t&&(s|=4),Nd(i,e,s,t)}var Al="_reactListening"+Math.random().toString(36).slice(2);function sc(e){if(!e[Al]){e[Al]=!0,wu.forEach(function(i){i!=="selectionchange"&&(qg.has(i)||ic(i,!1,e),ic(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Al]||(t[Al]=!0,ic("selectionchange",!1,t))}}function Nd(e,t,i,s){switch(ip(t)){case 2:var o=hv;break;case 8:o=dv;break;default:o=bc}i=o.bind(null,t,i,e),o=void 0,!Er||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),s?o!==void 0?e.addEventListener(t,i,{capture:!0,passive:o}):e.addEventListener(t,i,!0):o!==void 0?e.addEventListener(t,i,{passive:o}):e.addEventListener(t,i,!1)}function ac(e,t,i,s,o){var c=s;if((t&1)===0&&(t&2)===0&&s!==null)e:for(;;){if(s===null)return;var h=s.tag;if(h===3||h===4){var p=s.stateNode.containerInfo;if(p===o)break;if(h===4)for(h=s.return;h!==null;){var v=h.tag;if((v===3||v===4)&&h.stateNode.containerInfo===o)return;h=h.return}for(;p!==null;){if(h=Ti(p),h===null)return;if(v=h.tag,v===5||v===6||v===26||v===27){s=c=h;continue e}p=p.parentNode}}s=s.return}zu(function(){var _=c,M=Sr(i),D=[];e:{var A=rf.get(e);if(A!==void 0){var O=qa,I=e;switch(e){case"keypress":if(Da(i)===0)break e;case"keydown":case"keyup":O=Ry;break;case"focusin":I="focus",O=Ar;break;case"focusout":I="blur",O=Ar;break;case"beforeblur":case"afterblur":O=Ar;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":O=Uu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":O=by;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":O=Cy;break;case nf:case sf:case af:O=xy;break;case lf:O=Dy;break;case"scroll":case"scrollend":O=gy;break;case"wheel":O=qy;break;case"copy":case"cut":case"paste":O=ky;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":O=Bu;break;case"toggle":case"beforetoggle":O=Hy}var le=(t&4)!==0,Me=!le&&(e==="scroll"||e==="scrollend"),E=le?A!==null?A+"Capture":null:A;le=[];for(var x=_,T;x!==null;){var U=x;if(T=U.stateNode,U=U.tag,U!==5&&U!==26&&U!==27||T===null||E===null||(U=ks(x,E),U!=null&&le.push(ia(x,U,T))),Me)break;x=x.return}0<le.length&&(A=new O(A,I,null,i,M),D.push({event:A,listeners:le}))}}if((t&7)===0){e:{if(A=e==="mouseover"||e==="pointerover",O=e==="mouseout"||e==="pointerout",A&&i!==wr&&(I=i.relatedTarget||i.fromElement)&&(Ti(I)||I[ki]))break e;if((O||A)&&(A=M.window===M?M:(A=M.ownerDocument)?A.defaultView||A.parentWindow:window,O?(I=i.relatedTarget||i.toElement,O=_,I=I?Ti(I):null,I!==null&&(Me=f(I),le=I.tag,I!==Me||le!==5&&le!==27&&le!==6)&&(I=null)):(O=null,I=_),O!==I)){if(le=Uu,U="onMouseLeave",E="onMouseEnter",x="mouse",(e==="pointerout"||e==="pointerover")&&(le=Bu,U="onPointerLeave",E="onPointerEnter",x="pointer"),Me=O==null?A:Es(O),T=I==null?A:Es(I),A=new le(U,x+"leave",O,i,M),A.target=Me,A.relatedTarget=T,U=null,Ti(M)===_&&(le=new le(E,x+"enter",I,i,M),le.target=T,le.relatedTarget=Me,U=le),Me=U,O&&I)t:{for(le=Lg,E=O,x=I,T=0,U=E;U;U=le(U))T++;U=0;for(var ie=x;ie;ie=le(ie))U++;for(;0<T-U;)E=le(E),T--;for(;0<U-T;)x=le(x),U--;for(;T--;){if(E===x||x!==null&&E===x.alternate){le=E;break t}E=le(E),x=le(x)}le=null}else le=null;O!==null&&Od(D,A,O,le,!1),I!==null&&Me!==null&&Od(D,Me,I,le,!0)}}e:{if(A=_?Es(_):window,O=A.nodeName&&A.nodeName.toLowerCase(),O==="select"||O==="input"&&A.type==="file")var ke=Gu;else if(Vu(A))if(Qu)ke=Fy;else{ke=Zy;var te=Ky}else O=A.nodeName,!O||O.toLowerCase()!=="input"||A.type!=="checkbox"&&A.type!=="radio"?_&&br(_.elementType)&&(ke=Gu):ke=Jy;if(ke&&(ke=ke(e,_))){Xu(D,ke,i,M);break e}te&&te(e,A,_),e==="focusout"&&_&&A.type==="number"&&_.memoizedProps.value!=null&&vr(A,"number",A.value)}switch(te=_?Es(_):window,e){case"focusin":(Vu(te)||te.contentEditable==="true")&&(Ci=te,Mr=_,zs=null);break;case"focusout":zs=Mr=Ci=null;break;case"mousedown":Cr=!0;break;case"contextmenu":case"mouseup":case"dragend":Cr=!1,ef(D,i,M);break;case"selectionchange":if(Iy)break;case"keydown":case"keyup":ef(D,i,M)}var de;if(Or)e:{switch(e){case"compositionstart":var be="onCompositionStart";break e;case"compositionend":be="onCompositionEnd";break e;case"compositionupdate":be="onCompositionUpdate";break e}be=void 0}else Mi?$u(e,i)&&(be="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(be="onCompositionStart");be&&(qu&&i.locale!=="ko"&&(Mi||be!=="onCompositionStart"?be==="onCompositionEnd"&&Mi&&(de=Mu()):(On=M,kr="value"in On?On.value:On.textContent,Mi=!0)),te=Nl(_,be),0<te.length&&(be=new Du(be,e,null,i,M),D.push({event:be,listeners:te}),de?be.data=de:(de=Yu(i),de!==null&&(be.data=de)))),(de=Yy?Vy(e,i):Xy(e,i))&&(be=Nl(_,"onBeforeInput"),0<be.length&&(te=new Du("onBeforeInput","beforeinput",null,i,M),D.push({event:te,listeners:be}),te.data=de)),Ug(D,e,_,i,M)}Ad(D,t)})}function ia(e,t,i){return{instance:e,listener:t,currentTarget:i}}function Nl(e,t){for(var i=t+"Capture",s=[];e!==null;){var o=e,c=o.stateNode;if(o=o.tag,o!==5&&o!==26&&o!==27||c===null||(o=ks(e,i),o!=null&&s.unshift(ia(e,o,c)),o=ks(e,t),o!=null&&s.push(ia(e,o,c))),e.tag===3)return s;e=e.return}return[]}function Lg(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Od(e,t,i,s,o){for(var c=t._reactName,h=[];i!==null&&i!==s;){var p=i,v=p.alternate,_=p.stateNode;if(p=p.tag,v!==null&&v===s)break;p!==5&&p!==26&&p!==27||_===null||(v=_,o?(_=ks(i,c),_!=null&&h.unshift(ia(i,_,v))):o||(_=ks(i,c),_!=null&&h.push(ia(i,_,v)))),i=i.return}h.length!==0&&e.push({event:t,listeners:h})}var Hg=/\r\n?/g,$g=/\u0000|\uFFFD/g;function jd(e){return(typeof e=="string"?e:""+e).replace(Hg,`
|
|
9
|
-
`).replace($g,"")}function Rd(e,t){return t=jd(t),jd(e)===t}function ze(e,t,i,s,o,c){switch(i){case"children":typeof s=="string"?t==="body"||t==="textarea"&&s===""||ji(e,s):(typeof s=="number"||typeof s=="bigint")&&t!=="body"&&ji(e,""+s);break;case"className":za(e,"class",s);break;case"tabIndex":za(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":za(e,i,s);break;case"style":ju(e,s,c);break;case"data":if(t!=="object"){za(e,"data",s);break}case"src":case"href":if(s===""&&(t!=="a"||i!=="href")){e.removeAttribute(i);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(i);break}s=Ca(""+s),e.setAttribute(i,s);break;case"action":case"formAction":if(typeof s=="function"){e.setAttribute(i,"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 c=="function"&&(i==="formAction"?(t!=="input"&&ze(e,t,"name",o.name,o,null),ze(e,t,"formEncType",o.formEncType,o,null),ze(e,t,"formMethod",o.formMethod,o,null),ze(e,t,"formTarget",o.formTarget,o,null)):(ze(e,t,"encType",o.encType,o,null),ze(e,t,"method",o.method,o,null),ze(e,t,"target",o.target,o,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(i);break}s=Ca(""+s),e.setAttribute(i,s);break;case"onClick":s!=null&&(e.onclick=cn);break;case"onScroll":s!=null&&ge("scroll",e);break;case"onScrollEnd":s!=null&&ge("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(l(61));if(i=s.__html,i!=null){if(o.children!=null)throw Error(l(60));e.innerHTML=i}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}i=Ca(""+s),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(i,""+s):e.removeAttribute(i);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":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(i,""):e.removeAttribute(i);break;case"capture":case"download":s===!0?e.setAttribute(i,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(i,s):e.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(i,s):e.removeAttribute(i);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(i):e.setAttribute(i,s);break;case"popover":ge("beforetoggle",e),ge("toggle",e),Ra(e,"popover",s);break;case"xlinkActuate":on(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":on(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":on(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":on(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":on(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":on(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":on(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":on(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":on(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":Ra(e,"is",s);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=my.get(i)||i,Ra(e,i,s))}}function lc(e,t,i,s,o,c){switch(i){case"style":ju(e,s,c);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(l(61));if(i=s.__html,i!=null){if(o.children!=null)throw Error(l(60));e.innerHTML=i}}break;case"children":typeof s=="string"?ji(e,s):(typeof s=="number"||typeof s=="bigint")&&ji(e,""+s);break;case"onScroll":s!=null&&ge("scroll",e);break;case"onScrollEnd":s!=null&&ge("scrollend",e);break;case"onClick":s!=null&&(e.onclick=cn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Su.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(o=i.endsWith("Capture"),t=i.slice(2,o?i.length-7:void 0),c=e[pt]||null,c=c!=null?c[i]:null,typeof c=="function"&&e.removeEventListener(t,c,o),typeof s=="function")){typeof c!="function"&&c!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(t,s,o);break e}i in e?e[i]=s:s===!0?e.setAttribute(i,""):Ra(e,i,s)}}}function ct(e,t,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ge("error",e),ge("load",e);var s=!1,o=!1,c;for(c in i)if(i.hasOwnProperty(c)){var h=i[c];if(h!=null)switch(c){case"src":s=!0;break;case"srcSet":o=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(l(137,t));default:ze(e,t,c,h,i,null)}}o&&ze(e,t,"srcSet",i.srcSet,i,null),s&&ze(e,t,"src",i.src,i,null);return;case"input":ge("invalid",e);var p=c=h=o=null,v=null,_=null;for(s in i)if(i.hasOwnProperty(s)){var M=i[s];if(M!=null)switch(s){case"name":o=M;break;case"type":h=M;break;case"checked":v=M;break;case"defaultChecked":_=M;break;case"value":c=M;break;case"defaultValue":p=M;break;case"children":case"dangerouslySetInnerHTML":if(M!=null)throw Error(l(137,t));break;default:ze(e,t,s,M,i,null)}}_u(e,c,p,v,_,h,o,!1);return;case"select":ge("invalid",e),s=h=c=null;for(o in i)if(i.hasOwnProperty(o)&&(p=i[o],p!=null))switch(o){case"value":c=p;break;case"defaultValue":h=p;break;case"multiple":s=p;default:ze(e,t,o,p,i,null)}t=c,i=h,e.multiple=!!s,t!=null?Oi(e,!!s,t,!1):i!=null&&Oi(e,!!s,i,!0);return;case"textarea":ge("invalid",e),c=o=s=null;for(h in i)if(i.hasOwnProperty(h)&&(p=i[h],p!=null))switch(h){case"value":s=p;break;case"defaultValue":o=p;break;case"children":c=p;break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(l(91));break;default:ze(e,t,h,p,i,null)}Nu(e,s,o,c);return;case"option":for(v in i)i.hasOwnProperty(v)&&(s=i[v],s!=null)&&(v==="selected"?e.selected=s&&typeof s!="function"&&typeof s!="symbol":ze(e,t,v,s,i,null));return;case"dialog":ge("beforetoggle",e),ge("toggle",e),ge("cancel",e),ge("close",e);break;case"iframe":case"object":ge("load",e);break;case"video":case"audio":for(s=0;s<na.length;s++)ge(na[s],e);break;case"image":ge("error",e),ge("load",e);break;case"details":ge("toggle",e);break;case"embed":case"source":case"link":ge("error",e),ge("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(_ in i)if(i.hasOwnProperty(_)&&(s=i[_],s!=null))switch(_){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,t));default:ze(e,t,_,s,i,null)}return;default:if(br(t)){for(M in i)i.hasOwnProperty(M)&&(s=i[M],s!==void 0&&lc(e,t,M,s,i,void 0));return}}for(p in i)i.hasOwnProperty(p)&&(s=i[p],s!=null&&ze(e,t,p,s,i,null))}function Yg(e,t,i,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var o=null,c=null,h=null,p=null,v=null,_=null,M=null;for(O in i){var D=i[O];if(i.hasOwnProperty(O)&&D!=null)switch(O){case"checked":break;case"value":break;case"defaultValue":v=D;default:s.hasOwnProperty(O)||ze(e,t,O,null,s,D)}}for(var A in s){var O=s[A];if(D=i[A],s.hasOwnProperty(A)&&(O!=null||D!=null))switch(A){case"type":c=O;break;case"name":o=O;break;case"checked":_=O;break;case"defaultChecked":M=O;break;case"value":h=O;break;case"defaultValue":p=O;break;case"children":case"dangerouslySetInnerHTML":if(O!=null)throw Error(l(137,t));break;default:O!==D&&ze(e,t,A,O,s,D)}}gr(e,h,p,v,_,M,c,o);return;case"select":O=h=p=A=null;for(c in i)if(v=i[c],i.hasOwnProperty(c)&&v!=null)switch(c){case"value":break;case"multiple":O=v;default:s.hasOwnProperty(c)||ze(e,t,c,null,s,v)}for(o in s)if(c=s[o],v=i[o],s.hasOwnProperty(o)&&(c!=null||v!=null))switch(o){case"value":A=c;break;case"defaultValue":p=c;break;case"multiple":h=c;default:c!==v&&ze(e,t,o,c,s,v)}t=p,i=h,s=O,A!=null?Oi(e,!!i,A,!1):!!s!=!!i&&(t!=null?Oi(e,!!i,t,!0):Oi(e,!!i,i?[]:"",!1));return;case"textarea":O=A=null;for(p in i)if(o=i[p],i.hasOwnProperty(p)&&o!=null&&!s.hasOwnProperty(p))switch(p){case"value":break;case"children":break;default:ze(e,t,p,null,s,o)}for(h in s)if(o=s[h],c=i[h],s.hasOwnProperty(h)&&(o!=null||c!=null))switch(h){case"value":A=o;break;case"defaultValue":O=o;break;case"children":break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(l(91));break;default:o!==c&&ze(e,t,h,o,s,c)}Au(e,A,O);return;case"option":for(var I in i)A=i[I],i.hasOwnProperty(I)&&A!=null&&!s.hasOwnProperty(I)&&(I==="selected"?e.selected=!1:ze(e,t,I,null,s,A));for(v in s)A=s[v],O=i[v],s.hasOwnProperty(v)&&A!==O&&(A!=null||O!=null)&&(v==="selected"?e.selected=A&&typeof A!="function"&&typeof A!="symbol":ze(e,t,v,A,s,O));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 le in i)A=i[le],i.hasOwnProperty(le)&&A!=null&&!s.hasOwnProperty(le)&&ze(e,t,le,null,s,A);for(_ in s)if(A=s[_],O=i[_],s.hasOwnProperty(_)&&A!==O&&(A!=null||O!=null))switch(_){case"children":case"dangerouslySetInnerHTML":if(A!=null)throw Error(l(137,t));break;default:ze(e,t,_,A,s,O)}return;default:if(br(t)){for(var Me in i)A=i[Me],i.hasOwnProperty(Me)&&A!==void 0&&!s.hasOwnProperty(Me)&&lc(e,t,Me,void 0,s,A);for(M in s)A=s[M],O=i[M],!s.hasOwnProperty(M)||A===O||A===void 0&&O===void 0||lc(e,t,M,A,s,O);return}}for(var E in i)A=i[E],i.hasOwnProperty(E)&&A!=null&&!s.hasOwnProperty(E)&&ze(e,t,E,null,s,A);for(D in s)A=s[D],O=i[D],!s.hasOwnProperty(D)||A===O||A==null&&O==null||ze(e,t,D,A,s,O)}function zd(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Vg(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,i=performance.getEntriesByType("resource"),s=0;s<i.length;s++){var o=i[s],c=o.transferSize,h=o.initiatorType,p=o.duration;if(c&&p&&zd(h)){for(h=0,p=o.responseEnd,s+=1;s<i.length;s++){var v=i[s],_=v.startTime;if(_>p)break;var M=v.transferSize,D=v.initiatorType;M&&zd(D)&&(v=v.responseEnd,h+=M*(v<p?1:(p-_)/(v-_)))}if(--s,t+=8*(c+h)/(o.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 rc=null,oc=null;function Ol(e){return e.nodeType===9?e:e.ownerDocument}function Md(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 Cd(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 cc(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 uc=null;function Xg(){var e=window.event;return e&&e.type==="popstate"?e===uc?!1:(uc=e,!0):(uc=null,!1)}var Ud=typeof setTimeout=="function"?setTimeout:void 0,Gg=typeof clearTimeout=="function"?clearTimeout:void 0,Dd=typeof Promise=="function"?Promise:void 0,Qg=typeof queueMicrotask=="function"?queueMicrotask:typeof Dd<"u"?function(e){return Dd.resolve(null).then(e).catch(Kg)}:Ud;function Kg(e){setTimeout(function(){throw e})}function Qn(e){return e==="head"}function Bd(e,t){var i=t,s=0;do{var o=i.nextSibling;if(e.removeChild(i),o&&o.nodeType===8)if(i=o.data,i==="/$"||i==="/&"){if(s===0){e.removeChild(o),rs(t);return}s--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")s++;else if(i==="html")sa(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,sa(i);for(var c=i.firstChild;c;){var h=c.nextSibling,p=c.nodeName;c[xs]||p==="SCRIPT"||p==="STYLE"||p==="LINK"&&c.rel.toLowerCase()==="stylesheet"||i.removeChild(c),c=h}}else i==="body"&&sa(e.ownerDocument.body);i=o}while(i);rs(t)}function qd(e,t){var i=e;e=0;do{var s=i.nextSibling;if(i.nodeType===1?t?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(t?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),s&&s.nodeType===8)if(i=s.data,i==="/$"){if(e===0)break;e--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||e++;i=s}while(i)}function fc(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var i=t;switch(t=t.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":fc(i),mr(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function Zg(e,t,i,s){for(;e.nodeType===1;){var o=i;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[xs])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(c=e.getAttribute("rel"),c==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(c!==o.rel||e.getAttribute("href")!==(o.href==null||o.href===""?null:o.href)||e.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin)||e.getAttribute("title")!==(o.title==null?null:o.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(c=e.getAttribute("src"),(c!==(o.src==null?null:o.src)||e.getAttribute("type")!==(o.type==null?null:o.type)||e.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin))&&c&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var c=o.name==null?null:""+o.name;if(o.type==="hidden"&&e.getAttribute("name")===c)return e}else return e;if(e=Lt(e.nextSibling),e===null)break}return null}function Jg(e,t,i){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=Lt(e.nextSibling),e===null))return null;return e}function Ld(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Lt(e.nextSibling),e===null))return null;return e}function hc(e){return e.data==="$?"||e.data==="$~"}function dc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Fg(e,t){var i=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||i.readyState!=="loading")t();else{var s=function(){t(),i.removeEventListener("DOMContentLoaded",s)};i.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function Lt(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 pc=null;function Hd(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"||i==="/&"){if(t===0)return Lt(e.nextSibling);t--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||t++}e=e.nextSibling}return null}function $d(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(t===0)return e;t--}else i!=="/$"&&i!=="/&"||t++}e=e.previousSibling}return null}function Yd(e,t,i){switch(t=Ol(i),e){case"html":if(e=t.documentElement,!e)throw Error(l(452));return e;case"head":if(e=t.head,!e)throw Error(l(453));return e;case"body":if(e=t.body,!e)throw Error(l(454));return e;default:throw Error(l(451))}}function sa(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);mr(e)}var Ht=new Map,Vd=new Set;function jl(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Tn=$.d;$.d={f:Wg,r:Ig,D:Pg,C:ev,L:tv,m:nv,X:sv,S:iv,M:av};function Wg(){var e=Tn.f(),t=Sl();return e||t}function Ig(e){var t=_i(e);t!==null&&t.tag===5&&t.type==="form"?lh(t):Tn.r(e)}var ss=typeof document>"u"?null:document;function Xd(e,t,i){var s=ss;if(s&&typeof t=="string"&&t){var o=zt(t);o='link[rel="'+e+'"][href="'+o+'"]',typeof i=="string"&&(o+='[crossorigin="'+i+'"]'),Vd.has(o)||(Vd.add(o),e={rel:e,crossOrigin:i,href:t},s.querySelector(o)===null&&(t=s.createElement("link"),ct(t,"link",e),tt(t),s.head.appendChild(t)))}}function Pg(e){Tn.D(e),Xd("dns-prefetch",e,null)}function ev(e,t){Tn.C(e,t),Xd("preconnect",e,t)}function tv(e,t,i){Tn.L(e,t,i);var s=ss;if(s&&e&&t){var o='link[rel="preload"][as="'+zt(t)+'"]';t==="image"&&i&&i.imageSrcSet?(o+='[imagesrcset="'+zt(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(o+='[imagesizes="'+zt(i.imageSizes)+'"]')):o+='[href="'+zt(e)+'"]';var c=o;switch(t){case"style":c=as(e);break;case"script":c=ls(e)}Ht.has(c)||(e=w({rel:"preload",href:t==="image"&&i&&i.imageSrcSet?void 0:e,as:t},i),Ht.set(c,e),s.querySelector(o)!==null||t==="style"&&s.querySelector(aa(c))||t==="script"&&s.querySelector(la(c))||(t=s.createElement("link"),ct(t,"link",e),tt(t),s.head.appendChild(t)))}}function nv(e,t){Tn.m(e,t);var i=ss;if(i&&e){var s=t&&typeof t.as=="string"?t.as:"script",o='link[rel="modulepreload"][as="'+zt(s)+'"][href="'+zt(e)+'"]',c=o;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":c=ls(e)}if(!Ht.has(c)&&(e=w({rel:"modulepreload",href:e},t),Ht.set(c,e),i.querySelector(o)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(la(c)))return}s=i.createElement("link"),ct(s,"link",e),tt(s),i.head.appendChild(s)}}}function iv(e,t,i){Tn.S(e,t,i);var s=ss;if(s&&e){var o=Ai(s).hoistableStyles,c=as(e);t=t||"default";var h=o.get(c);if(!h){var p={loading:0,preload:null};if(h=s.querySelector(aa(c)))p.loading=5;else{e=w({rel:"stylesheet",href:e,"data-precedence":t},i),(i=Ht.get(c))&&mc(e,i);var v=h=s.createElement("link");tt(v),ct(v,"link",e),v._p=new Promise(function(_,M){v.onload=_,v.onerror=M}),v.addEventListener("load",function(){p.loading|=1}),v.addEventListener("error",function(){p.loading|=2}),p.loading|=4,Rl(h,t,s)}h={type:"stylesheet",instance:h,count:1,state:p},o.set(c,h)}}}function sv(e,t){Tn.X(e,t);var i=ss;if(i&&e){var s=Ai(i).hoistableScripts,o=ls(e),c=s.get(o);c||(c=i.querySelector(la(o)),c||(e=w({src:e,async:!0},t),(t=Ht.get(o))&&yc(e,t),c=i.createElement("script"),tt(c),ct(c,"link",e),i.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},s.set(o,c))}}function av(e,t){Tn.M(e,t);var i=ss;if(i&&e){var s=Ai(i).hoistableScripts,o=ls(e),c=s.get(o);c||(c=i.querySelector(la(o)),c||(e=w({src:e,async:!0,type:"module"},t),(t=Ht.get(o))&&yc(e,t),c=i.createElement("script"),tt(c),ct(c,"link",e),i.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},s.set(o,c))}}function Gd(e,t,i,s){var o=(o=he.current)?jl(o):null;if(!o)throw Error(l(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(t=as(i.href),i=Ai(o).hoistableStyles,s=i.get(t),s||(s={type:"style",instance:null,count:0,state:null},i.set(t,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){e=as(i.href);var c=Ai(o).hoistableStyles,h=c.get(e);if(h||(o=o.ownerDocument||o,h={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},c.set(e,h),(c=o.querySelector(aa(e)))&&!c._p&&(h.instance=c,h.state.loading=5),Ht.has(e)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},Ht.set(e,i),c||lv(o,e,i,h.state))),t&&s===null)throw Error(l(528,""));return h}if(t&&s!==null)throw Error(l(529,""));return null;case"script":return t=i.async,i=i.src,typeof i=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=ls(i),i=Ai(o).hoistableScripts,s=i.get(t),s||(s={type:"script",instance:null,count:0,state:null},i.set(t,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,e))}}function as(e){return'href="'+zt(e)+'"'}function aa(e){return'link[rel="stylesheet"]['+e+"]"}function Qd(e){return w({},e,{"data-precedence":e.precedence,precedence:null})}function lv(e,t,i,s){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?s.loading=1:(t=e.createElement("link"),s.preload=t,t.addEventListener("load",function(){return s.loading|=1}),t.addEventListener("error",function(){return s.loading|=2}),ct(t,"link",i),tt(t),e.head.appendChild(t))}function ls(e){return'[src="'+zt(e)+'"]'}function la(e){return"script[async]"+e}function Kd(e,t,i){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+zt(i.href)+'"]');if(s)return t.instance=s,tt(s),s;var o=w({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),tt(s),ct(s,"style",o),Rl(s,i.precedence,e),t.instance=s;case"stylesheet":o=as(i.href);var c=e.querySelector(aa(o));if(c)return t.state.loading|=4,t.instance=c,tt(c),c;s=Qd(i),(o=Ht.get(o))&&mc(s,o),c=(e.ownerDocument||e).createElement("link"),tt(c);var h=c;return h._p=new Promise(function(p,v){h.onload=p,h.onerror=v}),ct(c,"link",s),t.state.loading|=4,Rl(c,i.precedence,e),t.instance=c;case"script":return c=ls(i.src),(o=e.querySelector(la(c)))?(t.instance=o,tt(o),o):(s=i,(o=Ht.get(c))&&(s=w({},i),yc(s,o)),e=e.ownerDocument||e,o=e.createElement("script"),tt(o),ct(o,"link",s),e.head.appendChild(o),t.instance=o);case"void":return null;default:throw Error(l(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(s=t.instance,t.state.loading|=4,Rl(s,i.precedence,e));return t.instance}function Rl(e,t,i){for(var s=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),o=s.length?s[s.length-1]:null,c=o,h=0;h<s.length;h++){var p=s[h];if(p.dataset.precedence===t)c=p;else if(c!==o)break}c?c.parentNode.insertBefore(e,c.nextSibling):(t=i.nodeType===9?i.head:i,t.insertBefore(e,t.firstChild))}function mc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function yc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var zl=null;function Zd(e,t,i){if(zl===null){var s=new Map,o=zl=new Map;o.set(i,s)}else o=zl,s=o.get(i),s||(s=new Map,o.set(i,s));if(s.has(e))return s;for(s.set(e,null),i=i.getElementsByTagName(e),o=0;o<i.length;o++){var c=i[o];if(!(c[xs]||c[at]||e==="link"&&c.getAttribute("rel")==="stylesheet")&&c.namespaceURI!=="http://www.w3.org/2000/svg"){var h=c.getAttribute(t)||"";h=e+h;var p=s.get(h);p?p.push(c):s.set(h,[c])}}return s}function Jd(e,t,i){e=e.ownerDocument||e,e.head.insertBefore(i,t==="title"?e.querySelector("head > title"):null)}function rv(e,t,i){if(i===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;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!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 Fd(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function ov(e,t,i,s){if(i.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var o=as(s.href),c=t.querySelector(aa(o));if(c){t=c._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Ml.bind(e),t.then(e,e)),i.state.loading|=4,i.instance=c,tt(c);return}c=t.ownerDocument||t,s=Qd(s),(o=Ht.get(o))&&mc(s,o),c=c.createElement("link"),tt(c);var h=c;h._p=new Promise(function(p,v){h.onload=p,h.onerror=v}),ct(c,"link",s),i.instance=c}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(i,t),(t=i.state.preload)&&(i.state.loading&3)===0&&(e.count++,i=Ml.bind(e),t.addEventListener("load",i),t.addEventListener("error",i))}}var gc=0;function cv(e,t){return e.stylesheets&&e.count===0&&Ul(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var s=setTimeout(function(){if(e.stylesheets&&Ul(e,e.stylesheets),e.unsuspend){var c=e.unsuspend;e.unsuspend=null,c()}},6e4+t);0<e.imgBytes&&gc===0&&(gc=62500*Vg());var o=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Ul(e,e.stylesheets),e.unsuspend)){var c=e.unsuspend;e.unsuspend=null,c()}},(e.imgBytes>gc?50:800)+t);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(o)}}:null}function Ml(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ul(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Cl=null;function Ul(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Cl=new Map,t.forEach(uv,e),Cl=null,Ml.call(e))}function uv(e,t){if(!(t.state.loading&4)){var i=Cl.get(e);if(i)var s=i.get(null);else{i=new Map,Cl.set(e,i);for(var o=e.querySelectorAll("link[data-precedence],style[data-precedence]"),c=0;c<o.length;c++){var h=o[c];(h.nodeName==="LINK"||h.getAttribute("media")!=="not all")&&(i.set(h.dataset.precedence,h),s=h)}s&&i.set(null,s)}o=t.instance,h=o.getAttribute("data-precedence"),c=i.get(h)||s,c===s&&i.set(null,o),i.set(h,o),this.count++,s=Ml.bind(this),o.addEventListener("load",s),o.addEventListener("error",s),c?c.parentNode.insertBefore(o,c.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(o,e.firstChild)),t.state.loading|=4}}var ra={$$typeof:J,Provider:null,Consumer:null,_currentValue:F,_currentValue2:F,_threadCount:0};function fv(e,t,i,s,o,c,h,p,v){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=fr(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=fr(0),this.hiddenUpdates=fr(null),this.identifierPrefix=s,this.onUncaughtError=o,this.onCaughtError=c,this.onRecoverableError=h,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=v,this.incompleteTransitions=new Map}function Wd(e,t,i,s,o,c,h,p,v,_,M,D){return e=new fv(e,t,i,h,v,_,M,D,p),t=1,c===!0&&(t|=24),c=kt(3,null,null,t),e.current=c,c.stateNode=e,t=Jr(),t.refCount++,e.pooledCache=t,t.refCount++,c.memoizedState={element:s,isDehydrated:i,cache:t},Pr(c),e}function Id(e){return e?(e=Bi,e):Bi}function Pd(e,t,i,s,o,c){o=Id(o),s.context===null?s.context=o:s.pendingContext=o,s=Un(t),s.payload={element:i},c=c===void 0?null:c,c!==null&&(s.callback=c),i=Dn(e,s,t),i!==null&&(wt(i,e,t),Ls(i,e,t))}function ep(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function vc(e,t){ep(e,t),(e=e.alternate)&&ep(e,t)}function tp(e){if(e.tag===13||e.tag===31){var t=oi(e,67108864);t!==null&&wt(t,e,67108864),vc(e,67108864)}}function np(e){if(e.tag===13||e.tag===31){var t=Ot();t=hr(t);var i=oi(e,t);i!==null&&wt(i,e,t),vc(e,t)}}var Dl=!0;function hv(e,t,i,s){var o=k.T;k.T=null;var c=$.p;try{$.p=2,bc(e,t,i,s)}finally{$.p=c,k.T=o}}function dv(e,t,i,s){var o=k.T;k.T=null;var c=$.p;try{$.p=8,bc(e,t,i,s)}finally{$.p=c,k.T=o}}function bc(e,t,i,s){if(Dl){var o=wc(s);if(o===null)ac(e,t,s,Bl,i),sp(e,s);else if(mv(o,e,t,i,s))s.stopPropagation();else if(sp(e,s),t&4&&-1<pv.indexOf(e)){for(;o!==null;){var c=_i(o);if(c!==null)switch(c.tag){case 3:if(c=c.stateNode,c.current.memoizedState.isDehydrated){var h=ii(c.pendingLanes);if(h!==0){var p=c;for(p.pendingLanes|=2,p.entangledLanes|=2;h;){var v=1<<31-xt(h);p.entanglements[1]|=v,h&=~v}en(c),(Ae&6)===0&&(bl=Qe()+500,ta(0))}}break;case 31:case 13:p=oi(c,2),p!==null&&wt(p,c,2),Sl(),vc(c,2)}if(c=wc(s),c===null&&ac(e,t,s,Bl,i),c===o)break;o=c}o!==null&&s.stopPropagation()}else ac(e,t,s,null,i)}}function wc(e){return e=Sr(e),Sc(e)}var Bl=null;function Sc(e){if(Bl=null,e=Ti(e),e!==null){var t=f(e);if(t===null)e=null;else{var i=t.tag;if(i===13){if(e=d(t),e!==null)return e;e=null}else if(i===31){if(e=m(t),e!==null)return e;e=null}else if(i===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Bl=e,null}function ip(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(Ei()){case uu:return 2;case fu:return 8;case _a:case ey:return 32;case hu:return 268435456;default:return 32}default:return 32}}var xc=!1,Kn=null,Zn=null,Jn=null,oa=new Map,ca=new Map,Fn=[],pv="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 sp(e,t){switch(e){case"focusin":case"focusout":Kn=null;break;case"dragenter":case"dragleave":Zn=null;break;case"mouseover":case"mouseout":Jn=null;break;case"pointerover":case"pointerout":oa.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ca.delete(t.pointerId)}}function ua(e,t,i,s,o,c){return e===null||e.nativeEvent!==c?(e={blockedOn:t,domEventName:i,eventSystemFlags:s,nativeEvent:c,targetContainers:[o]},t!==null&&(t=_i(t),t!==null&&tp(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function mv(e,t,i,s,o){switch(t){case"focusin":return Kn=ua(Kn,e,t,i,s,o),!0;case"dragenter":return Zn=ua(Zn,e,t,i,s,o),!0;case"mouseover":return Jn=ua(Jn,e,t,i,s,o),!0;case"pointerover":var c=o.pointerId;return oa.set(c,ua(oa.get(c)||null,e,t,i,s,o)),!0;case"gotpointercapture":return c=o.pointerId,ca.set(c,ua(ca.get(c)||null,e,t,i,s,o)),!0}return!1}function ap(e){var t=Ti(e.target);if(t!==null){var i=f(t);if(i!==null){if(t=i.tag,t===13){if(t=d(i),t!==null){e.blockedOn=t,vu(e.priority,function(){np(i)});return}}else if(t===31){if(t=m(i),t!==null){e.blockedOn=t,vu(e.priority,function(){np(i)});return}}else if(t===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ql(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=wc(e.nativeEvent);if(i===null){i=e.nativeEvent;var s=new i.constructor(i.type,i);wr=s,i.target.dispatchEvent(s),wr=null}else return t=_i(i),t!==null&&tp(t),e.blockedOn=i,!1;t.shift()}return!0}function lp(e,t,i){ql(e)&&i.delete(t)}function yv(){xc=!1,Kn!==null&&ql(Kn)&&(Kn=null),Zn!==null&&ql(Zn)&&(Zn=null),Jn!==null&&ql(Jn)&&(Jn=null),oa.forEach(lp),ca.forEach(lp)}function Ll(e,t){e.blockedOn===t&&(e.blockedOn=null,xc||(xc=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,yv)))}var Hl=null;function rp(e){Hl!==e&&(Hl=e,r.unstable_scheduleCallback(r.unstable_NormalPriority,function(){Hl===e&&(Hl=null);for(var t=0;t<e.length;t+=3){var i=e[t],s=e[t+1],o=e[t+2];if(typeof s!="function"){if(Sc(s||i)===null)continue;break}var c=_i(i);c!==null&&(e.splice(t,3),t-=3,wo(c,{pending:!0,data:o,method:i.method,action:s},s,o))}}))}function rs(e){function t(v){return Ll(v,e)}Kn!==null&&Ll(Kn,e),Zn!==null&&Ll(Zn,e),Jn!==null&&Ll(Jn,e),oa.forEach(t),ca.forEach(t);for(var i=0;i<Fn.length;i++){var s=Fn[i];s.blockedOn===e&&(s.blockedOn=null)}for(;0<Fn.length&&(i=Fn[0],i.blockedOn===null);)ap(i),i.blockedOn===null&&Fn.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(s=0;s<i.length;s+=3){var o=i[s],c=i[s+1],h=o[pt]||null;if(typeof c=="function")h||rp(i);else if(h){var p=null;if(c&&c.hasAttribute("formAction")){if(o=c,h=c[pt]||null)p=h.formAction;else if(Sc(o)!==null)continue}else p=h.action;typeof p=="function"?i[s+1]=p:(i.splice(s,3),s-=3),rp(i)}}}function op(){function e(c){c.canIntercept&&c.info==="react-transition"&&c.intercept({handler:function(){return new Promise(function(h){return o=h})},focusReset:"manual",scroll:"manual"})}function t(){o!==null&&(o(),o=null),s||setTimeout(i,20)}function i(){if(!s&&!navigation.transition){var c=navigation.currentEntry;c&&c.url!=null&&navigation.navigate(c.url,{state:c.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var s=!1,o=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(i,100),function(){s=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),o!==null&&(o(),o=null)}}}function Ec(e){this._internalRoot=e}$l.prototype.render=Ec.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(l(409));var i=t.current,s=Ot();Pd(i,s,e,t,null,null)},$l.prototype.unmount=Ec.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Pd(e.current,2,null,e,null,null),Sl(),t[ki]=null}};function $l(e){this._internalRoot=e}$l.prototype.unstable_scheduleHydration=function(e){if(e){var t=gu();e={blockedOn:null,target:e,priority:t};for(var i=0;i<Fn.length&&t!==0&&t<Fn[i].priority;i++);Fn.splice(i,0,e),i===0&&ap(e)}};var cp=n.version;if(cp!=="19.2.8")throw Error(l(527,cp,"19.2.8"));$.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(l(188)):(e=Object.keys(e).join(","),Error(l(268,e)));return e=b(t),e=e!==null?R(e):null,e=e===null?null:e.stateNode,e};var gv={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:k,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Yl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Yl.isDisabled&&Yl.supportsFiber)try{bs=Yl.inject(gv),St=Yl}catch{}}return pa.createRoot=function(e,t){if(!u(e))throw Error(l(299));var i=!1,s="",o=yh,c=gh,h=vh;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(c=t.onCaughtError),t.onRecoverableError!==void 0&&(h=t.onRecoverableError)),t=Wd(e,1,!1,null,null,i,s,null,o,c,h,op),e[ki]=t.current,sc(e),new Ec(t)},pa.hydrateRoot=function(e,t,i){if(!u(e))throw Error(l(299));var s=!1,o="",c=yh,h=gh,p=vh,v=null;return i!=null&&(i.unstable_strictMode===!0&&(s=!0),i.identifierPrefix!==void 0&&(o=i.identifierPrefix),i.onUncaughtError!==void 0&&(c=i.onUncaughtError),i.onCaughtError!==void 0&&(h=i.onCaughtError),i.onRecoverableError!==void 0&&(p=i.onRecoverableError),i.formState!==void 0&&(v=i.formState)),t=Wd(e,1,!0,t,i??null,s,o,v,c,h,p,op),t.context=Id(null),i=t.current,s=Ot(),s=hr(s),o=Un(s),o.callback=null,Dn(i,o,s),i=s,t.current.lanes=i,Ss(t,i),en(t),e[ki]=t.current,sc(e),new $l(t)},pa.version="19.2.8",pa}var Ap;function Cv(){if(Ap)return Oc.exports;Ap=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(n){console.error(n)}}return r(),Oc.exports=Mv(),Oc.exports}var Uv=Cv(),Xl={exports:{}},Np;function Dv(){if(Np)return Xl.exports;Np=1;var r=typeof Reflect=="object"?Reflect:null,n=r&&typeof r.apply=="function"?r.apply:function(C,H,B){return Function.prototype.apply.call(C,H,B)},a;r&&typeof r.ownKeys=="function"?a=r.ownKeys:Object.getOwnPropertySymbols?a=function(C){return Object.getOwnPropertyNames(C).concat(Object.getOwnPropertySymbols(C))}:a=function(C){return Object.getOwnPropertyNames(C)};function l(N){console&&console.warn&&console.warn(N)}var u=Number.isNaN||function(C){return C!==C};function f(){f.init.call(this)}Xl.exports=f,Xl.exports.once=z,f.EventEmitter=f,f.prototype._events=void 0,f.prototype._eventsCount=0,f.prototype._maxListeners=void 0;var d=10;function m(N){if(typeof N!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof N)}Object.defineProperty(f,"defaultMaxListeners",{enumerable:!0,get:function(){return d},set:function(N){if(typeof N!="number"||N<0||u(N))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+N+".");d=N}}),f.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},f.prototype.setMaxListeners=function(C){if(typeof C!="number"||C<0||u(C))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+C+".");return this._maxListeners=C,this};function y(N){return N._maxListeners===void 0?f.defaultMaxListeners:N._maxListeners}f.prototype.getMaxListeners=function(){return y(this)},f.prototype.emit=function(C){for(var H=[],B=1;B<arguments.length;B++)H.push(arguments[B]);var Q=C==="error",ne=this._events;if(ne!==void 0)Q=Q&&ne.error===void 0;else if(!Q)return!1;if(Q){var se;if(H.length>0&&(se=H[0]),se instanceof Error)throw se;var xe=new Error("Unhandled error."+(se?" ("+se.message+")":""));throw xe.context=se,xe}var ue=ne[C];if(ue===void 0)return!1;if(typeof ue=="function")n(ue,this,H);else for(var je=ue.length,Ge=K(ue,je),B=0;B<je;++B)n(Ge[B],this,H);return!0};function b(N,C,H,B){var Q,ne,se;if(m(H),ne=N._events,ne===void 0?(ne=N._events=Object.create(null),N._eventsCount=0):(ne.newListener!==void 0&&(N.emit("newListener",C,H.listener?H.listener:H),ne=N._events),se=ne[C]),se===void 0)se=ne[C]=H,++N._eventsCount;else if(typeof se=="function"?se=ne[C]=B?[H,se]:[se,H]:B?se.unshift(H):se.push(H),Q=y(N),Q>0&&se.length>Q&&!se.warned){se.warned=!0;var xe=new Error("Possible EventEmitter memory leak detected. "+se.length+" "+String(C)+" listeners added. Use emitter.setMaxListeners() to increase limit");xe.name="MaxListenersExceededWarning",xe.emitter=N,xe.type=C,xe.count=se.length,l(xe)}return N}f.prototype.addListener=function(C,H){return b(this,C,H,!1)},f.prototype.on=f.prototype.addListener,f.prototype.prependListener=function(C,H){return b(this,C,H,!0)};function R(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function w(N,C,H){var B={fired:!1,wrapFn:void 0,target:N,type:C,listener:H},Q=R.bind(B);return Q.listener=H,B.wrapFn=Q,Q}f.prototype.once=function(C,H){return m(H),this.on(C,w(this,C,H)),this},f.prototype.prependOnceListener=function(C,H){return m(H),this.prependListener(C,w(this,C,H)),this},f.prototype.removeListener=function(C,H){var B,Q,ne,se,xe;if(m(H),Q=this._events,Q===void 0)return this;if(B=Q[C],B===void 0)return this;if(B===H||B.listener===H)--this._eventsCount===0?this._events=Object.create(null):(delete Q[C],Q.removeListener&&this.emit("removeListener",C,B.listener||H));else if(typeof B!="function"){for(ne=-1,se=B.length-1;se>=0;se--)if(B[se]===H||B[se].listener===H){xe=B[se].listener,ne=se;break}if(ne<0)return this;ne===0?B.shift():P(B,ne),B.length===1&&(Q[C]=B[0]),Q.removeListener!==void 0&&this.emit("removeListener",C,xe||H)}return this},f.prototype.off=f.prototype.removeListener,f.prototype.removeAllListeners=function(C){var H,B,Q;if(B=this._events,B===void 0)return this;if(B.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):B[C]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete B[C]),this;if(arguments.length===0){var ne=Object.keys(B),se;for(Q=0;Q<ne.length;++Q)se=ne[Q],se!=="removeListener"&&this.removeAllListeners(se);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(H=B[C],typeof H=="function")this.removeListener(C,H);else if(H!==void 0)for(Q=H.length-1;Q>=0;Q--)this.removeListener(C,H[Q]);return this};function j(N,C,H){var B=N._events;if(B===void 0)return[];var Q=B[C];return Q===void 0?[]:typeof Q=="function"?H?[Q.listener||Q]:[Q]:H?W(Q):K(Q,Q.length)}f.prototype.listeners=function(C){return j(this,C,!0)},f.prototype.rawListeners=function(C){return j(this,C,!1)},f.listenerCount=function(N,C){return typeof N.listenerCount=="function"?N.listenerCount(C):L.call(N,C)},f.prototype.listenerCount=L;function L(N){var C=this._events;if(C!==void 0){var H=C[N];if(typeof H=="function")return 1;if(H!==void 0)return H.length}return 0}f.prototype.eventNames=function(){return this._eventsCount>0?a(this._events):[]};function K(N,C){for(var H=new Array(C),B=0;B<C;++B)H[B]=N[B];return H}function P(N,C){for(;C+1<N.length;C++)N[C]=N[C+1];N.pop()}function W(N){for(var C=new Array(N.length),H=0;H<C.length;++H)C[H]=N[H].listener||N[H];return C}function z(N,C){return new Promise(function(H,B){function Q(se){N.removeListener(C,ne),B(se)}function ne(){typeof N.removeListener=="function"&&N.removeListener("error",Q),H([].slice.call(arguments))}J(N,C,ne,{once:!0}),C!=="error"&&X(N,Q,{once:!0})})}function X(N,C,H){typeof N.on=="function"&&J(N,"error",C,H)}function J(N,C,H,B){if(typeof N.on=="function")B.once?N.once(C,H):N.on(C,H);else if(typeof N.addEventListener=="function")N.addEventListener(C,function Q(ne){B.once&&N.removeEventListener(C,Q),H(ne)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof N)}return Xl.exports}var ei=Dv();const Il=Tv(ei),Bv=Object.prototype.toString,qv="[object Uint8Array]",Lv="[object ArrayBuffer]";function pm(r,n,a){return r?r.constructor===n?!0:Bv.call(r)===a:!1}function Hv(r){return pm(r,Uint8Array,qv)}function $v(r){return pm(r,ArrayBuffer,Lv)}function Yv(r){return Hv(r)||$v(r)}function Vv(r){if(!Yv(r))throw new TypeError(`Expected \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof r}\``)}const Op={utf8:new globalThis.TextDecoder("utf8")};function mm(r,n="utf8"){return Vv(r),Op[n]??=new globalThis.TextDecoder(n),Op[n].decode(r)}function Xv(r){if(typeof r!="string")throw new TypeError(`Expected \`string\`, got \`${typeof r}\``)}const Gv=new globalThis.TextEncoder;function ym(r){return Xv(r),Gv.encode(r)}Array.from({length:256},(r,n)=>n.toString(16).padStart(2,"0"));const ut=[];for(let r=0;r<256;++r)ut.push((r+256).toString(16).slice(1));function Qv(r,n=0){return(ut[r[n+0]]+ut[r[n+1]]+ut[r[n+2]]+ut[r[n+3]]+"-"+ut[r[n+4]]+ut[r[n+5]]+"-"+ut[r[n+6]]+ut[r[n+7]]+"-"+ut[r[n+8]]+ut[r[n+9]]+"-"+ut[r[n+10]]+ut[r[n+11]]+ut[r[n+12]]+ut[r[n+13]]+ut[r[n+14]]+ut[r[n+15]]).toLowerCase()}const Kv=new Uint8Array(16);function Zv(){return crypto.getRandomValues(Kv)}function et(r,n,a){return crypto.randomUUID?crypto.randomUUID():Jv(r)}function Jv(r,n,a){r=r||{};const l=r.random??r.rng?.()??Zv();if(l.length<16)throw new Error("Random bytes length must be >= 16");return l[6]=l[6]&15|64,l[8]=l[8]&63|128,Qv(l)}const Lc=1024,jp="$",Si={openBrace:123,closeBrace:125,quote:34,backslash:92,delimiter:36},Rp=(r,n)=>{if(n===0||r(0)!==Si.openBrace)return-1;const a=Math.min(n,Lc);let l=0,u=!1,f=!1;for(let d=0;d<a;d++){const m=r(d);if(u){f?f=!1:m===Si.backslash?f=!0:m===Si.quote&&(u=!1);continue}if(m===Si.quote)u=!0;else if(m===Si.openBrace)l++;else if(m===Si.closeBrace&&--l===0){const y=d+1;return y<a&&r(y)===Si.delimiter?y:-1}}return-1},_e={connected:"connected",disconnected:"disconnected",peerOnline:"peerOnline",peerGone:"peerGone",peerDisplaced:"peerDisplaced",peerShape:"peerShape",rejected:"rejected",unroutable:"unroutable",transportError:"transportError",relayed:"relayed"};class gm{maxPeers;peers=new Map;constructor(n=1e4){this.maxPeers=n}set(n,a){for(this.peers.delete(n),this.peers.set(n,a);this.peers.size>this.maxPeers;){const l=this.peers.keys().next();if(l.done)break;this.peers.delete(l.value)}}get(n){return this.peers.get(n)}delete(n){return this.shapes.delete(n),this.peers.delete(n)}clear(){this.peers.clear(),this.shapes.clear()}shapes=new Map;noteShape(n,a){if(this.shapes.get(n)===a)return!1;for(this.shapes.delete(n),this.shapes.set(n,a);this.shapes.size>this.maxPeers;){const l=this.shapes.keys().next();if(l.done)break;this.shapes.delete(l.value)}return!0}shapeOf(n){return this.shapes.get(n)}get size(){return this.peers.size}namesFor(n){const a=[];for(const[l,u]of this.peers)u===n&&a.push(l);return a}names(){return[...this.peers.keys()]}}class rr extends ei.EventEmitter{name;destinations=[];peerRegistry=new gm;readyFlag=!1;seq=0;constructor(n,a){super(),this.name=n,n||(this.name=et()),a&&a.forEach(l=>{l.pipe(this)})}async ready(n=3e4){const a=Date.now()+n;for(;!this.readyFlag;){if(Date.now()>a)return!1;await new Promise(l=>setTimeout(l,10))}return!0}async open(){}async close(){}buildHeader(n,a,l){return{source:n,target:a,time:Date.now(),seq:this.seq++,...l}}prependHeader(n,a,l){return this.frameMessage(this.buildHeader(n,a),l)}frameMessage(n,a){const l=JSON.stringify(n)+jp,u=ym(l);if(u.length>Lc)throw new Error(`message header is ${u.length} bytes, over the ${Lc} byte limit (source '${n.source}', target '${n.target}') - shorten the peer names`);if(typeof a=="string")return l+a;const f=new Uint8Array(u.length+a.length);return f.set(u,0),f.set(a,u.length),f}extractHeader(n){const a=typeof n=="string",l=Rp(a?y=>n.charCodeAt(y):y=>n[y],n.length);if(l<0)return[void 0,"","no msgrpc header"];const u=a?n.substring(0,l):mm(n.subarray(0,l));let f;try{f=JSON.parse(u)}catch(y){return[void 0,"",`unparsable header: ${String(y)}`]}if(!f||typeof f!="object")return[void 0,"","header is not an object"];if(typeof f.target!="string"||!f.target)return[void 0,"","header names no target"];if(typeof f.source!="string"||!f.source)return[void 0,"","header names no source"];const d=l+jp.length,m=a?n.substring(d):n.slice(d);return this.setKnownSource(f.source),[f,m]}getName(){return this.name}targetExists(n,a){let l;this.name===n&&(l=this);const u=this.peerRegistry.get(n);return u&&(l=u),l||this.destinations.map(f=>{!l&&!f.target.isTransport()&&f.target.targetExists(n,(a||0)+1)&&(l=f.target)}),l}pipe(n){const a=et();return this.destinations.push({id:a,target:n}),()=>{this.destinations=this.destinations.filter(l=>l.id!==a)}}async receive(n,a,l){}async receivePayload(n,a,l){}async send(n,a,l){await Promise.all(this.destinations.map(async u=>await u.target.receive(n,a,l)))}setKnownSource(n){this.peerRegistry.set(n,this)}usePeerRegistry(n){return this.peerRegistry=n,this}getIdentity(n){}async sendPayload(n,a,l,u){}isTransport(){return!1}}var We;(function(r){r.RequestMessage="REQUEST",r.ResponseMessage="RESPONSE",r.ErrorMessage="ERROR",r.EventMessage="EVENT",r.UnknownMessage="UNKNOWN"})(We||(We={}));class vm{type;payload}const Fv=(r,n,a,l)=>{const u=new vm;return u.type=l||We.UnknownMessage,u.payload=r,u};class bm extends rr{name;constructor(n,a){super(n),this.name=n,n||(this.name=et()),a&&a.forEach(l=>{l.pipe(this)})}pipe(n){const a=et();return this.destinations.push({id:a,target:n}),()=>{this.destinations=this.destinations.filter(l=>l.id!==a)}}receive(n,a,l){return Promise.resolve()}async send(n,a,l){await Promise.all(this.destinations.map(async u=>await u.target.receive(n,a,l)))}async sendPayload(n,a,l,u){const f=Fv(n,this.name,u,a);await this.send(f,l,u)}}const Wv=r=>r==="on"||r==="addListener"||r==="prependListener"||r==="once"||r==="prependOnceListener"||r==="off"||r==="removeListener"||r==="emit"||r==="removeListener"||r==="removeAllListeners"||r==="setMaxListeners"||r==="getMaxListeners";var Xe;(function(r){r.CallInstanceMethod="POST",r.success="SUCCESS",r.error="ERROR",r.event="EVENT"})(Xe||(Xe={}));const Gl={query:0,"idempotent-command":1,"non-repeatable-command":2},Mc=r=>{if(r instanceof Error)return{name:r.name,message:r.message,stack:r.stack};if(r&&typeof r=="object"){const n=r;if(typeof n.message=="string")return{name:typeof n.name=="string"?n.name:"Error",message:n.message}}return{name:"Error",message:String(r)}},Iv=r=>"code"in r,Hc=new WeakMap,$c=new WeakMap,Yc=new WeakMap,Vc=new WeakMap,Xc=new WeakMap,Pv=(r,n,a,l,u,f)=>{let d=Hc.get(r);if(d||Hc.set(r,d=new Set),d.add(n),l){let y=Yc.get(r);y||Yc.set(r,y=new Set),y.add(n)}if(u){let y=Vc.get(r);y||Vc.set(r,y=new Set),y.add(n)}if(f){let y=Xc.get(r);y||Xc.set(r,y=new Set),y.add(n)}if(!a)return;let m=$c.get(r);m||$c.set(r,m=new Map),m.set(n,a)},zp=(r,n)=>{if(r.static)throw new Error("@rpc: static methods cannot be exposed");if(r.private)throw new Error("@rpc: private methods cannot be exposed");r.addInitializer(function(){Pv(this.constructor,String(r.name),n.semantics,n.conflate,n.requiresAuthority,n.injectInvocation)})};function fs(r,n){if(typeof r=="function"&&n)return zp(n,{});const a=r;return(l,u)=>zp(u,a)}const wm=new WeakMap,Sm=(r,n={})=>(a,l)=>(wm.set(a,{name:r,version:n.version,execution:n.execution,mailbox:n.mailbox}),a),e0=r=>{for(let n=r.constructor;n;n=Object.getPrototypeOf(n)){const a=wm.get(n);if(a)return a}},t0=r=>{const n=new Set;for(let a=r.constructor;a;a=Object.getPrototypeOf(a))for(const l of Hc.get(a)??[])n.add(l);return n.size?n:void 0},n0=r=>{const n=new Map;for(let a=r.constructor;a;a=Object.getPrototypeOf(a))for(const[l,u]of $c.get(a)??[])n.has(l)||n.set(l,u);return n},i0=r=>{const n=new Set;for(let a=r.constructor;a;a=Object.getPrototypeOf(a))for(const l of Yc.get(a)??[])n.add(l);return n},s0=r=>{const n=new Set;for(let a=r.constructor;a;a=Object.getPrototypeOf(a))for(const l of Vc.get(a)??[])n.add(l);return n},a0=r=>{const n=new Set;for(let a=r.constructor;a;a=Object.getPrototypeOf(a))for(const l of Xc.get(a)??[])n.add(l);return n},l0=Symbol("@source-repo/rpc/invocation"),Mp=(r,n)=>!!r&&!!n&&r.peer===n.peer&&r.instance===n.instance;class r0{durable=!1;async load(){}async save(){}}const dt="$host",Ql=128,xm=/[\u0000-\u001f\u007f]/,In=(r,n)=>{if(!r)throw new Error(`topology: ${n} is empty`);if(xm.test(r))throw new Error(`topology: ${n} contains a control character, and ids never do`)},Cc=r=>{if(r!==void 0&&xm.test(r))throw new Error("topology: a label contains a control character")};class o0{peer;options;records=new Map;onCommitted;listeners=new Map;store;loaded=!1;constructor(n,a={}){this.peer=n,this.options=a;for(const l of a.place??[])In(l,`place segment '${l}'`);Cc(a.label),this.store=a.store??new r0}async init(){const n=await this.store.load();if(n)for(const a of n)this.records.set(a.ref.instance,a);this.records.has(dt)||this.records.set(dt,{ref:{peer:this.peer,instance:dt},parent:null,owner:null,parentEpoch:et(),ownerEpoch:et(),version:{epoch:et(),revision:0},...this.options.label!==void 0?{label:this.options.label}:{}}),this.loaded=!0,await this.persist()}ref(n){return{peer:this.peer,instance:n}}get(n){return this.records.get(n)}all(){return[...this.records.values()]}get place(){return this.options.place}capabilities(){return{authorityScope:"host",cycleGuarantee:"detected",reverseIndex:"eventual",deletion:"tombstone",durability:this.store.durable?"durable":"volatile"}}async declare(n,a={}){if(this.assertLoaded(),In(n,`instance '${n}'`),n===dt)throw new Error(`topology: ${dt} is the synthetic root - set its links with updateHost()`);if(this.records.has(n))throw new Error(`topology: ${n} is already declared - changes go through update() with the expected version`);Cc(a.label);const l=a.parent===void 0?this.ref(dt):a.parent;this.checkParent(n,l),this.checkOwner(n,a.owner??null);const u={ref:this.ref(n),parent:l,owner:a.owner??null,parentEpoch:et(),ownerEpoch:et(),version:{epoch:et(),revision:0},...a.label!==void 0?{label:a.label}:{}};return this.records.set(n,u),await this.persist(),this.notify(n),u}async update(n,a,l){this.assertLoaded();const u=this.records.get(n);if(!u)throw new Error(`topology: ${n} is not declared here`);if(u.version.epoch!==l.expectedVersion.epoch||u.version.revision!==l.expectedVersion.revision)throw new Error(`topology: ${n} is at revision ${u.version.revision}, not ${l.expectedVersion.revision} - read it again and decide again`);Cc(a.label),a.parent!==void 0&&(n===dt?this.checkRootParent(a.parent):this.checkParent(n,a.parent)),a.owner!==void 0&&this.checkOwner(n,a.owner);const f={...u,...a.parent!==void 0?{parent:a.parent,parentEpoch:et()}:{},...a.owner!==void 0?{owner:a.owner,ownerEpoch:et()}:{},...a.label!==void 0?{label:a.label}:{},version:{epoch:u.version.epoch,revision:u.version.revision+1}};return this.records.set(n,f),await this.persist(),this.notify(n),f}async updateHost(n,a){return this.update(dt,n,a)}checkParent(n,a){if(a===null)return;if(In(a.peer,"parent peer"),In(a.instance,"parent instance"),a.peer!==this.peer)throw new Error(`topology: ${n} cannot have a remote physical parent - only the ${dt} root may, root to root`);if(a.instance===n)throw new Error(`topology: ${n} cannot be its own parent`);const l=new Set([n]);let u=a.instance;for(;u!==void 0;){if(l.has(u))throw new Error(`topology: parenting ${n} under ${a.instance} closes a physical cycle`);l.add(u);const f=this.records.get(u);u=f?.parent&&f.parent.peer===this.peer?f.parent.instance:void 0}}checkRootParent(n){if(n!==null){if(In(n.peer,"parent peer"),In(n.instance,"parent instance"),n.peer===this.peer)throw new Error(`topology: the ${dt} root's parent is another host's root, not something on this host`);if(n.instance!==dt)throw new Error("topology: a host root's parent must be another host root - physical edges cross hosts only root to root")}}checkOwner(n,a){if(a!==null&&(In(a.peer,"owner peer"),In(a.instance,"owner instance"),a.peer===this.peer&&a.instance===n))throw new Error(`topology: ${n} cannot own itself`)}physicalPath(n){const a=this.options.place??[this.peer],l=[],u=new Set;let f=n;for(let d=0;d<=Ql;d++){if(f===void 0)return{segments:l,validity:{status:"valid"}};if(f===dt)return{segments:[...a,...l],validity:{status:"valid"}};if(u.has(f))return{segments:l,validity:{status:"cycle",path:[...u].map(y=>this.ref(y))}};u.add(f);const m=this.records.get(f);if(!m)return{segments:l,validity:{status:"unresolved",at:this.ref(f)}};l.unshift(f),f=m.parent===null?void 0:m.parent.peer===this.peer?m.parent.instance:dt}return{segments:l,validity:{status:"depth-exceeded",maxDepth:Ql}}}ownerChain(n){const a=[],l=new Set;let u=n;for(let f=0;f<=Ql;f++){if(u===void 0)return{chain:a,validity:{status:"valid"}};if(l.has(u))return{chain:a,validity:{status:"cycle",path:a.slice(a.findIndex(m=>m.instance===u))}};l.add(u);const d=this.records.get(u);if(!d)return{chain:a,validity:{status:"unresolved",at:this.ref(u)}};if(a.push(d.ref),d.owner===null)return{chain:a,validity:{status:"valid"}};if(d.owner.peer!==this.peer)return{chain:a,continuesAt:d.owner,validity:{status:"valid"}};u=d.owner.instance}return{chain:a,validity:{status:"depth-exceeded",maxDepth:Ql}}}externalStore(n){return{getSnapshot:()=>this.records.get(n),subscribe:a=>{let l=this.listeners.get(n);return l||this.listeners.set(n,l=new Set),l.add(a),()=>l.delete(a)}}}notify(n){try{this.onCommitted?.()}catch{}for(const a of[...this.listeners.get(n)??[]])try{a()}catch{}}assertLoaded(){if(!this.loaded)throw new Error("topology: not loaded yet - await the server ready()")}async persist(){await this.store.save(this.all())}}const c0=16*1024,Cp=64*1024,u0=128,Em=r=>{const n=JSON.stringify(r);return n===void 0?8:n.length};class f0 extends ei.EventEmitter{topology;providers=new Map;subscriptions=new Map;push;constructor(n){super(),this.topology=n}key(n,a){return`${n}\0${a}`}provide(n,a,l){const u=this.key(n,a.id);if(this.providers.has(u))throw new Error(`context: ${n} already provides ${a.id} - one provider owns one value`);const f=a.maxSerializedBytes??c0,d=y=>{const b=Em(y);if(b>f)throw new Error(`context: a ${a.id} value of ${b} bytes exceeds its ${f} byte bound - context is ambient data, not a payload`);return y},m={token:a,value:d(l),epoch:et(),revision:0};return this.providers.set(u,m),this.changed(),{set:y=>{m.value=d(y),m.revision++,this.changed()},clear:()=>{this.providers.get(u)===m&&(this.providers.delete(u),this.changed())}}}changed(){for(const[n,a]of this.subscriptions)a.queued||(a.queued=!0,queueMicrotask(()=>{a.queued=!1,this.subscriptions.has(n)&&(a.seq++,this.push?.(a.source,{subscriptionId:a.subscriptionId,snapshot:this.snapshotFor(a.node,a.tokenIds,a.seq,!0)}))}));this.emit("contextChanged")}walk(n,a){const l=[],u=new Set;let f=n;for(let d=0;d<=u0;d++){if(f===void 0)return{refs:l};if(u.has(f))return{refs:l,trouble:{axis:a,status:"cycle",path:l.slice(l.findIndex(b=>b.instance===f))}};u.add(f);const m=this.topology.get(f);if(!m)return{refs:l,trouble:{axis:a,status:"invalid-reference",at:{peer:this.topology.peer,instance:f}}};l.push(m.ref);const y=a==="physical"?m.parent:m.owner;if(y===null)return{refs:l};if(y.peer!==this.topology.peer)return{refs:l,continues:y};f=y.instance}return{refs:l,trouble:{axis:a,status:"depth-exceeded"}}}chainKeyOf(n,a){return n.map(l=>{const u=this.topology.get(l.instance);return u?a==="physical"?u.parentEpoch:u.ownerEpoch:"missing"}).join("\0")}snapshotFor(n,a,l,u){const f=this.walk(n,"physical"),d=this.walk(n,"logical"),m=[...f.trouble?[f.trouble]:[],...d.trouble?[d.trouble]:[]],y=a.map(b=>{const R=[];for(const[w,j]of[["physical",f.refs],["logical",d.refs]])for(const L of j){const K=this.providers.get(this.key(L.instance,b));!K||K.token.axis!==w||u&&(K.token.exposure??"remote")==="local"||R.push({node:L,axis:w,value:K.value,provider:{epoch:K.epoch,revision:K.revision}})}return{tokenId:b,entries:R}});return{node:this.topology.ref(n),walked:{physical:f.refs,logical:d.refs},continues:{...f.continues?{physical:f.continues}:{},...d.continues?{logical:d.continues}:{}},trouble:m,chainKey:{physical:this.chainKeyOf(f.refs,"physical"),logical:this.chainKeyOf(d.refs,"logical")},tokens:y,seq:l}}subscribe(n,a,l,u){const f=`${n}\0${a}`,d=this.subscriptions.get(f),m=d?++d.seq:0;return this.subscriptions.set(f,{source:n,subscriptionId:a,node:l,tokenIds:u,seq:m,queued:!1}),this.snapshotFor(l,u,m,!0)}unsubscribe(n,a){this.subscriptions.delete(`${n}\0${a}`)}dropSubscriber(n){for(const[a,l]of this.subscriptions)l.source===n&&this.subscriptions.delete(a)}get subscriptionCount(){return this.subscriptions.size}}const Ea="$context",km="$context",h0=(r,n)=>{const a=[];for(const{token:u,entry:f}of n){if((u.capture??"never")!=="explicit")throw new Error(`context: ${u.id} declares capture '${u.capture??"never"}', so it stays on its chain`);if((u.exposure??"remote")==="local")throw new Error(`context: ${u.id} is local-only, and a capture is precisely a value leaving the host`);f&&a.push(f)}const l=a.reduce((u,f)=>u+Em(f.value),0);if(l>Cp)throw new Error(`context: a capture of ${l} bytes exceeds the ${Cp} byte bound`);return{source:r,entries:a}},_n="$snapshot",Tm=new WeakMap,Zt=r=>{const n=Tm.get(r);if(!n)throw new Error("not an RpcComponent - components are constructed through the RpcComponent base class");return n},Kl=r=>Object.freeze({...r}),Up=(r,n)=>{const a=Zt(r),l=n.props??a.props,u=n.state??a.state,f=a.validate?.(l,u);if(f)throw new Error(`component snapshot rejected: ${f}`);a.props=l,a.state=u,a.revision++,a.notify?.()};class hs extends ei.EventEmitter{constructor(n,a){super(),Tm.set(this,{epoch:et(),revision:0,props:Kl(n),state:Kl(a),authority:Object.freeze({generation:0})})}get props(){return Zt(this).props}get state(){return Zt(this).state}setState=n=>{const a=this.state,l=typeof n=="function"?n(a):n;return Up(this,{state:Kl({...a,...l})}),this.state};replaceState=n=>{const a=typeof n=="function"?n(this.state):n;return Up(this,{state:Kl(a)}),this.state}}const eu=r=>{const n=Zt(r);return{epoch:n.epoch,revision:n.revision,props:n.props,state:n.state,authority:n.authority}},d0=r=>Zt(r).authority,p0=6e4,tu=(r,n,a)=>{const l=Zt(r),u=l.authority.holder;l.expiryTimer&&clearTimeout(l.expiryTimer),l.expiryTimer=void 0,l.authority=Object.freeze(n),l.revision++,n.expiresAt!==void 0&&(l.expiryTimer=setTimeout(()=>{l.expiryTimer=void 0,!(l.authority.holder!==n.holder||l.authority.generation!==n.generation)&&tu(r,{generation:l.authority.generation+1},"expired")},n.expiresAt-Date.now()),l.expiryTimer.unref?.()),r instanceof ei.EventEmitter&&r.emit("authorityChanged",{reason:a,authority:l.authority,previousHolder:u}),l.notify?.()},m0=(r,n,a,l)=>{const f=Zt(r).authority,d=Date.now(),m=f.holder!==void 0&&(f.expiresAt??0)>d;if(m&&f.holder!==n&&!l)return{granted:!1,holder:f.holder,expiresAt:f.expiresAt};const y=m&&f.holder===n;return tu(r,{holder:n,expiresAt:d+a,generation:y?f.generation:f.generation+1},y?"renewed":m?"taken":"acquired"),{granted:!0,authority:Zt(r).authority}},y0=(r,n)=>{const a=Zt(r);return a.authority.holder!==n?"ok - was not holding":(tu(r,{generation:a.authority.generation+1},"released"),"ok")},g0=1048576,v0=(r,n)=>{Zt(r).validate=n},b0=(r,n,a,l)=>{const u=Zt(r),f=n.minPublishIntervalMs??0,d=n.maxSnapshotBytes??g0;let m=!1,y=0,b;const R=()=>{y=Date.now();const w=eu(r),j=JSON.stringify(w).length;if(j>d){l?.log("Error","component snapshot not published: {estimated} bytes exceeds the {maxBytes} byte bound",{estimated:j,maxBytes:d});return}a()};u.notify=()=>{m||(m=!0,queueMicrotask(()=>{m=!1;const w=y+f-Date.now();if(w<=0)return R();b||(b=setTimeout(()=>{b=void 0,R()},w),b.unref?.())}))}},w0=1,Dp=32,Gt=r=>r===null?"null":Array.isArray(r)?"array":r instanceof Uint8Array?"bytes":r instanceof Date?"date":typeof r,Sa=r=>{switch(r.kind){case"literal":return JSON.stringify(r.value);case"array":return`${Sa(r.items)}[]`;case"tuple":return`[${r.items.map(Sa).join(", ")}]`;case"union":return r.options.map(Sa).join(" | ");case"ref":return r.name;case"object":return"object";case"record":return`{ [key: string]: ${Sa(r.values)} }`;default:return r.kind}},Bp=r=>typeof r=="object"&&r!==null&&!Array.isArray(r)&&!(r instanceof Uint8Array)&&!(r instanceof Date),tn=(r,n,a={},l="",u=0)=>{if(u>Dp)return`${l||"value"}: nested deeper than ${Dp} levels`;const f=l||"value";switch(n.kind){case"any":return;case"null":return r===null?void 0:`${f}: expected null, got ${Gt(r)}`;case"boolean":return typeof r=="boolean"?void 0:`${f}: expected boolean, got ${Gt(r)}`;case"number":return typeof r!="number"||Number.isNaN(r)?`${f}: expected number, got ${Gt(r)}`:n.integer&&!Number.isInteger(r)?`${f}: expected an integer, got ${r}`:n.min!==void 0&&r<n.min?`${f}: ${r} is below the minimum ${n.min}`:n.max!==void 0&&r>n.max?`${f}: ${r} is above the maximum ${n.max}`:void 0;case"string":return typeof r!="string"?`${f}: expected string, got ${Gt(r)}`:n.minLength!==void 0&&r.length<n.minLength?`${f}: shorter than ${n.minLength} characters`:n.maxLength!==void 0&&r.length>n.maxLength?`${f}: longer than ${n.maxLength} characters`:n.pattern!==void 0&&!new RegExp(n.pattern).test(r)?`${f}: does not match ${n.pattern}`:void 0;case"bytes":return r instanceof Uint8Array?n.maxBytes!==void 0&&r.length>n.maxBytes?`${f}: longer than ${n.maxBytes} bytes`:void 0:`${f}: expected bytes, got ${Gt(r)}`;case"date":return r instanceof Date&&!Number.isNaN(r.getTime())?void 0:`${f}: expected a date, got ${Gt(r)}`;case"literal":return r===n.value?void 0:`${f}: expected ${JSON.stringify(n.value)}`;case"array":{if(!Array.isArray(r))return`${f}: expected an array, got ${Gt(r)}`;if(n.maxItems!==void 0&&r.length>n.maxItems)return`${f}: more than ${n.maxItems} items`;for(let d=0;d<r.length;d++){const m=tn(r[d],n.items,a,`${f}[${d}]`,u+1);if(m)return m}return}case"tuple":{if(!Array.isArray(r))return`${f}: expected a tuple, got ${Gt(r)}`;if(r.length!==n.items.length)return`${f}: expected ${n.items.length} elements, got ${r.length}`;for(let d=0;d<n.items.length;d++){const m=tn(r[d],n.items[d],a,`${f}[${d}]`,u+1);if(m)return m}return}case"object":{if(!Bp(r))return`${f}: expected an object, got ${Gt(r)}`;const d=r;for(const[m,y]of Object.entries(n.fields)){if(!(d[m]!==void 0)){if(y.optional)continue;return`${f}.${m}: missing`}const R=tn(d[m],y.type,a,`${f}.${m}`,u+1);if(R)return R}if(!n.additional){const m=Object.keys(d).find(y=>!(y in n.fields));if(m!==void 0)return`${f}.${m}: not part of this type`}return}case"record":{if(!Bp(r))return`${f}: expected an object, got ${Gt(r)}`;const d=Object.keys(r);if(n.maxEntries!==void 0&&d.length>n.maxEntries)return`${f}: more than ${n.maxEntries} entries`;const m=n.keyPattern===void 0?void 0:new RegExp(n.keyPattern);for(const y of d){if(m&&!m.test(y))return`${f}.${y}: key does not match ${n.keyPattern}`;const b=tn(r[y],n.values,a,`${f}.${y}`,u+1);if(b)return b}return}case"union":{for(const d of n.options)if(!tn(r,d,a,f,u+1))return;return`${f}: expected ${Sa(n)}, got ${Gt(r)}`}case"ref":{const d=a[n.name];return d?tn(r,d,a,f,u+1):`${f}: unknown type '${n.name}'`}}return`${f}: unknown type kind '${n.kind}'`},S0=(r,n,a={})=>{const l=n.params.filter((u,f)=>!x0(n.params[f])).length;if(r.length<l)return`expected at least ${l} argument${l===1?"":"s"}, got ${r.length}`;if(r.length>n.params.length&&!n.rest)return`expected at most ${n.params.length} arguments, got ${r.length}`;for(let u=0;u<r.length;u++){const f=u<n.params.length?n.params[u]:n.rest,d=tn(r[u],f,a,`argument ${u}`);if(d)return d}},x0=r=>r.kind==="any"||r.kind==="union"&&r.options.some(n=>n.kind==="literal"&&n.value===null),Gc=(r,n)=>r.kind==="ref"?Gc(n?.[r.name]??{kind:"any"},n):r,qp=(r,n)=>!(n.integer&&!r.integer||n.min!==void 0&&(r.min===void 0||r.min<n.min)||n.max!==void 0&&(r.max===void 0||r.max>n.max)),Kt=(r,n,a={},l=0,u=new Set)=>{if(l>64)return!1;if(r.kind==="ref"&&n.kind==="ref"){const m=`${r.name} <: ${n.name}`;if(u.has(m))return!0;u.add(m)}const f=Gc(r,a),d=Gc(n,a);if(d.kind==="any")return!0;if(f.kind==="any")return!1;if(f.kind==="union")return f.options.every(m=>Kt(m,d,a,l+1,u));if(d.kind==="union")return d.options.some(m=>Kt(f,m,a,l+1,u));if(f.kind==="literal")return d.kind==="literal"?f.value===d.value:(f.value===null?"null":typeof f.value)!==d.kind?!1:d.kind==="number"&&typeof f.value=="number"?qp({min:f.value,max:f.value,integer:Number.isInteger(f.value)},d):!0;if(f.kind!==d.kind)return!1;switch(f.kind){case"null":case"boolean":case"date":return!0;case"number":return qp(f,d);case"string":{const m=d;return!(m.minLength!==void 0&&(f.minLength===void 0||f.minLength<m.minLength)||m.maxLength!==void 0&&(f.maxLength===void 0||f.maxLength>m.maxLength)||m.pattern!==void 0&&m.pattern!==f.pattern)}case"bytes":{const m=d;return m.maxBytes===void 0||f.maxBytes!==void 0&&f.maxBytes<=m.maxBytes}case"array":{const m=d;return m.maxItems!==void 0&&(f.maxItems===void 0||f.maxItems>m.maxItems)?!1:Kt(f.items,m.items,a,l+1,u)}case"tuple":{const m=d;return f.items.length!==m.items.length?!1:f.items.every((y,b)=>Kt(y,m.items[b],a,l+1,u))}case"record":{const m=d;return m.maxEntries!==void 0&&(f.maxEntries===void 0||f.maxEntries>m.maxEntries)||m.keyPattern!==void 0&&m.keyPattern!==f.keyPattern?!1:Kt(f.values,m.values,a,l+1,u)}case"object":{const m=d;for(const[y,b]of Object.entries(m.fields)){const R=f.fields[y];if(!R){if(b.optional)continue;return!1}if(!b.optional&&R.optional||!Kt(R.type,b.type,a,l+1,u))return!1}if(!m.additional){for(const y of Object.keys(f.fields))if(!(y in m.fields))return!1}return!0}default:return!1}},Zl=r=>r.params.filter(n=>!(n.kind==="any"||n.kind==="union"&&n.options.some(a=>a.kind==="literal"&&a.value===null))).length,E0=(r,n,a,l)=>{const u=[];!a.rest&&a.params.length<n.params.length&&u.push({where:r,reason:`takes at most ${a.params.length} arguments, but a caller may send ${n.params.length}`}),Zl(a)>Zl(n)&&u.push({where:r,reason:`requires ${Zl(a)} arguments, but a caller may send as few as ${Zl(n)}`});for(let m=0;m<n.params.length;m++){const y=m<a.params.length?a.params[m]:a.rest;y&&(Kt(n.params[m],y,l)||u.push({where:`${r} argument ${m}`,reason:"narrowed, so a value the caller may send is no longer accepted"}))}n.returns&&a.returns&&!Kt(a.returns,n.returns,l)&&u.push({where:`${r} return`,reason:"widened, so a value this contract may return is not one the caller expects"});const f=n.semantics,d=a.semantics;return f&&d&&Gl[d]>Gl[f]&&u.push({where:r,reason:`is now ${d} where the caller was told ${f}, so a retry the caller may already make is no longer safe`}),f&&!d&&Gl[f]<Gl["non-repeatable-command"]&&u.push({where:r,reason:`no longer declares that it is ${f}, so a caller relying on that promise has nothing to rely on`}),u},k0=(r,n,a={})=>{const l=[];for(const[u,f]of Object.entries(r.methods)){const d=n.methods[u];if(!d){l.push({where:u,reason:"no longer exists"});continue}l.push(...E0(u,f,d,a))}for(const[u,f]of Object.entries(r.events??{})){const d=n.events?.[u];if(!d){l.push({where:`event ${u}`,reason:"is no longer emitted, so a subscription to it would never fire"});continue}for(let m=0;m<d.params.length;m++){const y=f.params[m];if(!y){l.push({where:`event ${u} argument ${m}`,reason:"is emitted but the caller does not expect it"});continue}Kt(d.params[m],y,a)||l.push({where:`event ${u} argument ${m}`,reason:"widened, so a value this contract may emit is not one the caller expects"})}}for(const u of r.capabilities??[])n.capabilities?.includes(u)||l.push({where:`capability ${u}`,reason:"is no longer declared, so whatever found this peer by it will stop finding it"});return r.component&&(n.component?(Kt(n.component.props,r.component.props,a)||l.push({where:"component props",reason:"widened, so a snapshot this contract may serve is not one the observer expects"}),Kt(n.component.state,r.component.state,a)||l.push({where:"component state",reason:"widened, so a snapshot this contract may serve is not one the observer expects"})):l.push({where:"component",reason:"is no longer served, so an observer would wait forever for a snapshot"})),l},T0=(r,n,a,l)=>l.length?`${r}@${n} is not compatible with ${r}@${a??"current"}: `+l.map(u=>`${u.where} ${u.reason}`).join("; "):void 0;class _0{rpcServer;instance;event;target;instanceName;listener=(...n)=>{this.rpcServer.sendEvent(this.target,this.event,n,this.instanceName).catch(a=>this.rpcServer.emit("deliveryError",{target:this.target,event:this.event,path:this.instanceName,error:a}))};constructor(n,a,l,u,f){this.rpcServer=n,this.instance=a,this.event=l,this.target=u,this.instanceName=f}attach(){this.instance.on(this.event,this.listener)}detach(){this.instance.removeListener(this.event,this.listener)}}const Lp=(r,n,a)=>`${r}\0${n}\0${a}`,Hp=r=>r.type===Xe.CallInstanceMethod,A0=100,N0=new Set(["Unauthorized","Forbidden","InvalidParams","IncompatibleVersion","ClassNotFound","MethodNotFound","TransportError","Timeout","UnknownOutcome"]),O0=r=>{const n=r?.code;return typeof n=="string"&&N0.has(n)?n:"Exception"};class j0 extends bm{manageRpc=new R0;eventProxies=new Map;epoch=typeof globalThis.crypto?.randomUUID=="function"?globalThis.crypto.randomUUID().slice(0,8):et().slice(0,8);eventSequences=new Map;eventCounters=new Map;eventTracked=new Map;eventSequenceKey(n,a){return`${n}\0${a}`}trackEvent(n,a){if(a===_n)return;const l=this.eventSequenceKey(n,a);if(this.eventCounters.has(l))return;const u=this.manageRpc.exposedNameSpaceInstances[n];if(!(u instanceof Il))return;const f=()=>this.eventSequences.set(l,(this.eventSequences.get(l)??0)+1);this.eventCounters.set(l,f),this.eventSequences.set(l,this.eventSequences.get(l)??0),this.eventTracked.set(l,Date.now()),u.on(a,f)}eventTrackedSince(n,a){return this.eventTracked.get(this.eventSequenceKey(n,a))}trackDeclaredEvents(){for(const[n,a]of Object.entries(this.schema?.namespaces??{}))if(this.manageRpc.exposedNameSpaceInstances[n])for(const l of Object.keys(a.events??{}))this.trackEvent(n,l)}eventSequenceOf(n,a){return this.eventSequences.get(this.eventSequenceKey(n,a))}authorize;resolveIdentity;requireIdentity=!1;deduplicateRequests=!0;maxTrackedRequests=1e3;refuseExpiredCalls=!0;idempotency;schema;validation="described";hostTopology;hostContext;allowTopologyMutation=!1;validateResults=!1;unknownVersion="allow";compatibility=new Map;recentResponses=new Map;inFlightRequests=new Set;constructor(n,a){super(n,a),this.manageRpc.logger?.log("Information","RpcServerHandler {name} starting",{name:n})}async checkAccess(n,a,l){const u=this.resolveIdentity?.(a);if(this.requireIdentity&&!u)return"Unauthorized";if(!this.authorize)return;const f={identity:u,source:a,instanceName:n.path,method:n.method,params:n.params,subscription:l};try{return await this.authorize(f)?void 0:"Forbidden"}catch{return"Forbidden"}}checkParams(n){if(!this.schema||this.validation==="off")return;const a=this.schema.namespaces[n.path];if(!a)return this.validation==="required"?`${n.path} is not described by the schema`:void 0;if(a.validate===!1)return;const l=a.methods[n.method];if(!l)return this.validation==="required"?`${n.path}.${n.method} is not described by the schema`:void 0;const u=S0(n.params,l,this.schema.types);if(u)return a.version?`${u} (this server serves ${n.path}@${a.version})`:u}checkVersion(n){if(!this.schema||this.validation==="off"||!n.version)return;const a=this.schema.namespaces[n.path];if(!a||n.version===a.version)return;const l=`${n.path}@${n.version}`;if(this.compatibility.has(l))return this.compatibility.get(l);const u=a.history?.[n.version];let f;return u?f=T0(n.path,n.version,a.version,k0(u,a,this.schema.types)):f=this.unknownVersion==="reject"?`${n.path}@${n.version} is unknown to this server, which serves ${n.path}@${a.version??"an unversioned contract"}`:void 0,this.compatibility.set(l,f),f}async receive(n,a,l){this.manageRpc.logger?.log("Debug","RpcServerHandler {name} received message type {type} from {source} to {target}: {message}",{name:this.name,type:n.type,source:a,target:l,message:JSON.stringify(n)}),n.payload&&this.receivePayload(n.payload,a,l).catch(u=>this.emit("handlerError",{source:a,target:l,error:u}))}respond(n,a,l,u){if(this.deduplicateRequests)for(this.inFlightRequests.delete(n),this.recentResponses.set(n,l);this.recentResponses.size>this.maxTrackedRequests;){const f=this.recentResponses.keys().next();if(f.done)break;this.recentResponses.delete(f.value)}return this.sendPayload(l,u,this.name,a)}async receivePayload(n,a,l){try{await this.dispatch(n,a,l)}catch(u){await this.reportDispatchFailure(n,a,u)}}async reportDispatchFailure(n,a,l){this.emit("handlerError",{source:a,payload:n,error:l});const u=n.id;if(!(!Hp(n)||!u)){this.deduplicateRequests&&this.inFlightRequests.delete(u);try{await this.sendPayload({type:Xe.error,id:u,code:"Exception",error:Mc(l)},We.ErrorMessage,this.name,a)}catch{}}}async dispatch(n,a,l){const u=Date.now();if(Hp(n)){if(this.deduplicateRequests){const L=this.recentResponses.get(n.id);if(L){const K=L.code?We.ErrorMessage:We.ResponseMessage;await this.sendPayload(L,K,this.name,a);return}if(this.inFlightRequests.has(n.id))return;this.inFlightRequests.add(n.id)}const f=this.manageRpc.findNameSpaceMethodMap(n.path),d=f?.get(n.method);if(!d){const L=n.path,K=n.params[0],P=this.manageRpc.exposedNameSpaceInstances[L];if(n.method==="on"&&K===_n&&P&&!(P instanceof hs)){await this.sendError(n.id,a,"ClassNotFound",`${n.path} is not an observable component`);return}if(n.method==="on"&&P instanceof Il){const W=await this.checkAccess(n,a,!0);if(W){await this.sendError(n.id,a,W,`not permitted to subscribe to ${n.path}.${K}`);return}const z=Lp(L,K,a);let X=this.eventProxies.get(z),J="ok - already exists";X||(this.trackEvent(L,K),X=new _0(this,P,K,a,L),this.eventProxies.set(z,X),X.attach(),J="ok"),K===_n&&await this.sendEvent(a,_n,[eu(P)],L),await this.respond(n.id,a,{type:Xe.success,result:J,id:n.id},We.ResponseMessage)}else if((n.method==="off"||n.method==="removeListener")&&P instanceof Il){const W=Lp(L,K,a),z=this.eventProxies.get(W);z&&(z.detach(),this.eventProxies.delete(W)),await this.respond(n.id,a,{type:Xe.success,result:z?"ok":"ok - was not subscribed",id:n.id},We.ResponseMessage)}else if(n.path===Ea&&(n.method==="read"||n.method==="subscribe"||n.method==="unsubscribe")){if(!this.hostContext){await this.sendError(n.id,a,"ClassNotFound","this host serves no context");return}const W=await this.checkAccess(n,a,!1);if(W){await this.sendError(n.id,a,W,`not permitted to call ${n.path}.${n.method}`);return}const z=J=>Array.isArray(J)?J.map(String):[];let X;n.method==="read"?X=this.hostContext.snapshotFor(String(n.params[0]),z(n.params[1]),0,!0):n.method==="subscribe"?X=this.hostContext.subscribe(a,String(n.params[0]),String(n.params[1]),z(n.params[2])):(this.hostContext.unsubscribe(a,String(n.params[0])),X="ok"),await this.respond(n.id,a,{type:Xe.success,result:X,id:n.id},We.ResponseMessage)}else if((n.method==="$acquire"||n.method==="$release")&&P){if(!(P instanceof hs)){await this.sendError(n.id,a,"ClassNotFound",`${n.path} is not an observable component, so it has no authority to hold`);return}const W=await this.checkAccess(n,a,!1);if(W){await this.sendError(n.id,a,W,`not permitted to call ${n.path}.${n.method}`);return}if(n.method==="$acquire"){const z=n.params[0]??p0;if(typeof z!="number"||!Number.isFinite(z)||z<=0){await this.sendError(n.id,a,"InvalidParams","$acquire: the lease must expire, so its ttl is a positive number of milliseconds");return}const X=n.params[1]?.take===!0,J=m0(P,a,z,X);if(!J.granted){await this.sendError(n.id,a,"NotInControl",`${n.path} is controlled by ${J.holder} until ${new Date(J.expiresAt).toISOString()}`);return}await this.respond(n.id,a,{type:Xe.success,result:J.authority,id:n.id},We.ResponseMessage)}else{const z=y0(P,a);await this.respond(n.id,a,{type:Xe.success,result:z,id:n.id},We.ResponseMessage)}}else await this.sendError(n.id,a,f?"MethodNotFound":"ClassNotFound",`${n.path}.${n.method} is not exposed`);return}const m=await this.checkAccess(n,a,!1);if(m){await this.sendError(n.id,a,m,`not permitted to call ${n.path}.${n.method}`);return}const y=this.checkVersion(n);if(y){await this.sendError(n.id,a,"IncompatibleVersion",y);return}const b=this.checkParams(n);if(b){await this.sendError(n.id,a,"InvalidParams",b);return}const R=this.authorityRefusal(n,a);if(R){await this.sendError(n.id,a,"NotInControl",R);return}const w=this.fenceRefusal(n);if(w){await this.sendError(n.id,a,"OwnershipChanged",w);return}const j=this.executionKey(n,a);j===void 0?await this.invoke(n,a,u,d):await this.enqueue(j,n,a,u,d)}}async enqueue(n,a,l,u,f){const d=this.manageRpc.exposedConflation[a.path]?.has(a.method)?`${n}\0${a.method}`:void 0;let m=!1;if(d){const j=this.conflatable.get(d);j&&(j.supersede(),m=!0)}const y=this.executionWaiting.get(n)??0,b=this.manageRpc.exposedMailbox[a.path]??A0;if(!m&&y>=b){await this.sendError(a.id,l,"Busy",`${a.path}.${a.method} was not queued: ${y} calls are already waiting on this instance`);return}let R=!1;const w=d?{supersede:()=>{R=!0,this.sendError(a.id,l,"Superseded",`${a.path}.${a.method} was superseded by a newer call before it ran`).catch(()=>{})}}:void 0;d&&w&&this.conflatable.set(d,w),this.executionWaiting.set(n,y+1),await this.serialise(n,async()=>{const j=this.executionWaiting.get(n)??1;j<=1?this.executionWaiting.delete(n):this.executionWaiting.set(n,j-1),d&&this.conflatable.get(d)===w&&this.conflatable.delete(d),!R&&await this.invoke(a,l,u,f)})}executionWaiting=new Map;conflatable=new Map;async invoke(n,a,l,u){const f=this.expiredBy(n,l);if(f!==void 0){await this.sendError(n.id,a,"Timeout",`${n.path}.${n.method} was not run: its caller stopped waiting ${f} ms ago`);return}const d=this.authorityRefusal(n,a);if(d){await this.sendError(n.id,a,"NotInControl",d);return}const m=this.fenceRefusal(n);if(m){await this.sendError(n.id,a,"OwnershipChanged",m);return}const y=this.invocationFor(n,a);let b=!1;if(y){let j;try{j=await this.idempotency.begin(y)}catch(L){await this.sendError(n.id,a,"UnknownOutcome",`${n.path}.${n.method} was not run: its idempotency store could not be reached (${L instanceof Error?L.message:String(L)})`);return}if(j==="in-progress"){this.inFlightRequests.delete(n.id);return}if(j!=="acquired"){const L=Iv(j)?{type:Xe.error,id:n.id,code:j.code,error:j.error}:{type:Xe.success,id:n.id,result:j.result};await this.respond(n.id,a,L,L.type===Xe.error?We.ErrorMessage:We.ResponseMessage);return}b=!0}const R=[...n.params];if(this.manageRpc.exposedInjection[n.path]?.has(n.method)){for(;R.length<u.length-1;)R.push(void 0);const j=Object.freeze({[l0]:!0,context:Object.freeze({requestId:n.id,source:a,...this.resolveIdentity?.(a)?{identity:this.resolveIdentity(a)}:{},...n.ttl!==void 0?{ttl:n.ttl}:{},...n.idempotencyKey?{idempotencyKey:n.idempotencyKey}:{}})});R.push(j)}let w;try{w=await u(...R);const j=this.checkResult(n,w);if(j){await this.settle(y,b,{code:"InvalidParams",error:{name:"RpcError",message:j}}),await this.sendError(n.id,a,"InvalidParams",j);return}await this.settle(y,b,{result:w}),await this.respond(n.id,a,{type:Xe.success,id:n.id,result:w},We.ResponseMessage)}catch(j){const L=O0(j);await this.settle(y,b,{code:L,error:Mc(j)}),await this.respond(n.id,a,{type:Xe.error,id:n.id,code:L,error:Mc(j)},We.ErrorMessage)}}async settle(n,a,l){if(!(!n||!a))try{await this.idempotency.complete(n,l)}catch(u){this.emit("idempotencyError",{invocation:n,outcome:l,error:u})}}invocationFor(n,a){if(!(!this.idempotency||this.semanticsOf(n)!=="non-repeatable-command"))return{idempotencyKey:n.idempotencyKey??n.id,requestId:n.id,scope:`${n.path}.${n.method}`,source:a,...n.ttl!==void 0?{ttl:n.ttl}:{}}}authorityRefusal(n,a){if(!this.manageRpc.exposedAuthority[n.path]?.has(n.method))return;const l=this.manageRpc.exposedNameSpaceInstances[n.path];if(!(l instanceof hs))return;const u=d0(l),f=u.holder!==void 0&&(u.expiresAt??0)>Date.now();if(!(f&&u.holder===a))return f?`${n.path}.${n.method} requires authority: ${u.holder} is in control`:`${n.path}.${n.method} requires authority: nobody is in control - $acquire it first`}fenceRefusal(n){const a=n.fence;if(!a)return;const l=this.hostTopology?.get(n.path);if(!l)return`${n.path} has no topology record here to check the owner fence against`;if(l.ownerEpoch!==a.ownerEpoch)return`${n.path} changed owner generation while this call was on its way - read the topology again and decide again`}semanticsOf(n){return this.manageRpc.exposedSemantics[n.path]?.get(n.method)??this.schema?.namespaces[n.path]?.methods[n.method]?.semantics}executionKey(n,a){const l=this.manageRpc.exposedExecution[n.path];if(!l){const f=this.semanticsOf(n);return f==="idempotent-command"||f==="non-repeatable-command"?n.path:void 0}if(l==="parallel")return;if(l==="serial")return n.path;const u={identity:this.resolveIdentity?.(a),source:a,instanceName:n.path,method:n.method,params:n.params,subscription:!1};try{return`${n.path}\0${l(u)}`}catch{return n.path}}executionQueues=new Map;async serialise(n,a){const l=this.executionQueues.get(n)??Promise.resolve();let u;const f=new Promise(m=>u=m),d=l.then(()=>f);this.executionQueues.set(n,d),await l;try{return await a()}finally{u(),this.executionQueues.get(n)===d&&this.executionQueues.delete(n)}}expiredBy(n,a){if(!this.refuseExpiredCalls||n.ttl===void 0||!Number.isFinite(n.ttl)||n.ttl<0)return;const l=Date.now()-(a+n.ttl);return l>0?l:void 0}checkResult(n,a){if(!this.validateResults||!this.schema)return;const l=this.schema.namespaces[n.path]?.methods[n.method]?.returns;if(!l)return;const u=tn(a,l,this.schema.types,"result");return u?`${n.path}.${n.method} returned a value its own schema forbids: ${u}`:void 0}sendError(n,a,l,u){return this.respond(n,a,{type:Xe.error,id:n,code:l,error:{name:"RpcError",message:u}},We.ErrorMessage)}removePeer(n){for(const[a,l]of this.eventProxies)l.target===n&&(l.detach(),this.eventProxies.delete(a))}async sendEvent(n,a,l,u){const f=u?this.eventSequenceOf(u,a):void 0;return await this.sendPayload({type:Xe.event,event:a,params:l,path:u,...f!==void 0?{seq:f,epoch:this.epoch}:{}},We.EventMessage,this.name,n)}}class R0{logger;exposedNameSpaceMethodMaps={};exposedNameSpaceInstances={};exposedClasses={};createdInstances=new Map;exposedSemantics={};exposedExecution={};exposedConflation={};exposedAuthority={};exposedInjection={};exposedMailbox={};componentContractFor;constructor(n){this.logger=n}exposeManagement(){this.getNameSpaceMethodMap("manageRpc").set("createRpcInstance",(...a)=>this.createRpcInstance(a[0],a[1],...a.slice(2))),this.exposedNameSpaceInstances.manageRpc=this}getNameSpaceMethodMap(n){let a=this.exposedNameSpaceMethodMaps[n];return a||(a=new Map,this.exposedNameSpaceMethodMaps[n]=a),a}findNameSpaceMethodMap(n){return this.exposedNameSpaceMethodMaps[n]}requireExplicitExposure=!1;exposeClassInstance(n,a,l){const u=e0(n),f=a??u?.name;if(!f)throw new Error(`exposeClassInstance: ${n.constructor.name} declares no @rpcNamespace, so a name is required`);const d=typeof l=="number"?{prototypeSteps:l}:l??{};let m=d.prototypeSteps;const y=t0(n);if(!y&&this.requireExplicitExposure)throw new Error(`exposeClassInstance: ${n.constructor.name} marks no @rpc methods and requireExplicitExposure is on`);this.exposedNameSpaceInstances[f]=n;const b=d.execution??u?.execution;b&&(this.exposedExecution[f]=b);const R=n0(n);R.size&&(this.exposedSemantics[f]=R);const w=i0(n);if(w.size){for(const X of w)if(R.get(X)!=="idempotent-command")throw new Error(`exposeClassInstance: ${f}.${X} declares conflate without 'idempotent-command' semantics - only a command that is free to repeat is free to skip`);this.exposedConflation[f]=w}const j=s0(n);if(j.size){if(!(n instanceof hs))throw new Error(`exposeClassInstance: ${f}.${[...j][0]} declares requiresAuthority, but ${n.constructor.name} is not an RpcComponent - there is no authority to check against`);this.exposedAuthority[f]=j}const L=a0(n);L.size&&(this.exposedInjection[f]=L);const K=d.mailbox??u?.mailbox;if(K!==void 0){if(!Number.isInteger(K)||K<1)throw new Error(`exposeClassInstance: ${f} declares a mailbox of ${K}; the bound is a positive count of waiting calls`);this.exposedMailbox[f]=K}if(n instanceof hs){const X=this.componentContractFor?.(f);X&&v0(n,(J,N)=>tn(J,X.component.props,X.types,"props")??tn(N,X.component.state,X.types,"state")),b0(n,d.component??{},()=>{n.emit(_n,eu(n))},this.logger)}let P=Object.getOwnPropertyNames(n.constructor.prototype),W=Object.getPrototypeOf(n.constructor.prototype);for(;W&&W.constructor.name!=="Object"&&W.constructor.name!=="EventEmitter";){const X=Object.getOwnPropertyNames(W);if(P=P.concat(X),W=Object.getPrototypeOf(W),m&&m--===0)break}const z=this.getNameSpaceMethodMap(f);for(const X of P)X==="constructor"||typeof n[X]!="function"||y&&!y.has(X)||z.set(X,n[X].bind(n))}exposeClass(n,a){let l=n.name;a&&(l=a),this.exposedClasses[l]=n}exposeObject(n,a){this.exposedNameSpaceInstances[a]=n;const l=Object.getOwnPropertyNames(n);for(const u of l)u!=="constructor"&&typeof n[u]=="function"&&this.getNameSpaceMethodMap(a).set(u,n[u])}expose(n,a){this.getNameSpaceMethodMap(n).set(n,a)}async createRpcInstance(n,a,...l){let u="";const f=this.exposedClasses[n];if(f){const d=a||et(),m=new f(...l);this.createdInstances.set(d,m),this.exposeClassInstance(m,d),u=d}return u}}const _m=1e4,Pl=(r,n,a)=>`${r}\0${n}\0${a}`;class ma extends Error{code;remoteStack;constructor(n,a,l){super(a?`${n}: ${a}`:n),this.code=n,this.remoteStack=l,this.name="RpcError"}}function z0(r){return r.type===Xe.success}function M0(r){return r.type===Xe.event}function C0(r){return r.type===Xe.error}class U0 extends bm{callTimeout;responsePromiseMap=new Map;responseTimeoutMap=new Map;schemaVersions;subscriptions=new Map;eventEmitter=new ei.EventEmitter;constructor(n,a,l=_m){super(n,a),this.callTimeout=l}async receive(n,a,l){const u=n.payload;if(u){if(M0(u)){this.deliverEvent(u,a);return}if(z0(u)){this.takePending(u.id)?.resolve(u.result);return}C0(u)&&this.takePending(u.id)?.reject(new ma(u.code,u.error?.message,u.error?.stack))}}lastDeliveredStamp;deliverEvent(n,a){this.lastDeliveredStamp=n.seq!==void 0&&n.epoch?{peer:a??"",...n.path?{namespace:n.path}:{},event:n.event,seq:n.seq,epoch:n.epoch}:void 0;const l=this.eventEmitter;if(l instanceof ei.EventEmitter){const u=a??"",f=n.path?[Pl(u,n.path,n.event),Pl("",n.path,n.event)]:l.eventNames().filter(d=>typeof d=="string").filter(d=>{const[m,,y]=d.split("\0");return y===n.event&&(m===u||m==="")});for(const d of new Set(f))this.deliverSafely(()=>l.emit(d,...n.params),n)}this.deliverSafely(()=>this.emit(n.event,n.params),n)}deliverSafely(n,a){try{n()}catch(l){this.emit("subscriberError",{event:a.event,path:a.path,error:l})}}async resubscribe(){const n=[...this.subscriptions.values()],a=await Promise.allSettled(n.map(u=>this.call(u.remote,u.instanceName,"on",u.event))),l=a.flatMap((u,f)=>u.status==="rejected"?[{peer:n[f].remote,namespace:n[f].instanceName,event:n[f].event,error:u.reason}]:[]);return l.length&&this.emit("resubscribeFailed",l),a.length-l.length}failPendingCalls(n){for(const a of[...this.responsePromiseMap.keys()]){const l=this.sentRequests.has(a);this.sentRequests.delete(a),this.takePending(a)?.reject(l?new ma("UnknownOutcome",`${n}, after the request was sent - it may or may not have run`):new ma("TransportError",`${n}, before the request was sent`))}}sentRequests=new Set;takePending(n){if(n===void 0)return;const a=this.responsePromiseMap.get(n);this.responsePromiseMap.delete(n),this.sentRequests.delete(n);const l=this.responseTimeoutMap.get(n);return l!==void 0&&(clearTimeout(l),this.responseTimeoutMap.delete(n)),a}call(n,a,l,...u){return this.callWith({},n,a,l,...u)}callWith(n,a,l,u,...f){const d=n.timeoutMs??this.callTimeout;if(!Number.isInteger(d)||d<0)return Promise.reject(new Error(`${l}.${u}: timeoutMs must be a finite non-negative integer, not ${String(n.timeoutMs)}`));const m={id:et(),type:Xe.CallInstanceMethod,path:l,method:u,params:f,version:this.schemaVersions?.[l],ttl:d>0?d:void 0,...n.idempotencyKey?{idempotencyKey:n.idempotencyKey}:{},...n.ownerEpoch?{fence:{ownerEpoch:n.ownerEpoch}}:{}};return new Promise((y,b)=>{this.responsePromiseMap.set(m.id,{resolve:y,reject:b}),d>0&&this.responseTimeoutMap.set(m.id,setTimeout(()=>{this.takePending(m.id)?.reject(new ma("Timeout",`no response to ${l}.${u} within ${d} ms`))},d)),this.sendPayload(m,We.RequestMessage,this.name,a).then(()=>{this.responsePromiseMap.has(m.id)&&this.sentRequests.add(m.id)},R=>{this.takePending(m.id)?.reject(new ma("TransportError",R instanceof Error?R.message:String(R)))})})}proxy(n,a,l={}){const u={};return new Proxy(u,{get:(f,d)=>{let m;if(typeof d=="string"){if(f[d])return f[d];if(d==="then")return;d==="$with"?f[d]=y=>this.proxy(n,a,{...l,...y}):Wv(d)?f[d]=(...y)=>{const b=y[0];if(typeof b=="string"){const R=Pl(a??"",n,b);if(this.eventEmitter[d](R,...y.slice(1)),d==="on")this.subscriptions.set(R,{remote:a,instanceName:n,event:b});else if(d==="off"||d==="removeListener"){if(this.eventEmitter.listenerCount(R)>0)return Promise.resolve("ok - other local handlers remain");this.subscriptions.delete(R)}}else this.eventEmitter[d](...y);return this.call(a,n,d,y[0])}:f[d]=(...y)=>this.callWith(l,a,n,d,...y),m=f[d]}return m}})}}const Am=Symbol("@source-repo/rpc/component");class D0{namespace;target;release;view={epoch:"",revision:-1,props:Object.freeze({}),state:Object.freeze({}),status:"initializing",receivedAt:0};users=0;inner;store;first;listeners=new Set;retired=new Set;settleFirst;handler=n=>this.accept(n);constructor(n,a,l,u){this.namespace=a,this.target=l,this.release=u,this.inner=n.proxy(a,l),this.first=new Promise(f=>this.settleFirst=f),this.store={getSnapshot:()=>this.view,subscribe:f=>(this.listeners.add(f),()=>this.listeners.delete(f)),close:()=>this.close()}}async open(){await this.inner.on(_n,this.handler),await this.first}accept(n){this.view.status!=="closed"&&(this.retired.has(n.epoch)||this.view.epoch===n.epoch&&n.revision<=this.view.revision||(this.view.epoch&&this.view.epoch!==n.epoch&&this.retired.add(this.view.epoch),this.view={...n,status:"live",receivedAt:Date.now()},this.settleFirst(),this.notify()))}markStale(){this.view.status==="live"&&(this.view={...this.view,status:"stale",staleSince:Date.now()},this.notify())}async close(){this.users>0&&this.users--,!(this.users>0)&&(this.view={...this.view,status:"closed"},this.notify(),this.release(),await this.inner.off(_n,this.handler).catch(()=>{}))}markClosed(){this.view.status!=="closed"&&(this.view={...this.view,status:"closed"},this.notify())}notify(){for(const n of[...this.listeners])try{n()}catch{}}}class B0{handler;channels=new Map;constructor(n,a){this.handler=n,a.on(_e.disconnected,()=>{for(const l of this.channels.values())l.markStale()});for(const l of[_e.peerGone,_e.peerDisplaced])a.on(l,u=>{for(const f of this.channels.values())f.target===u&&f.markStale()})}async open(n,a){const l=`${a??""}\0${n}`;let u=this.channels.get(l);if(u)await u.first;else{u=new D0(this.handler,n,a,()=>{this.channels.delete(l)}),this.channels.set(l,u);try{await u.open()}catch(f){throw this.channels.delete(l),f}}return u.users++,u}closeAll(){for(const n of this.channels.values())n.markClosed();this.channels.clear()}}const Nm=(r,n)=>new Proxy(n,{get:(a,l)=>l==="props"?r.view.props:l==="state"?r.view.state:l===Am?r.store:l==="$with"?u=>Nm(r,n.$with(u)):a[l],set:(a,l,u)=>{if(l==="props"||l==="state")throw new TypeError(`${String(l)} is read-only on a component proxy - call a method to change the world`);return a[l]=u,!0}}),ln=Object.create(null);ln.open="0";ln.close="1";ln.ping="2";ln.pong="3";ln.message="4";ln.upgrade="5";ln.noop="6";const er=Object.create(null);Object.keys(ln).forEach(r=>{er[ln[r]]=r});const Qc={type:"error",data:"parser error"},Om=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",jm=typeof ArrayBuffer=="function",Rm=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r&&r.buffer instanceof ArrayBuffer,nu=({type:r,data:n},a,l)=>Om&&n instanceof Blob?a?l(n):$p(n,l):jm&&(n instanceof ArrayBuffer||Rm(n))?a?l(n):$p(new Blob([n]),l):l(ln[r]+(n||"")),$p=(r,n)=>{const a=new FileReader;return a.onload=function(){const l=a.result.split(",")[1];n("b"+(l||""))},a.readAsDataURL(r)};function Yp(r){return r instanceof Uint8Array?r:r instanceof ArrayBuffer?new Uint8Array(r):new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}let Uc;function q0(r,n){if(Om&&r.data instanceof Blob)return r.data.arrayBuffer().then(Yp).then(n);if(jm&&(r.data instanceof ArrayBuffer||Rm(r.data)))return n(Yp(r.data));nu(r,!1,a=>{Uc||(Uc=new TextEncoder),n(Uc.encode(a))})}const Vp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",xa=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let r=0;r<Vp.length;r++)xa[Vp.charCodeAt(r)]=r;const L0=r=>{let n=r.length*.75,a=r.length,l,u=0,f,d,m,y;r[r.length-1]==="="&&(n--,r[r.length-2]==="="&&n--);const b=new ArrayBuffer(n),R=new Uint8Array(b);for(l=0;l<a;l+=4)f=xa[r.charCodeAt(l)],d=xa[r.charCodeAt(l+1)],m=xa[r.charCodeAt(l+2)],y=xa[r.charCodeAt(l+3)],R[u++]=f<<2|d>>4,R[u++]=(d&15)<<4|m>>2,R[u++]=(m&3)<<6|y&63;return b},H0=typeof ArrayBuffer=="function",iu=(r,n)=>{if(typeof r!="string")return{type:"message",data:zm(r,n)};const a=r.charAt(0);return a==="b"?{type:"message",data:$0(r.substring(1),n)}:er[a]?r.length>1?{type:er[a],data:r.substring(1)}:{type:er[a]}:Qc},$0=(r,n)=>{if(H0){const a=L0(r);return zm(a,n)}else return{base64:!0,data:r}},zm=(r,n)=>n==="blob"?r instanceof Blob?r:new Blob([r]):r instanceof ArrayBuffer?r:r.buffer,Mm="",Y0=(r,n)=>{const a=r.length,l=new Array(a);let u=0;r.forEach((f,d)=>{nu(f,!1,m=>{l[d]=m,++u===a&&n(l.join(Mm))})})},V0=(r,n)=>{const a=r.split(Mm),l=[];for(let u=0;u<a.length;u++){const f=iu(a[u],n);if(l.push(f),f.type==="error")break}return l};function X0(){return new TransformStream({transform(r,n){q0(r,a=>{const l=a.length;let u;if(l<126)u=new Uint8Array(1),new DataView(u.buffer).setUint8(0,l);else if(l<65536){u=new Uint8Array(3);const f=new DataView(u.buffer);f.setUint8(0,126),f.setUint16(1,l)}else{u=new Uint8Array(9);const f=new DataView(u.buffer);f.setUint8(0,127),f.setBigUint64(1,BigInt(l))}r.data&&typeof r.data!="string"&&(u[0]|=128),n.enqueue(u),n.enqueue(a)})}})}let Dc;function Jl(r){return r.reduce((n,a)=>n+a.length,0)}function Fl(r,n){if(r[0].length===n)return r.shift();const a=new Uint8Array(n);let l=0;for(let u=0;u<n;u++)a[u]=r[0][l++],l===r[0].length&&(r.shift(),l=0);return r.length&&l<r[0].length&&(r[0]=r[0].slice(l)),a}function G0(r,n){Dc||(Dc=new TextDecoder);const a=[];let l=0,u=-1,f=!1;return new TransformStream({transform(d,m){for(a.push(d);;){if(l===0){if(Jl(a)<1)break;const y=Fl(a,1);f=(y[0]&128)===128,u=y[0]&127,u<126?l=3:u===126?l=1:l=2}else if(l===1){if(Jl(a)<2)break;const y=Fl(a,2);u=new DataView(y.buffer,y.byteOffset,y.length).getUint16(0),l=3}else if(l===2){if(Jl(a)<8)break;const y=Fl(a,8),b=new DataView(y.buffer,y.byteOffset,y.length),R=b.getUint32(0);if(R>Math.pow(2,21)-1){m.enqueue(Qc);break}u=R*Math.pow(2,32)+b.getUint32(4),l=3}else{if(Jl(a)<u)break;const y=Fl(a,u);m.enqueue(iu(f?y:Dc.decode(y),n)),l=0}if(u===0||u>r){m.enqueue(Qc);break}}}})}const Cm=4;function Ie(r){if(r)return Q0(r)}function Q0(r){for(var n in Ie.prototype)r[n]=Ie.prototype[n];return r}Ie.prototype.on=Ie.prototype.addEventListener=function(r,n){return this._callbacks=this._callbacks||{},(this._callbacks["$"+r]=this._callbacks["$"+r]||[]).push(n),this};Ie.prototype.once=function(r,n){function a(){this.off(r,a),n.apply(this,arguments)}return a.fn=n,this.on(r,a),this};Ie.prototype.off=Ie.prototype.removeListener=Ie.prototype.removeAllListeners=Ie.prototype.removeEventListener=function(r,n){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var a=this._callbacks["$"+r];if(!a)return this;if(arguments.length==1)return delete this._callbacks["$"+r],this;for(var l,u=0;u<a.length;u++)if(l=a[u],l===n||l.fn===n){a.splice(u,1);break}return a.length===0&&delete this._callbacks["$"+r],this};Ie.prototype.emit=function(r){this._callbacks=this._callbacks||{};for(var n=new Array(arguments.length-1),a=this._callbacks["$"+r],l=1;l<arguments.length;l++)n[l-1]=arguments[l];if(a){a=a.slice(0);for(var l=0,u=a.length;l<u;++l)a[l].apply(this,n)}return this};Ie.prototype.emitReserved=Ie.prototype.emit;Ie.prototype.listeners=function(r){return this._callbacks=this._callbacks||{},this._callbacks["$"+r]||[]};Ie.prototype.hasListeners=function(r){return!!this.listeners(r).length};const or=typeof Promise=="function"&&typeof Promise.resolve=="function"?n=>Promise.resolve().then(n):(n,a)=>a(n,0),$t=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),K0="arraybuffer";function Um(r,...n){return n.reduce((a,l)=>(r.hasOwnProperty(l)&&(a[l]=r[l]),a),{})}const Z0=$t.setTimeout,J0=$t.clearTimeout;function cr(r,n){n.useNativeTimers?(r.setTimeoutFn=Z0.bind($t),r.clearTimeoutFn=J0.bind($t)):(r.setTimeoutFn=$t.setTimeout.bind($t),r.clearTimeoutFn=$t.clearTimeout.bind($t))}const F0=1.33;function W0(r){return typeof r=="string"?I0(r):Math.ceil((r.byteLength||r.size)*F0)}function I0(r){let n=0,a=0;for(let l=0,u=r.length;l<u;l++)n=r.charCodeAt(l),n<128?a+=1:n<2048?a+=2:n<55296||n>=57344?a+=3:(l++,a+=4);return a}function Dm(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function P0(r){let n="";for(let a in r)r.hasOwnProperty(a)&&(n.length&&(n+="&"),n+=encodeURIComponent(a)+"="+encodeURIComponent(r[a]));return n}function eb(r){let n={},a=r.split("&");for(let l=0,u=a.length;l<u;l++){let f=a[l].split("=");n[decodeURIComponent(f[0])]=decodeURIComponent(f[1])}return n}class tb extends Error{constructor(n,a,l){super(n),this.description=a,this.context=l,this.type="TransportError"}}class su extends Ie{constructor(n){super(),this.writable=!1,cr(this,n),this.opts=n,this.query=n.query,this.socket=n.socket,this.supportsBinary=!n.forceBase64}onError(n,a,l){return super.emitReserved("error",new tb(n,a,l)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(n){this.readyState==="open"&&this.write(n)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(n){const a=iu(n,this.socket.binaryType);this.onPacket(a)}onPacket(n){super.emitReserved("packet",n)}onClose(n){this.readyState="closed",super.emitReserved("close",n)}pause(n){}createUri(n,a={}){return n+"://"+this._hostname()+this._port()+this.opts.path+this._query(a)}_hostname(){const n=this.opts.hostname;return n.indexOf(":")===-1?n:"["+n+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(n){const a=P0(n);return a.length?"?"+a:""}}class nb extends su{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(n){this.readyState="pausing";const a=()=>{this.readyState="paused",n()};if(this._polling||!this.writable){let l=0;this._polling&&(l++,this.once("pollComplete",function(){--l||a()})),this.writable||(l++,this.once("drain",function(){--l||a()}))}else a()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(n){const a=l=>{if(this.readyState==="opening"&&l.type==="open"&&this.onOpen(),l.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(l)};V0(n,this.socket.binaryType).forEach(a),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const n=()=>{this.write([{type:"close"}])};this.readyState==="open"?n():this.once("open",n)}write(n){this.writable=!1,Y0(n,a=>{this.doWrite(a,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const n=this.opts.secure?"https":"http",a=this.query||{};return this.opts.timestampRequests!==!1&&(a[this.opts.timestampParam]=Dm()),!this.supportsBinary&&!a.sid&&(a.b64=1),this.createUri(n,a)}}let Bm=!1;try{Bm=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const ib=Bm;function sb(){}class ab extends nb{constructor(n){if(super(n),typeof location<"u"){const a=location.protocol==="https:";let l=location.port;l||(l=a?"443":"80"),this.xd=typeof location<"u"&&n.hostname!==location.hostname||l!==n.port}}doWrite(n,a){const l=this.request({method:"POST",data:n});l.on("success",a),l.on("error",(u,f)=>{this.onError("xhr post error",u,f)})}doPoll(){const n=this.request();n.on("data",this.onData.bind(this)),n.on("error",(a,l)=>{this.onError("xhr poll error",a,l)}),this.pollXhr=n}}class an extends Ie{constructor(n,a,l){super(),this.createRequest=n,cr(this,l),this._opts=l,this._method=l.method||"GET",this._uri=a,this._data=l.data!==void 0?l.data:null,this._create()}_create(){var n;const a=Um(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");a.xdomain=!!this._opts.xd;const l=this._xhr=this.createRequest(a);try{l.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){l.setDisableHeaderCheck&&l.setDisableHeaderCheck(!0);for(let u in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(u)&&l.setRequestHeader(u,this._opts.extraHeaders[u])}}catch{}if(this._method==="POST")try{l.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{l.setRequestHeader("Accept","*/*")}catch{}(n=this._opts.cookieJar)===null||n===void 0||n.addCookies(l),"withCredentials"in l&&(l.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(l.timeout=this._opts.requestTimeout),l.onreadystatechange=()=>{var u;l.readyState===3&&((u=this._opts.cookieJar)===null||u===void 0||u.parseCookies(l.getResponseHeader("set-cookie"))),l.readyState===4&&(l.status===200||l.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof l.status=="number"?l.status:0)},0))},l.send(this._data)}catch(u){this.setTimeoutFn(()=>{this._onError(u)},0);return}typeof document<"u"&&(this._index=an.requestsCount++,an.requests[this._index]=this)}_onError(n){this.emitReserved("error",n,this._xhr),this._cleanup(!0)}_cleanup(n){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=sb,n)try{this._xhr.abort()}catch{}typeof document<"u"&&delete an.requests[this._index],this._xhr=null}}_onLoad(){const n=this._xhr.responseText;n!==null&&(this.emitReserved("data",n),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}an.requestsCount=0;an.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Xp);else if(typeof addEventListener=="function"){const r="onpagehide"in $t?"pagehide":"unload";addEventListener(r,Xp,!1)}}function Xp(){for(let r in an.requests)an.requests.hasOwnProperty(r)&&an.requests[r].abort()}const lb=(function(){const r=qm({xdomain:!1});return r&&r.responseType!==null})();class rb extends ab{constructor(n){super(n);const a=n&&n.forceBase64;this.supportsBinary=lb&&!a}request(n={}){return Object.assign(n,{xd:this.xd},this.opts),new an(qm,this.uri(),n)}}function qm(r){const n=r.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!n||ib))return new XMLHttpRequest}catch{}if(!n)try{return new $t[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Lm=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class ob extends su{get name(){return"websocket"}doOpen(){const n=this.uri(),a=this.opts.protocols,l=Lm?{}:Um(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(l.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(n,a,l)}catch(u){return this.emitReserved("error",u)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=n=>this.onClose({description:"websocket connection closed",context:n}),this.ws.onmessage=n=>this.onData(n.data),this.ws.onerror=n=>this.onError("websocket error",n)}write(n){this.writable=!1;for(let a=0;a<n.length;a++){const l=n[a],u=a===n.length-1;nu(l,this.supportsBinary,f=>{try{this.doWrite(l,f)}catch{}u&&or(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const n=this.opts.secure?"wss":"ws",a=this.query||{};return this.opts.timestampRequests&&(a[this.opts.timestampParam]=Dm()),this.supportsBinary||(a.b64=1),this.createUri(n,a)}}const Bc=$t.WebSocket||$t.MozWebSocket;class cb extends ob{createSocket(n,a,l){return Lm?new Bc(n,a,l):a?new Bc(n,a):new Bc(n)}doWrite(n,a){this.ws.send(a)}}class ub extends su{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(n){return this.emitReserved("error",n)}this._transport.closed.then(()=>{this.onClose()}).catch(n=>{this.onError("webtransport error",n)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(n=>{const a=G0(Number.MAX_SAFE_INTEGER,this.socket.binaryType),l=n.readable.pipeThrough(a).getReader(),u=X0();u.readable.pipeTo(n.writable),this._writer=u.writable.getWriter();const f=()=>{l.read().then(({done:m,value:y})=>{m||(this.onPacket(y),f())}).catch(m=>{})};f();const d={type:"open"};this.query.sid&&(d.data=`{"sid":"${this.query.sid}"}`),this._writer.write(d).then(()=>this.onOpen())})})}write(n){this.writable=!1;for(let a=0;a<n.length;a++){const l=n[a],u=a===n.length-1;this._writer.write(l).then(()=>{u&&or(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var n;(n=this._transport)===null||n===void 0||n.close()}}const fb={websocket:cb,webtransport:ub,polling:rb},hb=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,db=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Kc(r){if(r.length>8e3)throw"URI too long";const n=r,a=r.indexOf("["),l=r.indexOf("]");a!=-1&&l!=-1&&(r=r.substring(0,a)+r.substring(a,l).replace(/:/g,";")+r.substring(l,r.length));let u=hb.exec(r||""),f={},d=14;for(;d--;)f[db[d]]=u[d]||"";return a!=-1&&l!=-1&&(f.source=n,f.host=f.host.substring(1,f.host.length-1).replace(/;/g,":"),f.authority=f.authority.replace("[","").replace("]","").replace(/;/g,":"),f.ipv6uri=!0),f.pathNames=pb(f,f.path),f.queryKey=mb(f,f.query),f}function pb(r,n){const a=/\/{2,9}/g,l=n.replace(a,"/").split("/");return(n.slice(0,1)=="/"||n.length===0)&&l.splice(0,1),n.slice(-1)=="/"&&l.splice(l.length-1,1),l}function mb(r,n){const a={};return n.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(l,u,f){u&&(a[u]=f)}),a}const Zc=typeof addEventListener=="function"&&typeof removeEventListener=="function",tr=[];Zc&&addEventListener("offline",()=>{tr.forEach(r=>r())},!1);class Pn extends Ie{constructor(n,a){if(super(),this.binaryType=K0,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,n&&typeof n=="object"&&(a=n,n=null),n){const l=Kc(n);a.hostname=l.host,a.secure=l.protocol==="https"||l.protocol==="wss",a.port=l.port,l.query&&(a.query=l.query)}else a.host&&(a.hostname=Kc(a.host).host);cr(this,a),this.secure=a.secure!=null?a.secure:typeof location<"u"&&location.protocol==="https:",a.hostname&&!a.port&&(a.port=this.secure?"443":"80"),this.hostname=a.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=a.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},a.transports.forEach(l=>{const u=l.prototype.name;this.transports.push(u),this._transportsByName[u]=l}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},a),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=eb(this.opts.query)),Zc&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},tr.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(n){const a=Object.assign({},this.opts.query);a.EIO=Cm,a.transport=n,this.id&&(a.sid=this.id);const l=Object.assign({},this.opts,{query:a,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[n]);return new this._transportsByName[n](l)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const n=this.opts.rememberUpgrade&&Pn.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const a=this.createTransport(n);a.open(),this.setTransport(a)}setTransport(n){this.transport&&this.transport.removeAllListeners(),this.transport=n,n.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",a=>this._onClose("transport close",a))}onOpen(){this.readyState="open",Pn.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",n),this.emitReserved("heartbeat"),n.type){case"open":this.onHandshake(JSON.parse(n.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const a=new Error("server error");a.code=n.data,this._onError(a);break;case"message":this.emitReserved("data",n.data),this.emitReserved("message",n.data);break}}onHandshake(n){this.emitReserved("handshake",n),this.id=n.sid,this.transport.query.sid=n.sid,this._pingInterval=n.pingInterval,this._pingTimeout=n.pingTimeout,this._maxPayload=n.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const n=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+n,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},n),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const n=this._getWritablePackets();this.transport.send(n),this._prevBufferLen=n.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let a=1;for(let l=0;l<this.writeBuffer.length;l++){const u=this.writeBuffer[l].data;if(u&&(a+=W0(u)),l>0&&a>this._maxPayload)return this.writeBuffer.slice(0,l);a+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const n=Date.now()>this._pingTimeoutTime;return n&&(this._pingTimeoutTime=0,or(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),n}write(n,a,l){return this._sendPacket("message",n,a,l),this}send(n,a,l){return this._sendPacket("message",n,a,l),this}_sendPacket(n,a,l,u){if(typeof a=="function"&&(u=a,a=void 0),typeof l=="function"&&(u=l,l=null),this.readyState==="closing"||this.readyState==="closed")return;l=l||{},l.compress=l.compress!==!1;const f={type:n,data:a,options:l};this.emitReserved("packetCreate",f),this.writeBuffer.push(f),u&&this.once("flush",u),this.flush()}close(){const n=()=>{this._onClose("forced close"),this.transport.close()},a=()=>{this.off("upgrade",a),this.off("upgradeError",a),n()},l=()=>{this.once("upgrade",a),this.once("upgradeError",a)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?l():n()}):this.upgrading?l():n()),this}_onError(n){if(Pn.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",n),this._onClose("transport error",n)}_onClose(n,a){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Zc&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const l=tr.indexOf(this._offlineEventListener);l!==-1&&tr.splice(l,1)}this.readyState="closed",this.id=null,this.emitReserved("close",n,a),this.writeBuffer=[],this._prevBufferLen=0}}}Pn.protocol=Cm;class yb extends Pn{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let n=0;n<this._upgrades.length;n++)this._probe(this._upgrades[n])}_probe(n){let a=this.createTransport(n),l=!1;Pn.priorWebsocketSuccess=!1;const u=()=>{l||(a.send([{type:"ping",data:"probe"}]),a.once("packet",w=>{if(!l)if(w.type==="pong"&&w.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",a),!a)return;Pn.priorWebsocketSuccess=a.name==="websocket",this.transport.pause(()=>{l||this.readyState!=="closed"&&(R(),this.setTransport(a),a.send([{type:"upgrade"}]),this.emitReserved("upgrade",a),a=null,this.upgrading=!1,this.flush())})}else{const j=new Error("probe error");j.transport=a.name,this.emitReserved("upgradeError",j)}}))};function f(){l||(l=!0,R(),a.close(),a=null)}const d=w=>{const j=new Error("probe error: "+w);j.transport=a.name,f(),this.emitReserved("upgradeError",j)};function m(){d("transport closed")}function y(){d("socket closed")}function b(w){a&&w.name!==a.name&&f()}const R=()=>{a.removeListener("open",u),a.removeListener("error",d),a.removeListener("close",m),this.off("close",y),this.off("upgrading",b)};a.once("open",u),a.once("error",d),a.once("close",m),this.once("close",y),this.once("upgrading",b),this._upgrades.indexOf("webtransport")!==-1&&n!=="webtransport"?this.setTimeoutFn(()=>{l||a.open()},200):a.open()}onHandshake(n){this._upgrades=this._filterUpgrades(n.upgrades),super.onHandshake(n)}_filterUpgrades(n){const a=[];for(let l=0;l<n.length;l++)~this.transports.indexOf(n[l])&&a.push(n[l]);return a}}let gb=class extends yb{constructor(n,a={}){const l=typeof n=="object",u=l?{...n}:{...a};(!u.transports||u.transports&&typeof u.transports[0]=="string")&&(u.transports=(u.transports||["polling","websocket","webtransport"]).map(f=>fb[f]).filter(f=>!!f)),super(l?u:n,u)}};function vb(r,n="",a){let l=r;a=a||typeof location<"u"&&location,r==null&&(r=a.protocol+"//"+a.host),typeof r=="string"&&(r.charAt(0)==="/"&&(r.charAt(1)==="/"?r=a.protocol+r:r=a.host+r),/^(https?|wss?):\/\//.test(r)||(typeof a<"u"?r=a.protocol+"//"+r:r="https://"+r),l=Kc(r)),l.port||(/^(http|ws)$/.test(l.protocol)?l.port="80":/^(http|ws)s$/.test(l.protocol)&&(l.port="443")),l.path=l.path||"/";const f=l.host.indexOf(":")!==-1?"["+l.host+"]":l.host;return l.id=l.protocol+"://"+f+":"+l.port+n,l.href=l.protocol+"://"+f+(a&&a.port===l.port?"":":"+l.port),l}const bb=typeof ArrayBuffer=="function",wb=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r.buffer instanceof ArrayBuffer,Hm=Object.prototype.toString,Sb=typeof Blob=="function"||typeof Blob<"u"&&Hm.call(Blob)==="[object BlobConstructor]",xb=typeof File=="function"||typeof File<"u"&&Hm.call(File)==="[object FileConstructor]";function au(r){return bb&&(r instanceof ArrayBuffer||wb(r))||Sb&&r instanceof Blob||xb&&r instanceof File}function nr(r,n){if(!r||typeof r!="object")return!1;if(Array.isArray(r)){for(let a=0,l=r.length;a<l;a++)if(nr(r[a]))return!0;return!1}if(au(r))return!0;if(r.toJSON&&typeof r.toJSON=="function"&&arguments.length===1)return nr(r.toJSON(),!0);for(const a in r)if(Object.prototype.hasOwnProperty.call(r,a)&&nr(r[a]))return!0;return!1}function Eb(r){const n=[],a=r.data,l=r;return l.data=ir(a,n),l.attachments=n.length,{packet:l,buffers:n}}function ir(r,n,a){if(!r)return r;if(au(r)){const l={_placeholder:!0,num:n.length};return n.push(r),l}else if(Array.isArray(r)){const l=new Array(r.length);for(let u=0;u<r.length;u++)l[u]=ir(r[u],n);return l}else if(typeof r=="object"&&!(r instanceof Date)){if(r.toJSON&&typeof r.toJSON=="function"&&!a)return ir(r.toJSON(),n,!0);const l={};for(const u in r)Object.prototype.hasOwnProperty.call(r,u)&&(l[u]=ir(r[u],n));return l}return r}function kb(r,n){return r.data=Jc(r.data,n),delete r.attachments,r}function Jc(r,n){if(!r)return r;if(r&&r._placeholder===!0){if(typeof r.num=="number"&&r.num>=0&&r.num<n.length)return n[r.num];throw new Error("illegal attachments")}else if(Array.isArray(r))for(let a=0;a<r.length;a++)r[a]=Jc(r[a],n);else if(typeof r=="object")for(const a in r)Object.prototype.hasOwnProperty.call(r,a)&&(r[a]=Jc(r[a],n));return r}const Tb=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var Se;(function(r){r[r.CONNECT=0]="CONNECT",r[r.DISCONNECT=1]="DISCONNECT",r[r.EVENT=2]="EVENT",r[r.ACK=3]="ACK",r[r.CONNECT_ERROR=4]="CONNECT_ERROR",r[r.BINARY_EVENT=5]="BINARY_EVENT",r[r.BINARY_ACK=6]="BINARY_ACK"})(Se||(Se={}));let _b=class{constructor(n){this.replacer=n}encode(n){return(n.type===Se.EVENT||n.type===Se.ACK)&&nr(n)?this.encodeAsBinary({type:n.type===Se.EVENT?Se.BINARY_EVENT:Se.BINARY_ACK,nsp:n.nsp,data:n.data,id:n.id}):[this.encodeAsString(n)]}encodeAsString(n){let a=""+n.type;return(n.type===Se.BINARY_EVENT||n.type===Se.BINARY_ACK)&&(a+=n.attachments+"-"),n.nsp&&n.nsp!=="/"&&(a+=n.nsp+","),n.id!=null&&(a+=n.id),n.data!=null&&(a+=JSON.stringify(n.data,this.replacer)),a}encodeAsBinary(n){const a=Eb(n),l=this.encodeAsString(a.packet),u=a.buffers;return u.unshift(l),u}},Ab=class $m extends Ie{constructor(n){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof n=="function"?{reviver:n}:n)}add(n){let a;if(typeof n=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");a=this.decodeString(n);const l=a.type===Se.BINARY_EVENT;l||a.type===Se.BINARY_ACK?(a.type=l?Se.EVENT:Se.ACK,this.reconstructor=new Nb(a)):super.emitReserved("decoded",a)}else if(au(n)||n.base64)if(this.reconstructor)a=this.reconstructor.takeBinaryData(n),a&&(this.reconstructor=null,super.emitReserved("decoded",a));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+n)}decodeString(n){let a=0;const l={type:Number(n.charAt(0))};if(Se[l.type]===void 0)throw new Error("unknown packet type "+l.type);if(l.type===Se.BINARY_EVENT||l.type===Se.BINARY_ACK){const f=a+1;for(;n.charAt(++a)!=="-"&&a!=n.length;);const d=n.substring(f,a);if(d!=Number(d)||n.charAt(a)!=="-")throw new Error("Illegal attachments");const m=Number(d);if(!Ob(m)||m<1)throw new Error("Illegal attachments");if(m>this.opts.maxAttachments)throw new Error("too many attachments");l.attachments=m}if(n.charAt(a+1)==="/"){const f=a+1;for(;++a&&!(n.charAt(a)===","||a===n.length););l.nsp=n.substring(f,a)}else l.nsp="/";const u=n.charAt(a+1);if(u!==""&&Number(u)==u){const f=a+1;for(;++a;){const d=n.charAt(a);if(d==null||Number(d)!=d){--a;break}if(a===n.length)break}l.id=Number(n.substring(f,a+1))}if(n.charAt(++a)){const f=this.tryParse(n.substr(a));if($m.isPayloadValid(l.type,f))l.data=f;else throw new Error("invalid payload")}return l}tryParse(n){try{return JSON.parse(n,this.opts.reviver)}catch{return!1}}static isPayloadValid(n,a){switch(n){case Se.CONNECT:return Gp(a);case Se.DISCONNECT:return a===void 0;case Se.CONNECT_ERROR:return typeof a=="string"||Gp(a);case Se.EVENT:case Se.BINARY_EVENT:return Array.isArray(a)&&(typeof a[0]=="number"||typeof a[0]=="string"&&Tb.indexOf(a[0])===-1);case Se.ACK:case Se.BINARY_ACK:return Array.isArray(a)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}};class Nb{constructor(n){this.packet=n,this.buffers=[],this.reconPack=n}takeBinaryData(n){if(this.buffers.push(n),this.buffers.length===this.reconPack.attachments){const a=kb(this.reconPack,this.buffers);return this.finishedReconstruction(),a}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const Ob=Number.isInteger||function(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r};function Gp(r){return Object.prototype.toString.call(r)==="[object Object]"}const jb=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Ab,Encoder:_b,get PacketType(){return Se}},Symbol.toStringTag,{value:"Module"}));function Qt(r,n,a){return r.on(n,a),function(){r.off(n,a)}}const Rb=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Ym extends Ie{constructor(n,a,l){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=n,this.nsp=a,l&&l.auth&&(this.auth=l.auth),this._opts=Object.assign({},l),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const n=this.io;this.subs=[Qt(n,"open",this.onopen.bind(this)),Qt(n,"packet",this.onpacket.bind(this)),Qt(n,"error",this.onerror.bind(this)),Qt(n,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...n){return n.unshift("message"),this.emit.apply(this,n),this}emit(n,...a){var l,u,f;if(Rb.hasOwnProperty(n))throw new Error('"'+n.toString()+'" is a reserved event name');if(a.unshift(n),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(a),this;const d={type:Se.EVENT,data:a};if(d.options={},d.options.compress=this.flags.compress!==!1,typeof a[a.length-1]=="function"){const R=this.ids++,w=a.pop();this._registerAckCallback(R,w),d.id=R}const m=(u=(l=this.io.engine)===null||l===void 0?void 0:l.transport)===null||u===void 0?void 0:u.writable,y=this.connected&&!(!((f=this.io.engine)===null||f===void 0)&&f._hasPingExpired());return this.flags.volatile&&!m||(y?(this.notifyOutgoingListeners(d),this.packet(d)):this.sendBuffer.push(d)),this.flags={},this}_registerAckCallback(n,a){var l;const u=(l=this.flags.timeout)!==null&&l!==void 0?l:this._opts.ackTimeout;if(u===void 0){this.acks[n]=a;return}const f=this.io.setTimeoutFn(()=>{delete this.acks[n];for(let m=0;m<this.sendBuffer.length;m++)this.sendBuffer[m].id===n&&this.sendBuffer.splice(m,1);a.call(this,new Error("operation has timed out"))},u),d=(...m)=>{this.io.clearTimeoutFn(f),a.apply(this,m)};d.withError=!0,this.acks[n]=d}emitWithAck(n,...a){return new Promise((l,u)=>{const f=(d,m)=>d?u(d):l(m);f.withError=!0,a.push(f),this.emit(n,...a)})}_addToQueue(n){let a;typeof n[n.length-1]=="function"&&(a=n.pop());const l={id:this._queueSeq++,tryCount:0,pending:!1,args:n,flags:Object.assign({fromQueue:!0},this.flags)};n.push((u,...f)=>(this._queue[0],u!==null?l.tryCount>this._opts.retries&&(this._queue.shift(),a&&a(u)):(this._queue.shift(),a&&a(null,...f)),l.pending=!1,this._drainQueue())),this._queue.push(l),this._drainQueue()}_drainQueue(n=!1){if(!this.connected||this._queue.length===0)return;const a=this._queue[0];a.pending&&!n||(a.pending=!0,a.tryCount++,this.flags=a.flags,this.emit.apply(this,a.args))}packet(n){n.nsp=this.nsp,this.io._packet(n)}onopen(){typeof this.auth=="function"?this.auth(n=>{this._sendConnectPacket(n)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(n){this.packet({type:Se.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},n):n})}onerror(n){this.connected||this.emitReserved("connect_error",n)}onclose(n,a){this.connected=!1,delete this.id,this.emitReserved("disconnect",n,a),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(n=>{if(!this.sendBuffer.some(l=>String(l.id)===n)){const l=this.acks[n];delete this.acks[n],l.withError&&l.call(this,new Error("socket has been disconnected"))}})}onpacket(n){if(n.nsp===this.nsp)switch(n.type){case Se.CONNECT:n.data&&n.data.sid?this.onconnect(n.data.sid,n.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Se.EVENT:case Se.BINARY_EVENT:this.onevent(n);break;case Se.ACK:case Se.BINARY_ACK:this.onack(n);break;case Se.DISCONNECT:this.ondisconnect();break;case Se.CONNECT_ERROR:this.destroy();const l=new Error(n.data.message);l.data=n.data.data,this.emitReserved("connect_error",l);break}}onevent(n){const a=n.data||[];n.id!=null&&a.push(this.ack(n.id)),this.connected?this.emitEvent(a):this.receiveBuffer.push(Object.freeze(a))}emitEvent(n){if(this._anyListeners&&this._anyListeners.length){const a=this._anyListeners.slice();for(const l of a)l.apply(this,n)}super.emit.apply(this,n),this._pid&&n.length&&typeof n[n.length-1]=="string"&&(this._lastOffset=n[n.length-1])}ack(n){const a=this;let l=!1;return function(...u){l||(l=!0,a.packet({type:Se.ACK,id:n,data:u}))}}onack(n){const a=this.acks[n.id];typeof a=="function"&&(delete this.acks[n.id],a.withError&&n.data.unshift(null),a.apply(this,n.data))}onconnect(n,a){this.id=n,this.recovered=a&&this._pid===a,this._pid=a,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(n=>this.emitEvent(n)),this.receiveBuffer=[],this.sendBuffer.forEach(n=>{this.notifyOutgoingListeners(n),this.packet(n)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(n=>n()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Se.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(n){return this.flags.compress=n,this}get volatile(){return this.flags.volatile=!0,this}timeout(n){return this.flags.timeout=n,this}onAny(n){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(n),this}prependAny(n){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(n),this}offAny(n){if(!this._anyListeners)return this;if(n){const a=this._anyListeners;for(let l=0;l<a.length;l++)if(n===a[l])return a.splice(l,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(n){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(n),this}prependAnyOutgoing(n){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(n),this}offAnyOutgoing(n){if(!this._anyOutgoingListeners)return this;if(n){const a=this._anyOutgoingListeners;for(let l=0;l<a.length;l++)if(n===a[l])return a.splice(l,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(n){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const a=this._anyOutgoingListeners.slice();for(const l of a)l.apply(this,n.data)}}}function ds(r){r=r||{},this.ms=r.min||100,this.max=r.max||1e4,this.factor=r.factor||2,this.jitter=r.jitter>0&&r.jitter<=1?r.jitter:0,this.attempts=0}ds.prototype.duration=function(){var r=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var n=Math.random(),a=Math.floor(n*this.jitter*r);r=(Math.floor(n*10)&1)==0?r-a:r+a}return Math.min(r,this.max)|0};ds.prototype.reset=function(){this.attempts=0};ds.prototype.setMin=function(r){this.ms=r};ds.prototype.setMax=function(r){this.max=r};ds.prototype.setJitter=function(r){this.jitter=r};class Fc extends Ie{constructor(n,a){var l;super(),this.nsps={},this.subs=[],n&&typeof n=="object"&&(a=n,n=void 0),a=a||{},a.path=a.path||"/socket.io",this.opts=a,cr(this,a),this.reconnection(a.reconnection!==!1),this.reconnectionAttempts(a.reconnectionAttempts||1/0),this.reconnectionDelay(a.reconnectionDelay||1e3),this.reconnectionDelayMax(a.reconnectionDelayMax||5e3),this.randomizationFactor((l=a.randomizationFactor)!==null&&l!==void 0?l:.5),this.backoff=new ds({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(a.timeout==null?2e4:a.timeout),this._readyState="closed",this.uri=n;const u=a.parser||jb;this.encoder=new u.Encoder,this.decoder=new u.Decoder,this._autoConnect=a.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(n){return arguments.length?(this._reconnection=!!n,n||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(n){return n===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=n,this)}reconnectionDelay(n){var a;return n===void 0?this._reconnectionDelay:(this._reconnectionDelay=n,(a=this.backoff)===null||a===void 0||a.setMin(n),this)}randomizationFactor(n){var a;return n===void 0?this._randomizationFactor:(this._randomizationFactor=n,(a=this.backoff)===null||a===void 0||a.setJitter(n),this)}reconnectionDelayMax(n){var a;return n===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=n,(a=this.backoff)===null||a===void 0||a.setMax(n),this)}timeout(n){return arguments.length?(this._timeout=n,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(n){if(~this._readyState.indexOf("open"))return this;this.engine=new gb(this.uri,this.opts);const a=this.engine,l=this;this._readyState="opening",this.skipReconnect=!1;const u=Qt(a,"open",function(){l.onopen(),n&&n()}),f=m=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",m),n?n(m):this.maybeReconnectOnOpen()},d=Qt(a,"error",f);if(this._timeout!==!1){const m=this._timeout,y=this.setTimeoutFn(()=>{u(),f(new Error("timeout")),a.close()},m);this.opts.autoUnref&&y.unref(),this.subs.push(()=>{this.clearTimeoutFn(y)})}return this.subs.push(u),this.subs.push(d),this}connect(n){return this.open(n)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const n=this.engine;this.subs.push(Qt(n,"ping",this.onping.bind(this)),Qt(n,"data",this.ondata.bind(this)),Qt(n,"error",this.onerror.bind(this)),Qt(n,"close",this.onclose.bind(this)),Qt(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(n){try{this.decoder.add(n)}catch(a){this.onclose("parse error",a)}}ondecoded(n){or(()=>{this.emitReserved("packet",n)},this.setTimeoutFn)}onerror(n){this.emitReserved("error",n)}socket(n,a){let l=this.nsps[n];return l?this._autoConnect&&!l.active&&l.connect():(l=new Ym(this,n,a),this.nsps[n]=l),l}_destroy(n){const a=Object.keys(this.nsps);for(const l of a)if(this.nsps[l].active)return;this._close()}_packet(n){const a=this.encoder.encode(n);for(let l=0;l<a.length;l++)this.engine.write(a[l],n.options)}cleanup(){this.subs.forEach(n=>n()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(n,a){var l;this.cleanup(),(l=this.engine)===null||l===void 0||l.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",n,a),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const n=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const a=this.backoff.duration();this._reconnecting=!0;const l=this.setTimeoutFn(()=>{n.skipReconnect||(this.emitReserved("reconnect_attempt",n.backoff.attempts),!n.skipReconnect&&n.open(u=>{u?(n._reconnecting=!1,n.reconnect(),this.emitReserved("reconnect_error",u)):n.onreconnect()}))},a);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}}onreconnect(){const n=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",n)}}const ya={};function ka(r,n){typeof r=="object"&&(n=r,r=void 0),n=n||{};const a=vb(r,n.path||"/socket.io"),l=a.source,u=a.id,f=a.path,d=ya[u]&&f in ya[u].nsps,m=n.forceNew||n["force new connection"]||n.multiplex===!1||d;let y;return m?y=new Fc(l,n):(ya[u]||(ya[u]=new Fc(l,n)),y=ya[u]),a.query&&!n.query&&(n.query=a.queryKey),y.socket(a.path,n)}Object.assign(ka,{Manager:Fc,Socket:Ym,io:ka,connect:ka});function zb(r){const n=r.length;let a=0,l=0;for(;l<n;){let u=r.charCodeAt(l++);if((u&4294967168)===0){a++;continue}else if((u&4294965248)===0)a+=2;else{if(u>=55296&&u<=56319&&l<n){const f=r.charCodeAt(l);(f&64512)===56320&&(++l,u=((u&1023)<<10)+(f&1023)+65536)}(u&4294901760)===0?a+=3:a+=4}}return a}function Mb(r,n,a){const l=r.length;let u=a,f=0;for(;f<l;){let d=r.charCodeAt(f++);if((d&4294967168)===0){n[u++]=d;continue}else if((d&4294965248)===0)n[u++]=d>>6&31|192;else{if(d>=55296&&d<=56319&&f<l){const m=r.charCodeAt(f);(m&64512)===56320&&(++f,d=((d&1023)<<10)+(m&1023)+65536)}(d&4294901760)===0?(n[u++]=d>>12&15|224,n[u++]=d>>6&63|128):(n[u++]=d>>18&7|240,n[u++]=d>>12&63|128,n[u++]=d>>6&63|128)}n[u++]=d&63|128}}const Cb=new TextEncoder,Ub=50;function Db(r,n,a){Cb.encodeInto(r,n.subarray(a))}function Bb(r,n,a){r.length>Ub?Db(r,n,a):Mb(r,n,a)}const qb=4096;function Vm(r,n,a){let l=n;const u=l+a,f=[];let d="";for(;l<u;){const m=r[l++];if((m&128)===0)f.push(m);else if((m&224)===192){const y=r[l++]&63;f.push((m&31)<<6|y)}else if((m&240)===224){const y=r[l++]&63,b=r[l++]&63;f.push((m&31)<<12|y<<6|b)}else if((m&248)===240){const y=r[l++]&63,b=r[l++]&63,R=r[l++]&63;let w=(m&7)<<18|y<<12|b<<6|R;w>65535&&(w-=65536,f.push(w>>>10&1023|55296),w=56320|w&1023),f.push(w)}else f.push(m);f.length>=qb&&(d+=String.fromCharCode(...f),f.length=0)}return f.length>0&&(d+=String.fromCharCode(...f)),d}const Lb=new TextDecoder,Hb=200;function $b(r,n,a){const l=r.subarray(n,n+a);return Lb.decode(l)}function Yb(r,n,a){return a>Hb?$b(r,n,a):Vm(r,n,a)}class Wl{type;data;constructor(n,a){this.type=n,this.data=a}}class jt extends Error{constructor(n){super(n);const a=Object.create(jt.prototype);Object.setPrototypeOf(this,a),Object.defineProperty(this,"name",{configurable:!0,enumerable:!1,value:jt.name})}}const ga=4294967295;function Vb(r,n,a){const l=a/4294967296,u=a;r.setUint32(n,l),r.setUint32(n+4,u)}function Xm(r,n,a){const l=Math.floor(a/4294967296),u=a;r.setUint32(n,l),r.setUint32(n+4,u)}function Gm(r,n){const a=r.getInt32(n),l=r.getUint32(n+4);return a*4294967296+l}function Xb(r,n){const a=r.getUint32(n),l=r.getUint32(n+4);return a*4294967296+l}const Gb=-1,Qb=4294967296-1,Kb=17179869184-1;function Zb({sec:r,nsec:n}){if(r>=0&&n>=0&&r<=Kb)if(n===0&&r<=Qb){const a=new Uint8Array(4);return new DataView(a.buffer).setUint32(0,r),a}else{const a=r/4294967296,l=r&4294967295,u=new Uint8Array(8),f=new DataView(u.buffer);return f.setUint32(0,n<<2|a&3),f.setUint32(4,l),u}else{const a=new Uint8Array(12),l=new DataView(a.buffer);return l.setUint32(0,n),Xm(l,4,r),a}}function Jb(r){const n=r.getTime(),a=Math.floor(n/1e3),l=(n-a*1e3)*1e6,u=Math.floor(l/1e9);return{sec:a+u,nsec:l-u*1e9}}function Fb(r){if(r instanceof Date){const n=Jb(r);return Zb(n)}else return null}function Wb(r){const n=new DataView(r.buffer,r.byteOffset,r.byteLength);switch(r.byteLength){case 4:return{sec:n.getUint32(0),nsec:0};case 8:{const a=n.getUint32(0),l=n.getUint32(4),u=(a&3)*4294967296+l,f=a>>>2;return{sec:u,nsec:f}}case 12:{const a=Gm(n,4),l=n.getUint32(0);return{sec:a,nsec:l}}default:throw new jt(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${r.length}`)}}function Ib(r){const n=Wb(r);return new Date(n.sec*1e3+n.nsec/1e6)}const Pb={type:Gb,encode:Fb,decode:Ib};class ur{static defaultCodec=new ur;__brand;builtInEncoders=[];builtInDecoders=[];encoders=[];decoders=[];constructor(){this.register(Pb)}register({type:n,encode:a,decode:l}){if(n>=0)this.encoders[n]=a,this.decoders[n]=l;else{const u=-1-n;this.builtInEncoders[u]=a,this.builtInDecoders[u]=l}}tryToEncode(n,a){for(let l=0;l<this.builtInEncoders.length;l++){const u=this.builtInEncoders[l];if(u!=null){const f=u(n,a);if(f!=null){const d=-1-l;return new Wl(d,f)}}}for(let l=0;l<this.encoders.length;l++){const u=this.encoders[l];if(u!=null){const f=u(n,a);if(f!=null){const d=l;return new Wl(d,f)}}}return n instanceof Wl?n:null}decode(n,a,l){const u=a<0?this.builtInDecoders[-1-a]:this.decoders[a];return u?u(n,a,l):new Wl(a,n)}}function ew(r){return r instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&r instanceof SharedArrayBuffer}function Wc(r){return r instanceof Uint8Array?r:ArrayBuffer.isView(r)?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):ew(r)?new Uint8Array(r):Uint8Array.from(r)}const tw=100,nw=2048;class lu{extensionCodec;context;useBigInt64;maxDepth;initialBufferSize;sortKeys;forceFloat32;ignoreUndefined;forceIntegerToFloat;pos;view;bytes;entered=!1;constructor(n){this.extensionCodec=n?.extensionCodec??ur.defaultCodec,this.context=n?.context,this.useBigInt64=n?.useBigInt64??!1,this.maxDepth=n?.maxDepth??tw,this.initialBufferSize=n?.initialBufferSize??nw,this.sortKeys=n?.sortKeys??!1,this.forceFloat32=n?.forceFloat32??!1,this.ignoreUndefined=n?.ignoreUndefined??!1,this.forceIntegerToFloat=n?.forceIntegerToFloat??!1,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}clone(){return new lu({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,maxDepth:this.maxDepth,initialBufferSize:this.initialBufferSize,sortKeys:this.sortKeys,forceFloat32:this.forceFloat32,ignoreUndefined:this.ignoreUndefined,forceIntegerToFloat:this.forceIntegerToFloat})}reinitializeState(){this.pos=0}encodeSharedRef(n){if(this.entered)return this.clone().encodeSharedRef(n);try{return this.entered=!0,this.reinitializeState(),this.doEncode(n,1),this.bytes.subarray(0,this.pos)}finally{this.entered=!1}}encode(n){if(this.entered)return this.clone().encode(n);try{return this.entered=!0,this.reinitializeState(),this.doEncode(n,1),this.bytes.slice(0,this.pos)}finally{this.entered=!1}}doEncode(n,a){if(a>this.maxDepth)throw new Error(`Too deep objects in depth ${a}`);n==null?this.encodeNil():typeof n=="boolean"?this.encodeBoolean(n):typeof n=="number"?this.forceIntegerToFloat?this.encodeNumberAsFloat(n):this.encodeNumber(n):typeof n=="string"?this.encodeString(n):this.useBigInt64&&typeof n=="bigint"?this.encodeBigInt64(n):this.encodeObject(n,a)}ensureBufferSizeToWrite(n){const a=this.pos+n;this.view.byteLength<a&&this.resizeBuffer(a*2)}resizeBuffer(n){const a=new ArrayBuffer(n),l=new Uint8Array(a),u=new DataView(a);l.set(this.bytes),this.view=u,this.bytes=l}encodeNil(){this.writeU8(192)}encodeBoolean(n){n===!1?this.writeU8(194):this.writeU8(195)}encodeNumber(n){!this.forceIntegerToFloat&&Number.isSafeInteger(n)?n>=0?n<128?this.writeU8(n):n<256?(this.writeU8(204),this.writeU8(n)):n<65536?(this.writeU8(205),this.writeU16(n)):n<4294967296?(this.writeU8(206),this.writeU32(n)):this.useBigInt64?this.encodeNumberAsFloat(n):(this.writeU8(207),this.writeU64(n)):n>=-32?this.writeU8(224|n+32):n>=-128?(this.writeU8(208),this.writeI8(n)):n>=-32768?(this.writeU8(209),this.writeI16(n)):n>=-2147483648?(this.writeU8(210),this.writeI32(n)):this.useBigInt64?this.encodeNumberAsFloat(n):(this.writeU8(211),this.writeI64(n)):this.encodeNumberAsFloat(n)}encodeNumberAsFloat(n){this.forceFloat32?(this.writeU8(202),this.writeF32(n)):(this.writeU8(203),this.writeF64(n))}encodeBigInt64(n){n>=BigInt(0)?(this.writeU8(207),this.writeBigUint64(n)):(this.writeU8(211),this.writeBigInt64(n))}writeStringHeader(n){if(n<32)this.writeU8(160+n);else if(n<256)this.writeU8(217),this.writeU8(n);else if(n<65536)this.writeU8(218),this.writeU16(n);else if(n<4294967296)this.writeU8(219),this.writeU32(n);else throw new Error(`Too long string: ${n} bytes in UTF-8`)}encodeString(n){const l=zb(n);this.ensureBufferSizeToWrite(5+l),this.writeStringHeader(l),Bb(n,this.bytes,this.pos),this.pos+=l}encodeObject(n,a){const l=this.extensionCodec.tryToEncode(n,this.context);if(l!=null)this.encodeExtension(l);else if(Array.isArray(n))this.encodeArray(n,a);else if(ArrayBuffer.isView(n))this.encodeBinary(n);else if(typeof n=="object")this.encodeMap(n,a);else throw new Error(`Unrecognized object: ${Object.prototype.toString.apply(n)}`)}encodeBinary(n){const a=n.byteLength;if(a<256)this.writeU8(196),this.writeU8(a);else if(a<65536)this.writeU8(197),this.writeU16(a);else if(a<4294967296)this.writeU8(198),this.writeU32(a);else throw new Error(`Too large binary: ${a}`);const l=Wc(n);this.writeU8a(l)}encodeArray(n,a){const l=n.length;if(l<16)this.writeU8(144+l);else if(l<65536)this.writeU8(220),this.writeU16(l);else if(l<4294967296)this.writeU8(221),this.writeU32(l);else throw new Error(`Too large array: ${l}`);for(const u of n)this.doEncode(u,a+1)}countWithoutUndefined(n,a){let l=0;for(const u of a)n[u]!==void 0&&l++;return l}encodeMap(n,a){const l=Object.keys(n);this.sortKeys&&l.sort();const u=this.ignoreUndefined?this.countWithoutUndefined(n,l):l.length;if(u<16)this.writeU8(128+u);else if(u<65536)this.writeU8(222),this.writeU16(u);else if(u<4294967296)this.writeU8(223),this.writeU32(u);else throw new Error(`Too large map object: ${u}`);for(const f of l){const d=n[f];this.ignoreUndefined&&d===void 0||(this.encodeString(f),this.doEncode(d,a+1))}}encodeExtension(n){if(typeof n.data=="function"){const l=n.data(this.pos+6),u=l.length;if(u>=4294967296)throw new Error(`Too large extension object: ${u}`);this.writeU8(201),this.writeU32(u),this.writeI8(n.type),this.writeU8a(l);return}const a=n.data.length;if(a===1)this.writeU8(212);else if(a===2)this.writeU8(213);else if(a===4)this.writeU8(214);else if(a===8)this.writeU8(215);else if(a===16)this.writeU8(216);else if(a<256)this.writeU8(199),this.writeU8(a);else if(a<65536)this.writeU8(200),this.writeU16(a);else if(a<4294967296)this.writeU8(201),this.writeU32(a);else throw new Error(`Too large extension object: ${a}`);this.writeI8(n.type),this.writeU8a(n.data)}writeU8(n){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,n),this.pos++}writeU8a(n){const a=n.length;this.ensureBufferSizeToWrite(a),this.bytes.set(n,this.pos),this.pos+=a}writeI8(n){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,n),this.pos++}writeU16(n){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,n),this.pos+=2}writeI16(n){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,n),this.pos+=2}writeU32(n){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,n),this.pos+=4}writeI32(n){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,n),this.pos+=4}writeF32(n){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,n),this.pos+=4}writeF64(n){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,n),this.pos+=8}writeU64(n){this.ensureBufferSizeToWrite(8),Vb(this.view,this.pos,n),this.pos+=8}writeI64(n){this.ensureBufferSizeToWrite(8),Xm(this.view,this.pos,n),this.pos+=8}writeBigUint64(n){this.ensureBufferSizeToWrite(8),this.view.setBigUint64(this.pos,n),this.pos+=8}writeBigInt64(n){this.ensureBufferSizeToWrite(8),this.view.setBigInt64(this.pos,n),this.pos+=8}}function iw(r,n){return new lu(n).encodeSharedRef(r)}function qc(r){return`${r<0?"-":""}0x${Math.abs(r).toString(16).padStart(2,"0")}`}const sw=16,aw=16;class lw{hit=0;miss=0;caches;maxKeyLength;maxLengthPerKey;constructor(n=sw,a=aw){this.maxKeyLength=n,this.maxLengthPerKey=a,this.caches=[];for(let l=0;l<this.maxKeyLength;l++)this.caches.push([])}canBeCached(n){return n>0&&n<=this.maxKeyLength}find(n,a,l){const u=this.caches[l-1];e:for(const f of u){const d=f.bytes;for(let m=0;m<l;m++)if(d[m]!==n[a+m])continue e;return f.str}return null}store(n,a){const l=this.caches[n.length-1],u={bytes:n,str:a};l.length>=this.maxLengthPerKey?l[Math.random()*l.length|0]=u:l.push(u)}decode(n,a,l){const u=this.find(n,a,l);if(u!=null)return this.hit++,u;this.miss++;const f=Vm(n,a,l),d=Uint8Array.prototype.slice.call(n,a,a+l);return this.store(d,f),f}}const Ic="array",Ta="map_key",Qm="map_value",rw=r=>{if(typeof r=="string"||typeof r=="number")return r;throw new jt("The type of key must be string or number but "+typeof r)};class ow{stack=[];stackHeadPosition=-1;get length(){return this.stackHeadPosition+1}top(){return this.stack[this.stackHeadPosition]}pushArrayState(n){const a=this.getUninitializedStateFromPool();a.type=Ic,a.position=0,a.size=n,a.array=new Array(n)}pushMapState(n){const a=this.getUninitializedStateFromPool();a.type=Ta,a.readCount=0,a.size=n,a.map={}}getUninitializedStateFromPool(){if(this.stackHeadPosition++,this.stackHeadPosition===this.stack.length){const n={type:void 0,size:0,array:void 0,position:0,readCount:0,map:void 0,key:null};this.stack.push(n)}return this.stack[this.stackHeadPosition]}release(n){if(this.stack[this.stackHeadPosition]!==n)throw new Error("Invalid stack state. Released state is not on top of the stack.");if(n.type===Ic){const l=n;l.size=0,l.array=void 0,l.position=0,l.type=void 0}if(n.type===Ta||n.type===Qm){const l=n;l.size=0,l.map=void 0,l.readCount=0,l.type=void 0}this.stackHeadPosition--}reset(){this.stack.length=0,this.stackHeadPosition=-1}}const va=-1,ru=new DataView(new ArrayBuffer(0)),cw=new Uint8Array(ru.buffer);try{ru.getInt8(0)}catch(r){if(!(r instanceof RangeError))throw new Error("This module is not supported in the current JavaScript engine because DataView does not throw RangeError on out-of-bounds access")}const Qp=new RangeError("Insufficient data"),uw=new lw;class ou{extensionCodec;context;useBigInt64;rawStrings;maxStrLength;maxBinLength;maxArrayLength;maxMapLength;maxExtLength;keyDecoder;mapKeyConverter;totalPos=0;pos=0;view=ru;bytes=cw;headByte=va;stack=new ow;entered=!1;constructor(n){this.extensionCodec=n?.extensionCodec??ur.defaultCodec,this.context=n?.context,this.useBigInt64=n?.useBigInt64??!1,this.rawStrings=n?.rawStrings??!1,this.maxStrLength=n?.maxStrLength??ga,this.maxBinLength=n?.maxBinLength??ga,this.maxArrayLength=n?.maxArrayLength??ga,this.maxMapLength=n?.maxMapLength??ga,this.maxExtLength=n?.maxExtLength??ga,this.keyDecoder=n?.keyDecoder!==void 0?n.keyDecoder:uw,this.mapKeyConverter=n?.mapKeyConverter??rw}clone(){return new ou({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,rawStrings:this.rawStrings,maxStrLength:this.maxStrLength,maxBinLength:this.maxBinLength,maxArrayLength:this.maxArrayLength,maxMapLength:this.maxMapLength,maxExtLength:this.maxExtLength,keyDecoder:this.keyDecoder})}reinitializeState(){this.totalPos=0,this.headByte=va,this.stack.reset()}setBuffer(n){const a=Wc(n);this.bytes=a,this.view=new DataView(a.buffer,a.byteOffset,a.byteLength),this.pos=0}appendBuffer(n){if(this.headByte===va&&!this.hasRemaining(1))this.setBuffer(n);else{const a=this.bytes.subarray(this.pos),l=Wc(n),u=new Uint8Array(a.length+l.length);u.set(a),u.set(l,a.length),this.setBuffer(u)}}hasRemaining(n){return this.view.byteLength-this.pos>=n}createExtraByteError(n){const{view:a,pos:l}=this;return new RangeError(`Extra ${a.byteLength-l} of ${a.byteLength} byte(s) found at buffer[${n}]`)}decode(n){if(this.entered)return this.clone().decode(n);try{this.entered=!0,this.reinitializeState(),this.setBuffer(n);const a=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return a}finally{this.entered=!1}}*decodeMulti(n){if(this.entered){yield*this.clone().decodeMulti(n);return}try{for(this.entered=!0,this.reinitializeState(),this.setBuffer(n);this.hasRemaining(1);)yield this.doDecodeSync()}finally{this.entered=!1}}async decodeAsync(n){if(this.entered)return this.clone().decodeAsync(n);try{this.entered=!0;let a=!1,l;for await(const m of n){if(a)throw this.entered=!1,this.createExtraByteError(this.totalPos);this.appendBuffer(m);try{l=this.doDecodeSync(),a=!0}catch(y){if(!(y instanceof RangeError))throw y}this.totalPos+=this.pos}if(a){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return l}const{headByte:u,pos:f,totalPos:d}=this;throw new RangeError(`Insufficient data in parsing ${qc(u)} at ${d} (${f} in the current buffer)`)}finally{this.entered=!1}}decodeArrayStream(n){return this.decodeMultiAsync(n,!0)}decodeStream(n){return this.decodeMultiAsync(n,!1)}async*decodeMultiAsync(n,a){if(this.entered){yield*this.clone().decodeMultiAsync(n,a);return}try{this.entered=!0;let l=a,u=-1;for await(const f of n){if(a&&u===0)throw this.createExtraByteError(this.totalPos);this.appendBuffer(f),l&&(u=this.readArraySize(),l=!1,this.complete());try{for(;yield this.doDecodeSync(),--u!==0;);}catch(d){if(!(d instanceof RangeError))throw d}this.totalPos+=this.pos}}finally{this.entered=!1}}doDecodeSync(){e:for(;;){const n=this.readHeadByte();let a;if(n>=224)a=n-256;else if(n<192)if(n<128)a=n;else if(n<144){const u=n-128;if(u!==0){this.pushMapState(u),this.complete();continue e}else a={}}else if(n<160){const u=n-144;if(u!==0){this.pushArrayState(u),this.complete();continue e}else a=[]}else{const u=n-160;a=this.decodeString(u,0)}else if(n===192)a=null;else if(n===194)a=!1;else if(n===195)a=!0;else if(n===202)a=this.readF32();else if(n===203)a=this.readF64();else if(n===204)a=this.readU8();else if(n===205)a=this.readU16();else if(n===206)a=this.readU32();else if(n===207)this.useBigInt64?a=this.readU64AsBigInt():a=this.readU64();else if(n===208)a=this.readI8();else if(n===209)a=this.readI16();else if(n===210)a=this.readI32();else if(n===211)this.useBigInt64?a=this.readI64AsBigInt():a=this.readI64();else if(n===217){const u=this.lookU8();a=this.decodeString(u,1)}else if(n===218){const u=this.lookU16();a=this.decodeString(u,2)}else if(n===219){const u=this.lookU32();a=this.decodeString(u,4)}else if(n===220){const u=this.readU16();if(u!==0){this.pushArrayState(u),this.complete();continue e}else a=[]}else if(n===221){const u=this.readU32();if(u!==0){this.pushArrayState(u),this.complete();continue e}else a=[]}else if(n===222){const u=this.readU16();if(u!==0){this.pushMapState(u),this.complete();continue e}else a={}}else if(n===223){const u=this.readU32();if(u!==0){this.pushMapState(u),this.complete();continue e}else a={}}else if(n===196){const u=this.lookU8();a=this.decodeBinary(u,1)}else if(n===197){const u=this.lookU16();a=this.decodeBinary(u,2)}else if(n===198){const u=this.lookU32();a=this.decodeBinary(u,4)}else if(n===212)a=this.decodeExtension(1,0);else if(n===213)a=this.decodeExtension(2,0);else if(n===214)a=this.decodeExtension(4,0);else if(n===215)a=this.decodeExtension(8,0);else if(n===216)a=this.decodeExtension(16,0);else if(n===199){const u=this.lookU8();a=this.decodeExtension(u,1)}else if(n===200){const u=this.lookU16();a=this.decodeExtension(u,2)}else if(n===201){const u=this.lookU32();a=this.decodeExtension(u,4)}else throw new jt(`Unrecognized type byte: ${qc(n)}`);this.complete();const l=this.stack;for(;l.length>0;){const u=l.top();if(u.type===Ic)if(u.array[u.position]=a,u.position++,u.position===u.size)a=u.array,l.release(u);else continue e;else if(u.type===Ta){if(a==="__proto__")throw new jt("The key __proto__ is not allowed");u.key=this.mapKeyConverter(a),u.type=Qm;continue e}else if(u.map[u.key]=a,u.readCount++,u.readCount===u.size)a=u.map,l.release(u);else{u.key=null,u.type=Ta;continue e}}return a}}readHeadByte(){return this.headByte===va&&(this.headByte=this.readU8()),this.headByte}complete(){this.headByte=va}readArraySize(){const n=this.readHeadByte();switch(n){case 220:return this.readU16();case 221:return this.readU32();default:{if(n<160)return n-144;throw new jt(`Unrecognized array type byte: ${qc(n)}`)}}}pushMapState(n){if(n>this.maxMapLength)throw new jt(`Max length exceeded: map length (${n}) > maxMapLengthLength (${this.maxMapLength})`);this.stack.pushMapState(n)}pushArrayState(n){if(n>this.maxArrayLength)throw new jt(`Max length exceeded: array length (${n}) > maxArrayLength (${this.maxArrayLength})`);this.stack.pushArrayState(n)}decodeString(n,a){return!this.rawStrings||this.stateIsMapKey()?this.decodeUtf8String(n,a):this.decodeBinary(n,a)}decodeUtf8String(n,a){if(n>this.maxStrLength)throw new jt(`Max length exceeded: UTF-8 byte length (${n}) > maxStrLength (${this.maxStrLength})`);if(this.bytes.byteLength<this.pos+a+n)throw Qp;const l=this.pos+a;let u;return this.stateIsMapKey()&&this.keyDecoder?.canBeCached(n)?u=this.keyDecoder.decode(this.bytes,l,n):u=Yb(this.bytes,l,n),this.pos+=a+n,u}stateIsMapKey(){return this.stack.length>0?this.stack.top().type===Ta:!1}decodeBinary(n,a){if(n>this.maxBinLength)throw new jt(`Max length exceeded: bin length (${n}) > maxBinLength (${this.maxBinLength})`);if(!this.hasRemaining(n+a))throw Qp;const l=this.pos+a,u=this.bytes.subarray(l,l+n);return this.pos+=a+n,u}decodeExtension(n,a){if(n>this.maxExtLength)throw new jt(`Max length exceeded: ext length (${n}) > maxExtLength (${this.maxExtLength})`);const l=this.view.getInt8(this.pos+a),u=this.decodeBinary(n,a+1);return this.extensionCodec.decode(u,l,this.context)}lookU8(){return this.view.getUint8(this.pos)}lookU16(){return this.view.getUint16(this.pos)}lookU32(){return this.view.getUint32(this.pos)}readU8(){const n=this.view.getUint8(this.pos);return this.pos++,n}readI8(){const n=this.view.getInt8(this.pos);return this.pos++,n}readU16(){const n=this.view.getUint16(this.pos);return this.pos+=2,n}readI16(){const n=this.view.getInt16(this.pos);return this.pos+=2,n}readU32(){const n=this.view.getUint32(this.pos);return this.pos+=4,n}readI32(){const n=this.view.getInt32(this.pos);return this.pos+=4,n}readU64(){const n=Xb(this.view,this.pos);return this.pos+=8,n}readI64(){const n=Gm(this.view,this.pos);return this.pos+=8,n}readU64AsBigInt(){const n=this.view.getBigUint64(this.pos);return this.pos+=8,n}readI64AsBigInt(){const n=this.view.getBigInt64(this.pos);return this.pos+=8,n}readF32(){const n=this.view.getFloat32(this.pos);return this.pos+=4,n}readF64(){const n=this.view.getFloat64(this.pos);return this.pos+=8,n}}function fw(r,n){return new ou(n).decode(r)}const Km={contentType:"application/msgpack",encode:r=>iw(r,{ignoreUndefined:!0}),decode:r=>fw(r)},hw={contentType:"application/json",encode:r=>ym(JSON.stringify(r)),decode:r=>JSON.parse(mm(r))},dw=r=>r?Km:hw,Kp=async(r,n,a,l,u,f)=>{if(r.emit(_e.unroutable,{source:a,target:l,reason:f}),n.type!==We.RequestMessage)return;const d=n.payload?.id;if(!d)return;const m={type:Xe.error,id:d,code:u,error:{name:"RpcError",message:`${r.name}: ${f}`}},y=new vm;y.type=We.ErrorMessage,y.payload=m;try{await r.receive(y,r.name,a)}catch{}},pw=64,mw=r=>typeof r=="string"&&r.length>0&&r.length<=pw,Zp="presence",yw=128,Jp=8,Fp=r=>typeof r=="string"&&r.length>0&&r.length<=yw&&![...r].some(n=>n===" "||n.charCodeAt(0)<32||n.charCodeAt(0)===127),gw=async(r,n)=>{const a=r.map(u=>u.presenceSettled?.()??Promise.resolve());let l;await Promise.race([Promise.all(a).then(()=>{}),new Promise(u=>{l=setTimeout(u,n),l.unref?.()})]),l!==void 0&&clearTimeout(l)};class Wp extends rr{url;options;announcePresence;allowInsecureTls;socket;connected=!1;codec=Km;knownPeers=new Set;carrying=[];sweepLanded;sweep=new Promise(n=>this.sweepLanded=n);presenceSettled(){return this.announcePresence||this.sweepLanded?.(),this.sweep}constructor(n,a,l,u={},f=!0,d=!1){super(n,l),this.url=a,this.options=u,this.announcePresence=f,this.allowInsecureTls=d,queueMicrotask(()=>{this.open().catch(m=>this.emit(_e.transportError,m))})}closing=!1;async close(){this.closing=!0,this.sweepLanded?.(),this.sweepLanded=void 0;const n=this.socket;if(this.socket=void 0,this.connected=!1,this.readyFlag=!1,!n)return;n.io.reconnection(!1);const a=n.io.engine,l=n.connected&&a?new Promise(u=>{const f=setTimeout(u,2e3);f.unref?.(),a.once("close",()=>{clearTimeout(f),u()})}):Promise.resolve();n.disconnect(),await l,n.removeAllListeners(),this.knownPeers.clear()}async open(){if(this.socket)return;super.open();const n=this.url;this.allowInsecureTls&&(this.options={rejectUnauthorized:!1,...this.options},this.warnAboutInsecureTls()),this.socket=n?ka(n,this.options):ka(this.options),this.socket.on("message",async a=>{try{const[l,u,f]=this.extractHeader(new Uint8Array(a));if(!l){this.emit(_e.rejected,{source:"unknown",reason:f??"no msgrpc header"});return}const d=this.codec.decode(u);await this.deliver(d,l.source,l.target,l.hops??0)}catch(l){this.emit(_e.rejected,{source:"unknown",reason:`undecodable frame: ${String(l)}`,error:l})}}),this.socket.on(Zp,a=>{try{this.onPresence(a)}catch(l){this.emit(_e.rejected,{source:"unknown",reason:`bad presence update: ${String(l)}`,error:l})}}),this.socket.on("connect",()=>{this.connected=!0,this.readyFlag=!0,this.announcePresence&&this.announce(),this.emit(_e.connected)}),this.socket.on("disconnect",a=>{this.connected=!1,this.readyFlag=!1;for(const l of[...this.knownPeers])this.knownPeers.delete(l),this.emit(_e.peerGone,l);this.emit(_e.disconnected,a),a==="io server disconnect"&&!this.closing&&setTimeout(()=>{!this.closing&&this.socket?.disconnected&&this.socket.connect()},1e3).unref?.()})}warnAboutInsecureTls(){!this.url||!/^(https|wss):/i.test(this.url)||console.warn(`source-rpc: '${this.name}' is connecting to ${this.url} with allowInsecureTls, so the server's certificate is not checked. Anything able to answer on that address can read and rewrite this link. Use it for a development server, not a plant.`)}registerIfUnrouted(n){this.peerRegistry.get(n)||this.setKnownSource(n)}announce(){const n={name:this.name};this.carrying.length&&(n.carrying=this.carrying),this.shape&&(n.shape=this.shape),this.socket?.emit(Zp,n)}shape;announceShape(n){this.shape!==n&&(this.shape=n,this.connected&&this.announcePresence&&this.announce())}advertise(n){const a=[...n].sort();a.length===this.carrying.length&&a.every((l,u)=>l===this.carrying[u])||(this.carrying=a,this.connected&&this.announcePresence&&this.announce())}noteShape(n,a){mw(a)&&this.peerRegistry.noteShape(n,a)&&this.emit(_e.peerShape,n,a)}onPresence(n){if(Array.isArray(n.peers)){const a=this.sweepLanded;this.sweepLanded=void 0,a?.();for(const l of n.peers)!Fp(l)||l===this.name||(n.shapes&&Object.prototype.hasOwnProperty.call(n.shapes,l)&&this.noteShape(l,n.shapes[l]),!this.knownPeers.has(l)&&(this.knownPeers.add(l),this.registerIfUnrouted(l),this.emit(_e.peerOnline,l)));return}if(!(!Fp(n.peer)||n.peer===this.name))if(n.state==="offline"){if(!this.knownPeers.delete(n.peer))return;this.emit(_e.peerGone,n.peer)}else{if(n.shape!==void 0&&this.noteShape(n.peer,n.shape),this.knownPeers.has(n.peer))return;this.knownPeers.add(n.peer),this.registerIfUnrouted(n.peer),this.emit(_e.peerOnline,n.peer)}}async deliver(n,a,l,u){if(l!==this.name){const f=this.peerRegistry.get(l);if(f&&f!==this&&f.isTransport()){if(u+1>Jp){await Kp(this,n,a,l,"TransportError",`over ${Jp} relays`);return}const d=f;d.forward?d.forward(n,a,l,u+1):await f.receive(n,a,l);return}}if(this.targetExists(l)){await this.send(n,a,l);return}await Kp(this,n,a,l,"TransportError",`no route to '${l}'`)}forward(n,a,l,u){try{this.requireSocket().emit("message",this.frameMessage(this.buildHeader(a,l,{hops:u}),this.codec.encode(n)))}catch(f){this.emit(_e.unroutable,{source:a,target:l,reason:`cannot forward: ${String(f)}`,error:f})}}requireSocket(){if(!this.socket)throw new Error(`SocketIoClientTransport '${this.name}': not connected to ${this.url??"the default url"}`);return this.socket}async receive(n,a,l){this.requireSocket().emit("message",this.frameMessage(this.buildHeader(a,l),this.codec.encode(n)))}isTransport(){return!0}}const cu=Object.freeze(`abandon
|
|
3
|
+
`+vs+e+bs}var ws=!1;function ii(e,t){if(!e||ws)return"";ws=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var L=function(){throw Error()};if(Object.defineProperty(L.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(L,[])}catch(C){var R=C}Reflect.construct(e,[],L)}else{try{L.call()}catch(C){R=C}e.call(L.prototype)}}else{try{throw Error()}catch(C){R=C}(L=e())&&typeof L.catch=="function"&&L.catch(function(){})}}catch(C){if(C&&R&&typeof C.stack=="string")return[C.stack,R.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var u=r.DetermineComponentFrameRoot(),h=u[0],m=u[1];if(h&&m){var w=h.split(`
|
|
4
|
+
`),O=m.split(`
|
|
5
|
+
`);for(c=r=0;r<w.length&&!w[r].includes("DetermineComponentFrameRoot");)r++;for(;c<O.length&&!O[c].includes("DetermineComponentFrameRoot");)c++;if(r===w.length||c===O.length)for(r=w.length-1,c=O.length-1;1<=r&&0<=c&&w[r]!==O[c];)c--;for(;1<=r&&0<=c;r--,c--)if(w[r]!==O[c]){if(r!==1||c!==1)do if(r--,c--,0>c||w[r]!==O[c]){var U=`
|
|
6
|
+
`+w[r].replace(" at new "," at ");return e.displayName&&U.includes("<anonymous>")&&(U=U.replace("<anonymous>",e.displayName)),U}while(1<=r&&0<=c);break}}}finally{ws=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?cn(i):""}function dt(e,t){switch(e.tag){case 26:case 27:case 5:return cn(e.type);case 16:return cn("Lazy");case 13:return e.child!==t&&t!==null?cn("Suspense Fallback"):cn("Suspense");case 19:return cn("SuspenseList");case 0:case 15:return ii(e.type,!1);case 11:return ii(e.type.render,!1);case 1:return ii(e.type,!0);case 31:return cn("Activity");default:return""}}function xs(e){try{var t="",i=null;do t+=dt(e,i),i=e,e=e.return;while(e);return t}catch(r){return`
|
|
7
|
+
Error generating stack: `+r.message+`
|
|
8
|
+
`+r.stack}}var H=Object.prototype.hasOwnProperty,oe=a.unstable_scheduleCallback,$e=a.unstable_cancelCallback,be=a.unstable_shouldYield,st=a.unstable_requestPaint,Qe=a.unstable_now,ki=a.unstable_getCurrentPriorityLevel,_u=a.unstable_ImmediatePriority,ju=a.unstable_UserBlockingPriority,Ra=a.unstable_NormalPriority,eg=a.unstable_LowPriority,Nu=a.unstable_IdlePriority,tg=a.log,ng=a.unstable_setDisableYieldValue,Ss=null,St=null;function jn(e){if(typeof tg=="function"&&ng(e),St&&typeof St.setStrictMode=="function")try{St.setStrictMode(Ss,e)}catch{}}var Et=Math.clz32?Math.clz32:ag,ig=Math.log,sg=Math.LN2;function ag(e){return e>>>=0,e===0?32:31-(ig(e)/sg|0)|0}var Ma=256,Ca=262144,za=4194304;function si(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 Ua(e,t,i){var r=e.pendingLanes;if(r===0)return 0;var c=0,u=e.suspendedLanes,h=e.pingedLanes;e=e.warmLanes;var m=r&134217727;return m!==0?(r=m&~u,r!==0?c=si(r):(h&=m,h!==0?c=si(h):i||(i=m&~e,i!==0&&(c=si(i))))):(m=r&~u,m!==0?c=si(m):h!==0?c=si(h):i||(i=r&~e,i!==0&&(c=si(i)))),c===0?0:t!==0&&t!==c&&(t&u)===0&&(u=c&-c,i=t&-t,u>=i||u===32&&(i&4194048)!==0)?t:c}function Es(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function rg(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 Ou(){var e=za;return za<<=1,(za&62914560)===0&&(za=4194304),e}function wl(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function ks(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function lg(e,t,i,r,c,u){var h=e.pendingLanes;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=i,e.entangledLanes&=i,e.errorRecoveryDisabledLanes&=i,e.shellSuspendCounter=0;var m=e.entanglements,w=e.expirationTimes,O=e.hiddenUpdates;for(i=h&~i;0<i;){var U=31-Et(i),L=1<<U;m[U]=0,w[U]=-1;var R=O[U];if(R!==null)for(O[U]=null,U=0;U<R.length;U++){var C=R[U];C!==null&&(C.lane&=-536870913)}i&=~L}r!==0&&Ru(e,r,0),u!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=u&~(h&~t))}function Ru(e,t,i){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Et(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|i&261930}function Mu(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var r=31-Et(i),c=1<<r;c&t|e[r]&t&&(e[r]|=t),i&=~c}}function Cu(e,t){var i=t&-t;return i=(i&42)!==0?1:xl(i),(i&(e.suspendedLanes|t))!==0?0:i}function xl(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 Sl(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function zu(){var e=X.p;return e!==0?e:(e=window.event,e===void 0?32:wp(e.type))}function Uu(e,t){var i=X.p;try{return X.p=e,t()}finally{X.p=i}}var Nn=Math.random().toString(36).slice(2),at="__reactFiber$"+Nn,mt="__reactProps$"+Nn,Ti="__reactContainer$"+Nn,El="__reactEvents$"+Nn,og="__reactListeners$"+Nn,cg="__reactHandles$"+Nn,Du="__reactResources$"+Nn,Ts="__reactMarker$"+Nn;function kl(e){delete e[at],delete e[mt],delete e[El],delete e[og],delete e[cg]}function Ai(e){var t=e[at];if(t)return t;for(var i=e.parentNode;i;){if(t=i[Ti]||i[at]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=sp(e);e!==null;){if(i=e[at])return i;e=sp(e)}return t}e=i,i=e.parentNode}return null}function _i(e){if(e=e[at]||e[Ti]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function As(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(l(33))}function ji(e){var t=e[Du];return t||(t=e[Du]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function tt(e){e[Ts]=!0}var Bu=new Set,qu={};function ai(e,t){Ni(e,t),Ni(e+"Capture",t)}function Ni(e,t){for(qu[e]=t,e=0;e<t.length;e++)Bu.add(t[e])}var ug=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]*$"),$u={},Lu={};function fg(e){return H.call(Lu,e)?!0:H.call($u,e)?!1:ug.test(e)?Lu[e]=!0:($u[e]=!0,!1)}function Da(e,t,i){if(fg(t))if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var r=t.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+i)}}function Ba(e,t,i){if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+i)}}function un(e,t,i,r){if(r===null)e.removeAttribute(i);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttributeNS(t,i,""+r)}}function Ct(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Hu(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function dg(e,t,i){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var c=r.get,u=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.call(this)},set:function(h){i=""+h,u.call(this,h)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return i},setValue:function(h){i=""+h},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Tl(e){if(!e._valueTracker){var t=Hu(e)?"checked":"value";e._valueTracker=dg(e,t,""+e[t])}}function Yu(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),r="";return e&&(r=Hu(e)?e.checked?"true":"false":e.value),e=r,e!==i?(t.setValue(e),!0):!1}function qa(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 hg=/[\n"\\]/g;function zt(e){return e.replace(hg,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Al(e,t,i,r,c,u,h,m){e.name="",h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"?e.type=h:e.removeAttribute("type"),t!=null?h==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Ct(t)):e.value!==""+Ct(t)&&(e.value=""+Ct(t)):h!=="submit"&&h!=="reset"||e.removeAttribute("value"),t!=null?_l(e,h,Ct(t)):i!=null?_l(e,h,Ct(i)):r!=null&&e.removeAttribute("value"),c==null&&u!=null&&(e.defaultChecked=!!u),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"?e.name=""+Ct(m):e.removeAttribute("name")}function Gu(e,t,i,r,c,u,h,m){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(e.type=u),t!=null||i!=null){if(!(u!=="submit"&&u!=="reset"||t!=null)){Tl(e);return}i=i!=null?""+Ct(i):"",t=t!=null?""+Ct(t):i,m||t===e.value||(e.value=t),e.defaultValue=t}r=r??c,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=m?e.checked:!!r,e.defaultChecked=!!r,h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.name=h),Tl(e)}function _l(e,t,i){t==="number"&&qa(e.ownerDocument)===e||e.defaultValue===""+i||(e.defaultValue=""+i)}function Oi(e,t,i,r){if(e=e.options,t){t={};for(var c=0;c<i.length;c++)t["$"+i[c]]=!0;for(i=0;i<e.length;i++)c=t.hasOwnProperty("$"+e[i].value),e[i].selected!==c&&(e[i].selected=c),c&&r&&(e[i].defaultSelected=!0)}else{for(i=""+Ct(i),t=null,c=0;c<e.length;c++){if(e[c].value===i){e[c].selected=!0,r&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function Vu(e,t,i){if(t!=null&&(t=""+Ct(t),t!==e.value&&(e.value=t),i==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=i!=null?""+Ct(i):""}function Xu(e,t,i,r){if(t==null){if(r!=null){if(i!=null)throw Error(l(92));if(K(r)){if(1<r.length)throw Error(l(93));r=r[0]}i=r}i==null&&(i=""),t=i}i=Ct(t),e.defaultValue=i,r=e.textContent,r===i&&r!==""&&r!==null&&(e.value=r),Tl(e)}function Ri(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var pg=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 Ku(e,t,i){var r=t.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?r?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":r?e.setProperty(t,i):typeof i!="number"||i===0||pg.has(t)?t==="float"?e.cssFloat=i:e[t]=(""+i).trim():e[t]=i+"px"}function Qu(e,t,i){if(t!=null&&typeof t!="object")throw Error(l(62));if(e=e.style,i!=null){for(var r in i)!i.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf("--")===0?e.setProperty(r,""):r==="float"?e.cssFloat="":e[r]="");for(var c in t)r=t[c],t.hasOwnProperty(c)&&i[c]!==r&&Ku(e,c,r)}else for(var u in t)t.hasOwnProperty(u)&&Ku(e,u,t[u])}function jl(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 mg=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"]]),yg=/^[\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 $a(e){return yg.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function fn(){}var Nl=null;function Ol(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Mi=null,Ci=null;function Zu(e){var t=_i(e);if(t&&(e=t.stateNode)){var i=e[mt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Al(e,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),t=i.name,i.type==="radio"&&t!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+zt(""+t)+'"][type="radio"]'),t=0;t<i.length;t++){var r=i[t];if(r!==e&&r.form===e.form){var c=r[mt]||null;if(!c)throw Error(l(90));Al(r,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(t=0;t<i.length;t++)r=i[t],r.form===e.form&&Yu(r)}break e;case"textarea":Vu(e,i.value,i.defaultValue);break e;case"select":t=i.value,t!=null&&Oi(e,!!i.multiple,t,!1)}}}var Rl=!1;function Ju(e,t,i){if(Rl)return e(t,i);Rl=!0;try{var r=e(t);return r}finally{if(Rl=!1,(Mi!==null||Ci!==null)&&(Ar(),Mi&&(t=Mi,e=Ci,Ci=Mi=null,Zu(t),e)))for(t=0;t<e.length;t++)Zu(e[t])}}function _s(e,t){var i=e.stateNode;if(i===null)return null;var r=i[mt]||null;if(r===null)return null;i=r[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":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(l(231,t,typeof i));return i}var dn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ml=!1;if(dn)try{var js={};Object.defineProperty(js,"passive",{get:function(){Ml=!0}}),window.addEventListener("test",js,js),window.removeEventListener("test",js,js)}catch{Ml=!1}var On=null,Cl=null,La=null;function Fu(){if(La)return La;var e,t=Cl,i=t.length,r,c="value"in On?On.value:On.textContent,u=c.length;for(e=0;e<i&&t[e]===c[e];e++);var h=i-e;for(r=1;r<=h&&t[i-r]===c[u-r];r++);return La=c.slice(e,1<r?1-r:void 0)}function Ha(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 Ya(){return!0}function Wu(){return!1}function yt(e){function t(i,r,c,u,h){this._reactName=i,this._targetInst=c,this.type=r,this.nativeEvent=u,this.target=h,this.currentTarget=null;for(var m in e)e.hasOwnProperty(m)&&(i=e[m],this[m]=i?i(u):u[m]);return this.isDefaultPrevented=(u.defaultPrevented!=null?u.defaultPrevented:u.returnValue===!1)?Ya:Wu,this.isPropagationStopped=Wu,this}return b(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=Ya)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Ya)},persist:function(){},isPersistent:Ya}),t}var ri={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ga=yt(ri),Ns=b({},ri,{view:0,detail:0}),gg=yt(Ns),zl,Ul,Os,Va=b({},Ns,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Bl,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!==Os&&(Os&&e.type==="mousemove"?(zl=e.screenX-Os.screenX,Ul=e.screenY-Os.screenY):Ul=zl=0,Os=e),zl)},movementY:function(e){return"movementY"in e?e.movementY:Ul}}),Iu=yt(Va),vg=b({},Va,{dataTransfer:0}),bg=yt(vg),wg=b({},Ns,{relatedTarget:0}),Dl=yt(wg),xg=b({},ri,{animationName:0,elapsedTime:0,pseudoElement:0}),Sg=yt(xg),Eg=b({},ri,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),kg=yt(Eg),Tg=b({},ri,{data:0}),Pu=yt(Tg),Ag={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},_g={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"},jg={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ng(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=jg[e])?!!t[e]:!1}function Bl(){return Ng}var Og=b({},Ns,{key:function(e){if(e.key){var t=Ag[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ha(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?_g[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Bl,charCode:function(e){return e.type==="keypress"?Ha(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ha(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Rg=yt(Og),Mg=b({},Va,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ef=yt(Mg),Cg=b({},Ns,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Bl}),zg=yt(Cg),Ug=b({},ri,{propertyName:0,elapsedTime:0,pseudoElement:0}),Dg=yt(Ug),Bg=b({},Va,{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}),qg=yt(Bg),$g=b({},ri,{newState:0,oldState:0}),Lg=yt($g),Hg=[9,13,27,32],ql=dn&&"CompositionEvent"in window,Rs=null;dn&&"documentMode"in document&&(Rs=document.documentMode);var Yg=dn&&"TextEvent"in window&&!Rs,tf=dn&&(!ql||Rs&&8<Rs&&11>=Rs),nf=" ",sf=!1;function af(e,t){switch(e){case"keyup":return Hg.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function rf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var zi=!1;function Gg(e,t){switch(e){case"compositionend":return rf(t);case"keypress":return t.which!==32?null:(sf=!0,nf);case"textInput":return e=t.data,e===nf&&sf?null:e;default:return null}}function Vg(e,t){if(zi)return e==="compositionend"||!ql&&af(e,t)?(e=Fu(),La=Cl=On=null,zi=!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 tf&&t.locale!=="ko"?null:t.data;default:return null}}var Xg={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 lf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Xg[e.type]:t==="textarea"}function of(e,t,i,r){Mi?Ci?Ci.push(r):Ci=[r]:Mi=r,t=Cr(t,"onChange"),0<t.length&&(i=new Ga("onChange","change",null,i,r),e.push({event:i,listeners:t}))}var Ms=null,Cs=null;function Kg(e){Vh(e,0)}function Xa(e){var t=As(e);if(Yu(t))return e}function cf(e,t){if(e==="change")return t}var uf=!1;if(dn){var $l;if(dn){var Ll="oninput"in document;if(!Ll){var ff=document.createElement("div");ff.setAttribute("oninput","return;"),Ll=typeof ff.oninput=="function"}$l=Ll}else $l=!1;uf=$l&&(!document.documentMode||9<document.documentMode)}function df(){Ms&&(Ms.detachEvent("onpropertychange",hf),Cs=Ms=null)}function hf(e){if(e.propertyName==="value"&&Xa(Cs)){var t=[];of(t,Cs,e,Ol(e)),Ju(Kg,t)}}function Qg(e,t,i){e==="focusin"?(df(),Ms=t,Cs=i,Ms.attachEvent("onpropertychange",hf)):e==="focusout"&&df()}function Zg(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Xa(Cs)}function Jg(e,t){if(e==="click")return Xa(t)}function Fg(e,t){if(e==="input"||e==="change")return Xa(t)}function Wg(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var kt=typeof Object.is=="function"?Object.is:Wg;function zs(e,t){if(kt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var i=Object.keys(e),r=Object.keys(t);if(i.length!==r.length)return!1;for(r=0;r<i.length;r++){var c=i[r];if(!H.call(t,c)||!kt(e[c],t[c]))return!1}return!0}function pf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function mf(e,t){var i=pf(e);e=0;for(var r;i;){if(i.nodeType===3){if(r=e+i.textContent.length,e<=t&&r>=t)return{node:i,offset:t-e};e=r}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=pf(i)}}function yf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?yf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function gf(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=qa(e.document);t instanceof e.HTMLIFrameElement;){try{var i=typeof t.contentWindow.location.href=="string"}catch{i=!1}if(i)e=t.contentWindow;else break;t=qa(e.document)}return t}function Hl(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 Ig=dn&&"documentMode"in document&&11>=document.documentMode,Ui=null,Yl=null,Us=null,Gl=!1;function vf(e,t,i){var r=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Gl||Ui==null||Ui!==qa(r)||(r=Ui,"selectionStart"in r&&Hl(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Us&&zs(Us,r)||(Us=r,r=Cr(Yl,"onSelect"),0<r.length&&(t=new Ga("onSelect","select",null,t,i),e.push({event:t,listeners:r}),t.target=Ui)))}function li(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var Di={animationend:li("Animation","AnimationEnd"),animationiteration:li("Animation","AnimationIteration"),animationstart:li("Animation","AnimationStart"),transitionrun:li("Transition","TransitionRun"),transitionstart:li("Transition","TransitionStart"),transitioncancel:li("Transition","TransitionCancel"),transitionend:li("Transition","TransitionEnd")},Vl={},bf={};dn&&(bf=document.createElement("div").style,"AnimationEvent"in window||(delete Di.animationend.animation,delete Di.animationiteration.animation,delete Di.animationstart.animation),"TransitionEvent"in window||delete Di.transitionend.transition);function oi(e){if(Vl[e])return Vl[e];if(!Di[e])return e;var t=Di[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in bf)return Vl[e]=t[i];return e}var wf=oi("animationend"),xf=oi("animationiteration"),Sf=oi("animationstart"),Pg=oi("transitionrun"),ev=oi("transitionstart"),tv=oi("transitioncancel"),Ef=oi("transitionend"),kf=new Map,Xl="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(" ");Xl.push("scrollEnd");function Vt(e,t){kf.set(e,t),ai(t,[e])}var Ka=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)},Ut=[],Bi=0,Kl=0;function Qa(){for(var e=Bi,t=Kl=Bi=0;t<e;){var i=Ut[t];Ut[t++]=null;var r=Ut[t];Ut[t++]=null;var c=Ut[t];Ut[t++]=null;var u=Ut[t];if(Ut[t++]=null,r!==null&&c!==null){var h=r.pending;h===null?c.next=c:(c.next=h.next,h.next=c),r.pending=c}u!==0&&Tf(i,c,u)}}function Za(e,t,i,r){Ut[Bi++]=e,Ut[Bi++]=t,Ut[Bi++]=i,Ut[Bi++]=r,Kl|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Ql(e,t,i,r){return Za(e,t,i,r),Ja(e)}function ci(e,t){return Za(e,null,null,t),Ja(e)}function Tf(e,t,i){e.lanes|=i;var r=e.alternate;r!==null&&(r.lanes|=i);for(var c=!1,u=e.return;u!==null;)u.childLanes|=i,r=u.alternate,r!==null&&(r.childLanes|=i),u.tag===22&&(e=u.stateNode,e===null||e._visibility&1||(c=!0)),e=u,u=u.return;return e.tag===3?(u=e.stateNode,c&&t!==null&&(c=31-Et(i),e=u.hiddenUpdates,r=e[c],r===null?e[c]=[t]:r.push(t),t.lane=i|536870912),u):null}function Ja(e){if(50<ia)throw ia=0,ic=null,Error(l(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var qi={};function nv(e,t,i,r){this.tag=e,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Tt(e,t,i,r){return new nv(e,t,i,r)}function Zl(e){return e=e.prototype,!(!e||!e.isReactComponent)}function hn(e,t){var i=e.alternate;return i===null?(i=Tt(e.tag,t,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=t,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=e.flags&65011712,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,t=e.dependencies,i.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i.refCleanup=e.refCleanup,i}function Af(e,t){e.flags&=65011714;var i=e.alternate;return i===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=i.childLanes,e.lanes=i.lanes,e.child=i.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=i.memoizedProps,e.memoizedState=i.memoizedState,e.updateQueue=i.updateQueue,e.type=i.type,t=i.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Fa(e,t,i,r,c,u){var h=0;if(r=e,typeof e=="function")Zl(e)&&(h=1);else if(typeof e=="string")h=l0(e,i,ee.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case P:return e=Tt(31,i,t,c),e.elementType=P,e.lanes=u,e;case J:return ui(i.children,c,u,t);case F:h=8,c|=24;break;case M:return e=Tt(12,i,t,c|2),e.elementType=M,e.lanes=u,e;case A:return e=Tt(13,i,t,c),e.elementType=A,e.lanes=u,e;case $:return e=Tt(19,i,t,c),e.elementType=$,e.lanes=u,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Z:h=10;break e;case Y:h=9;break e;case S:h=11;break e;case z:h=14;break e;case W:h=16,r=null;break e}h=29,i=Error(l(130,e===null?"null":typeof e,"")),r=null}return t=Tt(h,i,t,c),t.elementType=e,t.type=r,t.lanes=u,t}function ui(e,t,i,r){return e=Tt(7,e,r,t),e.lanes=i,e}function Jl(e,t,i){return e=Tt(6,e,null,t),e.lanes=i,e}function _f(e){var t=Tt(18,null,null,0);return t.stateNode=e,t}function Fl(e,t,i){return t=Tt(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var jf=new WeakMap;function Dt(e,t){if(typeof e=="object"&&e!==null){var i=jf.get(e);return i!==void 0?i:(t={value:e,source:t,stack:xs(t)},jf.set(e,t),t)}return{value:e,source:t,stack:xs(t)}}var $i=[],Li=0,Wa=null,Ds=0,Bt=[],qt=0,Rn=null,tn=1,nn="";function pn(e,t){$i[Li++]=Ds,$i[Li++]=Wa,Wa=e,Ds=t}function Nf(e,t,i){Bt[qt++]=tn,Bt[qt++]=nn,Bt[qt++]=Rn,Rn=e;var r=tn;e=nn;var c=32-Et(r)-1;r&=~(1<<c),i+=1;var u=32-Et(t)+c;if(30<u){var h=c-c%5;u=(r&(1<<h)-1).toString(32),r>>=h,c-=h,tn=1<<32-Et(t)+c|i<<c|r,nn=u+e}else tn=1<<u|i<<c|r,nn=e}function Wl(e){e.return!==null&&(pn(e,1),Nf(e,1,0))}function Il(e){for(;e===Wa;)Wa=$i[--Li],$i[Li]=null,Ds=$i[--Li],$i[Li]=null;for(;e===Rn;)Rn=Bt[--qt],Bt[qt]=null,nn=Bt[--qt],Bt[qt]=null,tn=Bt[--qt],Bt[qt]=null}function Of(e,t){Bt[qt++]=tn,Bt[qt++]=nn,Bt[qt++]=Rn,tn=t.id,nn=t.overflow,Rn=e}var rt=null,Le=null,ke=!1,Mn=null,$t=!1,Pl=Error(l(519));function Cn(e){var t=Error(l(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Bs(Dt(t,e)),Pl}function Rf(e){var t=e.stateNode,i=e.type,r=e.memoizedProps;switch(t[at]=e,t[mt]=r,i){case"dialog":xe("cancel",t),xe("close",t);break;case"iframe":case"object":case"embed":xe("load",t);break;case"video":case"audio":for(i=0;i<aa.length;i++)xe(aa[i],t);break;case"source":xe("error",t);break;case"img":case"image":case"link":xe("error",t),xe("load",t);break;case"details":xe("toggle",t);break;case"input":xe("invalid",t),Gu(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":xe("invalid",t);break;case"textarea":xe("invalid",t),Xu(t,r.value,r.defaultValue,r.children)}i=r.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||t.textContent===""+i||r.suppressHydrationWarning===!0||Zh(t.textContent,i)?(r.popover!=null&&(xe("beforetoggle",t),xe("toggle",t)),r.onScroll!=null&&xe("scroll",t),r.onScrollEnd!=null&&xe("scrollend",t),r.onClick!=null&&(t.onclick=fn),t=!0):t=!1,t||Cn(e,!0)}function Mf(e){for(rt=e.return;rt;)switch(rt.tag){case 5:case 31:case 13:$t=!1;return;case 27:case 3:$t=!0;return;default:rt=rt.return}}function Hi(e){if(e!==rt)return!1;if(!ke)return Mf(e),ke=!0,!1;var t=e.tag,i;if((i=t!==3&&t!==27)&&((i=t===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||vc(e.type,e.memoizedProps)),i=!i),i&&Le&&Cn(e),Mf(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));Le=ip(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));Le=ip(e)}else t===27?(t=Le,Qn(e.type)?(e=Ec,Ec=null,Le=e):Le=t):Le=rt?Ht(e.stateNode.nextSibling):null;return!0}function fi(){Le=rt=null,ke=!1}function eo(){var e=Mn;return e!==null&&(wt===null?wt=e:wt.push.apply(wt,e),Mn=null),e}function Bs(e){Mn===null?Mn=[e]:Mn.push(e)}var to=x(null),di=null,mn=null;function zn(e,t,i){Q(to,t._currentValue),t._currentValue=i}function yn(e){e._currentValue=to.current,D(to)}function no(e,t,i){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===i)break;e=e.return}}function io(e,t,i,r){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var u=c.dependencies;if(u!==null){var h=c.child;u=u.firstContext;e:for(;u!==null;){var m=u;u=c;for(var w=0;w<t.length;w++)if(m.context===t[w]){u.lanes|=i,m=u.alternate,m!==null&&(m.lanes|=i),no(u.return,i,e),r||(h=null);break e}u=m.next}}else if(c.tag===18){if(h=c.return,h===null)throw Error(l(341));h.lanes|=i,u=h.alternate,u!==null&&(u.lanes|=i),no(h,i,e),h=null}else h=c.child;if(h!==null)h.return=c;else for(h=c;h!==null;){if(h===e){h=null;break}if(c=h.sibling,c!==null){c.return=h.return,h=c;break}h=h.return}c=h}}function Yi(e,t,i,r){e=null;for(var c=t,u=!1;c!==null;){if(!u){if((c.flags&524288)!==0)u=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var h=c.alternate;if(h===null)throw Error(l(387));if(h=h.memoizedProps,h!==null){var m=c.type;kt(c.pendingProps.value,h.value)||(e!==null?e.push(m):e=[m])}}else if(c===Ae.current){if(h=c.alternate,h===null)throw Error(l(387));h.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(ua):e=[ua])}c=c.return}e!==null&&io(t,e,i,r),t.flags|=262144}function Ia(e){for(e=e.firstContext;e!==null;){if(!kt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function hi(e){di=e,mn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function lt(e){return Cf(di,e)}function Pa(e,t){return di===null&&hi(e),Cf(e,t)}function Cf(e,t){var i=t._currentValue;if(t={context:t,memoizedValue:i,next:null},mn===null){if(e===null)throw Error(l(308));mn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else mn=mn.next=t;return i}var iv=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(i,r){e.push(r)}};this.abort=function(){t.aborted=!0,e.forEach(function(i){return i()})}},sv=a.unstable_scheduleCallback,av=a.unstable_NormalPriority,Ze={$$typeof:Z,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function so(){return{controller:new iv,data:new Map,refCount:0}}function qs(e){e.refCount--,e.refCount===0&&sv(av,function(){e.controller.abort()})}var $s=null,ao=0,Gi=0,Vi=null;function rv(e,t){if($s===null){var i=$s=[];ao=0,Gi=cc(),Vi={status:"pending",value:void 0,then:function(r){i.push(r)}}}return ao++,t.then(zf,zf),t}function zf(){if(--ao===0&&$s!==null){Vi!==null&&(Vi.status="fulfilled");var e=$s;$s=null,Gi=0,Vi=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function lv(e,t){var i=[],r={status:"pending",value:null,reason:null,then:function(c){i.push(c)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var c=0;c<i.length;c++)(0,i[c])(t)},function(c){for(r.status="rejected",r.reason=c,c=0;c<i.length;c++)(0,i[c])(void 0)}),r}var Uf=j.S;j.S=function(e,t){vh=Qe(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&rv(e,t),Uf!==null&&Uf(e,t)};var pi=x(null);function ro(){var e=pi.current;return e!==null?e:qe.pooledCache}function er(e,t){t===null?Q(pi,pi.current):Q(pi,t.pool)}function Df(){var e=ro();return e===null?null:{parent:Ze._currentValue,pool:e}}var Xi=Error(l(460)),lo=Error(l(474)),tr=Error(l(542)),nr={then:function(){}};function Bf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function qf(e,t,i){switch(i=e[i],i===void 0?e.push(t):i!==t&&(t.then(fn,fn),t=i),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Lf(e),e;default:if(typeof t.status=="string")t.then(fn,fn);else{if(e=qe,e!==null&&100<e.shellSuspendCounter)throw Error(l(482));e=t,e.status="pending",e.then(function(r){if(t.status==="pending"){var c=t;c.status="fulfilled",c.value=r}},function(r){if(t.status==="pending"){var c=t;c.status="rejected",c.reason=r}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Lf(e),e}throw yi=t,Xi}}function mi(e){try{var t=e._init;return t(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(yi=i,Xi):i}}var yi=null;function $f(){if(yi===null)throw Error(l(459));var e=yi;return yi=null,e}function Lf(e){if(e===Xi||e===tr)throw Error(l(483))}var Ki=null,Ls=0;function ir(e){var t=Ls;return Ls+=1,Ki===null&&(Ki=[]),qf(Ki,e,t)}function Hs(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function sr(e,t){throw t.$$typeof===_?Error(l(525)):(e=Object.prototype.toString.call(t),Error(l(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Hf(e){function t(T,E){if(e){var N=T.deletions;N===null?(T.deletions=[E],T.flags|=16):N.push(E)}}function i(T,E){if(!e)return null;for(;E!==null;)t(T,E),E=E.sibling;return null}function r(T){for(var E=new Map;T!==null;)T.key!==null?E.set(T.key,T):E.set(T.index,T),T=T.sibling;return E}function c(T,E){return T=hn(T,E),T.index=0,T.sibling=null,T}function u(T,E,N){return T.index=N,e?(N=T.alternate,N!==null?(N=N.index,N<E?(T.flags|=67108866,E):N):(T.flags|=67108866,E)):(T.flags|=1048576,E)}function h(T){return e&&T.alternate===null&&(T.flags|=67108866),T}function m(T,E,N,B){return E===null||E.tag!==6?(E=Jl(N,T.mode,B),E.return=T,E):(E=c(E,N),E.return=T,E)}function w(T,E,N,B){var re=N.type;return re===J?U(T,E,N.props.children,B,N.key):E!==null&&(E.elementType===re||typeof re=="object"&&re!==null&&re.$$typeof===W&&mi(re)===E.type)?(E=c(E,N.props),Hs(E,N),E.return=T,E):(E=Fa(N.type,N.key,N.props,null,T.mode,B),Hs(E,N),E.return=T,E)}function O(T,E,N,B){return E===null||E.tag!==4||E.stateNode.containerInfo!==N.containerInfo||E.stateNode.implementation!==N.implementation?(E=Fl(N,T.mode,B),E.return=T,E):(E=c(E,N.children||[]),E.return=T,E)}function U(T,E,N,B,re){return E===null||E.tag!==7?(E=ui(N,T.mode,B,re),E.return=T,E):(E=c(E,N),E.return=T,E)}function L(T,E,N){if(typeof E=="string"&&E!==""||typeof E=="number"||typeof E=="bigint")return E=Jl(""+E,T.mode,N),E.return=T,E;if(typeof E=="object"&&E!==null){switch(E.$$typeof){case G:return N=Fa(E.type,E.key,E.props,null,T.mode,N),Hs(N,E),N.return=T,N;case V:return E=Fl(E,T.mode,N),E.return=T,E;case W:return E=mi(E),L(T,E,N)}if(K(E)||le(E))return E=ui(E,T.mode,N,null),E.return=T,E;if(typeof E.then=="function")return L(T,ir(E),N);if(E.$$typeof===Z)return L(T,Pa(T,E),N);sr(T,E)}return null}function R(T,E,N,B){var re=E!==null?E.key:null;if(typeof N=="string"&&N!==""||typeof N=="number"||typeof N=="bigint")return re!==null?null:m(T,E,""+N,B);if(typeof N=="object"&&N!==null){switch(N.$$typeof){case G:return N.key===re?w(T,E,N,B):null;case V:return N.key===re?O(T,E,N,B):null;case W:return N=mi(N),R(T,E,N,B)}if(K(N)||le(N))return re!==null?null:U(T,E,N,B,null);if(typeof N.then=="function")return R(T,E,ir(N),B);if(N.$$typeof===Z)return R(T,E,Pa(T,N),B);sr(T,N)}return null}function C(T,E,N,B,re){if(typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint")return T=T.get(N)||null,m(E,T,""+B,re);if(typeof B=="object"&&B!==null){switch(B.$$typeof){case G:return T=T.get(B.key===null?N:B.key)||null,w(E,T,B,re);case V:return T=T.get(B.key===null?N:B.key)||null,O(E,T,B,re);case W:return B=mi(B),C(T,E,N,B,re)}if(K(B)||le(B))return T=T.get(N)||null,U(E,T,B,re,null);if(typeof B.then=="function")return C(T,E,N,ir(B),re);if(B.$$typeof===Z)return C(T,E,N,Pa(E,B),re);sr(E,B)}return null}function ne(T,E,N,B){for(var re=null,_e=null,se=E,ye=E=0,Ee=null;se!==null&&ye<N.length;ye++){se.index>ye?(Ee=se,se=null):Ee=se.sibling;var je=R(T,se,N[ye],B);if(je===null){se===null&&(se=Ee);break}e&&se&&je.alternate===null&&t(T,se),E=u(je,E,ye),_e===null?re=je:_e.sibling=je,_e=je,se=Ee}if(ye===N.length)return i(T,se),ke&&pn(T,ye),re;if(se===null){for(;ye<N.length;ye++)se=L(T,N[ye],B),se!==null&&(E=u(se,E,ye),_e===null?re=se:_e.sibling=se,_e=se);return ke&&pn(T,ye),re}for(se=r(se);ye<N.length;ye++)Ee=C(se,T,ye,N[ye],B),Ee!==null&&(e&&Ee.alternate!==null&&se.delete(Ee.key===null?ye:Ee.key),E=u(Ee,E,ye),_e===null?re=Ee:_e.sibling=Ee,_e=Ee);return e&&se.forEach(function(In){return t(T,In)}),ke&&pn(T,ye),re}function ue(T,E,N,B){if(N==null)throw Error(l(151));for(var re=null,_e=null,se=E,ye=E=0,Ee=null,je=N.next();se!==null&&!je.done;ye++,je=N.next()){se.index>ye?(Ee=se,se=null):Ee=se.sibling;var In=R(T,se,je.value,B);if(In===null){se===null&&(se=Ee);break}e&&se&&In.alternate===null&&t(T,se),E=u(In,E,ye),_e===null?re=In:_e.sibling=In,_e=In,se=Ee}if(je.done)return i(T,se),ke&&pn(T,ye),re;if(se===null){for(;!je.done;ye++,je=N.next())je=L(T,je.value,B),je!==null&&(E=u(je,E,ye),_e===null?re=je:_e.sibling=je,_e=je);return ke&&pn(T,ye),re}for(se=r(se);!je.done;ye++,je=N.next())je=C(se,T,ye,je.value,B),je!==null&&(e&&je.alternate!==null&&se.delete(je.key===null?ye:je.key),E=u(je,E,ye),_e===null?re=je:_e.sibling=je,_e=je);return e&&se.forEach(function(v0){return t(T,v0)}),ke&&pn(T,ye),re}function De(T,E,N,B){if(typeof N=="object"&&N!==null&&N.type===J&&N.key===null&&(N=N.props.children),typeof N=="object"&&N!==null){switch(N.$$typeof){case G:e:{for(var re=N.key;E!==null;){if(E.key===re){if(re=N.type,re===J){if(E.tag===7){i(T,E.sibling),B=c(E,N.props.children),B.return=T,T=B;break e}}else if(E.elementType===re||typeof re=="object"&&re!==null&&re.$$typeof===W&&mi(re)===E.type){i(T,E.sibling),B=c(E,N.props),Hs(B,N),B.return=T,T=B;break e}i(T,E);break}else t(T,E);E=E.sibling}N.type===J?(B=ui(N.props.children,T.mode,B,N.key),B.return=T,T=B):(B=Fa(N.type,N.key,N.props,null,T.mode,B),Hs(B,N),B.return=T,T=B)}return h(T);case V:e:{for(re=N.key;E!==null;){if(E.key===re)if(E.tag===4&&E.stateNode.containerInfo===N.containerInfo&&E.stateNode.implementation===N.implementation){i(T,E.sibling),B=c(E,N.children||[]),B.return=T,T=B;break e}else{i(T,E);break}else t(T,E);E=E.sibling}B=Fl(N,T.mode,B),B.return=T,T=B}return h(T);case W:return N=mi(N),De(T,E,N,B)}if(K(N))return ne(T,E,N,B);if(le(N)){if(re=le(N),typeof re!="function")throw Error(l(150));return N=re.call(N),ue(T,E,N,B)}if(typeof N.then=="function")return De(T,E,ir(N),B);if(N.$$typeof===Z)return De(T,E,Pa(T,N),B);sr(T,N)}return typeof N=="string"&&N!==""||typeof N=="number"||typeof N=="bigint"?(N=""+N,E!==null&&E.tag===6?(i(T,E.sibling),B=c(E,N),B.return=T,T=B):(i(T,E),B=Jl(N,T.mode,B),B.return=T,T=B),h(T)):i(T,E)}return function(T,E,N,B){try{Ls=0;var re=De(T,E,N,B);return Ki=null,re}catch(se){if(se===Xi||se===tr)throw se;var _e=Tt(29,se,null,T.mode);return _e.lanes=B,_e.return=T,_e}}}var gi=Hf(!0),Yf=Hf(!1),Un=!1;function oo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function co(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 Dn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Bn(e,t,i){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(Ne&2)!==0){var c=r.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),r.pending=t,t=Ja(e),Tf(e,null,i),t}return Za(e,r,t,i),Ja(e)}function Ys(e,t,i){if(t=t.updateQueue,t!==null&&(t=t.shared,(i&4194048)!==0)){var r=t.lanes;r&=e.pendingLanes,i|=r,t.lanes=i,Mu(e,i)}}function uo(e,t){var i=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,i===r)){var c=null,u=null;if(i=i.firstBaseUpdate,i!==null){do{var h={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};u===null?c=u=h:u=u.next=h,i=i.next}while(i!==null);u===null?c=u=t:u=u.next=t}else c=u=t;i={baseState:r.baseState,firstBaseUpdate:c,lastBaseUpdate:u,shared:r.shared,callbacks:r.callbacks},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=t:e.next=t,i.lastBaseUpdate=t}var fo=!1;function Gs(){if(fo){var e=Vi;if(e!==null)throw e}}function Vs(e,t,i,r){fo=!1;var c=e.updateQueue;Un=!1;var u=c.firstBaseUpdate,h=c.lastBaseUpdate,m=c.shared.pending;if(m!==null){c.shared.pending=null;var w=m,O=w.next;w.next=null,h===null?u=O:h.next=O,h=w;var U=e.alternate;U!==null&&(U=U.updateQueue,m=U.lastBaseUpdate,m!==h&&(m===null?U.firstBaseUpdate=O:m.next=O,U.lastBaseUpdate=w))}if(u!==null){var L=c.baseState;h=0,U=O=w=null,m=u;do{var R=m.lane&-536870913,C=R!==m.lane;if(C?(Se&R)===R:(r&R)===R){R!==0&&R===Gi&&(fo=!0),U!==null&&(U=U.next={lane:0,tag:m.tag,payload:m.payload,callback:null,next:null});e:{var ne=e,ue=m;R=t;var De=i;switch(ue.tag){case 1:if(ne=ue.payload,typeof ne=="function"){L=ne.call(De,L,R);break e}L=ne;break e;case 3:ne.flags=ne.flags&-65537|128;case 0:if(ne=ue.payload,R=typeof ne=="function"?ne.call(De,L,R):ne,R==null)break e;L=b({},L,R);break e;case 2:Un=!0}}R=m.callback,R!==null&&(e.flags|=64,C&&(e.flags|=8192),C=c.callbacks,C===null?c.callbacks=[R]:C.push(R))}else C={lane:R,tag:m.tag,payload:m.payload,callback:m.callback,next:null},U===null?(O=U=C,w=L):U=U.next=C,h|=R;if(m=m.next,m===null){if(m=c.shared.pending,m===null)break;C=m,m=C.next,C.next=null,c.lastBaseUpdate=C,c.shared.pending=null}}while(!0);U===null&&(w=L),c.baseState=w,c.firstBaseUpdate=O,c.lastBaseUpdate=U,u===null&&(c.shared.lanes=0),Yn|=h,e.lanes=h,e.memoizedState=L}}function Gf(e,t){if(typeof e!="function")throw Error(l(191,e));e.call(t)}function Vf(e,t){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)Gf(i[e],t)}var Qi=x(null),ar=x(0);function Xf(e,t){e=Tn,Q(ar,e),Q(Qi,t),Tn=e|t.baseLanes}function ho(){Q(ar,Tn),Q(Qi,Qi.current)}function po(){Tn=ar.current,D(Qi),D(ar)}var At=x(null),Lt=null;function qn(e){var t=e.alternate;Q(Xe,Xe.current&1),Q(At,e),Lt===null&&(t===null||Qi.current!==null||t.memoizedState!==null)&&(Lt=e)}function mo(e){Q(Xe,Xe.current),Q(At,e),Lt===null&&(Lt=e)}function Kf(e){e.tag===22?(Q(Xe,Xe.current),Q(At,e),Lt===null&&(Lt=e)):$n()}function $n(){Q(Xe,Xe.current),Q(At,At.current)}function _t(e){D(At),Lt===e&&(Lt=null),D(Xe)}var Xe=x(0);function rr(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||xc(i)||Sc(i)))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 gn=0,me=null,ze=null,Je=null,lr=!1,Zi=!1,vi=!1,or=0,Xs=0,Ji=null,ov=0;function Ge(){throw Error(l(321))}function yo(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!kt(e[i],t[i]))return!1;return!0}function go(e,t,i,r,c,u){return gn=u,me=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,j.H=e===null||e.memoizedState===null?Nd:Mo,vi=!1,u=i(r,c),vi=!1,Zi&&(u=Zf(t,i,r,c)),Qf(e),u}function Qf(e){j.H=Zs;var t=ze!==null&&ze.next!==null;if(gn=0,Je=ze=me=null,lr=!1,Xs=0,Ji=null,t)throw Error(l(300));e===null||Fe||(e=e.dependencies,e!==null&&Ia(e)&&(Fe=!0))}function Zf(e,t,i,r){me=e;var c=0;do{if(Zi&&(Ji=null),Xs=0,Zi=!1,25<=c)throw Error(l(301));if(c+=1,Je=ze=null,e.updateQueue!=null){var u=e.updateQueue;u.lastEffect=null,u.events=null,u.stores=null,u.memoCache!=null&&(u.memoCache.index=0)}j.H=Od,u=t(i,r)}while(Zi);return u}function cv(){var e=j.H,t=e.useState()[0];return t=typeof t.then=="function"?Ks(t):t,e=e.useState()[0],(ze!==null?ze.memoizedState:null)!==e&&(me.flags|=1024),t}function vo(){var e=or!==0;return or=0,e}function bo(e,t,i){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i}function wo(e){if(lr){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}lr=!1}gn=0,Je=ze=me=null,Zi=!1,Xs=or=0,Ji=null}function ht(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Je===null?me.memoizedState=Je=e:Je=Je.next=e,Je}function Ke(){if(ze===null){var e=me.alternate;e=e!==null?e.memoizedState:null}else e=ze.next;var t=Je===null?me.memoizedState:Je.next;if(t!==null)Je=t,ze=e;else{if(e===null)throw me.alternate===null?Error(l(467)):Error(l(310));ze=e,e={memoizedState:ze.memoizedState,baseState:ze.baseState,baseQueue:ze.baseQueue,queue:ze.queue,next:null},Je===null?me.memoizedState=Je=e:Je=Je.next=e}return Je}function cr(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ks(e){var t=Xs;return Xs+=1,Ji===null&&(Ji=[]),e=qf(Ji,e,t),t=me,(Je===null?t.memoizedState:Je.next)===null&&(t=t.alternate,j.H=t===null||t.memoizedState===null?Nd:Mo),e}function ur(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Ks(e);if(e.$$typeof===Z)return lt(e)}throw Error(l(438,String(e)))}function xo(e){var t=null,i=me.updateQueue;if(i!==null&&(t=i.memoCache),t==null){var r=me.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(c){return c.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),i===null&&(i=cr(),me.updateQueue=i),i.memoCache=t,i=t.data[t.index],i===void 0)for(i=t.data[t.index]=Array(e),r=0;r<e;r++)i[r]=ie;return t.index++,i}function vn(e,t){return typeof t=="function"?t(e):t}function fr(e){var t=Ke();return So(t,ze,e)}function So(e,t,i){var r=e.queue;if(r===null)throw Error(l(311));r.lastRenderedReducer=i;var c=e.baseQueue,u=r.pending;if(u!==null){if(c!==null){var h=c.next;c.next=u.next,u.next=h}t.baseQueue=c=u,r.pending=null}if(u=e.baseState,c===null)e.memoizedState=u;else{t=c.next;var m=h=null,w=null,O=t,U=!1;do{var L=O.lane&-536870913;if(L!==O.lane?(Se&L)===L:(gn&L)===L){var R=O.revertLane;if(R===0)w!==null&&(w=w.next={lane:0,revertLane:0,gesture:null,action:O.action,hasEagerState:O.hasEagerState,eagerState:O.eagerState,next:null}),L===Gi&&(U=!0);else if((gn&R)===R){O=O.next,R===Gi&&(U=!0);continue}else L={lane:0,revertLane:O.revertLane,gesture:null,action:O.action,hasEagerState:O.hasEagerState,eagerState:O.eagerState,next:null},w===null?(m=w=L,h=u):w=w.next=L,me.lanes|=R,Yn|=R;L=O.action,vi&&i(u,L),u=O.hasEagerState?O.eagerState:i(u,L)}else R={lane:L,revertLane:O.revertLane,gesture:O.gesture,action:O.action,hasEagerState:O.hasEagerState,eagerState:O.eagerState,next:null},w===null?(m=w=R,h=u):w=w.next=R,me.lanes|=L,Yn|=L;O=O.next}while(O!==null&&O!==t);if(w===null?h=u:w.next=m,!kt(u,e.memoizedState)&&(Fe=!0,U&&(i=Vi,i!==null)))throw i;e.memoizedState=u,e.baseState=h,e.baseQueue=w,r.lastRenderedState=u}return c===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Eo(e){var t=Ke(),i=t.queue;if(i===null)throw Error(l(311));i.lastRenderedReducer=e;var r=i.dispatch,c=i.pending,u=t.memoizedState;if(c!==null){i.pending=null;var h=c=c.next;do u=e(u,h.action),h=h.next;while(h!==c);kt(u,t.memoizedState)||(Fe=!0),t.memoizedState=u,t.baseQueue===null&&(t.baseState=u),i.lastRenderedState=u}return[u,r]}function Jf(e,t,i){var r=me,c=Ke(),u=ke;if(u){if(i===void 0)throw Error(l(407));i=i()}else i=t();var h=!kt((ze||c).memoizedState,i);if(h&&(c.memoizedState=i,Fe=!0),c=c.queue,Ao(If.bind(null,r,c,e),[e]),c.getSnapshot!==t||h||Je!==null&&Je.memoizedState.tag&1){if(r.flags|=2048,Fi(9,{destroy:void 0},Wf.bind(null,r,c,i,t),null),qe===null)throw Error(l(349));u||(gn&127)!==0||Ff(r,t,i)}return i}function Ff(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=me.updateQueue,t===null?(t=cr(),me.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function Wf(e,t,i,r){t.value=i,t.getSnapshot=r,Pf(t)&&ed(e)}function If(e,t,i){return i(function(){Pf(t)&&ed(e)})}function Pf(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!kt(e,i)}catch{return!0}}function ed(e){var t=ci(e,2);t!==null&&xt(t,e,2)}function ko(e){var t=ht();if(typeof e=="function"){var i=e;if(e=i(),vi){jn(!0);try{i()}finally{jn(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:vn,lastRenderedState:e},t}function td(e,t,i,r){return e.baseState=i,So(e,ze,typeof r=="function"?r:vn)}function uv(e,t,i,r,c){if(pr(e))throw Error(l(485));if(e=t.action,e!==null){var u={payload:c,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(h){u.listeners.push(h)}};j.T!==null?i(!0):u.isTransition=!1,r(u),i=t.pending,i===null?(u.next=t.pending=u,nd(t,u)):(u.next=i.next,t.pending=i.next=u)}}function nd(e,t){var i=t.action,r=t.payload,c=e.state;if(t.isTransition){var u=j.T,h={};j.T=h;try{var m=i(c,r),w=j.S;w!==null&&w(h,m),id(e,t,m)}catch(O){To(e,t,O)}finally{u!==null&&h.types!==null&&(u.types=h.types),j.T=u}}else try{u=i(c,r),id(e,t,u)}catch(O){To(e,t,O)}}function id(e,t,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(r){sd(e,t,r)},function(r){return To(e,t,r)}):sd(e,t,i)}function sd(e,t,i){t.status="fulfilled",t.value=i,ad(t),e.state=i,t=e.pending,t!==null&&(i=t.next,i===t?e.pending=null:(i=i.next,t.next=i,nd(e,i)))}function To(e,t,i){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=i,ad(t),t=t.next;while(t!==r)}e.action=null}function ad(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function rd(e,t){return t}function ld(e,t){if(ke){var i=qe.formState;if(i!==null){e:{var r=me;if(ke){if(Le){t:{for(var c=Le,u=$t;c.nodeType!==8;){if(!u){c=null;break t}if(c=Ht(c.nextSibling),c===null){c=null;break t}}u=c.data,c=u==="F!"||u==="F"?c:null}if(c){Le=Ht(c.nextSibling),r=c.data==="F!";break e}}Cn(r)}r=!1}r&&(t=i[0])}}return i=ht(),i.memoizedState=i.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:rd,lastRenderedState:t},i.queue=r,i=Ad.bind(null,me,r),r.dispatch=i,r=ko(!1),u=Ro.bind(null,me,!1,r.queue),r=ht(),c={state:t,dispatch:null,action:e,pending:null},r.queue=c,i=uv.bind(null,me,c,u,i),c.dispatch=i,r.memoizedState=e,[t,i,!1]}function od(e){var t=Ke();return cd(t,ze,e)}function cd(e,t,i){if(t=So(e,t,rd)[0],e=fr(vn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=Ks(t)}catch(h){throw h===Xi?tr:h}else r=t;t=Ke();var c=t.queue,u=c.dispatch;return i!==t.memoizedState&&(me.flags|=2048,Fi(9,{destroy:void 0},fv.bind(null,c,i),null)),[r,u,e]}function fv(e,t){e.action=t}function ud(e){var t=Ke(),i=ze;if(i!==null)return cd(t,i,e);Ke(),t=t.memoizedState,i=Ke();var r=i.queue.dispatch;return i.memoizedState=e,[t,r,!1]}function Fi(e,t,i,r){return e={tag:e,create:i,deps:r,inst:t,next:null},t=me.updateQueue,t===null&&(t=cr(),me.updateQueue=t),i=t.lastEffect,i===null?t.lastEffect=e.next=e:(r=i.next,i.next=e,e.next=r,t.lastEffect=e),e}function fd(){return Ke().memoizedState}function dr(e,t,i,r){var c=ht();me.flags|=e,c.memoizedState=Fi(1|t,{destroy:void 0},i,r===void 0?null:r)}function hr(e,t,i,r){var c=Ke();r=r===void 0?null:r;var u=c.memoizedState.inst;ze!==null&&r!==null&&yo(r,ze.memoizedState.deps)?c.memoizedState=Fi(t,u,i,r):(me.flags|=e,c.memoizedState=Fi(1|t,u,i,r))}function dd(e,t){dr(8390656,8,e,t)}function Ao(e,t){hr(2048,8,e,t)}function dv(e){me.flags|=4;var t=me.updateQueue;if(t===null)t=cr(),me.updateQueue=t,t.events=[e];else{var i=t.events;i===null?t.events=[e]:i.push(e)}}function hd(e){var t=Ke().memoizedState;return dv({ref:t,nextImpl:e}),function(){if((Ne&2)!==0)throw Error(l(440));return t.impl.apply(void 0,arguments)}}function pd(e,t){return hr(4,2,e,t)}function md(e,t){return hr(4,4,e,t)}function yd(e,t){if(typeof t=="function"){e=e();var i=t(e);return function(){typeof i=="function"?i():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function gd(e,t,i){i=i!=null?i.concat([e]):null,hr(4,4,yd.bind(null,t,e),i)}function _o(){}function vd(e,t){var i=Ke();t=t===void 0?null:t;var r=i.memoizedState;return t!==null&&yo(t,r[1])?r[0]:(i.memoizedState=[e,t],e)}function bd(e,t){var i=Ke();t=t===void 0?null:t;var r=i.memoizedState;if(t!==null&&yo(t,r[1]))return r[0];if(r=e(),vi){jn(!0);try{e()}finally{jn(!1)}}return i.memoizedState=[r,t],r}function jo(e,t,i){return i===void 0||(gn&1073741824)!==0&&(Se&261930)===0?e.memoizedState=t:(e.memoizedState=i,e=wh(),me.lanes|=e,Yn|=e,i)}function wd(e,t,i,r){return kt(i,t)?i:Qi.current!==null?(e=jo(e,i,r),kt(e,t)||(Fe=!0),e):(gn&42)===0||(gn&1073741824)!==0&&(Se&261930)===0?(Fe=!0,e.memoizedState=i):(e=wh(),me.lanes|=e,Yn|=e,t)}function xd(e,t,i,r,c){var u=X.p;X.p=u!==0&&8>u?u:8;var h=j.T,m={};j.T=m,Ro(e,!1,t,i);try{var w=c(),O=j.S;if(O!==null&&O(m,w),w!==null&&typeof w=="object"&&typeof w.then=="function"){var U=lv(w,r);Qs(e,t,U,Ot(e))}else Qs(e,t,r,Ot(e))}catch(L){Qs(e,t,{then:function(){},status:"rejected",reason:L},Ot())}finally{X.p=u,h!==null&&m.types!==null&&(h.types=m.types),j.T=h}}function hv(){}function No(e,t,i,r){if(e.tag!==5)throw Error(l(476));var c=Sd(e).queue;xd(e,c,t,te,i===null?hv:function(){return Ed(e),i(r)})}function Sd(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:te,baseState:te,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vn,lastRenderedState:te},next:null};var i={};return t.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vn,lastRenderedState:i},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ed(e){var t=Sd(e);t.next===null&&(t=e.alternate.memoizedState),Qs(e,t.next.queue,{},Ot())}function Oo(){return lt(ua)}function kd(){return Ke().memoizedState}function Td(){return Ke().memoizedState}function pv(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var i=Ot();e=Dn(i);var r=Bn(t,e,i);r!==null&&(xt(r,t,i),Ys(r,t,i)),t={cache:so()},e.payload=t;return}t=t.return}}function mv(e,t,i){var r=Ot();i={lane:r,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},pr(e)?_d(t,i):(i=Ql(e,t,i,r),i!==null&&(xt(i,e,r),jd(i,t,r)))}function Ad(e,t,i){var r=Ot();Qs(e,t,i,r)}function Qs(e,t,i,r){var c={lane:r,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(pr(e))_d(t,c);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var h=t.lastRenderedState,m=u(h,i);if(c.hasEagerState=!0,c.eagerState=m,kt(m,h))return Za(e,t,c,0),qe===null&&Qa(),!1}catch{}if(i=Ql(e,t,c,r),i!==null)return xt(i,e,r),jd(i,t,r),!0}return!1}function Ro(e,t,i,r){if(r={lane:2,revertLane:cc(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},pr(e)){if(t)throw Error(l(479))}else t=Ql(e,i,r,2),t!==null&&xt(t,e,2)}function pr(e){var t=e.alternate;return e===me||t!==null&&t===me}function _d(e,t){Zi=lr=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function jd(e,t,i){if((i&4194048)!==0){var r=t.lanes;r&=e.pendingLanes,i|=r,t.lanes=i,Mu(e,i)}}var Zs={readContext:lt,use:ur,useCallback:Ge,useContext:Ge,useEffect:Ge,useImperativeHandle:Ge,useLayoutEffect:Ge,useInsertionEffect:Ge,useMemo:Ge,useReducer:Ge,useRef:Ge,useState:Ge,useDebugValue:Ge,useDeferredValue:Ge,useTransition:Ge,useSyncExternalStore:Ge,useId:Ge,useHostTransitionStatus:Ge,useFormState:Ge,useActionState:Ge,useOptimistic:Ge,useMemoCache:Ge,useCacheRefresh:Ge};Zs.useEffectEvent=Ge;var Nd={readContext:lt,use:ur,useCallback:function(e,t){return ht().memoizedState=[e,t===void 0?null:t],e},useContext:lt,useEffect:dd,useImperativeHandle:function(e,t,i){i=i!=null?i.concat([e]):null,dr(4194308,4,yd.bind(null,t,e),i)},useLayoutEffect:function(e,t){return dr(4194308,4,e,t)},useInsertionEffect:function(e,t){dr(4,2,e,t)},useMemo:function(e,t){var i=ht();t=t===void 0?null:t;var r=e();if(vi){jn(!0);try{e()}finally{jn(!1)}}return i.memoizedState=[r,t],r},useReducer:function(e,t,i){var r=ht();if(i!==void 0){var c=i(t);if(vi){jn(!0);try{i(t)}finally{jn(!1)}}}else c=t;return r.memoizedState=r.baseState=c,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:c},r.queue=e,e=e.dispatch=mv.bind(null,me,e),[r.memoizedState,e]},useRef:function(e){var t=ht();return e={current:e},t.memoizedState=e},useState:function(e){e=ko(e);var t=e.queue,i=Ad.bind(null,me,t);return t.dispatch=i,[e.memoizedState,i]},useDebugValue:_o,useDeferredValue:function(e,t){var i=ht();return jo(i,e,t)},useTransition:function(){var e=ko(!1);return e=xd.bind(null,me,e.queue,!0,!1),ht().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,i){var r=me,c=ht();if(ke){if(i===void 0)throw Error(l(407));i=i()}else{if(i=t(),qe===null)throw Error(l(349));(Se&127)!==0||Ff(r,t,i)}c.memoizedState=i;var u={value:i,getSnapshot:t};return c.queue=u,dd(If.bind(null,r,u,e),[e]),r.flags|=2048,Fi(9,{destroy:void 0},Wf.bind(null,r,u,i,t),null),i},useId:function(){var e=ht(),t=qe.identifierPrefix;if(ke){var i=nn,r=tn;i=(r&~(1<<32-Et(r)-1)).toString(32)+i,t="_"+t+"R_"+i,i=or++,0<i&&(t+="H"+i.toString(32)),t+="_"}else i=ov++,t="_"+t+"r_"+i.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Oo,useFormState:ld,useActionState:ld,useOptimistic:function(e){var t=ht();t.memoizedState=t.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=i,t=Ro.bind(null,me,!0,i),i.dispatch=t,[e,t]},useMemoCache:xo,useCacheRefresh:function(){return ht().memoizedState=pv.bind(null,me)},useEffectEvent:function(e){var t=ht(),i={impl:e};return t.memoizedState=i,function(){if((Ne&2)!==0)throw Error(l(440));return i.impl.apply(void 0,arguments)}}},Mo={readContext:lt,use:ur,useCallback:vd,useContext:lt,useEffect:Ao,useImperativeHandle:gd,useInsertionEffect:pd,useLayoutEffect:md,useMemo:bd,useReducer:fr,useRef:fd,useState:function(){return fr(vn)},useDebugValue:_o,useDeferredValue:function(e,t){var i=Ke();return wd(i,ze.memoizedState,e,t)},useTransition:function(){var e=fr(vn)[0],t=Ke().memoizedState;return[typeof e=="boolean"?e:Ks(e),t]},useSyncExternalStore:Jf,useId:kd,useHostTransitionStatus:Oo,useFormState:od,useActionState:od,useOptimistic:function(e,t){var i=Ke();return td(i,ze,e,t)},useMemoCache:xo,useCacheRefresh:Td};Mo.useEffectEvent=hd;var Od={readContext:lt,use:ur,useCallback:vd,useContext:lt,useEffect:Ao,useImperativeHandle:gd,useInsertionEffect:pd,useLayoutEffect:md,useMemo:bd,useReducer:Eo,useRef:fd,useState:function(){return Eo(vn)},useDebugValue:_o,useDeferredValue:function(e,t){var i=Ke();return ze===null?jo(i,e,t):wd(i,ze.memoizedState,e,t)},useTransition:function(){var e=Eo(vn)[0],t=Ke().memoizedState;return[typeof e=="boolean"?e:Ks(e),t]},useSyncExternalStore:Jf,useId:kd,useHostTransitionStatus:Oo,useFormState:ud,useActionState:ud,useOptimistic:function(e,t){var i=Ke();return ze!==null?td(i,ze,e,t):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:xo,useCacheRefresh:Td};Od.useEffectEvent=hd;function Co(e,t,i,r){t=e.memoizedState,i=i(r,t),i=i==null?t:b({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var zo={enqueueSetState:function(e,t,i){e=e._reactInternals;var r=Ot(),c=Dn(r);c.payload=t,i!=null&&(c.callback=i),t=Bn(e,c,r),t!==null&&(xt(t,e,r),Ys(t,e,r))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var r=Ot(),c=Dn(r);c.tag=1,c.payload=t,i!=null&&(c.callback=i),t=Bn(e,c,r),t!==null&&(xt(t,e,r),Ys(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=Ot(),r=Dn(i);r.tag=2,t!=null&&(r.callback=t),t=Bn(e,r,i),t!==null&&(xt(t,e,i),Ys(t,e,i))}};function Rd(e,t,i,r,c,u,h){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,u,h):t.prototype&&t.prototype.isPureReactComponent?!zs(i,r)||!zs(c,u):!0}function Md(e,t,i,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(i,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(i,r),t.state!==e&&zo.enqueueReplaceState(t,t.state,null)}function bi(e,t){var i=t;if("ref"in t){i={};for(var r in t)r!=="ref"&&(i[r]=t[r])}if(e=e.defaultProps){i===t&&(i=b({},i));for(var c in e)i[c]===void 0&&(i[c]=e[c])}return i}function Cd(e){Ka(e)}function zd(e){console.error(e)}function Ud(e){Ka(e)}function mr(e,t){try{var i=e.onUncaughtError;i(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function Dd(e,t,i){try{var r=e.onCaughtError;r(i.value,{componentStack:i.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function Uo(e,t,i){return i=Dn(i),i.tag=3,i.payload={element:null},i.callback=function(){mr(e,t)},i}function Bd(e){return e=Dn(e),e.tag=3,e}function qd(e,t,i,r){var c=i.type.getDerivedStateFromError;if(typeof c=="function"){var u=r.value;e.payload=function(){return c(u)},e.callback=function(){Dd(t,i,r)}}var h=i.stateNode;h!==null&&typeof h.componentDidCatch=="function"&&(e.callback=function(){Dd(t,i,r),typeof c!="function"&&(Gn===null?Gn=new Set([this]):Gn.add(this));var m=r.stack;this.componentDidCatch(r.value,{componentStack:m!==null?m:""})})}function yv(e,t,i,r,c){if(i.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=i.alternate,t!==null&&Yi(t,i,c,!0),i=At.current,i!==null){switch(i.tag){case 31:case 13:return Lt===null?_r():i.alternate===null&&Ve===0&&(Ve=3),i.flags&=-257,i.flags|=65536,i.lanes=c,r===nr?i.flags|=16384:(t=i.updateQueue,t===null?i.updateQueue=new Set([r]):t.add(r),rc(e,r,c)),!1;case 22:return i.flags|=65536,r===nr?i.flags|=16384:(t=i.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},i.updateQueue=t):(i=t.retryQueue,i===null?t.retryQueue=new Set([r]):i.add(r)),rc(e,r,c)),!1}throw Error(l(435,i.tag))}return rc(e,r,c),_r(),!1}if(ke)return t=At.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,r!==Pl&&(e=Error(l(422),{cause:r}),Bs(Dt(e,i)))):(r!==Pl&&(t=Error(l(423),{cause:r}),Bs(Dt(t,i))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,r=Dt(r,i),c=Uo(e.stateNode,r,c),uo(e,c),Ve!==4&&(Ve=2)),!1;var u=Error(l(520),{cause:r});if(u=Dt(u,i),na===null?na=[u]:na.push(u),Ve!==4&&(Ve=2),t===null)return!0;r=Dt(r,i),i=t;do{switch(i.tag){case 3:return i.flags|=65536,e=c&-c,i.lanes|=e,e=Uo(i.stateNode,r,e),uo(i,e),!1;case 1:if(t=i.type,u=i.stateNode,(i.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||u!==null&&typeof u.componentDidCatch=="function"&&(Gn===null||!Gn.has(u))))return i.flags|=65536,c&=-c,i.lanes|=c,c=Bd(c),qd(c,e,i,r),uo(i,c),!1}i=i.return}while(i!==null);return!1}var Do=Error(l(461)),Fe=!1;function ot(e,t,i,r){t.child=e===null?Yf(t,null,i,r):gi(t,e.child,i,r)}function $d(e,t,i,r,c){i=i.render;var u=t.ref;if("ref"in r){var h={};for(var m in r)m!=="ref"&&(h[m]=r[m])}else h=r;return hi(t),r=go(e,t,i,h,u,c),m=vo(),e!==null&&!Fe?(bo(e,t,c),bn(e,t,c)):(ke&&m&&Wl(t),t.flags|=1,ot(e,t,r,c),t.child)}function Ld(e,t,i,r,c){if(e===null){var u=i.type;return typeof u=="function"&&!Zl(u)&&u.defaultProps===void 0&&i.compare===null?(t.tag=15,t.type=u,Hd(e,t,u,r,c)):(e=Fa(i.type,null,r,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(u=e.child,!Vo(e,c)){var h=u.memoizedProps;if(i=i.compare,i=i!==null?i:zs,i(h,r)&&e.ref===t.ref)return bn(e,t,c)}return t.flags|=1,e=hn(u,r),e.ref=t.ref,e.return=t,t.child=e}function Hd(e,t,i,r,c){if(e!==null){var u=e.memoizedProps;if(zs(u,r)&&e.ref===t.ref)if(Fe=!1,t.pendingProps=r=u,Vo(e,c))(e.flags&131072)!==0&&(Fe=!0);else return t.lanes=e.lanes,bn(e,t,c)}return Bo(e,t,i,r,c)}function Yd(e,t,i,r){var c=r.children,u=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode==="hidden"){if((t.flags&128)!==0){if(u=u!==null?u.baseLanes|i:i,e!==null){for(r=t.child=e.child,c=0;r!==null;)c=c|r.lanes|r.childLanes,r=r.sibling;r=c&~u}else r=0,t.child=null;return Gd(e,t,u,i,r)}if((i&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&er(t,u!==null?u.cachePool:null),u!==null?Xf(t,u):ho(),Kf(t);else return r=t.lanes=536870912,Gd(e,t,u!==null?u.baseLanes|i:i,i,r)}else u!==null?(er(t,u.cachePool),Xf(t,u),$n(),t.memoizedState=null):(e!==null&&er(t,null),ho(),$n());return ot(e,t,c,i),t.child}function Js(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Gd(e,t,i,r,c){var u=ro();return u=u===null?null:{parent:Ze._currentValue,pool:u},t.memoizedState={baseLanes:i,cachePool:u},e!==null&&er(t,null),ho(),Kf(t),e!==null&&Yi(e,t,r,!0),t.childLanes=c,null}function yr(e,t){return t=vr({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Vd(e,t,i){return gi(t,e.child,null,i),e=yr(t,t.pendingProps),e.flags|=2,_t(t),t.memoizedState=null,e}function gv(e,t,i){var r=t.pendingProps,c=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(ke){if(r.mode==="hidden")return e=yr(t,r),t.lanes=536870912,Js(null,e);if(mo(t),(e=Le)?(e=np(e,$t),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Rn!==null?{id:tn,overflow:nn}:null,retryLane:536870912,hydrationErrors:null},i=_f(e),i.return=t,t.child=i,rt=t,Le=null)):e=null,e===null)throw Cn(t);return t.lanes=536870912,null}return yr(t,r)}var u=e.memoizedState;if(u!==null){var h=u.dehydrated;if(mo(t),c)if(t.flags&256)t.flags&=-257,t=Vd(e,t,i);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(l(558));else if(Fe||Yi(e,t,i,!1),c=(i&e.childLanes)!==0,Fe||c){if(r=qe,r!==null&&(h=Cu(r,i),h!==0&&h!==u.retryLane))throw u.retryLane=h,ci(e,h),xt(r,e,h),Do;_r(),t=Vd(e,t,i)}else e=u.treeContext,Le=Ht(h.nextSibling),rt=t,ke=!0,Mn=null,$t=!1,e!==null&&Of(t,e),t=yr(t,r),t.flags|=4096;return t}return e=hn(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function gr(e,t){var i=t.ref;if(i===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(l(284));(e===null||e.ref!==i)&&(t.flags|=4194816)}}function Bo(e,t,i,r,c){return hi(t),i=go(e,t,i,r,void 0,c),r=vo(),e!==null&&!Fe?(bo(e,t,c),bn(e,t,c)):(ke&&r&&Wl(t),t.flags|=1,ot(e,t,i,c),t.child)}function Xd(e,t,i,r,c,u){return hi(t),t.updateQueue=null,i=Zf(t,r,i,c),Qf(e),r=vo(),e!==null&&!Fe?(bo(e,t,u),bn(e,t,u)):(ke&&r&&Wl(t),t.flags|=1,ot(e,t,i,u),t.child)}function Kd(e,t,i,r,c){if(hi(t),t.stateNode===null){var u=qi,h=i.contextType;typeof h=="object"&&h!==null&&(u=lt(h)),u=new i(r,u),t.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=zo,t.stateNode=u,u._reactInternals=t,u=t.stateNode,u.props=r,u.state=t.memoizedState,u.refs={},oo(t),h=i.contextType,u.context=typeof h=="object"&&h!==null?lt(h):qi,u.state=t.memoizedState,h=i.getDerivedStateFromProps,typeof h=="function"&&(Co(t,i,h,r),u.state=t.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof u.getSnapshotBeforeUpdate=="function"||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(h=u.state,typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount(),h!==u.state&&zo.enqueueReplaceState(u,u.state,null),Vs(t,r,u,c),Gs(),u.state=t.memoizedState),typeof u.componentDidMount=="function"&&(t.flags|=4194308),r=!0}else if(e===null){u=t.stateNode;var m=t.memoizedProps,w=bi(i,m);u.props=w;var O=u.context,U=i.contextType;h=qi,typeof U=="object"&&U!==null&&(h=lt(U));var L=i.getDerivedStateFromProps;U=typeof L=="function"||typeof u.getSnapshotBeforeUpdate=="function",m=t.pendingProps!==m,U||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(m||O!==h)&&Md(t,u,r,h),Un=!1;var R=t.memoizedState;u.state=R,Vs(t,r,u,c),Gs(),O=t.memoizedState,m||R!==O||Un?(typeof L=="function"&&(Co(t,i,L,r),O=t.memoizedState),(w=Un||Rd(t,i,w,r,R,O,h))?(U||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=r,t.memoizedState=O),u.props=r,u.state=O,u.context=h,r=w):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{u=t.stateNode,co(e,t),h=t.memoizedProps,U=bi(i,h),u.props=U,L=t.pendingProps,R=u.context,O=i.contextType,w=qi,typeof O=="object"&&O!==null&&(w=lt(O)),m=i.getDerivedStateFromProps,(O=typeof m=="function"||typeof u.getSnapshotBeforeUpdate=="function")||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(h!==L||R!==w)&&Md(t,u,r,w),Un=!1,R=t.memoizedState,u.state=R,Vs(t,r,u,c),Gs();var C=t.memoizedState;h!==L||R!==C||Un||e!==null&&e.dependencies!==null&&Ia(e.dependencies)?(typeof m=="function"&&(Co(t,i,m,r),C=t.memoizedState),(U=Un||Rd(t,i,U,r,R,C,w)||e!==null&&e.dependencies!==null&&Ia(e.dependencies))?(O||typeof u.UNSAFE_componentWillUpdate!="function"&&typeof u.componentWillUpdate!="function"||(typeof u.componentWillUpdate=="function"&&u.componentWillUpdate(r,C,w),typeof u.UNSAFE_componentWillUpdate=="function"&&u.UNSAFE_componentWillUpdate(r,C,w)),typeof u.componentDidUpdate=="function"&&(t.flags|=4),typeof u.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof u.componentDidUpdate!="function"||h===e.memoizedProps&&R===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||h===e.memoizedProps&&R===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=C),u.props=r,u.state=C,u.context=w,r=U):(typeof u.componentDidUpdate!="function"||h===e.memoizedProps&&R===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||h===e.memoizedProps&&R===e.memoizedState||(t.flags|=1024),r=!1)}return u=r,gr(e,t),r=(t.flags&128)!==0,u||r?(u=t.stateNode,i=r&&typeof i.getDerivedStateFromError!="function"?null:u.render(),t.flags|=1,e!==null&&r?(t.child=gi(t,e.child,null,c),t.child=gi(t,null,i,c)):ot(e,t,i,c),t.memoizedState=u.state,e=t.child):e=bn(e,t,c),e}function Qd(e,t,i,r){return fi(),t.flags|=256,ot(e,t,i,r),t.child}var qo={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function $o(e){return{baseLanes:e,cachePool:Df()}}function Lo(e,t,i){return e=e!==null?e.childLanes&~i:0,t&&(e|=Nt),e}function Zd(e,t,i){var r=t.pendingProps,c=!1,u=(t.flags&128)!==0,h;if((h=u)||(h=e!==null&&e.memoizedState===null?!1:(Xe.current&2)!==0),h&&(c=!0,t.flags&=-129),h=(t.flags&32)!==0,t.flags&=-33,e===null){if(ke){if(c?qn(t):$n(),(e=Le)?(e=np(e,$t),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Rn!==null?{id:tn,overflow:nn}:null,retryLane:536870912,hydrationErrors:null},i=_f(e),i.return=t,t.child=i,rt=t,Le=null)):e=null,e===null)throw Cn(t);return Sc(e)?t.lanes=32:t.lanes=536870912,null}var m=r.children;return r=r.fallback,c?($n(),c=t.mode,m=vr({mode:"hidden",children:m},c),r=ui(r,c,i,null),m.return=t,r.return=t,m.sibling=r,t.child=m,r=t.child,r.memoizedState=$o(i),r.childLanes=Lo(e,h,i),t.memoizedState=qo,Js(null,r)):(qn(t),Ho(t,m))}var w=e.memoizedState;if(w!==null&&(m=w.dehydrated,m!==null)){if(u)t.flags&256?(qn(t),t.flags&=-257,t=Yo(e,t,i)):t.memoizedState!==null?($n(),t.child=e.child,t.flags|=128,t=null):($n(),m=r.fallback,c=t.mode,r=vr({mode:"visible",children:r.children},c),m=ui(m,c,i,null),m.flags|=2,r.return=t,m.return=t,r.sibling=m,t.child=r,gi(t,e.child,null,i),r=t.child,r.memoizedState=$o(i),r.childLanes=Lo(e,h,i),t.memoizedState=qo,t=Js(null,r));else if(qn(t),Sc(m)){if(h=m.nextSibling&&m.nextSibling.dataset,h)var O=h.dgst;h=O,r=Error(l(419)),r.stack="",r.digest=h,Bs({value:r,source:null,stack:null}),t=Yo(e,t,i)}else if(Fe||Yi(e,t,i,!1),h=(i&e.childLanes)!==0,Fe||h){if(h=qe,h!==null&&(r=Cu(h,i),r!==0&&r!==w.retryLane))throw w.retryLane=r,ci(e,r),xt(h,e,r),Do;xc(m)||_r(),t=Yo(e,t,i)}else xc(m)?(t.flags|=192,t.child=e.child,t=null):(e=w.treeContext,Le=Ht(m.nextSibling),rt=t,ke=!0,Mn=null,$t=!1,e!==null&&Of(t,e),t=Ho(t,r.children),t.flags|=4096);return t}return c?($n(),m=r.fallback,c=t.mode,w=e.child,O=w.sibling,r=hn(w,{mode:"hidden",children:r.children}),r.subtreeFlags=w.subtreeFlags&65011712,O!==null?m=hn(O,m):(m=ui(m,c,i,null),m.flags|=2),m.return=t,r.return=t,r.sibling=m,t.child=r,Js(null,r),r=t.child,m=e.child.memoizedState,m===null?m=$o(i):(c=m.cachePool,c!==null?(w=Ze._currentValue,c=c.parent!==w?{parent:w,pool:w}:c):c=Df(),m={baseLanes:m.baseLanes|i,cachePool:c}),r.memoizedState=m,r.childLanes=Lo(e,h,i),t.memoizedState=qo,Js(e.child,r)):(qn(t),i=e.child,e=i.sibling,i=hn(i,{mode:"visible",children:r.children}),i.return=t,i.sibling=null,e!==null&&(h=t.deletions,h===null?(t.deletions=[e],t.flags|=16):h.push(e)),t.child=i,t.memoizedState=null,i)}function Ho(e,t){return t=vr({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function vr(e,t){return e=Tt(22,e,null,t),e.lanes=0,e}function Yo(e,t,i){return gi(t,e.child,null,i),e=Ho(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Jd(e,t,i){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),no(e.return,t,i)}function Go(e,t,i,r,c,u){var h=e.memoizedState;h===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:i,tailMode:c,treeForkCount:u}:(h.isBackwards=t,h.rendering=null,h.renderingStartTime=0,h.last=r,h.tail=i,h.tailMode=c,h.treeForkCount=u)}function Fd(e,t,i){var r=t.pendingProps,c=r.revealOrder,u=r.tail;r=r.children;var h=Xe.current,m=(h&2)!==0;if(m?(h=h&1|2,t.flags|=128):h&=1,Q(Xe,h),ot(e,t,r,i),r=ke?Ds:0,!m&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Jd(e,i,t);else if(e.tag===19)Jd(e,i,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(c){case"forwards":for(i=t.child,c=null;i!==null;)e=i.alternate,e!==null&&rr(e)===null&&(c=i),i=i.sibling;i=c,i===null?(c=t.child,t.child=null):(c=i.sibling,i.sibling=null),Go(t,!1,c,i,u,r);break;case"backwards":case"unstable_legacy-backwards":for(i=null,c=t.child,t.child=null;c!==null;){if(e=c.alternate,e!==null&&rr(e)===null){t.child=c;break}e=c.sibling,c.sibling=i,i=c,c=e}Go(t,!0,i,null,u,r);break;case"together":Go(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function bn(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),Yn|=t.lanes,(i&t.childLanes)===0)if(e!==null){if(Yi(e,t,i,!1),(i&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(l(153));if(t.child!==null){for(e=t.child,i=hn(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=hn(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function Vo(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Ia(e)))}function vv(e,t,i){switch(t.tag){case 3:it(t,t.stateNode.containerInfo),zn(t,Ze,e.memoizedState.cache),fi();break;case 27:case 5:ni(t);break;case 4:it(t,t.stateNode.containerInfo);break;case 10:zn(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,mo(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?(qn(t),t.flags|=128,null):(i&t.child.childLanes)!==0?Zd(e,t,i):(qn(t),e=bn(e,t,i),e!==null?e.sibling:null);qn(t);break;case 19:var c=(e.flags&128)!==0;if(r=(i&t.childLanes)!==0,r||(Yi(e,t,i,!1),r=(i&t.childLanes)!==0),c){if(r)return Fd(e,t,i);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),Q(Xe,Xe.current),r)break;return null;case 22:return t.lanes=0,Yd(e,t,i,t.pendingProps);case 24:zn(t,Ze,e.memoizedState.cache)}return bn(e,t,i)}function Wd(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps)Fe=!0;else{if(!Vo(e,i)&&(t.flags&128)===0)return Fe=!1,vv(e,t,i);Fe=(e.flags&131072)!==0}else Fe=!1,ke&&(t.flags&1048576)!==0&&Nf(t,Ds,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=mi(t.elementType),t.type=e,typeof e=="function")Zl(e)?(r=bi(e,r),t.tag=1,t=Kd(null,t,e,r,i)):(t.tag=0,t=Bo(null,t,e,r,i));else{if(e!=null){var c=e.$$typeof;if(c===S){t.tag=11,t=$d(null,t,e,r,i);break e}else if(c===z){t.tag=14,t=Ld(null,t,e,r,i);break e}}throw t=Ce(e)||e,Error(l(306,t,""))}}return t;case 0:return Bo(e,t,t.type,t.pendingProps,i);case 1:return r=t.type,c=bi(r,t.pendingProps),Kd(e,t,r,c,i);case 3:e:{if(it(t,t.stateNode.containerInfo),e===null)throw Error(l(387));r=t.pendingProps;var u=t.memoizedState;c=u.element,co(e,t),Vs(t,r,null,i);var h=t.memoizedState;if(r=h.cache,zn(t,Ze,r),r!==u.cache&&io(t,[Ze],i,!0),Gs(),r=h.element,u.isDehydrated)if(u={element:r,isDehydrated:!1,cache:h.cache},t.updateQueue.baseState=u,t.memoizedState=u,t.flags&256){t=Qd(e,t,r,i);break e}else if(r!==c){c=Dt(Error(l(424)),t),Bs(c),t=Qd(e,t,r,i);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,Le=Ht(e.firstChild),rt=t,ke=!0,Mn=null,$t=!0,i=Yf(t,null,r,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(fi(),r===c){t=bn(e,t,i);break e}ot(e,t,r,i)}t=t.child}return t;case 26:return gr(e,t),e===null?(i=op(t.type,null,t.pendingProps,null))?t.memoizedState=i:ke||(i=t.type,e=t.pendingProps,r=zr(pe.current).createElement(i),r[at]=t,r[mt]=e,ct(r,i,e),tt(r),t.stateNode=r):t.memoizedState=op(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ni(t),e===null&&ke&&(r=t.stateNode=ap(t.type,t.pendingProps,pe.current),rt=t,$t=!0,c=Le,Qn(t.type)?(Ec=c,Le=Ht(r.firstChild)):Le=c),ot(e,t,t.pendingProps.children,i),gr(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ke&&((c=r=Le)&&(r=Zv(r,t.type,t.pendingProps,$t),r!==null?(t.stateNode=r,rt=t,Le=Ht(r.firstChild),$t=!1,c=!0):c=!1),c||Cn(t)),ni(t),c=t.type,u=t.pendingProps,h=e!==null?e.memoizedProps:null,r=u.children,vc(c,u)?r=null:h!==null&&vc(c,h)&&(t.flags|=32),t.memoizedState!==null&&(c=go(e,t,cv,null,null,i),ua._currentValue=c),gr(e,t),ot(e,t,r,i),t.child;case 6:return e===null&&ke&&((e=i=Le)&&(i=Jv(i,t.pendingProps,$t),i!==null?(t.stateNode=i,rt=t,Le=null,e=!0):e=!1),e||Cn(t)),null;case 13:return Zd(e,t,i);case 4:return it(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=gi(t,null,r,i):ot(e,t,r,i),t.child;case 11:return $d(e,t,t.type,t.pendingProps,i);case 7:return ot(e,t,t.pendingProps,i),t.child;case 8:return ot(e,t,t.pendingProps.children,i),t.child;case 12:return ot(e,t,t.pendingProps.children,i),t.child;case 10:return r=t.pendingProps,zn(t,t.type,r.value),ot(e,t,r.children,i),t.child;case 9:return c=t.type._context,r=t.pendingProps.children,hi(t),c=lt(c),r=r(c),t.flags|=1,ot(e,t,r,i),t.child;case 14:return Ld(e,t,t.type,t.pendingProps,i);case 15:return Hd(e,t,t.type,t.pendingProps,i);case 19:return Fd(e,t,i);case 31:return gv(e,t,i);case 22:return Yd(e,t,i,t.pendingProps);case 24:return hi(t),r=lt(Ze),e===null?(c=ro(),c===null&&(c=qe,u=so(),c.pooledCache=u,u.refCount++,u!==null&&(c.pooledCacheLanes|=i),c=u),t.memoizedState={parent:r,cache:c},oo(t),zn(t,Ze,c)):((e.lanes&i)!==0&&(co(e,t),Vs(t,null,null,i),Gs()),c=e.memoizedState,u=t.memoizedState,c.parent!==r?(c={parent:r,cache:r},t.memoizedState=c,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=c),zn(t,Ze,r)):(r=u.cache,zn(t,Ze,r),r!==c.cache&&io(t,[Ze],i,!0))),ot(e,t,t.pendingProps.children,i),t.child;case 29:throw t.pendingProps}throw Error(l(156,t.tag))}function wn(e){e.flags|=4}function Xo(e,t,i,r,c){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(c&335544128)===c)if(e.stateNode.complete)e.flags|=8192;else if(kh())e.flags|=8192;else throw yi=nr,lo}else e.flags&=-16777217}function Id(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!hp(t))if(kh())e.flags|=8192;else throw yi=nr,lo}function br(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Ou():536870912,e.lanes|=t,es|=t)}function Fs(e,t){if(!ke)switch(e.tailMode){case"hidden":t=e.tail;for(var i=null;t!==null;)t.alternate!==null&&(i=t),t=t.sibling;i===null?e.tail=null:i.sibling=null;break;case"collapsed":i=e.tail;for(var r=null;i!==null;)i.alternate!==null&&(r=i),i=i.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function He(e){var t=e.alternate!==null&&e.alternate.child===e.child,i=0,r=0;if(t)for(var c=e.child;c!==null;)i|=c.lanes|c.childLanes,r|=c.subtreeFlags&65011712,r|=c.flags&65011712,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)i|=c.lanes|c.childLanes,r|=c.subtreeFlags,r|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=r,e.childLanes=i,t}function bv(e,t,i){var r=t.pendingProps;switch(Il(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return He(t),null;case 1:return He(t),null;case 3:return i=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),yn(Ze),Be(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Hi(t)?wn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,eo())),He(t),null;case 26:var c=t.type,u=t.memoizedState;return e===null?(wn(t),u!==null?(He(t),Id(t,u)):(He(t),Xo(t,c,null,r,i))):u?u!==e.memoizedState?(wn(t),He(t),Id(t,u)):(He(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&wn(t),He(t),Xo(t,c,e,r,i)),null;case 27:if(en(t),i=pe.current,c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&wn(t);else{if(!r){if(t.stateNode===null)throw Error(l(166));return He(t),null}e=ee.current,Hi(t)?Rf(t):(e=ap(c,r,i),t.stateNode=e,wn(t))}return He(t),null;case 5:if(en(t),c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&wn(t);else{if(!r){if(t.stateNode===null)throw Error(l(166));return He(t),null}if(u=ee.current,Hi(t))Rf(t);else{var h=zr(pe.current);switch(u){case 1:u=h.createElementNS("http://www.w3.org/2000/svg",c);break;case 2:u=h.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;default:switch(c){case"svg":u=h.createElementNS("http://www.w3.org/2000/svg",c);break;case"math":u=h.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;case"script":u=h.createElement("div"),u.innerHTML="<script><\/script>",u=u.removeChild(u.firstChild);break;case"select":u=typeof r.is=="string"?h.createElement("select",{is:r.is}):h.createElement("select"),r.multiple?u.multiple=!0:r.size&&(u.size=r.size);break;default:u=typeof r.is=="string"?h.createElement(c,{is:r.is}):h.createElement(c)}}u[at]=t,u[mt]=r;e:for(h=t.child;h!==null;){if(h.tag===5||h.tag===6)u.appendChild(h.stateNode);else if(h.tag!==4&&h.tag!==27&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===t)break e;for(;h.sibling===null;){if(h.return===null||h.return===t)break e;h=h.return}h.sibling.return=h.return,h=h.sibling}t.stateNode=u;e:switch(ct(u,c,r),c){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&wn(t)}}return He(t),Xo(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,i),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&wn(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(l(166));if(e=pe.current,Hi(t)){if(e=t.stateNode,i=t.memoizedProps,r=null,c=rt,c!==null)switch(c.tag){case 27:case 5:r=c.memoizedProps}e[at]=t,e=!!(e.nodeValue===i||r!==null&&r.suppressHydrationWarning===!0||Zh(e.nodeValue,i)),e||Cn(t,!0)}else e=zr(e).createTextNode(r),e[at]=t,t.stateNode=e}return He(t),null;case 31:if(i=t.memoizedState,e===null||e.memoizedState!==null){if(r=Hi(t),i!==null){if(e===null){if(!r)throw Error(l(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(557));e[at]=t}else fi(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;He(t),e=!1}else i=eo(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return t.flags&256?(_t(t),t):(_t(t),null);if((t.flags&128)!==0)throw Error(l(558))}return He(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=Hi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!c)throw Error(l(318));if(c=t.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(l(317));c[at]=t}else fi(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;He(t),c=!1}else c=eo(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return t.flags&256?(_t(t),t):(_t(t),null)}return _t(t),(t.flags&128)!==0?(t.lanes=i,t):(i=r!==null,e=e!==null&&e.memoizedState!==null,i&&(r=t.child,c=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(c=r.alternate.memoizedState.cachePool.pool),u=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(u=r.memoizedState.cachePool.pool),u!==c&&(r.flags|=2048)),i!==e&&i&&(t.child.flags|=8192),br(t,t.updateQueue),He(t),null);case 4:return Be(),e===null&&hc(t.stateNode.containerInfo),He(t),null;case 10:return yn(t.type),He(t),null;case 19:if(D(Xe),r=t.memoizedState,r===null)return He(t),null;if(c=(t.flags&128)!==0,u=r.rendering,u===null)if(c)Fs(r,!1);else{if(Ve!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(u=rr(e),u!==null){for(t.flags|=128,Fs(r,!1),e=u.updateQueue,t.updateQueue=e,br(t,e),t.subtreeFlags=0,e=i,i=t.child;i!==null;)Af(i,e),i=i.sibling;return Q(Xe,Xe.current&1|2),ke&&pn(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Qe()>kr&&(t.flags|=128,c=!0,Fs(r,!1),t.lanes=4194304)}else{if(!c)if(e=rr(u),e!==null){if(t.flags|=128,c=!0,e=e.updateQueue,t.updateQueue=e,br(t,e),Fs(r,!0),r.tail===null&&r.tailMode==="hidden"&&!u.alternate&&!ke)return He(t),null}else 2*Qe()-r.renderingStartTime>kr&&i!==536870912&&(t.flags|=128,c=!0,Fs(r,!1),t.lanes=4194304);r.isBackwards?(u.sibling=t.child,t.child=u):(e=r.last,e!==null?e.sibling=u:t.child=u,r.last=u)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Qe(),e.sibling=null,i=Xe.current,Q(Xe,c?i&1|2:i&1),ke&&pn(t,r.treeForkCount),e):(He(t),null);case 22:case 23:return _t(t),po(),r=t.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?(i&536870912)!==0&&(t.flags&128)===0&&(He(t),t.subtreeFlags&6&&(t.flags|=8192)):He(t),i=t.updateQueue,i!==null&&br(t,i.retryQueue),i=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==i&&(t.flags|=2048),e!==null&&D(pi),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),yn(Ze),He(t),null;case 25:return null;case 30:return null}throw Error(l(156,t.tag))}function wv(e,t){switch(Il(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return yn(Ze),Be(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return en(t),null;case 31:if(t.memoizedState!==null){if(_t(t),t.alternate===null)throw Error(l(340));fi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(_t(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(l(340));fi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return D(Xe),null;case 4:return Be(),null;case 10:return yn(t.type),null;case 22:case 23:return _t(t),po(),e!==null&&D(pi),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return yn(Ze),null;case 25:return null;default:return null}}function Pd(e,t){switch(Il(t),t.tag){case 3:yn(Ze),Be();break;case 26:case 27:case 5:en(t);break;case 4:Be();break;case 31:t.memoizedState!==null&&_t(t);break;case 13:_t(t);break;case 19:D(Xe);break;case 10:yn(t.type);break;case 22:case 23:_t(t),po(),e!==null&&D(pi);break;case 24:yn(Ze)}}function Ws(e,t){try{var i=t.updateQueue,r=i!==null?i.lastEffect:null;if(r!==null){var c=r.next;i=c;do{if((i.tag&e)===e){r=void 0;var u=i.create,h=i.inst;r=u(),h.destroy=r}i=i.next}while(i!==c)}}catch(m){Me(t,t.return,m)}}function Ln(e,t,i){try{var r=t.updateQueue,c=r!==null?r.lastEffect:null;if(c!==null){var u=c.next;r=u;do{if((r.tag&e)===e){var h=r.inst,m=h.destroy;if(m!==void 0){h.destroy=void 0,c=t;var w=i,O=m;try{O()}catch(U){Me(c,w,U)}}}r=r.next}while(r!==u)}}catch(U){Me(t,t.return,U)}}function eh(e){var t=e.updateQueue;if(t!==null){var i=e.stateNode;try{Vf(t,i)}catch(r){Me(e,e.return,r)}}}function th(e,t,i){i.props=bi(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(r){Me(e,t,r)}}function Is(e,t){try{var i=e.ref;if(i!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof i=="function"?e.refCleanup=i(r):i.current=r}}catch(c){Me(e,t,c)}}function sn(e,t){var i=e.ref,r=e.refCleanup;if(i!==null)if(typeof r=="function")try{r()}catch(c){Me(e,t,c)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(c){Me(e,t,c)}else i.current=null}function nh(e){var t=e.type,i=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":i.autoFocus&&r.focus();break e;case"img":i.src?r.src=i.src:i.srcSet&&(r.srcset=i.srcSet)}}catch(c){Me(e,e.return,c)}}function Ko(e,t,i){try{var r=e.stateNode;Yv(r,e.type,i,t),r[mt]=t}catch(c){Me(e,e.return,c)}}function ih(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Qn(e.type)||e.tag===4}function Qo(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ih(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&&Qn(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 Zo(e,t,i){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(e,t):(t=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,t.appendChild(e),i=i._reactRootContainer,i!=null||t.onclick!==null||(t.onclick=fn));else if(r!==4&&(r===27&&Qn(e.type)&&(i=e.stateNode,t=null),e=e.child,e!==null))for(Zo(e,t,i),e=e.sibling;e!==null;)Zo(e,t,i),e=e.sibling}function wr(e,t,i){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?i.insertBefore(e,t):i.appendChild(e);else if(r!==4&&(r===27&&Qn(e.type)&&(i=e.stateNode),e=e.child,e!==null))for(wr(e,t,i),e=e.sibling;e!==null;)wr(e,t,i),e=e.sibling}function sh(e){var t=e.stateNode,i=e.memoizedProps;try{for(var r=e.type,c=t.attributes;c.length;)t.removeAttributeNode(c[0]);ct(t,r,i),t[at]=e,t[mt]=i}catch(u){Me(e,e.return,u)}}var xn=!1,We=!1,Jo=!1,ah=typeof WeakSet=="function"?WeakSet:Set,nt=null;function xv(e,t){if(e=e.containerInfo,yc=Hr,e=gf(e),Hl(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var r=i.getSelection&&i.getSelection();if(r&&r.rangeCount!==0){i=r.anchorNode;var c=r.anchorOffset,u=r.focusNode;r=r.focusOffset;try{i.nodeType,u.nodeType}catch{i=null;break e}var h=0,m=-1,w=-1,O=0,U=0,L=e,R=null;t:for(;;){for(var C;L!==i||c!==0&&L.nodeType!==3||(m=h+c),L!==u||r!==0&&L.nodeType!==3||(w=h+r),L.nodeType===3&&(h+=L.nodeValue.length),(C=L.firstChild)!==null;)R=L,L=C;for(;;){if(L===e)break t;if(R===i&&++O===c&&(m=h),R===u&&++U===r&&(w=h),(C=L.nextSibling)!==null)break;L=R,R=L.parentNode}L=C}i=m===-1||w===-1?null:{start:m,end:w}}else i=null}i=i||{start:0,end:0}}else i=null;for(gc={focusedElem:e,selectionRange:i},Hr=!1,nt=t;nt!==null;)if(t=nt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,nt=e;else for(;nt!==null;){switch(t=nt,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(i=0;i<e.length;i++)c=e[i],c.ref.impl=c.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&u!==null){e=void 0,i=t,c=u.memoizedProps,u=u.memoizedState,r=i.stateNode;try{var ne=bi(i.type,c);e=r.getSnapshotBeforeUpdate(ne,u),r.__reactInternalSnapshotBeforeUpdate=e}catch(ue){Me(i,i.return,ue)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,i=e.nodeType,i===9)wc(e);else if(i===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":wc(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(l(163))}if(e=t.sibling,e!==null){e.return=t.return,nt=e;break}nt=t.return}}function rh(e,t,i){var r=i.flags;switch(i.tag){case 0:case 11:case 15:En(e,i),r&4&&Ws(5,i);break;case 1:if(En(e,i),r&4)if(e=i.stateNode,t===null)try{e.componentDidMount()}catch(h){Me(i,i.return,h)}else{var c=bi(i.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(h){Me(i,i.return,h)}}r&64&&eh(i),r&512&&Is(i,i.return);break;case 3:if(En(e,i),r&64&&(e=i.updateQueue,e!==null)){if(t=null,i.child!==null)switch(i.child.tag){case 27:case 5:t=i.child.stateNode;break;case 1:t=i.child.stateNode}try{Vf(e,t)}catch(h){Me(i,i.return,h)}}break;case 27:t===null&&r&4&&sh(i);case 26:case 5:En(e,i),t===null&&r&4&&nh(i),r&512&&Is(i,i.return);break;case 12:En(e,i);break;case 31:En(e,i),r&4&&ch(e,i);break;case 13:En(e,i),r&4&&uh(e,i),r&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=Ov.bind(null,i),Fv(e,i))));break;case 22:if(r=i.memoizedState!==null||xn,!r){t=t!==null&&t.memoizedState!==null||We,c=xn;var u=We;xn=r,(We=t)&&!u?kn(e,i,(i.subtreeFlags&8772)!==0):En(e,i),xn=c,We=u}break;case 30:break;default:En(e,i)}}function lh(e){var t=e.alternate;t!==null&&(e.alternate=null,lh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&kl(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 Ye=null,gt=!1;function Sn(e,t,i){for(i=i.child;i!==null;)oh(e,t,i),i=i.sibling}function oh(e,t,i){if(St&&typeof St.onCommitFiberUnmount=="function")try{St.onCommitFiberUnmount(Ss,i)}catch{}switch(i.tag){case 26:We||sn(i,t),Sn(e,t,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:We||sn(i,t);var r=Ye,c=gt;Qn(i.type)&&(Ye=i.stateNode,gt=!1),Sn(e,t,i),la(i.stateNode),Ye=r,gt=c;break;case 5:We||sn(i,t);case 6:if(r=Ye,c=gt,Ye=null,Sn(e,t,i),Ye=r,gt=c,Ye!==null)if(gt)try{(Ye.nodeType===9?Ye.body:Ye.nodeName==="HTML"?Ye.ownerDocument.body:Ye).removeChild(i.stateNode)}catch(u){Me(i,t,u)}else try{Ye.removeChild(i.stateNode)}catch(u){Me(i,t,u)}break;case 18:Ye!==null&&(gt?(e=Ye,ep(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),os(e)):ep(Ye,i.stateNode));break;case 4:r=Ye,c=gt,Ye=i.stateNode.containerInfo,gt=!0,Sn(e,t,i),Ye=r,gt=c;break;case 0:case 11:case 14:case 15:Ln(2,i,t),We||Ln(4,i,t),Sn(e,t,i);break;case 1:We||(sn(i,t),r=i.stateNode,typeof r.componentWillUnmount=="function"&&th(i,t,r)),Sn(e,t,i);break;case 21:Sn(e,t,i);break;case 22:We=(r=We)||i.memoizedState!==null,Sn(e,t,i),We=r;break;default:Sn(e,t,i)}}function ch(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{os(e)}catch(i){Me(t,t.return,i)}}}function uh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{os(e)}catch(i){Me(t,t.return,i)}}function Sv(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new ah),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new ah),t;default:throw Error(l(435,e.tag))}}function xr(e,t){var i=Sv(e);t.forEach(function(r){if(!i.has(r)){i.add(r);var c=Rv.bind(null,e,r);r.then(c,c)}})}function vt(e,t){var i=t.deletions;if(i!==null)for(var r=0;r<i.length;r++){var c=i[r],u=e,h=t,m=h;e:for(;m!==null;){switch(m.tag){case 27:if(Qn(m.type)){Ye=m.stateNode,gt=!1;break e}break;case 5:Ye=m.stateNode,gt=!1;break e;case 3:case 4:Ye=m.stateNode.containerInfo,gt=!0;break e}m=m.return}if(Ye===null)throw Error(l(160));oh(u,h,c),Ye=null,gt=!1,u=c.alternate,u!==null&&(u.return=null),c.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)fh(t,e),t=t.sibling}var Xt=null;function fh(e,t){var i=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:vt(t,e),bt(e),r&4&&(Ln(3,e,e.return),Ws(3,e),Ln(5,e,e.return));break;case 1:vt(t,e),bt(e),r&512&&(We||i===null||sn(i,i.return)),r&64&&xn&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(i=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=i===null?r:i.concat(r))));break;case 26:var c=Xt;if(vt(t,e),bt(e),r&512&&(We||i===null||sn(i,i.return)),r&4){var u=i!==null?i.memoizedState:null;if(r=e.memoizedState,i===null)if(r===null)if(e.stateNode===null){e:{r=e.type,i=e.memoizedProps,c=c.ownerDocument||c;t:switch(r){case"title":u=c.getElementsByTagName("title")[0],(!u||u[Ts]||u[at]||u.namespaceURI==="http://www.w3.org/2000/svg"||u.hasAttribute("itemprop"))&&(u=c.createElement(r),c.head.insertBefore(u,c.querySelector("head > title"))),ct(u,r,i),u[at]=e,tt(u),r=u;break e;case"link":var h=fp("link","href",c).get(r+(i.href||""));if(h){for(var m=0;m<h.length;m++)if(u=h[m],u.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&u.getAttribute("rel")===(i.rel==null?null:i.rel)&&u.getAttribute("title")===(i.title==null?null:i.title)&&u.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){h.splice(m,1);break t}}u=c.createElement(r),ct(u,r,i),c.head.appendChild(u);break;case"meta":if(h=fp("meta","content",c).get(r+(i.content||""))){for(m=0;m<h.length;m++)if(u=h[m],u.getAttribute("content")===(i.content==null?null:""+i.content)&&u.getAttribute("name")===(i.name==null?null:i.name)&&u.getAttribute("property")===(i.property==null?null:i.property)&&u.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&u.getAttribute("charset")===(i.charSet==null?null:i.charSet)){h.splice(m,1);break t}}u=c.createElement(r),ct(u,r,i),c.head.appendChild(u);break;default:throw Error(l(468,r))}u[at]=e,tt(u),r=u}e.stateNode=r}else dp(c,e.type,e.stateNode);else e.stateNode=up(c,r,e.memoizedProps);else u!==r?(u===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):u.count--,r===null?dp(c,e.type,e.stateNode):up(c,r,e.memoizedProps)):r===null&&e.stateNode!==null&&Ko(e,e.memoizedProps,i.memoizedProps)}break;case 27:vt(t,e),bt(e),r&512&&(We||i===null||sn(i,i.return)),i!==null&&r&4&&Ko(e,e.memoizedProps,i.memoizedProps);break;case 5:if(vt(t,e),bt(e),r&512&&(We||i===null||sn(i,i.return)),e.flags&32){c=e.stateNode;try{Ri(c,"")}catch(ne){Me(e,e.return,ne)}}r&4&&e.stateNode!=null&&(c=e.memoizedProps,Ko(e,c,i!==null?i.memoizedProps:c)),r&1024&&(Jo=!0);break;case 6:if(vt(t,e),bt(e),r&4){if(e.stateNode===null)throw Error(l(162));r=e.memoizedProps,i=e.stateNode;try{i.nodeValue=r}catch(ne){Me(e,e.return,ne)}}break;case 3:if(Br=null,c=Xt,Xt=Ur(t.containerInfo),vt(t,e),Xt=c,bt(e),r&4&&i!==null&&i.memoizedState.isDehydrated)try{os(t.containerInfo)}catch(ne){Me(e,e.return,ne)}Jo&&(Jo=!1,dh(e));break;case 4:r=Xt,Xt=Ur(e.stateNode.containerInfo),vt(t,e),bt(e),Xt=r;break;case 12:vt(t,e),bt(e);break;case 31:vt(t,e),bt(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,xr(e,r)));break;case 13:vt(t,e),bt(e),e.child.flags&8192&&e.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(Er=Qe()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,xr(e,r)));break;case 22:c=e.memoizedState!==null;var w=i!==null&&i.memoizedState!==null,O=xn,U=We;if(xn=O||c,We=U||w,vt(t,e),We=U,xn=O,bt(e),r&8192)e:for(t=e.stateNode,t._visibility=c?t._visibility&-2:t._visibility|1,c&&(i===null||w||xn||We||wi(e)),i=null,t=e;;){if(t.tag===5||t.tag===26){if(i===null){w=i=t;try{if(u=w.stateNode,c)h=u.style,typeof h.setProperty=="function"?h.setProperty("display","none","important"):h.display="none";else{m=w.stateNode;var L=w.memoizedProps.style,R=L!=null&&L.hasOwnProperty("display")?L.display:null;m.style.display=R==null||typeof R=="boolean"?"":(""+R).trim()}}catch(ne){Me(w,w.return,ne)}}}else if(t.tag===6){if(i===null){w=t;try{w.stateNode.nodeValue=c?"":w.memoizedProps}catch(ne){Me(w,w.return,ne)}}}else if(t.tag===18){if(i===null){w=t;try{var C=w.stateNode;c?tp(C,!0):tp(w.stateNode,!1)}catch(ne){Me(w,w.return,ne)}}}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;i===t&&(i=null),t=t.return}i===t&&(i=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(i=r.retryQueue,i!==null&&(r.retryQueue=null,xr(e,i))));break;case 19:vt(t,e),bt(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,xr(e,r)));break;case 30:break;case 21:break;default:vt(t,e),bt(e)}}function bt(e){var t=e.flags;if(t&2){try{for(var i,r=e.return;r!==null;){if(ih(r)){i=r;break}r=r.return}if(i==null)throw Error(l(160));switch(i.tag){case 27:var c=i.stateNode,u=Qo(e);wr(e,u,c);break;case 5:var h=i.stateNode;i.flags&32&&(Ri(h,""),i.flags&=-33);var m=Qo(e);wr(e,m,h);break;case 3:case 4:var w=i.stateNode.containerInfo,O=Qo(e);Zo(e,O,w);break;default:throw Error(l(161))}}catch(U){Me(e,e.return,U)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function dh(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;dh(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function En(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)rh(e,t.alternate,t),t=t.sibling}function wi(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ln(4,t,t.return),wi(t);break;case 1:sn(t,t.return);var i=t.stateNode;typeof i.componentWillUnmount=="function"&&th(t,t.return,i),wi(t);break;case 27:la(t.stateNode);case 26:case 5:sn(t,t.return),wi(t);break;case 22:t.memoizedState===null&&wi(t);break;case 30:wi(t);break;default:wi(t)}e=e.sibling}}function kn(e,t,i){for(i=i&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var r=t.alternate,c=e,u=t,h=u.flags;switch(u.tag){case 0:case 11:case 15:kn(c,u,i),Ws(4,u);break;case 1:if(kn(c,u,i),r=u,c=r.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(O){Me(r,r.return,O)}if(r=u,c=r.updateQueue,c!==null){var m=r.stateNode;try{var w=c.shared.hiddenCallbacks;if(w!==null)for(c.shared.hiddenCallbacks=null,c=0;c<w.length;c++)Gf(w[c],m)}catch(O){Me(r,r.return,O)}}i&&h&64&&eh(u),Is(u,u.return);break;case 27:sh(u);case 26:case 5:kn(c,u,i),i&&r===null&&h&4&&nh(u),Is(u,u.return);break;case 12:kn(c,u,i);break;case 31:kn(c,u,i),i&&h&4&&ch(c,u);break;case 13:kn(c,u,i),i&&h&4&&uh(c,u);break;case 22:u.memoizedState===null&&kn(c,u,i),Is(u,u.return);break;case 30:break;default:kn(c,u,i)}t=t.sibling}}function Fo(e,t){var i=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==i&&(e!=null&&e.refCount++,i!=null&&qs(i))}function Wo(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&qs(e))}function Kt(e,t,i,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)hh(e,t,i,r),t=t.sibling}function hh(e,t,i,r){var c=t.flags;switch(t.tag){case 0:case 11:case 15:Kt(e,t,i,r),c&2048&&Ws(9,t);break;case 1:Kt(e,t,i,r);break;case 3:Kt(e,t,i,r),c&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&qs(e)));break;case 12:if(c&2048){Kt(e,t,i,r),e=t.stateNode;try{var u=t.memoizedProps,h=u.id,m=u.onPostCommit;typeof m=="function"&&m(h,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(w){Me(t,t.return,w)}}else Kt(e,t,i,r);break;case 31:Kt(e,t,i,r);break;case 13:Kt(e,t,i,r);break;case 23:break;case 22:u=t.stateNode,h=t.alternate,t.memoizedState!==null?u._visibility&2?Kt(e,t,i,r):Ps(e,t):u._visibility&2?Kt(e,t,i,r):(u._visibility|=2,Wi(e,t,i,r,(t.subtreeFlags&10256)!==0||!1)),c&2048&&Fo(h,t);break;case 24:Kt(e,t,i,r),c&2048&&Wo(t.alternate,t);break;default:Kt(e,t,i,r)}}function Wi(e,t,i,r,c){for(c=c&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var u=e,h=t,m=i,w=r,O=h.flags;switch(h.tag){case 0:case 11:case 15:Wi(u,h,m,w,c),Ws(8,h);break;case 23:break;case 22:var U=h.stateNode;h.memoizedState!==null?U._visibility&2?Wi(u,h,m,w,c):Ps(u,h):(U._visibility|=2,Wi(u,h,m,w,c)),c&&O&2048&&Fo(h.alternate,h);break;case 24:Wi(u,h,m,w,c),c&&O&2048&&Wo(h.alternate,h);break;default:Wi(u,h,m,w,c)}t=t.sibling}}function Ps(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var i=e,r=t,c=r.flags;switch(r.tag){case 22:Ps(i,r),c&2048&&Fo(r.alternate,r);break;case 24:Ps(i,r),c&2048&&Wo(r.alternate,r);break;default:Ps(i,r)}t=t.sibling}}var ea=8192;function Ii(e,t,i){if(e.subtreeFlags&ea)for(e=e.child;e!==null;)ph(e,t,i),e=e.sibling}function ph(e,t,i){switch(e.tag){case 26:Ii(e,t,i),e.flags&ea&&e.memoizedState!==null&&o0(i,Xt,e.memoizedState,e.memoizedProps);break;case 5:Ii(e,t,i);break;case 3:case 4:var r=Xt;Xt=Ur(e.stateNode.containerInfo),Ii(e,t,i),Xt=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=ea,ea=16777216,Ii(e,t,i),ea=r):Ii(e,t,i));break;default:Ii(e,t,i)}}function mh(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 ta(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var r=t[i];nt=r,gh(r,e)}mh(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)yh(e),e=e.sibling}function yh(e){switch(e.tag){case 0:case 11:case 15:ta(e),e.flags&2048&&Ln(9,e,e.return);break;case 3:ta(e);break;case 12:ta(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Sr(e)):ta(e);break;default:ta(e)}}function Sr(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var r=t[i];nt=r,gh(r,e)}mh(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ln(8,t,t.return),Sr(t);break;case 22:i=t.stateNode,i._visibility&2&&(i._visibility&=-3,Sr(t));break;default:Sr(t)}e=e.sibling}}function gh(e,t){for(;nt!==null;){var i=nt;switch(i.tag){case 0:case 11:case 15:Ln(8,i,t);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var r=i.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:qs(i.memoizedState.cache)}if(r=i.child,r!==null)r.return=i,nt=r;else e:for(i=e;nt!==null;){r=nt;var c=r.sibling,u=r.return;if(lh(r),r===i){nt=null;break e}if(c!==null){c.return=u,nt=c;break e}nt=u}}}var Ev={getCacheForType:function(e){var t=lt(Ze),i=t.data.get(e);return i===void 0&&(i=e(),t.data.set(e,i)),i},cacheSignal:function(){return lt(Ze).controller.signal}},kv=typeof WeakMap=="function"?WeakMap:Map,Ne=0,qe=null,we=null,Se=0,Re=0,jt=null,Hn=!1,Pi=!1,Io=!1,Tn=0,Ve=0,Yn=0,xi=0,Po=0,Nt=0,es=0,na=null,wt=null,ec=!1,Er=0,vh=0,kr=1/0,Tr=null,Gn=null,Pe=0,Vn=null,ts=null,An=0,tc=0,nc=null,bh=null,ia=0,ic=null;function Ot(){return(Ne&2)!==0&&Se!==0?Se&-Se:j.T!==null?cc():zu()}function wh(){if(Nt===0)if((Se&536870912)===0||ke){var e=Ca;Ca<<=1,(Ca&3932160)===0&&(Ca=262144),Nt=e}else Nt=536870912;return e=At.current,e!==null&&(e.flags|=32),Nt}function xt(e,t,i){(e===qe&&(Re===2||Re===9)||e.cancelPendingCommit!==null)&&(ns(e,0),Xn(e,Se,Nt,!1)),ks(e,i),((Ne&2)===0||e!==qe)&&(e===qe&&((Ne&2)===0&&(xi|=i),Ve===4&&Xn(e,Se,Nt,!1)),an(e))}function xh(e,t,i){if((Ne&6)!==0)throw Error(l(327));var r=!i&&(t&127)===0&&(t&e.expiredLanes)===0||Es(e,t),c=r?_v(e,t):ac(e,t,!0),u=r;do{if(c===0){Pi&&!r&&Xn(e,t,0,!1);break}else{if(i=e.current.alternate,u&&!Tv(i)){c=ac(e,t,!1),u=!1;continue}if(c===2){if(u=t,e.errorRecoveryDisabledLanes&u)var h=0;else h=e.pendingLanes&-536870913,h=h!==0?h:h&536870912?536870912:0;if(h!==0){t=h;e:{var m=e;c=na;var w=m.current.memoizedState.isDehydrated;if(w&&(ns(m,h).flags|=256),h=ac(m,h,!1),h!==2){if(Io&&!w){m.errorRecoveryDisabledLanes|=u,xi|=u,c=4;break e}u=wt,wt=c,u!==null&&(wt===null?wt=u:wt.push.apply(wt,u))}c=h}if(u=!1,c!==2)continue}}if(c===1){ns(e,0),Xn(e,t,0,!0);break}e:{switch(r=e,u=c,u){case 0:case 1:throw Error(l(345));case 4:if((t&4194048)!==t)break;case 6:Xn(r,t,Nt,!Hn);break e;case 2:wt=null;break;case 3:case 5:break;default:throw Error(l(329))}if((t&62914560)===t&&(c=Er+300-Qe(),10<c)){if(Xn(r,t,Nt,!Hn),Ua(r,0,!0)!==0)break e;An=t,r.timeoutHandle=Ih(Sh.bind(null,r,i,wt,Tr,ec,t,Nt,xi,es,Hn,u,"Throttled",-0,0),c);break e}Sh(r,i,wt,Tr,ec,t,Nt,xi,es,Hn,u,null,-0,0)}}break}while(!0);an(e)}function Sh(e,t,i,r,c,u,h,m,w,O,U,L,R,C){if(e.timeoutHandle=-1,L=t.subtreeFlags,L&8192||(L&16785408)===16785408){L={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:fn},ph(t,u,L);var ne=(u&62914560)===u?Er-Qe():(u&4194048)===u?vh-Qe():0;if(ne=c0(L,ne),ne!==null){An=u,e.cancelPendingCommit=ne(Oh.bind(null,e,t,u,i,r,c,h,m,w,U,L,null,R,C)),Xn(e,u,h,!O);return}}Oh(e,t,u,i,r,c,h,m,w)}function Tv(e){for(var t=e;;){var i=t.tag;if((i===0||i===11||i===15)&&t.flags&16384&&(i=t.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var r=0;r<i.length;r++){var c=i[r],u=c.getSnapshot;c=c.value;try{if(!kt(u(),c))return!1}catch{return!1}}if(i=t.child,t.subtreeFlags&16384&&i!==null)i.return=t,t=i;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Xn(e,t,i,r){t&=~Po,t&=~xi,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var c=t;0<c;){var u=31-Et(c),h=1<<u;r[u]=-1,c&=~h}i!==0&&Ru(e,i,t)}function Ar(){return(Ne&6)===0?(sa(0),!1):!0}function sc(){if(we!==null){if(Re===0)var e=we.return;else e=we,mn=di=null,wo(e),Ki=null,Ls=0,e=we;for(;e!==null;)Pd(e.alternate,e),e=e.return;we=null}}function ns(e,t){var i=e.timeoutHandle;i!==-1&&(e.timeoutHandle=-1,Xv(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),An=0,sc(),qe=e,we=i=hn(e.current,null),Se=t,Re=0,jt=null,Hn=!1,Pi=Es(e,t),Io=!1,es=Nt=Po=xi=Yn=Ve=0,wt=na=null,ec=!1,(t&8)!==0&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var c=31-Et(r),u=1<<c;t|=e[c],r&=~u}return Tn=t,Qa(),i}function Eh(e,t){me=null,j.H=Zs,t===Xi||t===tr?(t=$f(),Re=3):t===lo?(t=$f(),Re=4):Re=t===Do?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,jt=t,we===null&&(Ve=1,mr(e,Dt(t,e.current)))}function kh(){var e=At.current;return e===null?!0:(Se&4194048)===Se?Lt===null:(Se&62914560)===Se||(Se&536870912)!==0?e===Lt:!1}function Th(){var e=j.H;return j.H=Zs,e===null?Zs:e}function Ah(){var e=j.A;return j.A=Ev,e}function _r(){Ve=4,Hn||(Se&4194048)!==Se&&At.current!==null||(Pi=!0),(Yn&134217727)===0&&(xi&134217727)===0||qe===null||Xn(qe,Se,Nt,!1)}function ac(e,t,i){var r=Ne;Ne|=2;var c=Th(),u=Ah();(qe!==e||Se!==t)&&(Tr=null,ns(e,t)),t=!1;var h=Ve;e:do try{if(Re!==0&&we!==null){var m=we,w=jt;switch(Re){case 8:sc(),h=6;break e;case 3:case 2:case 9:case 6:At.current===null&&(t=!0);var O=Re;if(Re=0,jt=null,is(e,m,w,O),i&&Pi){h=0;break e}break;default:O=Re,Re=0,jt=null,is(e,m,w,O)}}Av(),h=Ve;break}catch(U){Eh(e,U)}while(!0);return t&&e.shellSuspendCounter++,mn=di=null,Ne=r,j.H=c,j.A=u,we===null&&(qe=null,Se=0,Qa()),h}function Av(){for(;we!==null;)_h(we)}function _v(e,t){var i=Ne;Ne|=2;var r=Th(),c=Ah();qe!==e||Se!==t?(Tr=null,kr=Qe()+500,ns(e,t)):Pi=Es(e,t);e:do try{if(Re!==0&&we!==null){t=we;var u=jt;t:switch(Re){case 1:Re=0,jt=null,is(e,t,u,1);break;case 2:case 9:if(Bf(u)){Re=0,jt=null,jh(t);break}t=function(){Re!==2&&Re!==9||qe!==e||(Re=7),an(e)},u.then(t,t);break e;case 3:Re=7;break e;case 4:Re=5;break e;case 7:Bf(u)?(Re=0,jt=null,jh(t)):(Re=0,jt=null,is(e,t,u,7));break;case 5:var h=null;switch(we.tag){case 26:h=we.memoizedState;case 5:case 27:var m=we;if(h?hp(h):m.stateNode.complete){Re=0,jt=null;var w=m.sibling;if(w!==null)we=w;else{var O=m.return;O!==null?(we=O,jr(O)):we=null}break t}}Re=0,jt=null,is(e,t,u,5);break;case 6:Re=0,jt=null,is(e,t,u,6);break;case 8:sc(),Ve=6;break e;default:throw Error(l(462))}}jv();break}catch(U){Eh(e,U)}while(!0);return mn=di=null,j.H=r,j.A=c,Ne=i,we!==null?0:(qe=null,Se=0,Qa(),Ve)}function jv(){for(;we!==null&&!be();)_h(we)}function _h(e){var t=Wd(e.alternate,e,Tn);e.memoizedProps=e.pendingProps,t===null?jr(e):we=t}function jh(e){var t=e,i=t.alternate;switch(t.tag){case 15:case 0:t=Xd(i,t,t.pendingProps,t.type,void 0,Se);break;case 11:t=Xd(i,t,t.pendingProps,t.type.render,t.ref,Se);break;case 5:wo(t);default:Pd(i,t),t=we=Af(t,Tn),t=Wd(i,t,Tn)}e.memoizedProps=e.pendingProps,t===null?jr(e):we=t}function is(e,t,i,r){mn=di=null,wo(t),Ki=null,Ls=0;var c=t.return;try{if(yv(e,c,t,i,Se)){Ve=1,mr(e,Dt(i,e.current)),we=null;return}}catch(u){if(c!==null)throw we=c,u;Ve=1,mr(e,Dt(i,e.current)),we=null;return}t.flags&32768?(ke||r===1?e=!0:Pi||(Se&536870912)!==0?e=!1:(Hn=e=!0,(r===2||r===9||r===3||r===6)&&(r=At.current,r!==null&&r.tag===13&&(r.flags|=16384))),Nh(t,e)):jr(t)}function jr(e){var t=e;do{if((t.flags&32768)!==0){Nh(t,Hn);return}e=t.return;var i=bv(t.alternate,t,Tn);if(i!==null){we=i;return}if(t=t.sibling,t!==null){we=t;return}we=t=e}while(t!==null);Ve===0&&(Ve=5)}function Nh(e,t){do{var i=wv(e.alternate,e);if(i!==null){i.flags&=32767,we=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!t&&(e=e.sibling,e!==null)){we=e;return}we=e=i}while(e!==null);Ve=6,we=null}function Oh(e,t,i,r,c,u,h,m,w){e.cancelPendingCommit=null;do Nr();while(Pe!==0);if((Ne&6)!==0)throw Error(l(327));if(t!==null){if(t===e.current)throw Error(l(177));if(u=t.lanes|t.childLanes,u|=Kl,lg(e,i,u,h,m,w),e===qe&&(we=qe=null,Se=0),ts=t,Vn=e,An=i,tc=u,nc=c,bh=r,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Mv(Ra,function(){return Uh(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||r){r=j.T,j.T=null,c=X.p,X.p=2,h=Ne,Ne|=4;try{xv(e,t,i)}finally{Ne=h,X.p=c,j.T=r}}Pe=1,Rh(),Mh(),Ch()}}function Rh(){if(Pe===1){Pe=0;var e=Vn,t=ts,i=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||i){i=j.T,j.T=null;var r=X.p;X.p=2;var c=Ne;Ne|=4;try{fh(t,e);var u=gc,h=gf(e.containerInfo),m=u.focusedElem,w=u.selectionRange;if(h!==m&&m&&m.ownerDocument&&yf(m.ownerDocument.documentElement,m)){if(w!==null&&Hl(m)){var O=w.start,U=w.end;if(U===void 0&&(U=O),"selectionStart"in m)m.selectionStart=O,m.selectionEnd=Math.min(U,m.value.length);else{var L=m.ownerDocument||document,R=L&&L.defaultView||window;if(R.getSelection){var C=R.getSelection(),ne=m.textContent.length,ue=Math.min(w.start,ne),De=w.end===void 0?ue:Math.min(w.end,ne);!C.extend&&ue>De&&(h=De,De=ue,ue=h);var T=mf(m,ue),E=mf(m,De);if(T&&E&&(C.rangeCount!==1||C.anchorNode!==T.node||C.anchorOffset!==T.offset||C.focusNode!==E.node||C.focusOffset!==E.offset)){var N=L.createRange();N.setStart(T.node,T.offset),C.removeAllRanges(),ue>De?(C.addRange(N),C.extend(E.node,E.offset)):(N.setEnd(E.node,E.offset),C.addRange(N))}}}}for(L=[],C=m;C=C.parentNode;)C.nodeType===1&&L.push({element:C,left:C.scrollLeft,top:C.scrollTop});for(typeof m.focus=="function"&&m.focus(),m=0;m<L.length;m++){var B=L[m];B.element.scrollLeft=B.left,B.element.scrollTop=B.top}}Hr=!!yc,gc=yc=null}finally{Ne=c,X.p=r,j.T=i}}e.current=t,Pe=2}}function Mh(){if(Pe===2){Pe=0;var e=Vn,t=ts,i=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||i){i=j.T,j.T=null;var r=X.p;X.p=2;var c=Ne;Ne|=4;try{rh(e,t.alternate,t)}finally{Ne=c,X.p=r,j.T=i}}Pe=3}}function Ch(){if(Pe===4||Pe===3){Pe=0,st();var e=Vn,t=ts,i=An,r=bh;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Pe=5:(Pe=0,ts=Vn=null,zh(e,e.pendingLanes));var c=e.pendingLanes;if(c===0&&(Gn=null),Sl(i),t=t.stateNode,St&&typeof St.onCommitFiberRoot=="function")try{St.onCommitFiberRoot(Ss,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=j.T,c=X.p,X.p=2,j.T=null;try{for(var u=e.onRecoverableError,h=0;h<r.length;h++){var m=r[h];u(m.value,{componentStack:m.stack})}}finally{j.T=t,X.p=c}}(An&3)!==0&&Nr(),an(e),c=e.pendingLanes,(i&261930)!==0&&(c&42)!==0?e===ic?ia++:(ia=0,ic=e):ia=0,sa(0)}}function zh(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,qs(t)))}function Nr(){return Rh(),Mh(),Ch(),Uh()}function Uh(){if(Pe!==5)return!1;var e=Vn,t=tc;tc=0;var i=Sl(An),r=j.T,c=X.p;try{X.p=32>i?32:i,j.T=null,i=nc,nc=null;var u=Vn,h=An;if(Pe=0,ts=Vn=null,An=0,(Ne&6)!==0)throw Error(l(331));var m=Ne;if(Ne|=4,yh(u.current),hh(u,u.current,h,i),Ne=m,sa(0,!1),St&&typeof St.onPostCommitFiberRoot=="function")try{St.onPostCommitFiberRoot(Ss,u)}catch{}return!0}finally{X.p=c,j.T=r,zh(e,t)}}function Dh(e,t,i){t=Dt(i,t),t=Uo(e.stateNode,t,2),e=Bn(e,t,2),e!==null&&(ks(e,2),an(e))}function Me(e,t,i){if(e.tag===3)Dh(e,e,i);else for(;t!==null;){if(t.tag===3){Dh(t,e,i);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Gn===null||!Gn.has(r))){e=Dt(i,e),i=Bd(2),r=Bn(t,i,2),r!==null&&(qd(i,r,t,e),ks(r,2),an(r));break}}t=t.return}}function rc(e,t,i){var r=e.pingCache;if(r===null){r=e.pingCache=new kv;var c=new Set;r.set(t,c)}else c=r.get(t),c===void 0&&(c=new Set,r.set(t,c));c.has(i)||(Io=!0,c.add(i),e=Nv.bind(null,e,t,i),t.then(e,e))}function Nv(e,t,i){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,qe===e&&(Se&i)===i&&(Ve===4||Ve===3&&(Se&62914560)===Se&&300>Qe()-Er?(Ne&2)===0&&ns(e,0):Po|=i,es===Se&&(es=0)),an(e)}function Bh(e,t){t===0&&(t=Ou()),e=ci(e,t),e!==null&&(ks(e,t),an(e))}function Ov(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),Bh(e,i)}function Rv(e,t){var i=0;switch(e.tag){case 31:case 13:var r=e.stateNode,c=e.memoizedState;c!==null&&(i=c.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(l(314))}r!==null&&r.delete(t),Bh(e,i)}function Mv(e,t){return oe(e,t)}var Or=null,ss=null,lc=!1,Rr=!1,oc=!1,Kn=0;function an(e){e!==ss&&e.next===null&&(ss===null?Or=ss=e:ss=ss.next=e),Rr=!0,lc||(lc=!0,zv())}function sa(e,t){if(!oc&&Rr){oc=!0;do for(var i=!1,r=Or;r!==null;){if(e!==0){var c=r.pendingLanes;if(c===0)var u=0;else{var h=r.suspendedLanes,m=r.pingedLanes;u=(1<<31-Et(42|e)+1)-1,u&=c&~(h&~m),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(i=!0,Hh(r,u))}else u=Se,u=Ua(r,r===qe?u:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(u&3)===0||Es(r,u)||(i=!0,Hh(r,u));r=r.next}while(i);oc=!1}}function Cv(){qh()}function qh(){Rr=lc=!1;var e=0;Kn!==0&&Vv()&&(e=Kn);for(var t=Qe(),i=null,r=Or;r!==null;){var c=r.next,u=$h(r,t);u===0?(r.next=null,i===null?Or=c:i.next=c,c===null&&(ss=i)):(i=r,(e!==0||(u&3)!==0)&&(Rr=!0)),r=c}Pe!==0&&Pe!==5||sa(e),Kn!==0&&(Kn=0)}function $h(e,t){for(var i=e.suspendedLanes,r=e.pingedLanes,c=e.expirationTimes,u=e.pendingLanes&-62914561;0<u;){var h=31-Et(u),m=1<<h,w=c[h];w===-1?((m&i)===0||(m&r)!==0)&&(c[h]=rg(m,t)):w<=t&&(e.expiredLanes|=m),u&=~m}if(t=qe,i=Se,i=Ua(e,e===t?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,i===0||e===t&&(Re===2||Re===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&$e(r),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||Es(e,i)){if(t=i&-i,t===e.callbackPriority)return t;switch(r!==null&&$e(r),Sl(i)){case 2:case 8:i=ju;break;case 32:i=Ra;break;case 268435456:i=Nu;break;default:i=Ra}return r=Lh.bind(null,e),i=oe(i,r),e.callbackPriority=t,e.callbackNode=i,t}return r!==null&&r!==null&&$e(r),e.callbackPriority=2,e.callbackNode=null,2}function Lh(e,t){if(Pe!==0&&Pe!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(Nr()&&e.callbackNode!==i)return null;var r=Se;return r=Ua(e,e===qe?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(xh(e,r,t),$h(e,Qe()),e.callbackNode!=null&&e.callbackNode===i?Lh.bind(null,e):null)}function Hh(e,t){if(Nr())return null;xh(e,t,!0)}function zv(){Kv(function(){(Ne&6)!==0?oe(_u,Cv):qh()})}function cc(){if(Kn===0){var e=Gi;e===0&&(e=Ma,Ma<<=1,(Ma&261888)===0&&(Ma=256)),Kn=e}return Kn}function Yh(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:$a(""+e)}function Gh(e,t){var i=t.ownerDocument.createElement("input");return i.name=t.name,i.value=t.value,e.id&&i.setAttribute("form",e.id),t.parentNode.insertBefore(i,t),e=new FormData(e),i.parentNode.removeChild(i),e}function Uv(e,t,i,r,c){if(t==="submit"&&i&&i.stateNode===c){var u=Yh((c[mt]||null).action),h=r.submitter;h&&(t=(t=h[mt]||null)?Yh(t.formAction):h.getAttribute("formAction"),t!==null&&(u=t,h=null));var m=new Ga("action","action",null,r,c);e.push({event:m,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Kn!==0){var w=h?Gh(c,h):new FormData(c);No(i,{pending:!0,data:w,method:c.method,action:u},null,w)}}else typeof u=="function"&&(m.preventDefault(),w=h?Gh(c,h):new FormData(c),No(i,{pending:!0,data:w,method:c.method,action:u},u,w))},currentTarget:c}]})}}for(var uc=0;uc<Xl.length;uc++){var fc=Xl[uc],Dv=fc.toLowerCase(),Bv=fc[0].toUpperCase()+fc.slice(1);Vt(Dv,"on"+Bv)}Vt(wf,"onAnimationEnd"),Vt(xf,"onAnimationIteration"),Vt(Sf,"onAnimationStart"),Vt("dblclick","onDoubleClick"),Vt("focusin","onFocus"),Vt("focusout","onBlur"),Vt(Pg,"onTransitionRun"),Vt(ev,"onTransitionStart"),Vt(tv,"onTransitionCancel"),Vt(Ef,"onTransitionEnd"),Ni("onMouseEnter",["mouseout","mouseover"]),Ni("onMouseLeave",["mouseout","mouseover"]),Ni("onPointerEnter",["pointerout","pointerover"]),Ni("onPointerLeave",["pointerout","pointerover"]),ai("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ai("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ai("onBeforeInput",["compositionend","keypress","textInput","paste"]),ai("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ai("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ai("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var aa="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(" "),qv=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(aa));function Vh(e,t){t=(t&4)!==0;for(var i=0;i<e.length;i++){var r=e[i],c=r.event;r=r.listeners;e:{var u=void 0;if(t)for(var h=r.length-1;0<=h;h--){var m=r[h],w=m.instance,O=m.currentTarget;if(m=m.listener,w!==u&&c.isPropagationStopped())break e;u=m,c.currentTarget=O;try{u(c)}catch(U){Ka(U)}c.currentTarget=null,u=w}else for(h=0;h<r.length;h++){if(m=r[h],w=m.instance,O=m.currentTarget,m=m.listener,w!==u&&c.isPropagationStopped())break e;u=m,c.currentTarget=O;try{u(c)}catch(U){Ka(U)}c.currentTarget=null,u=w}}}}function xe(e,t){var i=t[El];i===void 0&&(i=t[El]=new Set);var r=e+"__bubble";i.has(r)||(Xh(t,e,2,!1),i.add(r))}function dc(e,t,i){var r=0;t&&(r|=4),Xh(i,e,r,t)}var Mr="_reactListening"+Math.random().toString(36).slice(2);function hc(e){if(!e[Mr]){e[Mr]=!0,Bu.forEach(function(i){i!=="selectionchange"&&(qv.has(i)||dc(i,!1,e),dc(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Mr]||(t[Mr]=!0,dc("selectionchange",!1,t))}}function Xh(e,t,i,r){switch(wp(t)){case 2:var c=d0;break;case 8:c=h0;break;default:c=jc}i=c.bind(null,t,i,e),c=void 0,!Ml||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),r?c!==void 0?e.addEventListener(t,i,{capture:!0,passive:c}):e.addEventListener(t,i,!0):c!==void 0?e.addEventListener(t,i,{passive:c}):e.addEventListener(t,i,!1)}function pc(e,t,i,r,c){var u=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var h=r.tag;if(h===3||h===4){var m=r.stateNode.containerInfo;if(m===c)break;if(h===4)for(h=r.return;h!==null;){var w=h.tag;if((w===3||w===4)&&h.stateNode.containerInfo===c)return;h=h.return}for(;m!==null;){if(h=Ai(m),h===null)return;if(w=h.tag,w===5||w===6||w===26||w===27){r=u=h;continue e}m=m.parentNode}}r=r.return}Ju(function(){var O=u,U=Ol(i),L=[];e:{var R=kf.get(e);if(R!==void 0){var C=Ga,ne=e;switch(e){case"keypress":if(Ha(i)===0)break e;case"keydown":case"keyup":C=Rg;break;case"focusin":ne="focus",C=Dl;break;case"focusout":ne="blur",C=Dl;break;case"beforeblur":case"afterblur":C=Dl;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":C=Iu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":C=bg;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":C=zg;break;case wf:case xf:case Sf:C=Sg;break;case Ef:C=Dg;break;case"scroll":case"scrollend":C=gg;break;case"wheel":C=qg;break;case"copy":case"cut":case"paste":C=kg;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":C=ef;break;case"toggle":case"beforetoggle":C=Lg}var ue=(t&4)!==0,De=!ue&&(e==="scroll"||e==="scrollend"),T=ue?R!==null?R+"Capture":null:R;ue=[];for(var E=O,N;E!==null;){var B=E;if(N=B.stateNode,B=B.tag,B!==5&&B!==26&&B!==27||N===null||T===null||(B=_s(E,T),B!=null&&ue.push(ra(E,B,N))),De)break;E=E.return}0<ue.length&&(R=new C(R,ne,null,i,U),L.push({event:R,listeners:ue}))}}if((t&7)===0){e:{if(R=e==="mouseover"||e==="pointerover",C=e==="mouseout"||e==="pointerout",R&&i!==Nl&&(ne=i.relatedTarget||i.fromElement)&&(Ai(ne)||ne[Ti]))break e;if((C||R)&&(R=U.window===U?U:(R=U.ownerDocument)?R.defaultView||R.parentWindow:window,C?(ne=i.relatedTarget||i.toElement,C=O,ne=ne?Ai(ne):null,ne!==null&&(De=f(ne),ue=ne.tag,ne!==De||ue!==5&&ue!==27&&ue!==6)&&(ne=null)):(C=null,ne=O),C!==ne)){if(ue=Iu,B="onMouseLeave",T="onMouseEnter",E="mouse",(e==="pointerout"||e==="pointerover")&&(ue=ef,B="onPointerLeave",T="onPointerEnter",E="pointer"),De=C==null?R:As(C),N=ne==null?R:As(ne),R=new ue(B,E+"leave",C,i,U),R.target=De,R.relatedTarget=N,B=null,Ai(U)===O&&(ue=new ue(T,E+"enter",ne,i,U),ue.target=N,ue.relatedTarget=De,B=ue),De=B,C&&ne)t:{for(ue=$v,T=C,E=ne,N=0,B=T;B;B=ue(B))N++;B=0;for(var re=E;re;re=ue(re))B++;for(;0<N-B;)T=ue(T),N--;for(;0<B-N;)E=ue(E),B--;for(;N--;){if(T===E||E!==null&&T===E.alternate){ue=T;break t}T=ue(T),E=ue(E)}ue=null}else ue=null;C!==null&&Kh(L,R,C,ue,!1),ne!==null&&De!==null&&Kh(L,De,ne,ue,!0)}}e:{if(R=O?As(O):window,C=R.nodeName&&R.nodeName.toLowerCase(),C==="select"||C==="input"&&R.type==="file")var _e=cf;else if(lf(R))if(uf)_e=Fg;else{_e=Zg;var se=Qg}else C=R.nodeName,!C||C.toLowerCase()!=="input"||R.type!=="checkbox"&&R.type!=="radio"?O&&jl(O.elementType)&&(_e=cf):_e=Jg;if(_e&&(_e=_e(e,O))){of(L,_e,i,U);break e}se&&se(e,R,O),e==="focusout"&&O&&R.type==="number"&&O.memoizedProps.value!=null&&_l(R,"number",R.value)}switch(se=O?As(O):window,e){case"focusin":(lf(se)||se.contentEditable==="true")&&(Ui=se,Yl=O,Us=null);break;case"focusout":Us=Yl=Ui=null;break;case"mousedown":Gl=!0;break;case"contextmenu":case"mouseup":case"dragend":Gl=!1,vf(L,i,U);break;case"selectionchange":if(Ig)break;case"keydown":case"keyup":vf(L,i,U)}var ye;if(ql)e:{switch(e){case"compositionstart":var Ee="onCompositionStart";break e;case"compositionend":Ee="onCompositionEnd";break e;case"compositionupdate":Ee="onCompositionUpdate";break e}Ee=void 0}else zi?af(e,i)&&(Ee="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(Ee="onCompositionStart");Ee&&(tf&&i.locale!=="ko"&&(zi||Ee!=="onCompositionStart"?Ee==="onCompositionEnd"&&zi&&(ye=Fu()):(On=U,Cl="value"in On?On.value:On.textContent,zi=!0)),se=Cr(O,Ee),0<se.length&&(Ee=new Pu(Ee,e,null,i,U),L.push({event:Ee,listeners:se}),ye?Ee.data=ye:(ye=rf(i),ye!==null&&(Ee.data=ye)))),(ye=Yg?Gg(e,i):Vg(e,i))&&(Ee=Cr(O,"onBeforeInput"),0<Ee.length&&(se=new Pu("onBeforeInput","beforeinput",null,i,U),L.push({event:se,listeners:Ee}),se.data=ye)),Uv(L,e,O,i,U)}Vh(L,t)})}function ra(e,t,i){return{instance:e,listener:t,currentTarget:i}}function Cr(e,t){for(var i=t+"Capture",r=[];e!==null;){var c=e,u=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||u===null||(c=_s(e,i),c!=null&&r.unshift(ra(e,c,u)),c=_s(e,t),c!=null&&r.push(ra(e,c,u))),e.tag===3)return r;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 Kh(e,t,i,r,c){for(var u=t._reactName,h=[];i!==null&&i!==r;){var m=i,w=m.alternate,O=m.stateNode;if(m=m.tag,w!==null&&w===r)break;m!==5&&m!==26&&m!==27||O===null||(w=O,c?(O=_s(i,u),O!=null&&h.unshift(ra(i,O,w))):c||(O=_s(i,u),O!=null&&h.push(ra(i,O,w)))),i=i.return}h.length!==0&&e.push({event:t,listeners:h})}var Lv=/\r\n?/g,Hv=/\u0000|\uFFFD/g;function Qh(e){return(typeof e=="string"?e:""+e).replace(Lv,`
|
|
9
|
+
`).replace(Hv,"")}function Zh(e,t){return t=Qh(t),Qh(e)===t}function Ue(e,t,i,r,c,u){switch(i){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||Ri(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&Ri(e,""+r);break;case"className":Ba(e,"class",r);break;case"tabIndex":Ba(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":Ba(e,i,r);break;case"style":Qu(e,r,u);break;case"data":if(t!=="object"){Ba(e,"data",r);break}case"src":case"href":if(r===""&&(t!=="a"||i!=="href")){e.removeAttribute(i);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(i);break}r=$a(""+r),e.setAttribute(i,r);break;case"action":case"formAction":if(typeof r=="function"){e.setAttribute(i,"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"&&(i==="formAction"?(t!=="input"&&Ue(e,t,"name",c.name,c,null),Ue(e,t,"formEncType",c.formEncType,c,null),Ue(e,t,"formMethod",c.formMethod,c,null),Ue(e,t,"formTarget",c.formTarget,c,null)):(Ue(e,t,"encType",c.encType,c,null),Ue(e,t,"method",c.method,c,null),Ue(e,t,"target",c.target,c,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(i);break}r=$a(""+r),e.setAttribute(i,r);break;case"onClick":r!=null&&(e.onclick=fn);break;case"onScroll":r!=null&&xe("scroll",e);break;case"onScrollEnd":r!=null&&xe("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(l(61));if(i=r.__html,i!=null){if(c.children!=null)throw Error(l(60));e.innerHTML=i}}break;case"multiple":e.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":e.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){e.removeAttribute("xlink:href");break}i=$a(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(i,""+r):e.removeAttribute(i);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":r&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(i,""):e.removeAttribute(i);break;case"capture":case"download":r===!0?e.setAttribute(i,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(i,r):e.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?e.setAttribute(i,r):e.removeAttribute(i);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?e.removeAttribute(i):e.setAttribute(i,r);break;case"popover":xe("beforetoggle",e),xe("toggle",e),Da(e,"popover",r);break;case"xlinkActuate":un(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":un(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":un(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":un(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":un(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":un(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":un(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":un(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":un(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":Da(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=mg.get(i)||i,Da(e,i,r))}}function mc(e,t,i,r,c,u){switch(i){case"style":Qu(e,r,u);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(l(61));if(i=r.__html,i!=null){if(c.children!=null)throw Error(l(60));e.innerHTML=i}}break;case"children":typeof r=="string"?Ri(e,r):(typeof r=="number"||typeof r=="bigint")&&Ri(e,""+r);break;case"onScroll":r!=null&&xe("scroll",e);break;case"onScrollEnd":r!=null&&xe("scrollend",e);break;case"onClick":r!=null&&(e.onclick=fn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!qu.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(c=i.endsWith("Capture"),t=i.slice(2,c?i.length-7:void 0),u=e[mt]||null,u=u!=null?u[i]:null,typeof u=="function"&&e.removeEventListener(t,u,c),typeof r=="function")){typeof u!="function"&&u!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(t,r,c);break e}i in e?e[i]=r:r===!0?e.setAttribute(i,""):Da(e,i,r)}}}function ct(e,t,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":xe("error",e),xe("load",e);var r=!1,c=!1,u;for(u in i)if(i.hasOwnProperty(u)){var h=i[u];if(h!=null)switch(u){case"src":r=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(l(137,t));default:Ue(e,t,u,h,i,null)}}c&&Ue(e,t,"srcSet",i.srcSet,i,null),r&&Ue(e,t,"src",i.src,i,null);return;case"input":xe("invalid",e);var m=u=h=c=null,w=null,O=null;for(r in i)if(i.hasOwnProperty(r)){var U=i[r];if(U!=null)switch(r){case"name":c=U;break;case"type":h=U;break;case"checked":w=U;break;case"defaultChecked":O=U;break;case"value":u=U;break;case"defaultValue":m=U;break;case"children":case"dangerouslySetInnerHTML":if(U!=null)throw Error(l(137,t));break;default:Ue(e,t,r,U,i,null)}}Gu(e,u,m,w,O,h,c,!1);return;case"select":xe("invalid",e),r=h=u=null;for(c in i)if(i.hasOwnProperty(c)&&(m=i[c],m!=null))switch(c){case"value":u=m;break;case"defaultValue":h=m;break;case"multiple":r=m;default:Ue(e,t,c,m,i,null)}t=u,i=h,e.multiple=!!r,t!=null?Oi(e,!!r,t,!1):i!=null&&Oi(e,!!r,i,!0);return;case"textarea":xe("invalid",e),u=c=r=null;for(h in i)if(i.hasOwnProperty(h)&&(m=i[h],m!=null))switch(h){case"value":r=m;break;case"defaultValue":c=m;break;case"children":u=m;break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(l(91));break;default:Ue(e,t,h,m,i,null)}Xu(e,r,c,u);return;case"option":for(w in i)i.hasOwnProperty(w)&&(r=i[w],r!=null)&&(w==="selected"?e.selected=r&&typeof r!="function"&&typeof r!="symbol":Ue(e,t,w,r,i,null));return;case"dialog":xe("beforetoggle",e),xe("toggle",e),xe("cancel",e),xe("close",e);break;case"iframe":case"object":xe("load",e);break;case"video":case"audio":for(r=0;r<aa.length;r++)xe(aa[r],e);break;case"image":xe("error",e),xe("load",e);break;case"details":xe("toggle",e);break;case"embed":case"source":case"link":xe("error",e),xe("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(O in i)if(i.hasOwnProperty(O)&&(r=i[O],r!=null))switch(O){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,t));default:Ue(e,t,O,r,i,null)}return;default:if(jl(t)){for(U in i)i.hasOwnProperty(U)&&(r=i[U],r!==void 0&&mc(e,t,U,r,i,void 0));return}}for(m in i)i.hasOwnProperty(m)&&(r=i[m],r!=null&&Ue(e,t,m,r,i,null))}function Yv(e,t,i,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var c=null,u=null,h=null,m=null,w=null,O=null,U=null;for(C in i){var L=i[C];if(i.hasOwnProperty(C)&&L!=null)switch(C){case"checked":break;case"value":break;case"defaultValue":w=L;default:r.hasOwnProperty(C)||Ue(e,t,C,null,r,L)}}for(var R in r){var C=r[R];if(L=i[R],r.hasOwnProperty(R)&&(C!=null||L!=null))switch(R){case"type":u=C;break;case"name":c=C;break;case"checked":O=C;break;case"defaultChecked":U=C;break;case"value":h=C;break;case"defaultValue":m=C;break;case"children":case"dangerouslySetInnerHTML":if(C!=null)throw Error(l(137,t));break;default:C!==L&&Ue(e,t,R,C,r,L)}}Al(e,h,m,w,O,U,u,c);return;case"select":C=h=m=R=null;for(u in i)if(w=i[u],i.hasOwnProperty(u)&&w!=null)switch(u){case"value":break;case"multiple":C=w;default:r.hasOwnProperty(u)||Ue(e,t,u,null,r,w)}for(c in r)if(u=r[c],w=i[c],r.hasOwnProperty(c)&&(u!=null||w!=null))switch(c){case"value":R=u;break;case"defaultValue":m=u;break;case"multiple":h=u;default:u!==w&&Ue(e,t,c,u,r,w)}t=m,i=h,r=C,R!=null?Oi(e,!!i,R,!1):!!r!=!!i&&(t!=null?Oi(e,!!i,t,!0):Oi(e,!!i,i?[]:"",!1));return;case"textarea":C=R=null;for(m in i)if(c=i[m],i.hasOwnProperty(m)&&c!=null&&!r.hasOwnProperty(m))switch(m){case"value":break;case"children":break;default:Ue(e,t,m,null,r,c)}for(h in r)if(c=r[h],u=i[h],r.hasOwnProperty(h)&&(c!=null||u!=null))switch(h){case"value":R=c;break;case"defaultValue":C=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(l(91));break;default:c!==u&&Ue(e,t,h,c,r,u)}Vu(e,R,C);return;case"option":for(var ne in i)R=i[ne],i.hasOwnProperty(ne)&&R!=null&&!r.hasOwnProperty(ne)&&(ne==="selected"?e.selected=!1:Ue(e,t,ne,null,r,R));for(w in r)R=r[w],C=i[w],r.hasOwnProperty(w)&&R!==C&&(R!=null||C!=null)&&(w==="selected"?e.selected=R&&typeof R!="function"&&typeof R!="symbol":Ue(e,t,w,R,r,C));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 ue in i)R=i[ue],i.hasOwnProperty(ue)&&R!=null&&!r.hasOwnProperty(ue)&&Ue(e,t,ue,null,r,R);for(O in r)if(R=r[O],C=i[O],r.hasOwnProperty(O)&&R!==C&&(R!=null||C!=null))switch(O){case"children":case"dangerouslySetInnerHTML":if(R!=null)throw Error(l(137,t));break;default:Ue(e,t,O,R,r,C)}return;default:if(jl(t)){for(var De in i)R=i[De],i.hasOwnProperty(De)&&R!==void 0&&!r.hasOwnProperty(De)&&mc(e,t,De,void 0,r,R);for(U in r)R=r[U],C=i[U],!r.hasOwnProperty(U)||R===C||R===void 0&&C===void 0||mc(e,t,U,R,r,C);return}}for(var T in i)R=i[T],i.hasOwnProperty(T)&&R!=null&&!r.hasOwnProperty(T)&&Ue(e,t,T,null,r,R);for(L in r)R=r[L],C=i[L],!r.hasOwnProperty(L)||R===C||R==null&&C==null||Ue(e,t,L,R,r,C)}function Jh(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Gv(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,i=performance.getEntriesByType("resource"),r=0;r<i.length;r++){var c=i[r],u=c.transferSize,h=c.initiatorType,m=c.duration;if(u&&m&&Jh(h)){for(h=0,m=c.responseEnd,r+=1;r<i.length;r++){var w=i[r],O=w.startTime;if(O>m)break;var U=w.transferSize,L=w.initiatorType;U&&Jh(L)&&(w=w.responseEnd,h+=U*(w<m?1:(m-O)/(w-O)))}if(--r,t+=8*(u+h)/(c.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 yc=null,gc=null;function zr(e){return e.nodeType===9?e:e.ownerDocument}function Fh(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 Wh(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 vc(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 bc=null;function Vv(){var e=window.event;return e&&e.type==="popstate"?e===bc?!1:(bc=e,!0):(bc=null,!1)}var Ih=typeof setTimeout=="function"?setTimeout:void 0,Xv=typeof clearTimeout=="function"?clearTimeout:void 0,Ph=typeof Promise=="function"?Promise:void 0,Kv=typeof queueMicrotask=="function"?queueMicrotask:typeof Ph<"u"?function(e){return Ph.resolve(null).then(e).catch(Qv)}:Ih;function Qv(e){setTimeout(function(){throw e})}function Qn(e){return e==="head"}function ep(e,t){var i=t,r=0;do{var c=i.nextSibling;if(e.removeChild(i),c&&c.nodeType===8)if(i=c.data,i==="/$"||i==="/&"){if(r===0){e.removeChild(c),os(t);return}r--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")r++;else if(i==="html")la(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,la(i);for(var u=i.firstChild;u;){var h=u.nextSibling,m=u.nodeName;u[Ts]||m==="SCRIPT"||m==="STYLE"||m==="LINK"&&u.rel.toLowerCase()==="stylesheet"||i.removeChild(u),u=h}}else i==="body"&&la(e.ownerDocument.body);i=c}while(i);os(t)}function tp(e,t){var i=e;e=0;do{var r=i.nextSibling;if(i.nodeType===1?t?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(t?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),r&&r.nodeType===8)if(i=r.data,i==="/$"){if(e===0)break;e--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||e++;i=r}while(i)}function wc(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var i=t;switch(t=t.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":wc(i),kl(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function Zv(e,t,i,r){for(;e.nodeType===1;){var c=i;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[Ts])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!==c.rel||e.getAttribute("href")!==(c.href==null||c.href===""?null:c.href)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin)||e.getAttribute("title")!==(c.title==null?null:c.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(u=e.getAttribute("src"),(u!==(c.src==null?null:c.src)||e.getAttribute("type")!==(c.type==null?null:c.type)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin))&&u&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var u=c.name==null?null:""+c.name;if(c.type==="hidden"&&e.getAttribute("name")===u)return e}else return e;if(e=Ht(e.nextSibling),e===null)break}return null}function Jv(e,t,i){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=Ht(e.nextSibling),e===null))return null;return e}function np(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Ht(e.nextSibling),e===null))return null;return e}function xc(e){return e.data==="$?"||e.data==="$~"}function Sc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Fv(e,t){var i=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||i.readyState!=="loading")t();else{var r=function(){t(),i.removeEventListener("DOMContentLoaded",r)};i.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}function Ht(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 Ec=null;function ip(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"||i==="/&"){if(t===0)return Ht(e.nextSibling);t--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||t++}e=e.nextSibling}return null}function sp(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(t===0)return e;t--}else i!=="/$"&&i!=="/&"||t++}e=e.previousSibling}return null}function ap(e,t,i){switch(t=zr(i),e){case"html":if(e=t.documentElement,!e)throw Error(l(452));return e;case"head":if(e=t.head,!e)throw Error(l(453));return e;case"body":if(e=t.body,!e)throw Error(l(454));return e;default:throw Error(l(451))}}function la(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);kl(e)}var Yt=new Map,rp=new Set;function Ur(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var _n=X.d;X.d={f:Wv,r:Iv,D:Pv,C:e0,L:t0,m:n0,X:s0,S:i0,M:a0};function Wv(){var e=_n.f(),t=Ar();return e||t}function Iv(e){var t=_i(e);t!==null&&t.tag===5&&t.type==="form"?Ed(t):_n.r(e)}var as=typeof document>"u"?null:document;function lp(e,t,i){var r=as;if(r&&typeof t=="string"&&t){var c=zt(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof i=="string"&&(c+='[crossorigin="'+i+'"]'),rp.has(c)||(rp.add(c),e={rel:e,crossOrigin:i,href:t},r.querySelector(c)===null&&(t=r.createElement("link"),ct(t,"link",e),tt(t),r.head.appendChild(t)))}}function Pv(e){_n.D(e),lp("dns-prefetch",e,null)}function e0(e,t){_n.C(e,t),lp("preconnect",e,t)}function t0(e,t,i){_n.L(e,t,i);var r=as;if(r&&e&&t){var c='link[rel="preload"][as="'+zt(t)+'"]';t==="image"&&i&&i.imageSrcSet?(c+='[imagesrcset="'+zt(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(c+='[imagesizes="'+zt(i.imageSizes)+'"]')):c+='[href="'+zt(e)+'"]';var u=c;switch(t){case"style":u=rs(e);break;case"script":u=ls(e)}Yt.has(u)||(e=b({rel:"preload",href:t==="image"&&i&&i.imageSrcSet?void 0:e,as:t},i),Yt.set(u,e),r.querySelector(c)!==null||t==="style"&&r.querySelector(oa(u))||t==="script"&&r.querySelector(ca(u))||(t=r.createElement("link"),ct(t,"link",e),tt(t),r.head.appendChild(t)))}}function n0(e,t){_n.m(e,t);var i=as;if(i&&e){var r=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+zt(r)+'"][href="'+zt(e)+'"]',u=c;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=ls(e)}if(!Yt.has(u)&&(e=b({rel:"modulepreload",href:e},t),Yt.set(u,e),i.querySelector(c)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(ca(u)))return}r=i.createElement("link"),ct(r,"link",e),tt(r),i.head.appendChild(r)}}}function i0(e,t,i){_n.S(e,t,i);var r=as;if(r&&e){var c=ji(r).hoistableStyles,u=rs(e);t=t||"default";var h=c.get(u);if(!h){var m={loading:0,preload:null};if(h=r.querySelector(oa(u)))m.loading=5;else{e=b({rel:"stylesheet",href:e,"data-precedence":t},i),(i=Yt.get(u))&&kc(e,i);var w=h=r.createElement("link");tt(w),ct(w,"link",e),w._p=new Promise(function(O,U){w.onload=O,w.onerror=U}),w.addEventListener("load",function(){m.loading|=1}),w.addEventListener("error",function(){m.loading|=2}),m.loading|=4,Dr(h,t,r)}h={type:"stylesheet",instance:h,count:1,state:m},c.set(u,h)}}}function s0(e,t){_n.X(e,t);var i=as;if(i&&e){var r=ji(i).hoistableScripts,c=ls(e),u=r.get(c);u||(u=i.querySelector(ca(c)),u||(e=b({src:e,async:!0},t),(t=Yt.get(c))&&Tc(e,t),u=i.createElement("script"),tt(u),ct(u,"link",e),i.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},r.set(c,u))}}function a0(e,t){_n.M(e,t);var i=as;if(i&&e){var r=ji(i).hoistableScripts,c=ls(e),u=r.get(c);u||(u=i.querySelector(ca(c)),u||(e=b({src:e,async:!0,type:"module"},t),(t=Yt.get(c))&&Tc(e,t),u=i.createElement("script"),tt(u),ct(u,"link",e),i.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},r.set(c,u))}}function op(e,t,i,r){var c=(c=pe.current)?Ur(c):null;if(!c)throw Error(l(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(t=rs(i.href),i=ji(c).hoistableStyles,r=i.get(t),r||(r={type:"style",instance:null,count:0,state:null},i.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){e=rs(i.href);var u=ji(c).hoistableStyles,h=u.get(e);if(h||(c=c.ownerDocument||c,h={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,h),(u=c.querySelector(oa(e)))&&!u._p&&(h.instance=u,h.state.loading=5),Yt.has(e)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},Yt.set(e,i),u||r0(c,e,i,h.state))),t&&r===null)throw Error(l(528,""));return h}if(t&&r!==null)throw Error(l(529,""));return null;case"script":return t=i.async,i=i.src,typeof i=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=ls(i),i=ji(c).hoistableScripts,r=i.get(t),r||(r={type:"script",instance:null,count:0,state:null},i.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,e))}}function rs(e){return'href="'+zt(e)+'"'}function oa(e){return'link[rel="stylesheet"]['+e+"]"}function cp(e){return b({},e,{"data-precedence":e.precedence,precedence:null})}function r0(e,t,i,r){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?r.loading=1:(t=e.createElement("link"),r.preload=t,t.addEventListener("load",function(){return r.loading|=1}),t.addEventListener("error",function(){return r.loading|=2}),ct(t,"link",i),tt(t),e.head.appendChild(t))}function ls(e){return'[src="'+zt(e)+'"]'}function ca(e){return"script[async]"+e}function up(e,t,i){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+zt(i.href)+'"]');if(r)return t.instance=r,tt(r),r;var c=b({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),tt(r),ct(r,"style",c),Dr(r,i.precedence,e),t.instance=r;case"stylesheet":c=rs(i.href);var u=e.querySelector(oa(c));if(u)return t.state.loading|=4,t.instance=u,tt(u),u;r=cp(i),(c=Yt.get(c))&&kc(r,c),u=(e.ownerDocument||e).createElement("link"),tt(u);var h=u;return h._p=new Promise(function(m,w){h.onload=m,h.onerror=w}),ct(u,"link",r),t.state.loading|=4,Dr(u,i.precedence,e),t.instance=u;case"script":return u=ls(i.src),(c=e.querySelector(ca(u)))?(t.instance=c,tt(c),c):(r=i,(c=Yt.get(u))&&(r=b({},i),Tc(r,c)),e=e.ownerDocument||e,c=e.createElement("script"),tt(c),ct(c,"link",r),e.head.appendChild(c),t.instance=c);case"void":return null;default:throw Error(l(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(r=t.instance,t.state.loading|=4,Dr(r,i.precedence,e));return t.instance}function Dr(e,t,i){for(var r=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=r.length?r[r.length-1]:null,u=c,h=0;h<r.length;h++){var m=r[h];if(m.dataset.precedence===t)u=m;else if(u!==c)break}u?u.parentNode.insertBefore(e,u.nextSibling):(t=i.nodeType===9?i.head:i,t.insertBefore(e,t.firstChild))}function kc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Tc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Br=null;function fp(e,t,i){if(Br===null){var r=new Map,c=Br=new Map;c.set(i,r)}else c=Br,r=c.get(i),r||(r=new Map,c.set(i,r));if(r.has(e))return r;for(r.set(e,null),i=i.getElementsByTagName(e),c=0;c<i.length;c++){var u=i[c];if(!(u[Ts]||u[at]||e==="link"&&u.getAttribute("rel")==="stylesheet")&&u.namespaceURI!=="http://www.w3.org/2000/svg"){var h=u.getAttribute(t)||"";h=e+h;var m=r.get(h);m?m.push(u):r.set(h,[u])}}return r}function dp(e,t,i){e=e.ownerDocument||e,e.head.insertBefore(i,t==="title"?e.querySelector("head > title"):null)}function l0(e,t,i){if(i===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;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!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 hp(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function o0(e,t,i,r){if(i.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var c=rs(r.href),u=t.querySelector(oa(c));if(u){t=u._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=qr.bind(e),t.then(e,e)),i.state.loading|=4,i.instance=u,tt(u);return}u=t.ownerDocument||t,r=cp(r),(c=Yt.get(c))&&kc(r,c),u=u.createElement("link"),tt(u);var h=u;h._p=new Promise(function(m,w){h.onload=m,h.onerror=w}),ct(u,"link",r),i.instance=u}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(i,t),(t=i.state.preload)&&(i.state.loading&3)===0&&(e.count++,i=qr.bind(e),t.addEventListener("load",i),t.addEventListener("error",i))}}var Ac=0;function c0(e,t){return e.stylesheets&&e.count===0&&Lr(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var r=setTimeout(function(){if(e.stylesheets&&Lr(e,e.stylesheets),e.unsuspend){var u=e.unsuspend;e.unsuspend=null,u()}},6e4+t);0<e.imgBytes&&Ac===0&&(Ac=62500*Gv());var c=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Lr(e,e.stylesheets),e.unsuspend)){var u=e.unsuspend;e.unsuspend=null,u()}},(e.imgBytes>Ac?50:800)+t);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(c)}}:null}function qr(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Lr(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var $r=null;function Lr(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,$r=new Map,t.forEach(u0,e),$r=null,qr.call(e))}function u0(e,t){if(!(t.state.loading&4)){var i=$r.get(e);if(i)var r=i.get(null);else{i=new Map,$r.set(e,i);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u<c.length;u++){var h=c[u];(h.nodeName==="LINK"||h.getAttribute("media")!=="not all")&&(i.set(h.dataset.precedence,h),r=h)}r&&i.set(null,r)}c=t.instance,h=c.getAttribute("data-precedence"),u=i.get(h)||r,u===r&&i.set(null,c),i.set(h,c),this.count++,r=qr.bind(this),c.addEventListener("load",r),c.addEventListener("error",r),u?u.parentNode.insertBefore(c,u.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(c,e.firstChild)),t.state.loading|=4}}var ua={$$typeof:Z,Provider:null,Consumer:null,_currentValue:te,_currentValue2:te,_threadCount:0};function f0(e,t,i,r,c,u,h,m,w){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=wl(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=wl(0),this.hiddenUpdates=wl(null),this.identifierPrefix=r,this.onUncaughtError=c,this.onCaughtError=u,this.onRecoverableError=h,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=w,this.incompleteTransitions=new Map}function pp(e,t,i,r,c,u,h,m,w,O,U,L){return e=new f0(e,t,i,h,w,O,U,L,m),t=1,u===!0&&(t|=24),u=Tt(3,null,null,t),e.current=u,u.stateNode=e,t=so(),t.refCount++,e.pooledCache=t,t.refCount++,u.memoizedState={element:r,isDehydrated:i,cache:t},oo(u),e}function mp(e){return e?(e=qi,e):qi}function yp(e,t,i,r,c,u){c=mp(c),r.context===null?r.context=c:r.pendingContext=c,r=Dn(t),r.payload={element:i},u=u===void 0?null:u,u!==null&&(r.callback=u),i=Bn(e,r,t),i!==null&&(xt(i,e,t),Ys(i,e,t))}function gp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function _c(e,t){gp(e,t),(e=e.alternate)&&gp(e,t)}function vp(e){if(e.tag===13||e.tag===31){var t=ci(e,67108864);t!==null&&xt(t,e,67108864),_c(e,67108864)}}function bp(e){if(e.tag===13||e.tag===31){var t=Ot();t=xl(t);var i=ci(e,t);i!==null&&xt(i,e,t),_c(e,t)}}var Hr=!0;function d0(e,t,i,r){var c=j.T;j.T=null;var u=X.p;try{X.p=2,jc(e,t,i,r)}finally{X.p=u,j.T=c}}function h0(e,t,i,r){var c=j.T;j.T=null;var u=X.p;try{X.p=8,jc(e,t,i,r)}finally{X.p=u,j.T=c}}function jc(e,t,i,r){if(Hr){var c=Nc(r);if(c===null)pc(e,t,r,Yr,i),xp(e,r);else if(m0(c,e,t,i,r))r.stopPropagation();else if(xp(e,r),t&4&&-1<p0.indexOf(e)){for(;c!==null;){var u=_i(c);if(u!==null)switch(u.tag){case 3:if(u=u.stateNode,u.current.memoizedState.isDehydrated){var h=si(u.pendingLanes);if(h!==0){var m=u;for(m.pendingLanes|=2,m.entangledLanes|=2;h;){var w=1<<31-Et(h);m.entanglements[1]|=w,h&=~w}an(u),(Ne&6)===0&&(kr=Qe()+500,sa(0))}}break;case 31:case 13:m=ci(u,2),m!==null&&xt(m,u,2),Ar(),_c(u,2)}if(u=Nc(r),u===null&&pc(e,t,r,Yr,i),u===c)break;c=u}c!==null&&r.stopPropagation()}else pc(e,t,r,null,i)}}function Nc(e){return e=Ol(e),Oc(e)}var Yr=null;function Oc(e){if(Yr=null,e=Ai(e),e!==null){var t=f(e);if(t===null)e=null;else{var i=t.tag;if(i===13){if(e=d(t),e!==null)return e;e=null}else if(i===31){if(e=p(t),e!==null)return e;e=null}else if(i===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Yr=e,null}function wp(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(ki()){case _u:return 2;case ju:return 8;case Ra:case eg:return 32;case Nu:return 268435456;default:return 32}default:return 32}}var Rc=!1,Zn=null,Jn=null,Fn=null,fa=new Map,da=new Map,Wn=[],p0="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 xp(e,t){switch(e){case"focusin":case"focusout":Zn=null;break;case"dragenter":case"dragleave":Jn=null;break;case"mouseover":case"mouseout":Fn=null;break;case"pointerover":case"pointerout":fa.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":da.delete(t.pointerId)}}function ha(e,t,i,r,c,u){return e===null||e.nativeEvent!==u?(e={blockedOn:t,domEventName:i,eventSystemFlags:r,nativeEvent:u,targetContainers:[c]},t!==null&&(t=_i(t),t!==null&&vp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function m0(e,t,i,r,c){switch(t){case"focusin":return Zn=ha(Zn,e,t,i,r,c),!0;case"dragenter":return Jn=ha(Jn,e,t,i,r,c),!0;case"mouseover":return Fn=ha(Fn,e,t,i,r,c),!0;case"pointerover":var u=c.pointerId;return fa.set(u,ha(fa.get(u)||null,e,t,i,r,c)),!0;case"gotpointercapture":return u=c.pointerId,da.set(u,ha(da.get(u)||null,e,t,i,r,c)),!0}return!1}function Sp(e){var t=Ai(e.target);if(t!==null){var i=f(t);if(i!==null){if(t=i.tag,t===13){if(t=d(i),t!==null){e.blockedOn=t,Uu(e.priority,function(){bp(i)});return}}else if(t===31){if(t=p(i),t!==null){e.blockedOn=t,Uu(e.priority,function(){bp(i)});return}}else if(t===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Gr(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=Nc(e.nativeEvent);if(i===null){i=e.nativeEvent;var r=new i.constructor(i.type,i);Nl=r,i.target.dispatchEvent(r),Nl=null}else return t=_i(i),t!==null&&vp(t),e.blockedOn=i,!1;t.shift()}return!0}function Ep(e,t,i){Gr(e)&&i.delete(t)}function y0(){Rc=!1,Zn!==null&&Gr(Zn)&&(Zn=null),Jn!==null&&Gr(Jn)&&(Jn=null),Fn!==null&&Gr(Fn)&&(Fn=null),fa.forEach(Ep),da.forEach(Ep)}function Vr(e,t){e.blockedOn===t&&(e.blockedOn=null,Rc||(Rc=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,y0)))}var Xr=null;function kp(e){Xr!==e&&(Xr=e,a.unstable_scheduleCallback(a.unstable_NormalPriority,function(){Xr===e&&(Xr=null);for(var t=0;t<e.length;t+=3){var i=e[t],r=e[t+1],c=e[t+2];if(typeof r!="function"){if(Oc(r||i)===null)continue;break}var u=_i(i);u!==null&&(e.splice(t,3),t-=3,No(u,{pending:!0,data:c,method:i.method,action:r},r,c))}}))}function os(e){function t(w){return Vr(w,e)}Zn!==null&&Vr(Zn,e),Jn!==null&&Vr(Jn,e),Fn!==null&&Vr(Fn,e),fa.forEach(t),da.forEach(t);for(var i=0;i<Wn.length;i++){var r=Wn[i];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Wn.length&&(i=Wn[0],i.blockedOn===null);)Sp(i),i.blockedOn===null&&Wn.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(r=0;r<i.length;r+=3){var c=i[r],u=i[r+1],h=c[mt]||null;if(typeof u=="function")h||kp(i);else if(h){var m=null;if(u&&u.hasAttribute("formAction")){if(c=u,h=u[mt]||null)m=h.formAction;else if(Oc(c)!==null)continue}else m=h.action;typeof m=="function"?i[r+1]=m:(i.splice(r,3),r-=3),kp(i)}}}function Tp(){function e(u){u.canIntercept&&u.info==="react-transition"&&u.intercept({handler:function(){return new Promise(function(h){return c=h})},focusReset:"manual",scroll:"manual"})}function t(){c!==null&&(c(),c=null),r||setTimeout(i,20)}function i(){if(!r&&!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 r=!1,c=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(i,100),function(){r=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),c!==null&&(c(),c=null)}}}function Mc(e){this._internalRoot=e}Kr.prototype.render=Mc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(l(409));var i=t.current,r=Ot();yp(i,r,e,t,null,null)},Kr.prototype.unmount=Mc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;yp(e.current,2,null,e,null,null),Ar(),t[Ti]=null}};function Kr(e){this._internalRoot=e}Kr.prototype.unstable_scheduleHydration=function(e){if(e){var t=zu();e={blockedOn:null,target:e,priority:t};for(var i=0;i<Wn.length&&t!==0&&t<Wn[i].priority;i++);Wn.splice(i,0,e),i===0&&Sp(e)}};var Ap=n.version;if(Ap!=="19.2.8")throw Error(l(527,Ap,"19.2.8"));X.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(l(188)):(e=Object.keys(e).join(","),Error(l(268,e)));return e=v(t),e=e!==null?k(e):null,e=e===null?null:e.stateNode,e};var g0={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:j,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Qr=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Qr.isDisabled&&Qr.supportsFiber)try{Ss=Qr.inject(g0),St=Qr}catch{}}return ga.createRoot=function(e,t){if(!o(e))throw Error(l(299));var i=!1,r="",c=Cd,u=zd,h=Ud;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(c=t.onUncaughtError),t.onCaughtError!==void 0&&(u=t.onCaughtError),t.onRecoverableError!==void 0&&(h=t.onRecoverableError)),t=pp(e,1,!1,null,null,i,r,null,c,u,h,Tp),e[Ti]=t.current,hc(e),new Mc(t)},ga.hydrateRoot=function(e,t,i){if(!o(e))throw Error(l(299));var r=!1,c="",u=Cd,h=zd,m=Ud,w=null;return i!=null&&(i.unstable_strictMode===!0&&(r=!0),i.identifierPrefix!==void 0&&(c=i.identifierPrefix),i.onUncaughtError!==void 0&&(u=i.onUncaughtError),i.onCaughtError!==void 0&&(h=i.onCaughtError),i.onRecoverableError!==void 0&&(m=i.onRecoverableError),i.formState!==void 0&&(w=i.formState)),t=pp(e,1,!0,t,i??null,r,c,w,u,h,m,Tp),t.context=mp(null),i=t.current,r=Ot(),r=xl(r),c=Dn(r),c.callback=null,Bn(i,c,r),i=r,t.current.lanes=i,ks(t,i),an(t),e[Ti]=t.current,hc(e),new Kr(t)},ga.version="19.2.8",ga}var Vp;function z0(){if(Vp)return qc.exports;Vp=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(n){console.error(n)}}return a(),qc.exports=C0(),qc.exports}var U0=z0(),Jr={exports:{}},Xp;function D0(){if(Xp)return Jr.exports;Xp=1;var a=typeof Reflect=="object"?Reflect:null,n=a&&typeof a.apply=="function"?a.apply:function(A,$,z){return Function.prototype.apply.call(A,$,z)},s;a&&typeof a.ownKeys=="function"?s=a.ownKeys:Object.getOwnPropertySymbols?s=function(A){return Object.getOwnPropertyNames(A).concat(Object.getOwnPropertySymbols(A))}:s=function(A){return Object.getOwnPropertyNames(A)};function l(S){console&&console.warn&&console.warn(S)}var o=Number.isNaN||function(A){return A!==A};function f(){f.init.call(this)}Jr.exports=f,Jr.exports.once=M,f.EventEmitter=f,f.prototype._events=void 0,f.prototype._eventsCount=0,f.prototype._maxListeners=void 0;var d=10;function p(S){if(typeof S!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof S)}Object.defineProperty(f,"defaultMaxListeners",{enumerable:!0,get:function(){return d},set:function(S){if(typeof S!="number"||S<0||o(S))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+S+".");d=S}}),f.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},f.prototype.setMaxListeners=function(A){if(typeof A!="number"||A<0||o(A))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+A+".");return this._maxListeners=A,this};function g(S){return S._maxListeners===void 0?f.defaultMaxListeners:S._maxListeners}f.prototype.getMaxListeners=function(){return g(this)},f.prototype.emit=function(A){for(var $=[],z=1;z<arguments.length;z++)$.push(arguments[z]);var W=A==="error",P=this._events;if(P!==void 0)W=W&&P.error===void 0;else if(!W)return!1;if(W){var ie;if($.length>0&&(ie=$[0]),ie instanceof Error)throw ie;var de=new Error("Unhandled error."+(ie?" ("+ie.message+")":""));throw de.context=ie,de}var le=P[A];if(le===void 0)return!1;if(typeof le=="function")n(le,this,$);else for(var fe=le.length,Ce=V(le,fe),z=0;z<fe;++z)n(Ce[z],this,$);return!0};function v(S,A,$,z){var W,P,ie;if(p($),P=S._events,P===void 0?(P=S._events=Object.create(null),S._eventsCount=0):(P.newListener!==void 0&&(S.emit("newListener",A,$.listener?$.listener:$),P=S._events),ie=P[A]),ie===void 0)ie=P[A]=$,++S._eventsCount;else if(typeof ie=="function"?ie=P[A]=z?[$,ie]:[ie,$]:z?ie.unshift($):ie.push($),W=g(S),W>0&&ie.length>W&&!ie.warned){ie.warned=!0;var de=new Error("Possible EventEmitter memory leak detected. "+ie.length+" "+String(A)+" listeners added. Use emitter.setMaxListeners() to increase limit");de.name="MaxListenersExceededWarning",de.emitter=S,de.type=A,de.count=ie.length,l(de)}return S}f.prototype.addListener=function(A,$){return v(this,A,$,!1)},f.prototype.on=f.prototype.addListener,f.prototype.prependListener=function(A,$){return v(this,A,$,!0)};function k(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function b(S,A,$){var z={fired:!1,wrapFn:void 0,target:S,type:A,listener:$},W=k.bind(z);return W.listener=$,z.wrapFn=W,W}f.prototype.once=function(A,$){return p($),this.on(A,b(this,A,$)),this},f.prototype.prependOnceListener=function(A,$){return p($),this.prependListener(A,b(this,A,$)),this},f.prototype.removeListener=function(A,$){var z,W,P,ie,de;if(p($),W=this._events,W===void 0)return this;if(z=W[A],z===void 0)return this;if(z===$||z.listener===$)--this._eventsCount===0?this._events=Object.create(null):(delete W[A],W.removeListener&&this.emit("removeListener",A,z.listener||$));else if(typeof z!="function"){for(P=-1,ie=z.length-1;ie>=0;ie--)if(z[ie]===$||z[ie].listener===$){de=z[ie].listener,P=ie;break}if(P<0)return this;P===0?z.shift():J(z,P),z.length===1&&(W[A]=z[0]),W.removeListener!==void 0&&this.emit("removeListener",A,de||$)}return this},f.prototype.off=f.prototype.removeListener,f.prototype.removeAllListeners=function(A){var $,z,W;if(z=this._events,z===void 0)return this;if(z.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):z[A]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete z[A]),this;if(arguments.length===0){var P=Object.keys(z),ie;for(W=0;W<P.length;++W)ie=P[W],ie!=="removeListener"&&this.removeAllListeners(ie);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if($=z[A],typeof $=="function")this.removeListener(A,$);else if($!==void 0)for(W=$.length-1;W>=0;W--)this.removeListener(A,$[W]);return this};function _(S,A,$){var z=S._events;if(z===void 0)return[];var W=z[A];return W===void 0?[]:typeof W=="function"?$?[W.listener||W]:[W]:$?F(W):V(W,W.length)}f.prototype.listeners=function(A){return _(this,A,!0)},f.prototype.rawListeners=function(A){return _(this,A,!1)},f.listenerCount=function(S,A){return typeof S.listenerCount=="function"?S.listenerCount(A):G.call(S,A)},f.prototype.listenerCount=G;function G(S){var A=this._events;if(A!==void 0){var $=A[S];if(typeof $=="function")return 1;if($!==void 0)return $.length}return 0}f.prototype.eventNames=function(){return this._eventsCount>0?s(this._events):[]};function V(S,A){for(var $=new Array(A),z=0;z<A;++z)$[z]=S[z];return $}function J(S,A){for(;A+1<S.length;A++)S[A]=S[A+1];S.pop()}function F(S){for(var A=new Array(S.length),$=0;$<A.length;++$)A[$]=S[$].listener||S[$];return A}function M(S,A){return new Promise(function($,z){function W(ie){S.removeListener(A,P),z(ie)}function P(){typeof S.removeListener=="function"&&S.removeListener("error",W),$([].slice.call(arguments))}Z(S,A,P,{once:!0}),A!=="error"&&Y(S,W,{once:!0})})}function Y(S,A,$){typeof S.on=="function"&&Z(S,"error",A,$)}function Z(S,A,$,z){if(typeof S.on=="function")z.once?S.once(A,$):S.on(A,$);else if(typeof S.addEventListener=="function")S.addEventListener(A,function W(P){z.once&&S.removeEventListener(A,W),$(P)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof S)}return Jr.exports}var It=D0();const il=T0(It),B0=Object.prototype.toString,q0="[object Uint8Array]",$0="[object ArrayBuffer]";function Im(a,n,s){return a?a.constructor===n?!0:B0.call(a)===s:!1}function L0(a){return Im(a,Uint8Array,q0)}function H0(a){return Im(a,ArrayBuffer,$0)}function Y0(a){return L0(a)||H0(a)}function G0(a){if(!Y0(a))throw new TypeError(`Expected \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof a}\``)}const Kp={utf8:new globalThis.TextDecoder("utf8")};function Pm(a,n="utf8"){return G0(a),Kp[n]??=new globalThis.TextDecoder(n),Kp[n].decode(a)}function V0(a){if(typeof a!="string")throw new TypeError(`Expected \`string\`, got \`${typeof a}\``)}const X0=new globalThis.TextEncoder;function ey(a){return V0(a),X0.encode(a)}Array.from({length:256},(a,n)=>n.toString(16).padStart(2,"0"));const ut=[];for(let a=0;a<256;++a)ut.push((a+256).toString(16).slice(1));function K0(a,n=0){return(ut[a[n+0]]+ut[a[n+1]]+ut[a[n+2]]+ut[a[n+3]]+"-"+ut[a[n+4]]+ut[a[n+5]]+"-"+ut[a[n+6]]+ut[a[n+7]]+"-"+ut[a[n+8]]+ut[a[n+9]]+"-"+ut[a[n+10]]+ut[a[n+11]]+ut[a[n+12]]+ut[a[n+13]]+ut[a[n+14]]+ut[a[n+15]]).toLowerCase()}const Q0=new Uint8Array(16);function Z0(){return crypto.getRandomValues(Q0)}function et(a,n,s){return crypto.randomUUID?crypto.randomUUID():J0(a)}function J0(a,n,s){a=a||{};const l=a.random??a.rng?.()??Z0();if(l.length<16)throw new Error("Random bytes length must be >= 16");return l[6]=l[6]&15|64,l[8]=l[8]&63|128,K0(l)}const Qc=1024,Qp="$",Si={openBrace:123,closeBrace:125,quote:34,backslash:92,delimiter:36},Zp=(a,n)=>{if(n===0||a(0)!==Si.openBrace)return-1;const s=Math.min(n,Qc);let l=0,o=!1,f=!1;for(let d=0;d<s;d++){const p=a(d);if(o){f?f=!1:p===Si.backslash?f=!0:p===Si.quote&&(o=!1);continue}if(p===Si.quote)o=!0;else if(p===Si.openBrace)l++;else if(p===Si.closeBrace&&--l===0){const g=d+1;return g<s&&a(g)===Si.delimiter?g:-1}}return-1},ve={connected:"connected",disconnected:"disconnected",peerOnline:"peerOnline",peerGone:"peerGone",peerDisplaced:"peerDisplaced",peerShape:"peerShape",rejected:"rejected",unroutable:"unroutable",transportError:"transportError",relayed:"relayed"};class ty{maxPeers;peers=new Map;constructor(n=1e4){this.maxPeers=n}set(n,s){for(this.peers.delete(n),this.peers.set(n,s);this.peers.size>this.maxPeers;){const l=this.peers.keys().next();if(l.done)break;this.peers.delete(l.value)}}get(n){return this.peers.get(n)}delete(n){return this.shapes.delete(n),this.peers.delete(n)}clear(){this.peers.clear(),this.shapes.clear()}shapes=new Map;noteShape(n,s){if(this.shapes.get(n)===s)return!1;for(this.shapes.delete(n),this.shapes.set(n,s);this.shapes.size>this.maxPeers;){const l=this.shapes.keys().next();if(l.done)break;this.shapes.delete(l.value)}return!0}shapeOf(n){return this.shapes.get(n)}get size(){return this.peers.size}namesFor(n){const s=[];for(const[l,o]of this.peers)o===n&&s.push(l);return s}names(){return[...this.peers.keys()]}}class ml extends It.EventEmitter{name;destinations=[];peerRegistry=new ty;readyFlag=!1;seq=0;constructor(n,s){super(),this.name=n,n||(this.name=et()),s&&s.forEach(l=>{l.pipe(this)})}async ready(n=3e4){const s=Date.now()+n;for(;!this.readyFlag;){if(Date.now()>s)return!1;await new Promise(l=>setTimeout(l,10))}return!0}async open(){}async close(){}buildHeader(n,s,l){return{source:n,target:s,time:Date.now(),seq:this.seq++,...l}}prependHeader(n,s,l){return this.frameMessage(this.buildHeader(n,s),l)}frameMessage(n,s){const l=JSON.stringify(n)+Qp,o=ey(l);if(o.length>Qc)throw new Error(`message header is ${o.length} bytes, over the ${Qc} byte limit (source '${n.source}', target '${n.target}') - shorten the peer names`);if(typeof s=="string")return l+s;const f=new Uint8Array(o.length+s.length);return f.set(o,0),f.set(s,o.length),f}extractHeader(n){const s=typeof n=="string",l=Zp(s?g=>n.charCodeAt(g):g=>n[g],n.length);if(l<0)return[void 0,"","no msgrpc header"];const o=s?n.substring(0,l):Pm(n.subarray(0,l));let f;try{f=JSON.parse(o)}catch(g){return[void 0,"",`unparsable header: ${String(g)}`]}if(!f||typeof f!="object")return[void 0,"","header is not an object"];if(typeof f.target!="string"||!f.target)return[void 0,"","header names no target"];if(typeof f.source!="string"||!f.source)return[void 0,"","header names no source"];const d=l+Qp.length,p=s?n.substring(d):n.slice(d);return this.setKnownSource(f.source),[f,p]}getName(){return this.name}targetExists(n,s){let l;this.name===n&&(l=this);const o=this.peerRegistry.get(n);return o&&(l=o),l||this.destinations.map(f=>{!l&&!f.target.isTransport()&&f.target.targetExists(n,(s||0)+1)&&(l=f.target)}),l}pipe(n){const s=et();return this.destinations.push({id:s,target:n}),()=>{this.destinations=this.destinations.filter(l=>l.id!==s)}}async receive(n,s,l){}async receivePayload(n,s,l){}async send(n,s,l){await Promise.all(this.destinations.map(async o=>await o.target.receive(n,s,l)))}setKnownSource(n){this.peerRegistry.set(n,this)}usePeerRegistry(n){return this.peerRegistry=n,this}getIdentity(n){}async sendPayload(n,s,l,o){}isTransport(){return!1}}var Oe;(function(a){a.RequestMessage="REQUEST",a.ResponseMessage="RESPONSE",a.ErrorMessage="ERROR",a.EventMessage="EVENT",a.UnknownMessage="UNKNOWN"})(Oe||(Oe={}));class ny{type;payload}const F0=(a,n,s,l)=>{const o=new ny;return o.type=l||Oe.UnknownMessage,o.payload=a,o};class iy extends ml{name;constructor(n,s){super(n),this.name=n,n||(this.name=et()),s&&s.forEach(l=>{l.pipe(this)})}pipe(n){const s=et();return this.destinations.push({id:s,target:n}),()=>{this.destinations=this.destinations.filter(l=>l.id!==s)}}receive(n,s,l){return Promise.resolve()}async send(n,s,l){await Promise.all(this.destinations.map(async o=>await o.target.receive(n,s,l)))}async sendPayload(n,s,l,o){const f=F0(n,this.name,o,s);await this.send(f,l,o)}}const W0=a=>a==="on"||a==="addListener"||a==="prependListener"||a==="once"||a==="prependOnceListener"||a==="off"||a==="removeListener"||a==="emit"||a==="removeListener"||a==="removeAllListeners"||a==="setMaxListeners"||a==="getMaxListeners",Jp="$retired";var ge;(function(a){a.CallInstanceMethod="POST",a.success="SUCCESS",a.error="ERROR",a.event="EVENT",a.batch="BATCH",a.ticket="TICKET"})(ge||(ge={}));const Fr={query:0,"idempotent-command":1,"non-repeatable-command":2},va=a=>{if(a instanceof Error)return{name:a.name,message:a.message,stack:a.stack};if(a&&typeof a=="object"){const n=a;if(typeof n.message=="string")return{name:typeof n.name=="string"?n.name:"Error",message:n.message}}return{name:"Error",message:String(a)}},I0=a=>"code"in a,Zc=new WeakMap,Jc=new WeakMap,Fc=new WeakMap,Wc=new WeakMap,Ic=new WeakMap,Pc=new WeakMap,eu=new WeakMap,P0=a=>a==="*"||a.length>0&&!/[\u0000-\u001f\u007f]/.test(a)&&a.split(".").every(n=>n.length>0),eb=(a,n,s)=>{let l=Zc.get(a);if(l||Zc.set(a,l=new Set),l.add(n),s.conflate){let f=Fc.get(a);f||Fc.set(a,f=new Set),f.add(n)}if(s.requiresAuthority){let f=Wc.get(a);f||Wc.set(a,f=new Set),f.add(n)}if(s.injectInvocation){let f=Ic.get(a);f||Ic.set(a,f=new Set),f.add(n)}if(s.effect){let f=Pc.get(a);f||Pc.set(a,f=new Map),f.set(n,s.effect)}if(s.sets!==void 0){if(!P0(s.sets))throw new Error(`@rpc: '${s.sets}' is not a usable sets path - use '*', a field, or a dot path like 'zones.top.setpoint'`);let f=eu.get(a);f||eu.set(a,f=new Map),f.set(n,s.sets)}if(!s.semantics)return;let o=Jc.get(a);o||Jc.set(a,o=new Map),o.set(n,s.semantics)},Fp=(a,n)=>{if(a.static)throw new Error("@rpc: static methods cannot be exposed");if(a.private)throw new Error("@rpc: private methods cannot be exposed");a.addInitializer(function(){eb(this.constructor,String(a.name),n)})};function ds(a,n){if(typeof a=="function"&&n)return Fp(n,{});const s=a;return(l,o)=>Fp(o,s)}const sy=new WeakMap,ay=(a,n={})=>(s,l)=>(sy.set(s,{name:a,version:n.version,execution:n.execution,mailbox:n.mailbox}),s),ry=a=>{for(let n=a.constructor;n;n=Object.getPrototypeOf(n)){const s=sy.get(n);if(s)return s}},tb=a=>{const n=new Set;for(let s=a.constructor;s;s=Object.getPrototypeOf(s))for(const l of Zc.get(s)??[])n.add(l);return n.size?n:void 0},nb=a=>{const n=new Map;for(let s=a.constructor;s;s=Object.getPrototypeOf(s))for(const[l,o]of Jc.get(s)??[])n.has(l)||n.set(l,o);return n},ib=a=>{const n=new Map;for(let s=a.constructor;s;s=Object.getPrototypeOf(s))for(const[l,o]of Pc.get(s)??[])n.has(l)||n.set(l,o);return n},sb=a=>{const n=new Map;for(let s=a.constructor;s;s=Object.getPrototypeOf(s))for(const[l,o]of eu.get(s)??[])n.has(l)||n.set(l,o);return n},ab=a=>{const n=new Set;for(let s=a.constructor;s;s=Object.getPrototypeOf(s))for(const l of Fc.get(s)??[])n.add(l);return n},rb=a=>{const n=new Set;for(let s=a.constructor;s;s=Object.getPrototypeOf(s))for(const l of Wc.get(s)??[])n.add(l);return n},lb=a=>{const n=new Set;for(let s=a.constructor;s;s=Object.getPrototypeOf(s))for(const l of Ic.get(s)??[])n.add(l);return n},Wp=["ai.tool.write","ai.tool.program","ai.program.write","ai.program.program","ai.sponsor"],ob=a=>{const n=a;if(!n||typeof n!="object")throw new Error("aiGrants: expected a grants document object");if(n.grants!==1)throw new Error(`aiGrants: unsupported document version ${JSON.stringify(n.grants)} - this library understands version 1`);if(typeof n.revision!="number"||!Number.isFinite(n.revision))throw new Error("aiGrants: revision must be a number, so a rollback is visible");for(const[s,l]of Object.entries(n.open??{})){if(!Wp.includes(s))throw new Error(`aiGrants: '${s}' is not a grant this library defines - one of ${Wp.join(", ")}`);if(!l||typeof l!="object")throw new Error(`aiGrants: '${s}' must map to an object, even an empty one`);if(l.to&&!Array.isArray(l.to))throw new Error(`aiGrants: '${s}'.to must be a list of peer names`);if(l.roles&&!Array.isArray(l.roles))throw new Error(`aiGrants: '${s}'.roles must be a list of roles`);if(l.expiresAt!==void 0&&typeof l.expiresAt!="number")throw new Error(`aiGrants: '${s}'.expiresAt must be epoch milliseconds`);if(l.maxGeneration!==void 0&&!(typeof l.maxGeneration=="number"&&l.maxGeneration>=1))throw new Error(`aiGrants: '${s}'.maxGeneration must be 1 or more`)}return n},cb=a=>{if(a?.roles?.includes("ai-program"))return"ai-program";if(a?.roles?.includes("ai-tool"))return"ai-tool"},ub=(a,n)=>{if(n!=="observe")return n==="security-admin"?"ai.sponsor":n==="program"?a==="ai-program"?"ai.program.program":"ai.tool.program":a==="ai-program"?"ai.program.write":"ai.tool.write"},fb=({grants:a,identity:n,effect:s,now:l=Date.now()})=>{const o=cb(n);if(!o)return{allowed:!0,reason:"not an AI principal"};const f=ub(o,s);if(!f)return{allowed:!0,reason:`${o} may observe`};const d=a?.open?.[f];if(!d)return{allowed:!1,grant:f,reason:`${f} is not open on this node`};if(d.expiresAt!==void 0&&d.expiresAt<=l){const k=Math.round((l-d.expiresAt)/1e3);return{allowed:!1,grant:f,reason:`${f} lapsed ${k}s ago`}}const p=d.to?.includes(n?.name??""),g=d.roles?.some(k=>n?.roles?.includes(k));if((d.to!==void 0||d.roles!==void 0)&&!p&&!g)return{allowed:!1,grant:f,reason:`${f} is open, but not to ${n?.name??"this principal"}`};if(d.maxGeneration!==void 0){const k=typeof n?.claims?.generation=="number"?n.claims.generation:1;if(k>d.maxGeneration)return{allowed:!1,grant:f,reason:`${f} permits generation ${d.maxGeneration} and this principal is generation ${k}`}}return{allowed:!0,grant:f,reason:`${f} is open to ${n?.name??"this principal"}`}},db=Symbol("@source-repo/rpc/invocation"),hb=30*6e4,pb=(a,n,s)=>{const l=new It.EventEmitter;let o=!1;const f=g=>{o||(o=!0,g())},d={get ticket(){return p},resolve:g=>f(()=>s("resolved",g)),reject:g=>f(()=>s("rejected",void 0,g)),progress:g=>{o||s("progress",g)},on(g,v){return l.on(g,v),d},abandon:()=>l.emit("abandoned")},p={id:a,expiresAt:n,result:new Promise(()=>{}),on:()=>p,off:()=>p};return d},mb=a=>{if(a instanceof Error)return a;const n=a,s=new Error(typeof n?.message=="string"?n.message:"the deferred work failed");return typeof n?.name=="string"&&(s.name=n.name),typeof n?.stack=="string"&&(s.stack=n.stack),s},yb=64;class gb{held=new Map;early=new Map;open(n,s,l){const o=new It.EventEmitter;let f;const d=new Promise((v,k)=>{f={resolve:v,reject:k}});d.catch(()=>{});const p={settle:f,events:o,target:s};l>Date.now()&&(p.lapses=setTimeout(()=>{this.held.delete(n),f.reject(new Error(`the ticket for ${n} lapsed at ${new Date(l).toISOString()} with no answer`))},l-Date.now()),p.lapses.unref?.()),this.held.set(n,p);for(const v of this.early.get(n)??[])this.deliver(n,v.from,v.outcome,v.value,v.error);this.early.delete(n);const g={id:n,expiresAt:l,result:d,on:(v,k)=>{if(o.on(v,k),v==="progress"&&!p.watched){p.watched=!0;const b=p.heldProgress??[];p.heldProgress=void 0;for(const _ of b)queueMicrotask(()=>k(_))}return g},off:(v,k)=>(o.off(v,k),g)};return g}deliver(n,s,l,o,f){const d=this.held.get(n);if(!d||d.target!==s)return!1;if(l==="progress"){if(!d.watched){const p=d.heldProgress??=[];return p.length>=yb&&p.shift(),p.push(o),!0}return d.events.emit("progress",o),!0}return this.forget(n),l==="resolved"?d.settle.resolve(o):d.settle.reject(mb(f)),!0}holdEarly(n,s,l,o,f){const d=this.early.get(n)??[];d.push({from:s,outcome:l,value:o,error:f}),this.early.set(n,d)}dropTarget(n){for(const[s,l]of this.held)l.target===n&&(this.forget(s),l.settle.reject(new Error(`${n} went away before answering the ticket for ${s}`)));for(const[s,l]of this.early)l.every(o=>o.from===n)&&this.early.delete(s)}forget(n){const s=this.held.get(n);s?.lapses&&clearTimeout(s.lapses),this.held.delete(n)}get outstanding(){return this.held.size}}const Ip=(a,n)=>!!a&&!!n&&a.peer===n.peer&&a.instance===n.instance;class vb{durable=!1;async load(){}async save(){}}const pt="$host",Wr=128,ly=/[\u0000-\u001f\u007f]/,Pn=(a,n)=>{if(!a)throw new Error(`topology: ${n} is empty`);if(ly.test(a))throw new Error(`topology: ${n} contains a control character, and ids never do`)},Yc=a=>{if(a!==void 0&&ly.test(a))throw new Error("topology: a label contains a control character")};class bb{peer;options;records=new Map;onCommitted;listeners=new Map;store;loaded=!1;constructor(n,s={}){this.peer=n,this.options=s;for(const l of s.place??[])Pn(l,`place segment '${l}'`);Yc(s.label),this.store=s.store??new vb}async init(){const n=await this.store.load();if(n)for(const s of n)this.records.set(s.ref.instance,s);this.records.has(pt)||this.records.set(pt,{ref:{peer:this.peer,instance:pt},parent:null,owner:null,parentEpoch:et(),ownerEpoch:et(),version:{epoch:et(),revision:0},...this.options.label!==void 0?{label:this.options.label}:{}}),this.loaded=!0,await this.persist()}ref(n){return{peer:this.peer,instance:n}}get(n){return this.records.get(n)}all(){return[...this.records.values()]}get place(){return this.options.place}capabilities(){return{authorityScope:"host",cycleGuarantee:"detected",reverseIndex:"eventual",deletion:"tombstone",durability:this.store.durable?"durable":"volatile"}}async declare(n,s={}){if(this.assertLoaded(),Pn(n,`instance '${n}'`),n===pt)throw new Error(`topology: ${pt} is the synthetic root - set its links with updateHost()`);if(this.records.has(n))throw new Error(`topology: ${n} is already declared - changes go through update() with the expected version`);Yc(s.label);const l=s.parent===void 0?this.ref(pt):s.parent;this.checkParent(n,l),this.checkOwner(n,s.owner??null);const o={ref:this.ref(n),parent:l,owner:s.owner??null,parentEpoch:et(),ownerEpoch:et(),version:{epoch:et(),revision:0},...s.label!==void 0?{label:s.label}:{}};return this.records.set(n,o),await this.persist(),this.notify(n),o}async update(n,s,l){this.assertLoaded();const o=this.records.get(n);if(!o)throw new Error(`topology: ${n} is not declared here`);if(o.version.epoch!==l.expectedVersion.epoch||o.version.revision!==l.expectedVersion.revision)throw new Error(`topology: ${n} is at revision ${o.version.revision}, not ${l.expectedVersion.revision} - read it again and decide again`);Yc(s.label),s.parent!==void 0&&(n===pt?this.checkRootParent(s.parent):this.checkParent(n,s.parent)),s.owner!==void 0&&this.checkOwner(n,s.owner);const f={...o,...s.parent!==void 0?{parent:s.parent,parentEpoch:et()}:{},...s.owner!==void 0?{owner:s.owner,ownerEpoch:et()}:{},...s.label!==void 0?{label:s.label}:{},version:{epoch:o.version.epoch,revision:o.version.revision+1}};return this.records.set(n,f),await this.persist(),this.notify(n),f}async updateHost(n,s){return this.update(pt,n,s)}checkParent(n,s){if(s===null)return;if(Pn(s.peer,"parent peer"),Pn(s.instance,"parent instance"),s.peer!==this.peer)throw new Error(`topology: ${n} cannot have a remote physical parent - only the ${pt} root may, root to root`);if(s.instance===n)throw new Error(`topology: ${n} cannot be its own parent`);const l=new Set([n]);let o=s.instance;for(;o!==void 0;){if(l.has(o))throw new Error(`topology: parenting ${n} under ${s.instance} closes a physical cycle`);l.add(o);const f=this.records.get(o);o=f?.parent&&f.parent.peer===this.peer?f.parent.instance:void 0}}checkRootParent(n){if(n!==null){if(Pn(n.peer,"parent peer"),Pn(n.instance,"parent instance"),n.peer===this.peer)throw new Error(`topology: the ${pt} root's parent is another host's root, not something on this host`);if(n.instance!==pt)throw new Error("topology: a host root's parent must be another host root - physical edges cross hosts only root to root")}}checkOwner(n,s){if(s!==null&&(Pn(s.peer,"owner peer"),Pn(s.instance,"owner instance"),s.peer===this.peer&&s.instance===n))throw new Error(`topology: ${n} cannot own itself`)}physicalPath(n){const s=this.options.place??[this.peer],l=[],o=new Set;let f=n;for(let d=0;d<=Wr;d++){if(f===void 0)return{segments:l,validity:{status:"valid"}};if(f===pt)return{segments:[...s,...l],validity:{status:"valid"}};if(o.has(f))return{segments:l,validity:{status:"cycle",path:[...o].map(g=>this.ref(g))}};o.add(f);const p=this.records.get(f);if(!p)return{segments:l,validity:{status:"unresolved",at:this.ref(f)}};l.unshift(f),f=p.parent===null?void 0:p.parent.peer===this.peer?p.parent.instance:pt}return{segments:l,validity:{status:"depth-exceeded",maxDepth:Wr}}}ownerChain(n){const s=[],l=new Set;let o=n;for(let f=0;f<=Wr;f++){if(o===void 0)return{chain:s,validity:{status:"valid"}};if(l.has(o))return{chain:s,validity:{status:"cycle",path:s.slice(s.findIndex(p=>p.instance===o))}};l.add(o);const d=this.records.get(o);if(!d)return{chain:s,validity:{status:"unresolved",at:this.ref(o)}};if(s.push(d.ref),d.owner===null)return{chain:s,validity:{status:"valid"}};if(d.owner.peer!==this.peer)return{chain:s,continuesAt:d.owner,validity:{status:"valid"}};o=d.owner.instance}return{chain:s,validity:{status:"depth-exceeded",maxDepth:Wr}}}externalStore(n){return{getSnapshot:()=>this.records.get(n),subscribe:s=>{let l=this.listeners.get(n);return l||this.listeners.set(n,l=new Set),l.add(s),()=>l.delete(s)}}}notify(n){try{this.onCommitted?.()}catch{}for(const s of[...this.listeners.get(n)??[]])try{s()}catch{}}assertLoaded(){if(!this.loaded)throw new Error("topology: not loaded yet - await the server ready()")}async persist(){await this.store.save(this.all())}}const wb=/[\u0000-\u001f\u007f]/,xb=a=>{if(!a.id||wb.test(a.id))throw new Error(`defineRpcContext: '${a.id}' is not a usable token id`);if(!a.id.includes("."))throw new Error(`defineRpcContext: '${a.id}' has no namespace - a token id is globally stable, like 'acme.plant'`);if(!a.schemaVersion)throw new Error(`defineRpcContext: ${a.id} declares no schemaVersion`);return Object.freeze({...a})},Sb=16*1024,Pp=64*1024,Eb=128,oy=a=>{const n=JSON.stringify(a);return n===void 0?8:n.length};class kb extends It.EventEmitter{topology;providers=new Map;subscriptions=new Map;push;constructor(n){super(),this.topology=n}key(n,s){return`${n}\0${s}`}provide(n,s,l){const o=this.key(n,s.id);if(this.providers.has(o))throw new Error(`context: ${n} already provides ${s.id} - one provider owns one value`);const f=s.maxSerializedBytes??Sb,d=g=>{const v=oy(g);if(v>f)throw new Error(`context: a ${s.id} value of ${v} bytes exceeds its ${f} byte bound - context is ambient data, not a payload`);return g},p={token:s,value:d(l),epoch:et(),revision:0};return this.providers.set(o,p),this.changed(),{set:g=>{p.value=d(g),p.revision++,this.changed()},clear:()=>{this.providers.get(o)===p&&(this.providers.delete(o),this.changed())}}}changed(){for(const[n,s]of this.subscriptions)s.queued||(s.queued=!0,queueMicrotask(()=>{s.queued=!1,this.subscriptions.has(n)&&(s.seq++,this.push?.(s.source,{subscriptionId:s.subscriptionId,snapshot:this.snapshotFor(s.node,s.tokenIds,s.seq,!0)}))}));this.emit("contextChanged")}walk(n,s){const l=[],o=new Set;let f=n;for(let d=0;d<=Eb;d++){if(f===void 0)return{refs:l};if(o.has(f))return{refs:l,trouble:{axis:s,status:"cycle",path:l.slice(l.findIndex(v=>v.instance===f))}};o.add(f);const p=this.topology.get(f);if(!p)return{refs:l,trouble:{axis:s,status:"invalid-reference",at:{peer:this.topology.peer,instance:f}}};l.push(p.ref);const g=s==="physical"?p.parent:p.owner;if(g===null)return{refs:l};if(g.peer!==this.topology.peer)return{refs:l,continues:g};f=g.instance}return{refs:l,trouble:{axis:s,status:"depth-exceeded"}}}chainKeyOf(n,s){return n.map(l=>{const o=this.topology.get(l.instance);return o?s==="physical"?o.parentEpoch:o.ownerEpoch:"missing"}).join("\0")}snapshotFor(n,s,l,o){const f=this.walk(n,"physical"),d=this.walk(n,"logical"),p=[...f.trouble?[f.trouble]:[],...d.trouble?[d.trouble]:[]],g=s.map(v=>{const k=[];for(const[b,_]of[["physical",f.refs],["logical",d.refs]])for(const G of _){const V=this.providers.get(this.key(G.instance,v));!V||V.token.axis!==b||o&&(V.token.exposure??"remote")==="local"||k.push({node:G,axis:b,value:V.value,provider:{epoch:V.epoch,revision:V.revision}})}return{tokenId:v,entries:k}});return{node:this.topology.ref(n),walked:{physical:f.refs,logical:d.refs},continues:{...f.continues?{physical:f.continues}:{},...d.continues?{logical:d.continues}:{}},trouble:p,chainKey:{physical:this.chainKeyOf(f.refs,"physical"),logical:this.chainKeyOf(d.refs,"logical")},tokens:g,seq:l}}subscribe(n,s,l,o){const f=`${n}\0${s}`,d=this.subscriptions.get(f),p=d?++d.seq:0;return this.subscriptions.set(f,{source:n,subscriptionId:s,node:l,tokenIds:o,seq:p,queued:!1}),this.snapshotFor(l,o,p,!0)}unsubscribe(n,s){this.subscriptions.delete(`${n}\0${s}`)}dropSubscriber(n){for(const[s,l]of this.subscriptions)l.source===n&&this.subscriptions.delete(s)}get subscriptionCount(){return this.subscriptions.size}}const ps="$context",cy="$context",Tb=(a,n)=>{const s=[];for(const{token:o,entry:f}of n){if((o.capture??"never")!=="explicit")throw new Error(`context: ${o.id} declares capture '${o.capture??"never"}', so it stays on its chain`);if((o.exposure??"remote")==="local")throw new Error(`context: ${o.id} is local-only, and a capture is precisely a value leaving the host`);f&&s.push(f)}const l=s.reduce((o,f)=>o+oy(f.value),0);if(l>Pp)throw new Error(`context: a capture of ${l} bytes exceeds the ${Pp} byte bound`);return{source:a,entries:s}},tu=a=>!Array.isArray(a),uy=a=>Object.keys(a).sort(),Jt="$snapshot",fy=new WeakMap,Pt=a=>{const n=fy.get(a);if(!n)throw new Error("not an RpcComponent - components are constructed through the RpcComponent base class");return n},Ir=a=>Object.freeze({...a}),em=(a,n)=>{const s=Pt(a),l=n.props??s.props,o=n.state??s.state,f=s.validate?.(l,o);if(f)throw new Error(`component snapshot rejected: ${f}`);s.props=l,s.state=o,s.revision++,s.notify?.()};class ei extends It.EventEmitter{constructor(n,s){super(),fy.set(this,{epoch:et(),revision:0,props:Ir(n),state:Ir(s),authority:Object.freeze({generation:0})})}get props(){return Pt(this).props}get state(){return Pt(this).state}setState=n=>{const s=this.state,l=typeof n=="function"?n(s):n;return em(this,{state:Ir({...s,...l})}),this.state};replaceState=n=>{const s=typeof n=="function"?n(this.state):n;return em(this,{state:Ir(s)}),this.state}}const Oa=a=>{const n=Pt(a);return{epoch:n.epoch,revision:n.revision,props:n.props,state:n.state,authority:n.authority}},dy=(a,n)=>{const s={},l={},o=[];for(const f of n){const d=tu(f)?f.path:f;if(!d.length)continue;const[p,...g]=d,v=p==="props"?a.props:p==="state"?a.state:void 0,k=p==="props"?s:p==="state"?l:void 0;if(!v||!k)continue;if(!tu(f)){tm(v,k,g);continue}const b=Ab(v,g);if(b==null||typeof b!="object"||Array.isArray(b)){o.push({path:d,offset:f.offset??0,keys:[],total:0});continue}const _=uy(b),G=Math.max(0,Math.trunc(f.offset??0)),V=f.limit===void 0?_.slice(G):_.slice(G,G+Math.max(0,Math.trunc(f.limit)));for(const J of V)tm(v,k,[...g,J]);o.push({path:d,offset:G,keys:V,total:_.length})}return{...a,props:s,state:l,projection:n,...o.length?{slices:o}:{}}},Ab=(a,n)=>{let s=a;for(const l of n){if(s===null||typeof s!="object"||!(l in s))return;s=s[l]}return s},tm=(a,n,s)=>{if(!s.length){for(const[f,d]of Object.entries(a))n[f]=d;return}let l=a;for(const f of s){if(l===null||typeof l!="object"||!(f in l))return;l=l[f]}let o=n;for(const f of s.slice(0,-1))o=o[f]??={};o[s[s.length-1]]=l},_b=a=>Pt(a).authority,jb=6e4,pu=(a,n,s)=>{const l=Pt(a),o=l.authority.holder;l.expiryTimer&&clearTimeout(l.expiryTimer),l.expiryTimer=void 0,l.authority=Object.freeze(n),l.revision++,n.expiresAt!==void 0&&(l.expiryTimer=setTimeout(()=>{l.expiryTimer=void 0,!(l.authority.holder!==n.holder||l.authority.generation!==n.generation)&&pu(a,{generation:l.authority.generation+1},"expired")},n.expiresAt-Date.now()),l.expiryTimer.unref?.()),a instanceof It.EventEmitter&&a.emit("authorityChanged",{reason:s,authority:l.authority,previousHolder:o}),l.notify?.()},Nb=(a,n,s,l)=>{const f=Pt(a).authority,d=Date.now(),p=f.holder!==void 0&&(f.expiresAt??0)>d;if(p&&f.holder!==n&&!l)return{granted:!1,holder:f.holder,expiresAt:f.expiresAt};const g=p&&f.holder===n;return pu(a,{holder:n,expiresAt:d+s,generation:g?f.generation:f.generation+1},g?"renewed":p?"taken":"acquired"),{granted:!0,authority:Pt(a).authority}},Ob=(a,n)=>{const s=Pt(a);return s.authority.holder!==n?"ok - was not holding":(pu(a,{generation:s.authority.generation+1},"released"),"ok")},Rb=1048576,Mb=(a,n)=>{Pt(a).validate=n},Cb=(a,n,s,l)=>{const o=Pt(a),f=n.minPublishIntervalMs??0,d=n.maxSnapshotBytes??Rb;let p=!1,g=0,v;const k=()=>{g=Date.now();const b=Oa(a),_=JSON.stringify(b).length;if(_>d){l?.log("Error","component snapshot not published: {estimated} bytes exceeds the {maxBytes} byte bound",{estimated:_,maxBytes:d});return}s()};o.notify=()=>{p||(p=!0,queueMicrotask(()=>{p=!1;const b=g+f-Date.now();if(b<=0)return k();v||(v=setTimeout(()=>{v=void 0,k()},b),v.unref?.())}))}},nm=["getList","getMany","getManyReference"],im=1e3,zb=250,sm=["startsWith","contains","eq","ne","lt","lte","gt","gte"],am=8,rm=64,mu=a=>typeof a.dataResources=="function"&&typeof a.dataRequest=="function",Ub=(a,n)=>mu(a)?a.dataResources().find(s=>s.path.length===n.length&&s.path.every((l,o)=>l===n[o])):void 0,Db=(a,n,s)=>{if(typeof a!="string"||!nm.includes(a))return new Error(`$data: ${String(a)} is not served here - this component answers ${nm.join(", ")}`);if(!Array.isArray(n)||!n.length||!n.every(f=>typeof f=="string"))return new Error('$data: a resource is a non-empty path of string segments, such as ["state","tags"]');const l=s??{};if(typeof l!="object")return new Error("$data: params is an object, or absent");if(a==="getMany")return!Array.isArray(l.ids)||!l.ids.length||!l.ids.every(f=>typeof f=="string")?new Error("$data: getMany takes a non-empty array of string ids"):l.ids.length>im?new Error(`$data: getMany is bounded at ${im} ids; ask for a page instead`):{method:a,resource:n,params:l};if(a==="getManyReference"){const f=l;if(typeof f.target!="string"||!f.target)return new Error("$data: getManyReference needs a target field to match on");if(typeof f.id!="string"&&typeof f.id!="number")return new Error("$data: getManyReference needs an id, as a string or a number")}const o=l.pagination;if(o!==void 0){if(typeof o!="object"||o===null)return new Error("$data: pagination is { page, pageSize }");for(const[f,d]of[["page",o.page],["pageSize",o.pageSize]])if(d!==void 0&&(!Number.isInteger(d)||d<0))return new Error(`$data: pagination.${f} must be a non-negative integer, not ${String(d)}`);if(o.page!==void 0&&o.pageSize===void 0)return new Error("$data: pagination.page needs a pageSize - a page number alone does not say how big a page is")}if(l.filter!==void 0){const f=hy(l.filter,1,{nodes:0});if(f)return f}if(l.sort!==void 0){const f=l.sort;if(typeof f!="object"||f===null)return new Error("$data: sort is { field, order }");if(f.field!==void 0&&(typeof f.field!="string"||!f.field))return new Error("$data: sort.field is a non-empty string, or absent for the id");if(f.order!==void 0&&f.order!=="ASC"&&f.order!=="DESC")return new Error(`$data: sort.order is ASC or DESC, not ${String(f.order)}`)}return{method:a,resource:n,params:l}},hy=(a,n,s)=>{if(n>am)return new Error(`$data: a filter nested deeper than ${am} is refused`);if(++s.nodes>rm)return new Error(`$data: a filter of more than ${rm} conditions is refused`);if(typeof a!="object"||a===null)return new Error("$data: a filter is a condition, or { all: [...] }, or { any: [...] }");const l=a;for(const d of["all","any"])if(l[d]!==void 0){if(!Array.isArray(l[d])||!l[d].length)return new Error(`$data: ${d} is a non-empty array of filters`);for(const p of l[d]){const g=hy(p,n+1,s);if(g)return g}return}const o=a;if(!sm.includes(o.op))return new Error(`$data: ${String(o.op)} is not a comparison - one of ${sm.join(", ")}`);if(o.field!==void 0&&(typeof o.field!="string"||!o.field))return new Error("$data: a condition field is a non-empty string, or absent to compare the row itself");const f=o.operand;if(f!==null&&typeof f!="string"&&typeof f!="number"&&typeof f!="boolean")return new Error("$data: an operand is a string, number, boolean or null")},Bb=(a,n)=>{let s=a;for(const l of n){if(s===null||typeof s!="object")return;s=s[l]}return s},py=(a,n)=>{const[s,...l]=n,o=s==="props"?a.props:s==="state"?a.state:void 0;if(!o)return;const f=Bb(o,l);return f!==null&&typeof f=="object"&&!Array.isArray(f)?f:void 0},nu=(a,n,s)=>{if(s===void 0)return a;if(s==="id")return n;let l=a;for(const o of s.split(".")){if(l===null||typeof l!="object")return;l=l[o]}return l},qb=(a,{op:n,operand:s})=>{if(n==="ne")return a!==s;if(a===void 0)return!1;switch(n){case"eq":return a===s;case"startsWith":case"contains":{const l=typeof a=="string"?a:String(a),o=String(s);return n==="startsWith"?l.startsWith(o):l.includes(o)}default:{if(!(typeof a=="number"&&typeof s=="number"||typeof a=="string"&&typeof s=="string"))return!1;const o=a<s?-1:a>s?1:0;return n==="lt"?o<0:n==="lte"?o<=0:n==="gt"?o>0:o>=0}}},fl=(a,n,s)=>{const l=a;if(l.all)return l.all.every(f=>fl(f,n,s));if(l.any)return l.any.some(f=>fl(f,n,s));const o=a;return qb(nu(n,s,o.field),o)},lm=(a,n)=>a===n?0:a===void 0?1:n===void 0?-1:typeof a=="number"&&typeof n=="number"?a-n:String(a)<String(n)?-1:String(a)>String(n)?1:0,$b=(a,n,s)=>{const l={field:s.target,op:"eq",operand:s.id};return my(a,n,{...s,filter:s.filter?{all:[l,s.filter]}:l})},Lb=(a,n,s)=>{const l=Oa(a),o=py(l,n)??{},f=s.ids.filter(d=>Object.prototype.hasOwnProperty.call(o,d));return{ids:f,data:f.map(d=>o[d]),epoch:l.epoch,revision:l.revision}},my=(a,n,s)=>{const l=Oa(a),o=py(l,n)??{};return{...Hb(uy(o).map(f=>[f,o[f]]),s),epoch:l.epoch,revision:l.revision}},Hb=(a,n)=>{const s=new Map(a),l=a.map(([k])=>k),o=n.filter?l.filter(k=>fl(n.filter,s.get(k),k)):l,f=n.sort?[...o].sort((k,b)=>(lm(nu(s.get(k),k,n.sort?.field),nu(s.get(b),b,n.sort?.field))||lm(k,b))*(n.sort?.order==="DESC"?-1:1)):o,{page:d=0,pageSize:p}=n.pagination??{},g=d*(p??0),v=p===void 0?f:f.slice(g,g+p);return{ids:v,data:v.map(k=>s.get(k)),total:f.length,hasMore:g+v.length<f.length}},Yb=1,om=32,Qt=a=>a===null?"null":Array.isArray(a)?"array":a instanceof Uint8Array?"bytes":a instanceof Date?"date":typeof a,Ta=a=>{switch(a.kind){case"literal":return JSON.stringify(a.value);case"array":return`${Ta(a.items)}[]`;case"tuple":return`[${a.items.map(Ta).join(", ")}]`;case"union":return a.options.map(Ta).join(" | ");case"ref":return a.name;case"object":return"object";case"record":return`{ [key: string]: ${Ta(a.values)} }`;default:return a.kind}},cm=a=>typeof a=="object"&&a!==null&&!Array.isArray(a)&&!(a instanceof Uint8Array)&&!(a instanceof Date),Ft=(a,n,s={},l="",o=0)=>{if(o>om)return`${l||"value"}: nested deeper than ${om} levels`;const f=l||"value";switch(n.kind){case"any":return;case"null":return a===null?void 0:`${f}: expected null, got ${Qt(a)}`;case"boolean":return typeof a=="boolean"?void 0:`${f}: expected boolean, got ${Qt(a)}`;case"number":return typeof a!="number"||Number.isNaN(a)?`${f}: expected number, got ${Qt(a)}`:n.integer&&!Number.isInteger(a)?`${f}: expected an integer, got ${a}`:n.min!==void 0&&a<n.min?`${f}: ${a} is below the minimum ${n.min}`:n.max!==void 0&&a>n.max?`${f}: ${a} is above the maximum ${n.max}`:void 0;case"string":return typeof a!="string"?`${f}: expected string, got ${Qt(a)}`:n.minLength!==void 0&&a.length<n.minLength?`${f}: shorter than ${n.minLength} characters`:n.maxLength!==void 0&&a.length>n.maxLength?`${f}: longer than ${n.maxLength} characters`:n.pattern!==void 0&&!new RegExp(n.pattern).test(a)?`${f}: does not match ${n.pattern}`:void 0;case"bytes":return a instanceof Uint8Array?n.maxBytes!==void 0&&a.length>n.maxBytes?`${f}: longer than ${n.maxBytes} bytes`:void 0:`${f}: expected bytes, got ${Qt(a)}`;case"date":return a instanceof Date&&!Number.isNaN(a.getTime())?void 0:`${f}: expected a date, got ${Qt(a)}`;case"literal":return a===n.value?void 0:`${f}: expected ${JSON.stringify(n.value)}`;case"array":{if(!Array.isArray(a))return`${f}: expected an array, got ${Qt(a)}`;if(n.maxItems!==void 0&&a.length>n.maxItems)return`${f}: more than ${n.maxItems} items`;for(let d=0;d<a.length;d++){const p=Ft(a[d],n.items,s,`${f}[${d}]`,o+1);if(p)return p}return}case"tuple":{if(!Array.isArray(a))return`${f}: expected a tuple, got ${Qt(a)}`;if(a.length!==n.items.length)return`${f}: expected ${n.items.length} elements, got ${a.length}`;for(let d=0;d<n.items.length;d++){const p=Ft(a[d],n.items[d],s,`${f}[${d}]`,o+1);if(p)return p}return}case"object":{if(!cm(a))return`${f}: expected an object, got ${Qt(a)}`;const d=a;for(const[p,g]of Object.entries(n.fields)){if(!(d[p]!==void 0)){if(g.optional)continue;return`${f}.${p}: missing`}const k=Ft(d[p],g.type,s,`${f}.${p}`,o+1);if(k)return k}if(!n.additional){const p=Object.keys(d).find(g=>!(g in n.fields));if(p!==void 0)return`${f}.${p}: not part of this type`}return}case"record":{if(!cm(a))return`${f}: expected an object, got ${Qt(a)}`;const d=Object.keys(a);if(n.maxEntries!==void 0&&d.length>n.maxEntries)return`${f}: more than ${n.maxEntries} entries`;const p=n.keyPattern===void 0?void 0:new RegExp(n.keyPattern);for(const g of d){if(p&&!p.test(g))return`${f}.${g}: key does not match ${n.keyPattern}`;const v=Ft(a[g],n.values,s,`${f}.${g}`,o+1);if(v)return v}return}case"union":{for(const d of n.options)if(!Ft(a,d,s,f,o+1))return;return`${f}: expected ${Ta(n)}, got ${Qt(a)}`}case"ref":{const d=s[n.name];return d?Ft(a,d,s,f,o+1):`${f}: unknown type '${n.name}'`}}return`${f}: unknown type kind '${n.kind}'`},Gb=(a,n,s={})=>{const l=n.params.filter((o,f)=>!Vb(n.params[f])).length;if(a.length<l)return`expected at least ${l} argument${l===1?"":"s"}, got ${a.length}`;if(a.length>n.params.length&&!n.rest)return`expected at most ${n.params.length} arguments, got ${a.length}`;for(let o=0;o<a.length;o++){const f=o<n.params.length?n.params[o]:n.rest,d=Ft(a[o],f,s,`argument ${o}`);if(d)return d}},Vb=a=>a.kind==="any"||a.kind==="union"&&a.options.some(n=>n.kind==="literal"&&n.value===null),um={observe:0,operate:1,program:2,"security-admin":3},iu=(a,n)=>a.kind==="ref"?iu(n?.[a.name]??{kind:"any"},n):a,fm=(a,n)=>!(n.integer&&!a.integer||n.min!==void 0&&(a.min===void 0||a.min<n.min)||n.max!==void 0&&(a.max===void 0||a.max>n.max)),Mt=(a,n,s={},l=0,o=new Set)=>{if(l>64)return!1;if(a.kind==="ref"&&n.kind==="ref"){const p=`${a.name} <: ${n.name}`;if(o.has(p))return!0;o.add(p)}const f=iu(a,s),d=iu(n,s);if(d.kind==="any")return!0;if(f.kind==="any")return!1;if(f.kind==="union")return f.options.every(p=>Mt(p,d,s,l+1,o));if(d.kind==="union")return d.options.some(p=>Mt(f,p,s,l+1,o));if(f.kind==="literal")return d.kind==="literal"?f.value===d.value:(f.value===null?"null":typeof f.value)!==d.kind?!1:d.kind==="number"&&typeof f.value=="number"?fm({min:f.value,max:f.value,integer:Number.isInteger(f.value)},d):!0;if(f.kind!==d.kind)return!1;switch(f.kind){case"null":case"boolean":case"date":return!0;case"number":return fm(f,d);case"string":{const p=d;return!(p.minLength!==void 0&&(f.minLength===void 0||f.minLength<p.minLength)||p.maxLength!==void 0&&(f.maxLength===void 0||f.maxLength>p.maxLength)||p.pattern!==void 0&&p.pattern!==f.pattern)}case"bytes":{const p=d;return p.maxBytes===void 0||f.maxBytes!==void 0&&f.maxBytes<=p.maxBytes}case"array":{const p=d;return p.maxItems!==void 0&&(f.maxItems===void 0||f.maxItems>p.maxItems)?!1:Mt(f.items,p.items,s,l+1,o)}case"tuple":{const p=d;return f.items.length!==p.items.length?!1:f.items.every((g,v)=>Mt(g,p.items[v],s,l+1,o))}case"record":{const p=d;return p.maxEntries!==void 0&&(f.maxEntries===void 0||f.maxEntries>p.maxEntries)||p.keyPattern!==void 0&&p.keyPattern!==f.keyPattern?!1:Mt(f.values,p.values,s,l+1,o)}case"object":{const p=d;for(const[g,v]of Object.entries(p.fields)){const k=f.fields[g];if(!k){if(v.optional)continue;return!1}if(!v.optional&&k.optional||!Mt(k.type,v.type,s,l+1,o))return!1}if(!p.additional){for(const g of Object.keys(f.fields))if(!(g in p.fields))return!1}return!0}default:return!1}},Pr=a=>a.params.filter(n=>!(n.kind==="any"||n.kind==="union"&&n.options.some(s=>s.kind==="literal"&&s.value===null))).length,Xb=(a,n,s,l)=>{const o=[];!s.rest&&s.params.length<n.params.length&&o.push({where:a,reason:`takes at most ${s.params.length} arguments, but a caller may send ${n.params.length}`}),Pr(s)>Pr(n)&&o.push({where:a,reason:`requires ${Pr(s)} arguments, but a caller may send as few as ${Pr(n)}`});for(let v=0;v<n.params.length;v++){const k=v<s.params.length?s.params[v]:s.rest;k&&(Mt(n.params[v],k,l)||o.push({where:`${a} argument ${v}`,reason:"narrowed, so a value the caller may send is no longer accepted"}))}n.returns&&s.returns&&!Mt(s.returns,n.returns,l)&&o.push({where:`${a} return`,reason:"widened, so a value this contract may return is not one the caller expects"}),n.deferred?.result&&s.deferred?.result&&!Mt(s.deferred.result,n.deferred.result,l)&&o.push({where:`${a} deferred result`,reason:"widened, so a value this contract may answer with is not one the caller expects"}),n.deferred?.progress&&s.deferred?.progress&&!Mt(s.deferred.progress,n.deferred.progress,l)&&o.push({where:`${a} deferred progress`,reason:"widened, so an update this contract may report is not one the caller expects"}),!n.deferred!=!s.deferred&&o.push({where:`${a} reply`,reason:s.deferred?"became deferred, so the result no longer arrives in the call":"stopped being deferred, so a caller holding a ticket has nothing to hold"});const f=n.semantics,d=s.semantics;f&&d&&Fr[d]>Fr[f]&&o.push({where:a,reason:`is now ${d} where the caller was told ${f}, so a retry the caller may already make is no longer safe`}),f&&!d&&Fr[f]<Fr["non-repeatable-command"]&&o.push({where:a,reason:`no longer declares that it is ${f}, so a caller relying on that promise has nothing to rely on`});const p=n.effect,g=s.effect;return p&&g&&um[g]>um[p]&&o.push({where:a,reason:`now has effect '${g}' where the caller was told '${p}', so a caller granted the lesser authority is refused`}),p&&!g&&o.push({where:a,reason:`no longer declares effect '${p}', so it falls back to the default and a grant written against the declaration no longer matches`}),o},Kb=(a,n,s={})=>{const l=[];for(const[o,f]of Object.entries(a.methods)){const d=n.methods[o];if(!d){l.push({where:o,reason:"no longer exists"});continue}l.push(...Xb(o,f,d,s))}for(const[o,f]of Object.entries(a.events??{})){const d=n.events?.[o];if(!d){l.push({where:`event ${o}`,reason:"is no longer emitted, so a subscription to it would never fire"});continue}for(let p=0;p<d.params.length;p++){const g=f.params[p];if(!g){l.push({where:`event ${o} argument ${p}`,reason:"is emitted but the caller does not expect it"});continue}Mt(d.params[p],g,s)||l.push({where:`event ${o} argument ${p}`,reason:"widened, so a value this contract may emit is not one the caller expects"})}}for(const o of a.capabilities??[])n.capabilities?.includes(o)||l.push({where:`capability ${o}`,reason:"is no longer declared, so whatever found this peer by it will stop finding it"});return a.component&&(n.component?(Mt(n.component.props,a.component.props,s)||l.push({where:"component props",reason:"widened, so a snapshot this contract may serve is not one the observer expects"}),Mt(n.component.state,a.component.state,s)||l.push({where:"component state",reason:"widened, so a snapshot this contract may serve is not one the observer expects"})):l.push({where:"component",reason:"is no longer served, so an observer would wait forever for a snapshot"})),l},Qb=(a,n,s,l)=>l.length?`${a}@${n} is not compatible with ${a}@${s??"current"}: `+l.map(o=>`${o.where} ${o.reason}`).join("; "):void 0;class Zb{rpcServer;instance;event;target;instanceName;projection;listener=(...n)=>{const s=this.projection?[dy(n[0],this.projection)]:n;this.rpcServer.sendEvent(this.target,this.event,s,this.instanceName).catch(l=>this.rpcServer.emit("deliveryError",{target:this.target,event:this.event,path:this.instanceName,error:l}))};constructor(n,s,l,o,f,d){this.rpcServer=n,this.instance=s,this.event=l,this.target=o,this.instanceName=f,this.projection=d}attach(){this.instance.on(this.event,this.listener)}detach(){this.instance.removeListener(this.event,this.listener)}}const dm=(a,n,s)=>`${a}\0${n}\0${s}`,Jb=a=>{if(a==null)return;if(!Array.isArray(a))return new Error("a component projection is an array of entries, each a path or a { path, offset, limit } slice");const n=s=>Array.isArray(s)&&s.every(l=>typeof l=="string");for(const s of a){if(n(s))continue;const l=s;if(!l||typeof l!="object"||!n(l.path))return new Error("a component projection entry is a path of string segments, or a slice naming one as `path`");for(const[o,f]of[["offset",l.offset],["limit",l.limit]])if(f!==void 0&&(!Number.isInteger(f)||f<0))return new Error(`a projection slice's ${o} must be a non-negative integer, not ${String(f)}`)}return a.length?a:new Error("a component projection naming no paths would subscribe to nothing; omit it to receive the whole snapshot")},Fb=(a,n)=>!a||!n?a===n:a.length!==n.length?!1:a.every((s,l)=>JSON.stringify(s)===JSON.stringify(n[l])),hm=a=>a.type===ge.CallInstanceMethod,Wb=100,Ib=new Set(["Unauthorized","Forbidden","InvalidParams","IncompatibleVersion","ClassNotFound","MethodNotFound","TransportError","Timeout","UnknownOutcome"]),Pb=a=>{const n=a?.code;return typeof n=="string"&&Ib.has(n)?n:"Exception"},ew=new Map([["$data","observe"],["$acquire","operate"],["$release","operate"]]),tw=new Map([["read","observe"],["subscribe","observe"],["unsubscribe","observe"]]),nw=3e4;class iw extends iy{manageRpc=new sw;eventProxies=new Map;declaredElevations=[];deferrals=new Map;async retire(n){const s=this.manageRpc.withdraw(n);if(s===void 0)return!1;for(const[l,o]of this.eventProxies)o.instanceName===n&&(o.detach(),this.eventProxies.delete(l),await this.sendEvent(o.target,Jp,[{namespace:n,generation:s}],n).catch(f=>this.emit("deliveryError",{target:o.target,event:Jp,path:n,error:f})));return!0}peerLifetime(n,s){if(s){const d=this.lifetimeTimers.get(n);d&&clearTimeout(d),this.lifetimeTimers.delete(n);return}const l=[...this.manageRpc.namespaces].filter(([,d])=>d.lifetime?.peer===n);if(!l.length||this.lifetimeTimers.has(n))return;const o=Math.max(...l.map(([,d])=>d.lifetime?.graceMs??nw)),f=setTimeout(()=>{this.lifetimeTimers.delete(n);for(const[d,p]of this.manageRpc.namespaces)p.lifetime?.peer===n&&this.retire(d)},o);f.unref?.(),this.lifetimeTimers.set(n,f)}lifetimeTimers=new Map;abandonFor(n){for(const[s,l]of this.deferrals)l.peer===n&&(this.deferrals.delete(s),l.deferred.abandon())}epoch=typeof globalThis.crypto?.randomUUID=="function"?globalThis.crypto.randomUUID().slice(0,8):et().slice(0,8);eventSequences=new Map;eventCounters=new Map;eventTracked=new Map;eventSequenceKey(n,s){return`${n}\0${s}`}trackEvent(n,s){if(s===Jt)return;const l=this.eventSequenceKey(n,s);if(this.eventCounters.has(l))return;const o=this.manageRpc.instanceAt(n);if(!(o instanceof il))return;const f=()=>this.eventSequences.set(l,(this.eventSequences.get(l)??0)+1);this.eventCounters.set(l,f),this.eventSequences.set(l,this.eventSequences.get(l)??0),this.eventTracked.set(l,Date.now()),o.on(s,f)}eventTrackedSince(n,s){return this.eventTracked.get(this.eventSequenceKey(n,s))}trackDeclaredEvents(){for(const[n,s]of Object.entries(this.schema?.namespaces??{}))if(this.manageRpc.instanceAt(n))for(const l of Object.keys(s.events??{}))this.trackEvent(n,l)}eventSequenceOf(n,s){return this.eventSequences.get(this.eventSequenceKey(n,s))}authorize;resolveIdentity;requireIdentity=!1;aiGrants;onAiDecision;deduplicateRequests=!0;maxTrackedRequests=1e3;refuseExpiredCalls=!0;idempotency;schema;validation="described";hostTopology;hostContext;allowTopologyMutation=!1;allowStatePathWrites=!1;maxIncomingBatchCalls=256;validateResults=!1;unknownVersion="allow";compatibility=new Map;recentResponses=new Map;inFlightRequests=new Set;constructor(n,s){super(n,s),this.manageRpc.logger?.log("Information","RpcServerHandler {name} starting",{name:n})}async checkAccess(n,s,l){const o=this.resolveIdentity?.(s);if(this.requireIdentity&&!o)return"Unauthorized";const f=l?"observe":this.effectOf(n),d=fb({grants:this.aiGrants,identity:o,effect:f});if((d.grant||!d.allowed)&&this.onAiDecision?.({source:s,path:n.path,method:n.method,effect:f,allowed:d.allowed,grant:d.grant,reason:d.reason}),!d.allowed)return"Forbidden";if(!this.authorize)return;const p={identity:o,source:s,instanceName:n.path,method:n.method,params:n.params,subscription:l};try{return await this.authorize(p)?void 0:"Forbidden"}catch{return"Forbidden"}}checkParams(n){if(!this.schema||this.validation==="off")return;const s=this.schema.namespaces[n.path];if(!s)return this.validation==="required"?`${n.path} is not described by the schema`:void 0;if(s.validate===!1)return;const l=s.methods[n.method];if(!l)return this.validation==="required"?`${n.path}.${n.method} is not described by the schema`:void 0;const o=Gb(n.params,l,this.schema.types);if(o)return s.version?`${o} (this server serves ${n.path}@${s.version})`:o}checkVersion(n){if(!this.schema||this.validation==="off"||!n.version)return;const s=this.schema.namespaces[n.path];if(!s||n.version===s.version)return;const l=`${n.path}@${n.version}`;if(this.compatibility.has(l))return this.compatibility.get(l);const o=s.history?.[n.version];let f;return o?f=Qb(n.path,n.version,s.version,Kb(o,s,this.schema.types)):f=this.unknownVersion==="reject"?`${n.path}@${n.version} is unknown to this server, which serves ${n.path}@${s.version??"an unversioned contract"}`:void 0,this.compatibility.set(l,f),f}async receive(n,s,l){this.manageRpc.logger?.log("Debug","RpcServerHandler {name} received message type {type} from {source} to {target}: {message}",{name:this.name,type:n.type,source:s,target:l,message:JSON.stringify(n)}),n.payload&&this.receivePayload(n.payload,s,l).catch(o=>this.emit("handlerError",{source:s,target:l,error:o}))}respond(n,s,l,o){if(this.deduplicateRequests)for(this.inFlightRequests.delete(n),this.recentResponses.set(n,l);this.recentResponses.size>this.maxTrackedRequests;){const f=this.recentResponses.keys().next();if(f.done)break;this.recentResponses.delete(f.value)}return this.sendPayload(l,o,this.name,s)}async receivePayload(n,s,l){if(n.type===ge.batch){const o=n.payloads??[];if(o.length>this.maxIncomingBatchCalls){const f=`this peer accepts at most ${this.maxIncomingBatchCalls} calls in one batch, and this one carried ${o.length}`;this.emit("handlerError",{source:s,payload:n,error:new Error(f)});for(const d of o){const p=d?.id;p&&await this.sendPayload({type:ge.error,id:p,code:"InvalidParams",error:va(new Error(f))},Oe.ErrorMessage,this.name,s).catch(()=>{})}return}for(const f of o){if(f?.type===ge.batch){await this.reportDispatchFailure(f,s,new Error("a batch may not contain another batch"));continue}this.receivePayload(f,s,l).catch(d=>this.emit("handlerError",{source:s,target:l,error:d}))}return}try{await this.dispatch(n,s,l)}catch(o){await this.reportDispatchFailure(n,s,o)}}async reportDispatchFailure(n,s,l){this.emit("handlerError",{source:s,payload:n,error:l});const o=n.id;if(!(!hm(n)||!o)){this.deduplicateRequests&&this.inFlightRequests.delete(o);try{await this.sendPayload({type:ge.error,id:o,code:"Exception",error:va(l)},Oe.ErrorMessage,this.name,s)}catch{}}}async dispatch(n,s,l){const o=Date.now();if(hm(n)){if(this.deduplicateRequests){const V=this.recentResponses.get(n.id);if(V){const J=V.code?Oe.ErrorMessage:Oe.ResponseMessage;await this.sendPayload(V,J,this.name,s);return}if(this.inFlightRequests.has(n.id))return;this.inFlightRequests.add(n.id)}const f=this.manageRpc.findNameSpaceMethodMap(n.path),d=f?.get(n.method);if(!d){const V=n.path,J=n.params[0],F=this.manageRpc.instanceAt(V);if(n.method==="on"&&J===Jt&&F&&!(F instanceof ei)){await this.sendError(n.id,s,"ClassNotFound",`${n.path} is not an observable component`);return}if(n.method==="on"&&F instanceof il){const M=await this.checkAccess(n,s,!0);if(M){await this.sendError(n.id,s,M,`not permitted to subscribe to ${n.path}.${J}`);return}const Y=dm(V,J,s),Z=J===Jt?Jb(n.params[1]):void 0;if(Z instanceof Error){await this.sendError(n.id,s,"InvalidParams",Z.message);return}let S=this.eventProxies.get(Y),A="ok - already exists";if(S&&J===Jt&&!Fb(S.projection,Z)&&(S.detach(),this.eventProxies.delete(Y),S=void 0,A="ok - reprojected"),S||(this.trackEvent(V,J),S=new Zb(this,F,J,s,V,Z),this.eventProxies.set(Y,S),S.attach(),A!=="ok - reprojected"&&(A="ok")),J===Jt){const $=Oa(F);await this.sendEvent(s,Jt,[Z?dy($,Z):$],V)}await this.respond(n.id,s,{type:ge.success,result:A,id:n.id},Oe.ResponseMessage)}else if((n.method==="off"||n.method==="removeListener")&&F instanceof il){const M=dm(V,J,s),Y=this.eventProxies.get(M);Y&&(Y.detach(),this.eventProxies.delete(M)),await this.respond(n.id,s,{type:ge.success,result:Y?"ok":"ok - was not subscribed",id:n.id},Oe.ResponseMessage)}else if(n.path===ps&&(n.method==="read"||n.method==="subscribe"||n.method==="unsubscribe")){if(!this.hostContext){await this.sendError(n.id,s,"ClassNotFound","this host serves no context");return}const M=await this.checkAccess(n,s,!1);if(M){await this.sendError(n.id,s,M,`not permitted to call ${n.path}.${n.method}`);return}const Y=S=>Array.isArray(S)?S.map(String):[];let Z;n.method==="read"?Z=this.hostContext.snapshotFor(String(n.params[0]),Y(n.params[1]),0,!0):n.method==="subscribe"?Z=this.hostContext.subscribe(s,String(n.params[0]),String(n.params[1]),Y(n.params[2])):(this.hostContext.unsubscribe(s,String(n.params[0])),Z="ok"),await this.respond(n.id,s,{type:ge.success,result:Z,id:n.id},Oe.ResponseMessage)}else if((n.method==="$acquire"||n.method==="$release")&&F){if(!(F instanceof ei)){await this.sendError(n.id,s,"ClassNotFound",`${n.path} is not an observable component, so it has no authority to hold`);return}const M=await this.checkAccess(n,s,!1);if(M){await this.sendError(n.id,s,M,`not permitted to call ${n.path}.${n.method}`);return}if(n.method==="$acquire"){const Y=n.params[0]??jb;if(typeof Y!="number"||!Number.isFinite(Y)||Y<=0){await this.sendError(n.id,s,"InvalidParams","$acquire: the lease must expire, so its ttl is a positive number of milliseconds");return}const Z=n.params[1]?.take===!0,S=Nb(F,s,Y,Z);if(!S.granted){await this.sendError(n.id,s,"NotInControl",`${n.path} is controlled by ${S.holder} until ${new Date(S.expiresAt).toISOString()}`);return}await this.respond(n.id,s,{type:ge.success,result:S.authority,id:n.id},Oe.ResponseMessage)}else{const Y=Ob(F,s);await this.respond(n.id,s,{type:ge.success,result:Y,id:n.id},Oe.ResponseMessage)}}else if(n.method==="$data"&&F){if(!(F instanceof ei)){await this.sendError(n.id,s,"ClassNotFound",`${n.path} is not an observable component, so it serves no data`);return}const M=await this.checkAccess(n,s,!1);if(M){await this.sendError(n.id,s,M,`not permitted to call ${n.path}.${n.method}`);return}const Y=Db(n.params[0],n.params[1],n.params[2]);if(Y instanceof Error){await this.sendError(n.id,s,"InvalidParams",Y.message);return}const Z=Ub(F,Y.resource);if(Z&&!Z.verbs.includes(Y.method)){await this.sendError(n.id,s,"InvalidParams",`$data: ${Y.resource.join(".")} answers ${Z.verbs.join(", ")}, not ${Y.method}`);return}if(!Z&&mu(F)&&Y.resource[0]!=="props"&&Y.resource[0]!=="state"){const P=F.dataResources().map(de=>de.path.join(".")),ie=P.length>12?`${P.slice(0,12).join(", ")} and ${P.length-12} more`:P.join(", ");await this.sendError(n.id,s,"InvalidParams",`$data: ${Y.resource.join(".")} is not a resource of ${n.path}${P.length?` - it serves ${ie}`:", which serves none"}`);return}const S=Date.now(),A=Z?await F.dataRequest(Y.method,Y.resource,Y.params):Y.method==="getMany"?Lb(F,Y.resource,Y.params):Y.method==="getManyReference"?$b(F,Y.resource,Y.params):my(F,Y.resource,Y.params),$=this.checkRows(Z,A);if($){await this.sendError(n.id,s,"InvalidParams",$);return}const z=Date.now()-S;z>=zb&&this.emit("slowRequest",{source:s,path:n.path,method:Y.method,resource:Y.resource,ms:z,served:Z?"component":"library",...A&&typeof A=="object"?{queryMs:A.queryMs,countMs:A.countMs}:{}});const W=A&&typeof A=="object"?{...A,ms:z}:A;await this.respond(n.id,s,{type:ge.success,result:W,id:n.id},Oe.ResponseMessage)}else await this.sendError(n.id,s,f?"MethodNotFound":"ClassNotFound",`${n.path}.${n.method} is not exposed`);return}const p=await this.checkAccess(n,s,!1);if(p){await this.sendError(n.id,s,p,`not permitted to call ${n.path}.${n.method}`);return}const g=this.checkVersion(n);if(g){await this.sendError(n.id,s,"IncompatibleVersion",g);return}const v=this.checkParams(n);if(v){await this.sendError(n.id,s,"InvalidParams",v);return}const k=this.pathWriteRefusal(n);if(k){await this.sendError(n.id,s,"Forbidden",k);return}const b=this.authorityRefusal(n,s);if(b){await this.sendError(n.id,s,"NotInControl",b);return}const _=this.fenceRefusal(n);if(_){await this.sendError(n.id,s,"OwnershipChanged",_);return}const G=this.executionKey(n,s);G===void 0?await this.invoke(n,s,o,d):await this.enqueue(G,n,s,o,d)}}async enqueue(n,s,l,o,f){const d=this.manageRpc.at(s.path)?.conflation?.has(s.method)?`${n}\0${s.method}`:void 0;let p=!1;if(d){const G=this.conflatable.get(d);G&&(G.supersede(),p=!0)}const g=this.executionWaiting.get(n)??0,v=this.manageRpc.at(s.path)?.mailbox??Wb;if(!p&&g>=v){await this.sendError(s.id,l,"Busy",`${s.path}.${s.method} was not queued: ${g} calls are already waiting on this instance`);return}const k=this.manageRpc.at(s.path)?.generation;let b=!1;const _=d?{supersede:()=>{b=!0,this.sendError(s.id,l,"Superseded",`${s.path}.${s.method} was superseded by a newer call before it ran`).catch(()=>{})}}:void 0;d&&_&&this.conflatable.set(d,_),this.executionWaiting.set(n,g+1),await this.serialise(n,async()=>{const G=this.executionWaiting.get(n)??1;if(G<=1?this.executionWaiting.delete(n):this.executionWaiting.set(n,G-1),d&&this.conflatable.get(d)===_&&this.conflatable.delete(d),!b){if(this.manageRpc.at(s.path)?.generation!==k){await this.sendError(s.id,l,"OwnershipChanged",`${s.path}.${s.method} was queued against an instance that has since been retired, so it certainly did not run`);return}await this.invoke(s,l,o,f)}})}executionWaiting=new Map;conflatable=new Map;async invoke(n,s,l,o){const f=this.expiredBy(n,l);if(f!==void 0){await this.sendError(n.id,s,"Timeout",`${n.path}.${n.method} was not run: its caller stopped waiting ${f} ms ago`);return}const d=this.authorityRefusal(n,s);if(d){await this.sendError(n.id,s,"NotInControl",d);return}const p=this.fenceRefusal(n);if(p){await this.sendError(n.id,s,"OwnershipChanged",p);return}const g=this.invocationFor(n,s);let v=!1;if(g){let _;try{_=await this.idempotency.begin(g)}catch(G){await this.sendError(n.id,s,"UnknownOutcome",`${n.path}.${n.method} was not run: its idempotency store could not be reached (${G instanceof Error?G.message:String(G)})`);return}if(_==="in-progress"){this.inFlightRequests.delete(n.id);return}if(_!=="acquired"){const G=I0(_)?{type:ge.error,id:n.id,code:_.code,error:_.error}:{type:ge.success,id:n.id,result:_.result};await this.respond(n.id,s,G,G.type===ge.error?Oe.ErrorMessage:Oe.ResponseMessage);return}v=!0}const k=[...n.params];if(this.manageRpc.at(n.path)?.injection?.has(n.method)){for(;k.length<o.length-1;)k.push(void 0);const _=Object.freeze({[db]:!0,defer:()=>{const G=Date.now()+hb,V=pb(n.id,G,(J,F,M)=>{J!=="progress"&&this.deferrals.delete(n.id),this.sendPayload({type:ge.ticket,id:n.id,outcome:J,value:F,...M?{error:va(M)}:{}},Oe.ResponseMessage,this.name,s).catch(Y=>this.emit("deliveryError",{target:s,id:n.id,error:Y}))});return this.deferrals.set(n.id,{peer:s,deferred:V}),V},context:Object.freeze({requestId:n.id,source:s,...this.resolveIdentity?.(s)?{identity:this.resolveIdentity(s)}:{},...n.ttl!==void 0?{ttl:n.ttl}:{},...n.idempotencyKey?{idempotencyKey:n.idempotencyKey}:{}})});k.push(_)}let b;try{b=await o(...k);const _=this.checkResult(n,b);if(_){await this.settle(g,v,{code:"InvalidParams",error:{name:"RpcError",message:_}}),await this.sendError(n.id,s,"InvalidParams",_);return}await this.settle(g,v,{result:b});const G=this.deferrals.has(n.id),V=G?{id:n.id,expiresAt:b?.expiresAt}:b;await this.respond(n.id,s,{type:ge.success,id:n.id,result:V,...G?{deferred:!0}:{}},Oe.ResponseMessage)}catch(_){const G=Pb(_);await this.settle(g,v,{code:G,error:va(_)}),await this.respond(n.id,s,{type:ge.error,id:n.id,code:G,error:va(_)},Oe.ErrorMessage)}}async settle(n,s,l){if(!(!n||!s))try{await this.idempotency.complete(n,l)}catch(o){this.emit("idempotencyError",{invocation:n,outcome:l,error:o})}}invocationFor(n,s){if(!(!this.idempotency||this.semanticsOf(n)!=="non-repeatable-command"))return{idempotencyKey:n.idempotencyKey??n.id,requestId:n.id,scope:`${n.path}.${n.method}`,source:s,...n.ttl!==void 0?{ttl:n.ttl}:{}}}pathWriteRefusal(n){if(!(this.allowStatePathWrites||this.setsOf(n)!=="*"))return`${n.path}.${n.method} sets any path, which this host does not accept - it is enabled with allowStatePathWrites, and gated by authorize() like any call`}authorityRefusal(n,s){if(!this.manageRpc.at(n.path)?.authority?.has(n.method))return;const l=this.manageRpc.instanceAt(n.path);if(!(l instanceof ei))return;const o=_b(l),f=o.holder!==void 0&&(o.expiresAt??0)>Date.now();if(!(f&&o.holder===s))return f?`${n.path}.${n.method} requires authority: ${o.holder} is in control`:`${n.path}.${n.method} requires authority: nobody is in control - $acquire it first`}fenceRefusal(n){const s=n.fence;if(!s)return;const l=this.hostTopology?.get(n.path);if(!l)return`${n.path} has no topology record here to check the owner fence against`;if(l.ownerEpoch!==s.ownerEpoch)return`${n.path} changed owner generation while this call was on its way - read the topology again and decide again`}semanticsOf(n){return this.manageRpc.at(n.path)?.semantics?.get(n.method)??this.schema?.namespaces[n.path]?.methods[n.method]?.semantics}effectOf(n){const s=this.manageRpc.at(n.path)?.effect?.get(n.method)??this.schema?.namespaces[n.path]?.methods[n.method]?.effect;if(s)return s;const l=n.path===ps?tw.get(n.method):ew.get(n.method);return l||(this.semanticsOf(n)==="query"?"observe":"operate")}setsOf(n){return this.manageRpc.at(n.path)?.sets?.get(n.method)??this.schema?.namespaces[n.path]?.methods[n.method]?.sets}publishedSetsOf(n){const s=this.setsOf(n);return s==="*"&&!this.allowStatePathWrites?void 0:s}executionKey(n,s){const l=this.manageRpc.at(n.path)?.execution;if(!l){const f=this.semanticsOf(n);return f==="idempotent-command"||f==="non-repeatable-command"?n.path:void 0}if(l==="parallel")return;if(l==="serial")return n.path;const o={identity:this.resolveIdentity?.(s),source:s,instanceName:n.path,method:n.method,params:n.params,subscription:!1};try{return`${n.path}\0${l(o)}`}catch{return n.path}}executionQueues=new Map;async serialise(n,s){const l=this.executionQueues.get(n)??Promise.resolve();let o;const f=new Promise(p=>o=p),d=l.then(()=>f);this.executionQueues.set(n,d),await l;try{return await s()}finally{o(),this.executionQueues.get(n)===d&&this.executionQueues.delete(n)}}expiredBy(n,s){if(!this.refuseExpiredCalls||n.ttl===void 0||!Number.isFinite(n.ttl)||n.ttl<0)return;const l=Date.now()-(s+n.ttl);return l>0?l:void 0}checkRows(n,s){if(!this.validateResults||!n?.row)return;const l=s?.data;if(Array.isArray(l))for(const[o,f]of l.entries()){const d=Ft(f,n.row,this.schema?.types,"row");if(d)return`${n.path.join(".")} served a row its own declared type forbids (row ${o}): ${d}`}}checkResult(n,s){if(!this.validateResults||!this.schema)return;const l=this.schema.namespaces[n.path]?.methods[n.method]?.returns;if(!l)return;const o=Ft(s,l,this.schema.types,"result");return o?`${n.path}.${n.method} returned a value its own schema forbids: ${o}`:void 0}sendError(n,s,l,o){return this.respond(n,s,{type:ge.error,id:n,code:l,error:{name:"RpcError",message:o}},Oe.ErrorMessage)}removePeer(n){for(const[s,l]of this.eventProxies)l.target===n&&(l.detach(),this.eventProxies.delete(s));this.abandonFor(n)}async sendEvent(n,s,l,o){const f=o?this.eventSequenceOf(o,s):void 0;return await this.sendPayload({type:ge.event,event:s,params:l,path:o,...f!==void 0?{seq:f,epoch:this.epoch}:{}},Oe.EventMessage,this.name,n)}}class sw{logger;namespaces=new Map;exposedClasses={};record(n){let s=this.namespaces.get(n);return s||(s={methods:new Map,generation:this.retired.get(n)??0},this.namespaces.set(n,s)),s}withdraw(n){const s=this.namespaces.get(n);if(s?.instance)return this.namespaces.delete(n),this.retired.set(n,s.generation+1),s.generation}retired=new Map;at(n){return this.namespaces.get(n)}instanceAt(n){return this.namespaces.get(n)?.instance}componentContractFor;constructor(n){this.logger=n}exposeManagement(){this.getNameSpaceMethodMap("manageRpc").set("createRpcInstance",(...s)=>this.createRpcInstance(s[0],s[1],...s.slice(2))),this.record("manageRpc").instance=this}getNameSpaceMethodMap(n){return this.record(n).methods}findNameSpaceMethodMap(n){return this.namespaces.get(n)?.methods}requireExplicitExposure=!1;exposeClassInstance(n,s,l){const o=ry(n),f=s??o?.name;if(!f)throw new Error(`exposeClassInstance: ${n.constructor.name} declares no @rpcNamespace, so a name is required`);const d=typeof l=="number"?{prototypeSteps:l}:l??{};let p=d.prototypeSteps;const g=tb(n);if(!g&&this.requireExplicitExposure)throw new Error(`exposeClassInstance: ${n.constructor.name} marks no @rpc methods and requireExplicitExposure is on`);const v=this.namespaces.get(f)?.instance;if(v&&v!==n&&d.replace!==!0)throw new Error(`exposeClassInstance: ${f} is already exposed by ${v.constructor?.name??"another instance"}; pass { replace: true } to displace it deliberately`);v&&v!==n&&(this.record(f).generation+=1),this.record(f).instance=n;const k=d.execution??o?.execution;k&&(this.record(f).execution=k);const b=nb(n);b.size&&(this.record(f).semantics=b);const _=ib(n);_.size&&(this.record(f).effect=_);const G=sb(n);if(G.size){if(!(n instanceof ei))throw new Error(`exposeClassInstance: ${f}.${[...G.keys()][0]} declares sets, but ${n.constructor.name} is not an RpcComponent - there is no state for a path to name`);for(const[A,$]of G)if(b.get(A)==="query")throw new Error(`exposeClassInstance: ${f}.${A} declares sets '${$}' with 'query' semantics - a method that changes state is not a query`);this.record(f).sets=G}const V=ab(n);if(V.size){for(const A of V)if(b.get(A)!=="idempotent-command")throw new Error(`exposeClassInstance: ${f}.${A} declares conflate without 'idempotent-command' semantics - only a command that is free to repeat is free to skip`);this.record(f).conflation=V}const J=rb(n);if(J.size){if(!(n instanceof ei))throw new Error(`exposeClassInstance: ${f}.${[...J][0]} declares requiresAuthority, but ${n.constructor.name} is not an RpcComponent - there is no authority to check against`);this.record(f).authority=J}const F=lb(n);F.size&&(this.record(f).injection=F),d.lifetime&&(this.record(f).lifetime=d.lifetime);const M=d.mailbox??o?.mailbox;if(M!==void 0){if(!Number.isInteger(M)||M<1)throw new Error(`exposeClassInstance: ${f} declares a mailbox of ${M}; the bound is a positive count of waiting calls`);this.record(f).mailbox=M}if(n instanceof ei){const A=this.componentContractFor?.(f);A&&Mb(n,($,z)=>Ft($,A.component.props,A.types,"props")??Ft(z,A.component.state,A.types,"state")),Cb(n,d.component??{},()=>{n.emit(Jt,Oa(n))},this.logger)}let Y=Object.getOwnPropertyNames(n.constructor.prototype),Z=Object.getPrototypeOf(n.constructor.prototype);for(;Z&&Z.constructor.name!=="Object"&&Z.constructor.name!=="EventEmitter";){const A=Object.getOwnPropertyNames(Z);if(Y=Y.concat(A),Z=Object.getPrototypeOf(Z),p&&p--===0)break}const S=this.getNameSpaceMethodMap(f);for(const A of Y)A==="constructor"||typeof n[A]!="function"||g&&!g.has(A)||S.set(A,n[A].bind(n))}exposeClass(n,s){let l=n.name;s&&(l=s),this.exposedClasses[l]=n}exposeObject(n,s){this.record(s).instance=n;const l=Object.getOwnPropertyNames(n);for(const o of l)o!=="constructor"&&typeof n[o]=="function"&&this.getNameSpaceMethodMap(s).set(o,n[o])}expose(n,s){this.getNameSpaceMethodMap(n).set(n,s)}async createRpcInstance(n,s,...l){let o="";const f=this.exposedClasses[n];if(f){const d=s||et(),p=new f(...l);this.record(d).created=!0,this.exposeClassInstance(p,d),o=d}return o}}const yy=1e4,sl=(a,n,s)=>`${a}\0${n}\0${s}`;class ba extends Error{code;remoteStack;constructor(n,s,l){super(s?`${n}: ${s}`:n),this.code=n,this.remoteStack=l,this.name="RpcError"}}function aw(a){return a.type===ge.ticket}function rw(a){return a.type===ge.success}function lw(a){return a.type===ge.event}function ow(a){return a.type===ge.error}class cw extends iy{callTimeout;responsePromiseMap=new Map;tickets=new gb;responseTimeoutMap=new Map;schemaVersions;batchCalls=!0;maxBatchCalls=64;outbound=new Map;flushQueued=!1;enqueueCall(n,s){return this.batchCalls?new Promise((l,o)=>{const f=s??"",d=this.outbound.get(f);d?d.push({payload:n,settled:{resolve:l,reject:o}}):this.outbound.set(f,[{payload:n,settled:{resolve:l,reject:o}}]),!this.flushQueued&&(this.flushQueued=!0,queueMicrotask(()=>this.flushCalls()))}):this.sendPayload(n,Oe.RequestMessage,this.name,s)}flushCalls(){this.flushQueued=!1;const n=[...this.outbound.entries()];this.outbound.clear();const s=Math.max(1,this.maxBatchCalls);for(const[l,o]of n){const f=l===""?void 0:l;for(let d=0;d<o.length;d+=s){const p=o.slice(d,d+s),g=p.length===1?p[0].payload:{type:ge.batch,payloads:p.map(v=>v.payload)};this.sendPayload(g,Oe.RequestMessage,this.name,f).then(()=>p.forEach(v=>v.settled.resolve()),v=>p.forEach(k=>k.settled.reject(v)))}}}subscriptions=new Map;eventEmitter=new It.EventEmitter;constructor(n,s,l=yy){super(n,s),this.callTimeout=l}async receive(n,s,l){const o=n.payload;if(o){if(lw(o)){this.deliverEvent(o,s);return}if(aw(o)){if(!s)return;const f=this.tickets.deliver(o.id,s,o.outcome,o.value,o.error);!f&&this.responsePromiseMap.has(o.id)?this.tickets.holdEarly(o.id,s,o.outcome,o.value,o.error):f||this.emit("ticketRefused",{id:o.id,from:s});return}if(rw(o)){const f=this.takePending(o.id);if(!f)return;const d=o.deferred?o.result:void 0;f.resolve(d&&s?this.tickets.open(d.id,s,d.expiresAt):o.result);return}ow(o)&&this.takePending(o.id)?.reject(new ba(o.code,o.error?.message,o.error?.stack))}}lastDeliveredStamp;deliverEvent(n,s){this.lastDeliveredStamp=n.seq!==void 0&&n.epoch?{peer:s??"",...n.path?{namespace:n.path}:{},event:n.event,seq:n.seq,epoch:n.epoch}:void 0;const l=this.eventEmitter;if(l instanceof It.EventEmitter){const o=s??"",f=n.path?[sl(o,n.path,n.event),sl("",n.path,n.event)]:l.eventNames().filter(d=>typeof d=="string").filter(d=>{const[p,,g]=d.split("\0");return g===n.event&&(p===o||p==="")});for(const d of new Set(f))this.deliverSafely(()=>l.emit(d,...n.params),n)}this.deliverSafely(()=>this.emit(n.event,n.params),n)}deliverSafely(n,s){try{n()}catch(l){this.emit("subscriberError",{event:s.event,path:s.path,error:l})}}async resubscribe(){const n=[...this.subscriptions.values()],s=await Promise.allSettled(n.map(o=>o.projection===void 0?this.call(o.remote,o.instanceName,"on",o.event):this.call(o.remote,o.instanceName,"on",o.event,o.projection))),l=s.flatMap((o,f)=>o.status==="rejected"?[{peer:n[f].remote,namespace:n[f].instanceName,event:n[f].event,error:o.reason}]:[]);return l.length&&this.emit("resubscribeFailed",l),s.length-l.length}failPendingCalls(n){for(const s of[...this.responsePromiseMap.keys()]){const l=this.sentRequests.has(s);this.sentRequests.delete(s),this.takePending(s)?.reject(l?new ba("UnknownOutcome",`${n}, after the request was sent - it may or may not have run`):new ba("TransportError",`${n}, before the request was sent`))}}sentRequests=new Set;takePending(n){if(n===void 0)return;const s=this.responsePromiseMap.get(n);this.responsePromiseMap.delete(n),this.sentRequests.delete(n);const l=this.responseTimeoutMap.get(n);return l!==void 0&&(clearTimeout(l),this.responseTimeoutMap.delete(n)),s}call(n,s,l,...o){return this.callWith({},n,s,l,...o)}callWith(n,s,l,o,...f){const d=n.timeoutMs??this.callTimeout;if(!Number.isInteger(d)||d<0)return Promise.reject(new Error(`${l}.${o}: timeoutMs must be a finite non-negative integer, not ${String(n.timeoutMs)}`));const p={id:et(),type:ge.CallInstanceMethod,path:l,method:o,params:f,version:this.schemaVersions?.[l],ttl:d>0?d:void 0,...n.idempotencyKey?{idempotencyKey:n.idempotencyKey}:{},...n.ownerEpoch?{fence:{ownerEpoch:n.ownerEpoch}}:{}};return new Promise((g,v)=>{this.responsePromiseMap.set(p.id,{resolve:g,reject:v}),d>0&&this.responseTimeoutMap.set(p.id,setTimeout(()=>{this.takePending(p.id)?.reject(new ba("Timeout",`no response to ${l}.${o} within ${d} ms`))},d)),this.enqueueCall(p,s).then(()=>{this.responsePromiseMap.has(p.id)&&this.sentRequests.add(p.id)},k=>{this.takePending(p.id)?.reject(new ba("TransportError",k instanceof Error?k.message:String(k)))})})}proxy(n,s,l={}){const o={};return new Proxy(o,{get:(f,d)=>{let p;if(typeof d=="string"){if(f[d])return f[d];if(d==="then")return;d==="$with"?f[d]=g=>this.proxy(n,s,{...l,...g}):W0(d)?f[d]=(...g)=>{const v=g[0];if(typeof v=="string"){const k=sl(s??"",n,v);if(this.eventEmitter[d](k,...g.slice(1)),d==="on")this.subscriptions.set(k,{remote:s,instanceName:n,event:v,projection:g[2]});else if(d==="off"||d==="removeListener"){if(this.eventEmitter.listenerCount(k)>0)return Promise.resolve("ok - other local handlers remain");this.subscriptions.delete(k)}}else this.eventEmitter[d](...g);return d==="on"&&g[2]!==void 0?this.call(s,n,d,g[0],g[2]):this.call(s,n,d,g[0])}:f[d]=(...g)=>this.callWith(l,s,n,d,...g),p=f[d]}return p}})}}const gy=Symbol("@source-repo/rpc/component");class uw{namespace;target;release;projection;view={epoch:"",revision:-1,props:Object.freeze({}),state:Object.freeze({}),status:"initializing",receivedAt:0};users=0;inner;store;first;listeners=new Set;retired=new Set;settleFirst;handler=n=>this.accept(n);constructor(n,s,l,o,f){this.namespace=s,this.target=l,this.release=o,this.projection=f,this.inner=n.proxy(s,l),this.first=new Promise(d=>this.settleFirst=d),this.store={getSnapshot:()=>this.view,subscribe:d=>(this.listeners.add(d),()=>this.listeners.delete(d)),close:()=>this.close()}}async open(){await this.inner.on(Jt,this.handler,this.projection),await this.first}accept(n){this.view.status!=="closed"&&(this.retired.has(n.epoch)||this.view.epoch===n.epoch&&n.revision<=this.view.revision||(this.view.epoch&&this.view.epoch!==n.epoch&&this.retired.add(this.view.epoch),this.view={...n,status:"live",receivedAt:Date.now()},this.settleFirst(),this.notify()))}markStale(){this.view.status==="live"&&(this.view={...this.view,status:"stale",staleSince:Date.now()},this.notify())}async close(){this.users>0&&this.users--,!(this.users>0)&&(this.view={...this.view,status:"closed"},this.notify(),this.release(),await this.inner.off(Jt,this.handler).catch(()=>{}))}markClosed(){this.view.status!=="closed"&&(this.view={...this.view,status:"closed"},this.notify())}notify(){for(const n of[...this.listeners])try{n()}catch{}}}const fw=(a,n)=>!a||!n?a===n:a.length!==n.length?!1:a.every((s,l)=>JSON.stringify(s)===JSON.stringify(n[l])),pm=a=>a?a.map(n=>tu(n)?`${n.path.join(".")}[${n.offset??0}..${n.limit===void 0?"":(n.offset??0)+n.limit}]`:n.join(".")).join(", "):"the whole snapshot";class dw{handler;channels=new Map;constructor(n,s){this.handler=n,s.on(ve.disconnected,()=>{for(const l of this.channels.values())l.markStale()});for(const l of[ve.peerGone,ve.peerDisplaced])s.on(l,o=>{for(const f of this.channels.values())f.target===o&&f.markStale()})}async open(n,s,l){const o=`${s??""}\0${n}`;let f=this.channels.get(o);if(f&&!fw(f.projection,l))throw new Error(`component: ${n}${s?` on ${s}`:""} is already observed here with a different projection (${pm(f.projection)} against ${pm(l)}) - one peer holds one subscription per component`);if(f)await f.first;else{f=new uw(this.handler,n,s,()=>{this.channels.delete(o)},l),this.channels.set(o,f);try{await f.open()}catch(d){throw this.channels.delete(o),d}}return f.users++,f}closeAll(){for(const n of this.channels.values())n.markClosed();this.channels.clear()}}const vy=(a,n)=>new Proxy(n,{get:(s,l)=>l==="props"?a.view.props:l==="state"?a.view.state:l===gy?a.store:l==="$with"?o=>vy(a,n.$with(o)):s[l],set:(s,l,o)=>{if(l==="props"||l==="state")throw new TypeError(`${String(l)} is read-only on a component proxy - call a method to change the world`);return s[l]=o,!0}}),on=Object.create(null);on.open="0";on.close="1";on.ping="2";on.pong="3";on.message="4";on.upgrade="5";on.noop="6";const al=Object.create(null);Object.keys(on).forEach(a=>{al[on[a]]=a});const su={type:"error",data:"parser error"},by=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",wy=typeof ArrayBuffer=="function",xy=a=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(a):a&&a.buffer instanceof ArrayBuffer,yu=({type:a,data:n},s,l)=>by&&n instanceof Blob?s?l(n):mm(n,l):wy&&(n instanceof ArrayBuffer||xy(n))?s?l(n):mm(new Blob([n]),l):l(on[a]+(n||"")),mm=(a,n)=>{const s=new FileReader;return s.onload=function(){const l=s.result.split(",")[1];n("b"+(l||""))},s.readAsDataURL(a)};function ym(a){return a instanceof Uint8Array?a:a instanceof ArrayBuffer?new Uint8Array(a):new Uint8Array(a.buffer,a.byteOffset,a.byteLength)}let Gc;function hw(a,n){if(by&&a.data instanceof Blob)return a.data.arrayBuffer().then(ym).then(n);if(wy&&(a.data instanceof ArrayBuffer||xy(a.data)))return n(ym(a.data));yu(a,!1,s=>{Gc||(Gc=new TextEncoder),n(Gc.encode(s))})}const gm="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Aa=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let a=0;a<gm.length;a++)Aa[gm.charCodeAt(a)]=a;const pw=a=>{let n=a.length*.75,s=a.length,l,o=0,f,d,p,g;a[a.length-1]==="="&&(n--,a[a.length-2]==="="&&n--);const v=new ArrayBuffer(n),k=new Uint8Array(v);for(l=0;l<s;l+=4)f=Aa[a.charCodeAt(l)],d=Aa[a.charCodeAt(l+1)],p=Aa[a.charCodeAt(l+2)],g=Aa[a.charCodeAt(l+3)],k[o++]=f<<2|d>>4,k[o++]=(d&15)<<4|p>>2,k[o++]=(p&3)<<6|g&63;return v},mw=typeof ArrayBuffer=="function",gu=(a,n)=>{if(typeof a!="string")return{type:"message",data:Sy(a,n)};const s=a.charAt(0);return s==="b"?{type:"message",data:yw(a.substring(1),n)}:al[s]?a.length>1?{type:al[s],data:a.substring(1)}:{type:al[s]}:su},yw=(a,n)=>{if(mw){const s=pw(a);return Sy(s,n)}else return{base64:!0,data:a}},Sy=(a,n)=>n==="blob"?a instanceof Blob?a:new Blob([a]):a instanceof ArrayBuffer?a:a.buffer,Ey="",gw=(a,n)=>{const s=a.length,l=new Array(s);let o=0;a.forEach((f,d)=>{yu(f,!1,p=>{l[d]=p,++o===s&&n(l.join(Ey))})})},vw=(a,n)=>{const s=a.split(Ey),l=[];for(let o=0;o<s.length;o++){const f=gu(s[o],n);if(l.push(f),f.type==="error")break}return l};function bw(){return new TransformStream({transform(a,n){hw(a,s=>{const l=s.length;let o;if(l<126)o=new Uint8Array(1),new DataView(o.buffer).setUint8(0,l);else if(l<65536){o=new Uint8Array(3);const f=new DataView(o.buffer);f.setUint8(0,126),f.setUint16(1,l)}else{o=new Uint8Array(9);const f=new DataView(o.buffer);f.setUint8(0,127),f.setBigUint64(1,BigInt(l))}a.data&&typeof a.data!="string"&&(o[0]|=128),n.enqueue(o),n.enqueue(s)})}})}let Vc;function el(a){return a.reduce((n,s)=>n+s.length,0)}function tl(a,n){if(a[0].length===n)return a.shift();const s=new Uint8Array(n);let l=0;for(let o=0;o<n;o++)s[o]=a[0][l++],l===a[0].length&&(a.shift(),l=0);return a.length&&l<a[0].length&&(a[0]=a[0].slice(l)),s}function ww(a,n){Vc||(Vc=new TextDecoder);const s=[];let l=0,o=-1,f=!1;return new TransformStream({transform(d,p){for(s.push(d);;){if(l===0){if(el(s)<1)break;const g=tl(s,1);f=(g[0]&128)===128,o=g[0]&127,o<126?l=3:o===126?l=1:l=2}else if(l===1){if(el(s)<2)break;const g=tl(s,2);o=new DataView(g.buffer,g.byteOffset,g.length).getUint16(0),l=3}else if(l===2){if(el(s)<8)break;const g=tl(s,8),v=new DataView(g.buffer,g.byteOffset,g.length),k=v.getUint32(0);if(k>Math.pow(2,21)-1){p.enqueue(su);break}o=k*Math.pow(2,32)+v.getUint32(4),l=3}else{if(el(s)<o)break;const g=tl(s,o);p.enqueue(gu(f?g:Vc.decode(g),n)),l=0}if(o===0||o>a){p.enqueue(su);break}}}})}const ky=4;function Ie(a){if(a)return xw(a)}function xw(a){for(var n in Ie.prototype)a[n]=Ie.prototype[n];return a}Ie.prototype.on=Ie.prototype.addEventListener=function(a,n){return this._callbacks=this._callbacks||{},(this._callbacks["$"+a]=this._callbacks["$"+a]||[]).push(n),this};Ie.prototype.once=function(a,n){function s(){this.off(a,s),n.apply(this,arguments)}return s.fn=n,this.on(a,s),this};Ie.prototype.off=Ie.prototype.removeListener=Ie.prototype.removeAllListeners=Ie.prototype.removeEventListener=function(a,n){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var s=this._callbacks["$"+a];if(!s)return this;if(arguments.length==1)return delete this._callbacks["$"+a],this;for(var l,o=0;o<s.length;o++)if(l=s[o],l===n||l.fn===n){s.splice(o,1);break}return s.length===0&&delete this._callbacks["$"+a],this};Ie.prototype.emit=function(a){this._callbacks=this._callbacks||{};for(var n=new Array(arguments.length-1),s=this._callbacks["$"+a],l=1;l<arguments.length;l++)n[l-1]=arguments[l];if(s){s=s.slice(0);for(var l=0,o=s.length;l<o;++l)s[l].apply(this,n)}return this};Ie.prototype.emitReserved=Ie.prototype.emit;Ie.prototype.listeners=function(a){return this._callbacks=this._callbacks||{},this._callbacks["$"+a]||[]};Ie.prototype.hasListeners=function(a){return!!this.listeners(a).length};const yl=typeof Promise=="function"&&typeof Promise.resolve=="function"?n=>Promise.resolve().then(n):(n,s)=>s(n,0),Gt=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),Sw="arraybuffer";function Ty(a,...n){return n.reduce((s,l)=>(a.hasOwnProperty(l)&&(s[l]=a[l]),s),{})}const Ew=Gt.setTimeout,kw=Gt.clearTimeout;function gl(a,n){n.useNativeTimers?(a.setTimeoutFn=Ew.bind(Gt),a.clearTimeoutFn=kw.bind(Gt)):(a.setTimeoutFn=Gt.setTimeout.bind(Gt),a.clearTimeoutFn=Gt.clearTimeout.bind(Gt))}const Tw=1.33;function Aw(a){return typeof a=="string"?_w(a):Math.ceil((a.byteLength||a.size)*Tw)}function _w(a){let n=0,s=0;for(let l=0,o=a.length;l<o;l++)n=a.charCodeAt(l),n<128?s+=1:n<2048?s+=2:n<55296||n>=57344?s+=3:(l++,s+=4);return s}function Ay(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function jw(a){let n="";for(let s in a)a.hasOwnProperty(s)&&(n.length&&(n+="&"),n+=encodeURIComponent(s)+"="+encodeURIComponent(a[s]));return n}function Nw(a){let n={},s=a.split("&");for(let l=0,o=s.length;l<o;l++){let f=s[l].split("=");n[decodeURIComponent(f[0])]=decodeURIComponent(f[1])}return n}class Ow extends Error{constructor(n,s,l){super(n),this.description=s,this.context=l,this.type="TransportError"}}class vu extends Ie{constructor(n){super(),this.writable=!1,gl(this,n),this.opts=n,this.query=n.query,this.socket=n.socket,this.supportsBinary=!n.forceBase64}onError(n,s,l){return super.emitReserved("error",new Ow(n,s,l)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(n){this.readyState==="open"&&this.write(n)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(n){const s=gu(n,this.socket.binaryType);this.onPacket(s)}onPacket(n){super.emitReserved("packet",n)}onClose(n){this.readyState="closed",super.emitReserved("close",n)}pause(n){}createUri(n,s={}){return n+"://"+this._hostname()+this._port()+this.opts.path+this._query(s)}_hostname(){const n=this.opts.hostname;return n.indexOf(":")===-1?n:"["+n+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(n){const s=jw(n);return s.length?"?"+s:""}}class Rw extends vu{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(n){this.readyState="pausing";const s=()=>{this.readyState="paused",n()};if(this._polling||!this.writable){let l=0;this._polling&&(l++,this.once("pollComplete",function(){--l||s()})),this.writable||(l++,this.once("drain",function(){--l||s()}))}else s()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(n){const s=l=>{if(this.readyState==="opening"&&l.type==="open"&&this.onOpen(),l.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(l)};vw(n,this.socket.binaryType).forEach(s),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const n=()=>{this.write([{type:"close"}])};this.readyState==="open"?n():this.once("open",n)}write(n){this.writable=!1,gw(n,s=>{this.doWrite(s,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const n=this.opts.secure?"https":"http",s=this.query||{};return this.opts.timestampRequests!==!1&&(s[this.opts.timestampParam]=Ay()),!this.supportsBinary&&!s.sid&&(s.b64=1),this.createUri(n,s)}}let _y=!1;try{_y=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Mw=_y;function Cw(){}class zw extends Rw{constructor(n){if(super(n),typeof location<"u"){const s=location.protocol==="https:";let l=location.port;l||(l=s?"443":"80"),this.xd=typeof location<"u"&&n.hostname!==location.hostname||l!==n.port}}doWrite(n,s){const l=this.request({method:"POST",data:n});l.on("success",s),l.on("error",(o,f)=>{this.onError("xhr post error",o,f)})}doPoll(){const n=this.request();n.on("data",this.onData.bind(this)),n.on("error",(s,l)=>{this.onError("xhr poll error",s,l)}),this.pollXhr=n}}class ln extends Ie{constructor(n,s,l){super(),this.createRequest=n,gl(this,l),this._opts=l,this._method=l.method||"GET",this._uri=s,this._data=l.data!==void 0?l.data:null,this._create()}_create(){var n;const s=Ty(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");s.xdomain=!!this._opts.xd;const l=this._xhr=this.createRequest(s);try{l.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){l.setDisableHeaderCheck&&l.setDisableHeaderCheck(!0);for(let o in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(o)&&l.setRequestHeader(o,this._opts.extraHeaders[o])}}catch{}if(this._method==="POST")try{l.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{l.setRequestHeader("Accept","*/*")}catch{}(n=this._opts.cookieJar)===null||n===void 0||n.addCookies(l),"withCredentials"in l&&(l.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(l.timeout=this._opts.requestTimeout),l.onreadystatechange=()=>{var o;l.readyState===3&&((o=this._opts.cookieJar)===null||o===void 0||o.parseCookies(l.getResponseHeader("set-cookie"))),l.readyState===4&&(l.status===200||l.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof l.status=="number"?l.status:0)},0))},l.send(this._data)}catch(o){this.setTimeoutFn(()=>{this._onError(o)},0);return}typeof document<"u"&&(this._index=ln.requestsCount++,ln.requests[this._index]=this)}_onError(n){this.emitReserved("error",n,this._xhr),this._cleanup(!0)}_cleanup(n){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=Cw,n)try{this._xhr.abort()}catch{}typeof document<"u"&&delete ln.requests[this._index],this._xhr=null}}_onLoad(){const n=this._xhr.responseText;n!==null&&(this.emitReserved("data",n),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}ln.requestsCount=0;ln.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",vm);else if(typeof addEventListener=="function"){const a="onpagehide"in Gt?"pagehide":"unload";addEventListener(a,vm,!1)}}function vm(){for(let a in ln.requests)ln.requests.hasOwnProperty(a)&&ln.requests[a].abort()}const Uw=(function(){const a=jy({xdomain:!1});return a&&a.responseType!==null})();class Dw extends zw{constructor(n){super(n);const s=n&&n.forceBase64;this.supportsBinary=Uw&&!s}request(n={}){return Object.assign(n,{xd:this.xd},this.opts),new ln(jy,this.uri(),n)}}function jy(a){const n=a.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!n||Mw))return new XMLHttpRequest}catch{}if(!n)try{return new Gt[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Ny=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Bw extends vu{get name(){return"websocket"}doOpen(){const n=this.uri(),s=this.opts.protocols,l=Ny?{}:Ty(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(l.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(n,s,l)}catch(o){return this.emitReserved("error",o)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=n=>this.onClose({description:"websocket connection closed",context:n}),this.ws.onmessage=n=>this.onData(n.data),this.ws.onerror=n=>this.onError("websocket error",n)}write(n){this.writable=!1;for(let s=0;s<n.length;s++){const l=n[s],o=s===n.length-1;yu(l,this.supportsBinary,f=>{try{this.doWrite(l,f)}catch{}o&&yl(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const n=this.opts.secure?"wss":"ws",s=this.query||{};return this.opts.timestampRequests&&(s[this.opts.timestampParam]=Ay()),this.supportsBinary||(s.b64=1),this.createUri(n,s)}}const Xc=Gt.WebSocket||Gt.MozWebSocket;class qw extends Bw{createSocket(n,s,l){return Ny?new Xc(n,s,l):s?new Xc(n,s):new Xc(n)}doWrite(n,s){this.ws.send(s)}}class $w extends vu{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(n){return this.emitReserved("error",n)}this._transport.closed.then(()=>{this.onClose()}).catch(n=>{this.onError("webtransport error",n)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(n=>{const s=ww(Number.MAX_SAFE_INTEGER,this.socket.binaryType),l=n.readable.pipeThrough(s).getReader(),o=bw();o.readable.pipeTo(n.writable),this._writer=o.writable.getWriter();const f=()=>{l.read().then(({done:p,value:g})=>{p||(this.onPacket(g),f())}).catch(p=>{})};f();const d={type:"open"};this.query.sid&&(d.data=`{"sid":"${this.query.sid}"}`),this._writer.write(d).then(()=>this.onOpen())})})}write(n){this.writable=!1;for(let s=0;s<n.length;s++){const l=n[s],o=s===n.length-1;this._writer.write(l).then(()=>{o&&yl(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var n;(n=this._transport)===null||n===void 0||n.close()}}const Lw={websocket:qw,webtransport:$w,polling:Dw},Hw=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Yw=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function au(a){if(a.length>8e3)throw"URI too long";const n=a,s=a.indexOf("["),l=a.indexOf("]");s!=-1&&l!=-1&&(a=a.substring(0,s)+a.substring(s,l).replace(/:/g,";")+a.substring(l,a.length));let o=Hw.exec(a||""),f={},d=14;for(;d--;)f[Yw[d]]=o[d]||"";return s!=-1&&l!=-1&&(f.source=n,f.host=f.host.substring(1,f.host.length-1).replace(/;/g,":"),f.authority=f.authority.replace("[","").replace("]","").replace(/;/g,":"),f.ipv6uri=!0),f.pathNames=Gw(f,f.path),f.queryKey=Vw(f,f.query),f}function Gw(a,n){const s=/\/{2,9}/g,l=n.replace(s,"/").split("/");return(n.slice(0,1)=="/"||n.length===0)&&l.splice(0,1),n.slice(-1)=="/"&&l.splice(l.length-1,1),l}function Vw(a,n){const s={};return n.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(l,o,f){o&&(s[o]=f)}),s}const ru=typeof addEventListener=="function"&&typeof removeEventListener=="function",rl=[];ru&&addEventListener("offline",()=>{rl.forEach(a=>a())},!1);class ti extends Ie{constructor(n,s){if(super(),this.binaryType=Sw,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,n&&typeof n=="object"&&(s=n,n=null),n){const l=au(n);s.hostname=l.host,s.secure=l.protocol==="https"||l.protocol==="wss",s.port=l.port,l.query&&(s.query=l.query)}else s.host&&(s.hostname=au(s.host).host);gl(this,s),this.secure=s.secure!=null?s.secure:typeof location<"u"&&location.protocol==="https:",s.hostname&&!s.port&&(s.port=this.secure?"443":"80"),this.hostname=s.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=s.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},s.transports.forEach(l=>{const o=l.prototype.name;this.transports.push(o),this._transportsByName[o]=l}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},s),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Nw(this.opts.query)),ru&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},rl.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(n){const s=Object.assign({},this.opts.query);s.EIO=ky,s.transport=n,this.id&&(s.sid=this.id);const l=Object.assign({},this.opts,{query:s,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[n]);return new this._transportsByName[n](l)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const n=this.opts.rememberUpgrade&&ti.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const s=this.createTransport(n);s.open(),this.setTransport(s)}setTransport(n){this.transport&&this.transport.removeAllListeners(),this.transport=n,n.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",s=>this._onClose("transport close",s))}onOpen(){this.readyState="open",ti.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",n),this.emitReserved("heartbeat"),n.type){case"open":this.onHandshake(JSON.parse(n.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const s=new Error("server error");s.code=n.data,this._onError(s);break;case"message":this.emitReserved("data",n.data),this.emitReserved("message",n.data);break}}onHandshake(n){this.emitReserved("handshake",n),this.id=n.sid,this.transport.query.sid=n.sid,this._pingInterval=n.pingInterval,this._pingTimeout=n.pingTimeout,this._maxPayload=n.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const n=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+n,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},n),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const n=this._getWritablePackets();this.transport.send(n),this._prevBufferLen=n.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let s=1;for(let l=0;l<this.writeBuffer.length;l++){const o=this.writeBuffer[l].data;if(o&&(s+=Aw(o)),l>0&&s>this._maxPayload)return this.writeBuffer.slice(0,l);s+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const n=Date.now()>this._pingTimeoutTime;return n&&(this._pingTimeoutTime=0,yl(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),n}write(n,s,l){return this._sendPacket("message",n,s,l),this}send(n,s,l){return this._sendPacket("message",n,s,l),this}_sendPacket(n,s,l,o){if(typeof s=="function"&&(o=s,s=void 0),typeof l=="function"&&(o=l,l=null),this.readyState==="closing"||this.readyState==="closed")return;l=l||{},l.compress=l.compress!==!1;const f={type:n,data:s,options:l};this.emitReserved("packetCreate",f),this.writeBuffer.push(f),o&&this.once("flush",o),this.flush()}close(){const n=()=>{this._onClose("forced close"),this.transport.close()},s=()=>{this.off("upgrade",s),this.off("upgradeError",s),n()},l=()=>{this.once("upgrade",s),this.once("upgradeError",s)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?l():n()}):this.upgrading?l():n()),this}_onError(n){if(ti.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",n),this._onClose("transport error",n)}_onClose(n,s){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),ru&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const l=rl.indexOf(this._offlineEventListener);l!==-1&&rl.splice(l,1)}this.readyState="closed",this.id=null,this.emitReserved("close",n,s),this.writeBuffer=[],this._prevBufferLen=0}}}ti.protocol=ky;class Xw extends ti{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let n=0;n<this._upgrades.length;n++)this._probe(this._upgrades[n])}_probe(n){let s=this.createTransport(n),l=!1;ti.priorWebsocketSuccess=!1;const o=()=>{l||(s.send([{type:"ping",data:"probe"}]),s.once("packet",b=>{if(!l)if(b.type==="pong"&&b.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",s),!s)return;ti.priorWebsocketSuccess=s.name==="websocket",this.transport.pause(()=>{l||this.readyState!=="closed"&&(k(),this.setTransport(s),s.send([{type:"upgrade"}]),this.emitReserved("upgrade",s),s=null,this.upgrading=!1,this.flush())})}else{const _=new Error("probe error");_.transport=s.name,this.emitReserved("upgradeError",_)}}))};function f(){l||(l=!0,k(),s.close(),s=null)}const d=b=>{const _=new Error("probe error: "+b);_.transport=s.name,f(),this.emitReserved("upgradeError",_)};function p(){d("transport closed")}function g(){d("socket closed")}function v(b){s&&b.name!==s.name&&f()}const k=()=>{s.removeListener("open",o),s.removeListener("error",d),s.removeListener("close",p),this.off("close",g),this.off("upgrading",v)};s.once("open",o),s.once("error",d),s.once("close",p),this.once("close",g),this.once("upgrading",v),this._upgrades.indexOf("webtransport")!==-1&&n!=="webtransport"?this.setTimeoutFn(()=>{l||s.open()},200):s.open()}onHandshake(n){this._upgrades=this._filterUpgrades(n.upgrades),super.onHandshake(n)}_filterUpgrades(n){const s=[];for(let l=0;l<n.length;l++)~this.transports.indexOf(n[l])&&s.push(n[l]);return s}}let Kw=class extends Xw{constructor(n,s={}){const l=typeof n=="object",o=l?{...n}:{...s};(!o.transports||o.transports&&typeof o.transports[0]=="string")&&(o.transports=(o.transports||["polling","websocket","webtransport"]).map(f=>Lw[f]).filter(f=>!!f)),super(l?o:n,o)}};function Qw(a,n="",s){let l=a;s=s||typeof location<"u"&&location,a==null&&(a=s.protocol+"//"+s.host),typeof a=="string"&&(a.charAt(0)==="/"&&(a.charAt(1)==="/"?a=s.protocol+a:a=s.host+a),/^(https?|wss?):\/\//.test(a)||(typeof s<"u"?a=s.protocol+"//"+a:a="https://"+a),l=au(a)),l.port||(/^(http|ws)$/.test(l.protocol)?l.port="80":/^(http|ws)s$/.test(l.protocol)&&(l.port="443")),l.path=l.path||"/";const f=l.host.indexOf(":")!==-1?"["+l.host+"]":l.host;return l.id=l.protocol+"://"+f+":"+l.port+n,l.href=l.protocol+"://"+f+(s&&s.port===l.port?"":":"+l.port),l}const Zw=typeof ArrayBuffer=="function",Jw=a=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(a):a.buffer instanceof ArrayBuffer,Oy=Object.prototype.toString,Fw=typeof Blob=="function"||typeof Blob<"u"&&Oy.call(Blob)==="[object BlobConstructor]",Ww=typeof File=="function"||typeof File<"u"&&Oy.call(File)==="[object FileConstructor]";function bu(a){return Zw&&(a instanceof ArrayBuffer||Jw(a))||Fw&&a instanceof Blob||Ww&&a instanceof File}function ll(a,n){if(!a||typeof a!="object")return!1;if(Array.isArray(a)){for(let s=0,l=a.length;s<l;s++)if(ll(a[s]))return!0;return!1}if(bu(a))return!0;if(a.toJSON&&typeof a.toJSON=="function"&&arguments.length===1)return ll(a.toJSON(),!0);for(const s in a)if(Object.prototype.hasOwnProperty.call(a,s)&&ll(a[s]))return!0;return!1}function Iw(a){const n=[],s=a.data,l=a;return l.data=ol(s,n),l.attachments=n.length,{packet:l,buffers:n}}function ol(a,n,s){if(!a)return a;if(bu(a)){const l={_placeholder:!0,num:n.length};return n.push(a),l}else if(Array.isArray(a)){const l=new Array(a.length);for(let o=0;o<a.length;o++)l[o]=ol(a[o],n);return l}else if(typeof a=="object"&&!(a instanceof Date)){if(a.toJSON&&typeof a.toJSON=="function"&&!s)return ol(a.toJSON(),n,!0);const l={};for(const o in a)Object.prototype.hasOwnProperty.call(a,o)&&(l[o]=ol(a[o],n));return l}return a}function Pw(a,n){return a.data=lu(a.data,n),delete a.attachments,a}function lu(a,n){if(!a)return a;if(a&&a._placeholder===!0){if(typeof a.num=="number"&&a.num>=0&&a.num<n.length)return n[a.num];throw new Error("illegal attachments")}else if(Array.isArray(a))for(let s=0;s<a.length;s++)a[s]=lu(a[s],n);else if(typeof a=="object")for(const s in a)Object.prototype.hasOwnProperty.call(a,s)&&(a[s]=lu(a[s],n));return a}const ex=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var Te;(function(a){a[a.CONNECT=0]="CONNECT",a[a.DISCONNECT=1]="DISCONNECT",a[a.EVENT=2]="EVENT",a[a.ACK=3]="ACK",a[a.CONNECT_ERROR=4]="CONNECT_ERROR",a[a.BINARY_EVENT=5]="BINARY_EVENT",a[a.BINARY_ACK=6]="BINARY_ACK"})(Te||(Te={}));let tx=class{constructor(n){this.replacer=n}encode(n){return(n.type===Te.EVENT||n.type===Te.ACK)&&ll(n)?this.encodeAsBinary({type:n.type===Te.EVENT?Te.BINARY_EVENT:Te.BINARY_ACK,nsp:n.nsp,data:n.data,id:n.id}):[this.encodeAsString(n)]}encodeAsString(n){let s=""+n.type;return(n.type===Te.BINARY_EVENT||n.type===Te.BINARY_ACK)&&(s+=n.attachments+"-"),n.nsp&&n.nsp!=="/"&&(s+=n.nsp+","),n.id!=null&&(s+=n.id),n.data!=null&&(s+=JSON.stringify(n.data,this.replacer)),s}encodeAsBinary(n){const s=Iw(n),l=this.encodeAsString(s.packet),o=s.buffers;return o.unshift(l),o}},nx=class Ry extends Ie{constructor(n){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof n=="function"?{reviver:n}:n)}add(n){let s;if(typeof n=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");s=this.decodeString(n);const l=s.type===Te.BINARY_EVENT;l||s.type===Te.BINARY_ACK?(s.type=l?Te.EVENT:Te.ACK,this.reconstructor=new ix(s)):super.emitReserved("decoded",s)}else if(bu(n)||n.base64)if(this.reconstructor)s=this.reconstructor.takeBinaryData(n),s&&(this.reconstructor=null,super.emitReserved("decoded",s));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+n)}decodeString(n){let s=0;const l={type:Number(n.charAt(0))};if(Te[l.type]===void 0)throw new Error("unknown packet type "+l.type);if(l.type===Te.BINARY_EVENT||l.type===Te.BINARY_ACK){const f=s+1;for(;n.charAt(++s)!=="-"&&s!=n.length;);const d=n.substring(f,s);if(d!=Number(d)||n.charAt(s)!=="-")throw new Error("Illegal attachments");const p=Number(d);if(!sx(p)||p<1)throw new Error("Illegal attachments");if(p>this.opts.maxAttachments)throw new Error("too many attachments");l.attachments=p}if(n.charAt(s+1)==="/"){const f=s+1;for(;++s&&!(n.charAt(s)===","||s===n.length););l.nsp=n.substring(f,s)}else l.nsp="/";const o=n.charAt(s+1);if(o!==""&&Number(o)==o){const f=s+1;for(;++s;){const d=n.charAt(s);if(d==null||Number(d)!=d){--s;break}if(s===n.length)break}l.id=Number(n.substring(f,s+1))}if(n.charAt(++s)){const f=this.tryParse(n.substr(s));if(Ry.isPayloadValid(l.type,f))l.data=f;else throw new Error("invalid payload")}return l}tryParse(n){try{return JSON.parse(n,this.opts.reviver)}catch{return!1}}static isPayloadValid(n,s){switch(n){case Te.CONNECT:return bm(s);case Te.DISCONNECT:return s===void 0;case Te.CONNECT_ERROR:return typeof s=="string"||bm(s);case Te.EVENT:case Te.BINARY_EVENT:return Array.isArray(s)&&(typeof s[0]=="number"||typeof s[0]=="string"&&ex.indexOf(s[0])===-1);case Te.ACK:case Te.BINARY_ACK:return Array.isArray(s)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}};class ix{constructor(n){this.packet=n,this.buffers=[],this.reconPack=n}takeBinaryData(n){if(this.buffers.push(n),this.buffers.length===this.reconPack.attachments){const s=Pw(this.reconPack,this.buffers);return this.finishedReconstruction(),s}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const sx=Number.isInteger||function(a){return typeof a=="number"&&isFinite(a)&&Math.floor(a)===a};function bm(a){return Object.prototype.toString.call(a)==="[object Object]"}const ax=Object.freeze(Object.defineProperty({__proto__:null,Decoder:nx,Encoder:tx,get PacketType(){return Te}},Symbol.toStringTag,{value:"Module"}));function Zt(a,n,s){return a.on(n,s),function(){a.off(n,s)}}const rx=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class My extends Ie{constructor(n,s,l){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=n,this.nsp=s,l&&l.auth&&(this.auth=l.auth),this._opts=Object.assign({},l),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const n=this.io;this.subs=[Zt(n,"open",this.onopen.bind(this)),Zt(n,"packet",this.onpacket.bind(this)),Zt(n,"error",this.onerror.bind(this)),Zt(n,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...n){return n.unshift("message"),this.emit.apply(this,n),this}emit(n,...s){var l,o,f;if(rx.hasOwnProperty(n))throw new Error('"'+n.toString()+'" is a reserved event name');if(s.unshift(n),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(s),this;const d={type:Te.EVENT,data:s};if(d.options={},d.options.compress=this.flags.compress!==!1,typeof s[s.length-1]=="function"){const k=this.ids++,b=s.pop();this._registerAckCallback(k,b),d.id=k}const p=(o=(l=this.io.engine)===null||l===void 0?void 0:l.transport)===null||o===void 0?void 0:o.writable,g=this.connected&&!(!((f=this.io.engine)===null||f===void 0)&&f._hasPingExpired());return this.flags.volatile&&!p||(g?(this.notifyOutgoingListeners(d),this.packet(d)):this.sendBuffer.push(d)),this.flags={},this}_registerAckCallback(n,s){var l;const o=(l=this.flags.timeout)!==null&&l!==void 0?l:this._opts.ackTimeout;if(o===void 0){this.acks[n]=s;return}const f=this.io.setTimeoutFn(()=>{delete this.acks[n];for(let p=0;p<this.sendBuffer.length;p++)this.sendBuffer[p].id===n&&this.sendBuffer.splice(p,1);s.call(this,new Error("operation has timed out"))},o),d=(...p)=>{this.io.clearTimeoutFn(f),s.apply(this,p)};d.withError=!0,this.acks[n]=d}emitWithAck(n,...s){return new Promise((l,o)=>{const f=(d,p)=>d?o(d):l(p);f.withError=!0,s.push(f),this.emit(n,...s)})}_addToQueue(n){let s;typeof n[n.length-1]=="function"&&(s=n.pop());const l={id:this._queueSeq++,tryCount:0,pending:!1,args:n,flags:Object.assign({fromQueue:!0},this.flags)};n.push((o,...f)=>(this._queue[0],o!==null?l.tryCount>this._opts.retries&&(this._queue.shift(),s&&s(o)):(this._queue.shift(),s&&s(null,...f)),l.pending=!1,this._drainQueue())),this._queue.push(l),this._drainQueue()}_drainQueue(n=!1){if(!this.connected||this._queue.length===0)return;const s=this._queue[0];s.pending&&!n||(s.pending=!0,s.tryCount++,this.flags=s.flags,this.emit.apply(this,s.args))}packet(n){n.nsp=this.nsp,this.io._packet(n)}onopen(){typeof this.auth=="function"?this.auth(n=>{this._sendConnectPacket(n)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(n){this.packet({type:Te.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},n):n})}onerror(n){this.connected||this.emitReserved("connect_error",n)}onclose(n,s){this.connected=!1,delete this.id,this.emitReserved("disconnect",n,s),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(n=>{if(!this.sendBuffer.some(l=>String(l.id)===n)){const l=this.acks[n];delete this.acks[n],l.withError&&l.call(this,new Error("socket has been disconnected"))}})}onpacket(n){if(n.nsp===this.nsp)switch(n.type){case Te.CONNECT:n.data&&n.data.sid?this.onconnect(n.data.sid,n.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Te.EVENT:case Te.BINARY_EVENT:this.onevent(n);break;case Te.ACK:case Te.BINARY_ACK:this.onack(n);break;case Te.DISCONNECT:this.ondisconnect();break;case Te.CONNECT_ERROR:this.destroy();const l=new Error(n.data.message);l.data=n.data.data,this.emitReserved("connect_error",l);break}}onevent(n){const s=n.data||[];n.id!=null&&s.push(this.ack(n.id)),this.connected?this.emitEvent(s):this.receiveBuffer.push(Object.freeze(s))}emitEvent(n){if(this._anyListeners&&this._anyListeners.length){const s=this._anyListeners.slice();for(const l of s)l.apply(this,n)}super.emit.apply(this,n),this._pid&&n.length&&typeof n[n.length-1]=="string"&&(this._lastOffset=n[n.length-1])}ack(n){const s=this;let l=!1;return function(...o){l||(l=!0,s.packet({type:Te.ACK,id:n,data:o}))}}onack(n){const s=this.acks[n.id];typeof s=="function"&&(delete this.acks[n.id],s.withError&&n.data.unshift(null),s.apply(this,n.data))}onconnect(n,s){this.id=n,this.recovered=s&&this._pid===s,this._pid=s,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(n=>this.emitEvent(n)),this.receiveBuffer=[],this.sendBuffer.forEach(n=>{this.notifyOutgoingListeners(n),this.packet(n)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(n=>n()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Te.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(n){return this.flags.compress=n,this}get volatile(){return this.flags.volatile=!0,this}timeout(n){return this.flags.timeout=n,this}onAny(n){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(n),this}prependAny(n){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(n),this}offAny(n){if(!this._anyListeners)return this;if(n){const s=this._anyListeners;for(let l=0;l<s.length;l++)if(n===s[l])return s.splice(l,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(n){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(n),this}prependAnyOutgoing(n){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(n),this}offAnyOutgoing(n){if(!this._anyOutgoingListeners)return this;if(n){const s=this._anyOutgoingListeners;for(let l=0;l<s.length;l++)if(n===s[l])return s.splice(l,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(n){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const s=this._anyOutgoingListeners.slice();for(const l of s)l.apply(this,n.data)}}}function ys(a){a=a||{},this.ms=a.min||100,this.max=a.max||1e4,this.factor=a.factor||2,this.jitter=a.jitter>0&&a.jitter<=1?a.jitter:0,this.attempts=0}ys.prototype.duration=function(){var a=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var n=Math.random(),s=Math.floor(n*this.jitter*a);a=(Math.floor(n*10)&1)==0?a-s:a+s}return Math.min(a,this.max)|0};ys.prototype.reset=function(){this.attempts=0};ys.prototype.setMin=function(a){this.ms=a};ys.prototype.setMax=function(a){this.max=a};ys.prototype.setJitter=function(a){this.jitter=a};class ou extends Ie{constructor(n,s){var l;super(),this.nsps={},this.subs=[],n&&typeof n=="object"&&(s=n,n=void 0),s=s||{},s.path=s.path||"/socket.io",this.opts=s,gl(this,s),this.reconnection(s.reconnection!==!1),this.reconnectionAttempts(s.reconnectionAttempts||1/0),this.reconnectionDelay(s.reconnectionDelay||1e3),this.reconnectionDelayMax(s.reconnectionDelayMax||5e3),this.randomizationFactor((l=s.randomizationFactor)!==null&&l!==void 0?l:.5),this.backoff=new ys({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(s.timeout==null?2e4:s.timeout),this._readyState="closed",this.uri=n;const o=s.parser||ax;this.encoder=new o.Encoder,this.decoder=new o.Decoder,this._autoConnect=s.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(n){return arguments.length?(this._reconnection=!!n,n||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(n){return n===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=n,this)}reconnectionDelay(n){var s;return n===void 0?this._reconnectionDelay:(this._reconnectionDelay=n,(s=this.backoff)===null||s===void 0||s.setMin(n),this)}randomizationFactor(n){var s;return n===void 0?this._randomizationFactor:(this._randomizationFactor=n,(s=this.backoff)===null||s===void 0||s.setJitter(n),this)}reconnectionDelayMax(n){var s;return n===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=n,(s=this.backoff)===null||s===void 0||s.setMax(n),this)}timeout(n){return arguments.length?(this._timeout=n,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(n){if(~this._readyState.indexOf("open"))return this;this.engine=new Kw(this.uri,this.opts);const s=this.engine,l=this;this._readyState="opening",this.skipReconnect=!1;const o=Zt(s,"open",function(){l.onopen(),n&&n()}),f=p=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",p),n?n(p):this.maybeReconnectOnOpen()},d=Zt(s,"error",f);if(this._timeout!==!1){const p=this._timeout,g=this.setTimeoutFn(()=>{o(),f(new Error("timeout")),s.close()},p);this.opts.autoUnref&&g.unref(),this.subs.push(()=>{this.clearTimeoutFn(g)})}return this.subs.push(o),this.subs.push(d),this}connect(n){return this.open(n)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const n=this.engine;this.subs.push(Zt(n,"ping",this.onping.bind(this)),Zt(n,"data",this.ondata.bind(this)),Zt(n,"error",this.onerror.bind(this)),Zt(n,"close",this.onclose.bind(this)),Zt(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(n){try{this.decoder.add(n)}catch(s){this.onclose("parse error",s)}}ondecoded(n){yl(()=>{this.emitReserved("packet",n)},this.setTimeoutFn)}onerror(n){this.emitReserved("error",n)}socket(n,s){let l=this.nsps[n];return l?this._autoConnect&&!l.active&&l.connect():(l=new My(this,n,s),this.nsps[n]=l),l}_destroy(n){const s=Object.keys(this.nsps);for(const l of s)if(this.nsps[l].active)return;this._close()}_packet(n){const s=this.encoder.encode(n);for(let l=0;l<s.length;l++)this.engine.write(s[l],n.options)}cleanup(){this.subs.forEach(n=>n()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(n,s){var l;this.cleanup(),(l=this.engine)===null||l===void 0||l.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",n,s),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const n=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const s=this.backoff.duration();this._reconnecting=!0;const l=this.setTimeoutFn(()=>{n.skipReconnect||(this.emitReserved("reconnect_attempt",n.backoff.attempts),!n.skipReconnect&&n.open(o=>{o?(n._reconnecting=!1,n.reconnect(),this.emitReserved("reconnect_error",o)):n.onreconnect()}))},s);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}}onreconnect(){const n=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",n)}}const wa={};function _a(a,n){typeof a=="object"&&(n=a,a=void 0),n=n||{};const s=Qw(a,n.path||"/socket.io"),l=s.source,o=s.id,f=s.path,d=wa[o]&&f in wa[o].nsps,p=n.forceNew||n["force new connection"]||n.multiplex===!1||d;let g;return p?g=new ou(l,n):(wa[o]||(wa[o]=new ou(l,n)),g=wa[o]),s.query&&!n.query&&(n.query=s.queryKey),g.socket(s.path,n)}Object.assign(_a,{Manager:ou,Socket:My,io:_a,connect:_a});function lx(a){const n=a.length;let s=0,l=0;for(;l<n;){let o=a.charCodeAt(l++);if((o&4294967168)===0){s++;continue}else if((o&4294965248)===0)s+=2;else{if(o>=55296&&o<=56319&&l<n){const f=a.charCodeAt(l);(f&64512)===56320&&(++l,o=((o&1023)<<10)+(f&1023)+65536)}(o&4294901760)===0?s+=3:s+=4}}return s}function ox(a,n,s){const l=a.length;let o=s,f=0;for(;f<l;){let d=a.charCodeAt(f++);if((d&4294967168)===0){n[o++]=d;continue}else if((d&4294965248)===0)n[o++]=d>>6&31|192;else{if(d>=55296&&d<=56319&&f<l){const p=a.charCodeAt(f);(p&64512)===56320&&(++f,d=((d&1023)<<10)+(p&1023)+65536)}(d&4294901760)===0?(n[o++]=d>>12&15|224,n[o++]=d>>6&63|128):(n[o++]=d>>18&7|240,n[o++]=d>>12&63|128,n[o++]=d>>6&63|128)}n[o++]=d&63|128}}const cx=new TextEncoder,ux=50;function fx(a,n,s){cx.encodeInto(a,n.subarray(s))}function dx(a,n,s){a.length>ux?fx(a,n,s):ox(a,n,s)}const hx=4096;function Cy(a,n,s){let l=n;const o=l+s,f=[];let d="";for(;l<o;){const p=a[l++];if((p&128)===0)f.push(p);else if((p&224)===192){const g=a[l++]&63;f.push((p&31)<<6|g)}else if((p&240)===224){const g=a[l++]&63,v=a[l++]&63;f.push((p&31)<<12|g<<6|v)}else if((p&248)===240){const g=a[l++]&63,v=a[l++]&63,k=a[l++]&63;let b=(p&7)<<18|g<<12|v<<6|k;b>65535&&(b-=65536,f.push(b>>>10&1023|55296),b=56320|b&1023),f.push(b)}else f.push(p);f.length>=hx&&(d+=String.fromCharCode(...f),f.length=0)}return f.length>0&&(d+=String.fromCharCode(...f)),d}const px=new TextDecoder,mx=200;function yx(a,n,s){const l=a.subarray(n,n+s);return px.decode(l)}function gx(a,n,s){return s>mx?yx(a,n,s):Cy(a,n,s)}class nl{type;data;constructor(n,s){this.type=n,this.data=s}}class Rt extends Error{constructor(n){super(n);const s=Object.create(Rt.prototype);Object.setPrototypeOf(this,s),Object.defineProperty(this,"name",{configurable:!0,enumerable:!1,value:Rt.name})}}const xa=4294967295;function vx(a,n,s){const l=s/4294967296,o=s;a.setUint32(n,l),a.setUint32(n+4,o)}function zy(a,n,s){const l=Math.floor(s/4294967296),o=s;a.setUint32(n,l),a.setUint32(n+4,o)}function Uy(a,n){const s=a.getInt32(n),l=a.getUint32(n+4);return s*4294967296+l}function bx(a,n){const s=a.getUint32(n),l=a.getUint32(n+4);return s*4294967296+l}const wx=-1,xx=4294967296-1,Sx=17179869184-1;function Ex({sec:a,nsec:n}){if(a>=0&&n>=0&&a<=Sx)if(n===0&&a<=xx){const s=new Uint8Array(4);return new DataView(s.buffer).setUint32(0,a),s}else{const s=a/4294967296,l=a&4294967295,o=new Uint8Array(8),f=new DataView(o.buffer);return f.setUint32(0,n<<2|s&3),f.setUint32(4,l),o}else{const s=new Uint8Array(12),l=new DataView(s.buffer);return l.setUint32(0,n),zy(l,4,a),s}}function kx(a){const n=a.getTime(),s=Math.floor(n/1e3),l=(n-s*1e3)*1e6,o=Math.floor(l/1e9);return{sec:s+o,nsec:l-o*1e9}}function Tx(a){if(a instanceof Date){const n=kx(a);return Ex(n)}else return null}function Ax(a){const n=new DataView(a.buffer,a.byteOffset,a.byteLength);switch(a.byteLength){case 4:return{sec:n.getUint32(0),nsec:0};case 8:{const s=n.getUint32(0),l=n.getUint32(4),o=(s&3)*4294967296+l,f=s>>>2;return{sec:o,nsec:f}}case 12:{const s=Uy(n,4),l=n.getUint32(0);return{sec:s,nsec:l}}default:throw new Rt(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${a.length}`)}}function _x(a){const n=Ax(a);return new Date(n.sec*1e3+n.nsec/1e6)}const jx={type:wx,encode:Tx,decode:_x};class vl{static defaultCodec=new vl;__brand;builtInEncoders=[];builtInDecoders=[];encoders=[];decoders=[];constructor(){this.register(jx)}register({type:n,encode:s,decode:l}){if(n>=0)this.encoders[n]=s,this.decoders[n]=l;else{const o=-1-n;this.builtInEncoders[o]=s,this.builtInDecoders[o]=l}}tryToEncode(n,s){for(let l=0;l<this.builtInEncoders.length;l++){const o=this.builtInEncoders[l];if(o!=null){const f=o(n,s);if(f!=null){const d=-1-l;return new nl(d,f)}}}for(let l=0;l<this.encoders.length;l++){const o=this.encoders[l];if(o!=null){const f=o(n,s);if(f!=null){const d=l;return new nl(d,f)}}}return n instanceof nl?n:null}decode(n,s,l){const o=s<0?this.builtInDecoders[-1-s]:this.decoders[s];return o?o(n,s,l):new nl(s,n)}}function Nx(a){return a instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&a instanceof SharedArrayBuffer}function cu(a){return a instanceof Uint8Array?a:ArrayBuffer.isView(a)?new Uint8Array(a.buffer,a.byteOffset,a.byteLength):Nx(a)?new Uint8Array(a):Uint8Array.from(a)}const Ox=100,Rx=2048;class wu{extensionCodec;context;useBigInt64;maxDepth;initialBufferSize;sortKeys;forceFloat32;ignoreUndefined;forceIntegerToFloat;pos;view;bytes;entered=!1;constructor(n){this.extensionCodec=n?.extensionCodec??vl.defaultCodec,this.context=n?.context,this.useBigInt64=n?.useBigInt64??!1,this.maxDepth=n?.maxDepth??Ox,this.initialBufferSize=n?.initialBufferSize??Rx,this.sortKeys=n?.sortKeys??!1,this.forceFloat32=n?.forceFloat32??!1,this.ignoreUndefined=n?.ignoreUndefined??!1,this.forceIntegerToFloat=n?.forceIntegerToFloat??!1,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}clone(){return new wu({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,maxDepth:this.maxDepth,initialBufferSize:this.initialBufferSize,sortKeys:this.sortKeys,forceFloat32:this.forceFloat32,ignoreUndefined:this.ignoreUndefined,forceIntegerToFloat:this.forceIntegerToFloat})}reinitializeState(){this.pos=0}encodeSharedRef(n){if(this.entered)return this.clone().encodeSharedRef(n);try{return this.entered=!0,this.reinitializeState(),this.doEncode(n,1),this.bytes.subarray(0,this.pos)}finally{this.entered=!1}}encode(n){if(this.entered)return this.clone().encode(n);try{return this.entered=!0,this.reinitializeState(),this.doEncode(n,1),this.bytes.slice(0,this.pos)}finally{this.entered=!1}}doEncode(n,s){if(s>this.maxDepth)throw new Error(`Too deep objects in depth ${s}`);n==null?this.encodeNil():typeof n=="boolean"?this.encodeBoolean(n):typeof n=="number"?this.forceIntegerToFloat?this.encodeNumberAsFloat(n):this.encodeNumber(n):typeof n=="string"?this.encodeString(n):this.useBigInt64&&typeof n=="bigint"?this.encodeBigInt64(n):this.encodeObject(n,s)}ensureBufferSizeToWrite(n){const s=this.pos+n;this.view.byteLength<s&&this.resizeBuffer(s*2)}resizeBuffer(n){const s=new ArrayBuffer(n),l=new Uint8Array(s),o=new DataView(s);l.set(this.bytes),this.view=o,this.bytes=l}encodeNil(){this.writeU8(192)}encodeBoolean(n){n===!1?this.writeU8(194):this.writeU8(195)}encodeNumber(n){!this.forceIntegerToFloat&&Number.isSafeInteger(n)?n>=0?n<128?this.writeU8(n):n<256?(this.writeU8(204),this.writeU8(n)):n<65536?(this.writeU8(205),this.writeU16(n)):n<4294967296?(this.writeU8(206),this.writeU32(n)):this.useBigInt64?this.encodeNumberAsFloat(n):(this.writeU8(207),this.writeU64(n)):n>=-32?this.writeU8(224|n+32):n>=-128?(this.writeU8(208),this.writeI8(n)):n>=-32768?(this.writeU8(209),this.writeI16(n)):n>=-2147483648?(this.writeU8(210),this.writeI32(n)):this.useBigInt64?this.encodeNumberAsFloat(n):(this.writeU8(211),this.writeI64(n)):this.encodeNumberAsFloat(n)}encodeNumberAsFloat(n){this.forceFloat32?(this.writeU8(202),this.writeF32(n)):(this.writeU8(203),this.writeF64(n))}encodeBigInt64(n){n>=BigInt(0)?(this.writeU8(207),this.writeBigUint64(n)):(this.writeU8(211),this.writeBigInt64(n))}writeStringHeader(n){if(n<32)this.writeU8(160+n);else if(n<256)this.writeU8(217),this.writeU8(n);else if(n<65536)this.writeU8(218),this.writeU16(n);else if(n<4294967296)this.writeU8(219),this.writeU32(n);else throw new Error(`Too long string: ${n} bytes in UTF-8`)}encodeString(n){const l=lx(n);this.ensureBufferSizeToWrite(5+l),this.writeStringHeader(l),dx(n,this.bytes,this.pos),this.pos+=l}encodeObject(n,s){const l=this.extensionCodec.tryToEncode(n,this.context);if(l!=null)this.encodeExtension(l);else if(Array.isArray(n))this.encodeArray(n,s);else if(ArrayBuffer.isView(n))this.encodeBinary(n);else if(typeof n=="object")this.encodeMap(n,s);else throw new Error(`Unrecognized object: ${Object.prototype.toString.apply(n)}`)}encodeBinary(n){const s=n.byteLength;if(s<256)this.writeU8(196),this.writeU8(s);else if(s<65536)this.writeU8(197),this.writeU16(s);else if(s<4294967296)this.writeU8(198),this.writeU32(s);else throw new Error(`Too large binary: ${s}`);const l=cu(n);this.writeU8a(l)}encodeArray(n,s){const l=n.length;if(l<16)this.writeU8(144+l);else if(l<65536)this.writeU8(220),this.writeU16(l);else if(l<4294967296)this.writeU8(221),this.writeU32(l);else throw new Error(`Too large array: ${l}`);for(const o of n)this.doEncode(o,s+1)}countWithoutUndefined(n,s){let l=0;for(const o of s)n[o]!==void 0&&l++;return l}encodeMap(n,s){const l=Object.keys(n);this.sortKeys&&l.sort();const o=this.ignoreUndefined?this.countWithoutUndefined(n,l):l.length;if(o<16)this.writeU8(128+o);else if(o<65536)this.writeU8(222),this.writeU16(o);else if(o<4294967296)this.writeU8(223),this.writeU32(o);else throw new Error(`Too large map object: ${o}`);for(const f of l){const d=n[f];this.ignoreUndefined&&d===void 0||(this.encodeString(f),this.doEncode(d,s+1))}}encodeExtension(n){if(typeof n.data=="function"){const l=n.data(this.pos+6),o=l.length;if(o>=4294967296)throw new Error(`Too large extension object: ${o}`);this.writeU8(201),this.writeU32(o),this.writeI8(n.type),this.writeU8a(l);return}const s=n.data.length;if(s===1)this.writeU8(212);else if(s===2)this.writeU8(213);else if(s===4)this.writeU8(214);else if(s===8)this.writeU8(215);else if(s===16)this.writeU8(216);else if(s<256)this.writeU8(199),this.writeU8(s);else if(s<65536)this.writeU8(200),this.writeU16(s);else if(s<4294967296)this.writeU8(201),this.writeU32(s);else throw new Error(`Too large extension object: ${s}`);this.writeI8(n.type),this.writeU8a(n.data)}writeU8(n){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,n),this.pos++}writeU8a(n){const s=n.length;this.ensureBufferSizeToWrite(s),this.bytes.set(n,this.pos),this.pos+=s}writeI8(n){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,n),this.pos++}writeU16(n){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,n),this.pos+=2}writeI16(n){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,n),this.pos+=2}writeU32(n){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,n),this.pos+=4}writeI32(n){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,n),this.pos+=4}writeF32(n){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,n),this.pos+=4}writeF64(n){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,n),this.pos+=8}writeU64(n){this.ensureBufferSizeToWrite(8),vx(this.view,this.pos,n),this.pos+=8}writeI64(n){this.ensureBufferSizeToWrite(8),zy(this.view,this.pos,n),this.pos+=8}writeBigUint64(n){this.ensureBufferSizeToWrite(8),this.view.setBigUint64(this.pos,n),this.pos+=8}writeBigInt64(n){this.ensureBufferSizeToWrite(8),this.view.setBigInt64(this.pos,n),this.pos+=8}}function Mx(a,n){return new wu(n).encodeSharedRef(a)}function Kc(a){return`${a<0?"-":""}0x${Math.abs(a).toString(16).padStart(2,"0")}`}const Cx=16,zx=16;class Ux{hit=0;miss=0;caches;maxKeyLength;maxLengthPerKey;constructor(n=Cx,s=zx){this.maxKeyLength=n,this.maxLengthPerKey=s,this.caches=[];for(let l=0;l<this.maxKeyLength;l++)this.caches.push([])}canBeCached(n){return n>0&&n<=this.maxKeyLength}find(n,s,l){const o=this.caches[l-1];e:for(const f of o){const d=f.bytes;for(let p=0;p<l;p++)if(d[p]!==n[s+p])continue e;return f.str}return null}store(n,s){const l=this.caches[n.length-1],o={bytes:n,str:s};l.length>=this.maxLengthPerKey?l[Math.random()*l.length|0]=o:l.push(o)}decode(n,s,l){const o=this.find(n,s,l);if(o!=null)return this.hit++,o;this.miss++;const f=Cy(n,s,l),d=Uint8Array.prototype.slice.call(n,s,s+l);return this.store(d,f),f}}const uu="array",ja="map_key",Dy="map_value",Dx=a=>{if(typeof a=="string"||typeof a=="number")return a;throw new Rt("The type of key must be string or number but "+typeof a)};class Bx{stack=[];stackHeadPosition=-1;get length(){return this.stackHeadPosition+1}top(){return this.stack[this.stackHeadPosition]}pushArrayState(n){const s=this.getUninitializedStateFromPool();s.type=uu,s.position=0,s.size=n,s.array=new Array(n)}pushMapState(n){const s=this.getUninitializedStateFromPool();s.type=ja,s.readCount=0,s.size=n,s.map={}}getUninitializedStateFromPool(){if(this.stackHeadPosition++,this.stackHeadPosition===this.stack.length){const n={type:void 0,size:0,array:void 0,position:0,readCount:0,map:void 0,key:null};this.stack.push(n)}return this.stack[this.stackHeadPosition]}release(n){if(this.stack[this.stackHeadPosition]!==n)throw new Error("Invalid stack state. Released state is not on top of the stack.");if(n.type===uu){const l=n;l.size=0,l.array=void 0,l.position=0,l.type=void 0}if(n.type===ja||n.type===Dy){const l=n;l.size=0,l.map=void 0,l.readCount=0,l.type=void 0}this.stackHeadPosition--}reset(){this.stack.length=0,this.stackHeadPosition=-1}}const Sa=-1,xu=new DataView(new ArrayBuffer(0)),qx=new Uint8Array(xu.buffer);try{xu.getInt8(0)}catch(a){if(!(a instanceof RangeError))throw new Error("This module is not supported in the current JavaScript engine because DataView does not throw RangeError on out-of-bounds access")}const wm=new RangeError("Insufficient data"),$x=new Ux;class Su{extensionCodec;context;useBigInt64;rawStrings;maxStrLength;maxBinLength;maxArrayLength;maxMapLength;maxExtLength;keyDecoder;mapKeyConverter;totalPos=0;pos=0;view=xu;bytes=qx;headByte=Sa;stack=new Bx;entered=!1;constructor(n){this.extensionCodec=n?.extensionCodec??vl.defaultCodec,this.context=n?.context,this.useBigInt64=n?.useBigInt64??!1,this.rawStrings=n?.rawStrings??!1,this.maxStrLength=n?.maxStrLength??xa,this.maxBinLength=n?.maxBinLength??xa,this.maxArrayLength=n?.maxArrayLength??xa,this.maxMapLength=n?.maxMapLength??xa,this.maxExtLength=n?.maxExtLength??xa,this.keyDecoder=n?.keyDecoder!==void 0?n.keyDecoder:$x,this.mapKeyConverter=n?.mapKeyConverter??Dx}clone(){return new Su({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,rawStrings:this.rawStrings,maxStrLength:this.maxStrLength,maxBinLength:this.maxBinLength,maxArrayLength:this.maxArrayLength,maxMapLength:this.maxMapLength,maxExtLength:this.maxExtLength,keyDecoder:this.keyDecoder})}reinitializeState(){this.totalPos=0,this.headByte=Sa,this.stack.reset()}setBuffer(n){const s=cu(n);this.bytes=s,this.view=new DataView(s.buffer,s.byteOffset,s.byteLength),this.pos=0}appendBuffer(n){if(this.headByte===Sa&&!this.hasRemaining(1))this.setBuffer(n);else{const s=this.bytes.subarray(this.pos),l=cu(n),o=new Uint8Array(s.length+l.length);o.set(s),o.set(l,s.length),this.setBuffer(o)}}hasRemaining(n){return this.view.byteLength-this.pos>=n}createExtraByteError(n){const{view:s,pos:l}=this;return new RangeError(`Extra ${s.byteLength-l} of ${s.byteLength} byte(s) found at buffer[${n}]`)}decode(n){if(this.entered)return this.clone().decode(n);try{this.entered=!0,this.reinitializeState(),this.setBuffer(n);const s=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return s}finally{this.entered=!1}}*decodeMulti(n){if(this.entered){yield*this.clone().decodeMulti(n);return}try{for(this.entered=!0,this.reinitializeState(),this.setBuffer(n);this.hasRemaining(1);)yield this.doDecodeSync()}finally{this.entered=!1}}async decodeAsync(n){if(this.entered)return this.clone().decodeAsync(n);try{this.entered=!0;let s=!1,l;for await(const p of n){if(s)throw this.entered=!1,this.createExtraByteError(this.totalPos);this.appendBuffer(p);try{l=this.doDecodeSync(),s=!0}catch(g){if(!(g instanceof RangeError))throw g}this.totalPos+=this.pos}if(s){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return l}const{headByte:o,pos:f,totalPos:d}=this;throw new RangeError(`Insufficient data in parsing ${Kc(o)} at ${d} (${f} in the current buffer)`)}finally{this.entered=!1}}decodeArrayStream(n){return this.decodeMultiAsync(n,!0)}decodeStream(n){return this.decodeMultiAsync(n,!1)}async*decodeMultiAsync(n,s){if(this.entered){yield*this.clone().decodeMultiAsync(n,s);return}try{this.entered=!0;let l=s,o=-1;for await(const f of n){if(s&&o===0)throw this.createExtraByteError(this.totalPos);this.appendBuffer(f),l&&(o=this.readArraySize(),l=!1,this.complete());try{for(;yield this.doDecodeSync(),--o!==0;);}catch(d){if(!(d instanceof RangeError))throw d}this.totalPos+=this.pos}}finally{this.entered=!1}}doDecodeSync(){e:for(;;){const n=this.readHeadByte();let s;if(n>=224)s=n-256;else if(n<192)if(n<128)s=n;else if(n<144){const o=n-128;if(o!==0){this.pushMapState(o),this.complete();continue e}else s={}}else if(n<160){const o=n-144;if(o!==0){this.pushArrayState(o),this.complete();continue e}else s=[]}else{const o=n-160;s=this.decodeString(o,0)}else if(n===192)s=null;else if(n===194)s=!1;else if(n===195)s=!0;else if(n===202)s=this.readF32();else if(n===203)s=this.readF64();else if(n===204)s=this.readU8();else if(n===205)s=this.readU16();else if(n===206)s=this.readU32();else if(n===207)this.useBigInt64?s=this.readU64AsBigInt():s=this.readU64();else if(n===208)s=this.readI8();else if(n===209)s=this.readI16();else if(n===210)s=this.readI32();else if(n===211)this.useBigInt64?s=this.readI64AsBigInt():s=this.readI64();else if(n===217){const o=this.lookU8();s=this.decodeString(o,1)}else if(n===218){const o=this.lookU16();s=this.decodeString(o,2)}else if(n===219){const o=this.lookU32();s=this.decodeString(o,4)}else if(n===220){const o=this.readU16();if(o!==0){this.pushArrayState(o),this.complete();continue e}else s=[]}else if(n===221){const o=this.readU32();if(o!==0){this.pushArrayState(o),this.complete();continue e}else s=[]}else if(n===222){const o=this.readU16();if(o!==0){this.pushMapState(o),this.complete();continue e}else s={}}else if(n===223){const o=this.readU32();if(o!==0){this.pushMapState(o),this.complete();continue e}else s={}}else if(n===196){const o=this.lookU8();s=this.decodeBinary(o,1)}else if(n===197){const o=this.lookU16();s=this.decodeBinary(o,2)}else if(n===198){const o=this.lookU32();s=this.decodeBinary(o,4)}else if(n===212)s=this.decodeExtension(1,0);else if(n===213)s=this.decodeExtension(2,0);else if(n===214)s=this.decodeExtension(4,0);else if(n===215)s=this.decodeExtension(8,0);else if(n===216)s=this.decodeExtension(16,0);else if(n===199){const o=this.lookU8();s=this.decodeExtension(o,1)}else if(n===200){const o=this.lookU16();s=this.decodeExtension(o,2)}else if(n===201){const o=this.lookU32();s=this.decodeExtension(o,4)}else throw new Rt(`Unrecognized type byte: ${Kc(n)}`);this.complete();const l=this.stack;for(;l.length>0;){const o=l.top();if(o.type===uu)if(o.array[o.position]=s,o.position++,o.position===o.size)s=o.array,l.release(o);else continue e;else if(o.type===ja){if(s==="__proto__")throw new Rt("The key __proto__ is not allowed");o.key=this.mapKeyConverter(s),o.type=Dy;continue e}else if(o.map[o.key]=s,o.readCount++,o.readCount===o.size)s=o.map,l.release(o);else{o.key=null,o.type=ja;continue e}}return s}}readHeadByte(){return this.headByte===Sa&&(this.headByte=this.readU8()),this.headByte}complete(){this.headByte=Sa}readArraySize(){const n=this.readHeadByte();switch(n){case 220:return this.readU16();case 221:return this.readU32();default:{if(n<160)return n-144;throw new Rt(`Unrecognized array type byte: ${Kc(n)}`)}}}pushMapState(n){if(n>this.maxMapLength)throw new Rt(`Max length exceeded: map length (${n}) > maxMapLengthLength (${this.maxMapLength})`);this.stack.pushMapState(n)}pushArrayState(n){if(n>this.maxArrayLength)throw new Rt(`Max length exceeded: array length (${n}) > maxArrayLength (${this.maxArrayLength})`);this.stack.pushArrayState(n)}decodeString(n,s){return!this.rawStrings||this.stateIsMapKey()?this.decodeUtf8String(n,s):this.decodeBinary(n,s)}decodeUtf8String(n,s){if(n>this.maxStrLength)throw new Rt(`Max length exceeded: UTF-8 byte length (${n}) > maxStrLength (${this.maxStrLength})`);if(this.bytes.byteLength<this.pos+s+n)throw wm;const l=this.pos+s;let o;return this.stateIsMapKey()&&this.keyDecoder?.canBeCached(n)?o=this.keyDecoder.decode(this.bytes,l,n):o=gx(this.bytes,l,n),this.pos+=s+n,o}stateIsMapKey(){return this.stack.length>0?this.stack.top().type===ja:!1}decodeBinary(n,s){if(n>this.maxBinLength)throw new Rt(`Max length exceeded: bin length (${n}) > maxBinLength (${this.maxBinLength})`);if(!this.hasRemaining(n+s))throw wm;const l=this.pos+s,o=this.bytes.subarray(l,l+n);return this.pos+=s+n,o}decodeExtension(n,s){if(n>this.maxExtLength)throw new Rt(`Max length exceeded: ext length (${n}) > maxExtLength (${this.maxExtLength})`);const l=this.view.getInt8(this.pos+s),o=this.decodeBinary(n,s+1);return this.extensionCodec.decode(o,l,this.context)}lookU8(){return this.view.getUint8(this.pos)}lookU16(){return this.view.getUint16(this.pos)}lookU32(){return this.view.getUint32(this.pos)}readU8(){const n=this.view.getUint8(this.pos);return this.pos++,n}readI8(){const n=this.view.getInt8(this.pos);return this.pos++,n}readU16(){const n=this.view.getUint16(this.pos);return this.pos+=2,n}readI16(){const n=this.view.getInt16(this.pos);return this.pos+=2,n}readU32(){const n=this.view.getUint32(this.pos);return this.pos+=4,n}readI32(){const n=this.view.getInt32(this.pos);return this.pos+=4,n}readU64(){const n=bx(this.view,this.pos);return this.pos+=8,n}readI64(){const n=Uy(this.view,this.pos);return this.pos+=8,n}readU64AsBigInt(){const n=this.view.getBigUint64(this.pos);return this.pos+=8,n}readI64AsBigInt(){const n=this.view.getBigInt64(this.pos);return this.pos+=8,n}readF32(){const n=this.view.getFloat32(this.pos);return this.pos+=4,n}readF64(){const n=this.view.getFloat64(this.pos);return this.pos+=8,n}}function Lx(a,n){return new Su(n).decode(a)}const By={contentType:"application/msgpack",encode:a=>Mx(a,{ignoreUndefined:!0}),decode:a=>Lx(a)},Hx={contentType:"application/json",encode:a=>ey(JSON.stringify(a)),decode:a=>JSON.parse(Pm(a))},Yx=a=>a?By:Hx,xm=async(a,n,s,l,o,f)=>{if(a.emit(ve.unroutable,{source:s,target:l,reason:f}),n.type!==Oe.RequestMessage)return;const d=n.payload?.id;if(!d)return;const p={type:ge.error,id:d,code:o,error:{name:"RpcError",message:`${a.name}: ${f}`}},g=new ny;g.type=Oe.ErrorMessage,g.payload=p;try{await a.receive(g,a.name,s)}catch{}},Gx=64,Vx=a=>typeof a=="string"&&a.length>0&&a.length<=Gx,Sm="presence",Xx=128,Em=8,km=a=>typeof a=="string"&&a.length>0&&a.length<=Xx&&![...a].some(n=>n===" "||n.charCodeAt(0)<32||n.charCodeAt(0)===127),Kx=async(a,n)=>{const s=a.map(o=>o.presenceSettled?.()??Promise.resolve());let l;await Promise.race([Promise.all(s).then(()=>{}),new Promise(o=>{l=setTimeout(o,n),l.unref?.()})]),l!==void 0&&clearTimeout(l)},Qx=a=>a==="on"?"subscribe":a==="off"||a==="removeListener"?"unsubscribe":"call",Tm=a=>{const n=a.payload;if(n)switch(n.type){case ge.CallInstanceMethod:{const s=n;return{kind:Qx(s.method),channel:"req",correlation:s.id,path:s.path,method:s.method,version:s.version,ttl:s.ttl,idempotencyKey:s.idempotencyKey,fence:s.fence?.ownerEpoch,body:s.params}}case ge.success:{const s=n;return{kind:"result",channel:"rsp",correlation:s.id,deferred:s.deferred,body:s.result}}case ge.error:{const s=n;return{kind:"error",channel:"rsp",correlation:s.id,code:s.code,body:s.error}}case ge.ticket:{const s=n;return{kind:"ticket",channel:"rsp",correlation:s.id,outcome:s.outcome,body:s.outcome==="rejected"?s.error:s.value}}case ge.event:{const s=n;return{kind:"event",channel:"evt",event:s.event,path:s.path,seq:s.seq,epoch:s.epoch,body:s.params}}default:return}},Am=a=>{switch(a.kind){case"call":case"subscribe":case"unsubscribe":{if(!a.correlation||!a.path||!a.method)return;const n={type:ge.CallInstanceMethod,id:a.correlation,path:a.path,method:a.method,version:a.version,ttl:a.ttl,idempotencyKey:a.idempotencyKey,...a.fence?{fence:{ownerEpoch:a.fence}}:{},params:Array.isArray(a.body)?a.body:a.body===void 0||a.body===null?[]:[a.body]};return{type:Oe.RequestMessage,payload:n}}case"result":{if(!a.correlation)return;const n={type:ge.success,id:a.correlation,result:a.body,...a.deferred?{deferred:!0}:{}};return{type:Oe.ResponseMessage,payload:n}}case"error":{if(!a.correlation)return;const n={type:ge.error,id:a.correlation,code:a.code??"Exception",error:a.body};return{type:Oe.ErrorMessage,payload:n}}case"ticket":{if(!a.correlation||a.outcome!=="progress"&&a.outcome!=="resolved"&&a.outcome!=="rejected")return;const n={type:ge.ticket,id:a.correlation,outcome:a.outcome,...a.outcome==="rejected"?{error:a.body}:{value:a.body}};return{type:Oe.ResponseMessage,payload:n}}case"event":{if(!a.event)return;const n={type:ge.event,event:a.event,path:a.path,...a.seq!==void 0?{seq:a.seq}:{},...a.epoch?{epoch:a.epoch}:{},params:Array.isArray(a.body)?a.body:[a.body]};return{type:Oe.EventMessage,payload:n}}default:return}},_m="frame",jm="message",dl=2,Nm=a=>({kind:a.kind,...a.correlation?{corr:a.correlation}:{},...a.path?{path:a.path}:{},...a.method?{method:a.method}:{},...a.event?{event:a.event}:{},...a.code?{code:a.code}:{},...a.version?{ver:a.version}:{},...a.ttl!==void 0?{ttl:a.ttl}:{},...a.idempotencyKey?{idem:a.idempotencyKey}:{},...a.fence?{fence:a.fence}:{},...a.deferred?{deferred:!0}:{},...a.outcome?{outcome:a.outcome}:{},...a.seq!==void 0?{seq:a.seq}:{},...a.epoch?{epoch:a.epoch}:{},...a.body!==void 0?{body:a.body}:{}}),Zx=(a,n,s,l=0)=>{const o={v:dl,src:n,tgt:s,...l?{hops:l}:{}},f=a.payload;if(f?.type===ge.batch){const p=(f.payloads??[]).map(g=>Tm({type:a.type,payload:g})).filter(g=>g!==void 0);return p.length?{...o,kind:"batch",batch:p.map(g=>({...o,...Nm(g)}))}:void 0}const d=Tm(a);if(d)return{...o,...Nm(d)}},Om=a=>({kind:a.kind,correlation:a.corr,path:a.path,method:a.method,event:a.event,code:a.code,version:a.ver,ttl:a.ttl,idempotencyKey:a.idem,fence:a.fence,deferred:a.deferred===!0,outcome:a.outcome,seq:a.seq,epoch:a.epoch,body:a.body}),Jx=a=>{if(!a||typeof a!="object"||Array.isArray(a))return{reason:"frame is not an object"};const n=a;if(n.v!==dl)return{reason:`frame version ${String(n.v)}, which this build does not accept`};if(typeof n.src!="string"||!n.src)return{reason:"frame names no source"};if(typeof n.tgt!="string"||!n.tgt)return{reason:"frame names no target"};const s=typeof n.hops=="number"&&Number.isSafeInteger(n.hops)&&n.hops>=0?n.hops:0;if(n.kind==="batch"){if(!Array.isArray(n.batch)||!n.batch.length)return{reason:"batch carries no frames"};const o=[];for(const d of n.batch){const p=Am(Om(d));if(!p?.payload)return{reason:`batch carries an unreadable '${String(d?.kind)}' frame`};o.push(p.payload)}const f={type:ge.batch,payloads:o};return{message:{type:Oe.RequestMessage,payload:f},source:n.src,target:n.tgt,hops:s}}const l=Am(Om(n));return l?{message:l,source:n.src,target:n.tgt,hops:s}:{reason:`unrecognised or incomplete '${String(n.kind)}' frame`}};class Rm extends ml{url;options;announcePresence;allowInsecureTls;socket;connected=!1;codec=By;frameVersion=dl;knownPeers=new Set;carrying=[];sweepLanded;sweep=new Promise(n=>this.sweepLanded=n);presenceSettled(){return this.announcePresence||this.sweepLanded?.(),this.sweep}constructor(n,s,l,o={},f=!0,d=!1,p=dl){super(n,l),this.url=s,this.options=o,this.announcePresence=f,this.allowInsecureTls=d,this.frameVersion=p,queueMicrotask(()=>{this.open().catch(g=>this.emit(ve.transportError,g))})}closing=!1;async close(){this.closing=!0,this.sweepLanded?.(),this.sweepLanded=void 0;const n=this.socket;if(this.socket=void 0,this.connected=!1,this.readyFlag=!1,!n)return;n.io.reconnection(!1);const s=n.io.engine,l=n.connected&&s?new Promise(o=>{const f=setTimeout(o,2e3);f.unref?.(),s.once("close",()=>{clearTimeout(f),o()})}):Promise.resolve();n.disconnect(),await l,n.removeAllListeners(),this.knownPeers.clear()}async open(){if(this.socket)return;super.open();const n=this.url;this.allowInsecureTls&&(this.options={rejectUnauthorized:!1,...this.options},this.warnAboutInsecureTls()),this.socket=n?_a(n,this.options):_a(this.options),this.socket.on(jm,async s=>{try{const[l,o,f]=this.extractHeader(new Uint8Array(s));if(!l){this.emit(ve.rejected,{source:"unknown",reason:f??"no msgrpc header"});return}const d=this.codec.decode(o);await this.deliver(d,l.source,l.target,l.hops??0)}catch(l){this.emit(ve.rejected,{source:"unknown",reason:`undecodable frame: ${String(l)}`,error:l})}}),this.socket.on(_m,async s=>{try{const l=Jx(this.codec.decode(new Uint8Array(s)));if("reason"in l){this.emit(ve.rejected,{source:"unknown",reason:l.reason});return}await this.deliver(l.message,l.source,l.target,l.hops)}catch(l){this.emit(ve.rejected,{source:"unknown",reason:`undecodable frame: ${String(l)}`,error:l})}}),this.socket.on(Sm,s=>{try{this.onPresence(s)}catch(l){this.emit(ve.rejected,{source:"unknown",reason:`bad presence update: ${String(l)}`,error:l})}}),this.socket.on("connect",()=>{this.connected=!0,this.readyFlag=!0,this.announcePresence&&this.announce(),this.emit(ve.connected)}),this.socket.on("disconnect",s=>{this.connected=!1,this.readyFlag=!1;for(const l of[...this.knownPeers])this.knownPeers.delete(l),this.emit(ve.peerGone,l);this.emit(ve.disconnected,s),s==="io server disconnect"&&!this.closing&&setTimeout(()=>{!this.closing&&this.socket?.disconnected&&this.socket.connect()},1e3).unref?.()})}warnAboutInsecureTls(){!this.url||!/^(https|wss):/i.test(this.url)||console.warn(`source-rpc: '${this.name}' is connecting to ${this.url} with allowInsecureTls, so the server's certificate is not checked. Anything able to answer on that address can read and rewrite this link. Use it for a development server, not a plant.`)}registerIfUnrouted(n){this.peerRegistry.get(n)||this.setKnownSource(n)}announce(){const n={name:this.name};this.carrying.length&&(n.carrying=this.carrying),this.shape&&(n.shape=this.shape),this.frameVersion!==1&&(n.v=this.frameVersion),this.socket?.emit(Sm,n)}shape;announceShape(n){this.shape!==n&&(this.shape=n,this.connected&&this.announcePresence&&this.announce())}advertise(n){const s=[...n].sort();s.length===this.carrying.length&&s.every((l,o)=>l===this.carrying[o])||(this.carrying=s,this.connected&&this.announcePresence&&this.announce())}noteShape(n,s){Vx(s)&&this.peerRegistry.noteShape(n,s)&&this.emit(ve.peerShape,n,s)}onPresence(n){if(Array.isArray(n.peers)){const s=this.sweepLanded;this.sweepLanded=void 0,s?.();for(const l of n.peers)!km(l)||l===this.name||(n.shapes&&Object.prototype.hasOwnProperty.call(n.shapes,l)&&this.noteShape(l,n.shapes[l]),!this.knownPeers.has(l)&&(this.knownPeers.add(l),this.registerIfUnrouted(l),this.emit(ve.peerOnline,l)));return}if(!(!km(n.peer)||n.peer===this.name))if(n.state==="offline"){if(!this.knownPeers.delete(n.peer))return;this.emit(ve.peerGone,n.peer)}else{if(n.shape!==void 0&&this.noteShape(n.peer,n.shape),this.knownPeers.has(n.peer))return;this.knownPeers.add(n.peer),this.registerIfUnrouted(n.peer),this.emit(ve.peerOnline,n.peer)}}async deliver(n,s,l,o){if(l!==this.name){const f=this.peerRegistry.get(l);if(f&&f!==this&&f.isTransport()){if(o+1>Em){await xm(this,n,s,l,"TransportError",`over ${Em} relays`);return}const d=f;d.forward?d.forward(n,s,l,o+1):await f.receive(n,s,l);return}}if(this.targetExists(l)){await this.send(n,s,l);return}await xm(this,n,s,l,"TransportError",`no route to '${l}'`)}forward(n,s,l,o){try{this.emitFrame(this.requireSocket(),n,s,l,o)}catch(f){this.emit(ve.unroutable,{source:s,target:l,reason:`cannot forward: ${String(f)}`,error:f})}}emitFrame(n,s,l,o,f=0){if(this.frameVersion===1){const p=this.buildHeader(l,o,f?{hops:f}:void 0);n.emit(jm,this.frameMessage(p,this.codec.encode(s)));return}const d=Zx(s,l,o,f);if(!d)throw new Error(`SocketIoClientTransport '${this.name}': no frame representation for this message`);n.emit(_m,this.codec.encode(d))}requireSocket(){if(!this.socket)throw new Error(`SocketIoClientTransport '${this.name}': not connected to ${this.url??"the default url"}`);return this.socket}async receive(n,s,l){this.emitFrame(this.requireSocket(),n,s,l)}isTransport(){return!0}}const Eu=Object.freeze(`abandon
|
|
10
10
|
ability
|
|
11
11
|
able
|
|
12
12
|
about
|
|
@@ -2054,10 +2054,10 @@ zebra
|
|
|
2054
2054
|
zero
|
|
2055
2055
|
zone
|
|
2056
2056
|
zoo`.split(`
|
|
2057
|
-
`));cu.length;const vw=r=>{const n=new Uint32Array(r);return crypto.getRandomValues(n),[...n].map(a=>a%cu.length)},bw=(r=3)=>vw(r).map(n=>cu[n]).join("-"),ww=(r,n=3)=>`${r}-${bw(n)}`,Ip=128;class Sw{local;peer;caller;chains=new Map;constructor(n,a,l,u){this.local=n,this.peer=a,this.caller=l,n.on("contextChanged",()=>{for(const f of this.chains.values())f.localChanged()}),u.on(_e.disconnected,()=>{for(const f of this.chains.values())f.markStale()});for(const f of[_e.peerGone,_e.peerDisplaced])u.on(f,d=>{for(const m of this.chains.values())m.peerLost(String(d))});u.on(_e.connected,()=>{for(const f of this.chains.values())f.reconnect()})}store(n,a){let l=this.chains.get(n);return l||this.chains.set(n,l=new xw(this,n,()=>this.chains.delete(n))),l.storeFor(a)}require(n,a){const l=this.store(n,a).getSnapshot();if(l.status==="invalid")throw new Error(`context: ${a.id} at ${n} is invalid (${l.invalidReason}) - topology-dependent decisions fail closed`);if(l.status==="missing")throw new Error(`context: nothing provides ${a.id} on ${n}'s ${a.axis} chain`);if(l.status==="stale"&&(a.stalePolicy??"allow")==="reject")throw new Error(`context: ${a.id} at ${n} is stale, and this token rejects stale answers`);if(l.status!=="live"&&l.status!=="stale")throw new Error(`context: ${a.id} at ${n} is still ${l.status}`);const u=l.entry??l.entries?.[0];if(!u)throw new Error(`context: nothing provides ${a.id} on ${n}'s ${a.axis} chain`);return u.value}capture(n,a){return h0({peer:this.peer,instance:n},a.map(l=>{const u=this.store(n,l).getSnapshot(),f=u.entry??u.entries?.[0];return{token:l,...f&&(u.status==="live"||u.status==="stale")?{entry:{tokenId:l.id,schemaVersion:l.schemaVersion,axis:l.axis,provider:f.provider,providerVersion:f.providerVersion,mountEpoch:u.mountEpoch,value:f.value}}:{}}}))}}class xw{resolver;node;release;tokens=new Map;hops={physical:[],logical:[]};localSnapshot;retired=new Set;cycles={};mountKeys={};mountEpochs={};reasons={};constructor(n,a,l){this.resolver=n,this.node=a,this.release=l}storeFor(n){let a=this.tokens.get(n.id);a||(a={token:n,view:{tokenId:n.id,axis:n.axis,status:"initializing",mountEpoch:"",resolvedAt:0,transitionReason:"initial-load"},listeners:new Set,users:0},this.tokens.set(n.id,a),this.localChanged()),a.users++;const l=a;return{getSnapshot:()=>l.view,subscribe:u=>(l.listeners.add(u),()=>l.listeners.delete(u)),close:()=>{if(l.users--,!(l.users>0)&&(l.view={...l.view,status:"closed"},this.notify(l),this.tokens.delete(l.token.id),this.tokens.size===0)){for(const u of["physical","logical"])this.retireFrom(u,0);this.release()}}}}localChanged(){this.localSnapshot=this.resolver.local.snapshotFor(this.node,[...this.tokens.keys()],0,!1),this.rebuild("physical"),this.rebuild("logical");for(const n of["physical","logical"])for(const a of this.hops[n])a.retired||(a.peer===this.resolver.peer||a.tokenKey!==this.tokensFor(n).join(","))&&this.open(a);this.recompute()}markStale(){for(const n of["physical","logical"])for(const a of this.hops[n])a.stale=!0;this.recompute()}peerLost(n){for(const a of["physical","logical"])for(const l of this.hops[a])l.peer===n&&(l.stale=!0);this.recompute()}reconnect(){for(const n of["physical","logical"])for(const a of this.hops[n])a.stale&&!a.retired&&(this.reasons[n]="reconnect",this.open(a))}rebuild(n){const a=this.hops[n];this.cycles[n]=void 0;let l=[...this.localSnapshot?.walked[n]??[]],u=this.localSnapshot?.continues[n],f=0;for(;u;){const d=u,m=l.findIndex(R=>Mp(R,d));if(m!==-1){this.cycles[n]=l.slice(m),this.retireFrom(n,f);return}const y=a[f];if(y&&y.peer===u.peer&&y.node===u.instance){y.snapshot&&(l=[...l,...y.snapshot.walked[n]]),u=y.snapshot?.continues[n],f++;continue}this.retireFrom(n,f);const b={peer:u.peer,node:u.instance,axis:n,subscriptionId:et(),stale:!1,retired:!1};a[f]=b,this.open(b),u=void 0,f++}this.retireFrom(n,f)}retireFrom(n,a){const l=this.hops[n];for(const u of l.splice(a)){u.retired=!0,this.retired.add(u.subscriptionId),u.detach?.();const f=this.resolver.caller.proxy(Ea,u.peer);Promise.resolve(f.unsubscribe(u.subscriptionId)).catch(()=>{})}}tokensFor(n){return[...this.tokens.values()].filter(a=>a.token.axis===n).map(a=>a.token.id)}async open(n){if(n.tokenKey=this.tokensFor(n.axis).join(","),n.peer===this.resolver.peer){this.accept(n,this.resolver.local.snapshotFor(n.node,this.tokensFor(n.axis),0,!1));return}const a=this.resolver.caller.eventEmitter;if(!n.detach){const l=Pl(n.peer,Ea,km),u=f=>{const d=f;d.subscriptionId!==n.subscriptionId||n.retired||n.snapshot&&d.snapshot.seq<=n.snapshot.seq||this.accept(n,d.snapshot)};a.on(l,u),n.detach=()=>{a.removeListener(l,u)}}try{const u=await this.resolver.caller.proxy(Ea,n.peer).subscribe(n.subscriptionId,n.node,this.tokensFor(n.axis));if(n.retired)return;n.stale=!1,this.accept(n,u)}catch{n.retired||(n.stale=!0,this.recompute(),setTimeout(()=>{!n.retired&&n.stale&&this.open(n)},2e3).unref?.())}}accept(n,a){const l=!n.snapshot||!Mp(n.snapshot.continues[n.axis]??null,a.continues[n.axis]??null);n.snapshot=a,n.stale=!1,l&&this.rebuild(n.axis),this.recompute()}recompute(){for(const n of this.tokens.values()){const a=n.token.axis,l=this.hops[a],u=[...this.localSnapshot?[this.localSnapshot]:[],...l.flatMap(N=>N.snapshot?[N.snapshot]:[])],f=u.map(N=>N.chainKey[a]).join(" ")+" "+l.map(N=>N.subscriptionId).join(" ");let d=!1;this.mountKeys[a]!==f&&(this.mountKeys[a]!==void 0&&this.reasons[a]!=="reconnect"&&(this.reasons[a]=a==="logical"?"owner-remount":"parent-remount"),this.mountKeys[a]=f,this.mountEpochs[a]=et(),d=!0);const m=this.mountEpochs[a]??"",y=this.reasons[a]??"initial-load",b=u.flatMap(N=>N.trouble.filter(C=>C.axis===a)),R=l.some(N=>!N.snapshot&&!N.retired),w=l.some(N=>N.stale&&!N.retired),j=u.flatMap(N=>N.walked[a]),L=this.cycles[a],K=u.flatMap(N=>(N.tokens.find(C=>C.tokenId===n.token.id)?.entries??[]).filter(C=>C.axis===a).map(C=>({value:C.value,provider:C.node,providerVersion:C.provider}))),P=!R&&!w,W=d&&(n.view.entry||n.view.entries)?{previous:n.view.entry??n.view.entries}:n.view.previous?{previous:n.view.previous}:{};let z;const X={tokenId:n.token.id,axis:a,mountEpoch:m,resolvedAt:Date.now(),transitionReason:y,...W};if(b.length||L||j.length>Ip){const N=b[0];z={...X,status:"invalid",invalidReason:L?"cycle":j.length>Ip?"depth-exceeded":N.status==="cycle"?"cycle":N.status,...L?{invalidPath:L}:N?.path?{invalidPath:N.path}:{}}}else if(R)z={...X,status:"initializing"};else if(K.length===0)z={...X,status:w?"stale":"missing",...w?{staleSince:n.view.staleSince??Date.now()}:{}};else{const N=n.token.resolution??"nearest";z={...X,status:w?"stale":"live",...w?{staleSince:n.view.staleSince??Date.now()}:{},...N==="nearest"?{entry:K[0]}:{entries:K}}}z.status==="stale"&&!z.entry&&!z.entries&&(n.view.entry||n.view.entries)&&(z={...z,...n.view.entry?{entry:n.view.entry}:{},...n.view.entries?{entries:n.view.entries}:{}}),P&&z.status==="live"&&(this.reasons[a]=void 0),JSON.stringify({...n.view,resolvedAt:0})!==JSON.stringify({...z,resolvedAt:0})&&(n.view=z,this.notify(n))}}notify(n){for(const a of[...n.listeners])try{a()}catch{}}}const Ew=JSON.parse('{"RpcTopologyRecord":{"kind":"object","fields":{"ref":{"type":{"kind":"ref","name":"RpcRef"}},"parent":{"type":{"kind":"union","options":[{"kind":"null"},{"kind":"ref","name":"RpcRef"}]},"optional":true},"owner":{"type":{"kind":"union","options":[{"kind":"null"},{"kind":"ref","name":"RpcRef"}]},"optional":true},"parentEpoch":{"type":{"kind":"string"}},"ownerEpoch":{"type":{"kind":"string"}},"version":{"type":{"kind":"ref","name":"RpcTopologyVersion"}},"label":{"type":{"kind":"string"},"optional":true}}},"RpcRef":{"kind":"object","fields":{"peer":{"type":{"kind":"string"}},"instance":{"type":{"kind":"string"}}}},"RpcTopologyVersion":{"kind":"object","fields":{"epoch":{"type":{"kind":"string"}},"revision":{"type":{"kind":"number"}}}},"RpcTopologyCapabilities":{"kind":"object","fields":{"authorityScope":{"type":{"kind":"literal","value":"host"}},"cycleGuarantee":{"type":{"kind":"literal","value":"detected"}},"reverseIndex":{"type":{"kind":"literal","value":"eventual"}},"deletion":{"type":{"kind":"literal","value":"tombstone"}},"durability":{"type":{"kind":"union","options":[{"kind":"literal","value":"volatile"},{"kind":"literal","value":"durable"}]}}}},"RpcTopologyPatch":{"kind":"object","fields":{"parent":{"type":{"kind":"union","options":[{"kind":"null"},{"kind":"ref","name":"RpcRef"}]},"optional":true},"owner":{"type":{"kind":"union","options":[{"kind":"null"},{"kind":"ref","name":"RpcRef"}]},"optional":true},"label":{"type":{"kind":"string"},"optional":true}}},"RpcTopologyMutation":{"kind":"object","fields":{"expectedVersion":{"type":{"kind":"ref","name":"RpcTopologyVersion"}},"reason":{"type":{"kind":"string"},"optional":true}}},"ServerDescription":{"kind":"object","fields":{"name":{"type":{"kind":"string"}},"version":{"type":{"kind":"string"},"optional":true},"validating":{"type":{"kind":"boolean"}},"namespaces":{"type":{"kind":"array","items":{"kind":"ref","name":"DescribedNamespace"}}},"host":{"type":{"kind":"object","fields":{"root":{"type":{"kind":"ref","name":"RpcRef"}},"parent":{"type":{"kind":"union","options":[{"kind":"null"},{"kind":"ref","name":"RpcRef"}]},"optional":true},"owner":{"type":{"kind":"union","options":[{"kind":"null"},{"kind":"ref","name":"RpcRef"}]},"optional":true},"place":{"type":{"kind":"array","items":{"kind":"string"}},"optional":true},"label":{"type":{"kind":"string"},"optional":true},"capabilities":{"type":{"kind":"ref","name":"RpcTopologyCapabilities"}}}},"optional":true},"types":{"type":{"kind":"record","values":{"kind":"ref","name":"TypeNode"}},"optional":true}}},"DescribedNamespace":{"kind":"object","fields":{"name":{"type":{"kind":"string"}},"version":{"type":{"kind":"string"},"optional":true},"className":{"type":{"kind":"string"},"optional":true},"created":{"type":{"kind":"boolean"}},"emitter":{"type":{"kind":"boolean"}},"serialised":{"type":{"kind":"boolean"},"optional":true},"component":{"type":{"kind":"ref","name":"DescribedComponent"},"optional":true},"topology":{"type":{"kind":"ref","name":"DescribedTopology"},"optional":true},"capabilities":{"type":{"kind":"array","items":{"kind":"string"}},"optional":true},"methods":{"type":{"kind":"array","items":{"kind":"ref","name":"DescribedMethod"}}},"events":{"type":{"kind":"array","items":{"kind":"ref","name":"DescribedEvent"}}}}},"DescribedComponent":{"kind":"object","fields":{"props":{"type":{"kind":"union","options":[{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"any"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"null"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"boolean"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"number"}},"integer":{"type":{"kind":"boolean"},"optional":true},"min":{"type":{"kind":"number"},"optional":true},"max":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"string"}},"pattern":{"type":{"kind":"string"},"optional":true},"minLength":{"type":{"kind":"number"},"optional":true},"maxLength":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"bytes"}},"maxBytes":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"date"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"literal"}},"value":{"type":{"kind":"union","options":[{"kind":"null"},{"kind":"string"},{"kind":"number"},{"kind":"literal","value":false},{"kind":"literal","value":true}]},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"array"}},"items":{"type":{"kind":"ref","name":"TypeNode"}},"maxItems":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"tuple"}},"items":{"type":{"kind":"array","items":{"kind":"ref","name":"TypeNode"}}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"object"}},"fields":{"type":{"kind":"record","values":{"kind":"ref","name":"FieldNode"}}},"additional":{"type":{"kind":"boolean"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"record"}},"values":{"type":{"kind":"ref","name":"TypeNode"}},"keyPattern":{"type":{"kind":"string"},"optional":true},"maxEntries":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"union"}},"options":{"type":{"kind":"array","items":{"kind":"ref","name":"TypeNode"}}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"ref"}},"name":{"type":{"kind":"string"}}}}]},"optional":true},"state":{"type":{"kind":"union","options":[{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"any"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"null"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"boolean"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"number"}},"integer":{"type":{"kind":"boolean"},"optional":true},"min":{"type":{"kind":"number"},"optional":true},"max":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"string"}},"pattern":{"type":{"kind":"string"},"optional":true},"minLength":{"type":{"kind":"number"},"optional":true},"maxLength":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"bytes"}},"maxBytes":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"date"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"literal"}},"value":{"type":{"kind":"union","options":[{"kind":"null"},{"kind":"string"},{"kind":"number"},{"kind":"literal","value":false},{"kind":"literal","value":true}]},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"array"}},"items":{"type":{"kind":"ref","name":"TypeNode"}},"maxItems":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"tuple"}},"items":{"type":{"kind":"array","items":{"kind":"ref","name":"TypeNode"}}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"object"}},"fields":{"type":{"kind":"record","values":{"kind":"ref","name":"FieldNode"}}},"additional":{"type":{"kind":"boolean"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"record"}},"values":{"type":{"kind":"ref","name":"TypeNode"}},"keyPattern":{"type":{"kind":"string"},"optional":true},"maxEntries":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"union"}},"options":{"type":{"kind":"array","items":{"kind":"ref","name":"TypeNode"}}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"ref"}},"name":{"type":{"kind":"string"}}}}]},"optional":true},"subscribers":{"type":{"kind":"number"}}}},"TypeNode":{"kind":"union","options":[{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"any"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"null"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"boolean"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"number"}},"integer":{"type":{"kind":"boolean"},"optional":true},"min":{"type":{"kind":"number"},"optional":true},"max":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"string"}},"pattern":{"type":{"kind":"string"},"optional":true},"minLength":{"type":{"kind":"number"},"optional":true},"maxLength":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"bytes"}},"maxBytes":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"date"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"literal"}},"value":{"type":{"kind":"union","options":[{"kind":"null"},{"kind":"string"},{"kind":"number"},{"kind":"literal","value":false},{"kind":"literal","value":true}]},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"array"}},"items":{"type":{"kind":"ref","name":"TypeNode"}},"maxItems":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"tuple"}},"items":{"type":{"kind":"array","items":{"kind":"ref","name":"TypeNode"}}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"object"}},"fields":{"type":{"kind":"record","values":{"kind":"ref","name":"FieldNode"}}},"additional":{"type":{"kind":"boolean"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"record"}},"values":{"type":{"kind":"ref","name":"TypeNode"}},"keyPattern":{"type":{"kind":"string"},"optional":true},"maxEntries":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"union"}},"options":{"type":{"kind":"array","items":{"kind":"ref","name":"TypeNode"}}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"ref"}},"name":{"type":{"kind":"string"}}}}]},"FieldNode":{"kind":"object","fields":{"type":{"type":{"kind":"ref","name":"TypeNode"}},"optional":{"type":{"kind":"boolean"},"optional":true}}},"DescribedTopology":{"kind":"object","fields":{"parent":{"type":{"kind":"union","options":[{"kind":"null"},{"kind":"ref","name":"RpcRef"}]},"optional":true},"owner":{"type":{"kind":"union","options":[{"kind":"null"},{"kind":"ref","name":"RpcRef"}]},"optional":true},"parentEpoch":{"type":{"kind":"string"}},"ownerEpoch":{"type":{"kind":"string"}},"label":{"type":{"kind":"string"},"optional":true}}},"DescribedMethod":{"kind":"object","fields":{"name":{"type":{"kind":"string"}},"params":{"type":{"kind":"array","items":{"kind":"ref","name":"TypeNode"}},"optional":true},"paramNames":{"type":{"kind":"array","items":{"kind":"string"}},"optional":true},"rest":{"type":{"kind":"union","options":[{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"any"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"null"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"boolean"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"number"}},"integer":{"type":{"kind":"boolean"},"optional":true},"min":{"type":{"kind":"number"},"optional":true},"max":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"string"}},"pattern":{"type":{"kind":"string"},"optional":true},"minLength":{"type":{"kind":"number"},"optional":true},"maxLength":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"bytes"}},"maxBytes":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"date"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"literal"}},"value":{"type":{"kind":"union","options":[{"kind":"null"},{"kind":"string"},{"kind":"number"},{"kind":"literal","value":false},{"kind":"literal","value":true}]},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"array"}},"items":{"type":{"kind":"ref","name":"TypeNode"}},"maxItems":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"tuple"}},"items":{"type":{"kind":"array","items":{"kind":"ref","name":"TypeNode"}}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"object"}},"fields":{"type":{"kind":"record","values":{"kind":"ref","name":"FieldNode"}}},"additional":{"type":{"kind":"boolean"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"record"}},"values":{"type":{"kind":"ref","name":"TypeNode"}},"keyPattern":{"type":{"kind":"string"},"optional":true},"maxEntries":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"union"}},"options":{"type":{"kind":"array","items":{"kind":"ref","name":"TypeNode"}}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"ref"}},"name":{"type":{"kind":"string"}}}}]},"optional":true},"returns":{"type":{"kind":"union","options":[{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"any"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"null"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"boolean"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"number"}},"integer":{"type":{"kind":"boolean"},"optional":true},"min":{"type":{"kind":"number"},"optional":true},"max":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"string"}},"pattern":{"type":{"kind":"string"},"optional":true},"minLength":{"type":{"kind":"number"},"optional":true},"maxLength":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"bytes"}},"maxBytes":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"date"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"literal"}},"value":{"type":{"kind":"union","options":[{"kind":"null"},{"kind":"string"},{"kind":"number"},{"kind":"literal","value":false},{"kind":"literal","value":true}]},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"array"}},"items":{"type":{"kind":"ref","name":"TypeNode"}},"maxItems":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"tuple"}},"items":{"type":{"kind":"array","items":{"kind":"ref","name":"TypeNode"}}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"object"}},"fields":{"type":{"kind":"record","values":{"kind":"ref","name":"FieldNode"}}},"additional":{"type":{"kind":"boolean"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"record"}},"values":{"type":{"kind":"ref","name":"TypeNode"}},"keyPattern":{"type":{"kind":"string"},"optional":true},"maxEntries":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"union"}},"options":{"type":{"kind":"array","items":{"kind":"ref","name":"TypeNode"}}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"ref"}},"name":{"type":{"kind":"string"}}}}]},"optional":true},"semantics":{"type":{"kind":"union","options":[{"kind":"literal","value":"query"},{"kind":"literal","value":"idempotent-command"},{"kind":"literal","value":"non-repeatable-command"}]},"optional":true},"requiresAuthority":{"type":{"kind":"boolean"},"optional":true}}},"DescribedEvent":{"kind":"object","fields":{"name":{"type":{"kind":"string"}},"params":{"type":{"kind":"array","items":{"kind":"ref","name":"TypeNode"}},"optional":true},"subscribers":{"type":{"kind":"number"}}}}}'),kw={msgrpc:{methods:{topology:{params:[],returns:{kind:"object",fields:{records:{type:{kind:"array",items:{kind:"ref",name:"RpcTopologyRecord"}}},place:{type:{kind:"array",items:{kind:"string"}},optional:!0},capabilities:{type:{kind:"ref",name:"RpcTopologyCapabilities"}}}},semantics:"query"},updateTopology:{params:[{kind:"string"},{kind:"ref",name:"RpcTopologyPatch"},{kind:"ref",name:"RpcTopologyMutation"}],paramNames:["instance","patch","mutation"],returns:{kind:"ref",name:"RpcTopologyRecord"},semantics:"idempotent-command"},eventCursor:{params:[{kind:"string"},{kind:"string"}],paramNames:["namespace","event"],returns:{kind:"object",fields:{epoch:{type:{kind:"string"}},seq:{type:{kind:"union",options:[{kind:"null"},{kind:"number"}]},optional:!0},since:{type:{kind:"number"},optional:!0}}},semantics:"query"},describe:{params:[],returns:{kind:"ref",name:"ServerDescription"}}}}},Tw={types:Ew,namespaces:kw};var Pp=function(r,n,a){for(var l=arguments.length>2,u=0;u<n.length;u++)a=l?n[u].call(r,a):n[u].call(r);return l?a:void 0},ba=function(r,n,a,l,u,f){function d(z){if(z!==void 0&&typeof z!="function")throw new TypeError("Function expected");return z}for(var m=l.kind,y=m==="getter"?"get":m==="setter"?"set":"value",b=!n&&r?l.static?r:r.prototype:null,R=n||(b?Object.getOwnPropertyDescriptor(b,l.name):{}),w,j=!1,L=a.length-1;L>=0;L--){var K={};for(var P in l)K[P]=P==="access"?{}:l[P];for(var P in l.access)K.access[P]=l.access[P];K.addInitializer=function(z){if(j)throw new TypeError("Cannot add initializers after decoration has completed");f.push(d(z||null))};var W=(0,a[L])(m==="accessor"?{get:R.get,set:R.set}:R[y],K);if(m==="accessor"){if(W===void 0)continue;if(W===null||typeof W!="object")throw new TypeError("Object expected");(w=d(W.get))&&(R.get=w),(w=d(W.set))&&(R.set=w),(w=d(W.init))&&u.unshift(w)}else(w=d(W))&&(m==="field"?u.unshift(w):R[y]=w)}b&&Object.defineProperty(b,l.name,R),j=!0};const Zm="msgrpc.",nn=r=>{switch(r.kind){case"ref":return{...r,name:Zm+r.name};case"array":return{...r,items:nn(r.items)};case"record":return{...r,values:nn(r.values)};case"tuple":return{...r,items:r.items.map(nn)};case"union":return{...r,options:r.options.map(nn)};case"object":return{...r,fields:Object.fromEntries(Object.entries(r.fields).map(([n,a])=>[n,{...a,type:nn(a.type)}]))};default:return r}},_w=r=>({...r,params:r.params.map(nn),...r.rest?{rest:nn(r.rest)}:{},...r.returns?{returns:nn(r.returns)}:{}}),wa=Tw,em={namespace:{...wa.namespaces.msgrpc,methods:Object.fromEntries(Object.entries(wa.namespaces.msgrpc.methods).map(([r,n])=>[r,_w(n)])),...wa.namespaces.msgrpc.events?{events:Object.fromEntries(Object.entries(wa.namespaces.msgrpc.events).map(([r,n])=>[r,{params:n.params.map(nn)}]))}:{}},types:Object.fromEntries(Object.entries(wa.types??{}).map(([r,n])=>[Zm+r,nn(n)]))},Aw=r=>r?.namespaces.msgrpc?r:{schema:w0,...r,types:{...r?.types,...em.types},namespaces:{...r?.namespaces,msgrpc:em.namespace}};let Nw=(()=>{var b;let r=[Sm("msgrpc")],n,a=[],l,u=[],f,d,m,y;return b=class{handler=Pp(this,u);constructor(w){this.handler=w}async topology(){const w=this.handler.hostTopology;if(w)return{records:w.all(),...w.place?{place:w.place}:{},capabilities:w.capabilities()}}async updateTopology(w,j,L){const K=this.handler.hostTopology;if(!K)throw new Error("this host keeps no topology records");if(!this.handler.allowTopologyMutation)throw new Error("this host does not accept remote topology mutation - it is enabled with topology.allowRemoteMutation, and gated by authorize() like any call");return w===dt?K.updateHost(j,L):K.update(w,j,L)}async eventCursor(w,j){this.handler.eventSequenceOf(w,j)===void 0&&this.handler.trackEvent(w,j);const K=this.handler.eventSequenceOf(w,j);return{epoch:this.handler.epoch,seq:K??null,...K!==void 0?{since:this.handler.eventTrackedSince(w,j)}:{}}}async describe(){const w=this.handler.manageRpc,j=this.handler.schema,L=new Set(w.createdInstances.keys()),K=Object.entries(w.exposedNameSpaceInstances).map(([z,X])=>{const J=j?.namespaces[z],C=[...w.findNameSpaceMethodMap(z)?.keys()??[]].sort().map(ue=>{const je=J?.methods[ue],Ge=this.handler.semanticsOf({path:z,method:ue});return{name:ue,...je?{params:je.params,paramNames:je.paramNames,rest:je.rest,returns:je.returns}:{},...Ge?{semantics:Ge}:{},...w.exposedAuthority[z]?.has(ue)?{requiresAuthority:!0}:{}}}),H=new Set(Object.keys(J?.events??{}));for(const ue of this.handler.eventProxies.values())ue.instanceName===z&&H.add(ue.event);H.delete(_n);const B=[...H].sort().map(ue=>({name:ue,...J?.events?.[ue]?{params:J.events[ue].params}:{},subscribers:[...this.handler.eventProxies.values()].filter(je=>je.instanceName===z&&je.event===ue).length})),Q=this.handler.hostTopology?.get(z),ne=Q?{parent:Q.parent,owner:Q.owner,parentEpoch:Q.parentEpoch,ownerEpoch:Q.ownerEpoch,...Q.label!==void 0?{label:Q.label}:{}}:void 0,se=w.exposedExecution[z],xe=X instanceof hs?{...J?.component?{props:J.component.props,state:J.component.state}:{},subscribers:[...this.handler.eventProxies.values()].filter(ue=>ue.instanceName===z&&ue.event===_n).length}:void 0;return{name:z,...J?.version?{version:J.version}:{},...se&&se!=="parallel"?{serialised:!0}:{},className:X.constructor?.name,created:L.has(z),emitter:X instanceof Il,...xe?{component:xe}:{},...ne?{topology:ne}:{},...J?.capabilities?{capabilities:J.capabilities}:{},methods:C,events:B}}),P=this.handler.hostTopology,W=P?.get(dt);return{name:this.handler.name,...j?.version?{version:j.version}:{},validating:!!j&&this.handler.validation!=="off",namespaces:K.sort((z,X)=>z.name.localeCompare(X.name)),...P&&W?{host:{root:W.ref,parent:W.parent,...W.owner?{owner:W.owner}:{},...P.place?{place:P.place}:{},...W.label!==void 0?{label:W.label}:{},capabilities:P.capabilities()}}:{},...j?.types?{types:j.types}:{}}}},l=b,(()=>{const w=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;f=[fs({semantics:"query"})],d=[fs({semantics:"idempotent-command"})],m=[fs({semantics:"query"})],y=[fs],ba(b,null,f,{kind:"method",name:"topology",static:!1,private:!1,access:{has:j=>"topology"in j,get:j=>j.topology},metadata:w},null,u),ba(b,null,d,{kind:"method",name:"updateTopology",static:!1,private:!1,access:{has:j=>"updateTopology"in j,get:j=>j.updateTopology},metadata:w},null,u),ba(b,null,m,{kind:"method",name:"eventCursor",static:!1,private:!1,access:{has:j=>"eventCursor"in j,get:j=>j.eventCursor},metadata:w},null,u),ba(b,null,y,{kind:"method",name:"describe",static:!1,private:!1,access:{has:j=>"describe"in j,get:j=>j.describe},metadata:w},null,u),ba(null,n={value:l},r,{kind:"class",name:l.name,metadata:w},null,a),l=n.value,w&&Object.defineProperty(l,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:w}),Pp(l,a)})(),l})();const Ow=r=>{let n=0xcbf29ce484222325n;for(let a=0;a<r.length;a++)n^=BigInt(r.charCodeAt(a)),n=n*0x100000001b3n&0xffffffffffffffffn;return n.toString(16).padStart(16,"0")},tm=r=>{const n=r.manageRpc,a=r.schema,l=Object.keys(n.exposedNameSpaceInstances).sort().map(u=>{const f=a?.namespaces[u],d=[...n.findNameSpaceMethodMap(u)?.keys()??[]].sort().map(m=>{const y=r.semanticsOf({path:u,method:m});return{name:m,...f?.methods[m]?{signature:f.methods[m]}:{},...y?{semantics:y}:{},...n.exposedAuthority[u]?.has(m)?{requiresAuthority:!0}:{}}});return{name:u,...f?.version?{version:f.version}:{},className:n.exposedNameSpaceInstances[u]?.constructor?.name,methods:d,events:Object.keys(f?.events??{}).sort(),...f?.capabilities?{capabilities:[...f.capabilities].sort()}:{},...f?.component?{component:f.component}:{}}});return Ow(JSON.stringify(l))};class jw extends rr{getTarget;targets=new Map;constructor(n,a){super("",n),this.getTarget=a}async receive(n,a,l){let u;if(this.getTarget&&(u=this.getTarget(l)),u||(u=this.targetExists(l)),u||(u=super.targetExists(l)),!u)throw this.emit(_e.unroutable,{source:a,target:l,reason:"no switch target for this peer"}),new Error(`no route to '${l}': nothing here reaches that peer. If it has only just connected, its presence may not have arrived yet - await it before calling.`);await u.receive(n,a,l)}setTarget(n,a){const u=a===void 0?(d=>d.getName())(n):a;this.targets.set(u,n);let f=!1;return()=>{f||(f=!0,this.targets.delete(u))}}setTargets(n){for(const a of n)this.setTarget(a)}targetExists(n,a=0){let l;return this.targets.forEach(u=>{!l&&!u.isTransport()&&u.targetExists(n,a+1)&&(l=u)}),l}}class Rw{rpc;caller;readyFlag=!1;switch;transports=[];peers=new gm;topology;context;contextResolver;componentChannels;componentLifecycle=new ei.EventEmitter;options={name:"*",transports:[],useMsgPack:!0,readyTimeout:3e4};constructor(n={}){this.options={...this.options,...n},this.rpc=new j0(this.options.name),this.caller=new U0(this.options.name,[],this.options.callTimeout??_m),this.switch=new jw([this.rpc,this.caller]);for(const a of[this.rpc,this.caller,this.switch])a.usePeerRegistry(this.peers);this.rpc.authorize=this.options.authorize,this.rpc.requireIdentity=this.options.requireAuthenticatedPeers??!!this.options.authenticate,this.rpc.resolveIdentity=a=>{for(const l of this.transports){const u=l.getIdentity(a);if(u)return u}},this.rpc.schema=this.options.schema,this.rpc.validation=this.options.validation??(this.options.schema?"described":"off"),this.rpc.validateResults=this.options.validateResults??!1,this.options.validateComponentSnapshots&&(this.rpc.manageRpc.componentContractFor=a=>{const l=this.rpc.schema?.namespaces[a]?.component;return l?{component:l,types:this.rpc.schema?.types}:void 0}),this.rpc.unknownVersion=this.options.unknownVersion??"allow",this.rpc.idempotency=this.options.idempotency,this.rpc.manageRpc.requireExplicitExposure=this.options.requireExplicitExposure??!1,this.options.exposeManagement&&this.rpc.manageRpc.exposeManagement(),this.options.exposeIntrospection&&(this.rpc.manageRpc.exposeClassInstance(new Nw(this.rpc)),this.rpc.schema=Aw(this.rpc.schema)),this.topology=new o0(this.options.name,this.options.topology),this.rpc.hostTopology=this.topology,this.rpc.allowTopologyMutation=this.options.topology?.allowRemoteMutation??!1,this.context=new f0(this.topology),this.topology.onCommitted=()=>this.context.changed(),this.rpc.hostContext=this.context,this.context.push=(a,l)=>{this.rpc.sendEvent(a,km,[l],Ea).catch(()=>{})},this.contextResolver=new Sw(this.context,this.options.name,this.caller,this.componentLifecycle),this.starting=this.topology.init().then(()=>this.buildTransports()).then(()=>{this.readyFlag=!0},a=>{this.initError=a}),this.init().catch(a=>{this.initError=a,this.emitSafely("initError",a)})}initError;starting=Promise.resolve();configuredTransports(){return this.options.transports}async buildTransport(n){if(n instanceof rr)return n;if(n.connect){const a=n;return new Wp(this.options.name,a.connect,[],{...a.path?{path:a.path}:{},...a.credentials?{auth:a.credentials}:{},...a.ca?{ca:a.ca}:{}},!0,a.allowInsecureTls)}}async buildTransports(){const n=dw(this.options.useMsgPack);for(const a of this.configuredTransports()){const l=await this.buildTransport(a);if(!l)throw new Error(`RpcServer '${this.options.name}': no transport can be built from ${JSON.stringify(a)}`);l.codec=n,this.options.relay!==void 0&&"relay"in l&&(l.relay=this.options.relay),this.attach(l)}}announceShape(){if(!this.rpc)return;this.rpc.trackDeclaredEvents();const n=tm(this.rpc);for(const a of this.transports)a.announceShape?.(n)}attach(n){this.transports.push(n),n.announceShape?.(tm(this.rpc)),n.usePeerRegistry(this.peers),n.pipe(this.rpc),n.pipe(this.caller),this.switch?.setTarget(n),n.on(_e.peerGone,a=>this.safely("peerGone",a,()=>{this.rpc.removePeer(a),this.context.dropSubscriber(a),this.peers.delete(a),this.relayPresence(n,a,"offline");for(const l of this.transports){const u=l;u.stopWatchingFor&&u.stopWatchingFor(a).catch(f=>this.emitSafely("presenceError",{peer:a,error:f}))}})),n.on(_e.peerOnline,a=>this.safely("peerOnline",a,()=>this.relayPresence(n,a,"online"))),n.on(_e.connected,()=>{this.caller.resubscribe().catch(a=>this.emitSafely("resubscribeError",a))});for(const a of[_e.disconnected,_e.peerGone,_e.peerDisplaced,_e.connected])n.on(a,l=>this.componentLifecycle.emit(a,l))}relayPresence(n,a,l){for(const u of this.transports){if(u===n)continue;const f=u;f.announcePeer&&f.announcePeer(a,l)}this.advertiseReachability()}advertiseReachability(){for(const n of this.transports)n instanceof Wp&&n.advertise(this.peers.names().filter(a=>a!==this.options.name&&this.peers.get(a)!==n))}emitSafely(n,a){for(const l of this.transports)l.emit(n,a)}safely(n,a,l){try{l()}catch(u){this.emitSafely("presenceError",{what:n,peer:a,error:u})}}async proxy(n,a){return await this.ready(),this.caller.proxy(n,a??"*")}async component(n,a){await this.ready(),this.componentChannels??=new B0(this.caller,this.componentLifecycle);const l=await this.componentChannels.open(n,a);return Nm(l,l.inner)}provideContext(n,a,l){return this.context.provide(n,a,l)}contextOf(n,a){return this.contextResolver.store(n,a)}requireContext(n,a){return this.contextResolver.require(n,a)}captureContext(n,a){return this.contextResolver.capture(n,a)}async close(){await this.starting.catch(()=>{}),this.componentChannels?.closeAll(),this.caller.failPendingCalls("server closed"),this.caller.subscriptions.clear(),await this.caller.close(),await Promise.all(this.transports.map(n=>n.close())),this.transports=[],this.peers.clear()}exposeClassInstance(n,a,l){this.rpc.manageRpc.exposeClassInstance(n,a,l),this.announceShape()}exposeClass(n,a){this.rpc.manageRpc.exposeClass(n,a),this.announceShape()}exposeObject(n,a){this.rpc.manageRpc.exposeObject(n,a),this.announceShape()}expose(n,a){this.rpc.manageRpc.expose(n,a),this.announceShape()}async createRpcInstance(n,a,...l){const u=await this.rpc.manageRpc.createRpcInstance(n,a,...l);return this.announceShape(),u}addTarget(n,a){this.switch?.setTarget(a)}async init(){}async ready(){await this.starting;const n=()=>this.transports.filter(l=>!l.readyFlag).length==0,a=Date.now()+this.options.readyTimeout;for(;!n()||!this.readyFlag;){const l=this.transports.find(u=>u.startupError!==void 0);if(l&&(this.initError=l.startupError),this.initError!==void 0)throw new Error(`RpcServer '${this.options.name}': could not start: ${this.initError instanceof Error?this.initError.message:String(this.initError)}`,{cause:this.initError});if(this.options.readyTimeout>0&&Date.now()>a){const u=this.transports.filter(f=>!f.readyFlag).map(f=>f.getName());throw new Error(`RpcServer '${this.options.name}': transports not ready within ${this.options.readyTimeout} ms: ${u.join(", ")}`)}await new Promise(u=>setTimeout(u,10))}}async awaitPeer(n,a=5e3){const l=Date.now()+a;for(;;){if(this.peers.get(n))return!0;if(Date.now()>=l)return!1;await new Promise(u=>setTimeout(u,20))}}async peersSettled(n=2e3){return await this.ready(),await gw(this.transports,n),this.peers.names().filter(a=>a!==this.options.name)}}const nm="msgrpc-page-name",zw=()=>{const r=new URLSearchParams(window.location.search).get("name")?.trim();if(r)return r;let n=sessionStorage.getItem(nm);return n||sessionStorage.setItem(nm,n=ww("page")),n},Mw=({peer:r,messages:n,onSend:a})=>{const[l,u]=Z.useState(""),[f,d]=Z.useState(null),[m,y]=Z.useState(!1),b=Z.useRef(null);Z.useEffect(()=>{b.current?.scrollIntoView({block:"end"})},[n.length]);const R=async()=>{!l.trim()||!r||(y(!0),d(await a(l.trim()).finally(()=>y(!1))??null),u(""))};return g.jsxs("div",{className:"chat",children:[g.jsxs("header",{children:[g.jsx("h1",{children:"Chat"}),g.jsx("span",{className:"muted mono",children:r??"—"})]}),!r&&g.jsx("p",{className:"muted",children:"Select a peer to talk to it. Any peer running this console can answer."}),r&&g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"chat-log",children:[n.length===0&&g.jsxs("p",{className:"muted",children:["Nothing yet. Say something to ",r,"."]}),n.map((w,j)=>g.jsx("div",{className:w.mine?"said mine":"said",children:g.jsx("span",{className:"text",children:w.text})},`${w.at}-${j}`)),g.jsx("div",{ref:b})]}),g.jsxs("div",{className:"chat-send",children:[g.jsx("input",{className:"control",value:l,placeholder:`say something to ${r}`,onChange:w=>u(w.target.value),onKeyDown:w=>{w.key==="Enter"&&R()}}),g.jsx("button",{className:"primary",disabled:m||!l.trim(),onClick:()=>{R()},children:m?"…":"Send"})]}),f&&g.jsx("p",{className:"muted bad",children:f})]})]})};var fm,hm,dm,os;dm=[Sm("chat")],hm=[fs({injectInvocation:!0})],fm=[fs];class cs{constructor(n){Tc(os,5,this);gp(this,"onMessage");this.onMessage=n}async say(n,a,l){const u=l.context.identity?.name??l.context.source;return this.onMessage(String(u),String(a)),"delivered"}async who(){return{app:"source-rpc console",kind:"browser page"}}}os=mp(null),Vl(os,1,"say",hm,cs),Vl(os,1,"who",fm,cs),cs=Vl(os,0,"ChatService",dm,cs),Tc(os,1,cs);const Cw=1,Uw={chat:{methods:{say:{params:[{kind:"string"},{kind:"string"}],paramNames:["from","text"],returns:{kind:"string"}},who:{params:[],returns:{kind:"object",fields:{app:{type:{kind:"string"}},kind:{type:{kind:"string"}}}}}}}},Dw={schema:Cw,namespaces:Uw},Bw=r=>{if(typeof r!="object"||r===null||Array.isArray(r))return null;const n=r;return!("value"in n)||!("quality"in n)&&!("unit"in n)&&!("forced"in n)?null:{value:n.value,quality:typeof n.quality=="string"?n.quality:void 0,unit:typeof n.unit=="string"?n.unit:void 0,forced:n.forced===!0}},im=r=>typeof r=="string"?r:JSON.stringify(r)??"undefined",sm=({name:r,value:n})=>{const a=Bw(n);return g.jsxs("div",{className:"value-row",children:[g.jsx("span",{className:"value-name mono",children:r}),a?g.jsxs("span",{className:"value mono",children:[im(a.value),a.unit&&g.jsxs("span",{className:"unit",children:[" ",a.unit]})]}):g.jsx("span",{className:"value mono",children:im(n)}),a?.forced&&g.jsx("span",{className:"quality forced",children:"forced"}),a?.quality&&g.jsx("span",{className:`quality q-${a.quality}`,children:a.quality})]})},qw=({peer:r,namespace:n,component:a,server:l,onSubscribed:u})=>{const[f,d]=Z.useState(null),[m,y]=Z.useState(null),[b,R]=Z.useState(!1),w=Z.useCallback(z=>f?f.subscribe(z):()=>{},[f]),j=Z.useCallback(()=>f?.getSnapshot()??null,[f]),L=Z.useSyncExternalStore(w,j);Z.useEffect(()=>()=>{f?.close()},[f]);const K=async()=>{const z=l.current;if(z){R(!0),y(null);try{const X=await z.component(n,r);d(X[Am]),u?.()}catch(X){y(X.message??String(X))}finally{R(!1)}}},P=()=>{d(null),u?.()},W=L?.status==="stale";return g.jsxs("div",{className:`component${W?" stale":""}`,children:[g.jsxs("div",{className:"component-head",children:[g.jsx("span",{className:"comp-label",children:"component"}),L&&g.jsx("span",{className:`status-badge ${L.status}`,children:L.status}),L&&L.receivedAt>0&&g.jsxs("span",{className:"muted",children:["rev ",L.revision," ·"," ",W&&L.staleSince?`last known ${new Date(L.receivedAt).toLocaleTimeString()}, stale since ${new Date(L.staleSince).toLocaleTimeString()}`:`updated ${new Date(L.receivedAt).toLocaleTimeString()}`]}),g.jsxs("span",{className:"muted",children:[a.subscribers," observer",a.subscribers===1?"":"s"]}),!f&&g.jsx("button",{className:"toggle",onClick:()=>{K()},disabled:b,children:b?"observing…":"observe"}),f&&g.jsx("button",{className:"toggle on",onClick:P,children:"stop"})]}),m&&g.jsx("p",{className:"component-error",children:m}),!f&&!m&&g.jsx("p",{className:"muted",children:"Cached props and state, read without a call. Observe to subscribe."}),f&&L&&L.receivedAt>0&&g.jsxs("div",{className:"component-body",children:[g.jsxs("div",{className:"value-table",children:[g.jsx("h4",{children:"props"}),Object.entries(L.props).map(([z,X])=>g.jsx(sm,{name:z,value:X},z)),Object.keys(L.props).length===0&&g.jsx("p",{className:"muted",children:"empty"})]}),g.jsxs("div",{className:"value-table",children:[g.jsx("h4",{children:"state"}),Object.entries(L.state).map(([z,X])=>g.jsx(sm,{name:z,value:X},z)),Object.keys(L.state).length===0&&g.jsx("p",{className:"muted",children:"empty"})]})]})]})},am=(r,n)=>r.peer===n?r.instance:`${r.peer}/${r.instance}`,Lw=({owner:r,home:n,peers:a,onSelectPeer:l})=>r.peer!==n&&a.includes(r.peer)?g.jsxs("button",{className:"owner-chip link",onClick:()=>l(r.peer),title:`owned by ${r.peer}/${r.instance} - select that peer`,children:["⤳ ",am(r,n)]}):g.jsxs("span",{className:"owner-chip",title:"logical owner",children:["⤳ ",am(r,n)]}),Jm=({namespace:r,childrenOf:n,home:a,peers:l,onSelectPeer:u})=>g.jsxs("li",{children:[g.jsxs("span",{className:"node",children:[g.jsx("span",{className:"mono",children:r.name}),r.topology?.label&&g.jsx("span",{className:"node-label",children:r.topology.label}),r.topology?.owner&&g.jsx(Lw,{owner:r.topology.owner,home:a,peers:l,onSelectPeer:u})]}),n(r.name).length>0&&g.jsx("ul",{children:n(r.name).map(f=>g.jsx(Jm,{namespace:f,childrenOf:n,home:a,peers:l,onSelectPeer:u},f.name))})]}),Hw=({description:r,peers:n,onSelectPeer:a})=>{const l=r.name,u=r.namespaces.filter(b=>b.topology);if(!r.host&&u.length===0)return null;const f=new Set,d=b=>f.has(b)?[]:(f.add(b),u.filter(R=>R.topology.parent?.instance===b&&R.topology.parent?.peer===l)),m=u.filter(b=>b.topology.parent===null||b.topology.parent.instance==="$host"),y=r.host?.place?.join(" / ")??l;return g.jsxs("div",{className:"structure",children:[g.jsxs("div",{className:"structure-head",children:[g.jsx("span",{className:"comp-label",children:"structure"}),g.jsx("span",{className:"mono",children:y}),r.host?.label&&g.jsx("span",{className:"node-label",children:r.host.label}),r.host?.parent&&g.jsxs("span",{className:"muted",children:["attached under"," ",n.includes(r.host.parent.peer)?g.jsx("button",{className:"owner-chip link",onClick:()=>a(r.host.parent.peer),children:r.host.parent.peer}):g.jsx("span",{className:"mono",children:r.host.parent.peer})]}),r.host&&g.jsxs("span",{className:"muted",title:"which topology guarantees this host actually offers",children:[r.host.capabilities.durability," · cycles ",r.host.capabilities.cycleGuarantee]})]}),m.length===0&&g.jsx("p",{className:"muted",children:"Nothing declares a place on this host yet."}),m.length>0&&g.jsx("ul",{className:"tree",children:m.map(b=>g.jsx(Jm,{namespace:b,childrenOf:d,home:l,peers:n,onSelectPeer:a},b.name))})]})},Fm=()=>new URL(".",document.baseURI),$w="console.json",Yw=async()=>{const r=await fetch(new URL($w,Fm()));if(!r.ok)throw new Error(`the console did not say who it is (${r.status})`);return(await r.json()).name},Vw=()=>`${Fm().pathname}socket.io`,ps=(r,n)=>r?.kind==="ref"?ps(n?.[r.name],n):r,sn=r=>{if(!r)return"unknown";switch(r.kind){case"literal":return JSON.stringify(r.value);case"array":return`${sn(r.items)}[]`;case"tuple":return`[${r.items.map(sn).join(", ")}]`;case"union":return r.options.map(sn).join(" | ");case"ref":return r.name;case"object":return`{ ${Object.entries(r.fields).map(([n,a])=>`${n}${a.optional?"?":""}: ${sn(a.type)}`).join(", ")} }`;case"record":return`{ [key: string]: ${sn(r.values)} }`;case"number":return r.min!==void 0||r.max!==void 0?`number(${r.min??""}..${r.max??""})`:"number";default:return r.kind}},sr=r=>r?.kind==="any"||r?.kind==="union"&&r.options.some(n=>n.kind==="literal"&&n.value===null),xi=r=>{if(r?.kind!=="union")return r;const n=r.options.filter(a=>!(a.kind==="literal"&&a.value===null));return n.length===1?n[0]:{...r,options:n}},lr=r=>{if(r?.kind!=="union")return;const n=r.options.filter(a=>a.kind==="literal").map(a=>a.value);return n.length===r.options.length&&n.length>0?n:void 0},Wm=r=>{const n=r.replace(/[\s:]/g,"");if(n.length%2)throw new Error("expected an even number of hex digits");if(n&&!/^[0-9a-fA-F]+$/.test(n))throw new Error("expected hex digits");return Uint8Array.from(n.match(/../g)?.map(a=>parseInt(a,16))??[])},Xw=r=>r.options.find(n=>!(n.kind==="literal"&&n.value===null))??r.options[0],ar=(r,n,a=0)=>{const l=ps(xi(r),n);if(!l||a>4)return null;switch(l.kind){case"number":return l.min??0;case"string":case"bytes":return"";case"boolean":return!1;case"date":return new Date;case"literal":return l.value;case"array":return[];case"record":return{};case"tuple":return l.items.map(u=>ar(u,n,a+1));case"union":return ar(Xw(l),n,a+1);case"object":return Object.fromEntries(Object.entries(l.fields).filter(([,u])=>!u.optional).map(([u,f])=>[u,ar(f.type,n,a+1)]));default:return null}},us=(r,n,a,l=0)=>{const u=ps(n,a);if(!u||r===null||r===void 0||l>8)return r;switch(u.kind){case"date":return typeof r=="string"||typeof r=="number"?new Date(r):r;case"bytes":return typeof r=="string"?Wm(r):r;case"array":return Array.isArray(r)?r.map(f=>us(f,u.items,a,l+1)):r;case"tuple":return Array.isArray(r)?r.map((f,d)=>us(f,u.items[d],a,l+1)):r;case"object":return typeof r!="object"||Array.isArray(r)?r:Object.fromEntries(Object.entries(r).map(([f,d])=>[f,us(d,u.fields[f]?.type,a,l+1)]));case"record":return typeof r!="object"||Array.isArray(r)?r:Object.fromEntries(Object.entries(r).map(([f,d])=>[f,us(d,u.values,a,l+1)]));case"union":{const f=u.options.filter(d=>!(d.kind==="literal"&&d.value===null));return f.length===1?us(r,f[0],a,l+1):r}default:return r}},Gw=(r,n,a)=>{const l=ps(xi(n),a),u=r.trim();switch(l?.kind){case"number":{if(u==="")throw new Error("expected a number");const f=Number(u);if(Number.isNaN(f))throw new Error(`${u} is not a number`);return f}case"boolean":return u==="true";case"string":return r;case"date":{const f=new Date(u);if(Number.isNaN(f.getTime()))throw new Error("expected a date");return f}case"bytes":return Wm(u);case"literal":return l.value;default:{if(lr(l)){const d=lr(l).find(m=>String(m)===u);if(d!==void 0)return d}if(u==="")return;let f;try{f=JSON.parse(u)}catch{throw new Error("expected JSON")}return us(f,xi(n),a)}}},Qw=(r,n)=>{const a=ps(xi(r),n),l=lr(a);if(l)return String(l[0]);switch(a?.kind){case"number":return String(a.min??0);case"boolean":return"false";case"date":return new Date().toISOString().slice(0,16);case"array":return"[]";case"record":return"{}";case"tuple":case"object":return JSON.stringify(ar(a,n),null,2);default:return""}},Kw=({name:r,type:n,types:a,state:l,onChange:u})=>{const f=sr(n),d=ps(xi(n),a),m=lr(d),y=w=>u({...l,text:w}),b=f&&!l.include,R=()=>{if(m)return g.jsx("select",{className:"control",value:l.text,disabled:b,onChange:w=>y(w.target.value),children:m.map(w=>g.jsx("option",{value:String(w),children:String(w)},String(w)))});switch(d?.kind){case"boolean":return g.jsxs("label",{className:"checkbox",children:[g.jsx("input",{type:"checkbox",checked:l.text==="true",disabled:b,onChange:w=>y(String(w.target.checked))}),g.jsx("span",{children:l.text==="true"?"true":"false"})]});case"number":return g.jsx("input",{className:"control",type:"number",value:l.text,disabled:b,min:d.min,max:d.max,step:d.integer?1:"any",onChange:w=>y(w.target.value)});case"date":return g.jsx("input",{className:"control",type:"datetime-local",value:l.text,disabled:b,onChange:w=>y(w.target.value)});case"string":return g.jsx("input",{className:"control",type:"text",value:l.text,disabled:b,onChange:w=>y(w.target.value)});case"bytes":return g.jsx("input",{className:"control mono",type:"text",placeholder:"hex, e.g. 01 ff 2a",value:l.text,disabled:b,onChange:w=>y(w.target.value)});default:return g.jsx("textarea",{className:"control mono",rows:Math.min(12,Math.max(2,l.text.split(`
|
|
2058
|
-
`).length)),placeholder:"JSON",value:l.text,disabled:
|
|
2057
|
+
`));Eu.length;const Fx=a=>{const n=new Uint32Array(a);return crypto.getRandomValues(n),[...n].map(s=>s%Eu.length)},Wx=(a=3)=>Fx(a).map(n=>Eu[n]).join("-"),Ix=(a,n=3)=>`${a}-${Wx(n)}`,Mm=128;class Px{local;peer;caller;chains=new Map;constructor(n,s,l,o){this.local=n,this.peer=s,this.caller=l,n.on("contextChanged",()=>{for(const f of this.chains.values())f.localChanged()}),o.on(ve.disconnected,()=>{for(const f of this.chains.values())f.markStale()});for(const f of[ve.peerGone,ve.peerDisplaced])o.on(f,d=>{for(const p of this.chains.values())p.peerLost(String(d))});o.on(ve.connected,()=>{for(const f of this.chains.values())f.reconnect()})}store(n,s){let l=this.chains.get(n);return l||this.chains.set(n,l=new Cm(this,n,()=>this.chains.delete(n))),l.storeFor(s)}storeAt(n,s){if(n.peer===this.peer)return this.store(n.instance,s);const l=`${n.peer}\0${n.instance}`;let o=this.chains.get(l);return o||this.chains.set(l,o=new Cm(this,n.instance,()=>this.chains.delete(l),n)),o.storeFor(s)}require(n,s){const l=this.store(n,s).getSnapshot();if(l.status==="invalid")throw new Error(`context: ${s.id} at ${n} is invalid (${l.invalidReason}) - topology-dependent decisions fail closed`);if(l.status==="missing")throw new Error(`context: nothing provides ${s.id} on ${n}'s ${s.axis} chain`);if(l.status==="stale"&&(s.stalePolicy??"allow")==="reject")throw new Error(`context: ${s.id} at ${n} is stale, and this token rejects stale answers`);if(l.status!=="live"&&l.status!=="stale")throw new Error(`context: ${s.id} at ${n} is still ${l.status}`);const o=l.entry??l.entries?.[0];if(!o)throw new Error(`context: nothing provides ${s.id} on ${n}'s ${s.axis} chain`);return o.value}capture(n,s){return Tb({peer:this.peer,instance:n},s.map(l=>{const o=this.store(n,l).getSnapshot(),f=o.entry??o.entries?.[0];return{token:l,...f&&(o.status==="live"||o.status==="stale")?{entry:{tokenId:l.id,schemaVersion:l.schemaVersion,axis:l.axis,provider:f.provider,providerVersion:f.providerVersion,mountEpoch:o.mountEpoch,value:f.value}}:{}}}))}}class Cm{resolver;node;release;origin;tokens=new Map;hops={physical:[],logical:[]};localSnapshot;retired=new Set;cycles={};mountKeys={};mountEpochs={};reasons={};constructor(n,s,l,o){this.resolver=n,this.node=s,this.release=l,this.origin=o}storeFor(n){let s=this.tokens.get(n.id);s||(s={token:n,view:{tokenId:n.id,axis:n.axis,status:"initializing",mountEpoch:"",resolvedAt:0,transitionReason:"initial-load"},listeners:new Set,users:0},this.tokens.set(n.id,s),this.localChanged()),s.users++;const l=s;return{getSnapshot:()=>l.view,subscribe:o=>(l.listeners.add(o),()=>l.listeners.delete(o)),close:()=>{if(l.users--,!(l.users>0)&&(l.view={...l.view,status:"closed"},this.notify(l),this.tokens.delete(l.token.id),this.tokens.size===0)){for(const o of["physical","logical"])this.retireFrom(o,0);this.release()}}}}localChanged(){this.origin||(this.localSnapshot=this.resolver.local.snapshotFor(this.node,[...this.tokens.keys()],0,!1)),this.rebuild("physical"),this.rebuild("logical");for(const n of["physical","logical"])for(const s of this.hops[n])s.retired||(s.peer===this.resolver.peer||s.tokenKey!==this.tokensFor(n).join(","))&&this.open(s);this.recompute()}markStale(){for(const n of["physical","logical"])for(const s of this.hops[n])s.stale=!0;this.recompute()}peerLost(n){for(const s of["physical","logical"])for(const l of this.hops[s])l.peer===n&&(l.stale=!0);this.recompute()}reconnect(){for(const n of["physical","logical"])for(const s of this.hops[n])s.stale&&!s.retired&&(this.reasons[n]="reconnect",this.open(s))}rebuild(n){const s=this.hops[n];this.cycles[n]=void 0;let l=[...this.localSnapshot?.walked[n]??[]],o=this.origin??this.localSnapshot?.continues[n],f=0;for(;o;){const d=o,p=l.findIndex(k=>Ip(k,d));if(p!==-1){this.cycles[n]=l.slice(p),this.retireFrom(n,f);return}const g=s[f];if(g&&g.peer===o.peer&&g.node===o.instance){g.snapshot&&(l=[...l,...g.snapshot.walked[n]]),o=g.snapshot?.continues[n],f++;continue}this.retireFrom(n,f);const v={peer:o.peer,node:o.instance,axis:n,subscriptionId:et(),stale:!1,retired:!1};s[f]=v,this.open(v),o=void 0,f++}this.retireFrom(n,f)}retireFrom(n,s){const l=this.hops[n];for(const o of l.splice(s)){o.retired=!0,this.retired.add(o.subscriptionId),o.detach?.();const f=this.resolver.caller.proxy(ps,o.peer);Promise.resolve(f.unsubscribe(o.subscriptionId)).catch(()=>{})}}tokensFor(n){return[...this.tokens.values()].filter(s=>s.token.axis===n).map(s=>s.token.id)}async open(n){if(n.tokenKey=this.tokensFor(n.axis).join(","),n.peer===this.resolver.peer){this.accept(n,this.resolver.local.snapshotFor(n.node,this.tokensFor(n.axis),0,!1));return}const s=this.resolver.caller.eventEmitter;if(!n.detach){const l=sl(n.peer,ps,cy),o=f=>{const d=f;d.subscriptionId!==n.subscriptionId||n.retired||n.snapshot&&d.snapshot.seq<=n.snapshot.seq||this.accept(n,d.snapshot)};s.on(l,o),n.detach=()=>{s.removeListener(l,o)}}try{const o=await this.resolver.caller.proxy(ps,n.peer).subscribe(n.subscriptionId,n.node,this.tokensFor(n.axis));if(n.retired)return;n.stale=!1,this.accept(n,o)}catch{n.retired||(n.stale=!0,this.recompute(),setTimeout(()=>{!n.retired&&n.stale&&this.open(n)},2e3).unref?.())}}accept(n,s){const l=!n.snapshot||!Ip(n.snapshot.continues[n.axis]??null,s.continues[n.axis]??null);n.snapshot=s,n.stale=!1,l&&this.rebuild(n.axis),this.recompute()}recompute(){for(const n of this.tokens.values()){const s=n.token.axis,l=this.hops[s],o=[...this.localSnapshot?[this.localSnapshot]:[],...l.flatMap(S=>S.snapshot?[S.snapshot]:[])],f=o.map(S=>S.chainKey[s]).join(" ")+" "+l.map(S=>S.subscriptionId).join(" ");let d=!1;this.mountKeys[s]!==f&&(this.mountKeys[s]!==void 0&&this.reasons[s]!=="reconnect"&&(this.reasons[s]=s==="logical"?"owner-remount":"parent-remount"),this.mountKeys[s]=f,this.mountEpochs[s]=et(),d=!0);const p=this.mountEpochs[s]??"",g=this.reasons[s]??"initial-load",v=o.flatMap(S=>S.trouble.filter(A=>A.axis===s)),k=l.some(S=>!S.snapshot&&!S.retired),b=l.some(S=>S.stale&&!S.retired),_=o.flatMap(S=>S.walked[s]),G=this.cycles[s],V=o.flatMap(S=>(S.tokens.find(A=>A.tokenId===n.token.id)?.entries??[]).filter(A=>A.axis===s).map(A=>({value:A.value,provider:A.node,providerVersion:A.provider}))),J=!k&&!b,F=d&&(n.view.entry||n.view.entries)?{previous:n.view.entry??n.view.entries}:n.view.previous?{previous:n.view.previous}:{};let M;const Y={tokenId:n.token.id,axis:s,mountEpoch:p,resolvedAt:Date.now(),transitionReason:g,...F};if(v.length||G||_.length>Mm){const S=v[0];M={...Y,status:"invalid",invalidReason:G?"cycle":_.length>Mm?"depth-exceeded":S.status==="cycle"?"cycle":S.status,...G?{invalidPath:G}:S?.path?{invalidPath:S.path}:{}}}else if(k)M={...Y,status:"initializing"};else if(V.length===0)M={...Y,status:b?"stale":"missing",...b?{staleSince:n.view.staleSince??Date.now()}:{}};else{const S=n.token.resolution??"nearest";M={...Y,status:b?"stale":"live",...b?{staleSince:n.view.staleSince??Date.now()}:{},...S==="nearest"?{entry:V[0]}:{entries:V}}}M.status==="stale"&&!M.entry&&!M.entries&&(n.view.entry||n.view.entries)&&(M={...M,...n.view.entry?{entry:n.view.entry}:{},...n.view.entries?{entries:n.view.entries}:{}}),J&&M.status==="live"&&(this.reasons[s]=void 0),JSON.stringify({...n.view,resolvedAt:0})!==JSON.stringify({...M,resolvedAt:0})&&(n.view=M,this.notify(n))}}notify(n){for(const s of[...n.listeners])try{s()}catch{}}}const eS=a=>typeof a.elevation=="function",tS=(a,n=Date.now())=>a.filter(s=>s.until===void 0||s.until>n).sort((s,l)=>(l.since??0)-(s.since??0)),nS=JSON.parse('{"RpcTopologyRecord":{"kind":"object","fields":{"ref":{"type":{"kind":"ref","name":"RpcRef"}},"parent":{"type":{"kind":"union","options":[{"kind":"null"},{"kind":"ref","name":"RpcRef"}]},"optional":true},"owner":{"type":{"kind":"union","options":[{"kind":"null"},{"kind":"ref","name":"RpcRef"}]},"optional":true},"parentEpoch":{"type":{"kind":"string"}},"ownerEpoch":{"type":{"kind":"string"}},"version":{"type":{"kind":"ref","name":"RpcTopologyVersion"}},"label":{"type":{"kind":"string"},"optional":true}}},"RpcRef":{"kind":"object","fields":{"peer":{"type":{"kind":"string"}},"instance":{"type":{"kind":"string"}}}},"RpcTopologyVersion":{"kind":"object","fields":{"epoch":{"type":{"kind":"string"}},"revision":{"type":{"kind":"number"}}}},"RpcTopologyCapabilities":{"kind":"object","fields":{"authorityScope":{"type":{"kind":"literal","value":"host"}},"cycleGuarantee":{"type":{"kind":"literal","value":"detected"}},"reverseIndex":{"type":{"kind":"literal","value":"eventual"}},"deletion":{"type":{"kind":"literal","value":"tombstone"}},"durability":{"type":{"kind":"union","options":[{"kind":"literal","value":"volatile"},{"kind":"literal","value":"durable"}]}}}},"RpcTopologyPatch":{"kind":"object","fields":{"parent":{"type":{"kind":"union","options":[{"kind":"null"},{"kind":"ref","name":"RpcRef"}]},"optional":true},"owner":{"type":{"kind":"union","options":[{"kind":"null"},{"kind":"ref","name":"RpcRef"}]},"optional":true},"label":{"type":{"kind":"string"},"optional":true}}},"RpcTopologyMutation":{"kind":"object","fields":{"expectedVersion":{"type":{"kind":"ref","name":"RpcTopologyVersion"}},"reason":{"type":{"kind":"string"},"optional":true}}},"ServerDescription":{"kind":"object","fields":{"name":{"type":{"kind":"string"}},"version":{"type":{"kind":"string"},"optional":true},"validating":{"type":{"kind":"boolean"}},"namespaces":{"type":{"kind":"array","items":{"kind":"ref","name":"DescribedNamespace"}}},"elevated":{"type":{"kind":"array","items":{"kind":"ref","name":"RpcElevation"}},"optional":true},"host":{"type":{"kind":"object","fields":{"root":{"type":{"kind":"ref","name":"RpcRef"}},"parent":{"type":{"kind":"union","options":[{"kind":"null"},{"kind":"ref","name":"RpcRef"}]},"optional":true},"owner":{"type":{"kind":"union","options":[{"kind":"null"},{"kind":"ref","name":"RpcRef"}]},"optional":true},"place":{"type":{"kind":"array","items":{"kind":"string"}},"optional":true},"label":{"type":{"kind":"string"},"optional":true},"capabilities":{"type":{"kind":"ref","name":"RpcTopologyCapabilities"}}}},"optional":true},"types":{"type":{"kind":"record","values":{"kind":"ref","name":"TypeNode"}},"optional":true}}},"DescribedNamespace":{"kind":"object","fields":{"name":{"type":{"kind":"string"}},"version":{"type":{"kind":"string"},"optional":true},"className":{"type":{"kind":"string"},"optional":true},"created":{"type":{"kind":"boolean"}},"emitter":{"type":{"kind":"boolean"}},"serialised":{"type":{"kind":"boolean"},"optional":true},"component":{"type":{"kind":"ref","name":"DescribedComponent"},"optional":true},"topology":{"type":{"kind":"ref","name":"DescribedTopology"},"optional":true},"capabilities":{"type":{"kind":"array","items":{"kind":"string"}},"optional":true},"methods":{"type":{"kind":"array","items":{"kind":"ref","name":"DescribedMethod"}}},"events":{"type":{"kind":"array","items":{"kind":"ref","name":"DescribedEvent"}}}}},"DescribedComponent":{"kind":"object","fields":{"props":{"type":{"kind":"union","options":[{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"any"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"null"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"boolean"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"number"}},"integer":{"type":{"kind":"boolean"},"optional":true},"min":{"type":{"kind":"number"},"optional":true},"max":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"string"}},"pattern":{"type":{"kind":"string"},"optional":true},"minLength":{"type":{"kind":"number"},"optional":true},"maxLength":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"bytes"}},"maxBytes":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"date"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"literal"}},"value":{"type":{"kind":"union","options":[{"kind":"null"},{"kind":"string"},{"kind":"number"},{"kind":"literal","value":false},{"kind":"literal","value":true}]},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"array"}},"items":{"type":{"kind":"ref","name":"TypeNode"}},"maxItems":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"tuple"}},"items":{"type":{"kind":"array","items":{"kind":"ref","name":"TypeNode"}}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"object"}},"fields":{"type":{"kind":"record","values":{"kind":"ref","name":"FieldNode"}}},"additional":{"type":{"kind":"boolean"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"record"}},"values":{"type":{"kind":"ref","name":"TypeNode"}},"keyPattern":{"type":{"kind":"string"},"optional":true},"maxEntries":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"union"}},"options":{"type":{"kind":"array","items":{"kind":"ref","name":"TypeNode"}}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"ref"}},"name":{"type":{"kind":"string"}}}}]},"optional":true},"state":{"type":{"kind":"union","options":[{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"any"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"null"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"boolean"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"number"}},"integer":{"type":{"kind":"boolean"},"optional":true},"min":{"type":{"kind":"number"},"optional":true},"max":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"string"}},"pattern":{"type":{"kind":"string"},"optional":true},"minLength":{"type":{"kind":"number"},"optional":true},"maxLength":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"bytes"}},"maxBytes":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"date"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"literal"}},"value":{"type":{"kind":"union","options":[{"kind":"null"},{"kind":"string"},{"kind":"number"},{"kind":"literal","value":false},{"kind":"literal","value":true}]},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"array"}},"items":{"type":{"kind":"ref","name":"TypeNode"}},"maxItems":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"tuple"}},"items":{"type":{"kind":"array","items":{"kind":"ref","name":"TypeNode"}}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"object"}},"fields":{"type":{"kind":"record","values":{"kind":"ref","name":"FieldNode"}}},"additional":{"type":{"kind":"boolean"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"record"}},"values":{"type":{"kind":"ref","name":"TypeNode"}},"keyPattern":{"type":{"kind":"string"},"optional":true},"maxEntries":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"union"}},"options":{"type":{"kind":"array","items":{"kind":"ref","name":"TypeNode"}}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"ref"}},"name":{"type":{"kind":"string"}}}}]},"optional":true},"subscribers":{"type":{"kind":"number"}},"resources":{"type":{"kind":"array","items":{"kind":"ref","name":"RpcDataResource"}},"optional":true}}},"TypeNode":{"kind":"union","options":[{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"any"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"null"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"boolean"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"number"}},"integer":{"type":{"kind":"boolean"},"optional":true},"min":{"type":{"kind":"number"},"optional":true},"max":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"string"}},"pattern":{"type":{"kind":"string"},"optional":true},"minLength":{"type":{"kind":"number"},"optional":true},"maxLength":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"bytes"}},"maxBytes":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"date"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"literal"}},"value":{"type":{"kind":"union","options":[{"kind":"null"},{"kind":"string"},{"kind":"number"},{"kind":"literal","value":false},{"kind":"literal","value":true}]},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"array"}},"items":{"type":{"kind":"ref","name":"TypeNode"}},"maxItems":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"tuple"}},"items":{"type":{"kind":"array","items":{"kind":"ref","name":"TypeNode"}}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"object"}},"fields":{"type":{"kind":"record","values":{"kind":"ref","name":"FieldNode"}}},"additional":{"type":{"kind":"boolean"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"record"}},"values":{"type":{"kind":"ref","name":"TypeNode"}},"keyPattern":{"type":{"kind":"string"},"optional":true},"maxEntries":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"union"}},"options":{"type":{"kind":"array","items":{"kind":"ref","name":"TypeNode"}}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"ref"}},"name":{"type":{"kind":"string"}}}}]},"FieldNode":{"kind":"object","fields":{"type":{"type":{"kind":"ref","name":"TypeNode"}},"optional":{"type":{"kind":"boolean"},"optional":true}}},"RpcDataResource":{"kind":"object","fields":{"path":{"type":{"kind":"array","items":{"kind":"string"}}},"row":{"type":{"kind":"union","options":[{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"any"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"null"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"boolean"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"number"}},"integer":{"type":{"kind":"boolean"},"optional":true},"min":{"type":{"kind":"number"},"optional":true},"max":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"string"}},"pattern":{"type":{"kind":"string"},"optional":true},"minLength":{"type":{"kind":"number"},"optional":true},"maxLength":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"bytes"}},"maxBytes":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"date"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"literal"}},"value":{"type":{"kind":"union","options":[{"kind":"null"},{"kind":"string"},{"kind":"number"},{"kind":"literal","value":false},{"kind":"literal","value":true}]},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"array"}},"items":{"type":{"kind":"ref","name":"TypeNode"}},"maxItems":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"tuple"}},"items":{"type":{"kind":"array","items":{"kind":"ref","name":"TypeNode"}}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"object"}},"fields":{"type":{"kind":"record","values":{"kind":"ref","name":"FieldNode"}}},"additional":{"type":{"kind":"boolean"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"record"}},"values":{"type":{"kind":"ref","name":"TypeNode"}},"keyPattern":{"type":{"kind":"string"},"optional":true},"maxEntries":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"union"}},"options":{"type":{"kind":"array","items":{"kind":"ref","name":"TypeNode"}}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"ref"}},"name":{"type":{"kind":"string"}}}}]},"optional":true},"verbs":{"type":{"kind":"array","items":{"kind":"ref","name":"RpcDataMethod"}}},"shape":{"type":{"kind":"union","options":[{"kind":"literal","value":"list"},{"kind":"literal","value":"tree"}]},"optional":true},"label":{"type":{"kind":"string"},"optional":true},"actions":{"type":{"kind":"array","items":{"kind":"ref","name":"RpcDataAction"}},"optional":true}}},"RpcDataMethod":{"kind":"union","options":[{"kind":"literal","value":"getList"},{"kind":"literal","value":"getOne"},{"kind":"literal","value":"getMany"},{"kind":"literal","value":"getManyReference"}]},"RpcDataAction":{"kind":"object","fields":{"method":{"type":{"kind":"string"}},"label":{"type":{"kind":"string"},"optional":true},"confirm":{"type":{"kind":"boolean"},"optional":true}}},"DescribedTopology":{"kind":"object","fields":{"parent":{"type":{"kind":"union","options":[{"kind":"null"},{"kind":"ref","name":"RpcRef"}]},"optional":true},"owner":{"type":{"kind":"union","options":[{"kind":"null"},{"kind":"ref","name":"RpcRef"}]},"optional":true},"parentEpoch":{"type":{"kind":"string"}},"ownerEpoch":{"type":{"kind":"string"}},"label":{"type":{"kind":"string"},"optional":true}}},"DescribedMethod":{"kind":"object","fields":{"name":{"type":{"kind":"string"}},"params":{"type":{"kind":"array","items":{"kind":"ref","name":"TypeNode"}},"optional":true},"paramNames":{"type":{"kind":"array","items":{"kind":"string"}},"optional":true},"rest":{"type":{"kind":"union","options":[{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"any"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"null"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"boolean"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"number"}},"integer":{"type":{"kind":"boolean"},"optional":true},"min":{"type":{"kind":"number"},"optional":true},"max":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"string"}},"pattern":{"type":{"kind":"string"},"optional":true},"minLength":{"type":{"kind":"number"},"optional":true},"maxLength":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"bytes"}},"maxBytes":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"date"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"literal"}},"value":{"type":{"kind":"union","options":[{"kind":"null"},{"kind":"string"},{"kind":"number"},{"kind":"literal","value":false},{"kind":"literal","value":true}]},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"array"}},"items":{"type":{"kind":"ref","name":"TypeNode"}},"maxItems":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"tuple"}},"items":{"type":{"kind":"array","items":{"kind":"ref","name":"TypeNode"}}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"object"}},"fields":{"type":{"kind":"record","values":{"kind":"ref","name":"FieldNode"}}},"additional":{"type":{"kind":"boolean"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"record"}},"values":{"type":{"kind":"ref","name":"TypeNode"}},"keyPattern":{"type":{"kind":"string"},"optional":true},"maxEntries":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"union"}},"options":{"type":{"kind":"array","items":{"kind":"ref","name":"TypeNode"}}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"ref"}},"name":{"type":{"kind":"string"}}}}]},"optional":true},"returns":{"type":{"kind":"union","options":[{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"any"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"null"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"boolean"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"number"}},"integer":{"type":{"kind":"boolean"},"optional":true},"min":{"type":{"kind":"number"},"optional":true},"max":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"string"}},"pattern":{"type":{"kind":"string"},"optional":true},"minLength":{"type":{"kind":"number"},"optional":true},"maxLength":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"bytes"}},"maxBytes":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"date"}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"literal"}},"value":{"type":{"kind":"union","options":[{"kind":"null"},{"kind":"string"},{"kind":"number"},{"kind":"literal","value":false},{"kind":"literal","value":true}]},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"array"}},"items":{"type":{"kind":"ref","name":"TypeNode"}},"maxItems":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"tuple"}},"items":{"type":{"kind":"array","items":{"kind":"ref","name":"TypeNode"}}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"object"}},"fields":{"type":{"kind":"record","values":{"kind":"ref","name":"FieldNode"}}},"additional":{"type":{"kind":"boolean"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"record"}},"values":{"type":{"kind":"ref","name":"TypeNode"}},"keyPattern":{"type":{"kind":"string"},"optional":true},"maxEntries":{"type":{"kind":"number"},"optional":true}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"union"}},"options":{"type":{"kind":"array","items":{"kind":"ref","name":"TypeNode"}}}}},{"kind":"object","fields":{"kind":{"type":{"kind":"literal","value":"ref"}},"name":{"type":{"kind":"string"}}}}]},"optional":true},"semantics":{"type":{"kind":"union","options":[{"kind":"literal","value":"query"},{"kind":"literal","value":"idempotent-command"},{"kind":"literal","value":"non-repeatable-command"}]},"optional":true},"effect":{"type":{"kind":"union","options":[{"kind":"literal","value":"observe"},{"kind":"literal","value":"operate"},{"kind":"literal","value":"program"},{"kind":"literal","value":"security-admin"}]},"optional":true},"sets":{"type":{"kind":"string"},"optional":true},"requiresAuthority":{"type":{"kind":"boolean"},"optional":true}}},"DescribedEvent":{"kind":"object","fields":{"name":{"type":{"kind":"string"}},"params":{"type":{"kind":"array","items":{"kind":"ref","name":"TypeNode"}},"optional":true},"subscribers":{"type":{"kind":"number"}}}},"RpcElevation":{"kind":"object","fields":{"capability":{"type":{"kind":"string"}},"reason":{"type":{"kind":"string"},"optional":true},"since":{"type":{"kind":"number"},"optional":true},"until":{"type":{"kind":"number"},"optional":true},"grantedBy":{"type":{"kind":"string"},"optional":true}}}}'),iS={msgrpc:{methods:{topology:{params:[],returns:{kind:"object",fields:{records:{type:{kind:"array",items:{kind:"ref",name:"RpcTopologyRecord"}}},place:{type:{kind:"array",items:{kind:"string"}},optional:!0},capabilities:{type:{kind:"ref",name:"RpcTopologyCapabilities"}}}},semantics:"query"},updateTopology:{params:[{kind:"string"},{kind:"ref",name:"RpcTopologyPatch"},{kind:"ref",name:"RpcTopologyMutation"}],paramNames:["instance","patch","mutation"],returns:{kind:"ref",name:"RpcTopologyRecord"},semantics:"idempotent-command"},eventCursor:{params:[{kind:"string"},{kind:"string"}],paramNames:["namespace","event"],returns:{kind:"object",fields:{epoch:{type:{kind:"string"}},seq:{type:{kind:"union",options:[{kind:"null"},{kind:"number"}]},optional:!0},since:{type:{kind:"number"},optional:!0}}},semantics:"query"},describe:{params:[],returns:{kind:"ref",name:"ServerDescription"},semantics:"query"}}}},sS={types:nS,namespaces:iS};var zm=function(a,n,s){for(var l=arguments.length>2,o=0;o<n.length;o++)s=l?n[o].call(a,s):n[o].call(a);return l?s:void 0},Ea=function(a,n,s,l,o,f){function d(M){if(M!==void 0&&typeof M!="function")throw new TypeError("Function expected");return M}for(var p=l.kind,g=p==="getter"?"get":p==="setter"?"set":"value",v=!n&&a?l.static?a:a.prototype:null,k=n||(v?Object.getOwnPropertyDescriptor(v,l.name):{}),b,_=!1,G=s.length-1;G>=0;G--){var V={};for(var J in l)V[J]=J==="access"?{}:l[J];for(var J in l.access)V.access[J]=l.access[J];V.addInitializer=function(M){if(_)throw new TypeError("Cannot add initializers after decoration has completed");f.push(d(M||null))};var F=(0,s[G])(p==="accessor"?{get:k.get,set:k.set}:k[g],V);if(p==="accessor"){if(F===void 0)continue;if(F===null||typeof F!="object")throw new TypeError("Object expected");(b=d(F.get))&&(k.get=b),(b=d(F.set))&&(k.set=b),(b=d(F.init))&&o.unshift(b)}else(b=d(F))&&(p==="field"?o.unshift(b):k[g]=b)}v&&Object.defineProperty(v,l.name,k),_=!0};const qy="msgrpc.",rn=a=>{switch(a.kind){case"ref":return{...a,name:qy+a.name};case"array":return{...a,items:rn(a.items)};case"record":return{...a,values:rn(a.values)};case"tuple":return{...a,items:a.items.map(rn)};case"union":return{...a,options:a.options.map(rn)};case"object":return{...a,fields:Object.fromEntries(Object.entries(a.fields).map(([n,s])=>[n,{...s,type:rn(s.type)}]))};default:return a}},aS=a=>({...a,params:a.params.map(rn),...a.rest?{rest:rn(a.rest)}:{},...a.returns?{returns:rn(a.returns)}:{}}),ka=sS,Um={namespace:{...ka.namespaces.msgrpc,methods:Object.fromEntries(Object.entries(ka.namespaces.msgrpc.methods).map(([a,n])=>[a,aS(n)])),...ka.namespaces.msgrpc.events?{events:Object.fromEntries(Object.entries(ka.namespaces.msgrpc.events).map(([a,n])=>[a,{params:n.params.map(rn)}]))}:{}},types:Object.fromEntries(Object.entries(ka.types??{}).map(([a,n])=>[qy+a,rn(n)]))},rS=a=>a?.namespaces.msgrpc?a:{schema:Yb,...a,types:{...a?.types,...Um.types},namespaces:{...a?.namespaces,msgrpc:Um.namespace}};let lS=(()=>{var v;let a=[ay("msgrpc")],n,s=[],l,o=[],f,d,p,g;return v=class{handler=zm(this,o);constructor(b){this.handler=b}async topology(){const b=this.handler.hostTopology;if(b)return{records:b.all(),...b.place?{place:b.place}:{},capabilities:b.capabilities()}}async updateTopology(b,_,G){const V=this.handler.hostTopology;if(!V)throw new Error("this host keeps no topology records");if(!this.handler.allowTopologyMutation)throw new Error("this host does not accept remote topology mutation - it is enabled with topology.allowRemoteMutation, and gated by authorize() like any call");return b===pt?V.updateHost(_,G):V.update(b,_,G)}async eventCursor(b,_){this.handler.eventSequenceOf(b,_)===void 0&&this.handler.trackEvent(b,_);const V=this.handler.eventSequenceOf(b,_);return{epoch:this.handler.epoch,seq:V??null,...V!==void 0?{since:this.handler.eventTrackedSince(b,_)}:{}}}async describe(){const b=this.handler.manageRpc,_=this.handler.schema,G=[...b.namespaces].flatMap(([M,Y])=>{const Z=Y.instance;if(!Z)return[];const S=_?.namespaces[M],$=[...b.findNameSpaceMethodMap(M)?.keys()??[]].sort().map(fe=>{const Ce=S?.methods[fe],K=this.handler.semanticsOf({path:M,method:fe}),j=this.handler.publishedSetsOf({path:M,method:fe});return{name:fe,...Ce?{params:Ce.params,paramNames:Ce.paramNames,rest:Ce.rest,returns:Ce.returns}:{},...K?{semantics:K}:{},effect:this.handler.effectOf({path:M,method:fe}),...j!==void 0?{sets:j}:{},...Y.authority?.has(fe)?{requiresAuthority:!0}:{}}}),z=new Set(Object.keys(S?.events??{}));for(const fe of this.handler.eventProxies.values())fe.instanceName===M&&z.add(fe.event);z.delete(Jt);const W=[...z].sort().map(fe=>({name:fe,...S?.events?.[fe]?{params:S.events[fe].params}:{},subscribers:[...this.handler.eventProxies.values()].filter(Ce=>Ce.instanceName===M&&Ce.event===fe).length})),P=this.handler.hostTopology?.get(M),ie=P?{parent:P.parent,owner:P.owner,parentEpoch:P.parentEpoch,ownerEpoch:P.ownerEpoch,...P.label!==void 0?{label:P.label}:{}}:void 0,de=Y.execution,le=Z instanceof ei?{...S?.component?{props:S.component.props,state:S.component.state}:{},subscribers:[...this.handler.eventProxies.values()].filter(fe=>fe.instanceName===M&&fe.event===Jt).length,...mu(Z)?{resources:Z.dataResources()}:{}}:void 0;return{name:M,...S?.version?{version:S.version}:{},...de&&de!=="parallel"?{serialised:!0}:{},className:Z.constructor?.name,created:Y.created===!0,emitter:Z instanceof il,...le?{component:le}:{},...ie?{topology:ie}:{},...S?.capabilities?{capabilities:S.capabilities}:{},methods:$,events:W}}),V=this.handler.hostTopology,J=V?.get(pt),F=tS([...[...b.namespaces.values()].map(M=>M.instance).filter(M=>!!M&&eS(M)).map(M=>M.elevation()).filter(M=>!!M),...this.handler.declaredElevations]);return{name:this.handler.name,..._?.version?{version:_.version}:{},validating:!!_&&this.handler.validation!=="off",namespaces:G.sort((M,Y)=>M.name.localeCompare(Y.name)),...F.length?{elevated:F}:{},...V&&J?{host:{root:J.ref,parent:J.parent,...J.owner?{owner:J.owner}:{},...V.place?{place:V.place}:{},...J.label!==void 0?{label:J.label}:{},capabilities:V.capabilities()}}:{},..._?.types?{types:_.types}:{}}}},l=v,(()=>{const b=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;f=[ds({semantics:"query"})],d=[ds({semantics:"idempotent-command"})],p=[ds({semantics:"query"})],g=[ds({semantics:"query"})],Ea(v,null,f,{kind:"method",name:"topology",static:!1,private:!1,access:{has:_=>"topology"in _,get:_=>_.topology},metadata:b},null,o),Ea(v,null,d,{kind:"method",name:"updateTopology",static:!1,private:!1,access:{has:_=>"updateTopology"in _,get:_=>_.updateTopology},metadata:b},null,o),Ea(v,null,p,{kind:"method",name:"eventCursor",static:!1,private:!1,access:{has:_=>"eventCursor"in _,get:_=>_.eventCursor},metadata:b},null,o),Ea(v,null,g,{kind:"method",name:"describe",static:!1,private:!1,access:{has:_=>"describe"in _,get:_=>_.describe},metadata:b},null,o),Ea(null,n={value:l},a,{kind:"class",name:l.name,metadata:b},null,s),l=n.value,b&&Object.defineProperty(l,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:b}),zm(l,s)})(),l})();const oS=a=>{let n=0xcbf29ce484222325n;for(let s=0;s<a.length;s++)n^=BigInt(a.charCodeAt(s)),n=n*0x100000001b3n&0xffffffffffffffffn;return n.toString(16).padStart(16,"0")},Dm=a=>{const n=a.manageRpc,s=a.schema,l=[...n.namespaces].filter(([,o])=>o.instance).map(([o])=>o).sort().map(o=>{const f=s?.namespaces[o],d=[...n.findNameSpaceMethodMap(o)?.keys()??[]].sort().map(p=>{const g=a.semanticsOf({path:o,method:p}),v=a.publishedSetsOf({path:o,method:p});return{name:p,...f?.methods[p]?{signature:f.methods[p]}:{},...g?{semantics:g}:{},effect:a.effectOf({path:o,method:p}),...v!==void 0?{sets:v}:{},...n.at(o)?.authority?.has(p)?{requiresAuthority:!0}:{}}});return{name:o,...f?.version?{version:f.version}:{},className:n.instanceAt(o)?.constructor?.name,methods:d,events:Object.keys(f?.events??{}).sort(),...f?.capabilities?{capabilities:[...f.capabilities].sort()}:{},...f?.component?{component:f.component}:{}}});return oS(JSON.stringify(l))};class cS extends ml{getTarget;targets=new Map;constructor(n,s){super("",n),this.getTarget=s}async receive(n,s,l){let o;if(this.getTarget&&(o=this.getTarget(l)),o||(o=this.targetExists(l)),o||(o=super.targetExists(l)),!o)throw this.emit(ve.unroutable,{source:s,target:l,reason:"no switch target for this peer"}),new Error(`no route to '${l}': nothing here reaches that peer. If it has only just connected, its presence may not have arrived yet - await it before calling.`);await o.receive(n,s,l)}setTarget(n,s){const o=s===void 0?(d=>d.getName())(n):s;this.targets.set(o,n);let f=!1;return()=>{f||(f=!0,this.targets.delete(o))}}setTargets(n){for(const s of n)this.setTarget(s)}targetExists(n,s=0){let l;return this.targets.forEach(o=>{!l&&!o.isTransport()&&o.targetExists(n,s+1)&&(l=o)}),l}}class uS extends It.EventEmitter{rpc;caller;readyFlag=!1;switch;transports=[];peers=new ty;topology;context;contextResolver;componentChannels;componentLifecycle=new It.EventEmitter;options={name:"*",transports:[],useMsgPack:!0,readyTimeout:3e4};constructor(n={}){super(),this.setMaxListeners(0),this.options={...this.options,...n},this.rpc=new iw(this.options.name),this.caller=new cw(this.options.name,[],this.options.callTimeout??yy),this.caller.batchCalls=this.options.batchCalls??!0,this.switch=new cS([this.rpc,this.caller]);for(const s of[this.rpc,this.caller,this.switch])s.usePeerRegistry(this.peers);this.rpc.authorize=this.options.authorize,this.options.aiGrants&&(this.rpc.aiGrants=ob(this.options.aiGrants)),this.rpc.onAiDecision=this.options.onAiDecision,this.rpc.requireIdentity=this.options.requireAuthenticatedPeers??!!this.options.authenticate,this.rpc.resolveIdentity=s=>{for(const l of this.transports){const o=l.getIdentity(s);if(o)return o}},this.rpc.schema=this.options.schema,this.rpc.validation=this.options.validation??(this.options.schema?"described":"off"),this.rpc.validateResults=this.options.validateResults??!1,this.options.validateComponentSnapshots&&(this.rpc.manageRpc.componentContractFor=s=>{const l=this.rpc.schema?.namespaces[s]?.component;return l?{component:l,types:this.rpc.schema?.types}:void 0}),this.rpc.unknownVersion=this.options.unknownVersion??"allow",this.rpc.idempotency=this.options.idempotency,this.rpc.manageRpc.requireExplicitExposure=this.options.requireExplicitExposure??!1,this.options.exposeManagement&&this.rpc.manageRpc.exposeManagement(),this.options.exposeIntrospection&&(this.rpc.manageRpc.exposeClassInstance(new lS(this.rpc)),this.rpc.schema=rS(this.rpc.schema)),this.topology=new bb(this.options.name,this.options.topology),this.rpc.hostTopology=this.topology,this.rpc.allowTopologyMutation=this.options.topology?.allowRemoteMutation??!1,this.rpc.allowStatePathWrites=this.options.allowStatePathWrites??!1,this.context=new kb(this.topology),this.topology.onCommitted=()=>this.context.changed(),this.rpc.hostContext=this.context,this.context.push=(s,l)=>{this.rpc.sendEvent(s,cy,[l],ps).catch(()=>{})},this.contextResolver=new Px(this.context,this.options.name,this.caller,this.componentLifecycle),this.starting=this.topology.init().then(()=>this.buildTransports()).then(()=>{this.readyFlag=!0},s=>{this.initError=s}),this.init().catch(s=>{this.initError=s,this.emitSafely("initError",s)})}initError;starting=Promise.resolve();configuredTransports(){return this.options.transports}async buildTransport(n){if(n instanceof ml)return n;if(n.connect){const s=n;return new Rm(this.options.name,s.connect,[],{...s.path?{path:s.path}:{},...s.credentials?{auth:s.credentials}:{},...s.ca?{ca:s.ca}:{}},!0,s.allowInsecureTls)}}async buildTransports(){const n=Yx(this.options.useMsgPack);for(const s of this.configuredTransports()){const l=await this.buildTransport(s);if(!l)throw new Error(`RpcServer '${this.options.name}': no transport can be built from ${JSON.stringify(s)}`);l.codec=n,this.options.relay!==void 0&&"relay"in l&&(l.relay=this.options.relay),this.attach(l)}}announceShape(){if(!this.rpc)return;this.rpc.trackDeclaredEvents();const n=Dm(this.rpc);for(const s of this.transports)s.announceShape?.(n)}attach(n){this.transports.push(n),n.announceShape?.(Dm(this.rpc)),n.usePeerRegistry(this.peers),n.pipe(this.rpc),n.pipe(this.caller),this.switch?.setTarget(n),n.on(ve.peerGone,s=>this.safely("peerGone",s,()=>{this.rpc.removePeer(s),this.context.dropSubscriber(s),this.peers.delete(s),this.relayPresence(n,s,"offline");for(const l of this.transports){const o=l;o.stopWatchingFor&&o.stopWatchingFor(s).catch(f=>this.emitSafely("presenceError",{peer:s,error:f}))}})),n.on(ve.peerOnline,s=>this.safely("peerOnline",s,()=>this.relayPresence(n,s,"online"))),n.on(ve.connected,()=>{this.caller.resubscribe().catch(s=>this.emitSafely("resubscribeError",s))});for(const s of[ve.peerGone,ve.peerDisplaced])n.on(s,l=>{this.caller.tickets.dropTarget(l),this.rpc.peerLifetime(l,!1)});n.on(ve.peerOnline,s=>this.rpc.peerLifetime(s,!0));for(const s of[ve.disconnected,ve.peerGone,ve.peerDisplaced,ve.connected])n.on(s,l=>{this.componentLifecycle.emit(s,l),this.emit(s,l)});for(const s of[ve.peerOnline,ve.peerShape])n.on(s,(...l)=>this.emit(s,...l))}relayPresence(n,s,l){for(const o of this.transports){if(o===n)continue;const f=o;f.announcePeer&&f.announcePeer(s,l)}this.advertiseReachability()}advertiseReachability(){for(const n of this.transports)n instanceof Rm&&n.advertise(this.peers.names().filter(s=>s!==this.options.name&&this.peers.get(s)!==n))}emitSafely(n,s){for(const l of this.transports)l.emit(n,s)}safely(n,s,l){try{l()}catch(o){this.emitSafely("presenceError",{what:n,peer:s,error:o})}}async proxy(n,s){return await this.ready(),this.caller.proxy(n,s??"*")}async component(n,s,l){await this.ready(),this.componentChannels??=new dw(this.caller,this.componentLifecycle);const o=await this.componentChannels.open(n,s,l?.paths);return vy(o,o.inner)}provideContext(n,s,l){return this.context.provide(n,s,l)}contextOf(n,s){return this.contextResolver.store(n,s)}contextAt(n,s){return this.contextResolver.storeAt(n,s)}requireContext(n,s){return this.contextResolver.require(n,s)}captureContext(n,s){return this.contextResolver.capture(n,s)}async close(){await this.starting.catch(()=>{}),this.componentChannels?.closeAll(),this.caller.failPendingCalls("server closed"),this.caller.subscriptions.clear(),await this.caller.close(),await Promise.all(this.transports.map(n=>n.close())),this.transports=[],this.peers.clear()}exposeClassInstance(n,s,l){this.rpc.manageRpc.exposeClassInstance(n,s,l),this.announceShape();const o=s??ry(n)?.name;return{withdraw:async()=>{if(!o)return!1;const f=await this.rpc.retire(o);return f&&this.announceShape(),f}}}elevate(n){const s={since:Date.now(),...n};this.rpc.declaredElevations.push(s);const l=()=>{const o=this.rpc.declaredElevations.indexOf(s);o>=0&&this.rpc.declaredElevations.splice(o,1)};return s.until!==void 0&&setTimeout(l,Math.max(0,s.until-Date.now())).unref?.(),this.announceShape(),{lower:l}}exposeClass(n,s){this.rpc.manageRpc.exposeClass(n,s),this.announceShape()}exposeObject(n,s){this.rpc.manageRpc.exposeObject(n,s),this.announceShape()}expose(n,s){this.rpc.manageRpc.expose(n,s),this.announceShape()}async createRpcInstance(n,s,...l){const o=await this.rpc.manageRpc.createRpcInstance(n,s,...l);return this.announceShape(),o}addTarget(n,s){this.switch?.setTarget(s)}async init(){}async ready(){await this.starting;const n=()=>this.transports.filter(l=>!l.readyFlag).length==0,s=Date.now()+this.options.readyTimeout;for(;!n()||!this.readyFlag;){const l=this.transports.find(o=>o.startupError!==void 0);if(l&&(this.initError=l.startupError),this.initError!==void 0)throw new Error(`RpcServer '${this.options.name}': could not start: ${this.initError instanceof Error?this.initError.message:String(this.initError)}`,{cause:this.initError});if(this.options.readyTimeout>0&&Date.now()>s){const o=this.transports.filter(f=>!f.readyFlag).map(f=>f.getName());throw new Error(`RpcServer '${this.options.name}': transports not ready within ${this.options.readyTimeout} ms: ${o.join(", ")}`)}await new Promise(o=>setTimeout(o,10))}}async awaitPeer(n,s=5e3){const l=Date.now()+s;for(;;){if(this.peers.get(n))return!0;if(Date.now()>=l)return!1;await new Promise(o=>setTimeout(o,20))}}async peersSettled(n=2e3){return await this.ready(),await Kx(this.transports,n),this.peers.names().filter(s=>s!==this.options.name)}}const Bm="msgrpc-page-name",fS=()=>{const a=new URLSearchParams(window.location.search).get("name")?.trim();if(a)return a;let n=sessionStorage.getItem(Bm);return n||sessionStorage.setItem(Bm,n=Ix("page")),n},dS=({peer:a,messages:n,onSend:s})=>{const[l,o]=q.useState(""),[f,d]=q.useState(null),[p,g]=q.useState(!1),v=q.useRef(null);q.useEffect(()=>{v.current?.scrollIntoView({block:"end"})},[n.length]);const k=async()=>{!l.trim()||!a||(g(!0),d(await s(l.trim()).finally(()=>g(!1))??null),o(""))};return y.jsxs("div",{className:"chat",children:[y.jsxs("header",{children:[y.jsx("h1",{children:"Chat"}),y.jsx("span",{className:"muted mono",children:a??"—"})]}),!a&&y.jsx("p",{className:"muted",children:"Select a peer to talk to it. Any peer running this console can answer."}),a&&y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"chat-log",children:[n.length===0&&y.jsxs("p",{className:"muted",children:["Nothing yet. Say something to ",a,"."]}),n.map((b,_)=>y.jsx("div",{className:b.mine?"said mine":"said",children:y.jsx("span",{className:"text",children:b.text})},`${b.at}-${_}`)),y.jsx("div",{ref:v})]}),y.jsxs("div",{className:"chat-send",children:[y.jsx("input",{className:"control",value:l,placeholder:`say something to ${a}`,onChange:b=>o(b.target.value),onKeyDown:b=>{b.key==="Enter"&&k()}}),y.jsx("button",{className:"primary",disabled:p||!l.trim(),onClick:()=>{k()},children:p?"…":"Send"})]}),f&&y.jsx("p",{className:"muted bad",children:f})]})]})};var Jm,Fm,Wm,cs;Wm=[ay("chat")],Fm=[ds({injectInvocation:!0})],Jm=[ds];class us{constructor(n){zc(cs,5,this);zp(this,"onMessage");this.onMessage=n}async say(n,s,l){const o=l.context.identity?.name??l.context.source;return this.onMessage(String(o),String(s)),"delivered"}async who(){return{app:"source-rpc console",kind:"browser page"}}}cs=Mp(null),Zr(cs,1,"say",Fm,us),Zr(cs,1,"who",Jm,us),us=Zr(cs,0,"ChatService",Wm,us),zc(cs,1,us);const hS=1,pS={chat:{methods:{say:{params:[{kind:"string"},{kind:"string"}],paramNames:["from","text"],returns:{kind:"string"}},who:{params:[],returns:{kind:"object",fields:{app:{type:{kind:"string"}},kind:{type:{kind:"string"}}}}}}}},mS={schema:hS,namespaces:pS},$y=()=>new URL(".",document.baseURI),yS="console.json",gS=async()=>{const a=await fetch(new URL(yS,$y()));if(!a.ok)throw new Error(`the console did not say who it is (${a.status})`);return(await a.json()).name},vS=()=>`${$y().pathname}socket.io`,gs=(a,n)=>a?.kind==="ref"?gs(n?.[a.name],n):a,Wt=a=>{if(!a)return"unknown";switch(a.kind){case"literal":return JSON.stringify(a.value);case"array":return`${Wt(a.items)}[]`;case"tuple":return`[${a.items.map(Wt).join(", ")}]`;case"union":return a.options.map(Wt).join(" | ");case"ref":return a.name;case"object":return`{ ${Object.entries(a.fields).map(([n,s])=>`${n}${s.optional?"?":""}: ${Wt(s.type)}`).join(", ")} }`;case"record":return`{ [key: string]: ${Wt(a.values)} }`;case"number":return a.min!==void 0||a.max!==void 0?`number(${a.min??""}..${a.max??""})`:"number";default:return a.kind}},cl=a=>a?.kind==="any"||a?.kind==="union"&&a.options.some(n=>n.kind==="literal"&&n.value===null),Ei=a=>{if(a?.kind!=="union")return a;const n=a.options.filter(s=>!(s.kind==="literal"&&s.value===null));return n.length===1?n[0]:{...a,options:n}},Ly=a=>a?.kind==="object"&&"value"in a.fields&&("quality"in a.fields||"unit"in a.fields||"forced"in a.fields),hl=a=>(a?.kind==="object"||a?.kind==="tuple")&&!Ly(a),ku=a=>a.kind==="object"?Object.entries(a.fields).map(([n,s])=>({name:n,type:s.type})):a.items.map((n,s)=>({name:String(s),type:n})),ms=(a,n,s)=>a?.kind!=="ref"?{type:a,seen:s}:s.has(a.name)?{type:void 0,seen:s}:ms(n?.[a.name],n,new Set(s).add(a.name)),Hy=(a,n,s,l)=>{const o=ms(a,s,l);return hl(o.type)?ku(o.type).map(f=>({member:f,at:ms(f.type,s,o.seen)})).filter(({at:f})=>hl(f.type)).map(({member:f,at:d})=>({name:f.name,path:[...n,f.name],children:Hy(f.type,[...n,f.name],s,d.seen)})):[]},bS=(a,n)=>[...["props","state"].filter(s=>a[s]!==void 0).map(s=>({name:s,path:[s],children:Hy(a[s],[s],n,new Set)})),...(a.resources??[]).filter(s=>s.verbs.includes("getList")).map(s=>({name:s.label??s.path.join("."),path:[...s.path],children:[]}))],wS=(a,n)=>a.resources?.find(s=>s.path.length===n.length&&s.path.every((l,o)=>l===n[o])),Yy=(a,n,s)=>{const l=(o,f,d)=>{const p=ms(o,s,d);return p.type?.kind==="record"||p.type?.kind==="array"?[{path:f,type:p.type,collection:!0}]:hl(p.type)?ku(p.type).flatMap(g=>l(g.type,[...f,g.name],p.seen)):[{path:f,type:p.type}]};return l(a,n,new Set)},xS=(a,n,s)=>{const l=wS(a,n);if(l)return{kind:"record",values:l.row??{kind:"any"}};const[o,...f]=n;if(o!=="props"&&o!=="state")return;let d=ms(a[o],s,new Set);for(const p of f){if(!hl(d.type))return;const g=ku(d.type).find(({name:v})=>v===p);if(!g)return;d=ms(g.type,s,d.seen)}return d.type},SS=(a,n,s)=>a.resources?.find(o=>o.path.length===n.length&&o.path.every((f,d)=>f===n[d]))?.actions?.filter(o=>s.some(f=>f.name===o.method)),Gy=(a,n)=>{let s=a;for(const l of n){if(s===null||typeof s!="object")return;s=s[l]}return s},ES=()=>()=>{},Tu=a=>({subscribe:ES,read:n=>Gy(a,n)}),kS=(a,n)=>({subscribe:s=>a.subscribe(s),read:s=>Gy(a.getSnapshot(),[...n,...s])}),hs=(a,n)=>{const s=n.join(""),l=q.useCallback(()=>a.read(n),[a,s]);return q.useSyncExternalStore(a.subscribe,l,l)},TS=(a,n)=>{const s=n.join(""),l=q.useCallback(()=>{const f=a.read(n);return f!==null&&typeof f=="object"?Object.keys(f).join(""):""},[a,s]),o=q.useSyncExternalStore(a.subscribe,l,l);return q.useMemo(()=>o===""?[]:o.split(""),[o])},Vy=(a,n)=>a?.kind==="ref"?Vy(n?.[a.name],n):a,Xy=a=>typeof a=="object"&&a!==null&&!Array.isArray(a),AS=a=>a?.kind==="union"&&a.options.every(n=>n.kind==="literal")?a.options.map(n=>n.value):void 0,_S=a=>Xy(a)&&"value"in a&&("quality"in a||"unit"in a||"forced"in a),jS=a=>typeof a=="string"?a:JSON.stringify(a)??"undefined",NS=({value:a,type:n,setter:s,busy:l,onDone:o})=>{const[f,d]=q.useState(()=>typeof a=="string"?a:JSON.stringify(a)??""),p=AS(n),g=async k=>{await s.call(k),o()};if(p)return y.jsx("select",{className:"value-edit",autoFocus:!0,defaultValue:String(a),disabled:l,onChange:k=>{g(p.find(b=>String(b)===k.target.value)??k.target.value)},onBlur:o,children:p.map(k=>y.jsx("option",{value:String(k),children:String(k)},String(k)))});if(n?.kind==="boolean")return y.jsx("input",{className:"value-edit",type:"checkbox",autoFocus:!0,defaultChecked:a===!0,disabled:l,onChange:k=>{g(k.target.checked)}});const v=n?.kind==="number";return y.jsxs("form",{className:"value-edit-form",onSubmit:k=>{if(k.preventDefault(),v){const b=Number(f);if(Number.isNaN(b))return;g(b);return}if(n?.kind==="string"||n===void 0)g(f);else try{g(JSON.parse(f))}catch{g(f)}},children:[y.jsx("input",{className:"value-edit",autoFocus:!0,value:f,disabled:l,type:v?"number":"text",...v&&n.min!==void 0?{min:n.min}:{},...v&&n.max!==void 0?{max:n.max}:{},onChange:k=>d(k.target.value),onKeyDown:k=>{k.key==="Escape"&&o()}}),y.jsx("button",{className:"toggle",type:"submit",disabled:l,title:`${s.method}(${f||"…"})`,children:l?"…":`send ${s.method}(${f||"…"})`})]})},Au=({name:a,value:n,type:s,path:l,edit:o,unit:f,quality:d,forced:p})=>{const[g,v]=q.useState(!1),k=l.join("."),b=o?.setterFor(l),_=o?.pending===k,G=o?.failed?.path===k?o.failed.message:void 0;return y.jsxs("div",{className:"value-row",children:[y.jsx("span",{className:"value-name mono",title:s?Wt(s):void 0,children:a}),g&&b?y.jsx(NS,{value:n,type:s,setter:b,busy:_,onDone:()=>v(!1)}):y.jsxs(y.Fragment,{children:[y.jsxs("span",{className:"value mono",children:[jS(n),typeof f=="string"&&y.jsxs("span",{className:"unit",children:[" ",f]})]}),p&&y.jsx("span",{className:"quality forced",children:"forced"}),typeof d=="string"&&y.jsx("span",{className:`quality q-${d}`,children:d}),b&&y.jsxs("button",{className:"toggle edit",onClick:()=>v(!0),title:`proposes a call to ${b.method}()`,children:["call ",b.method]})]}),G&&y.jsx("span",{className:"component-error",children:G})]})},OS=({source:a,name:n,path:s,type:l,edit:o})=>y.jsx(Au,{name:n,value:hs(a,s),type:l,path:s,edit:o}),Ky=({source:a,name:n,path:s,type:l})=>y.jsx(Au,{name:n,value:hs(a,[...s,"value"]),unit:hs(a,[...s,"unit"]),quality:hs(a,[...s,"quality"]),forced:hs(a,[...s,"forced"])===!0,type:l,path:s}),fu=a=>{const n=TS(a.source,a.path);return y.jsx(du,{...a,members:n.map(s=>({key:s,childType:a.childType}))})},du=({source:a,path:n,types:s,edit:l,depth:o,name:f,members:d})=>{const p=y.jsxs("div",{className:o===0?void 0:"value-branch",children:[d.map(({key:g,childType:v})=>y.jsx(bl,{name:g,source:a,type:v,types:s,path:[...n,g],edit:l,depth:o+1},g)),d.length===0&&y.jsx("p",{className:"muted",children:"empty"})]});return o===0?p:y.jsxs("div",{className:"value-node",children:[y.jsx("span",{className:"value-name mono branch",children:f}),p]})},bl=({source:a,type:n,types:s,name:l,path:o=[],edit:f,depth:d=0})=>{const p=Vy(n,s);return Ly(p)?y.jsx(Ky,{source:a,name:l??"",path:o,type:p}):p?.kind==="object"?y.jsx(du,{source:a,path:o,types:s,edit:f,depth:d,name:l,members:Object.entries(p.fields).map(([g,v])=>({key:g,childType:v.type}))}):p?.kind==="tuple"?y.jsx(du,{source:a,path:o,types:s,edit:f,depth:d,name:l,members:p.items.map((g,v)=>({key:String(v),childType:g}))}):p?.kind==="record"?y.jsx(fu,{source:a,path:o,childType:p.values,types:s,edit:f,depth:d,name:l}):p?.kind==="array"?y.jsx(fu,{source:a,path:o,childType:p.items,types:s,edit:f,depth:d,name:l}):p===void 0?y.jsx(RS,{source:a,name:l,path:o,edit:f,depth:d,types:s}):y.jsx(OS,{source:a,name:l??"",path:o,type:p,edit:f})},RS=({source:a,name:n,path:s,edit:l,depth:o,types:f})=>{const d=hs(a,s);return _S(d)?y.jsx(Ky,{source:a,name:n??"",path:s,type:void 0}):Xy(d)||Array.isArray(d)?y.jsx(fu,{source:a,path:s,types:f,edit:l,depth:o,name:n}):y.jsx(Au,{name:n??"",value:d,type:void 0,path:s,edit:l})},Qy=({nodes:a,selected:n,onSelect:s,depth:l=0})=>y.jsx(y.Fragment,{children:a.map(o=>{const f=o.path.join(".");return y.jsxs("div",{className:"scope-node",children:[y.jsx("button",{className:`scope-name mono${f===n?" on":""}`,style:{paddingLeft:`${l*12}px`},onClick:()=>s(o.path),title:`show every value under ${f}`,children:o.name}),y.jsx(Qy,{nodes:o.children,selected:n,onSelect:s,depth:l+1})]},f)})}),MS=a=>{const n=a.split(/&+/).map(s=>s.split(/\|+/).map(l=>l.trim()).filter(Boolean).map(CS)).filter(s=>s.length).map(s=>s.length===1?s[0]:{any:s});if(n.length)return n.length===1?n[0]:{all:n}},CS=a=>{const n=a.indexOf(":");if(n<=0)return{field:"id",op:"contains",operand:a};const s=a.slice(n+1).trim();return s?{field:a.slice(0,n).trim(),op:"contains",operand:s}:{field:"id",op:"contains",operand:a.slice(0,n).trim()}},zS=(a,n,s,l)=>{const o=s?.total,f=o!==void 0&&n>0?Math.ceil(o/n):void 0,d=f!==void 0?a+1<f:s?.hasMore??!1,p=a>0;return{pages:f,hasNext:d,hasPrevious:p,paged:p||d,position:f!==void 0?`${a+1}/${f}`:String(a+1),count:s===void 0?"asking…":o!==void 0?`${s.ids.length} of ${o}`:`${s.ids.length} rows`,emptiness:s===void 0||s.ids.length>0?void 0:(o!==void 0?o>0:p)?"past the end":l?"nothing matches":"empty"}},US=a=>{const[,n]=q.useState(0);return q.useEffect(()=>{if(a===void 0)return;const s=setInterval(()=>n(l=>l+1),1e3);return()=>clearInterval(s)},[a]),a===void 0?void 0:Math.floor((Date.now()-a)/1e3)},DS=(a,n)=>{const[s,l]=q.useState(a);return q.useEffect(()=>{const o=setTimeout(()=>l(a),n);return()=>clearTimeout(o)},[a,n]),s},BS=(a,n,s)=>{const[l,o]=q.useState(),[f,d]=q.useState(),[p,g]=q.useState(!1),[v,k]=q.useState(),b=q.useRef(a);b.current=a;const _=q.useRef(void 0),G=q.useRef(()=>{});return q.useEffect(()=>{let V=!1;const J=()=>{_.current!==void 0&&clearTimeout(_.current),_.current=void 0},F=async()=>{if(J(),!V){g(!0),k(Date.now());try{const Y=await b.current();if(V)return;o(Y),d(void 0)}catch(Y){if(V)return;d(Y.message??String(Y))}finally{V||(g(!1),k(void 0),n!==void 0&&document.visibilityState==="visible"&&(_.current=setTimeout(()=>{F()},n)))}}};G.current=()=>{F()};const M=()=>{document.visibilityState==="visible"?F():J()};return document.addEventListener("visibilitychange",M),F(),()=>{V=!0,J(),document.removeEventListener("visibilitychange",M)}},[s,n]),{data:l,error:f,fetching:p,since:v,refresh:q.useCallback(()=>G.current(),[])}},qS=({leaf:a,types:n,fetchPage:s,period:l,pageSize:o,edit:f,settled:d,filter:p,actions:g,onAction:v})=>{const[k,b]=q.useState(0),[_,G]=q.useState(),V=a.path.join("."),J=a.type?.kind==="record"?a.type.values:a.type?.kind==="array"?a.type.items:void 0,F=JSON.stringify([p??null,_??null]),[M,Y]=q.useState(F);M!==F&&(Y(F),b(0));const Z=J?.kind==="object"?Object.keys(J.fields):[],S=[V,k,o,d,F].join(""),{data:A,error:$,fetching:z,since:W}=BS(()=>s(a.path,k,o,p,_),l,S),P=q.useMemo(()=>Tu(a.path.reduceRight((le,fe)=>({[fe]:le}),Object.fromEntries((A?.ids??[]).map((le,fe)=>[le,A?.data[fe]])))),[A,a.path]),ie=US(W),de=zS(k,o,A,p!==void 0);return y.jsxs("div",{className:"collection",children:[y.jsxs("div",{className:"collection-head",children:[y.jsx("span",{className:"value-name mono branch",children:V}),y.jsxs("span",{className:"muted",children:[de.count,z&&A?" · refreshing":"",ie!==void 0&&ie>0&&y.jsxs("span",{className:"waiting",children:[" ",ie,"s"]}),!z&&A?.ms!==void 0&&A.ms>=250&&y.jsxs("span",{className:"slow",children:[" ","· peer ",A.ms," ms",A.countMs!==void 0&&A.queryMs!==void 0&&` (rows ${A.queryMs}, count ${A.countMs})`]})]}),y.jsxs("span",{className:"sorter",children:[y.jsxs("select",{className:"period",value:_?.field??"",title:"order the whole matched set, not this page",onChange:le=>G(le.target.value?{field:le.target.value,order:_?.order??"ASC"}:void 0),children:[y.jsx("option",{value:"",children:"by key"}),Z.map(le=>y.jsxs("option",{value:le,children:["by ",le]},le))]}),_&&y.jsx("button",{className:"toggle",title:_.order==="DESC"?"descending":"ascending",onClick:()=>G({..._,order:_.order==="DESC"?"ASC":"DESC"}),children:_.order==="DESC"?"▾":"▴"})]}),de.paged&&y.jsxs("span",{className:"pager",children:[y.jsx("button",{className:"toggle",disabled:!de.hasPrevious,onClick:()=>b(le=>le-1),children:"◂"}),y.jsx("span",{className:"muted mono",children:de.position}),y.jsx("button",{className:"toggle",disabled:!de.hasNext,onClick:()=>b(le=>le+1),children:"▸"})]})]}),$&&y.jsxs("p",{className:"component-error",children:[V,": ",$]}),A?.ids.map(le=>y.jsxs("div",{className:"collection-row",children:[y.jsx(bl,{name:`${V}.${le}`,source:P,type:J,types:n,path:[...a.path,le],edit:f,depth:1}),g?.length?y.jsx("span",{className:"row-actions",children:g.map(fe=>y.jsx("button",{className:"toggle",title:`calls ${fe.method}(${le})`,onClick:()=>v?.(fe,le),children:fe.label??fe.method},fe.method))}):null]},le)),de.emptiness&&y.jsx("p",{className:"muted",children:de.emptiness})]})},$S=({component:a,types:n,scope:s,source:l,edit:o,fetchPage:f,period:d,settled:p,actionsFor:g,onAction:v,pageSize:k=50})=>{const[b,_]=q.useState(""),G=DS(b,400),V=q.useMemo(()=>MS(G),[G]),J=q.useMemo(()=>Yy(xS(a,s,n),s,n),[a,s,n]),F=J.filter(S=>S.collection),M=J.filter(S=>!S.collection),[,Y]=q.useState(0);q.useEffect(()=>{if(V)return l.subscribe(()=>Y(S=>S+1))},[l,V]);const Z=V?M.filter(S=>fl(V,l.read(S.path),S.path.join("."))):M;return y.jsxs("div",{className:"value-grid",children:[y.jsxs("div",{className:"grid-head",children:[y.jsx("input",{className:"value-edit filter-box",value:b,placeholder:"filter",title:"a word searches the path; field:word narrows to a field; & is and, | is or",onChange:S=>_(S.target.value)}),M.length>0&&y.jsxs("span",{className:"muted",children:[V?`${Z.length} of ${M.length}`:`${M.length}`," field",M.length===1?"":"s"]})]}),Z.map(S=>y.jsx(bl,{name:S.path.join("."),source:l,type:S.type,types:n,path:S.path,edit:o,depth:1},S.path.join("."))),V&&M.length>0&&Z.length===0&&y.jsx("p",{className:"muted",children:"no field matches"}),F.map(S=>y.jsx(qS,{leaf:S,types:n,fetchPage:f,period:d,pageSize:k,edit:o,settled:p,filter:V,actions:g(S.path),onAction:v},S.path.join("."))),J.length===0&&y.jsx("p",{className:"muted",children:"nothing under this node"})]})},qm=(a,n)=>a.params===void 0||a.params.length===n,LS=(a,n)=>{const s=a.join("."),l=n.find(f=>f.sets===s&&qm(f,1));if(l)return{method:l,generic:!1};const o=n.find(f=>f.sets==="*"&&qm(f,2));return o?{method:o,generic:!0}:void 0},HS=(a,n,s)=>q.useSyncExternalStore(q.useCallback(l=>a?a.subscribe(l):()=>{},[a]),q.useCallback(()=>a?n(a.getSnapshot()):s,[a,n,s])),YS=a=>a.status,GS=({store:a})=>{const n=q.useSyncExternalStore(q.useCallback(s=>a.subscribe(s),[a]),q.useCallback(()=>a.getSnapshot(),[a]));return n.receivedAt===0?null:y.jsxs("span",{className:"muted",children:["rev ",n.revision," ·"," ",n.status==="stale"&&n.staleSince?`last known ${new Date(n.receivedAt).toLocaleTimeString()}, stale since ${new Date(n.staleSince).toLocaleTimeString()}`:`updated ${new Date(n.receivedAt).toLocaleTimeString()}`]})},$m=[{label:"1s",ms:1e3},{label:"5s",ms:5e3},{label:"30s",ms:3e4},{label:"manual",ms:void 0}],VS=Tu({}),XS=({peer:a,namespace:n,component:s,methods:l,types:o,server:f,onSubscribed:d})=>{const[p,g]=q.useState(null),[v,k]=q.useState(!1),[b,_]=q.useState(null),[G,V]=q.useState(!1),[J,F]=q.useState(),[M,Y]=q.useState(),[Z,S]=q.useState(5e3),[A,$]=q.useState(0),z=HS(p,YS,void 0),W=q.useMemo(()=>bS(s,o),[s,o]),[P,ie]=q.useState(()=>s.state?["state"]:W[0]?.path??["state"]),de=q.useMemo(()=>["props","state"].flatMap(I=>s[I]?Yy(s[I],[I],o):[]).filter(I=>!I.collection).map(I=>I.path),[s,o]),le=q.useMemo(()=>p?kS(p,[]):VS,[p]);q.useEffect(()=>()=>{p?.close()},[p]);const fe=async()=>{const I=f.current;if(I){V(!0),_(null);try{if(de.length){const ae=await I.component(n,a,{paths:de});g(ae[gy])}k(!0),d?.()}catch(ae){_(ae.message??String(ae))}finally{V(!1)}}},Ce=()=>{g(null),k(!1),d?.()},K=async(I,ae)=>{const x=f.current;if(x&&!(I.confirm&&!window.confirm(`${I.method}(${ae})?`))){F(ae),Y(void 0);try{await(await x.proxy(n,a))[I.method](ae),$(Q=>Q+1)}catch(D){Y({path:ae,message:D.message??String(D)})}finally{F(void 0)}}},j=async(I,ae,x,D,Q)=>{const ee=f.current;if(!ee)throw new Error("no link");return(await ee.proxy(n,a)).$data("getList",I,{pagination:{page:ae,pageSize:x},...D?{filter:D}:{},...Q?{sort:Q}:{}})},X={setterFor:I=>{const ae=LS(I,l);if(!ae)return;const{method:x,generic:D}=ae;return{method:x.name,call:async Q=>{const ee=f.current;if(ee){F(I.join(".")),Y(void 0);try{const ce=await ee.proxy(n,a);await(D?ce[x.name](I,Q):ce[x.name](Q)),$(pe=>pe+1)}catch(ce){Y({path:I.join("."),message:ce.message??String(ce)})}finally{F(void 0)}}}}},...J?{pending:J}:{},...M?{failed:M}:{}},te=z==="stale";return y.jsxs("div",{className:`component${te?" stale":""}`,children:[y.jsxs("div",{className:"component-head",children:[y.jsx("span",{className:"comp-label",children:"component"}),z&&y.jsx("span",{className:`status-badge ${z}`,children:z}),p&&y.jsx(GS,{store:p}),y.jsxs("span",{className:"muted",children:[s.subscribers," observer",s.subscribers===1?"":"s"]}),v&&y.jsx("select",{className:"period",value:String(Z),onChange:I=>S($m.find(ae=>String(ae.ms)===I.target.value)?.ms),title:"how often a page is asked for again",children:$m.map(I=>y.jsx("option",{value:String(I.ms),children:I.label},I.label))}),!v&&y.jsx("button",{className:"toggle",onClick:()=>{fe()},disabled:G,children:G?"observing…":"observe"}),v&&y.jsx("button",{className:"toggle on",onClick:Ce,children:"stop"})]}),b&&y.jsx("p",{className:"component-error",children:b}),!v&&!b&&y.jsx("p",{className:"muted",children:"Cached props and state, read without a call. Observe to subscribe."}),v&&y.jsxs("div",{className:"component-body",children:[y.jsxs("div",{className:"scope-pane",children:[y.jsx("h4",{children:"scope"}),y.jsx(Qy,{nodes:W,selected:P.join("."),onSelect:ie})]}),y.jsxs("div",{className:"value-table",children:[y.jsx("h4",{children:P.join(".")}),y.jsx($S,{component:s,types:o,scope:P,source:le,edit:X,fetchPage:j,period:Z,settled:A,actionsFor:I=>SS(s,I,l),onAction:(I,ae)=>{K(I,ae)}})]})]})]})},Zy=a=>`source-rpc.context-tokens.${a}`,Lm=a=>{try{const n=localStorage.getItem(Zy(a));return n?JSON.parse(n):[]}catch{return[]}},KS=(a,n)=>{try{localStorage.setItem(Zy(a),JSON.stringify(n))}catch{}},QS=(a,n)=>a.peer===n?a.instance:`${a.peer}/${a.instance}`,ZS=({store:a,home:n,onRemove:s})=>{const l=q.useCallback(p=>a.subscribe(p),[a]),o=q.useCallback(()=>a.getSnapshot(),[a]),f=q.useSyncExternalStore(l,o),d=f.entries??(f.entry?[f.entry]:[]);return y.jsxs("div",{className:"context-token",children:[y.jsxs("div",{className:"context-token-head",children:[y.jsx("code",{className:"mono",children:f.tokenId}),y.jsx("span",{className:`axis-badge ${f.axis}`,children:f.axis}),y.jsx("span",{className:`status-badge ${f.status}`,children:f.status}),f.status==="stale"&&f.staleSince&&y.jsxs("span",{className:"muted",children:["stale since ",new Date(f.staleSince).toLocaleTimeString()]}),f.status==="invalid"&&y.jsxs("span",{className:"component-error",children:[f.invalidReason,f.invalidPath?`: ${f.invalidPath.map(p=>`${p.peer}/${p.instance}`).join(" -> ")}`:""]}),y.jsx("button",{className:"toggle",onClick:s,title:"stop watching this token",children:"✕"})]}),f.status==="missing"&&y.jsxs("p",{className:"muted",children:["nothing on this node's ",f.axis," chain provides it"]}),d.map((p,g)=>y.jsxs("div",{className:"context-entry",children:[y.jsxs("span",{className:"muted mono provider",title:`provided at ${p.provider.peer}/${p.provider.instance}`,children:[QS(p.provider,n),g===0&&d.length>1?" · nearest":""]}),y.jsx(bl,{source:Tu(p.value)})]},`${p.provider.peer}/${p.provider.instance}`))]})},JS=({watched:a,peer:n,node:s,server:l,onRemove:o})=>{const[f,d]=q.useState(null);return q.useEffect(()=>{const p=l.current;if(!p)return;const g=xb({id:a.id,schemaVersion:"1",axis:a.axis,resolution:"collect"}),v=p.contextAt({peer:n,instance:s},g);return d(v),()=>{v.close(),d(null)}},[n,s,a.id,a.axis,l]),f?y.jsx(ZS,{store:f,home:n,onRemove:o}):null},FS=({peer:a,node:n,server:s})=>{const[l,o]=q.useState(()=>Lm(a)),[f,d]=q.useState(""),[p,g]=q.useState("physical");q.useEffect(()=>o(Lm(a)),[a]);const v=b=>{o(b),KS(a,b)},k=()=>{const b=f.trim();!b||l.some(_=>_.id===b&&_.axis===p)||(v([...l,{id:b,axis:p}]),d(""))};return y.jsxs("div",{className:"context",children:[y.jsxs("div",{className:"context-head",children:[y.jsx("span",{className:"comp-label",children:"context"}),y.jsx("span",{className:"muted mono",children:n}),y.jsxs("form",{className:"context-add",onSubmit:b=>{b.preventDefault(),k()},children:[y.jsx("input",{value:f,placeholder:"token id, e.g. acme.site","aria-label":"context token id",onChange:b=>d(b.target.value)}),y.jsxs("select",{value:p,"aria-label":"axis",onChange:b=>g(b.target.value),children:[y.jsx("option",{value:"physical",children:"physical"}),y.jsx("option",{value:"logical",children:"logical"})]}),y.jsx("button",{className:"toggle",type:"submit",disabled:!f.trim(),children:"watch"})]})]}),l.length===0&&y.jsx("p",{className:"muted",children:"Name a token to watch it. There is no list to choose from on purpose: a caller must already know an id, because enumerating the ambient data a plant carries is reconnaissance."}),l.map(b=>y.jsx(JS,{watched:b,peer:a,node:n,server:s,onRemove:()=>v(l.filter(_=>!(_.id===b.id&&_.axis===b.axis)))},`${b.id} ${b.axis}`))]})},WS={ai:"AI",api:"API",emqx:"EMQX",hmi:"HMI",mcp:"MCP",mqtt:"MQTT",rpc:"RPC",sdk:"SDK",std:"Std",ui:"UI"},IS=new Set(["console","mcp","page"]),PS=a=>a.split(/[-_.:/\s]+/).filter(Boolean),Hm=a=>WS[a.toLowerCase()]??`${a.slice(0,1).toUpperCase()}${a.slice(1)}`,Na=a=>{const n=PS(a);return n.length>=4&&IS.has(n[0].toLowerCase())?Hm(n[0]):n.map(Hm).join(" ")||a},Ym=(a,n)=>{const s=n?.label?.trim();if(s)return s;const l=n?.place?.map(o=>o.trim()).filter(Boolean);return l?.length?l[l.length-1]:Na(a)},Jy=a=>a.topology?.label?.trim()||Na(a.name),Gm=(a,n)=>a.peer===n?a.instance:`${a.peer}/${a.instance}`,e1=({owner:a,home:n,peers:s,onSelectPeer:l})=>a.peer!==n&&s.includes(a.peer)?y.jsxs("button",{className:"owner-chip link",onClick:()=>l(a.peer),title:`owned by ${a.peer}/${a.instance} - select that peer`,children:["⤳ ",Gm(a,n)]}):y.jsxs("span",{className:"owner-chip",title:"logical owner",children:["⤳ ",Gm(a,n)]}),Fy=({namespace:a,childrenOf:n,home:s,peers:l,onSelectPeer:o})=>y.jsxs("li",{children:[y.jsxs("span",{className:"node",children:[y.jsxs("span",{className:"entity-title compact",children:[y.jsx("span",{children:Jy(a)}),y.jsx("span",{className:"entity-id mono",children:a.name})]}),a.topology?.owner&&y.jsx(e1,{owner:a.topology.owner,home:s,peers:l,onSelectPeer:o})]}),n(a.name).length>0&&y.jsx("ul",{children:n(a.name).map(f=>y.jsx(Fy,{namespace:f,childrenOf:n,home:s,peers:l,onSelectPeer:o},f.name))})]}),t1=({description:a,peers:n,onSelectPeer:s})=>{const l=a.name,o=a.namespaces.filter(v=>v.topology);if(!a.host&&o.length===0)return null;const f=new Set,d=v=>f.has(v)?[]:(f.add(v),o.filter(k=>k.topology.parent?.instance===v&&k.topology.parent?.peer===l)),p=o.filter(v=>v.topology.parent===null||v.topology.parent.instance==="$host"),g=a.host?.place?.join(" / ")??l;return y.jsxs("div",{className:"structure",children:[y.jsxs("div",{className:"structure-head",children:[y.jsx("span",{className:"comp-label",children:"structure"}),y.jsx("span",{className:"mono",children:g}),a.host?.label&&y.jsx("span",{className:"node-label",children:a.host.label}),a.host?.parent&&y.jsxs("span",{className:"muted",children:["attached under"," ",n.includes(a.host.parent.peer)?y.jsx("button",{className:"owner-chip link",onClick:()=>s(a.host.parent.peer),children:a.host.parent.peer}):y.jsx("span",{className:"mono",children:a.host.parent.peer})]}),a.host&&y.jsxs("span",{className:"muted",title:"which topology guarantees this host actually offers",children:[a.host.capabilities.durability," · cycles ",a.host.capabilities.cycleGuarantee]})]}),p.length===0&&y.jsx("p",{className:"muted",children:"Nothing declares a place on this host yet."}),p.length>0&&y.jsx("ul",{className:"tree",children:p.map(v=>y.jsx(Fy,{namespace:v,childrenOf:d,home:l,peers:n,onSelectPeer:s},v.name))})]})},pl=a=>{if(a?.kind!=="union")return;const n=a.options.filter(s=>s.kind==="literal").map(s=>s.value);return n.length===a.options.length&&n.length>0?n:void 0},Wy=a=>{const n=a.replace(/[\s:]/g,"");if(n.length%2)throw new Error("expected an even number of hex digits");if(n&&!/^[0-9a-fA-F]+$/.test(n))throw new Error("expected hex digits");return Uint8Array.from(n.match(/../g)?.map(s=>parseInt(s,16))??[])},n1=a=>a.options.find(n=>!(n.kind==="literal"&&n.value===null))??a.options[0],ul=(a,n,s=0)=>{const l=gs(Ei(a),n);if(!l||s>4)return null;switch(l.kind){case"number":return l.min??0;case"string":case"bytes":return"";case"boolean":return!1;case"date":return new Date;case"literal":return l.value;case"array":return[];case"record":return{};case"tuple":return l.items.map(o=>ul(o,n,s+1));case"union":return ul(n1(l),n,s+1);case"object":return Object.fromEntries(Object.entries(l.fields).filter(([,o])=>!o.optional).map(([o,f])=>[o,ul(f.type,n,s+1)]));default:return null}},fs=(a,n,s,l=0)=>{const o=gs(n,s);if(!o||a===null||a===void 0||l>8)return a;switch(o.kind){case"date":return typeof a=="string"||typeof a=="number"?new Date(a):a;case"bytes":return typeof a=="string"?Wy(a):a;case"array":return Array.isArray(a)?a.map(f=>fs(f,o.items,s,l+1)):a;case"tuple":return Array.isArray(a)?a.map((f,d)=>fs(f,o.items[d],s,l+1)):a;case"object":return typeof a!="object"||Array.isArray(a)?a:Object.fromEntries(Object.entries(a).map(([f,d])=>[f,fs(d,o.fields[f]?.type,s,l+1)]));case"record":return typeof a!="object"||Array.isArray(a)?a:Object.fromEntries(Object.entries(a).map(([f,d])=>[f,fs(d,o.values,s,l+1)]));case"union":{const f=o.options.filter(d=>!(d.kind==="literal"&&d.value===null));return f.length===1?fs(a,f[0],s,l+1):a}default:return a}},i1=(a,n,s)=>{const l=gs(Ei(n),s),o=a.trim();switch(l?.kind){case"number":{if(o==="")throw new Error("expected a number");const f=Number(o);if(Number.isNaN(f))throw new Error(`${o} is not a number`);return f}case"boolean":return o==="true";case"string":return a;case"date":{const f=new Date(o);if(Number.isNaN(f.getTime()))throw new Error("expected a date");return f}case"bytes":return Wy(o);case"literal":return l.value;default:{if(pl(l)){const d=pl(l).find(p=>String(p)===o);if(d!==void 0)return d}if(o==="")return;let f;try{f=JSON.parse(o)}catch{throw new Error("expected JSON")}return fs(f,Ei(n),s)}}},s1=(a,n)=>{const s=gs(Ei(a),n),l=pl(s);if(l)return String(l[0]);switch(s?.kind){case"number":return String(s.min??0);case"boolean":return"false";case"date":return new Date().toISOString().slice(0,16);case"array":return"[]";case"record":return"{}";case"tuple":case"object":return JSON.stringify(ul(s,n),null,2);default:return""}},a1=({name:a,type:n,types:s,state:l,onChange:o})=>{const f=cl(n),d=gs(Ei(n),s),p=pl(d),g=b=>o({...l,text:b}),v=f&&!l.include,k=()=>{if(p)return y.jsx("select",{className:"control",value:l.text,disabled:v,onChange:b=>g(b.target.value),children:p.map(b=>y.jsx("option",{value:String(b),children:String(b)},String(b)))});switch(d?.kind){case"boolean":return y.jsxs("label",{className:"checkbox",children:[y.jsx("input",{type:"checkbox",checked:l.text==="true",disabled:v,onChange:b=>g(String(b.target.checked))}),y.jsx("span",{children:l.text==="true"?"true":"false"})]});case"number":return y.jsx("input",{className:"control",type:"number",value:l.text,disabled:v,min:d.min,max:d.max,step:d.integer?1:"any",onChange:b=>g(b.target.value)});case"date":return y.jsx("input",{className:"control",type:"datetime-local",value:l.text,disabled:v,onChange:b=>g(b.target.value)});case"string":return y.jsx("input",{className:"control",type:"text",value:l.text,disabled:v,onChange:b=>g(b.target.value)});case"bytes":return y.jsx("input",{className:"control mono",type:"text",placeholder:"hex, e.g. 01 ff 2a",value:l.text,disabled:v,onChange:b=>g(b.target.value)});default:return y.jsx("textarea",{className:"control mono",rows:Math.min(12,Math.max(2,l.text.split(`
|
|
2058
|
+
`).length)),placeholder:"JSON",value:l.text,disabled:v,onChange:b=>g(b.target.value)})}};return y.jsxs("div",{className:`field${v?" off":""}`,children:[y.jsxs("div",{className:"field-label",children:[f&&y.jsx("input",{type:"checkbox",className:"include",checked:l.include,title:"send this argument",onChange:b=>o({...l,include:b.target.checked})}),y.jsxs("span",{className:"name",children:[a,f?"?":""]}),y.jsx("span",{className:"type",children:Wt(Ei(n))})]}),k()]})},Vm=20,r1=(a,n,s,l,o)=>{const f=[...o.broker?["--broker",o.broker]:[],...o.hub?["--hub",o.hub]:[],...o.prefix?["--prefix",o.prefix]:[]],d=p=>{const g=typeof p=="string"?p:JSON.stringify(p);return/^[A-Za-z0-9._@/:+-]+$/.test(g??"")?g:`'${String(g).replace(/'/g,"'\\''")}'`};return["msgrpc","call",a,`${n}.${s}`,...l.map(d),...f].join(" ")},Iy=(a,n)=>`msgrpc.presets.${a}.${n}`,l1=(a,n)=>{try{const s=window.localStorage.getItem(Iy(a,n));return s?JSON.parse(s):[]}catch{return[]}},Xm=(a,n,s)=>{try{window.localStorage.setItem(Iy(a,n),JSON.stringify(s))}catch{}},o1=a=>{if(!a.length)return 0;const n=[...a].sort((s,l)=>s-l);return n[Math.floor(n.length/2)]},c1=({peer:a,namespace:n,method:s,types:l,service:o,network:f})=>{const d=s.params??[],p=s.paramNames??d.map((K,j)=>`argument ${j}`),[g,v]=q.useState(!1),[k,b]=q.useState(()=>d.map(K=>({text:s1(K,l),include:!cl(K)}))),[_,G]=q.useState(!1),[V,J]=q.useState(!1),[F,M]=q.useState(null),[Y,Z]=q.useState([]),[S,A]=q.useState(!1),[$,z]=q.useState(()=>l1(n,s.name)),W=`${s.name}(${s.params?d.map((K,j)=>`${p[j]}${cl(K)?"?":""}: ${Wt(Ei(K))}`).join(", "):"…"})${s.returns?`: ${Wt(s.returns)}`:""}`,P=()=>{const K=d.map((j,X)=>k[X].include?i1(k[X].text,j,l):void 0);for(;K.length&&K[K.length-1]===void 0&&cl(d[K.length-1]);)K.pop();return K},ie=async(K=1)=>{let j;try{j=P()}catch(I){M({ok:!1,text:I.message});return}G(!0),M(null);const X=[];let te=null;try{for(let I=0;I<K;I++){const ae=await o.call(a,n,s.name,j);if(X.push(ae.ms),te=ae.error?{ok:!1,text:`${ae.code?ae.code+": ":""}${ae.error}`}:{ok:!0,text:`${JSON.stringify(ae.result,null,2)??"undefined"}
|
|
2059
2059
|
|
|
2060
|
-
// ${pe.ms} ms`},pe.error)break}z(F)}catch(re){z({ok:!1,text:re.message})}finally{J(re=>[...re,...$].slice(-200)),L(!1)}},xe=()=>{const V=R.map(F=>F.include?F.text:"—").join(", ")||"no arguments",$=[{label:V,texts:R.map(F=>F.text),include:R.map(F=>F.include)},...H.filter(F=>F.label!==V)].slice(0,8);B($),rm(n,a.name,$)},ue=V=>w(R.map((k,$)=>({text:V.texts[$]??k.text,include:V.include[$]??k.include}))),je=V=>{const k=H.filter($=>$.label!==V);B(k),rm(n,a.name,k)},Ge=()=>{let V;try{V=ne()}catch{V=[]}navigator.clipboard?.writeText(Zw(r,n,a.name,V,f)).then(()=>{C(!0),setTimeout(()=>C(!1),1500)})};return g.jsxs("div",{className:`method${y?" open":""}`,children:[g.jsxs("button",{className:"method-head",onClick:()=>b(!y),"aria-expanded":y,children:[g.jsx("span",{className:"chevron",children:y?"▾":"▸"}),g.jsx("code",{children:Q}),a.semantics==="query"&&g.jsx("span",{className:"sem query",children:"query"}),a.semantics==="idempotent-command"&&g.jsx("span",{className:"sem idempotent",children:"idempotent"}),a.semantics==="non-repeatable-command"&&g.jsx("span",{className:"sem once",children:"won't repeat"})]}),y&&g.jsxs("div",{className:"method-body",children:[d.length===0&&g.jsx("p",{className:"muted",children:"No arguments."}),d.map((V,k)=>g.jsx(Kw,{name:m[k],type:V,types:l,state:R[k],onChange:$=>w(R.map((F,re)=>re===k?$:F))},k)),d.length>0&&(H.length>0||R.length>0)&&g.jsxs("div",{className:"presets",children:[H.map(V=>g.jsxs("span",{className:"preset",children:[g.jsx("button",{className:"toggle",onClick:()=>ue(V),title:"put these arguments back in the form",children:V.label}),g.jsx("button",{className:"forget",onClick:()=>je(V.label),title:"forget this one",children:"×"})]},V.label)),g.jsx("button",{className:"toggle",onClick:xe,title:"keep these arguments for next time",children:"save"})]}),a.rest&&g.jsxs("p",{className:"muted",children:["Takes further ",sn(a.rest)," arguments, which this form does not send."]}),!a.params&&g.jsx("p",{className:"muted",children:"No schema describes this method, so its arguments cannot be shown as fields."}),!a.semantics&&g.jsx("p",{className:"muted",children:"The contract does not say what calling this does. Treat it as a command until someone who knows says otherwise."}),K&&g.jsxs("div",{className:"confirm",children:[g.jsxs("span",{children:["Not free to repeat — sent once, it has happened. Send ",g.jsx("code",{children:a.name}),"?"]}),g.jsx("button",{className:"primary",onClick:()=>{P(!1),se()},children:"send once"}),g.jsx("button",{className:"toggle",onClick:()=>P(!1),children:"cancel"})]}),g.jsxs("div",{className:"actions",children:[g.jsx("button",{className:"primary",onClick:()=>a.semantics==="non-repeatable-command"?P(!0):void se(),disabled:j||K,children:j?"calling…":"Call"}),(a.semantics==="query"||a.semantics==="idempotent-command")&&g.jsxs("button",{className:"toggle",onClick:()=>{se(lm)},disabled:j,title:"call it repeatedly and keep the timings",children:["×",lm]}),g.jsx("button",{className:"toggle",onClick:Ge,title:"the command line that makes the same call",children:N?"copied":"copy as CLI"}),X.length>0&&g.jsxs("span",{className:"muted timing",children:[X.length," call",X.length===1?"":"s"," · p50 ",Fw(X)," ms · last ",X[X.length-1]," ms"]})]}),W&&g.jsx("pre",{className:W.ok?"result":"result bad",children:W.text})]})]})},Iw=["POST","SUCCESS","ERROR","EVENT"],Pm=500,Pw=r=>r==="POST"?"→":r==="EVENT"?"⇒":"←",om=r=>`${r.namespace??"?"}.${r.method??r.event??"?"}`,cm=r=>{if(r.params!==void 0)return JSON.stringify(r.params);if(r.result!==void 0)return JSON.stringify(r.result)},eS=({service:r,selected:n,frames:a,onClear:l,paused:u,onPaused:f,hidden:d})=>{const[m,y]=Z.useState(null),[b,R]=Z.useState([]),[w,j]=Z.useState(!1),[L,K]=Z.useState(null),[P,W]=Z.useState(!0),[z,X]=Z.useState(!1),[J,N]=Z.useState([]),[C,H]=Z.useState(""),[B,Q]=Z.useState(new Set),ne=Z.useRef(null);Z.useEffect(()=>{ne.current=m},[m]),Z.useEffect(()=>()=>{ne.current&&r?.untap(ne.current)},[r]);const se=async()=>{if(r){j(!0),K(null);try{const V={payloads:P,...z&&n?{peer:n}:{},...J.length?{kinds:J}:{}},k=await r.tap(V);y(k.token),R(k.sources),k.sources.length||K("Nothing here can watch traffic: no broker exposing a bus, and no MQTT link.")}catch(V){K(V.message)}finally{j(!1)}}},xe=async()=>{if(!(!r||!m)){j(!0);try{await r.untap(m)}catch{}finally{y(null),R([]),j(!1)}}},ue=V=>N(k=>k.includes(V)?k.filter($=>$!==V):[...k,V]),je=C.trim().toLowerCase(),Ge=a.filter(V=>!je||`${V.source} ${V.target} ${om(V)} ${cm(V)??""}`.toLowerCase().includes(je)).slice(0,Pm);return g.jsxs("div",{className:d?"traffic hidden":"traffic",children:[g.jsxs("header",{children:[g.jsx("h1",{children:"Traffic"}),g.jsxs("div",{className:"traffic-actions",children:[a.length>0&&g.jsx("button",{className:"toggle",onClick:l,children:"clear"}),m&&g.jsx("button",{className:u?"toggle on":"toggle",onClick:()=>f(!u),children:u?"paused":"pause"}),g.jsx("button",{className:m?"toggle on":"toggle",onClick:()=>{m?xe():se()},disabled:w||!r,children:w?"…":m?"tapping":"tap"})]})]}),!m&&g.jsxs("div",{className:"tap-setup",children:[g.jsxs("label",{className:"checkbox",children:[g.jsx("input",{type:"checkbox",checked:P,onChange:V=>W(V.target.checked)}),"arguments and results"]}),g.jsxs("label",{className:"checkbox",children:[g.jsx("input",{type:"checkbox",checked:z,disabled:!n,onChange:V=>X(V.target.checked)}),"only ",n??"the selected peer"]}),g.jsxs("div",{className:"kinds",children:[Iw.map(V=>g.jsx("button",{className:J.includes(V)?"toggle on":"toggle",onClick:()=>ue(V),children:V},V)),J.length===0&&g.jsx("span",{className:"muted",children:"all kinds"})]}),g.jsx("p",{className:"muted",children:"Watches what other peers say to each other. It costs something at the other end, so it is off until asked and stops when this tab does."})]}),L&&g.jsx("p",{className:"bad",children:L}),m&&b.length>0&&g.jsxs("p",{className:"muted tap-where",children:["watching via ",g.jsx("span",{className:"mono",children:b.join(", ")}),u&&" · paused"]}),m&&g.jsx("input",{className:"control",placeholder:"filter by peer, method or payload",value:C,onChange:V=>H(V.target.value)}),m&&a.length===0&&g.jsx("p",{className:"muted",children:"Nothing has crossed yet."}),Ge.map((V,k)=>{const $=cm(V),F=B.has(V.at*1e3+k),re=V.at*1e3+k;return g.jsxs("div",{className:`frame ${V.kind.toLowerCase()}`,children:[g.jsxs("div",{className:"frame-head",children:[g.jsx("time",{children:new Date(V.at).toLocaleTimeString()}),g.jsx("span",{className:"arrow",children:Pw(V.kind)}),g.jsxs("span",{className:"mono peers",children:[V.source," → ",V.target]}),g.jsx("code",{children:om(V)}),V.ms!==void 0&&g.jsxs("span",{className:"muted ms",children:[V.ms," ms"]}),V.code&&g.jsx("span",{className:"code",children:V.code})]}),V.error&&g.jsx("p",{className:"frame-error",children:V.error}),$&&g.jsx("pre",{className:F?"frame-payload open":"frame-payload",onClick:()=>Q(pe=>{const S=new Set(pe);return S.has(re)?S.delete(re):S.add(re),S}),children:$})]},`${V.at}-${k}`)})]})},tS=Pm,nS={rejected:"refused before it reached the RPC layer",unroutable:"nowhere to deliver it",peerDisplaced:"two peers are answering to one name",transportError:"the link itself failed"},iS=({problems:r,onClear:n})=>g.jsxs("div",{className:"problems",children:[g.jsxs("header",{children:[g.jsx("h1",{children:"Problems"}),r.length>0&&g.jsx("button",{className:"toggle",onClick:n,children:"clear"})]}),r.length===0&&g.jsx("p",{className:"muted",children:"Nothing refused, undeliverable or displaced. This is where a call that never comes back says why."}),r.map((a,l)=>g.jsxs("div",{className:`problem ${a.kind}`,children:[g.jsxs("div",{className:"problem-head",children:[g.jsx("time",{children:new Date(a.at).toLocaleTimeString()}),g.jsx("span",{className:"kind",children:a.kind}),g.jsxs("span",{className:"muted link",children:["on ",a.link]})]}),g.jsxs("div",{className:"problem-body",children:[a.peer&&g.jsxs("code",{className:"mono",children:[a.peer,a.target?` → ${a.target}`:""]}),g.jsx("p",{children:a.reason??nS[a.kind]??""})]})]},`${a.at}-${l}`))]}),sS=3,aS=({changes:r,onClear:n})=>{const a=new Map;for(const u of r)u.state==="online"&&a.set(u.peer,(a.get(u.peer)??0)+1);const l=[...a.entries()].filter(([,u])=>u>=sS).sort((u,f)=>f[1]-u[1]);return g.jsxs("div",{className:"presence",children:[g.jsxs("header",{children:[g.jsx("h1",{children:"Presence"}),r.length>0&&g.jsx("button",{className:"toggle",onClick:n,children:"clear"})]}),l.length>0&&g.jsx("div",{className:"flapping",children:l.map(([u,f])=>g.jsxs("p",{children:[g.jsx("span",{className:"mono",children:u})," has arrived ",f," times"]},u))}),r.length===0&&g.jsx("p",{className:"muted",children:"Nobody has arrived or left since this console started."}),r.map((u,f)=>g.jsxs("div",{className:`coming ${u.state}`,children:[g.jsx("time",{children:new Date(u.at).toLocaleTimeString()}),g.jsx("span",{className:"mark",children:u.state==="online"?"+":"−"}),g.jsx("span",{className:"mono",children:u.peer}),u.link&&u.link!=="this console"&&g.jsx("span",{className:"muted link",children:u.link})]},`${u.at}-${f}`))]})},um=3,lS=()=>{const[r,n]=Z.useState(null),[a,l]=Z.useState(""),[u,f]=Z.useState("connecting"),d=Z.useRef(null),m=Z.useRef(null),y=Z.useRef(null),b=Z.useRef(null),R=Z.useRef(null),w=Z.useRef(null);return Z.useEffect(()=>{let j,L=0,K=!1;const P=()=>{j?.close()};window.addEventListener("pagehide",P);const W=async()=>{try{const z=await Yw(),X=zw();l(X),j=new Rw({name:X,transports:[{connect:window.location.origin,path:Vw()}],readyTimeout:1e4,schema:Dw,exposeIntrospection:!0}),j.exposeClassInstance(new cs((B,Q)=>y.current?.(B,Q)));const J=j.transports[0];J?.on(_e.disconnected,()=>f("reconnecting")),J?.on(_e.connected,()=>f("connected")),await j.ready();for(const B of j.transports)B.on(_e.disconnected,()=>f("reconnecting")),B.on(_e.connected,()=>f("connected"));w.current=j;const N=await j.proxy("console",z);await N.on("event",B=>d.current?.(B)),await N.on("peer",B=>{const Q=B;m.current?.(Q.peer,Q.state,Q)}),await N.on("frame",B=>b.current?.(B)),await N.on("problem",B=>R.current?.(B));const C=N,{callTimeout:H}=await C.peers();H&&(j.caller.callTimeout=H+5e3),n(C),f("connected")}catch(z){if(K)return;if(await j?.close().catch(()=>{}),j=void 0,++L<=um){f(`cannot reach the console, trying again (${L}/${um})`),await new Promise(X=>setTimeout(X,L*1e3)),K||await W();return}f(`cannot reach the console: ${z.message}`)}};return W(),()=>{K=!0,window.removeEventListener("pagehide",P),j?.close()}},[]),{service:r,status:u,me:a,events:d,peerChange:m,said:y,frames:b,problems:R,peer:w}},rS=(r,n)=>{const a=new Blob([r.map(f=>JSON.stringify(f)).join(`
|
|
2060
|
+
// ${ae.ms} ms`},ae.error)break}M(te)}catch(I){M({ok:!1,text:I.message})}finally{Z(I=>[...I,...X].slice(-200)),G(!1)}},de=()=>{const K=k.map(te=>te.include?te.text:"—").join(", ")||"no arguments",X=[{label:K,texts:k.map(te=>te.text),include:k.map(te=>te.include)},...$.filter(te=>te.label!==K)].slice(0,8);z(X),Xm(n,s.name,X)},le=K=>b(k.map((j,X)=>({text:K.texts[X]??j.text,include:K.include[X]??j.include}))),fe=K=>{const j=$.filter(X=>X.label!==K);z(j),Xm(n,s.name,j)},Ce=()=>{let K;try{K=P()}catch{K=[]}navigator.clipboard?.writeText(r1(a,n,s.name,K,f)).then(()=>{A(!0),setTimeout(()=>A(!1),1500)})};return y.jsxs("div",{className:`method${g?" open":""}`,children:[y.jsxs("button",{className:"method-head",onClick:()=>v(!g),"aria-expanded":g,children:[y.jsx("span",{className:"chevron",children:g?"▾":"▸"}),y.jsx("code",{children:W}),s.semantics==="query"&&y.jsx("span",{className:"sem query",children:"query"}),s.semantics==="idempotent-command"&&y.jsx("span",{className:"sem idempotent",children:"idempotent"}),s.semantics==="non-repeatable-command"&&y.jsx("span",{className:"sem once",children:"won't repeat"})]}),g&&y.jsxs("div",{className:"method-body",children:[d.length===0&&y.jsx("p",{className:"muted",children:"No arguments."}),d.map((K,j)=>y.jsx(a1,{name:p[j],type:K,types:l,state:k[j],onChange:X=>b(k.map((te,I)=>I===j?X:te))},j)),d.length>0&&($.length>0||k.length>0)&&y.jsxs("div",{className:"presets",children:[$.map(K=>y.jsxs("span",{className:"preset",children:[y.jsx("button",{className:"toggle",onClick:()=>le(K),title:"put these arguments back in the form",children:K.label}),y.jsx("button",{className:"forget",onClick:()=>fe(K.label),title:"forget this one",children:"×"})]},K.label)),y.jsx("button",{className:"toggle",onClick:de,title:"keep these arguments for next time",children:"save"})]}),s.rest&&y.jsxs("p",{className:"muted",children:["Takes further ",Wt(s.rest)," arguments, which this form does not send."]}),!s.params&&y.jsx("p",{className:"muted",children:"No schema describes this method, so its arguments cannot be shown as fields."}),!s.semantics&&y.jsx("p",{className:"muted",children:"The contract does not say what calling this does. Treat it as a command until someone who knows says otherwise."}),V&&y.jsxs("div",{className:"confirm",children:[y.jsxs("span",{children:["Not free to repeat — sent once, it has happened. Send ",y.jsx("code",{children:s.name}),"?"]}),y.jsx("button",{className:"primary",onClick:()=>{J(!1),ie()},children:"send once"}),y.jsx("button",{className:"toggle",onClick:()=>J(!1),children:"cancel"})]}),y.jsxs("div",{className:"actions",children:[y.jsx("button",{className:"primary",onClick:()=>s.semantics==="non-repeatable-command"?J(!0):void ie(),disabled:_||V,children:_?"calling…":"Call"}),(s.semantics==="query"||s.semantics==="idempotent-command")&&y.jsxs("button",{className:"toggle",onClick:()=>{ie(Vm)},disabled:_,title:"call it repeatedly and keep the timings",children:["×",Vm]}),y.jsx("button",{className:"toggle",onClick:Ce,title:"the command line that makes the same call",children:S?"copied":"copy as CLI"}),Y.length>0&&y.jsxs("span",{className:"muted timing",children:[Y.length," call",Y.length===1?"":"s"," · p50 ",o1(Y)," ms · last ",Y[Y.length-1]," ms"]})]}),F&&y.jsx("pre",{className:F.ok?"result":"result bad",children:F.text})]})]})},u1=["POST","SUCCESS","ERROR","EVENT"],Py=500,f1=a=>a==="POST"?"→":a==="EVENT"?"⇒":"←",Km=a=>`${a.namespace??"?"}.${a.method??a.event??"?"}`,Qm=a=>{if(a.params!==void 0)return JSON.stringify(a.params);if(a.result!==void 0)return JSON.stringify(a.result)},d1=({service:a,selected:n,frames:s,onClear:l,paused:o,onPaused:f,hidden:d})=>{const[p,g]=q.useState(null),[v,k]=q.useState([]),[b,_]=q.useState(!1),[G,V]=q.useState(null),[J,F]=q.useState(!0),[M,Y]=q.useState(!1),[Z,S]=q.useState([]),[A,$]=q.useState(""),[z,W]=q.useState(new Set),P=q.useRef(null);q.useEffect(()=>{P.current=p},[p]),q.useEffect(()=>()=>{P.current&&a?.untap(P.current)},[a]);const ie=async()=>{if(a){_(!0),V(null);try{const K={payloads:J,...M&&n?{peer:n}:{},...Z.length?{kinds:Z}:{}},j=await a.tap(K);g(j.token),k(j.sources),j.sources.length||V("Nothing here can watch traffic: no broker exposing a bus, and no MQTT link.")}catch(K){V(K.message)}finally{_(!1)}}},de=async()=>{if(!(!a||!p)){_(!0);try{await a.untap(p)}catch{}finally{g(null),k([]),_(!1)}}},le=K=>S(j=>j.includes(K)?j.filter(X=>X!==K):[...j,K]),fe=A.trim().toLowerCase(),Ce=s.filter(K=>!fe||`${K.source} ${K.target} ${Km(K)} ${Qm(K)??""}`.toLowerCase().includes(fe)).slice(0,Py);return y.jsxs("div",{className:d?"traffic hidden":"traffic",children:[y.jsxs("header",{children:[y.jsx("h1",{children:"Traffic"}),y.jsxs("div",{className:"traffic-actions",children:[s.length>0&&y.jsx("button",{className:"toggle",onClick:l,children:"clear"}),p&&y.jsx("button",{className:o?"toggle on":"toggle",onClick:()=>f(!o),children:o?"paused":"pause"}),y.jsx("button",{className:p?"toggle on":"toggle",onClick:()=>{p?de():ie()},disabled:b||!a,children:b?"…":p?"tapping":"tap"})]})]}),!p&&y.jsxs("div",{className:"tap-setup",children:[y.jsxs("label",{className:"checkbox",children:[y.jsx("input",{type:"checkbox",checked:J,onChange:K=>F(K.target.checked)}),"arguments and results"]}),y.jsxs("label",{className:"checkbox",children:[y.jsx("input",{type:"checkbox",checked:M,disabled:!n,onChange:K=>Y(K.target.checked)}),"only ",n??"the selected peer"]}),y.jsxs("div",{className:"kinds",children:[u1.map(K=>y.jsx("button",{className:Z.includes(K)?"toggle on":"toggle",onClick:()=>le(K),children:K},K)),Z.length===0&&y.jsx("span",{className:"muted",children:"all kinds"})]}),y.jsx("p",{className:"muted",children:"Watches what other peers say to each other. It costs something at the other end, so it is off until asked and stops when this tab does."})]}),G&&y.jsx("p",{className:"bad",children:G}),p&&v.length>0&&y.jsxs("p",{className:"muted tap-where",children:["watching via ",y.jsx("span",{className:"mono",children:v.join(", ")}),o&&" · paused"]}),p&&y.jsx("input",{className:"control",placeholder:"filter by peer, method or payload",value:A,onChange:K=>$(K.target.value)}),p&&s.length===0&&y.jsx("p",{className:"muted",children:"Nothing has crossed yet."}),Ce.map((K,j)=>{const X=Qm(K),te=z.has(K.at*1e3+j),I=K.at*1e3+j;return y.jsxs("div",{className:`frame ${K.kind.toLowerCase()}`,children:[y.jsxs("div",{className:"frame-head",children:[y.jsx("time",{children:new Date(K.at).toLocaleTimeString()}),y.jsx("span",{className:"arrow",children:f1(K.kind)}),y.jsxs("span",{className:"mono peers",children:[K.source," → ",K.target]}),y.jsx("code",{children:Km(K)}),K.ms!==void 0&&y.jsxs("span",{className:"muted ms",children:[K.ms," ms"]}),K.code&&y.jsx("span",{className:"code",children:K.code})]}),K.error&&y.jsx("p",{className:"frame-error",children:K.error}),X&&y.jsx("pre",{className:te?"frame-payload open":"frame-payload",onClick:()=>W(ae=>{const x=new Set(ae);return x.has(I)?x.delete(I):x.add(I),x}),children:X})]},`${K.at}-${j}`)})]})},h1=Py,p1={rejected:"refused before it reached the RPC layer",unroutable:"nowhere to deliver it",peerDisplaced:"two peers are answering to one name",transportError:"the link itself failed"},m1=({problems:a,onClear:n})=>y.jsxs("div",{className:"problems",children:[y.jsxs("header",{children:[y.jsx("h1",{children:"Problems"}),a.length>0&&y.jsx("button",{className:"toggle",onClick:n,children:"clear"})]}),a.length===0&&y.jsx("p",{className:"muted",children:"Nothing refused, undeliverable or displaced. This is where a call that never comes back says why."}),a.map((s,l)=>y.jsxs("div",{className:`problem ${s.kind}`,children:[y.jsxs("div",{className:"problem-head",children:[y.jsx("time",{children:new Date(s.at).toLocaleTimeString()}),y.jsx("span",{className:"kind",children:s.kind}),y.jsxs("span",{className:"muted link",children:["on ",s.link]})]}),y.jsxs("div",{className:"problem-body",children:[s.peer&&y.jsxs("code",{className:"mono",children:[s.peer,s.target?` → ${s.target}`:""]}),y.jsx("p",{children:s.reason??p1[s.kind]??""})]})]},`${s.at}-${l}`))]}),y1=3,g1=({changes:a,onClear:n})=>{const s=new Map;for(const o of a)o.state==="online"&&s.set(o.peer,(s.get(o.peer)??0)+1);const l=[...s.entries()].filter(([,o])=>o>=y1).sort((o,f)=>f[1]-o[1]);return y.jsxs("div",{className:"presence",children:[y.jsxs("header",{children:[y.jsx("h1",{children:"Presence"}),a.length>0&&y.jsx("button",{className:"toggle",onClick:n,children:"clear"})]}),l.length>0&&y.jsx("div",{className:"flapping",children:l.map(([o,f])=>y.jsxs("p",{children:[y.jsx("span",{children:Na(o)})," ",y.jsx("span",{className:"mono small-id",children:o})," has arrived ",f," times"]},o))}),a.length===0&&y.jsx("p",{className:"muted",children:"Nobody has arrived or left since this console started."}),a.map((o,f)=>y.jsxs("div",{className:`coming ${o.state}`,children:[y.jsx("time",{children:new Date(o.at).toLocaleTimeString()}),y.jsx("span",{className:"mark",children:o.state==="online"?"+":"−"}),y.jsxs("span",{className:"presence-peer",children:[y.jsx("span",{children:Na(o.peer)}),y.jsx("span",{className:"mono small-id",children:o.peer})]}),o.link&&o.link!=="this console"&&y.jsx("span",{className:"muted link",children:o.link})]},`${o.at}-${f}`))]})},Zm=3,v1=()=>{const[a,n]=q.useState(null),[s,l]=q.useState(""),[o,f]=q.useState("connecting"),d=q.useRef(null),p=q.useRef(null),g=q.useRef(null),v=q.useRef(null),k=q.useRef(null),b=q.useRef(null);return q.useEffect(()=>{let _,G=0,V=!1;const J=()=>{_?.close()};window.addEventListener("pagehide",J);const F=async()=>{try{const M=await gS(),Y=fS();l(Y),_=new uS({name:Y,transports:[{connect:window.location.origin,path:vS()}],readyTimeout:1e4,schema:mS,exposeIntrospection:!0}),_.exposeClassInstance(new us((z,W)=>g.current?.(z,W)));const Z=_.transports[0];Z?.on(ve.disconnected,()=>f("reconnecting")),Z?.on(ve.connected,()=>f("connected")),await _.ready();for(const z of _.transports)z.on(ve.disconnected,()=>f("reconnecting")),z.on(ve.connected,()=>f("connected"));b.current=_;const S=await _.proxy("console",M);await S.on("event",z=>d.current?.(z)),await S.on("peer",z=>{const W=z;p.current?.(W.peer,W.state,W)}),await S.on("frame",z=>v.current?.(z)),await S.on("problem",z=>k.current?.(z));const A=S,{callTimeout:$}=await A.peers();$&&(_.caller.callTimeout=$+5e3),n(A),f("connected")}catch(M){if(V)return;if(await _?.close().catch(()=>{}),_=void 0,++G<=Zm){f(`cannot reach the console, trying again (${G}/${Zm})`),await new Promise(Y=>setTimeout(Y,G*1e3)),V||await F();return}f(`cannot reach the console: ${M.message}`)}};return F(),()=>{V=!0,window.removeEventListener("pagehide",J),_?.close()}},[]),{service:a,status:o,me:s,events:d,peerChange:p,said:g,frames:v,problems:k,peer:b}},b1=(a,n)=>{const s=new Blob([a.map(f=>JSON.stringify(f)).join(`
|
|
2061
2061
|
`)+`
|
|
2062
|
-
`],{type:"application/x-ndjson"}),l=URL.createObjectURL(
|
|
2062
|
+
`],{type:"application/x-ndjson"}),l=URL.createObjectURL(s),o=document.createElement("a");o.href=l,o.download=n,o.click(),URL.revokeObjectURL(l)},w1=()=>{const{service:a,status:n,me:s,events:l,peerChange:o,said:f,frames:d,problems:p,peer:g}=v1(),[v,k]=q.useState({}),[b,_]=q.useState({}),[G,V]=q.useState([]),[J,F]=q.useState(new Set),[M,Y]=q.useState(null),[Z,S]=q.useState(null),[A,$]=q.useState(new Set),[z,W]=q.useState([]),[P,ie]=q.useState("events"),[de,le]=q.useState([]),[fe,Ce]=q.useState(!1),[K,j]=q.useState([]),[X,te]=q.useState({}),[I,ae]=q.useState({}),[x,D]=q.useState({}),[Q,ee]=q.useState({}),[ce,pe]=q.useState([]),[Ae,it]=q.useState(""),[Be,ni]=q.useState(!1),en=q.useCallback(async()=>{if(!a)return;const H=await a.peers();V(H.peers),$(new Set(H.watching)),te(H.links??{}),ae(H.network??{}),D(H.roles??{}),ee(H.structure??{})},[a]);q.useEffect(()=>{s&&(document.title=s)},[s]),q.useEffect(()=>{f.current=(H,oe)=>{k($e=>({...$e,[H]:[...$e[H]??[],{from:H,text:oe,at:Date.now(),mine:!1}]})),_($e=>({...$e,[H]:($e[H]??0)+1}))}},[f]),q.useEffect(()=>{P!=="chat"||!M||_(H=>H[M]?{...H,[M]:0}:H)},[P,M,v]);const vs=async H=>{if(!g.current||!M)return"not connected";k(oe=>({...oe,[M]:[...oe[M]??[],{from:s,text:H,at:Date.now(),mine:!0}]}));try{await(await g.current.proxy("chat",M)).say(s,H);return}catch(oe){return`${M} did not take it: ${oe.message??String(oe)}`}};q.useEffect(()=>{en(),l.current=H=>{Be||W(oe=>[H,...oe].slice(0,500))},o.current=(H,oe,$e)=>{if(oe==="reshaped"){en(),a&&H===M&&a.describe(H).then(S).catch(()=>{});return}F(be=>{const st=new Set(be);return oe==="offline"?st.add(H):st.delete(H),st}),pe(be=>[$e,...be].slice(0,200)),en()}},[a,en,l,o,Be,M]),q.useEffect(()=>{d.current=H=>{fe||le(oe=>[H,...oe].slice(0,h1))}},[d,fe]),q.useEffect(()=>{p.current=H=>j(oe=>[H,...oe].slice(0,200)),a&&a.problems().then(({problems:H})=>j(H)).catch(()=>{}),a&&a.presence().then(({changes:H})=>pe(H)).catch(()=>{})},[a,p]);const bs=async H=>{Y(H),S(null),a&&(S(await a.describe(H)),await en())},cn=async(H,oe)=>{if(!(!a||!M)){for(const $e of oe){if(A.has(`${M}/${H}/${$e.name}`))continue;(await a.watch(M,H,$e.name)).watching&&$(st=>new Set(st).add(`${M}/${H}/${$e.name}`))}S(await a.describe(M))}},ws=async(H,oe)=>{if(!a||!M)return;const $e=`${M}/${H}/${oe.name}`,be=A.has($e)?await a.unwatch(M,H,oe.name):await a.watch(M,H,oe.name);$(st=>{const Qe=new Set(st);return be.watching?Qe.add($e):Qe.delete($e),Qe}),M&&S(await a.describe(M))},ii=Z&&"error"in Z?Z:null,dt=Z&&!("error"in Z)?Z:null,xs=Object.values(b).reduce((H,oe)=>H+oe,0);return y.jsxs("div",{className:"app",children:[y.jsxs("aside",{children:[y.jsxs("div",{className:"identity",children:[y.jsx("span",{className:"muted",children:"this page is"}),y.jsx("span",{className:"name",children:s?Na(s):"…"}),s&&y.jsx("span",{className:"mono small-id",title:"the peer name this page serves and calls under",children:s})]}),y.jsxs("header",{children:[y.jsx("h1",{children:"Peers"}),y.jsx("span",{className:`status ${n==="connected"?"ok":"warn"}`,children:n})]}),G.length===0&&y.jsx("p",{className:"muted",children:"Waiting for a peer to announce itself…"}),(()=>{const H=new Set(G),oe=G.filter(be=>{const st=Q[be]?.parent;return!st||st===be||!H.has(st)}),$e=(be,st,Qe)=>y.jsxs("div",{children:[y.jsxs("button",{className:`peer${be===M?" selected":""}`,style:st>0?{paddingLeft:10+st*14}:void 0,onClick:()=>{bs(be)},children:[y.jsx("span",{className:`dot${J.has(be)?" off":""}`}),y.jsxs("span",{className:"peer-lines",children:[y.jsxs("span",{className:"peer-primary",children:[y.jsx("span",{className:"peer-display",children:Ym(be,Q[be])}),y.jsx("span",{className:"peer-id mono",children:be}),be===s&&y.jsx("span",{className:"you",children:"you"}),b[be]>0&&y.jsx("span",{className:"count",children:b[be]}),x[be]&&y.jsx("span",{className:`role ${x[be]}`,children:x[be]==="undescribed"?"no contract":x[be]}),X[be]&&X[be]!=="this console"&&y.jsx("span",{className:"link",children:X[be]})]}),Q[be]?.place&&y.jsx("span",{className:"peer-place",children:Q[be]?.place?.join(" / ")??""})]})]}),!Qe.has(be)&&G.filter(ki=>Q[ki]?.parent===be&&ki!==be).map(ki=>$e(ki,st+1,new Set([...Qe,be])))]},be);return oe.map(be=>$e(be,0,new Set))})()]}),y.jsxs("main",{children:[!M&&y.jsx("p",{className:"muted",children:"Select a peer to see what it exposes."}),M&&!Z&&y.jsxs("p",{className:"muted",children:["Describing ",M,"…"]}),ii&&y.jsxs("div",{className:"notice",children:[y.jsx("strong",{children:ii.code??"Error"}),y.jsx("p",{children:ii.error}),y.jsx("p",{className:"muted",children:"A server answers this only when it is started with exposeIntrospection."})]}),dt&&y.jsxs(y.Fragment,{children:[y.jsxs("header",{className:"peer-head",children:[y.jsxs("h1",{children:[y.jsx("span",{children:Ym(dt.name,Q[dt.name])}),y.jsx("span",{className:"entity-id mono",children:dt.name})]}),y.jsxs("span",{className:"muted",children:[dt.version?`contract ${dt.version} · `:"",dt.validating?"arguments checked":"arguments not checked"]})]}),dt.elevated?.length?y.jsxs("div",{className:"elevated",role:"alert",children:[y.jsx("strong",{children:"elevated"}),dt.elevated.map(H=>y.jsxs("span",{className:`elevation${H.until===void 0?" unbounded":""}`,children:[y.jsx("span",{className:"mono",children:H.capability}),H.reason?` — ${H.reason}`:"",H.until===void 0?" · until someone closes it":` · until ${new Date(H.until).toLocaleTimeString()}`,H.grantedBy?` · by ${H.grantedBy}`:""]},H.capability))]}):null,y.jsx(t1,{description:dt,peers:G,onSelectPeer:H=>{bs(H)}}),dt.namespaces.map(H=>y.jsxs("section",{className:"namespace",children:[y.jsxs("h2",{children:[y.jsxs("span",{className:"entity-title",children:[y.jsx("span",{children:Jy(H)}),y.jsx("span",{className:"entity-id mono",children:H.name})]}),H.version&&y.jsxs("span",{className:"badge",children:["@",H.version]}),y.jsxs("span",{className:"muted mono",children:[H.className,H.created?" · created at runtime":""]}),H.capabilities?.map(oe=>y.jsx("span",{className:"capability",title:"implements this contract interface",children:oe},oe))]}),H.component&&y.jsx(XS,{peer:M,namespace:H.name,component:H.component,methods:H.methods,types:dt.types,server:g,onSubscribed:()=>{a&&M&&a.describe(M).then(S).catch(()=>{})}}),H.topology&&y.jsx(FS,{peer:M,node:H.name,server:g}),H.methods.map(oe=>y.jsx(c1,{peer:M,namespace:H.name,method:oe,types:dt.types,service:a,network:I},oe.name)),H.events.length>0&&y.jsxs("div",{className:"events",children:[y.jsxs("h3",{children:["events",H.events.some(oe=>!A.has(`${M}/${H.name}/${oe.name}`))&&y.jsx("button",{className:"toggle",onClick:()=>{cn(H.name,H.events)},children:"watch all"})]}),H.events.map(oe=>{const $e=A.has(`${M}/${H.name}/${oe.name}`);return y.jsxs("div",{className:"event-row",children:[y.jsxs("code",{children:[oe.name,"(",oe.params?oe.params.map(Wt).join(", "):"…",")"]}),y.jsx("button",{className:$e?"toggle on":"toggle",onClick:()=>{ws(H.name,oe)},children:$e?"unwatch":"watch"}),y.jsxs("span",{className:"muted",children:[oe.subscribers," subscriber",oe.subscribers===1?"":"s"]})]},oe.name)})]})]},H.name))]})]}),y.jsxs("section",{className:"side",children:[y.jsx("nav",{className:"tabs",children:["events","traffic","problems","presence","chat"].map(H=>y.jsxs("button",{className:P===H?"tab on":"tab",onClick:()=>ie(H),children:[H,H==="traffic"&&de.length>0&&y.jsx("span",{className:"count",children:de.length}),H==="problems"&&K.length>0&&y.jsx("span",{className:"count bad",children:K.length}),H==="chat"&&xs>0&&y.jsx("span",{className:"count",children:xs})]},H))}),P==="chat"&&y.jsx(dS,{peer:M,messages:M?v[M]??[]:[],onSend:vs}),P==="problems"&&y.jsx(m1,{problems:K,onClear:()=>j([])}),P==="presence"&&y.jsx(g1,{changes:ce,onClear:()=>pe([])}),y.jsx(d1,{service:a,selected:M,frames:de,onClear:()=>le([]),paused:fe,onPaused:Ce,hidden:P!=="traffic"}),P==="events"&&y.jsxs("div",{className:"stream",children:[y.jsxs("header",{children:[y.jsx("h1",{children:"Events"}),y.jsxs("div",{className:"traffic-actions",children:[z.length>0&&y.jsx("button",{className:"toggle",onClick:()=>b1(z,"events.jsonl"),title:"save what is here as jsonl",children:"export"}),z.length>0&&y.jsx("button",{className:"toggle",onClick:()=>W([]),children:"clear"}),y.jsx("button",{className:Be?"toggle on":"toggle",onClick:()=>ni(!Be),children:Be?"paused":"pause"})]})]}),z.length>0&&y.jsx("input",{className:"control",placeholder:"filter by peer, event or payload",value:Ae,onChange:H=>it(H.target.value)}),z.length===0&&y.jsx("p",{className:"muted",children:"Watch an event to see it here."}),z.filter(H=>{const oe=Ae.trim().toLowerCase();return!oe||`${H.peer} ${H.namespace}.${H.event} ${JSON.stringify(H.args)}`.toLowerCase().includes(oe)}).map((H,oe)=>y.jsxs("div",{className:"streamed",children:[y.jsx("time",{children:new Date(H.at).toLocaleTimeString()}),y.jsxs("code",{children:[H.peer,"/",H.namespace,".",H.event]}),y.jsx("pre",{children:JSON.stringify(H.args)})]},`${H.at}-${oe}`))]})]})]})};U0.createRoot(document.getElementById("root")).render(y.jsx(q.StrictMode,{children:y.jsx(w1,{})}));
|
|
2063
2063
|
//# sourceMappingURL=app.js.map
|